index.full.js 1.9 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762
  1. /*! Element Plus v2.2.27 */
  2. (function (global, factory) {
  3. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
  4. typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
  5. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ElementPlus = {}, global.Vue));
  6. })(this, (function (exports, vue) { 'use strict';
  7. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  8. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  9. var root = freeGlobal || freeSelf || Function("return this")();
  10. var Symbol$1 = root.Symbol;
  11. var objectProto$s = Object.prototype;
  12. var hasOwnProperty$p = objectProto$s.hasOwnProperty;
  13. var nativeObjectToString$3 = objectProto$s.toString;
  14. var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
  15. function getRawTag(value) {
  16. var isOwn = hasOwnProperty$p.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  17. try {
  18. value[symToStringTag$1] = void 0;
  19. var unmasked = true;
  20. } catch (e) {
  21. }
  22. var result = nativeObjectToString$3.call(value);
  23. if (unmasked) {
  24. if (isOwn) {
  25. value[symToStringTag$1] = tag;
  26. } else {
  27. delete value[symToStringTag$1];
  28. }
  29. }
  30. return result;
  31. }
  32. var objectProto$r = Object.prototype;
  33. var nativeObjectToString$2 = objectProto$r.toString;
  34. function objectToString$1(value) {
  35. return nativeObjectToString$2.call(value);
  36. }
  37. var nullTag = "[object Null]";
  38. var undefinedTag = "[object Undefined]";
  39. var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
  40. function baseGetTag(value) {
  41. if (value == null) {
  42. return value === void 0 ? undefinedTag : nullTag;
  43. }
  44. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString$1(value);
  45. }
  46. function isObjectLike(value) {
  47. return value != null && typeof value == "object";
  48. }
  49. var symbolTag$3 = "[object Symbol]";
  50. function isSymbol(value) {
  51. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
  52. }
  53. var NAN$2 = 0 / 0;
  54. function baseToNumber(value) {
  55. if (typeof value == "number") {
  56. return value;
  57. }
  58. if (isSymbol(value)) {
  59. return NAN$2;
  60. }
  61. return +value;
  62. }
  63. function arrayMap(array, iteratee) {
  64. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  65. while (++index < length) {
  66. result[index] = iteratee(array[index], index, array);
  67. }
  68. return result;
  69. }
  70. var isArray$1 = Array.isArray;
  71. var INFINITY$5 = 1 / 0;
  72. var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0;
  73. var symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
  74. function baseToString(value) {
  75. if (typeof value == "string") {
  76. return value;
  77. }
  78. if (isArray$1(value)) {
  79. return arrayMap(value, baseToString) + "";
  80. }
  81. if (isSymbol(value)) {
  82. return symbolToString ? symbolToString.call(value) : "";
  83. }
  84. var result = value + "";
  85. return result == "0" && 1 / value == -INFINITY$5 ? "-0" : result;
  86. }
  87. function createMathOperation(operator, defaultValue) {
  88. return function(value, other) {
  89. var result;
  90. if (value === void 0 && other === void 0) {
  91. return defaultValue;
  92. }
  93. if (value !== void 0) {
  94. result = value;
  95. }
  96. if (other !== void 0) {
  97. if (result === void 0) {
  98. return other;
  99. }
  100. if (typeof value == "string" || typeof other == "string") {
  101. value = baseToString(value);
  102. other = baseToString(other);
  103. } else {
  104. value = baseToNumber(value);
  105. other = baseToNumber(other);
  106. }
  107. result = operator(value, other);
  108. }
  109. return result;
  110. };
  111. }
  112. var add = createMathOperation(function(augend, addend) {
  113. return augend + addend;
  114. }, 0);
  115. var reWhitespace = /\s/;
  116. function trimmedEndIndex(string) {
  117. var index = string.length;
  118. while (index-- && reWhitespace.test(string.charAt(index))) {
  119. }
  120. return index;
  121. }
  122. var reTrimStart$2 = /^\s+/;
  123. function baseTrim(string) {
  124. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart$2, "") : string;
  125. }
  126. function isObject$2(value) {
  127. var type = typeof value;
  128. return value != null && (type == "object" || type == "function");
  129. }
  130. var NAN$1 = 0 / 0;
  131. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  132. var reIsBinary = /^0b[01]+$/i;
  133. var reIsOctal = /^0o[0-7]+$/i;
  134. var freeParseInt = parseInt;
  135. function toNumber(value) {
  136. if (typeof value == "number") {
  137. return value;
  138. }
  139. if (isSymbol(value)) {
  140. return NAN$1;
  141. }
  142. if (isObject$2(value)) {
  143. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  144. value = isObject$2(other) ? other + "" : other;
  145. }
  146. if (typeof value != "string") {
  147. return value === 0 ? value : +value;
  148. }
  149. value = baseTrim(value);
  150. var isBinary = reIsBinary.test(value);
  151. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN$1 : +value;
  152. }
  153. var INFINITY$4 = 1 / 0;
  154. var MAX_INTEGER = 17976931348623157e292;
  155. function toFinite(value) {
  156. if (!value) {
  157. return value === 0 ? value : 0;
  158. }
  159. value = toNumber(value);
  160. if (value === INFINITY$4 || value === -INFINITY$4) {
  161. var sign = value < 0 ? -1 : 1;
  162. return sign * MAX_INTEGER;
  163. }
  164. return value === value ? value : 0;
  165. }
  166. function toInteger(value) {
  167. var result = toFinite(value), remainder = result % 1;
  168. return result === result ? remainder ? result - remainder : result : 0;
  169. }
  170. var FUNC_ERROR_TEXT$b = "Expected a function";
  171. function after(n, func) {
  172. if (typeof func != "function") {
  173. throw new TypeError(FUNC_ERROR_TEXT$b);
  174. }
  175. n = toInteger(n);
  176. return function() {
  177. if (--n < 1) {
  178. return func.apply(this, arguments);
  179. }
  180. };
  181. }
  182. function identity$1(value) {
  183. return value;
  184. }
  185. var asyncTag = "[object AsyncFunction]";
  186. var funcTag$2 = "[object Function]";
  187. var genTag$1 = "[object GeneratorFunction]";
  188. var proxyTag = "[object Proxy]";
  189. function isFunction$1(value) {
  190. if (!isObject$2(value)) {
  191. return false;
  192. }
  193. var tag = baseGetTag(value);
  194. return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
  195. }
  196. var coreJsData = root["__core-js_shared__"];
  197. var maskSrcKey = function() {
  198. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  199. return uid ? "Symbol(src)_1." + uid : "";
  200. }();
  201. function isMasked(func) {
  202. return !!maskSrcKey && maskSrcKey in func;
  203. }
  204. var funcProto$2 = Function.prototype;
  205. var funcToString$2 = funcProto$2.toString;
  206. function toSource(func) {
  207. if (func != null) {
  208. try {
  209. return funcToString$2.call(func);
  210. } catch (e) {
  211. }
  212. try {
  213. return func + "";
  214. } catch (e) {
  215. }
  216. }
  217. return "";
  218. }
  219. var reRegExpChar$1 = /[\\^$.*+?()[\]{}|]/g;
  220. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  221. var funcProto$1 = Function.prototype;
  222. var objectProto$q = Object.prototype;
  223. var funcToString$1 = funcProto$1.toString;
  224. var hasOwnProperty$o = objectProto$q.hasOwnProperty;
  225. var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$o).replace(reRegExpChar$1, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
  226. function baseIsNative(value) {
  227. if (!isObject$2(value) || isMasked(value)) {
  228. return false;
  229. }
  230. var pattern = isFunction$1(value) ? reIsNative : reIsHostCtor;
  231. return pattern.test(toSource(value));
  232. }
  233. function getValue$1(object, key) {
  234. return object == null ? void 0 : object[key];
  235. }
  236. function getNative(object, key) {
  237. var value = getValue$1(object, key);
  238. return baseIsNative(value) ? value : void 0;
  239. }
  240. var WeakMap = getNative(root, "WeakMap");
  241. var metaMap = WeakMap && new WeakMap();
  242. var baseSetData = !metaMap ? identity$1 : function(func, data) {
  243. metaMap.set(func, data);
  244. return func;
  245. };
  246. var objectCreate = Object.create;
  247. var baseCreate = function() {
  248. function object() {
  249. }
  250. return function(proto) {
  251. if (!isObject$2(proto)) {
  252. return {};
  253. }
  254. if (objectCreate) {
  255. return objectCreate(proto);
  256. }
  257. object.prototype = proto;
  258. var result = new object();
  259. object.prototype = void 0;
  260. return result;
  261. };
  262. }();
  263. function createCtor(Ctor) {
  264. return function() {
  265. var args = arguments;
  266. switch (args.length) {
  267. case 0:
  268. return new Ctor();
  269. case 1:
  270. return new Ctor(args[0]);
  271. case 2:
  272. return new Ctor(args[0], args[1]);
  273. case 3:
  274. return new Ctor(args[0], args[1], args[2]);
  275. case 4:
  276. return new Ctor(args[0], args[1], args[2], args[3]);
  277. case 5:
  278. return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  279. case 6:
  280. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  281. case 7:
  282. return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  283. }
  284. var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args);
  285. return isObject$2(result) ? result : thisBinding;
  286. };
  287. }
  288. var WRAP_BIND_FLAG$8 = 1;
  289. function createBind(func, bitmask, thisArg) {
  290. var isBind = bitmask & WRAP_BIND_FLAG$8, Ctor = createCtor(func);
  291. function wrapper() {
  292. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  293. return fn.apply(isBind ? thisArg : this, arguments);
  294. }
  295. return wrapper;
  296. }
  297. function apply(func, thisArg, args) {
  298. switch (args.length) {
  299. case 0:
  300. return func.call(thisArg);
  301. case 1:
  302. return func.call(thisArg, args[0]);
  303. case 2:
  304. return func.call(thisArg, args[0], args[1]);
  305. case 3:
  306. return func.call(thisArg, args[0], args[1], args[2]);
  307. }
  308. return func.apply(thisArg, args);
  309. }
  310. var nativeMax$g = Math.max;
  311. function composeArgs(args, partials, holders, isCurried) {
  312. var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax$g(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried;
  313. while (++leftIndex < leftLength) {
  314. result[leftIndex] = partials[leftIndex];
  315. }
  316. while (++argsIndex < holdersLength) {
  317. if (isUncurried || argsIndex < argsLength) {
  318. result[holders[argsIndex]] = args[argsIndex];
  319. }
  320. }
  321. while (rangeLength--) {
  322. result[leftIndex++] = args[argsIndex++];
  323. }
  324. return result;
  325. }
  326. var nativeMax$f = Math.max;
  327. function composeArgsRight(args, partials, holders, isCurried) {
  328. var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax$f(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried;
  329. while (++argsIndex < rangeLength) {
  330. result[argsIndex] = args[argsIndex];
  331. }
  332. var offset = argsIndex;
  333. while (++rightIndex < rightLength) {
  334. result[offset + rightIndex] = partials[rightIndex];
  335. }
  336. while (++holdersIndex < holdersLength) {
  337. if (isUncurried || argsIndex < argsLength) {
  338. result[offset + holders[holdersIndex]] = args[argsIndex++];
  339. }
  340. }
  341. return result;
  342. }
  343. function countHolders(array, placeholder) {
  344. var length = array.length, result = 0;
  345. while (length--) {
  346. if (array[length] === placeholder) {
  347. ++result;
  348. }
  349. }
  350. return result;
  351. }
  352. function baseLodash() {
  353. }
  354. var MAX_ARRAY_LENGTH$6 = 4294967295;
  355. function LazyWrapper(value) {
  356. this.__wrapped__ = value;
  357. this.__actions__ = [];
  358. this.__dir__ = 1;
  359. this.__filtered__ = false;
  360. this.__iteratees__ = [];
  361. this.__takeCount__ = MAX_ARRAY_LENGTH$6;
  362. this.__views__ = [];
  363. }
  364. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  365. LazyWrapper.prototype.constructor = LazyWrapper;
  366. function noop$1() {
  367. }
  368. var getData = !metaMap ? noop$1 : function(func) {
  369. return metaMap.get(func);
  370. };
  371. var realNames = {};
  372. var objectProto$p = Object.prototype;
  373. var hasOwnProperty$n = objectProto$p.hasOwnProperty;
  374. function getFuncName(func) {
  375. var result = func.name + "", array = realNames[result], length = hasOwnProperty$n.call(realNames, result) ? array.length : 0;
  376. while (length--) {
  377. var data = array[length], otherFunc = data.func;
  378. if (otherFunc == null || otherFunc == func) {
  379. return data.name;
  380. }
  381. }
  382. return result;
  383. }
  384. function LodashWrapper(value, chainAll) {
  385. this.__wrapped__ = value;
  386. this.__actions__ = [];
  387. this.__chain__ = !!chainAll;
  388. this.__index__ = 0;
  389. this.__values__ = void 0;
  390. }
  391. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  392. LodashWrapper.prototype.constructor = LodashWrapper;
  393. function copyArray(source, array) {
  394. var index = -1, length = source.length;
  395. array || (array = Array(length));
  396. while (++index < length) {
  397. array[index] = source[index];
  398. }
  399. return array;
  400. }
  401. function wrapperClone(wrapper) {
  402. if (wrapper instanceof LazyWrapper) {
  403. return wrapper.clone();
  404. }
  405. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  406. result.__actions__ = copyArray(wrapper.__actions__);
  407. result.__index__ = wrapper.__index__;
  408. result.__values__ = wrapper.__values__;
  409. return result;
  410. }
  411. var objectProto$o = Object.prototype;
  412. var hasOwnProperty$m = objectProto$o.hasOwnProperty;
  413. function lodash(value) {
  414. if (isObjectLike(value) && !isArray$1(value) && !(value instanceof LazyWrapper)) {
  415. if (value instanceof LodashWrapper) {
  416. return value;
  417. }
  418. if (hasOwnProperty$m.call(value, "__wrapped__")) {
  419. return wrapperClone(value);
  420. }
  421. }
  422. return new LodashWrapper(value);
  423. }
  424. lodash.prototype = baseLodash.prototype;
  425. lodash.prototype.constructor = lodash;
  426. function isLaziable(func) {
  427. var funcName = getFuncName(func), other = lodash[funcName];
  428. if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
  429. return false;
  430. }
  431. if (func === other) {
  432. return true;
  433. }
  434. var data = getData(other);
  435. return !!data && func === data[0];
  436. }
  437. var HOT_COUNT = 800;
  438. var HOT_SPAN = 16;
  439. var nativeNow = Date.now;
  440. function shortOut(func) {
  441. var count = 0, lastCalled = 0;
  442. return function() {
  443. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  444. lastCalled = stamp;
  445. if (remaining > 0) {
  446. if (++count >= HOT_COUNT) {
  447. return arguments[0];
  448. }
  449. } else {
  450. count = 0;
  451. }
  452. return func.apply(void 0, arguments);
  453. };
  454. }
  455. var setData = shortOut(baseSetData);
  456. var reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/;
  457. var reSplitDetails = /,? & /;
  458. function getWrapDetails(source) {
  459. var match = source.match(reWrapDetails);
  460. return match ? match[1].split(reSplitDetails) : [];
  461. }
  462. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;
  463. function insertWrapDetails(source, details) {
  464. var length = details.length;
  465. if (!length) {
  466. return source;
  467. }
  468. var lastIndex = length - 1;
  469. details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
  470. details = details.join(length > 2 ? ", " : " ");
  471. return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
  472. }
  473. function constant(value) {
  474. return function() {
  475. return value;
  476. };
  477. }
  478. var defineProperty = function() {
  479. try {
  480. var func = getNative(Object, "defineProperty");
  481. func({}, "", {});
  482. return func;
  483. } catch (e) {
  484. }
  485. }();
  486. var baseSetToString = !defineProperty ? identity$1 : function(func, string) {
  487. return defineProperty(func, "toString", {
  488. "configurable": true,
  489. "enumerable": false,
  490. "value": constant(string),
  491. "writable": true
  492. });
  493. };
  494. var setToString = shortOut(baseSetToString);
  495. function arrayEach(array, iteratee) {
  496. var index = -1, length = array == null ? 0 : array.length;
  497. while (++index < length) {
  498. if (iteratee(array[index], index, array) === false) {
  499. break;
  500. }
  501. }
  502. return array;
  503. }
  504. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  505. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  506. while (fromRight ? index-- : ++index < length) {
  507. if (predicate(array[index], index, array)) {
  508. return index;
  509. }
  510. }
  511. return -1;
  512. }
  513. function baseIsNaN(value) {
  514. return value !== value;
  515. }
  516. function strictIndexOf(array, value, fromIndex) {
  517. var index = fromIndex - 1, length = array.length;
  518. while (++index < length) {
  519. if (array[index] === value) {
  520. return index;
  521. }
  522. }
  523. return -1;
  524. }
  525. function baseIndexOf(array, value, fromIndex) {
  526. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  527. }
  528. function arrayIncludes(array, value) {
  529. var length = array == null ? 0 : array.length;
  530. return !!length && baseIndexOf(array, value, 0) > -1;
  531. }
  532. var WRAP_BIND_FLAG$7 = 1;
  533. var WRAP_BIND_KEY_FLAG$6 = 2;
  534. var WRAP_CURRY_FLAG$6 = 8;
  535. var WRAP_CURRY_RIGHT_FLAG$3 = 16;
  536. var WRAP_PARTIAL_FLAG$6 = 32;
  537. var WRAP_PARTIAL_RIGHT_FLAG$3 = 64;
  538. var WRAP_ARY_FLAG$4 = 128;
  539. var WRAP_REARG_FLAG$3 = 256;
  540. var WRAP_FLIP_FLAG$2 = 512;
  541. var wrapFlags = [
  542. ["ary", WRAP_ARY_FLAG$4],
  543. ["bind", WRAP_BIND_FLAG$7],
  544. ["bindKey", WRAP_BIND_KEY_FLAG$6],
  545. ["curry", WRAP_CURRY_FLAG$6],
  546. ["curryRight", WRAP_CURRY_RIGHT_FLAG$3],
  547. ["flip", WRAP_FLIP_FLAG$2],
  548. ["partial", WRAP_PARTIAL_FLAG$6],
  549. ["partialRight", WRAP_PARTIAL_RIGHT_FLAG$3],
  550. ["rearg", WRAP_REARG_FLAG$3]
  551. ];
  552. function updateWrapDetails(details, bitmask) {
  553. arrayEach(wrapFlags, function(pair) {
  554. var value = "_." + pair[0];
  555. if (bitmask & pair[1] && !arrayIncludes(details, value)) {
  556. details.push(value);
  557. }
  558. });
  559. return details.sort();
  560. }
  561. function setWrapToString(wrapper, reference, bitmask) {
  562. var source = reference + "";
  563. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  564. }
  565. var WRAP_BIND_FLAG$6 = 1;
  566. var WRAP_BIND_KEY_FLAG$5 = 2;
  567. var WRAP_CURRY_BOUND_FLAG$1 = 4;
  568. var WRAP_CURRY_FLAG$5 = 8;
  569. var WRAP_PARTIAL_FLAG$5 = 32;
  570. var WRAP_PARTIAL_RIGHT_FLAG$2 = 64;
  571. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  572. var isCurry = bitmask & WRAP_CURRY_FLAG$5, newHolders = isCurry ? holders : void 0, newHoldersRight = isCurry ? void 0 : holders, newPartials = isCurry ? partials : void 0, newPartialsRight = isCurry ? void 0 : partials;
  573. bitmask |= isCurry ? WRAP_PARTIAL_FLAG$5 : WRAP_PARTIAL_RIGHT_FLAG$2;
  574. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG$2 : WRAP_PARTIAL_FLAG$5);
  575. if (!(bitmask & WRAP_CURRY_BOUND_FLAG$1)) {
  576. bitmask &= ~(WRAP_BIND_FLAG$6 | WRAP_BIND_KEY_FLAG$5);
  577. }
  578. var newData = [
  579. func,
  580. bitmask,
  581. thisArg,
  582. newPartials,
  583. newHolders,
  584. newPartialsRight,
  585. newHoldersRight,
  586. argPos,
  587. ary,
  588. arity
  589. ];
  590. var result = wrapFunc.apply(void 0, newData);
  591. if (isLaziable(func)) {
  592. setData(result, newData);
  593. }
  594. result.placeholder = placeholder;
  595. return setWrapToString(result, func, bitmask);
  596. }
  597. function getHolder(func) {
  598. var object = func;
  599. return object.placeholder;
  600. }
  601. var MAX_SAFE_INTEGER$5 = 9007199254740991;
  602. var reIsUint = /^(?:0|[1-9]\d*)$/;
  603. function isIndex(value, length) {
  604. var type = typeof value;
  605. length = length == null ? MAX_SAFE_INTEGER$5 : length;
  606. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
  607. }
  608. var nativeMin$e = Math.min;
  609. function reorder(array, indexes) {
  610. var arrLength = array.length, length = nativeMin$e(indexes.length, arrLength), oldArray = copyArray(array);
  611. while (length--) {
  612. var index = indexes[length];
  613. array[length] = isIndex(index, arrLength) ? oldArray[index] : void 0;
  614. }
  615. return array;
  616. }
  617. var PLACEHOLDER$1 = "__lodash_placeholder__";
  618. function replaceHolders(array, placeholder) {
  619. var index = -1, length = array.length, resIndex = 0, result = [];
  620. while (++index < length) {
  621. var value = array[index];
  622. if (value === placeholder || value === PLACEHOLDER$1) {
  623. array[index] = PLACEHOLDER$1;
  624. result[resIndex++] = index;
  625. }
  626. }
  627. return result;
  628. }
  629. var WRAP_BIND_FLAG$5 = 1;
  630. var WRAP_BIND_KEY_FLAG$4 = 2;
  631. var WRAP_CURRY_FLAG$4 = 8;
  632. var WRAP_CURRY_RIGHT_FLAG$2 = 16;
  633. var WRAP_ARY_FLAG$3 = 128;
  634. var WRAP_FLIP_FLAG$1 = 512;
  635. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  636. var isAry = bitmask & WRAP_ARY_FLAG$3, isBind = bitmask & WRAP_BIND_FLAG$5, isBindKey = bitmask & WRAP_BIND_KEY_FLAG$4, isCurried = bitmask & (WRAP_CURRY_FLAG$4 | WRAP_CURRY_RIGHT_FLAG$2), isFlip = bitmask & WRAP_FLIP_FLAG$1, Ctor = isBindKey ? void 0 : createCtor(func);
  637. function wrapper() {
  638. var length = arguments.length, args = Array(length), index = length;
  639. while (index--) {
  640. args[index] = arguments[index];
  641. }
  642. if (isCurried) {
  643. var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
  644. }
  645. if (partials) {
  646. args = composeArgs(args, partials, holders, isCurried);
  647. }
  648. if (partialsRight) {
  649. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  650. }
  651. length -= holdersCount;
  652. if (isCurried && length < arity) {
  653. var newHolders = replaceHolders(args, placeholder);
  654. return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
  655. }
  656. var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
  657. length = args.length;
  658. if (argPos) {
  659. args = reorder(args, argPos);
  660. } else if (isFlip && length > 1) {
  661. args.reverse();
  662. }
  663. if (isAry && ary < length) {
  664. args.length = ary;
  665. }
  666. if (this && this !== root && this instanceof wrapper) {
  667. fn = Ctor || createCtor(fn);
  668. }
  669. return fn.apply(thisBinding, args);
  670. }
  671. return wrapper;
  672. }
  673. function createCurry(func, bitmask, arity) {
  674. var Ctor = createCtor(func);
  675. function wrapper() {
  676. var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper);
  677. while (index--) {
  678. args[index] = arguments[index];
  679. }
  680. var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
  681. length -= holders.length;
  682. if (length < arity) {
  683. return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, void 0, args, holders, void 0, void 0, arity - length);
  684. }
  685. var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  686. return apply(fn, this, args);
  687. }
  688. return wrapper;
  689. }
  690. var WRAP_BIND_FLAG$4 = 1;
  691. function createPartial(func, bitmask, thisArg, partials) {
  692. var isBind = bitmask & WRAP_BIND_FLAG$4, Ctor = createCtor(func);
  693. function wrapper() {
  694. var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
  695. while (++leftIndex < leftLength) {
  696. args[leftIndex] = partials[leftIndex];
  697. }
  698. while (argsLength--) {
  699. args[leftIndex++] = arguments[++argsIndex];
  700. }
  701. return apply(fn, isBind ? thisArg : this, args);
  702. }
  703. return wrapper;
  704. }
  705. var PLACEHOLDER = "__lodash_placeholder__";
  706. var WRAP_BIND_FLAG$3 = 1;
  707. var WRAP_BIND_KEY_FLAG$3 = 2;
  708. var WRAP_CURRY_BOUND_FLAG = 4;
  709. var WRAP_CURRY_FLAG$3 = 8;
  710. var WRAP_ARY_FLAG$2 = 128;
  711. var WRAP_REARG_FLAG$2 = 256;
  712. var nativeMin$d = Math.min;
  713. function mergeData(data, source) {
  714. var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG$3 | WRAP_BIND_KEY_FLAG$3 | WRAP_ARY_FLAG$2);
  715. var isCombo = srcBitmask == WRAP_ARY_FLAG$2 && bitmask == WRAP_CURRY_FLAG$3 || srcBitmask == WRAP_ARY_FLAG$2 && bitmask == WRAP_REARG_FLAG$2 && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG$2 | WRAP_REARG_FLAG$2) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG$3;
  716. if (!(isCommon || isCombo)) {
  717. return data;
  718. }
  719. if (srcBitmask & WRAP_BIND_FLAG$3) {
  720. data[2] = source[2];
  721. newBitmask |= bitmask & WRAP_BIND_FLAG$3 ? 0 : WRAP_CURRY_BOUND_FLAG;
  722. }
  723. var value = source[3];
  724. if (value) {
  725. var partials = data[3];
  726. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  727. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  728. }
  729. value = source[5];
  730. if (value) {
  731. partials = data[5];
  732. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  733. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  734. }
  735. value = source[7];
  736. if (value) {
  737. data[7] = value;
  738. }
  739. if (srcBitmask & WRAP_ARY_FLAG$2) {
  740. data[8] = data[8] == null ? source[8] : nativeMin$d(data[8], source[8]);
  741. }
  742. if (data[9] == null) {
  743. data[9] = source[9];
  744. }
  745. data[0] = source[0];
  746. data[1] = newBitmask;
  747. return data;
  748. }
  749. var FUNC_ERROR_TEXT$a = "Expected a function";
  750. var WRAP_BIND_FLAG$2 = 1;
  751. var WRAP_BIND_KEY_FLAG$2 = 2;
  752. var WRAP_CURRY_FLAG$2 = 8;
  753. var WRAP_CURRY_RIGHT_FLAG$1 = 16;
  754. var WRAP_PARTIAL_FLAG$4 = 32;
  755. var WRAP_PARTIAL_RIGHT_FLAG$1 = 64;
  756. var nativeMax$e = Math.max;
  757. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  758. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG$2;
  759. if (!isBindKey && typeof func != "function") {
  760. throw new TypeError(FUNC_ERROR_TEXT$a);
  761. }
  762. var length = partials ? partials.length : 0;
  763. if (!length) {
  764. bitmask &= ~(WRAP_PARTIAL_FLAG$4 | WRAP_PARTIAL_RIGHT_FLAG$1);
  765. partials = holders = void 0;
  766. }
  767. ary = ary === void 0 ? ary : nativeMax$e(toInteger(ary), 0);
  768. arity = arity === void 0 ? arity : toInteger(arity);
  769. length -= holders ? holders.length : 0;
  770. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG$1) {
  771. var partialsRight = partials, holdersRight = holders;
  772. partials = holders = void 0;
  773. }
  774. var data = isBindKey ? void 0 : getData(func);
  775. var newData = [
  776. func,
  777. bitmask,
  778. thisArg,
  779. partials,
  780. holders,
  781. partialsRight,
  782. holdersRight,
  783. argPos,
  784. ary,
  785. arity
  786. ];
  787. if (data) {
  788. mergeData(newData, data);
  789. }
  790. func = newData[0];
  791. bitmask = newData[1];
  792. thisArg = newData[2];
  793. partials = newData[3];
  794. holders = newData[4];
  795. arity = newData[9] = newData[9] === void 0 ? isBindKey ? 0 : func.length : nativeMax$e(newData[9] - length, 0);
  796. if (!arity && bitmask & (WRAP_CURRY_FLAG$2 | WRAP_CURRY_RIGHT_FLAG$1)) {
  797. bitmask &= ~(WRAP_CURRY_FLAG$2 | WRAP_CURRY_RIGHT_FLAG$1);
  798. }
  799. if (!bitmask || bitmask == WRAP_BIND_FLAG$2) {
  800. var result = createBind(func, bitmask, thisArg);
  801. } else if (bitmask == WRAP_CURRY_FLAG$2 || bitmask == WRAP_CURRY_RIGHT_FLAG$1) {
  802. result = createCurry(func, bitmask, arity);
  803. } else if ((bitmask == WRAP_PARTIAL_FLAG$4 || bitmask == (WRAP_BIND_FLAG$2 | WRAP_PARTIAL_FLAG$4)) && !holders.length) {
  804. result = createPartial(func, bitmask, thisArg, partials);
  805. } else {
  806. result = createHybrid.apply(void 0, newData);
  807. }
  808. var setter = data ? baseSetData : setData;
  809. return setWrapToString(setter(result, newData), func, bitmask);
  810. }
  811. var WRAP_ARY_FLAG$1 = 128;
  812. function ary(func, n, guard) {
  813. n = guard ? void 0 : n;
  814. n = func && n == null ? func.length : n;
  815. return createWrap(func, WRAP_ARY_FLAG$1, void 0, void 0, void 0, void 0, n);
  816. }
  817. function baseAssignValue(object, key, value) {
  818. if (key == "__proto__" && defineProperty) {
  819. defineProperty(object, key, {
  820. "configurable": true,
  821. "enumerable": true,
  822. "value": value,
  823. "writable": true
  824. });
  825. } else {
  826. object[key] = value;
  827. }
  828. }
  829. function eq(value, other) {
  830. return value === other || value !== value && other !== other;
  831. }
  832. var objectProto$n = Object.prototype;
  833. var hasOwnProperty$l = objectProto$n.hasOwnProperty;
  834. function assignValue(object, key, value) {
  835. var objValue = object[key];
  836. if (!(hasOwnProperty$l.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
  837. baseAssignValue(object, key, value);
  838. }
  839. }
  840. function copyObject(source, props, object, customizer) {
  841. var isNew = !object;
  842. object || (object = {});
  843. var index = -1, length = props.length;
  844. while (++index < length) {
  845. var key = props[index];
  846. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
  847. if (newValue === void 0) {
  848. newValue = source[key];
  849. }
  850. if (isNew) {
  851. baseAssignValue(object, key, newValue);
  852. } else {
  853. assignValue(object, key, newValue);
  854. }
  855. }
  856. return object;
  857. }
  858. var nativeMax$d = Math.max;
  859. function overRest(func, start, transform) {
  860. start = nativeMax$d(start === void 0 ? func.length - 1 : start, 0);
  861. return function() {
  862. var args = arguments, index = -1, length = nativeMax$d(args.length - start, 0), array = Array(length);
  863. while (++index < length) {
  864. array[index] = args[start + index];
  865. }
  866. index = -1;
  867. var otherArgs = Array(start + 1);
  868. while (++index < start) {
  869. otherArgs[index] = args[index];
  870. }
  871. otherArgs[start] = transform(array);
  872. return apply(func, this, otherArgs);
  873. };
  874. }
  875. function baseRest(func, start) {
  876. return setToString(overRest(func, start, identity$1), func + "");
  877. }
  878. var MAX_SAFE_INTEGER$4 = 9007199254740991;
  879. function isLength(value) {
  880. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$4;
  881. }
  882. function isArrayLike(value) {
  883. return value != null && isLength(value.length) && !isFunction$1(value);
  884. }
  885. function isIterateeCall(value, index, object) {
  886. if (!isObject$2(object)) {
  887. return false;
  888. }
  889. var type = typeof index;
  890. if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
  891. return eq(object[index], value);
  892. }
  893. return false;
  894. }
  895. function createAssigner(assigner) {
  896. return baseRest(function(object, sources) {
  897. var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
  898. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
  899. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  900. customizer = length < 3 ? void 0 : customizer;
  901. length = 1;
  902. }
  903. object = Object(object);
  904. while (++index < length) {
  905. var source = sources[index];
  906. if (source) {
  907. assigner(object, source, index, customizer);
  908. }
  909. }
  910. return object;
  911. });
  912. }
  913. var objectProto$m = Object.prototype;
  914. function isPrototype(value) {
  915. var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$m;
  916. return value === proto;
  917. }
  918. function baseTimes(n, iteratee) {
  919. var index = -1, result = Array(n);
  920. while (++index < n) {
  921. result[index] = iteratee(index);
  922. }
  923. return result;
  924. }
  925. var argsTag$3 = "[object Arguments]";
  926. function baseIsArguments(value) {
  927. return isObjectLike(value) && baseGetTag(value) == argsTag$3;
  928. }
  929. var objectProto$l = Object.prototype;
  930. var hasOwnProperty$k = objectProto$l.hasOwnProperty;
  931. var propertyIsEnumerable$1 = objectProto$l.propertyIsEnumerable;
  932. var isArguments = baseIsArguments(function() {
  933. return arguments;
  934. }()) ? baseIsArguments : function(value) {
  935. return isObjectLike(value) && hasOwnProperty$k.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  936. };
  937. function stubFalse() {
  938. return false;
  939. }
  940. var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
  941. var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
  942. var moduleExports$2 = freeModule$2 && freeModule$2.exports === freeExports$2;
  943. var Buffer$1 = moduleExports$2 ? root.Buffer : void 0;
  944. var nativeIsBuffer = Buffer$1 ? Buffer$1.isBuffer : void 0;
  945. var isBuffer = nativeIsBuffer || stubFalse;
  946. var argsTag$2 = "[object Arguments]";
  947. var arrayTag$2 = "[object Array]";
  948. var boolTag$4 = "[object Boolean]";
  949. var dateTag$4 = "[object Date]";
  950. var errorTag$3 = "[object Error]";
  951. var funcTag$1 = "[object Function]";
  952. var mapTag$9 = "[object Map]";
  953. var numberTag$4 = "[object Number]";
  954. var objectTag$4 = "[object Object]";
  955. var regexpTag$4 = "[object RegExp]";
  956. var setTag$9 = "[object Set]";
  957. var stringTag$4 = "[object String]";
  958. var weakMapTag$3 = "[object WeakMap]";
  959. var arrayBufferTag$4 = "[object ArrayBuffer]";
  960. var dataViewTag$4 = "[object DataView]";
  961. var float32Tag$2 = "[object Float32Array]";
  962. var float64Tag$2 = "[object Float64Array]";
  963. var int8Tag$2 = "[object Int8Array]";
  964. var int16Tag$2 = "[object Int16Array]";
  965. var int32Tag$2 = "[object Int32Array]";
  966. var uint8Tag$2 = "[object Uint8Array]";
  967. var uint8ClampedTag$2 = "[object Uint8ClampedArray]";
  968. var uint16Tag$2 = "[object Uint16Array]";
  969. var uint32Tag$2 = "[object Uint32Array]";
  970. var typedArrayTags = {};
  971. typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] = typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] = typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] = typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] = typedArrayTags[uint32Tag$2] = true;
  972. typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$4] = typedArrayTags[boolTag$4] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$4] = typedArrayTags[errorTag$3] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$9] = typedArrayTags[numberTag$4] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$4] = typedArrayTags[setTag$9] = typedArrayTags[stringTag$4] = typedArrayTags[weakMapTag$3] = false;
  973. function baseIsTypedArray(value) {
  974. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  975. }
  976. function baseUnary(func) {
  977. return function(value) {
  978. return func(value);
  979. };
  980. }
  981. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  982. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  983. var moduleExports$1 = freeModule$1 && freeModule$1.exports === freeExports$1;
  984. var freeProcess = moduleExports$1 && freeGlobal.process;
  985. var nodeUtil = function() {
  986. try {
  987. var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
  988. if (types) {
  989. return types;
  990. }
  991. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  992. } catch (e) {
  993. }
  994. }();
  995. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  996. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  997. var objectProto$k = Object.prototype;
  998. var hasOwnProperty$j = objectProto$k.hasOwnProperty;
  999. function arrayLikeKeys(value, inherited) {
  1000. var isArr = isArray$1(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
  1001. for (var key in value) {
  1002. if ((inherited || hasOwnProperty$j.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
  1003. result.push(key);
  1004. }
  1005. }
  1006. return result;
  1007. }
  1008. function overArg(func, transform) {
  1009. return function(arg) {
  1010. return func(transform(arg));
  1011. };
  1012. }
  1013. var nativeKeys = overArg(Object.keys, Object);
  1014. var objectProto$j = Object.prototype;
  1015. var hasOwnProperty$i = objectProto$j.hasOwnProperty;
  1016. function baseKeys(object) {
  1017. if (!isPrototype(object)) {
  1018. return nativeKeys(object);
  1019. }
  1020. var result = [];
  1021. for (var key in Object(object)) {
  1022. if (hasOwnProperty$i.call(object, key) && key != "constructor") {
  1023. result.push(key);
  1024. }
  1025. }
  1026. return result;
  1027. }
  1028. function keys(object) {
  1029. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  1030. }
  1031. var objectProto$i = Object.prototype;
  1032. var hasOwnProperty$h = objectProto$i.hasOwnProperty;
  1033. var assign = createAssigner(function(object, source) {
  1034. if (isPrototype(source) || isArrayLike(source)) {
  1035. copyObject(source, keys(source), object);
  1036. return;
  1037. }
  1038. for (var key in source) {
  1039. if (hasOwnProperty$h.call(source, key)) {
  1040. assignValue(object, key, source[key]);
  1041. }
  1042. }
  1043. });
  1044. function nativeKeysIn(object) {
  1045. var result = [];
  1046. if (object != null) {
  1047. for (var key in Object(object)) {
  1048. result.push(key);
  1049. }
  1050. }
  1051. return result;
  1052. }
  1053. var objectProto$h = Object.prototype;
  1054. var hasOwnProperty$g = objectProto$h.hasOwnProperty;
  1055. function baseKeysIn(object) {
  1056. if (!isObject$2(object)) {
  1057. return nativeKeysIn(object);
  1058. }
  1059. var isProto = isPrototype(object), result = [];
  1060. for (var key in object) {
  1061. if (!(key == "constructor" && (isProto || !hasOwnProperty$g.call(object, key)))) {
  1062. result.push(key);
  1063. }
  1064. }
  1065. return result;
  1066. }
  1067. function keysIn(object) {
  1068. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  1069. }
  1070. var assignIn = createAssigner(function(object, source) {
  1071. copyObject(source, keysIn(source), object);
  1072. });
  1073. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  1074. copyObject(source, keysIn(source), object, customizer);
  1075. });
  1076. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  1077. copyObject(source, keys(source), object, customizer);
  1078. });
  1079. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/;
  1080. var reIsPlainProp = /^\w*$/;
  1081. function isKey(value, object) {
  1082. if (isArray$1(value)) {
  1083. return false;
  1084. }
  1085. var type = typeof value;
  1086. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
  1087. return true;
  1088. }
  1089. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  1090. }
  1091. var nativeCreate = getNative(Object, "create");
  1092. function hashClear() {
  1093. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1094. this.size = 0;
  1095. }
  1096. function hashDelete(key) {
  1097. var result = this.has(key) && delete this.__data__[key];
  1098. this.size -= result ? 1 : 0;
  1099. return result;
  1100. }
  1101. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  1102. var objectProto$g = Object.prototype;
  1103. var hasOwnProperty$f = objectProto$g.hasOwnProperty;
  1104. function hashGet(key) {
  1105. var data = this.__data__;
  1106. if (nativeCreate) {
  1107. var result = data[key];
  1108. return result === HASH_UNDEFINED$2 ? void 0 : result;
  1109. }
  1110. return hasOwnProperty$f.call(data, key) ? data[key] : void 0;
  1111. }
  1112. var objectProto$f = Object.prototype;
  1113. var hasOwnProperty$e = objectProto$f.hasOwnProperty;
  1114. function hashHas(key) {
  1115. var data = this.__data__;
  1116. return nativeCreate ? data[key] !== void 0 : hasOwnProperty$e.call(data, key);
  1117. }
  1118. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  1119. function hashSet(key, value) {
  1120. var data = this.__data__;
  1121. this.size += this.has(key) ? 0 : 1;
  1122. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
  1123. return this;
  1124. }
  1125. function Hash(entries) {
  1126. var index = -1, length = entries == null ? 0 : entries.length;
  1127. this.clear();
  1128. while (++index < length) {
  1129. var entry = entries[index];
  1130. this.set(entry[0], entry[1]);
  1131. }
  1132. }
  1133. Hash.prototype.clear = hashClear;
  1134. Hash.prototype["delete"] = hashDelete;
  1135. Hash.prototype.get = hashGet;
  1136. Hash.prototype.has = hashHas;
  1137. Hash.prototype.set = hashSet;
  1138. function listCacheClear() {
  1139. this.__data__ = [];
  1140. this.size = 0;
  1141. }
  1142. function assocIndexOf(array, key) {
  1143. var length = array.length;
  1144. while (length--) {
  1145. if (eq(array[length][0], key)) {
  1146. return length;
  1147. }
  1148. }
  1149. return -1;
  1150. }
  1151. var arrayProto$5 = Array.prototype;
  1152. var splice$2 = arrayProto$5.splice;
  1153. function listCacheDelete(key) {
  1154. var data = this.__data__, index = assocIndexOf(data, key);
  1155. if (index < 0) {
  1156. return false;
  1157. }
  1158. var lastIndex = data.length - 1;
  1159. if (index == lastIndex) {
  1160. data.pop();
  1161. } else {
  1162. splice$2.call(data, index, 1);
  1163. }
  1164. --this.size;
  1165. return true;
  1166. }
  1167. function listCacheGet(key) {
  1168. var data = this.__data__, index = assocIndexOf(data, key);
  1169. return index < 0 ? void 0 : data[index][1];
  1170. }
  1171. function listCacheHas(key) {
  1172. return assocIndexOf(this.__data__, key) > -1;
  1173. }
  1174. function listCacheSet(key, value) {
  1175. var data = this.__data__, index = assocIndexOf(data, key);
  1176. if (index < 0) {
  1177. ++this.size;
  1178. data.push([key, value]);
  1179. } else {
  1180. data[index][1] = value;
  1181. }
  1182. return this;
  1183. }
  1184. function ListCache(entries) {
  1185. var index = -1, length = entries == null ? 0 : entries.length;
  1186. this.clear();
  1187. while (++index < length) {
  1188. var entry = entries[index];
  1189. this.set(entry[0], entry[1]);
  1190. }
  1191. }
  1192. ListCache.prototype.clear = listCacheClear;
  1193. ListCache.prototype["delete"] = listCacheDelete;
  1194. ListCache.prototype.get = listCacheGet;
  1195. ListCache.prototype.has = listCacheHas;
  1196. ListCache.prototype.set = listCacheSet;
  1197. var Map$1 = getNative(root, "Map");
  1198. function mapCacheClear() {
  1199. this.size = 0;
  1200. this.__data__ = {
  1201. "hash": new Hash(),
  1202. "map": new (Map$1 || ListCache)(),
  1203. "string": new Hash()
  1204. };
  1205. }
  1206. function isKeyable(value) {
  1207. var type = typeof value;
  1208. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  1209. }
  1210. function getMapData(map, key) {
  1211. var data = map.__data__;
  1212. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  1213. }
  1214. function mapCacheDelete(key) {
  1215. var result = getMapData(this, key)["delete"](key);
  1216. this.size -= result ? 1 : 0;
  1217. return result;
  1218. }
  1219. function mapCacheGet(key) {
  1220. return getMapData(this, key).get(key);
  1221. }
  1222. function mapCacheHas(key) {
  1223. return getMapData(this, key).has(key);
  1224. }
  1225. function mapCacheSet(key, value) {
  1226. var data = getMapData(this, key), size = data.size;
  1227. data.set(key, value);
  1228. this.size += data.size == size ? 0 : 1;
  1229. return this;
  1230. }
  1231. function MapCache(entries) {
  1232. var index = -1, length = entries == null ? 0 : entries.length;
  1233. this.clear();
  1234. while (++index < length) {
  1235. var entry = entries[index];
  1236. this.set(entry[0], entry[1]);
  1237. }
  1238. }
  1239. MapCache.prototype.clear = mapCacheClear;
  1240. MapCache.prototype["delete"] = mapCacheDelete;
  1241. MapCache.prototype.get = mapCacheGet;
  1242. MapCache.prototype.has = mapCacheHas;
  1243. MapCache.prototype.set = mapCacheSet;
  1244. var FUNC_ERROR_TEXT$9 = "Expected a function";
  1245. function memoize(func, resolver) {
  1246. if (typeof func != "function" || resolver != null && typeof resolver != "function") {
  1247. throw new TypeError(FUNC_ERROR_TEXT$9);
  1248. }
  1249. var memoized = function() {
  1250. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  1251. if (cache.has(key)) {
  1252. return cache.get(key);
  1253. }
  1254. var result = func.apply(this, args);
  1255. memoized.cache = cache.set(key, result) || cache;
  1256. return result;
  1257. };
  1258. memoized.cache = new (memoize.Cache || MapCache)();
  1259. return memoized;
  1260. }
  1261. memoize.Cache = MapCache;
  1262. var MAX_MEMOIZE_SIZE = 500;
  1263. function memoizeCapped(func) {
  1264. var result = memoize(func, function(key) {
  1265. if (cache.size === MAX_MEMOIZE_SIZE) {
  1266. cache.clear();
  1267. }
  1268. return key;
  1269. });
  1270. var cache = result.cache;
  1271. return result;
  1272. }
  1273. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1274. var reEscapeChar = /\\(\\)?/g;
  1275. var stringToPath = memoizeCapped(function(string) {
  1276. var result = [];
  1277. if (string.charCodeAt(0) === 46) {
  1278. result.push("");
  1279. }
  1280. string.replace(rePropName, function(match, number, quote, subString) {
  1281. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  1282. });
  1283. return result;
  1284. });
  1285. function toString(value) {
  1286. return value == null ? "" : baseToString(value);
  1287. }
  1288. function castPath(value, object) {
  1289. if (isArray$1(value)) {
  1290. return value;
  1291. }
  1292. return isKey(value, object) ? [value] : stringToPath(toString(value));
  1293. }
  1294. var INFINITY$3 = 1 / 0;
  1295. function toKey(value) {
  1296. if (typeof value == "string" || isSymbol(value)) {
  1297. return value;
  1298. }
  1299. var result = value + "";
  1300. return result == "0" && 1 / value == -INFINITY$3 ? "-0" : result;
  1301. }
  1302. function baseGet(object, path) {
  1303. path = castPath(path, object);
  1304. var index = 0, length = path.length;
  1305. while (object != null && index < length) {
  1306. object = object[toKey(path[index++])];
  1307. }
  1308. return index && index == length ? object : void 0;
  1309. }
  1310. function get(object, path, defaultValue) {
  1311. var result = object == null ? void 0 : baseGet(object, path);
  1312. return result === void 0 ? defaultValue : result;
  1313. }
  1314. function baseAt(object, paths) {
  1315. var index = -1, length = paths.length, result = Array(length), skip = object == null;
  1316. while (++index < length) {
  1317. result[index] = skip ? void 0 : get(object, paths[index]);
  1318. }
  1319. return result;
  1320. }
  1321. function arrayPush(array, values) {
  1322. var index = -1, length = values.length, offset = array.length;
  1323. while (++index < length) {
  1324. array[offset + index] = values[index];
  1325. }
  1326. return array;
  1327. }
  1328. var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
  1329. function isFlattenable(value) {
  1330. return isArray$1(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  1331. }
  1332. function baseFlatten(array, depth, predicate, isStrict, result) {
  1333. var index = -1, length = array.length;
  1334. predicate || (predicate = isFlattenable);
  1335. result || (result = []);
  1336. while (++index < length) {
  1337. var value = array[index];
  1338. if (depth > 0 && predicate(value)) {
  1339. if (depth > 1) {
  1340. baseFlatten(value, depth - 1, predicate, isStrict, result);
  1341. } else {
  1342. arrayPush(result, value);
  1343. }
  1344. } else if (!isStrict) {
  1345. result[result.length] = value;
  1346. }
  1347. }
  1348. return result;
  1349. }
  1350. function flatten(array) {
  1351. var length = array == null ? 0 : array.length;
  1352. return length ? baseFlatten(array, 1) : [];
  1353. }
  1354. function flatRest(func) {
  1355. return setToString(overRest(func, void 0, flatten), func + "");
  1356. }
  1357. var at$1 = flatRest(baseAt);
  1358. var getPrototype = overArg(Object.getPrototypeOf, Object);
  1359. var objectTag$3 = "[object Object]";
  1360. var funcProto = Function.prototype;
  1361. var objectProto$e = Object.prototype;
  1362. var funcToString = funcProto.toString;
  1363. var hasOwnProperty$d = objectProto$e.hasOwnProperty;
  1364. var objectCtorString = funcToString.call(Object);
  1365. function isPlainObject(value) {
  1366. if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) {
  1367. return false;
  1368. }
  1369. var proto = getPrototype(value);
  1370. if (proto === null) {
  1371. return true;
  1372. }
  1373. var Ctor = hasOwnProperty$d.call(proto, "constructor") && proto.constructor;
  1374. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  1375. }
  1376. var domExcTag = "[object DOMException]";
  1377. var errorTag$2 = "[object Error]";
  1378. function isError(value) {
  1379. if (!isObjectLike(value)) {
  1380. return false;
  1381. }
  1382. var tag = baseGetTag(value);
  1383. return tag == errorTag$2 || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
  1384. }
  1385. var attempt = baseRest(function(func, args) {
  1386. try {
  1387. return apply(func, void 0, args);
  1388. } catch (e) {
  1389. return isError(e) ? e : new Error(e);
  1390. }
  1391. });
  1392. var FUNC_ERROR_TEXT$8 = "Expected a function";
  1393. function before(n, func) {
  1394. var result;
  1395. if (typeof func != "function") {
  1396. throw new TypeError(FUNC_ERROR_TEXT$8);
  1397. }
  1398. n = toInteger(n);
  1399. return function() {
  1400. if (--n > 0) {
  1401. result = func.apply(this, arguments);
  1402. }
  1403. if (n <= 1) {
  1404. func = void 0;
  1405. }
  1406. return result;
  1407. };
  1408. }
  1409. var WRAP_BIND_FLAG$1 = 1;
  1410. var WRAP_PARTIAL_FLAG$3 = 32;
  1411. var bind = baseRest(function(func, thisArg, partials) {
  1412. var bitmask = WRAP_BIND_FLAG$1;
  1413. if (partials.length) {
  1414. var holders = replaceHolders(partials, getHolder(bind));
  1415. bitmask |= WRAP_PARTIAL_FLAG$3;
  1416. }
  1417. return createWrap(func, bitmask, thisArg, partials, holders);
  1418. });
  1419. bind.placeholder = {};
  1420. var bindAll = flatRest(function(object, methodNames) {
  1421. arrayEach(methodNames, function(key) {
  1422. key = toKey(key);
  1423. baseAssignValue(object, key, bind(object[key], object));
  1424. });
  1425. return object;
  1426. });
  1427. var WRAP_BIND_FLAG = 1;
  1428. var WRAP_BIND_KEY_FLAG$1 = 2;
  1429. var WRAP_PARTIAL_FLAG$2 = 32;
  1430. var bindKey = baseRest(function(object, key, partials) {
  1431. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG$1;
  1432. if (partials.length) {
  1433. var holders = replaceHolders(partials, getHolder(bindKey));
  1434. bitmask |= WRAP_PARTIAL_FLAG$2;
  1435. }
  1436. return createWrap(key, bitmask, object, partials, holders);
  1437. });
  1438. bindKey.placeholder = {};
  1439. function baseSlice(array, start, end) {
  1440. var index = -1, length = array.length;
  1441. if (start < 0) {
  1442. start = -start > length ? 0 : length + start;
  1443. }
  1444. end = end > length ? length : end;
  1445. if (end < 0) {
  1446. end += length;
  1447. }
  1448. length = start > end ? 0 : end - start >>> 0;
  1449. start >>>= 0;
  1450. var result = Array(length);
  1451. while (++index < length) {
  1452. result[index] = array[index + start];
  1453. }
  1454. return result;
  1455. }
  1456. function castSlice(array, start, end) {
  1457. var length = array.length;
  1458. end = end === void 0 ? length : end;
  1459. return !start && end >= length ? array : baseSlice(array, start, end);
  1460. }
  1461. var rsAstralRange$3 = "\\ud800-\\udfff";
  1462. var rsComboMarksRange$4 = "\\u0300-\\u036f";
  1463. var reComboHalfMarksRange$4 = "\\ufe20-\\ufe2f";
  1464. var rsComboSymbolsRange$4 = "\\u20d0-\\u20ff";
  1465. var rsComboRange$4 = rsComboMarksRange$4 + reComboHalfMarksRange$4 + rsComboSymbolsRange$4;
  1466. var rsVarRange$3 = "\\ufe0e\\ufe0f";
  1467. var rsZWJ$3 = "\\u200d";
  1468. var reHasUnicode = RegExp("[" + rsZWJ$3 + rsAstralRange$3 + rsComboRange$4 + rsVarRange$3 + "]");
  1469. function hasUnicode(string) {
  1470. return reHasUnicode.test(string);
  1471. }
  1472. function asciiToArray(string) {
  1473. return string.split("");
  1474. }
  1475. var rsAstralRange$2 = "\\ud800-\\udfff";
  1476. var rsComboMarksRange$3 = "\\u0300-\\u036f";
  1477. var reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f";
  1478. var rsComboSymbolsRange$3 = "\\u20d0-\\u20ff";
  1479. var rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3;
  1480. var rsVarRange$2 = "\\ufe0e\\ufe0f";
  1481. var rsAstral$1 = "[" + rsAstralRange$2 + "]";
  1482. var rsCombo$3 = "[" + rsComboRange$3 + "]";
  1483. var rsFitz$2 = "\\ud83c[\\udffb-\\udfff]";
  1484. var rsModifier$2 = "(?:" + rsCombo$3 + "|" + rsFitz$2 + ")";
  1485. var rsNonAstral$2 = "[^" + rsAstralRange$2 + "]";
  1486. var rsRegional$2 = "(?:\\ud83c[\\udde6-\\uddff]){2}";
  1487. var rsSurrPair$2 = "[\\ud800-\\udbff][\\udc00-\\udfff]";
  1488. var rsZWJ$2 = "\\u200d";
  1489. var reOptMod$2 = rsModifier$2 + "?";
  1490. var rsOptVar$2 = "[" + rsVarRange$2 + "]?";
  1491. var rsOptJoin$2 = "(?:" + rsZWJ$2 + "(?:" + [rsNonAstral$2, rsRegional$2, rsSurrPair$2].join("|") + ")" + rsOptVar$2 + reOptMod$2 + ")*";
  1492. var rsSeq$2 = rsOptVar$2 + reOptMod$2 + rsOptJoin$2;
  1493. var rsSymbol$1 = "(?:" + [rsNonAstral$2 + rsCombo$3 + "?", rsCombo$3, rsRegional$2, rsSurrPair$2, rsAstral$1].join("|") + ")";
  1494. var reUnicode$1 = RegExp(rsFitz$2 + "(?=" + rsFitz$2 + ")|" + rsSymbol$1 + rsSeq$2, "g");
  1495. function unicodeToArray(string) {
  1496. return string.match(reUnicode$1) || [];
  1497. }
  1498. function stringToArray(string) {
  1499. return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
  1500. }
  1501. function createCaseFirst(methodName) {
  1502. return function(string) {
  1503. string = toString(string);
  1504. var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0;
  1505. var chr = strSymbols ? strSymbols[0] : string.charAt(0);
  1506. var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
  1507. return chr[methodName]() + trailing;
  1508. };
  1509. }
  1510. var upperFirst = createCaseFirst("toUpperCase");
  1511. function capitalize$2(string) {
  1512. return upperFirst(toString(string).toLowerCase());
  1513. }
  1514. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1515. var index = -1, length = array == null ? 0 : array.length;
  1516. if (initAccum && length) {
  1517. accumulator = array[++index];
  1518. }
  1519. while (++index < length) {
  1520. accumulator = iteratee(accumulator, array[index], index, array);
  1521. }
  1522. return accumulator;
  1523. }
  1524. function basePropertyOf(object) {
  1525. return function(key) {
  1526. return object == null ? void 0 : object[key];
  1527. };
  1528. }
  1529. var deburredLetters = {
  1530. "\xC0": "A",
  1531. "\xC1": "A",
  1532. "\xC2": "A",
  1533. "\xC3": "A",
  1534. "\xC4": "A",
  1535. "\xC5": "A",
  1536. "\xE0": "a",
  1537. "\xE1": "a",
  1538. "\xE2": "a",
  1539. "\xE3": "a",
  1540. "\xE4": "a",
  1541. "\xE5": "a",
  1542. "\xC7": "C",
  1543. "\xE7": "c",
  1544. "\xD0": "D",
  1545. "\xF0": "d",
  1546. "\xC8": "E",
  1547. "\xC9": "E",
  1548. "\xCA": "E",
  1549. "\xCB": "E",
  1550. "\xE8": "e",
  1551. "\xE9": "e",
  1552. "\xEA": "e",
  1553. "\xEB": "e",
  1554. "\xCC": "I",
  1555. "\xCD": "I",
  1556. "\xCE": "I",
  1557. "\xCF": "I",
  1558. "\xEC": "i",
  1559. "\xED": "i",
  1560. "\xEE": "i",
  1561. "\xEF": "i",
  1562. "\xD1": "N",
  1563. "\xF1": "n",
  1564. "\xD2": "O",
  1565. "\xD3": "O",
  1566. "\xD4": "O",
  1567. "\xD5": "O",
  1568. "\xD6": "O",
  1569. "\xD8": "O",
  1570. "\xF2": "o",
  1571. "\xF3": "o",
  1572. "\xF4": "o",
  1573. "\xF5": "o",
  1574. "\xF6": "o",
  1575. "\xF8": "o",
  1576. "\xD9": "U",
  1577. "\xDA": "U",
  1578. "\xDB": "U",
  1579. "\xDC": "U",
  1580. "\xF9": "u",
  1581. "\xFA": "u",
  1582. "\xFB": "u",
  1583. "\xFC": "u",
  1584. "\xDD": "Y",
  1585. "\xFD": "y",
  1586. "\xFF": "y",
  1587. "\xC6": "Ae",
  1588. "\xE6": "ae",
  1589. "\xDE": "Th",
  1590. "\xFE": "th",
  1591. "\xDF": "ss",
  1592. "\u0100": "A",
  1593. "\u0102": "A",
  1594. "\u0104": "A",
  1595. "\u0101": "a",
  1596. "\u0103": "a",
  1597. "\u0105": "a",
  1598. "\u0106": "C",
  1599. "\u0108": "C",
  1600. "\u010A": "C",
  1601. "\u010C": "C",
  1602. "\u0107": "c",
  1603. "\u0109": "c",
  1604. "\u010B": "c",
  1605. "\u010D": "c",
  1606. "\u010E": "D",
  1607. "\u0110": "D",
  1608. "\u010F": "d",
  1609. "\u0111": "d",
  1610. "\u0112": "E",
  1611. "\u0114": "E",
  1612. "\u0116": "E",
  1613. "\u0118": "E",
  1614. "\u011A": "E",
  1615. "\u0113": "e",
  1616. "\u0115": "e",
  1617. "\u0117": "e",
  1618. "\u0119": "e",
  1619. "\u011B": "e",
  1620. "\u011C": "G",
  1621. "\u011E": "G",
  1622. "\u0120": "G",
  1623. "\u0122": "G",
  1624. "\u011D": "g",
  1625. "\u011F": "g",
  1626. "\u0121": "g",
  1627. "\u0123": "g",
  1628. "\u0124": "H",
  1629. "\u0126": "H",
  1630. "\u0125": "h",
  1631. "\u0127": "h",
  1632. "\u0128": "I",
  1633. "\u012A": "I",
  1634. "\u012C": "I",
  1635. "\u012E": "I",
  1636. "\u0130": "I",
  1637. "\u0129": "i",
  1638. "\u012B": "i",
  1639. "\u012D": "i",
  1640. "\u012F": "i",
  1641. "\u0131": "i",
  1642. "\u0134": "J",
  1643. "\u0135": "j",
  1644. "\u0136": "K",
  1645. "\u0137": "k",
  1646. "\u0138": "k",
  1647. "\u0139": "L",
  1648. "\u013B": "L",
  1649. "\u013D": "L",
  1650. "\u013F": "L",
  1651. "\u0141": "L",
  1652. "\u013A": "l",
  1653. "\u013C": "l",
  1654. "\u013E": "l",
  1655. "\u0140": "l",
  1656. "\u0142": "l",
  1657. "\u0143": "N",
  1658. "\u0145": "N",
  1659. "\u0147": "N",
  1660. "\u014A": "N",
  1661. "\u0144": "n",
  1662. "\u0146": "n",
  1663. "\u0148": "n",
  1664. "\u014B": "n",
  1665. "\u014C": "O",
  1666. "\u014E": "O",
  1667. "\u0150": "O",
  1668. "\u014D": "o",
  1669. "\u014F": "o",
  1670. "\u0151": "o",
  1671. "\u0154": "R",
  1672. "\u0156": "R",
  1673. "\u0158": "R",
  1674. "\u0155": "r",
  1675. "\u0157": "r",
  1676. "\u0159": "r",
  1677. "\u015A": "S",
  1678. "\u015C": "S",
  1679. "\u015E": "S",
  1680. "\u0160": "S",
  1681. "\u015B": "s",
  1682. "\u015D": "s",
  1683. "\u015F": "s",
  1684. "\u0161": "s",
  1685. "\u0162": "T",
  1686. "\u0164": "T",
  1687. "\u0166": "T",
  1688. "\u0163": "t",
  1689. "\u0165": "t",
  1690. "\u0167": "t",
  1691. "\u0168": "U",
  1692. "\u016A": "U",
  1693. "\u016C": "U",
  1694. "\u016E": "U",
  1695. "\u0170": "U",
  1696. "\u0172": "U",
  1697. "\u0169": "u",
  1698. "\u016B": "u",
  1699. "\u016D": "u",
  1700. "\u016F": "u",
  1701. "\u0171": "u",
  1702. "\u0173": "u",
  1703. "\u0174": "W",
  1704. "\u0175": "w",
  1705. "\u0176": "Y",
  1706. "\u0177": "y",
  1707. "\u0178": "Y",
  1708. "\u0179": "Z",
  1709. "\u017B": "Z",
  1710. "\u017D": "Z",
  1711. "\u017A": "z",
  1712. "\u017C": "z",
  1713. "\u017E": "z",
  1714. "\u0132": "IJ",
  1715. "\u0133": "ij",
  1716. "\u0152": "Oe",
  1717. "\u0153": "oe",
  1718. "\u0149": "'n",
  1719. "\u017F": "s"
  1720. };
  1721. var deburrLetter = basePropertyOf(deburredLetters);
  1722. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1723. var rsComboMarksRange$2 = "\\u0300-\\u036f";
  1724. var reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f";
  1725. var rsComboSymbolsRange$2 = "\\u20d0-\\u20ff";
  1726. var rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2;
  1727. var rsCombo$2 = "[" + rsComboRange$2 + "]";
  1728. var reComboMark = RegExp(rsCombo$2, "g");
  1729. function deburr(string) {
  1730. string = toString(string);
  1731. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
  1732. }
  1733. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1734. function asciiWords(string) {
  1735. return string.match(reAsciiWord) || [];
  1736. }
  1737. var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
  1738. function hasUnicodeWord(string) {
  1739. return reHasUnicodeWord.test(string);
  1740. }
  1741. var rsAstralRange$1 = "\\ud800-\\udfff";
  1742. var rsComboMarksRange$1 = "\\u0300-\\u036f";
  1743. var reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f";
  1744. var rsComboSymbolsRange$1 = "\\u20d0-\\u20ff";
  1745. var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
  1746. var rsDingbatRange = "\\u2700-\\u27bf";
  1747. var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
  1748. var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
  1749. var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
  1750. var rsPunctuationRange = "\\u2000-\\u206f";
  1751. var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
  1752. var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
  1753. var rsVarRange$1 = "\\ufe0e\\ufe0f";
  1754. var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1755. var rsApos$1 = "['\u2019]";
  1756. var rsBreak = "[" + rsBreakRange + "]";
  1757. var rsCombo$1 = "[" + rsComboRange$1 + "]";
  1758. var rsDigits = "\\d+";
  1759. var rsDingbat = "[" + rsDingbatRange + "]";
  1760. var rsLower = "[" + rsLowerRange + "]";
  1761. var rsMisc = "[^" + rsAstralRange$1 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
  1762. var rsFitz$1 = "\\ud83c[\\udffb-\\udfff]";
  1763. var rsModifier$1 = "(?:" + rsCombo$1 + "|" + rsFitz$1 + ")";
  1764. var rsNonAstral$1 = "[^" + rsAstralRange$1 + "]";
  1765. var rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}";
  1766. var rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]";
  1767. var rsUpper = "[" + rsUpperRange + "]";
  1768. var rsZWJ$1 = "\\u200d";
  1769. var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
  1770. var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
  1771. var rsOptContrLower = "(?:" + rsApos$1 + "(?:d|ll|m|re|s|t|ve))?";
  1772. var rsOptContrUpper = "(?:" + rsApos$1 + "(?:D|LL|M|RE|S|T|VE))?";
  1773. var reOptMod$1 = rsModifier$1 + "?";
  1774. var rsOptVar$1 = "[" + rsVarRange$1 + "]?";
  1775. var rsOptJoin$1 = "(?:" + rsZWJ$1 + "(?:" + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsOptVar$1 + reOptMod$1 + ")*";
  1776. var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
  1777. var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
  1778. var rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1;
  1779. var rsEmoji = "(?:" + [rsDingbat, rsRegional$1, rsSurrPair$1].join("|") + ")" + rsSeq$1;
  1780. var reUnicodeWord = RegExp([
  1781. rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
  1782. rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
  1783. rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
  1784. rsUpper + "+" + rsOptContrUpper,
  1785. rsOrdUpper,
  1786. rsOrdLower,
  1787. rsDigits,
  1788. rsEmoji
  1789. ].join("|"), "g");
  1790. function unicodeWords(string) {
  1791. return string.match(reUnicodeWord) || [];
  1792. }
  1793. function words(string, pattern, guard) {
  1794. string = toString(string);
  1795. pattern = guard ? void 0 : pattern;
  1796. if (pattern === void 0) {
  1797. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  1798. }
  1799. return string.match(pattern) || [];
  1800. }
  1801. var rsApos = "['\u2019]";
  1802. var reApos = RegExp(rsApos, "g");
  1803. function createCompounder(callback) {
  1804. return function(string) {
  1805. return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
  1806. };
  1807. }
  1808. var camelCase = createCompounder(function(result, word, index) {
  1809. word = word.toLowerCase();
  1810. return result + (index ? capitalize$2(word) : word);
  1811. });
  1812. function castArray$1() {
  1813. if (!arguments.length) {
  1814. return [];
  1815. }
  1816. var value = arguments[0];
  1817. return isArray$1(value) ? value : [value];
  1818. }
  1819. var nativeIsFinite$1 = root.isFinite;
  1820. var nativeMin$c = Math.min;
  1821. function createRound(methodName) {
  1822. var func = Math[methodName];
  1823. return function(number, precision) {
  1824. number = toNumber(number);
  1825. precision = precision == null ? 0 : nativeMin$c(toInteger(precision), 292);
  1826. if (precision && nativeIsFinite$1(number)) {
  1827. var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
  1828. pair = (toString(value) + "e").split("e");
  1829. return +(pair[0] + "e" + (+pair[1] - precision));
  1830. }
  1831. return func(number);
  1832. };
  1833. }
  1834. var ceil = createRound("ceil");
  1835. function chain(value) {
  1836. var result = lodash(value);
  1837. result.__chain__ = true;
  1838. return result;
  1839. }
  1840. var nativeCeil$3 = Math.ceil;
  1841. var nativeMax$c = Math.max;
  1842. function chunk(array, size, guard) {
  1843. if (guard ? isIterateeCall(array, size, guard) : size === void 0) {
  1844. size = 1;
  1845. } else {
  1846. size = nativeMax$c(toInteger(size), 0);
  1847. }
  1848. var length = array == null ? 0 : array.length;
  1849. if (!length || size < 1) {
  1850. return [];
  1851. }
  1852. var index = 0, resIndex = 0, result = Array(nativeCeil$3(length / size));
  1853. while (index < length) {
  1854. result[resIndex++] = baseSlice(array, index, index += size);
  1855. }
  1856. return result;
  1857. }
  1858. function baseClamp(number, lower, upper) {
  1859. if (number === number) {
  1860. if (upper !== void 0) {
  1861. number = number <= upper ? number : upper;
  1862. }
  1863. if (lower !== void 0) {
  1864. number = number >= lower ? number : lower;
  1865. }
  1866. }
  1867. return number;
  1868. }
  1869. function clamp(number, lower, upper) {
  1870. if (upper === void 0) {
  1871. upper = lower;
  1872. lower = void 0;
  1873. }
  1874. if (upper !== void 0) {
  1875. upper = toNumber(upper);
  1876. upper = upper === upper ? upper : 0;
  1877. }
  1878. if (lower !== void 0) {
  1879. lower = toNumber(lower);
  1880. lower = lower === lower ? lower : 0;
  1881. }
  1882. return baseClamp(toNumber(number), lower, upper);
  1883. }
  1884. function stackClear() {
  1885. this.__data__ = new ListCache();
  1886. this.size = 0;
  1887. }
  1888. function stackDelete(key) {
  1889. var data = this.__data__, result = data["delete"](key);
  1890. this.size = data.size;
  1891. return result;
  1892. }
  1893. function stackGet(key) {
  1894. return this.__data__.get(key);
  1895. }
  1896. function stackHas(key) {
  1897. return this.__data__.has(key);
  1898. }
  1899. var LARGE_ARRAY_SIZE$2 = 200;
  1900. function stackSet(key, value) {
  1901. var data = this.__data__;
  1902. if (data instanceof ListCache) {
  1903. var pairs = data.__data__;
  1904. if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$2 - 1) {
  1905. pairs.push([key, value]);
  1906. this.size = ++data.size;
  1907. return this;
  1908. }
  1909. data = this.__data__ = new MapCache(pairs);
  1910. }
  1911. data.set(key, value);
  1912. this.size = data.size;
  1913. return this;
  1914. }
  1915. function Stack(entries) {
  1916. var data = this.__data__ = new ListCache(entries);
  1917. this.size = data.size;
  1918. }
  1919. Stack.prototype.clear = stackClear;
  1920. Stack.prototype["delete"] = stackDelete;
  1921. Stack.prototype.get = stackGet;
  1922. Stack.prototype.has = stackHas;
  1923. Stack.prototype.set = stackSet;
  1924. function baseAssign(object, source) {
  1925. return object && copyObject(source, keys(source), object);
  1926. }
  1927. function baseAssignIn(object, source) {
  1928. return object && copyObject(source, keysIn(source), object);
  1929. }
  1930. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  1931. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  1932. var moduleExports = freeModule && freeModule.exports === freeExports;
  1933. var Buffer = moduleExports ? root.Buffer : void 0;
  1934. var allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0;
  1935. function cloneBuffer(buffer, isDeep) {
  1936. if (isDeep) {
  1937. return buffer.slice();
  1938. }
  1939. var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  1940. buffer.copy(result);
  1941. return result;
  1942. }
  1943. function arrayFilter(array, predicate) {
  1944. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  1945. while (++index < length) {
  1946. var value = array[index];
  1947. if (predicate(value, index, array)) {
  1948. result[resIndex++] = value;
  1949. }
  1950. }
  1951. return result;
  1952. }
  1953. function stubArray() {
  1954. return [];
  1955. }
  1956. var objectProto$d = Object.prototype;
  1957. var propertyIsEnumerable = objectProto$d.propertyIsEnumerable;
  1958. var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
  1959. var getSymbols = !nativeGetSymbols$1 ? stubArray : function(object) {
  1960. if (object == null) {
  1961. return [];
  1962. }
  1963. object = Object(object);
  1964. return arrayFilter(nativeGetSymbols$1(object), function(symbol) {
  1965. return propertyIsEnumerable.call(object, symbol);
  1966. });
  1967. };
  1968. function copySymbols(source, object) {
  1969. return copyObject(source, getSymbols(source), object);
  1970. }
  1971. var nativeGetSymbols = Object.getOwnPropertySymbols;
  1972. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  1973. var result = [];
  1974. while (object) {
  1975. arrayPush(result, getSymbols(object));
  1976. object = getPrototype(object);
  1977. }
  1978. return result;
  1979. };
  1980. function copySymbolsIn(source, object) {
  1981. return copyObject(source, getSymbolsIn(source), object);
  1982. }
  1983. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  1984. var result = keysFunc(object);
  1985. return isArray$1(object) ? result : arrayPush(result, symbolsFunc(object));
  1986. }
  1987. function getAllKeys(object) {
  1988. return baseGetAllKeys(object, keys, getSymbols);
  1989. }
  1990. function getAllKeysIn(object) {
  1991. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  1992. }
  1993. var DataView = getNative(root, "DataView");
  1994. var Promise$1 = getNative(root, "Promise");
  1995. var Set$1 = getNative(root, "Set");
  1996. var mapTag$8 = "[object Map]";
  1997. var objectTag$2 = "[object Object]";
  1998. var promiseTag = "[object Promise]";
  1999. var setTag$8 = "[object Set]";
  2000. var weakMapTag$2 = "[object WeakMap]";
  2001. var dataViewTag$3 = "[object DataView]";
  2002. var dataViewCtorString = toSource(DataView);
  2003. var mapCtorString = toSource(Map$1);
  2004. var promiseCtorString = toSource(Promise$1);
  2005. var setCtorString = toSource(Set$1);
  2006. var weakMapCtorString = toSource(WeakMap);
  2007. var getTag = baseGetTag;
  2008. if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$8 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$8 || WeakMap && getTag(new WeakMap()) != weakMapTag$2) {
  2009. getTag = function(value) {
  2010. var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  2011. if (ctorString) {
  2012. switch (ctorString) {
  2013. case dataViewCtorString:
  2014. return dataViewTag$3;
  2015. case mapCtorString:
  2016. return mapTag$8;
  2017. case promiseCtorString:
  2018. return promiseTag;
  2019. case setCtorString:
  2020. return setTag$8;
  2021. case weakMapCtorString:
  2022. return weakMapTag$2;
  2023. }
  2024. }
  2025. return result;
  2026. };
  2027. }
  2028. var getTag$1 = getTag;
  2029. var objectProto$c = Object.prototype;
  2030. var hasOwnProperty$c = objectProto$c.hasOwnProperty;
  2031. function initCloneArray(array) {
  2032. var length = array.length, result = new array.constructor(length);
  2033. if (length && typeof array[0] == "string" && hasOwnProperty$c.call(array, "index")) {
  2034. result.index = array.index;
  2035. result.input = array.input;
  2036. }
  2037. return result;
  2038. }
  2039. var Uint8Array = root.Uint8Array;
  2040. function cloneArrayBuffer(arrayBuffer) {
  2041. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  2042. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  2043. return result;
  2044. }
  2045. function cloneDataView(dataView, isDeep) {
  2046. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  2047. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  2048. }
  2049. var reFlags$1 = /\w*$/;
  2050. function cloneRegExp(regexp) {
  2051. var result = new regexp.constructor(regexp.source, reFlags$1.exec(regexp));
  2052. result.lastIndex = regexp.lastIndex;
  2053. return result;
  2054. }
  2055. var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0;
  2056. var symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
  2057. function cloneSymbol(symbol) {
  2058. return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
  2059. }
  2060. function cloneTypedArray(typedArray, isDeep) {
  2061. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  2062. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  2063. }
  2064. var boolTag$3 = "[object Boolean]";
  2065. var dateTag$3 = "[object Date]";
  2066. var mapTag$7 = "[object Map]";
  2067. var numberTag$3 = "[object Number]";
  2068. var regexpTag$3 = "[object RegExp]";
  2069. var setTag$7 = "[object Set]";
  2070. var stringTag$3 = "[object String]";
  2071. var symbolTag$2 = "[object Symbol]";
  2072. var arrayBufferTag$3 = "[object ArrayBuffer]";
  2073. var dataViewTag$2 = "[object DataView]";
  2074. var float32Tag$1 = "[object Float32Array]";
  2075. var float64Tag$1 = "[object Float64Array]";
  2076. var int8Tag$1 = "[object Int8Array]";
  2077. var int16Tag$1 = "[object Int16Array]";
  2078. var int32Tag$1 = "[object Int32Array]";
  2079. var uint8Tag$1 = "[object Uint8Array]";
  2080. var uint8ClampedTag$1 = "[object Uint8ClampedArray]";
  2081. var uint16Tag$1 = "[object Uint16Array]";
  2082. var uint32Tag$1 = "[object Uint32Array]";
  2083. function initCloneByTag(object, tag, isDeep) {
  2084. var Ctor = object.constructor;
  2085. switch (tag) {
  2086. case arrayBufferTag$3:
  2087. return cloneArrayBuffer(object);
  2088. case boolTag$3:
  2089. case dateTag$3:
  2090. return new Ctor(+object);
  2091. case dataViewTag$2:
  2092. return cloneDataView(object, isDeep);
  2093. case float32Tag$1:
  2094. case float64Tag$1:
  2095. case int8Tag$1:
  2096. case int16Tag$1:
  2097. case int32Tag$1:
  2098. case uint8Tag$1:
  2099. case uint8ClampedTag$1:
  2100. case uint16Tag$1:
  2101. case uint32Tag$1:
  2102. return cloneTypedArray(object, isDeep);
  2103. case mapTag$7:
  2104. return new Ctor();
  2105. case numberTag$3:
  2106. case stringTag$3:
  2107. return new Ctor(object);
  2108. case regexpTag$3:
  2109. return cloneRegExp(object);
  2110. case setTag$7:
  2111. return new Ctor();
  2112. case symbolTag$2:
  2113. return cloneSymbol(object);
  2114. }
  2115. }
  2116. function initCloneObject(object) {
  2117. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  2118. }
  2119. var mapTag$6 = "[object Map]";
  2120. function baseIsMap(value) {
  2121. return isObjectLike(value) && getTag$1(value) == mapTag$6;
  2122. }
  2123. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  2124. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  2125. var setTag$6 = "[object Set]";
  2126. function baseIsSet(value) {
  2127. return isObjectLike(value) && getTag$1(value) == setTag$6;
  2128. }
  2129. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  2130. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  2131. var CLONE_DEEP_FLAG$7 = 1;
  2132. var CLONE_FLAT_FLAG$1 = 2;
  2133. var CLONE_SYMBOLS_FLAG$5 = 4;
  2134. var argsTag$1 = "[object Arguments]";
  2135. var arrayTag$1 = "[object Array]";
  2136. var boolTag$2 = "[object Boolean]";
  2137. var dateTag$2 = "[object Date]";
  2138. var errorTag$1 = "[object Error]";
  2139. var funcTag = "[object Function]";
  2140. var genTag = "[object GeneratorFunction]";
  2141. var mapTag$5 = "[object Map]";
  2142. var numberTag$2 = "[object Number]";
  2143. var objectTag$1 = "[object Object]";
  2144. var regexpTag$2 = "[object RegExp]";
  2145. var setTag$5 = "[object Set]";
  2146. var stringTag$2 = "[object String]";
  2147. var symbolTag$1 = "[object Symbol]";
  2148. var weakMapTag$1 = "[object WeakMap]";
  2149. var arrayBufferTag$2 = "[object ArrayBuffer]";
  2150. var dataViewTag$1 = "[object DataView]";
  2151. var float32Tag = "[object Float32Array]";
  2152. var float64Tag = "[object Float64Array]";
  2153. var int8Tag = "[object Int8Array]";
  2154. var int16Tag = "[object Int16Array]";
  2155. var int32Tag = "[object Int32Array]";
  2156. var uint8Tag = "[object Uint8Array]";
  2157. var uint8ClampedTag = "[object Uint8ClampedArray]";
  2158. var uint16Tag = "[object Uint16Array]";
  2159. var uint32Tag = "[object Uint32Array]";
  2160. var cloneableTags = {};
  2161. cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$2] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$2] = cloneableTags[dateTag$2] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$5] = cloneableTags[numberTag$2] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$2] = cloneableTags[setTag$5] = cloneableTags[stringTag$2] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  2162. cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag$1] = false;
  2163. function baseClone(value, bitmask, customizer, key, object, stack) {
  2164. var result, isDeep = bitmask & CLONE_DEEP_FLAG$7, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$5;
  2165. if (customizer) {
  2166. result = object ? customizer(value, key, object, stack) : customizer(value);
  2167. }
  2168. if (result !== void 0) {
  2169. return result;
  2170. }
  2171. if (!isObject$2(value)) {
  2172. return value;
  2173. }
  2174. var isArr = isArray$1(value);
  2175. if (isArr) {
  2176. result = initCloneArray(value);
  2177. if (!isDeep) {
  2178. return copyArray(value, result);
  2179. }
  2180. } else {
  2181. var tag = getTag$1(value), isFunc = tag == funcTag || tag == genTag;
  2182. if (isBuffer(value)) {
  2183. return cloneBuffer(value, isDeep);
  2184. }
  2185. if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
  2186. result = isFlat || isFunc ? {} : initCloneObject(value);
  2187. if (!isDeep) {
  2188. return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
  2189. }
  2190. } else {
  2191. if (!cloneableTags[tag]) {
  2192. return object ? value : {};
  2193. }
  2194. result = initCloneByTag(value, tag, isDeep);
  2195. }
  2196. }
  2197. stack || (stack = new Stack());
  2198. var stacked = stack.get(value);
  2199. if (stacked) {
  2200. return stacked;
  2201. }
  2202. stack.set(value, result);
  2203. if (isSet(value)) {
  2204. value.forEach(function(subValue) {
  2205. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  2206. });
  2207. } else if (isMap(value)) {
  2208. value.forEach(function(subValue, key2) {
  2209. result.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  2210. });
  2211. }
  2212. var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
  2213. var props = isArr ? void 0 : keysFunc(value);
  2214. arrayEach(props || value, function(subValue, key2) {
  2215. if (props) {
  2216. key2 = subValue;
  2217. subValue = value[key2];
  2218. }
  2219. assignValue(result, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
  2220. });
  2221. return result;
  2222. }
  2223. var CLONE_SYMBOLS_FLAG$4 = 4;
  2224. function clone(value) {
  2225. return baseClone(value, CLONE_SYMBOLS_FLAG$4);
  2226. }
  2227. var CLONE_DEEP_FLAG$6 = 1;
  2228. var CLONE_SYMBOLS_FLAG$3 = 4;
  2229. function cloneDeep(value) {
  2230. return baseClone(value, CLONE_DEEP_FLAG$6 | CLONE_SYMBOLS_FLAG$3);
  2231. }
  2232. var CLONE_DEEP_FLAG$5 = 1;
  2233. var CLONE_SYMBOLS_FLAG$2 = 4;
  2234. function cloneDeepWith(value, customizer) {
  2235. customizer = typeof customizer == "function" ? customizer : void 0;
  2236. return baseClone(value, CLONE_DEEP_FLAG$5 | CLONE_SYMBOLS_FLAG$2, customizer);
  2237. }
  2238. var CLONE_SYMBOLS_FLAG$1 = 4;
  2239. function cloneWith(value, customizer) {
  2240. customizer = typeof customizer == "function" ? customizer : void 0;
  2241. return baseClone(value, CLONE_SYMBOLS_FLAG$1, customizer);
  2242. }
  2243. function wrapperCommit() {
  2244. return new LodashWrapper(this.value(), this.__chain__);
  2245. }
  2246. function compact(array) {
  2247. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  2248. while (++index < length) {
  2249. var value = array[index];
  2250. if (value) {
  2251. result[resIndex++] = value;
  2252. }
  2253. }
  2254. return result;
  2255. }
  2256. function concat() {
  2257. var length = arguments.length;
  2258. if (!length) {
  2259. return [];
  2260. }
  2261. var args = Array(length - 1), array = arguments[0], index = length;
  2262. while (index--) {
  2263. args[index - 1] = arguments[index];
  2264. }
  2265. return arrayPush(isArray$1(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  2266. }
  2267. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  2268. function setCacheAdd(value) {
  2269. this.__data__.set(value, HASH_UNDEFINED);
  2270. return this;
  2271. }
  2272. function setCacheHas(value) {
  2273. return this.__data__.has(value);
  2274. }
  2275. function SetCache(values) {
  2276. var index = -1, length = values == null ? 0 : values.length;
  2277. this.__data__ = new MapCache();
  2278. while (++index < length) {
  2279. this.add(values[index]);
  2280. }
  2281. }
  2282. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  2283. SetCache.prototype.has = setCacheHas;
  2284. function arraySome(array, predicate) {
  2285. var index = -1, length = array == null ? 0 : array.length;
  2286. while (++index < length) {
  2287. if (predicate(array[index], index, array)) {
  2288. return true;
  2289. }
  2290. }
  2291. return false;
  2292. }
  2293. function cacheHas(cache, key) {
  2294. return cache.has(key);
  2295. }
  2296. var COMPARE_PARTIAL_FLAG$5 = 1;
  2297. var COMPARE_UNORDERED_FLAG$3 = 2;
  2298. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  2299. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
  2300. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  2301. return false;
  2302. }
  2303. var arrStacked = stack.get(array);
  2304. var othStacked = stack.get(other);
  2305. if (arrStacked && othStacked) {
  2306. return arrStacked == other && othStacked == array;
  2307. }
  2308. var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
  2309. stack.set(array, other);
  2310. stack.set(other, array);
  2311. while (++index < arrLength) {
  2312. var arrValue = array[index], othValue = other[index];
  2313. if (customizer) {
  2314. var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  2315. }
  2316. if (compared !== void 0) {
  2317. if (compared) {
  2318. continue;
  2319. }
  2320. result = false;
  2321. break;
  2322. }
  2323. if (seen) {
  2324. if (!arraySome(other, function(othValue2, othIndex) {
  2325. if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
  2326. return seen.push(othIndex);
  2327. }
  2328. })) {
  2329. result = false;
  2330. break;
  2331. }
  2332. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  2333. result = false;
  2334. break;
  2335. }
  2336. }
  2337. stack["delete"](array);
  2338. stack["delete"](other);
  2339. return result;
  2340. }
  2341. function mapToArray(map) {
  2342. var index = -1, result = Array(map.size);
  2343. map.forEach(function(value, key) {
  2344. result[++index] = [key, value];
  2345. });
  2346. return result;
  2347. }
  2348. function setToArray(set) {
  2349. var index = -1, result = Array(set.size);
  2350. set.forEach(function(value) {
  2351. result[++index] = value;
  2352. });
  2353. return result;
  2354. }
  2355. var COMPARE_PARTIAL_FLAG$4 = 1;
  2356. var COMPARE_UNORDERED_FLAG$2 = 2;
  2357. var boolTag$1 = "[object Boolean]";
  2358. var dateTag$1 = "[object Date]";
  2359. var errorTag = "[object Error]";
  2360. var mapTag$4 = "[object Map]";
  2361. var numberTag$1 = "[object Number]";
  2362. var regexpTag$1 = "[object RegExp]";
  2363. var setTag$4 = "[object Set]";
  2364. var stringTag$1 = "[object String]";
  2365. var symbolTag = "[object Symbol]";
  2366. var arrayBufferTag$1 = "[object ArrayBuffer]";
  2367. var dataViewTag = "[object DataView]";
  2368. var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0;
  2369. var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  2370. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  2371. switch (tag) {
  2372. case dataViewTag:
  2373. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
  2374. return false;
  2375. }
  2376. object = object.buffer;
  2377. other = other.buffer;
  2378. case arrayBufferTag$1:
  2379. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  2380. return false;
  2381. }
  2382. return true;
  2383. case boolTag$1:
  2384. case dateTag$1:
  2385. case numberTag$1:
  2386. return eq(+object, +other);
  2387. case errorTag:
  2388. return object.name == other.name && object.message == other.message;
  2389. case regexpTag$1:
  2390. case stringTag$1:
  2391. return object == other + "";
  2392. case mapTag$4:
  2393. var convert = mapToArray;
  2394. case setTag$4:
  2395. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
  2396. convert || (convert = setToArray);
  2397. if (object.size != other.size && !isPartial) {
  2398. return false;
  2399. }
  2400. var stacked = stack.get(object);
  2401. if (stacked) {
  2402. return stacked == other;
  2403. }
  2404. bitmask |= COMPARE_UNORDERED_FLAG$2;
  2405. stack.set(object, other);
  2406. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  2407. stack["delete"](object);
  2408. return result;
  2409. case symbolTag:
  2410. if (symbolValueOf) {
  2411. return symbolValueOf.call(object) == symbolValueOf.call(other);
  2412. }
  2413. }
  2414. return false;
  2415. }
  2416. var COMPARE_PARTIAL_FLAG$3 = 1;
  2417. var objectProto$b = Object.prototype;
  2418. var hasOwnProperty$b = objectProto$b.hasOwnProperty;
  2419. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  2420. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
  2421. if (objLength != othLength && !isPartial) {
  2422. return false;
  2423. }
  2424. var index = objLength;
  2425. while (index--) {
  2426. var key = objProps[index];
  2427. if (!(isPartial ? key in other : hasOwnProperty$b.call(other, key))) {
  2428. return false;
  2429. }
  2430. }
  2431. var objStacked = stack.get(object);
  2432. var othStacked = stack.get(other);
  2433. if (objStacked && othStacked) {
  2434. return objStacked == other && othStacked == object;
  2435. }
  2436. var result = true;
  2437. stack.set(object, other);
  2438. stack.set(other, object);
  2439. var skipCtor = isPartial;
  2440. while (++index < objLength) {
  2441. key = objProps[index];
  2442. var objValue = object[key], othValue = other[key];
  2443. if (customizer) {
  2444. var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  2445. }
  2446. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  2447. result = false;
  2448. break;
  2449. }
  2450. skipCtor || (skipCtor = key == "constructor");
  2451. }
  2452. if (result && !skipCtor) {
  2453. var objCtor = object.constructor, othCtor = other.constructor;
  2454. if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
  2455. result = false;
  2456. }
  2457. }
  2458. stack["delete"](object);
  2459. stack["delete"](other);
  2460. return result;
  2461. }
  2462. var COMPARE_PARTIAL_FLAG$2 = 1;
  2463. var argsTag = "[object Arguments]";
  2464. var arrayTag = "[object Array]";
  2465. var objectTag = "[object Object]";
  2466. var objectProto$a = Object.prototype;
  2467. var hasOwnProperty$a = objectProto$a.hasOwnProperty;
  2468. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  2469. var objIsArr = isArray$1(object), othIsArr = isArray$1(other), objTag = objIsArr ? arrayTag : getTag$1(object), othTag = othIsArr ? arrayTag : getTag$1(other);
  2470. objTag = objTag == argsTag ? objectTag : objTag;
  2471. othTag = othTag == argsTag ? objectTag : othTag;
  2472. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  2473. if (isSameTag && isBuffer(object)) {
  2474. if (!isBuffer(other)) {
  2475. return false;
  2476. }
  2477. objIsArr = true;
  2478. objIsObj = false;
  2479. }
  2480. if (isSameTag && !objIsObj) {
  2481. stack || (stack = new Stack());
  2482. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  2483. }
  2484. if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
  2485. var objIsWrapped = objIsObj && hasOwnProperty$a.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$a.call(other, "__wrapped__");
  2486. if (objIsWrapped || othIsWrapped) {
  2487. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  2488. stack || (stack = new Stack());
  2489. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  2490. }
  2491. }
  2492. if (!isSameTag) {
  2493. return false;
  2494. }
  2495. stack || (stack = new Stack());
  2496. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  2497. }
  2498. function baseIsEqual(value, other, bitmask, customizer, stack) {
  2499. if (value === other) {
  2500. return true;
  2501. }
  2502. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
  2503. return value !== value && other !== other;
  2504. }
  2505. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  2506. }
  2507. var COMPARE_PARTIAL_FLAG$1 = 1;
  2508. var COMPARE_UNORDERED_FLAG$1 = 2;
  2509. function baseIsMatch(object, source, matchData, customizer) {
  2510. var index = matchData.length, length = index, noCustomizer = !customizer;
  2511. if (object == null) {
  2512. return !length;
  2513. }
  2514. object = Object(object);
  2515. while (index--) {
  2516. var data = matchData[index];
  2517. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
  2518. return false;
  2519. }
  2520. }
  2521. while (++index < length) {
  2522. data = matchData[index];
  2523. var key = data[0], objValue = object[key], srcValue = data[1];
  2524. if (noCustomizer && data[2]) {
  2525. if (objValue === void 0 && !(key in object)) {
  2526. return false;
  2527. }
  2528. } else {
  2529. var stack = new Stack();
  2530. if (customizer) {
  2531. var result = customizer(objValue, srcValue, key, object, source, stack);
  2532. }
  2533. if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) {
  2534. return false;
  2535. }
  2536. }
  2537. }
  2538. return true;
  2539. }
  2540. function isStrictComparable(value) {
  2541. return value === value && !isObject$2(value);
  2542. }
  2543. function getMatchData(object) {
  2544. var result = keys(object), length = result.length;
  2545. while (length--) {
  2546. var key = result[length], value = object[key];
  2547. result[length] = [key, value, isStrictComparable(value)];
  2548. }
  2549. return result;
  2550. }
  2551. function matchesStrictComparable(key, srcValue) {
  2552. return function(object) {
  2553. if (object == null) {
  2554. return false;
  2555. }
  2556. return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
  2557. };
  2558. }
  2559. function baseMatches(source) {
  2560. var matchData = getMatchData(source);
  2561. if (matchData.length == 1 && matchData[0][2]) {
  2562. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  2563. }
  2564. return function(object) {
  2565. return object === source || baseIsMatch(object, source, matchData);
  2566. };
  2567. }
  2568. function baseHasIn(object, key) {
  2569. return object != null && key in Object(object);
  2570. }
  2571. function hasPath(object, path, hasFunc) {
  2572. path = castPath(path, object);
  2573. var index = -1, length = path.length, result = false;
  2574. while (++index < length) {
  2575. var key = toKey(path[index]);
  2576. if (!(result = object != null && hasFunc(object, key))) {
  2577. break;
  2578. }
  2579. object = object[key];
  2580. }
  2581. if (result || ++index != length) {
  2582. return result;
  2583. }
  2584. length = object == null ? 0 : object.length;
  2585. return !!length && isLength(length) && isIndex(key, length) && (isArray$1(object) || isArguments(object));
  2586. }
  2587. function hasIn(object, path) {
  2588. return object != null && hasPath(object, path, baseHasIn);
  2589. }
  2590. var COMPARE_PARTIAL_FLAG = 1;
  2591. var COMPARE_UNORDERED_FLAG = 2;
  2592. function baseMatchesProperty(path, srcValue) {
  2593. if (isKey(path) && isStrictComparable(srcValue)) {
  2594. return matchesStrictComparable(toKey(path), srcValue);
  2595. }
  2596. return function(object) {
  2597. var objValue = get(object, path);
  2598. return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  2599. };
  2600. }
  2601. function baseProperty(key) {
  2602. return function(object) {
  2603. return object == null ? void 0 : object[key];
  2604. };
  2605. }
  2606. function basePropertyDeep(path) {
  2607. return function(object) {
  2608. return baseGet(object, path);
  2609. };
  2610. }
  2611. function property(path) {
  2612. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  2613. }
  2614. function baseIteratee(value) {
  2615. if (typeof value == "function") {
  2616. return value;
  2617. }
  2618. if (value == null) {
  2619. return identity$1;
  2620. }
  2621. if (typeof value == "object") {
  2622. return isArray$1(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  2623. }
  2624. return property(value);
  2625. }
  2626. var FUNC_ERROR_TEXT$7 = "Expected a function";
  2627. function cond(pairs) {
  2628. var length = pairs == null ? 0 : pairs.length, toIteratee = baseIteratee;
  2629. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  2630. if (typeof pair[1] != "function") {
  2631. throw new TypeError(FUNC_ERROR_TEXT$7);
  2632. }
  2633. return [toIteratee(pair[0]), pair[1]];
  2634. });
  2635. return baseRest(function(args) {
  2636. var index = -1;
  2637. while (++index < length) {
  2638. var pair = pairs[index];
  2639. if (apply(pair[0], this, args)) {
  2640. return apply(pair[1], this, args);
  2641. }
  2642. }
  2643. });
  2644. }
  2645. function baseConformsTo(object, source, props) {
  2646. var length = props.length;
  2647. if (object == null) {
  2648. return !length;
  2649. }
  2650. object = Object(object);
  2651. while (length--) {
  2652. var key = props[length], predicate = source[key], value = object[key];
  2653. if (value === void 0 && !(key in object) || !predicate(value)) {
  2654. return false;
  2655. }
  2656. }
  2657. return true;
  2658. }
  2659. function baseConforms(source) {
  2660. var props = keys(source);
  2661. return function(object) {
  2662. return baseConformsTo(object, source, props);
  2663. };
  2664. }
  2665. var CLONE_DEEP_FLAG$4 = 1;
  2666. function conforms(source) {
  2667. return baseConforms(baseClone(source, CLONE_DEEP_FLAG$4));
  2668. }
  2669. function conformsTo(object, source) {
  2670. return source == null || baseConformsTo(object, source, keys(source));
  2671. }
  2672. function arrayAggregator(array, setter, iteratee, accumulator) {
  2673. var index = -1, length = array == null ? 0 : array.length;
  2674. while (++index < length) {
  2675. var value = array[index];
  2676. setter(accumulator, value, iteratee(value), array);
  2677. }
  2678. return accumulator;
  2679. }
  2680. function createBaseFor(fromRight) {
  2681. return function(object, iteratee, keysFunc) {
  2682. var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
  2683. while (length--) {
  2684. var key = props[fromRight ? length : ++index];
  2685. if (iteratee(iterable[key], key, iterable) === false) {
  2686. break;
  2687. }
  2688. }
  2689. return object;
  2690. };
  2691. }
  2692. var baseFor = createBaseFor();
  2693. function baseForOwn(object, iteratee) {
  2694. return object && baseFor(object, iteratee, keys);
  2695. }
  2696. function createBaseEach(eachFunc, fromRight) {
  2697. return function(collection, iteratee) {
  2698. if (collection == null) {
  2699. return collection;
  2700. }
  2701. if (!isArrayLike(collection)) {
  2702. return eachFunc(collection, iteratee);
  2703. }
  2704. var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
  2705. while (fromRight ? index-- : ++index < length) {
  2706. if (iteratee(iterable[index], index, iterable) === false) {
  2707. break;
  2708. }
  2709. }
  2710. return collection;
  2711. };
  2712. }
  2713. var baseEach = createBaseEach(baseForOwn);
  2714. function baseAggregator(collection, setter, iteratee, accumulator) {
  2715. baseEach(collection, function(value, key, collection2) {
  2716. setter(accumulator, value, iteratee(value), collection2);
  2717. });
  2718. return accumulator;
  2719. }
  2720. function createAggregator(setter, initializer) {
  2721. return function(collection, iteratee) {
  2722. var func = isArray$1(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
  2723. return func(collection, setter, baseIteratee(iteratee), accumulator);
  2724. };
  2725. }
  2726. var objectProto$9 = Object.prototype;
  2727. var hasOwnProperty$9 = objectProto$9.hasOwnProperty;
  2728. var countBy = createAggregator(function(result, value, key) {
  2729. if (hasOwnProperty$9.call(result, key)) {
  2730. ++result[key];
  2731. } else {
  2732. baseAssignValue(result, key, 1);
  2733. }
  2734. });
  2735. function create(prototype, properties) {
  2736. var result = baseCreate(prototype);
  2737. return properties == null ? result : baseAssign(result, properties);
  2738. }
  2739. var WRAP_CURRY_FLAG$1 = 8;
  2740. function curry(func, arity, guard) {
  2741. arity = guard ? void 0 : arity;
  2742. var result = createWrap(func, WRAP_CURRY_FLAG$1, void 0, void 0, void 0, void 0, void 0, arity);
  2743. result.placeholder = curry.placeholder;
  2744. return result;
  2745. }
  2746. curry.placeholder = {};
  2747. var WRAP_CURRY_RIGHT_FLAG = 16;
  2748. function curryRight(func, arity, guard) {
  2749. arity = guard ? void 0 : arity;
  2750. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, void 0, void 0, void 0, void 0, void 0, arity);
  2751. result.placeholder = curryRight.placeholder;
  2752. return result;
  2753. }
  2754. curryRight.placeholder = {};
  2755. var now = function() {
  2756. return root.Date.now();
  2757. };
  2758. var FUNC_ERROR_TEXT$6 = "Expected a function";
  2759. var nativeMax$b = Math.max;
  2760. var nativeMin$b = Math.min;
  2761. function debounce(func, wait, options) {
  2762. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  2763. if (typeof func != "function") {
  2764. throw new TypeError(FUNC_ERROR_TEXT$6);
  2765. }
  2766. wait = toNumber(wait) || 0;
  2767. if (isObject$2(options)) {
  2768. leading = !!options.leading;
  2769. maxing = "maxWait" in options;
  2770. maxWait = maxing ? nativeMax$b(toNumber(options.maxWait) || 0, wait) : maxWait;
  2771. trailing = "trailing" in options ? !!options.trailing : trailing;
  2772. }
  2773. function invokeFunc(time) {
  2774. var args = lastArgs, thisArg = lastThis;
  2775. lastArgs = lastThis = void 0;
  2776. lastInvokeTime = time;
  2777. result = func.apply(thisArg, args);
  2778. return result;
  2779. }
  2780. function leadingEdge(time) {
  2781. lastInvokeTime = time;
  2782. timerId = setTimeout(timerExpired, wait);
  2783. return leading ? invokeFunc(time) : result;
  2784. }
  2785. function remainingWait(time) {
  2786. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  2787. return maxing ? nativeMin$b(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  2788. }
  2789. function shouldInvoke(time) {
  2790. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  2791. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  2792. }
  2793. function timerExpired() {
  2794. var time = now();
  2795. if (shouldInvoke(time)) {
  2796. return trailingEdge(time);
  2797. }
  2798. timerId = setTimeout(timerExpired, remainingWait(time));
  2799. }
  2800. function trailingEdge(time) {
  2801. timerId = void 0;
  2802. if (trailing && lastArgs) {
  2803. return invokeFunc(time);
  2804. }
  2805. lastArgs = lastThis = void 0;
  2806. return result;
  2807. }
  2808. function cancel() {
  2809. if (timerId !== void 0) {
  2810. clearTimeout(timerId);
  2811. }
  2812. lastInvokeTime = 0;
  2813. lastArgs = lastCallTime = lastThis = timerId = void 0;
  2814. }
  2815. function flush() {
  2816. return timerId === void 0 ? result : trailingEdge(now());
  2817. }
  2818. function debounced() {
  2819. var time = now(), isInvoking = shouldInvoke(time);
  2820. lastArgs = arguments;
  2821. lastThis = this;
  2822. lastCallTime = time;
  2823. if (isInvoking) {
  2824. if (timerId === void 0) {
  2825. return leadingEdge(lastCallTime);
  2826. }
  2827. if (maxing) {
  2828. clearTimeout(timerId);
  2829. timerId = setTimeout(timerExpired, wait);
  2830. return invokeFunc(lastCallTime);
  2831. }
  2832. }
  2833. if (timerId === void 0) {
  2834. timerId = setTimeout(timerExpired, wait);
  2835. }
  2836. return result;
  2837. }
  2838. debounced.cancel = cancel;
  2839. debounced.flush = flush;
  2840. return debounced;
  2841. }
  2842. function defaultTo(value, defaultValue) {
  2843. return value == null || value !== value ? defaultValue : value;
  2844. }
  2845. var objectProto$8 = Object.prototype;
  2846. var hasOwnProperty$8 = objectProto$8.hasOwnProperty;
  2847. var defaults = baseRest(function(object, sources) {
  2848. object = Object(object);
  2849. var index = -1;
  2850. var length = sources.length;
  2851. var guard = length > 2 ? sources[2] : void 0;
  2852. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  2853. length = 1;
  2854. }
  2855. while (++index < length) {
  2856. var source = sources[index];
  2857. var props = keysIn(source);
  2858. var propsIndex = -1;
  2859. var propsLength = props.length;
  2860. while (++propsIndex < propsLength) {
  2861. var key = props[propsIndex];
  2862. var value = object[key];
  2863. if (value === void 0 || eq(value, objectProto$8[key]) && !hasOwnProperty$8.call(object, key)) {
  2864. object[key] = source[key];
  2865. }
  2866. }
  2867. }
  2868. return object;
  2869. });
  2870. function assignMergeValue(object, key, value) {
  2871. if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) {
  2872. baseAssignValue(object, key, value);
  2873. }
  2874. }
  2875. function isArrayLikeObject(value) {
  2876. return isObjectLike(value) && isArrayLike(value);
  2877. }
  2878. function safeGet(object, key) {
  2879. if (key === "constructor" && typeof object[key] === "function") {
  2880. return;
  2881. }
  2882. if (key == "__proto__") {
  2883. return;
  2884. }
  2885. return object[key];
  2886. }
  2887. function toPlainObject(value) {
  2888. return copyObject(value, keysIn(value));
  2889. }
  2890. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  2891. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
  2892. if (stacked) {
  2893. assignMergeValue(object, key, stacked);
  2894. return;
  2895. }
  2896. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
  2897. var isCommon = newValue === void 0;
  2898. if (isCommon) {
  2899. var isArr = isArray$1(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  2900. newValue = srcValue;
  2901. if (isArr || isBuff || isTyped) {
  2902. if (isArray$1(objValue)) {
  2903. newValue = objValue;
  2904. } else if (isArrayLikeObject(objValue)) {
  2905. newValue = copyArray(objValue);
  2906. } else if (isBuff) {
  2907. isCommon = false;
  2908. newValue = cloneBuffer(srcValue, true);
  2909. } else if (isTyped) {
  2910. isCommon = false;
  2911. newValue = cloneTypedArray(srcValue, true);
  2912. } else {
  2913. newValue = [];
  2914. }
  2915. } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  2916. newValue = objValue;
  2917. if (isArguments(objValue)) {
  2918. newValue = toPlainObject(objValue);
  2919. } else if (!isObject$2(objValue) || isFunction$1(objValue)) {
  2920. newValue = initCloneObject(srcValue);
  2921. }
  2922. } else {
  2923. isCommon = false;
  2924. }
  2925. }
  2926. if (isCommon) {
  2927. stack.set(srcValue, newValue);
  2928. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  2929. stack["delete"](srcValue);
  2930. }
  2931. assignMergeValue(object, key, newValue);
  2932. }
  2933. function baseMerge(object, source, srcIndex, customizer, stack) {
  2934. if (object === source) {
  2935. return;
  2936. }
  2937. baseFor(source, function(srcValue, key) {
  2938. stack || (stack = new Stack());
  2939. if (isObject$2(srcValue)) {
  2940. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  2941. } else {
  2942. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
  2943. if (newValue === void 0) {
  2944. newValue = srcValue;
  2945. }
  2946. assignMergeValue(object, key, newValue);
  2947. }
  2948. }, keysIn);
  2949. }
  2950. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  2951. if (isObject$2(objValue) && isObject$2(srcValue)) {
  2952. stack.set(srcValue, objValue);
  2953. baseMerge(objValue, srcValue, void 0, customDefaultsMerge, stack);
  2954. stack["delete"](srcValue);
  2955. }
  2956. return objValue;
  2957. }
  2958. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  2959. baseMerge(object, source, srcIndex, customizer);
  2960. });
  2961. var defaultsDeep = baseRest(function(args) {
  2962. args.push(void 0, customDefaultsMerge);
  2963. return apply(mergeWith, void 0, args);
  2964. });
  2965. var FUNC_ERROR_TEXT$5 = "Expected a function";
  2966. function baseDelay(func, wait, args) {
  2967. if (typeof func != "function") {
  2968. throw new TypeError(FUNC_ERROR_TEXT$5);
  2969. }
  2970. return setTimeout(function() {
  2971. func.apply(void 0, args);
  2972. }, wait);
  2973. }
  2974. var defer = baseRest(function(func, args) {
  2975. return baseDelay(func, 1, args);
  2976. });
  2977. var delay = baseRest(function(func, wait, args) {
  2978. return baseDelay(func, toNumber(wait) || 0, args);
  2979. });
  2980. function arrayIncludesWith(array, value, comparator) {
  2981. var index = -1, length = array == null ? 0 : array.length;
  2982. while (++index < length) {
  2983. if (comparator(value, array[index])) {
  2984. return true;
  2985. }
  2986. }
  2987. return false;
  2988. }
  2989. var LARGE_ARRAY_SIZE$1 = 200;
  2990. function baseDifference(array, values, iteratee, comparator) {
  2991. var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
  2992. if (!length) {
  2993. return result;
  2994. }
  2995. if (iteratee) {
  2996. values = arrayMap(values, baseUnary(iteratee));
  2997. }
  2998. if (comparator) {
  2999. includes = arrayIncludesWith;
  3000. isCommon = false;
  3001. } else if (values.length >= LARGE_ARRAY_SIZE$1) {
  3002. includes = cacheHas;
  3003. isCommon = false;
  3004. values = new SetCache(values);
  3005. }
  3006. outer:
  3007. while (++index < length) {
  3008. var value = array[index], computed = iteratee == null ? value : iteratee(value);
  3009. value = comparator || value !== 0 ? value : 0;
  3010. if (isCommon && computed === computed) {
  3011. var valuesIndex = valuesLength;
  3012. while (valuesIndex--) {
  3013. if (values[valuesIndex] === computed) {
  3014. continue outer;
  3015. }
  3016. }
  3017. result.push(value);
  3018. } else if (!includes(values, computed, comparator)) {
  3019. result.push(value);
  3020. }
  3021. }
  3022. return result;
  3023. }
  3024. var difference = baseRest(function(array, values) {
  3025. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
  3026. });
  3027. function last(array) {
  3028. var length = array == null ? 0 : array.length;
  3029. return length ? array[length - 1] : void 0;
  3030. }
  3031. var differenceBy = baseRest(function(array, values) {
  3032. var iteratee = last(values);
  3033. if (isArrayLikeObject(iteratee)) {
  3034. iteratee = void 0;
  3035. }
  3036. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), baseIteratee(iteratee)) : [];
  3037. });
  3038. var differenceWith = baseRest(function(array, values) {
  3039. var comparator = last(values);
  3040. if (isArrayLikeObject(comparator)) {
  3041. comparator = void 0;
  3042. }
  3043. return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), void 0, comparator) : [];
  3044. });
  3045. var divide = createMathOperation(function(dividend, divisor) {
  3046. return dividend / divisor;
  3047. }, 1);
  3048. function drop(array, n, guard) {
  3049. var length = array == null ? 0 : array.length;
  3050. if (!length) {
  3051. return [];
  3052. }
  3053. n = guard || n === void 0 ? 1 : toInteger(n);
  3054. return baseSlice(array, n < 0 ? 0 : n, length);
  3055. }
  3056. function dropRight(array, n, guard) {
  3057. var length = array == null ? 0 : array.length;
  3058. if (!length) {
  3059. return [];
  3060. }
  3061. n = guard || n === void 0 ? 1 : toInteger(n);
  3062. n = length - n;
  3063. return baseSlice(array, 0, n < 0 ? 0 : n);
  3064. }
  3065. function baseWhile(array, predicate, isDrop, fromRight) {
  3066. var length = array.length, index = fromRight ? length : -1;
  3067. while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
  3068. }
  3069. return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
  3070. }
  3071. function dropRightWhile(array, predicate) {
  3072. return array && array.length ? baseWhile(array, baseIteratee(predicate), true, true) : [];
  3073. }
  3074. function dropWhile(array, predicate) {
  3075. return array && array.length ? baseWhile(array, baseIteratee(predicate), true) : [];
  3076. }
  3077. function castFunction(value) {
  3078. return typeof value == "function" ? value : identity$1;
  3079. }
  3080. function forEach(collection, iteratee) {
  3081. var func = isArray$1(collection) ? arrayEach : baseEach;
  3082. return func(collection, castFunction(iteratee));
  3083. }
  3084. function arrayEachRight(array, iteratee) {
  3085. var length = array == null ? 0 : array.length;
  3086. while (length--) {
  3087. if (iteratee(array[length], length, array) === false) {
  3088. break;
  3089. }
  3090. }
  3091. return array;
  3092. }
  3093. var baseForRight = createBaseFor(true);
  3094. function baseForOwnRight(object, iteratee) {
  3095. return object && baseForRight(object, iteratee, keys);
  3096. }
  3097. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3098. function forEachRight(collection, iteratee) {
  3099. var func = isArray$1(collection) ? arrayEachRight : baseEachRight;
  3100. return func(collection, castFunction(iteratee));
  3101. }
  3102. function endsWith(string, target, position) {
  3103. string = toString(string);
  3104. target = baseToString(target);
  3105. var length = string.length;
  3106. position = position === void 0 ? length : baseClamp(toInteger(position), 0, length);
  3107. var end = position;
  3108. position -= target.length;
  3109. return position >= 0 && string.slice(position, end) == target;
  3110. }
  3111. function baseToPairs(object, props) {
  3112. return arrayMap(props, function(key) {
  3113. return [key, object[key]];
  3114. });
  3115. }
  3116. function setToPairs(set) {
  3117. var index = -1, result = Array(set.size);
  3118. set.forEach(function(value) {
  3119. result[++index] = [value, value];
  3120. });
  3121. return result;
  3122. }
  3123. var mapTag$3 = "[object Map]";
  3124. var setTag$3 = "[object Set]";
  3125. function createToPairs(keysFunc) {
  3126. return function(object) {
  3127. var tag = getTag$1(object);
  3128. if (tag == mapTag$3) {
  3129. return mapToArray(object);
  3130. }
  3131. if (tag == setTag$3) {
  3132. return setToPairs(object);
  3133. }
  3134. return baseToPairs(object, keysFunc(object));
  3135. };
  3136. }
  3137. var toPairs = createToPairs(keys);
  3138. var toPairsIn = createToPairs(keysIn);
  3139. var htmlEscapes = {
  3140. "&": "&amp;",
  3141. "<": "&lt;",
  3142. ">": "&gt;",
  3143. '"': "&quot;",
  3144. "'": "&#39;"
  3145. };
  3146. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  3147. var reUnescapedHtml = /[&<>"']/g;
  3148. var reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  3149. function escape(string) {
  3150. string = toString(string);
  3151. return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
  3152. }
  3153. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  3154. var reHasRegExpChar = RegExp(reRegExpChar.source);
  3155. function escapeRegExp(string) {
  3156. string = toString(string);
  3157. return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
  3158. }
  3159. function arrayEvery(array, predicate) {
  3160. var index = -1, length = array == null ? 0 : array.length;
  3161. while (++index < length) {
  3162. if (!predicate(array[index], index, array)) {
  3163. return false;
  3164. }
  3165. }
  3166. return true;
  3167. }
  3168. function baseEvery(collection, predicate) {
  3169. var result = true;
  3170. baseEach(collection, function(value, index, collection2) {
  3171. result = !!predicate(value, index, collection2);
  3172. return result;
  3173. });
  3174. return result;
  3175. }
  3176. function every(collection, predicate, guard) {
  3177. var func = isArray$1(collection) ? arrayEvery : baseEvery;
  3178. if (guard && isIterateeCall(collection, predicate, guard)) {
  3179. predicate = void 0;
  3180. }
  3181. return func(collection, baseIteratee(predicate));
  3182. }
  3183. var MAX_ARRAY_LENGTH$5 = 4294967295;
  3184. function toLength(value) {
  3185. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH$5) : 0;
  3186. }
  3187. function baseFill(array, value, start, end) {
  3188. var length = array.length;
  3189. start = toInteger(start);
  3190. if (start < 0) {
  3191. start = -start > length ? 0 : length + start;
  3192. }
  3193. end = end === void 0 || end > length ? length : toInteger(end);
  3194. if (end < 0) {
  3195. end += length;
  3196. }
  3197. end = start > end ? 0 : toLength(end);
  3198. while (start < end) {
  3199. array[start++] = value;
  3200. }
  3201. return array;
  3202. }
  3203. function fill(array, value, start, end) {
  3204. var length = array == null ? 0 : array.length;
  3205. if (!length) {
  3206. return [];
  3207. }
  3208. if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
  3209. start = 0;
  3210. end = length;
  3211. }
  3212. return baseFill(array, value, start, end);
  3213. }
  3214. function baseFilter(collection, predicate) {
  3215. var result = [];
  3216. baseEach(collection, function(value, index, collection2) {
  3217. if (predicate(value, index, collection2)) {
  3218. result.push(value);
  3219. }
  3220. });
  3221. return result;
  3222. }
  3223. function filter(collection, predicate) {
  3224. var func = isArray$1(collection) ? arrayFilter : baseFilter;
  3225. return func(collection, baseIteratee(predicate));
  3226. }
  3227. function createFind(findIndexFunc) {
  3228. return function(collection, predicate, fromIndex) {
  3229. var iterable = Object(collection);
  3230. if (!isArrayLike(collection)) {
  3231. var iteratee = baseIteratee(predicate);
  3232. collection = keys(collection);
  3233. predicate = function(key) {
  3234. return iteratee(iterable[key], key, iterable);
  3235. };
  3236. }
  3237. var index = findIndexFunc(collection, predicate, fromIndex);
  3238. return index > -1 ? iterable[iteratee ? collection[index] : index] : void 0;
  3239. };
  3240. }
  3241. var nativeMax$a = Math.max;
  3242. function findIndex(array, predicate, fromIndex) {
  3243. var length = array == null ? 0 : array.length;
  3244. if (!length) {
  3245. return -1;
  3246. }
  3247. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  3248. if (index < 0) {
  3249. index = nativeMax$a(length + index, 0);
  3250. }
  3251. return baseFindIndex(array, baseIteratee(predicate), index);
  3252. }
  3253. var find = createFind(findIndex);
  3254. function baseFindKey(collection, predicate, eachFunc) {
  3255. var result;
  3256. eachFunc(collection, function(value, key, collection2) {
  3257. if (predicate(value, key, collection2)) {
  3258. result = key;
  3259. return false;
  3260. }
  3261. });
  3262. return result;
  3263. }
  3264. function findKey(object, predicate) {
  3265. return baseFindKey(object, baseIteratee(predicate), baseForOwn);
  3266. }
  3267. var nativeMax$9 = Math.max;
  3268. var nativeMin$a = Math.min;
  3269. function findLastIndex(array, predicate, fromIndex) {
  3270. var length = array == null ? 0 : array.length;
  3271. if (!length) {
  3272. return -1;
  3273. }
  3274. var index = length - 1;
  3275. if (fromIndex !== void 0) {
  3276. index = toInteger(fromIndex);
  3277. index = fromIndex < 0 ? nativeMax$9(length + index, 0) : nativeMin$a(index, length - 1);
  3278. }
  3279. return baseFindIndex(array, baseIteratee(predicate), index, true);
  3280. }
  3281. var findLast = createFind(findLastIndex);
  3282. function findLastKey(object, predicate) {
  3283. return baseFindKey(object, baseIteratee(predicate), baseForOwnRight);
  3284. }
  3285. function head(array) {
  3286. return array && array.length ? array[0] : void 0;
  3287. }
  3288. function baseMap(collection, iteratee) {
  3289. var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
  3290. baseEach(collection, function(value, key, collection2) {
  3291. result[++index] = iteratee(value, key, collection2);
  3292. });
  3293. return result;
  3294. }
  3295. function map(collection, iteratee) {
  3296. var func = isArray$1(collection) ? arrayMap : baseMap;
  3297. return func(collection, baseIteratee(iteratee));
  3298. }
  3299. function flatMap(collection, iteratee) {
  3300. return baseFlatten(map(collection, iteratee), 1);
  3301. }
  3302. var INFINITY$2 = 1 / 0;
  3303. function flatMapDeep(collection, iteratee) {
  3304. return baseFlatten(map(collection, iteratee), INFINITY$2);
  3305. }
  3306. function flatMapDepth(collection, iteratee, depth) {
  3307. depth = depth === void 0 ? 1 : toInteger(depth);
  3308. return baseFlatten(map(collection, iteratee), depth);
  3309. }
  3310. var INFINITY$1 = 1 / 0;
  3311. function flattenDeep(array) {
  3312. var length = array == null ? 0 : array.length;
  3313. return length ? baseFlatten(array, INFINITY$1) : [];
  3314. }
  3315. function flattenDepth(array, depth) {
  3316. var length = array == null ? 0 : array.length;
  3317. if (!length) {
  3318. return [];
  3319. }
  3320. depth = depth === void 0 ? 1 : toInteger(depth);
  3321. return baseFlatten(array, depth);
  3322. }
  3323. var WRAP_FLIP_FLAG = 512;
  3324. function flip(func) {
  3325. return createWrap(func, WRAP_FLIP_FLAG);
  3326. }
  3327. var floor$1 = createRound("floor");
  3328. var FUNC_ERROR_TEXT$4 = "Expected a function";
  3329. var WRAP_CURRY_FLAG = 8;
  3330. var WRAP_PARTIAL_FLAG$1 = 32;
  3331. var WRAP_ARY_FLAG = 128;
  3332. var WRAP_REARG_FLAG$1 = 256;
  3333. function createFlow(fromRight) {
  3334. return flatRest(function(funcs) {
  3335. var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
  3336. if (fromRight) {
  3337. funcs.reverse();
  3338. }
  3339. while (index--) {
  3340. var func = funcs[index];
  3341. if (typeof func != "function") {
  3342. throw new TypeError(FUNC_ERROR_TEXT$4);
  3343. }
  3344. if (prereq && !wrapper && getFuncName(func) == "wrapper") {
  3345. var wrapper = new LodashWrapper([], true);
  3346. }
  3347. }
  3348. index = wrapper ? index : length;
  3349. while (++index < length) {
  3350. func = funcs[index];
  3351. var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : void 0;
  3352. if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG$1 | WRAP_REARG_FLAG$1) && !data[4].length && data[9] == 1) {
  3353. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  3354. } else {
  3355. wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
  3356. }
  3357. }
  3358. return function() {
  3359. var args = arguments, value = args[0];
  3360. if (wrapper && args.length == 1 && isArray$1(value)) {
  3361. return wrapper.plant(value).value();
  3362. }
  3363. var index2 = 0, result = length ? funcs[index2].apply(this, args) : value;
  3364. while (++index2 < length) {
  3365. result = funcs[index2].call(this, result);
  3366. }
  3367. return result;
  3368. };
  3369. });
  3370. }
  3371. var flow = createFlow();
  3372. var flowRight = createFlow(true);
  3373. function forIn(object, iteratee) {
  3374. return object == null ? object : baseFor(object, castFunction(iteratee), keysIn);
  3375. }
  3376. function forInRight(object, iteratee) {
  3377. return object == null ? object : baseForRight(object, castFunction(iteratee), keysIn);
  3378. }
  3379. function forOwn(object, iteratee) {
  3380. return object && baseForOwn(object, castFunction(iteratee));
  3381. }
  3382. function forOwnRight(object, iteratee) {
  3383. return object && baseForOwnRight(object, castFunction(iteratee));
  3384. }
  3385. function fromPairs(pairs) {
  3386. var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
  3387. while (++index < length) {
  3388. var pair = pairs[index];
  3389. result[pair[0]] = pair[1];
  3390. }
  3391. return result;
  3392. }
  3393. function baseFunctions(object, props) {
  3394. return arrayFilter(props, function(key) {
  3395. return isFunction$1(object[key]);
  3396. });
  3397. }
  3398. function functions(object) {
  3399. return object == null ? [] : baseFunctions(object, keys(object));
  3400. }
  3401. function functionsIn(object) {
  3402. return object == null ? [] : baseFunctions(object, keysIn(object));
  3403. }
  3404. var objectProto$7 = Object.prototype;
  3405. var hasOwnProperty$7 = objectProto$7.hasOwnProperty;
  3406. var groupBy = createAggregator(function(result, value, key) {
  3407. if (hasOwnProperty$7.call(result, key)) {
  3408. result[key].push(value);
  3409. } else {
  3410. baseAssignValue(result, key, [value]);
  3411. }
  3412. });
  3413. function baseGt(value, other) {
  3414. return value > other;
  3415. }
  3416. function createRelationalOperation(operator) {
  3417. return function(value, other) {
  3418. if (!(typeof value == "string" && typeof other == "string")) {
  3419. value = toNumber(value);
  3420. other = toNumber(other);
  3421. }
  3422. return operator(value, other);
  3423. };
  3424. }
  3425. var gt$1 = createRelationalOperation(baseGt);
  3426. var gte = createRelationalOperation(function(value, other) {
  3427. return value >= other;
  3428. });
  3429. var objectProto$6 = Object.prototype;
  3430. var hasOwnProperty$6 = objectProto$6.hasOwnProperty;
  3431. function baseHas(object, key) {
  3432. return object != null && hasOwnProperty$6.call(object, key);
  3433. }
  3434. function has(object, path) {
  3435. return object != null && hasPath(object, path, baseHas);
  3436. }
  3437. var nativeMax$8 = Math.max;
  3438. var nativeMin$9 = Math.min;
  3439. function baseInRange(number, start, end) {
  3440. return number >= nativeMin$9(start, end) && number < nativeMax$8(start, end);
  3441. }
  3442. function inRange(number, start, end) {
  3443. start = toFinite(start);
  3444. if (end === void 0) {
  3445. end = start;
  3446. start = 0;
  3447. } else {
  3448. end = toFinite(end);
  3449. }
  3450. number = toNumber(number);
  3451. return baseInRange(number, start, end);
  3452. }
  3453. var stringTag = "[object String]";
  3454. function isString$2(value) {
  3455. return typeof value == "string" || !isArray$1(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
  3456. }
  3457. function baseValues(object, props) {
  3458. return arrayMap(props, function(key) {
  3459. return object[key];
  3460. });
  3461. }
  3462. function values(object) {
  3463. return object == null ? [] : baseValues(object, keys(object));
  3464. }
  3465. var nativeMax$7 = Math.max;
  3466. function includes(collection, value, fromIndex, guard) {
  3467. collection = isArrayLike(collection) ? collection : values(collection);
  3468. fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
  3469. var length = collection.length;
  3470. if (fromIndex < 0) {
  3471. fromIndex = nativeMax$7(length + fromIndex, 0);
  3472. }
  3473. return isString$2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
  3474. }
  3475. var nativeMax$6 = Math.max;
  3476. function indexOf(array, value, fromIndex) {
  3477. var length = array == null ? 0 : array.length;
  3478. if (!length) {
  3479. return -1;
  3480. }
  3481. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  3482. if (index < 0) {
  3483. index = nativeMax$6(length + index, 0);
  3484. }
  3485. return baseIndexOf(array, value, index);
  3486. }
  3487. function initial(array) {
  3488. var length = array == null ? 0 : array.length;
  3489. return length ? baseSlice(array, 0, -1) : [];
  3490. }
  3491. var nativeMin$8 = Math.min;
  3492. function baseIntersection(arrays, iteratee, comparator) {
  3493. var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = [];
  3494. while (othIndex--) {
  3495. var array = arrays[othIndex];
  3496. if (othIndex && iteratee) {
  3497. array = arrayMap(array, baseUnary(iteratee));
  3498. }
  3499. maxLength = nativeMin$8(array.length, maxLength);
  3500. caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : void 0;
  3501. }
  3502. array = arrays[0];
  3503. var index = -1, seen = caches[0];
  3504. outer:
  3505. while (++index < length && result.length < maxLength) {
  3506. var value = array[index], computed = iteratee ? iteratee(value) : value;
  3507. value = comparator || value !== 0 ? value : 0;
  3508. if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
  3509. othIndex = othLength;
  3510. while (--othIndex) {
  3511. var cache = caches[othIndex];
  3512. if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
  3513. continue outer;
  3514. }
  3515. }
  3516. if (seen) {
  3517. seen.push(computed);
  3518. }
  3519. result.push(value);
  3520. }
  3521. }
  3522. return result;
  3523. }
  3524. function castArrayLikeObject(value) {
  3525. return isArrayLikeObject(value) ? value : [];
  3526. }
  3527. var intersection = baseRest(function(arrays) {
  3528. var mapped = arrayMap(arrays, castArrayLikeObject);
  3529. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
  3530. });
  3531. var intersectionBy = baseRest(function(arrays) {
  3532. var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  3533. if (iteratee === last(mapped)) {
  3534. iteratee = void 0;
  3535. } else {
  3536. mapped.pop();
  3537. }
  3538. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, baseIteratee(iteratee)) : [];
  3539. });
  3540. var intersectionWith = baseRest(function(arrays) {
  3541. var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
  3542. comparator = typeof comparator == "function" ? comparator : void 0;
  3543. if (comparator) {
  3544. mapped.pop();
  3545. }
  3546. return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, void 0, comparator) : [];
  3547. });
  3548. function baseInverter(object, setter, iteratee, accumulator) {
  3549. baseForOwn(object, function(value, key, object2) {
  3550. setter(accumulator, iteratee(value), key, object2);
  3551. });
  3552. return accumulator;
  3553. }
  3554. function createInverter(setter, toIteratee) {
  3555. return function(object, iteratee) {
  3556. return baseInverter(object, setter, toIteratee(iteratee), {});
  3557. };
  3558. }
  3559. var objectProto$5 = Object.prototype;
  3560. var nativeObjectToString$1 = objectProto$5.toString;
  3561. var invert = createInverter(function(result, value, key) {
  3562. if (value != null && typeof value.toString != "function") {
  3563. value = nativeObjectToString$1.call(value);
  3564. }
  3565. result[value] = key;
  3566. }, constant(identity$1));
  3567. var objectProto$4 = Object.prototype;
  3568. var hasOwnProperty$5 = objectProto$4.hasOwnProperty;
  3569. var nativeObjectToString = objectProto$4.toString;
  3570. var invertBy = createInverter(function(result, value, key) {
  3571. if (value != null && typeof value.toString != "function") {
  3572. value = nativeObjectToString.call(value);
  3573. }
  3574. if (hasOwnProperty$5.call(result, value)) {
  3575. result[value].push(key);
  3576. } else {
  3577. result[value] = [key];
  3578. }
  3579. }, baseIteratee);
  3580. function parent(object, path) {
  3581. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  3582. }
  3583. function baseInvoke(object, path, args) {
  3584. path = castPath(path, object);
  3585. object = parent(object, path);
  3586. var func = object == null ? object : object[toKey(last(path))];
  3587. return func == null ? void 0 : apply(func, object, args);
  3588. }
  3589. var invoke = baseRest(baseInvoke);
  3590. var invokeMap = baseRest(function(collection, path, args) {
  3591. var index = -1, isFunc = typeof path == "function", result = isArrayLike(collection) ? Array(collection.length) : [];
  3592. baseEach(collection, function(value) {
  3593. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  3594. });
  3595. return result;
  3596. });
  3597. var arrayBufferTag = "[object ArrayBuffer]";
  3598. function baseIsArrayBuffer(value) {
  3599. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  3600. }
  3601. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer;
  3602. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  3603. var boolTag = "[object Boolean]";
  3604. function isBoolean$1(value) {
  3605. return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
  3606. }
  3607. var dateTag = "[object Date]";
  3608. function baseIsDate(value) {
  3609. return isObjectLike(value) && baseGetTag(value) == dateTag;
  3610. }
  3611. var nodeIsDate = nodeUtil && nodeUtil.isDate;
  3612. var isDate$1 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  3613. function isElement$2(value) {
  3614. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  3615. }
  3616. var mapTag$2 = "[object Map]";
  3617. var setTag$2 = "[object Set]";
  3618. var objectProto$3 = Object.prototype;
  3619. var hasOwnProperty$4 = objectProto$3.hasOwnProperty;
  3620. function isEmpty$1(value) {
  3621. if (value == null) {
  3622. return true;
  3623. }
  3624. if (isArrayLike(value) && (isArray$1(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  3625. return !value.length;
  3626. }
  3627. var tag = getTag$1(value);
  3628. if (tag == mapTag$2 || tag == setTag$2) {
  3629. return !value.size;
  3630. }
  3631. if (isPrototype(value)) {
  3632. return !baseKeys(value).length;
  3633. }
  3634. for (var key in value) {
  3635. if (hasOwnProperty$4.call(value, key)) {
  3636. return false;
  3637. }
  3638. }
  3639. return true;
  3640. }
  3641. function isEqual$1(value, other) {
  3642. return baseIsEqual(value, other);
  3643. }
  3644. function isEqualWith(value, other, customizer) {
  3645. customizer = typeof customizer == "function" ? customizer : void 0;
  3646. var result = customizer ? customizer(value, other) : void 0;
  3647. return result === void 0 ? baseIsEqual(value, other, void 0, customizer) : !!result;
  3648. }
  3649. var nativeIsFinite = root.isFinite;
  3650. function isFinite(value) {
  3651. return typeof value == "number" && nativeIsFinite(value);
  3652. }
  3653. function isInteger(value) {
  3654. return typeof value == "number" && value == toInteger(value);
  3655. }
  3656. function isMatch(object, source) {
  3657. return object === source || baseIsMatch(object, source, getMatchData(source));
  3658. }
  3659. function isMatchWith(object, source, customizer) {
  3660. customizer = typeof customizer == "function" ? customizer : void 0;
  3661. return baseIsMatch(object, source, getMatchData(source), customizer);
  3662. }
  3663. var numberTag = "[object Number]";
  3664. function isNumber$1(value) {
  3665. return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
  3666. }
  3667. function isNaN$1(value) {
  3668. return isNumber$1(value) && value != +value;
  3669. }
  3670. var isMaskable = coreJsData ? isFunction$1 : stubFalse;
  3671. var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.";
  3672. function isNative(value) {
  3673. if (isMaskable(value)) {
  3674. throw new Error(CORE_ERROR_TEXT);
  3675. }
  3676. return baseIsNative(value);
  3677. }
  3678. function isNil(value) {
  3679. return value == null;
  3680. }
  3681. function isNull(value) {
  3682. return value === null;
  3683. }
  3684. var regexpTag = "[object RegExp]";
  3685. function baseIsRegExp(value) {
  3686. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  3687. }
  3688. var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
  3689. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  3690. var MAX_SAFE_INTEGER$3 = 9007199254740991;
  3691. function isSafeInteger(value) {
  3692. return isInteger(value) && value >= -MAX_SAFE_INTEGER$3 && value <= MAX_SAFE_INTEGER$3;
  3693. }
  3694. function isUndefined$1(value) {
  3695. return value === void 0;
  3696. }
  3697. var weakMapTag = "[object WeakMap]";
  3698. function isWeakMap(value) {
  3699. return isObjectLike(value) && getTag$1(value) == weakMapTag;
  3700. }
  3701. var weakSetTag = "[object WeakSet]";
  3702. function isWeakSet(value) {
  3703. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  3704. }
  3705. var CLONE_DEEP_FLAG$3 = 1;
  3706. function iteratee(func) {
  3707. return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG$3));
  3708. }
  3709. var arrayProto$4 = Array.prototype;
  3710. var nativeJoin = arrayProto$4.join;
  3711. function join(array, separator) {
  3712. return array == null ? "" : nativeJoin.call(array, separator);
  3713. }
  3714. var kebabCase = createCompounder(function(result, word, index) {
  3715. return result + (index ? "-" : "") + word.toLowerCase();
  3716. });
  3717. var keyBy = createAggregator(function(result, value, key) {
  3718. baseAssignValue(result, key, value);
  3719. });
  3720. function strictLastIndexOf(array, value, fromIndex) {
  3721. var index = fromIndex + 1;
  3722. while (index--) {
  3723. if (array[index] === value) {
  3724. return index;
  3725. }
  3726. }
  3727. return index;
  3728. }
  3729. var nativeMax$5 = Math.max;
  3730. var nativeMin$7 = Math.min;
  3731. function lastIndexOf(array, value, fromIndex) {
  3732. var length = array == null ? 0 : array.length;
  3733. if (!length) {
  3734. return -1;
  3735. }
  3736. var index = length;
  3737. if (fromIndex !== void 0) {
  3738. index = toInteger(fromIndex);
  3739. index = index < 0 ? nativeMax$5(length + index, 0) : nativeMin$7(index, length - 1);
  3740. }
  3741. return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
  3742. }
  3743. var lowerCase = createCompounder(function(result, word, index) {
  3744. return result + (index ? " " : "") + word.toLowerCase();
  3745. });
  3746. var lowerFirst = createCaseFirst("toLowerCase");
  3747. function baseLt(value, other) {
  3748. return value < other;
  3749. }
  3750. var lt$1 = createRelationalOperation(baseLt);
  3751. var lte = createRelationalOperation(function(value, other) {
  3752. return value <= other;
  3753. });
  3754. function mapKeys(object, iteratee) {
  3755. var result = {};
  3756. iteratee = baseIteratee(iteratee);
  3757. baseForOwn(object, function(value, key, object2) {
  3758. baseAssignValue(result, iteratee(value, key, object2), value);
  3759. });
  3760. return result;
  3761. }
  3762. function mapValues(object, iteratee) {
  3763. var result = {};
  3764. iteratee = baseIteratee(iteratee);
  3765. baseForOwn(object, function(value, key, object2) {
  3766. baseAssignValue(result, key, iteratee(value, key, object2));
  3767. });
  3768. return result;
  3769. }
  3770. var CLONE_DEEP_FLAG$2 = 1;
  3771. function matches(source) {
  3772. return baseMatches(baseClone(source, CLONE_DEEP_FLAG$2));
  3773. }
  3774. var CLONE_DEEP_FLAG$1 = 1;
  3775. function matchesProperty(path, srcValue) {
  3776. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG$1));
  3777. }
  3778. function baseExtremum(array, iteratee, comparator) {
  3779. var index = -1, length = array.length;
  3780. while (++index < length) {
  3781. var value = array[index], current = iteratee(value);
  3782. if (current != null && (computed === void 0 ? current === current && !isSymbol(current) : comparator(current, computed))) {
  3783. var computed = current, result = value;
  3784. }
  3785. }
  3786. return result;
  3787. }
  3788. function max$3(array) {
  3789. return array && array.length ? baseExtremum(array, identity$1, baseGt) : void 0;
  3790. }
  3791. function maxBy(array, iteratee) {
  3792. return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseGt) : void 0;
  3793. }
  3794. function baseSum(array, iteratee) {
  3795. var result, index = -1, length = array.length;
  3796. while (++index < length) {
  3797. var current = iteratee(array[index]);
  3798. if (current !== void 0) {
  3799. result = result === void 0 ? current : result + current;
  3800. }
  3801. }
  3802. return result;
  3803. }
  3804. var NAN = 0 / 0;
  3805. function baseMean(array, iteratee) {
  3806. var length = array == null ? 0 : array.length;
  3807. return length ? baseSum(array, iteratee) / length : NAN;
  3808. }
  3809. function mean(array) {
  3810. return baseMean(array, identity$1);
  3811. }
  3812. function meanBy(array, iteratee) {
  3813. return baseMean(array, baseIteratee(iteratee));
  3814. }
  3815. var merge = createAssigner(function(object, source, srcIndex) {
  3816. baseMerge(object, source, srcIndex);
  3817. });
  3818. var method = baseRest(function(path, args) {
  3819. return function(object) {
  3820. return baseInvoke(object, path, args);
  3821. };
  3822. });
  3823. var methodOf = baseRest(function(object, args) {
  3824. return function(path) {
  3825. return baseInvoke(object, path, args);
  3826. };
  3827. });
  3828. function min$3(array) {
  3829. return array && array.length ? baseExtremum(array, identity$1, baseLt) : void 0;
  3830. }
  3831. function minBy(array, iteratee) {
  3832. return array && array.length ? baseExtremum(array, baseIteratee(iteratee), baseLt) : void 0;
  3833. }
  3834. function mixin$1(object, source, options) {
  3835. var props = keys(source), methodNames = baseFunctions(source, props);
  3836. var chain = !(isObject$2(options) && "chain" in options) || !!options.chain, isFunc = isFunction$1(object);
  3837. arrayEach(methodNames, function(methodName) {
  3838. var func = source[methodName];
  3839. object[methodName] = func;
  3840. if (isFunc) {
  3841. object.prototype[methodName] = function() {
  3842. var chainAll = this.__chain__;
  3843. if (chain || chainAll) {
  3844. var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__);
  3845. actions.push({ "func": func, "args": arguments, "thisArg": object });
  3846. result.__chain__ = chainAll;
  3847. return result;
  3848. }
  3849. return func.apply(object, arrayPush([this.value()], arguments));
  3850. };
  3851. }
  3852. });
  3853. return object;
  3854. }
  3855. var multiply = createMathOperation(function(multiplier, multiplicand) {
  3856. return multiplier * multiplicand;
  3857. }, 1);
  3858. var FUNC_ERROR_TEXT$3 = "Expected a function";
  3859. function negate(predicate) {
  3860. if (typeof predicate != "function") {
  3861. throw new TypeError(FUNC_ERROR_TEXT$3);
  3862. }
  3863. return function() {
  3864. var args = arguments;
  3865. switch (args.length) {
  3866. case 0:
  3867. return !predicate.call(this);
  3868. case 1:
  3869. return !predicate.call(this, args[0]);
  3870. case 2:
  3871. return !predicate.call(this, args[0], args[1]);
  3872. case 3:
  3873. return !predicate.call(this, args[0], args[1], args[2]);
  3874. }
  3875. return !predicate.apply(this, args);
  3876. };
  3877. }
  3878. function iteratorToArray(iterator) {
  3879. var data, result = [];
  3880. while (!(data = iterator.next()).done) {
  3881. result.push(data.value);
  3882. }
  3883. return result;
  3884. }
  3885. var mapTag$1 = "[object Map]";
  3886. var setTag$1 = "[object Set]";
  3887. var symIterator$1 = Symbol$1 ? Symbol$1.iterator : void 0;
  3888. function toArray(value) {
  3889. if (!value) {
  3890. return [];
  3891. }
  3892. if (isArrayLike(value)) {
  3893. return isString$2(value) ? stringToArray(value) : copyArray(value);
  3894. }
  3895. if (symIterator$1 && value[symIterator$1]) {
  3896. return iteratorToArray(value[symIterator$1]());
  3897. }
  3898. var tag = getTag$1(value), func = tag == mapTag$1 ? mapToArray : tag == setTag$1 ? setToArray : values;
  3899. return func(value);
  3900. }
  3901. function wrapperNext() {
  3902. if (this.__values__ === void 0) {
  3903. this.__values__ = toArray(this.value());
  3904. }
  3905. var done = this.__index__ >= this.__values__.length, value = done ? void 0 : this.__values__[this.__index__++];
  3906. return { "done": done, "value": value };
  3907. }
  3908. function baseNth(array, n) {
  3909. var length = array.length;
  3910. if (!length) {
  3911. return;
  3912. }
  3913. n += n < 0 ? length : 0;
  3914. return isIndex(n, length) ? array[n] : void 0;
  3915. }
  3916. function nth(array, n) {
  3917. return array && array.length ? baseNth(array, toInteger(n)) : void 0;
  3918. }
  3919. function nthArg(n) {
  3920. n = toInteger(n);
  3921. return baseRest(function(args) {
  3922. return baseNth(args, n);
  3923. });
  3924. }
  3925. function baseUnset(object, path) {
  3926. path = castPath(path, object);
  3927. object = parent(object, path);
  3928. return object == null || delete object[toKey(last(path))];
  3929. }
  3930. function customOmitClone(value) {
  3931. return isPlainObject(value) ? void 0 : value;
  3932. }
  3933. var CLONE_DEEP_FLAG = 1;
  3934. var CLONE_FLAT_FLAG = 2;
  3935. var CLONE_SYMBOLS_FLAG = 4;
  3936. var omit = flatRest(function(object, paths) {
  3937. var result = {};
  3938. if (object == null) {
  3939. return result;
  3940. }
  3941. var isDeep = false;
  3942. paths = arrayMap(paths, function(path) {
  3943. path = castPath(path, object);
  3944. isDeep || (isDeep = path.length > 1);
  3945. return path;
  3946. });
  3947. copyObject(object, getAllKeysIn(object), result);
  3948. if (isDeep) {
  3949. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  3950. }
  3951. var length = paths.length;
  3952. while (length--) {
  3953. baseUnset(result, paths[length]);
  3954. }
  3955. return result;
  3956. });
  3957. function baseSet(object, path, value, customizer) {
  3958. if (!isObject$2(object)) {
  3959. return object;
  3960. }
  3961. path = castPath(path, object);
  3962. var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  3963. while (nested != null && ++index < length) {
  3964. var key = toKey(path[index]), newValue = value;
  3965. if (key === "__proto__" || key === "constructor" || key === "prototype") {
  3966. return object;
  3967. }
  3968. if (index != lastIndex) {
  3969. var objValue = nested[key];
  3970. newValue = customizer ? customizer(objValue, key, nested) : void 0;
  3971. if (newValue === void 0) {
  3972. newValue = isObject$2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
  3973. }
  3974. }
  3975. assignValue(nested, key, newValue);
  3976. nested = nested[key];
  3977. }
  3978. return object;
  3979. }
  3980. function basePickBy(object, paths, predicate) {
  3981. var index = -1, length = paths.length, result = {};
  3982. while (++index < length) {
  3983. var path = paths[index], value = baseGet(object, path);
  3984. if (predicate(value, path)) {
  3985. baseSet(result, castPath(path, object), value);
  3986. }
  3987. }
  3988. return result;
  3989. }
  3990. function pickBy(object, predicate) {
  3991. if (object == null) {
  3992. return {};
  3993. }
  3994. var props = arrayMap(getAllKeysIn(object), function(prop) {
  3995. return [prop];
  3996. });
  3997. predicate = baseIteratee(predicate);
  3998. return basePickBy(object, props, function(value, path) {
  3999. return predicate(value, path[0]);
  4000. });
  4001. }
  4002. function omitBy(object, predicate) {
  4003. return pickBy(object, negate(baseIteratee(predicate)));
  4004. }
  4005. function once(func) {
  4006. return before(2, func);
  4007. }
  4008. function baseSortBy(array, comparer) {
  4009. var length = array.length;
  4010. array.sort(comparer);
  4011. while (length--) {
  4012. array[length] = array[length].value;
  4013. }
  4014. return array;
  4015. }
  4016. function compareAscending(value, other) {
  4017. if (value !== other) {
  4018. var valIsDefined = value !== void 0, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
  4019. var othIsDefined = other !== void 0, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
  4020. if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
  4021. return 1;
  4022. }
  4023. if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
  4024. return -1;
  4025. }
  4026. }
  4027. return 0;
  4028. }
  4029. function compareMultiple(object, other, orders) {
  4030. var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
  4031. while (++index < length) {
  4032. var result = compareAscending(objCriteria[index], othCriteria[index]);
  4033. if (result) {
  4034. if (index >= ordersLength) {
  4035. return result;
  4036. }
  4037. var order = orders[index];
  4038. return result * (order == "desc" ? -1 : 1);
  4039. }
  4040. }
  4041. return object.index - other.index;
  4042. }
  4043. function baseOrderBy(collection, iteratees, orders) {
  4044. if (iteratees.length) {
  4045. iteratees = arrayMap(iteratees, function(iteratee) {
  4046. if (isArray$1(iteratee)) {
  4047. return function(value) {
  4048. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4049. };
  4050. }
  4051. return iteratee;
  4052. });
  4053. } else {
  4054. iteratees = [identity$1];
  4055. }
  4056. var index = -1;
  4057. iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
  4058. var result = baseMap(collection, function(value, key, collection2) {
  4059. var criteria = arrayMap(iteratees, function(iteratee) {
  4060. return iteratee(value);
  4061. });
  4062. return { "criteria": criteria, "index": ++index, "value": value };
  4063. });
  4064. return baseSortBy(result, function(object, other) {
  4065. return compareMultiple(object, other, orders);
  4066. });
  4067. }
  4068. function orderBy$1(collection, iteratees, orders, guard) {
  4069. if (collection == null) {
  4070. return [];
  4071. }
  4072. if (!isArray$1(iteratees)) {
  4073. iteratees = iteratees == null ? [] : [iteratees];
  4074. }
  4075. orders = guard ? void 0 : orders;
  4076. if (!isArray$1(orders)) {
  4077. orders = orders == null ? [] : [orders];
  4078. }
  4079. return baseOrderBy(collection, iteratees, orders);
  4080. }
  4081. function createOver(arrayFunc) {
  4082. return flatRest(function(iteratees) {
  4083. iteratees = arrayMap(iteratees, baseUnary(baseIteratee));
  4084. return baseRest(function(args) {
  4085. var thisArg = this;
  4086. return arrayFunc(iteratees, function(iteratee) {
  4087. return apply(iteratee, thisArg, args);
  4088. });
  4089. });
  4090. });
  4091. }
  4092. var over = createOver(arrayMap);
  4093. var castRest = baseRest;
  4094. var nativeMin$6 = Math.min;
  4095. var overArgs = castRest(function(func, transforms) {
  4096. transforms = transforms.length == 1 && isArray$1(transforms[0]) ? arrayMap(transforms[0], baseUnary(baseIteratee)) : arrayMap(baseFlatten(transforms, 1), baseUnary(baseIteratee));
  4097. var funcsLength = transforms.length;
  4098. return baseRest(function(args) {
  4099. var index = -1, length = nativeMin$6(args.length, funcsLength);
  4100. while (++index < length) {
  4101. args[index] = transforms[index].call(this, args[index]);
  4102. }
  4103. return apply(func, this, args);
  4104. });
  4105. });
  4106. var overEvery = createOver(arrayEvery);
  4107. var overSome = createOver(arraySome);
  4108. var MAX_SAFE_INTEGER$2 = 9007199254740991;
  4109. var nativeFloor$3 = Math.floor;
  4110. function baseRepeat(string, n) {
  4111. var result = "";
  4112. if (!string || n < 1 || n > MAX_SAFE_INTEGER$2) {
  4113. return result;
  4114. }
  4115. do {
  4116. if (n % 2) {
  4117. result += string;
  4118. }
  4119. n = nativeFloor$3(n / 2);
  4120. if (n) {
  4121. string += string;
  4122. }
  4123. } while (n);
  4124. return result;
  4125. }
  4126. var asciiSize = baseProperty("length");
  4127. var rsAstralRange = "\\ud800-\\udfff";
  4128. var rsComboMarksRange = "\\u0300-\\u036f";
  4129. var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
  4130. var rsComboSymbolsRange = "\\u20d0-\\u20ff";
  4131. var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
  4132. var rsVarRange = "\\ufe0e\\ufe0f";
  4133. var rsAstral = "[" + rsAstralRange + "]";
  4134. var rsCombo = "[" + rsComboRange + "]";
  4135. var rsFitz = "\\ud83c[\\udffb-\\udfff]";
  4136. var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
  4137. var rsNonAstral = "[^" + rsAstralRange + "]";
  4138. var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
  4139. var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
  4140. var rsZWJ = "\\u200d";
  4141. var reOptMod = rsModifier + "?";
  4142. var rsOptVar = "[" + rsVarRange + "]?";
  4143. var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
  4144. var rsSeq = rsOptVar + reOptMod + rsOptJoin;
  4145. var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
  4146. var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
  4147. function unicodeSize(string) {
  4148. var result = reUnicode.lastIndex = 0;
  4149. while (reUnicode.test(string)) {
  4150. ++result;
  4151. }
  4152. return result;
  4153. }
  4154. function stringSize(string) {
  4155. return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
  4156. }
  4157. var nativeCeil$2 = Math.ceil;
  4158. function createPadding(length, chars) {
  4159. chars = chars === void 0 ? " " : baseToString(chars);
  4160. var charsLength = chars.length;
  4161. if (charsLength < 2) {
  4162. return charsLength ? baseRepeat(chars, length) : chars;
  4163. }
  4164. var result = baseRepeat(chars, nativeCeil$2(length / stringSize(chars)));
  4165. return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join("") : result.slice(0, length);
  4166. }
  4167. var nativeCeil$1 = Math.ceil;
  4168. var nativeFloor$2 = Math.floor;
  4169. function pad(string, length, chars) {
  4170. string = toString(string);
  4171. length = toInteger(length);
  4172. var strLength = length ? stringSize(string) : 0;
  4173. if (!length || strLength >= length) {
  4174. return string;
  4175. }
  4176. var mid = (length - strLength) / 2;
  4177. return createPadding(nativeFloor$2(mid), chars) + string + createPadding(nativeCeil$1(mid), chars);
  4178. }
  4179. function padEnd(string, length, chars) {
  4180. string = toString(string);
  4181. length = toInteger(length);
  4182. var strLength = length ? stringSize(string) : 0;
  4183. return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
  4184. }
  4185. function padStart(string, length, chars) {
  4186. string = toString(string);
  4187. length = toInteger(length);
  4188. var strLength = length ? stringSize(string) : 0;
  4189. return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
  4190. }
  4191. var reTrimStart$1 = /^\s+/;
  4192. var nativeParseInt = root.parseInt;
  4193. function parseInt$1(string, radix, guard) {
  4194. if (guard || radix == null) {
  4195. radix = 0;
  4196. } else if (radix) {
  4197. radix = +radix;
  4198. }
  4199. return nativeParseInt(toString(string).replace(reTrimStart$1, ""), radix || 0);
  4200. }
  4201. var WRAP_PARTIAL_FLAG = 32;
  4202. var partial = baseRest(function(func, partials) {
  4203. var holders = replaceHolders(partials, getHolder(partial));
  4204. return createWrap(func, WRAP_PARTIAL_FLAG, void 0, partials, holders);
  4205. });
  4206. partial.placeholder = {};
  4207. var WRAP_PARTIAL_RIGHT_FLAG = 64;
  4208. var partialRight = baseRest(function(func, partials) {
  4209. var holders = replaceHolders(partials, getHolder(partialRight));
  4210. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, void 0, partials, holders);
  4211. });
  4212. partialRight.placeholder = {};
  4213. var partition = createAggregator(function(result, value, key) {
  4214. result[key ? 0 : 1].push(value);
  4215. }, function() {
  4216. return [[], []];
  4217. });
  4218. function basePick(object, paths) {
  4219. return basePickBy(object, paths, function(value, path) {
  4220. return hasIn(object, path);
  4221. });
  4222. }
  4223. var pick = flatRest(function(object, paths) {
  4224. return object == null ? {} : basePick(object, paths);
  4225. });
  4226. function wrapperPlant(value) {
  4227. var result, parent = this;
  4228. while (parent instanceof baseLodash) {
  4229. var clone = wrapperClone(parent);
  4230. clone.__index__ = 0;
  4231. clone.__values__ = void 0;
  4232. if (result) {
  4233. previous.__wrapped__ = clone;
  4234. } else {
  4235. result = clone;
  4236. }
  4237. var previous = clone;
  4238. parent = parent.__wrapped__;
  4239. }
  4240. previous.__wrapped__ = value;
  4241. return result;
  4242. }
  4243. function propertyOf(object) {
  4244. return function(path) {
  4245. return object == null ? void 0 : baseGet(object, path);
  4246. };
  4247. }
  4248. function baseIndexOfWith(array, value, fromIndex, comparator) {
  4249. var index = fromIndex - 1, length = array.length;
  4250. while (++index < length) {
  4251. if (comparator(array[index], value)) {
  4252. return index;
  4253. }
  4254. }
  4255. return -1;
  4256. }
  4257. var arrayProto$3 = Array.prototype;
  4258. var splice$1 = arrayProto$3.splice;
  4259. function basePullAll(array, values, iteratee, comparator) {
  4260. var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array;
  4261. if (array === values) {
  4262. values = copyArray(values);
  4263. }
  4264. if (iteratee) {
  4265. seen = arrayMap(array, baseUnary(iteratee));
  4266. }
  4267. while (++index < length) {
  4268. var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value;
  4269. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4270. if (seen !== array) {
  4271. splice$1.call(seen, fromIndex, 1);
  4272. }
  4273. splice$1.call(array, fromIndex, 1);
  4274. }
  4275. }
  4276. return array;
  4277. }
  4278. function pullAll(array, values) {
  4279. return array && array.length && values && values.length ? basePullAll(array, values) : array;
  4280. }
  4281. var pull = baseRest(pullAll);
  4282. function pullAllBy(array, values, iteratee) {
  4283. return array && array.length && values && values.length ? basePullAll(array, values, baseIteratee(iteratee)) : array;
  4284. }
  4285. function pullAllWith(array, values, comparator) {
  4286. return array && array.length && values && values.length ? basePullAll(array, values, void 0, comparator) : array;
  4287. }
  4288. var arrayProto$2 = Array.prototype;
  4289. var splice = arrayProto$2.splice;
  4290. function basePullAt(array, indexes) {
  4291. var length = array ? indexes.length : 0, lastIndex = length - 1;
  4292. while (length--) {
  4293. var index = indexes[length];
  4294. if (length == lastIndex || index !== previous) {
  4295. var previous = index;
  4296. if (isIndex(index)) {
  4297. splice.call(array, index, 1);
  4298. } else {
  4299. baseUnset(array, index);
  4300. }
  4301. }
  4302. }
  4303. return array;
  4304. }
  4305. var pullAt = flatRest(function(array, indexes) {
  4306. var length = array == null ? 0 : array.length, result = baseAt(array, indexes);
  4307. basePullAt(array, arrayMap(indexes, function(index) {
  4308. return isIndex(index, length) ? +index : index;
  4309. }).sort(compareAscending));
  4310. return result;
  4311. });
  4312. var nativeFloor$1 = Math.floor;
  4313. var nativeRandom$1 = Math.random;
  4314. function baseRandom(lower, upper) {
  4315. return lower + nativeFloor$1(nativeRandom$1() * (upper - lower + 1));
  4316. }
  4317. var freeParseFloat = parseFloat;
  4318. var nativeMin$5 = Math.min;
  4319. var nativeRandom = Math.random;
  4320. function random(lower, upper, floating) {
  4321. if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
  4322. upper = floating = void 0;
  4323. }
  4324. if (floating === void 0) {
  4325. if (typeof upper == "boolean") {
  4326. floating = upper;
  4327. upper = void 0;
  4328. } else if (typeof lower == "boolean") {
  4329. floating = lower;
  4330. lower = void 0;
  4331. }
  4332. }
  4333. if (lower === void 0 && upper === void 0) {
  4334. lower = 0;
  4335. upper = 1;
  4336. } else {
  4337. lower = toFinite(lower);
  4338. if (upper === void 0) {
  4339. upper = lower;
  4340. lower = 0;
  4341. } else {
  4342. upper = toFinite(upper);
  4343. }
  4344. }
  4345. if (lower > upper) {
  4346. var temp = lower;
  4347. lower = upper;
  4348. upper = temp;
  4349. }
  4350. if (floating || lower % 1 || upper % 1) {
  4351. var rand = nativeRandom();
  4352. return nativeMin$5(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
  4353. }
  4354. return baseRandom(lower, upper);
  4355. }
  4356. var nativeCeil = Math.ceil;
  4357. var nativeMax$4 = Math.max;
  4358. function baseRange(start, end, step, fromRight) {
  4359. var index = -1, length = nativeMax$4(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
  4360. while (length--) {
  4361. result[fromRight ? length : ++index] = start;
  4362. start += step;
  4363. }
  4364. return result;
  4365. }
  4366. function createRange(fromRight) {
  4367. return function(start, end, step) {
  4368. if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
  4369. end = step = void 0;
  4370. }
  4371. start = toFinite(start);
  4372. if (end === void 0) {
  4373. end = start;
  4374. start = 0;
  4375. } else {
  4376. end = toFinite(end);
  4377. }
  4378. step = step === void 0 ? start < end ? 1 : -1 : toFinite(step);
  4379. return baseRange(start, end, step, fromRight);
  4380. };
  4381. }
  4382. var range$1 = createRange();
  4383. var rangeRight = createRange(true);
  4384. var WRAP_REARG_FLAG = 256;
  4385. var rearg = flatRest(function(func, indexes) {
  4386. return createWrap(func, WRAP_REARG_FLAG, void 0, void 0, void 0, indexes);
  4387. });
  4388. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  4389. eachFunc(collection, function(value, index, collection2) {
  4390. accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
  4391. });
  4392. return accumulator;
  4393. }
  4394. function reduce(collection, iteratee, accumulator) {
  4395. var func = isArray$1(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
  4396. return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEach);
  4397. }
  4398. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  4399. var length = array == null ? 0 : array.length;
  4400. if (initAccum && length) {
  4401. accumulator = array[--length];
  4402. }
  4403. while (length--) {
  4404. accumulator = iteratee(accumulator, array[length], length, array);
  4405. }
  4406. return accumulator;
  4407. }
  4408. function reduceRight(collection, iteratee, accumulator) {
  4409. var func = isArray$1(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
  4410. return func(collection, baseIteratee(iteratee), accumulator, initAccum, baseEachRight);
  4411. }
  4412. function reject(collection, predicate) {
  4413. var func = isArray$1(collection) ? arrayFilter : baseFilter;
  4414. return func(collection, negate(baseIteratee(predicate)));
  4415. }
  4416. function remove(array, predicate) {
  4417. var result = [];
  4418. if (!(array && array.length)) {
  4419. return result;
  4420. }
  4421. var index = -1, indexes = [], length = array.length;
  4422. predicate = baseIteratee(predicate);
  4423. while (++index < length) {
  4424. var value = array[index];
  4425. if (predicate(value, index, array)) {
  4426. result.push(value);
  4427. indexes.push(index);
  4428. }
  4429. }
  4430. basePullAt(array, indexes);
  4431. return result;
  4432. }
  4433. function repeat(string, n, guard) {
  4434. if (guard ? isIterateeCall(string, n, guard) : n === void 0) {
  4435. n = 1;
  4436. } else {
  4437. n = toInteger(n);
  4438. }
  4439. return baseRepeat(toString(string), n);
  4440. }
  4441. function replace() {
  4442. var args = arguments, string = toString(args[0]);
  4443. return args.length < 3 ? string : string.replace(args[1], args[2]);
  4444. }
  4445. var FUNC_ERROR_TEXT$2 = "Expected a function";
  4446. function rest(func, start) {
  4447. if (typeof func != "function") {
  4448. throw new TypeError(FUNC_ERROR_TEXT$2);
  4449. }
  4450. start = start === void 0 ? start : toInteger(start);
  4451. return baseRest(func, start);
  4452. }
  4453. function result(object, path, defaultValue) {
  4454. path = castPath(path, object);
  4455. var index = -1, length = path.length;
  4456. if (!length) {
  4457. length = 1;
  4458. object = void 0;
  4459. }
  4460. while (++index < length) {
  4461. var value = object == null ? void 0 : object[toKey(path[index])];
  4462. if (value === void 0) {
  4463. index = length;
  4464. value = defaultValue;
  4465. }
  4466. object = isFunction$1(value) ? value.call(object) : value;
  4467. }
  4468. return object;
  4469. }
  4470. var arrayProto$1 = Array.prototype;
  4471. var nativeReverse = arrayProto$1.reverse;
  4472. function reverse(array) {
  4473. return array == null ? array : nativeReverse.call(array);
  4474. }
  4475. var round$1 = createRound("round");
  4476. function arraySample(array) {
  4477. var length = array.length;
  4478. return length ? array[baseRandom(0, length - 1)] : void 0;
  4479. }
  4480. function baseSample(collection) {
  4481. return arraySample(values(collection));
  4482. }
  4483. function sample(collection) {
  4484. var func = isArray$1(collection) ? arraySample : baseSample;
  4485. return func(collection);
  4486. }
  4487. function shuffleSelf(array, size) {
  4488. var index = -1, length = array.length, lastIndex = length - 1;
  4489. size = size === void 0 ? length : size;
  4490. while (++index < size) {
  4491. var rand = baseRandom(index, lastIndex), value = array[rand];
  4492. array[rand] = array[index];
  4493. array[index] = value;
  4494. }
  4495. array.length = size;
  4496. return array;
  4497. }
  4498. function arraySampleSize(array, n) {
  4499. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  4500. }
  4501. function baseSampleSize(collection, n) {
  4502. var array = values(collection);
  4503. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4504. }
  4505. function sampleSize(collection, n, guard) {
  4506. if (guard ? isIterateeCall(collection, n, guard) : n === void 0) {
  4507. n = 1;
  4508. } else {
  4509. n = toInteger(n);
  4510. }
  4511. var func = isArray$1(collection) ? arraySampleSize : baseSampleSize;
  4512. return func(collection, n);
  4513. }
  4514. function set(object, path, value) {
  4515. return object == null ? object : baseSet(object, path, value);
  4516. }
  4517. function setWith(object, path, value, customizer) {
  4518. customizer = typeof customizer == "function" ? customizer : void 0;
  4519. return object == null ? object : baseSet(object, path, value, customizer);
  4520. }
  4521. function arrayShuffle(array) {
  4522. return shuffleSelf(copyArray(array));
  4523. }
  4524. function baseShuffle(collection) {
  4525. return shuffleSelf(values(collection));
  4526. }
  4527. function shuffle(collection) {
  4528. var func = isArray$1(collection) ? arrayShuffle : baseShuffle;
  4529. return func(collection);
  4530. }
  4531. var mapTag = "[object Map]";
  4532. var setTag = "[object Set]";
  4533. function size(collection) {
  4534. if (collection == null) {
  4535. return 0;
  4536. }
  4537. if (isArrayLike(collection)) {
  4538. return isString$2(collection) ? stringSize(collection) : collection.length;
  4539. }
  4540. var tag = getTag$1(collection);
  4541. if (tag == mapTag || tag == setTag) {
  4542. return collection.size;
  4543. }
  4544. return baseKeys(collection).length;
  4545. }
  4546. function slice(array, start, end) {
  4547. var length = array == null ? 0 : array.length;
  4548. if (!length) {
  4549. return [];
  4550. }
  4551. if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
  4552. start = 0;
  4553. end = length;
  4554. } else {
  4555. start = start == null ? 0 : toInteger(start);
  4556. end = end === void 0 ? length : toInteger(end);
  4557. }
  4558. return baseSlice(array, start, end);
  4559. }
  4560. var snakeCase = createCompounder(function(result, word, index) {
  4561. return result + (index ? "_" : "") + word.toLowerCase();
  4562. });
  4563. function baseSome(collection, predicate) {
  4564. var result;
  4565. baseEach(collection, function(value, index, collection2) {
  4566. result = predicate(value, index, collection2);
  4567. return !result;
  4568. });
  4569. return !!result;
  4570. }
  4571. function some(collection, predicate, guard) {
  4572. var func = isArray$1(collection) ? arraySome : baseSome;
  4573. if (guard && isIterateeCall(collection, predicate, guard)) {
  4574. predicate = void 0;
  4575. }
  4576. return func(collection, baseIteratee(predicate));
  4577. }
  4578. var sortBy = baseRest(function(collection, iteratees) {
  4579. if (collection == null) {
  4580. return [];
  4581. }
  4582. var length = iteratees.length;
  4583. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  4584. iteratees = [];
  4585. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  4586. iteratees = [iteratees[0]];
  4587. }
  4588. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  4589. });
  4590. var MAX_ARRAY_LENGTH$4 = 4294967295;
  4591. var MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH$4 - 1;
  4592. var nativeFloor = Math.floor;
  4593. var nativeMin$4 = Math.min;
  4594. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4595. var low = 0, high = array == null ? 0 : array.length;
  4596. if (high === 0) {
  4597. return 0;
  4598. }
  4599. value = iteratee(value);
  4600. var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === void 0;
  4601. while (low < high) {
  4602. var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== void 0, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
  4603. if (valIsNaN) {
  4604. var setLow = retHighest || othIsReflexive;
  4605. } else if (valIsUndefined) {
  4606. setLow = othIsReflexive && (retHighest || othIsDefined);
  4607. } else if (valIsNull) {
  4608. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4609. } else if (valIsSymbol) {
  4610. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4611. } else if (othIsNull || othIsSymbol) {
  4612. setLow = false;
  4613. } else {
  4614. setLow = retHighest ? computed <= value : computed < value;
  4615. }
  4616. if (setLow) {
  4617. low = mid + 1;
  4618. } else {
  4619. high = mid;
  4620. }
  4621. }
  4622. return nativeMin$4(high, MAX_ARRAY_INDEX);
  4623. }
  4624. var MAX_ARRAY_LENGTH$3 = 4294967295;
  4625. var HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH$3 >>> 1;
  4626. function baseSortedIndex(array, value, retHighest) {
  4627. var low = 0, high = array == null ? low : array.length;
  4628. if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4629. while (low < high) {
  4630. var mid = low + high >>> 1, computed = array[mid];
  4631. if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
  4632. low = mid + 1;
  4633. } else {
  4634. high = mid;
  4635. }
  4636. }
  4637. return high;
  4638. }
  4639. return baseSortedIndexBy(array, value, identity$1, retHighest);
  4640. }
  4641. function sortedIndex(array, value) {
  4642. return baseSortedIndex(array, value);
  4643. }
  4644. function sortedIndexBy(array, value, iteratee) {
  4645. return baseSortedIndexBy(array, value, baseIteratee(iteratee));
  4646. }
  4647. function sortedIndexOf(array, value) {
  4648. var length = array == null ? 0 : array.length;
  4649. if (length) {
  4650. var index = baseSortedIndex(array, value);
  4651. if (index < length && eq(array[index], value)) {
  4652. return index;
  4653. }
  4654. }
  4655. return -1;
  4656. }
  4657. function sortedLastIndex(array, value) {
  4658. return baseSortedIndex(array, value, true);
  4659. }
  4660. function sortedLastIndexBy(array, value, iteratee) {
  4661. return baseSortedIndexBy(array, value, baseIteratee(iteratee), true);
  4662. }
  4663. function sortedLastIndexOf(array, value) {
  4664. var length = array == null ? 0 : array.length;
  4665. if (length) {
  4666. var index = baseSortedIndex(array, value, true) - 1;
  4667. if (eq(array[index], value)) {
  4668. return index;
  4669. }
  4670. }
  4671. return -1;
  4672. }
  4673. function baseSortedUniq(array, iteratee) {
  4674. var index = -1, length = array.length, resIndex = 0, result = [];
  4675. while (++index < length) {
  4676. var value = array[index], computed = iteratee ? iteratee(value) : value;
  4677. if (!index || !eq(computed, seen)) {
  4678. var seen = computed;
  4679. result[resIndex++] = value === 0 ? 0 : value;
  4680. }
  4681. }
  4682. return result;
  4683. }
  4684. function sortedUniq(array) {
  4685. return array && array.length ? baseSortedUniq(array) : [];
  4686. }
  4687. function sortedUniqBy(array, iteratee) {
  4688. return array && array.length ? baseSortedUniq(array, baseIteratee(iteratee)) : [];
  4689. }
  4690. var MAX_ARRAY_LENGTH$2 = 4294967295;
  4691. function split(string, separator, limit) {
  4692. if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
  4693. separator = limit = void 0;
  4694. }
  4695. limit = limit === void 0 ? MAX_ARRAY_LENGTH$2 : limit >>> 0;
  4696. if (!limit) {
  4697. return [];
  4698. }
  4699. string = toString(string);
  4700. if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
  4701. separator = baseToString(separator);
  4702. if (!separator && hasUnicode(string)) {
  4703. return castSlice(stringToArray(string), 0, limit);
  4704. }
  4705. }
  4706. return string.split(separator, limit);
  4707. }
  4708. var FUNC_ERROR_TEXT$1 = "Expected a function";
  4709. var nativeMax$3 = Math.max;
  4710. function spread(func, start) {
  4711. if (typeof func != "function") {
  4712. throw new TypeError(FUNC_ERROR_TEXT$1);
  4713. }
  4714. start = start == null ? 0 : nativeMax$3(toInteger(start), 0);
  4715. return baseRest(function(args) {
  4716. var array = args[start], otherArgs = castSlice(args, 0, start);
  4717. if (array) {
  4718. arrayPush(otherArgs, array);
  4719. }
  4720. return apply(func, this, otherArgs);
  4721. });
  4722. }
  4723. var startCase = createCompounder(function(result, word, index) {
  4724. return result + (index ? " " : "") + upperFirst(word);
  4725. });
  4726. function startsWith(string, target, position) {
  4727. string = toString(string);
  4728. position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
  4729. target = baseToString(target);
  4730. return string.slice(position, position + target.length) == target;
  4731. }
  4732. function stubObject() {
  4733. return {};
  4734. }
  4735. function stubString() {
  4736. return "";
  4737. }
  4738. function stubTrue() {
  4739. return true;
  4740. }
  4741. var subtract = createMathOperation(function(minuend, subtrahend) {
  4742. return minuend - subtrahend;
  4743. }, 0);
  4744. function sum$1(array) {
  4745. return array && array.length ? baseSum(array, identity$1) : 0;
  4746. }
  4747. function sumBy(array, iteratee) {
  4748. return array && array.length ? baseSum(array, baseIteratee(iteratee)) : 0;
  4749. }
  4750. function tail(array) {
  4751. var length = array == null ? 0 : array.length;
  4752. return length ? baseSlice(array, 1, length) : [];
  4753. }
  4754. function take(array, n, guard) {
  4755. if (!(array && array.length)) {
  4756. return [];
  4757. }
  4758. n = guard || n === void 0 ? 1 : toInteger(n);
  4759. return baseSlice(array, 0, n < 0 ? 0 : n);
  4760. }
  4761. function takeRight(array, n, guard) {
  4762. var length = array == null ? 0 : array.length;
  4763. if (!length) {
  4764. return [];
  4765. }
  4766. n = guard || n === void 0 ? 1 : toInteger(n);
  4767. n = length - n;
  4768. return baseSlice(array, n < 0 ? 0 : n, length);
  4769. }
  4770. function takeRightWhile(array, predicate) {
  4771. return array && array.length ? baseWhile(array, baseIteratee(predicate), false, true) : [];
  4772. }
  4773. function takeWhile(array, predicate) {
  4774. return array && array.length ? baseWhile(array, baseIteratee(predicate)) : [];
  4775. }
  4776. function tap(value, interceptor) {
  4777. interceptor(value);
  4778. return value;
  4779. }
  4780. var objectProto$2 = Object.prototype;
  4781. var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
  4782. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  4783. if (objValue === void 0 || eq(objValue, objectProto$2[key]) && !hasOwnProperty$3.call(object, key)) {
  4784. return srcValue;
  4785. }
  4786. return objValue;
  4787. }
  4788. var stringEscapes = {
  4789. "\\": "\\",
  4790. "'": "'",
  4791. "\n": "n",
  4792. "\r": "r",
  4793. "\u2028": "u2028",
  4794. "\u2029": "u2029"
  4795. };
  4796. function escapeStringChar(chr) {
  4797. return "\\" + stringEscapes[chr];
  4798. }
  4799. var reInterpolate = /<%=([\s\S]+?)%>/g;
  4800. var reEscape = /<%-([\s\S]+?)%>/g;
  4801. var reEvaluate = /<%([\s\S]+?)%>/g;
  4802. var templateSettings = {
  4803. "escape": reEscape,
  4804. "evaluate": reEvaluate,
  4805. "interpolate": reInterpolate,
  4806. "variable": "",
  4807. "imports": {
  4808. "_": { "escape": escape }
  4809. }
  4810. };
  4811. var INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
  4812. var reEmptyStringLeading = /\b__p \+= '';/g;
  4813. var reEmptyStringMiddle = /\b(__p \+=) '' \+/g;
  4814. var reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  4815. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  4816. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  4817. var reNoMatch = /($^)/;
  4818. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  4819. var objectProto$1 = Object.prototype;
  4820. var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
  4821. function template(string, options, guard) {
  4822. var settings = templateSettings.imports._.templateSettings || templateSettings;
  4823. if (guard && isIterateeCall(string, options, guard)) {
  4824. options = void 0;
  4825. }
  4826. string = toString(string);
  4827. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  4828. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
  4829. var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
  4830. var reDelimiters = RegExp((options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g");
  4831. var sourceURL = hasOwnProperty$2.call(options, "sourceURL") ? "//# sourceURL=" + (options.sourceURL + "").replace(/\s/g, " ") + "\n" : "";
  4832. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  4833. interpolateValue || (interpolateValue = esTemplateValue);
  4834. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  4835. if (escapeValue) {
  4836. isEscaping = true;
  4837. source += "' +\n__e(" + escapeValue + ") +\n'";
  4838. }
  4839. if (evaluateValue) {
  4840. isEvaluating = true;
  4841. source += "';\n" + evaluateValue + ";\n__p += '";
  4842. }
  4843. if (interpolateValue) {
  4844. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  4845. }
  4846. index = offset + match.length;
  4847. return match;
  4848. });
  4849. source += "';\n";
  4850. var variable = hasOwnProperty$2.call(options, "variable") && options.variable;
  4851. if (!variable) {
  4852. source = "with (obj) {\n" + source + "\n}\n";
  4853. } else if (reForbiddenIdentifierChars.test(variable)) {
  4854. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  4855. }
  4856. source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
  4857. source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
  4858. var result = attempt(function() {
  4859. return Function(importsKeys, sourceURL + "return " + source).apply(void 0, importsValues);
  4860. });
  4861. result.source = source;
  4862. if (isError(result)) {
  4863. throw result;
  4864. }
  4865. return result;
  4866. }
  4867. var FUNC_ERROR_TEXT = "Expected a function";
  4868. function throttle(func, wait, options) {
  4869. var leading = true, trailing = true;
  4870. if (typeof func != "function") {
  4871. throw new TypeError(FUNC_ERROR_TEXT);
  4872. }
  4873. if (isObject$2(options)) {
  4874. leading = "leading" in options ? !!options.leading : leading;
  4875. trailing = "trailing" in options ? !!options.trailing : trailing;
  4876. }
  4877. return debounce(func, wait, {
  4878. "leading": leading,
  4879. "maxWait": wait,
  4880. "trailing": trailing
  4881. });
  4882. }
  4883. function thru(value, interceptor) {
  4884. return interceptor(value);
  4885. }
  4886. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  4887. var MAX_ARRAY_LENGTH$1 = 4294967295;
  4888. var nativeMin$3 = Math.min;
  4889. function times(n, iteratee) {
  4890. n = toInteger(n);
  4891. if (n < 1 || n > MAX_SAFE_INTEGER$1) {
  4892. return [];
  4893. }
  4894. var index = MAX_ARRAY_LENGTH$1, length = nativeMin$3(n, MAX_ARRAY_LENGTH$1);
  4895. iteratee = castFunction(iteratee);
  4896. n -= MAX_ARRAY_LENGTH$1;
  4897. var result = baseTimes(length, iteratee);
  4898. while (++index < n) {
  4899. iteratee(index);
  4900. }
  4901. return result;
  4902. }
  4903. function wrapperToIterator() {
  4904. return this;
  4905. }
  4906. function baseWrapperValue(value, actions) {
  4907. var result = value;
  4908. if (result instanceof LazyWrapper) {
  4909. result = result.value();
  4910. }
  4911. return arrayReduce(actions, function(result2, action) {
  4912. return action.func.apply(action.thisArg, arrayPush([result2], action.args));
  4913. }, result);
  4914. }
  4915. function wrapperValue() {
  4916. return baseWrapperValue(this.__wrapped__, this.__actions__);
  4917. }
  4918. function toLower(value) {
  4919. return toString(value).toLowerCase();
  4920. }
  4921. function toPath(value) {
  4922. if (isArray$1(value)) {
  4923. return arrayMap(value, toKey);
  4924. }
  4925. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  4926. }
  4927. var MAX_SAFE_INTEGER = 9007199254740991;
  4928. function toSafeInteger(value) {
  4929. return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
  4930. }
  4931. function toUpper(value) {
  4932. return toString(value).toUpperCase();
  4933. }
  4934. function transform(object, iteratee, accumulator) {
  4935. var isArr = isArray$1(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  4936. iteratee = baseIteratee(iteratee);
  4937. if (accumulator == null) {
  4938. var Ctor = object && object.constructor;
  4939. if (isArrLike) {
  4940. accumulator = isArr ? new Ctor() : [];
  4941. } else if (isObject$2(object)) {
  4942. accumulator = isFunction$1(Ctor) ? baseCreate(getPrototype(object)) : {};
  4943. } else {
  4944. accumulator = {};
  4945. }
  4946. }
  4947. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
  4948. return iteratee(accumulator, value, index, object2);
  4949. });
  4950. return accumulator;
  4951. }
  4952. function charsEndIndex(strSymbols, chrSymbols) {
  4953. var index = strSymbols.length;
  4954. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  4955. }
  4956. return index;
  4957. }
  4958. function charsStartIndex(strSymbols, chrSymbols) {
  4959. var index = -1, length = strSymbols.length;
  4960. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
  4961. }
  4962. return index;
  4963. }
  4964. function trim(string, chars, guard) {
  4965. string = toString(string);
  4966. if (string && (guard || chars === void 0)) {
  4967. return baseTrim(string);
  4968. }
  4969. if (!string || !(chars = baseToString(chars))) {
  4970. return string;
  4971. }
  4972. var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
  4973. return castSlice(strSymbols, start, end).join("");
  4974. }
  4975. function trimEnd(string, chars, guard) {
  4976. string = toString(string);
  4977. if (string && (guard || chars === void 0)) {
  4978. return string.slice(0, trimmedEndIndex(string) + 1);
  4979. }
  4980. if (!string || !(chars = baseToString(chars))) {
  4981. return string;
  4982. }
  4983. var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  4984. return castSlice(strSymbols, 0, end).join("");
  4985. }
  4986. var reTrimStart = /^\s+/;
  4987. function trimStart(string, chars, guard) {
  4988. string = toString(string);
  4989. if (string && (guard || chars === void 0)) {
  4990. return string.replace(reTrimStart, "");
  4991. }
  4992. if (!string || !(chars = baseToString(chars))) {
  4993. return string;
  4994. }
  4995. var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
  4996. return castSlice(strSymbols, start).join("");
  4997. }
  4998. var DEFAULT_TRUNC_LENGTH = 30;
  4999. var DEFAULT_TRUNC_OMISSION = "...";
  5000. var reFlags = /\w*$/;
  5001. function truncate(string, options) {
  5002. var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
  5003. if (isObject$2(options)) {
  5004. var separator = "separator" in options ? options.separator : separator;
  5005. length = "length" in options ? toInteger(options.length) : length;
  5006. omission = "omission" in options ? baseToString(options.omission) : omission;
  5007. }
  5008. string = toString(string);
  5009. var strLength = string.length;
  5010. if (hasUnicode(string)) {
  5011. var strSymbols = stringToArray(string);
  5012. strLength = strSymbols.length;
  5013. }
  5014. if (length >= strLength) {
  5015. return string;
  5016. }
  5017. var end = length - stringSize(omission);
  5018. if (end < 1) {
  5019. return omission;
  5020. }
  5021. var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
  5022. if (separator === void 0) {
  5023. return result + omission;
  5024. }
  5025. if (strSymbols) {
  5026. end += result.length - end;
  5027. }
  5028. if (isRegExp(separator)) {
  5029. if (string.slice(end).search(separator)) {
  5030. var match, substring = result;
  5031. if (!separator.global) {
  5032. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + "g");
  5033. }
  5034. separator.lastIndex = 0;
  5035. while (match = separator.exec(substring)) {
  5036. var newEnd = match.index;
  5037. }
  5038. result = result.slice(0, newEnd === void 0 ? end : newEnd);
  5039. }
  5040. } else if (string.indexOf(baseToString(separator), end) != end) {
  5041. var index = result.lastIndexOf(separator);
  5042. if (index > -1) {
  5043. result = result.slice(0, index);
  5044. }
  5045. }
  5046. return result + omission;
  5047. }
  5048. function unary(func) {
  5049. return ary(func, 1);
  5050. }
  5051. var htmlUnescapes = {
  5052. "&amp;": "&",
  5053. "&lt;": "<",
  5054. "&gt;": ">",
  5055. "&quot;": '"',
  5056. "&#39;": "'"
  5057. };
  5058. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  5059. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
  5060. var reHasEscapedHtml = RegExp(reEscapedHtml.source);
  5061. function unescape(string) {
  5062. string = toString(string);
  5063. return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
  5064. }
  5065. var INFINITY = 1 / 0;
  5066. var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == INFINITY) ? noop$1 : function(values) {
  5067. return new Set$1(values);
  5068. };
  5069. var LARGE_ARRAY_SIZE = 200;
  5070. function baseUniq(array, iteratee, comparator) {
  5071. var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
  5072. if (comparator) {
  5073. isCommon = false;
  5074. includes = arrayIncludesWith;
  5075. } else if (length >= LARGE_ARRAY_SIZE) {
  5076. var set = iteratee ? null : createSet(array);
  5077. if (set) {
  5078. return setToArray(set);
  5079. }
  5080. isCommon = false;
  5081. includes = cacheHas;
  5082. seen = new SetCache();
  5083. } else {
  5084. seen = iteratee ? [] : result;
  5085. }
  5086. outer:
  5087. while (++index < length) {
  5088. var value = array[index], computed = iteratee ? iteratee(value) : value;
  5089. value = comparator || value !== 0 ? value : 0;
  5090. if (isCommon && computed === computed) {
  5091. var seenIndex = seen.length;
  5092. while (seenIndex--) {
  5093. if (seen[seenIndex] === computed) {
  5094. continue outer;
  5095. }
  5096. }
  5097. if (iteratee) {
  5098. seen.push(computed);
  5099. }
  5100. result.push(value);
  5101. } else if (!includes(seen, computed, comparator)) {
  5102. if (seen !== result) {
  5103. seen.push(computed);
  5104. }
  5105. result.push(value);
  5106. }
  5107. }
  5108. return result;
  5109. }
  5110. var union = baseRest(function(arrays) {
  5111. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  5112. });
  5113. var unionBy = baseRest(function(arrays) {
  5114. var iteratee = last(arrays);
  5115. if (isArrayLikeObject(iteratee)) {
  5116. iteratee = void 0;
  5117. }
  5118. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), baseIteratee(iteratee));
  5119. });
  5120. var unionWith = baseRest(function(arrays) {
  5121. var comparator = last(arrays);
  5122. comparator = typeof comparator == "function" ? comparator : void 0;
  5123. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), void 0, comparator);
  5124. });
  5125. function uniq(array) {
  5126. return array && array.length ? baseUniq(array) : [];
  5127. }
  5128. function uniqBy(array, iteratee) {
  5129. return array && array.length ? baseUniq(array, baseIteratee(iteratee)) : [];
  5130. }
  5131. function uniqWith(array, comparator) {
  5132. comparator = typeof comparator == "function" ? comparator : void 0;
  5133. return array && array.length ? baseUniq(array, void 0, comparator) : [];
  5134. }
  5135. var idCounter = 0;
  5136. function uniqueId(prefix) {
  5137. var id = ++idCounter;
  5138. return toString(prefix) + id;
  5139. }
  5140. function unset(object, path) {
  5141. return object == null ? true : baseUnset(object, path);
  5142. }
  5143. var nativeMax$2 = Math.max;
  5144. function unzip(array) {
  5145. if (!(array && array.length)) {
  5146. return [];
  5147. }
  5148. var length = 0;
  5149. array = arrayFilter(array, function(group) {
  5150. if (isArrayLikeObject(group)) {
  5151. length = nativeMax$2(group.length, length);
  5152. return true;
  5153. }
  5154. });
  5155. return baseTimes(length, function(index) {
  5156. return arrayMap(array, baseProperty(index));
  5157. });
  5158. }
  5159. function unzipWith(array, iteratee) {
  5160. if (!(array && array.length)) {
  5161. return [];
  5162. }
  5163. var result = unzip(array);
  5164. if (iteratee == null) {
  5165. return result;
  5166. }
  5167. return arrayMap(result, function(group) {
  5168. return apply(iteratee, void 0, group);
  5169. });
  5170. }
  5171. function baseUpdate(object, path, updater, customizer) {
  5172. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5173. }
  5174. function update(object, path, updater) {
  5175. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  5176. }
  5177. function updateWith(object, path, updater, customizer) {
  5178. customizer = typeof customizer == "function" ? customizer : void 0;
  5179. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  5180. }
  5181. var upperCase = createCompounder(function(result, word, index) {
  5182. return result + (index ? " " : "") + word.toUpperCase();
  5183. });
  5184. function valuesIn(object) {
  5185. return object == null ? [] : baseValues(object, keysIn(object));
  5186. }
  5187. var without = baseRest(function(array, values) {
  5188. return isArrayLikeObject(array) ? baseDifference(array, values) : [];
  5189. });
  5190. function wrap(value, wrapper) {
  5191. return partial(castFunction(wrapper), value);
  5192. }
  5193. var wrapperAt = flatRest(function(paths) {
  5194. var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
  5195. return baseAt(object, paths);
  5196. };
  5197. if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
  5198. return this.thru(interceptor);
  5199. }
  5200. value = value.slice(start, +start + (length ? 1 : 0));
  5201. value.__actions__.push({
  5202. "func": thru,
  5203. "args": [interceptor],
  5204. "thisArg": void 0
  5205. });
  5206. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  5207. if (length && !array.length) {
  5208. array.push(void 0);
  5209. }
  5210. return array;
  5211. });
  5212. });
  5213. function wrapperChain() {
  5214. return chain(this);
  5215. }
  5216. function wrapperReverse() {
  5217. var value = this.__wrapped__;
  5218. if (value instanceof LazyWrapper) {
  5219. var wrapped = value;
  5220. if (this.__actions__.length) {
  5221. wrapped = new LazyWrapper(this);
  5222. }
  5223. wrapped = wrapped.reverse();
  5224. wrapped.__actions__.push({
  5225. "func": thru,
  5226. "args": [reverse],
  5227. "thisArg": void 0
  5228. });
  5229. return new LodashWrapper(wrapped, this.__chain__);
  5230. }
  5231. return this.thru(reverse);
  5232. }
  5233. function baseXor(arrays, iteratee, comparator) {
  5234. var length = arrays.length;
  5235. if (length < 2) {
  5236. return length ? baseUniq(arrays[0]) : [];
  5237. }
  5238. var index = -1, result = Array(length);
  5239. while (++index < length) {
  5240. var array = arrays[index], othIndex = -1;
  5241. while (++othIndex < length) {
  5242. if (othIndex != index) {
  5243. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5244. }
  5245. }
  5246. }
  5247. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5248. }
  5249. var xor = baseRest(function(arrays) {
  5250. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  5251. });
  5252. var xorBy = baseRest(function(arrays) {
  5253. var iteratee = last(arrays);
  5254. if (isArrayLikeObject(iteratee)) {
  5255. iteratee = void 0;
  5256. }
  5257. return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee));
  5258. });
  5259. var xorWith = baseRest(function(arrays) {
  5260. var comparator = last(arrays);
  5261. comparator = typeof comparator == "function" ? comparator : void 0;
  5262. return baseXor(arrayFilter(arrays, isArrayLikeObject), void 0, comparator);
  5263. });
  5264. var zip = baseRest(unzip);
  5265. function baseZipObject(props, values, assignFunc) {
  5266. var index = -1, length = props.length, valsLength = values.length, result = {};
  5267. while (++index < length) {
  5268. var value = index < valsLength ? values[index] : void 0;
  5269. assignFunc(result, props[index], value);
  5270. }
  5271. return result;
  5272. }
  5273. function zipObject(props, values) {
  5274. return baseZipObject(props || [], values || [], assignValue);
  5275. }
  5276. function zipObjectDeep(props, values) {
  5277. return baseZipObject(props || [], values || [], baseSet);
  5278. }
  5279. var zipWith = baseRest(function(arrays) {
  5280. var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : void 0;
  5281. iteratee = typeof iteratee == "function" ? (arrays.pop(), iteratee) : void 0;
  5282. return unzipWith(arrays, iteratee);
  5283. });
  5284. var array = {
  5285. chunk,
  5286. compact,
  5287. concat,
  5288. difference,
  5289. differenceBy,
  5290. differenceWith,
  5291. drop,
  5292. dropRight,
  5293. dropRightWhile,
  5294. dropWhile,
  5295. fill,
  5296. findIndex,
  5297. findLastIndex,
  5298. first: head,
  5299. flatten,
  5300. flattenDeep,
  5301. flattenDepth,
  5302. fromPairs,
  5303. head,
  5304. indexOf,
  5305. initial,
  5306. intersection,
  5307. intersectionBy,
  5308. intersectionWith,
  5309. join,
  5310. last,
  5311. lastIndexOf,
  5312. nth,
  5313. pull,
  5314. pullAll,
  5315. pullAllBy,
  5316. pullAllWith,
  5317. pullAt,
  5318. remove,
  5319. reverse,
  5320. slice,
  5321. sortedIndex,
  5322. sortedIndexBy,
  5323. sortedIndexOf,
  5324. sortedLastIndex,
  5325. sortedLastIndexBy,
  5326. sortedLastIndexOf,
  5327. sortedUniq,
  5328. sortedUniqBy,
  5329. tail,
  5330. take,
  5331. takeRight,
  5332. takeRightWhile,
  5333. takeWhile,
  5334. union,
  5335. unionBy,
  5336. unionWith,
  5337. uniq,
  5338. uniqBy,
  5339. uniqWith,
  5340. unzip,
  5341. unzipWith,
  5342. without,
  5343. xor,
  5344. xorBy,
  5345. xorWith,
  5346. zip,
  5347. zipObject,
  5348. zipObjectDeep,
  5349. zipWith
  5350. };
  5351. var collection = {
  5352. countBy,
  5353. each: forEach,
  5354. eachRight: forEachRight,
  5355. every,
  5356. filter,
  5357. find,
  5358. findLast,
  5359. flatMap,
  5360. flatMapDeep,
  5361. flatMapDepth,
  5362. forEach,
  5363. forEachRight,
  5364. groupBy,
  5365. includes,
  5366. invokeMap,
  5367. keyBy,
  5368. map,
  5369. orderBy: orderBy$1,
  5370. partition,
  5371. reduce,
  5372. reduceRight,
  5373. reject,
  5374. sample,
  5375. sampleSize,
  5376. shuffle,
  5377. size,
  5378. some,
  5379. sortBy
  5380. };
  5381. var date$1 = {
  5382. now
  5383. };
  5384. var func = {
  5385. after,
  5386. ary,
  5387. before,
  5388. bind,
  5389. bindKey,
  5390. curry,
  5391. curryRight,
  5392. debounce,
  5393. defer,
  5394. delay,
  5395. flip,
  5396. memoize,
  5397. negate,
  5398. once,
  5399. overArgs,
  5400. partial,
  5401. partialRight,
  5402. rearg,
  5403. rest,
  5404. spread,
  5405. throttle,
  5406. unary,
  5407. wrap
  5408. };
  5409. var lang = {
  5410. castArray: castArray$1,
  5411. clone,
  5412. cloneDeep,
  5413. cloneDeepWith,
  5414. cloneWith,
  5415. conformsTo,
  5416. eq,
  5417. gt: gt$1,
  5418. gte,
  5419. isArguments,
  5420. isArray: isArray$1,
  5421. isArrayBuffer,
  5422. isArrayLike,
  5423. isArrayLikeObject,
  5424. isBoolean: isBoolean$1,
  5425. isBuffer,
  5426. isDate: isDate$1,
  5427. isElement: isElement$2,
  5428. isEmpty: isEmpty$1,
  5429. isEqual: isEqual$1,
  5430. isEqualWith,
  5431. isError,
  5432. isFinite,
  5433. isFunction: isFunction$1,
  5434. isInteger,
  5435. isLength,
  5436. isMap,
  5437. isMatch,
  5438. isMatchWith,
  5439. isNaN: isNaN$1,
  5440. isNative,
  5441. isNil,
  5442. isNull,
  5443. isNumber: isNumber$1,
  5444. isObject: isObject$2,
  5445. isObjectLike,
  5446. isPlainObject,
  5447. isRegExp,
  5448. isSafeInteger,
  5449. isSet,
  5450. isString: isString$2,
  5451. isSymbol,
  5452. isTypedArray,
  5453. isUndefined: isUndefined$1,
  5454. isWeakMap,
  5455. isWeakSet,
  5456. lt: lt$1,
  5457. lte,
  5458. toArray,
  5459. toFinite,
  5460. toInteger,
  5461. toLength,
  5462. toNumber,
  5463. toPlainObject,
  5464. toSafeInteger,
  5465. toString
  5466. };
  5467. var math = {
  5468. add,
  5469. ceil,
  5470. divide,
  5471. floor: floor$1,
  5472. max: max$3,
  5473. maxBy,
  5474. mean,
  5475. meanBy,
  5476. min: min$3,
  5477. minBy,
  5478. multiply,
  5479. round: round$1,
  5480. subtract,
  5481. sum: sum$1,
  5482. sumBy
  5483. };
  5484. var number = {
  5485. clamp,
  5486. inRange,
  5487. random
  5488. };
  5489. var object = {
  5490. assign,
  5491. assignIn,
  5492. assignInWith,
  5493. assignWith,
  5494. at: at$1,
  5495. create,
  5496. defaults,
  5497. defaultsDeep,
  5498. entries: toPairs,
  5499. entriesIn: toPairsIn,
  5500. extend: assignIn,
  5501. extendWith: assignInWith,
  5502. findKey,
  5503. findLastKey,
  5504. forIn,
  5505. forInRight,
  5506. forOwn,
  5507. forOwnRight,
  5508. functions,
  5509. functionsIn,
  5510. get,
  5511. has,
  5512. hasIn,
  5513. invert,
  5514. invertBy,
  5515. invoke,
  5516. keys,
  5517. keysIn,
  5518. mapKeys,
  5519. mapValues,
  5520. merge,
  5521. mergeWith,
  5522. omit,
  5523. omitBy,
  5524. pick,
  5525. pickBy,
  5526. result,
  5527. set,
  5528. setWith,
  5529. toPairs,
  5530. toPairsIn,
  5531. transform,
  5532. unset,
  5533. update,
  5534. updateWith,
  5535. values,
  5536. valuesIn
  5537. };
  5538. var seq = {
  5539. at: wrapperAt,
  5540. chain,
  5541. commit: wrapperCommit,
  5542. lodash,
  5543. next: wrapperNext,
  5544. plant: wrapperPlant,
  5545. reverse: wrapperReverse,
  5546. tap,
  5547. thru,
  5548. toIterator: wrapperToIterator,
  5549. toJSON: wrapperValue,
  5550. value: wrapperValue,
  5551. valueOf: wrapperValue,
  5552. wrapperChain
  5553. };
  5554. var string$1 = {
  5555. camelCase,
  5556. capitalize: capitalize$2,
  5557. deburr,
  5558. endsWith,
  5559. escape,
  5560. escapeRegExp,
  5561. kebabCase,
  5562. lowerCase,
  5563. lowerFirst,
  5564. pad,
  5565. padEnd,
  5566. padStart,
  5567. parseInt: parseInt$1,
  5568. repeat,
  5569. replace,
  5570. snakeCase,
  5571. split,
  5572. startCase,
  5573. startsWith,
  5574. template,
  5575. templateSettings,
  5576. toLower,
  5577. toUpper,
  5578. trim,
  5579. trimEnd,
  5580. trimStart,
  5581. truncate,
  5582. unescape,
  5583. upperCase,
  5584. upperFirst,
  5585. words
  5586. };
  5587. var util = {
  5588. attempt,
  5589. bindAll,
  5590. cond,
  5591. conforms,
  5592. constant,
  5593. defaultTo,
  5594. flow,
  5595. flowRight,
  5596. identity: identity$1,
  5597. iteratee,
  5598. matches,
  5599. matchesProperty,
  5600. method,
  5601. methodOf,
  5602. mixin: mixin$1,
  5603. noop: noop$1,
  5604. nthArg,
  5605. over,
  5606. overEvery,
  5607. overSome,
  5608. property,
  5609. propertyOf,
  5610. range: range$1,
  5611. rangeRight,
  5612. stubArray,
  5613. stubFalse,
  5614. stubObject,
  5615. stubString,
  5616. stubTrue,
  5617. times,
  5618. toPath,
  5619. uniqueId
  5620. };
  5621. function lazyClone() {
  5622. var result = new LazyWrapper(this.__wrapped__);
  5623. result.__actions__ = copyArray(this.__actions__);
  5624. result.__dir__ = this.__dir__;
  5625. result.__filtered__ = this.__filtered__;
  5626. result.__iteratees__ = copyArray(this.__iteratees__);
  5627. result.__takeCount__ = this.__takeCount__;
  5628. result.__views__ = copyArray(this.__views__);
  5629. return result;
  5630. }
  5631. function lazyReverse() {
  5632. if (this.__filtered__) {
  5633. var result = new LazyWrapper(this);
  5634. result.__dir__ = -1;
  5635. result.__filtered__ = true;
  5636. } else {
  5637. result = this.clone();
  5638. result.__dir__ *= -1;
  5639. }
  5640. return result;
  5641. }
  5642. var nativeMax$1 = Math.max;
  5643. var nativeMin$2 = Math.min;
  5644. function getView(start, end, transforms) {
  5645. var index = -1, length = transforms.length;
  5646. while (++index < length) {
  5647. var data = transforms[index], size = data.size;
  5648. switch (data.type) {
  5649. case "drop":
  5650. start += size;
  5651. break;
  5652. case "dropRight":
  5653. end -= size;
  5654. break;
  5655. case "take":
  5656. end = nativeMin$2(end, start + size);
  5657. break;
  5658. case "takeRight":
  5659. start = nativeMax$1(start, end - size);
  5660. break;
  5661. }
  5662. }
  5663. return { "start": start, "end": end };
  5664. }
  5665. var LAZY_FILTER_FLAG$1 = 1;
  5666. var LAZY_MAP_FLAG = 2;
  5667. var nativeMin$1 = Math.min;
  5668. function lazyValue() {
  5669. var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray$1(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin$1(length, this.__takeCount__);
  5670. if (!isArr || !isRight && arrLength == length && takeCount == length) {
  5671. return baseWrapperValue(array, this.__actions__);
  5672. }
  5673. var result = [];
  5674. outer:
  5675. while (length-- && resIndex < takeCount) {
  5676. index += dir;
  5677. var iterIndex = -1, value = array[index];
  5678. while (++iterIndex < iterLength) {
  5679. var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value);
  5680. if (type == LAZY_MAP_FLAG) {
  5681. value = computed;
  5682. } else if (!computed) {
  5683. if (type == LAZY_FILTER_FLAG$1) {
  5684. continue outer;
  5685. } else {
  5686. break outer;
  5687. }
  5688. }
  5689. }
  5690. result[resIndex++] = value;
  5691. }
  5692. return result;
  5693. }
  5694. var VERSION = "4.17.21";
  5695. var WRAP_BIND_KEY_FLAG = 2;
  5696. var LAZY_FILTER_FLAG = 1;
  5697. var LAZY_WHILE_FLAG = 3;
  5698. var MAX_ARRAY_LENGTH = 4294967295;
  5699. var arrayProto = Array.prototype;
  5700. var objectProto = Object.prototype;
  5701. var hasOwnProperty$1 = objectProto.hasOwnProperty;
  5702. var symIterator = Symbol$1 ? Symbol$1.iterator : void 0;
  5703. var nativeMax = Math.max;
  5704. var nativeMin = Math.min;
  5705. var mixin = function(func2) {
  5706. return function(object2, source, options) {
  5707. if (options == null) {
  5708. var isObj = isObject$2(source), props = isObj && keys(source), methodNames = props && props.length && baseFunctions(source, props);
  5709. if (!(methodNames ? methodNames.length : isObj)) {
  5710. options = source;
  5711. source = object2;
  5712. object2 = this;
  5713. }
  5714. }
  5715. return func2(object2, source, options);
  5716. };
  5717. }(mixin$1);
  5718. lodash.after = func.after;
  5719. lodash.ary = func.ary;
  5720. lodash.assign = object.assign;
  5721. lodash.assignIn = object.assignIn;
  5722. lodash.assignInWith = object.assignInWith;
  5723. lodash.assignWith = object.assignWith;
  5724. lodash.at = object.at;
  5725. lodash.before = func.before;
  5726. lodash.bind = func.bind;
  5727. lodash.bindAll = util.bindAll;
  5728. lodash.bindKey = func.bindKey;
  5729. lodash.castArray = lang.castArray;
  5730. lodash.chain = seq.chain;
  5731. lodash.chunk = array.chunk;
  5732. lodash.compact = array.compact;
  5733. lodash.concat = array.concat;
  5734. lodash.cond = util.cond;
  5735. lodash.conforms = util.conforms;
  5736. lodash.constant = util.constant;
  5737. lodash.countBy = collection.countBy;
  5738. lodash.create = object.create;
  5739. lodash.curry = func.curry;
  5740. lodash.curryRight = func.curryRight;
  5741. lodash.debounce = func.debounce;
  5742. lodash.defaults = object.defaults;
  5743. lodash.defaultsDeep = object.defaultsDeep;
  5744. lodash.defer = func.defer;
  5745. lodash.delay = func.delay;
  5746. lodash.difference = array.difference;
  5747. lodash.differenceBy = array.differenceBy;
  5748. lodash.differenceWith = array.differenceWith;
  5749. lodash.drop = array.drop;
  5750. lodash.dropRight = array.dropRight;
  5751. lodash.dropRightWhile = array.dropRightWhile;
  5752. lodash.dropWhile = array.dropWhile;
  5753. lodash.fill = array.fill;
  5754. lodash.filter = collection.filter;
  5755. lodash.flatMap = collection.flatMap;
  5756. lodash.flatMapDeep = collection.flatMapDeep;
  5757. lodash.flatMapDepth = collection.flatMapDepth;
  5758. lodash.flatten = array.flatten;
  5759. lodash.flattenDeep = array.flattenDeep;
  5760. lodash.flattenDepth = array.flattenDepth;
  5761. lodash.flip = func.flip;
  5762. lodash.flow = util.flow;
  5763. lodash.flowRight = util.flowRight;
  5764. lodash.fromPairs = array.fromPairs;
  5765. lodash.functions = object.functions;
  5766. lodash.functionsIn = object.functionsIn;
  5767. lodash.groupBy = collection.groupBy;
  5768. lodash.initial = array.initial;
  5769. lodash.intersection = array.intersection;
  5770. lodash.intersectionBy = array.intersectionBy;
  5771. lodash.intersectionWith = array.intersectionWith;
  5772. lodash.invert = object.invert;
  5773. lodash.invertBy = object.invertBy;
  5774. lodash.invokeMap = collection.invokeMap;
  5775. lodash.iteratee = util.iteratee;
  5776. lodash.keyBy = collection.keyBy;
  5777. lodash.keys = keys;
  5778. lodash.keysIn = object.keysIn;
  5779. lodash.map = collection.map;
  5780. lodash.mapKeys = object.mapKeys;
  5781. lodash.mapValues = object.mapValues;
  5782. lodash.matches = util.matches;
  5783. lodash.matchesProperty = util.matchesProperty;
  5784. lodash.memoize = func.memoize;
  5785. lodash.merge = object.merge;
  5786. lodash.mergeWith = object.mergeWith;
  5787. lodash.method = util.method;
  5788. lodash.methodOf = util.methodOf;
  5789. lodash.mixin = mixin;
  5790. lodash.negate = negate;
  5791. lodash.nthArg = util.nthArg;
  5792. lodash.omit = object.omit;
  5793. lodash.omitBy = object.omitBy;
  5794. lodash.once = func.once;
  5795. lodash.orderBy = collection.orderBy;
  5796. lodash.over = util.over;
  5797. lodash.overArgs = func.overArgs;
  5798. lodash.overEvery = util.overEvery;
  5799. lodash.overSome = util.overSome;
  5800. lodash.partial = func.partial;
  5801. lodash.partialRight = func.partialRight;
  5802. lodash.partition = collection.partition;
  5803. lodash.pick = object.pick;
  5804. lodash.pickBy = object.pickBy;
  5805. lodash.property = util.property;
  5806. lodash.propertyOf = util.propertyOf;
  5807. lodash.pull = array.pull;
  5808. lodash.pullAll = array.pullAll;
  5809. lodash.pullAllBy = array.pullAllBy;
  5810. lodash.pullAllWith = array.pullAllWith;
  5811. lodash.pullAt = array.pullAt;
  5812. lodash.range = util.range;
  5813. lodash.rangeRight = util.rangeRight;
  5814. lodash.rearg = func.rearg;
  5815. lodash.reject = collection.reject;
  5816. lodash.remove = array.remove;
  5817. lodash.rest = func.rest;
  5818. lodash.reverse = array.reverse;
  5819. lodash.sampleSize = collection.sampleSize;
  5820. lodash.set = object.set;
  5821. lodash.setWith = object.setWith;
  5822. lodash.shuffle = collection.shuffle;
  5823. lodash.slice = array.slice;
  5824. lodash.sortBy = collection.sortBy;
  5825. lodash.sortedUniq = array.sortedUniq;
  5826. lodash.sortedUniqBy = array.sortedUniqBy;
  5827. lodash.split = string$1.split;
  5828. lodash.spread = func.spread;
  5829. lodash.tail = array.tail;
  5830. lodash.take = array.take;
  5831. lodash.takeRight = array.takeRight;
  5832. lodash.takeRightWhile = array.takeRightWhile;
  5833. lodash.takeWhile = array.takeWhile;
  5834. lodash.tap = seq.tap;
  5835. lodash.throttle = func.throttle;
  5836. lodash.thru = thru;
  5837. lodash.toArray = lang.toArray;
  5838. lodash.toPairs = object.toPairs;
  5839. lodash.toPairsIn = object.toPairsIn;
  5840. lodash.toPath = util.toPath;
  5841. lodash.toPlainObject = lang.toPlainObject;
  5842. lodash.transform = object.transform;
  5843. lodash.unary = func.unary;
  5844. lodash.union = array.union;
  5845. lodash.unionBy = array.unionBy;
  5846. lodash.unionWith = array.unionWith;
  5847. lodash.uniq = array.uniq;
  5848. lodash.uniqBy = array.uniqBy;
  5849. lodash.uniqWith = array.uniqWith;
  5850. lodash.unset = object.unset;
  5851. lodash.unzip = array.unzip;
  5852. lodash.unzipWith = array.unzipWith;
  5853. lodash.update = object.update;
  5854. lodash.updateWith = object.updateWith;
  5855. lodash.values = object.values;
  5856. lodash.valuesIn = object.valuesIn;
  5857. lodash.without = array.without;
  5858. lodash.words = string$1.words;
  5859. lodash.wrap = func.wrap;
  5860. lodash.xor = array.xor;
  5861. lodash.xorBy = array.xorBy;
  5862. lodash.xorWith = array.xorWith;
  5863. lodash.zip = array.zip;
  5864. lodash.zipObject = array.zipObject;
  5865. lodash.zipObjectDeep = array.zipObjectDeep;
  5866. lodash.zipWith = array.zipWith;
  5867. lodash.entries = object.toPairs;
  5868. lodash.entriesIn = object.toPairsIn;
  5869. lodash.extend = object.assignIn;
  5870. lodash.extendWith = object.assignInWith;
  5871. mixin(lodash, lodash);
  5872. lodash.add = math.add;
  5873. lodash.attempt = util.attempt;
  5874. lodash.camelCase = string$1.camelCase;
  5875. lodash.capitalize = string$1.capitalize;
  5876. lodash.ceil = math.ceil;
  5877. lodash.clamp = number.clamp;
  5878. lodash.clone = lang.clone;
  5879. lodash.cloneDeep = lang.cloneDeep;
  5880. lodash.cloneDeepWith = lang.cloneDeepWith;
  5881. lodash.cloneWith = lang.cloneWith;
  5882. lodash.conformsTo = lang.conformsTo;
  5883. lodash.deburr = string$1.deburr;
  5884. lodash.defaultTo = util.defaultTo;
  5885. lodash.divide = math.divide;
  5886. lodash.endsWith = string$1.endsWith;
  5887. lodash.eq = lang.eq;
  5888. lodash.escape = string$1.escape;
  5889. lodash.escapeRegExp = string$1.escapeRegExp;
  5890. lodash.every = collection.every;
  5891. lodash.find = collection.find;
  5892. lodash.findIndex = array.findIndex;
  5893. lodash.findKey = object.findKey;
  5894. lodash.findLast = collection.findLast;
  5895. lodash.findLastIndex = array.findLastIndex;
  5896. lodash.findLastKey = object.findLastKey;
  5897. lodash.floor = math.floor;
  5898. lodash.forEach = collection.forEach;
  5899. lodash.forEachRight = collection.forEachRight;
  5900. lodash.forIn = object.forIn;
  5901. lodash.forInRight = object.forInRight;
  5902. lodash.forOwn = object.forOwn;
  5903. lodash.forOwnRight = object.forOwnRight;
  5904. lodash.get = object.get;
  5905. lodash.gt = lang.gt;
  5906. lodash.gte = lang.gte;
  5907. lodash.has = object.has;
  5908. lodash.hasIn = object.hasIn;
  5909. lodash.head = array.head;
  5910. lodash.identity = identity$1;
  5911. lodash.includes = collection.includes;
  5912. lodash.indexOf = array.indexOf;
  5913. lodash.inRange = number.inRange;
  5914. lodash.invoke = object.invoke;
  5915. lodash.isArguments = lang.isArguments;
  5916. lodash.isArray = isArray$1;
  5917. lodash.isArrayBuffer = lang.isArrayBuffer;
  5918. lodash.isArrayLike = lang.isArrayLike;
  5919. lodash.isArrayLikeObject = lang.isArrayLikeObject;
  5920. lodash.isBoolean = lang.isBoolean;
  5921. lodash.isBuffer = lang.isBuffer;
  5922. lodash.isDate = lang.isDate;
  5923. lodash.isElement = lang.isElement;
  5924. lodash.isEmpty = lang.isEmpty;
  5925. lodash.isEqual = lang.isEqual;
  5926. lodash.isEqualWith = lang.isEqualWith;
  5927. lodash.isError = lang.isError;
  5928. lodash.isFinite = lang.isFinite;
  5929. lodash.isFunction = lang.isFunction;
  5930. lodash.isInteger = lang.isInteger;
  5931. lodash.isLength = lang.isLength;
  5932. lodash.isMap = lang.isMap;
  5933. lodash.isMatch = lang.isMatch;
  5934. lodash.isMatchWith = lang.isMatchWith;
  5935. lodash.isNaN = lang.isNaN;
  5936. lodash.isNative = lang.isNative;
  5937. lodash.isNil = lang.isNil;
  5938. lodash.isNull = lang.isNull;
  5939. lodash.isNumber = lang.isNumber;
  5940. lodash.isObject = isObject$2;
  5941. lodash.isObjectLike = lang.isObjectLike;
  5942. lodash.isPlainObject = lang.isPlainObject;
  5943. lodash.isRegExp = lang.isRegExp;
  5944. lodash.isSafeInteger = lang.isSafeInteger;
  5945. lodash.isSet = lang.isSet;
  5946. lodash.isString = lang.isString;
  5947. lodash.isSymbol = lang.isSymbol;
  5948. lodash.isTypedArray = lang.isTypedArray;
  5949. lodash.isUndefined = lang.isUndefined;
  5950. lodash.isWeakMap = lang.isWeakMap;
  5951. lodash.isWeakSet = lang.isWeakSet;
  5952. lodash.join = array.join;
  5953. lodash.kebabCase = string$1.kebabCase;
  5954. lodash.last = last;
  5955. lodash.lastIndexOf = array.lastIndexOf;
  5956. lodash.lowerCase = string$1.lowerCase;
  5957. lodash.lowerFirst = string$1.lowerFirst;
  5958. lodash.lt = lang.lt;
  5959. lodash.lte = lang.lte;
  5960. lodash.max = math.max;
  5961. lodash.maxBy = math.maxBy;
  5962. lodash.mean = math.mean;
  5963. lodash.meanBy = math.meanBy;
  5964. lodash.min = math.min;
  5965. lodash.minBy = math.minBy;
  5966. lodash.stubArray = util.stubArray;
  5967. lodash.stubFalse = util.stubFalse;
  5968. lodash.stubObject = util.stubObject;
  5969. lodash.stubString = util.stubString;
  5970. lodash.stubTrue = util.stubTrue;
  5971. lodash.multiply = math.multiply;
  5972. lodash.nth = array.nth;
  5973. lodash.noop = util.noop;
  5974. lodash.now = date$1.now;
  5975. lodash.pad = string$1.pad;
  5976. lodash.padEnd = string$1.padEnd;
  5977. lodash.padStart = string$1.padStart;
  5978. lodash.parseInt = string$1.parseInt;
  5979. lodash.random = number.random;
  5980. lodash.reduce = collection.reduce;
  5981. lodash.reduceRight = collection.reduceRight;
  5982. lodash.repeat = string$1.repeat;
  5983. lodash.replace = string$1.replace;
  5984. lodash.result = object.result;
  5985. lodash.round = math.round;
  5986. lodash.sample = collection.sample;
  5987. lodash.size = collection.size;
  5988. lodash.snakeCase = string$1.snakeCase;
  5989. lodash.some = collection.some;
  5990. lodash.sortedIndex = array.sortedIndex;
  5991. lodash.sortedIndexBy = array.sortedIndexBy;
  5992. lodash.sortedIndexOf = array.sortedIndexOf;
  5993. lodash.sortedLastIndex = array.sortedLastIndex;
  5994. lodash.sortedLastIndexBy = array.sortedLastIndexBy;
  5995. lodash.sortedLastIndexOf = array.sortedLastIndexOf;
  5996. lodash.startCase = string$1.startCase;
  5997. lodash.startsWith = string$1.startsWith;
  5998. lodash.subtract = math.subtract;
  5999. lodash.sum = math.sum;
  6000. lodash.sumBy = math.sumBy;
  6001. lodash.template = string$1.template;
  6002. lodash.times = util.times;
  6003. lodash.toFinite = lang.toFinite;
  6004. lodash.toInteger = toInteger;
  6005. lodash.toLength = lang.toLength;
  6006. lodash.toLower = string$1.toLower;
  6007. lodash.toNumber = lang.toNumber;
  6008. lodash.toSafeInteger = lang.toSafeInteger;
  6009. lodash.toString = lang.toString;
  6010. lodash.toUpper = string$1.toUpper;
  6011. lodash.trim = string$1.trim;
  6012. lodash.trimEnd = string$1.trimEnd;
  6013. lodash.trimStart = string$1.trimStart;
  6014. lodash.truncate = string$1.truncate;
  6015. lodash.unescape = string$1.unescape;
  6016. lodash.uniqueId = util.uniqueId;
  6017. lodash.upperCase = string$1.upperCase;
  6018. lodash.upperFirst = string$1.upperFirst;
  6019. lodash.each = collection.forEach;
  6020. lodash.eachRight = collection.forEachRight;
  6021. lodash.first = array.head;
  6022. mixin(lodash, function() {
  6023. var source = {};
  6024. baseForOwn(lodash, function(func2, methodName) {
  6025. if (!hasOwnProperty$1.call(lodash.prototype, methodName)) {
  6026. source[methodName] = func2;
  6027. }
  6028. });
  6029. return source;
  6030. }(), { "chain": false });
  6031. lodash.VERSION = VERSION;
  6032. (lodash.templateSettings = string$1.templateSettings).imports._ = lodash;
  6033. arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
  6034. lodash[methodName].placeholder = lodash;
  6035. });
  6036. arrayEach(["drop", "take"], function(methodName, index) {
  6037. LazyWrapper.prototype[methodName] = function(n) {
  6038. n = n === void 0 ? 1 : nativeMax(toInteger(n), 0);
  6039. var result = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
  6040. if (result.__filtered__) {
  6041. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  6042. } else {
  6043. result.__views__.push({
  6044. "size": nativeMin(n, MAX_ARRAY_LENGTH),
  6045. "type": methodName + (result.__dir__ < 0 ? "Right" : "")
  6046. });
  6047. }
  6048. return result;
  6049. };
  6050. LazyWrapper.prototype[methodName + "Right"] = function(n) {
  6051. return this.reverse()[methodName](n).reverse();
  6052. };
  6053. });
  6054. arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
  6055. var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  6056. LazyWrapper.prototype[methodName] = function(iteratee) {
  6057. var result = this.clone();
  6058. result.__iteratees__.push({
  6059. "iteratee": baseIteratee(iteratee),
  6060. "type": type
  6061. });
  6062. result.__filtered__ = result.__filtered__ || isFilter;
  6063. return result;
  6064. };
  6065. });
  6066. arrayEach(["head", "last"], function(methodName, index) {
  6067. var takeName = "take" + (index ? "Right" : "");
  6068. LazyWrapper.prototype[methodName] = function() {
  6069. return this[takeName](1).value()[0];
  6070. };
  6071. });
  6072. arrayEach(["initial", "tail"], function(methodName, index) {
  6073. var dropName = "drop" + (index ? "" : "Right");
  6074. LazyWrapper.prototype[methodName] = function() {
  6075. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  6076. };
  6077. });
  6078. LazyWrapper.prototype.compact = function() {
  6079. return this.filter(identity$1);
  6080. };
  6081. LazyWrapper.prototype.find = function(predicate) {
  6082. return this.filter(predicate).head();
  6083. };
  6084. LazyWrapper.prototype.findLast = function(predicate) {
  6085. return this.reverse().find(predicate);
  6086. };
  6087. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  6088. if (typeof path == "function") {
  6089. return new LazyWrapper(this);
  6090. }
  6091. return this.map(function(value) {
  6092. return baseInvoke(value, path, args);
  6093. });
  6094. });
  6095. LazyWrapper.prototype.reject = function(predicate) {
  6096. return this.filter(negate(baseIteratee(predicate)));
  6097. };
  6098. LazyWrapper.prototype.slice = function(start, end) {
  6099. start = toInteger(start);
  6100. var result = this;
  6101. if (result.__filtered__ && (start > 0 || end < 0)) {
  6102. return new LazyWrapper(result);
  6103. }
  6104. if (start < 0) {
  6105. result = result.takeRight(-start);
  6106. } else if (start) {
  6107. result = result.drop(start);
  6108. }
  6109. if (end !== void 0) {
  6110. end = toInteger(end);
  6111. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  6112. }
  6113. return result;
  6114. };
  6115. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  6116. return this.reverse().takeWhile(predicate).reverse();
  6117. };
  6118. LazyWrapper.prototype.toArray = function() {
  6119. return this.take(MAX_ARRAY_LENGTH);
  6120. };
  6121. baseForOwn(LazyWrapper.prototype, function(func2, methodName) {
  6122. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
  6123. if (!lodashFunc) {
  6124. return;
  6125. }
  6126. lodash.prototype[methodName] = function() {
  6127. var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray$1(value);
  6128. var interceptor = function(value2) {
  6129. var result2 = lodashFunc.apply(lodash, arrayPush([value2], args));
  6130. return isTaker && chainAll ? result2[0] : result2;
  6131. };
  6132. if (useLazy && checkIteratee && typeof iteratee == "function" && iteratee.length != 1) {
  6133. isLazy = useLazy = false;
  6134. }
  6135. var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
  6136. if (!retUnwrapped && useLazy) {
  6137. value = onlyLazy ? value : new LazyWrapper(this);
  6138. var result = func2.apply(value, args);
  6139. result.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": void 0 });
  6140. return new LodashWrapper(result, chainAll);
  6141. }
  6142. if (isUnwrapped && onlyLazy) {
  6143. return func2.apply(this, args);
  6144. }
  6145. result = this.thru(interceptor);
  6146. return isUnwrapped ? isTaker ? result.value()[0] : result.value() : result;
  6147. };
  6148. });
  6149. arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
  6150. var func2 = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  6151. lodash.prototype[methodName] = function() {
  6152. var args = arguments;
  6153. if (retUnwrapped && !this.__chain__) {
  6154. var value = this.value();
  6155. return func2.apply(isArray$1(value) ? value : [], args);
  6156. }
  6157. return this[chainName](function(value2) {
  6158. return func2.apply(isArray$1(value2) ? value2 : [], args);
  6159. });
  6160. };
  6161. });
  6162. baseForOwn(LazyWrapper.prototype, function(func2, methodName) {
  6163. var lodashFunc = lodash[methodName];
  6164. if (lodashFunc) {
  6165. var key = lodashFunc.name + "";
  6166. if (!hasOwnProperty$1.call(realNames, key)) {
  6167. realNames[key] = [];
  6168. }
  6169. realNames[key].push({ "name": methodName, "func": lodashFunc });
  6170. }
  6171. });
  6172. realNames[createHybrid(void 0, WRAP_BIND_KEY_FLAG).name] = [{
  6173. "name": "wrapper",
  6174. "func": void 0
  6175. }];
  6176. LazyWrapper.prototype.clone = lazyClone;
  6177. LazyWrapper.prototype.reverse = lazyReverse;
  6178. LazyWrapper.prototype.value = lazyValue;
  6179. lodash.prototype.at = seq.at;
  6180. lodash.prototype.chain = seq.wrapperChain;
  6181. lodash.prototype.commit = seq.commit;
  6182. lodash.prototype.next = seq.next;
  6183. lodash.prototype.plant = seq.plant;
  6184. lodash.prototype.reverse = seq.reverse;
  6185. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = seq.value;
  6186. lodash.prototype.first = lodash.prototype.head;
  6187. if (symIterator) {
  6188. lodash.prototype[symIterator] = seq.toIterator;
  6189. }
  6190. /**
  6191. * @license
  6192. * Lodash (Custom Build) <https://lodash.com/>
  6193. * Build: `lodash modularize exports="es" -o ./`
  6194. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  6195. * Released under MIT license <https://lodash.com/license>
  6196. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  6197. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  6198. */
  6199. const FOCUSABLE_ELEMENT_SELECTORS = `a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])`;
  6200. const isVisible = (element) => {
  6201. const computed = getComputedStyle(element);
  6202. return computed.position === "fixed" ? false : element.offsetParent !== null;
  6203. };
  6204. const obtainAllFocusableElements$1 = (element) => {
  6205. return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
  6206. };
  6207. const isFocusable = (element) => {
  6208. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) {
  6209. return true;
  6210. }
  6211. if (element.disabled) {
  6212. return false;
  6213. }
  6214. switch (element.nodeName) {
  6215. case "A": {
  6216. return !!element.href && element.rel !== "ignore";
  6217. }
  6218. case "INPUT": {
  6219. return !(element.type === "hidden" || element.type === "file");
  6220. }
  6221. case "BUTTON":
  6222. case "SELECT":
  6223. case "TEXTAREA": {
  6224. return true;
  6225. }
  6226. default: {
  6227. return false;
  6228. }
  6229. }
  6230. };
  6231. const triggerEvent = function(elm, name, ...opts) {
  6232. let eventName;
  6233. if (name.includes("mouse") || name.includes("click")) {
  6234. eventName = "MouseEvents";
  6235. } else if (name.includes("key")) {
  6236. eventName = "KeyboardEvent";
  6237. } else {
  6238. eventName = "HTMLEvents";
  6239. }
  6240. const evt = document.createEvent(eventName);
  6241. evt.initEvent(name, ...opts);
  6242. elm.dispatchEvent(evt);
  6243. return elm;
  6244. };
  6245. const isLeaf = (el) => !el.getAttribute("aria-owns");
  6246. const getSibling = (el, distance, elClass) => {
  6247. const { parentNode } = el;
  6248. if (!parentNode)
  6249. return null;
  6250. const siblings = parentNode.querySelectorAll(elClass);
  6251. const index = Array.prototype.indexOf.call(siblings, el);
  6252. return siblings[index + distance] || null;
  6253. };
  6254. const focusNode = (el) => {
  6255. if (!el)
  6256. return;
  6257. el.focus();
  6258. !isLeaf(el) && el.click();
  6259. };
  6260. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  6261. const handleEvent = (event) => {
  6262. const shouldPrevent = theirsHandler == null ? void 0 : theirsHandler(event);
  6263. if (checkForDefaultPrevented === false || !shouldPrevent) {
  6264. return oursHandler == null ? void 0 : oursHandler(event);
  6265. }
  6266. };
  6267. return handleEvent;
  6268. };
  6269. const whenMouse = (handler) => {
  6270. return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
  6271. };
  6272. var __defProp$9 = Object.defineProperty;
  6273. var __defProps$6 = Object.defineProperties;
  6274. var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
  6275. var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
  6276. var __hasOwnProp$b = Object.prototype.hasOwnProperty;
  6277. var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
  6278. var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  6279. var __spreadValues$9 = (a, b) => {
  6280. for (var prop in b || (b = {}))
  6281. if (__hasOwnProp$b.call(b, prop))
  6282. __defNormalProp$9(a, prop, b[prop]);
  6283. if (__getOwnPropSymbols$b)
  6284. for (var prop of __getOwnPropSymbols$b(b)) {
  6285. if (__propIsEnum$b.call(b, prop))
  6286. __defNormalProp$9(a, prop, b[prop]);
  6287. }
  6288. return a;
  6289. };
  6290. var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
  6291. function computedEager(fn, options) {
  6292. var _a;
  6293. const result = vue.shallowRef();
  6294. vue.watchEffect(() => {
  6295. result.value = fn();
  6296. }, __spreadProps$6(__spreadValues$9({}, options), {
  6297. flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
  6298. }));
  6299. return vue.readonly(result);
  6300. }
  6301. var _a;
  6302. const isClient = typeof window !== "undefined";
  6303. const isDef = (val) => typeof val !== "undefined";
  6304. const isBoolean = (val) => typeof val === "boolean";
  6305. const isNumber = (val) => typeof val === "number";
  6306. const isString$1 = (val) => typeof val === "string";
  6307. const noop = () => {
  6308. };
  6309. isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
  6310. function resolveUnref(r) {
  6311. return typeof r === "function" ? r() : vue.unref(r);
  6312. }
  6313. function createFilterWrapper(filter, fn) {
  6314. function wrapper(...args) {
  6315. filter(() => fn.apply(this, args), { fn, thisArg: this, args });
  6316. }
  6317. return wrapper;
  6318. }
  6319. function debounceFilter(ms, options = {}) {
  6320. let timer;
  6321. let maxTimer;
  6322. const filter = (invoke) => {
  6323. const duration = resolveUnref(ms);
  6324. const maxDuration = resolveUnref(options.maxWait);
  6325. if (timer)
  6326. clearTimeout(timer);
  6327. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  6328. if (maxTimer) {
  6329. clearTimeout(maxTimer);
  6330. maxTimer = null;
  6331. }
  6332. return invoke();
  6333. }
  6334. if (maxDuration && !maxTimer) {
  6335. maxTimer = setTimeout(() => {
  6336. if (timer)
  6337. clearTimeout(timer);
  6338. maxTimer = null;
  6339. invoke();
  6340. }, maxDuration);
  6341. }
  6342. timer = setTimeout(() => {
  6343. if (maxTimer)
  6344. clearTimeout(maxTimer);
  6345. maxTimer = null;
  6346. invoke();
  6347. }, duration);
  6348. };
  6349. return filter;
  6350. }
  6351. function throttleFilter(ms, trailing = true, leading = true) {
  6352. let lastExec = 0;
  6353. let timer;
  6354. let isLeading = true;
  6355. const clear = () => {
  6356. if (timer) {
  6357. clearTimeout(timer);
  6358. timer = void 0;
  6359. }
  6360. };
  6361. const filter = (invoke) => {
  6362. const duration = resolveUnref(ms);
  6363. const elapsed = Date.now() - lastExec;
  6364. clear();
  6365. if (duration <= 0) {
  6366. lastExec = Date.now();
  6367. return invoke();
  6368. }
  6369. if (elapsed > duration && (leading || !isLeading)) {
  6370. lastExec = Date.now();
  6371. invoke();
  6372. } else if (trailing) {
  6373. timer = setTimeout(() => {
  6374. lastExec = Date.now();
  6375. isLeading = true;
  6376. clear();
  6377. invoke();
  6378. }, duration);
  6379. }
  6380. if (!leading && !timer)
  6381. timer = setTimeout(() => isLeading = true, duration);
  6382. isLeading = false;
  6383. };
  6384. return filter;
  6385. }
  6386. function identity(arg) {
  6387. return arg;
  6388. }
  6389. function tryOnScopeDispose(fn) {
  6390. if (vue.getCurrentScope()) {
  6391. vue.onScopeDispose(fn);
  6392. return true;
  6393. }
  6394. return false;
  6395. }
  6396. function useDebounceFn(fn, ms = 200, options = {}) {
  6397. return createFilterWrapper(debounceFilter(ms, options), fn);
  6398. }
  6399. function refDebounced(value, ms = 200, options = {}) {
  6400. if (ms <= 0)
  6401. return value;
  6402. const debounced = vue.ref(value.value);
  6403. const updater = useDebounceFn(() => {
  6404. debounced.value = value.value;
  6405. }, ms, options);
  6406. vue.watch(value, () => updater());
  6407. return debounced;
  6408. }
  6409. function useThrottleFn(fn, ms = 200, trailing = false, leading = true) {
  6410. return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
  6411. }
  6412. function tryOnMounted(fn, sync = true) {
  6413. if (vue.getCurrentInstance())
  6414. vue.onMounted(fn);
  6415. else if (sync)
  6416. fn();
  6417. else
  6418. vue.nextTick(fn);
  6419. }
  6420. function useTimeoutFn(cb, interval, options = {}) {
  6421. const {
  6422. immediate = true
  6423. } = options;
  6424. const isPending = vue.ref(false);
  6425. let timer = null;
  6426. function clear() {
  6427. if (timer) {
  6428. clearTimeout(timer);
  6429. timer = null;
  6430. }
  6431. }
  6432. function stop() {
  6433. isPending.value = false;
  6434. clear();
  6435. }
  6436. function start(...args) {
  6437. clear();
  6438. isPending.value = true;
  6439. timer = setTimeout(() => {
  6440. isPending.value = false;
  6441. timer = null;
  6442. cb(...args);
  6443. }, resolveUnref(interval));
  6444. }
  6445. if (immediate) {
  6446. isPending.value = true;
  6447. if (isClient)
  6448. start();
  6449. }
  6450. tryOnScopeDispose(stop);
  6451. return {
  6452. isPending,
  6453. start,
  6454. stop
  6455. };
  6456. }
  6457. function unrefElement(elRef) {
  6458. var _a;
  6459. const plain = resolveUnref(elRef);
  6460. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  6461. }
  6462. const defaultWindow = isClient ? window : void 0;
  6463. const defaultDocument = isClient ? window.document : void 0;
  6464. function useEventListener(...args) {
  6465. let target;
  6466. let event;
  6467. let listener;
  6468. let options;
  6469. if (isString$1(args[0])) {
  6470. [event, listener, options] = args;
  6471. target = defaultWindow;
  6472. } else {
  6473. [target, event, listener, options] = args;
  6474. }
  6475. if (!target)
  6476. return noop;
  6477. let cleanup = noop;
  6478. const stopWatch = vue.watch(() => unrefElement(target), (el) => {
  6479. cleanup();
  6480. if (!el)
  6481. return;
  6482. el.addEventListener(event, listener, options);
  6483. cleanup = () => {
  6484. el.removeEventListener(event, listener, options);
  6485. cleanup = noop;
  6486. };
  6487. }, { immediate: true, flush: "post" });
  6488. const stop = () => {
  6489. stopWatch();
  6490. cleanup();
  6491. };
  6492. tryOnScopeDispose(stop);
  6493. return stop;
  6494. }
  6495. function onClickOutside(target, handler, options = {}) {
  6496. const { window = defaultWindow, ignore, capture = true, detectIframe = false } = options;
  6497. if (!window)
  6498. return;
  6499. const shouldListen = vue.ref(true);
  6500. let fallback;
  6501. const listener = (event) => {
  6502. window.clearTimeout(fallback);
  6503. const el = unrefElement(target);
  6504. const composedPath = event.composedPath();
  6505. if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value)
  6506. return;
  6507. if (ignore && ignore.length > 0) {
  6508. if (ignore.some((target2) => {
  6509. const el2 = unrefElement(target2);
  6510. return el2 && (event.target === el2 || composedPath.includes(el2));
  6511. }))
  6512. return;
  6513. }
  6514. handler(event);
  6515. };
  6516. const cleanup = [
  6517. useEventListener(window, "click", listener, { passive: true, capture }),
  6518. useEventListener(window, "pointerdown", (e) => {
  6519. const el = unrefElement(target);
  6520. shouldListen.value = !!el && !e.composedPath().includes(el);
  6521. }, { passive: true }),
  6522. useEventListener(window, "pointerup", (e) => {
  6523. if (e.button === 0) {
  6524. const path = e.composedPath();
  6525. e.composedPath = () => path;
  6526. fallback = window.setTimeout(() => listener(e), 50);
  6527. }
  6528. }, { passive: true }),
  6529. detectIframe && useEventListener(window, "blur", (event) => {
  6530. var _a;
  6531. const el = unrefElement(target);
  6532. if (((_a = document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(document.activeElement)))
  6533. handler(event);
  6534. })
  6535. ].filter(Boolean);
  6536. const stop = () => cleanup.forEach((fn) => fn());
  6537. return stop;
  6538. }
  6539. function useSupported(callback, sync = false) {
  6540. const isSupported = vue.ref();
  6541. const update = () => isSupported.value = Boolean(callback());
  6542. update();
  6543. tryOnMounted(update, sync);
  6544. return isSupported;
  6545. }
  6546. const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
  6547. const globalKey = "__vueuse_ssr_handlers__";
  6548. _global[globalKey] = _global[globalKey] || {};
  6549. _global[globalKey];
  6550. function useCssVar(prop, target, { window = defaultWindow, initialValue = "" } = {}) {
  6551. const variable = vue.ref(initialValue);
  6552. const elRef = vue.computed(() => {
  6553. var _a;
  6554. return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
  6555. });
  6556. vue.watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => {
  6557. var _a;
  6558. if (el && window) {
  6559. const value = (_a = window.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a.trim();
  6560. variable.value = value || initialValue;
  6561. }
  6562. }, { immediate: true });
  6563. vue.watch(variable, (val) => {
  6564. var _a;
  6565. if ((_a = elRef.value) == null ? void 0 : _a.style)
  6566. elRef.value.style.setProperty(resolveUnref(prop), val);
  6567. });
  6568. return variable;
  6569. }
  6570. function useDocumentVisibility({ document = defaultDocument } = {}) {
  6571. if (!document)
  6572. return vue.ref("visible");
  6573. const visibility = vue.ref(document.visibilityState);
  6574. useEventListener(document, "visibilitychange", () => {
  6575. visibility.value = document.visibilityState;
  6576. });
  6577. return visibility;
  6578. }
  6579. var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
  6580. var __hasOwnProp$f = Object.prototype.hasOwnProperty;
  6581. var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
  6582. var __objRest$2 = (source, exclude) => {
  6583. var target = {};
  6584. for (var prop in source)
  6585. if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
  6586. target[prop] = source[prop];
  6587. if (source != null && __getOwnPropSymbols$f)
  6588. for (var prop of __getOwnPropSymbols$f(source)) {
  6589. if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
  6590. target[prop] = source[prop];
  6591. }
  6592. return target;
  6593. };
  6594. function useResizeObserver(target, callback, options = {}) {
  6595. const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$2(_a, ["window"]);
  6596. let observer;
  6597. const isSupported = useSupported(() => window && "ResizeObserver" in window);
  6598. const cleanup = () => {
  6599. if (observer) {
  6600. observer.disconnect();
  6601. observer = void 0;
  6602. }
  6603. };
  6604. const stopWatch = vue.watch(() => unrefElement(target), (el) => {
  6605. cleanup();
  6606. if (isSupported.value && window && el) {
  6607. observer = new ResizeObserver(callback);
  6608. observer.observe(el, observerOptions);
  6609. }
  6610. }, { immediate: true, flush: "post" });
  6611. const stop = () => {
  6612. cleanup();
  6613. stopWatch();
  6614. };
  6615. tryOnScopeDispose(stop);
  6616. return {
  6617. isSupported,
  6618. stop
  6619. };
  6620. }
  6621. function useElementBounding(target, options = {}) {
  6622. const {
  6623. reset = true,
  6624. windowResize = true,
  6625. windowScroll = true,
  6626. immediate = true
  6627. } = options;
  6628. const height = vue.ref(0);
  6629. const bottom = vue.ref(0);
  6630. const left = vue.ref(0);
  6631. const right = vue.ref(0);
  6632. const top = vue.ref(0);
  6633. const width = vue.ref(0);
  6634. const x = vue.ref(0);
  6635. const y = vue.ref(0);
  6636. function update() {
  6637. const el = unrefElement(target);
  6638. if (!el) {
  6639. if (reset) {
  6640. height.value = 0;
  6641. bottom.value = 0;
  6642. left.value = 0;
  6643. right.value = 0;
  6644. top.value = 0;
  6645. width.value = 0;
  6646. x.value = 0;
  6647. y.value = 0;
  6648. }
  6649. return;
  6650. }
  6651. const rect = el.getBoundingClientRect();
  6652. height.value = rect.height;
  6653. bottom.value = rect.bottom;
  6654. left.value = rect.left;
  6655. right.value = rect.right;
  6656. top.value = rect.top;
  6657. width.value = rect.width;
  6658. x.value = rect.x;
  6659. y.value = rect.y;
  6660. }
  6661. useResizeObserver(target, update);
  6662. vue.watch(() => unrefElement(target), (ele) => !ele && update());
  6663. if (windowScroll)
  6664. useEventListener("scroll", update, { passive: true });
  6665. if (windowResize)
  6666. useEventListener("resize", update, { passive: true });
  6667. tryOnMounted(() => {
  6668. if (immediate)
  6669. update();
  6670. });
  6671. return {
  6672. height,
  6673. bottom,
  6674. left,
  6675. right,
  6676. top,
  6677. width,
  6678. x,
  6679. y,
  6680. update
  6681. };
  6682. }
  6683. var SwipeDirection;
  6684. (function(SwipeDirection2) {
  6685. SwipeDirection2["UP"] = "UP";
  6686. SwipeDirection2["RIGHT"] = "RIGHT";
  6687. SwipeDirection2["DOWN"] = "DOWN";
  6688. SwipeDirection2["LEFT"] = "LEFT";
  6689. SwipeDirection2["NONE"] = "NONE";
  6690. })(SwipeDirection || (SwipeDirection = {}));
  6691. var __defProp = Object.defineProperty;
  6692. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  6693. var __hasOwnProp = Object.prototype.hasOwnProperty;
  6694. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  6695. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  6696. var __spreadValues = (a, b) => {
  6697. for (var prop in b || (b = {}))
  6698. if (__hasOwnProp.call(b, prop))
  6699. __defNormalProp(a, prop, b[prop]);
  6700. if (__getOwnPropSymbols)
  6701. for (var prop of __getOwnPropSymbols(b)) {
  6702. if (__propIsEnum.call(b, prop))
  6703. __defNormalProp(a, prop, b[prop]);
  6704. }
  6705. return a;
  6706. };
  6707. const _TransitionPresets = {
  6708. easeInSine: [0.12, 0, 0.39, 0],
  6709. easeOutSine: [0.61, 1, 0.88, 1],
  6710. easeInOutSine: [0.37, 0, 0.63, 1],
  6711. easeInQuad: [0.11, 0, 0.5, 0],
  6712. easeOutQuad: [0.5, 1, 0.89, 1],
  6713. easeInOutQuad: [0.45, 0, 0.55, 1],
  6714. easeInCubic: [0.32, 0, 0.67, 0],
  6715. easeOutCubic: [0.33, 1, 0.68, 1],
  6716. easeInOutCubic: [0.65, 0, 0.35, 1],
  6717. easeInQuart: [0.5, 0, 0.75, 0],
  6718. easeOutQuart: [0.25, 1, 0.5, 1],
  6719. easeInOutQuart: [0.76, 0, 0.24, 1],
  6720. easeInQuint: [0.64, 0, 0.78, 0],
  6721. easeOutQuint: [0.22, 1, 0.36, 1],
  6722. easeInOutQuint: [0.83, 0, 0.17, 1],
  6723. easeInExpo: [0.7, 0, 0.84, 0],
  6724. easeOutExpo: [0.16, 1, 0.3, 1],
  6725. easeInOutExpo: [0.87, 0, 0.13, 1],
  6726. easeInCirc: [0.55, 0, 1, 0.45],
  6727. easeOutCirc: [0, 0.55, 0.45, 1],
  6728. easeInOutCirc: [0.85, 0, 0.15, 1],
  6729. easeInBack: [0.36, 0, 0.66, -0.56],
  6730. easeOutBack: [0.34, 1.56, 0.64, 1],
  6731. easeInOutBack: [0.68, -0.6, 0.32, 1.6]
  6732. };
  6733. __spreadValues({
  6734. linear: identity
  6735. }, _TransitionPresets);
  6736. function useVModel(props, key, emit, options = {}) {
  6737. var _a, _b, _c;
  6738. const {
  6739. passive = false,
  6740. eventName,
  6741. deep = false,
  6742. defaultValue
  6743. } = options;
  6744. const vm = vue.getCurrentInstance();
  6745. const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));
  6746. let event = eventName;
  6747. if (!key) {
  6748. {
  6749. key = "modelValue";
  6750. }
  6751. }
  6752. event = eventName || event || `update:${key.toString()}`;
  6753. const getValue = () => isDef(props[key]) ? props[key] : defaultValue;
  6754. if (passive) {
  6755. const proxy = vue.ref(getValue());
  6756. vue.watch(() => props[key], (v) => proxy.value = v);
  6757. vue.watch(proxy, (v) => {
  6758. if (v !== props[key] || deep)
  6759. _emit(event, v);
  6760. }, {
  6761. deep
  6762. });
  6763. return proxy;
  6764. } else {
  6765. return vue.computed({
  6766. get() {
  6767. return getValue();
  6768. },
  6769. set(value) {
  6770. _emit(event, value);
  6771. }
  6772. });
  6773. }
  6774. }
  6775. function useWindowFocus({ window = defaultWindow } = {}) {
  6776. if (!window)
  6777. return vue.ref(false);
  6778. const focused = vue.ref(window.document.hasFocus());
  6779. useEventListener(window, "blur", () => {
  6780. focused.value = false;
  6781. });
  6782. useEventListener(window, "focus", () => {
  6783. focused.value = true;
  6784. });
  6785. return focused;
  6786. }
  6787. function useWindowSize(options = {}) {
  6788. const {
  6789. window = defaultWindow,
  6790. initialWidth = Infinity,
  6791. initialHeight = Infinity,
  6792. listenOrientation = true
  6793. } = options;
  6794. const width = vue.ref(initialWidth);
  6795. const height = vue.ref(initialHeight);
  6796. const update = () => {
  6797. if (window) {
  6798. width.value = window.innerWidth;
  6799. height.value = window.innerHeight;
  6800. }
  6801. };
  6802. update();
  6803. tryOnMounted(update);
  6804. useEventListener("resize", update, { passive: true });
  6805. if (listenOrientation)
  6806. useEventListener("orientationchange", update, { passive: true });
  6807. return { width, height };
  6808. }
  6809. const isInContainer = (el, container) => {
  6810. if (!isClient || !el || !container)
  6811. return false;
  6812. const elRect = el.getBoundingClientRect();
  6813. let containerRect;
  6814. if (container instanceof Element) {
  6815. containerRect = container.getBoundingClientRect();
  6816. } else {
  6817. containerRect = {
  6818. top: 0,
  6819. right: window.innerWidth,
  6820. bottom: window.innerHeight,
  6821. left: 0
  6822. };
  6823. }
  6824. return elRect.top < containerRect.bottom && elRect.bottom > containerRect.top && elRect.right > containerRect.left && elRect.left < containerRect.right;
  6825. };
  6826. const getOffsetTop = (el) => {
  6827. let offset = 0;
  6828. let parent = el;
  6829. while (parent) {
  6830. offset += parent.offsetTop;
  6831. parent = parent.offsetParent;
  6832. }
  6833. return offset;
  6834. };
  6835. const getOffsetTopDistance = (el, containerEl) => {
  6836. return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
  6837. };
  6838. const getClientXY = (event) => {
  6839. let clientX;
  6840. let clientY;
  6841. if (event.type === "touchend") {
  6842. clientY = event.changedTouches[0].clientY;
  6843. clientX = event.changedTouches[0].clientX;
  6844. } else if (event.type.startsWith("touch")) {
  6845. clientY = event.touches[0].clientY;
  6846. clientX = event.touches[0].clientX;
  6847. } else {
  6848. clientY = event.clientY;
  6849. clientX = event.clientX;
  6850. }
  6851. return {
  6852. clientX,
  6853. clientY
  6854. };
  6855. };
  6856. const NOOP = () => {
  6857. };
  6858. const hasOwnProperty = Object.prototype.hasOwnProperty;
  6859. const hasOwn = (val, key) => hasOwnProperty.call(val, key);
  6860. const isArray = Array.isArray;
  6861. const isDate = (val) => toTypeString(val) === "[object Date]";
  6862. const isFunction = (val) => typeof val === "function";
  6863. const isString = (val) => typeof val === "string";
  6864. const isObject$1 = (val) => val !== null && typeof val === "object";
  6865. const isPromise = (val) => {
  6866. return isObject$1(val) && isFunction(val.then) && isFunction(val.catch);
  6867. };
  6868. const objectToString = Object.prototype.toString;
  6869. const toTypeString = (value) => objectToString.call(value);
  6870. const toRawType = (value) => {
  6871. return toTypeString(value).slice(8, -1);
  6872. };
  6873. const cacheStringFunction = (fn) => {
  6874. const cache = /* @__PURE__ */ Object.create(null);
  6875. return (str) => {
  6876. const hit = cache[str];
  6877. return hit || (cache[str] = fn(str));
  6878. };
  6879. };
  6880. const camelizeRE = /-(\w)/g;
  6881. const camelize = cacheStringFunction((str) => {
  6882. return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
  6883. });
  6884. const hyphenateRE = /\B([A-Z])/g;
  6885. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  6886. const capitalize$1 = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));
  6887. const isUndefined = (val) => val === void 0;
  6888. const isEmpty = (val) => !val && val !== 0 || isArray(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
  6889. const isElement$1 = (e) => {
  6890. if (typeof Element === "undefined")
  6891. return false;
  6892. return e instanceof Element;
  6893. };
  6894. const isPropAbsent = (prop) => {
  6895. return isNil(prop);
  6896. };
  6897. const isStringNumber = (val) => {
  6898. if (!isString(val)) {
  6899. return false;
  6900. }
  6901. return !Number.isNaN(Number(val));
  6902. };
  6903. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  6904. const capitalize = (str) => capitalize$1(str);
  6905. const keysOf = (arr) => Object.keys(arr);
  6906. const entriesOf = (arr) => Object.entries(arr);
  6907. const getProp = (obj, path, defaultValue) => {
  6908. return {
  6909. get value() {
  6910. return get(obj, path, defaultValue);
  6911. },
  6912. set value(val) {
  6913. set(obj, path, val);
  6914. }
  6915. };
  6916. };
  6917. class ElementPlusError extends Error {
  6918. constructor(m) {
  6919. super(m);
  6920. this.name = "ElementPlusError";
  6921. }
  6922. }
  6923. function throwError(scope, m) {
  6924. throw new ElementPlusError(`[${scope}] ${m}`);
  6925. }
  6926. function debugWarn(scope, message) {
  6927. }
  6928. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  6929. const hasClass = (el, cls) => {
  6930. if (!el || !cls)
  6931. return false;
  6932. if (cls.includes(" "))
  6933. throw new Error("className should not contain space.");
  6934. return el.classList.contains(cls);
  6935. };
  6936. const addClass = (el, cls) => {
  6937. if (!el || !cls.trim())
  6938. return;
  6939. el.classList.add(...classNameToArray(cls));
  6940. };
  6941. const removeClass = (el, cls) => {
  6942. if (!el || !cls.trim())
  6943. return;
  6944. el.classList.remove(...classNameToArray(cls));
  6945. };
  6946. const getStyle = (element, styleName) => {
  6947. var _a;
  6948. if (!isClient || !element || !styleName)
  6949. return "";
  6950. let key = camelize(styleName);
  6951. if (key === "float")
  6952. key = "cssFloat";
  6953. try {
  6954. const style = element.style[key];
  6955. if (style)
  6956. return style;
  6957. const computed = (_a = document.defaultView) == null ? void 0 : _a.getComputedStyle(element, "");
  6958. return computed ? computed[key] : "";
  6959. } catch (e) {
  6960. return element.style[key];
  6961. }
  6962. };
  6963. function addUnit(value, defaultUnit = "px") {
  6964. if (!value)
  6965. return "";
  6966. if (isNumber(value) || isStringNumber(value)) {
  6967. return `${value}${defaultUnit}`;
  6968. } else if (isString(value)) {
  6969. return value;
  6970. }
  6971. }
  6972. const isScroll = (el, isVertical) => {
  6973. if (!isClient)
  6974. return false;
  6975. const key = {
  6976. undefined: "overflow",
  6977. true: "overflow-y",
  6978. false: "overflow-x"
  6979. }[String(isVertical)];
  6980. const overflow = getStyle(el, key);
  6981. return ["scroll", "auto", "overlay"].some((s) => overflow.includes(s));
  6982. };
  6983. const getScrollContainer = (el, isVertical) => {
  6984. if (!isClient)
  6985. return;
  6986. let parent = el;
  6987. while (parent) {
  6988. if ([window, document, document.documentElement].includes(parent))
  6989. return window;
  6990. if (isScroll(parent, isVertical))
  6991. return parent;
  6992. parent = parent.parentNode;
  6993. }
  6994. return parent;
  6995. };
  6996. let scrollBarWidth;
  6997. const getScrollBarWidth = (namespace) => {
  6998. var _a;
  6999. if (!isClient)
  7000. return 0;
  7001. if (scrollBarWidth !== void 0)
  7002. return scrollBarWidth;
  7003. const outer = document.createElement("div");
  7004. outer.className = `${namespace}-scrollbar__wrap`;
  7005. outer.style.visibility = "hidden";
  7006. outer.style.width = "100px";
  7007. outer.style.position = "absolute";
  7008. outer.style.top = "-9999px";
  7009. document.body.appendChild(outer);
  7010. const widthNoScroll = outer.offsetWidth;
  7011. outer.style.overflow = "scroll";
  7012. const inner = document.createElement("div");
  7013. inner.style.width = "100%";
  7014. outer.appendChild(inner);
  7015. const widthWithScroll = inner.offsetWidth;
  7016. (_a = outer.parentNode) == null ? void 0 : _a.removeChild(outer);
  7017. scrollBarWidth = widthNoScroll - widthWithScroll;
  7018. return scrollBarWidth;
  7019. };
  7020. function scrollIntoView(container, selected) {
  7021. if (!isClient)
  7022. return;
  7023. if (!selected) {
  7024. container.scrollTop = 0;
  7025. return;
  7026. }
  7027. const offsetParents = [];
  7028. let pointer = selected.offsetParent;
  7029. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  7030. offsetParents.push(pointer);
  7031. pointer = pointer.offsetParent;
  7032. }
  7033. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  7034. const bottom = top + selected.offsetHeight;
  7035. const viewRectTop = container.scrollTop;
  7036. const viewRectBottom = viewRectTop + container.clientHeight;
  7037. if (top < viewRectTop) {
  7038. container.scrollTop = top;
  7039. } else if (bottom > viewRectBottom) {
  7040. container.scrollTop = bottom - container.clientHeight;
  7041. }
  7042. }
  7043. let target = !isClient ? void 0 : document.body;
  7044. function createGlobalNode(id) {
  7045. const el = document.createElement("div");
  7046. if (id !== void 0) {
  7047. el.setAttribute("id", id);
  7048. }
  7049. target.appendChild(el);
  7050. return el;
  7051. }
  7052. function removeGlobalNode(el) {
  7053. el.remove();
  7054. }
  7055. var export_helper_default = (sfc, props) => {
  7056. let target = sfc.__vccOpts || sfc;
  7057. for (let [key, val] of props)
  7058. target[key] = val;
  7059. return target;
  7060. };
  7061. var _sfc_main6 = {
  7062. name: "ArrowDown"
  7063. };
  7064. var _hoisted_16$1 = {
  7065. viewBox: "0 0 1024 1024",
  7066. xmlns: "http://www.w3.org/2000/svg"
  7067. };
  7068. var _hoisted_26 = /* @__PURE__ */ vue.createElementVNode("path", {
  7069. fill: "currentColor",
  7070. d: "M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"
  7071. }, null, -1);
  7072. var _hoisted_36 = [
  7073. _hoisted_26
  7074. ];
  7075. function _sfc_render6(_ctx, _cache, $props, $setup, $data, $options) {
  7076. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_16$1, _hoisted_36);
  7077. }
  7078. var arrow_down_default = /* @__PURE__ */ export_helper_default(_sfc_main6, [["render", _sfc_render6], ["__file", "arrow-down.vue"]]);
  7079. var _sfc_main8 = {
  7080. name: "ArrowLeft"
  7081. };
  7082. var _hoisted_18$1 = {
  7083. viewBox: "0 0 1024 1024",
  7084. xmlns: "http://www.w3.org/2000/svg"
  7085. };
  7086. var _hoisted_28 = /* @__PURE__ */ vue.createElementVNode("path", {
  7087. fill: "currentColor",
  7088. d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"
  7089. }, null, -1);
  7090. var _hoisted_38 = [
  7091. _hoisted_28
  7092. ];
  7093. function _sfc_render8(_ctx, _cache, $props, $setup, $data, $options) {
  7094. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_18$1, _hoisted_38);
  7095. }
  7096. var arrow_left_default = /* @__PURE__ */ export_helper_default(_sfc_main8, [["render", _sfc_render8], ["__file", "arrow-left.vue"]]);
  7097. var _sfc_main10 = {
  7098. name: "ArrowRight"
  7099. };
  7100. var _hoisted_110 = {
  7101. viewBox: "0 0 1024 1024",
  7102. xmlns: "http://www.w3.org/2000/svg"
  7103. };
  7104. var _hoisted_210 = /* @__PURE__ */ vue.createElementVNode("path", {
  7105. fill: "currentColor",
  7106. d: "M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
  7107. }, null, -1);
  7108. var _hoisted_310 = [
  7109. _hoisted_210
  7110. ];
  7111. function _sfc_render10(_ctx, _cache, $props, $setup, $data, $options) {
  7112. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_110, _hoisted_310);
  7113. }
  7114. var arrow_right_default = /* @__PURE__ */ export_helper_default(_sfc_main10, [["render", _sfc_render10], ["__file", "arrow-right.vue"]]);
  7115. var _sfc_main12 = {
  7116. name: "ArrowUp"
  7117. };
  7118. var _hoisted_112 = {
  7119. viewBox: "0 0 1024 1024",
  7120. xmlns: "http://www.w3.org/2000/svg"
  7121. };
  7122. var _hoisted_212 = /* @__PURE__ */ vue.createElementVNode("path", {
  7123. fill: "currentColor",
  7124. d: "m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0z"
  7125. }, null, -1);
  7126. var _hoisted_312 = [
  7127. _hoisted_212
  7128. ];
  7129. function _sfc_render12(_ctx, _cache, $props, $setup, $data, $options) {
  7130. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_112, _hoisted_312);
  7131. }
  7132. var arrow_up_default = /* @__PURE__ */ export_helper_default(_sfc_main12, [["render", _sfc_render12], ["__file", "arrow-up.vue"]]);
  7133. var _sfc_main14 = {
  7134. name: "Back"
  7135. };
  7136. var _hoisted_114 = {
  7137. viewBox: "0 0 1024 1024",
  7138. xmlns: "http://www.w3.org/2000/svg"
  7139. };
  7140. var _hoisted_214 = /* @__PURE__ */ vue.createElementVNode("path", {
  7141. fill: "currentColor",
  7142. d: "M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64z"
  7143. }, null, -1);
  7144. var _hoisted_314 = /* @__PURE__ */ vue.createElementVNode("path", {
  7145. fill: "currentColor",
  7146. d: "m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312L237.248 512z"
  7147. }, null, -1);
  7148. var _hoisted_44 = [
  7149. _hoisted_214,
  7150. _hoisted_314
  7151. ];
  7152. function _sfc_render14(_ctx, _cache, $props, $setup, $data, $options) {
  7153. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_114, _hoisted_44);
  7154. }
  7155. var back_default = /* @__PURE__ */ export_helper_default(_sfc_main14, [["render", _sfc_render14], ["__file", "back.vue"]]);
  7156. var _sfc_main29 = {
  7157. name: "Calendar"
  7158. };
  7159. var _hoisted_129 = {
  7160. viewBox: "0 0 1024 1024",
  7161. xmlns: "http://www.w3.org/2000/svg"
  7162. };
  7163. var _hoisted_229 = /* @__PURE__ */ vue.createElementVNode("path", {
  7164. fill: "currentColor",
  7165. d: "M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64H128zm192-256h384V96a32 32 0 1 1 64 0v32h160a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h160V96a32 32 0 0 1 64 0v32zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64zm0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64zm192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64zm0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64zm192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64zm0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64z"
  7166. }, null, -1);
  7167. var _hoisted_328 = [
  7168. _hoisted_229
  7169. ];
  7170. function _sfc_render29(_ctx, _cache, $props, $setup, $data, $options) {
  7171. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_129, _hoisted_328);
  7172. }
  7173. var calendar_default = /* @__PURE__ */ export_helper_default(_sfc_main29, [["render", _sfc_render29], ["__file", "calendar.vue"]]);
  7174. var _sfc_main34 = {
  7175. name: "CaretRight"
  7176. };
  7177. var _hoisted_134 = {
  7178. viewBox: "0 0 1024 1024",
  7179. xmlns: "http://www.w3.org/2000/svg"
  7180. };
  7181. var _hoisted_234 = /* @__PURE__ */ vue.createElementVNode("path", {
  7182. fill: "currentColor",
  7183. d: "M384 192v640l384-320.064z"
  7184. }, null, -1);
  7185. var _hoisted_333 = [
  7186. _hoisted_234
  7187. ];
  7188. function _sfc_render34(_ctx, _cache, $props, $setup, $data, $options) {
  7189. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_134, _hoisted_333);
  7190. }
  7191. var caret_right_default = /* @__PURE__ */ export_helper_default(_sfc_main34, [["render", _sfc_render34], ["__file", "caret-right.vue"]]);
  7192. var _sfc_main35 = {
  7193. name: "CaretTop"
  7194. };
  7195. var _hoisted_135 = {
  7196. viewBox: "0 0 1024 1024",
  7197. xmlns: "http://www.w3.org/2000/svg"
  7198. };
  7199. var _hoisted_235 = /* @__PURE__ */ vue.createElementVNode("path", {
  7200. fill: "currentColor",
  7201. d: "M512 320 192 704h639.936z"
  7202. }, null, -1);
  7203. var _hoisted_334 = [
  7204. _hoisted_235
  7205. ];
  7206. function _sfc_render35(_ctx, _cache, $props, $setup, $data, $options) {
  7207. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_135, _hoisted_334);
  7208. }
  7209. var caret_top_default = /* @__PURE__ */ export_helper_default(_sfc_main35, [["render", _sfc_render35], ["__file", "caret-top.vue"]]);
  7210. var _sfc_main43 = {
  7211. name: "Check"
  7212. };
  7213. var _hoisted_143 = {
  7214. viewBox: "0 0 1024 1024",
  7215. xmlns: "http://www.w3.org/2000/svg"
  7216. };
  7217. var _hoisted_243 = /* @__PURE__ */ vue.createElementVNode("path", {
  7218. fill: "currentColor",
  7219. d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
  7220. }, null, -1);
  7221. var _hoisted_342 = [
  7222. _hoisted_243
  7223. ];
  7224. function _sfc_render43(_ctx, _cache, $props, $setup, $data, $options) {
  7225. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_143, _hoisted_342);
  7226. }
  7227. var check_default = /* @__PURE__ */ export_helper_default(_sfc_main43, [["render", _sfc_render43], ["__file", "check.vue"]]);
  7228. var _sfc_main47 = {
  7229. name: "CircleCheckFilled"
  7230. };
  7231. var _hoisted_147 = {
  7232. viewBox: "0 0 1024 1024",
  7233. xmlns: "http://www.w3.org/2000/svg"
  7234. };
  7235. var _hoisted_247 = /* @__PURE__ */ vue.createElementVNode("path", {
  7236. fill: "currentColor",
  7237. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336L456.192 600.384z"
  7238. }, null, -1);
  7239. var _hoisted_346 = [
  7240. _hoisted_247
  7241. ];
  7242. function _sfc_render47(_ctx, _cache, $props, $setup, $data, $options) {
  7243. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_147, _hoisted_346);
  7244. }
  7245. var circle_check_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main47, [["render", _sfc_render47], ["__file", "circle-check-filled.vue"]]);
  7246. var _sfc_main48 = {
  7247. name: "CircleCheck"
  7248. };
  7249. var _hoisted_148 = {
  7250. viewBox: "0 0 1024 1024",
  7251. xmlns: "http://www.w3.org/2000/svg"
  7252. };
  7253. var _hoisted_248 = /* @__PURE__ */ vue.createElementVNode("path", {
  7254. fill: "currentColor",
  7255. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  7256. }, null, -1);
  7257. var _hoisted_347 = /* @__PURE__ */ vue.createElementVNode("path", {
  7258. fill: "currentColor",
  7259. d: "M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"
  7260. }, null, -1);
  7261. var _hoisted_414 = [
  7262. _hoisted_248,
  7263. _hoisted_347
  7264. ];
  7265. function _sfc_render48(_ctx, _cache, $props, $setup, $data, $options) {
  7266. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_148, _hoisted_414);
  7267. }
  7268. var circle_check_default = /* @__PURE__ */ export_helper_default(_sfc_main48, [["render", _sfc_render48], ["__file", "circle-check.vue"]]);
  7269. var _sfc_main49 = {
  7270. name: "CircleCloseFilled"
  7271. };
  7272. var _hoisted_149 = {
  7273. viewBox: "0 0 1024 1024",
  7274. xmlns: "http://www.w3.org/2000/svg"
  7275. };
  7276. var _hoisted_249 = /* @__PURE__ */ vue.createElementVNode("path", {
  7277. fill: "currentColor",
  7278. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336L512 457.664z"
  7279. }, null, -1);
  7280. var _hoisted_348 = [
  7281. _hoisted_249
  7282. ];
  7283. function _sfc_render49(_ctx, _cache, $props, $setup, $data, $options) {
  7284. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_149, _hoisted_348);
  7285. }
  7286. var circle_close_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main49, [["render", _sfc_render49], ["__file", "circle-close-filled.vue"]]);
  7287. var _sfc_main50 = {
  7288. name: "CircleClose"
  7289. };
  7290. var _hoisted_150 = {
  7291. viewBox: "0 0 1024 1024",
  7292. xmlns: "http://www.w3.org/2000/svg"
  7293. };
  7294. var _hoisted_250 = /* @__PURE__ */ vue.createElementVNode("path", {
  7295. fill: "currentColor",
  7296. d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248L466.752 512z"
  7297. }, null, -1);
  7298. var _hoisted_349 = /* @__PURE__ */ vue.createElementVNode("path", {
  7299. fill: "currentColor",
  7300. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  7301. }, null, -1);
  7302. var _hoisted_415 = [
  7303. _hoisted_250,
  7304. _hoisted_349
  7305. ];
  7306. function _sfc_render50(_ctx, _cache, $props, $setup, $data, $options) {
  7307. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_150, _hoisted_415);
  7308. }
  7309. var circle_close_default = /* @__PURE__ */ export_helper_default(_sfc_main50, [["render", _sfc_render50], ["__file", "circle-close.vue"]]);
  7310. var _sfc_main53 = {
  7311. name: "Clock"
  7312. };
  7313. var _hoisted_153 = {
  7314. viewBox: "0 0 1024 1024",
  7315. xmlns: "http://www.w3.org/2000/svg"
  7316. };
  7317. var _hoisted_253 = /* @__PURE__ */ vue.createElementVNode("path", {
  7318. fill: "currentColor",
  7319. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768zm0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896z"
  7320. }, null, -1);
  7321. var _hoisted_352 = /* @__PURE__ */ vue.createElementVNode("path", {
  7322. fill: "currentColor",
  7323. d: "M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32z"
  7324. }, null, -1);
  7325. var _hoisted_417 = /* @__PURE__ */ vue.createElementVNode("path", {
  7326. fill: "currentColor",
  7327. d: "M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32z"
  7328. }, null, -1);
  7329. var _hoisted_55 = [
  7330. _hoisted_253,
  7331. _hoisted_352,
  7332. _hoisted_417
  7333. ];
  7334. function _sfc_render53(_ctx, _cache, $props, $setup, $data, $options) {
  7335. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_153, _hoisted_55);
  7336. }
  7337. var clock_default = /* @__PURE__ */ export_helper_default(_sfc_main53, [["render", _sfc_render53], ["__file", "clock.vue"]]);
  7338. var _sfc_main55 = {
  7339. name: "Close"
  7340. };
  7341. var _hoisted_155 = {
  7342. viewBox: "0 0 1024 1024",
  7343. xmlns: "http://www.w3.org/2000/svg"
  7344. };
  7345. var _hoisted_255 = /* @__PURE__ */ vue.createElementVNode("path", {
  7346. fill: "currentColor",
  7347. d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
  7348. }, null, -1);
  7349. var _hoisted_354 = [
  7350. _hoisted_255
  7351. ];
  7352. function _sfc_render55(_ctx, _cache, $props, $setup, $data, $options) {
  7353. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_155, _hoisted_354);
  7354. }
  7355. var close_default = /* @__PURE__ */ export_helper_default(_sfc_main55, [["render", _sfc_render55], ["__file", "close.vue"]]);
  7356. var _sfc_main71 = {
  7357. name: "DArrowLeft"
  7358. };
  7359. var _hoisted_171 = {
  7360. viewBox: "0 0 1024 1024",
  7361. xmlns: "http://www.w3.org/2000/svg"
  7362. };
  7363. var _hoisted_271 = /* @__PURE__ */ vue.createElementVNode("path", {
  7364. fill: "currentColor",
  7365. d: "M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224zm256 0a29.12 29.12 0 0 1 41.728 0 30.592 30.592 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.592 30.592 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672l331.648-340.224z"
  7366. }, null, -1);
  7367. var _hoisted_370 = [
  7368. _hoisted_271
  7369. ];
  7370. function _sfc_render71(_ctx, _cache, $props, $setup, $data, $options) {
  7371. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_171, _hoisted_370);
  7372. }
  7373. var d_arrow_left_default = /* @__PURE__ */ export_helper_default(_sfc_main71, [["render", _sfc_render71], ["__file", "d-arrow-left.vue"]]);
  7374. var _sfc_main72 = {
  7375. name: "DArrowRight"
  7376. };
  7377. var _hoisted_172 = {
  7378. viewBox: "0 0 1024 1024",
  7379. xmlns: "http://www.w3.org/2000/svg"
  7380. };
  7381. var _hoisted_272 = /* @__PURE__ */ vue.createElementVNode("path", {
  7382. fill: "currentColor",
  7383. d: "M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L764.736 512 452.864 192a30.592 30.592 0 0 1 0-42.688zm-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.592 30.592 0 0 1 0-42.752L508.736 512 196.864 192a30.592 30.592 0 0 1 0-42.688z"
  7384. }, null, -1);
  7385. var _hoisted_371 = [
  7386. _hoisted_272
  7387. ];
  7388. function _sfc_render72(_ctx, _cache, $props, $setup, $data, $options) {
  7389. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_172, _hoisted_371);
  7390. }
  7391. var d_arrow_right_default = /* @__PURE__ */ export_helper_default(_sfc_main72, [["render", _sfc_render72], ["__file", "d-arrow-right.vue"]]);
  7392. var _sfc_main79 = {
  7393. name: "Delete"
  7394. };
  7395. var _hoisted_179 = {
  7396. viewBox: "0 0 1024 1024",
  7397. xmlns: "http://www.w3.org/2000/svg"
  7398. };
  7399. var _hoisted_279 = /* @__PURE__ */ vue.createElementVNode("path", {
  7400. fill: "currentColor",
  7401. d: "M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"
  7402. }, null, -1);
  7403. var _hoisted_378 = [
  7404. _hoisted_279
  7405. ];
  7406. function _sfc_render79(_ctx, _cache, $props, $setup, $data, $options) {
  7407. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_179, _hoisted_378);
  7408. }
  7409. var delete_default = /* @__PURE__ */ export_helper_default(_sfc_main79, [["render", _sfc_render79], ["__file", "delete.vue"]]);
  7410. var _sfc_main89 = {
  7411. name: "Document"
  7412. };
  7413. var _hoisted_189 = {
  7414. viewBox: "0 0 1024 1024",
  7415. xmlns: "http://www.w3.org/2000/svg"
  7416. };
  7417. var _hoisted_289 = /* @__PURE__ */ vue.createElementVNode("path", {
  7418. fill: "currentColor",
  7419. d: "M832 384H576V128H192v768h640V384zm-26.496-64L640 154.496V320h165.504zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32zm160 448h384v64H320v-64zm0-192h160v64H320v-64zm0 384h384v64H320v-64z"
  7420. }, null, -1);
  7421. var _hoisted_388 = [
  7422. _hoisted_289
  7423. ];
  7424. function _sfc_render89(_ctx, _cache, $props, $setup, $data, $options) {
  7425. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_189, _hoisted_388);
  7426. }
  7427. var document_default = /* @__PURE__ */ export_helper_default(_sfc_main89, [["render", _sfc_render89], ["__file", "document.vue"]]);
  7428. var _sfc_main117 = {
  7429. name: "FullScreen"
  7430. };
  7431. var _hoisted_1117 = {
  7432. viewBox: "0 0 1024 1024",
  7433. xmlns: "http://www.w3.org/2000/svg"
  7434. };
  7435. var _hoisted_2117 = /* @__PURE__ */ vue.createElementVNode("path", {
  7436. fill: "currentColor",
  7437. d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64v.064zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64l-192 .192zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64l192-.192zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64v-.064z"
  7438. }, null, -1);
  7439. var _hoisted_3116 = [
  7440. _hoisted_2117
  7441. ];
  7442. function _sfc_render117(_ctx, _cache, $props, $setup, $data, $options) {
  7443. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1117, _hoisted_3116);
  7444. }
  7445. var full_screen_default = /* @__PURE__ */ export_helper_default(_sfc_main117, [["render", _sfc_render117], ["__file", "full-screen.vue"]]);
  7446. var _sfc_main130 = {
  7447. name: "Hide"
  7448. };
  7449. var _hoisted_1130 = {
  7450. viewBox: "0 0 1024 1024",
  7451. xmlns: "http://www.w3.org/2000/svg"
  7452. };
  7453. var _hoisted_2130 = /* @__PURE__ */ vue.createElementVNode("path", {
  7454. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z",
  7455. fill: "currentColor"
  7456. }, null, -1);
  7457. var _hoisted_3129 = /* @__PURE__ */ vue.createElementVNode("path", {
  7458. d: "M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z",
  7459. fill: "currentColor"
  7460. }, null, -1);
  7461. var _hoisted_436 = [
  7462. _hoisted_2130,
  7463. _hoisted_3129
  7464. ];
  7465. function _sfc_render130(_ctx, _cache, $props, $setup, $data, $options) {
  7466. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1130, _hoisted_436);
  7467. }
  7468. var hide_default = /* @__PURE__ */ export_helper_default(_sfc_main130, [["render", _sfc_render130], ["__file", "hide.vue"]]);
  7469. var _sfc_main140 = {
  7470. name: "InfoFilled"
  7471. };
  7472. var _hoisted_1140 = {
  7473. viewBox: "0 0 1024 1024",
  7474. xmlns: "http://www.w3.org/2000/svg"
  7475. };
  7476. var _hoisted_2140 = /* @__PURE__ */ vue.createElementVNode("path", {
  7477. fill: "currentColor",
  7478. d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64zm67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344zM590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"
  7479. }, null, -1);
  7480. var _hoisted_3139 = [
  7481. _hoisted_2140
  7482. ];
  7483. function _sfc_render140(_ctx, _cache, $props, $setup, $data, $options) {
  7484. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1140, _hoisted_3139);
  7485. }
  7486. var info_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main140, [["render", _sfc_render140], ["__file", "info-filled.vue"]]);
  7487. var _sfc_main147 = {
  7488. name: "Loading"
  7489. };
  7490. var _hoisted_1147 = {
  7491. viewBox: "0 0 1024 1024",
  7492. xmlns: "http://www.w3.org/2000/svg"
  7493. };
  7494. var _hoisted_2147 = /* @__PURE__ */ vue.createElementVNode("path", {
  7495. fill: "currentColor",
  7496. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32zm0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32zm448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32zm-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32zM195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0zm-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"
  7497. }, null, -1);
  7498. var _hoisted_3146 = [
  7499. _hoisted_2147
  7500. ];
  7501. function _sfc_render147(_ctx, _cache, $props, $setup, $data, $options) {
  7502. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1147, _hoisted_3146);
  7503. }
  7504. var loading_default = /* @__PURE__ */ export_helper_default(_sfc_main147, [["render", _sfc_render147], ["__file", "loading.vue"]]);
  7505. var _sfc_main165 = {
  7506. name: "Minus"
  7507. };
  7508. var _hoisted_1165 = {
  7509. viewBox: "0 0 1024 1024",
  7510. xmlns: "http://www.w3.org/2000/svg"
  7511. };
  7512. var _hoisted_2165 = /* @__PURE__ */ vue.createElementVNode("path", {
  7513. fill: "currentColor",
  7514. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64z"
  7515. }, null, -1);
  7516. var _hoisted_3164 = [
  7517. _hoisted_2165
  7518. ];
  7519. function _sfc_render165(_ctx, _cache, $props, $setup, $data, $options) {
  7520. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1165, _hoisted_3164);
  7521. }
  7522. var minus_default = /* @__PURE__ */ export_helper_default(_sfc_main165, [["render", _sfc_render165], ["__file", "minus.vue"]]);
  7523. var _sfc_main170 = {
  7524. name: "MoreFilled"
  7525. };
  7526. var _hoisted_1170 = {
  7527. viewBox: "0 0 1024 1024",
  7528. xmlns: "http://www.w3.org/2000/svg"
  7529. };
  7530. var _hoisted_2170 = /* @__PURE__ */ vue.createElementVNode("path", {
  7531. fill: "currentColor",
  7532. d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224zm336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224zm336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224z"
  7533. }, null, -1);
  7534. var _hoisted_3169 = [
  7535. _hoisted_2170
  7536. ];
  7537. function _sfc_render170(_ctx, _cache, $props, $setup, $data, $options) {
  7538. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1170, _hoisted_3169);
  7539. }
  7540. var more_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main170, [["render", _sfc_render170], ["__file", "more-filled.vue"]]);
  7541. var _sfc_main171 = {
  7542. name: "More"
  7543. };
  7544. var _hoisted_1171 = {
  7545. viewBox: "0 0 1024 1024",
  7546. xmlns: "http://www.w3.org/2000/svg"
  7547. };
  7548. var _hoisted_2171 = /* @__PURE__ */ vue.createElementVNode("path", {
  7549. fill: "currentColor",
  7550. d: "M176 416a112 112 0 1 0 0 224 112 112 0 0 0 0-224m0 64a48 48 0 1 1 0 96 48 48 0 0 1 0-96zm336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224zm0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96zm336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224zm0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96z"
  7551. }, null, -1);
  7552. var _hoisted_3170 = [
  7553. _hoisted_2171
  7554. ];
  7555. function _sfc_render171(_ctx, _cache, $props, $setup, $data, $options) {
  7556. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1171, _hoisted_3170);
  7557. }
  7558. var more_default = /* @__PURE__ */ export_helper_default(_sfc_main171, [["render", _sfc_render171], ["__file", "more.vue"]]);
  7559. var _sfc_main191 = {
  7560. name: "PictureFilled"
  7561. };
  7562. var _hoisted_1191 = {
  7563. viewBox: "0 0 1024 1024",
  7564. xmlns: "http://www.w3.org/2000/svg"
  7565. };
  7566. var _hoisted_2191 = /* @__PURE__ */ vue.createElementVNode("path", {
  7567. fill: "currentColor",
  7568. d: "M96 896a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h832a32 32 0 0 1 32 32v704a32 32 0 0 1-32 32H96zm315.52-228.48-68.928-68.928a32 32 0 0 0-45.248 0L128 768.064h778.688l-242.112-290.56a32 32 0 0 0-49.216 0L458.752 665.408a32 32 0 0 1-47.232 2.112zM256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384z"
  7569. }, null, -1);
  7570. var _hoisted_3190 = [
  7571. _hoisted_2191
  7572. ];
  7573. function _sfc_render191(_ctx, _cache, $props, $setup, $data, $options) {
  7574. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1191, _hoisted_3190);
  7575. }
  7576. var picture_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main191, [["render", _sfc_render191], ["__file", "picture-filled.vue"]]);
  7577. var _sfc_main197 = {
  7578. name: "Plus"
  7579. };
  7580. var _hoisted_1197 = {
  7581. viewBox: "0 0 1024 1024",
  7582. xmlns: "http://www.w3.org/2000/svg"
  7583. };
  7584. var _hoisted_2197 = /* @__PURE__ */ vue.createElementVNode("path", {
  7585. fill: "currentColor",
  7586. d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64h352z"
  7587. }, null, -1);
  7588. var _hoisted_3196 = [
  7589. _hoisted_2197
  7590. ];
  7591. function _sfc_render197(_ctx, _cache, $props, $setup, $data, $options) {
  7592. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1197, _hoisted_3196);
  7593. }
  7594. var plus_default = /* @__PURE__ */ export_helper_default(_sfc_main197, [["render", _sfc_render197], ["__file", "plus.vue"]]);
  7595. var _sfc_main206 = {
  7596. name: "QuestionFilled"
  7597. };
  7598. var _hoisted_1206 = {
  7599. viewBox: "0 0 1024 1024",
  7600. xmlns: "http://www.w3.org/2000/svg"
  7601. };
  7602. var _hoisted_2206 = /* @__PURE__ */ vue.createElementVNode("path", {
  7603. fill: "currentColor",
  7604. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm23.744 191.488c-52.096 0-92.928 14.784-123.2 44.352-30.976 29.568-45.76 70.4-45.76 122.496h80.256c0-29.568 5.632-52.8 17.6-68.992 13.376-19.712 35.2-28.864 66.176-28.864 23.936 0 42.944 6.336 56.32 19.712 12.672 13.376 19.712 31.68 19.712 54.912 0 17.6-6.336 34.496-19.008 49.984l-8.448 9.856c-45.76 40.832-73.216 70.4-82.368 89.408-9.856 19.008-14.08 42.24-14.08 68.992v9.856h80.96v-9.856c0-16.896 3.52-31.68 10.56-45.76 6.336-12.672 15.488-24.64 28.16-35.2 33.792-29.568 54.208-48.576 60.544-55.616 16.896-22.528 26.048-51.392 26.048-86.592 0-42.944-14.08-76.736-42.24-101.376-28.16-25.344-65.472-37.312-111.232-37.312zm-12.672 406.208a54.272 54.272 0 0 0-38.72 14.784 49.408 49.408 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.848 54.848 0 0 0 523.072 768c15.488 0 28.16-4.928 38.72-14.784a51.52 51.52 0 0 0 16.192-38.72 51.968 51.968 0 0 0-15.488-38.016 55.936 55.936 0 0 0-39.424-14.784z"
  7605. }, null, -1);
  7606. var _hoisted_3205 = [
  7607. _hoisted_2206
  7608. ];
  7609. function _sfc_render206(_ctx, _cache, $props, $setup, $data, $options) {
  7610. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1206, _hoisted_3205);
  7611. }
  7612. var question_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main206, [["render", _sfc_render206], ["__file", "question-filled.vue"]]);
  7613. var _sfc_main210 = {
  7614. name: "RefreshLeft"
  7615. };
  7616. var _hoisted_1210 = {
  7617. viewBox: "0 0 1024 1024",
  7618. xmlns: "http://www.w3.org/2000/svg"
  7619. };
  7620. var _hoisted_2210 = /* @__PURE__ */ vue.createElementVNode("path", {
  7621. fill: "currentColor",
  7622. d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
  7623. }, null, -1);
  7624. var _hoisted_3209 = [
  7625. _hoisted_2210
  7626. ];
  7627. function _sfc_render210(_ctx, _cache, $props, $setup, $data, $options) {
  7628. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1210, _hoisted_3209);
  7629. }
  7630. var refresh_left_default = /* @__PURE__ */ export_helper_default(_sfc_main210, [["render", _sfc_render210], ["__file", "refresh-left.vue"]]);
  7631. var _sfc_main211 = {
  7632. name: "RefreshRight"
  7633. };
  7634. var _hoisted_1211 = {
  7635. viewBox: "0 0 1024 1024",
  7636. xmlns: "http://www.w3.org/2000/svg"
  7637. };
  7638. var _hoisted_2211 = /* @__PURE__ */ vue.createElementVNode("path", {
  7639. fill: "currentColor",
  7640. d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88z"
  7641. }, null, -1);
  7642. var _hoisted_3210 = [
  7643. _hoisted_2211
  7644. ];
  7645. function _sfc_render211(_ctx, _cache, $props, $setup, $data, $options) {
  7646. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1211, _hoisted_3210);
  7647. }
  7648. var refresh_right_default = /* @__PURE__ */ export_helper_default(_sfc_main211, [["render", _sfc_render211], ["__file", "refresh-right.vue"]]);
  7649. var _sfc_main217 = {
  7650. name: "ScaleToOriginal"
  7651. };
  7652. var _hoisted_1217 = {
  7653. viewBox: "0 0 1024 1024",
  7654. xmlns: "http://www.w3.org/2000/svg"
  7655. };
  7656. var _hoisted_2217 = /* @__PURE__ */ vue.createElementVNode("path", {
  7657. fill: "currentColor",
  7658. d: "M813.176 180.706a60.235 60.235 0 0 1 60.236 60.235v481.883a60.235 60.235 0 0 1-60.236 60.235H210.824a60.235 60.235 0 0 1-60.236-60.235V240.94a60.235 60.235 0 0 1 60.236-60.235h602.352zm0-60.235H210.824A120.47 120.47 0 0 0 90.353 240.94v481.883a120.47 120.47 0 0 0 120.47 120.47h602.353a120.47 120.47 0 0 0 120.471-120.47V240.94a120.47 120.47 0 0 0-120.47-120.47zm-120.47 180.705a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zm-361.412 0a30.118 30.118 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.118 30.118 0 0 0-30.118-30.118zM512 361.412a30.118 30.118 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.118 30.118 0 0 0 512 361.412zM512 512a30.118 30.118 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.118 30.118 0 0 0 512 512z"
  7659. }, null, -1);
  7660. var _hoisted_3216 = [
  7661. _hoisted_2217
  7662. ];
  7663. function _sfc_render217(_ctx, _cache, $props, $setup, $data, $options) {
  7664. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1217, _hoisted_3216);
  7665. }
  7666. var scale_to_original_default = /* @__PURE__ */ export_helper_default(_sfc_main217, [["render", _sfc_render217], ["__file", "scale-to-original.vue"]]);
  7667. var _sfc_main220 = {
  7668. name: "Search"
  7669. };
  7670. var _hoisted_1220 = {
  7671. viewBox: "0 0 1024 1024",
  7672. xmlns: "http://www.w3.org/2000/svg"
  7673. };
  7674. var _hoisted_2220 = /* @__PURE__ */ vue.createElementVNode("path", {
  7675. fill: "currentColor",
  7676. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704z"
  7677. }, null, -1);
  7678. var _hoisted_3219 = [
  7679. _hoisted_2220
  7680. ];
  7681. function _sfc_render220(_ctx, _cache, $props, $setup, $data, $options) {
  7682. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1220, _hoisted_3219);
  7683. }
  7684. var search_default = /* @__PURE__ */ export_helper_default(_sfc_main220, [["render", _sfc_render220], ["__file", "search.vue"]]);
  7685. var _sfc_main236 = {
  7686. name: "SortDown"
  7687. };
  7688. var _hoisted_1236 = {
  7689. viewBox: "0 0 1024 1024",
  7690. xmlns: "http://www.w3.org/2000/svg"
  7691. };
  7692. var _hoisted_2236 = /* @__PURE__ */ vue.createElementVNode("path", {
  7693. fill: "currentColor",
  7694. d: "M576 96v709.568L333.312 562.816A32 32 0 1 0 288 608l297.408 297.344A32 32 0 0 0 640 882.688V96a32 32 0 0 0-64 0z"
  7695. }, null, -1);
  7696. var _hoisted_3235 = [
  7697. _hoisted_2236
  7698. ];
  7699. function _sfc_render236(_ctx, _cache, $props, $setup, $data, $options) {
  7700. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1236, _hoisted_3235);
  7701. }
  7702. var sort_down_default = /* @__PURE__ */ export_helper_default(_sfc_main236, [["render", _sfc_render236], ["__file", "sort-down.vue"]]);
  7703. var _sfc_main237 = {
  7704. name: "SortUp"
  7705. };
  7706. var _hoisted_1237 = {
  7707. viewBox: "0 0 1024 1024",
  7708. xmlns: "http://www.w3.org/2000/svg"
  7709. };
  7710. var _hoisted_2237 = /* @__PURE__ */ vue.createElementVNode("path", {
  7711. fill: "currentColor",
  7712. d: "M384 141.248V928a32 32 0 1 0 64 0V218.56l242.688 242.688A32 32 0 1 0 736 416L438.592 118.656A32 32 0 0 0 384 141.248z"
  7713. }, null, -1);
  7714. var _hoisted_3236 = [
  7715. _hoisted_2237
  7716. ];
  7717. function _sfc_render237(_ctx, _cache, $props, $setup, $data, $options) {
  7718. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1237, _hoisted_3236);
  7719. }
  7720. var sort_up_default = /* @__PURE__ */ export_helper_default(_sfc_main237, [["render", _sfc_render237], ["__file", "sort-up.vue"]]);
  7721. var _sfc_main240 = {
  7722. name: "StarFilled"
  7723. };
  7724. var _hoisted_1240 = {
  7725. viewBox: "0 0 1024 1024",
  7726. xmlns: "http://www.w3.org/2000/svg"
  7727. };
  7728. var _hoisted_2240 = /* @__PURE__ */ vue.createElementVNode("path", {
  7729. fill: "currentColor",
  7730. d: "M283.84 867.84 512 747.776l228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72z"
  7731. }, null, -1);
  7732. var _hoisted_3239 = [
  7733. _hoisted_2240
  7734. ];
  7735. function _sfc_render240(_ctx, _cache, $props, $setup, $data, $options) {
  7736. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1240, _hoisted_3239);
  7737. }
  7738. var star_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main240, [["render", _sfc_render240], ["__file", "star-filled.vue"]]);
  7739. var _sfc_main241 = {
  7740. name: "Star"
  7741. };
  7742. var _hoisted_1241 = {
  7743. viewBox: "0 0 1024 1024",
  7744. xmlns: "http://www.w3.org/2000/svg"
  7745. };
  7746. var _hoisted_2241 = /* @__PURE__ */ vue.createElementVNode("path", {
  7747. fill: "currentColor",
  7748. d: "m512 747.84 228.16 119.936a6.4 6.4 0 0 0 9.28-6.72l-43.52-254.08 184.512-179.904a6.4 6.4 0 0 0-3.52-10.88l-255.104-37.12L517.76 147.904a6.4 6.4 0 0 0-11.52 0L392.192 379.072l-255.104 37.12a6.4 6.4 0 0 0-3.52 10.88L318.08 606.976l-43.584 254.08a6.4 6.4 0 0 0 9.28 6.72L512 747.84zM313.6 924.48a70.4 70.4 0 0 1-102.144-74.24l37.888-220.928L88.96 472.96A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 126.208 0l99.2 200.96 221.824 32.256a70.4 70.4 0 0 1 39.04 120.064L774.72 629.376l37.888 220.928a70.4 70.4 0 0 1-102.144 74.24L512 820.096l-198.4 104.32z"
  7749. }, null, -1);
  7750. var _hoisted_3240 = [
  7751. _hoisted_2241
  7752. ];
  7753. function _sfc_render241(_ctx, _cache, $props, $setup, $data, $options) {
  7754. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1241, _hoisted_3240);
  7755. }
  7756. var star_default = /* @__PURE__ */ export_helper_default(_sfc_main241, [["render", _sfc_render241], ["__file", "star.vue"]]);
  7757. var _sfc_main243 = {
  7758. name: "SuccessFilled"
  7759. };
  7760. var _hoisted_1243 = {
  7761. viewBox: "0 0 1024 1024",
  7762. xmlns: "http://www.w3.org/2000/svg"
  7763. };
  7764. var _hoisted_2243 = /* @__PURE__ */ vue.createElementVNode("path", {
  7765. fill: "currentColor",
  7766. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336L456.192 600.384z"
  7767. }, null, -1);
  7768. var _hoisted_3242 = [
  7769. _hoisted_2243
  7770. ];
  7771. function _sfc_render243(_ctx, _cache, $props, $setup, $data, $options) {
  7772. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1243, _hoisted_3242);
  7773. }
  7774. var success_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main243, [["render", _sfc_render243], ["__file", "success-filled.vue"]]);
  7775. var _sfc_main274 = {
  7776. name: "View"
  7777. };
  7778. var _hoisted_1274 = {
  7779. viewBox: "0 0 1024 1024",
  7780. xmlns: "http://www.w3.org/2000/svg"
  7781. };
  7782. var _hoisted_2274 = /* @__PURE__ */ vue.createElementVNode("path", {
  7783. fill: "currentColor",
  7784. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352zm0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448zm0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160z"
  7785. }, null, -1);
  7786. var _hoisted_3273 = [
  7787. _hoisted_2274
  7788. ];
  7789. function _sfc_render274(_ctx, _cache, $props, $setup, $data, $options) {
  7790. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1274, _hoisted_3273);
  7791. }
  7792. var view_default = /* @__PURE__ */ export_helper_default(_sfc_main274, [["render", _sfc_render274], ["__file", "view.vue"]]);
  7793. var _sfc_main277 = {
  7794. name: "WarningFilled"
  7795. };
  7796. var _hoisted_1277 = {
  7797. viewBox: "0 0 1024 1024",
  7798. xmlns: "http://www.w3.org/2000/svg"
  7799. };
  7800. var _hoisted_2277 = /* @__PURE__ */ vue.createElementVNode("path", {
  7801. fill: "currentColor",
  7802. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256zm0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4z"
  7803. }, null, -1);
  7804. var _hoisted_3276 = [
  7805. _hoisted_2277
  7806. ];
  7807. function _sfc_render277(_ctx, _cache, $props, $setup, $data, $options) {
  7808. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1277, _hoisted_3276);
  7809. }
  7810. var warning_filled_default = /* @__PURE__ */ export_helper_default(_sfc_main277, [["render", _sfc_render277], ["__file", "warning-filled.vue"]]);
  7811. var _sfc_main282 = {
  7812. name: "ZoomIn"
  7813. };
  7814. var _hoisted_1282 = {
  7815. viewBox: "0 0 1024 1024",
  7816. xmlns: "http://www.w3.org/2000/svg"
  7817. };
  7818. var _hoisted_2282 = /* @__PURE__ */ vue.createElementVNode("path", {
  7819. fill: "currentColor",
  7820. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704zm-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64h96z"
  7821. }, null, -1);
  7822. var _hoisted_3281 = [
  7823. _hoisted_2282
  7824. ];
  7825. function _sfc_render282(_ctx, _cache, $props, $setup, $data, $options) {
  7826. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1282, _hoisted_3281);
  7827. }
  7828. var zoom_in_default = /* @__PURE__ */ export_helper_default(_sfc_main282, [["render", _sfc_render282], ["__file", "zoom-in.vue"]]);
  7829. var _sfc_main283 = {
  7830. name: "ZoomOut"
  7831. };
  7832. var _hoisted_1283 = {
  7833. viewBox: "0 0 1024 1024",
  7834. xmlns: "http://www.w3.org/2000/svg"
  7835. };
  7836. var _hoisted_2283 = /* @__PURE__ */ vue.createElementVNode("path", {
  7837. fill: "currentColor",
  7838. d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704zM352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64z"
  7839. }, null, -1);
  7840. var _hoisted_3282 = [
  7841. _hoisted_2283
  7842. ];
  7843. function _sfc_render283(_ctx, _cache, $props, $setup, $data, $options) {
  7844. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1283, _hoisted_3282);
  7845. }
  7846. var zoom_out_default = /* @__PURE__ */ export_helper_default(_sfc_main283, [["render", _sfc_render283], ["__file", "zoom-out.vue"]]);
  7847. /*! Element Plus Icons Vue v2.0.6 */
  7848. const epPropKey = "__epPropKey";
  7849. const definePropType = (val) => val;
  7850. const isEpProp = (val) => isObject$1(val) && !!val[epPropKey];
  7851. const buildProp = (prop, key) => {
  7852. if (!isObject$1(prop) || isEpProp(prop))
  7853. return prop;
  7854. const { values, required, default: defaultValue, type, validator } = prop;
  7855. const _validator = values || validator ? (val) => {
  7856. let valid = false;
  7857. let allowedValues = [];
  7858. if (values) {
  7859. allowedValues = Array.from(values);
  7860. if (hasOwn(prop, "default")) {
  7861. allowedValues.push(defaultValue);
  7862. }
  7863. valid || (valid = allowedValues.includes(val));
  7864. }
  7865. if (validator)
  7866. valid || (valid = validator(val));
  7867. if (!valid && allowedValues.length > 0) {
  7868. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  7869. vue.warn(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  7870. }
  7871. return valid;
  7872. } : void 0;
  7873. const epProp = {
  7874. type,
  7875. required: !!required,
  7876. validator: _validator,
  7877. [epPropKey]: true
  7878. };
  7879. if (hasOwn(prop, "default"))
  7880. epProp.default = defaultValue;
  7881. return epProp;
  7882. };
  7883. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [
  7884. key,
  7885. buildProp(option, key)
  7886. ]));
  7887. const iconPropType = definePropType([
  7888. String,
  7889. Object,
  7890. Function
  7891. ]);
  7892. const CloseComponents = {
  7893. Close: close_default
  7894. };
  7895. const TypeComponents = {
  7896. Close: close_default,
  7897. SuccessFilled: success_filled_default,
  7898. InfoFilled: info_filled_default,
  7899. WarningFilled: warning_filled_default,
  7900. CircleCloseFilled: circle_close_filled_default
  7901. };
  7902. const TypeComponentsMap = {
  7903. success: success_filled_default,
  7904. warning: warning_filled_default,
  7905. error: circle_close_filled_default,
  7906. info: info_filled_default
  7907. };
  7908. const ValidateComponentsMap = {
  7909. validating: loading_default,
  7910. success: circle_check_default,
  7911. error: circle_close_default
  7912. };
  7913. const withInstall = (main, extra) => {
  7914. main.install = (app) => {
  7915. for (const comp of [main, ...Object.values(extra != null ? extra : {})]) {
  7916. app.component(comp.name, comp);
  7917. }
  7918. };
  7919. if (extra) {
  7920. for (const [key, comp] of Object.entries(extra)) {
  7921. main[key] = comp;
  7922. }
  7923. }
  7924. return main;
  7925. };
  7926. const withInstallFunction = (fn, name) => {
  7927. fn.install = (app) => {
  7928. fn._context = app._context;
  7929. app.config.globalProperties[name] = fn;
  7930. };
  7931. return fn;
  7932. };
  7933. const withInstallDirective = (directive, name) => {
  7934. directive.install = (app) => {
  7935. app.directive(name, directive);
  7936. };
  7937. return directive;
  7938. };
  7939. const withNoopInstall = (component) => {
  7940. component.install = NOOP;
  7941. return component;
  7942. };
  7943. const composeRefs = (...refs) => {
  7944. return (el) => {
  7945. refs.forEach((ref) => {
  7946. if (isFunction(ref)) {
  7947. ref(el);
  7948. } else {
  7949. ref.value = el;
  7950. }
  7951. });
  7952. };
  7953. };
  7954. const EVENT_CODE = {
  7955. tab: "Tab",
  7956. enter: "Enter",
  7957. space: "Space",
  7958. left: "ArrowLeft",
  7959. up: "ArrowUp",
  7960. right: "ArrowRight",
  7961. down: "ArrowDown",
  7962. esc: "Escape",
  7963. delete: "Delete",
  7964. backspace: "Backspace",
  7965. numpadEnter: "NumpadEnter",
  7966. pageUp: "PageUp",
  7967. pageDown: "PageDown",
  7968. home: "Home",
  7969. end: "End"
  7970. };
  7971. const datePickTypes = [
  7972. "year",
  7973. "month",
  7974. "date",
  7975. "dates",
  7976. "week",
  7977. "datetime",
  7978. "datetimerange",
  7979. "daterange",
  7980. "monthrange"
  7981. ];
  7982. const WEEK_DAYS = [
  7983. "sun",
  7984. "mon",
  7985. "tue",
  7986. "wed",
  7987. "thu",
  7988. "fri",
  7989. "sat"
  7990. ];
  7991. const UPDATE_MODEL_EVENT = "update:modelValue";
  7992. const CHANGE_EVENT = "change";
  7993. const INPUT_EVENT = "input";
  7994. const INSTALLED_KEY = Symbol("INSTALLED_KEY");
  7995. const componentSizes = ["", "default", "small", "large"];
  7996. const componentSizeMap = {
  7997. large: 40,
  7998. default: 32,
  7999. small: 24
  8000. };
  8001. const getComponentSize = (size) => {
  8002. return componentSizeMap[size || "default"];
  8003. };
  8004. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  8005. var PatchFlags = /* @__PURE__ */ ((PatchFlags2) => {
  8006. PatchFlags2[PatchFlags2["TEXT"] = 1] = "TEXT";
  8007. PatchFlags2[PatchFlags2["CLASS"] = 2] = "CLASS";
  8008. PatchFlags2[PatchFlags2["STYLE"] = 4] = "STYLE";
  8009. PatchFlags2[PatchFlags2["PROPS"] = 8] = "PROPS";
  8010. PatchFlags2[PatchFlags2["FULL_PROPS"] = 16] = "FULL_PROPS";
  8011. PatchFlags2[PatchFlags2["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  8012. PatchFlags2[PatchFlags2["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  8013. PatchFlags2[PatchFlags2["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  8014. PatchFlags2[PatchFlags2["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  8015. PatchFlags2[PatchFlags2["NEED_PATCH"] = 512] = "NEED_PATCH";
  8016. PatchFlags2[PatchFlags2["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  8017. PatchFlags2[PatchFlags2["HOISTED"] = -1] = "HOISTED";
  8018. PatchFlags2[PatchFlags2["BAIL"] = -2] = "BAIL";
  8019. return PatchFlags2;
  8020. })(PatchFlags || {});
  8021. function isFragment(node) {
  8022. return vue.isVNode(node) && node.type === vue.Fragment;
  8023. }
  8024. function isComment(node) {
  8025. return vue.isVNode(node) && node.type === vue.Comment;
  8026. }
  8027. function isValidElementNode(node) {
  8028. return vue.isVNode(node) && !isFragment(node) && !isComment(node);
  8029. }
  8030. const getNormalizedProps = (node) => {
  8031. if (!vue.isVNode(node)) {
  8032. return {};
  8033. }
  8034. const raw = node.props || {};
  8035. const type = (vue.isVNode(node.type) ? node.type.props : void 0) || {};
  8036. const props = {};
  8037. Object.keys(type).forEach((key) => {
  8038. if (hasOwn(type[key], "default")) {
  8039. props[key] = type[key].default;
  8040. }
  8041. });
  8042. Object.keys(raw).forEach((key) => {
  8043. props[camelize(key)] = raw[key];
  8044. });
  8045. return props;
  8046. };
  8047. const ensureOnlyChild = (children) => {
  8048. if (!isArray(children) || children.length > 1) {
  8049. throw new Error("expect to receive a single Vue element child");
  8050. }
  8051. return children[0];
  8052. };
  8053. const flattedChildren = (children) => {
  8054. const vNodes = isArray(children) ? children : [children];
  8055. const result = [];
  8056. vNodes.forEach((child) => {
  8057. var _a;
  8058. if (isArray(child)) {
  8059. result.push(...flattedChildren(child));
  8060. } else if (vue.isVNode(child) && isArray(child.children)) {
  8061. result.push(...flattedChildren(child.children));
  8062. } else {
  8063. result.push(child);
  8064. if (vue.isVNode(child) && ((_a = child.component) == null ? void 0 : _a.subTree)) {
  8065. result.push(...flattedChildren(child.component.subTree));
  8066. }
  8067. }
  8068. });
  8069. return result;
  8070. };
  8071. const cubic = (value) => {
  8072. return value ** 3;
  8073. };
  8074. const easeInOutCubic = (value) => value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2;
  8075. const unique = (arr) => [...new Set(arr)];
  8076. const castArray = (arr) => {
  8077. if (!arr && arr !== 0)
  8078. return [];
  8079. return Array.isArray(arr) ? arr : [arr];
  8080. };
  8081. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  8082. const isKorean = (text) => /([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi.test(text);
  8083. const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
  8084. const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
  8085. const generateId = () => Math.floor(Math.random() * 1e4);
  8086. const mutable = (val) => val;
  8087. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  8088. const LISTENER_PREFIX = /^on[A-Z]/;
  8089. const useAttrs = (params = {}) => {
  8090. const { excludeListeners = false, excludeKeys } = params;
  8091. const allExcludeKeys = vue.computed(() => {
  8092. return ((excludeKeys == null ? void 0 : excludeKeys.value) || []).concat(DEFAULT_EXCLUDE_KEYS);
  8093. });
  8094. const instance = vue.getCurrentInstance();
  8095. if (!instance) {
  8096. return vue.computed(() => ({}));
  8097. }
  8098. return vue.computed(() => {
  8099. var _a;
  8100. return fromPairs(Object.entries((_a = instance.proxy) == null ? void 0 : _a.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key))));
  8101. });
  8102. };
  8103. const breadcrumbKey = Symbol("breadcrumbKey");
  8104. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  8105. const carouselContextKey = Symbol("carouselContextKey");
  8106. const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
  8107. const collapseContextKey = Symbol("collapseContextKey");
  8108. const configProviderContextKey = Symbol();
  8109. const dialogInjectionKey = Symbol("dialogInjectionKey");
  8110. const formContextKey = Symbol("formContextKey");
  8111. const formItemContextKey = Symbol("formItemContextKey");
  8112. const elPaginationKey = Symbol("elPaginationKey");
  8113. const radioGroupKey = Symbol("radioGroupKey");
  8114. const rowContextKey = Symbol("rowContextKey");
  8115. const scrollbarContextKey = Symbol("scrollbarContextKey");
  8116. const sliderContextKey = Symbol("sliderContextKey");
  8117. const tabsRootContextKey = Symbol("tabsRootContextKey");
  8118. const uploadContextKey = Symbol("uploadContextKey");
  8119. const POPPER_INJECTION_KEY = Symbol("popper");
  8120. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  8121. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  8122. const tooltipV2RootKey = Symbol("tooltipV2");
  8123. const tooltipV2ContentKey = Symbol("tooltipV2Content");
  8124. const TOOLTIP_V2_OPEN = "tooltip_v2.open";
  8125. const ROOT_PICKER_INJECTION_KEY = Symbol();
  8126. const useProp = (name) => {
  8127. const vm = vue.getCurrentInstance();
  8128. return vue.computed(() => {
  8129. var _a, _b;
  8130. return (_b = ((_a = vm.proxy) == null ? void 0 : _a.$props)[name]) != null ? _b : void 0;
  8131. });
  8132. };
  8133. const globalConfig = vue.ref();
  8134. function useGlobalConfig(key, defaultValue = void 0) {
  8135. const config = vue.getCurrentInstance() ? vue.inject(configProviderContextKey, globalConfig) : globalConfig;
  8136. if (key) {
  8137. return vue.computed(() => {
  8138. var _a, _b;
  8139. return (_b = (_a = config.value) == null ? void 0 : _a[key]) != null ? _b : defaultValue;
  8140. });
  8141. } else {
  8142. return config;
  8143. }
  8144. }
  8145. const provideGlobalConfig = (config, app, global = false) => {
  8146. var _a;
  8147. const inSetup = !!vue.getCurrentInstance();
  8148. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  8149. const provideFn = (_a = app == null ? void 0 : app.provide) != null ? _a : inSetup ? vue.provide : void 0;
  8150. if (!provideFn) {
  8151. return;
  8152. }
  8153. const context = vue.computed(() => {
  8154. const cfg = vue.unref(config);
  8155. if (!(oldConfig == null ? void 0 : oldConfig.value))
  8156. return cfg;
  8157. return mergeConfig(oldConfig.value, cfg);
  8158. });
  8159. provideFn(configProviderContextKey, context);
  8160. if (global || !globalConfig.value) {
  8161. globalConfig.value = context.value;
  8162. }
  8163. return context;
  8164. };
  8165. const mergeConfig = (a, b) => {
  8166. var _a;
  8167. const keys = [.../* @__PURE__ */ new Set([...keysOf(a), ...keysOf(b)])];
  8168. const obj = {};
  8169. for (const key of keys) {
  8170. obj[key] = (_a = b[key]) != null ? _a : a[key];
  8171. }
  8172. return obj;
  8173. };
  8174. const useSizeProp = buildProp({
  8175. type: String,
  8176. values: componentSizes,
  8177. required: false
  8178. });
  8179. const useSize = (fallback, ignore = {}) => {
  8180. const emptyRef = vue.ref(void 0);
  8181. const size = ignore.prop ? emptyRef : useProp("size");
  8182. const globalConfig = ignore.global ? emptyRef : useGlobalConfig("size");
  8183. const form = ignore.form ? { size: void 0 } : vue.inject(formContextKey, void 0);
  8184. const formItem = ignore.formItem ? { size: void 0 } : vue.inject(formItemContextKey, void 0);
  8185. return vue.computed(() => size.value || vue.unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || "");
  8186. };
  8187. const useDisabled = (fallback) => {
  8188. const disabled = useProp("disabled");
  8189. const form = vue.inject(formContextKey, void 0);
  8190. return vue.computed(() => disabled.value || vue.unref(fallback) || (form == null ? void 0 : form.disabled) || false);
  8191. };
  8192. const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
  8193. vue.watch(() => vue.unref(condition), (val) => {
  8194. }, {
  8195. immediate: true
  8196. });
  8197. };
  8198. const useDraggable = (targetRef, dragRef, draggable) => {
  8199. let transform = {
  8200. offsetX: 0,
  8201. offsetY: 0
  8202. };
  8203. const onMousedown = (e) => {
  8204. const downX = e.clientX;
  8205. const downY = e.clientY;
  8206. const { offsetX, offsetY } = transform;
  8207. const targetRect = targetRef.value.getBoundingClientRect();
  8208. const targetLeft = targetRect.left;
  8209. const targetTop = targetRect.top;
  8210. const targetWidth = targetRect.width;
  8211. const targetHeight = targetRect.height;
  8212. const clientWidth = document.documentElement.clientWidth;
  8213. const clientHeight = document.documentElement.clientHeight;
  8214. const minLeft = -targetLeft + offsetX;
  8215. const minTop = -targetTop + offsetY;
  8216. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  8217. const maxTop = clientHeight - targetTop - targetHeight + offsetY;
  8218. const onMousemove = (e2) => {
  8219. const moveX = Math.min(Math.max(offsetX + e2.clientX - downX, minLeft), maxLeft);
  8220. const moveY = Math.min(Math.max(offsetY + e2.clientY - downY, minTop), maxTop);
  8221. transform = {
  8222. offsetX: moveX,
  8223. offsetY: moveY
  8224. };
  8225. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  8226. };
  8227. const onMouseup = () => {
  8228. document.removeEventListener("mousemove", onMousemove);
  8229. document.removeEventListener("mouseup", onMouseup);
  8230. };
  8231. document.addEventListener("mousemove", onMousemove);
  8232. document.addEventListener("mouseup", onMouseup);
  8233. };
  8234. const onDraggable = () => {
  8235. if (dragRef.value && targetRef.value) {
  8236. dragRef.value.addEventListener("mousedown", onMousedown);
  8237. }
  8238. };
  8239. const offDraggable = () => {
  8240. if (dragRef.value && targetRef.value) {
  8241. dragRef.value.removeEventListener("mousedown", onMousedown);
  8242. }
  8243. };
  8244. vue.onMounted(() => {
  8245. vue.watchEffect(() => {
  8246. if (draggable.value) {
  8247. onDraggable();
  8248. } else {
  8249. offDraggable();
  8250. }
  8251. });
  8252. });
  8253. vue.onBeforeUnmount(() => {
  8254. offDraggable();
  8255. });
  8256. };
  8257. const useFocus = (el) => {
  8258. return {
  8259. focus: () => {
  8260. var _a, _b;
  8261. (_b = (_a = el.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  8262. }
  8263. };
  8264. };
  8265. const defaultNamespace = "el";
  8266. const statePrefix = "is-";
  8267. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  8268. let cls = `${namespace}-${block}`;
  8269. if (blockSuffix) {
  8270. cls += `-${blockSuffix}`;
  8271. }
  8272. if (element) {
  8273. cls += `__${element}`;
  8274. }
  8275. if (modifier) {
  8276. cls += `--${modifier}`;
  8277. }
  8278. return cls;
  8279. };
  8280. const useNamespace = (block) => {
  8281. const namespace = useGlobalConfig("namespace", defaultNamespace);
  8282. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  8283. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  8284. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  8285. const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  8286. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  8287. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  8288. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  8289. const is = (name, ...args) => {
  8290. const state = args.length >= 1 ? args[0] : true;
  8291. return name && state ? `${statePrefix}${name}` : "";
  8292. };
  8293. const cssVar = (object) => {
  8294. const styles = {};
  8295. for (const key in object) {
  8296. if (object[key]) {
  8297. styles[`--${namespace.value}-${key}`] = object[key];
  8298. }
  8299. }
  8300. return styles;
  8301. };
  8302. const cssVarBlock = (object) => {
  8303. const styles = {};
  8304. for (const key in object) {
  8305. if (object[key]) {
  8306. styles[`--${namespace.value}-${block}-${key}`] = object[key];
  8307. }
  8308. }
  8309. return styles;
  8310. };
  8311. const cssVarName = (name) => `--${namespace.value}-${name}`;
  8312. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  8313. return {
  8314. namespace,
  8315. b,
  8316. e,
  8317. m,
  8318. be,
  8319. em,
  8320. bm,
  8321. bem,
  8322. is,
  8323. cssVar,
  8324. cssVarName,
  8325. cssVarBlock,
  8326. cssVarBlockName
  8327. };
  8328. };
  8329. const defaultIdInjection = {
  8330. prefix: Math.floor(Math.random() * 1e4),
  8331. current: 0
  8332. };
  8333. const ID_INJECTION_KEY = Symbol("elIdInjection");
  8334. const useIdInjection = () => {
  8335. return vue.getCurrentInstance() ? vue.inject(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  8336. };
  8337. const useId = (deterministicId) => {
  8338. const idInjection = useIdInjection();
  8339. const namespace = useGlobalConfig("namespace", defaultNamespace);
  8340. const idRef = vue.computed(() => vue.unref(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  8341. return idRef;
  8342. };
  8343. const useFormItem = () => {
  8344. const form = vue.inject(formContextKey, void 0);
  8345. const formItem = vue.inject(formItemContextKey, void 0);
  8346. return {
  8347. form,
  8348. formItem
  8349. };
  8350. };
  8351. const useFormItemInputId = (props, {
  8352. formItemContext,
  8353. disableIdGeneration,
  8354. disableIdManagement
  8355. }) => {
  8356. if (!disableIdGeneration) {
  8357. disableIdGeneration = vue.ref(false);
  8358. }
  8359. if (!disableIdManagement) {
  8360. disableIdManagement = vue.ref(false);
  8361. }
  8362. const inputId = vue.ref();
  8363. let idUnwatch = void 0;
  8364. const isLabeledByFormItem = vue.computed(() => {
  8365. var _a;
  8366. return !!(!props.label && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);
  8367. });
  8368. vue.onMounted(() => {
  8369. idUnwatch = vue.watch([vue.toRef(props, "id"), disableIdGeneration], ([id, disableIdGeneration2]) => {
  8370. const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
  8371. if (newId !== inputId.value) {
  8372. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  8373. inputId.value && formItemContext.removeInputId(inputId.value);
  8374. if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
  8375. formItemContext.addInputId(newId);
  8376. }
  8377. }
  8378. inputId.value = newId;
  8379. }
  8380. }, { immediate: true });
  8381. });
  8382. vue.onUnmounted(() => {
  8383. idUnwatch && idUnwatch();
  8384. if (formItemContext == null ? void 0 : formItemContext.removeInputId) {
  8385. inputId.value && formItemContext.removeInputId(inputId.value);
  8386. }
  8387. });
  8388. return {
  8389. isLabeledByFormItem,
  8390. inputId
  8391. };
  8392. };
  8393. var English = {
  8394. name: "en",
  8395. el: {
  8396. colorpicker: {
  8397. confirm: "OK",
  8398. clear: "Clear",
  8399. defaultLabel: "color picker",
  8400. description: "current color is {color}. press enter to select a new color."
  8401. },
  8402. datepicker: {
  8403. now: "Now",
  8404. today: "Today",
  8405. cancel: "Cancel",
  8406. clear: "Clear",
  8407. confirm: "OK",
  8408. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  8409. monthTablePrompt: "Use the arrow keys and enter to select the month",
  8410. yearTablePrompt: "Use the arrow keys and enter to select the year",
  8411. selectedDate: "Selected date",
  8412. selectDate: "Select date",
  8413. selectTime: "Select time",
  8414. startDate: "Start Date",
  8415. startTime: "Start Time",
  8416. endDate: "End Date",
  8417. endTime: "End Time",
  8418. prevYear: "Previous Year",
  8419. nextYear: "Next Year",
  8420. prevMonth: "Previous Month",
  8421. nextMonth: "Next Month",
  8422. year: "",
  8423. month1: "January",
  8424. month2: "February",
  8425. month3: "March",
  8426. month4: "April",
  8427. month5: "May",
  8428. month6: "June",
  8429. month7: "July",
  8430. month8: "August",
  8431. month9: "September",
  8432. month10: "October",
  8433. month11: "November",
  8434. month12: "December",
  8435. week: "week",
  8436. weeks: {
  8437. sun: "Sun",
  8438. mon: "Mon",
  8439. tue: "Tue",
  8440. wed: "Wed",
  8441. thu: "Thu",
  8442. fri: "Fri",
  8443. sat: "Sat"
  8444. },
  8445. weeksFull: {
  8446. sun: "Sunday",
  8447. mon: "Monday",
  8448. tue: "Tuesday",
  8449. wed: "Wednesday",
  8450. thu: "Thursday",
  8451. fri: "Friday",
  8452. sat: "Saturday"
  8453. },
  8454. months: {
  8455. jan: "Jan",
  8456. feb: "Feb",
  8457. mar: "Mar",
  8458. apr: "Apr",
  8459. may: "May",
  8460. jun: "Jun",
  8461. jul: "Jul",
  8462. aug: "Aug",
  8463. sep: "Sep",
  8464. oct: "Oct",
  8465. nov: "Nov",
  8466. dec: "Dec"
  8467. }
  8468. },
  8469. inputNumber: {
  8470. decrease: "decrease number",
  8471. increase: "increase number"
  8472. },
  8473. select: {
  8474. loading: "Loading",
  8475. noMatch: "No matching data",
  8476. noData: "No data",
  8477. placeholder: "Select"
  8478. },
  8479. dropdown: {
  8480. toggleDropdown: "Toggle Dropdown"
  8481. },
  8482. cascader: {
  8483. noMatch: "No matching data",
  8484. loading: "Loading",
  8485. placeholder: "Select",
  8486. noData: "No data"
  8487. },
  8488. pagination: {
  8489. goto: "Go to",
  8490. pagesize: "/page",
  8491. total: "Total {total}",
  8492. pageClassifier: "",
  8493. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  8494. },
  8495. dialog: {
  8496. close: "Close this dialog"
  8497. },
  8498. drawer: {
  8499. close: "Close this dialog"
  8500. },
  8501. messagebox: {
  8502. title: "Message",
  8503. confirm: "OK",
  8504. cancel: "Cancel",
  8505. error: "Illegal input",
  8506. close: "Close this dialog"
  8507. },
  8508. upload: {
  8509. deleteTip: "press delete to remove",
  8510. delete: "Delete",
  8511. preview: "Preview",
  8512. continue: "Continue"
  8513. },
  8514. slider: {
  8515. defaultLabel: "slider between {min} and {max}",
  8516. defaultRangeStartLabel: "pick start value",
  8517. defaultRangeEndLabel: "pick end value"
  8518. },
  8519. table: {
  8520. emptyText: "No Data",
  8521. confirmFilter: "Confirm",
  8522. resetFilter: "Reset",
  8523. clearFilter: "All",
  8524. sumText: "Sum"
  8525. },
  8526. tree: {
  8527. emptyText: "No Data"
  8528. },
  8529. transfer: {
  8530. noMatch: "No matching data",
  8531. noData: "No data",
  8532. titles: ["List 1", "List 2"],
  8533. filterPlaceholder: "Enter keyword",
  8534. noCheckedFormat: "{total} items",
  8535. hasCheckedFormat: "{checked}/{total} checked"
  8536. },
  8537. image: {
  8538. error: "FAILED"
  8539. },
  8540. pageHeader: {
  8541. title: "Back"
  8542. },
  8543. popconfirm: {
  8544. confirmButtonText: "Yes",
  8545. cancelButtonText: "No"
  8546. }
  8547. }
  8548. };
  8549. const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
  8550. const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => {
  8551. var _a;
  8552. return `${(_a = option == null ? void 0 : option[key]) != null ? _a : `{${key}}`}`;
  8553. });
  8554. const buildLocaleContext = (locale) => {
  8555. const lang = vue.computed(() => vue.unref(locale).name);
  8556. const localeRef = vue.isRef(locale) ? locale : vue.ref(locale);
  8557. return {
  8558. lang,
  8559. locale: localeRef,
  8560. t: buildTranslator(locale)
  8561. };
  8562. };
  8563. const useLocale = () => {
  8564. const locale = useGlobalConfig("locale");
  8565. return buildLocaleContext(vue.computed(() => locale.value || English));
  8566. };
  8567. let activeEffectScope;
  8568. function recordEffectScope(effect2, scope = activeEffectScope) {
  8569. if (scope && scope.active) {
  8570. scope.effects.push(effect2);
  8571. }
  8572. }
  8573. const createDep = (effects) => {
  8574. const dep = new Set(effects);
  8575. dep.w = 0;
  8576. dep.n = 0;
  8577. return dep;
  8578. };
  8579. const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
  8580. const newTracked = (dep) => (dep.n & trackOpBit) > 0;
  8581. const initDepMarkers = ({ deps }) => {
  8582. if (deps.length) {
  8583. for (let i = 0; i < deps.length; i++) {
  8584. deps[i].w |= trackOpBit;
  8585. }
  8586. }
  8587. };
  8588. const finalizeDepMarkers = (effect2) => {
  8589. const { deps } = effect2;
  8590. if (deps.length) {
  8591. let ptr = 0;
  8592. for (let i = 0; i < deps.length; i++) {
  8593. const dep = deps[i];
  8594. if (wasTracked(dep) && !newTracked(dep)) {
  8595. dep.delete(effect2);
  8596. } else {
  8597. deps[ptr++] = dep;
  8598. }
  8599. dep.w &= ~trackOpBit;
  8600. dep.n &= ~trackOpBit;
  8601. }
  8602. deps.length = ptr;
  8603. }
  8604. };
  8605. let effectTrackDepth = 0;
  8606. let trackOpBit = 1;
  8607. const maxMarkerBits = 30;
  8608. let activeEffect;
  8609. class ReactiveEffect {
  8610. constructor(fn, scheduler2 = null, scope) {
  8611. this.fn = fn;
  8612. this.scheduler = scheduler2;
  8613. this.active = true;
  8614. this.deps = [];
  8615. this.parent = void 0;
  8616. recordEffectScope(this, scope);
  8617. }
  8618. run() {
  8619. if (!this.active) {
  8620. return this.fn();
  8621. }
  8622. let parent = activeEffect;
  8623. let lastShouldTrack = shouldTrack;
  8624. while (parent) {
  8625. if (parent === this) {
  8626. return;
  8627. }
  8628. parent = parent.parent;
  8629. }
  8630. try {
  8631. this.parent = activeEffect;
  8632. activeEffect = this;
  8633. shouldTrack = true;
  8634. trackOpBit = 1 << ++effectTrackDepth;
  8635. if (effectTrackDepth <= maxMarkerBits) {
  8636. initDepMarkers(this);
  8637. } else {
  8638. cleanupEffect(this);
  8639. }
  8640. return this.fn();
  8641. } finally {
  8642. if (effectTrackDepth <= maxMarkerBits) {
  8643. finalizeDepMarkers(this);
  8644. }
  8645. trackOpBit = 1 << --effectTrackDepth;
  8646. activeEffect = this.parent;
  8647. shouldTrack = lastShouldTrack;
  8648. this.parent = void 0;
  8649. if (this.deferStop) {
  8650. this.stop();
  8651. }
  8652. }
  8653. }
  8654. stop() {
  8655. if (activeEffect === this) {
  8656. this.deferStop = true;
  8657. } else if (this.active) {
  8658. cleanupEffect(this);
  8659. if (this.onStop) {
  8660. this.onStop();
  8661. }
  8662. this.active = false;
  8663. }
  8664. }
  8665. }
  8666. function cleanupEffect(effect2) {
  8667. const { deps } = effect2;
  8668. if (deps.length) {
  8669. for (let i = 0; i < deps.length; i++) {
  8670. deps[i].delete(effect2);
  8671. }
  8672. deps.length = 0;
  8673. }
  8674. }
  8675. let shouldTrack = true;
  8676. function trackEffects(dep, debuggerEventExtraInfo) {
  8677. let shouldTrack2 = false;
  8678. if (effectTrackDepth <= maxMarkerBits) {
  8679. if (!newTracked(dep)) {
  8680. dep.n |= trackOpBit;
  8681. shouldTrack2 = !wasTracked(dep);
  8682. }
  8683. } else {
  8684. shouldTrack2 = !dep.has(activeEffect);
  8685. }
  8686. if (shouldTrack2) {
  8687. dep.add(activeEffect);
  8688. activeEffect.deps.push(dep);
  8689. }
  8690. }
  8691. function triggerEffects(dep, debuggerEventExtraInfo) {
  8692. const effects = isArray(dep) ? dep : [...dep];
  8693. for (const effect2 of effects) {
  8694. if (effect2.computed) {
  8695. triggerEffect(effect2);
  8696. }
  8697. }
  8698. for (const effect2 of effects) {
  8699. if (!effect2.computed) {
  8700. triggerEffect(effect2);
  8701. }
  8702. }
  8703. }
  8704. function triggerEffect(effect2, debuggerEventExtraInfo) {
  8705. if (effect2 !== activeEffect || effect2.allowRecurse) {
  8706. if (effect2.scheduler) {
  8707. effect2.scheduler();
  8708. } else {
  8709. effect2.run();
  8710. }
  8711. }
  8712. }
  8713. function toRaw(observed) {
  8714. const raw = observed && observed["__v_raw"];
  8715. return raw ? toRaw(raw) : observed;
  8716. }
  8717. function trackRefValue(ref2) {
  8718. if (shouldTrack && activeEffect) {
  8719. ref2 = toRaw(ref2);
  8720. {
  8721. trackEffects(ref2.dep || (ref2.dep = createDep()));
  8722. }
  8723. }
  8724. }
  8725. function triggerRefValue(ref2, newVal) {
  8726. ref2 = toRaw(ref2);
  8727. if (ref2.dep) {
  8728. {
  8729. triggerEffects(ref2.dep);
  8730. }
  8731. }
  8732. }
  8733. class ComputedRefImpl {
  8734. constructor(getter, _setter, isReadonly2, isSSR) {
  8735. this._setter = _setter;
  8736. this.dep = void 0;
  8737. this.__v_isRef = true;
  8738. this._dirty = true;
  8739. this.effect = new ReactiveEffect(getter, () => {
  8740. if (!this._dirty) {
  8741. this._dirty = true;
  8742. triggerRefValue(this);
  8743. }
  8744. });
  8745. this.effect.computed = this;
  8746. this.effect.active = this._cacheable = !isSSR;
  8747. this["__v_isReadonly"] = isReadonly2;
  8748. }
  8749. get value() {
  8750. const self = toRaw(this);
  8751. trackRefValue(self);
  8752. if (self._dirty || !self._cacheable) {
  8753. self._dirty = false;
  8754. self._value = self.effect.run();
  8755. }
  8756. return self._value;
  8757. }
  8758. set value(newValue) {
  8759. this._setter(newValue);
  8760. }
  8761. }
  8762. function computed(getterOrOptions, debugOptions, isSSR = false) {
  8763. let getter;
  8764. let setter;
  8765. const onlyGetter = isFunction(getterOrOptions);
  8766. if (onlyGetter) {
  8767. getter = getterOrOptions;
  8768. setter = NOOP;
  8769. } else {
  8770. getter = getterOrOptions.get;
  8771. setter = getterOrOptions.set;
  8772. }
  8773. const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
  8774. return cRef;
  8775. }
  8776. const useLockscreen = (trigger) => {
  8777. if (!vue.isRef(trigger)) {
  8778. throwError("[useLockscreen]", "You need to pass a ref param to this function");
  8779. }
  8780. const ns = useNamespace("popup");
  8781. const hiddenCls = computed(() => ns.bm("parent", "hidden"));
  8782. if (!isClient || hasClass(document.body, hiddenCls.value)) {
  8783. return;
  8784. }
  8785. let scrollBarWidth = 0;
  8786. let withoutHiddenClass = false;
  8787. let bodyWidth = "0";
  8788. const cleanup = () => {
  8789. setTimeout(() => {
  8790. removeClass(document.body, hiddenCls.value);
  8791. if (withoutHiddenClass) {
  8792. document.body.style.width = bodyWidth;
  8793. }
  8794. }, 200);
  8795. };
  8796. vue.watch(trigger, (val) => {
  8797. if (!val) {
  8798. cleanup();
  8799. return;
  8800. }
  8801. withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
  8802. if (withoutHiddenClass) {
  8803. bodyWidth = document.body.style.width;
  8804. }
  8805. scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  8806. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  8807. const bodyOverflowY = getStyle(document.body, "overflowY");
  8808. if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) {
  8809. document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;
  8810. }
  8811. addClass(document.body, hiddenCls.value);
  8812. });
  8813. vue.onScopeDispose(() => cleanup());
  8814. };
  8815. const modalStack = [];
  8816. const closeModal = (e) => {
  8817. if (modalStack.length === 0)
  8818. return;
  8819. if (e.code === EVENT_CODE.esc) {
  8820. e.stopPropagation();
  8821. const topModal = modalStack[modalStack.length - 1];
  8822. topModal.handleClose();
  8823. }
  8824. };
  8825. const useModal = (instance, visibleRef) => {
  8826. vue.watch(visibleRef, (val) => {
  8827. if (val) {
  8828. modalStack.push(instance);
  8829. } else {
  8830. modalStack.splice(modalStack.indexOf(instance), 1);
  8831. }
  8832. });
  8833. };
  8834. if (isClient)
  8835. useEventListener(document, "keydown", closeModal);
  8836. const _prop = buildProp({
  8837. type: definePropType(Boolean),
  8838. default: null
  8839. });
  8840. const _event = buildProp({
  8841. type: definePropType(Function)
  8842. });
  8843. const createModelToggleComposable = (name) => {
  8844. const updateEventKey = `update:${name}`;
  8845. const updateEventKeyRaw = `onUpdate:${name}`;
  8846. const useModelToggleEmits2 = [updateEventKey];
  8847. const useModelToggleProps2 = {
  8848. [name]: _prop,
  8849. [updateEventKeyRaw]: _event
  8850. };
  8851. const useModelToggle2 = ({
  8852. indicator,
  8853. toggleReason,
  8854. shouldHideWhenRouteChanges,
  8855. shouldProceed,
  8856. onShow,
  8857. onHide
  8858. }) => {
  8859. const instance = vue.getCurrentInstance();
  8860. const { emit } = instance;
  8861. const props = instance.props;
  8862. const hasUpdateHandler = vue.computed(() => isFunction(props[updateEventKeyRaw]));
  8863. const isModelBindingAbsent = vue.computed(() => props[name] === null);
  8864. const doShow = (event) => {
  8865. if (indicator.value === true) {
  8866. return;
  8867. }
  8868. indicator.value = true;
  8869. if (toggleReason) {
  8870. toggleReason.value = event;
  8871. }
  8872. if (isFunction(onShow)) {
  8873. onShow(event);
  8874. }
  8875. };
  8876. const doHide = (event) => {
  8877. if (indicator.value === false) {
  8878. return;
  8879. }
  8880. indicator.value = false;
  8881. if (toggleReason) {
  8882. toggleReason.value = event;
  8883. }
  8884. if (isFunction(onHide)) {
  8885. onHide(event);
  8886. }
  8887. };
  8888. const show = (event) => {
  8889. if (props.disabled === true || isFunction(shouldProceed) && !shouldProceed())
  8890. return;
  8891. const shouldEmit = hasUpdateHandler.value && isClient;
  8892. if (shouldEmit) {
  8893. emit(updateEventKey, true);
  8894. }
  8895. if (isModelBindingAbsent.value || !shouldEmit) {
  8896. doShow(event);
  8897. }
  8898. };
  8899. const hide = (event) => {
  8900. if (props.disabled === true || !isClient)
  8901. return;
  8902. const shouldEmit = hasUpdateHandler.value && isClient;
  8903. if (shouldEmit) {
  8904. emit(updateEventKey, false);
  8905. }
  8906. if (isModelBindingAbsent.value || !shouldEmit) {
  8907. doHide(event);
  8908. }
  8909. };
  8910. const onChange = (val) => {
  8911. if (!isBoolean(val))
  8912. return;
  8913. if (props.disabled && val) {
  8914. if (hasUpdateHandler.value) {
  8915. emit(updateEventKey, false);
  8916. }
  8917. } else if (indicator.value !== val) {
  8918. if (val) {
  8919. doShow();
  8920. } else {
  8921. doHide();
  8922. }
  8923. }
  8924. };
  8925. const toggle = () => {
  8926. if (indicator.value) {
  8927. hide();
  8928. } else {
  8929. show();
  8930. }
  8931. };
  8932. vue.watch(() => props[name], onChange);
  8933. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
  8934. vue.watch(() => ({
  8935. ...instance.proxy.$route
  8936. }), () => {
  8937. if (shouldHideWhenRouteChanges.value && indicator.value) {
  8938. hide();
  8939. }
  8940. });
  8941. }
  8942. vue.onMounted(() => {
  8943. onChange(props[name]);
  8944. });
  8945. return {
  8946. hide,
  8947. show,
  8948. toggle,
  8949. hasUpdateHandler
  8950. };
  8951. };
  8952. return {
  8953. useModelToggle: useModelToggle2,
  8954. useModelToggleProps: useModelToggleProps2,
  8955. useModelToggleEmits: useModelToggleEmits2
  8956. };
  8957. };
  8958. const { useModelToggle, useModelToggleProps, useModelToggleEmits } = createModelToggleComposable("modelValue");
  8959. const usePreventGlobal = (indicator, evt, cb) => {
  8960. const prevent = (e) => {
  8961. if (cb(e))
  8962. e.stopImmediatePropagation();
  8963. };
  8964. let stop = void 0;
  8965. vue.watch(() => indicator.value, (val) => {
  8966. if (val) {
  8967. stop = useEventListener(document, evt, prevent, true);
  8968. } else {
  8969. stop == null ? void 0 : stop();
  8970. }
  8971. }, { immediate: true });
  8972. };
  8973. const useRestoreActive = (toggle, initialFocus) => {
  8974. let previousActive;
  8975. vue.watch(() => toggle.value, (val) => {
  8976. var _a, _b;
  8977. if (val) {
  8978. previousActive = document.activeElement;
  8979. if (vue.isRef(initialFocus)) {
  8980. (_b = (_a = initialFocus.value).focus) == null ? void 0 : _b.call(_a);
  8981. }
  8982. } else {
  8983. {
  8984. previousActive.focus();
  8985. }
  8986. }
  8987. });
  8988. };
  8989. const useSameTarget = (handleClick) => {
  8990. if (!handleClick) {
  8991. return { onClick: NOOP, onMousedown: NOOP, onMouseup: NOOP };
  8992. }
  8993. let mousedownTarget = false;
  8994. let mouseupTarget = false;
  8995. const onClick = (e) => {
  8996. if (mousedownTarget && mouseupTarget) {
  8997. handleClick(e);
  8998. }
  8999. mousedownTarget = mouseupTarget = false;
  9000. };
  9001. const onMousedown = (e) => {
  9002. mousedownTarget = e.target === e.currentTarget;
  9003. };
  9004. const onMouseup = (e) => {
  9005. mouseupTarget = e.target === e.currentTarget;
  9006. };
  9007. return { onClick, onMousedown, onMouseup };
  9008. };
  9009. const useTeleport = (contentRenderer, appendToBody) => {
  9010. const isTeleportVisible = vue.ref(false);
  9011. if (!isClient) {
  9012. return {
  9013. isTeleportVisible,
  9014. showTeleport: NOOP,
  9015. hideTeleport: NOOP,
  9016. renderTeleport: NOOP
  9017. };
  9018. }
  9019. let $el = null;
  9020. const showTeleport = () => {
  9021. isTeleportVisible.value = true;
  9022. if ($el !== null)
  9023. return;
  9024. $el = createGlobalNode();
  9025. };
  9026. const hideTeleport = () => {
  9027. isTeleportVisible.value = false;
  9028. if ($el !== null) {
  9029. removeGlobalNode($el);
  9030. $el = null;
  9031. }
  9032. };
  9033. const renderTeleport = () => {
  9034. return appendToBody.value !== true ? contentRenderer() : isTeleportVisible.value ? [vue.h(vue.Teleport, { to: $el }, contentRenderer())] : void 0;
  9035. };
  9036. vue.onUnmounted(hideTeleport);
  9037. return {
  9038. isTeleportVisible,
  9039. showTeleport,
  9040. hideTeleport,
  9041. renderTeleport
  9042. };
  9043. };
  9044. const useThrottleRender = (loading, throttle = 0) => {
  9045. if (throttle === 0)
  9046. return loading;
  9047. const throttled = vue.ref(false);
  9048. let timeoutHandle = 0;
  9049. const dispatchThrottling = () => {
  9050. if (timeoutHandle) {
  9051. clearTimeout(timeoutHandle);
  9052. }
  9053. timeoutHandle = window.setTimeout(() => {
  9054. throttled.value = loading.value;
  9055. }, throttle);
  9056. };
  9057. vue.onMounted(dispatchThrottling);
  9058. vue.watch(() => loading.value, (val) => {
  9059. if (val) {
  9060. dispatchThrottling();
  9061. } else {
  9062. throttled.value = val;
  9063. }
  9064. });
  9065. return throttled;
  9066. };
  9067. function useTimeout() {
  9068. let timeoutHandle;
  9069. const registerTimeout = (fn, delay) => {
  9070. cancelTimeout();
  9071. timeoutHandle = window.setTimeout(fn, delay);
  9072. };
  9073. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  9074. tryOnScopeDispose(() => cancelTimeout());
  9075. return {
  9076. registerTimeout,
  9077. cancelTimeout
  9078. };
  9079. }
  9080. const AFTER_APPEAR = "after-appear";
  9081. const AFTER_ENTER = "after-enter";
  9082. const AFTER_LEAVE = "after-leave";
  9083. const APPEAR = "appear";
  9084. const APPEAR_CANCELLED = "appear-cancelled";
  9085. const BEFORE_ENTER = "before-enter";
  9086. const BEFORE_LEAVE = "before-leave";
  9087. const ENTER = "enter";
  9088. const ENTER_CANCELLED = "enter-cancelled";
  9089. const LEAVE = "leave";
  9090. const LEAVE_CANCELLED = "leave-cancelled";
  9091. const useTransitionFallthroughEmits = [
  9092. AFTER_APPEAR,
  9093. AFTER_ENTER,
  9094. AFTER_LEAVE,
  9095. APPEAR,
  9096. APPEAR_CANCELLED,
  9097. BEFORE_ENTER,
  9098. BEFORE_LEAVE,
  9099. ENTER,
  9100. ENTER_CANCELLED,
  9101. LEAVE,
  9102. LEAVE_CANCELLED
  9103. ];
  9104. const useTransitionFallthrough = () => {
  9105. const { emit } = vue.getCurrentInstance();
  9106. return {
  9107. onAfterAppear: () => {
  9108. emit(AFTER_APPEAR);
  9109. },
  9110. onAfterEnter: () => {
  9111. emit(AFTER_ENTER);
  9112. },
  9113. onAfterLeave: () => {
  9114. emit(AFTER_LEAVE);
  9115. },
  9116. onAppearCancelled: () => {
  9117. emit(APPEAR_CANCELLED);
  9118. },
  9119. onBeforeEnter: () => {
  9120. emit(BEFORE_ENTER);
  9121. },
  9122. onBeforeLeave: () => {
  9123. emit(BEFORE_LEAVE);
  9124. },
  9125. onEnter: () => {
  9126. emit(ENTER);
  9127. },
  9128. onEnterCancelled: () => {
  9129. emit(ENTER_CANCELLED);
  9130. },
  9131. onLeave: () => {
  9132. emit(LEAVE);
  9133. },
  9134. onLeaveCancelled: () => {
  9135. emit(LEAVE_CANCELLED);
  9136. }
  9137. };
  9138. };
  9139. let registeredEscapeHandlers = [];
  9140. const cachedHandler = (e) => {
  9141. const event = e;
  9142. if (event.key === EVENT_CODE.esc) {
  9143. registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
  9144. }
  9145. };
  9146. const useEscapeKeydown = (handler) => {
  9147. vue.onMounted(() => {
  9148. if (registeredEscapeHandlers.length === 0) {
  9149. document.addEventListener("keydown", cachedHandler);
  9150. }
  9151. if (isClient)
  9152. registeredEscapeHandlers.push(handler);
  9153. });
  9154. vue.onBeforeUnmount(() => {
  9155. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  9156. if (registeredEscapeHandlers.length === 0) {
  9157. if (isClient)
  9158. document.removeEventListener("keydown", cachedHandler);
  9159. }
  9160. });
  9161. };
  9162. let cachedContainer;
  9163. const usePopperContainerId = () => {
  9164. const namespace = useGlobalConfig("namespace", defaultNamespace);
  9165. const idInjection = useIdInjection();
  9166. const id = vue.computed(() => {
  9167. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  9168. });
  9169. const selector = vue.computed(() => `#${id.value}`);
  9170. return {
  9171. id,
  9172. selector
  9173. };
  9174. };
  9175. const createContainer = (id) => {
  9176. const container = document.createElement("div");
  9177. container.id = id;
  9178. document.body.appendChild(container);
  9179. return container;
  9180. };
  9181. const usePopperContainer = () => {
  9182. vue.onBeforeMount(() => {
  9183. if (!isClient)
  9184. return;
  9185. const { id, selector } = usePopperContainerId();
  9186. if (!cachedContainer && !document.body.querySelector(selector.value)) {
  9187. cachedContainer = createContainer(id.value);
  9188. }
  9189. });
  9190. };
  9191. const useDelayedRender = ({
  9192. indicator,
  9193. intermediateIndicator,
  9194. shouldSetIntermediate = () => true,
  9195. beforeShow,
  9196. afterShow,
  9197. afterHide,
  9198. beforeHide
  9199. }) => {
  9200. vue.watch(() => vue.unref(indicator), (val) => {
  9201. if (val) {
  9202. beforeShow == null ? void 0 : beforeShow();
  9203. vue.nextTick(() => {
  9204. if (!vue.unref(indicator))
  9205. return;
  9206. if (shouldSetIntermediate("show")) {
  9207. intermediateIndicator.value = true;
  9208. }
  9209. });
  9210. } else {
  9211. beforeHide == null ? void 0 : beforeHide();
  9212. vue.nextTick(() => {
  9213. if (vue.unref(indicator))
  9214. return;
  9215. if (shouldSetIntermediate("hide")) {
  9216. intermediateIndicator.value = false;
  9217. }
  9218. });
  9219. }
  9220. });
  9221. vue.watch(() => intermediateIndicator.value, (val) => {
  9222. if (val) {
  9223. afterShow == null ? void 0 : afterShow();
  9224. } else {
  9225. afterHide == null ? void 0 : afterHide();
  9226. }
  9227. });
  9228. };
  9229. const useDelayedToggleProps = buildProps({
  9230. showAfter: {
  9231. type: Number,
  9232. default: 0
  9233. },
  9234. hideAfter: {
  9235. type: Number,
  9236. default: 200
  9237. }
  9238. });
  9239. const useDelayedToggle = ({
  9240. showAfter,
  9241. hideAfter,
  9242. open,
  9243. close
  9244. }) => {
  9245. const { registerTimeout } = useTimeout();
  9246. const onOpen = (event) => {
  9247. registerTimeout(() => {
  9248. open(event);
  9249. }, vue.unref(showAfter));
  9250. };
  9251. const onClose = (event) => {
  9252. registerTimeout(() => {
  9253. close(event);
  9254. }, vue.unref(hideAfter));
  9255. };
  9256. return {
  9257. onOpen,
  9258. onClose
  9259. };
  9260. };
  9261. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  9262. const useForwardRef = (forwardRef) => {
  9263. const setForwardRef = (el) => {
  9264. forwardRef.value = el;
  9265. };
  9266. vue.provide(FORWARD_REF_INJECTION_KEY, {
  9267. setForwardRef
  9268. });
  9269. };
  9270. const useForwardRefDirective = (setForwardRef) => {
  9271. return {
  9272. mounted(el) {
  9273. setForwardRef(el);
  9274. },
  9275. updated(el) {
  9276. setForwardRef(el);
  9277. },
  9278. unmounted() {
  9279. setForwardRef(null);
  9280. }
  9281. };
  9282. };
  9283. const zIndex = vue.ref(0);
  9284. const useZIndex = () => {
  9285. const initialZIndex = useGlobalConfig("zIndex", 2e3);
  9286. const currentZIndex = vue.computed(() => initialZIndex.value + zIndex.value);
  9287. const nextZIndex = () => {
  9288. zIndex.value++;
  9289. return currentZIndex.value;
  9290. };
  9291. return {
  9292. initialZIndex,
  9293. currentZIndex,
  9294. nextZIndex
  9295. };
  9296. };
  9297. function getSide(placement) {
  9298. return placement.split('-')[0];
  9299. }
  9300. function getAlignment(placement) {
  9301. return placement.split('-')[1];
  9302. }
  9303. function getMainAxisFromPlacement(placement) {
  9304. return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';
  9305. }
  9306. function getLengthFromAxis(axis) {
  9307. return axis === 'y' ? 'height' : 'width';
  9308. }
  9309. function computeCoordsFromPlacement(_ref, placement, rtl) {
  9310. let {
  9311. reference,
  9312. floating
  9313. } = _ref;
  9314. const commonX = reference.x + reference.width / 2 - floating.width / 2;
  9315. const commonY = reference.y + reference.height / 2 - floating.height / 2;
  9316. const mainAxis = getMainAxisFromPlacement(placement);
  9317. const length = getLengthFromAxis(mainAxis);
  9318. const commonAlign = reference[length] / 2 - floating[length] / 2;
  9319. const side = getSide(placement);
  9320. const isVertical = mainAxis === 'x';
  9321. let coords;
  9322. switch (side) {
  9323. case 'top':
  9324. coords = {
  9325. x: commonX,
  9326. y: reference.y - floating.height
  9327. };
  9328. break;
  9329. case 'bottom':
  9330. coords = {
  9331. x: commonX,
  9332. y: reference.y + reference.height
  9333. };
  9334. break;
  9335. case 'right':
  9336. coords = {
  9337. x: reference.x + reference.width,
  9338. y: commonY
  9339. };
  9340. break;
  9341. case 'left':
  9342. coords = {
  9343. x: reference.x - floating.width,
  9344. y: commonY
  9345. };
  9346. break;
  9347. default:
  9348. coords = {
  9349. x: reference.x,
  9350. y: reference.y
  9351. };
  9352. }
  9353. switch (getAlignment(placement)) {
  9354. case 'start':
  9355. coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
  9356. break;
  9357. case 'end':
  9358. coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
  9359. break;
  9360. }
  9361. return coords;
  9362. }
  9363. /**
  9364. * Computes the `x` and `y` coordinates that will place the floating element
  9365. * next to a reference element when it is given a certain positioning strategy.
  9366. *
  9367. * This export does not have any `platform` interface logic. You will need to
  9368. * write one for the platform you are using Floating UI with.
  9369. */
  9370. const computePosition$1 = async (reference, floating, config) => {
  9371. const {
  9372. placement = 'bottom',
  9373. strategy = 'absolute',
  9374. middleware = [],
  9375. platform
  9376. } = config;
  9377. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
  9378. if (process.env.NODE_ENV !== "production") {
  9379. if (platform == null) {
  9380. console.error(['Floating UI: `platform` property was not passed to config. If you', 'want to use Floating UI on the web, install @floating-ui/dom', 'instead of the /core package. Otherwise, you can create your own', '`platform`: https://floating-ui.com/docs/platform'].join(' '));
  9381. }
  9382. if (middleware.filter(_ref => {
  9383. let {
  9384. name
  9385. } = _ref;
  9386. return name === 'autoPlacement' || name === 'flip';
  9387. }).length > 1) {
  9388. throw new Error(['Floating UI: duplicate `flip` and/or `autoPlacement`', 'middleware detected. This will lead to an infinite loop. Ensure only', 'one of either has been passed to the `middleware` array.'].join(' '));
  9389. }
  9390. }
  9391. let rects = await platform.getElementRects({
  9392. reference,
  9393. floating,
  9394. strategy
  9395. });
  9396. let {
  9397. x,
  9398. y
  9399. } = computeCoordsFromPlacement(rects, placement, rtl);
  9400. let statefulPlacement = placement;
  9401. let middlewareData = {};
  9402. let resetCount = 0;
  9403. for (let i = 0; i < middleware.length; i++) {
  9404. const {
  9405. name,
  9406. fn
  9407. } = middleware[i];
  9408. const {
  9409. x: nextX,
  9410. y: nextY,
  9411. data,
  9412. reset
  9413. } = await fn({
  9414. x,
  9415. y,
  9416. initialPlacement: placement,
  9417. placement: statefulPlacement,
  9418. strategy,
  9419. middlewareData,
  9420. rects,
  9421. platform,
  9422. elements: {
  9423. reference,
  9424. floating
  9425. }
  9426. });
  9427. x = nextX != null ? nextX : x;
  9428. y = nextY != null ? nextY : y;
  9429. middlewareData = { ...middlewareData,
  9430. [name]: { ...middlewareData[name],
  9431. ...data
  9432. }
  9433. };
  9434. if (process.env.NODE_ENV !== "production") {
  9435. if (resetCount > 50) {
  9436. console.warn(['Floating UI: The middleware lifecycle appears to be running in an', 'infinite loop. This is usually caused by a `reset` continually', 'being returned without a break condition.'].join(' '));
  9437. }
  9438. }
  9439. if (reset && resetCount <= 50) {
  9440. resetCount++;
  9441. if (typeof reset === 'object') {
  9442. if (reset.placement) {
  9443. statefulPlacement = reset.placement;
  9444. }
  9445. if (reset.rects) {
  9446. rects = reset.rects === true ? await platform.getElementRects({
  9447. reference,
  9448. floating,
  9449. strategy
  9450. }) : reset.rects;
  9451. }
  9452. ({
  9453. x,
  9454. y
  9455. } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
  9456. }
  9457. i = -1;
  9458. continue;
  9459. }
  9460. }
  9461. return {
  9462. x,
  9463. y,
  9464. placement: statefulPlacement,
  9465. strategy,
  9466. middlewareData
  9467. };
  9468. };
  9469. function expandPaddingObject(padding) {
  9470. return {
  9471. top: 0,
  9472. right: 0,
  9473. bottom: 0,
  9474. left: 0,
  9475. ...padding
  9476. };
  9477. }
  9478. function getSideObjectFromPadding(padding) {
  9479. return typeof padding !== 'number' ? expandPaddingObject(padding) : {
  9480. top: padding,
  9481. right: padding,
  9482. bottom: padding,
  9483. left: padding
  9484. };
  9485. }
  9486. function rectToClientRect(rect) {
  9487. return { ...rect,
  9488. top: rect.y,
  9489. left: rect.x,
  9490. right: rect.x + rect.width,
  9491. bottom: rect.y + rect.height
  9492. };
  9493. }
  9494. const min$2 = Math.min;
  9495. const max$2 = Math.max;
  9496. function within(min$1, value, max$1) {
  9497. return max$2(min$1, min$2(value, max$1));
  9498. }
  9499. /**
  9500. * Positions an inner element of the floating element such that it is centered
  9501. * to the reference element.
  9502. * @see https://floating-ui.com/docs/arrow
  9503. */
  9504. const arrow = options => ({
  9505. name: 'arrow',
  9506. options,
  9507. async fn(middlewareArguments) {
  9508. // Since `element` is required, we don't Partial<> the type
  9509. const {
  9510. element,
  9511. padding = 0
  9512. } = options != null ? options : {};
  9513. const {
  9514. x,
  9515. y,
  9516. placement,
  9517. rects,
  9518. platform
  9519. } = middlewareArguments;
  9520. if (element == null) {
  9521. if (process.env.NODE_ENV !== "production") {
  9522. console.warn('Floating UI: No `element` was passed to the `arrow` middleware.');
  9523. }
  9524. return {};
  9525. }
  9526. const paddingObject = getSideObjectFromPadding(padding);
  9527. const coords = {
  9528. x,
  9529. y
  9530. };
  9531. const axis = getMainAxisFromPlacement(placement);
  9532. const alignment = getAlignment(placement);
  9533. const length = getLengthFromAxis(axis);
  9534. const arrowDimensions = await platform.getDimensions(element);
  9535. const minProp = axis === 'y' ? 'top' : 'left';
  9536. const maxProp = axis === 'y' ? 'bottom' : 'right';
  9537. const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
  9538. const startDiff = coords[axis] - rects.reference[axis];
  9539. const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
  9540. let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
  9541. if (clientSize === 0) {
  9542. clientSize = rects.floating[length];
  9543. }
  9544. const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center
  9545. // point is outside the floating element's bounds
  9546. const min = paddingObject[minProp];
  9547. const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];
  9548. const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
  9549. const offset = within(min, center, max); // Make sure that arrow points at the reference
  9550. const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];
  9551. const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];
  9552. const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;
  9553. return {
  9554. [axis]: coords[axis] - alignmentOffset,
  9555. data: {
  9556. [axis]: offset,
  9557. centerOffset: center - offset
  9558. }
  9559. };
  9560. }
  9561. });
  9562. async function convertValueToCoords(middlewareArguments, value) {
  9563. const {
  9564. placement,
  9565. platform,
  9566. elements
  9567. } = middlewareArguments;
  9568. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
  9569. const side = getSide(placement);
  9570. const alignment = getAlignment(placement);
  9571. const isVertical = getMainAxisFromPlacement(placement) === 'x';
  9572. const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
  9573. const crossAxisMulti = rtl && isVertical ? -1 : 1;
  9574. const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const
  9575. let {
  9576. mainAxis,
  9577. crossAxis,
  9578. alignmentAxis
  9579. } = typeof rawValue === 'number' ? {
  9580. mainAxis: rawValue,
  9581. crossAxis: 0,
  9582. alignmentAxis: null
  9583. } : {
  9584. mainAxis: 0,
  9585. crossAxis: 0,
  9586. alignmentAxis: null,
  9587. ...rawValue
  9588. };
  9589. if (alignment && typeof alignmentAxis === 'number') {
  9590. crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
  9591. }
  9592. return isVertical ? {
  9593. x: crossAxis * crossAxisMulti,
  9594. y: mainAxis * mainAxisMulti
  9595. } : {
  9596. x: mainAxis * mainAxisMulti,
  9597. y: crossAxis * crossAxisMulti
  9598. };
  9599. }
  9600. /**
  9601. * Displaces the floating element from its reference element.
  9602. * @see https://floating-ui.com/docs/offset
  9603. */
  9604. const offset = function (value) {
  9605. if (value === void 0) {
  9606. value = 0;
  9607. }
  9608. return {
  9609. name: 'offset',
  9610. options: value,
  9611. async fn(middlewareArguments) {
  9612. const {
  9613. x,
  9614. y
  9615. } = middlewareArguments;
  9616. const diffCoords = await convertValueToCoords(middlewareArguments, value);
  9617. return {
  9618. x: x + diffCoords.x,
  9619. y: y + diffCoords.y,
  9620. data: diffCoords
  9621. };
  9622. }
  9623. };
  9624. };
  9625. function isWindow(value) {
  9626. return value && value.document && value.location && value.alert && value.setInterval;
  9627. }
  9628. function getWindow(node) {
  9629. if (node == null) {
  9630. return window;
  9631. }
  9632. if (!isWindow(node)) {
  9633. const ownerDocument = node.ownerDocument;
  9634. return ownerDocument ? ownerDocument.defaultView || window : window;
  9635. }
  9636. return node;
  9637. }
  9638. function getComputedStyle$1(element) {
  9639. return getWindow(element).getComputedStyle(element);
  9640. }
  9641. function getNodeName(node) {
  9642. return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';
  9643. }
  9644. function getUAString() {
  9645. const uaData = navigator.userAgentData;
  9646. if (uaData != null && uaData.brands) {
  9647. return uaData.brands.map(item => item.brand + "/" + item.version).join(' ');
  9648. }
  9649. return navigator.userAgent;
  9650. }
  9651. function isHTMLElement(value) {
  9652. return value instanceof getWindow(value).HTMLElement;
  9653. }
  9654. function isElement(value) {
  9655. return value instanceof getWindow(value).Element;
  9656. }
  9657. function isNode(value) {
  9658. return value instanceof getWindow(value).Node;
  9659. }
  9660. function isShadowRoot(node) {
  9661. // Browsers without `ShadowRoot` support
  9662. if (typeof ShadowRoot === 'undefined') {
  9663. return false;
  9664. }
  9665. const OwnElement = getWindow(node).ShadowRoot;
  9666. return node instanceof OwnElement || node instanceof ShadowRoot;
  9667. }
  9668. function isOverflowElement(element) {
  9669. // Firefox wants us to check `-x` and `-y` variations as well
  9670. const {
  9671. overflow,
  9672. overflowX,
  9673. overflowY
  9674. } = getComputedStyle$1(element);
  9675. return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
  9676. }
  9677. function isTableElement(element) {
  9678. return ['table', 'td', 'th'].includes(getNodeName(element));
  9679. }
  9680. function isContainingBlock(element) {
  9681. // TODO: Try and use feature detection here instead
  9682. const isFirefox = /firefox/i.test(getUAString());
  9683. const css = getComputedStyle$1(element); // This is non-exhaustive but covers the most common CSS properties that
  9684. // create a containing block.
  9685. // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
  9686. return css.transform !== 'none' || css.perspective !== 'none' || // @ts-ignore (TS 4.1 compat)
  9687. css.contain === 'paint' || ['transform', 'perspective'].includes(css.willChange) || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false);
  9688. }
  9689. function isLayoutViewport() {
  9690. // Not Safari
  9691. return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways
  9692. // • Always-visible scrollbar or not
  9693. // • Width of <html>, etc.
  9694. // const vV = win.visualViewport;
  9695. // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;
  9696. }
  9697. const min$1 = Math.min;
  9698. const max$1 = Math.max;
  9699. const round = Math.round;
  9700. function getBoundingClientRect(element, includeScale, isFixedStrategy) {
  9701. var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;
  9702. if (includeScale === void 0) {
  9703. includeScale = false;
  9704. }
  9705. if (isFixedStrategy === void 0) {
  9706. isFixedStrategy = false;
  9707. }
  9708. const clientRect = element.getBoundingClientRect();
  9709. let scaleX = 1;
  9710. let scaleY = 1;
  9711. if (includeScale && isHTMLElement(element)) {
  9712. scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
  9713. scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
  9714. }
  9715. const win = isElement(element) ? getWindow(element) : window;
  9716. const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
  9717. const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;
  9718. const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;
  9719. const width = clientRect.width / scaleX;
  9720. const height = clientRect.height / scaleY;
  9721. return {
  9722. width,
  9723. height,
  9724. top: y,
  9725. right: x + width,
  9726. bottom: y + height,
  9727. left: x,
  9728. x,
  9729. y
  9730. };
  9731. }
  9732. function getDocumentElement(node) {
  9733. return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
  9734. }
  9735. function getNodeScroll(element) {
  9736. if (isElement(element)) {
  9737. return {
  9738. scrollLeft: element.scrollLeft,
  9739. scrollTop: element.scrollTop
  9740. };
  9741. }
  9742. return {
  9743. scrollLeft: element.pageXOffset,
  9744. scrollTop: element.pageYOffset
  9745. };
  9746. }
  9747. function getWindowScrollBarX(element) {
  9748. // If <html> has a CSS width greater than the viewport, then this will be
  9749. // incorrect for RTL.
  9750. return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
  9751. }
  9752. function isScaled(element) {
  9753. const rect = getBoundingClientRect(element);
  9754. return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;
  9755. }
  9756. function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
  9757. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9758. const documentElement = getDocumentElement(offsetParent);
  9759. const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)
  9760. isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');
  9761. let scroll = {
  9762. scrollLeft: 0,
  9763. scrollTop: 0
  9764. };
  9765. const offsets = {
  9766. x: 0,
  9767. y: 0
  9768. };
  9769. if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
  9770. if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
  9771. scroll = getNodeScroll(offsetParent);
  9772. }
  9773. if (isHTMLElement(offsetParent)) {
  9774. const offsetRect = getBoundingClientRect(offsetParent, true);
  9775. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9776. offsets.y = offsetRect.y + offsetParent.clientTop;
  9777. } else if (documentElement) {
  9778. offsets.x = getWindowScrollBarX(documentElement);
  9779. }
  9780. }
  9781. return {
  9782. x: rect.left + scroll.scrollLeft - offsets.x,
  9783. y: rect.top + scroll.scrollTop - offsets.y,
  9784. width: rect.width,
  9785. height: rect.height
  9786. };
  9787. }
  9788. function getParentNode(node) {
  9789. if (getNodeName(node) === 'html') {
  9790. return node;
  9791. }
  9792. return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
  9793. // @ts-ignore
  9794. node.assignedSlot || // step into the shadow DOM of the parent of a slotted node
  9795. node.parentNode || ( // DOM Element detected
  9796. isShadowRoot(node) ? node.host : null) || // ShadowRoot detected
  9797. getDocumentElement(node) // fallback
  9798. );
  9799. }
  9800. function getTrueOffsetParent(element) {
  9801. if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {
  9802. return null;
  9803. }
  9804. return composedOffsetParent(element);
  9805. }
  9806. /**
  9807. * Polyfills the old offsetParent behavior from before the spec was changed:
  9808. * https://github.com/w3c/csswg-drafts/issues/159
  9809. */
  9810. function composedOffsetParent(element) {
  9811. let {
  9812. offsetParent
  9813. } = element;
  9814. let ancestor = element;
  9815. let foundInsideSlot = false;
  9816. while (ancestor && ancestor !== offsetParent) {
  9817. const {
  9818. assignedSlot
  9819. } = ancestor;
  9820. if (assignedSlot) {
  9821. let newOffsetParent = assignedSlot.offsetParent;
  9822. if (getComputedStyle$1(assignedSlot).display === 'contents') {
  9823. const hadStyleAttribute = assignedSlot.hasAttribute('style');
  9824. const oldDisplay = assignedSlot.style.display;
  9825. assignedSlot.style.display = getComputedStyle$1(ancestor).display;
  9826. newOffsetParent = assignedSlot.offsetParent;
  9827. assignedSlot.style.display = oldDisplay;
  9828. if (!hadStyleAttribute) {
  9829. assignedSlot.removeAttribute('style');
  9830. }
  9831. }
  9832. ancestor = assignedSlot;
  9833. if (offsetParent !== newOffsetParent) {
  9834. offsetParent = newOffsetParent;
  9835. foundInsideSlot = true;
  9836. }
  9837. } else if (isShadowRoot(ancestor) && ancestor.host && foundInsideSlot) {
  9838. break;
  9839. }
  9840. ancestor = isShadowRoot(ancestor) && ancestor.host || ancestor.parentNode;
  9841. }
  9842. return offsetParent;
  9843. }
  9844. function getContainingBlock(element) {
  9845. let currentNode = getParentNode(element);
  9846. if (isShadowRoot(currentNode)) {
  9847. currentNode = currentNode.host;
  9848. }
  9849. while (isHTMLElement(currentNode) && !['html', 'body'].includes(getNodeName(currentNode))) {
  9850. if (isContainingBlock(currentNode)) {
  9851. return currentNode;
  9852. } else {
  9853. const parent = currentNode.parentNode;
  9854. currentNode = isShadowRoot(parent) ? parent.host : parent;
  9855. }
  9856. }
  9857. return null;
  9858. } // Gets the closest ancestor positioned element. Handles some edge cases,
  9859. // such as table ancestors and cross browser bugs.
  9860. function getOffsetParent(element) {
  9861. const window = getWindow(element);
  9862. let offsetParent = getTrueOffsetParent(element);
  9863. while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') {
  9864. offsetParent = getTrueOffsetParent(offsetParent);
  9865. }
  9866. if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
  9867. return window;
  9868. }
  9869. return offsetParent || getContainingBlock(element) || window;
  9870. }
  9871. function getDimensions(element) {
  9872. if (isHTMLElement(element)) {
  9873. return {
  9874. width: element.offsetWidth,
  9875. height: element.offsetHeight
  9876. };
  9877. }
  9878. const rect = getBoundingClientRect(element);
  9879. return {
  9880. width: rect.width,
  9881. height: rect.height
  9882. };
  9883. }
  9884. function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
  9885. let {
  9886. rect,
  9887. offsetParent,
  9888. strategy
  9889. } = _ref;
  9890. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9891. const documentElement = getDocumentElement(offsetParent);
  9892. if (offsetParent === documentElement) {
  9893. return rect;
  9894. }
  9895. let scroll = {
  9896. scrollLeft: 0,
  9897. scrollTop: 0
  9898. };
  9899. const offsets = {
  9900. x: 0,
  9901. y: 0
  9902. };
  9903. if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
  9904. if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
  9905. scroll = getNodeScroll(offsetParent);
  9906. }
  9907. if (isHTMLElement(offsetParent)) {
  9908. const offsetRect = getBoundingClientRect(offsetParent, true);
  9909. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9910. offsets.y = offsetRect.y + offsetParent.clientTop;
  9911. } // This doesn't appear to be need to be negated.
  9912. // else if (documentElement) {
  9913. // offsets.x = getWindowScrollBarX(documentElement);
  9914. // }
  9915. }
  9916. return { ...rect,
  9917. x: rect.x - scroll.scrollLeft + offsets.x,
  9918. y: rect.y - scroll.scrollTop + offsets.y
  9919. };
  9920. }
  9921. function getViewportRect(element, strategy) {
  9922. const win = getWindow(element);
  9923. const html = getDocumentElement(element);
  9924. const visualViewport = win.visualViewport;
  9925. let width = html.clientWidth;
  9926. let height = html.clientHeight;
  9927. let x = 0;
  9928. let y = 0;
  9929. if (visualViewport) {
  9930. width = visualViewport.width;
  9931. height = visualViewport.height;
  9932. const layoutViewport = isLayoutViewport();
  9933. if (layoutViewport || !layoutViewport && strategy === 'fixed') {
  9934. x = visualViewport.offsetLeft;
  9935. y = visualViewport.offsetTop;
  9936. }
  9937. }
  9938. return {
  9939. width,
  9940. height,
  9941. x,
  9942. y
  9943. };
  9944. }
  9945. // of the `<html>` and `<body>` rect bounds if horizontally scrollable
  9946. function getDocumentRect(element) {
  9947. var _element$ownerDocumen;
  9948. const html = getDocumentElement(element);
  9949. const scroll = getNodeScroll(element);
  9950. const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
  9951. const width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
  9952. const height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
  9953. let x = -scroll.scrollLeft + getWindowScrollBarX(element);
  9954. const y = -scroll.scrollTop;
  9955. if (getComputedStyle$1(body || html).direction === 'rtl') {
  9956. x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
  9957. }
  9958. return {
  9959. width,
  9960. height,
  9961. x,
  9962. y
  9963. };
  9964. }
  9965. function getNearestOverflowAncestor(node) {
  9966. const parentNode = getParentNode(node);
  9967. if (['html', 'body', '#document'].includes(getNodeName(parentNode))) {
  9968. // @ts-ignore assume body is always available
  9969. return node.ownerDocument.body;
  9970. }
  9971. if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
  9972. return parentNode;
  9973. }
  9974. return getNearestOverflowAncestor(parentNode);
  9975. }
  9976. function getOverflowAncestors(node, list) {
  9977. var _node$ownerDocument;
  9978. if (list === void 0) {
  9979. list = [];
  9980. }
  9981. const scrollableAncestor = getNearestOverflowAncestor(node);
  9982. const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
  9983. const win = getWindow(scrollableAncestor);
  9984. const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;
  9985. const updatedList = list.concat(target);
  9986. return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here
  9987. updatedList.concat(getOverflowAncestors(target));
  9988. }
  9989. function contains(parent, child) {
  9990. const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method
  9991. if (parent.contains(child)) {
  9992. return true;
  9993. } // then fallback to custom implementation with Shadow DOM support
  9994. else if (rootNode && isShadowRoot(rootNode)) {
  9995. let next = child;
  9996. do {
  9997. // use `===` replace node.isSameNode()
  9998. if (next && parent === next) {
  9999. return true;
  10000. } // @ts-ignore: need a better way to handle this...
  10001. next = next.parentNode || next.host;
  10002. } while (next);
  10003. }
  10004. return false;
  10005. }
  10006. function getInnerBoundingClientRect(element, strategy) {
  10007. const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');
  10008. const top = clientRect.top + element.clientTop;
  10009. const left = clientRect.left + element.clientLeft;
  10010. return {
  10011. top,
  10012. left,
  10013. x: left,
  10014. y: top,
  10015. right: left + element.clientWidth,
  10016. bottom: top + element.clientHeight,
  10017. width: element.clientWidth,
  10018. height: element.clientHeight
  10019. };
  10020. }
  10021. function getClientRectFromClippingAncestor(element, clippingParent, strategy) {
  10022. if (clippingParent === 'viewport') {
  10023. return rectToClientRect(getViewportRect(element, strategy));
  10024. }
  10025. if (isElement(clippingParent)) {
  10026. return getInnerBoundingClientRect(clippingParent, strategy);
  10027. }
  10028. return rectToClientRect(getDocumentRect(getDocumentElement(element)));
  10029. } // A "clipping ancestor" is an overflowable container with the characteristic of
  10030. // clipping (or hiding) overflowing elements with a position different from
  10031. // `initial`
  10032. function getClippingAncestors(element) {
  10033. const clippingAncestors = getOverflowAncestors(element);
  10034. const canEscapeClipping = ['absolute', 'fixed'].includes(getComputedStyle$1(element).position);
  10035. const clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
  10036. if (!isElement(clipperElement)) {
  10037. return [];
  10038. } // @ts-ignore isElement check ensures we return Array<Element>
  10039. return clippingAncestors.filter(clippingAncestors => isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');
  10040. } // Gets the maximum area that the element is visible in due to any number of
  10041. // clipping ancestors
  10042. function getClippingRect(_ref) {
  10043. let {
  10044. element,
  10045. boundary,
  10046. rootBoundary,
  10047. strategy
  10048. } = _ref;
  10049. const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);
  10050. const clippingAncestors = [...mainClippingAncestors, rootBoundary];
  10051. const firstClippingAncestor = clippingAncestors[0];
  10052. const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
  10053. const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
  10054. accRect.top = max$1(rect.top, accRect.top);
  10055. accRect.right = min$1(rect.right, accRect.right);
  10056. accRect.bottom = min$1(rect.bottom, accRect.bottom);
  10057. accRect.left = max$1(rect.left, accRect.left);
  10058. return accRect;
  10059. }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
  10060. return {
  10061. width: clippingRect.right - clippingRect.left,
  10062. height: clippingRect.bottom - clippingRect.top,
  10063. x: clippingRect.left,
  10064. y: clippingRect.top
  10065. };
  10066. }
  10067. const platform = {
  10068. getClippingRect,
  10069. convertOffsetParentRelativeRectToViewportRelativeRect,
  10070. isElement,
  10071. getDimensions,
  10072. getOffsetParent,
  10073. getDocumentElement,
  10074. getElementRects: _ref => {
  10075. let {
  10076. reference,
  10077. floating,
  10078. strategy
  10079. } = _ref;
  10080. return {
  10081. reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),
  10082. floating: { ...getDimensions(floating),
  10083. x: 0,
  10084. y: 0
  10085. }
  10086. };
  10087. },
  10088. getClientRects: element => Array.from(element.getClientRects()),
  10089. isRTL: element => getComputedStyle$1(element).direction === 'rtl'
  10090. };
  10091. /**
  10092. * Computes the `x` and `y` coordinates that will place the floating element
  10093. * next to a reference element when it is given a certain CSS positioning
  10094. * strategy.
  10095. */
  10096. const computePosition = (reference, floating, options) => computePosition$1(reference, floating, {
  10097. platform,
  10098. ...options
  10099. });
  10100. const useFloatingProps = buildProps({});
  10101. const unrefReference = (elRef) => {
  10102. if (!isClient)
  10103. return;
  10104. if (!elRef)
  10105. return elRef;
  10106. const unrefEl = unrefElement(elRef);
  10107. if (unrefEl)
  10108. return unrefEl;
  10109. return vue.isRef(elRef) ? unrefEl : elRef;
  10110. };
  10111. const getPositionDataWithUnit = (record, key) => {
  10112. const value = record == null ? void 0 : record[key];
  10113. return isNil(value) ? "" : `${value}px`;
  10114. };
  10115. const useFloating = ({
  10116. middleware,
  10117. placement,
  10118. strategy
  10119. }) => {
  10120. const referenceRef = vue.ref();
  10121. const contentRef = vue.ref();
  10122. const x = vue.ref();
  10123. const y = vue.ref();
  10124. const middlewareData = vue.ref({});
  10125. const states = {
  10126. x,
  10127. y,
  10128. placement,
  10129. strategy,
  10130. middlewareData
  10131. };
  10132. const update = async () => {
  10133. if (!isClient)
  10134. return;
  10135. const referenceEl = unrefReference(referenceRef);
  10136. const contentEl = unrefElement(contentRef);
  10137. if (!referenceEl || !contentEl)
  10138. return;
  10139. const data = await computePosition(referenceEl, contentEl, {
  10140. placement: vue.unref(placement),
  10141. strategy: vue.unref(strategy),
  10142. middleware: vue.unref(middleware)
  10143. });
  10144. keysOf(states).forEach((key) => {
  10145. states[key].value = data[key];
  10146. });
  10147. };
  10148. vue.onMounted(() => {
  10149. vue.watchEffect(() => {
  10150. update();
  10151. });
  10152. });
  10153. return {
  10154. ...states,
  10155. update,
  10156. referenceRef,
  10157. contentRef
  10158. };
  10159. };
  10160. const arrowMiddleware = ({
  10161. arrowRef,
  10162. padding
  10163. }) => {
  10164. return {
  10165. name: "arrow",
  10166. options: {
  10167. element: arrowRef,
  10168. padding
  10169. },
  10170. fn(args) {
  10171. const arrowEl = vue.unref(arrowRef);
  10172. if (!arrowEl)
  10173. return {};
  10174. return arrow({
  10175. element: arrowEl,
  10176. padding
  10177. }).fn(args);
  10178. }
  10179. };
  10180. };
  10181. function useCursor(input) {
  10182. const selectionRef = vue.ref();
  10183. function recordCursor() {
  10184. if (input.value == void 0)
  10185. return;
  10186. const { selectionStart, selectionEnd, value } = input.value;
  10187. if (selectionStart == null || selectionEnd == null)
  10188. return;
  10189. const beforeTxt = value.slice(0, Math.max(0, selectionStart));
  10190. const afterTxt = value.slice(Math.max(0, selectionEnd));
  10191. selectionRef.value = {
  10192. selectionStart,
  10193. selectionEnd,
  10194. value,
  10195. beforeTxt,
  10196. afterTxt
  10197. };
  10198. }
  10199. function setCursor() {
  10200. if (input.value == void 0 || selectionRef.value == void 0)
  10201. return;
  10202. const { value } = input.value;
  10203. const { beforeTxt, afterTxt, selectionStart } = selectionRef.value;
  10204. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0)
  10205. return;
  10206. let startPos = value.length;
  10207. if (value.endsWith(afterTxt)) {
  10208. startPos = value.length - afterTxt.length;
  10209. } else if (value.startsWith(beforeTxt)) {
  10210. startPos = beforeTxt.length;
  10211. } else {
  10212. const beforeLastChar = beforeTxt[selectionStart - 1];
  10213. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  10214. if (newIndex !== -1) {
  10215. startPos = newIndex + 1;
  10216. }
  10217. }
  10218. input.value.setSelectionRange(startPos, startPos);
  10219. }
  10220. return [recordCursor, setCursor];
  10221. }
  10222. const getOrderedChildren = (vm, childComponentName, children) => {
  10223. const nodes = flattedChildren(vm.subTree).filter((n) => {
  10224. var _a;
  10225. return vue.isVNode(n) && ((_a = n.type) == null ? void 0 : _a.name) === childComponentName && !!n.component;
  10226. });
  10227. const uids = nodes.map((n) => n.component.uid);
  10228. return uids.map((uid) => children[uid]).filter((p) => !!p);
  10229. };
  10230. const useOrderedChildren = (vm, childComponentName) => {
  10231. const children = {};
  10232. const orderedChildren = vue.shallowRef([]);
  10233. const addChild = (child) => {
  10234. children[child.uid] = child;
  10235. orderedChildren.value = getOrderedChildren(vm, childComponentName, children);
  10236. };
  10237. const removeChild = (uid) => {
  10238. delete children[uid];
  10239. orderedChildren.value = orderedChildren.value.filter((children2) => children2.uid !== uid);
  10240. };
  10241. return {
  10242. children: orderedChildren,
  10243. addChild,
  10244. removeChild
  10245. };
  10246. };
  10247. const version$1 = "2.2.27";
  10248. const makeInstaller = (components = []) => {
  10249. const install = (app, options) => {
  10250. if (app[INSTALLED_KEY])
  10251. return;
  10252. app[INSTALLED_KEY] = true;
  10253. components.forEach((c) => app.use(c));
  10254. if (options)
  10255. provideGlobalConfig(options, app, true);
  10256. };
  10257. return {
  10258. version: version$1,
  10259. install
  10260. };
  10261. };
  10262. const affixProps = buildProps({
  10263. zIndex: {
  10264. type: definePropType([Number, String]),
  10265. default: 100
  10266. },
  10267. target: {
  10268. type: String,
  10269. default: ""
  10270. },
  10271. offset: {
  10272. type: Number,
  10273. default: 0
  10274. },
  10275. position: {
  10276. type: String,
  10277. values: ["top", "bottom"],
  10278. default: "top"
  10279. }
  10280. });
  10281. const affixEmits = {
  10282. scroll: ({ scrollTop, fixed }) => isNumber(scrollTop) && isBoolean(fixed),
  10283. [CHANGE_EVENT]: (fixed) => isBoolean(fixed)
  10284. };
  10285. var _export_sfc = (sfc, props) => {
  10286. const target = sfc.__vccOpts || sfc;
  10287. for (const [key, val] of props) {
  10288. target[key] = val;
  10289. }
  10290. return target;
  10291. };
  10292. const COMPONENT_NAME$m = "ElAffix";
  10293. const __default__$1y = vue.defineComponent({
  10294. name: COMPONENT_NAME$m
  10295. });
  10296. const _sfc_main$2h = /* @__PURE__ */ vue.defineComponent({
  10297. ...__default__$1y,
  10298. props: affixProps,
  10299. emits: affixEmits,
  10300. setup(__props, { expose, emit }) {
  10301. const props = __props;
  10302. const ns = useNamespace("affix");
  10303. const target = vue.shallowRef();
  10304. const root = vue.shallowRef();
  10305. const scrollContainer = vue.shallowRef();
  10306. const { height: windowHeight } = useWindowSize();
  10307. const {
  10308. height: rootHeight,
  10309. width: rootWidth,
  10310. top: rootTop,
  10311. bottom: rootBottom,
  10312. update: updateRoot
  10313. } = useElementBounding(root, { windowScroll: false });
  10314. const targetRect = useElementBounding(target);
  10315. const fixed = vue.ref(false);
  10316. const scrollTop = vue.ref(0);
  10317. const transform = vue.ref(0);
  10318. const rootStyle = vue.computed(() => {
  10319. return {
  10320. height: fixed.value ? `${rootHeight.value}px` : "",
  10321. width: fixed.value ? `${rootWidth.value}px` : ""
  10322. };
  10323. });
  10324. const affixStyle = vue.computed(() => {
  10325. if (!fixed.value)
  10326. return {};
  10327. const offset = props.offset ? addUnit(props.offset) : 0;
  10328. return {
  10329. height: `${rootHeight.value}px`,
  10330. width: `${rootWidth.value}px`,
  10331. top: props.position === "top" ? offset : "",
  10332. bottom: props.position === "bottom" ? offset : "",
  10333. transform: transform.value ? `translateY(${transform.value}px)` : "",
  10334. zIndex: props.zIndex
  10335. };
  10336. });
  10337. const update = () => {
  10338. if (!scrollContainer.value)
  10339. return;
  10340. scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
  10341. if (props.position === "top") {
  10342. if (props.target) {
  10343. const difference = targetRect.bottom.value - props.offset - rootHeight.value;
  10344. fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0;
  10345. transform.value = difference < 0 ? difference : 0;
  10346. } else {
  10347. fixed.value = props.offset > rootTop.value;
  10348. }
  10349. } else if (props.target) {
  10350. const difference = windowHeight.value - targetRect.top.value - props.offset - rootHeight.value;
  10351. fixed.value = windowHeight.value - props.offset < rootBottom.value && windowHeight.value > targetRect.top.value;
  10352. transform.value = difference < 0 ? -difference : 0;
  10353. } else {
  10354. fixed.value = windowHeight.value - props.offset < rootBottom.value;
  10355. }
  10356. };
  10357. const handleScroll = () => {
  10358. updateRoot();
  10359. emit("scroll", {
  10360. scrollTop: scrollTop.value,
  10361. fixed: fixed.value
  10362. });
  10363. };
  10364. vue.watch(fixed, (val) => emit("change", val));
  10365. vue.onMounted(() => {
  10366. var _a;
  10367. if (props.target) {
  10368. target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
  10369. if (!target.value)
  10370. throwError(COMPONENT_NAME$m, `Target is not existed: ${props.target}`);
  10371. } else {
  10372. target.value = document.documentElement;
  10373. }
  10374. scrollContainer.value = getScrollContainer(root.value, true);
  10375. updateRoot();
  10376. });
  10377. useEventListener(scrollContainer, "scroll", handleScroll);
  10378. vue.watchEffect(update);
  10379. expose({
  10380. update,
  10381. updateRoot
  10382. });
  10383. return (_ctx, _cache) => {
  10384. return vue.openBlock(), vue.createElementBlock("div", {
  10385. ref_key: "root",
  10386. ref: root,
  10387. class: vue.normalizeClass(vue.unref(ns).b()),
  10388. style: vue.normalizeStyle(vue.unref(rootStyle))
  10389. }, [
  10390. vue.createElementVNode("div", {
  10391. class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
  10392. style: vue.normalizeStyle(vue.unref(affixStyle))
  10393. }, [
  10394. vue.renderSlot(_ctx.$slots, "default")
  10395. ], 6)
  10396. ], 6);
  10397. };
  10398. }
  10399. });
  10400. var Affix = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__file", "affix.vue"]]);
  10401. const ElAffix = withInstall(Affix);
  10402. const iconProps = buildProps({
  10403. size: {
  10404. type: definePropType([Number, String])
  10405. },
  10406. color: {
  10407. type: String
  10408. }
  10409. });
  10410. const __default__$1x = vue.defineComponent({
  10411. name: "ElIcon",
  10412. inheritAttrs: false
  10413. });
  10414. const _sfc_main$2g = /* @__PURE__ */ vue.defineComponent({
  10415. ...__default__$1x,
  10416. props: iconProps,
  10417. setup(__props) {
  10418. const props = __props;
  10419. const ns = useNamespace("icon");
  10420. const style = vue.computed(() => {
  10421. const { size, color } = props;
  10422. if (!size && !color)
  10423. return {};
  10424. return {
  10425. fontSize: isUndefined(size) ? void 0 : addUnit(size),
  10426. "--color": color
  10427. };
  10428. });
  10429. return (_ctx, _cache) => {
  10430. return vue.openBlock(), vue.createElementBlock("i", vue.mergeProps({
  10431. class: vue.unref(ns).b(),
  10432. style: vue.unref(style)
  10433. }, _ctx.$attrs), [
  10434. vue.renderSlot(_ctx.$slots, "default")
  10435. ], 16);
  10436. };
  10437. }
  10438. });
  10439. var Icon = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["__file", "icon.vue"]]);
  10440. const ElIcon = withInstall(Icon);
  10441. const alertEffects = ["light", "dark"];
  10442. const alertProps = buildProps({
  10443. title: {
  10444. type: String,
  10445. default: ""
  10446. },
  10447. description: {
  10448. type: String,
  10449. default: ""
  10450. },
  10451. type: {
  10452. type: String,
  10453. values: keysOf(TypeComponentsMap),
  10454. default: "info"
  10455. },
  10456. closable: {
  10457. type: Boolean,
  10458. default: true
  10459. },
  10460. closeText: {
  10461. type: String,
  10462. default: ""
  10463. },
  10464. showIcon: Boolean,
  10465. center: Boolean,
  10466. effect: {
  10467. type: String,
  10468. values: alertEffects,
  10469. default: "light"
  10470. }
  10471. });
  10472. const alertEmits = {
  10473. close: (evt) => evt instanceof MouseEvent
  10474. };
  10475. const __default__$1w = vue.defineComponent({
  10476. name: "ElAlert"
  10477. });
  10478. const _sfc_main$2f = /* @__PURE__ */ vue.defineComponent({
  10479. ...__default__$1w,
  10480. props: alertProps,
  10481. emits: alertEmits,
  10482. setup(__props, { emit }) {
  10483. const props = __props;
  10484. const { Close } = TypeComponents;
  10485. const slots = vue.useSlots();
  10486. const ns = useNamespace("alert");
  10487. const visible = vue.ref(true);
  10488. const iconComponent = vue.computed(() => TypeComponentsMap[props.type]);
  10489. const iconClass = vue.computed(() => [
  10490. ns.e("icon"),
  10491. { [ns.is("big")]: !!props.description || !!slots.default }
  10492. ]);
  10493. const isBoldTitle = vue.computed(() => {
  10494. return { [ns.is("bold")]: props.description || slots.default };
  10495. });
  10496. const close = (evt) => {
  10497. visible.value = false;
  10498. emit("close", evt);
  10499. };
  10500. return (_ctx, _cache) => {
  10501. return vue.openBlock(), vue.createBlock(vue.Transition, {
  10502. name: vue.unref(ns).b("fade"),
  10503. persisted: ""
  10504. }, {
  10505. default: vue.withCtx(() => [
  10506. vue.withDirectives(vue.createElementVNode("div", {
  10507. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.type), vue.unref(ns).is("center", _ctx.center), vue.unref(ns).is(_ctx.effect)]),
  10508. role: "alert"
  10509. }, [
  10510. _ctx.showIcon && vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  10511. key: 0,
  10512. class: vue.normalizeClass(vue.unref(iconClass))
  10513. }, {
  10514. default: vue.withCtx(() => [
  10515. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
  10516. ]),
  10517. _: 1
  10518. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  10519. vue.createElementVNode("div", {
  10520. class: vue.normalizeClass(vue.unref(ns).e("content"))
  10521. }, [
  10522. _ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
  10523. key: 0,
  10524. class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(isBoldTitle)])
  10525. }, [
  10526. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  10527. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  10528. ])
  10529. ], 2)) : vue.createCommentVNode("v-if", true),
  10530. _ctx.$slots.default || _ctx.description ? (vue.openBlock(), vue.createElementBlock("p", {
  10531. key: 1,
  10532. class: vue.normalizeClass(vue.unref(ns).e("description"))
  10533. }, [
  10534. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  10535. vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
  10536. ])
  10537. ], 2)) : vue.createCommentVNode("v-if", true),
  10538. _ctx.closable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  10539. _ctx.closeText ? (vue.openBlock(), vue.createElementBlock("div", {
  10540. key: 0,
  10541. class: vue.normalizeClass([vue.unref(ns).e("close-btn"), vue.unref(ns).is("customed")]),
  10542. onClick: close
  10543. }, vue.toDisplayString(_ctx.closeText), 3)) : (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  10544. key: 1,
  10545. class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
  10546. onClick: close
  10547. }, {
  10548. default: vue.withCtx(() => [
  10549. vue.createVNode(vue.unref(Close))
  10550. ]),
  10551. _: 1
  10552. }, 8, ["class"]))
  10553. ], 64)) : vue.createCommentVNode("v-if", true)
  10554. ], 2)
  10555. ], 2), [
  10556. [vue.vShow, visible.value]
  10557. ])
  10558. ]),
  10559. _: 3
  10560. }, 8, ["name"]);
  10561. };
  10562. }
  10563. });
  10564. var Alert = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__file", "alert.vue"]]);
  10565. const ElAlert = withInstall(Alert);
  10566. let hiddenTextarea = void 0;
  10567. const HIDDEN_STYLE = `
  10568. height:0 !important;
  10569. visibility:hidden !important;
  10570. overflow:hidden !important;
  10571. position:absolute !important;
  10572. z-index:-1000 !important;
  10573. top:0 !important;
  10574. right:0 !important;
  10575. `;
  10576. const CONTEXT_STYLE = [
  10577. "letter-spacing",
  10578. "line-height",
  10579. "padding-top",
  10580. "padding-bottom",
  10581. "font-family",
  10582. "font-weight",
  10583. "font-size",
  10584. "text-rendering",
  10585. "text-transform",
  10586. "width",
  10587. "text-indent",
  10588. "padding-left",
  10589. "padding-right",
  10590. "border-width",
  10591. "box-sizing"
  10592. ];
  10593. function calculateNodeStyling(targetElement) {
  10594. const style = window.getComputedStyle(targetElement);
  10595. const boxSizing = style.getPropertyValue("box-sizing");
  10596. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  10597. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  10598. const contextStyle = CONTEXT_STYLE.map((name) => `${name}:${style.getPropertyValue(name)}`).join(";");
  10599. return { contextStyle, paddingSize, borderSize, boxSizing };
  10600. }
  10601. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  10602. var _a;
  10603. if (!hiddenTextarea) {
  10604. hiddenTextarea = document.createElement("textarea");
  10605. document.body.appendChild(hiddenTextarea);
  10606. }
  10607. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  10608. hiddenTextarea.setAttribute("style", `${contextStyle};${HIDDEN_STYLE}`);
  10609. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  10610. let height = hiddenTextarea.scrollHeight;
  10611. const result = {};
  10612. if (boxSizing === "border-box") {
  10613. height = height + borderSize;
  10614. } else if (boxSizing === "content-box") {
  10615. height = height - paddingSize;
  10616. }
  10617. hiddenTextarea.value = "";
  10618. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  10619. if (isNumber(minRows)) {
  10620. let minHeight = singleRowHeight * minRows;
  10621. if (boxSizing === "border-box") {
  10622. minHeight = minHeight + paddingSize + borderSize;
  10623. }
  10624. height = Math.max(minHeight, height);
  10625. result.minHeight = `${minHeight}px`;
  10626. }
  10627. if (isNumber(maxRows)) {
  10628. let maxHeight = singleRowHeight * maxRows;
  10629. if (boxSizing === "border-box") {
  10630. maxHeight = maxHeight + paddingSize + borderSize;
  10631. }
  10632. height = Math.min(maxHeight, height);
  10633. }
  10634. result.height = `${height}px`;
  10635. (_a = hiddenTextarea.parentNode) == null ? void 0 : _a.removeChild(hiddenTextarea);
  10636. hiddenTextarea = void 0;
  10637. return result;
  10638. }
  10639. const inputProps = buildProps({
  10640. id: {
  10641. type: String,
  10642. default: void 0
  10643. },
  10644. size: useSizeProp,
  10645. disabled: Boolean,
  10646. modelValue: {
  10647. type: definePropType([
  10648. String,
  10649. Number,
  10650. Object
  10651. ]),
  10652. default: ""
  10653. },
  10654. type: {
  10655. type: String,
  10656. default: "text"
  10657. },
  10658. resize: {
  10659. type: String,
  10660. values: ["none", "both", "horizontal", "vertical"]
  10661. },
  10662. autosize: {
  10663. type: definePropType([Boolean, Object]),
  10664. default: false
  10665. },
  10666. autocomplete: {
  10667. type: String,
  10668. default: "off"
  10669. },
  10670. formatter: {
  10671. type: Function
  10672. },
  10673. parser: {
  10674. type: Function
  10675. },
  10676. placeholder: {
  10677. type: String
  10678. },
  10679. form: {
  10680. type: String
  10681. },
  10682. readonly: {
  10683. type: Boolean,
  10684. default: false
  10685. },
  10686. clearable: {
  10687. type: Boolean,
  10688. default: false
  10689. },
  10690. showPassword: {
  10691. type: Boolean,
  10692. default: false
  10693. },
  10694. showWordLimit: {
  10695. type: Boolean,
  10696. default: false
  10697. },
  10698. suffixIcon: {
  10699. type: iconPropType
  10700. },
  10701. prefixIcon: {
  10702. type: iconPropType
  10703. },
  10704. containerRole: {
  10705. type: String,
  10706. default: void 0
  10707. },
  10708. label: {
  10709. type: String,
  10710. default: void 0
  10711. },
  10712. tabindex: {
  10713. type: [String, Number],
  10714. default: 0
  10715. },
  10716. validateEvent: {
  10717. type: Boolean,
  10718. default: true
  10719. },
  10720. inputStyle: {
  10721. type: definePropType([Object, Array, String]),
  10722. default: () => mutable({})
  10723. }
  10724. });
  10725. const inputEmits = {
  10726. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  10727. input: (value) => isString(value),
  10728. change: (value) => isString(value),
  10729. focus: (evt) => evt instanceof FocusEvent,
  10730. blur: (evt) => evt instanceof FocusEvent,
  10731. clear: () => true,
  10732. mouseleave: (evt) => evt instanceof MouseEvent,
  10733. mouseenter: (evt) => evt instanceof MouseEvent,
  10734. keydown: (evt) => evt instanceof Event,
  10735. compositionstart: (evt) => evt instanceof CompositionEvent,
  10736. compositionupdate: (evt) => evt instanceof CompositionEvent,
  10737. compositionend: (evt) => evt instanceof CompositionEvent
  10738. };
  10739. const _hoisted_1$13 = ["role"];
  10740. const _hoisted_2$G = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"];
  10741. const _hoisted_3$k = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"];
  10742. const __default__$1v = vue.defineComponent({
  10743. name: "ElInput",
  10744. inheritAttrs: false
  10745. });
  10746. const _sfc_main$2e = /* @__PURE__ */ vue.defineComponent({
  10747. ...__default__$1v,
  10748. props: inputProps,
  10749. emits: inputEmits,
  10750. setup(__props, { expose, emit }) {
  10751. const props = __props;
  10752. const rawAttrs = vue.useAttrs();
  10753. const slots = vue.useSlots();
  10754. const containerAttrs = vue.computed(() => {
  10755. const comboBoxAttrs = {};
  10756. if (props.containerRole === "combobox") {
  10757. comboBoxAttrs["aria-haspopup"] = rawAttrs["aria-haspopup"];
  10758. comboBoxAttrs["aria-owns"] = rawAttrs["aria-owns"];
  10759. comboBoxAttrs["aria-expanded"] = rawAttrs["aria-expanded"];
  10760. }
  10761. return comboBoxAttrs;
  10762. });
  10763. const containerKls = vue.computed(() => [
  10764. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  10765. nsInput.m(inputSize.value),
  10766. nsInput.is("disabled", inputDisabled.value),
  10767. nsInput.is("exceed", inputExceed.value),
  10768. {
  10769. [nsInput.b("group")]: slots.prepend || slots.append,
  10770. [nsInput.bm("group", "append")]: slots.append,
  10771. [nsInput.bm("group", "prepend")]: slots.prepend,
  10772. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  10773. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  10774. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value
  10775. },
  10776. rawAttrs.class
  10777. ]);
  10778. const wrapperKls = vue.computed(() => [
  10779. nsInput.e("wrapper"),
  10780. nsInput.is("focus", focused.value)
  10781. ]);
  10782. const attrs = useAttrs({
  10783. excludeKeys: vue.computed(() => {
  10784. return Object.keys(containerAttrs.value);
  10785. })
  10786. });
  10787. const { form, formItem } = useFormItem();
  10788. const { inputId } = useFormItemInputId(props, {
  10789. formItemContext: formItem
  10790. });
  10791. const inputSize = useSize();
  10792. const inputDisabled = useDisabled();
  10793. const nsInput = useNamespace("input");
  10794. const nsTextarea = useNamespace("textarea");
  10795. const input = vue.shallowRef();
  10796. const textarea = vue.shallowRef();
  10797. const focused = vue.ref(false);
  10798. const hovering = vue.ref(false);
  10799. const isComposing = vue.ref(false);
  10800. const passwordVisible = vue.ref(false);
  10801. const countStyle = vue.ref();
  10802. const textareaCalcStyle = vue.shallowRef(props.inputStyle);
  10803. const _ref = vue.computed(() => input.value || textarea.value);
  10804. const needStatusIcon = vue.computed(() => {
  10805. var _a;
  10806. return (_a = form == null ? void 0 : form.statusIcon) != null ? _a : false;
  10807. });
  10808. const validateState = vue.computed(() => (formItem == null ? void 0 : formItem.validateState) || "");
  10809. const validateIcon = vue.computed(() => validateState.value && ValidateComponentsMap[validateState.value]);
  10810. const passwordIcon = vue.computed(() => passwordVisible.value ? view_default : hide_default);
  10811. const containerStyle = vue.computed(() => [
  10812. rawAttrs.style,
  10813. props.inputStyle
  10814. ]);
  10815. const textareaStyle = vue.computed(() => [
  10816. props.inputStyle,
  10817. textareaCalcStyle.value,
  10818. { resize: props.resize }
  10819. ]);
  10820. const nativeInputValue = vue.computed(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  10821. const showClear = vue.computed(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (focused.value || hovering.value));
  10822. const showPwdVisible = vue.computed(() => props.showPassword && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (!!nativeInputValue.value || focused.value));
  10823. const isWordLimitVisible = vue.computed(() => props.showWordLimit && !!attrs.value.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  10824. const textLength = vue.computed(() => Array.from(nativeInputValue.value).length);
  10825. const inputExceed = vue.computed(() => !!isWordLimitVisible.value && textLength.value > Number(attrs.value.maxlength));
  10826. const suffixVisible = vue.computed(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  10827. const [recordCursor, setCursor] = useCursor(input);
  10828. useResizeObserver(textarea, (entries) => {
  10829. if (!isWordLimitVisible.value || props.resize !== "both")
  10830. return;
  10831. const entry = entries[0];
  10832. const { width } = entry.contentRect;
  10833. countStyle.value = {
  10834. right: `calc(100% - ${width + 15 + 6}px)`
  10835. };
  10836. });
  10837. const resizeTextarea = () => {
  10838. const { type, autosize } = props;
  10839. if (!isClient || type !== "textarea")
  10840. return;
  10841. if (autosize) {
  10842. const minRows = isObject$1(autosize) ? autosize.minRows : void 0;
  10843. const maxRows = isObject$1(autosize) ? autosize.maxRows : void 0;
  10844. textareaCalcStyle.value = {
  10845. ...calcTextareaHeight(textarea.value, minRows, maxRows)
  10846. };
  10847. } else {
  10848. textareaCalcStyle.value = {
  10849. minHeight: calcTextareaHeight(textarea.value).minHeight
  10850. };
  10851. }
  10852. };
  10853. const setNativeInputValue = () => {
  10854. const input2 = _ref.value;
  10855. if (!input2 || input2.value === nativeInputValue.value)
  10856. return;
  10857. input2.value = nativeInputValue.value;
  10858. };
  10859. const handleInput = async (event) => {
  10860. recordCursor();
  10861. let { value } = event.target;
  10862. if (props.formatter) {
  10863. value = props.parser ? props.parser(value) : value;
  10864. value = props.formatter(value);
  10865. }
  10866. if (isComposing.value)
  10867. return;
  10868. if (value === nativeInputValue.value) {
  10869. setNativeInputValue();
  10870. return;
  10871. }
  10872. emit(UPDATE_MODEL_EVENT, value);
  10873. emit("input", value);
  10874. await vue.nextTick();
  10875. setNativeInputValue();
  10876. setCursor();
  10877. };
  10878. const handleChange = (event) => {
  10879. emit("change", event.target.value);
  10880. };
  10881. const handleCompositionStart = (event) => {
  10882. emit("compositionstart", event);
  10883. isComposing.value = true;
  10884. };
  10885. const handleCompositionUpdate = (event) => {
  10886. var _a;
  10887. emit("compositionupdate", event);
  10888. const text = (_a = event.target) == null ? void 0 : _a.value;
  10889. const lastCharacter = text[text.length - 1] || "";
  10890. isComposing.value = !isKorean(lastCharacter);
  10891. };
  10892. const handleCompositionEnd = (event) => {
  10893. emit("compositionend", event);
  10894. if (isComposing.value) {
  10895. isComposing.value = false;
  10896. handleInput(event);
  10897. }
  10898. };
  10899. const handlePasswordVisible = () => {
  10900. passwordVisible.value = !passwordVisible.value;
  10901. focus();
  10902. };
  10903. const focus = async () => {
  10904. var _a;
  10905. await vue.nextTick();
  10906. (_a = _ref.value) == null ? void 0 : _a.focus();
  10907. };
  10908. const blur = () => {
  10909. var _a;
  10910. return (_a = _ref.value) == null ? void 0 : _a.blur();
  10911. };
  10912. const handleFocus = (event) => {
  10913. focused.value = true;
  10914. emit("focus", event);
  10915. };
  10916. const handleBlur = (event) => {
  10917. var _a;
  10918. focused.value = false;
  10919. emit("blur", event);
  10920. if (props.validateEvent) {
  10921. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn());
  10922. }
  10923. };
  10924. const handleMouseLeave = (evt) => {
  10925. hovering.value = false;
  10926. emit("mouseleave", evt);
  10927. };
  10928. const handleMouseEnter = (evt) => {
  10929. hovering.value = true;
  10930. emit("mouseenter", evt);
  10931. };
  10932. const handleKeydown = (evt) => {
  10933. emit("keydown", evt);
  10934. };
  10935. const select = () => {
  10936. var _a;
  10937. (_a = _ref.value) == null ? void 0 : _a.select();
  10938. };
  10939. const clear = () => {
  10940. emit(UPDATE_MODEL_EVENT, "");
  10941. emit("change", "");
  10942. emit("clear");
  10943. emit("input", "");
  10944. };
  10945. vue.watch(() => props.modelValue, () => {
  10946. var _a;
  10947. vue.nextTick(() => resizeTextarea());
  10948. if (props.validateEvent) {
  10949. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn());
  10950. }
  10951. });
  10952. vue.watch(nativeInputValue, () => setNativeInputValue());
  10953. vue.watch(() => props.type, async () => {
  10954. await vue.nextTick();
  10955. setNativeInputValue();
  10956. resizeTextarea();
  10957. });
  10958. vue.onMounted(() => {
  10959. if (!props.formatter && props.parser) ;
  10960. setNativeInputValue();
  10961. vue.nextTick(resizeTextarea);
  10962. });
  10963. expose({
  10964. input,
  10965. textarea,
  10966. ref: _ref,
  10967. textareaStyle,
  10968. autosize: vue.toRef(props, "autosize"),
  10969. focus,
  10970. blur,
  10971. select,
  10972. clear,
  10973. resizeTextarea
  10974. });
  10975. return (_ctx, _cache) => {
  10976. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", vue.mergeProps(vue.unref(containerAttrs), {
  10977. class: vue.unref(containerKls),
  10978. style: vue.unref(containerStyle),
  10979. role: _ctx.containerRole,
  10980. onMouseenter: handleMouseEnter,
  10981. onMouseleave: handleMouseLeave
  10982. }), [
  10983. vue.createCommentVNode(" input "),
  10984. _ctx.type !== "textarea" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  10985. vue.createCommentVNode(" prepend slot "),
  10986. _ctx.$slots.prepend ? (vue.openBlock(), vue.createElementBlock("div", {
  10987. key: 0,
  10988. class: vue.normalizeClass(vue.unref(nsInput).be("group", "prepend"))
  10989. }, [
  10990. vue.renderSlot(_ctx.$slots, "prepend")
  10991. ], 2)) : vue.createCommentVNode("v-if", true),
  10992. vue.createElementVNode("div", {
  10993. class: vue.normalizeClass(vue.unref(wrapperKls))
  10994. }, [
  10995. vue.createCommentVNode(" prefix slot "),
  10996. _ctx.$slots.prefix || _ctx.prefixIcon ? (vue.openBlock(), vue.createElementBlock("span", {
  10997. key: 0,
  10998. class: vue.normalizeClass(vue.unref(nsInput).e("prefix"))
  10999. }, [
  11000. vue.createElementVNode("span", {
  11001. class: vue.normalizeClass(vue.unref(nsInput).e("prefix-inner")),
  11002. onClick: focus
  11003. }, [
  11004. vue.renderSlot(_ctx.$slots, "prefix"),
  11005. _ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  11006. key: 0,
  11007. class: vue.normalizeClass(vue.unref(nsInput).e("icon"))
  11008. }, {
  11009. default: vue.withCtx(() => [
  11010. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prefixIcon)))
  11011. ]),
  11012. _: 1
  11013. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  11014. ], 2)
  11015. ], 2)) : vue.createCommentVNode("v-if", true),
  11016. vue.createElementVNode("input", vue.mergeProps({
  11017. id: vue.unref(inputId),
  11018. ref_key: "input",
  11019. ref: input,
  11020. class: vue.unref(nsInput).e("inner")
  11021. }, vue.unref(attrs), {
  11022. type: _ctx.showPassword ? passwordVisible.value ? "text" : "password" : _ctx.type,
  11023. disabled: vue.unref(inputDisabled),
  11024. formatter: _ctx.formatter,
  11025. parser: _ctx.parser,
  11026. readonly: _ctx.readonly,
  11027. autocomplete: _ctx.autocomplete,
  11028. tabindex: _ctx.tabindex,
  11029. "aria-label": _ctx.label,
  11030. placeholder: _ctx.placeholder,
  11031. style: _ctx.inputStyle,
  11032. form: props.form,
  11033. onCompositionstart: handleCompositionStart,
  11034. onCompositionupdate: handleCompositionUpdate,
  11035. onCompositionend: handleCompositionEnd,
  11036. onInput: handleInput,
  11037. onFocus: handleFocus,
  11038. onBlur: handleBlur,
  11039. onChange: handleChange,
  11040. onKeydown: handleKeydown
  11041. }), null, 16, _hoisted_2$G),
  11042. vue.createCommentVNode(" suffix slot "),
  11043. vue.unref(suffixVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
  11044. key: 1,
  11045. class: vue.normalizeClass(vue.unref(nsInput).e("suffix"))
  11046. }, [
  11047. vue.createElementVNode("span", {
  11048. class: vue.normalizeClass(vue.unref(nsInput).e("suffix-inner")),
  11049. onClick: focus
  11050. }, [
  11051. !vue.unref(showClear) || !vue.unref(showPwdVisible) || !vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  11052. vue.renderSlot(_ctx.$slots, "suffix"),
  11053. _ctx.suffixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  11054. key: 0,
  11055. class: vue.normalizeClass(vue.unref(nsInput).e("icon"))
  11056. }, {
  11057. default: vue.withCtx(() => [
  11058. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.suffixIcon)))
  11059. ]),
  11060. _: 1
  11061. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  11062. ], 64)) : vue.createCommentVNode("v-if", true),
  11063. vue.unref(showClear) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  11064. key: 1,
  11065. class: vue.normalizeClass([vue.unref(nsInput).e("icon"), vue.unref(nsInput).e("clear")]),
  11066. onMousedown: vue.withModifiers(vue.unref(NOOP), ["prevent"]),
  11067. onClick: clear
  11068. }, {
  11069. default: vue.withCtx(() => [
  11070. vue.createVNode(vue.unref(circle_close_default))
  11071. ]),
  11072. _: 1
  11073. }, 8, ["class", "onMousedown"])) : vue.createCommentVNode("v-if", true),
  11074. vue.unref(showPwdVisible) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  11075. key: 2,
  11076. class: vue.normalizeClass([vue.unref(nsInput).e("icon"), vue.unref(nsInput).e("password")]),
  11077. onClick: handlePasswordVisible
  11078. }, {
  11079. default: vue.withCtx(() => [
  11080. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(passwordIcon))))
  11081. ]),
  11082. _: 1
  11083. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  11084. vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
  11085. key: 3,
  11086. class: vue.normalizeClass(vue.unref(nsInput).e("count"))
  11087. }, [
  11088. vue.createElementVNode("span", {
  11089. class: vue.normalizeClass(vue.unref(nsInput).e("count-inner"))
  11090. }, vue.toDisplayString(vue.unref(textLength)) + " / " + vue.toDisplayString(vue.unref(attrs).maxlength), 3)
  11091. ], 2)) : vue.createCommentVNode("v-if", true),
  11092. vue.unref(validateState) && vue.unref(validateIcon) && vue.unref(needStatusIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  11093. key: 4,
  11094. class: vue.normalizeClass([
  11095. vue.unref(nsInput).e("icon"),
  11096. vue.unref(nsInput).e("validateIcon"),
  11097. vue.unref(nsInput).is("loading", vue.unref(validateState) === "validating")
  11098. ])
  11099. }, {
  11100. default: vue.withCtx(() => [
  11101. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(validateIcon))))
  11102. ]),
  11103. _: 1
  11104. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  11105. ], 2)
  11106. ], 2)) : vue.createCommentVNode("v-if", true)
  11107. ], 2),
  11108. vue.createCommentVNode(" append slot "),
  11109. _ctx.$slots.append ? (vue.openBlock(), vue.createElementBlock("div", {
  11110. key: 1,
  11111. class: vue.normalizeClass(vue.unref(nsInput).be("group", "append"))
  11112. }, [
  11113. vue.renderSlot(_ctx.$slots, "append")
  11114. ], 2)) : vue.createCommentVNode("v-if", true)
  11115. ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  11116. vue.createCommentVNode(" textarea "),
  11117. vue.createElementVNode("textarea", vue.mergeProps({
  11118. id: vue.unref(inputId),
  11119. ref_key: "textarea",
  11120. ref: textarea,
  11121. class: vue.unref(nsTextarea).e("inner")
  11122. }, vue.unref(attrs), {
  11123. tabindex: _ctx.tabindex,
  11124. disabled: vue.unref(inputDisabled),
  11125. readonly: _ctx.readonly,
  11126. autocomplete: _ctx.autocomplete,
  11127. style: vue.unref(textareaStyle),
  11128. "aria-label": _ctx.label,
  11129. placeholder: _ctx.placeholder,
  11130. form: props.form,
  11131. onCompositionstart: handleCompositionStart,
  11132. onCompositionupdate: handleCompositionUpdate,
  11133. onCompositionend: handleCompositionEnd,
  11134. onInput: handleInput,
  11135. onFocus: handleFocus,
  11136. onBlur: handleBlur,
  11137. onChange: handleChange,
  11138. onKeydown: handleKeydown
  11139. }), null, 16, _hoisted_3$k),
  11140. vue.unref(isWordLimitVisible) ? (vue.openBlock(), vue.createElementBlock("span", {
  11141. key: 0,
  11142. style: vue.normalizeStyle(countStyle.value),
  11143. class: vue.normalizeClass(vue.unref(nsInput).e("count"))
  11144. }, vue.toDisplayString(vue.unref(textLength)) + " / " + vue.toDisplayString(vue.unref(attrs).maxlength), 7)) : vue.createCommentVNode("v-if", true)
  11145. ], 64))
  11146. ], 16, _hoisted_1$13)), [
  11147. [vue.vShow, _ctx.type !== "hidden"]
  11148. ]);
  11149. };
  11150. }
  11151. });
  11152. var Input = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["__file", "input.vue"]]);
  11153. const ElInput = withInstall(Input);
  11154. const GAP = 4;
  11155. const BAR_MAP = {
  11156. vertical: {
  11157. offset: "offsetHeight",
  11158. scroll: "scrollTop",
  11159. scrollSize: "scrollHeight",
  11160. size: "height",
  11161. key: "vertical",
  11162. axis: "Y",
  11163. client: "clientY",
  11164. direction: "top"
  11165. },
  11166. horizontal: {
  11167. offset: "offsetWidth",
  11168. scroll: "scrollLeft",
  11169. scrollSize: "scrollWidth",
  11170. size: "width",
  11171. key: "horizontal",
  11172. axis: "X",
  11173. client: "clientX",
  11174. direction: "left"
  11175. }
  11176. };
  11177. const renderThumbStyle$1 = ({
  11178. move,
  11179. size,
  11180. bar
  11181. }) => ({
  11182. [bar.size]: size,
  11183. transform: `translate${bar.axis}(${move}%)`
  11184. });
  11185. const thumbProps = buildProps({
  11186. vertical: Boolean,
  11187. size: String,
  11188. move: Number,
  11189. ratio: {
  11190. type: Number,
  11191. required: true
  11192. },
  11193. always: Boolean
  11194. });
  11195. const COMPONENT_NAME$l = "Thumb";
  11196. const _sfc_main$2d = /* @__PURE__ */ vue.defineComponent({
  11197. __name: "thumb",
  11198. props: thumbProps,
  11199. setup(__props) {
  11200. const props = __props;
  11201. const scrollbar = vue.inject(scrollbarContextKey);
  11202. const ns = useNamespace("scrollbar");
  11203. if (!scrollbar)
  11204. throwError(COMPONENT_NAME$l, "can not inject scrollbar context");
  11205. const instance = vue.ref();
  11206. const thumb = vue.ref();
  11207. const thumbState = vue.ref({});
  11208. const visible = vue.ref(false);
  11209. let cursorDown = false;
  11210. let cursorLeave = false;
  11211. let originalOnSelectStart = isClient ? document.onselectstart : null;
  11212. const bar = vue.computed(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  11213. const thumbStyle = vue.computed(() => renderThumbStyle$1({
  11214. size: props.size,
  11215. move: props.move,
  11216. bar: bar.value
  11217. }));
  11218. const offsetRatio = vue.computed(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  11219. const clickThumbHandler = (e) => {
  11220. var _a;
  11221. e.stopPropagation();
  11222. if (e.ctrlKey || [1, 2].includes(e.button))
  11223. return;
  11224. (_a = window.getSelection()) == null ? void 0 : _a.removeAllRanges();
  11225. startDrag(e);
  11226. const el = e.currentTarget;
  11227. if (!el)
  11228. return;
  11229. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  11230. };
  11231. const clickTrackHandler = (e) => {
  11232. if (!thumb.value || !instance.value || !scrollbar.wrapElement)
  11233. return;
  11234. const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
  11235. const thumbHalf = thumb.value[bar.value.offset] / 2;
  11236. const thumbPositionPercentage = (offset - thumbHalf) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  11237. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  11238. };
  11239. const startDrag = (e) => {
  11240. e.stopImmediatePropagation();
  11241. cursorDown = true;
  11242. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  11243. document.addEventListener("mouseup", mouseUpDocumentHandler);
  11244. originalOnSelectStart = document.onselectstart;
  11245. document.onselectstart = () => false;
  11246. };
  11247. const mouseMoveDocumentHandler = (e) => {
  11248. if (!instance.value || !thumb.value)
  11249. return;
  11250. if (cursorDown === false)
  11251. return;
  11252. const prevPage = thumbState.value[bar.value.axis];
  11253. if (!prevPage)
  11254. return;
  11255. const offset = (instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
  11256. const thumbClickPosition = thumb.value[bar.value.offset] - prevPage;
  11257. const thumbPositionPercentage = (offset - thumbClickPosition) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  11258. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  11259. };
  11260. const mouseUpDocumentHandler = () => {
  11261. cursorDown = false;
  11262. thumbState.value[bar.value.axis] = 0;
  11263. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  11264. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  11265. restoreOnselectstart();
  11266. if (cursorLeave)
  11267. visible.value = false;
  11268. };
  11269. const mouseMoveScrollbarHandler = () => {
  11270. cursorLeave = false;
  11271. visible.value = !!props.size;
  11272. };
  11273. const mouseLeaveScrollbarHandler = () => {
  11274. cursorLeave = true;
  11275. visible.value = cursorDown;
  11276. };
  11277. vue.onBeforeUnmount(() => {
  11278. restoreOnselectstart();
  11279. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  11280. });
  11281. const restoreOnselectstart = () => {
  11282. if (document.onselectstart !== originalOnSelectStart)
  11283. document.onselectstart = originalOnSelectStart;
  11284. };
  11285. useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  11286. useEventListener(vue.toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  11287. return (_ctx, _cache) => {
  11288. return vue.openBlock(), vue.createBlock(vue.Transition, {
  11289. name: vue.unref(ns).b("fade"),
  11290. persisted: ""
  11291. }, {
  11292. default: vue.withCtx(() => [
  11293. vue.withDirectives(vue.createElementVNode("div", {
  11294. ref_key: "instance",
  11295. ref: instance,
  11296. class: vue.normalizeClass([vue.unref(ns).e("bar"), vue.unref(ns).is(vue.unref(bar).key)]),
  11297. onMousedown: clickTrackHandler
  11298. }, [
  11299. vue.createElementVNode("div", {
  11300. ref_key: "thumb",
  11301. ref: thumb,
  11302. class: vue.normalizeClass(vue.unref(ns).e("thumb")),
  11303. style: vue.normalizeStyle(vue.unref(thumbStyle)),
  11304. onMousedown: clickThumbHandler
  11305. }, null, 38)
  11306. ], 34), [
  11307. [vue.vShow, _ctx.always || visible.value]
  11308. ])
  11309. ]),
  11310. _: 1
  11311. }, 8, ["name"]);
  11312. };
  11313. }
  11314. });
  11315. var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main$2d, [["__file", "thumb.vue"]]);
  11316. const barProps = buildProps({
  11317. always: {
  11318. type: Boolean,
  11319. default: true
  11320. },
  11321. width: String,
  11322. height: String,
  11323. ratioX: {
  11324. type: Number,
  11325. default: 1
  11326. },
  11327. ratioY: {
  11328. type: Number,
  11329. default: 1
  11330. }
  11331. });
  11332. const _sfc_main$2c = /* @__PURE__ */ vue.defineComponent({
  11333. __name: "bar",
  11334. props: barProps,
  11335. setup(__props, { expose }) {
  11336. const props = __props;
  11337. const moveX = vue.ref(0);
  11338. const moveY = vue.ref(0);
  11339. const handleScroll = (wrap) => {
  11340. if (wrap) {
  11341. const offsetHeight = wrap.offsetHeight - GAP;
  11342. const offsetWidth = wrap.offsetWidth - GAP;
  11343. moveY.value = wrap.scrollTop * 100 / offsetHeight * props.ratioY;
  11344. moveX.value = wrap.scrollLeft * 100 / offsetWidth * props.ratioX;
  11345. }
  11346. };
  11347. expose({
  11348. handleScroll
  11349. });
  11350. return (_ctx, _cache) => {
  11351. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  11352. vue.createVNode(Thumb, {
  11353. move: moveX.value,
  11354. ratio: _ctx.ratioX,
  11355. size: _ctx.width,
  11356. always: _ctx.always
  11357. }, null, 8, ["move", "ratio", "size", "always"]),
  11358. vue.createVNode(Thumb, {
  11359. move: moveY.value,
  11360. ratio: _ctx.ratioY,
  11361. size: _ctx.height,
  11362. vertical: "",
  11363. always: _ctx.always
  11364. }, null, 8, ["move", "ratio", "size", "always"])
  11365. ], 64);
  11366. };
  11367. }
  11368. });
  11369. var Bar = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["__file", "bar.vue"]]);
  11370. const scrollbarProps = buildProps({
  11371. height: {
  11372. type: [String, Number],
  11373. default: ""
  11374. },
  11375. maxHeight: {
  11376. type: [String, Number],
  11377. default: ""
  11378. },
  11379. native: {
  11380. type: Boolean,
  11381. default: false
  11382. },
  11383. wrapStyle: {
  11384. type: definePropType([String, Object, Array]),
  11385. default: ""
  11386. },
  11387. wrapClass: {
  11388. type: [String, Array],
  11389. default: ""
  11390. },
  11391. viewClass: {
  11392. type: [String, Array],
  11393. default: ""
  11394. },
  11395. viewStyle: {
  11396. type: [String, Array, Object],
  11397. default: ""
  11398. },
  11399. noresize: Boolean,
  11400. tag: {
  11401. type: String,
  11402. default: "div"
  11403. },
  11404. always: Boolean,
  11405. minSize: {
  11406. type: Number,
  11407. default: 20
  11408. }
  11409. });
  11410. const scrollbarEmits = {
  11411. scroll: ({
  11412. scrollTop,
  11413. scrollLeft
  11414. }) => [scrollTop, scrollLeft].every(isNumber)
  11415. };
  11416. const COMPONENT_NAME$k = "ElScrollbar";
  11417. const __default__$1u = vue.defineComponent({
  11418. name: COMPONENT_NAME$k
  11419. });
  11420. const _sfc_main$2b = /* @__PURE__ */ vue.defineComponent({
  11421. ...__default__$1u,
  11422. props: scrollbarProps,
  11423. emits: scrollbarEmits,
  11424. setup(__props, { expose, emit }) {
  11425. const props = __props;
  11426. const ns = useNamespace("scrollbar");
  11427. let stopResizeObserver = void 0;
  11428. let stopResizeListener = void 0;
  11429. const scrollbarRef = vue.ref();
  11430. const wrapRef = vue.ref();
  11431. const resizeRef = vue.ref();
  11432. const sizeWidth = vue.ref("0");
  11433. const sizeHeight = vue.ref("0");
  11434. const barRef = vue.ref();
  11435. const ratioY = vue.ref(1);
  11436. const ratioX = vue.ref(1);
  11437. const style = vue.computed(() => {
  11438. const style2 = {};
  11439. if (props.height)
  11440. style2.height = addUnit(props.height);
  11441. if (props.maxHeight)
  11442. style2.maxHeight = addUnit(props.maxHeight);
  11443. return [props.wrapStyle, style2];
  11444. });
  11445. const wrapKls = vue.computed(() => {
  11446. return [
  11447. props.wrapClass,
  11448. ns.e("wrap"),
  11449. { [ns.em("wrap", "hidden-default")]: !props.native }
  11450. ];
  11451. });
  11452. const resizeKls = vue.computed(() => {
  11453. return [ns.e("view"), props.viewClass];
  11454. });
  11455. const handleScroll = () => {
  11456. var _a;
  11457. if (wrapRef.value) {
  11458. (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
  11459. emit("scroll", {
  11460. scrollTop: wrapRef.value.scrollTop,
  11461. scrollLeft: wrapRef.value.scrollLeft
  11462. });
  11463. }
  11464. };
  11465. function scrollTo(arg1, arg2) {
  11466. if (isObject$1(arg1)) {
  11467. wrapRef.value.scrollTo(arg1);
  11468. } else if (isNumber(arg1) && isNumber(arg2)) {
  11469. wrapRef.value.scrollTo(arg1, arg2);
  11470. }
  11471. }
  11472. const setScrollTop = (value) => {
  11473. if (!isNumber(value)) {
  11474. return;
  11475. }
  11476. wrapRef.value.scrollTop = value;
  11477. };
  11478. const setScrollLeft = (value) => {
  11479. if (!isNumber(value)) {
  11480. return;
  11481. }
  11482. wrapRef.value.scrollLeft = value;
  11483. };
  11484. const update = () => {
  11485. if (!wrapRef.value)
  11486. return;
  11487. const offsetHeight = wrapRef.value.offsetHeight - GAP;
  11488. const offsetWidth = wrapRef.value.offsetWidth - GAP;
  11489. const originalHeight = offsetHeight ** 2 / wrapRef.value.scrollHeight;
  11490. const originalWidth = offsetWidth ** 2 / wrapRef.value.scrollWidth;
  11491. const height = Math.max(originalHeight, props.minSize);
  11492. const width = Math.max(originalWidth, props.minSize);
  11493. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
  11494. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
  11495. sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
  11496. sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
  11497. };
  11498. vue.watch(() => props.noresize, (noresize) => {
  11499. if (noresize) {
  11500. stopResizeObserver == null ? void 0 : stopResizeObserver();
  11501. stopResizeListener == null ? void 0 : stopResizeListener();
  11502. } else {
  11503. ({ stop: stopResizeObserver } = useResizeObserver(resizeRef, update));
  11504. stopResizeListener = useEventListener("resize", update);
  11505. }
  11506. }, { immediate: true });
  11507. vue.watch(() => [props.maxHeight, props.height], () => {
  11508. if (!props.native)
  11509. vue.nextTick(() => {
  11510. var _a;
  11511. update();
  11512. if (wrapRef.value) {
  11513. (_a = barRef.value) == null ? void 0 : _a.handleScroll(wrapRef.value);
  11514. }
  11515. });
  11516. });
  11517. vue.provide(scrollbarContextKey, vue.reactive({
  11518. scrollbarElement: scrollbarRef,
  11519. wrapElement: wrapRef
  11520. }));
  11521. vue.onMounted(() => {
  11522. if (!props.native)
  11523. vue.nextTick(() => {
  11524. update();
  11525. });
  11526. });
  11527. vue.onUpdated(() => update());
  11528. expose({
  11529. wrapRef,
  11530. update,
  11531. scrollTo,
  11532. setScrollTop,
  11533. setScrollLeft,
  11534. handleScroll
  11535. });
  11536. return (_ctx, _cache) => {
  11537. return vue.openBlock(), vue.createElementBlock("div", {
  11538. ref_key: "scrollbarRef",
  11539. ref: scrollbarRef,
  11540. class: vue.normalizeClass(vue.unref(ns).b())
  11541. }, [
  11542. vue.createElementVNode("div", {
  11543. ref_key: "wrapRef",
  11544. ref: wrapRef,
  11545. class: vue.normalizeClass(vue.unref(wrapKls)),
  11546. style: vue.normalizeStyle(vue.unref(style)),
  11547. onScroll: handleScroll
  11548. }, [
  11549. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
  11550. ref_key: "resizeRef",
  11551. ref: resizeRef,
  11552. class: vue.normalizeClass(vue.unref(resizeKls)),
  11553. style: vue.normalizeStyle(_ctx.viewStyle)
  11554. }, {
  11555. default: vue.withCtx(() => [
  11556. vue.renderSlot(_ctx.$slots, "default")
  11557. ]),
  11558. _: 3
  11559. }, 8, ["class", "style"]))
  11560. ], 38),
  11561. !_ctx.native ? (vue.openBlock(), vue.createBlock(Bar, {
  11562. key: 0,
  11563. ref_key: "barRef",
  11564. ref: barRef,
  11565. height: sizeHeight.value,
  11566. width: sizeWidth.value,
  11567. always: _ctx.always,
  11568. "ratio-x": ratioX.value,
  11569. "ratio-y": ratioY.value
  11570. }, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : vue.createCommentVNode("v-if", true)
  11571. ], 2);
  11572. };
  11573. }
  11574. });
  11575. var Scrollbar$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["__file", "scrollbar.vue"]]);
  11576. const ElScrollbar = withInstall(Scrollbar$1);
  11577. const Effect = {
  11578. LIGHT: "light",
  11579. DARK: "dark"
  11580. };
  11581. const roleTypes = [
  11582. "dialog",
  11583. "grid",
  11584. "group",
  11585. "listbox",
  11586. "menu",
  11587. "navigation",
  11588. "tooltip",
  11589. "tree"
  11590. ];
  11591. const popperProps = buildProps({
  11592. role: {
  11593. type: String,
  11594. values: roleTypes,
  11595. default: "tooltip"
  11596. }
  11597. });
  11598. const usePopperProps = popperProps;
  11599. const __default__$1t = vue.defineComponent({
  11600. name: "ElPopperRoot",
  11601. inheritAttrs: false
  11602. });
  11603. const _sfc_main$2a = /* @__PURE__ */ vue.defineComponent({
  11604. ...__default__$1t,
  11605. props: popperProps,
  11606. setup(__props, { expose }) {
  11607. const props = __props;
  11608. const triggerRef = vue.ref();
  11609. const popperInstanceRef = vue.ref();
  11610. const contentRef = vue.ref();
  11611. const referenceRef = vue.ref();
  11612. const role = vue.computed(() => props.role);
  11613. const popperProvides = {
  11614. triggerRef,
  11615. popperInstanceRef,
  11616. contentRef,
  11617. referenceRef,
  11618. role
  11619. };
  11620. expose(popperProvides);
  11621. vue.provide(POPPER_INJECTION_KEY, popperProvides);
  11622. return (_ctx, _cache) => {
  11623. return vue.renderSlot(_ctx.$slots, "default");
  11624. };
  11625. }
  11626. });
  11627. var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$2a, [["__file", "popper.vue"]]);
  11628. const popperArrowProps = buildProps({
  11629. arrowOffset: {
  11630. type: Number,
  11631. default: 5
  11632. }
  11633. });
  11634. const usePopperArrowProps = popperArrowProps;
  11635. const __default__$1s = vue.defineComponent({
  11636. name: "ElPopperArrow",
  11637. inheritAttrs: false
  11638. });
  11639. const _sfc_main$29 = /* @__PURE__ */ vue.defineComponent({
  11640. ...__default__$1s,
  11641. props: popperArrowProps,
  11642. setup(__props, { expose }) {
  11643. const props = __props;
  11644. const ns = useNamespace("popper");
  11645. const { arrowOffset, arrowRef } = vue.inject(POPPER_CONTENT_INJECTION_KEY, void 0);
  11646. vue.watch(() => props.arrowOffset, (val) => {
  11647. arrowOffset.value = val;
  11648. });
  11649. vue.onBeforeUnmount(() => {
  11650. arrowRef.value = void 0;
  11651. });
  11652. expose({
  11653. arrowRef
  11654. });
  11655. return (_ctx, _cache) => {
  11656. return vue.openBlock(), vue.createElementBlock("span", {
  11657. ref_key: "arrowRef",
  11658. ref: arrowRef,
  11659. class: vue.normalizeClass(vue.unref(ns).e("arrow")),
  11660. "data-popper-arrow": ""
  11661. }, null, 2);
  11662. };
  11663. }
  11664. });
  11665. var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$29, [["__file", "arrow.vue"]]);
  11666. const NAME = "ElOnlyChild";
  11667. const OnlyChild = vue.defineComponent({
  11668. name: NAME,
  11669. setup(_, {
  11670. slots,
  11671. attrs
  11672. }) {
  11673. var _a;
  11674. const forwardRefInjection = vue.inject(FORWARD_REF_INJECTION_KEY);
  11675. const forwardRefDirective = useForwardRefDirective((_a = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a : NOOP);
  11676. return () => {
  11677. var _a2;
  11678. const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots, attrs);
  11679. if (!defaultSlot)
  11680. return null;
  11681. if (defaultSlot.length > 1) {
  11682. return null;
  11683. }
  11684. const firstLegitNode = findFirstLegitChild(defaultSlot);
  11685. if (!firstLegitNode) {
  11686. return null;
  11687. }
  11688. return vue.withDirectives(vue.cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
  11689. };
  11690. }
  11691. });
  11692. function findFirstLegitChild(node) {
  11693. if (!node)
  11694. return null;
  11695. const children = node;
  11696. for (const child of children) {
  11697. if (isObject$1(child)) {
  11698. switch (child.type) {
  11699. case vue.Comment:
  11700. continue;
  11701. case vue.Text:
  11702. case "svg":
  11703. return wrapTextContent(child);
  11704. case vue.Fragment:
  11705. return findFirstLegitChild(child.children);
  11706. default:
  11707. return child;
  11708. }
  11709. }
  11710. return wrapTextContent(child);
  11711. }
  11712. return null;
  11713. }
  11714. function wrapTextContent(s) {
  11715. const ns = useNamespace("only-child");
  11716. return vue.createVNode("span", {
  11717. "class": ns.e("content")
  11718. }, [s]);
  11719. }
  11720. const popperTriggerProps = buildProps({
  11721. virtualRef: {
  11722. type: definePropType(Object)
  11723. },
  11724. virtualTriggering: Boolean,
  11725. onMouseenter: {
  11726. type: definePropType(Function)
  11727. },
  11728. onMouseleave: {
  11729. type: definePropType(Function)
  11730. },
  11731. onClick: {
  11732. type: definePropType(Function)
  11733. },
  11734. onKeydown: {
  11735. type: definePropType(Function)
  11736. },
  11737. onFocus: {
  11738. type: definePropType(Function)
  11739. },
  11740. onBlur: {
  11741. type: definePropType(Function)
  11742. },
  11743. onContextmenu: {
  11744. type: definePropType(Function)
  11745. },
  11746. id: String,
  11747. open: Boolean
  11748. });
  11749. const usePopperTriggerProps = popperTriggerProps;
  11750. const __default__$1r = vue.defineComponent({
  11751. name: "ElPopperTrigger",
  11752. inheritAttrs: false
  11753. });
  11754. const _sfc_main$28 = /* @__PURE__ */ vue.defineComponent({
  11755. ...__default__$1r,
  11756. props: popperTriggerProps,
  11757. setup(__props, { expose }) {
  11758. const props = __props;
  11759. const { role, triggerRef } = vue.inject(POPPER_INJECTION_KEY, void 0);
  11760. useForwardRef(triggerRef);
  11761. const ariaControls = vue.computed(() => {
  11762. return ariaHaspopup.value ? props.id : void 0;
  11763. });
  11764. const ariaDescribedby = vue.computed(() => {
  11765. if (role && role.value === "tooltip") {
  11766. return props.open && props.id ? props.id : void 0;
  11767. }
  11768. return void 0;
  11769. });
  11770. const ariaHaspopup = vue.computed(() => {
  11771. if (role && role.value !== "tooltip") {
  11772. return role.value;
  11773. }
  11774. return void 0;
  11775. });
  11776. const ariaExpanded = vue.computed(() => {
  11777. return ariaHaspopup.value ? `${props.open}` : void 0;
  11778. });
  11779. let virtualTriggerAriaStopWatch = void 0;
  11780. vue.onMounted(() => {
  11781. vue.watch(() => props.virtualRef, (virtualEl) => {
  11782. if (virtualEl) {
  11783. triggerRef.value = unrefElement(virtualEl);
  11784. }
  11785. }, {
  11786. immediate: true
  11787. });
  11788. vue.watch(triggerRef, (el, prevEl) => {
  11789. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  11790. virtualTriggerAriaStopWatch = void 0;
  11791. if (isElement$1(el)) {
  11792. [
  11793. "onMouseenter",
  11794. "onMouseleave",
  11795. "onClick",
  11796. "onKeydown",
  11797. "onFocus",
  11798. "onBlur",
  11799. "onContextmenu"
  11800. ].forEach((eventName) => {
  11801. var _a;
  11802. const handler = props[eventName];
  11803. if (handler) {
  11804. el.addEventListener(eventName.slice(2).toLowerCase(), handler);
  11805. (_a = prevEl == null ? void 0 : prevEl.removeEventListener) == null ? void 0 : _a.call(prevEl, eventName.slice(2).toLowerCase(), handler);
  11806. }
  11807. });
  11808. virtualTriggerAriaStopWatch = vue.watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
  11809. [
  11810. "aria-controls",
  11811. "aria-describedby",
  11812. "aria-haspopup",
  11813. "aria-expanded"
  11814. ].forEach((key, idx) => {
  11815. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  11816. });
  11817. }, { immediate: true });
  11818. }
  11819. if (isElement$1(prevEl)) {
  11820. [
  11821. "aria-controls",
  11822. "aria-describedby",
  11823. "aria-haspopup",
  11824. "aria-expanded"
  11825. ].forEach((key) => prevEl.removeAttribute(key));
  11826. }
  11827. }, {
  11828. immediate: true
  11829. });
  11830. });
  11831. vue.onBeforeUnmount(() => {
  11832. virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
  11833. virtualTriggerAriaStopWatch = void 0;
  11834. });
  11835. expose({
  11836. triggerRef
  11837. });
  11838. return (_ctx, _cache) => {
  11839. return !_ctx.virtualTriggering ? (vue.openBlock(), vue.createBlock(vue.unref(OnlyChild), vue.mergeProps({ key: 0 }, _ctx.$attrs, {
  11840. "aria-controls": vue.unref(ariaControls),
  11841. "aria-describedby": vue.unref(ariaDescribedby),
  11842. "aria-expanded": vue.unref(ariaExpanded),
  11843. "aria-haspopup": vue.unref(ariaHaspopup)
  11844. }), {
  11845. default: vue.withCtx(() => [
  11846. vue.renderSlot(_ctx.$slots, "default")
  11847. ]),
  11848. _: 3
  11849. }, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : vue.createCommentVNode("v-if", true);
  11850. };
  11851. }
  11852. });
  11853. var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$28, [["__file", "trigger.vue"]]);
  11854. var E$1="top",R="bottom",W="right",P$1="left",me="auto",G=[E$1,R,W,P$1],U$1="start",J="end",Xe="clippingParents",je="viewport",K="popper",Ye="reference",De=G.reduce(function(t,e){return t.concat([e+"-"+U$1,e+"-"+J])},[]),Ee=[].concat(G,[me]).reduce(function(t,e){return t.concat([e,e+"-"+U$1,e+"-"+J])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",nt="write",rt="afterWrite",ot=[Ge,Je,Ke,Qe,Ze,et,tt,nt,rt];function C(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Q(t){var e=H(t).Element;return t instanceof e||t instanceof Element}function B(t){var e=H(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Pe(t){if(typeof ShadowRoot=="undefined")return !1;var e=H(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Mt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!B(i)||!C(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s);}));});}function Rt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(f,c){return f[c]="",f},{});!B(o)||!C(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(f){o.removeAttribute(f);}));});}}var Ae={name:"applyStyles",enabled:!0,phase:"write",fn:Mt,effect:Rt,requires:["computeStyles"]};function q(t){return t.split("-")[0]}var X$1=Math.max,ve=Math.min,Z=Math.round;function ee(t,e){e===void 0&&(e=!1);var n=t.getBoundingClientRect(),r=1,o=1;if(B(t)&&e){var i=t.offsetHeight,a=t.offsetWidth;a>0&&(r=Z(n.width)/a||1),i>0&&(o=Z(n.height)/i||1);}return {width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function ke(t){var e=ee(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function it(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return !0;if(n&&Pe(n)){var r=e;do{if(r&&t.isSameNode(r))return !0;r=r.parentNode||r.host;}while(r)}return !1}function N$1(t){return H(t).getComputedStyle(t)}function Wt(t){return ["table","td","th"].indexOf(C(t))>=0}function I$1(t){return ((Q(t)?t.ownerDocument:t.document)||window.document).documentElement}function ge(t){return C(t)==="html"?t:t.assignedSlot||t.parentNode||(Pe(t)?t.host:null)||I$1(t)}function at(t){return !B(t)||N$1(t).position==="fixed"?null:t.offsetParent}function Bt(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&B(t)){var r=N$1(t);if(r.position==="fixed")return null}var o=ge(t);for(Pe(o)&&(o=o.host);B(o)&&["html","body"].indexOf(C(o))<0;){var i=N$1(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode;}return null}function se(t){for(var e=H(t),n=at(t);n&&Wt(n)&&N$1(n).position==="static";)n=at(n);return n&&(C(n)==="html"||C(n)==="body"&&N$1(n).position==="static")?e:n||Bt(t)||e}function Le(t){return ["top","bottom"].indexOf(t)>=0?"x":"y"}function fe(t,e,n){return X$1(t,ve(e,n))}function St(t,e,n){var r=fe(t,e,n);return r>n?n:r}function st(){return {top:0,right:0,bottom:0,left:0}}function ft(t){return Object.assign({},st(),t)}function ct(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Tt=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,ft(typeof t!="number"?t:ct(t,G))};function Ht(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=q(n.placement),f=Le(s),c=[P$1,W].indexOf(s)>=0,u=c?"height":"width";if(!(!i||!a)){var m=Tt(o.padding,n),v=ke(i),l=f==="y"?E$1:P$1,h=f==="y"?R:W,p=n.rects.reference[u]+n.rects.reference[f]-a[f]-n.rects.popper[u],g=a[f]-n.rects.reference[f],x=se(i),y=x?f==="y"?x.clientHeight||0:x.clientWidth||0:0,$=p/2-g/2,d=m[l],b=y-v[u]-m[h],w=y/2-v[u]/2+$,O=fe(d,w,b),j=f;n.modifiersData[r]=(e={},e[j]=O,e.centerOffset=O-w,e);}}function Ct(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||!it(e.elements.popper,o)||(e.elements.arrow=o));}var pt={name:"arrow",enabled:!0,phase:"main",fn:Ht,effect:Ct,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function te(t){return t.split("-")[1]}var qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vt(t){var e=t.x,n=t.y,r=window,o=r.devicePixelRatio||1;return {x:Z(e*o)/o||0,y:Z(n*o)/o||0}}function ut(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,s=t.position,f=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,m=t.isFixed,v=a.x,l=v===void 0?0:v,h=a.y,p=h===void 0?0:h,g=typeof u=="function"?u({x:l,y:p}):{x:l,y:p};l=g.x,p=g.y;var x=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),$=P$1,d=E$1,b=window;if(c){var w=se(n),O="clientHeight",j="clientWidth";if(w===H(n)&&(w=I$1(n),N$1(w).position!=="static"&&s==="absolute"&&(O="scrollHeight",j="scrollWidth")),w=w,o===E$1||(o===P$1||o===W)&&i===J){d=R;var A=m&&w===b&&b.visualViewport?b.visualViewport.height:w[O];p-=A-r.height,p*=f?1:-1;}if(o===P$1||(o===E$1||o===R)&&i===J){$=W;var k=m&&w===b&&b.visualViewport?b.visualViewport.width:w[j];l-=k-r.width,l*=f?1:-1;}}var D=Object.assign({position:s},c&&qt),S=u===!0?Vt({x:l,y:p}):{x:l,y:p};if(l=S.x,p=S.y,f){var L;return Object.assign({},D,(L={},L[d]=y?"0":"",L[$]=x?"0":"",L.transform=(b.devicePixelRatio||1)<=1?"translate("+l+"px, "+p+"px)":"translate3d("+l+"px, "+p+"px, 0)",L))}return Object.assign({},D,(e={},e[d]=y?p+"px":"",e[$]=x?l+"px":"",e.transform="",e))}function Nt(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,f=s===void 0?!0:s,c={placement:q(e.placement),variation:te(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ut(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ut(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement});}var Me={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Nt,data:{}},ye={passive:!0};function It(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,f=H(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,ye);}),s&&f.addEventListener("resize",n.update,ye),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ye);}),s&&f.removeEventListener("resize",n.update,ye);}}var Re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:It,data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(t){return t.replace(/left|right|bottom|top/g,function(e){return _t[e]})}var zt={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,function(e){return zt[e]})}function We(t){var e=H(t),n=e.pageXOffset,r=e.pageYOffset;return {scrollLeft:n,scrollTop:r}}function Be(t){return ee(I$1(t)).left+We(t).scrollLeft}function Ft(t){var e=H(t),n=I$1(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+Be(t),y:s}}function Ut(t){var e,n=I$1(t),r=We(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=X$1(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=X$1(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Be(t),f=-r.scrollTop;return N$1(o||n).direction==="rtl"&&(s+=X$1(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}function Se(t){var e=N$1(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return /auto|scroll|overlay|hidden/.test(n+o+r)}function dt(t){return ["html","body","#document"].indexOf(C(t))>=0?t.ownerDocument.body:B(t)&&Se(t)?t:dt(ge(t))}function ce(t,e){var n;e===void 0&&(e=[]);var r=dt(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=H(r),a=o?[i].concat(i.visualViewport||[],Se(r)?r:[]):r,s=e.concat(a);return o?s:s.concat(ce(ge(a)))}function Te(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Xt(t){var e=ee(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ht(t,e){return e===je?Te(Ft(t)):Q(e)?Xt(e):Te(Ut(I$1(t)))}function Yt(t){var e=ce(ge(t)),n=["absolute","fixed"].indexOf(N$1(t).position)>=0,r=n&&B(t)?se(t):t;return Q(r)?e.filter(function(o){return Q(o)&&it(o,r)&&C(o)!=="body"}):[]}function Gt(t,e,n){var r=e==="clippingParents"?Yt(t):[].concat(e),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(s,f){var c=ht(t,f);return s.top=X$1(c.top,s.top),s.right=ve(c.right,s.right),s.bottom=ve(c.bottom,s.bottom),s.left=X$1(c.left,s.left),s},ht(t,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e=t.reference,n=t.element,r=t.placement,o=r?q(r):null,i=r?te(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,f;switch(o){case E$1:f={x:a,y:e.y-n.height};break;case R:f={x:a,y:e.y+e.height};break;case W:f={x:e.x+e.width,y:s};break;case P$1:f={x:e.x-n.width,y:s};break;default:f={x:e.x,y:e.y};}var c=o?Le(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case U$1:f[c]=f[c]-(e[u]/2-n[u]/2);break;case J:f[c]=f[c]+(e[u]/2-n[u]/2);break}}return f}function ne(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.boundary,a=i===void 0?Xe:i,s=n.rootBoundary,f=s===void 0?je:s,c=n.elementContext,u=c===void 0?K:c,m=n.altBoundary,v=m===void 0?!1:m,l=n.padding,h=l===void 0?0:l,p=ft(typeof h!="number"?h:ct(h,G)),g=u===K?Ye:K,x=t.rects.popper,y=t.elements[v?g:u],$=Gt(Q(y)?y:y.contextElement||I$1(t.elements.popper),a,f),d=ee(t.elements.reference),b=mt({reference:d,element:x,strategy:"absolute",placement:o}),w=Te(Object.assign({},x,b)),O=u===K?w:d,j={top:$.top-O.top+p.top,bottom:O.bottom-$.bottom+p.bottom,left:$.left-O.left+p.left,right:O.right-$.right+p.right},A=t.modifiersData.offset;if(u===K&&A){var k=A[o];Object.keys(j).forEach(function(D){var S=[W,R].indexOf(D)>=0?1:-1,L=[E$1,R].indexOf(D)>=0?"y":"x";j[D]+=k[L]*S;});}return j}function Jt(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Ee:f,u=te(r),m=u?s?De:De.filter(function(h){return te(h)===u}):G,v=m.filter(function(h){return c.indexOf(h)>=0});v.length===0&&(v=m);var l=v.reduce(function(h,p){return h[p]=ne(t,{placement:p,boundary:o,rootBoundary:i,padding:a})[q(p)],h},{});return Object.keys(l).sort(function(h,p){return l[h]-l[p]})}function Kt(t){if(q(t)===me)return [];var e=be(t);return [lt(t),e,lt(e)]}function Qt(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,f=n.fallbackPlacements,c=n.padding,u=n.boundary,m=n.rootBoundary,v=n.altBoundary,l=n.flipVariations,h=l===void 0?!0:l,p=n.allowedAutoPlacements,g=e.options.placement,x=q(g),y=x===g,$=f||(y||!h?[be(g)]:Kt(g)),d=[g].concat($).reduce(function(z,V){return z.concat(q(V)===me?Jt(e,{placement:V,boundary:u,rootBoundary:m,padding:c,flipVariations:h,allowedAutoPlacements:p}):V)},[]),b=e.rects.reference,w=e.rects.popper,O=new Map,j=!0,A=d[0],k=0;k<d.length;k++){var D=d[k],S=q(D),L=te(D)===U$1,re=[E$1,R].indexOf(S)>=0,oe=re?"width":"height",M=ne(e,{placement:D,boundary:u,rootBoundary:m,altBoundary:v,padding:c}),T=re?L?W:P$1:L?R:E$1;b[oe]>w[oe]&&(T=be(T));var pe=be(T),_=[];if(i&&_.push(M[S]<=0),s&&_.push(M[T]<=0,M[pe]<=0),_.every(function(z){return z})){A=D,j=!1;break}O.set(D,_);}if(j)for(var ue=h?3:1,xe=function(z){var V=d.find(function(de){var ae=O.get(de);if(ae)return ae.slice(0,z).every(function(Y){return Y})});if(V)return A=V,"break"},ie=ue;ie>0;ie--){var le=xe(ie);if(le==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=!0,e.placement=A,e.reset=!0);}}var vt={name:"flip",enabled:!0,phase:"main",fn:Qt,requiresIfExists:["offset"],data:{_skip:!1}};function gt(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function yt(t){return [E$1,W,R,P$1].some(function(e){return t[e]>=0})}function Zt(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=ne(e,{elementContext:"reference"}),s=ne(e,{altBoundary:!0}),f=gt(a,r),c=gt(s,o,i),u=yt(f),m=yt(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m});}var bt={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function en(t,e,n){var r=q(t),o=[P$1,E$1].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P$1,W].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function tn(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,a=Ee.reduce(function(u,m){return u[m]=en(m,e.rects,i),u},{}),s=a[e.placement],f=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a;}var wt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:tn};function nn(t){var e=t.state,n=t.name;e.modifiersData[n]=mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement});}var He={name:"popperOffsets",enabled:!0,phase:"read",fn:nn,data:{}};function rn(t){return t==="x"?"y":"x"}function on(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,f=n.boundary,c=n.rootBoundary,u=n.altBoundary,m=n.padding,v=n.tether,l=v===void 0?!0:v,h=n.tetherOffset,p=h===void 0?0:h,g=ne(e,{boundary:f,rootBoundary:c,padding:m,altBoundary:u}),x=q(e.placement),y=te(e.placement),$=!y,d=Le(x),b=rn(d),w=e.modifiersData.popperOffsets,O=e.rects.reference,j=e.rects.popper,A=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(w){if(i){var L,re=d==="y"?E$1:P$1,oe=d==="y"?R:W,M=d==="y"?"height":"width",T=w[d],pe=T+g[re],_=T-g[oe],ue=l?-j[M]/2:0,xe=y===U$1?O[M]:j[M],ie=y===U$1?-j[M]:-O[M],le=e.elements.arrow,z=l&&le?ke(le):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:st(),de=V[re],ae=V[oe],Y=fe(0,O[M],z[M]),jt=$?O[M]/2-ue-Y-de-k.mainAxis:xe-Y-de-k.mainAxis,Dt=$?-O[M]/2+ue+Y+ae+k.mainAxis:ie+Y+ae+k.mainAxis,Oe=e.elements.arrow&&se(e.elements.arrow),Et=Oe?d==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,Ce=(L=D==null?void 0:D[d])!=null?L:0,Pt=T+jt-Ce-Et,At=T+Dt-Ce,qe=fe(l?ve(pe,Pt):pe,T,l?X$1(_,At):_);w[d]=qe,S[d]=qe-T;}if(s){var Ve,kt=d==="x"?E$1:P$1,Lt=d==="x"?R:W,F=w[b],he=b==="y"?"height":"width",Ne=F+g[kt],Ie=F-g[Lt],$e=[E$1,P$1].indexOf(x)!==-1,_e=(Ve=D==null?void 0:D[b])!=null?Ve:0,ze=$e?Ne:F-O[he]-j[he]-_e+k.altAxis,Fe=$e?F+O[he]+j[he]-_e-k.altAxis:Ie,Ue=l&&$e?St(ze,F,Fe):fe(l?ze:Ne,F,l?Fe:Ie);w[b]=Ue,S[b]=Ue-F;}e.modifiersData[r]=S;}}var xt={name:"preventOverflow",enabled:!0,phase:"main",fn:on,requiresIfExists:["offset"]};function an(t){return {scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function sn(t){return t===H(t)||!B(t)?We(t):an(t)}function fn(t){var e=t.getBoundingClientRect(),n=Z(e.width)/t.offsetWidth||1,r=Z(e.height)/t.offsetHeight||1;return n!==1||r!==1}function cn(t,e,n){n===void 0&&(n=!1);var r=B(e),o=B(e)&&fn(e),i=I$1(e),a=ee(t,o),s={scrollLeft:0,scrollTop:0},f={x:0,y:0};return (r||!r&&!n)&&((C(e)!=="body"||Se(i))&&(s=sn(e)),B(e)?(f=ee(e,!0),f.x+=e.clientLeft,f.y+=e.clientTop):i&&(f.x=Be(i))),{x:a.left+s.scrollLeft-f.x,y:a.top+s.scrollTop-f.y,width:a.width,height:a.height}}function pn(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i);});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var f=e.get(s);f&&o(f);}}),r.push(i);}return t.forEach(function(i){n.has(i.name)||o(i);}),r}function un(t){var e=pn(t);return ot.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function ln(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t());});})),e}}function dn(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function $t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return !e.some(function(r){return !(r&&typeof r.getBoundingClientRect=="function")})}function we(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Ot:o;return function(a,s,f){f===void 0&&(f=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:a,popper:s},attributes:{},styles:{}},u=[],m=!1,v={state:c,setOptions:function(p){var g=typeof p=="function"?p(c.options):p;h(),c.options=Object.assign({},i,c.options,g),c.scrollParents={reference:Q(a)?ce(a):a.contextElement?ce(a.contextElement):[],popper:ce(s)};var x=un(dn([].concat(r,c.options.modifiers)));return c.orderedModifiers=x.filter(function(y){return y.enabled}),l(),v.update()},forceUpdate:function(){if(!m){var p=c.elements,g=p.reference,x=p.popper;if($t(g,x)){c.rects={reference:cn(g,se(x),c.options.strategy==="fixed"),popper:ke(x)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(j){return c.modifiersData[j.name]=Object.assign({},j.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===!0){c.reset=!1,y=-1;continue}var $=c.orderedModifiers[y],d=$.fn,b=$.options,w=b===void 0?{}:b,O=$.name;typeof d=="function"&&(c=d({state:c,options:w,name:O,instance:v})||c);}}}},update:ln(function(){return new Promise(function(p){v.forceUpdate(),p(c);})}),destroy:function(){h(),m=!0;}};if(!$t(a,s))return v;v.setOptions(f).then(function(p){!m&&f.onFirstUpdate&&f.onFirstUpdate(p);});function l(){c.orderedModifiers.forEach(function(p){var g=p.name,x=p.options,y=x===void 0?{}:x,$=p.effect;if(typeof $=="function"){var d=$({state:c,name:g,instance:v,options:y}),b=function(){};u.push(d||b);}});}function h(){u.forEach(function(p){return p()}),u=[];}return v}}we();var mn=[Re,He,Me,Ae];we({defaultModifiers:mn});var gn=[Re,He,Me,Ae,wt,vt,xt,pt,bt],yn=we({defaultModifiers:gn});
  11855. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  11856. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  11857. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  11858. const FOCUS_AFTER_TRAPPED_OPTS = {
  11859. cancelable: true,
  11860. bubbles: false
  11861. };
  11862. const FOCUSOUT_PREVENTED_OPTS = {
  11863. cancelable: true,
  11864. bubbles: false
  11865. };
  11866. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  11867. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  11868. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  11869. const focusReason = vue.ref();
  11870. const lastUserFocusTimestamp = vue.ref(0);
  11871. const lastAutomatedFocusTimestamp = vue.ref(0);
  11872. let focusReasonUserCount = 0;
  11873. const obtainAllFocusableElements = (element) => {
  11874. const nodes = [];
  11875. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
  11876. acceptNode: (node) => {
  11877. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  11878. if (node.disabled || node.hidden || isHiddenInput)
  11879. return NodeFilter.FILTER_SKIP;
  11880. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  11881. }
  11882. });
  11883. while (walker.nextNode())
  11884. nodes.push(walker.currentNode);
  11885. return nodes;
  11886. };
  11887. const getVisibleElement = (elements, container) => {
  11888. for (const element of elements) {
  11889. if (!isHidden(element, container))
  11890. return element;
  11891. }
  11892. };
  11893. const isHidden = (element, container) => {
  11894. if (getComputedStyle(element).visibility === "hidden")
  11895. return true;
  11896. while (element) {
  11897. if (container && element === container)
  11898. return false;
  11899. if (getComputedStyle(element).display === "none")
  11900. return true;
  11901. element = element.parentElement;
  11902. }
  11903. return false;
  11904. };
  11905. const getEdges = (container) => {
  11906. const focusable = obtainAllFocusableElements(container);
  11907. const first = getVisibleElement(focusable, container);
  11908. const last = getVisibleElement(focusable.reverse(), container);
  11909. return [first, last];
  11910. };
  11911. const isSelectable = (element) => {
  11912. return element instanceof HTMLInputElement && "select" in element;
  11913. };
  11914. const tryFocus = (element, shouldSelect) => {
  11915. if (element && element.focus) {
  11916. const prevFocusedElement = document.activeElement;
  11917. element.focus({ preventScroll: true });
  11918. lastAutomatedFocusTimestamp.value = window.performance.now();
  11919. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
  11920. element.select();
  11921. }
  11922. }
  11923. };
  11924. function removeFromStack(list, item) {
  11925. const copy = [...list];
  11926. const idx = list.indexOf(item);
  11927. if (idx !== -1) {
  11928. copy.splice(idx, 1);
  11929. }
  11930. return copy;
  11931. }
  11932. const createFocusableStack = () => {
  11933. let stack = [];
  11934. const push = (layer) => {
  11935. const currentLayer = stack[0];
  11936. if (currentLayer && layer !== currentLayer) {
  11937. currentLayer.pause();
  11938. }
  11939. stack = removeFromStack(stack, layer);
  11940. stack.unshift(layer);
  11941. };
  11942. const remove = (layer) => {
  11943. var _a, _b;
  11944. stack = removeFromStack(stack, layer);
  11945. (_b = (_a = stack[0]) == null ? void 0 : _a.resume) == null ? void 0 : _b.call(_a);
  11946. };
  11947. return {
  11948. push,
  11949. remove
  11950. };
  11951. };
  11952. const focusFirstDescendant = (elements, shouldSelect = false) => {
  11953. const prevFocusedElement = document.activeElement;
  11954. for (const element of elements) {
  11955. tryFocus(element, shouldSelect);
  11956. if (document.activeElement !== prevFocusedElement)
  11957. return;
  11958. }
  11959. };
  11960. const focusableStack = createFocusableStack();
  11961. const isFocusCausedByUserEvent = () => {
  11962. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  11963. };
  11964. const notifyFocusReasonPointer = () => {
  11965. focusReason.value = "pointer";
  11966. lastUserFocusTimestamp.value = window.performance.now();
  11967. };
  11968. const notifyFocusReasonKeydown = () => {
  11969. focusReason.value = "keyboard";
  11970. lastUserFocusTimestamp.value = window.performance.now();
  11971. };
  11972. const useFocusReason = () => {
  11973. vue.onMounted(() => {
  11974. if (focusReasonUserCount === 0) {
  11975. document.addEventListener("mousedown", notifyFocusReasonPointer);
  11976. document.addEventListener("touchstart", notifyFocusReasonPointer);
  11977. document.addEventListener("keydown", notifyFocusReasonKeydown);
  11978. }
  11979. focusReasonUserCount++;
  11980. });
  11981. vue.onBeforeUnmount(() => {
  11982. focusReasonUserCount--;
  11983. if (focusReasonUserCount <= 0) {
  11984. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  11985. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  11986. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  11987. }
  11988. });
  11989. return {
  11990. focusReason,
  11991. lastUserFocusTimestamp,
  11992. lastAutomatedFocusTimestamp
  11993. };
  11994. };
  11995. const createFocusOutPreventedEvent = (detail) => {
  11996. return new CustomEvent(FOCUSOUT_PREVENTED, {
  11997. ...FOCUSOUT_PREVENTED_OPTS,
  11998. detail
  11999. });
  12000. };
  12001. const _sfc_main$27 = vue.defineComponent({
  12002. name: "ElFocusTrap",
  12003. inheritAttrs: false,
  12004. props: {
  12005. loop: Boolean,
  12006. trapped: Boolean,
  12007. focusTrapEl: Object,
  12008. focusStartEl: {
  12009. type: [Object, String],
  12010. default: "first"
  12011. }
  12012. },
  12013. emits: [
  12014. ON_TRAP_FOCUS_EVT,
  12015. ON_RELEASE_FOCUS_EVT,
  12016. "focusin",
  12017. "focusout",
  12018. "focusout-prevented",
  12019. "release-requested"
  12020. ],
  12021. setup(props, { emit }) {
  12022. const forwardRef = vue.ref();
  12023. let lastFocusBeforeTrapped;
  12024. let lastFocusAfterTrapped;
  12025. const { focusReason } = useFocusReason();
  12026. useEscapeKeydown((event) => {
  12027. if (props.trapped && !focusLayer.paused) {
  12028. emit("release-requested", event);
  12029. }
  12030. });
  12031. const focusLayer = {
  12032. paused: false,
  12033. pause() {
  12034. this.paused = true;
  12035. },
  12036. resume() {
  12037. this.paused = false;
  12038. }
  12039. };
  12040. const onKeydown = (e) => {
  12041. if (!props.loop && !props.trapped)
  12042. return;
  12043. if (focusLayer.paused)
  12044. return;
  12045. const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  12046. const { loop } = props;
  12047. const isTabbing = key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  12048. const currentFocusingEl = document.activeElement;
  12049. if (isTabbing && currentFocusingEl) {
  12050. const container = currentTarget;
  12051. const [first, last] = getEdges(container);
  12052. const isTabbable = first && last;
  12053. if (!isTabbable) {
  12054. if (currentFocusingEl === container) {
  12055. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  12056. focusReason: focusReason.value
  12057. });
  12058. emit("focusout-prevented", focusoutPreventedEvent);
  12059. if (!focusoutPreventedEvent.defaultPrevented) {
  12060. e.preventDefault();
  12061. }
  12062. }
  12063. } else {
  12064. if (!shiftKey && currentFocusingEl === last) {
  12065. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  12066. focusReason: focusReason.value
  12067. });
  12068. emit("focusout-prevented", focusoutPreventedEvent);
  12069. if (!focusoutPreventedEvent.defaultPrevented) {
  12070. e.preventDefault();
  12071. if (loop)
  12072. tryFocus(first, true);
  12073. }
  12074. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  12075. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  12076. focusReason: focusReason.value
  12077. });
  12078. emit("focusout-prevented", focusoutPreventedEvent);
  12079. if (!focusoutPreventedEvent.defaultPrevented) {
  12080. e.preventDefault();
  12081. if (loop)
  12082. tryFocus(last, true);
  12083. }
  12084. }
  12085. }
  12086. }
  12087. };
  12088. vue.provide(FOCUS_TRAP_INJECTION_KEY, {
  12089. focusTrapRef: forwardRef,
  12090. onKeydown
  12091. });
  12092. vue.watch(() => props.focusTrapEl, (focusTrapEl) => {
  12093. if (focusTrapEl) {
  12094. forwardRef.value = focusTrapEl;
  12095. }
  12096. }, { immediate: true });
  12097. vue.watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
  12098. if (forwardRef2) {
  12099. forwardRef2.addEventListener("keydown", onKeydown);
  12100. forwardRef2.addEventListener("focusin", onFocusIn);
  12101. forwardRef2.addEventListener("focusout", onFocusOut);
  12102. }
  12103. if (oldForwardRef) {
  12104. oldForwardRef.removeEventListener("keydown", onKeydown);
  12105. oldForwardRef.removeEventListener("focusin", onFocusIn);
  12106. oldForwardRef.removeEventListener("focusout", onFocusOut);
  12107. }
  12108. });
  12109. const trapOnFocus = (e) => {
  12110. emit(ON_TRAP_FOCUS_EVT, e);
  12111. };
  12112. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  12113. const onFocusIn = (e) => {
  12114. const trapContainer = vue.unref(forwardRef);
  12115. if (!trapContainer)
  12116. return;
  12117. const target = e.target;
  12118. const relatedTarget = e.relatedTarget;
  12119. const isFocusedInTrap = target && trapContainer.contains(target);
  12120. if (!props.trapped) {
  12121. const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
  12122. if (!isPrevFocusedInTrap) {
  12123. lastFocusBeforeTrapped = relatedTarget;
  12124. }
  12125. }
  12126. if (isFocusedInTrap)
  12127. emit("focusin", e);
  12128. if (focusLayer.paused)
  12129. return;
  12130. if (props.trapped) {
  12131. if (isFocusedInTrap) {
  12132. lastFocusAfterTrapped = target;
  12133. } else {
  12134. tryFocus(lastFocusAfterTrapped, true);
  12135. }
  12136. }
  12137. };
  12138. const onFocusOut = (e) => {
  12139. const trapContainer = vue.unref(forwardRef);
  12140. if (focusLayer.paused || !trapContainer)
  12141. return;
  12142. if (props.trapped) {
  12143. const relatedTarget = e.relatedTarget;
  12144. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
  12145. setTimeout(() => {
  12146. if (!focusLayer.paused && props.trapped) {
  12147. const focusoutPreventedEvent = createFocusOutPreventedEvent({
  12148. focusReason: focusReason.value
  12149. });
  12150. emit("focusout-prevented", focusoutPreventedEvent);
  12151. if (!focusoutPreventedEvent.defaultPrevented) {
  12152. tryFocus(lastFocusAfterTrapped, true);
  12153. }
  12154. }
  12155. }, 0);
  12156. }
  12157. } else {
  12158. const target = e.target;
  12159. const isFocusedInTrap = target && trapContainer.contains(target);
  12160. if (!isFocusedInTrap)
  12161. emit("focusout", e);
  12162. }
  12163. };
  12164. async function startTrap() {
  12165. await vue.nextTick();
  12166. const trapContainer = vue.unref(forwardRef);
  12167. if (trapContainer) {
  12168. focusableStack.push(focusLayer);
  12169. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  12170. lastFocusBeforeTrapped = prevFocusedElement;
  12171. const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
  12172. if (!isPrevFocusContained) {
  12173. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  12174. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  12175. trapContainer.dispatchEvent(focusEvent);
  12176. if (!focusEvent.defaultPrevented) {
  12177. vue.nextTick(() => {
  12178. let focusStartEl = props.focusStartEl;
  12179. if (!isString(focusStartEl)) {
  12180. tryFocus(focusStartEl);
  12181. if (document.activeElement !== focusStartEl) {
  12182. focusStartEl = "first";
  12183. }
  12184. }
  12185. if (focusStartEl === "first") {
  12186. focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  12187. }
  12188. if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
  12189. tryFocus(trapContainer);
  12190. }
  12191. });
  12192. }
  12193. }
  12194. }
  12195. }
  12196. function stopTrap() {
  12197. const trapContainer = vue.unref(forwardRef);
  12198. if (trapContainer) {
  12199. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  12200. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  12201. ...FOCUS_AFTER_TRAPPED_OPTS,
  12202. detail: {
  12203. focusReason: focusReason.value
  12204. }
  12205. });
  12206. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  12207. trapContainer.dispatchEvent(releasedEvent);
  12208. if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !isFocusCausedByUserEvent())) {
  12209. tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
  12210. }
  12211. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus);
  12212. focusableStack.remove(focusLayer);
  12213. }
  12214. }
  12215. vue.onMounted(() => {
  12216. if (props.trapped) {
  12217. startTrap();
  12218. }
  12219. vue.watch(() => props.trapped, (trapped) => {
  12220. if (trapped) {
  12221. startTrap();
  12222. } else {
  12223. stopTrap();
  12224. }
  12225. });
  12226. });
  12227. vue.onBeforeUnmount(() => {
  12228. if (props.trapped) {
  12229. stopTrap();
  12230. }
  12231. });
  12232. return {
  12233. onKeydown
  12234. };
  12235. }
  12236. });
  12237. function _sfc_render$y(_ctx, _cache, $props, $setup, $data, $options) {
  12238. return vue.renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  12239. }
  12240. var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$27, [["render", _sfc_render$y], ["__file", "focus-trap.vue"]]);
  12241. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  12242. const popperCoreConfigProps = buildProps({
  12243. boundariesPadding: {
  12244. type: Number,
  12245. default: 0
  12246. },
  12247. fallbackPlacements: {
  12248. type: definePropType(Array),
  12249. default: void 0
  12250. },
  12251. gpuAcceleration: {
  12252. type: Boolean,
  12253. default: true
  12254. },
  12255. offset: {
  12256. type: Number,
  12257. default: 12
  12258. },
  12259. placement: {
  12260. type: String,
  12261. values: Ee,
  12262. default: "bottom"
  12263. },
  12264. popperOptions: {
  12265. type: definePropType(Object),
  12266. default: () => ({})
  12267. },
  12268. strategy: {
  12269. type: String,
  12270. values: POSITIONING_STRATEGIES,
  12271. default: "absolute"
  12272. }
  12273. });
  12274. const popperContentProps = buildProps({
  12275. ...popperCoreConfigProps,
  12276. id: String,
  12277. style: {
  12278. type: definePropType([String, Array, Object])
  12279. },
  12280. className: {
  12281. type: definePropType([String, Array, Object])
  12282. },
  12283. effect: {
  12284. type: String,
  12285. default: "dark"
  12286. },
  12287. visible: Boolean,
  12288. enterable: {
  12289. type: Boolean,
  12290. default: true
  12291. },
  12292. pure: Boolean,
  12293. focusOnShow: {
  12294. type: Boolean,
  12295. default: false
  12296. },
  12297. trapping: {
  12298. type: Boolean,
  12299. default: false
  12300. },
  12301. popperClass: {
  12302. type: definePropType([String, Array, Object])
  12303. },
  12304. popperStyle: {
  12305. type: definePropType([String, Array, Object])
  12306. },
  12307. referenceEl: {
  12308. type: definePropType(Object)
  12309. },
  12310. triggerTargetEl: {
  12311. type: definePropType(Object)
  12312. },
  12313. stopPopperMouseEvent: {
  12314. type: Boolean,
  12315. default: true
  12316. },
  12317. ariaLabel: {
  12318. type: String,
  12319. default: void 0
  12320. },
  12321. virtualTriggering: Boolean,
  12322. zIndex: Number
  12323. });
  12324. const popperContentEmits = {
  12325. mouseenter: (evt) => evt instanceof MouseEvent,
  12326. mouseleave: (evt) => evt instanceof MouseEvent,
  12327. focus: () => true,
  12328. blur: () => true,
  12329. close: () => true
  12330. };
  12331. const usePopperCoreConfigProps = popperCoreConfigProps;
  12332. const usePopperContentProps = popperContentProps;
  12333. const usePopperContentEmits = popperContentEmits;
  12334. const buildPopperOptions = (props, arrowProps) => {
  12335. const { placement, strategy, popperOptions } = props;
  12336. const options = {
  12337. placement,
  12338. strategy,
  12339. ...popperOptions,
  12340. modifiers: genModifiers(props)
  12341. };
  12342. attachArrow(options, arrowProps);
  12343. deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers);
  12344. return options;
  12345. };
  12346. const unwrapMeasurableEl = ($el) => {
  12347. if (!isClient)
  12348. return;
  12349. return unrefElement($el);
  12350. };
  12351. function genModifiers(options) {
  12352. const { offset, gpuAcceleration, fallbackPlacements } = options;
  12353. return [
  12354. {
  12355. name: "offset",
  12356. options: {
  12357. offset: [0, offset != null ? offset : 12]
  12358. }
  12359. },
  12360. {
  12361. name: "preventOverflow",
  12362. options: {
  12363. padding: {
  12364. top: 2,
  12365. bottom: 2,
  12366. left: 5,
  12367. right: 5
  12368. }
  12369. }
  12370. },
  12371. {
  12372. name: "flip",
  12373. options: {
  12374. padding: 5,
  12375. fallbackPlacements
  12376. }
  12377. },
  12378. {
  12379. name: "computeStyles",
  12380. options: {
  12381. gpuAcceleration
  12382. }
  12383. }
  12384. ];
  12385. }
  12386. function attachArrow(options, { arrowEl, arrowOffset }) {
  12387. options.modifiers.push({
  12388. name: "arrow",
  12389. options: {
  12390. element: arrowEl,
  12391. padding: arrowOffset != null ? arrowOffset : 5
  12392. }
  12393. });
  12394. }
  12395. function deriveExtraModifiers(options, modifiers) {
  12396. if (modifiers) {
  12397. options.modifiers = [...options.modifiers, ...modifiers != null ? modifiers : []];
  12398. }
  12399. }
  12400. const __default__$1q = vue.defineComponent({
  12401. name: "ElPopperContent"
  12402. });
  12403. const _sfc_main$26 = /* @__PURE__ */ vue.defineComponent({
  12404. ...__default__$1q,
  12405. props: popperContentProps,
  12406. emits: popperContentEmits,
  12407. setup(__props, { expose, emit }) {
  12408. const props = __props;
  12409. const { popperInstanceRef, contentRef, triggerRef, role } = vue.inject(POPPER_INJECTION_KEY, void 0);
  12410. const formItemContext = vue.inject(formItemContextKey, void 0);
  12411. const { nextZIndex } = useZIndex();
  12412. const ns = useNamespace("popper");
  12413. const popperContentRef = vue.ref();
  12414. const focusStartRef = vue.ref("first");
  12415. const arrowRef = vue.ref();
  12416. const arrowOffset = vue.ref();
  12417. vue.provide(POPPER_CONTENT_INJECTION_KEY, {
  12418. arrowRef,
  12419. arrowOffset
  12420. });
  12421. if (formItemContext && (formItemContext.addInputId || formItemContext.removeInputId)) {
  12422. vue.provide(formItemContextKey, {
  12423. ...formItemContext,
  12424. addInputId: NOOP,
  12425. removeInputId: NOOP
  12426. });
  12427. }
  12428. const contentZIndex = vue.ref(props.zIndex || nextZIndex());
  12429. const trapped = vue.ref(false);
  12430. let triggerTargetAriaStopWatch = void 0;
  12431. const computedReference = vue.computed(() => unwrapMeasurableEl(props.referenceEl) || vue.unref(triggerRef));
  12432. const contentStyle = vue.computed(() => [{ zIndex: vue.unref(contentZIndex) }, props.popperStyle]);
  12433. const contentClass = vue.computed(() => [
  12434. ns.b(),
  12435. ns.is("pure", props.pure),
  12436. ns.is(props.effect),
  12437. props.popperClass
  12438. ]);
  12439. const ariaModal = vue.computed(() => {
  12440. return role && role.value === "dialog" ? "false" : void 0;
  12441. });
  12442. const createPopperInstance = ({
  12443. referenceEl,
  12444. popperContentEl,
  12445. arrowEl
  12446. }) => {
  12447. const options = buildPopperOptions(props, {
  12448. arrowEl,
  12449. arrowOffset: vue.unref(arrowOffset)
  12450. });
  12451. return yn(referenceEl, popperContentEl, options);
  12452. };
  12453. const updatePopper = (shouldUpdateZIndex = true) => {
  12454. var _a;
  12455. (_a = vue.unref(popperInstanceRef)) == null ? void 0 : _a.update();
  12456. shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex());
  12457. };
  12458. const togglePopperAlive = () => {
  12459. var _a, _b;
  12460. const monitorable = { name: "eventListeners", enabled: props.visible };
  12461. (_b = (_a = vue.unref(popperInstanceRef)) == null ? void 0 : _a.setOptions) == null ? void 0 : _b.call(_a, (options) => ({
  12462. ...options,
  12463. modifiers: [...options.modifiers || [], monitorable]
  12464. }));
  12465. updatePopper(false);
  12466. if (props.visible && props.focusOnShow) {
  12467. trapped.value = true;
  12468. } else if (props.visible === false) {
  12469. trapped.value = false;
  12470. }
  12471. };
  12472. const onFocusAfterTrapped = () => {
  12473. emit("focus");
  12474. };
  12475. const onFocusAfterReleased = (event) => {
  12476. var _a;
  12477. if (((_a = event.detail) == null ? void 0 : _a.focusReason) !== "pointer") {
  12478. focusStartRef.value = "first";
  12479. emit("blur");
  12480. }
  12481. };
  12482. const onFocusInTrap = (event) => {
  12483. if (props.visible && !trapped.value) {
  12484. if (event.target) {
  12485. focusStartRef.value = event.target;
  12486. }
  12487. trapped.value = true;
  12488. }
  12489. };
  12490. const onFocusoutPrevented = (event) => {
  12491. if (!props.trapping) {
  12492. if (event.detail.focusReason === "pointer") {
  12493. event.preventDefault();
  12494. }
  12495. trapped.value = false;
  12496. }
  12497. };
  12498. const onReleaseRequested = () => {
  12499. trapped.value = false;
  12500. emit("close");
  12501. };
  12502. vue.onMounted(() => {
  12503. let updateHandle;
  12504. vue.watch(computedReference, (referenceEl) => {
  12505. var _a;
  12506. updateHandle == null ? void 0 : updateHandle();
  12507. const popperInstance = vue.unref(popperInstanceRef);
  12508. (_a = popperInstance == null ? void 0 : popperInstance.destroy) == null ? void 0 : _a.call(popperInstance);
  12509. if (referenceEl) {
  12510. const popperContentEl = vue.unref(popperContentRef);
  12511. contentRef.value = popperContentEl;
  12512. popperInstanceRef.value = createPopperInstance({
  12513. referenceEl,
  12514. popperContentEl,
  12515. arrowEl: vue.unref(arrowRef)
  12516. });
  12517. updateHandle = vue.watch(() => referenceEl.getBoundingClientRect(), () => updatePopper(), {
  12518. immediate: true
  12519. });
  12520. } else {
  12521. popperInstanceRef.value = void 0;
  12522. }
  12523. }, {
  12524. immediate: true
  12525. });
  12526. vue.watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  12527. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  12528. triggerTargetAriaStopWatch = void 0;
  12529. const el = vue.unref(triggerTargetEl || popperContentRef.value);
  12530. const prevEl = vue.unref(prevTriggerTargetEl || popperContentRef.value);
  12531. if (isElement$1(el)) {
  12532. triggerTargetAriaStopWatch = vue.watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
  12533. ["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
  12534. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  12535. });
  12536. }, { immediate: true });
  12537. }
  12538. if (prevEl !== el && isElement$1(prevEl)) {
  12539. ["role", "aria-label", "aria-modal", "id"].forEach((key) => {
  12540. prevEl.removeAttribute(key);
  12541. });
  12542. }
  12543. }, { immediate: true });
  12544. vue.watch(() => props.visible, togglePopperAlive, { immediate: true });
  12545. vue.watch(() => buildPopperOptions(props, {
  12546. arrowEl: vue.unref(arrowRef),
  12547. arrowOffset: vue.unref(arrowOffset)
  12548. }), (option) => {
  12549. var _a;
  12550. return (_a = popperInstanceRef.value) == null ? void 0 : _a.setOptions(option);
  12551. });
  12552. });
  12553. vue.onBeforeUnmount(() => {
  12554. triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
  12555. triggerTargetAriaStopWatch = void 0;
  12556. });
  12557. expose({
  12558. popperContentRef,
  12559. popperInstanceRef,
  12560. updatePopper,
  12561. contentStyle
  12562. });
  12563. return (_ctx, _cache) => {
  12564. return vue.openBlock(), vue.createElementBlock("div", {
  12565. ref_key: "popperContentRef",
  12566. ref: popperContentRef,
  12567. style: vue.normalizeStyle(vue.unref(contentStyle)),
  12568. class: vue.normalizeClass(vue.unref(contentClass)),
  12569. tabindex: "-1",
  12570. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  12571. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  12572. }, [
  12573. vue.createVNode(vue.unref(ElFocusTrap), {
  12574. trapped: trapped.value,
  12575. "trap-on-focus-in": true,
  12576. "focus-trap-el": popperContentRef.value,
  12577. "focus-start-el": focusStartRef.value,
  12578. onFocusAfterTrapped,
  12579. onFocusAfterReleased,
  12580. onFocusin: onFocusInTrap,
  12581. onFocusoutPrevented,
  12582. onReleaseRequested
  12583. }, {
  12584. default: vue.withCtx(() => [
  12585. vue.renderSlot(_ctx.$slots, "default")
  12586. ]),
  12587. _: 3
  12588. }, 8, ["trapped", "focus-trap-el", "focus-start-el"])
  12589. ], 38);
  12590. };
  12591. }
  12592. });
  12593. var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$26, [["__file", "content.vue"]]);
  12594. const ElPopper = withInstall(Popper);
  12595. const ns = useNamespace("tooltip");
  12596. const useTooltipContentProps = buildProps({
  12597. ...useDelayedToggleProps,
  12598. ...popperContentProps,
  12599. appendTo: {
  12600. type: definePropType([String, Object])
  12601. },
  12602. content: {
  12603. type: String,
  12604. default: ""
  12605. },
  12606. rawContent: {
  12607. type: Boolean,
  12608. default: false
  12609. },
  12610. persistent: Boolean,
  12611. ariaLabel: String,
  12612. visible: {
  12613. type: definePropType(Boolean),
  12614. default: null
  12615. },
  12616. transition: {
  12617. type: String,
  12618. default: `${ns.namespace.value}-fade-in-linear`
  12619. },
  12620. teleported: {
  12621. type: Boolean,
  12622. default: true
  12623. },
  12624. disabled: {
  12625. type: Boolean
  12626. }
  12627. });
  12628. const useTooltipTriggerProps = buildProps({
  12629. ...popperTriggerProps,
  12630. disabled: Boolean,
  12631. trigger: {
  12632. type: definePropType([String, Array]),
  12633. default: "hover"
  12634. },
  12635. triggerKeys: {
  12636. type: definePropType(Array),
  12637. default: () => [EVENT_CODE.enter, EVENT_CODE.space]
  12638. }
  12639. });
  12640. const {
  12641. useModelToggleProps: useTooltipModelToggleProps,
  12642. useModelToggleEmits: useTooltipModelToggleEmits,
  12643. useModelToggle: useTooltipModelToggle
  12644. } = createModelToggleComposable("visible");
  12645. const useTooltipProps = buildProps({
  12646. ...popperProps,
  12647. ...useTooltipModelToggleProps,
  12648. ...useTooltipContentProps,
  12649. ...useTooltipTriggerProps,
  12650. ...popperArrowProps,
  12651. showArrow: {
  12652. type: Boolean,
  12653. default: true
  12654. }
  12655. });
  12656. const tooltipEmits = [
  12657. ...useTooltipModelToggleEmits,
  12658. "before-show",
  12659. "before-hide",
  12660. "show",
  12661. "hide",
  12662. "open",
  12663. "close"
  12664. ];
  12665. const isTriggerType = (trigger, type) => {
  12666. if (isArray(trigger)) {
  12667. return trigger.includes(type);
  12668. }
  12669. return trigger === type;
  12670. };
  12671. const whenTrigger = (trigger, type, handler) => {
  12672. return (e) => {
  12673. isTriggerType(vue.unref(trigger), type) && handler(e);
  12674. };
  12675. };
  12676. const __default__$1p = vue.defineComponent({
  12677. name: "ElTooltipTrigger"
  12678. });
  12679. const _sfc_main$25 = /* @__PURE__ */ vue.defineComponent({
  12680. ...__default__$1p,
  12681. props: useTooltipTriggerProps,
  12682. setup(__props, { expose }) {
  12683. const props = __props;
  12684. const ns = useNamespace("tooltip");
  12685. const { controlled, id, open, onOpen, onClose, onToggle } = vue.inject(TOOLTIP_INJECTION_KEY, void 0);
  12686. const triggerRef = vue.ref(null);
  12687. const stopWhenControlledOrDisabled = () => {
  12688. if (vue.unref(controlled) || props.disabled) {
  12689. return true;
  12690. }
  12691. };
  12692. const trigger = vue.toRef(props, "trigger");
  12693. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onOpen));
  12694. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
  12695. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
  12696. if (e.button === 0) {
  12697. onToggle(e);
  12698. }
  12699. }));
  12700. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
  12701. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
  12702. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
  12703. e.preventDefault();
  12704. onToggle(e);
  12705. }));
  12706. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  12707. const { code } = e;
  12708. if (props.triggerKeys.includes(code)) {
  12709. e.preventDefault();
  12710. onToggle(e);
  12711. }
  12712. });
  12713. expose({
  12714. triggerRef
  12715. });
  12716. return (_ctx, _cache) => {
  12717. return vue.openBlock(), vue.createBlock(vue.unref(ElPopperTrigger), {
  12718. id: vue.unref(id),
  12719. "virtual-ref": _ctx.virtualRef,
  12720. open: vue.unref(open),
  12721. "virtual-triggering": _ctx.virtualTriggering,
  12722. class: vue.normalizeClass(vue.unref(ns).e("trigger")),
  12723. onBlur: vue.unref(onBlur),
  12724. onClick: vue.unref(onClick),
  12725. onContextmenu: vue.unref(onContextMenu),
  12726. onFocus: vue.unref(onFocus),
  12727. onMouseenter: vue.unref(onMouseenter),
  12728. onMouseleave: vue.unref(onMouseleave),
  12729. onKeydown: vue.unref(onKeydown)
  12730. }, {
  12731. default: vue.withCtx(() => [
  12732. vue.renderSlot(_ctx.$slots, "default")
  12733. ]),
  12734. _: 3
  12735. }, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
  12736. };
  12737. }
  12738. });
  12739. var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$25, [["__file", "trigger.vue"]]);
  12740. const __default__$1o = vue.defineComponent({
  12741. name: "ElTooltipContent",
  12742. inheritAttrs: false
  12743. });
  12744. const _sfc_main$24 = /* @__PURE__ */ vue.defineComponent({
  12745. ...__default__$1o,
  12746. props: useTooltipContentProps,
  12747. setup(__props, { expose }) {
  12748. const props = __props;
  12749. const { selector } = usePopperContainerId();
  12750. const contentRef = vue.ref(null);
  12751. const destroyed = vue.ref(false);
  12752. const {
  12753. controlled,
  12754. id,
  12755. open,
  12756. trigger,
  12757. onClose,
  12758. onOpen,
  12759. onShow,
  12760. onHide,
  12761. onBeforeShow,
  12762. onBeforeHide
  12763. } = vue.inject(TOOLTIP_INJECTION_KEY, void 0);
  12764. const persistentRef = vue.computed(() => {
  12765. return props.persistent;
  12766. });
  12767. vue.onBeforeUnmount(() => {
  12768. destroyed.value = true;
  12769. });
  12770. const shouldRender = vue.computed(() => {
  12771. return vue.unref(persistentRef) ? true : vue.unref(open);
  12772. });
  12773. const shouldShow = vue.computed(() => {
  12774. return props.disabled ? false : vue.unref(open);
  12775. });
  12776. const appendTo = vue.computed(() => {
  12777. return props.appendTo || selector.value;
  12778. });
  12779. const contentStyle = vue.computed(() => {
  12780. var _a;
  12781. return (_a = props.style) != null ? _a : {};
  12782. });
  12783. const ariaHidden = vue.computed(() => !vue.unref(open));
  12784. const onTransitionLeave = () => {
  12785. onHide();
  12786. };
  12787. const stopWhenControlled = () => {
  12788. if (vue.unref(controlled))
  12789. return true;
  12790. };
  12791. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  12792. if (props.enterable && vue.unref(trigger) === "hover") {
  12793. onOpen();
  12794. }
  12795. });
  12796. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  12797. if (vue.unref(trigger) === "hover") {
  12798. onClose();
  12799. }
  12800. });
  12801. const onBeforeEnter = () => {
  12802. var _a, _b;
  12803. (_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  12804. onBeforeShow == null ? void 0 : onBeforeShow();
  12805. };
  12806. const onBeforeLeave = () => {
  12807. onBeforeHide == null ? void 0 : onBeforeHide();
  12808. };
  12809. const onAfterShow = () => {
  12810. onShow();
  12811. stopHandle = onClickOutside(vue.computed(() => {
  12812. var _a;
  12813. return (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
  12814. }), () => {
  12815. if (vue.unref(controlled))
  12816. return;
  12817. const $trigger = vue.unref(trigger);
  12818. if ($trigger !== "hover") {
  12819. onClose();
  12820. }
  12821. });
  12822. };
  12823. const onBlur = () => {
  12824. if (!props.virtualTriggering) {
  12825. onClose();
  12826. }
  12827. };
  12828. let stopHandle;
  12829. vue.watch(() => vue.unref(open), (val) => {
  12830. if (!val) {
  12831. stopHandle == null ? void 0 : stopHandle();
  12832. }
  12833. }, {
  12834. flush: "post"
  12835. });
  12836. vue.watch(() => props.content, () => {
  12837. var _a, _b;
  12838. (_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  12839. });
  12840. expose({
  12841. contentRef
  12842. });
  12843. return (_ctx, _cache) => {
  12844. return vue.openBlock(), vue.createBlock(vue.Teleport, {
  12845. disabled: !_ctx.teleported,
  12846. to: vue.unref(appendTo)
  12847. }, [
  12848. vue.createVNode(vue.Transition, {
  12849. name: _ctx.transition,
  12850. onAfterLeave: onTransitionLeave,
  12851. onBeforeEnter,
  12852. onAfterEnter: onAfterShow,
  12853. onBeforeLeave
  12854. }, {
  12855. default: vue.withCtx(() => [
  12856. vue.unref(shouldRender) ? vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(ElPopperContent), vue.mergeProps({
  12857. key: 0,
  12858. id: vue.unref(id),
  12859. ref_key: "contentRef",
  12860. ref: contentRef
  12861. }, _ctx.$attrs, {
  12862. "aria-label": _ctx.ariaLabel,
  12863. "aria-hidden": vue.unref(ariaHidden),
  12864. "boundaries-padding": _ctx.boundariesPadding,
  12865. "fallback-placements": _ctx.fallbackPlacements,
  12866. "gpu-acceleration": _ctx.gpuAcceleration,
  12867. offset: _ctx.offset,
  12868. placement: _ctx.placement,
  12869. "popper-options": _ctx.popperOptions,
  12870. strategy: _ctx.strategy,
  12871. effect: _ctx.effect,
  12872. enterable: _ctx.enterable,
  12873. pure: _ctx.pure,
  12874. "popper-class": _ctx.popperClass,
  12875. "popper-style": [_ctx.popperStyle, vue.unref(contentStyle)],
  12876. "reference-el": _ctx.referenceEl,
  12877. "trigger-target-el": _ctx.triggerTargetEl,
  12878. visible: vue.unref(shouldShow),
  12879. "z-index": _ctx.zIndex,
  12880. onMouseenter: vue.unref(onContentEnter),
  12881. onMouseleave: vue.unref(onContentLeave),
  12882. onBlur,
  12883. onClose: vue.unref(onClose)
  12884. }), {
  12885. default: vue.withCtx(() => [
  12886. !destroyed.value ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : vue.createCommentVNode("v-if", true)
  12887. ]),
  12888. _: 3
  12889. }, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "onMouseenter", "onMouseleave", "onClose"])), [
  12890. [vue.vShow, vue.unref(shouldShow)]
  12891. ]) : vue.createCommentVNode("v-if", true)
  12892. ]),
  12893. _: 3
  12894. }, 8, ["name"])
  12895. ], 8, ["disabled", "to"]);
  12896. };
  12897. }
  12898. });
  12899. var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$24, [["__file", "content.vue"]]);
  12900. const _hoisted_1$12 = ["innerHTML"];
  12901. const _hoisted_2$F = { key: 1 };
  12902. const __default__$1n = vue.defineComponent({
  12903. name: "ElTooltip"
  12904. });
  12905. const _sfc_main$23 = /* @__PURE__ */ vue.defineComponent({
  12906. ...__default__$1n,
  12907. props: useTooltipProps,
  12908. emits: tooltipEmits,
  12909. setup(__props, { expose, emit }) {
  12910. const props = __props;
  12911. usePopperContainer();
  12912. const id = useId();
  12913. const popperRef = vue.ref();
  12914. const contentRef = vue.ref();
  12915. const updatePopper = () => {
  12916. var _a;
  12917. const popperComponent = vue.unref(popperRef);
  12918. if (popperComponent) {
  12919. (_a = popperComponent.popperInstanceRef) == null ? void 0 : _a.update();
  12920. }
  12921. };
  12922. const open = vue.ref(false);
  12923. const toggleReason = vue.ref();
  12924. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  12925. indicator: open,
  12926. toggleReason
  12927. });
  12928. const { onOpen, onClose } = useDelayedToggle({
  12929. showAfter: vue.toRef(props, "showAfter"),
  12930. hideAfter: vue.toRef(props, "hideAfter"),
  12931. open: show,
  12932. close: hide
  12933. });
  12934. const controlled = vue.computed(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  12935. vue.provide(TOOLTIP_INJECTION_KEY, {
  12936. controlled,
  12937. id,
  12938. open: vue.readonly(open),
  12939. trigger: vue.toRef(props, "trigger"),
  12940. onOpen: (event) => {
  12941. onOpen(event);
  12942. },
  12943. onClose: (event) => {
  12944. onClose(event);
  12945. },
  12946. onToggle: (event) => {
  12947. if (vue.unref(open)) {
  12948. onClose(event);
  12949. } else {
  12950. onOpen(event);
  12951. }
  12952. },
  12953. onShow: () => {
  12954. emit("show", toggleReason.value);
  12955. },
  12956. onHide: () => {
  12957. emit("hide", toggleReason.value);
  12958. },
  12959. onBeforeShow: () => {
  12960. emit("before-show", toggleReason.value);
  12961. },
  12962. onBeforeHide: () => {
  12963. emit("before-hide", toggleReason.value);
  12964. },
  12965. updatePopper
  12966. });
  12967. vue.watch(() => props.disabled, (disabled) => {
  12968. if (disabled && open.value) {
  12969. open.value = false;
  12970. }
  12971. });
  12972. const isFocusInsideContent = () => {
  12973. var _a, _b;
  12974. const popperContent = (_b = (_a = contentRef.value) == null ? void 0 : _a.contentRef) == null ? void 0 : _b.popperContentRef;
  12975. return popperContent && popperContent.contains(document.activeElement);
  12976. };
  12977. vue.onDeactivated(() => open.value && hide());
  12978. expose({
  12979. popperRef,
  12980. contentRef,
  12981. isFocusInsideContent,
  12982. updatePopper,
  12983. onOpen,
  12984. onClose,
  12985. hide
  12986. });
  12987. return (_ctx, _cache) => {
  12988. return vue.openBlock(), vue.createBlock(vue.unref(ElPopper), {
  12989. ref_key: "popperRef",
  12990. ref: popperRef,
  12991. role: _ctx.role
  12992. }, {
  12993. default: vue.withCtx(() => [
  12994. vue.createVNode(ElTooltipTrigger, {
  12995. disabled: _ctx.disabled,
  12996. trigger: _ctx.trigger,
  12997. "trigger-keys": _ctx.triggerKeys,
  12998. "virtual-ref": _ctx.virtualRef,
  12999. "virtual-triggering": _ctx.virtualTriggering
  13000. }, {
  13001. default: vue.withCtx(() => [
  13002. _ctx.$slots.default ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }) : vue.createCommentVNode("v-if", true)
  13003. ]),
  13004. _: 3
  13005. }, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering"]),
  13006. vue.createVNode(ElTooltipContent, {
  13007. ref_key: "contentRef",
  13008. ref: contentRef,
  13009. "aria-label": _ctx.ariaLabel,
  13010. "boundaries-padding": _ctx.boundariesPadding,
  13011. content: _ctx.content,
  13012. disabled: _ctx.disabled,
  13013. effect: _ctx.effect,
  13014. enterable: _ctx.enterable,
  13015. "fallback-placements": _ctx.fallbackPlacements,
  13016. "hide-after": _ctx.hideAfter,
  13017. "gpu-acceleration": _ctx.gpuAcceleration,
  13018. offset: _ctx.offset,
  13019. persistent: _ctx.persistent,
  13020. "popper-class": _ctx.popperClass,
  13021. "popper-style": _ctx.popperStyle,
  13022. placement: _ctx.placement,
  13023. "popper-options": _ctx.popperOptions,
  13024. pure: _ctx.pure,
  13025. "raw-content": _ctx.rawContent,
  13026. "reference-el": _ctx.referenceEl,
  13027. "trigger-target-el": _ctx.triggerTargetEl,
  13028. "show-after": _ctx.showAfter,
  13029. strategy: _ctx.strategy,
  13030. teleported: _ctx.teleported,
  13031. transition: _ctx.transition,
  13032. "virtual-triggering": _ctx.virtualTriggering,
  13033. "z-index": _ctx.zIndex,
  13034. "append-to": _ctx.appendTo
  13035. }, {
  13036. default: vue.withCtx(() => [
  13037. vue.renderSlot(_ctx.$slots, "content", {}, () => [
  13038. _ctx.rawContent ? (vue.openBlock(), vue.createElementBlock("span", {
  13039. key: 0,
  13040. innerHTML: _ctx.content
  13041. }, null, 8, _hoisted_1$12)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$F, vue.toDisplayString(_ctx.content), 1))
  13042. ]),
  13043. _ctx.showArrow ? (vue.openBlock(), vue.createBlock(vue.unref(ElPopperArrow), {
  13044. key: 0,
  13045. "arrow-offset": _ctx.arrowOffset
  13046. }, null, 8, ["arrow-offset"])) : vue.createCommentVNode("v-if", true)
  13047. ]),
  13048. _: 3
  13049. }, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to"])
  13050. ]),
  13051. _: 3
  13052. }, 8, ["role"]);
  13053. };
  13054. }
  13055. });
  13056. var Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main$23, [["__file", "tooltip.vue"]]);
  13057. const ElTooltip = withInstall(Tooltip);
  13058. const autocompleteProps = buildProps({
  13059. valueKey: {
  13060. type: String,
  13061. default: "value"
  13062. },
  13063. modelValue: {
  13064. type: [String, Number],
  13065. default: ""
  13066. },
  13067. debounce: {
  13068. type: Number,
  13069. default: 300
  13070. },
  13071. placement: {
  13072. type: definePropType(String),
  13073. values: [
  13074. "top",
  13075. "top-start",
  13076. "top-end",
  13077. "bottom",
  13078. "bottom-start",
  13079. "bottom-end"
  13080. ],
  13081. default: "bottom-start"
  13082. },
  13083. fetchSuggestions: {
  13084. type: definePropType([Function, Array]),
  13085. default: NOOP
  13086. },
  13087. popperClass: {
  13088. type: String,
  13089. default: ""
  13090. },
  13091. triggerOnFocus: {
  13092. type: Boolean,
  13093. default: true
  13094. },
  13095. selectWhenUnmatched: {
  13096. type: Boolean,
  13097. default: false
  13098. },
  13099. hideLoading: {
  13100. type: Boolean,
  13101. default: false
  13102. },
  13103. label: {
  13104. type: String
  13105. },
  13106. teleported: useTooltipContentProps.teleported,
  13107. highlightFirstItem: {
  13108. type: Boolean,
  13109. default: false
  13110. },
  13111. fitInputWidth: {
  13112. type: Boolean,
  13113. default: false
  13114. }
  13115. });
  13116. const autocompleteEmits = {
  13117. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  13118. [INPUT_EVENT]: (value) => isString(value),
  13119. [CHANGE_EVENT]: (value) => isString(value),
  13120. focus: (evt) => evt instanceof FocusEvent,
  13121. blur: (evt) => evt instanceof FocusEvent,
  13122. clear: () => true,
  13123. select: (item) => isObject$1(item)
  13124. };
  13125. const _hoisted_1$11 = ["aria-expanded", "aria-owns"];
  13126. const _hoisted_2$E = { key: 0 };
  13127. const _hoisted_3$j = ["id", "aria-selected", "onClick"];
  13128. const COMPONENT_NAME$j = "ElAutocomplete";
  13129. const __default__$1m = vue.defineComponent({
  13130. name: COMPONENT_NAME$j,
  13131. inheritAttrs: false
  13132. });
  13133. const _sfc_main$22 = /* @__PURE__ */ vue.defineComponent({
  13134. ...__default__$1m,
  13135. props: autocompleteProps,
  13136. emits: autocompleteEmits,
  13137. setup(__props, { expose, emit }) {
  13138. const props = __props;
  13139. const attrs = useAttrs();
  13140. const rawAttrs = vue.useAttrs();
  13141. const disabled = useDisabled();
  13142. const ns = useNamespace("autocomplete");
  13143. const inputRef = vue.ref();
  13144. const regionRef = vue.ref();
  13145. const popperRef = vue.ref();
  13146. const listboxRef = vue.ref();
  13147. let readonly = false;
  13148. let ignoreFocusEvent = false;
  13149. const suggestions = vue.ref([]);
  13150. const highlightedIndex = vue.ref(-1);
  13151. const dropdownWidth = vue.ref("");
  13152. const activated = vue.ref(false);
  13153. const suggestionDisabled = vue.ref(false);
  13154. const loading = vue.ref(false);
  13155. const listboxId = vue.computed(() => ns.b(String(generateId())));
  13156. const styles = vue.computed(() => rawAttrs.style);
  13157. const suggestionVisible = vue.computed(() => {
  13158. const isValidData = suggestions.value.length > 0;
  13159. return (isValidData || loading.value) && activated.value;
  13160. });
  13161. const suggestionLoading = vue.computed(() => !props.hideLoading && loading.value);
  13162. const refInput = vue.computed(() => {
  13163. if (inputRef.value) {
  13164. return Array.from(inputRef.value.$el.querySelectorAll("input"));
  13165. }
  13166. return [];
  13167. });
  13168. const onSuggestionShow = async () => {
  13169. await vue.nextTick();
  13170. if (suggestionVisible.value) {
  13171. dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
  13172. }
  13173. };
  13174. const onShow = () => {
  13175. ignoreFocusEvent = true;
  13176. };
  13177. const onHide = () => {
  13178. ignoreFocusEvent = false;
  13179. highlightedIndex.value = -1;
  13180. };
  13181. const getData = async (queryString) => {
  13182. if (suggestionDisabled.value)
  13183. return;
  13184. const cb = (suggestionList) => {
  13185. loading.value = false;
  13186. if (suggestionDisabled.value)
  13187. return;
  13188. if (isArray(suggestionList)) {
  13189. suggestions.value = suggestionList;
  13190. highlightedIndex.value = props.highlightFirstItem ? 0 : -1;
  13191. } else {
  13192. throwError(COMPONENT_NAME$j, "autocomplete suggestions must be an array");
  13193. }
  13194. };
  13195. loading.value = true;
  13196. if (isArray(props.fetchSuggestions)) {
  13197. cb(props.fetchSuggestions);
  13198. } else {
  13199. const result = await props.fetchSuggestions(queryString, cb);
  13200. if (isArray(result))
  13201. cb(result);
  13202. }
  13203. };
  13204. const debouncedGetData = debounce(getData, props.debounce);
  13205. const handleInput = (value) => {
  13206. const valuePresented = !!value;
  13207. emit(INPUT_EVENT, value);
  13208. emit(UPDATE_MODEL_EVENT, value);
  13209. suggestionDisabled.value = false;
  13210. activated.value || (activated.value = valuePresented);
  13211. if (!props.triggerOnFocus && !value) {
  13212. suggestionDisabled.value = true;
  13213. suggestions.value = [];
  13214. return;
  13215. }
  13216. debouncedGetData(value);
  13217. };
  13218. const handleMouseDown = (event) => {
  13219. var _a;
  13220. if (disabled.value)
  13221. return;
  13222. if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
  13223. activated.value = true;
  13224. }
  13225. };
  13226. const handleChange = (value) => {
  13227. emit(CHANGE_EVENT, value);
  13228. };
  13229. const handleFocus = (evt) => {
  13230. if (ignoreFocusEvent)
  13231. return;
  13232. activated.value = true;
  13233. emit("focus", evt);
  13234. if (props.triggerOnFocus && !readonly) {
  13235. debouncedGetData(String(props.modelValue));
  13236. }
  13237. };
  13238. const handleBlur = (evt) => {
  13239. if (ignoreFocusEvent)
  13240. return;
  13241. emit("blur", evt);
  13242. };
  13243. const handleClear = () => {
  13244. activated.value = false;
  13245. emit(UPDATE_MODEL_EVENT, "");
  13246. emit("clear");
  13247. };
  13248. const handleKeyEnter = async () => {
  13249. if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) {
  13250. handleSelect(suggestions.value[highlightedIndex.value]);
  13251. } else if (props.selectWhenUnmatched) {
  13252. emit("select", { value: props.modelValue });
  13253. suggestions.value = [];
  13254. highlightedIndex.value = -1;
  13255. }
  13256. };
  13257. const handleKeyEscape = (evt) => {
  13258. if (suggestionVisible.value) {
  13259. evt.preventDefault();
  13260. evt.stopPropagation();
  13261. close();
  13262. }
  13263. };
  13264. const close = () => {
  13265. activated.value = false;
  13266. };
  13267. const focus = () => {
  13268. var _a;
  13269. (_a = inputRef.value) == null ? void 0 : _a.focus();
  13270. };
  13271. const blur = () => {
  13272. var _a;
  13273. (_a = inputRef.value) == null ? void 0 : _a.blur();
  13274. };
  13275. const handleSelect = async (item) => {
  13276. emit(INPUT_EVENT, item[props.valueKey]);
  13277. emit(UPDATE_MODEL_EVENT, item[props.valueKey]);
  13278. emit("select", item);
  13279. suggestions.value = [];
  13280. highlightedIndex.value = -1;
  13281. };
  13282. const highlight = (index) => {
  13283. if (!suggestionVisible.value || loading.value)
  13284. return;
  13285. if (index < 0) {
  13286. highlightedIndex.value = -1;
  13287. return;
  13288. }
  13289. if (index >= suggestions.value.length) {
  13290. index = suggestions.value.length - 1;
  13291. }
  13292. const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`);
  13293. const suggestionList = suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`);
  13294. const highlightItem = suggestionList[index];
  13295. const scrollTop = suggestion.scrollTop;
  13296. const { offsetTop, scrollHeight } = highlightItem;
  13297. if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) {
  13298. suggestion.scrollTop += scrollHeight;
  13299. }
  13300. if (offsetTop < scrollTop) {
  13301. suggestion.scrollTop -= scrollHeight;
  13302. }
  13303. highlightedIndex.value = index;
  13304. inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
  13305. };
  13306. onClickOutside(listboxRef, () => {
  13307. suggestionVisible.value && close();
  13308. });
  13309. vue.onMounted(() => {
  13310. inputRef.value.ref.setAttribute("role", "textbox");
  13311. inputRef.value.ref.setAttribute("aria-autocomplete", "list");
  13312. inputRef.value.ref.setAttribute("aria-controls", "id");
  13313. inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
  13314. readonly = inputRef.value.ref.hasAttribute("readonly");
  13315. });
  13316. expose({
  13317. highlightedIndex,
  13318. activated,
  13319. loading,
  13320. inputRef,
  13321. popperRef,
  13322. suggestions,
  13323. handleSelect,
  13324. handleKeyEnter,
  13325. focus,
  13326. blur,
  13327. close,
  13328. highlight
  13329. });
  13330. return (_ctx, _cache) => {
  13331. return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), {
  13332. ref_key: "popperRef",
  13333. ref: popperRef,
  13334. visible: vue.unref(suggestionVisible),
  13335. placement: _ctx.placement,
  13336. "fallback-placements": ["bottom-start", "top-start"],
  13337. "popper-class": [vue.unref(ns).e("popper"), _ctx.popperClass],
  13338. teleported: _ctx.teleported,
  13339. "gpu-acceleration": false,
  13340. pure: "",
  13341. "manual-mode": "",
  13342. effect: "light",
  13343. trigger: "click",
  13344. transition: `${vue.unref(ns).namespace.value}-zoom-in-top`,
  13345. persistent: "",
  13346. onBeforeShow: onSuggestionShow,
  13347. onShow,
  13348. onHide
  13349. }, {
  13350. content: vue.withCtx(() => [
  13351. vue.createElementVNode("div", {
  13352. ref_key: "regionRef",
  13353. ref: regionRef,
  13354. class: vue.normalizeClass([vue.unref(ns).b("suggestion"), vue.unref(ns).is("loading", vue.unref(suggestionLoading))]),
  13355. style: vue.normalizeStyle({
  13356. [_ctx.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
  13357. outline: "none"
  13358. }),
  13359. role: "region"
  13360. }, [
  13361. vue.createVNode(vue.unref(ElScrollbar), {
  13362. id: vue.unref(listboxId),
  13363. tag: "ul",
  13364. "wrap-class": vue.unref(ns).be("suggestion", "wrap"),
  13365. "view-class": vue.unref(ns).be("suggestion", "list"),
  13366. role: "listbox"
  13367. }, {
  13368. default: vue.withCtx(() => [
  13369. vue.unref(suggestionLoading) ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_2$E, [
  13370. vue.createVNode(vue.unref(ElIcon), {
  13371. class: vue.normalizeClass(vue.unref(ns).is("loading"))
  13372. }, {
  13373. default: vue.withCtx(() => [
  13374. vue.createVNode(vue.unref(loading_default))
  13375. ]),
  13376. _: 1
  13377. }, 8, ["class"])
  13378. ])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(suggestions.value, (item, index) => {
  13379. return vue.openBlock(), vue.createElementBlock("li", {
  13380. id: `${vue.unref(listboxId)}-item-${index}`,
  13381. key: index,
  13382. class: vue.normalizeClass({ highlighted: highlightedIndex.value === index }),
  13383. role: "option",
  13384. "aria-selected": highlightedIndex.value === index,
  13385. onClick: ($event) => handleSelect(item)
  13386. }, [
  13387. vue.renderSlot(_ctx.$slots, "default", { item }, () => [
  13388. vue.createTextVNode(vue.toDisplayString(item[_ctx.valueKey]), 1)
  13389. ])
  13390. ], 10, _hoisted_3$j);
  13391. }), 128))
  13392. ]),
  13393. _: 3
  13394. }, 8, ["id", "wrap-class", "view-class"])
  13395. ], 6)
  13396. ]),
  13397. default: vue.withCtx(() => [
  13398. vue.createElementVNode("div", {
  13399. ref_key: "listboxRef",
  13400. ref: listboxRef,
  13401. class: vue.normalizeClass([vue.unref(ns).b(), _ctx.$attrs.class]),
  13402. style: vue.normalizeStyle(vue.unref(styles)),
  13403. role: "combobox",
  13404. "aria-haspopup": "listbox",
  13405. "aria-expanded": vue.unref(suggestionVisible),
  13406. "aria-owns": vue.unref(listboxId)
  13407. }, [
  13408. vue.createVNode(vue.unref(ElInput), vue.mergeProps({
  13409. ref_key: "inputRef",
  13410. ref: inputRef
  13411. }, vue.unref(attrs), {
  13412. "model-value": _ctx.modelValue,
  13413. onInput: handleInput,
  13414. onChange: handleChange,
  13415. onFocus: handleFocus,
  13416. onBlur: handleBlur,
  13417. onClear: handleClear,
  13418. onKeydown: [
  13419. _cache[0] || (_cache[0] = vue.withKeys(vue.withModifiers(($event) => highlight(highlightedIndex.value - 1), ["prevent"]), ["up"])),
  13420. _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(($event) => highlight(highlightedIndex.value + 1), ["prevent"]), ["down"])),
  13421. vue.withKeys(handleKeyEnter, ["enter"]),
  13422. vue.withKeys(close, ["tab"]),
  13423. vue.withKeys(handleKeyEscape, ["esc"])
  13424. ],
  13425. onMousedown: handleMouseDown
  13426. }), vue.createSlots({ _: 2 }, [
  13427. _ctx.$slots.prepend ? {
  13428. name: "prepend",
  13429. fn: vue.withCtx(() => [
  13430. vue.renderSlot(_ctx.$slots, "prepend")
  13431. ])
  13432. } : void 0,
  13433. _ctx.$slots.append ? {
  13434. name: "append",
  13435. fn: vue.withCtx(() => [
  13436. vue.renderSlot(_ctx.$slots, "append")
  13437. ])
  13438. } : void 0,
  13439. _ctx.$slots.prefix ? {
  13440. name: "prefix",
  13441. fn: vue.withCtx(() => [
  13442. vue.renderSlot(_ctx.$slots, "prefix")
  13443. ])
  13444. } : void 0,
  13445. _ctx.$slots.suffix ? {
  13446. name: "suffix",
  13447. fn: vue.withCtx(() => [
  13448. vue.renderSlot(_ctx.$slots, "suffix")
  13449. ])
  13450. } : void 0
  13451. ]), 1040, ["model-value", "onKeydown"])
  13452. ], 14, _hoisted_1$11)
  13453. ]),
  13454. _: 3
  13455. }, 8, ["visible", "placement", "popper-class", "teleported", "transition"]);
  13456. };
  13457. }
  13458. });
  13459. var Autocomplete = /* @__PURE__ */ _export_sfc(_sfc_main$22, [["__file", "autocomplete.vue"]]);
  13460. const ElAutocomplete = withInstall(Autocomplete);
  13461. const avatarProps = buildProps({
  13462. size: {
  13463. type: [Number, String],
  13464. values: componentSizes,
  13465. default: "",
  13466. validator: (val) => isNumber(val)
  13467. },
  13468. shape: {
  13469. type: String,
  13470. values: ["circle", "square"],
  13471. default: "circle"
  13472. },
  13473. icon: {
  13474. type: iconPropType
  13475. },
  13476. src: {
  13477. type: String,
  13478. default: ""
  13479. },
  13480. alt: String,
  13481. srcSet: String,
  13482. fit: {
  13483. type: definePropType(String),
  13484. default: "cover"
  13485. }
  13486. });
  13487. const avatarEmits = {
  13488. error: (evt) => evt instanceof Event
  13489. };
  13490. const _hoisted_1$10 = ["src", "alt", "srcset"];
  13491. const __default__$1l = vue.defineComponent({
  13492. name: "ElAvatar"
  13493. });
  13494. const _sfc_main$21 = /* @__PURE__ */ vue.defineComponent({
  13495. ...__default__$1l,
  13496. props: avatarProps,
  13497. emits: avatarEmits,
  13498. setup(__props, { emit }) {
  13499. const props = __props;
  13500. const ns = useNamespace("avatar");
  13501. const hasLoadError = vue.ref(false);
  13502. const avatarClass = vue.computed(() => {
  13503. const { size, icon, shape } = props;
  13504. const classList = [ns.b()];
  13505. if (isString(size))
  13506. classList.push(ns.m(size));
  13507. if (icon)
  13508. classList.push(ns.m("icon"));
  13509. if (shape)
  13510. classList.push(ns.m(shape));
  13511. return classList;
  13512. });
  13513. const sizeStyle = vue.computed(() => {
  13514. const { size } = props;
  13515. return isNumber(size) ? ns.cssVarBlock({
  13516. size: addUnit(size) || ""
  13517. }) : void 0;
  13518. });
  13519. const fitStyle = vue.computed(() => ({
  13520. objectFit: props.fit
  13521. }));
  13522. vue.watch(() => props.src, () => hasLoadError.value = false);
  13523. function handleError(e) {
  13524. hasLoadError.value = true;
  13525. emit("error", e);
  13526. }
  13527. return (_ctx, _cache) => {
  13528. return vue.openBlock(), vue.createElementBlock("span", {
  13529. class: vue.normalizeClass(vue.unref(avatarClass)),
  13530. style: vue.normalizeStyle(vue.unref(sizeStyle))
  13531. }, [
  13532. (_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", {
  13533. key: 0,
  13534. src: _ctx.src,
  13535. alt: _ctx.alt,
  13536. srcset: _ctx.srcSet,
  13537. style: vue.normalizeStyle(vue.unref(fitStyle)),
  13538. onError: handleError
  13539. }, null, 44, _hoisted_1$10)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 1 }, {
  13540. default: vue.withCtx(() => [
  13541. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  13542. ]),
  13543. _: 1
  13544. })) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
  13545. ], 6);
  13546. };
  13547. }
  13548. });
  13549. var Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$21, [["__file", "avatar.vue"]]);
  13550. const ElAvatar = withInstall(Avatar);
  13551. const backtopProps = {
  13552. visibilityHeight: {
  13553. type: Number,
  13554. default: 200
  13555. },
  13556. target: {
  13557. type: String,
  13558. default: ""
  13559. },
  13560. right: {
  13561. type: Number,
  13562. default: 40
  13563. },
  13564. bottom: {
  13565. type: Number,
  13566. default: 40
  13567. }
  13568. };
  13569. const backtopEmits = {
  13570. click: (evt) => evt instanceof MouseEvent
  13571. };
  13572. const useBackTop = (props, emit, componentName) => {
  13573. const el = vue.shallowRef();
  13574. const container = vue.shallowRef();
  13575. const visible = vue.ref(false);
  13576. const scrollToTop = () => {
  13577. if (!el.value)
  13578. return;
  13579. const beginTime = Date.now();
  13580. const beginValue = el.value.scrollTop;
  13581. const frameFunc = () => {
  13582. if (!el.value)
  13583. return;
  13584. const progress = (Date.now() - beginTime) / 500;
  13585. if (progress < 1) {
  13586. el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress));
  13587. requestAnimationFrame(frameFunc);
  13588. } else {
  13589. el.value.scrollTop = 0;
  13590. }
  13591. };
  13592. requestAnimationFrame(frameFunc);
  13593. };
  13594. const handleScroll = () => {
  13595. if (el.value)
  13596. visible.value = el.value.scrollTop >= props.visibilityHeight;
  13597. };
  13598. const handleClick = (event) => {
  13599. scrollToTop();
  13600. emit("click", event);
  13601. };
  13602. const handleScrollThrottled = useThrottleFn(handleScroll, 300, true);
  13603. useEventListener(container, "scroll", handleScrollThrottled);
  13604. vue.onMounted(() => {
  13605. var _a;
  13606. container.value = document;
  13607. el.value = document.documentElement;
  13608. if (props.target) {
  13609. el.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
  13610. if (!el.value) {
  13611. throwError(componentName, `target does not exist: ${props.target}`);
  13612. }
  13613. container.value = el.value;
  13614. }
  13615. });
  13616. return {
  13617. visible,
  13618. handleClick
  13619. };
  13620. };
  13621. const COMPONENT_NAME$i = "ElBacktop";
  13622. const __default__$1k = vue.defineComponent({
  13623. name: COMPONENT_NAME$i
  13624. });
  13625. const _sfc_main$20 = /* @__PURE__ */ vue.defineComponent({
  13626. ...__default__$1k,
  13627. props: backtopProps,
  13628. emits: backtopEmits,
  13629. setup(__props, { emit }) {
  13630. const props = __props;
  13631. const ns = useNamespace("backtop");
  13632. const { handleClick, visible } = useBackTop(props, emit, COMPONENT_NAME$i);
  13633. const backTopStyle = vue.computed(() => ({
  13634. right: `${props.right}px`,
  13635. bottom: `${props.bottom}px`
  13636. }));
  13637. return (_ctx, _cache) => {
  13638. return vue.openBlock(), vue.createBlock(vue.Transition, {
  13639. name: `${vue.unref(ns).namespace.value}-fade-in`
  13640. }, {
  13641. default: vue.withCtx(() => [
  13642. vue.unref(visible) ? (vue.openBlock(), vue.createElementBlock("div", {
  13643. key: 0,
  13644. style: vue.normalizeStyle(vue.unref(backTopStyle)),
  13645. class: vue.normalizeClass(vue.unref(ns).b()),
  13646. onClick: _cache[0] || (_cache[0] = vue.withModifiers((...args) => vue.unref(handleClick) && vue.unref(handleClick)(...args), ["stop"]))
  13647. }, [
  13648. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  13649. vue.createVNode(vue.unref(ElIcon), {
  13650. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  13651. }, {
  13652. default: vue.withCtx(() => [
  13653. vue.createVNode(vue.unref(caret_top_default))
  13654. ]),
  13655. _: 1
  13656. }, 8, ["class"])
  13657. ])
  13658. ], 6)) : vue.createCommentVNode("v-if", true)
  13659. ]),
  13660. _: 3
  13661. }, 8, ["name"]);
  13662. };
  13663. }
  13664. });
  13665. var Backtop = /* @__PURE__ */ _export_sfc(_sfc_main$20, [["__file", "backtop.vue"]]);
  13666. const ElBacktop = withInstall(Backtop);
  13667. const badgeProps = buildProps({
  13668. value: {
  13669. type: [String, Number],
  13670. default: ""
  13671. },
  13672. max: {
  13673. type: Number,
  13674. default: 99
  13675. },
  13676. isDot: Boolean,
  13677. hidden: Boolean,
  13678. type: {
  13679. type: String,
  13680. values: ["primary", "success", "warning", "info", "danger"],
  13681. default: "danger"
  13682. }
  13683. });
  13684. const _hoisted_1$$ = ["textContent"];
  13685. const __default__$1j = vue.defineComponent({
  13686. name: "ElBadge"
  13687. });
  13688. const _sfc_main$1$ = /* @__PURE__ */ vue.defineComponent({
  13689. ...__default__$1j,
  13690. props: badgeProps,
  13691. setup(__props, { expose }) {
  13692. const props = __props;
  13693. const ns = useNamespace("badge");
  13694. const content = vue.computed(() => {
  13695. if (props.isDot)
  13696. return "";
  13697. if (isNumber(props.value) && isNumber(props.max)) {
  13698. return props.max < props.value ? `${props.max}+` : `${props.value}`;
  13699. }
  13700. return `${props.value}`;
  13701. });
  13702. expose({
  13703. content
  13704. });
  13705. return (_ctx, _cache) => {
  13706. return vue.openBlock(), vue.createElementBlock("div", {
  13707. class: vue.normalizeClass(vue.unref(ns).b())
  13708. }, [
  13709. vue.renderSlot(_ctx.$slots, "default"),
  13710. vue.createVNode(vue.Transition, {
  13711. name: `${vue.unref(ns).namespace.value}-zoom-in-center`,
  13712. persisted: ""
  13713. }, {
  13714. default: vue.withCtx(() => [
  13715. vue.withDirectives(vue.createElementVNode("sup", {
  13716. class: vue.normalizeClass([
  13717. vue.unref(ns).e("content"),
  13718. vue.unref(ns).em("content", _ctx.type),
  13719. vue.unref(ns).is("fixed", !!_ctx.$slots.default),
  13720. vue.unref(ns).is("dot", _ctx.isDot)
  13721. ]),
  13722. textContent: vue.toDisplayString(vue.unref(content))
  13723. }, null, 10, _hoisted_1$$), [
  13724. [vue.vShow, !_ctx.hidden && (vue.unref(content) || _ctx.isDot)]
  13725. ])
  13726. ]),
  13727. _: 1
  13728. }, 8, ["name"])
  13729. ], 2);
  13730. };
  13731. }
  13732. });
  13733. var Badge = /* @__PURE__ */ _export_sfc(_sfc_main$1$, [["__file", "badge.vue"]]);
  13734. const ElBadge = withInstall(Badge);
  13735. const breadcrumbProps = buildProps({
  13736. separator: {
  13737. type: String,
  13738. default: "/"
  13739. },
  13740. separatorIcon: {
  13741. type: iconPropType
  13742. }
  13743. });
  13744. const __default__$1i = vue.defineComponent({
  13745. name: "ElBreadcrumb"
  13746. });
  13747. const _sfc_main$1_ = /* @__PURE__ */ vue.defineComponent({
  13748. ...__default__$1i,
  13749. props: breadcrumbProps,
  13750. setup(__props) {
  13751. const props = __props;
  13752. const ns = useNamespace("breadcrumb");
  13753. const breadcrumb = vue.ref();
  13754. vue.provide(breadcrumbKey, props);
  13755. vue.onMounted(() => {
  13756. const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
  13757. if (items.length) {
  13758. items[items.length - 1].setAttribute("aria-current", "page");
  13759. }
  13760. });
  13761. return (_ctx, _cache) => {
  13762. return vue.openBlock(), vue.createElementBlock("div", {
  13763. ref_key: "breadcrumb",
  13764. ref: breadcrumb,
  13765. class: vue.normalizeClass(vue.unref(ns).b()),
  13766. "aria-label": "Breadcrumb",
  13767. role: "navigation"
  13768. }, [
  13769. vue.renderSlot(_ctx.$slots, "default")
  13770. ], 2);
  13771. };
  13772. }
  13773. });
  13774. var Breadcrumb = /* @__PURE__ */ _export_sfc(_sfc_main$1_, [["__file", "breadcrumb.vue"]]);
  13775. const breadcrumbItemProps = buildProps({
  13776. to: {
  13777. type: definePropType([String, Object]),
  13778. default: ""
  13779. },
  13780. replace: {
  13781. type: Boolean,
  13782. default: false
  13783. }
  13784. });
  13785. const __default__$1h = vue.defineComponent({
  13786. name: "ElBreadcrumbItem"
  13787. });
  13788. const _sfc_main$1Z = /* @__PURE__ */ vue.defineComponent({
  13789. ...__default__$1h,
  13790. props: breadcrumbItemProps,
  13791. setup(__props) {
  13792. const props = __props;
  13793. const instance = vue.getCurrentInstance();
  13794. const breadcrumbContext = vue.inject(breadcrumbKey, void 0);
  13795. const ns = useNamespace("breadcrumb");
  13796. const { separator, separatorIcon } = vue.toRefs(breadcrumbContext);
  13797. const router = instance.appContext.config.globalProperties.$router;
  13798. const link = vue.ref();
  13799. const onClick = () => {
  13800. if (!props.to || !router)
  13801. return;
  13802. props.replace ? router.replace(props.to) : router.push(props.to);
  13803. };
  13804. return (_ctx, _cache) => {
  13805. return vue.openBlock(), vue.createElementBlock("span", {
  13806. class: vue.normalizeClass(vue.unref(ns).e("item"))
  13807. }, [
  13808. vue.createElementVNode("span", {
  13809. ref_key: "link",
  13810. ref: link,
  13811. class: vue.normalizeClass([vue.unref(ns).e("inner"), vue.unref(ns).is("link", !!_ctx.to)]),
  13812. role: "link",
  13813. onClick
  13814. }, [
  13815. vue.renderSlot(_ctx.$slots, "default")
  13816. ], 2),
  13817. vue.unref(separatorIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  13818. key: 0,
  13819. class: vue.normalizeClass(vue.unref(ns).e("separator"))
  13820. }, {
  13821. default: vue.withCtx(() => [
  13822. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(separatorIcon))))
  13823. ]),
  13824. _: 1
  13825. }, 8, ["class"])) : (vue.openBlock(), vue.createElementBlock("span", {
  13826. key: 1,
  13827. class: vue.normalizeClass(vue.unref(ns).e("separator")),
  13828. role: "presentation"
  13829. }, vue.toDisplayString(vue.unref(separator)), 3))
  13830. ], 2);
  13831. };
  13832. }
  13833. });
  13834. var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main$1Z, [["__file", "breadcrumb-item.vue"]]);
  13835. const ElBreadcrumb = withInstall(Breadcrumb, {
  13836. BreadcrumbItem
  13837. });
  13838. const ElBreadcrumbItem = withNoopInstall(BreadcrumbItem);
  13839. const useButton = (props, emit) => {
  13840. useDeprecated({
  13841. from: "type.text",
  13842. replacement: "link",
  13843. version: "3.0.0",
  13844. scope: "props",
  13845. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  13846. }, vue.computed(() => props.type === "text"));
  13847. const buttonGroupContext = vue.inject(buttonGroupContextKey, void 0);
  13848. const globalConfig = useGlobalConfig("button");
  13849. const { form } = useFormItem();
  13850. const _size = useSize(vue.computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
  13851. const _disabled = useDisabled();
  13852. const _ref = vue.ref();
  13853. const slots = vue.useSlots();
  13854. const _type = vue.computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
  13855. const autoInsertSpace = vue.computed(() => {
  13856. var _a, _b, _c;
  13857. return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
  13858. });
  13859. const shouldAddSpace = vue.computed(() => {
  13860. var _a;
  13861. const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
  13862. if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
  13863. const slot = defaultSlot[0];
  13864. if ((slot == null ? void 0 : slot.type) === vue.Text) {
  13865. const text = slot.children;
  13866. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  13867. }
  13868. }
  13869. return false;
  13870. });
  13871. const handleClick = (evt) => {
  13872. if (props.nativeType === "reset") {
  13873. form == null ? void 0 : form.resetFields();
  13874. }
  13875. emit("click", evt);
  13876. };
  13877. return {
  13878. _disabled,
  13879. _size,
  13880. _type,
  13881. _ref,
  13882. shouldAddSpace,
  13883. handleClick
  13884. };
  13885. };
  13886. const buttonTypes = [
  13887. "default",
  13888. "primary",
  13889. "success",
  13890. "warning",
  13891. "info",
  13892. "danger",
  13893. "text",
  13894. ""
  13895. ];
  13896. const buttonNativeTypes = ["button", "submit", "reset"];
  13897. const buttonProps = buildProps({
  13898. size: useSizeProp,
  13899. disabled: Boolean,
  13900. type: {
  13901. type: String,
  13902. values: buttonTypes,
  13903. default: ""
  13904. },
  13905. icon: {
  13906. type: iconPropType
  13907. },
  13908. nativeType: {
  13909. type: String,
  13910. values: buttonNativeTypes,
  13911. default: "button"
  13912. },
  13913. loading: Boolean,
  13914. loadingIcon: {
  13915. type: iconPropType,
  13916. default: () => loading_default
  13917. },
  13918. plain: Boolean,
  13919. text: Boolean,
  13920. link: Boolean,
  13921. bg: Boolean,
  13922. autofocus: Boolean,
  13923. round: Boolean,
  13924. circle: Boolean,
  13925. color: String,
  13926. dark: Boolean,
  13927. autoInsertSpace: {
  13928. type: Boolean,
  13929. default: void 0
  13930. }
  13931. });
  13932. const buttonEmits = {
  13933. click: (evt) => evt instanceof MouseEvent
  13934. };
  13935. function bound01$1(n, max) {
  13936. if (isOnePointZero$1(n)) {
  13937. n = "100%";
  13938. }
  13939. var isPercent = isPercentage$1(n);
  13940. n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
  13941. if (isPercent) {
  13942. n = parseInt(String(n * max), 10) / 100;
  13943. }
  13944. if (Math.abs(n - max) < 1e-6) {
  13945. return 1;
  13946. }
  13947. if (max === 360) {
  13948. n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
  13949. } else {
  13950. n = n % max / parseFloat(String(max));
  13951. }
  13952. return n;
  13953. }
  13954. function clamp01(val) {
  13955. return Math.min(1, Math.max(0, val));
  13956. }
  13957. function isOnePointZero$1(n) {
  13958. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  13959. }
  13960. function isPercentage$1(n) {
  13961. return typeof n === "string" && n.indexOf("%") !== -1;
  13962. }
  13963. function boundAlpha(a) {
  13964. a = parseFloat(a);
  13965. if (isNaN(a) || a < 0 || a > 1) {
  13966. a = 1;
  13967. }
  13968. return a;
  13969. }
  13970. function convertToPercentage(n) {
  13971. if (n <= 1) {
  13972. return "".concat(Number(n) * 100, "%");
  13973. }
  13974. return n;
  13975. }
  13976. function pad2(c) {
  13977. return c.length === 1 ? "0" + c : String(c);
  13978. }
  13979. function rgbToRgb(r, g, b) {
  13980. return {
  13981. r: bound01$1(r, 255) * 255,
  13982. g: bound01$1(g, 255) * 255,
  13983. b: bound01$1(b, 255) * 255
  13984. };
  13985. }
  13986. function rgbToHsl(r, g, b) {
  13987. r = bound01$1(r, 255);
  13988. g = bound01$1(g, 255);
  13989. b = bound01$1(b, 255);
  13990. var max = Math.max(r, g, b);
  13991. var min = Math.min(r, g, b);
  13992. var h = 0;
  13993. var s = 0;
  13994. var l = (max + min) / 2;
  13995. if (max === min) {
  13996. s = 0;
  13997. h = 0;
  13998. } else {
  13999. var d = max - min;
  14000. s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
  14001. switch (max) {
  14002. case r:
  14003. h = (g - b) / d + (g < b ? 6 : 0);
  14004. break;
  14005. case g:
  14006. h = (b - r) / d + 2;
  14007. break;
  14008. case b:
  14009. h = (r - g) / d + 4;
  14010. break;
  14011. }
  14012. h /= 6;
  14013. }
  14014. return { h, s, l };
  14015. }
  14016. function hue2rgb(p, q, t) {
  14017. if (t < 0) {
  14018. t += 1;
  14019. }
  14020. if (t > 1) {
  14021. t -= 1;
  14022. }
  14023. if (t < 1 / 6) {
  14024. return p + (q - p) * (6 * t);
  14025. }
  14026. if (t < 1 / 2) {
  14027. return q;
  14028. }
  14029. if (t < 2 / 3) {
  14030. return p + (q - p) * (2 / 3 - t) * 6;
  14031. }
  14032. return p;
  14033. }
  14034. function hslToRgb(h, s, l) {
  14035. var r;
  14036. var g;
  14037. var b;
  14038. h = bound01$1(h, 360);
  14039. s = bound01$1(s, 100);
  14040. l = bound01$1(l, 100);
  14041. if (s === 0) {
  14042. g = l;
  14043. b = l;
  14044. r = l;
  14045. } else {
  14046. var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
  14047. var p = 2 * l - q;
  14048. r = hue2rgb(p, q, h + 1 / 3);
  14049. g = hue2rgb(p, q, h);
  14050. b = hue2rgb(p, q, h - 1 / 3);
  14051. }
  14052. return { r: r * 255, g: g * 255, b: b * 255 };
  14053. }
  14054. function rgbToHsv(r, g, b) {
  14055. r = bound01$1(r, 255);
  14056. g = bound01$1(g, 255);
  14057. b = bound01$1(b, 255);
  14058. var max = Math.max(r, g, b);
  14059. var min = Math.min(r, g, b);
  14060. var h = 0;
  14061. var v = max;
  14062. var d = max - min;
  14063. var s = max === 0 ? 0 : d / max;
  14064. if (max === min) {
  14065. h = 0;
  14066. } else {
  14067. switch (max) {
  14068. case r:
  14069. h = (g - b) / d + (g < b ? 6 : 0);
  14070. break;
  14071. case g:
  14072. h = (b - r) / d + 2;
  14073. break;
  14074. case b:
  14075. h = (r - g) / d + 4;
  14076. break;
  14077. }
  14078. h /= 6;
  14079. }
  14080. return { h, s, v };
  14081. }
  14082. function hsvToRgb(h, s, v) {
  14083. h = bound01$1(h, 360) * 6;
  14084. s = bound01$1(s, 100);
  14085. v = bound01$1(v, 100);
  14086. var i = Math.floor(h);
  14087. var f = h - i;
  14088. var p = v * (1 - s);
  14089. var q = v * (1 - f * s);
  14090. var t = v * (1 - (1 - f) * s);
  14091. var mod = i % 6;
  14092. var r = [v, q, p, p, t, v][mod];
  14093. var g = [t, v, v, q, p, p][mod];
  14094. var b = [p, p, t, v, v, q][mod];
  14095. return { r: r * 255, g: g * 255, b: b * 255 };
  14096. }
  14097. function rgbToHex(r, g, b, allow3Char) {
  14098. var hex = [
  14099. pad2(Math.round(r).toString(16)),
  14100. pad2(Math.round(g).toString(16)),
  14101. pad2(Math.round(b).toString(16))
  14102. ];
  14103. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
  14104. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  14105. }
  14106. return hex.join("");
  14107. }
  14108. function rgbaToHex(r, g, b, a, allow4Char) {
  14109. var hex = [
  14110. pad2(Math.round(r).toString(16)),
  14111. pad2(Math.round(g).toString(16)),
  14112. pad2(Math.round(b).toString(16)),
  14113. pad2(convertDecimalToHex(a))
  14114. ];
  14115. if (allow4Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1)) && hex[3].startsWith(hex[3].charAt(1))) {
  14116. return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  14117. }
  14118. return hex.join("");
  14119. }
  14120. function convertDecimalToHex(d) {
  14121. return Math.round(parseFloat(d) * 255).toString(16);
  14122. }
  14123. function convertHexToDecimal(h) {
  14124. return parseIntFromHex(h) / 255;
  14125. }
  14126. function parseIntFromHex(val) {
  14127. return parseInt(val, 16);
  14128. }
  14129. function numberInputToObject(color) {
  14130. return {
  14131. r: color >> 16,
  14132. g: (color & 65280) >> 8,
  14133. b: color & 255
  14134. };
  14135. }
  14136. var names = {
  14137. aliceblue: "#f0f8ff",
  14138. antiquewhite: "#faebd7",
  14139. aqua: "#00ffff",
  14140. aquamarine: "#7fffd4",
  14141. azure: "#f0ffff",
  14142. beige: "#f5f5dc",
  14143. bisque: "#ffe4c4",
  14144. black: "#000000",
  14145. blanchedalmond: "#ffebcd",
  14146. blue: "#0000ff",
  14147. blueviolet: "#8a2be2",
  14148. brown: "#a52a2a",
  14149. burlywood: "#deb887",
  14150. cadetblue: "#5f9ea0",
  14151. chartreuse: "#7fff00",
  14152. chocolate: "#d2691e",
  14153. coral: "#ff7f50",
  14154. cornflowerblue: "#6495ed",
  14155. cornsilk: "#fff8dc",
  14156. crimson: "#dc143c",
  14157. cyan: "#00ffff",
  14158. darkblue: "#00008b",
  14159. darkcyan: "#008b8b",
  14160. darkgoldenrod: "#b8860b",
  14161. darkgray: "#a9a9a9",
  14162. darkgreen: "#006400",
  14163. darkgrey: "#a9a9a9",
  14164. darkkhaki: "#bdb76b",
  14165. darkmagenta: "#8b008b",
  14166. darkolivegreen: "#556b2f",
  14167. darkorange: "#ff8c00",
  14168. darkorchid: "#9932cc",
  14169. darkred: "#8b0000",
  14170. darksalmon: "#e9967a",
  14171. darkseagreen: "#8fbc8f",
  14172. darkslateblue: "#483d8b",
  14173. darkslategray: "#2f4f4f",
  14174. darkslategrey: "#2f4f4f",
  14175. darkturquoise: "#00ced1",
  14176. darkviolet: "#9400d3",
  14177. deeppink: "#ff1493",
  14178. deepskyblue: "#00bfff",
  14179. dimgray: "#696969",
  14180. dimgrey: "#696969",
  14181. dodgerblue: "#1e90ff",
  14182. firebrick: "#b22222",
  14183. floralwhite: "#fffaf0",
  14184. forestgreen: "#228b22",
  14185. fuchsia: "#ff00ff",
  14186. gainsboro: "#dcdcdc",
  14187. ghostwhite: "#f8f8ff",
  14188. goldenrod: "#daa520",
  14189. gold: "#ffd700",
  14190. gray: "#808080",
  14191. green: "#008000",
  14192. greenyellow: "#adff2f",
  14193. grey: "#808080",
  14194. honeydew: "#f0fff0",
  14195. hotpink: "#ff69b4",
  14196. indianred: "#cd5c5c",
  14197. indigo: "#4b0082",
  14198. ivory: "#fffff0",
  14199. khaki: "#f0e68c",
  14200. lavenderblush: "#fff0f5",
  14201. lavender: "#e6e6fa",
  14202. lawngreen: "#7cfc00",
  14203. lemonchiffon: "#fffacd",
  14204. lightblue: "#add8e6",
  14205. lightcoral: "#f08080",
  14206. lightcyan: "#e0ffff",
  14207. lightgoldenrodyellow: "#fafad2",
  14208. lightgray: "#d3d3d3",
  14209. lightgreen: "#90ee90",
  14210. lightgrey: "#d3d3d3",
  14211. lightpink: "#ffb6c1",
  14212. lightsalmon: "#ffa07a",
  14213. lightseagreen: "#20b2aa",
  14214. lightskyblue: "#87cefa",
  14215. lightslategray: "#778899",
  14216. lightslategrey: "#778899",
  14217. lightsteelblue: "#b0c4de",
  14218. lightyellow: "#ffffe0",
  14219. lime: "#00ff00",
  14220. limegreen: "#32cd32",
  14221. linen: "#faf0e6",
  14222. magenta: "#ff00ff",
  14223. maroon: "#800000",
  14224. mediumaquamarine: "#66cdaa",
  14225. mediumblue: "#0000cd",
  14226. mediumorchid: "#ba55d3",
  14227. mediumpurple: "#9370db",
  14228. mediumseagreen: "#3cb371",
  14229. mediumslateblue: "#7b68ee",
  14230. mediumspringgreen: "#00fa9a",
  14231. mediumturquoise: "#48d1cc",
  14232. mediumvioletred: "#c71585",
  14233. midnightblue: "#191970",
  14234. mintcream: "#f5fffa",
  14235. mistyrose: "#ffe4e1",
  14236. moccasin: "#ffe4b5",
  14237. navajowhite: "#ffdead",
  14238. navy: "#000080",
  14239. oldlace: "#fdf5e6",
  14240. olive: "#808000",
  14241. olivedrab: "#6b8e23",
  14242. orange: "#ffa500",
  14243. orangered: "#ff4500",
  14244. orchid: "#da70d6",
  14245. palegoldenrod: "#eee8aa",
  14246. palegreen: "#98fb98",
  14247. paleturquoise: "#afeeee",
  14248. palevioletred: "#db7093",
  14249. papayawhip: "#ffefd5",
  14250. peachpuff: "#ffdab9",
  14251. peru: "#cd853f",
  14252. pink: "#ffc0cb",
  14253. plum: "#dda0dd",
  14254. powderblue: "#b0e0e6",
  14255. purple: "#800080",
  14256. rebeccapurple: "#663399",
  14257. red: "#ff0000",
  14258. rosybrown: "#bc8f8f",
  14259. royalblue: "#4169e1",
  14260. saddlebrown: "#8b4513",
  14261. salmon: "#fa8072",
  14262. sandybrown: "#f4a460",
  14263. seagreen: "#2e8b57",
  14264. seashell: "#fff5ee",
  14265. sienna: "#a0522d",
  14266. silver: "#c0c0c0",
  14267. skyblue: "#87ceeb",
  14268. slateblue: "#6a5acd",
  14269. slategray: "#708090",
  14270. slategrey: "#708090",
  14271. snow: "#fffafa",
  14272. springgreen: "#00ff7f",
  14273. steelblue: "#4682b4",
  14274. tan: "#d2b48c",
  14275. teal: "#008080",
  14276. thistle: "#d8bfd8",
  14277. tomato: "#ff6347",
  14278. turquoise: "#40e0d0",
  14279. violet: "#ee82ee",
  14280. wheat: "#f5deb3",
  14281. white: "#ffffff",
  14282. whitesmoke: "#f5f5f5",
  14283. yellow: "#ffff00",
  14284. yellowgreen: "#9acd32"
  14285. };
  14286. function inputToRGB(color) {
  14287. var rgb = { r: 0, g: 0, b: 0 };
  14288. var a = 1;
  14289. var s = null;
  14290. var v = null;
  14291. var l = null;
  14292. var ok = false;
  14293. var format = false;
  14294. if (typeof color === "string") {
  14295. color = stringInputToObject(color);
  14296. }
  14297. if (typeof color === "object") {
  14298. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  14299. rgb = rgbToRgb(color.r, color.g, color.b);
  14300. ok = true;
  14301. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  14302. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  14303. s = convertToPercentage(color.s);
  14304. v = convertToPercentage(color.v);
  14305. rgb = hsvToRgb(color.h, s, v);
  14306. ok = true;
  14307. format = "hsv";
  14308. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  14309. s = convertToPercentage(color.s);
  14310. l = convertToPercentage(color.l);
  14311. rgb = hslToRgb(color.h, s, l);
  14312. ok = true;
  14313. format = "hsl";
  14314. }
  14315. if (Object.prototype.hasOwnProperty.call(color, "a")) {
  14316. a = color.a;
  14317. }
  14318. }
  14319. a = boundAlpha(a);
  14320. return {
  14321. ok,
  14322. format: color.format || format,
  14323. r: Math.min(255, Math.max(rgb.r, 0)),
  14324. g: Math.min(255, Math.max(rgb.g, 0)),
  14325. b: Math.min(255, Math.max(rgb.b, 0)),
  14326. a
  14327. };
  14328. }
  14329. var CSS_INTEGER = "[-\\+]?\\d+%?";
  14330. var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
  14331. var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
  14332. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  14333. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  14334. var matchers = {
  14335. CSS_UNIT: new RegExp(CSS_UNIT),
  14336. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  14337. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  14338. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  14339. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  14340. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  14341. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  14342. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  14343. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  14344. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  14345. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  14346. };
  14347. function stringInputToObject(color) {
  14348. color = color.trim().toLowerCase();
  14349. if (color.length === 0) {
  14350. return false;
  14351. }
  14352. var named = false;
  14353. if (names[color]) {
  14354. color = names[color];
  14355. named = true;
  14356. } else if (color === "transparent") {
  14357. return { r: 0, g: 0, b: 0, a: 0, format: "name" };
  14358. }
  14359. var match = matchers.rgb.exec(color);
  14360. if (match) {
  14361. return { r: match[1], g: match[2], b: match[3] };
  14362. }
  14363. match = matchers.rgba.exec(color);
  14364. if (match) {
  14365. return { r: match[1], g: match[2], b: match[3], a: match[4] };
  14366. }
  14367. match = matchers.hsl.exec(color);
  14368. if (match) {
  14369. return { h: match[1], s: match[2], l: match[3] };
  14370. }
  14371. match = matchers.hsla.exec(color);
  14372. if (match) {
  14373. return { h: match[1], s: match[2], l: match[3], a: match[4] };
  14374. }
  14375. match = matchers.hsv.exec(color);
  14376. if (match) {
  14377. return { h: match[1], s: match[2], v: match[3] };
  14378. }
  14379. match = matchers.hsva.exec(color);
  14380. if (match) {
  14381. return { h: match[1], s: match[2], v: match[3], a: match[4] };
  14382. }
  14383. match = matchers.hex8.exec(color);
  14384. if (match) {
  14385. return {
  14386. r: parseIntFromHex(match[1]),
  14387. g: parseIntFromHex(match[2]),
  14388. b: parseIntFromHex(match[3]),
  14389. a: convertHexToDecimal(match[4]),
  14390. format: named ? "name" : "hex8"
  14391. };
  14392. }
  14393. match = matchers.hex6.exec(color);
  14394. if (match) {
  14395. return {
  14396. r: parseIntFromHex(match[1]),
  14397. g: parseIntFromHex(match[2]),
  14398. b: parseIntFromHex(match[3]),
  14399. format: named ? "name" : "hex"
  14400. };
  14401. }
  14402. match = matchers.hex4.exec(color);
  14403. if (match) {
  14404. return {
  14405. r: parseIntFromHex(match[1] + match[1]),
  14406. g: parseIntFromHex(match[2] + match[2]),
  14407. b: parseIntFromHex(match[3] + match[3]),
  14408. a: convertHexToDecimal(match[4] + match[4]),
  14409. format: named ? "name" : "hex8"
  14410. };
  14411. }
  14412. match = matchers.hex3.exec(color);
  14413. if (match) {
  14414. return {
  14415. r: parseIntFromHex(match[1] + match[1]),
  14416. g: parseIntFromHex(match[2] + match[2]),
  14417. b: parseIntFromHex(match[3] + match[3]),
  14418. format: named ? "name" : "hex"
  14419. };
  14420. }
  14421. return false;
  14422. }
  14423. function isValidCSSUnit(color) {
  14424. return Boolean(matchers.CSS_UNIT.exec(String(color)));
  14425. }
  14426. var TinyColor = function() {
  14427. function TinyColor2(color, opts) {
  14428. if (color === void 0) {
  14429. color = "";
  14430. }
  14431. if (opts === void 0) {
  14432. opts = {};
  14433. }
  14434. var _a;
  14435. if (color instanceof TinyColor2) {
  14436. return color;
  14437. }
  14438. if (typeof color === "number") {
  14439. color = numberInputToObject(color);
  14440. }
  14441. this.originalInput = color;
  14442. var rgb = inputToRGB(color);
  14443. this.originalInput = color;
  14444. this.r = rgb.r;
  14445. this.g = rgb.g;
  14446. this.b = rgb.b;
  14447. this.a = rgb.a;
  14448. this.roundA = Math.round(100 * this.a) / 100;
  14449. this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
  14450. this.gradientType = opts.gradientType;
  14451. if (this.r < 1) {
  14452. this.r = Math.round(this.r);
  14453. }
  14454. if (this.g < 1) {
  14455. this.g = Math.round(this.g);
  14456. }
  14457. if (this.b < 1) {
  14458. this.b = Math.round(this.b);
  14459. }
  14460. this.isValid = rgb.ok;
  14461. }
  14462. TinyColor2.prototype.isDark = function() {
  14463. return this.getBrightness() < 128;
  14464. };
  14465. TinyColor2.prototype.isLight = function() {
  14466. return !this.isDark();
  14467. };
  14468. TinyColor2.prototype.getBrightness = function() {
  14469. var rgb = this.toRgb();
  14470. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  14471. };
  14472. TinyColor2.prototype.getLuminance = function() {
  14473. var rgb = this.toRgb();
  14474. var R;
  14475. var G;
  14476. var B;
  14477. var RsRGB = rgb.r / 255;
  14478. var GsRGB = rgb.g / 255;
  14479. var BsRGB = rgb.b / 255;
  14480. if (RsRGB <= 0.03928) {
  14481. R = RsRGB / 12.92;
  14482. } else {
  14483. R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
  14484. }
  14485. if (GsRGB <= 0.03928) {
  14486. G = GsRGB / 12.92;
  14487. } else {
  14488. G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
  14489. }
  14490. if (BsRGB <= 0.03928) {
  14491. B = BsRGB / 12.92;
  14492. } else {
  14493. B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
  14494. }
  14495. return 0.2126 * R + 0.7152 * G + 0.0722 * B;
  14496. };
  14497. TinyColor2.prototype.getAlpha = function() {
  14498. return this.a;
  14499. };
  14500. TinyColor2.prototype.setAlpha = function(alpha) {
  14501. this.a = boundAlpha(alpha);
  14502. this.roundA = Math.round(100 * this.a) / 100;
  14503. return this;
  14504. };
  14505. TinyColor2.prototype.toHsv = function() {
  14506. var hsv = rgbToHsv(this.r, this.g, this.b);
  14507. return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
  14508. };
  14509. TinyColor2.prototype.toHsvString = function() {
  14510. var hsv = rgbToHsv(this.r, this.g, this.b);
  14511. var h = Math.round(hsv.h * 360);
  14512. var s = Math.round(hsv.s * 100);
  14513. var v = Math.round(hsv.v * 100);
  14514. return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  14515. };
  14516. TinyColor2.prototype.toHsl = function() {
  14517. var hsl = rgbToHsl(this.r, this.g, this.b);
  14518. return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
  14519. };
  14520. TinyColor2.prototype.toHslString = function() {
  14521. var hsl = rgbToHsl(this.r, this.g, this.b);
  14522. var h = Math.round(hsl.h * 360);
  14523. var s = Math.round(hsl.s * 100);
  14524. var l = Math.round(hsl.l * 100);
  14525. return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  14526. };
  14527. TinyColor2.prototype.toHex = function(allow3Char) {
  14528. if (allow3Char === void 0) {
  14529. allow3Char = false;
  14530. }
  14531. return rgbToHex(this.r, this.g, this.b, allow3Char);
  14532. };
  14533. TinyColor2.prototype.toHexString = function(allow3Char) {
  14534. if (allow3Char === void 0) {
  14535. allow3Char = false;
  14536. }
  14537. return "#" + this.toHex(allow3Char);
  14538. };
  14539. TinyColor2.prototype.toHex8 = function(allow4Char) {
  14540. if (allow4Char === void 0) {
  14541. allow4Char = false;
  14542. }
  14543. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  14544. };
  14545. TinyColor2.prototype.toHex8String = function(allow4Char) {
  14546. if (allow4Char === void 0) {
  14547. allow4Char = false;
  14548. }
  14549. return "#" + this.toHex8(allow4Char);
  14550. };
  14551. TinyColor2.prototype.toRgb = function() {
  14552. return {
  14553. r: Math.round(this.r),
  14554. g: Math.round(this.g),
  14555. b: Math.round(this.b),
  14556. a: this.a
  14557. };
  14558. };
  14559. TinyColor2.prototype.toRgbString = function() {
  14560. var r = Math.round(this.r);
  14561. var g = Math.round(this.g);
  14562. var b = Math.round(this.b);
  14563. return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  14564. };
  14565. TinyColor2.prototype.toPercentageRgb = function() {
  14566. var fmt = function(x) {
  14567. return "".concat(Math.round(bound01$1(x, 255) * 100), "%");
  14568. };
  14569. return {
  14570. r: fmt(this.r),
  14571. g: fmt(this.g),
  14572. b: fmt(this.b),
  14573. a: this.a
  14574. };
  14575. };
  14576. TinyColor2.prototype.toPercentageRgbString = function() {
  14577. var rnd = function(x) {
  14578. return Math.round(bound01$1(x, 255) * 100);
  14579. };
  14580. return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
  14581. };
  14582. TinyColor2.prototype.toName = function() {
  14583. if (this.a === 0) {
  14584. return "transparent";
  14585. }
  14586. if (this.a < 1) {
  14587. return false;
  14588. }
  14589. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  14590. for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
  14591. var _b = _a[_i], key = _b[0], value = _b[1];
  14592. if (hex === value) {
  14593. return key;
  14594. }
  14595. }
  14596. return false;
  14597. };
  14598. TinyColor2.prototype.toString = function(format) {
  14599. var formatSet = Boolean(format);
  14600. format = format !== null && format !== void 0 ? format : this.format;
  14601. var formattedString = false;
  14602. var hasAlpha = this.a < 1 && this.a >= 0;
  14603. var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith("hex") || format === "name");
  14604. if (needsAlphaFormat) {
  14605. if (format === "name" && this.a === 0) {
  14606. return this.toName();
  14607. }
  14608. return this.toRgbString();
  14609. }
  14610. if (format === "rgb") {
  14611. formattedString = this.toRgbString();
  14612. }
  14613. if (format === "prgb") {
  14614. formattedString = this.toPercentageRgbString();
  14615. }
  14616. if (format === "hex" || format === "hex6") {
  14617. formattedString = this.toHexString();
  14618. }
  14619. if (format === "hex3") {
  14620. formattedString = this.toHexString(true);
  14621. }
  14622. if (format === "hex4") {
  14623. formattedString = this.toHex8String(true);
  14624. }
  14625. if (format === "hex8") {
  14626. formattedString = this.toHex8String();
  14627. }
  14628. if (format === "name") {
  14629. formattedString = this.toName();
  14630. }
  14631. if (format === "hsl") {
  14632. formattedString = this.toHslString();
  14633. }
  14634. if (format === "hsv") {
  14635. formattedString = this.toHsvString();
  14636. }
  14637. return formattedString || this.toHexString();
  14638. };
  14639. TinyColor2.prototype.toNumber = function() {
  14640. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  14641. };
  14642. TinyColor2.prototype.clone = function() {
  14643. return new TinyColor2(this.toString());
  14644. };
  14645. TinyColor2.prototype.lighten = function(amount) {
  14646. if (amount === void 0) {
  14647. amount = 10;
  14648. }
  14649. var hsl = this.toHsl();
  14650. hsl.l += amount / 100;
  14651. hsl.l = clamp01(hsl.l);
  14652. return new TinyColor2(hsl);
  14653. };
  14654. TinyColor2.prototype.brighten = function(amount) {
  14655. if (amount === void 0) {
  14656. amount = 10;
  14657. }
  14658. var rgb = this.toRgb();
  14659. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  14660. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  14661. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  14662. return new TinyColor2(rgb);
  14663. };
  14664. TinyColor2.prototype.darken = function(amount) {
  14665. if (amount === void 0) {
  14666. amount = 10;
  14667. }
  14668. var hsl = this.toHsl();
  14669. hsl.l -= amount / 100;
  14670. hsl.l = clamp01(hsl.l);
  14671. return new TinyColor2(hsl);
  14672. };
  14673. TinyColor2.prototype.tint = function(amount) {
  14674. if (amount === void 0) {
  14675. amount = 10;
  14676. }
  14677. return this.mix("white", amount);
  14678. };
  14679. TinyColor2.prototype.shade = function(amount) {
  14680. if (amount === void 0) {
  14681. amount = 10;
  14682. }
  14683. return this.mix("black", amount);
  14684. };
  14685. TinyColor2.prototype.desaturate = function(amount) {
  14686. if (amount === void 0) {
  14687. amount = 10;
  14688. }
  14689. var hsl = this.toHsl();
  14690. hsl.s -= amount / 100;
  14691. hsl.s = clamp01(hsl.s);
  14692. return new TinyColor2(hsl);
  14693. };
  14694. TinyColor2.prototype.saturate = function(amount) {
  14695. if (amount === void 0) {
  14696. amount = 10;
  14697. }
  14698. var hsl = this.toHsl();
  14699. hsl.s += amount / 100;
  14700. hsl.s = clamp01(hsl.s);
  14701. return new TinyColor2(hsl);
  14702. };
  14703. TinyColor2.prototype.greyscale = function() {
  14704. return this.desaturate(100);
  14705. };
  14706. TinyColor2.prototype.spin = function(amount) {
  14707. var hsl = this.toHsl();
  14708. var hue = (hsl.h + amount) % 360;
  14709. hsl.h = hue < 0 ? 360 + hue : hue;
  14710. return new TinyColor2(hsl);
  14711. };
  14712. TinyColor2.prototype.mix = function(color, amount) {
  14713. if (amount === void 0) {
  14714. amount = 50;
  14715. }
  14716. var rgb1 = this.toRgb();
  14717. var rgb2 = new TinyColor2(color).toRgb();
  14718. var p = amount / 100;
  14719. var rgba = {
  14720. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  14721. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  14722. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  14723. a: (rgb2.a - rgb1.a) * p + rgb1.a
  14724. };
  14725. return new TinyColor2(rgba);
  14726. };
  14727. TinyColor2.prototype.analogous = function(results, slices) {
  14728. if (results === void 0) {
  14729. results = 6;
  14730. }
  14731. if (slices === void 0) {
  14732. slices = 30;
  14733. }
  14734. var hsl = this.toHsl();
  14735. var part = 360 / slices;
  14736. var ret = [this];
  14737. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
  14738. hsl.h = (hsl.h + part) % 360;
  14739. ret.push(new TinyColor2(hsl));
  14740. }
  14741. return ret;
  14742. };
  14743. TinyColor2.prototype.complement = function() {
  14744. var hsl = this.toHsl();
  14745. hsl.h = (hsl.h + 180) % 360;
  14746. return new TinyColor2(hsl);
  14747. };
  14748. TinyColor2.prototype.monochromatic = function(results) {
  14749. if (results === void 0) {
  14750. results = 6;
  14751. }
  14752. var hsv = this.toHsv();
  14753. var h = hsv.h;
  14754. var s = hsv.s;
  14755. var v = hsv.v;
  14756. var res = [];
  14757. var modification = 1 / results;
  14758. while (results--) {
  14759. res.push(new TinyColor2({ h, s, v }));
  14760. v = (v + modification) % 1;
  14761. }
  14762. return res;
  14763. };
  14764. TinyColor2.prototype.splitcomplement = function() {
  14765. var hsl = this.toHsl();
  14766. var h = hsl.h;
  14767. return [
  14768. this,
  14769. new TinyColor2({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
  14770. new TinyColor2({ h: (h + 216) % 360, s: hsl.s, l: hsl.l })
  14771. ];
  14772. };
  14773. TinyColor2.prototype.onBackground = function(background) {
  14774. var fg = this.toRgb();
  14775. var bg = new TinyColor2(background).toRgb();
  14776. return new TinyColor2({
  14777. r: bg.r + (fg.r - bg.r) * fg.a,
  14778. g: bg.g + (fg.g - bg.g) * fg.a,
  14779. b: bg.b + (fg.b - bg.b) * fg.a
  14780. });
  14781. };
  14782. TinyColor2.prototype.triad = function() {
  14783. return this.polyad(3);
  14784. };
  14785. TinyColor2.prototype.tetrad = function() {
  14786. return this.polyad(4);
  14787. };
  14788. TinyColor2.prototype.polyad = function(n) {
  14789. var hsl = this.toHsl();
  14790. var h = hsl.h;
  14791. var result = [this];
  14792. var increment = 360 / n;
  14793. for (var i = 1; i < n; i++) {
  14794. result.push(new TinyColor2({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
  14795. }
  14796. return result;
  14797. };
  14798. TinyColor2.prototype.equals = function(color) {
  14799. return this.toRgbString() === new TinyColor2(color).toRgbString();
  14800. };
  14801. return TinyColor2;
  14802. }();
  14803. function darken(color, amount = 20) {
  14804. return color.mix("#141414", amount).toString();
  14805. }
  14806. function useButtonCustomStyle(props) {
  14807. const _disabled = useDisabled();
  14808. const ns = useNamespace("button");
  14809. return vue.computed(() => {
  14810. let styles = {};
  14811. const buttonColor = props.color;
  14812. if (buttonColor) {
  14813. const color = new TinyColor(buttonColor);
  14814. const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
  14815. if (props.plain) {
  14816. styles = ns.cssVarBlock({
  14817. "bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
  14818. "text-color": buttonColor,
  14819. "border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
  14820. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  14821. "hover-bg-color": buttonColor,
  14822. "hover-border-color": buttonColor,
  14823. "active-bg-color": activeBgColor,
  14824. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  14825. "active-border-color": activeBgColor
  14826. });
  14827. if (_disabled.value) {
  14828. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
  14829. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
  14830. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
  14831. }
  14832. } else {
  14833. const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
  14834. const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  14835. styles = ns.cssVarBlock({
  14836. "bg-color": buttonColor,
  14837. "text-color": textColor,
  14838. "border-color": buttonColor,
  14839. "hover-bg-color": hoverBgColor,
  14840. "hover-text-color": textColor,
  14841. "hover-border-color": hoverBgColor,
  14842. "active-bg-color": activeBgColor,
  14843. "active-border-color": activeBgColor
  14844. });
  14845. if (_disabled.value) {
  14846. const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
  14847. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  14848. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  14849. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  14850. }
  14851. }
  14852. }
  14853. return styles;
  14854. });
  14855. }
  14856. const _hoisted_1$_ = ["aria-disabled", "disabled", "autofocus", "type"];
  14857. const __default__$1g = vue.defineComponent({
  14858. name: "ElButton"
  14859. });
  14860. const _sfc_main$1Y = /* @__PURE__ */ vue.defineComponent({
  14861. ...__default__$1g,
  14862. props: buttonProps,
  14863. emits: buttonEmits,
  14864. setup(__props, { expose, emit }) {
  14865. const props = __props;
  14866. const buttonStyle = useButtonCustomStyle(props);
  14867. const ns = useNamespace("button");
  14868. const { _ref, _size, _type, _disabled, shouldAddSpace, handleClick } = useButton(props, emit);
  14869. expose({
  14870. ref: _ref,
  14871. size: _size,
  14872. type: _type,
  14873. disabled: _disabled,
  14874. shouldAddSpace
  14875. });
  14876. return (_ctx, _cache) => {
  14877. return vue.openBlock(), vue.createElementBlock("button", {
  14878. ref_key: "_ref",
  14879. ref: _ref,
  14880. class: vue.normalizeClass([
  14881. vue.unref(ns).b(),
  14882. vue.unref(ns).m(vue.unref(_type)),
  14883. vue.unref(ns).m(vue.unref(_size)),
  14884. vue.unref(ns).is("disabled", vue.unref(_disabled)),
  14885. vue.unref(ns).is("loading", _ctx.loading),
  14886. vue.unref(ns).is("plain", _ctx.plain),
  14887. vue.unref(ns).is("round", _ctx.round),
  14888. vue.unref(ns).is("circle", _ctx.circle),
  14889. vue.unref(ns).is("text", _ctx.text),
  14890. vue.unref(ns).is("link", _ctx.link),
  14891. vue.unref(ns).is("has-bg", _ctx.bg)
  14892. ]),
  14893. "aria-disabled": vue.unref(_disabled) || _ctx.loading,
  14894. disabled: vue.unref(_disabled) || _ctx.loading,
  14895. autofocus: _ctx.autofocus,
  14896. type: _ctx.nativeType,
  14897. style: vue.normalizeStyle(vue.unref(buttonStyle)),
  14898. onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(handleClick) && vue.unref(handleClick)(...args))
  14899. }, [
  14900. _ctx.loading ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  14901. _ctx.$slots.loading ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }) : (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  14902. key: 1,
  14903. class: vue.normalizeClass(vue.unref(ns).is("loading"))
  14904. }, {
  14905. default: vue.withCtx(() => [
  14906. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.loadingIcon)))
  14907. ]),
  14908. _: 1
  14909. }, 8, ["class"]))
  14910. ], 64)) : _ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 1 }, {
  14911. default: vue.withCtx(() => [
  14912. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon), { key: 0 })) : vue.renderSlot(_ctx.$slots, "icon", { key: 1 })
  14913. ]),
  14914. _: 3
  14915. })) : vue.createCommentVNode("v-if", true),
  14916. _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", {
  14917. key: 2,
  14918. class: vue.normalizeClass({ [vue.unref(ns).em("text", "expand")]: vue.unref(shouldAddSpace) })
  14919. }, [
  14920. vue.renderSlot(_ctx.$slots, "default")
  14921. ], 2)) : vue.createCommentVNode("v-if", true)
  14922. ], 14, _hoisted_1$_);
  14923. };
  14924. }
  14925. });
  14926. var Button = /* @__PURE__ */ _export_sfc(_sfc_main$1Y, [["__file", "button.vue"]]);
  14927. const buttonGroupProps = {
  14928. size: buttonProps.size,
  14929. type: buttonProps.type
  14930. };
  14931. const __default__$1f = vue.defineComponent({
  14932. name: "ElButtonGroup"
  14933. });
  14934. const _sfc_main$1X = /* @__PURE__ */ vue.defineComponent({
  14935. ...__default__$1f,
  14936. props: buttonGroupProps,
  14937. setup(__props) {
  14938. const props = __props;
  14939. vue.provide(buttonGroupContextKey, vue.reactive({
  14940. size: vue.toRef(props, "size"),
  14941. type: vue.toRef(props, "type")
  14942. }));
  14943. const ns = useNamespace("button");
  14944. return (_ctx, _cache) => {
  14945. return vue.openBlock(), vue.createElementBlock("div", {
  14946. class: vue.normalizeClass(`${vue.unref(ns).b("group")}`)
  14947. }, [
  14948. vue.renderSlot(_ctx.$slots, "default")
  14949. ], 2);
  14950. };
  14951. }
  14952. });
  14953. var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1X, [["__file", "button-group.vue"]]);
  14954. const ElButton = withInstall(Button, {
  14955. ButtonGroup
  14956. });
  14957. const ElButtonGroup$1 = withNoopInstall(ButtonGroup);
  14958. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  14959. var dayjs_min = {exports: {}};
  14960. (function(module, exports) {
  14961. !function(t, e) {
  14962. module.exports = e() ;
  14963. }(commonjsGlobal, function() {
  14964. var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, m = function(t2, e2, n2) {
  14965. var r2 = String(t2);
  14966. return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
  14967. }, g = { s: m, z: function(t2) {
  14968. var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
  14969. return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
  14970. }, m: function t2(e2, n2) {
  14971. if (e2.date() < n2.date())
  14972. return -t2(n2, e2);
  14973. var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
  14974. return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
  14975. }, a: function(t2) {
  14976. return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
  14977. }, p: function(t2) {
  14978. return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
  14979. }, u: function(t2) {
  14980. return t2 === void 0;
  14981. } }, v = "en", D = {};
  14982. D[v] = M;
  14983. var p = function(t2) {
  14984. return t2 instanceof _;
  14985. }, S = function t2(e2, n2, r2) {
  14986. var i2;
  14987. if (!e2)
  14988. return v;
  14989. if (typeof e2 == "string") {
  14990. var s2 = e2.toLowerCase();
  14991. D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
  14992. var u2 = e2.split("-");
  14993. if (!i2 && u2.length > 1)
  14994. return t2(u2[0]);
  14995. } else {
  14996. var a2 = e2.name;
  14997. D[a2] = e2, i2 = a2;
  14998. }
  14999. return !r2 && i2 && (v = i2), i2 || !r2 && v;
  15000. }, w = function(t2, e2) {
  15001. if (p(t2))
  15002. return t2.clone();
  15003. var n2 = typeof e2 == "object" ? e2 : {};
  15004. return n2.date = t2, n2.args = arguments, new _(n2);
  15005. }, O = g;
  15006. O.l = S, O.i = p, O.w = function(t2, e2) {
  15007. return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
  15008. };
  15009. var _ = function() {
  15010. function M2(t2) {
  15011. this.$L = S(t2.locale, null, true), this.parse(t2);
  15012. }
  15013. var m2 = M2.prototype;
  15014. return m2.parse = function(t2) {
  15015. this.$d = function(t3) {
  15016. var e2 = t3.date, n2 = t3.utc;
  15017. if (e2 === null)
  15018. return new Date(NaN);
  15019. if (O.u(e2))
  15020. return new Date();
  15021. if (e2 instanceof Date)
  15022. return new Date(e2);
  15023. if (typeof e2 == "string" && !/Z$/i.test(e2)) {
  15024. var r2 = e2.match(l);
  15025. if (r2) {
  15026. var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
  15027. return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
  15028. }
  15029. }
  15030. return new Date(e2);
  15031. }(t2), this.$x = t2.x || {}, this.init();
  15032. }, m2.init = function() {
  15033. var t2 = this.$d;
  15034. this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
  15035. }, m2.$utils = function() {
  15036. return O;
  15037. }, m2.isValid = function() {
  15038. return !(this.$d.toString() === $);
  15039. }, m2.isSame = function(t2, e2) {
  15040. var n2 = w(t2);
  15041. return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
  15042. }, m2.isAfter = function(t2, e2) {
  15043. return w(t2) < this.startOf(e2);
  15044. }, m2.isBefore = function(t2, e2) {
  15045. return this.endOf(e2) < w(t2);
  15046. }, m2.$g = function(t2, e2, n2) {
  15047. return O.u(t2) ? this[e2] : this.set(n2, t2);
  15048. }, m2.unix = function() {
  15049. return Math.floor(this.valueOf() / 1e3);
  15050. }, m2.valueOf = function() {
  15051. return this.$d.getTime();
  15052. }, m2.startOf = function(t2, e2) {
  15053. var n2 = this, r2 = !!O.u(e2) || e2, h2 = O.p(t2), $2 = function(t3, e3) {
  15054. var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
  15055. return r2 ? i2 : i2.endOf(a);
  15056. }, l2 = function(t3, e3) {
  15057. return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
  15058. }, y2 = this.$W, M3 = this.$M, m3 = this.$D, g2 = "set" + (this.$u ? "UTC" : "");
  15059. switch (h2) {
  15060. case c:
  15061. return r2 ? $2(1, 0) : $2(31, 11);
  15062. case f:
  15063. return r2 ? $2(1, M3) : $2(0, M3 + 1);
  15064. case o:
  15065. var v2 = this.$locale().weekStart || 0, D2 = (y2 < v2 ? y2 + 7 : y2) - v2;
  15066. return $2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
  15067. case a:
  15068. case d:
  15069. return l2(g2 + "Hours", 0);
  15070. case u:
  15071. return l2(g2 + "Minutes", 1);
  15072. case s:
  15073. return l2(g2 + "Seconds", 2);
  15074. case i:
  15075. return l2(g2 + "Milliseconds", 3);
  15076. default:
  15077. return this.clone();
  15078. }
  15079. }, m2.endOf = function(t2) {
  15080. return this.startOf(t2, false);
  15081. }, m2.$set = function(t2, e2) {
  15082. var n2, o2 = O.p(t2), h2 = "set" + (this.$u ? "UTC" : ""), $2 = (n2 = {}, n2[a] = h2 + "Date", n2[d] = h2 + "Date", n2[f] = h2 + "Month", n2[c] = h2 + "FullYear", n2[u] = h2 + "Hours", n2[s] = h2 + "Minutes", n2[i] = h2 + "Seconds", n2[r] = h2 + "Milliseconds", n2)[o2], l2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
  15083. if (o2 === f || o2 === c) {
  15084. var y2 = this.clone().set(d, 1);
  15085. y2.$d[$2](l2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
  15086. } else
  15087. $2 && this.$d[$2](l2);
  15088. return this.init(), this;
  15089. }, m2.set = function(t2, e2) {
  15090. return this.clone().$set(t2, e2);
  15091. }, m2.get = function(t2) {
  15092. return this[O.p(t2)]();
  15093. }, m2.add = function(r2, h2) {
  15094. var d2, $2 = this;
  15095. r2 = Number(r2);
  15096. var l2 = O.p(h2), y2 = function(t2) {
  15097. var e2 = w($2);
  15098. return O.w(e2.date(e2.date() + Math.round(t2 * r2)), $2);
  15099. };
  15100. if (l2 === f)
  15101. return this.set(f, this.$M + r2);
  15102. if (l2 === c)
  15103. return this.set(c, this.$y + r2);
  15104. if (l2 === a)
  15105. return y2(1);
  15106. if (l2 === o)
  15107. return y2(7);
  15108. var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[l2] || 1, m3 = this.$d.getTime() + r2 * M3;
  15109. return O.w(m3, this);
  15110. }, m2.subtract = function(t2, e2) {
  15111. return this.add(-1 * t2, e2);
  15112. }, m2.format = function(t2) {
  15113. var e2 = this, n2 = this.$locale();
  15114. if (!this.isValid())
  15115. return n2.invalidDate || $;
  15116. var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h2 = function(t3, n3, i3, s3) {
  15117. return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
  15118. }, c2 = function(t3) {
  15119. return O.s(s2 % 12 || 12, t3, "0");
  15120. }, d2 = n2.meridiem || function(t3, e3, n3) {
  15121. var r3 = t3 < 12 ? "AM" : "PM";
  15122. return n3 ? r3.toLowerCase() : r3;
  15123. }, l2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h2(n2.monthsShort, a2, f2, 3), MMMM: h2(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h2(n2.weekdaysMin, this.$W, o2, 2), ddd: h2(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
  15124. return r2.replace(y, function(t3, e3) {
  15125. return e3 || l2[t3] || i2.replace(":", "");
  15126. });
  15127. }, m2.utcOffset = function() {
  15128. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  15129. }, m2.diff = function(r2, d2, $2) {
  15130. var l2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, g2 = this - M3, v2 = O.m(this, M3);
  15131. return v2 = (l2 = {}, l2[c] = v2 / 12, l2[f] = v2, l2[h] = v2 / 3, l2[o] = (g2 - m3) / 6048e5, l2[a] = (g2 - m3) / 864e5, l2[u] = g2 / n, l2[s] = g2 / e, l2[i] = g2 / t, l2)[y2] || g2, $2 ? v2 : O.a(v2);
  15132. }, m2.daysInMonth = function() {
  15133. return this.endOf(f).$D;
  15134. }, m2.$locale = function() {
  15135. return D[this.$L];
  15136. }, m2.locale = function(t2, e2) {
  15137. if (!t2)
  15138. return this.$L;
  15139. var n2 = this.clone(), r2 = S(t2, e2, true);
  15140. return r2 && (n2.$L = r2), n2;
  15141. }, m2.clone = function() {
  15142. return O.w(this.$d, this);
  15143. }, m2.toDate = function() {
  15144. return new Date(this.valueOf());
  15145. }, m2.toJSON = function() {
  15146. return this.isValid() ? this.toISOString() : null;
  15147. }, m2.toISOString = function() {
  15148. return this.$d.toISOString();
  15149. }, m2.toString = function() {
  15150. return this.$d.toUTCString();
  15151. }, M2;
  15152. }(), T = _.prototype;
  15153. return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
  15154. T[t2[1]] = function(e2) {
  15155. return this.$g(e2, t2[0], t2[1]);
  15156. };
  15157. }), w.extend = function(t2, e2) {
  15158. return t2.$i || (t2(e2, _, w), t2.$i = true), w;
  15159. }, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
  15160. return w(1e3 * t2);
  15161. }, w.en = D[v], w.Ls = D, w.p = {}, w;
  15162. });
  15163. })(dayjs_min);
  15164. var dayjs = dayjs_min.exports;
  15165. var customParseFormat$1 = {exports: {}};
  15166. (function(module, exports) {
  15167. !function(e, t) {
  15168. module.exports = t() ;
  15169. }(commonjsGlobal, function() {
  15170. var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d\d/, r = /\d\d?/, i = /\d*[^-_:/,()\s\d]+/, o = {}, s = function(e2) {
  15171. return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
  15172. };
  15173. var a = function(e2) {
  15174. return function(t2) {
  15175. this[e2] = +t2;
  15176. };
  15177. }, f = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
  15178. (this.zone || (this.zone = {})).offset = function(e3) {
  15179. if (!e3)
  15180. return 0;
  15181. if (e3 === "Z")
  15182. return 0;
  15183. var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
  15184. return n2 === 0 ? 0 : t2[0] === "+" ? -n2 : n2;
  15185. }(e2);
  15186. }], h = function(e2) {
  15187. var t2 = o[e2];
  15188. return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
  15189. }, u = function(e2, t2) {
  15190. var n2, r2 = o.meridiem;
  15191. if (r2) {
  15192. for (var i2 = 1; i2 <= 24; i2 += 1)
  15193. if (e2.indexOf(r2(i2, 0, t2)) > -1) {
  15194. n2 = i2 > 12;
  15195. break;
  15196. }
  15197. } else
  15198. n2 = e2 === (t2 ? "pm" : "PM");
  15199. return n2;
  15200. }, d = { A: [i, function(e2) {
  15201. this.afternoon = u(e2, false);
  15202. }], a: [i, function(e2) {
  15203. this.afternoon = u(e2, true);
  15204. }], S: [/\d/, function(e2) {
  15205. this.milliseconds = 100 * +e2;
  15206. }], SS: [n, function(e2) {
  15207. this.milliseconds = 10 * +e2;
  15208. }], SSS: [/\d{3}/, function(e2) {
  15209. this.milliseconds = +e2;
  15210. }], s: [r, a("seconds")], ss: [r, a("seconds")], m: [r, a("minutes")], mm: [r, a("minutes")], H: [r, a("hours")], h: [r, a("hours")], HH: [r, a("hours")], hh: [r, a("hours")], D: [r, a("day")], DD: [n, a("day")], Do: [i, function(e2) {
  15211. var t2 = o.ordinal, n2 = e2.match(/\d+/);
  15212. if (this.day = n2[0], t2)
  15213. for (var r2 = 1; r2 <= 31; r2 += 1)
  15214. t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
  15215. }], M: [r, a("month")], MM: [n, a("month")], MMM: [i, function(e2) {
  15216. var t2 = h("months"), n2 = (h("monthsShort") || t2.map(function(e3) {
  15217. return e3.slice(0, 3);
  15218. })).indexOf(e2) + 1;
  15219. if (n2 < 1)
  15220. throw new Error();
  15221. this.month = n2 % 12 || n2;
  15222. }], MMMM: [i, function(e2) {
  15223. var t2 = h("months").indexOf(e2) + 1;
  15224. if (t2 < 1)
  15225. throw new Error();
  15226. this.month = t2 % 12 || t2;
  15227. }], Y: [/[+-]?\d+/, a("year")], YY: [n, function(e2) {
  15228. this.year = s(e2);
  15229. }], YYYY: [/\d{4}/, a("year")], Z: f, ZZ: f };
  15230. function c(n2) {
  15231. var r2, i2;
  15232. r2 = n2, i2 = o && o.formats;
  15233. for (var s2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(t2, n3, r3) {
  15234. var o2 = r3 && r3.toUpperCase();
  15235. return n3 || i2[r3] || e[r3] || i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(e2, t3, n4) {
  15236. return t3 || n4.slice(1);
  15237. });
  15238. })).match(t), a2 = s2.length, f2 = 0; f2 < a2; f2 += 1) {
  15239. var h2 = s2[f2], u2 = d[h2], c2 = u2 && u2[0], l = u2 && u2[1];
  15240. s2[f2] = l ? { regex: c2, parser: l } : h2.replace(/^\[|\]$/g, "");
  15241. }
  15242. return function(e2) {
  15243. for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
  15244. var i3 = s2[n3];
  15245. if (typeof i3 == "string")
  15246. r3 += i3.length;
  15247. else {
  15248. var o2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = o2.exec(h3)[0];
  15249. f3.call(t2, u3), e2 = e2.replace(u3, "");
  15250. }
  15251. }
  15252. return function(e3) {
  15253. var t3 = e3.afternoon;
  15254. if (t3 !== void 0) {
  15255. var n4 = e3.hours;
  15256. t3 ? n4 < 12 && (e3.hours += 12) : n4 === 12 && (e3.hours = 0), delete e3.afternoon;
  15257. }
  15258. }(t2), t2;
  15259. };
  15260. }
  15261. return function(e2, t2, n2) {
  15262. n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (s = e2.parseTwoDigitYear);
  15263. var r2 = t2.prototype, i2 = r2.parse;
  15264. r2.parse = function(e3) {
  15265. var t3 = e3.date, r3 = e3.utc, s2 = e3.args;
  15266. this.$u = r3;
  15267. var a2 = s2[1];
  15268. if (typeof a2 == "string") {
  15269. var f2 = s2[2] === true, h2 = s2[3] === true, u2 = f2 || h2, d2 = s2[2];
  15270. h2 && (d2 = s2[2]), o = this.$locale(), !f2 && d2 && (o = n2.Ls[d2]), this.$d = function(e4, t4, n3) {
  15271. try {
  15272. if (["x", "X"].indexOf(t4) > -1)
  15273. return new Date((t4 === "X" ? 1e3 : 1) * e4);
  15274. var r4 = c(t4)(e4), i3 = r4.year, o2 = r4.month, s3 = r4.day, a3 = r4.hours, f3 = r4.minutes, h3 = r4.seconds, u3 = r4.milliseconds, d3 = r4.zone, l2 = new Date(), m2 = s3 || (i3 || o2 ? 1 : l2.getDate()), M2 = i3 || l2.getFullYear(), Y = 0;
  15275. i3 && !o2 || (Y = o2 > 0 ? o2 - 1 : l2.getMonth());
  15276. var p = a3 || 0, v = f3 || 0, D = h3 || 0, g = u3 || 0;
  15277. return d3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g + 60 * d3.offset * 1e3)) : n3 ? new Date(Date.UTC(M2, Y, m2, p, v, D, g)) : new Date(M2, Y, m2, p, v, D, g);
  15278. } catch (e5) {
  15279. return new Date("");
  15280. }
  15281. }(t3, a2, r3), this.init(), d2 && d2 !== true && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = new Date("")), o = {};
  15282. } else if (a2 instanceof Array)
  15283. for (var l = a2.length, m = 1; m <= l; m += 1) {
  15284. s2[1] = a2[m - 1];
  15285. var M = n2.apply(this, s2);
  15286. if (M.isValid()) {
  15287. this.$d = M.$d, this.$L = M.$L, this.init();
  15288. break;
  15289. }
  15290. m === l && (this.$d = new Date(""));
  15291. }
  15292. else
  15293. i2.call(this, e3);
  15294. };
  15295. };
  15296. });
  15297. })(customParseFormat$1);
  15298. var customParseFormat = customParseFormat$1.exports;
  15299. const timeUnits$1 = ["hours", "minutes", "seconds"];
  15300. const DEFAULT_FORMATS_TIME = "HH:mm:ss";
  15301. const DEFAULT_FORMATS_DATE = "YYYY-MM-DD";
  15302. const DEFAULT_FORMATS_DATEPICKER = {
  15303. date: DEFAULT_FORMATS_DATE,
  15304. dates: DEFAULT_FORMATS_DATE,
  15305. week: "gggg[w]ww",
  15306. year: "YYYY",
  15307. month: "YYYY-MM",
  15308. datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`,
  15309. monthrange: "YYYY-MM",
  15310. daterange: DEFAULT_FORMATS_DATE,
  15311. datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`
  15312. };
  15313. const buildTimeList = (value, bound) => {
  15314. return [
  15315. value > 0 ? value - 1 : void 0,
  15316. value,
  15317. value < bound ? value + 1 : void 0
  15318. ];
  15319. };
  15320. const rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
  15321. const extractDateFormat = (format) => {
  15322. return format.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
  15323. };
  15324. const extractTimeFormat = (format) => {
  15325. return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim();
  15326. };
  15327. const dateEquals = function(a, b) {
  15328. const aIsDate = isDate(a);
  15329. const bIsDate = isDate(b);
  15330. if (aIsDate && bIsDate) {
  15331. return a.getTime() === b.getTime();
  15332. }
  15333. if (!aIsDate && !bIsDate) {
  15334. return a === b;
  15335. }
  15336. return false;
  15337. };
  15338. const valueEquals = function(a, b) {
  15339. const aIsArray = isArray(a);
  15340. const bIsArray = isArray(b);
  15341. if (aIsArray && bIsArray) {
  15342. if (a.length !== b.length) {
  15343. return false;
  15344. }
  15345. return a.every((item, index) => dateEquals(item, b[index]));
  15346. }
  15347. if (!aIsArray && !bIsArray) {
  15348. return dateEquals(a, b);
  15349. }
  15350. return false;
  15351. };
  15352. const parseDate = function(date, format, lang) {
  15353. const day = isEmpty(format) || format === "x" ? dayjs(date).locale(lang) : dayjs(date, format).locale(lang);
  15354. return day.isValid() ? day : void 0;
  15355. };
  15356. const formatter = function(date, format, lang) {
  15357. if (isEmpty(format))
  15358. return date;
  15359. if (format === "x")
  15360. return +date;
  15361. return dayjs(date).locale(lang).format(format);
  15362. };
  15363. const makeList = (total, method) => {
  15364. var _a;
  15365. const arr = [];
  15366. const disabledArr = method == null ? void 0 : method();
  15367. for (let i = 0; i < total; i++) {
  15368. arr.push((_a = disabledArr == null ? void 0 : disabledArr.includes(i)) != null ? _a : false);
  15369. }
  15370. return arr;
  15371. };
  15372. const disabledTimeListsProps = buildProps({
  15373. disabledHours: {
  15374. type: definePropType(Function)
  15375. },
  15376. disabledMinutes: {
  15377. type: definePropType(Function)
  15378. },
  15379. disabledSeconds: {
  15380. type: definePropType(Function)
  15381. }
  15382. });
  15383. const timePanelSharedProps = buildProps({
  15384. visible: Boolean,
  15385. actualVisible: {
  15386. type: Boolean,
  15387. default: void 0
  15388. },
  15389. format: {
  15390. type: String,
  15391. default: ""
  15392. }
  15393. });
  15394. const timePickerDefaultProps = buildProps({
  15395. id: {
  15396. type: definePropType([Array, String])
  15397. },
  15398. name: {
  15399. type: definePropType([Array, String]),
  15400. default: ""
  15401. },
  15402. popperClass: {
  15403. type: String,
  15404. default: ""
  15405. },
  15406. format: String,
  15407. valueFormat: String,
  15408. type: {
  15409. type: String,
  15410. default: ""
  15411. },
  15412. clearable: {
  15413. type: Boolean,
  15414. default: true
  15415. },
  15416. clearIcon: {
  15417. type: definePropType([String, Object]),
  15418. default: circle_close_default
  15419. },
  15420. editable: {
  15421. type: Boolean,
  15422. default: true
  15423. },
  15424. prefixIcon: {
  15425. type: definePropType([String, Object]),
  15426. default: ""
  15427. },
  15428. size: useSizeProp,
  15429. readonly: {
  15430. type: Boolean,
  15431. default: false
  15432. },
  15433. disabled: {
  15434. type: Boolean,
  15435. default: false
  15436. },
  15437. placeholder: {
  15438. type: String,
  15439. default: ""
  15440. },
  15441. popperOptions: {
  15442. type: definePropType(Object),
  15443. default: () => ({})
  15444. },
  15445. modelValue: {
  15446. type: definePropType([Date, Array, String, Number]),
  15447. default: ""
  15448. },
  15449. rangeSeparator: {
  15450. type: String,
  15451. default: "-"
  15452. },
  15453. startPlaceholder: String,
  15454. endPlaceholder: String,
  15455. defaultValue: {
  15456. type: definePropType([Date, Array])
  15457. },
  15458. defaultTime: {
  15459. type: definePropType([Date, Array])
  15460. },
  15461. isRange: {
  15462. type: Boolean,
  15463. default: false
  15464. },
  15465. ...disabledTimeListsProps,
  15466. disabledDate: {
  15467. type: Function
  15468. },
  15469. cellClassName: {
  15470. type: Function
  15471. },
  15472. shortcuts: {
  15473. type: Array,
  15474. default: () => []
  15475. },
  15476. arrowControl: {
  15477. type: Boolean,
  15478. default: false
  15479. },
  15480. label: {
  15481. type: String,
  15482. default: void 0
  15483. },
  15484. tabindex: {
  15485. type: definePropType([String, Number]),
  15486. default: 0
  15487. },
  15488. validateEvent: {
  15489. type: Boolean,
  15490. default: true
  15491. },
  15492. unlinkPanels: Boolean
  15493. });
  15494. const _hoisted_1$Z = ["id", "name", "placeholder", "value", "disabled", "readonly"];
  15495. const _hoisted_2$D = ["id", "name", "placeholder", "value", "disabled", "readonly"];
  15496. const __default__$1e = vue.defineComponent({
  15497. name: "Picker"
  15498. });
  15499. const _sfc_main$1W = /* @__PURE__ */ vue.defineComponent({
  15500. ...__default__$1e,
  15501. props: timePickerDefaultProps,
  15502. emits: [
  15503. "update:modelValue",
  15504. "change",
  15505. "focus",
  15506. "blur",
  15507. "calendar-change",
  15508. "panel-change",
  15509. "visible-change",
  15510. "keydown"
  15511. ],
  15512. setup(__props, { expose, emit }) {
  15513. const props = __props;
  15514. const { lang } = useLocale();
  15515. const nsDate = useNamespace("date");
  15516. const nsInput = useNamespace("input");
  15517. const nsRange = useNamespace("range");
  15518. const { form, formItem } = useFormItem();
  15519. const elPopperOptions = vue.inject("ElPopperOptions", {});
  15520. const refPopper = vue.ref();
  15521. const inputRef = vue.ref();
  15522. const pickerVisible = vue.ref(false);
  15523. const pickerActualVisible = vue.ref(false);
  15524. const valueOnOpen = vue.ref(null);
  15525. let hasJustTabExitedInput = false;
  15526. let ignoreFocusEvent = false;
  15527. vue.watch(pickerVisible, (val) => {
  15528. if (!val) {
  15529. userInput.value = null;
  15530. vue.nextTick(() => {
  15531. emitChange(props.modelValue);
  15532. });
  15533. } else {
  15534. vue.nextTick(() => {
  15535. if (val) {
  15536. valueOnOpen.value = props.modelValue;
  15537. }
  15538. });
  15539. }
  15540. });
  15541. const emitChange = (val, isClear) => {
  15542. if (isClear || !valueEquals(val, valueOnOpen.value)) {
  15543. emit("change", val);
  15544. props.validateEvent && (formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn()));
  15545. }
  15546. };
  15547. const emitInput = (input) => {
  15548. if (!valueEquals(props.modelValue, input)) {
  15549. let formatted;
  15550. if (isArray(input)) {
  15551. formatted = input.map((item) => formatter(item, props.valueFormat, lang.value));
  15552. } else if (input) {
  15553. formatted = formatter(input, props.valueFormat, lang.value);
  15554. }
  15555. emit("update:modelValue", input ? formatted : input, lang.value);
  15556. }
  15557. };
  15558. const emitKeydown = (e) => {
  15559. emit("keydown", e);
  15560. };
  15561. const refInput = vue.computed(() => {
  15562. if (inputRef.value) {
  15563. const _r = isRangeInput.value ? inputRef.value : inputRef.value.$el;
  15564. return Array.from(_r.querySelectorAll("input"));
  15565. }
  15566. return [];
  15567. });
  15568. const setSelectionRange = (start, end, pos) => {
  15569. const _inputs = refInput.value;
  15570. if (!_inputs.length)
  15571. return;
  15572. if (!pos || pos === "min") {
  15573. _inputs[0].setSelectionRange(start, end);
  15574. _inputs[0].focus();
  15575. } else if (pos === "max") {
  15576. _inputs[1].setSelectionRange(start, end);
  15577. _inputs[1].focus();
  15578. }
  15579. };
  15580. const focusOnInputBox = () => {
  15581. focus(true, true);
  15582. vue.nextTick(() => {
  15583. ignoreFocusEvent = false;
  15584. });
  15585. };
  15586. const onPick = (date = "", visible = false) => {
  15587. if (!visible) {
  15588. ignoreFocusEvent = true;
  15589. }
  15590. pickerVisible.value = visible;
  15591. let result;
  15592. if (isArray(date)) {
  15593. result = date.map((_) => _.toDate());
  15594. } else {
  15595. result = date ? date.toDate() : date;
  15596. }
  15597. userInput.value = null;
  15598. emitInput(result);
  15599. };
  15600. const onBeforeShow = () => {
  15601. pickerActualVisible.value = true;
  15602. };
  15603. const onShow = () => {
  15604. emit("visible-change", true);
  15605. };
  15606. const onKeydownPopperContent = (event) => {
  15607. if ((event == null ? void 0 : event.key) === EVENT_CODE.esc) {
  15608. focus(true, true);
  15609. }
  15610. };
  15611. const onHide = () => {
  15612. pickerActualVisible.value = false;
  15613. pickerVisible.value = false;
  15614. ignoreFocusEvent = false;
  15615. emit("visible-change", false);
  15616. };
  15617. const handleOpen = () => {
  15618. pickerVisible.value = true;
  15619. };
  15620. const handleClose = () => {
  15621. pickerVisible.value = false;
  15622. };
  15623. const focus = (focusStartInput = true, isIgnoreFocusEvent = false) => {
  15624. ignoreFocusEvent = isIgnoreFocusEvent;
  15625. const [leftInput, rightInput] = vue.unref(refInput);
  15626. let input = leftInput;
  15627. if (!focusStartInput && isRangeInput.value) {
  15628. input = rightInput;
  15629. }
  15630. if (input) {
  15631. input.focus();
  15632. }
  15633. };
  15634. const handleFocusInput = (e) => {
  15635. if (props.readonly || pickerDisabled.value || pickerVisible.value || ignoreFocusEvent) {
  15636. return;
  15637. }
  15638. pickerVisible.value = true;
  15639. emit("focus", e);
  15640. };
  15641. let currentHandleBlurDeferCallback = void 0;
  15642. const handleBlurInput = (e) => {
  15643. const handleBlurDefer = async () => {
  15644. setTimeout(() => {
  15645. var _a;
  15646. if (currentHandleBlurDeferCallback === handleBlurDefer) {
  15647. if (!(((_a = refPopper.value) == null ? void 0 : _a.isFocusInsideContent()) && !hasJustTabExitedInput) && refInput.value.filter((input) => {
  15648. return input.contains(document.activeElement);
  15649. }).length === 0) {
  15650. handleChange();
  15651. pickerVisible.value = false;
  15652. emit("blur", e);
  15653. props.validateEvent && (formItem == null ? void 0 : formItem.validate("blur").catch((err) => debugWarn()));
  15654. }
  15655. hasJustTabExitedInput = false;
  15656. }
  15657. }, 0);
  15658. };
  15659. currentHandleBlurDeferCallback = handleBlurDefer;
  15660. handleBlurDefer();
  15661. };
  15662. const pickerDisabled = vue.computed(() => {
  15663. return props.disabled || (form == null ? void 0 : form.disabled);
  15664. });
  15665. const parsedValue = vue.computed(() => {
  15666. let dayOrDays;
  15667. if (valueIsEmpty.value) {
  15668. if (pickerOptions.value.getDefaultValue) {
  15669. dayOrDays = pickerOptions.value.getDefaultValue();
  15670. }
  15671. } else {
  15672. if (isArray(props.modelValue)) {
  15673. dayOrDays = props.modelValue.map((d) => parseDate(d, props.valueFormat, lang.value));
  15674. } else {
  15675. dayOrDays = parseDate(props.modelValue, props.valueFormat, lang.value);
  15676. }
  15677. }
  15678. if (pickerOptions.value.getRangeAvailableTime) {
  15679. const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays);
  15680. if (!isEqual$1(availableResult, dayOrDays)) {
  15681. dayOrDays = availableResult;
  15682. emitInput(isArray(dayOrDays) ? dayOrDays.map((_) => _.toDate()) : dayOrDays.toDate());
  15683. }
  15684. }
  15685. if (isArray(dayOrDays) && dayOrDays.some((day) => !day)) {
  15686. dayOrDays = [];
  15687. }
  15688. return dayOrDays;
  15689. });
  15690. const displayValue = vue.computed(() => {
  15691. if (!pickerOptions.value.panelReady)
  15692. return "";
  15693. const formattedValue = formatDayjsToString(parsedValue.value);
  15694. if (isArray(userInput.value)) {
  15695. return [
  15696. userInput.value[0] || formattedValue && formattedValue[0] || "",
  15697. userInput.value[1] || formattedValue && formattedValue[1] || ""
  15698. ];
  15699. } else if (userInput.value !== null) {
  15700. return userInput.value;
  15701. }
  15702. if (!isTimePicker.value && valueIsEmpty.value)
  15703. return "";
  15704. if (!pickerVisible.value && valueIsEmpty.value)
  15705. return "";
  15706. if (formattedValue) {
  15707. return isDatesPicker.value ? formattedValue.join(", ") : formattedValue;
  15708. }
  15709. return "";
  15710. });
  15711. const isTimeLikePicker = vue.computed(() => props.type.includes("time"));
  15712. const isTimePicker = vue.computed(() => props.type.startsWith("time"));
  15713. const isDatesPicker = vue.computed(() => props.type === "dates");
  15714. const triggerIcon = vue.computed(() => props.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default));
  15715. const showClose = vue.ref(false);
  15716. const onClearIconClick = (event) => {
  15717. if (props.readonly || pickerDisabled.value)
  15718. return;
  15719. if (showClose.value) {
  15720. event.stopPropagation();
  15721. focusOnInputBox();
  15722. emitInput(null);
  15723. emitChange(null, true);
  15724. showClose.value = false;
  15725. pickerVisible.value = false;
  15726. pickerOptions.value.handleClear && pickerOptions.value.handleClear();
  15727. }
  15728. };
  15729. const valueIsEmpty = vue.computed(() => {
  15730. const { modelValue } = props;
  15731. return !modelValue || isArray(modelValue) && !modelValue.filter(Boolean).length;
  15732. });
  15733. const onMouseDownInput = async (event) => {
  15734. var _a;
  15735. if (props.readonly || pickerDisabled.value)
  15736. return;
  15737. if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
  15738. pickerVisible.value = true;
  15739. }
  15740. };
  15741. const onMouseEnter = () => {
  15742. if (props.readonly || pickerDisabled.value)
  15743. return;
  15744. if (!valueIsEmpty.value && props.clearable) {
  15745. showClose.value = true;
  15746. }
  15747. };
  15748. const onMouseLeave = () => {
  15749. showClose.value = false;
  15750. };
  15751. const onTouchStartInput = (event) => {
  15752. var _a;
  15753. if (props.readonly || pickerDisabled.value)
  15754. return;
  15755. if (((_a = event.touches[0].target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
  15756. pickerVisible.value = true;
  15757. }
  15758. };
  15759. const isRangeInput = vue.computed(() => {
  15760. return props.type.includes("range");
  15761. });
  15762. const pickerSize = useSize();
  15763. const popperEl = vue.computed(() => {
  15764. var _a, _b;
  15765. return (_b = (_a = vue.unref(refPopper)) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  15766. });
  15767. const actualInputRef = vue.computed(() => {
  15768. var _a;
  15769. if (vue.unref(isRangeInput)) {
  15770. return vue.unref(inputRef);
  15771. }
  15772. return (_a = vue.unref(inputRef)) == null ? void 0 : _a.$el;
  15773. });
  15774. onClickOutside(actualInputRef, (e) => {
  15775. const unrefedPopperEl = vue.unref(popperEl);
  15776. const inputEl = vue.unref(actualInputRef);
  15777. if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || e.composedPath().includes(inputEl))
  15778. return;
  15779. pickerVisible.value = false;
  15780. });
  15781. const userInput = vue.ref(null);
  15782. const handleChange = () => {
  15783. if (userInput.value) {
  15784. const value = parseUserInputToDayjs(displayValue.value);
  15785. if (value) {
  15786. if (isValidValue(value)) {
  15787. emitInput(isArray(value) ? value.map((_) => _.toDate()) : value.toDate());
  15788. userInput.value = null;
  15789. }
  15790. }
  15791. }
  15792. if (userInput.value === "") {
  15793. emitInput(null);
  15794. emitChange(null);
  15795. userInput.value = null;
  15796. }
  15797. };
  15798. const parseUserInputToDayjs = (value) => {
  15799. if (!value)
  15800. return null;
  15801. return pickerOptions.value.parseUserInput(value);
  15802. };
  15803. const formatDayjsToString = (value) => {
  15804. if (!value)
  15805. return null;
  15806. return pickerOptions.value.formatToString(value);
  15807. };
  15808. const isValidValue = (value) => {
  15809. return pickerOptions.value.isValidValue(value);
  15810. };
  15811. const handleKeydownInput = async (event) => {
  15812. if (props.readonly || pickerDisabled.value)
  15813. return;
  15814. const { code } = event;
  15815. emitKeydown(event);
  15816. if (code === EVENT_CODE.esc) {
  15817. if (pickerVisible.value === true) {
  15818. pickerVisible.value = false;
  15819. event.preventDefault();
  15820. event.stopPropagation();
  15821. }
  15822. return;
  15823. }
  15824. if (code === EVENT_CODE.down) {
  15825. if (pickerOptions.value.handleFocusPicker) {
  15826. event.preventDefault();
  15827. event.stopPropagation();
  15828. }
  15829. if (pickerVisible.value === false) {
  15830. pickerVisible.value = true;
  15831. await vue.nextTick();
  15832. }
  15833. if (pickerOptions.value.handleFocusPicker) {
  15834. pickerOptions.value.handleFocusPicker();
  15835. return;
  15836. }
  15837. }
  15838. if (code === EVENT_CODE.tab) {
  15839. hasJustTabExitedInput = true;
  15840. return;
  15841. }
  15842. if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) {
  15843. if (userInput.value === null || userInput.value === "" || isValidValue(parseUserInputToDayjs(displayValue.value))) {
  15844. handleChange();
  15845. pickerVisible.value = false;
  15846. }
  15847. event.stopPropagation();
  15848. return;
  15849. }
  15850. if (userInput.value) {
  15851. event.stopPropagation();
  15852. return;
  15853. }
  15854. if (pickerOptions.value.handleKeydownInput) {
  15855. pickerOptions.value.handleKeydownInput(event);
  15856. }
  15857. };
  15858. const onUserInput = (e) => {
  15859. userInput.value = e;
  15860. if (!pickerVisible.value) {
  15861. pickerVisible.value = true;
  15862. }
  15863. };
  15864. const handleStartInput = (event) => {
  15865. const target = event.target;
  15866. if (userInput.value) {
  15867. userInput.value = [target.value, userInput.value[1]];
  15868. } else {
  15869. userInput.value = [target.value, null];
  15870. }
  15871. };
  15872. const handleEndInput = (event) => {
  15873. const target = event.target;
  15874. if (userInput.value) {
  15875. userInput.value = [userInput.value[0], target.value];
  15876. } else {
  15877. userInput.value = [null, target.value];
  15878. }
  15879. };
  15880. const handleStartChange = () => {
  15881. var _a;
  15882. const values = userInput.value;
  15883. const value = parseUserInputToDayjs(values && values[0]);
  15884. const parsedVal = vue.unref(parsedValue);
  15885. if (value && value.isValid()) {
  15886. userInput.value = [
  15887. formatDayjsToString(value),
  15888. ((_a = displayValue.value) == null ? void 0 : _a[1]) || null
  15889. ];
  15890. const newValue = [value, parsedVal && (parsedVal[1] || null)];
  15891. if (isValidValue(newValue)) {
  15892. emitInput(newValue);
  15893. userInput.value = null;
  15894. }
  15895. }
  15896. };
  15897. const handleEndChange = () => {
  15898. var _a;
  15899. const values = vue.unref(userInput);
  15900. const value = parseUserInputToDayjs(values && values[1]);
  15901. const parsedVal = vue.unref(parsedValue);
  15902. if (value && value.isValid()) {
  15903. userInput.value = [
  15904. ((_a = vue.unref(displayValue)) == null ? void 0 : _a[0]) || null,
  15905. formatDayjsToString(value)
  15906. ];
  15907. const newValue = [parsedVal && parsedVal[0], value];
  15908. if (isValidValue(newValue)) {
  15909. emitInput(newValue);
  15910. userInput.value = null;
  15911. }
  15912. }
  15913. };
  15914. const pickerOptions = vue.ref({});
  15915. const onSetPickerOption = (e) => {
  15916. pickerOptions.value[e[0]] = e[1];
  15917. pickerOptions.value.panelReady = true;
  15918. };
  15919. const onCalendarChange = (e) => {
  15920. emit("calendar-change", e);
  15921. };
  15922. const onPanelChange = (value, mode, view) => {
  15923. emit("panel-change", value, mode, view);
  15924. };
  15925. vue.provide("EP_PICKER_BASE", {
  15926. props
  15927. });
  15928. expose({
  15929. focus,
  15930. handleFocusInput,
  15931. handleBlurInput,
  15932. handleOpen,
  15933. handleClose,
  15934. onPick
  15935. });
  15936. return (_ctx, _cache) => {
  15937. return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), vue.mergeProps({
  15938. ref_key: "refPopper",
  15939. ref: refPopper,
  15940. visible: pickerVisible.value,
  15941. effect: "light",
  15942. pure: "",
  15943. trigger: "click"
  15944. }, _ctx.$attrs, {
  15945. role: "dialog",
  15946. teleported: "",
  15947. transition: `${vue.unref(nsDate).namespace.value}-zoom-in-top`,
  15948. "popper-class": [`${vue.unref(nsDate).namespace.value}-picker__popper`, _ctx.popperClass],
  15949. "popper-options": vue.unref(elPopperOptions),
  15950. "fallback-placements": ["bottom", "top", "right", "left"],
  15951. "gpu-acceleration": false,
  15952. "stop-popper-mouse-event": false,
  15953. "hide-after": 0,
  15954. persistent: "",
  15955. onBeforeShow,
  15956. onShow,
  15957. onHide
  15958. }), {
  15959. default: vue.withCtx(() => [
  15960. !vue.unref(isRangeInput) ? (vue.openBlock(), vue.createBlock(vue.unref(ElInput), {
  15961. key: 0,
  15962. id: _ctx.id,
  15963. ref_key: "inputRef",
  15964. ref: inputRef,
  15965. "container-role": "combobox",
  15966. "model-value": vue.unref(displayValue),
  15967. name: _ctx.name,
  15968. size: vue.unref(pickerSize),
  15969. disabled: vue.unref(pickerDisabled),
  15970. placeholder: _ctx.placeholder,
  15971. class: vue.normalizeClass([vue.unref(nsDate).b("editor"), vue.unref(nsDate).bm("editor", _ctx.type), _ctx.$attrs.class]),
  15972. style: vue.normalizeStyle(_ctx.$attrs.style),
  15973. readonly: !_ctx.editable || _ctx.readonly || vue.unref(isDatesPicker) || _ctx.type === "week",
  15974. label: _ctx.label,
  15975. tabindex: _ctx.tabindex,
  15976. "validate-event": false,
  15977. onInput: onUserInput,
  15978. onFocus: handleFocusInput,
  15979. onBlur: handleBlurInput,
  15980. onKeydown: handleKeydownInput,
  15981. onChange: handleChange,
  15982. onMousedown: onMouseDownInput,
  15983. onMouseenter: onMouseEnter,
  15984. onMouseleave: onMouseLeave,
  15985. onTouchstart: onTouchStartInput,
  15986. onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  15987. }, ["stop"]))
  15988. }, {
  15989. prefix: vue.withCtx(() => [
  15990. vue.unref(triggerIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  15991. key: 0,
  15992. class: vue.normalizeClass(vue.unref(nsInput).e("icon")),
  15993. onMousedown: vue.withModifiers(onMouseDownInput, ["prevent"]),
  15994. onTouchstart: onTouchStartInput
  15995. }, {
  15996. default: vue.withCtx(() => [
  15997. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(triggerIcon))))
  15998. ]),
  15999. _: 1
  16000. }, 8, ["class", "onMousedown"])) : vue.createCommentVNode("v-if", true)
  16001. ]),
  16002. suffix: vue.withCtx(() => [
  16003. showClose.value && _ctx.clearIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  16004. key: 0,
  16005. class: vue.normalizeClass(`${vue.unref(nsInput).e("icon")} clear-icon`),
  16006. onClick: vue.withModifiers(onClearIconClick, ["stop"])
  16007. }, {
  16008. default: vue.withCtx(() => [
  16009. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.clearIcon)))
  16010. ]),
  16011. _: 1
  16012. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  16013. ]),
  16014. _: 1
  16015. }, 8, ["id", "model-value", "name", "size", "disabled", "placeholder", "class", "style", "readonly", "label", "tabindex", "onKeydown"])) : (vue.openBlock(), vue.createElementBlock("div", {
  16016. key: 1,
  16017. ref_key: "inputRef",
  16018. ref: inputRef,
  16019. class: vue.normalizeClass([
  16020. vue.unref(nsDate).b("editor"),
  16021. vue.unref(nsDate).bm("editor", _ctx.type),
  16022. vue.unref(nsInput).e("wrapper"),
  16023. vue.unref(nsDate).is("disabled", vue.unref(pickerDisabled)),
  16024. vue.unref(nsDate).is("active", pickerVisible.value),
  16025. vue.unref(nsRange).b("editor"),
  16026. vue.unref(pickerSize) ? vue.unref(nsRange).bm("editor", vue.unref(pickerSize)) : "",
  16027. _ctx.$attrs.class
  16028. ]),
  16029. style: vue.normalizeStyle(_ctx.$attrs.style),
  16030. onClick: handleFocusInput,
  16031. onMouseenter: onMouseEnter,
  16032. onMouseleave: onMouseLeave,
  16033. onTouchstart: onTouchStartInput,
  16034. onKeydown: handleKeydownInput
  16035. }, [
  16036. vue.unref(triggerIcon) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  16037. key: 0,
  16038. class: vue.normalizeClass([vue.unref(nsInput).e("icon"), vue.unref(nsRange).e("icon")]),
  16039. onMousedown: vue.withModifiers(onMouseDownInput, ["prevent"]),
  16040. onTouchstart: onTouchStartInput
  16041. }, {
  16042. default: vue.withCtx(() => [
  16043. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(triggerIcon))))
  16044. ]),
  16045. _: 1
  16046. }, 8, ["class", "onMousedown"])) : vue.createCommentVNode("v-if", true),
  16047. vue.createElementVNode("input", {
  16048. id: _ctx.id && _ctx.id[0],
  16049. autocomplete: "off",
  16050. name: _ctx.name && _ctx.name[0],
  16051. placeholder: _ctx.startPlaceholder,
  16052. value: vue.unref(displayValue) && vue.unref(displayValue)[0],
  16053. disabled: vue.unref(pickerDisabled),
  16054. readonly: !_ctx.editable || _ctx.readonly,
  16055. class: vue.normalizeClass(vue.unref(nsRange).b("input")),
  16056. onMousedown: onMouseDownInput,
  16057. onInput: handleStartInput,
  16058. onChange: handleStartChange,
  16059. onFocus: handleFocusInput,
  16060. onBlur: handleBlurInput
  16061. }, null, 42, _hoisted_1$Z),
  16062. vue.renderSlot(_ctx.$slots, "range-separator", {}, () => [
  16063. vue.createElementVNode("span", {
  16064. class: vue.normalizeClass(vue.unref(nsRange).b("separator"))
  16065. }, vue.toDisplayString(_ctx.rangeSeparator), 3)
  16066. ]),
  16067. vue.createElementVNode("input", {
  16068. id: _ctx.id && _ctx.id[1],
  16069. autocomplete: "off",
  16070. name: _ctx.name && _ctx.name[1],
  16071. placeholder: _ctx.endPlaceholder,
  16072. value: vue.unref(displayValue) && vue.unref(displayValue)[1],
  16073. disabled: vue.unref(pickerDisabled),
  16074. readonly: !_ctx.editable || _ctx.readonly,
  16075. class: vue.normalizeClass(vue.unref(nsRange).b("input")),
  16076. onMousedown: onMouseDownInput,
  16077. onFocus: handleFocusInput,
  16078. onBlur: handleBlurInput,
  16079. onInput: handleEndInput,
  16080. onChange: handleEndChange
  16081. }, null, 42, _hoisted_2$D),
  16082. _ctx.clearIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  16083. key: 1,
  16084. class: vue.normalizeClass([
  16085. vue.unref(nsInput).e("icon"),
  16086. vue.unref(nsRange).e("close-icon"),
  16087. {
  16088. [vue.unref(nsRange).e("close-icon--hidden")]: !showClose.value
  16089. }
  16090. ]),
  16091. onClick: onClearIconClick
  16092. }, {
  16093. default: vue.withCtx(() => [
  16094. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.clearIcon)))
  16095. ]),
  16096. _: 1
  16097. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  16098. ], 38))
  16099. ]),
  16100. content: vue.withCtx(() => [
  16101. vue.renderSlot(_ctx.$slots, "default", {
  16102. visible: pickerVisible.value,
  16103. actualVisible: pickerActualVisible.value,
  16104. parsedValue: vue.unref(parsedValue),
  16105. format: _ctx.format,
  16106. unlinkPanels: _ctx.unlinkPanels,
  16107. type: _ctx.type,
  16108. defaultValue: _ctx.defaultValue,
  16109. onPick,
  16110. onSelectRange: setSelectionRange,
  16111. onSetPickerOption,
  16112. onCalendarChange,
  16113. onPanelChange,
  16114. onKeydown: onKeydownPopperContent,
  16115. onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(() => {
  16116. }, ["stop"]))
  16117. })
  16118. ]),
  16119. _: 3
  16120. }, 16, ["visible", "transition", "popper-class", "popper-options"]);
  16121. };
  16122. }
  16123. });
  16124. var CommonPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1W, [["__file", "picker.vue"]]);
  16125. const panelTimePickerProps = buildProps({
  16126. ...timePanelSharedProps,
  16127. datetimeRole: String,
  16128. parsedValue: {
  16129. type: definePropType(Object)
  16130. }
  16131. });
  16132. const useTimePanel = ({
  16133. getAvailableHours,
  16134. getAvailableMinutes,
  16135. getAvailableSeconds
  16136. }) => {
  16137. const getAvailableTime = (date, role, first, compareDate) => {
  16138. const availableTimeGetters = {
  16139. hour: getAvailableHours,
  16140. minute: getAvailableMinutes,
  16141. second: getAvailableSeconds
  16142. };
  16143. let result = date;
  16144. ["hour", "minute", "second"].forEach((type) => {
  16145. if (availableTimeGetters[type]) {
  16146. let availableTimeSlots;
  16147. const method = availableTimeGetters[type];
  16148. switch (type) {
  16149. case "minute": {
  16150. availableTimeSlots = method(result.hour(), role, compareDate);
  16151. break;
  16152. }
  16153. case "second": {
  16154. availableTimeSlots = method(result.hour(), result.minute(), role, compareDate);
  16155. break;
  16156. }
  16157. default: {
  16158. availableTimeSlots = method(role, compareDate);
  16159. break;
  16160. }
  16161. }
  16162. if ((availableTimeSlots == null ? void 0 : availableTimeSlots.length) && !availableTimeSlots.includes(result[type]())) {
  16163. const pos = first ? 0 : availableTimeSlots.length - 1;
  16164. result = result[type](availableTimeSlots[pos]);
  16165. }
  16166. }
  16167. });
  16168. return result;
  16169. };
  16170. const timePickerOptions = {};
  16171. const onSetOption = ([key, val]) => {
  16172. timePickerOptions[key] = val;
  16173. };
  16174. return {
  16175. timePickerOptions,
  16176. getAvailableTime,
  16177. onSetOption
  16178. };
  16179. };
  16180. const makeAvailableArr = (disabledList) => {
  16181. const trueOrNumber = (isDisabled, index) => isDisabled || index;
  16182. const getNumber = (predicate) => predicate !== true;
  16183. return disabledList.map(trueOrNumber).filter(getNumber);
  16184. };
  16185. const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
  16186. const getHoursList = (role, compare) => {
  16187. return makeList(24, disabledHours && (() => disabledHours == null ? void 0 : disabledHours(role, compare)));
  16188. };
  16189. const getMinutesList = (hour, role, compare) => {
  16190. return makeList(60, disabledMinutes && (() => disabledMinutes == null ? void 0 : disabledMinutes(hour, role, compare)));
  16191. };
  16192. const getSecondsList = (hour, minute, role, compare) => {
  16193. return makeList(60, disabledSeconds && (() => disabledSeconds == null ? void 0 : disabledSeconds(hour, minute, role, compare)));
  16194. };
  16195. return {
  16196. getHoursList,
  16197. getMinutesList,
  16198. getSecondsList
  16199. };
  16200. };
  16201. const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
  16202. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds);
  16203. const getAvailableHours = (role, compare) => {
  16204. return makeAvailableArr(getHoursList(role, compare));
  16205. };
  16206. const getAvailableMinutes = (hour, role, compare) => {
  16207. return makeAvailableArr(getMinutesList(hour, role, compare));
  16208. };
  16209. const getAvailableSeconds = (hour, minute, role, compare) => {
  16210. return makeAvailableArr(getSecondsList(hour, minute, role, compare));
  16211. };
  16212. return {
  16213. getAvailableHours,
  16214. getAvailableMinutes,
  16215. getAvailableSeconds
  16216. };
  16217. };
  16218. const useOldValue = (props) => {
  16219. const oldValue = vue.ref(props.parsedValue);
  16220. vue.watch(() => props.visible, (val) => {
  16221. if (!val) {
  16222. oldValue.value = props.parsedValue;
  16223. }
  16224. });
  16225. return oldValue;
  16226. };
  16227. const nodeList = /* @__PURE__ */ new Map();
  16228. let startClick;
  16229. if (isClient) {
  16230. document.addEventListener("mousedown", (e) => startClick = e);
  16231. document.addEventListener("mouseup", (e) => {
  16232. for (const handlers of nodeList.values()) {
  16233. for (const { documentHandler } of handlers) {
  16234. documentHandler(e, startClick);
  16235. }
  16236. }
  16237. });
  16238. }
  16239. function createDocumentHandler(el, binding) {
  16240. let excludes = [];
  16241. if (Array.isArray(binding.arg)) {
  16242. excludes = binding.arg;
  16243. } else if (isElement$1(binding.arg)) {
  16244. excludes.push(binding.arg);
  16245. }
  16246. return function(mouseup, mousedown) {
  16247. const popperRef = binding.instance.popperRef;
  16248. const mouseUpTarget = mouseup.target;
  16249. const mouseDownTarget = mousedown == null ? void 0 : mousedown.target;
  16250. const isBound = !binding || !binding.instance;
  16251. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  16252. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  16253. const isSelf = el === mouseUpTarget;
  16254. const isTargetExcluded = excludes.length && excludes.some((item) => item == null ? void 0 : item.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  16255. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  16256. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
  16257. return;
  16258. }
  16259. binding.value(mouseup, mousedown);
  16260. };
  16261. }
  16262. const ClickOutside = {
  16263. beforeMount(el, binding) {
  16264. if (!nodeList.has(el)) {
  16265. nodeList.set(el, []);
  16266. }
  16267. nodeList.get(el).push({
  16268. documentHandler: createDocumentHandler(el, binding),
  16269. bindingFn: binding.value
  16270. });
  16271. },
  16272. updated(el, binding) {
  16273. if (!nodeList.has(el)) {
  16274. nodeList.set(el, []);
  16275. }
  16276. const handlers = nodeList.get(el);
  16277. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  16278. const newHandler = {
  16279. documentHandler: createDocumentHandler(el, binding),
  16280. bindingFn: binding.value
  16281. };
  16282. if (oldHandlerIndex >= 0) {
  16283. handlers.splice(oldHandlerIndex, 1, newHandler);
  16284. } else {
  16285. handlers.push(newHandler);
  16286. }
  16287. },
  16288. unmounted(el) {
  16289. nodeList.delete(el);
  16290. }
  16291. };
  16292. const REPEAT_INTERVAL = 100;
  16293. const REPEAT_DELAY = 600;
  16294. const vRepeatClick = {
  16295. beforeMount(el, binding) {
  16296. const value = binding.value;
  16297. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction(value) ? {} : value;
  16298. let intervalId;
  16299. let delayId;
  16300. const handler = () => isFunction(value) ? value() : value.handler();
  16301. const clear = () => {
  16302. if (delayId) {
  16303. clearTimeout(delayId);
  16304. delayId = void 0;
  16305. }
  16306. if (intervalId) {
  16307. clearInterval(intervalId);
  16308. intervalId = void 0;
  16309. }
  16310. };
  16311. el.addEventListener("mousedown", (evt) => {
  16312. if (evt.button !== 0)
  16313. return;
  16314. clear();
  16315. handler();
  16316. document.addEventListener("mouseup", () => clear(), {
  16317. once: true
  16318. });
  16319. delayId = setTimeout(() => {
  16320. intervalId = setInterval(() => {
  16321. handler();
  16322. }, interval);
  16323. }, delay);
  16324. });
  16325. }
  16326. };
  16327. const FOCUSABLE_CHILDREN = "_trap-focus-children";
  16328. const FOCUS_STACK = [];
  16329. const FOCUS_HANDLER = (e) => {
  16330. if (FOCUS_STACK.length === 0)
  16331. return;
  16332. const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN];
  16333. if (focusableElement.length > 0 && e.code === EVENT_CODE.tab) {
  16334. if (focusableElement.length === 1) {
  16335. e.preventDefault();
  16336. if (document.activeElement !== focusableElement[0]) {
  16337. focusableElement[0].focus();
  16338. }
  16339. return;
  16340. }
  16341. const goingBackward = e.shiftKey;
  16342. const isFirst = e.target === focusableElement[0];
  16343. const isLast = e.target === focusableElement[focusableElement.length - 1];
  16344. if (isFirst && goingBackward) {
  16345. e.preventDefault();
  16346. focusableElement[focusableElement.length - 1].focus();
  16347. }
  16348. if (isLast && !goingBackward) {
  16349. e.preventDefault();
  16350. focusableElement[0].focus();
  16351. }
  16352. }
  16353. };
  16354. const TrapFocus = {
  16355. beforeMount(el) {
  16356. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  16357. FOCUS_STACK.push(el);
  16358. if (FOCUS_STACK.length <= 1) {
  16359. document.addEventListener("keydown", FOCUS_HANDLER);
  16360. }
  16361. },
  16362. updated(el) {
  16363. vue.nextTick(() => {
  16364. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  16365. });
  16366. },
  16367. unmounted() {
  16368. FOCUS_STACK.shift();
  16369. if (FOCUS_STACK.length === 0) {
  16370. document.removeEventListener("keydown", FOCUS_HANDLER);
  16371. }
  16372. }
  16373. };
  16374. var v=!1,o,f,s,u,d,N,l,p,m,w,D,x,E,M,F;function a(){if(!v){v=!0;var e=navigator.userAgent,n=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),i=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(x=/\b(iPhone|iP[ao]d)/.exec(e),E=/\b(iP[ao]d)/.exec(e),w=/Android/i.exec(e),M=/FBAN\/\w+;/i.exec(e),F=/Mobile/i.exec(e),D=!!/Win64/.exec(e),n){o=n[1]?parseFloat(n[1]):n[5]?parseFloat(n[5]):NaN,o&&document&&document.documentMode&&(o=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);N=r?parseFloat(r[1])+4:o,f=n[2]?parseFloat(n[2]):NaN,s=n[3]?parseFloat(n[3]):NaN,u=n[4]?parseFloat(n[4]):NaN,u?(n=/(?:Chrome\/(\d+\.\d+))/.exec(e),d=n&&n[1]?parseFloat(n[1]):NaN):d=NaN;}else o=f=s=d=u=NaN;if(i){if(i[1]){var t=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l=t?parseFloat(t[1].replace("_",".")):!0;}else l=!1;p=!!i[2],m=!!i[3];}else l=p=m=!1;}}var _={ie:function(){return a()||o},ieCompatibilityMode:function(){return a()||N>o},ie64:function(){return _.ie()&&D},firefox:function(){return a()||f},opera:function(){return a()||s},webkit:function(){return a()||u},safari:function(){return _.webkit()},chrome:function(){return a()||d},windows:function(){return a()||p},osx:function(){return a()||l},linux:function(){return a()||m},iphone:function(){return a()||x},mobile:function(){return a()||x||E||w||F},nativeApp:function(){return a()||M},android:function(){return a()||w},ipad:function(){return a()||E}},A=_;var c=!!(typeof window<"u"&&window.document&&window.document.createElement),U={canUseDOM:c,canUseWorkers:typeof Worker<"u",canUseEventListeners:c&&!!(window.addEventListener||window.attachEvent),canUseViewport:c&&!!window.screen,isInWorker:!c},h=U;var X;h.canUseDOM&&(X=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);function S(e,n){if(!h.canUseDOM||n&&!("addEventListener"in document))return !1;var i="on"+e,r=i in document;if(!r){var t=document.createElement("div");t.setAttribute(i,"return;"),r=typeof t[i]=="function";}return !r&&X&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var b=S;var O=10,I=40,P=800;function T(e){var n=0,i=0,r=0,t=0;return "detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(n=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(n=i,i=0),r=n*O,t=i*O,"deltaY"in e&&(t=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||t)&&e.deltaMode&&(e.deltaMode==1?(r*=I,t*=I):(r*=P,t*=P)),r&&!n&&(n=r<1?-1:1),t&&!i&&(i=t<1?-1:1),{spinX:n,spinY:i,pixelX:r,pixelY:t}}T.getEventType=function(){return A.firefox()?"DOMMouseScroll":b("wheel")?"wheel":"mousewheel"};var Y=T;/**
  16375. * Checks if an event is supported in the current execution environment.
  16376. *
  16377. * NOTE: This will not work correctly for non-generic events such as `change`,
  16378. * `reset`, `load`, `error`, and `select`.
  16379. *
  16380. * Borrows from Modernizr.
  16381. *
  16382. * @param {string} eventNameSuffix Event name, e.g. "click".
  16383. * @param {?boolean} capture Check if the capture phase is supported.
  16384. * @return {boolean} True if the event is supported.
  16385. * @internal
  16386. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  16387. */
  16388. const mousewheel = function(element, callback) {
  16389. if (element && element.addEventListener) {
  16390. const fn = function(event) {
  16391. const normalized = Y(event);
  16392. callback && Reflect.apply(callback, this, [event, normalized]);
  16393. };
  16394. element.addEventListener("wheel", fn, { passive: true });
  16395. }
  16396. };
  16397. const Mousewheel = {
  16398. beforeMount(el, binding) {
  16399. mousewheel(el, binding.value);
  16400. }
  16401. };
  16402. const basicTimeSpinnerProps = buildProps({
  16403. role: {
  16404. type: String,
  16405. required: true
  16406. },
  16407. spinnerDate: {
  16408. type: definePropType(Object),
  16409. required: true
  16410. },
  16411. showSeconds: {
  16412. type: Boolean,
  16413. default: true
  16414. },
  16415. arrowControl: Boolean,
  16416. amPmMode: {
  16417. type: definePropType(String),
  16418. default: ""
  16419. },
  16420. ...disabledTimeListsProps
  16421. });
  16422. const _hoisted_1$Y = ["onClick"];
  16423. const _hoisted_2$C = ["onMouseenter"];
  16424. const _sfc_main$1V = /* @__PURE__ */ vue.defineComponent({
  16425. __name: "basic-time-spinner",
  16426. props: basicTimeSpinnerProps,
  16427. emits: ["change", "select-range", "set-option"],
  16428. setup(__props, { emit }) {
  16429. const props = __props;
  16430. const ns = useNamespace("time");
  16431. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props.disabledHours, props.disabledMinutes, props.disabledSeconds);
  16432. let isScrolling = false;
  16433. const currentScrollbar = vue.ref();
  16434. const listHoursRef = vue.ref();
  16435. const listMinutesRef = vue.ref();
  16436. const listSecondsRef = vue.ref();
  16437. const listRefsMap = {
  16438. hours: listHoursRef,
  16439. minutes: listMinutesRef,
  16440. seconds: listSecondsRef
  16441. };
  16442. const spinnerItems = vue.computed(() => {
  16443. return props.showSeconds ? timeUnits$1 : timeUnits$1.slice(0, 2);
  16444. });
  16445. const timePartials = vue.computed(() => {
  16446. const { spinnerDate } = props;
  16447. const hours = spinnerDate.hour();
  16448. const minutes = spinnerDate.minute();
  16449. const seconds = spinnerDate.second();
  16450. return { hours, minutes, seconds };
  16451. });
  16452. const timeList = vue.computed(() => {
  16453. const { hours, minutes } = vue.unref(timePartials);
  16454. return {
  16455. hours: getHoursList(props.role),
  16456. minutes: getMinutesList(hours, props.role),
  16457. seconds: getSecondsList(hours, minutes, props.role)
  16458. };
  16459. });
  16460. const arrowControlTimeList = vue.computed(() => {
  16461. const { hours, minutes, seconds } = vue.unref(timePartials);
  16462. return {
  16463. hours: buildTimeList(hours, 23),
  16464. minutes: buildTimeList(minutes, 59),
  16465. seconds: buildTimeList(seconds, 59)
  16466. };
  16467. });
  16468. const debouncedResetScroll = debounce((type) => {
  16469. isScrolling = false;
  16470. adjustCurrentSpinner(type);
  16471. }, 200);
  16472. const getAmPmFlag = (hour) => {
  16473. const shouldShowAmPm = !!props.amPmMode;
  16474. if (!shouldShowAmPm)
  16475. return "";
  16476. const isCapital = props.amPmMode === "A";
  16477. let content = hour < 12 ? " am" : " pm";
  16478. if (isCapital)
  16479. content = content.toUpperCase();
  16480. return content;
  16481. };
  16482. const emitSelectRange = (type) => {
  16483. let range;
  16484. switch (type) {
  16485. case "hours":
  16486. range = [0, 2];
  16487. break;
  16488. case "minutes":
  16489. range = [3, 5];
  16490. break;
  16491. case "seconds":
  16492. range = [6, 8];
  16493. break;
  16494. }
  16495. const [left, right] = range;
  16496. emit("select-range", left, right);
  16497. currentScrollbar.value = type;
  16498. };
  16499. const adjustCurrentSpinner = (type) => {
  16500. adjustSpinner(type, vue.unref(timePartials)[type]);
  16501. };
  16502. const adjustSpinners = () => {
  16503. adjustCurrentSpinner("hours");
  16504. adjustCurrentSpinner("minutes");
  16505. adjustCurrentSpinner("seconds");
  16506. };
  16507. const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  16508. const adjustSpinner = (type, value) => {
  16509. if (props.arrowControl)
  16510. return;
  16511. const scrollbar = vue.unref(listRefsMap[type]);
  16512. if (scrollbar && scrollbar.$el) {
  16513. getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type));
  16514. }
  16515. };
  16516. const typeItemHeight = (type) => {
  16517. const scrollbar = vue.unref(listRefsMap[type]);
  16518. return (scrollbar == null ? void 0 : scrollbar.$el.querySelector("li").offsetHeight) || 0;
  16519. };
  16520. const onIncrement = () => {
  16521. scrollDown(1);
  16522. };
  16523. const onDecrement = () => {
  16524. scrollDown(-1);
  16525. };
  16526. const scrollDown = (step) => {
  16527. if (!currentScrollbar.value) {
  16528. emitSelectRange("hours");
  16529. }
  16530. const label = currentScrollbar.value;
  16531. const now = vue.unref(timePartials)[label];
  16532. const total = currentScrollbar.value === "hours" ? 24 : 60;
  16533. const next = findNextUnDisabled(label, now, step, total);
  16534. modifyDateField(label, next);
  16535. adjustSpinner(label, next);
  16536. vue.nextTick(() => emitSelectRange(label));
  16537. };
  16538. const findNextUnDisabled = (type, now, step, total) => {
  16539. let next = (now + step + total) % total;
  16540. const list = vue.unref(timeList)[type];
  16541. while (list[next] && next !== now) {
  16542. next = (next + step + total) % total;
  16543. }
  16544. return next;
  16545. };
  16546. const modifyDateField = (type, value) => {
  16547. const list = vue.unref(timeList)[type];
  16548. const isDisabled = list[value];
  16549. if (isDisabled)
  16550. return;
  16551. const { hours, minutes, seconds } = vue.unref(timePartials);
  16552. let changeTo;
  16553. switch (type) {
  16554. case "hours":
  16555. changeTo = props.spinnerDate.hour(value).minute(minutes).second(seconds);
  16556. break;
  16557. case "minutes":
  16558. changeTo = props.spinnerDate.hour(hours).minute(value).second(seconds);
  16559. break;
  16560. case "seconds":
  16561. changeTo = props.spinnerDate.hour(hours).minute(minutes).second(value);
  16562. break;
  16563. }
  16564. emit("change", changeTo);
  16565. };
  16566. const handleClick = (type, { value, disabled }) => {
  16567. if (!disabled) {
  16568. modifyDateField(type, value);
  16569. emitSelectRange(type);
  16570. adjustSpinner(type, value);
  16571. }
  16572. };
  16573. const handleScroll = (type) => {
  16574. isScrolling = true;
  16575. debouncedResetScroll(type);
  16576. const value = Math.min(Math.round((getScrollbarElement(vue.unref(listRefsMap[type]).$el).scrollTop - (scrollBarHeight(type) * 0.5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59);
  16577. modifyDateField(type, value);
  16578. };
  16579. const scrollBarHeight = (type) => {
  16580. return vue.unref(listRefsMap[type]).$el.offsetHeight;
  16581. };
  16582. const bindScrollEvent = () => {
  16583. const bindFunction = (type) => {
  16584. const scrollbar = vue.unref(listRefsMap[type]);
  16585. if (scrollbar && scrollbar.$el) {
  16586. getScrollbarElement(scrollbar.$el).onscroll = () => {
  16587. handleScroll(type);
  16588. };
  16589. }
  16590. };
  16591. bindFunction("hours");
  16592. bindFunction("minutes");
  16593. bindFunction("seconds");
  16594. };
  16595. vue.onMounted(() => {
  16596. vue.nextTick(() => {
  16597. !props.arrowControl && bindScrollEvent();
  16598. adjustSpinners();
  16599. if (props.role === "start")
  16600. emitSelectRange("hours");
  16601. });
  16602. });
  16603. const setRef = (scrollbar, type) => {
  16604. listRefsMap[type].value = scrollbar;
  16605. };
  16606. emit("set-option", [`${props.role}_scrollDown`, scrollDown]);
  16607. emit("set-option", [`${props.role}_emitSelectRange`, emitSelectRange]);
  16608. vue.watch(() => props.spinnerDate, () => {
  16609. if (isScrolling)
  16610. return;
  16611. adjustSpinners();
  16612. });
  16613. return (_ctx, _cache) => {
  16614. return vue.openBlock(), vue.createElementBlock("div", {
  16615. class: vue.normalizeClass([vue.unref(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }])
  16616. }, [
  16617. !_ctx.arrowControl ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(spinnerItems), (item) => {
  16618. return vue.openBlock(), vue.createBlock(vue.unref(ElScrollbar), {
  16619. key: item,
  16620. ref_for: true,
  16621. ref: (scrollbar) => setRef(scrollbar, item),
  16622. class: vue.normalizeClass(vue.unref(ns).be("spinner", "wrapper")),
  16623. "wrap-style": "max-height: inherit;",
  16624. "view-class": vue.unref(ns).be("spinner", "list"),
  16625. noresize: "",
  16626. tag: "ul",
  16627. onMouseenter: ($event) => emitSelectRange(item),
  16628. onMousemove: ($event) => adjustCurrentSpinner(item)
  16629. }, {
  16630. default: vue.withCtx(() => [
  16631. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(timeList)[item], (disabled, key) => {
  16632. return vue.openBlock(), vue.createElementBlock("li", {
  16633. key,
  16634. class: vue.normalizeClass([
  16635. vue.unref(ns).be("spinner", "item"),
  16636. vue.unref(ns).is("active", key === vue.unref(timePartials)[item]),
  16637. vue.unref(ns).is("disabled", disabled)
  16638. ]),
  16639. onClick: ($event) => handleClick(item, { value: key, disabled })
  16640. }, [
  16641. item === "hours" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  16642. vue.createTextVNode(vue.toDisplayString(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + vue.toDisplayString(getAmPmFlag(key)), 1)
  16643. ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  16644. vue.createTextVNode(vue.toDisplayString(("0" + key).slice(-2)), 1)
  16645. ], 64))
  16646. ], 10, _hoisted_1$Y);
  16647. }), 128))
  16648. ]),
  16649. _: 2
  16650. }, 1032, ["class", "view-class", "onMouseenter", "onMousemove"]);
  16651. }), 128)) : vue.createCommentVNode("v-if", true),
  16652. _ctx.arrowControl ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(vue.unref(spinnerItems), (item) => {
  16653. return vue.openBlock(), vue.createElementBlock("div", {
  16654. key: item,
  16655. class: vue.normalizeClass([vue.unref(ns).be("spinner", "wrapper"), vue.unref(ns).is("arrow")]),
  16656. onMouseenter: ($event) => emitSelectRange(item)
  16657. }, [
  16658. vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  16659. class: vue.normalizeClass(["arrow-up", vue.unref(ns).be("spinner", "arrow")])
  16660. }, {
  16661. default: vue.withCtx(() => [
  16662. vue.createVNode(vue.unref(arrow_up_default))
  16663. ]),
  16664. _: 1
  16665. }, 8, ["class"])), [
  16666. [vue.unref(vRepeatClick), onDecrement]
  16667. ]),
  16668. vue.withDirectives((vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  16669. class: vue.normalizeClass(["arrow-down", vue.unref(ns).be("spinner", "arrow")])
  16670. }, {
  16671. default: vue.withCtx(() => [
  16672. vue.createVNode(vue.unref(arrow_down_default))
  16673. ]),
  16674. _: 1
  16675. }, 8, ["class"])), [
  16676. [vue.unref(vRepeatClick), onIncrement]
  16677. ]),
  16678. vue.createElementVNode("ul", {
  16679. class: vue.normalizeClass(vue.unref(ns).be("spinner", "list"))
  16680. }, [
  16681. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(arrowControlTimeList)[item], (time, key) => {
  16682. return vue.openBlock(), vue.createElementBlock("li", {
  16683. key,
  16684. class: vue.normalizeClass([
  16685. vue.unref(ns).be("spinner", "item"),
  16686. vue.unref(ns).is("active", time === vue.unref(timePartials)[item]),
  16687. vue.unref(ns).is("disabled", vue.unref(timeList)[item][time])
  16688. ])
  16689. }, [
  16690. typeof time === "number" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  16691. item === "hours" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  16692. vue.createTextVNode(vue.toDisplayString(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + vue.toDisplayString(getAmPmFlag(time)), 1)
  16693. ], 64)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  16694. vue.createTextVNode(vue.toDisplayString(("0" + time).slice(-2)), 1)
  16695. ], 64))
  16696. ], 64)) : vue.createCommentVNode("v-if", true)
  16697. ], 2);
  16698. }), 128))
  16699. ], 2)
  16700. ], 42, _hoisted_2$C);
  16701. }), 128)) : vue.createCommentVNode("v-if", true)
  16702. ], 2);
  16703. };
  16704. }
  16705. });
  16706. var TimeSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$1V, [["__file", "basic-time-spinner.vue"]]);
  16707. const _sfc_main$1U = /* @__PURE__ */ vue.defineComponent({
  16708. __name: "panel-time-pick",
  16709. props: panelTimePickerProps,
  16710. emits: ["pick", "select-range", "set-picker-option"],
  16711. setup(__props, { emit }) {
  16712. const props = __props;
  16713. const pickerBase = vue.inject("EP_PICKER_BASE");
  16714. const {
  16715. arrowControl,
  16716. disabledHours,
  16717. disabledMinutes,
  16718. disabledSeconds,
  16719. defaultValue
  16720. } = pickerBase.props;
  16721. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds);
  16722. const ns = useNamespace("time");
  16723. const { t, lang } = useLocale();
  16724. const selectionRange = vue.ref([0, 2]);
  16725. const oldValue = useOldValue(props);
  16726. const transitionName = vue.computed(() => {
  16727. return isUndefined(props.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : "";
  16728. });
  16729. const showSeconds = vue.computed(() => {
  16730. return props.format.includes("ss");
  16731. });
  16732. const amPmMode = vue.computed(() => {
  16733. if (props.format.includes("A"))
  16734. return "A";
  16735. if (props.format.includes("a"))
  16736. return "a";
  16737. return "";
  16738. });
  16739. const isValidValue = (_date) => {
  16740. const parsedDate = dayjs(_date).locale(lang.value);
  16741. const result = getRangeAvailableTime(parsedDate);
  16742. return parsedDate.isSame(result);
  16743. };
  16744. const handleCancel = () => {
  16745. emit("pick", oldValue.value, false);
  16746. };
  16747. const handleConfirm = (visible = false, first = false) => {
  16748. if (first)
  16749. return;
  16750. emit("pick", props.parsedValue, visible);
  16751. };
  16752. const handleChange = (_date) => {
  16753. if (!props.visible) {
  16754. return;
  16755. }
  16756. const result = getRangeAvailableTime(_date).millisecond(0);
  16757. emit("pick", result, true);
  16758. };
  16759. const setSelectionRange = (start, end) => {
  16760. emit("select-range", start, end);
  16761. selectionRange.value = [start, end];
  16762. };
  16763. const changeSelectionRange = (step) => {
  16764. const list = [0, 3].concat(showSeconds.value ? [6] : []);
  16765. const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
  16766. const index = list.indexOf(selectionRange.value[0]);
  16767. const next = (index + step + list.length) % list.length;
  16768. timePickerOptions["start_emitSelectRange"](mapping[next]);
  16769. };
  16770. const handleKeydown = (event) => {
  16771. const code = event.code;
  16772. const { left, right, up, down } = EVENT_CODE;
  16773. if ([left, right].includes(code)) {
  16774. const step = code === left ? -1 : 1;
  16775. changeSelectionRange(step);
  16776. event.preventDefault();
  16777. return;
  16778. }
  16779. if ([up, down].includes(code)) {
  16780. const step = code === up ? -1 : 1;
  16781. timePickerOptions["start_scrollDown"](step);
  16782. event.preventDefault();
  16783. return;
  16784. }
  16785. };
  16786. const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({
  16787. getAvailableHours,
  16788. getAvailableMinutes,
  16789. getAvailableSeconds
  16790. });
  16791. const getRangeAvailableTime = (date) => {
  16792. return getAvailableTime(date, props.datetimeRole || "", true);
  16793. };
  16794. const parseUserInput = (value) => {
  16795. if (!value)
  16796. return null;
  16797. return dayjs(value, props.format).locale(lang.value);
  16798. };
  16799. const formatToString = (value) => {
  16800. if (!value)
  16801. return null;
  16802. return value.format(props.format);
  16803. };
  16804. const getDefaultValue = () => {
  16805. return dayjs(defaultValue).locale(lang.value);
  16806. };
  16807. emit("set-picker-option", ["isValidValue", isValidValue]);
  16808. emit("set-picker-option", ["formatToString", formatToString]);
  16809. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  16810. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  16811. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  16812. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  16813. return (_ctx, _cache) => {
  16814. return vue.openBlock(), vue.createBlock(vue.Transition, { name: vue.unref(transitionName) }, {
  16815. default: vue.withCtx(() => [
  16816. _ctx.actualVisible || _ctx.visible ? (vue.openBlock(), vue.createElementBlock("div", {
  16817. key: 0,
  16818. class: vue.normalizeClass(vue.unref(ns).b("panel"))
  16819. }, [
  16820. vue.createElementVNode("div", {
  16821. class: vue.normalizeClass([vue.unref(ns).be("panel", "content"), { "has-seconds": vue.unref(showSeconds) }])
  16822. }, [
  16823. vue.createVNode(TimeSpinner, {
  16824. ref: "spinner",
  16825. role: _ctx.datetimeRole || "start",
  16826. "arrow-control": vue.unref(arrowControl),
  16827. "show-seconds": vue.unref(showSeconds),
  16828. "am-pm-mode": vue.unref(amPmMode),
  16829. "spinner-date": _ctx.parsedValue,
  16830. "disabled-hours": vue.unref(disabledHours),
  16831. "disabled-minutes": vue.unref(disabledMinutes),
  16832. "disabled-seconds": vue.unref(disabledSeconds),
  16833. onChange: handleChange,
  16834. onSetOption: vue.unref(onSetOption),
  16835. onSelectRange: setSelectionRange
  16836. }, null, 8, ["role", "arrow-control", "show-seconds", "am-pm-mode", "spinner-date", "disabled-hours", "disabled-minutes", "disabled-seconds", "onSetOption"])
  16837. ], 2),
  16838. vue.createElementVNode("div", {
  16839. class: vue.normalizeClass(vue.unref(ns).be("panel", "footer"))
  16840. }, [
  16841. vue.createElementVNode("button", {
  16842. type: "button",
  16843. class: vue.normalizeClass([vue.unref(ns).be("panel", "btn"), "cancel"]),
  16844. onClick: handleCancel
  16845. }, vue.toDisplayString(vue.unref(t)("el.datepicker.cancel")), 3),
  16846. vue.createElementVNode("button", {
  16847. type: "button",
  16848. class: vue.normalizeClass([vue.unref(ns).be("panel", "btn"), "confirm"]),
  16849. onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm())
  16850. }, vue.toDisplayString(vue.unref(t)("el.datepicker.confirm")), 3)
  16851. ], 2)
  16852. ], 2)) : vue.createCommentVNode("v-if", true)
  16853. ]),
  16854. _: 1
  16855. }, 8, ["name"]);
  16856. };
  16857. }
  16858. });
  16859. var TimePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1U, [["__file", "panel-time-pick.vue"]]);
  16860. const panelTimeRangeProps = buildProps({
  16861. ...timePanelSharedProps,
  16862. parsedValue: {
  16863. type: definePropType(Array)
  16864. }
  16865. });
  16866. const _hoisted_1$X = ["disabled"];
  16867. const _sfc_main$1T = /* @__PURE__ */ vue.defineComponent({
  16868. __name: "panel-time-range",
  16869. props: panelTimeRangeProps,
  16870. emits: ["pick", "select-range", "set-picker-option"],
  16871. setup(__props, { emit }) {
  16872. const props = __props;
  16873. const makeSelectRange = (start, end) => {
  16874. const result = [];
  16875. for (let i = start; i <= end; i++) {
  16876. result.push(i);
  16877. }
  16878. return result;
  16879. };
  16880. const { t, lang } = useLocale();
  16881. const nsTime = useNamespace("time");
  16882. const nsPicker = useNamespace("picker");
  16883. const pickerBase = vue.inject("EP_PICKER_BASE");
  16884. const {
  16885. arrowControl,
  16886. disabledHours,
  16887. disabledMinutes,
  16888. disabledSeconds,
  16889. defaultValue
  16890. } = pickerBase.props;
  16891. const startTime = vue.computed(() => props.parsedValue[0]);
  16892. const endTime = vue.computed(() => props.parsedValue[1]);
  16893. const oldValue = useOldValue(props);
  16894. const handleCancel = () => {
  16895. emit("pick", oldValue.value, false);
  16896. };
  16897. const showSeconds = vue.computed(() => {
  16898. return props.format.includes("ss");
  16899. });
  16900. const amPmMode = vue.computed(() => {
  16901. if (props.format.includes("A"))
  16902. return "A";
  16903. if (props.format.includes("a"))
  16904. return "a";
  16905. return "";
  16906. });
  16907. const handleConfirm = (visible = false) => {
  16908. emit("pick", [startTime.value, endTime.value], visible);
  16909. };
  16910. const handleMinChange = (date) => {
  16911. handleChange(date.millisecond(0), endTime.value);
  16912. };
  16913. const handleMaxChange = (date) => {
  16914. handleChange(startTime.value, date.millisecond(0));
  16915. };
  16916. const isValidValue = (_date) => {
  16917. const parsedDate = _date.map((_) => dayjs(_).locale(lang.value));
  16918. const result = getRangeAvailableTime(parsedDate);
  16919. return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]);
  16920. };
  16921. const handleChange = (start, end) => {
  16922. emit("pick", [start, end], true);
  16923. };
  16924. const btnConfirmDisabled = vue.computed(() => {
  16925. return startTime.value > endTime.value;
  16926. });
  16927. const selectionRange = vue.ref([0, 2]);
  16928. const setMinSelectionRange = (start, end) => {
  16929. emit("select-range", start, end, "min");
  16930. selectionRange.value = [start, end];
  16931. };
  16932. const offset = vue.computed(() => showSeconds.value ? 11 : 8);
  16933. const setMaxSelectionRange = (start, end) => {
  16934. emit("select-range", start, end, "max");
  16935. const _offset = vue.unref(offset);
  16936. selectionRange.value = [start + _offset, end + _offset];
  16937. };
  16938. const changeSelectionRange = (step) => {
  16939. const list = showSeconds.value ? [0, 3, 6, 11, 14, 17] : [0, 3, 8, 11];
  16940. const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
  16941. const index = list.indexOf(selectionRange.value[0]);
  16942. const next = (index + step + list.length) % list.length;
  16943. const half = list.length / 2;
  16944. if (next < half) {
  16945. timePickerOptions["start_emitSelectRange"](mapping[next]);
  16946. } else {
  16947. timePickerOptions["end_emitSelectRange"](mapping[next - half]);
  16948. }
  16949. };
  16950. const handleKeydown = (event) => {
  16951. const code = event.code;
  16952. const { left, right, up, down } = EVENT_CODE;
  16953. if ([left, right].includes(code)) {
  16954. const step = code === left ? -1 : 1;
  16955. changeSelectionRange(step);
  16956. event.preventDefault();
  16957. return;
  16958. }
  16959. if ([up, down].includes(code)) {
  16960. const step = code === up ? -1 : 1;
  16961. const role = selectionRange.value[0] < offset.value ? "start" : "end";
  16962. timePickerOptions[`${role}_scrollDown`](step);
  16963. event.preventDefault();
  16964. return;
  16965. }
  16966. };
  16967. const disabledHours_ = (role, compare) => {
  16968. const defaultDisable = disabledHours ? disabledHours(role) : [];
  16969. const isStart = role === "start";
  16970. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  16971. const compareHour = compareDate.hour();
  16972. const nextDisable = isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1);
  16973. return union(defaultDisable, nextDisable);
  16974. };
  16975. const disabledMinutes_ = (hour, role, compare) => {
  16976. const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : [];
  16977. const isStart = role === "start";
  16978. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  16979. const compareHour = compareDate.hour();
  16980. if (hour !== compareHour) {
  16981. return defaultDisable;
  16982. }
  16983. const compareMinute = compareDate.minute();
  16984. const nextDisable = isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1);
  16985. return union(defaultDisable, nextDisable);
  16986. };
  16987. const disabledSeconds_ = (hour, minute, role, compare) => {
  16988. const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : [];
  16989. const isStart = role === "start";
  16990. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  16991. const compareHour = compareDate.hour();
  16992. const compareMinute = compareDate.minute();
  16993. if (hour !== compareHour || minute !== compareMinute) {
  16994. return defaultDisable;
  16995. }
  16996. const compareSecond = compareDate.second();
  16997. const nextDisable = isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1);
  16998. return union(defaultDisable, nextDisable);
  16999. };
  17000. const getRangeAvailableTime = ([start, end]) => {
  17001. return [
  17002. getAvailableTime(start, "start", true, end),
  17003. getAvailableTime(end, "end", false, start)
  17004. ];
  17005. };
  17006. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours_, disabledMinutes_, disabledSeconds_);
  17007. const {
  17008. timePickerOptions,
  17009. getAvailableTime,
  17010. onSetOption
  17011. } = useTimePanel({
  17012. getAvailableHours,
  17013. getAvailableMinutes,
  17014. getAvailableSeconds
  17015. });
  17016. const parseUserInput = (days) => {
  17017. if (!days)
  17018. return null;
  17019. if (isArray(days)) {
  17020. return days.map((d) => dayjs(d, props.format).locale(lang.value));
  17021. }
  17022. return dayjs(days, props.format).locale(lang.value);
  17023. };
  17024. const formatToString = (days) => {
  17025. if (!days)
  17026. return null;
  17027. if (isArray(days)) {
  17028. return days.map((d) => d.format(props.format));
  17029. }
  17030. return days.format(props.format);
  17031. };
  17032. const getDefaultValue = () => {
  17033. if (isArray(defaultValue)) {
  17034. return defaultValue.map((d) => dayjs(d).locale(lang.value));
  17035. }
  17036. const defaultDay = dayjs(defaultValue).locale(lang.value);
  17037. return [defaultDay, defaultDay.add(60, "m")];
  17038. };
  17039. emit("set-picker-option", ["formatToString", formatToString]);
  17040. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  17041. emit("set-picker-option", ["isValidValue", isValidValue]);
  17042. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  17043. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  17044. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  17045. return (_ctx, _cache) => {
  17046. return _ctx.actualVisible ? (vue.openBlock(), vue.createElementBlock("div", {
  17047. key: 0,
  17048. class: vue.normalizeClass([vue.unref(nsTime).b("range-picker"), vue.unref(nsPicker).b("panel")])
  17049. }, [
  17050. vue.createElementVNode("div", {
  17051. class: vue.normalizeClass(vue.unref(nsTime).be("range-picker", "content"))
  17052. }, [
  17053. vue.createElementVNode("div", {
  17054. class: vue.normalizeClass(vue.unref(nsTime).be("range-picker", "cell"))
  17055. }, [
  17056. vue.createElementVNode("div", {
  17057. class: vue.normalizeClass(vue.unref(nsTime).be("range-picker", "header"))
  17058. }, vue.toDisplayString(vue.unref(t)("el.datepicker.startTime")), 3),
  17059. vue.createElementVNode("div", {
  17060. class: vue.normalizeClass([
  17061. vue.unref(nsTime).be("range-picker", "body"),
  17062. vue.unref(nsTime).be("panel", "content"),
  17063. vue.unref(nsTime).is("arrow", vue.unref(arrowControl)),
  17064. { "has-seconds": vue.unref(showSeconds) }
  17065. ])
  17066. }, [
  17067. vue.createVNode(TimeSpinner, {
  17068. ref: "minSpinner",
  17069. role: "start",
  17070. "show-seconds": vue.unref(showSeconds),
  17071. "am-pm-mode": vue.unref(amPmMode),
  17072. "arrow-control": vue.unref(arrowControl),
  17073. "spinner-date": vue.unref(startTime),
  17074. "disabled-hours": disabledHours_,
  17075. "disabled-minutes": disabledMinutes_,
  17076. "disabled-seconds": disabledSeconds_,
  17077. onChange: handleMinChange,
  17078. onSetOption: vue.unref(onSetOption),
  17079. onSelectRange: setMinSelectionRange
  17080. }, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
  17081. ], 2)
  17082. ], 2),
  17083. vue.createElementVNode("div", {
  17084. class: vue.normalizeClass(vue.unref(nsTime).be("range-picker", "cell"))
  17085. }, [
  17086. vue.createElementVNode("div", {
  17087. class: vue.normalizeClass(vue.unref(nsTime).be("range-picker", "header"))
  17088. }, vue.toDisplayString(vue.unref(t)("el.datepicker.endTime")), 3),
  17089. vue.createElementVNode("div", {
  17090. class: vue.normalizeClass([
  17091. vue.unref(nsTime).be("range-picker", "body"),
  17092. vue.unref(nsTime).be("panel", "content"),
  17093. vue.unref(nsTime).is("arrow", vue.unref(arrowControl)),
  17094. { "has-seconds": vue.unref(showSeconds) }
  17095. ])
  17096. }, [
  17097. vue.createVNode(TimeSpinner, {
  17098. ref: "maxSpinner",
  17099. role: "end",
  17100. "show-seconds": vue.unref(showSeconds),
  17101. "am-pm-mode": vue.unref(amPmMode),
  17102. "arrow-control": vue.unref(arrowControl),
  17103. "spinner-date": vue.unref(endTime),
  17104. "disabled-hours": disabledHours_,
  17105. "disabled-minutes": disabledMinutes_,
  17106. "disabled-seconds": disabledSeconds_,
  17107. onChange: handleMaxChange,
  17108. onSetOption: vue.unref(onSetOption),
  17109. onSelectRange: setMaxSelectionRange
  17110. }, null, 8, ["show-seconds", "am-pm-mode", "arrow-control", "spinner-date", "onSetOption"])
  17111. ], 2)
  17112. ], 2)
  17113. ], 2),
  17114. vue.createElementVNode("div", {
  17115. class: vue.normalizeClass(vue.unref(nsTime).be("panel", "footer"))
  17116. }, [
  17117. vue.createElementVNode("button", {
  17118. type: "button",
  17119. class: vue.normalizeClass([vue.unref(nsTime).be("panel", "btn"), "cancel"]),
  17120. onClick: _cache[0] || (_cache[0] = ($event) => handleCancel())
  17121. }, vue.toDisplayString(vue.unref(t)("el.datepicker.cancel")), 3),
  17122. vue.createElementVNode("button", {
  17123. type: "button",
  17124. class: vue.normalizeClass([vue.unref(nsTime).be("panel", "btn"), "confirm"]),
  17125. disabled: vue.unref(btnConfirmDisabled),
  17126. onClick: _cache[1] || (_cache[1] = ($event) => handleConfirm())
  17127. }, vue.toDisplayString(vue.unref(t)("el.datepicker.confirm")), 11, _hoisted_1$X)
  17128. ], 2)
  17129. ], 2)) : vue.createCommentVNode("v-if", true);
  17130. };
  17131. }
  17132. });
  17133. var TimeRangePanel = /* @__PURE__ */ _export_sfc(_sfc_main$1T, [["__file", "panel-time-range.vue"]]);
  17134. dayjs.extend(customParseFormat);
  17135. var TimePicker = vue.defineComponent({
  17136. name: "ElTimePicker",
  17137. install: null,
  17138. props: {
  17139. ...timePickerDefaultProps,
  17140. isRange: {
  17141. type: Boolean,
  17142. default: false
  17143. }
  17144. },
  17145. emits: ["update:modelValue"],
  17146. setup(props, ctx) {
  17147. const commonPicker = vue.ref();
  17148. const [type, Panel] = props.isRange ? ["timerange", TimeRangePanel] : ["time", TimePickPanel];
  17149. const modelUpdater = (value) => ctx.emit("update:modelValue", value);
  17150. vue.provide("ElPopperOptions", props.popperOptions);
  17151. ctx.expose({
  17152. focus: (e) => {
  17153. var _a;
  17154. (_a = commonPicker.value) == null ? void 0 : _a.handleFocusInput(e);
  17155. },
  17156. blur: (e) => {
  17157. var _a;
  17158. (_a = commonPicker.value) == null ? void 0 : _a.handleBlurInput(e);
  17159. },
  17160. handleOpen: () => {
  17161. var _a;
  17162. (_a = commonPicker.value) == null ? void 0 : _a.handleOpen();
  17163. },
  17164. handleClose: () => {
  17165. var _a;
  17166. (_a = commonPicker.value) == null ? void 0 : _a.handleClose();
  17167. }
  17168. });
  17169. return () => {
  17170. var _a;
  17171. const format = (_a = props.format) != null ? _a : DEFAULT_FORMATS_TIME;
  17172. return vue.createVNode(CommonPicker, vue.mergeProps(props, {
  17173. "ref": commonPicker,
  17174. "type": type,
  17175. "format": format,
  17176. "onUpdate:modelValue": modelUpdater
  17177. }), {
  17178. default: (props2) => vue.createVNode(Panel, props2, null)
  17179. });
  17180. };
  17181. }
  17182. });
  17183. const _TimePicker = TimePicker;
  17184. _TimePicker.install = (app) => {
  17185. app.component(_TimePicker.name, _TimePicker);
  17186. };
  17187. const ElTimePicker = _TimePicker;
  17188. const getPrevMonthLastDays = (date, count) => {
  17189. const lastDay = date.subtract(1, "month").endOf("month").date();
  17190. return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
  17191. };
  17192. const getMonthDays = (date) => {
  17193. const days = date.daysInMonth();
  17194. return rangeArr(days).map((_, index) => index + 1);
  17195. };
  17196. const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
  17197. const start = index * 7;
  17198. return days.slice(start, start + 7);
  17199. });
  17200. const dateTableProps = buildProps({
  17201. selectedDay: {
  17202. type: definePropType(Object)
  17203. },
  17204. range: {
  17205. type: definePropType(Array)
  17206. },
  17207. date: {
  17208. type: definePropType(Object),
  17209. required: true
  17210. },
  17211. hideHeader: {
  17212. type: Boolean
  17213. }
  17214. });
  17215. const dateTableEmits = {
  17216. pick: (value) => isObject$1(value)
  17217. };
  17218. var localeData$1 = {exports: {}};
  17219. (function(module, exports) {
  17220. !function(n, e) {
  17221. module.exports = e() ;
  17222. }(commonjsGlobal, function() {
  17223. return function(n, e, t) {
  17224. var r = e.prototype, o = function(n2) {
  17225. return n2 && (n2.indexOf ? n2 : n2.s);
  17226. }, u = function(n2, e2, t2, r2, u2) {
  17227. var i2 = n2.name ? n2 : n2.$locale(), a2 = o(i2[e2]), s2 = o(i2[t2]), f = a2 || s2.map(function(n3) {
  17228. return n3.slice(0, r2);
  17229. });
  17230. if (!u2)
  17231. return f;
  17232. var d = i2.weekStart;
  17233. return f.map(function(n3, e3) {
  17234. return f[(e3 + (d || 0)) % 7];
  17235. });
  17236. }, i = function() {
  17237. return t.Ls[t.locale()];
  17238. }, a = function(n2, e2) {
  17239. return n2.formats[e2] || function(n3) {
  17240. return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n4, e3, t2) {
  17241. return e3 || t2.slice(1);
  17242. });
  17243. }(n2.formats[e2.toUpperCase()]);
  17244. }, s = function() {
  17245. var n2 = this;
  17246. return { months: function(e2) {
  17247. return e2 ? e2.format("MMMM") : u(n2, "months");
  17248. }, monthsShort: function(e2) {
  17249. return e2 ? e2.format("MMM") : u(n2, "monthsShort", "months", 3);
  17250. }, firstDayOfWeek: function() {
  17251. return n2.$locale().weekStart || 0;
  17252. }, weekdays: function(e2) {
  17253. return e2 ? e2.format("dddd") : u(n2, "weekdays");
  17254. }, weekdaysMin: function(e2) {
  17255. return e2 ? e2.format("dd") : u(n2, "weekdaysMin", "weekdays", 2);
  17256. }, weekdaysShort: function(e2) {
  17257. return e2 ? e2.format("ddd") : u(n2, "weekdaysShort", "weekdays", 3);
  17258. }, longDateFormat: function(e2) {
  17259. return a(n2.$locale(), e2);
  17260. }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
  17261. };
  17262. r.localeData = function() {
  17263. return s.bind(this)();
  17264. }, t.localeData = function() {
  17265. var n2 = i();
  17266. return { firstDayOfWeek: function() {
  17267. return n2.weekStart || 0;
  17268. }, weekdays: function() {
  17269. return t.weekdays();
  17270. }, weekdaysShort: function() {
  17271. return t.weekdaysShort();
  17272. }, weekdaysMin: function() {
  17273. return t.weekdaysMin();
  17274. }, months: function() {
  17275. return t.months();
  17276. }, monthsShort: function() {
  17277. return t.monthsShort();
  17278. }, longDateFormat: function(e2) {
  17279. return a(n2, e2);
  17280. }, meridiem: n2.meridiem, ordinal: n2.ordinal };
  17281. }, t.months = function() {
  17282. return u(i(), "months");
  17283. }, t.monthsShort = function() {
  17284. return u(i(), "monthsShort", "months", 3);
  17285. }, t.weekdays = function(n2) {
  17286. return u(i(), "weekdays", null, null, n2);
  17287. }, t.weekdaysShort = function(n2) {
  17288. return u(i(), "weekdaysShort", "weekdays", 3, n2);
  17289. }, t.weekdaysMin = function(n2) {
  17290. return u(i(), "weekdaysMin", "weekdays", 2, n2);
  17291. };
  17292. };
  17293. });
  17294. })(localeData$1);
  17295. var localeData = localeData$1.exports;
  17296. const useDateTable = (props, emit) => {
  17297. dayjs.extend(localeData);
  17298. const firstDayOfWeek = dayjs.localeData().firstDayOfWeek();
  17299. const { t, lang } = useLocale();
  17300. const now = dayjs().locale(lang.value);
  17301. const isInRange = vue.computed(() => !!props.range && !!props.range.length);
  17302. const rows = vue.computed(() => {
  17303. let days = [];
  17304. if (isInRange.value) {
  17305. const [start, end] = props.range;
  17306. const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
  17307. text: start.date() + index,
  17308. type: "current"
  17309. }));
  17310. let remaining = currentMonthRange.length % 7;
  17311. remaining = remaining === 0 ? 0 : 7 - remaining;
  17312. const nextMonthRange = rangeArr(remaining).map((_, index) => ({
  17313. text: index + 1,
  17314. type: "next"
  17315. }));
  17316. days = currentMonthRange.concat(nextMonthRange);
  17317. } else {
  17318. const firstDay = props.date.startOf("month").day();
  17319. const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
  17320. text: day,
  17321. type: "prev"
  17322. }));
  17323. const currentMonthDays = getMonthDays(props.date).map((day) => ({
  17324. text: day,
  17325. type: "current"
  17326. }));
  17327. days = [...prevMonthDays, ...currentMonthDays];
  17328. const remaining = 7 - (days.length % 7 || 7);
  17329. const nextMonthDays = rangeArr(remaining).map((_, index) => ({
  17330. text: index + 1,
  17331. type: "next"
  17332. }));
  17333. days = days.concat(nextMonthDays);
  17334. }
  17335. return toNestedArr(days);
  17336. });
  17337. const weekDays = vue.computed(() => {
  17338. const start = firstDayOfWeek;
  17339. if (start === 0) {
  17340. return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
  17341. } else {
  17342. return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
  17343. }
  17344. });
  17345. const getFormattedDate = (day, type) => {
  17346. switch (type) {
  17347. case "prev":
  17348. return props.date.startOf("month").subtract(1, "month").date(day);
  17349. case "next":
  17350. return props.date.startOf("month").add(1, "month").date(day);
  17351. case "current":
  17352. return props.date.date(day);
  17353. }
  17354. };
  17355. const handlePickDay = ({ text, type }) => {
  17356. const date = getFormattedDate(text, type);
  17357. emit("pick", date);
  17358. };
  17359. const getSlotData = ({ text, type }) => {
  17360. const day = getFormattedDate(text, type);
  17361. return {
  17362. isSelected: day.isSame(props.selectedDay),
  17363. type: `${type}-month`,
  17364. day: day.format("YYYY-MM-DD"),
  17365. date: day.toDate()
  17366. };
  17367. };
  17368. return {
  17369. now,
  17370. isInRange,
  17371. rows,
  17372. weekDays,
  17373. getFormattedDate,
  17374. handlePickDay,
  17375. getSlotData
  17376. };
  17377. };
  17378. const _hoisted_1$W = { key: 0 };
  17379. const _hoisted_2$B = ["onClick"];
  17380. const __default__$1d = vue.defineComponent({
  17381. name: "DateTable"
  17382. });
  17383. const _sfc_main$1S = /* @__PURE__ */ vue.defineComponent({
  17384. ...__default__$1d,
  17385. props: dateTableProps,
  17386. emits: dateTableEmits,
  17387. setup(__props, { expose, emit }) {
  17388. const props = __props;
  17389. const {
  17390. isInRange,
  17391. now,
  17392. rows,
  17393. weekDays,
  17394. getFormattedDate,
  17395. handlePickDay,
  17396. getSlotData
  17397. } = useDateTable(props, emit);
  17398. const nsTable = useNamespace("calendar-table");
  17399. const nsDay = useNamespace("calendar-day");
  17400. const getCellClass = ({ text, type }) => {
  17401. const classes = [type];
  17402. if (type === "current") {
  17403. const date = getFormattedDate(text, type);
  17404. if (date.isSame(props.selectedDay, "day")) {
  17405. classes.push(nsDay.is("selected"));
  17406. }
  17407. if (date.isSame(now, "day")) {
  17408. classes.push(nsDay.is("today"));
  17409. }
  17410. }
  17411. return classes;
  17412. };
  17413. expose({
  17414. getFormattedDate
  17415. });
  17416. return (_ctx, _cache) => {
  17417. return vue.openBlock(), vue.createElementBlock("table", {
  17418. class: vue.normalizeClass([vue.unref(nsTable).b(), vue.unref(nsTable).is("range", vue.unref(isInRange))]),
  17419. cellspacing: "0",
  17420. cellpadding: "0"
  17421. }, [
  17422. !_ctx.hideHeader ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_1$W, [
  17423. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(weekDays), (day) => {
  17424. return vue.openBlock(), vue.createElementBlock("th", { key: day }, vue.toDisplayString(day), 1);
  17425. }), 128))
  17426. ])) : vue.createCommentVNode("v-if", true),
  17427. vue.createElementVNode("tbody", null, [
  17428. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rows), (row, index) => {
  17429. return vue.openBlock(), vue.createElementBlock("tr", {
  17430. key: index,
  17431. class: vue.normalizeClass({
  17432. [vue.unref(nsTable).e("row")]: true,
  17433. [vue.unref(nsTable).em("row", "hide-border")]: index === 0 && _ctx.hideHeader
  17434. })
  17435. }, [
  17436. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, key) => {
  17437. return vue.openBlock(), vue.createElementBlock("td", {
  17438. key,
  17439. class: vue.normalizeClass(getCellClass(cell)),
  17440. onClick: ($event) => vue.unref(handlePickDay)(cell)
  17441. }, [
  17442. vue.createElementVNode("div", {
  17443. class: vue.normalizeClass(vue.unref(nsDay).b())
  17444. }, [
  17445. vue.renderSlot(_ctx.$slots, "date-cell", {
  17446. data: vue.unref(getSlotData)(cell)
  17447. }, () => [
  17448. vue.createElementVNode("span", null, vue.toDisplayString(cell.text), 1)
  17449. ])
  17450. ], 2)
  17451. ], 10, _hoisted_2$B);
  17452. }), 128))
  17453. ], 2);
  17454. }), 128))
  17455. ])
  17456. ], 2);
  17457. };
  17458. }
  17459. });
  17460. var DateTable$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1S, [["__file", "date-table.vue"]]);
  17461. const adjacentMonth = (start, end) => {
  17462. const firstMonthLastDay = start.endOf("month");
  17463. const lastMonthFirstDay = end.startOf("month");
  17464. const isSameWeek = firstMonthLastDay.isSame(lastMonthFirstDay, "week");
  17465. const lastMonthStartDay = isSameWeek ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  17466. return [
  17467. [start, firstMonthLastDay],
  17468. [lastMonthStartDay.startOf("week"), end]
  17469. ];
  17470. };
  17471. const threeConsecutiveMonth = (start, end) => {
  17472. const firstMonthLastDay = start.endOf("month");
  17473. const secondMonthFirstDay = start.add(1, "month").startOf("month");
  17474. const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
  17475. const secondMonthLastDay = secondMonthStartDay.endOf("month");
  17476. const lastMonthFirstDay = end.startOf("month");
  17477. const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  17478. return [
  17479. [start, firstMonthLastDay],
  17480. [secondMonthStartDay.startOf("week"), secondMonthLastDay],
  17481. [lastMonthStartDay.startOf("week"), end]
  17482. ];
  17483. };
  17484. const useCalendar = (props, emit, componentName) => {
  17485. const slots = vue.useSlots();
  17486. const { lang } = useLocale();
  17487. const selectedDay = vue.ref();
  17488. const now = dayjs().locale(lang.value);
  17489. const realSelectedDay = vue.computed({
  17490. get() {
  17491. if (!props.modelValue)
  17492. return selectedDay.value;
  17493. return date.value;
  17494. },
  17495. set(val) {
  17496. if (!val)
  17497. return;
  17498. selectedDay.value = val;
  17499. const result = val.toDate();
  17500. emit(INPUT_EVENT, result);
  17501. emit(UPDATE_MODEL_EVENT, result);
  17502. }
  17503. });
  17504. const validatedRange = vue.computed(() => {
  17505. if (!props.range)
  17506. return [];
  17507. const rangeArrDayjs = props.range.map((_) => dayjs(_).locale(lang.value));
  17508. const [startDayjs, endDayjs] = rangeArrDayjs;
  17509. if (startDayjs.isAfter(endDayjs)) {
  17510. return [];
  17511. }
  17512. if (startDayjs.isSame(endDayjs, "month")) {
  17513. return calculateValidatedDateRange(startDayjs, endDayjs);
  17514. } else {
  17515. if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
  17516. return [];
  17517. }
  17518. return calculateValidatedDateRange(startDayjs, endDayjs);
  17519. }
  17520. });
  17521. const date = vue.computed(() => {
  17522. if (!props.modelValue) {
  17523. return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
  17524. } else {
  17525. return dayjs(props.modelValue).locale(lang.value);
  17526. }
  17527. });
  17528. const prevMonthDayjs = vue.computed(() => date.value.subtract(1, "month").date(1));
  17529. const nextMonthDayjs = vue.computed(() => date.value.add(1, "month").date(1));
  17530. const prevYearDayjs = vue.computed(() => date.value.subtract(1, "year").date(1));
  17531. const nextYearDayjs = vue.computed(() => date.value.add(1, "year").date(1));
  17532. const calculateValidatedDateRange = (startDayjs, endDayjs) => {
  17533. const firstDay = startDayjs.startOf("week");
  17534. const lastDay = endDayjs.endOf("week");
  17535. const firstMonth = firstDay.get("month");
  17536. const lastMonth = lastDay.get("month");
  17537. if (firstMonth === lastMonth) {
  17538. return [[firstDay, lastDay]];
  17539. } else if ((firstMonth + 1) % 12 === lastMonth) {
  17540. return adjacentMonth(firstDay, lastDay);
  17541. } else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) {
  17542. return threeConsecutiveMonth(firstDay, lastDay);
  17543. } else {
  17544. return [];
  17545. }
  17546. };
  17547. const pickDay = (day) => {
  17548. realSelectedDay.value = day;
  17549. };
  17550. const selectDate = (type) => {
  17551. const dateMap = {
  17552. "prev-month": prevMonthDayjs.value,
  17553. "next-month": nextMonthDayjs.value,
  17554. "prev-year": prevYearDayjs.value,
  17555. "next-year": nextYearDayjs.value,
  17556. today: now
  17557. };
  17558. const day = dateMap[type];
  17559. if (!day.isSame(date.value, "day")) {
  17560. pickDay(day);
  17561. }
  17562. };
  17563. useDeprecated({
  17564. from: '"dateCell"',
  17565. replacement: '"date-cell"',
  17566. scope: "ElCalendar",
  17567. version: "2.3.0",
  17568. ref: "https://element-plus.org/en-US/component/calendar.html#slots",
  17569. type: "Slot"
  17570. }, vue.computed(() => !!slots.dateCell));
  17571. return {
  17572. calculateValidatedDateRange,
  17573. date,
  17574. realSelectedDay,
  17575. pickDay,
  17576. selectDate,
  17577. validatedRange
  17578. };
  17579. };
  17580. const isValidRange$1 = (range) => isArray(range) && range.length === 2 && range.every((item) => isDate(item));
  17581. const calendarProps = buildProps({
  17582. modelValue: {
  17583. type: Date
  17584. },
  17585. range: {
  17586. type: definePropType(Array),
  17587. validator: isValidRange$1
  17588. }
  17589. });
  17590. const calendarEmits = {
  17591. [UPDATE_MODEL_EVENT]: (value) => isDate(value),
  17592. [INPUT_EVENT]: (value) => isDate(value)
  17593. };
  17594. const COMPONENT_NAME$h = "ElCalendar";
  17595. const __default__$1c = vue.defineComponent({
  17596. name: COMPONENT_NAME$h
  17597. });
  17598. const _sfc_main$1R = /* @__PURE__ */ vue.defineComponent({
  17599. ...__default__$1c,
  17600. props: calendarProps,
  17601. emits: calendarEmits,
  17602. setup(__props, { expose, emit }) {
  17603. const props = __props;
  17604. const ns = useNamespace("calendar");
  17605. const {
  17606. calculateValidatedDateRange,
  17607. date,
  17608. pickDay,
  17609. realSelectedDay,
  17610. selectDate,
  17611. validatedRange
  17612. } = useCalendar(props, emit);
  17613. const { t } = useLocale();
  17614. const i18nDate = vue.computed(() => {
  17615. const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
  17616. return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
  17617. });
  17618. expose({
  17619. selectedDay: realSelectedDay,
  17620. pickDay,
  17621. selectDate,
  17622. calculateValidatedDateRange
  17623. });
  17624. return (_ctx, _cache) => {
  17625. return vue.openBlock(), vue.createElementBlock("div", {
  17626. class: vue.normalizeClass(vue.unref(ns).b())
  17627. }, [
  17628. vue.createElementVNode("div", {
  17629. class: vue.normalizeClass(vue.unref(ns).e("header"))
  17630. }, [
  17631. vue.renderSlot(_ctx.$slots, "header", { date: vue.unref(i18nDate) }, () => [
  17632. vue.createElementVNode("div", {
  17633. class: vue.normalizeClass(vue.unref(ns).e("title"))
  17634. }, vue.toDisplayString(vue.unref(i18nDate)), 3),
  17635. vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
  17636. key: 0,
  17637. class: vue.normalizeClass(vue.unref(ns).e("button-group"))
  17638. }, [
  17639. vue.createVNode(vue.unref(ElButtonGroup$1), null, {
  17640. default: vue.withCtx(() => [
  17641. vue.createVNode(vue.unref(ElButton), {
  17642. size: "small",
  17643. onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(selectDate)("prev-month"))
  17644. }, {
  17645. default: vue.withCtx(() => [
  17646. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.prevMonth")), 1)
  17647. ]),
  17648. _: 1
  17649. }),
  17650. vue.createVNode(vue.unref(ElButton), {
  17651. size: "small",
  17652. onClick: _cache[1] || (_cache[1] = ($event) => vue.unref(selectDate)("today"))
  17653. }, {
  17654. default: vue.withCtx(() => [
  17655. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.today")), 1)
  17656. ]),
  17657. _: 1
  17658. }),
  17659. vue.createVNode(vue.unref(ElButton), {
  17660. size: "small",
  17661. onClick: _cache[2] || (_cache[2] = ($event) => vue.unref(selectDate)("next-month"))
  17662. }, {
  17663. default: vue.withCtx(() => [
  17664. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.nextMonth")), 1)
  17665. ]),
  17666. _: 1
  17667. })
  17668. ]),
  17669. _: 1
  17670. })
  17671. ], 2)) : vue.createCommentVNode("v-if", true)
  17672. ])
  17673. ], 2),
  17674. vue.unref(validatedRange).length === 0 ? (vue.openBlock(), vue.createElementBlock("div", {
  17675. key: 0,
  17676. class: vue.normalizeClass(vue.unref(ns).e("body"))
  17677. }, [
  17678. vue.createVNode(DateTable$1, {
  17679. date: vue.unref(date),
  17680. "selected-day": vue.unref(realSelectedDay),
  17681. onPick: vue.unref(pickDay)
  17682. }, vue.createSlots({ _: 2 }, [
  17683. _ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
  17684. name: "date-cell",
  17685. fn: vue.withCtx((data) => [
  17686. _ctx.$slots["date-cell"] ? vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.mergeProps({ key: 0 }, data))) : vue.renderSlot(_ctx.$slots, "dateCell", vue.normalizeProps(vue.mergeProps({ key: 1 }, data)))
  17687. ])
  17688. } : void 0
  17689. ]), 1032, ["date", "selected-day", "onPick"])
  17690. ], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
  17691. key: 1,
  17692. class: vue.normalizeClass(vue.unref(ns).e("body"))
  17693. }, [
  17694. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(validatedRange), (range_, index) => {
  17695. return vue.openBlock(), vue.createBlock(DateTable$1, {
  17696. key: index,
  17697. date: range_[0],
  17698. "selected-day": vue.unref(realSelectedDay),
  17699. range: range_,
  17700. "hide-header": index !== 0,
  17701. onPick: vue.unref(pickDay)
  17702. }, vue.createSlots({ _: 2 }, [
  17703. _ctx.$slots["date-cell"] || _ctx.$slots.dateCell ? {
  17704. name: "date-cell",
  17705. fn: vue.withCtx((data) => [
  17706. _ctx.$slots["date-cell"] ? vue.renderSlot(_ctx.$slots, "date-cell", vue.normalizeProps(vue.mergeProps({ key: 0 }, data))) : vue.renderSlot(_ctx.$slots, "dateCell", vue.normalizeProps(vue.mergeProps({ key: 1 }, data)))
  17707. ])
  17708. } : void 0
  17709. ]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]);
  17710. }), 128))
  17711. ], 2))
  17712. ], 2);
  17713. };
  17714. }
  17715. });
  17716. var Calendar = /* @__PURE__ */ _export_sfc(_sfc_main$1R, [["__file", "calendar.vue"]]);
  17717. const ElCalendar = withInstall(Calendar);
  17718. const cardProps = buildProps({
  17719. header: {
  17720. type: String,
  17721. default: ""
  17722. },
  17723. bodyStyle: {
  17724. type: definePropType([String, Object, Array]),
  17725. default: ""
  17726. },
  17727. shadow: {
  17728. type: String,
  17729. values: ["always", "hover", "never"],
  17730. default: "always"
  17731. }
  17732. });
  17733. const __default__$1b = vue.defineComponent({
  17734. name: "ElCard"
  17735. });
  17736. const _sfc_main$1Q = /* @__PURE__ */ vue.defineComponent({
  17737. ...__default__$1b,
  17738. props: cardProps,
  17739. setup(__props) {
  17740. const ns = useNamespace("card");
  17741. return (_ctx, _cache) => {
  17742. return vue.openBlock(), vue.createElementBlock("div", {
  17743. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is(`${_ctx.shadow}-shadow`)])
  17744. }, [
  17745. _ctx.$slots.header || _ctx.header ? (vue.openBlock(), vue.createElementBlock("div", {
  17746. key: 0,
  17747. class: vue.normalizeClass(vue.unref(ns).e("header"))
  17748. }, [
  17749. vue.renderSlot(_ctx.$slots, "header", {}, () => [
  17750. vue.createTextVNode(vue.toDisplayString(_ctx.header), 1)
  17751. ])
  17752. ], 2)) : vue.createCommentVNode("v-if", true),
  17753. vue.createElementVNode("div", {
  17754. class: vue.normalizeClass(vue.unref(ns).e("body")),
  17755. style: vue.normalizeStyle(_ctx.bodyStyle)
  17756. }, [
  17757. vue.renderSlot(_ctx.$slots, "default")
  17758. ], 6)
  17759. ], 2);
  17760. };
  17761. }
  17762. });
  17763. var Card = /* @__PURE__ */ _export_sfc(_sfc_main$1Q, [["__file", "card.vue"]]);
  17764. const ElCard = withInstall(Card);
  17765. const carouselProps = buildProps({
  17766. initialIndex: {
  17767. type: Number,
  17768. default: 0
  17769. },
  17770. height: {
  17771. type: String,
  17772. default: ""
  17773. },
  17774. trigger: {
  17775. type: String,
  17776. values: ["hover", "click"],
  17777. default: "hover"
  17778. },
  17779. autoplay: {
  17780. type: Boolean,
  17781. default: true
  17782. },
  17783. interval: {
  17784. type: Number,
  17785. default: 3e3
  17786. },
  17787. indicatorPosition: {
  17788. type: String,
  17789. values: ["", "none", "outside"],
  17790. default: ""
  17791. },
  17792. indicator: {
  17793. type: Boolean,
  17794. default: true
  17795. },
  17796. arrow: {
  17797. type: String,
  17798. values: ["always", "hover", "never"],
  17799. default: "hover"
  17800. },
  17801. type: {
  17802. type: String,
  17803. values: ["", "card"],
  17804. default: ""
  17805. },
  17806. loop: {
  17807. type: Boolean,
  17808. default: true
  17809. },
  17810. direction: {
  17811. type: String,
  17812. values: ["horizontal", "vertical"],
  17813. default: "horizontal"
  17814. },
  17815. pauseOnHover: {
  17816. type: Boolean,
  17817. default: true
  17818. }
  17819. });
  17820. const carouselEmits = {
  17821. change: (current, prev) => [current, prev].every(isNumber)
  17822. };
  17823. const THROTTLE_TIME = 300;
  17824. const useCarousel = (props, emit, componentName) => {
  17825. const {
  17826. children: items,
  17827. addChild: addItem,
  17828. removeChild: removeItem
  17829. } = useOrderedChildren(vue.getCurrentInstance(), "ElCarouselItem");
  17830. const activeIndex = vue.ref(-1);
  17831. const timer = vue.ref(null);
  17832. const hover = vue.ref(false);
  17833. const root = vue.ref();
  17834. const arrowDisplay = vue.computed(() => props.arrow !== "never" && !vue.unref(isVertical));
  17835. const hasLabel = vue.computed(() => {
  17836. return items.value.some((item) => item.props.label.toString().length > 0);
  17837. });
  17838. const isCardType = vue.computed(() => props.type === "card");
  17839. const isVertical = vue.computed(() => props.direction === "vertical");
  17840. const throttledArrowClick = throttle((index) => {
  17841. setActiveItem(index);
  17842. }, THROTTLE_TIME, { trailing: true });
  17843. const throttledIndicatorHover = throttle((index) => {
  17844. handleIndicatorHover(index);
  17845. }, THROTTLE_TIME);
  17846. function pauseTimer() {
  17847. if (timer.value) {
  17848. clearInterval(timer.value);
  17849. timer.value = null;
  17850. }
  17851. }
  17852. function startTimer() {
  17853. if (props.interval <= 0 || !props.autoplay || timer.value)
  17854. return;
  17855. timer.value = setInterval(() => playSlides(), props.interval);
  17856. }
  17857. const playSlides = () => {
  17858. if (activeIndex.value < items.value.length - 1) {
  17859. activeIndex.value = activeIndex.value + 1;
  17860. } else if (props.loop) {
  17861. activeIndex.value = 0;
  17862. }
  17863. };
  17864. function setActiveItem(index) {
  17865. if (isString(index)) {
  17866. const filteredItems = items.value.filter((item) => item.props.name === index);
  17867. if (filteredItems.length > 0) {
  17868. index = items.value.indexOf(filteredItems[0]);
  17869. }
  17870. }
  17871. index = Number(index);
  17872. if (Number.isNaN(index) || index !== Math.floor(index)) {
  17873. return;
  17874. }
  17875. const itemCount = items.value.length;
  17876. const oldIndex = activeIndex.value;
  17877. if (index < 0) {
  17878. activeIndex.value = props.loop ? itemCount - 1 : 0;
  17879. } else if (index >= itemCount) {
  17880. activeIndex.value = props.loop ? 0 : itemCount - 1;
  17881. } else {
  17882. activeIndex.value = index;
  17883. }
  17884. if (oldIndex === activeIndex.value) {
  17885. resetItemPosition(oldIndex);
  17886. }
  17887. resetTimer();
  17888. }
  17889. function resetItemPosition(oldIndex) {
  17890. items.value.forEach((item, index) => {
  17891. item.translateItem(index, activeIndex.value, oldIndex);
  17892. });
  17893. }
  17894. function itemInStage(item, index) {
  17895. var _a, _b, _c, _d;
  17896. const _items = vue.unref(items);
  17897. const itemCount = _items.length;
  17898. if (itemCount === 0 || !item.states.inStage)
  17899. return false;
  17900. const nextItemIndex = index + 1;
  17901. const prevItemIndex = index - 1;
  17902. const lastItemIndex = itemCount - 1;
  17903. const isLastItemActive = _items[lastItemIndex].states.active;
  17904. const isFirstItemActive = _items[0].states.active;
  17905. const isNextItemActive = (_b = (_a = _items[nextItemIndex]) == null ? void 0 : _a.states) == null ? void 0 : _b.active;
  17906. const isPrevItemActive = (_d = (_c = _items[prevItemIndex]) == null ? void 0 : _c.states) == null ? void 0 : _d.active;
  17907. if (index === lastItemIndex && isFirstItemActive || isNextItemActive) {
  17908. return "left";
  17909. } else if (index === 0 && isLastItemActive || isPrevItemActive) {
  17910. return "right";
  17911. }
  17912. return false;
  17913. }
  17914. function handleMouseEnter() {
  17915. hover.value = true;
  17916. if (props.pauseOnHover) {
  17917. pauseTimer();
  17918. }
  17919. }
  17920. function handleMouseLeave() {
  17921. hover.value = false;
  17922. startTimer();
  17923. }
  17924. function handleButtonEnter(arrow) {
  17925. if (vue.unref(isVertical))
  17926. return;
  17927. items.value.forEach((item, index) => {
  17928. if (arrow === itemInStage(item, index)) {
  17929. item.states.hover = true;
  17930. }
  17931. });
  17932. }
  17933. function handleButtonLeave() {
  17934. if (vue.unref(isVertical))
  17935. return;
  17936. items.value.forEach((item) => {
  17937. item.states.hover = false;
  17938. });
  17939. }
  17940. function handleIndicatorClick(index) {
  17941. activeIndex.value = index;
  17942. }
  17943. function handleIndicatorHover(index) {
  17944. if (props.trigger === "hover" && index !== activeIndex.value) {
  17945. activeIndex.value = index;
  17946. }
  17947. }
  17948. function prev() {
  17949. setActiveItem(activeIndex.value - 1);
  17950. }
  17951. function next() {
  17952. setActiveItem(activeIndex.value + 1);
  17953. }
  17954. function resetTimer() {
  17955. pauseTimer();
  17956. startTimer();
  17957. }
  17958. vue.watch(() => activeIndex.value, (current, prev2) => {
  17959. resetItemPosition(prev2);
  17960. if (prev2 > -1) {
  17961. emit("change", current, prev2);
  17962. }
  17963. });
  17964. vue.watch(() => props.autoplay, (autoplay) => {
  17965. autoplay ? startTimer() : pauseTimer();
  17966. });
  17967. vue.watch(() => props.loop, () => {
  17968. setActiveItem(activeIndex.value);
  17969. });
  17970. vue.watch(() => props.interval, () => {
  17971. resetTimer();
  17972. });
  17973. vue.watch(() => items.value, () => {
  17974. if (items.value.length > 0)
  17975. setActiveItem(props.initialIndex);
  17976. });
  17977. const resizeObserver = vue.shallowRef();
  17978. vue.onMounted(() => {
  17979. resizeObserver.value = useResizeObserver(root.value, () => {
  17980. resetItemPosition();
  17981. });
  17982. startTimer();
  17983. });
  17984. vue.onBeforeUnmount(() => {
  17985. pauseTimer();
  17986. if (root.value && resizeObserver.value)
  17987. resizeObserver.value.stop();
  17988. });
  17989. vue.provide(carouselContextKey, {
  17990. root,
  17991. isCardType,
  17992. isVertical,
  17993. items,
  17994. loop: props.loop,
  17995. addItem,
  17996. removeItem,
  17997. setActiveItem
  17998. });
  17999. return {
  18000. root,
  18001. activeIndex,
  18002. arrowDisplay,
  18003. hasLabel,
  18004. hover,
  18005. isCardType,
  18006. items,
  18007. handleButtonEnter,
  18008. handleButtonLeave,
  18009. handleIndicatorClick,
  18010. handleMouseEnter,
  18011. handleMouseLeave,
  18012. setActiveItem,
  18013. prev,
  18014. next,
  18015. throttledArrowClick,
  18016. throttledIndicatorHover
  18017. };
  18018. };
  18019. const _hoisted_1$V = ["onMouseenter", "onClick"];
  18020. const _hoisted_2$A = { key: 0 };
  18021. const COMPONENT_NAME$g = "ElCarousel";
  18022. const __default__$1a = vue.defineComponent({
  18023. name: COMPONENT_NAME$g
  18024. });
  18025. const _sfc_main$1P = /* @__PURE__ */ vue.defineComponent({
  18026. ...__default__$1a,
  18027. props: carouselProps,
  18028. emits: carouselEmits,
  18029. setup(__props, { expose, emit }) {
  18030. const props = __props;
  18031. const {
  18032. root,
  18033. activeIndex,
  18034. arrowDisplay,
  18035. hasLabel,
  18036. hover,
  18037. isCardType,
  18038. items,
  18039. handleButtonEnter,
  18040. handleButtonLeave,
  18041. handleIndicatorClick,
  18042. handleMouseEnter,
  18043. handleMouseLeave,
  18044. setActiveItem,
  18045. prev,
  18046. next,
  18047. throttledArrowClick,
  18048. throttledIndicatorHover
  18049. } = useCarousel(props, emit);
  18050. const ns = useNamespace("carousel");
  18051. const carouselClasses = vue.computed(() => {
  18052. const classes = [ns.b(), ns.m(props.direction)];
  18053. if (vue.unref(isCardType)) {
  18054. classes.push(ns.m("card"));
  18055. }
  18056. return classes;
  18057. });
  18058. const indicatorsClasses = vue.computed(() => {
  18059. const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
  18060. if (vue.unref(hasLabel)) {
  18061. classes.push(ns.em("indicators", "labels"));
  18062. }
  18063. if (props.indicatorPosition === "outside" || vue.unref(isCardType)) {
  18064. classes.push(ns.em("indicators", "outside"));
  18065. }
  18066. return classes;
  18067. });
  18068. expose({
  18069. setActiveItem,
  18070. prev,
  18071. next
  18072. });
  18073. return (_ctx, _cache) => {
  18074. return vue.openBlock(), vue.createElementBlock("div", {
  18075. ref_key: "root",
  18076. ref: root,
  18077. class: vue.normalizeClass(vue.unref(carouselClasses)),
  18078. onMouseenter: _cache[6] || (_cache[6] = vue.withModifiers((...args) => vue.unref(handleMouseEnter) && vue.unref(handleMouseEnter)(...args), ["stop"])),
  18079. onMouseleave: _cache[7] || (_cache[7] = vue.withModifiers((...args) => vue.unref(handleMouseLeave) && vue.unref(handleMouseLeave)(...args), ["stop"]))
  18080. }, [
  18081. vue.createElementVNode("div", {
  18082. class: vue.normalizeClass(vue.unref(ns).e("container")),
  18083. style: vue.normalizeStyle({ height: _ctx.height })
  18084. }, [
  18085. vue.unref(arrowDisplay) ? (vue.openBlock(), vue.createBlock(vue.Transition, {
  18086. key: 0,
  18087. name: "carousel-arrow-left",
  18088. persisted: ""
  18089. }, {
  18090. default: vue.withCtx(() => [
  18091. vue.withDirectives(vue.createElementVNode("button", {
  18092. type: "button",
  18093. class: vue.normalizeClass([vue.unref(ns).e("arrow"), vue.unref(ns).em("arrow", "left")]),
  18094. onMouseenter: _cache[0] || (_cache[0] = ($event) => vue.unref(handleButtonEnter)("left")),
  18095. onMouseleave: _cache[1] || (_cache[1] = (...args) => vue.unref(handleButtonLeave) && vue.unref(handleButtonLeave)(...args)),
  18096. onClick: _cache[2] || (_cache[2] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(vue.unref(activeIndex) - 1), ["stop"]))
  18097. }, [
  18098. vue.createVNode(vue.unref(ElIcon), null, {
  18099. default: vue.withCtx(() => [
  18100. vue.createVNode(vue.unref(arrow_left_default))
  18101. ]),
  18102. _: 1
  18103. })
  18104. ], 34), [
  18105. [
  18106. vue.vShow,
  18107. (_ctx.arrow === "always" || vue.unref(hover)) && (props.loop || vue.unref(activeIndex) > 0)
  18108. ]
  18109. ])
  18110. ]),
  18111. _: 1
  18112. })) : vue.createCommentVNode("v-if", true),
  18113. vue.unref(arrowDisplay) ? (vue.openBlock(), vue.createBlock(vue.Transition, {
  18114. key: 1,
  18115. name: "carousel-arrow-right",
  18116. persisted: ""
  18117. }, {
  18118. default: vue.withCtx(() => [
  18119. vue.withDirectives(vue.createElementVNode("button", {
  18120. type: "button",
  18121. class: vue.normalizeClass([vue.unref(ns).e("arrow"), vue.unref(ns).em("arrow", "right")]),
  18122. onMouseenter: _cache[3] || (_cache[3] = ($event) => vue.unref(handleButtonEnter)("right")),
  18123. onMouseleave: _cache[4] || (_cache[4] = (...args) => vue.unref(handleButtonLeave) && vue.unref(handleButtonLeave)(...args)),
  18124. onClick: _cache[5] || (_cache[5] = vue.withModifiers(($event) => vue.unref(throttledArrowClick)(vue.unref(activeIndex) + 1), ["stop"]))
  18125. }, [
  18126. vue.createVNode(vue.unref(ElIcon), null, {
  18127. default: vue.withCtx(() => [
  18128. vue.createVNode(vue.unref(arrow_right_default))
  18129. ]),
  18130. _: 1
  18131. })
  18132. ], 34), [
  18133. [
  18134. vue.vShow,
  18135. (_ctx.arrow === "always" || vue.unref(hover)) && (props.loop || vue.unref(activeIndex) < vue.unref(items).length - 1)
  18136. ]
  18137. ])
  18138. ]),
  18139. _: 1
  18140. })) : vue.createCommentVNode("v-if", true),
  18141. vue.renderSlot(_ctx.$slots, "default")
  18142. ], 6),
  18143. _ctx.indicatorPosition !== "none" ? (vue.openBlock(), vue.createElementBlock("ul", {
  18144. key: 0,
  18145. class: vue.normalizeClass(vue.unref(indicatorsClasses))
  18146. }, [
  18147. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(items), (item, index) => {
  18148. return vue.openBlock(), vue.createElementBlock("li", {
  18149. key: index,
  18150. class: vue.normalizeClass([
  18151. vue.unref(ns).e("indicator"),
  18152. vue.unref(ns).em("indicator", _ctx.direction),
  18153. vue.unref(ns).is("active", index === vue.unref(activeIndex))
  18154. ]),
  18155. onMouseenter: ($event) => vue.unref(throttledIndicatorHover)(index),
  18156. onClick: vue.withModifiers(($event) => vue.unref(handleIndicatorClick)(index), ["stop"])
  18157. }, [
  18158. vue.createElementVNode("button", {
  18159. class: vue.normalizeClass(vue.unref(ns).e("button"))
  18160. }, [
  18161. vue.unref(hasLabel) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$A, vue.toDisplayString(item.props.label), 1)) : vue.createCommentVNode("v-if", true)
  18162. ], 2)
  18163. ], 42, _hoisted_1$V);
  18164. }), 128))
  18165. ], 2)) : vue.createCommentVNode("v-if", true)
  18166. ], 34);
  18167. };
  18168. }
  18169. });
  18170. var Carousel = /* @__PURE__ */ _export_sfc(_sfc_main$1P, [["__file", "carousel.vue"]]);
  18171. const carouselItemProps = buildProps({
  18172. name: { type: String, default: "" },
  18173. label: {
  18174. type: [String, Number],
  18175. default: ""
  18176. }
  18177. });
  18178. const useCarouselItem = (props, componentName) => {
  18179. const carouselContext = vue.inject(carouselContextKey);
  18180. const instance = vue.getCurrentInstance();
  18181. const CARD_SCALE = 0.83;
  18182. const hover = vue.ref(false);
  18183. const translate = vue.ref(0);
  18184. const scale = vue.ref(1);
  18185. const active = vue.ref(false);
  18186. const ready = vue.ref(false);
  18187. const inStage = vue.ref(false);
  18188. const animating = vue.ref(false);
  18189. const { isCardType, isVertical } = carouselContext;
  18190. function processIndex(index, activeIndex, length) {
  18191. const lastItemIndex = length - 1;
  18192. const prevItemIndex = activeIndex - 1;
  18193. const nextItemIndex = activeIndex + 1;
  18194. const halfItemIndex = length / 2;
  18195. if (activeIndex === 0 && index === lastItemIndex) {
  18196. return -1;
  18197. } else if (activeIndex === lastItemIndex && index === 0) {
  18198. return length;
  18199. } else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) {
  18200. return length + 1;
  18201. } else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) {
  18202. return -2;
  18203. }
  18204. return index;
  18205. }
  18206. function calcCardTranslate(index, activeIndex) {
  18207. var _a;
  18208. const parentWidth = ((_a = carouselContext.root.value) == null ? void 0 : _a.offsetWidth) || 0;
  18209. if (inStage.value) {
  18210. return parentWidth * ((2 - CARD_SCALE) * (index - activeIndex) + 1) / 4;
  18211. } else if (index < activeIndex) {
  18212. return -(1 + CARD_SCALE) * parentWidth / 4;
  18213. } else {
  18214. return (3 + CARD_SCALE) * parentWidth / 4;
  18215. }
  18216. }
  18217. function calcTranslate(index, activeIndex, isVertical2) {
  18218. const rootEl = carouselContext.root.value;
  18219. if (!rootEl)
  18220. return 0;
  18221. const distance = (isVertical2 ? rootEl.offsetHeight : rootEl.offsetWidth) || 0;
  18222. return distance * (index - activeIndex);
  18223. }
  18224. const translateItem = (index, activeIndex, oldIndex) => {
  18225. var _a;
  18226. const _isCardType = vue.unref(isCardType);
  18227. const carouselItemLength = (_a = carouselContext.items.value.length) != null ? _a : Number.NaN;
  18228. const isActive = index === activeIndex;
  18229. if (!_isCardType && !isUndefined(oldIndex)) {
  18230. animating.value = isActive || index === oldIndex;
  18231. }
  18232. if (!isActive && carouselItemLength > 2 && carouselContext.loop) {
  18233. index = processIndex(index, activeIndex, carouselItemLength);
  18234. }
  18235. const _isVertical = vue.unref(isVertical);
  18236. active.value = isActive;
  18237. if (_isCardType) {
  18238. inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1;
  18239. translate.value = calcCardTranslate(index, activeIndex);
  18240. scale.value = vue.unref(active) ? 1 : CARD_SCALE;
  18241. } else {
  18242. translate.value = calcTranslate(index, activeIndex, _isVertical);
  18243. }
  18244. ready.value = true;
  18245. };
  18246. function handleItemClick() {
  18247. if (carouselContext && vue.unref(isCardType)) {
  18248. const index = carouselContext.items.value.findIndex(({ uid }) => uid === instance.uid);
  18249. carouselContext.setActiveItem(index);
  18250. }
  18251. }
  18252. vue.onMounted(() => {
  18253. carouselContext.addItem({
  18254. props,
  18255. states: vue.reactive({
  18256. hover,
  18257. translate,
  18258. scale,
  18259. active,
  18260. ready,
  18261. inStage,
  18262. animating
  18263. }),
  18264. uid: instance.uid,
  18265. translateItem
  18266. });
  18267. });
  18268. vue.onUnmounted(() => {
  18269. carouselContext.removeItem(instance.uid);
  18270. });
  18271. return {
  18272. active,
  18273. animating,
  18274. hover,
  18275. inStage,
  18276. isVertical,
  18277. translate,
  18278. isCardType,
  18279. scale,
  18280. ready,
  18281. handleItemClick
  18282. };
  18283. };
  18284. const __default__$19 = vue.defineComponent({
  18285. name: "ElCarouselItem"
  18286. });
  18287. const _sfc_main$1O = /* @__PURE__ */ vue.defineComponent({
  18288. ...__default__$19,
  18289. props: carouselItemProps,
  18290. setup(__props) {
  18291. const props = __props;
  18292. const ns = useNamespace("carousel");
  18293. const {
  18294. active,
  18295. animating,
  18296. hover,
  18297. inStage,
  18298. isVertical,
  18299. translate,
  18300. isCardType,
  18301. scale,
  18302. ready,
  18303. handleItemClick
  18304. } = useCarouselItem(props);
  18305. const itemStyle = vue.computed(() => {
  18306. const translateType = `translate${vue.unref(isVertical) ? "Y" : "X"}`;
  18307. const _translate = `${translateType}(${vue.unref(translate)}px)`;
  18308. const _scale = `scale(${vue.unref(scale)})`;
  18309. const transform = [_translate, _scale].join(" ");
  18310. return {
  18311. transform
  18312. };
  18313. });
  18314. return (_ctx, _cache) => {
  18315. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  18316. class: vue.normalizeClass([
  18317. vue.unref(ns).e("item"),
  18318. vue.unref(ns).is("active", vue.unref(active)),
  18319. vue.unref(ns).is("in-stage", vue.unref(inStage)),
  18320. vue.unref(ns).is("hover", vue.unref(hover)),
  18321. vue.unref(ns).is("animating", vue.unref(animating)),
  18322. { [vue.unref(ns).em("item", "card")]: vue.unref(isCardType) }
  18323. ]),
  18324. style: vue.normalizeStyle(vue.unref(itemStyle)),
  18325. onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(handleItemClick) && vue.unref(handleItemClick)(...args))
  18326. }, [
  18327. vue.unref(isCardType) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  18328. key: 0,
  18329. class: vue.normalizeClass(vue.unref(ns).e("mask"))
  18330. }, null, 2)), [
  18331. [vue.vShow, !vue.unref(active)]
  18332. ]) : vue.createCommentVNode("v-if", true),
  18333. vue.renderSlot(_ctx.$slots, "default")
  18334. ], 6)), [
  18335. [vue.vShow, vue.unref(ready)]
  18336. ]);
  18337. };
  18338. }
  18339. });
  18340. var CarouselItem = /* @__PURE__ */ _export_sfc(_sfc_main$1O, [["__file", "carousel-item.vue"]]);
  18341. const ElCarousel = withInstall(Carousel, {
  18342. CarouselItem
  18343. });
  18344. const ElCarouselItem = withNoopInstall(CarouselItem);
  18345. const checkboxProps = {
  18346. modelValue: {
  18347. type: [Number, String, Boolean],
  18348. default: void 0
  18349. },
  18350. label: {
  18351. type: [String, Boolean, Number, Object]
  18352. },
  18353. indeterminate: Boolean,
  18354. disabled: Boolean,
  18355. checked: Boolean,
  18356. name: {
  18357. type: String,
  18358. default: void 0
  18359. },
  18360. trueLabel: {
  18361. type: [String, Number],
  18362. default: void 0
  18363. },
  18364. falseLabel: {
  18365. type: [String, Number],
  18366. default: void 0
  18367. },
  18368. id: {
  18369. type: String,
  18370. default: void 0
  18371. },
  18372. controls: {
  18373. type: String,
  18374. default: void 0
  18375. },
  18376. border: Boolean,
  18377. size: useSizeProp,
  18378. tabindex: [String, Number],
  18379. validateEvent: {
  18380. type: Boolean,
  18381. default: true
  18382. }
  18383. };
  18384. const checkboxEmits = {
  18385. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  18386. change: (val) => isString(val) || isNumber(val) || isBoolean(val)
  18387. };
  18388. const useCheckboxDisabled = ({
  18389. model,
  18390. isChecked
  18391. }) => {
  18392. const checkboxGroup = vue.inject(checkboxGroupContextKey, void 0);
  18393. const isLimitDisabled = vue.computed(() => {
  18394. var _a, _b;
  18395. const max = (_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value;
  18396. const min = (_b = checkboxGroup == null ? void 0 : checkboxGroup.min) == null ? void 0 : _b.value;
  18397. return !isUndefined(max) && model.value.length >= max && !isChecked.value || !isUndefined(min) && model.value.length <= min && isChecked.value;
  18398. });
  18399. const isDisabled = useDisabled(vue.computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.disabled.value) || isLimitDisabled.value));
  18400. return {
  18401. isDisabled,
  18402. isLimitDisabled
  18403. };
  18404. };
  18405. const useCheckboxEvent = (props, {
  18406. model,
  18407. isLimitExceeded,
  18408. hasOwnLabel,
  18409. isDisabled,
  18410. isLabeledByFormItem
  18411. }) => {
  18412. const checkboxGroup = vue.inject(checkboxGroupContextKey, void 0);
  18413. const { formItem } = useFormItem();
  18414. const { emit } = vue.getCurrentInstance();
  18415. function getLabeledValue(value) {
  18416. var _a, _b;
  18417. return value === props.trueLabel || value === true ? (_a = props.trueLabel) != null ? _a : true : (_b = props.falseLabel) != null ? _b : false;
  18418. }
  18419. function emitChangeEvent(checked, e) {
  18420. emit("change", getLabeledValue(checked), e);
  18421. }
  18422. function handleChange(e) {
  18423. if (isLimitExceeded.value)
  18424. return;
  18425. const target = e.target;
  18426. emit("change", getLabeledValue(target.checked), e);
  18427. }
  18428. async function onClickRoot(e) {
  18429. if (isLimitExceeded.value)
  18430. return;
  18431. if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
  18432. const eventTargets = e.composedPath();
  18433. const hasLabel = eventTargets.some((item) => item.tagName === "LABEL");
  18434. if (!hasLabel) {
  18435. model.value = getLabeledValue([false, props.falseLabel].includes(model.value));
  18436. await vue.nextTick();
  18437. emitChangeEvent(model.value, e);
  18438. }
  18439. }
  18440. }
  18441. const validateEvent = vue.computed(() => (checkboxGroup == null ? void 0 : checkboxGroup.validateEvent) || props.validateEvent);
  18442. vue.watch(() => props.modelValue, () => {
  18443. if (validateEvent.value) {
  18444. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  18445. }
  18446. });
  18447. return {
  18448. handleChange,
  18449. onClickRoot
  18450. };
  18451. };
  18452. const useCheckboxModel = (props) => {
  18453. const selfModel = vue.ref(false);
  18454. const { emit } = vue.getCurrentInstance();
  18455. const checkboxGroup = vue.inject(checkboxGroupContextKey, void 0);
  18456. const isGroup = vue.computed(() => isUndefined(checkboxGroup) === false);
  18457. const isLimitExceeded = vue.ref(false);
  18458. const model = vue.computed({
  18459. get() {
  18460. var _a, _b;
  18461. return isGroup.value ? (_a = checkboxGroup == null ? void 0 : checkboxGroup.modelValue) == null ? void 0 : _a.value : (_b = props.modelValue) != null ? _b : selfModel.value;
  18462. },
  18463. set(val) {
  18464. var _a, _b;
  18465. if (isGroup.value && isArray(val)) {
  18466. isLimitExceeded.value = ((_a = checkboxGroup == null ? void 0 : checkboxGroup.max) == null ? void 0 : _a.value) !== void 0 && val.length > (checkboxGroup == null ? void 0 : checkboxGroup.max.value);
  18467. isLimitExceeded.value === false && ((_b = checkboxGroup == null ? void 0 : checkboxGroup.changeEvent) == null ? void 0 : _b.call(checkboxGroup, val));
  18468. } else {
  18469. emit(UPDATE_MODEL_EVENT, val);
  18470. selfModel.value = val;
  18471. }
  18472. }
  18473. });
  18474. return {
  18475. model,
  18476. isGroup,
  18477. isLimitExceeded
  18478. };
  18479. };
  18480. const useCheckboxStatus = (props, slots, { model }) => {
  18481. const checkboxGroup = vue.inject(checkboxGroupContextKey, void 0);
  18482. const isFocused = vue.ref(false);
  18483. const isChecked = vue.computed(() => {
  18484. const value = model.value;
  18485. if (isBoolean(value)) {
  18486. return value;
  18487. } else if (isArray(value)) {
  18488. if (isObject$1(props.label)) {
  18489. return value.map(vue.toRaw).some((o) => isEqual$1(o, props.label));
  18490. } else {
  18491. return value.map(vue.toRaw).includes(props.label);
  18492. }
  18493. } else if (value !== null && value !== void 0) {
  18494. return value === props.trueLabel;
  18495. } else {
  18496. return !!value;
  18497. }
  18498. });
  18499. const checkboxButtonSize = useSize(vue.computed(() => {
  18500. var _a;
  18501. return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
  18502. }), {
  18503. prop: true
  18504. });
  18505. const checkboxSize = useSize(vue.computed(() => {
  18506. var _a;
  18507. return (_a = checkboxGroup == null ? void 0 : checkboxGroup.size) == null ? void 0 : _a.value;
  18508. }));
  18509. const hasOwnLabel = vue.computed(() => {
  18510. return !!(slots.default || props.label);
  18511. });
  18512. return {
  18513. checkboxButtonSize,
  18514. isChecked,
  18515. isFocused,
  18516. checkboxSize,
  18517. hasOwnLabel
  18518. };
  18519. };
  18520. const setStoreValue = (props, { model }) => {
  18521. function addToStore() {
  18522. if (isArray(model.value) && !model.value.includes(props.label)) {
  18523. model.value.push(props.label);
  18524. } else {
  18525. model.value = props.trueLabel || true;
  18526. }
  18527. }
  18528. props.checked && addToStore();
  18529. };
  18530. const useCheckbox = (props, slots) => {
  18531. const { formItem: elFormItem } = useFormItem();
  18532. const { model, isGroup, isLimitExceeded } = useCheckboxModel(props);
  18533. const {
  18534. isFocused,
  18535. isChecked,
  18536. checkboxButtonSize,
  18537. checkboxSize,
  18538. hasOwnLabel
  18539. } = useCheckboxStatus(props, slots, { model });
  18540. const { isDisabled } = useCheckboxDisabled({ model, isChecked });
  18541. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
  18542. formItemContext: elFormItem,
  18543. disableIdGeneration: hasOwnLabel,
  18544. disableIdManagement: isGroup
  18545. });
  18546. const { handleChange, onClickRoot } = useCheckboxEvent(props, {
  18547. model,
  18548. isLimitExceeded,
  18549. hasOwnLabel,
  18550. isDisabled,
  18551. isLabeledByFormItem
  18552. });
  18553. setStoreValue(props, { model });
  18554. return {
  18555. inputId,
  18556. isLabeledByFormItem,
  18557. isChecked,
  18558. isDisabled,
  18559. isFocused,
  18560. checkboxButtonSize,
  18561. checkboxSize,
  18562. hasOwnLabel,
  18563. model,
  18564. handleChange,
  18565. onClickRoot
  18566. };
  18567. };
  18568. const _hoisted_1$U = ["tabindex", "role", "aria-checked"];
  18569. const _hoisted_2$z = ["id", "aria-hidden", "name", "tabindex", "disabled", "true-value", "false-value"];
  18570. const _hoisted_3$i = ["id", "aria-hidden", "disabled", "value", "name", "tabindex"];
  18571. const __default__$18 = vue.defineComponent({
  18572. name: "ElCheckbox"
  18573. });
  18574. const _sfc_main$1N = /* @__PURE__ */ vue.defineComponent({
  18575. ...__default__$18,
  18576. props: checkboxProps,
  18577. emits: checkboxEmits,
  18578. setup(__props) {
  18579. const props = __props;
  18580. const slots = vue.useSlots();
  18581. const {
  18582. inputId,
  18583. isLabeledByFormItem,
  18584. isChecked,
  18585. isDisabled,
  18586. isFocused,
  18587. checkboxSize,
  18588. hasOwnLabel,
  18589. model,
  18590. handleChange,
  18591. onClickRoot
  18592. } = useCheckbox(props, slots);
  18593. const ns = useNamespace("checkbox");
  18594. const compKls = vue.computed(() => {
  18595. return [
  18596. ns.b(),
  18597. ns.m(checkboxSize.value),
  18598. ns.is("disabled", isDisabled.value),
  18599. ns.is("bordered", props.border),
  18600. ns.is("checked", isChecked.value)
  18601. ];
  18602. });
  18603. const spanKls = vue.computed(() => {
  18604. return [
  18605. ns.e("input"),
  18606. ns.is("disabled", isDisabled.value),
  18607. ns.is("checked", isChecked.value),
  18608. ns.is("indeterminate", props.indeterminate),
  18609. ns.is("focus", isFocused.value)
  18610. ];
  18611. });
  18612. return (_ctx, _cache) => {
  18613. return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(!vue.unref(hasOwnLabel) && vue.unref(isLabeledByFormItem) ? "span" : "label"), {
  18614. class: vue.normalizeClass(vue.unref(compKls)),
  18615. "aria-controls": _ctx.indeterminate ? _ctx.controls : null,
  18616. onClick: vue.unref(onClickRoot)
  18617. }, {
  18618. default: vue.withCtx(() => [
  18619. vue.createElementVNode("span", {
  18620. class: vue.normalizeClass(vue.unref(spanKls)),
  18621. tabindex: _ctx.indeterminate ? 0 : void 0,
  18622. role: _ctx.indeterminate ? "checkbox" : void 0,
  18623. "aria-checked": _ctx.indeterminate ? "mixed" : void 0
  18624. }, [
  18625. _ctx.trueLabel || _ctx.falseLabel ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  18626. key: 0,
  18627. id: vue.unref(inputId),
  18628. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(model) ? model.value = $event : null),
  18629. class: vue.normalizeClass(vue.unref(ns).e("original")),
  18630. type: "checkbox",
  18631. "aria-hidden": _ctx.indeterminate ? "true" : "false",
  18632. name: _ctx.name,
  18633. tabindex: _ctx.tabindex,
  18634. disabled: vue.unref(isDisabled),
  18635. "true-value": _ctx.trueLabel,
  18636. "false-value": _ctx.falseLabel,
  18637. onChange: _cache[1] || (_cache[1] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
  18638. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  18639. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false)
  18640. }, null, 42, _hoisted_2$z)), [
  18641. [vue.vModelCheckbox, vue.unref(model)]
  18642. ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  18643. key: 1,
  18644. id: vue.unref(inputId),
  18645. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.isRef(model) ? model.value = $event : null),
  18646. class: vue.normalizeClass(vue.unref(ns).e("original")),
  18647. type: "checkbox",
  18648. "aria-hidden": _ctx.indeterminate ? "true" : "false",
  18649. disabled: vue.unref(isDisabled),
  18650. value: _ctx.label,
  18651. name: _ctx.name,
  18652. tabindex: _ctx.tabindex,
  18653. onChange: _cache[5] || (_cache[5] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
  18654. onFocus: _cache[6] || (_cache[6] = ($event) => isFocused.value = true),
  18655. onBlur: _cache[7] || (_cache[7] = ($event) => isFocused.value = false)
  18656. }, null, 42, _hoisted_3$i)), [
  18657. [vue.vModelCheckbox, vue.unref(model)]
  18658. ]),
  18659. vue.createElementVNode("span", {
  18660. class: vue.normalizeClass(vue.unref(ns).e("inner"))
  18661. }, null, 2)
  18662. ], 10, _hoisted_1$U),
  18663. vue.unref(hasOwnLabel) ? (vue.openBlock(), vue.createElementBlock("span", {
  18664. key: 0,
  18665. class: vue.normalizeClass(vue.unref(ns).e("label"))
  18666. }, [
  18667. vue.renderSlot(_ctx.$slots, "default"),
  18668. !_ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  18669. vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
  18670. ], 64)) : vue.createCommentVNode("v-if", true)
  18671. ], 2)) : vue.createCommentVNode("v-if", true)
  18672. ]),
  18673. _: 3
  18674. }, 8, ["class", "aria-controls", "onClick"]);
  18675. };
  18676. }
  18677. });
  18678. var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main$1N, [["__file", "checkbox.vue"]]);
  18679. const _hoisted_1$T = ["name", "tabindex", "disabled", "true-value", "false-value"];
  18680. const _hoisted_2$y = ["name", "tabindex", "disabled", "value"];
  18681. const __default__$17 = vue.defineComponent({
  18682. name: "ElCheckboxButton"
  18683. });
  18684. const _sfc_main$1M = /* @__PURE__ */ vue.defineComponent({
  18685. ...__default__$17,
  18686. props: checkboxProps,
  18687. emits: checkboxEmits,
  18688. setup(__props) {
  18689. const props = __props;
  18690. const slots = vue.useSlots();
  18691. const {
  18692. isFocused,
  18693. isChecked,
  18694. isDisabled,
  18695. checkboxButtonSize,
  18696. model,
  18697. handleChange
  18698. } = useCheckbox(props, slots);
  18699. const checkboxGroup = vue.inject(checkboxGroupContextKey, void 0);
  18700. const ns = useNamespace("checkbox");
  18701. const activeStyle = vue.computed(() => {
  18702. var _a, _b, _c, _d;
  18703. const fillValue = (_b = (_a = checkboxGroup == null ? void 0 : checkboxGroup.fill) == null ? void 0 : _a.value) != null ? _b : "";
  18704. return {
  18705. backgroundColor: fillValue,
  18706. borderColor: fillValue,
  18707. color: (_d = (_c = checkboxGroup == null ? void 0 : checkboxGroup.textColor) == null ? void 0 : _c.value) != null ? _d : "",
  18708. boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
  18709. };
  18710. });
  18711. const lableKls = vue.computed(() => {
  18712. return [
  18713. ns.b("button"),
  18714. ns.bm("button", checkboxButtonSize.value),
  18715. ns.is("disabled", isDisabled.value),
  18716. ns.is("checked", isChecked.value),
  18717. ns.is("focus", isFocused.value)
  18718. ];
  18719. });
  18720. return (_ctx, _cache) => {
  18721. return vue.openBlock(), vue.createElementBlock("label", {
  18722. class: vue.normalizeClass(vue.unref(lableKls))
  18723. }, [
  18724. _ctx.trueLabel || _ctx.falseLabel ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  18725. key: 0,
  18726. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(model) ? model.value = $event : null),
  18727. class: vue.normalizeClass(vue.unref(ns).be("button", "original")),
  18728. type: "checkbox",
  18729. name: _ctx.name,
  18730. tabindex: _ctx.tabindex,
  18731. disabled: vue.unref(isDisabled),
  18732. "true-value": _ctx.trueLabel,
  18733. "false-value": _ctx.falseLabel,
  18734. onChange: _cache[1] || (_cache[1] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
  18735. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  18736. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false)
  18737. }, null, 42, _hoisted_1$T)), [
  18738. [vue.vModelCheckbox, vue.unref(model)]
  18739. ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  18740. key: 1,
  18741. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.isRef(model) ? model.value = $event : null),
  18742. class: vue.normalizeClass(vue.unref(ns).be("button", "original")),
  18743. type: "checkbox",
  18744. name: _ctx.name,
  18745. tabindex: _ctx.tabindex,
  18746. disabled: vue.unref(isDisabled),
  18747. value: _ctx.label,
  18748. onChange: _cache[5] || (_cache[5] = (...args) => vue.unref(handleChange) && vue.unref(handleChange)(...args)),
  18749. onFocus: _cache[6] || (_cache[6] = ($event) => isFocused.value = true),
  18750. onBlur: _cache[7] || (_cache[7] = ($event) => isFocused.value = false)
  18751. }, null, 42, _hoisted_2$y)), [
  18752. [vue.vModelCheckbox, vue.unref(model)]
  18753. ]),
  18754. _ctx.$slots.default || _ctx.label ? (vue.openBlock(), vue.createElementBlock("span", {
  18755. key: 2,
  18756. class: vue.normalizeClass(vue.unref(ns).be("button", "inner")),
  18757. style: vue.normalizeStyle(vue.unref(isChecked) ? vue.unref(activeStyle) : void 0)
  18758. }, [
  18759. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  18760. vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
  18761. ])
  18762. ], 6)) : vue.createCommentVNode("v-if", true)
  18763. ], 2);
  18764. };
  18765. }
  18766. });
  18767. var CheckboxButton = /* @__PURE__ */ _export_sfc(_sfc_main$1M, [["__file", "checkbox-button.vue"]]);
  18768. const checkboxGroupProps = buildProps({
  18769. modelValue: {
  18770. type: definePropType(Array),
  18771. default: () => []
  18772. },
  18773. disabled: Boolean,
  18774. min: Number,
  18775. max: Number,
  18776. size: useSizeProp,
  18777. label: String,
  18778. fill: String,
  18779. textColor: String,
  18780. tag: {
  18781. type: String,
  18782. default: "div"
  18783. },
  18784. validateEvent: {
  18785. type: Boolean,
  18786. default: true
  18787. }
  18788. });
  18789. const checkboxGroupEmits = {
  18790. [UPDATE_MODEL_EVENT]: (val) => isArray(val),
  18791. change: (val) => isArray(val)
  18792. };
  18793. const __default__$16 = vue.defineComponent({
  18794. name: "ElCheckboxGroup"
  18795. });
  18796. const _sfc_main$1L = /* @__PURE__ */ vue.defineComponent({
  18797. ...__default__$16,
  18798. props: checkboxGroupProps,
  18799. emits: checkboxGroupEmits,
  18800. setup(__props, { emit }) {
  18801. const props = __props;
  18802. const ns = useNamespace("checkbox");
  18803. const { formItem } = useFormItem();
  18804. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
  18805. formItemContext: formItem
  18806. });
  18807. const changeEvent = async (value) => {
  18808. emit(UPDATE_MODEL_EVENT, value);
  18809. await vue.nextTick();
  18810. emit("change", value);
  18811. };
  18812. const modelValue = vue.computed({
  18813. get() {
  18814. return props.modelValue;
  18815. },
  18816. set(val) {
  18817. changeEvent(val);
  18818. }
  18819. });
  18820. vue.provide(checkboxGroupContextKey, {
  18821. ...pick(vue.toRefs(props), [
  18822. "size",
  18823. "min",
  18824. "max",
  18825. "disabled",
  18826. "validateEvent",
  18827. "fill",
  18828. "textColor"
  18829. ]),
  18830. modelValue,
  18831. changeEvent
  18832. });
  18833. vue.watch(() => props.modelValue, () => {
  18834. if (props.validateEvent) {
  18835. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  18836. }
  18837. });
  18838. return (_ctx, _cache) => {
  18839. var _a;
  18840. return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
  18841. id: vue.unref(groupId),
  18842. class: vue.normalizeClass(vue.unref(ns).b("group")),
  18843. role: "group",
  18844. "aria-label": !vue.unref(isLabeledByFormItem) ? _ctx.label || "checkbox-group" : void 0,
  18845. "aria-labelledby": vue.unref(isLabeledByFormItem) ? (_a = vue.unref(formItem)) == null ? void 0 : _a.labelId : void 0
  18846. }, {
  18847. default: vue.withCtx(() => [
  18848. vue.renderSlot(_ctx.$slots, "default")
  18849. ]),
  18850. _: 3
  18851. }, 8, ["id", "class", "aria-label", "aria-labelledby"]);
  18852. };
  18853. }
  18854. });
  18855. var CheckboxGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1L, [["__file", "checkbox-group.vue"]]);
  18856. const ElCheckbox = withInstall(Checkbox, {
  18857. CheckboxButton,
  18858. CheckboxGroup
  18859. });
  18860. const ElCheckboxButton = withNoopInstall(CheckboxButton);
  18861. const ElCheckboxGroup$1 = withNoopInstall(CheckboxGroup);
  18862. const radioPropsBase = buildProps({
  18863. size: useSizeProp,
  18864. disabled: Boolean,
  18865. label: {
  18866. type: [String, Number, Boolean],
  18867. default: ""
  18868. }
  18869. });
  18870. const radioProps = buildProps({
  18871. ...radioPropsBase,
  18872. modelValue: {
  18873. type: [String, Number, Boolean],
  18874. default: ""
  18875. },
  18876. name: {
  18877. type: String,
  18878. default: ""
  18879. },
  18880. border: Boolean
  18881. });
  18882. const radioEmits = {
  18883. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  18884. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  18885. };
  18886. const useRadio = (props, emit) => {
  18887. const radioRef = vue.ref();
  18888. const radioGroup = vue.inject(radioGroupKey, void 0);
  18889. const isGroup = vue.computed(() => !!radioGroup);
  18890. const modelValue = vue.computed({
  18891. get() {
  18892. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  18893. },
  18894. set(val) {
  18895. if (isGroup.value) {
  18896. radioGroup.changeEvent(val);
  18897. } else {
  18898. emit && emit(UPDATE_MODEL_EVENT, val);
  18899. }
  18900. radioRef.value.checked = props.modelValue === props.label;
  18901. }
  18902. });
  18903. const size = useSize(vue.computed(() => radioGroup == null ? void 0 : radioGroup.size));
  18904. const disabled = useDisabled(vue.computed(() => radioGroup == null ? void 0 : radioGroup.disabled));
  18905. const focus = vue.ref(false);
  18906. const tabIndex = vue.computed(() => {
  18907. return disabled.value || isGroup.value && modelValue.value !== props.label ? -1 : 0;
  18908. });
  18909. return {
  18910. radioRef,
  18911. isGroup,
  18912. radioGroup,
  18913. focus,
  18914. size,
  18915. disabled,
  18916. tabIndex,
  18917. modelValue
  18918. };
  18919. };
  18920. const _hoisted_1$S = ["value", "name", "disabled"];
  18921. const __default__$15 = vue.defineComponent({
  18922. name: "ElRadio"
  18923. });
  18924. const _sfc_main$1K = /* @__PURE__ */ vue.defineComponent({
  18925. ...__default__$15,
  18926. props: radioProps,
  18927. emits: radioEmits,
  18928. setup(__props, { emit }) {
  18929. const props = __props;
  18930. const ns = useNamespace("radio");
  18931. const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(props, emit);
  18932. function handleChange() {
  18933. vue.nextTick(() => emit("change", modelValue.value));
  18934. }
  18935. return (_ctx, _cache) => {
  18936. var _a;
  18937. return vue.openBlock(), vue.createElementBlock("label", {
  18938. class: vue.normalizeClass([
  18939. vue.unref(ns).b(),
  18940. vue.unref(ns).is("disabled", vue.unref(disabled)),
  18941. vue.unref(ns).is("focus", vue.unref(focus)),
  18942. vue.unref(ns).is("bordered", _ctx.border),
  18943. vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
  18944. vue.unref(ns).m(vue.unref(size))
  18945. ])
  18946. }, [
  18947. vue.createElementVNode("span", {
  18948. class: vue.normalizeClass([
  18949. vue.unref(ns).e("input"),
  18950. vue.unref(ns).is("disabled", vue.unref(disabled)),
  18951. vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
  18952. ])
  18953. }, [
  18954. vue.withDirectives(vue.createElementVNode("input", {
  18955. ref_key: "radioRef",
  18956. ref: radioRef,
  18957. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
  18958. class: vue.normalizeClass(vue.unref(ns).e("original")),
  18959. value: _ctx.label,
  18960. name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
  18961. disabled: vue.unref(disabled),
  18962. type: "radio",
  18963. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  18964. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  18965. onChange: handleChange
  18966. }, null, 42, _hoisted_1$S), [
  18967. [vue.vModelRadio, vue.unref(modelValue)]
  18968. ]),
  18969. vue.createElementVNode("span", {
  18970. class: vue.normalizeClass(vue.unref(ns).e("inner"))
  18971. }, null, 2)
  18972. ], 2),
  18973. vue.createElementVNode("span", {
  18974. class: vue.normalizeClass(vue.unref(ns).e("label")),
  18975. onKeydown: _cache[3] || (_cache[3] = vue.withModifiers(() => {
  18976. }, ["stop"]))
  18977. }, [
  18978. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  18979. vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
  18980. ])
  18981. ], 34)
  18982. ], 2);
  18983. };
  18984. }
  18985. });
  18986. var Radio = /* @__PURE__ */ _export_sfc(_sfc_main$1K, [["__file", "radio.vue"]]);
  18987. const radioButtonProps = buildProps({
  18988. ...radioPropsBase,
  18989. name: {
  18990. type: String,
  18991. default: ""
  18992. }
  18993. });
  18994. const _hoisted_1$R = ["value", "name", "disabled"];
  18995. const __default__$14 = vue.defineComponent({
  18996. name: "ElRadioButton"
  18997. });
  18998. const _sfc_main$1J = /* @__PURE__ */ vue.defineComponent({
  18999. ...__default__$14,
  19000. props: radioButtonProps,
  19001. setup(__props) {
  19002. const props = __props;
  19003. const ns = useNamespace("radio");
  19004. const { radioRef, focus, size, disabled, modelValue, radioGroup } = useRadio(props);
  19005. const activeStyle = vue.computed(() => {
  19006. return {
  19007. backgroundColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  19008. borderColor: (radioGroup == null ? void 0 : radioGroup.fill) || "",
  19009. boxShadow: (radioGroup == null ? void 0 : radioGroup.fill) ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  19010. color: (radioGroup == null ? void 0 : radioGroup.textColor) || ""
  19011. };
  19012. });
  19013. return (_ctx, _cache) => {
  19014. var _a;
  19015. return vue.openBlock(), vue.createElementBlock("label", {
  19016. class: vue.normalizeClass([
  19017. vue.unref(ns).b("button"),
  19018. vue.unref(ns).is("active", vue.unref(modelValue) === _ctx.label),
  19019. vue.unref(ns).is("disabled", vue.unref(disabled)),
  19020. vue.unref(ns).is("focus", vue.unref(focus)),
  19021. vue.unref(ns).bm("button", vue.unref(size))
  19022. ])
  19023. }, [
  19024. vue.withDirectives(vue.createElementVNode("input", {
  19025. ref_key: "radioRef",
  19026. ref: radioRef,
  19027. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
  19028. class: vue.normalizeClass(vue.unref(ns).be("button", "original-radio")),
  19029. value: _ctx.label,
  19030. type: "radio",
  19031. name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
  19032. disabled: vue.unref(disabled),
  19033. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  19034. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false)
  19035. }, null, 42, _hoisted_1$R), [
  19036. [vue.vModelRadio, vue.unref(modelValue)]
  19037. ]),
  19038. vue.createElementVNode("span", {
  19039. class: vue.normalizeClass(vue.unref(ns).be("button", "inner")),
  19040. style: vue.normalizeStyle(vue.unref(modelValue) === _ctx.label ? vue.unref(activeStyle) : {}),
  19041. onKeydown: _cache[3] || (_cache[3] = vue.withModifiers(() => {
  19042. }, ["stop"]))
  19043. }, [
  19044. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  19045. vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
  19046. ])
  19047. ], 38)
  19048. ], 2);
  19049. };
  19050. }
  19051. });
  19052. var RadioButton = /* @__PURE__ */ _export_sfc(_sfc_main$1J, [["__file", "radio-button.vue"]]);
  19053. const radioGroupProps = buildProps({
  19054. id: {
  19055. type: String,
  19056. default: void 0
  19057. },
  19058. size: useSizeProp,
  19059. disabled: Boolean,
  19060. modelValue: {
  19061. type: [String, Number, Boolean],
  19062. default: ""
  19063. },
  19064. fill: {
  19065. type: String,
  19066. default: ""
  19067. },
  19068. label: {
  19069. type: String,
  19070. default: void 0
  19071. },
  19072. textColor: {
  19073. type: String,
  19074. default: ""
  19075. },
  19076. name: {
  19077. type: String,
  19078. default: void 0
  19079. },
  19080. validateEvent: {
  19081. type: Boolean,
  19082. default: true
  19083. }
  19084. });
  19085. const radioGroupEmits = radioEmits;
  19086. const _hoisted_1$Q = ["id", "aria-label", "aria-labelledby"];
  19087. const __default__$13 = vue.defineComponent({
  19088. name: "ElRadioGroup"
  19089. });
  19090. const _sfc_main$1I = /* @__PURE__ */ vue.defineComponent({
  19091. ...__default__$13,
  19092. props: radioGroupProps,
  19093. emits: radioGroupEmits,
  19094. setup(__props, { emit }) {
  19095. const props = __props;
  19096. const ns = useNamespace("radio");
  19097. const radioId = useId();
  19098. const radioGroupRef = vue.ref();
  19099. const { formItem } = useFormItem();
  19100. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, {
  19101. formItemContext: formItem
  19102. });
  19103. const changeEvent = (value) => {
  19104. emit(UPDATE_MODEL_EVENT, value);
  19105. vue.nextTick(() => emit("change", value));
  19106. };
  19107. vue.onMounted(() => {
  19108. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  19109. const firstLabel = radios[0];
  19110. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) {
  19111. firstLabel.tabIndex = 0;
  19112. }
  19113. });
  19114. const name = vue.computed(() => {
  19115. return props.name || radioId.value;
  19116. });
  19117. vue.provide(radioGroupKey, vue.reactive({
  19118. ...vue.toRefs(props),
  19119. changeEvent,
  19120. name
  19121. }));
  19122. vue.watch(() => props.modelValue, () => {
  19123. if (props.validateEvent) {
  19124. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  19125. }
  19126. });
  19127. return (_ctx, _cache) => {
  19128. return vue.openBlock(), vue.createElementBlock("div", {
  19129. id: vue.unref(groupId),
  19130. ref_key: "radioGroupRef",
  19131. ref: radioGroupRef,
  19132. class: vue.normalizeClass(vue.unref(ns).b("group")),
  19133. role: "radiogroup",
  19134. "aria-label": !vue.unref(isLabeledByFormItem) ? _ctx.label || "radio-group" : void 0,
  19135. "aria-labelledby": vue.unref(isLabeledByFormItem) ? vue.unref(formItem).labelId : void 0
  19136. }, [
  19137. vue.renderSlot(_ctx.$slots, "default")
  19138. ], 10, _hoisted_1$Q);
  19139. };
  19140. }
  19141. });
  19142. var RadioGroup = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["__file", "radio-group.vue"]]);
  19143. const ElRadio = withInstall(Radio, {
  19144. RadioButton,
  19145. RadioGroup
  19146. });
  19147. const ElRadioGroup = withNoopInstall(RadioGroup);
  19148. const ElRadioButton = withNoopInstall(RadioButton);
  19149. var NodeContent$1 = vue.defineComponent({
  19150. name: "NodeContent",
  19151. setup() {
  19152. const ns = useNamespace("cascader-node");
  19153. return {
  19154. ns
  19155. };
  19156. },
  19157. render() {
  19158. const { ns } = this;
  19159. const { node, panel } = this.$parent;
  19160. const { data, label } = node;
  19161. const { renderLabelFn } = panel;
  19162. return vue.h("span", { class: ns.e("label") }, renderLabelFn ? renderLabelFn({ node, data }) : label);
  19163. }
  19164. });
  19165. const CASCADER_PANEL_INJECTION_KEY = Symbol();
  19166. const _sfc_main$1H = vue.defineComponent({
  19167. name: "ElCascaderNode",
  19168. components: {
  19169. ElCheckbox,
  19170. ElRadio,
  19171. NodeContent: NodeContent$1,
  19172. ElIcon,
  19173. Check: check_default,
  19174. Loading: loading_default,
  19175. ArrowRight: arrow_right_default
  19176. },
  19177. props: {
  19178. node: {
  19179. type: Object,
  19180. required: true
  19181. },
  19182. menuId: String
  19183. },
  19184. emits: ["expand"],
  19185. setup(props, { emit }) {
  19186. const panel = vue.inject(CASCADER_PANEL_INJECTION_KEY);
  19187. const ns = useNamespace("cascader-node");
  19188. const isHoverMenu = vue.computed(() => panel.isHoverMenu);
  19189. const multiple = vue.computed(() => panel.config.multiple);
  19190. const checkStrictly = vue.computed(() => panel.config.checkStrictly);
  19191. const checkedNodeId = vue.computed(() => {
  19192. var _a;
  19193. return (_a = panel.checkedNodes[0]) == null ? void 0 : _a.uid;
  19194. });
  19195. const isDisabled = vue.computed(() => props.node.isDisabled);
  19196. const isLeaf = vue.computed(() => props.node.isLeaf);
  19197. const expandable = vue.computed(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
  19198. const inExpandingPath = vue.computed(() => isInPath(panel.expandingNode));
  19199. const inCheckedPath = vue.computed(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
  19200. const isInPath = (node) => {
  19201. var _a;
  19202. const { level, uid } = props.node;
  19203. return ((_a = node == null ? void 0 : node.pathNodes[level - 1]) == null ? void 0 : _a.uid) === uid;
  19204. };
  19205. const doExpand = () => {
  19206. if (inExpandingPath.value)
  19207. return;
  19208. panel.expandNode(props.node);
  19209. };
  19210. const doCheck = (checked) => {
  19211. const { node } = props;
  19212. if (checked === node.checked)
  19213. return;
  19214. panel.handleCheckChange(node, checked);
  19215. };
  19216. const doLoad = () => {
  19217. panel.lazyLoad(props.node, () => {
  19218. if (!isLeaf.value)
  19219. doExpand();
  19220. });
  19221. };
  19222. const handleHoverExpand = (e) => {
  19223. if (!isHoverMenu.value)
  19224. return;
  19225. handleExpand();
  19226. !isLeaf.value && emit("expand", e);
  19227. };
  19228. const handleExpand = () => {
  19229. const { node } = props;
  19230. if (!expandable.value || node.loading)
  19231. return;
  19232. node.loaded ? doExpand() : doLoad();
  19233. };
  19234. const handleClick = () => {
  19235. if (isHoverMenu.value && !isLeaf.value)
  19236. return;
  19237. if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) {
  19238. handleCheck(true);
  19239. } else {
  19240. handleExpand();
  19241. }
  19242. };
  19243. const handleSelectCheck = (checked) => {
  19244. if (checkStrictly.value) {
  19245. doCheck(checked);
  19246. if (props.node.loaded) {
  19247. doExpand();
  19248. }
  19249. } else {
  19250. handleCheck(checked);
  19251. }
  19252. };
  19253. const handleCheck = (checked) => {
  19254. if (!props.node.loaded) {
  19255. doLoad();
  19256. } else {
  19257. doCheck(checked);
  19258. !checkStrictly.value && doExpand();
  19259. }
  19260. };
  19261. return {
  19262. panel,
  19263. isHoverMenu,
  19264. multiple,
  19265. checkStrictly,
  19266. checkedNodeId,
  19267. isDisabled,
  19268. isLeaf,
  19269. expandable,
  19270. inExpandingPath,
  19271. inCheckedPath,
  19272. ns,
  19273. handleHoverExpand,
  19274. handleExpand,
  19275. handleClick,
  19276. handleCheck,
  19277. handleSelectCheck
  19278. };
  19279. }
  19280. });
  19281. const _hoisted_1$P = ["id", "aria-haspopup", "aria-owns", "aria-expanded", "tabindex"];
  19282. const _hoisted_2$x = /* @__PURE__ */ vue.createElementVNode("span", null, null, -1);
  19283. function _sfc_render$x(_ctx, _cache, $props, $setup, $data, $options) {
  19284. const _component_el_checkbox = vue.resolveComponent("el-checkbox");
  19285. const _component_el_radio = vue.resolveComponent("el-radio");
  19286. const _component_check = vue.resolveComponent("check");
  19287. const _component_el_icon = vue.resolveComponent("el-icon");
  19288. const _component_node_content = vue.resolveComponent("node-content");
  19289. const _component_loading = vue.resolveComponent("loading");
  19290. const _component_arrow_right = vue.resolveComponent("arrow-right");
  19291. return vue.openBlock(), vue.createElementBlock("li", {
  19292. id: `${_ctx.menuId}-${_ctx.node.uid}`,
  19293. role: "menuitem",
  19294. "aria-haspopup": !_ctx.isLeaf,
  19295. "aria-owns": _ctx.isLeaf ? null : _ctx.menuId,
  19296. "aria-expanded": _ctx.inExpandingPath,
  19297. tabindex: _ctx.expandable ? -1 : void 0,
  19298. class: vue.normalizeClass([
  19299. _ctx.ns.b(),
  19300. _ctx.ns.is("selectable", _ctx.checkStrictly),
  19301. _ctx.ns.is("active", _ctx.node.checked),
  19302. _ctx.ns.is("disabled", !_ctx.expandable),
  19303. _ctx.inExpandingPath && "in-active-path",
  19304. _ctx.inCheckedPath && "in-checked-path"
  19305. ]),
  19306. onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.handleHoverExpand && _ctx.handleHoverExpand(...args)),
  19307. onFocus: _cache[3] || (_cache[3] = (...args) => _ctx.handleHoverExpand && _ctx.handleHoverExpand(...args)),
  19308. onClick: _cache[4] || (_cache[4] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  19309. }, [
  19310. vue.createCommentVNode(" prefix "),
  19311. _ctx.multiple ? (vue.openBlock(), vue.createBlock(_component_el_checkbox, {
  19312. key: 0,
  19313. "model-value": _ctx.node.checked,
  19314. indeterminate: _ctx.node.indeterminate,
  19315. disabled: _ctx.isDisabled,
  19316. onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  19317. }, ["stop"])),
  19318. "onUpdate:modelValue": _ctx.handleSelectCheck
  19319. }, null, 8, ["model-value", "indeterminate", "disabled", "onUpdate:modelValue"])) : _ctx.checkStrictly ? (vue.openBlock(), vue.createBlock(_component_el_radio, {
  19320. key: 1,
  19321. "model-value": _ctx.checkedNodeId,
  19322. label: _ctx.node.uid,
  19323. disabled: _ctx.isDisabled,
  19324. "onUpdate:modelValue": _ctx.handleSelectCheck,
  19325. onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
  19326. }, ["stop"]))
  19327. }, {
  19328. default: vue.withCtx(() => [
  19329. vue.createCommentVNode("\n Add an empty element to avoid render label,\n do not use empty fragment here for https://github.com/vuejs/vue-next/pull/2485\n "),
  19330. _hoisted_2$x
  19331. ]),
  19332. _: 1
  19333. }, 8, ["model-value", "label", "disabled", "onUpdate:modelValue"])) : _ctx.isLeaf && _ctx.node.checked ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  19334. key: 2,
  19335. class: vue.normalizeClass(_ctx.ns.e("prefix"))
  19336. }, {
  19337. default: vue.withCtx(() => [
  19338. vue.createVNode(_component_check)
  19339. ]),
  19340. _: 1
  19341. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  19342. vue.createCommentVNode(" content "),
  19343. vue.createVNode(_component_node_content),
  19344. vue.createCommentVNode(" postfix "),
  19345. !_ctx.isLeaf ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 3 }, [
  19346. _ctx.node.loading ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  19347. key: 0,
  19348. class: vue.normalizeClass([_ctx.ns.is("loading"), _ctx.ns.e("postfix")])
  19349. }, {
  19350. default: vue.withCtx(() => [
  19351. vue.createVNode(_component_loading)
  19352. ]),
  19353. _: 1
  19354. }, 8, ["class"])) : (vue.openBlock(), vue.createBlock(_component_el_icon, {
  19355. key: 1,
  19356. class: vue.normalizeClass(["arrow-right", _ctx.ns.e("postfix")])
  19357. }, {
  19358. default: vue.withCtx(() => [
  19359. vue.createVNode(_component_arrow_right)
  19360. ]),
  19361. _: 1
  19362. }, 8, ["class"]))
  19363. ], 64)) : vue.createCommentVNode("v-if", true)
  19364. ], 42, _hoisted_1$P);
  19365. }
  19366. var ElCascaderNode = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["render", _sfc_render$x], ["__file", "node.vue"]]);
  19367. const _sfc_main$1G = vue.defineComponent({
  19368. name: "ElCascaderMenu",
  19369. components: {
  19370. Loading: loading_default,
  19371. ElIcon,
  19372. ElScrollbar,
  19373. ElCascaderNode
  19374. },
  19375. props: {
  19376. nodes: {
  19377. type: Array,
  19378. required: true
  19379. },
  19380. index: {
  19381. type: Number,
  19382. required: true
  19383. }
  19384. },
  19385. setup(props) {
  19386. const instance = vue.getCurrentInstance();
  19387. const ns = useNamespace("cascader-menu");
  19388. const { t } = useLocale();
  19389. const id = generateId();
  19390. let activeNode = null;
  19391. let hoverTimer = null;
  19392. const panel = vue.inject(CASCADER_PANEL_INJECTION_KEY);
  19393. const hoverZone = vue.ref(null);
  19394. const isEmpty = vue.computed(() => !props.nodes.length);
  19395. const isLoading = vue.computed(() => !panel.initialLoaded);
  19396. const menuId = vue.computed(() => `cascader-menu-${id}-${props.index}`);
  19397. const handleExpand = (e) => {
  19398. activeNode = e.target;
  19399. };
  19400. const handleMouseMove = (e) => {
  19401. if (!panel.isHoverMenu || !activeNode || !hoverZone.value)
  19402. return;
  19403. if (activeNode.contains(e.target)) {
  19404. clearHoverTimer();
  19405. const el = instance.vnode.el;
  19406. const { left } = el.getBoundingClientRect();
  19407. const { offsetWidth, offsetHeight } = el;
  19408. const startX = e.clientX - left;
  19409. const top = activeNode.offsetTop;
  19410. const bottom = top + activeNode.offsetHeight;
  19411. hoverZone.value.innerHTML = `
  19412. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${top} L${offsetWidth} 0 V${top} Z" />
  19413. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${bottom} L${offsetWidth} ${offsetHeight} V${bottom} Z" />
  19414. `;
  19415. } else if (!hoverTimer) {
  19416. hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
  19417. }
  19418. };
  19419. const clearHoverTimer = () => {
  19420. if (!hoverTimer)
  19421. return;
  19422. clearTimeout(hoverTimer);
  19423. hoverTimer = null;
  19424. };
  19425. const clearHoverZone = () => {
  19426. if (!hoverZone.value)
  19427. return;
  19428. hoverZone.value.innerHTML = "";
  19429. clearHoverTimer();
  19430. };
  19431. return {
  19432. ns,
  19433. panel,
  19434. hoverZone,
  19435. isEmpty,
  19436. isLoading,
  19437. menuId,
  19438. t,
  19439. handleExpand,
  19440. handleMouseMove,
  19441. clearHoverZone
  19442. };
  19443. }
  19444. });
  19445. function _sfc_render$w(_ctx, _cache, $props, $setup, $data, $options) {
  19446. const _component_el_cascader_node = vue.resolveComponent("el-cascader-node");
  19447. const _component_loading = vue.resolveComponent("loading");
  19448. const _component_el_icon = vue.resolveComponent("el-icon");
  19449. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  19450. return vue.openBlock(), vue.createBlock(_component_el_scrollbar, {
  19451. key: _ctx.menuId,
  19452. tag: "ul",
  19453. role: "menu",
  19454. class: vue.normalizeClass(_ctx.ns.b()),
  19455. "wrap-class": _ctx.ns.e("wrap"),
  19456. "view-class": [_ctx.ns.e("list"), _ctx.ns.is("empty", _ctx.isEmpty)],
  19457. onMousemove: _ctx.handleMouseMove,
  19458. onMouseleave: _ctx.clearHoverZone
  19459. }, {
  19460. default: vue.withCtx(() => {
  19461. var _a;
  19462. return [
  19463. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.nodes, (node) => {
  19464. return vue.openBlock(), vue.createBlock(_component_el_cascader_node, {
  19465. key: node.uid,
  19466. node,
  19467. "menu-id": _ctx.menuId,
  19468. onExpand: _ctx.handleExpand
  19469. }, null, 8, ["node", "menu-id", "onExpand"]);
  19470. }), 128)),
  19471. _ctx.isLoading ? (vue.openBlock(), vue.createElementBlock("div", {
  19472. key: 0,
  19473. class: vue.normalizeClass(_ctx.ns.e("empty-text"))
  19474. }, [
  19475. vue.createVNode(_component_el_icon, {
  19476. size: "14",
  19477. class: vue.normalizeClass(_ctx.ns.is("loading"))
  19478. }, {
  19479. default: vue.withCtx(() => [
  19480. vue.createVNode(_component_loading)
  19481. ]),
  19482. _: 1
  19483. }, 8, ["class"]),
  19484. vue.createTextVNode(" " + vue.toDisplayString(_ctx.t("el.cascader.loading")), 1)
  19485. ], 2)) : _ctx.isEmpty ? (vue.openBlock(), vue.createElementBlock("div", {
  19486. key: 1,
  19487. class: vue.normalizeClass(_ctx.ns.e("empty-text"))
  19488. }, vue.toDisplayString(_ctx.t("el.cascader.noData")), 3)) : ((_a = _ctx.panel) == null ? void 0 : _a.isHoverMenu) ? (vue.openBlock(), vue.createElementBlock("svg", {
  19489. key: 2,
  19490. ref: "hoverZone",
  19491. class: vue.normalizeClass(_ctx.ns.e("hover-zone"))
  19492. }, null, 2)) : vue.createCommentVNode("v-if", true)
  19493. ];
  19494. }),
  19495. _: 1
  19496. }, 8, ["class", "wrap-class", "view-class", "onMousemove", "onMouseleave"]);
  19497. }
  19498. var ElCascaderMenu = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["render", _sfc_render$w], ["__file", "menu.vue"]]);
  19499. let uid = 0;
  19500. const calculatePathNodes = (node) => {
  19501. const nodes = [node];
  19502. let { parent } = node;
  19503. while (parent) {
  19504. nodes.unshift(parent);
  19505. parent = parent.parent;
  19506. }
  19507. return nodes;
  19508. };
  19509. class Node$2 {
  19510. constructor(data, config, parent, root = false) {
  19511. this.data = data;
  19512. this.config = config;
  19513. this.parent = parent;
  19514. this.root = root;
  19515. this.uid = uid++;
  19516. this.checked = false;
  19517. this.indeterminate = false;
  19518. this.loading = false;
  19519. const { value: valueKey, label: labelKey, children: childrenKey } = config;
  19520. const childrenData = data[childrenKey];
  19521. const pathNodes = calculatePathNodes(this);
  19522. this.level = root ? 0 : parent ? parent.level + 1 : 1;
  19523. this.value = data[valueKey];
  19524. this.label = data[labelKey];
  19525. this.pathNodes = pathNodes;
  19526. this.pathValues = pathNodes.map((node) => node.value);
  19527. this.pathLabels = pathNodes.map((node) => node.label);
  19528. this.childrenData = childrenData;
  19529. this.children = (childrenData || []).map((child) => new Node$2(child, config, this));
  19530. this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
  19531. }
  19532. get isDisabled() {
  19533. const { data, parent, config } = this;
  19534. const { disabled, checkStrictly } = config;
  19535. const isDisabled = isFunction(disabled) ? disabled(data, this) : !!data[disabled];
  19536. return isDisabled || !checkStrictly && (parent == null ? void 0 : parent.isDisabled);
  19537. }
  19538. get isLeaf() {
  19539. const { data, config, childrenData, loaded } = this;
  19540. const { lazy, leaf } = config;
  19541. const isLeaf = isFunction(leaf) ? leaf(data, this) : data[leaf];
  19542. return isUndefined(isLeaf) ? lazy && !loaded ? false : !(Array.isArray(childrenData) && childrenData.length) : !!isLeaf;
  19543. }
  19544. get valueByOption() {
  19545. return this.config.emitPath ? this.pathValues : this.value;
  19546. }
  19547. appendChild(childData) {
  19548. const { childrenData, children } = this;
  19549. const node = new Node$2(childData, this.config, this);
  19550. if (Array.isArray(childrenData)) {
  19551. childrenData.push(childData);
  19552. } else {
  19553. this.childrenData = [childData];
  19554. }
  19555. children.push(node);
  19556. return node;
  19557. }
  19558. calcText(allLevels, separator) {
  19559. const text = allLevels ? this.pathLabels.join(separator) : this.label;
  19560. this.text = text;
  19561. return text;
  19562. }
  19563. broadcast(event, ...args) {
  19564. const handlerName = `onParent${capitalize(event)}`;
  19565. this.children.forEach((child) => {
  19566. if (child) {
  19567. child.broadcast(event, ...args);
  19568. child[handlerName] && child[handlerName](...args);
  19569. }
  19570. });
  19571. }
  19572. emit(event, ...args) {
  19573. const { parent } = this;
  19574. const handlerName = `onChild${capitalize(event)}`;
  19575. if (parent) {
  19576. parent[handlerName] && parent[handlerName](...args);
  19577. parent.emit(event, ...args);
  19578. }
  19579. }
  19580. onParentCheck(checked) {
  19581. if (!this.isDisabled) {
  19582. this.setCheckState(checked);
  19583. }
  19584. }
  19585. onChildCheck() {
  19586. const { children } = this;
  19587. const validChildren = children.filter((child) => !child.isDisabled);
  19588. const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
  19589. this.setCheckState(checked);
  19590. }
  19591. setCheckState(checked) {
  19592. const totalNum = this.children.length;
  19593. const checkedNum = this.children.reduce((c, p) => {
  19594. const num = p.checked ? 1 : p.indeterminate ? 0.5 : 0;
  19595. return c + num;
  19596. }, 0);
  19597. this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
  19598. this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
  19599. }
  19600. doCheck(checked) {
  19601. if (this.checked === checked)
  19602. return;
  19603. const { checkStrictly, multiple } = this.config;
  19604. if (checkStrictly || !multiple) {
  19605. this.checked = checked;
  19606. } else {
  19607. this.broadcast("check", checked);
  19608. this.setCheckState(checked);
  19609. this.emit("check");
  19610. }
  19611. }
  19612. }
  19613. var Node$3 = Node$2;
  19614. const flatNodes = (nodes, leafOnly) => {
  19615. return nodes.reduce((res, node) => {
  19616. if (node.isLeaf) {
  19617. res.push(node);
  19618. } else {
  19619. !leafOnly && res.push(node);
  19620. res = res.concat(flatNodes(node.children, leafOnly));
  19621. }
  19622. return res;
  19623. }, []);
  19624. };
  19625. class Store {
  19626. constructor(data, config) {
  19627. this.config = config;
  19628. const nodes = (data || []).map((nodeData) => new Node$3(nodeData, this.config));
  19629. this.nodes = nodes;
  19630. this.allNodes = flatNodes(nodes, false);
  19631. this.leafNodes = flatNodes(nodes, true);
  19632. }
  19633. getNodes() {
  19634. return this.nodes;
  19635. }
  19636. getFlattedNodes(leafOnly) {
  19637. return leafOnly ? this.leafNodes : this.allNodes;
  19638. }
  19639. appendNode(nodeData, parentNode) {
  19640. const node = parentNode ? parentNode.appendChild(nodeData) : new Node$3(nodeData, this.config);
  19641. if (!parentNode)
  19642. this.nodes.push(node);
  19643. this.allNodes.push(node);
  19644. node.isLeaf && this.leafNodes.push(node);
  19645. }
  19646. appendNodes(nodeDataList, parentNode) {
  19647. nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode));
  19648. }
  19649. getNodeByValue(value, leafOnly = false) {
  19650. if (!value && value !== 0)
  19651. return null;
  19652. const node = this.getFlattedNodes(leafOnly).find((node2) => isEqual$1(node2.value, value) || isEqual$1(node2.pathValues, value));
  19653. return node || null;
  19654. }
  19655. getSameNode(node) {
  19656. if (!node)
  19657. return null;
  19658. const node_ = this.getFlattedNodes(false).find(({ value, level }) => isEqual$1(node.value, value) && node.level === level);
  19659. return node_ || null;
  19660. }
  19661. }
  19662. const CommonProps = {
  19663. modelValue: [Number, String, Array],
  19664. options: {
  19665. type: Array,
  19666. default: () => []
  19667. },
  19668. props: {
  19669. type: Object,
  19670. default: () => ({})
  19671. }
  19672. };
  19673. const DefaultProps = {
  19674. expandTrigger: "click",
  19675. multiple: false,
  19676. checkStrictly: false,
  19677. emitPath: true,
  19678. lazy: false,
  19679. lazyLoad: NOOP,
  19680. value: "value",
  19681. label: "label",
  19682. children: "children",
  19683. leaf: "leaf",
  19684. disabled: "disabled",
  19685. hoverThreshold: 500
  19686. };
  19687. const useCascaderConfig = (props) => {
  19688. return vue.computed(() => ({
  19689. ...DefaultProps,
  19690. ...props.props
  19691. }));
  19692. };
  19693. const getMenuIndex = (el) => {
  19694. if (!el)
  19695. return 0;
  19696. const pieces = el.id.split("-");
  19697. return Number(pieces[pieces.length - 2]);
  19698. };
  19699. const checkNode = (el) => {
  19700. if (!el)
  19701. return;
  19702. const input = el.querySelector("input");
  19703. if (input) {
  19704. input.click();
  19705. } else if (isLeaf(el)) {
  19706. el.click();
  19707. }
  19708. };
  19709. const sortByOriginalOrder = (oldNodes, newNodes) => {
  19710. const newNodesCopy = newNodes.slice(0);
  19711. const newIds = newNodesCopy.map((node) => node.uid);
  19712. const res = oldNodes.reduce((acc, item) => {
  19713. const index = newIds.indexOf(item.uid);
  19714. if (index > -1) {
  19715. acc.push(item);
  19716. newNodesCopy.splice(index, 1);
  19717. newIds.splice(index, 1);
  19718. }
  19719. return acc;
  19720. }, []);
  19721. res.push(...newNodesCopy);
  19722. return res;
  19723. };
  19724. const _sfc_main$1F = vue.defineComponent({
  19725. name: "ElCascaderPanel",
  19726. components: {
  19727. ElCascaderMenu
  19728. },
  19729. props: {
  19730. ...CommonProps,
  19731. border: {
  19732. type: Boolean,
  19733. default: true
  19734. },
  19735. renderLabel: Function
  19736. },
  19737. emits: [UPDATE_MODEL_EVENT, CHANGE_EVENT, "close", "expand-change"],
  19738. setup(props, { emit, slots }) {
  19739. let manualChecked = false;
  19740. const ns = useNamespace("cascader");
  19741. const config = useCascaderConfig(props);
  19742. let store = null;
  19743. const initialLoaded = vue.ref(true);
  19744. const menuList = vue.ref([]);
  19745. const checkedValue = vue.ref(null);
  19746. const menus = vue.ref([]);
  19747. const expandingNode = vue.ref(null);
  19748. const checkedNodes = vue.ref([]);
  19749. const isHoverMenu = vue.computed(() => config.value.expandTrigger === "hover");
  19750. const renderLabelFn = vue.computed(() => props.renderLabel || slots.default);
  19751. const initStore = () => {
  19752. const { options } = props;
  19753. const cfg = config.value;
  19754. manualChecked = false;
  19755. store = new Store(options, cfg);
  19756. menus.value = [store.getNodes()];
  19757. if (cfg.lazy && isEmpty(props.options)) {
  19758. initialLoaded.value = false;
  19759. lazyLoad(void 0, (list) => {
  19760. if (list) {
  19761. store = new Store(list, cfg);
  19762. menus.value = [store.getNodes()];
  19763. }
  19764. initialLoaded.value = true;
  19765. syncCheckedValue(false, true);
  19766. });
  19767. } else {
  19768. syncCheckedValue(false, true);
  19769. }
  19770. };
  19771. const lazyLoad = (node, cb) => {
  19772. const cfg = config.value;
  19773. node = node || new Node$3({}, cfg, void 0, true);
  19774. node.loading = true;
  19775. const resolve = (dataList) => {
  19776. const _node = node;
  19777. const parent = _node.root ? null : _node;
  19778. dataList && (store == null ? void 0 : store.appendNodes(dataList, parent));
  19779. _node.loading = false;
  19780. _node.loaded = true;
  19781. _node.childrenData = _node.childrenData || [];
  19782. cb && cb(dataList);
  19783. };
  19784. cfg.lazyLoad(node, resolve);
  19785. };
  19786. const expandNode = (node, silent) => {
  19787. var _a;
  19788. const { level } = node;
  19789. const newMenus = menus.value.slice(0, level);
  19790. let newExpandingNode;
  19791. if (node.isLeaf) {
  19792. newExpandingNode = node.pathNodes[level - 2];
  19793. } else {
  19794. newExpandingNode = node;
  19795. newMenus.push(node.children);
  19796. }
  19797. if (((_a = expandingNode.value) == null ? void 0 : _a.uid) !== (newExpandingNode == null ? void 0 : newExpandingNode.uid)) {
  19798. expandingNode.value = node;
  19799. menus.value = newMenus;
  19800. !silent && emit("expand-change", (node == null ? void 0 : node.pathValues) || []);
  19801. }
  19802. };
  19803. const handleCheckChange = (node, checked, emitClose = true) => {
  19804. const { checkStrictly, multiple } = config.value;
  19805. const oldNode = checkedNodes.value[0];
  19806. manualChecked = true;
  19807. !multiple && (oldNode == null ? void 0 : oldNode.doCheck(false));
  19808. node.doCheck(checked);
  19809. calculateCheckedValue();
  19810. emitClose && !multiple && !checkStrictly && emit("close");
  19811. !emitClose && !multiple && !checkStrictly && expandParentNode(node);
  19812. };
  19813. const expandParentNode = (node) => {
  19814. if (!node)
  19815. return;
  19816. node = node.parent;
  19817. expandParentNode(node);
  19818. node && expandNode(node);
  19819. };
  19820. const getFlattedNodes = (leafOnly) => {
  19821. return store == null ? void 0 : store.getFlattedNodes(leafOnly);
  19822. };
  19823. const getCheckedNodes = (leafOnly) => {
  19824. var _a;
  19825. return (_a = getFlattedNodes(leafOnly)) == null ? void 0 : _a.filter((node) => node.checked !== false);
  19826. };
  19827. const clearCheckedNodes = () => {
  19828. checkedNodes.value.forEach((node) => node.doCheck(false));
  19829. calculateCheckedValue();
  19830. };
  19831. const calculateCheckedValue = () => {
  19832. var _a;
  19833. const { checkStrictly, multiple } = config.value;
  19834. const oldNodes = checkedNodes.value;
  19835. const newNodes = getCheckedNodes(!checkStrictly);
  19836. const nodes = sortByOriginalOrder(oldNodes, newNodes);
  19837. const values = nodes.map((node) => node.valueByOption);
  19838. checkedNodes.value = nodes;
  19839. checkedValue.value = multiple ? values : (_a = values[0]) != null ? _a : null;
  19840. };
  19841. const syncCheckedValue = (loaded = false, forced = false) => {
  19842. const { modelValue } = props;
  19843. const { lazy, multiple, checkStrictly } = config.value;
  19844. const leafOnly = !checkStrictly;
  19845. if (!initialLoaded.value || manualChecked || !forced && isEqual$1(modelValue, checkedValue.value))
  19846. return;
  19847. if (lazy && !loaded) {
  19848. const values = unique(flattenDeep(castArray(modelValue)));
  19849. const nodes = values.map((val) => store == null ? void 0 : store.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
  19850. if (nodes.length) {
  19851. nodes.forEach((node) => {
  19852. lazyLoad(node, () => syncCheckedValue(false, forced));
  19853. });
  19854. } else {
  19855. syncCheckedValue(true, forced);
  19856. }
  19857. } else {
  19858. const values = multiple ? castArray(modelValue) : [modelValue];
  19859. const nodes = unique(values.map((val) => store == null ? void 0 : store.getNodeByValue(val, leafOnly)));
  19860. syncMenuState(nodes, forced);
  19861. checkedValue.value = cloneDeep(modelValue);
  19862. }
  19863. };
  19864. const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
  19865. const { checkStrictly } = config.value;
  19866. const oldNodes = checkedNodes.value;
  19867. const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf));
  19868. const oldExpandingNode = store == null ? void 0 : store.getSameNode(expandingNode.value);
  19869. const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
  19870. if (newExpandingNode) {
  19871. newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
  19872. } else {
  19873. expandingNode.value = null;
  19874. }
  19875. oldNodes.forEach((node) => node.doCheck(false));
  19876. newNodes.forEach((node) => node.doCheck(true));
  19877. checkedNodes.value = newNodes;
  19878. vue.nextTick(scrollToExpandingNode);
  19879. };
  19880. const scrollToExpandingNode = () => {
  19881. if (!isClient)
  19882. return;
  19883. menuList.value.forEach((menu) => {
  19884. const menuElement = menu == null ? void 0 : menu.$el;
  19885. if (menuElement) {
  19886. const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  19887. const activeNode = menuElement.querySelector(`.${ns.b("node")}.${ns.is("active")}`) || menuElement.querySelector(`.${ns.b("node")}.in-active-path`);
  19888. scrollIntoView(container, activeNode);
  19889. }
  19890. });
  19891. };
  19892. const handleKeyDown = (e) => {
  19893. const target = e.target;
  19894. const { code } = e;
  19895. switch (code) {
  19896. case EVENT_CODE.up:
  19897. case EVENT_CODE.down: {
  19898. e.preventDefault();
  19899. const distance = code === EVENT_CODE.up ? -1 : 1;
  19900. focusNode(getSibling(target, distance, `.${ns.b("node")}[tabindex="-1"]`));
  19901. break;
  19902. }
  19903. case EVENT_CODE.left: {
  19904. e.preventDefault();
  19905. const preMenu = menuList.value[getMenuIndex(target) - 1];
  19906. const expandedNode = preMenu == null ? void 0 : preMenu.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
  19907. focusNode(expandedNode);
  19908. break;
  19909. }
  19910. case EVENT_CODE.right: {
  19911. e.preventDefault();
  19912. const nextMenu = menuList.value[getMenuIndex(target) + 1];
  19913. const firstNode = nextMenu == null ? void 0 : nextMenu.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
  19914. focusNode(firstNode);
  19915. break;
  19916. }
  19917. case EVENT_CODE.enter:
  19918. checkNode(target);
  19919. break;
  19920. }
  19921. };
  19922. vue.provide(CASCADER_PANEL_INJECTION_KEY, vue.reactive({
  19923. config,
  19924. expandingNode,
  19925. checkedNodes,
  19926. isHoverMenu,
  19927. initialLoaded,
  19928. renderLabelFn,
  19929. lazyLoad,
  19930. expandNode,
  19931. handleCheckChange
  19932. }));
  19933. vue.watch([config, () => props.options], initStore, {
  19934. deep: true,
  19935. immediate: true
  19936. });
  19937. vue.watch(() => props.modelValue, () => {
  19938. manualChecked = false;
  19939. syncCheckedValue();
  19940. }, {
  19941. deep: true
  19942. });
  19943. vue.watch(() => checkedValue.value, (val) => {
  19944. if (!isEqual$1(val, props.modelValue)) {
  19945. emit(UPDATE_MODEL_EVENT, val);
  19946. emit(CHANGE_EVENT, val);
  19947. }
  19948. });
  19949. vue.onBeforeUpdate(() => menuList.value = []);
  19950. vue.onMounted(() => !isEmpty(props.modelValue) && syncCheckedValue());
  19951. return {
  19952. ns,
  19953. menuList,
  19954. menus,
  19955. checkedNodes,
  19956. handleKeyDown,
  19957. handleCheckChange,
  19958. getFlattedNodes,
  19959. getCheckedNodes,
  19960. clearCheckedNodes,
  19961. calculateCheckedValue,
  19962. scrollToExpandingNode
  19963. };
  19964. }
  19965. });
  19966. function _sfc_render$v(_ctx, _cache, $props, $setup, $data, $options) {
  19967. const _component_el_cascader_menu = vue.resolveComponent("el-cascader-menu");
  19968. return vue.openBlock(), vue.createElementBlock("div", {
  19969. class: vue.normalizeClass([_ctx.ns.b("panel"), _ctx.ns.is("bordered", _ctx.border)]),
  19970. onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleKeyDown && _ctx.handleKeyDown(...args))
  19971. }, [
  19972. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menus, (menu, index) => {
  19973. return vue.openBlock(), vue.createBlock(_component_el_cascader_menu, {
  19974. key: index,
  19975. ref_for: true,
  19976. ref: (item) => _ctx.menuList[index] = item,
  19977. index,
  19978. nodes: [...menu]
  19979. }, null, 8, ["index", "nodes"]);
  19980. }), 128))
  19981. ], 34);
  19982. }
  19983. var CascaderPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$v], ["__file", "index.vue"]]);
  19984. CascaderPanel.install = (app) => {
  19985. app.component(CascaderPanel.name, CascaderPanel);
  19986. };
  19987. const _CascaderPanel = CascaderPanel;
  19988. const ElCascaderPanel = _CascaderPanel;
  19989. const tagProps = buildProps({
  19990. closable: Boolean,
  19991. type: {
  19992. type: String,
  19993. values: ["success", "info", "warning", "danger", ""],
  19994. default: ""
  19995. },
  19996. hit: Boolean,
  19997. disableTransitions: Boolean,
  19998. color: {
  19999. type: String,
  20000. default: ""
  20001. },
  20002. size: {
  20003. type: String,
  20004. values: componentSizes,
  20005. default: ""
  20006. },
  20007. effect: {
  20008. type: String,
  20009. values: ["dark", "light", "plain"],
  20010. default: "light"
  20011. },
  20012. round: Boolean
  20013. });
  20014. const tagEmits = {
  20015. close: (evt) => evt instanceof MouseEvent,
  20016. click: (evt) => evt instanceof MouseEvent
  20017. };
  20018. const __default__$12 = vue.defineComponent({
  20019. name: "ElTag"
  20020. });
  20021. const _sfc_main$1E = /* @__PURE__ */ vue.defineComponent({
  20022. ...__default__$12,
  20023. props: tagProps,
  20024. emits: tagEmits,
  20025. setup(__props, { emit }) {
  20026. const props = __props;
  20027. const tagSize = useSize();
  20028. const ns = useNamespace("tag");
  20029. const classes = vue.computed(() => {
  20030. const { type, hit, effect, closable, round } = props;
  20031. return [
  20032. ns.b(),
  20033. ns.is("closable", closable),
  20034. ns.m(type),
  20035. ns.m(tagSize.value),
  20036. ns.m(effect),
  20037. ns.is("hit", hit),
  20038. ns.is("round", round)
  20039. ];
  20040. });
  20041. const handleClose = (event) => {
  20042. emit("close", event);
  20043. };
  20044. const handleClick = (event) => {
  20045. emit("click", event);
  20046. };
  20047. return (_ctx, _cache) => {
  20048. return _ctx.disableTransitions ? (vue.openBlock(), vue.createElementBlock("span", {
  20049. key: 0,
  20050. class: vue.normalizeClass(vue.unref(classes)),
  20051. style: vue.normalizeStyle({ backgroundColor: _ctx.color }),
  20052. onClick: handleClick
  20053. }, [
  20054. vue.createElementVNode("span", {
  20055. class: vue.normalizeClass(vue.unref(ns).e("content"))
  20056. }, [
  20057. vue.renderSlot(_ctx.$slots, "default")
  20058. ], 2),
  20059. _ctx.closable ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  20060. key: 0,
  20061. class: vue.normalizeClass(vue.unref(ns).e("close")),
  20062. onClick: vue.withModifiers(handleClose, ["stop"])
  20063. }, {
  20064. default: vue.withCtx(() => [
  20065. vue.createVNode(vue.unref(close_default))
  20066. ]),
  20067. _: 1
  20068. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  20069. ], 6)) : (vue.openBlock(), vue.createBlock(vue.Transition, {
  20070. key: 1,
  20071. name: `${vue.unref(ns).namespace.value}-zoom-in-center`,
  20072. appear: ""
  20073. }, {
  20074. default: vue.withCtx(() => [
  20075. vue.createElementVNode("span", {
  20076. class: vue.normalizeClass(vue.unref(classes)),
  20077. style: vue.normalizeStyle({ backgroundColor: _ctx.color }),
  20078. onClick: handleClick
  20079. }, [
  20080. vue.createElementVNode("span", {
  20081. class: vue.normalizeClass(vue.unref(ns).e("content"))
  20082. }, [
  20083. vue.renderSlot(_ctx.$slots, "default")
  20084. ], 2),
  20085. _ctx.closable ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  20086. key: 0,
  20087. class: vue.normalizeClass(vue.unref(ns).e("close")),
  20088. onClick: vue.withModifiers(handleClose, ["stop"])
  20089. }, {
  20090. default: vue.withCtx(() => [
  20091. vue.createVNode(vue.unref(close_default))
  20092. ]),
  20093. _: 1
  20094. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  20095. ], 6)
  20096. ]),
  20097. _: 3
  20098. }, 8, ["name"]));
  20099. };
  20100. }
  20101. });
  20102. var Tag = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["__file", "tag.vue"]]);
  20103. const ElTag = withInstall(Tag);
  20104. const popperOptions = {
  20105. modifiers: [
  20106. {
  20107. name: "arrowPosition",
  20108. enabled: true,
  20109. phase: "main",
  20110. fn: ({ state }) => {
  20111. const { modifiersData, placement } = state;
  20112. if (["right", "left", "bottom", "top"].includes(placement))
  20113. return;
  20114. modifiersData.arrow.x = 35;
  20115. },
  20116. requires: ["arrow"]
  20117. }
  20118. ]
  20119. };
  20120. const COMPONENT_NAME$f = "ElCascader";
  20121. const _sfc_main$1D = vue.defineComponent({
  20122. name: COMPONENT_NAME$f,
  20123. components: {
  20124. ElCascaderPanel: _CascaderPanel,
  20125. ElInput,
  20126. ElTooltip,
  20127. ElScrollbar,
  20128. ElTag,
  20129. ElIcon,
  20130. CircleClose: circle_close_default,
  20131. Check: check_default,
  20132. ArrowDown: arrow_down_default
  20133. },
  20134. directives: {
  20135. Clickoutside: ClickOutside
  20136. },
  20137. props: {
  20138. ...CommonProps,
  20139. size: {
  20140. type: String,
  20141. validator: isValidComponentSize
  20142. },
  20143. placeholder: {
  20144. type: String
  20145. },
  20146. disabled: Boolean,
  20147. clearable: Boolean,
  20148. filterable: Boolean,
  20149. filterMethod: {
  20150. type: Function,
  20151. default: (node, keyword) => node.text.includes(keyword)
  20152. },
  20153. separator: {
  20154. type: String,
  20155. default: " / "
  20156. },
  20157. showAllLevels: {
  20158. type: Boolean,
  20159. default: true
  20160. },
  20161. collapseTags: Boolean,
  20162. collapseTagsTooltip: {
  20163. type: Boolean,
  20164. default: false
  20165. },
  20166. debounce: {
  20167. type: Number,
  20168. default: 300
  20169. },
  20170. beforeFilter: {
  20171. type: Function,
  20172. default: () => true
  20173. },
  20174. popperClass: {
  20175. type: String,
  20176. default: ""
  20177. },
  20178. teleported: useTooltipContentProps.teleported,
  20179. tagType: { ...tagProps.type, default: "info" },
  20180. validateEvent: {
  20181. type: Boolean,
  20182. default: true
  20183. }
  20184. },
  20185. emits: [
  20186. UPDATE_MODEL_EVENT,
  20187. CHANGE_EVENT,
  20188. "focus",
  20189. "blur",
  20190. "visible-change",
  20191. "expand-change",
  20192. "remove-tag"
  20193. ],
  20194. setup(props, { emit }) {
  20195. let inputInitialHeight = 0;
  20196. let pressDeleteCount = 0;
  20197. const nsCascader = useNamespace("cascader");
  20198. const nsInput = useNamespace("input");
  20199. const { t } = useLocale();
  20200. const { form, formItem } = useFormItem();
  20201. const tooltipRef = vue.ref(null);
  20202. const input = vue.ref(null);
  20203. const tagWrapper = vue.ref(null);
  20204. const panel = vue.ref(null);
  20205. const suggestionPanel = vue.ref(null);
  20206. const popperVisible = vue.ref(false);
  20207. const inputHover = vue.ref(false);
  20208. const filtering = vue.ref(false);
  20209. const inputValue = vue.ref("");
  20210. const searchInputValue = vue.ref("");
  20211. const presentTags = vue.ref([]);
  20212. const allPresentTags = vue.ref([]);
  20213. const suggestions = vue.ref([]);
  20214. const isOnComposition = vue.ref(false);
  20215. const isDisabled = vue.computed(() => props.disabled || (form == null ? void 0 : form.disabled));
  20216. const inputPlaceholder = vue.computed(() => props.placeholder || t("el.cascader.placeholder"));
  20217. const currentPlaceholder = vue.computed(() => searchInputValue.value || presentTags.value.length > 0 ? "" : inputPlaceholder.value);
  20218. const realSize = useSize();
  20219. const tagSize = vue.computed(() => ["small"].includes(realSize.value) ? "small" : "default");
  20220. const multiple = vue.computed(() => !!props.props.multiple);
  20221. const readonly = vue.computed(() => !props.filterable || multiple.value);
  20222. const searchKeyword = vue.computed(() => multiple.value ? searchInputValue.value : inputValue.value);
  20223. const checkedNodes = vue.computed(() => {
  20224. var _a;
  20225. return ((_a = panel.value) == null ? void 0 : _a.checkedNodes) || [];
  20226. });
  20227. const clearBtnVisible = vue.computed(() => {
  20228. if (!props.clearable || isDisabled.value || filtering.value || !inputHover.value)
  20229. return false;
  20230. return !!checkedNodes.value.length;
  20231. });
  20232. const presentText = vue.computed(() => {
  20233. const { showAllLevels, separator } = props;
  20234. const nodes = checkedNodes.value;
  20235. return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
  20236. });
  20237. const checkedValue = vue.computed({
  20238. get() {
  20239. return cloneDeep(props.modelValue);
  20240. },
  20241. set(val) {
  20242. emit(UPDATE_MODEL_EVENT, val);
  20243. emit(CHANGE_EVENT, val);
  20244. if (props.validateEvent) {
  20245. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  20246. }
  20247. }
  20248. });
  20249. const popperPaneRef = vue.computed(() => {
  20250. var _a, _b;
  20251. return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  20252. });
  20253. const togglePopperVisible = (visible) => {
  20254. var _a, _b, _c;
  20255. if (isDisabled.value)
  20256. return;
  20257. visible = visible != null ? visible : !popperVisible.value;
  20258. if (visible !== popperVisible.value) {
  20259. popperVisible.value = visible;
  20260. (_b = (_a = input.value) == null ? void 0 : _a.input) == null ? void 0 : _b.setAttribute("aria-expanded", `${visible}`);
  20261. if (visible) {
  20262. updatePopperPosition();
  20263. vue.nextTick((_c = panel.value) == null ? void 0 : _c.scrollToExpandingNode);
  20264. } else if (props.filterable) {
  20265. syncPresentTextValue();
  20266. }
  20267. emit("visible-change", visible);
  20268. }
  20269. };
  20270. const updatePopperPosition = () => {
  20271. vue.nextTick(() => {
  20272. var _a;
  20273. (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper();
  20274. });
  20275. };
  20276. const hideSuggestionPanel = () => {
  20277. filtering.value = false;
  20278. };
  20279. const genTag = (node) => {
  20280. const { showAllLevels, separator } = props;
  20281. return {
  20282. node,
  20283. key: node.uid,
  20284. text: node.calcText(showAllLevels, separator),
  20285. hitState: false,
  20286. closable: !isDisabled.value && !node.isDisabled,
  20287. isCollapseTag: false
  20288. };
  20289. };
  20290. const deleteTag = (tag) => {
  20291. var _a;
  20292. const node = tag.node;
  20293. node.doCheck(false);
  20294. (_a = panel.value) == null ? void 0 : _a.calculateCheckedValue();
  20295. emit("remove-tag", node.valueByOption);
  20296. };
  20297. const calculatePresentTags = () => {
  20298. if (!multiple.value)
  20299. return;
  20300. const nodes = checkedNodes.value;
  20301. const tags = [];
  20302. const allTags = [];
  20303. nodes.forEach((node) => allTags.push(genTag(node)));
  20304. allPresentTags.value = allTags;
  20305. if (nodes.length) {
  20306. const [first, ...rest] = nodes;
  20307. const restCount = rest.length;
  20308. tags.push(genTag(first));
  20309. if (restCount) {
  20310. if (props.collapseTags) {
  20311. tags.push({
  20312. key: -1,
  20313. text: `+ ${restCount}`,
  20314. closable: false,
  20315. isCollapseTag: true
  20316. });
  20317. } else {
  20318. rest.forEach((node) => tags.push(genTag(node)));
  20319. }
  20320. }
  20321. }
  20322. presentTags.value = tags;
  20323. };
  20324. const calculateSuggestions = () => {
  20325. var _a, _b;
  20326. const { filterMethod, showAllLevels, separator } = props;
  20327. const res = (_b = (_a = panel.value) == null ? void 0 : _a.getFlattedNodes(!props.props.checkStrictly)) == null ? void 0 : _b.filter((node) => {
  20328. if (node.isDisabled)
  20329. return false;
  20330. node.calcText(showAllLevels, separator);
  20331. return filterMethod(node, searchKeyword.value);
  20332. });
  20333. if (multiple.value) {
  20334. presentTags.value.forEach((tag) => {
  20335. tag.hitState = false;
  20336. });
  20337. allPresentTags.value.forEach((tag) => {
  20338. tag.hitState = false;
  20339. });
  20340. }
  20341. filtering.value = true;
  20342. suggestions.value = res;
  20343. updatePopperPosition();
  20344. };
  20345. const focusFirstNode = () => {
  20346. var _a;
  20347. let firstNode;
  20348. if (filtering.value && suggestionPanel.value) {
  20349. firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
  20350. } else {
  20351. firstNode = (_a = panel.value) == null ? void 0 : _a.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
  20352. }
  20353. if (firstNode) {
  20354. firstNode.focus();
  20355. !filtering.value && firstNode.click();
  20356. }
  20357. };
  20358. const updateStyle = () => {
  20359. var _a, _b;
  20360. const inputInner = (_a = input.value) == null ? void 0 : _a.input;
  20361. const tagWrapperEl = tagWrapper.value;
  20362. const suggestionPanelEl = (_b = suggestionPanel.value) == null ? void 0 : _b.$el;
  20363. if (!isClient || !inputInner)
  20364. return;
  20365. if (suggestionPanelEl) {
  20366. const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
  20367. suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
  20368. }
  20369. if (tagWrapperEl) {
  20370. const { offsetHeight } = tagWrapperEl;
  20371. const height = presentTags.value.length > 0 ? `${Math.max(offsetHeight + 6, inputInitialHeight)}px` : `${inputInitialHeight}px`;
  20372. inputInner.style.height = height;
  20373. updatePopperPosition();
  20374. }
  20375. };
  20376. const getCheckedNodes = (leafOnly) => {
  20377. var _a;
  20378. return (_a = panel.value) == null ? void 0 : _a.getCheckedNodes(leafOnly);
  20379. };
  20380. const handleExpandChange = (value) => {
  20381. updatePopperPosition();
  20382. emit("expand-change", value);
  20383. };
  20384. const handleComposition = (event) => {
  20385. var _a;
  20386. const text = (_a = event.target) == null ? void 0 : _a.value;
  20387. if (event.type === "compositionend") {
  20388. isOnComposition.value = false;
  20389. vue.nextTick(() => handleInput(text));
  20390. } else {
  20391. const lastCharacter = text[text.length - 1] || "";
  20392. isOnComposition.value = !isKorean(lastCharacter);
  20393. }
  20394. };
  20395. const handleKeyDown = (e) => {
  20396. if (isOnComposition.value)
  20397. return;
  20398. switch (e.code) {
  20399. case EVENT_CODE.enter:
  20400. togglePopperVisible();
  20401. break;
  20402. case EVENT_CODE.down:
  20403. togglePopperVisible(true);
  20404. vue.nextTick(focusFirstNode);
  20405. e.preventDefault();
  20406. break;
  20407. case EVENT_CODE.esc:
  20408. if (popperVisible.value === true) {
  20409. e.preventDefault();
  20410. e.stopPropagation();
  20411. togglePopperVisible(false);
  20412. }
  20413. break;
  20414. case EVENT_CODE.tab:
  20415. togglePopperVisible(false);
  20416. break;
  20417. }
  20418. };
  20419. const handleClear = () => {
  20420. var _a;
  20421. (_a = panel.value) == null ? void 0 : _a.clearCheckedNodes();
  20422. if (!popperVisible.value && props.filterable) {
  20423. syncPresentTextValue();
  20424. }
  20425. togglePopperVisible(false);
  20426. };
  20427. const syncPresentTextValue = () => {
  20428. const { value } = presentText;
  20429. inputValue.value = value;
  20430. searchInputValue.value = value;
  20431. };
  20432. const handleSuggestionClick = (node) => {
  20433. var _a, _b;
  20434. const { checked } = node;
  20435. if (multiple.value) {
  20436. (_a = panel.value) == null ? void 0 : _a.handleCheckChange(node, !checked, false);
  20437. } else {
  20438. !checked && ((_b = panel.value) == null ? void 0 : _b.handleCheckChange(node, true, false));
  20439. togglePopperVisible(false);
  20440. }
  20441. };
  20442. const handleSuggestionKeyDown = (e) => {
  20443. const target = e.target;
  20444. const { code } = e;
  20445. switch (code) {
  20446. case EVENT_CODE.up:
  20447. case EVENT_CODE.down: {
  20448. const distance = code === EVENT_CODE.up ? -1 : 1;
  20449. focusNode(getSibling(target, distance, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
  20450. break;
  20451. }
  20452. case EVENT_CODE.enter:
  20453. target.click();
  20454. break;
  20455. }
  20456. };
  20457. const handleDelete = () => {
  20458. const tags = presentTags.value;
  20459. const lastTag = tags[tags.length - 1];
  20460. pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
  20461. if (!lastTag || !pressDeleteCount || props.collapseTags && tags.length > 1)
  20462. return;
  20463. if (lastTag.hitState) {
  20464. deleteTag(lastTag);
  20465. } else {
  20466. lastTag.hitState = true;
  20467. }
  20468. };
  20469. const handleFilter = debounce(() => {
  20470. const { value } = searchKeyword;
  20471. if (!value)
  20472. return;
  20473. const passed = props.beforeFilter(value);
  20474. if (isPromise(passed)) {
  20475. passed.then(calculateSuggestions).catch(() => {
  20476. });
  20477. } else if (passed !== false) {
  20478. calculateSuggestions();
  20479. } else {
  20480. hideSuggestionPanel();
  20481. }
  20482. }, props.debounce);
  20483. const handleInput = (val, e) => {
  20484. !popperVisible.value && togglePopperVisible(true);
  20485. if (e == null ? void 0 : e.isComposing)
  20486. return;
  20487. val ? handleFilter() : hideSuggestionPanel();
  20488. };
  20489. vue.watch(filtering, updatePopperPosition);
  20490. vue.watch([checkedNodes, isDisabled], calculatePresentTags);
  20491. vue.watch(presentTags, () => {
  20492. vue.nextTick(() => updateStyle());
  20493. });
  20494. vue.watch(presentText, syncPresentTextValue, { immediate: true });
  20495. vue.onMounted(() => {
  20496. const inputInner = input.value.input;
  20497. const inputInnerHeight = Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
  20498. inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
  20499. useResizeObserver(inputInner, updateStyle);
  20500. });
  20501. return {
  20502. popperOptions,
  20503. tooltipRef,
  20504. popperPaneRef,
  20505. input,
  20506. tagWrapper,
  20507. panel,
  20508. suggestionPanel,
  20509. popperVisible,
  20510. inputHover,
  20511. inputPlaceholder,
  20512. currentPlaceholder,
  20513. filtering,
  20514. presentText,
  20515. checkedValue,
  20516. inputValue,
  20517. searchInputValue,
  20518. presentTags,
  20519. allPresentTags,
  20520. suggestions,
  20521. isDisabled,
  20522. isOnComposition,
  20523. realSize,
  20524. tagSize,
  20525. multiple,
  20526. readonly,
  20527. clearBtnVisible,
  20528. nsCascader,
  20529. nsInput,
  20530. t,
  20531. togglePopperVisible,
  20532. hideSuggestionPanel,
  20533. deleteTag,
  20534. focusFirstNode,
  20535. getCheckedNodes,
  20536. handleExpandChange,
  20537. handleKeyDown,
  20538. handleComposition,
  20539. handleClear,
  20540. handleSuggestionClick,
  20541. handleSuggestionKeyDown,
  20542. handleDelete,
  20543. handleInput
  20544. };
  20545. }
  20546. });
  20547. const _hoisted_1$O = { key: 0 };
  20548. const _hoisted_2$w = ["placeholder"];
  20549. const _hoisted_3$h = ["onClick"];
  20550. function _sfc_render$u(_ctx, _cache, $props, $setup, $data, $options) {
  20551. const _component_circle_close = vue.resolveComponent("circle-close");
  20552. const _component_el_icon = vue.resolveComponent("el-icon");
  20553. const _component_arrow_down = vue.resolveComponent("arrow-down");
  20554. const _component_el_input = vue.resolveComponent("el-input");
  20555. const _component_el_tag = vue.resolveComponent("el-tag");
  20556. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  20557. const _component_el_cascader_panel = vue.resolveComponent("el-cascader-panel");
  20558. const _component_check = vue.resolveComponent("check");
  20559. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  20560. const _directive_clickoutside = vue.resolveDirective("clickoutside");
  20561. return vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  20562. ref: "tooltipRef",
  20563. visible: _ctx.popperVisible,
  20564. teleported: _ctx.teleported,
  20565. "popper-class": [_ctx.nsCascader.e("dropdown"), _ctx.popperClass],
  20566. "popper-options": _ctx.popperOptions,
  20567. "fallback-placements": [
  20568. "bottom-start",
  20569. "bottom",
  20570. "top-start",
  20571. "top",
  20572. "right",
  20573. "left"
  20574. ],
  20575. "stop-popper-mouse-event": false,
  20576. "gpu-acceleration": false,
  20577. placement: "bottom-start",
  20578. transition: `${_ctx.nsCascader.namespace.value}-zoom-in-top`,
  20579. effect: "light",
  20580. pure: "",
  20581. persistent: "",
  20582. onHide: _ctx.hideSuggestionPanel
  20583. }, {
  20584. default: vue.withCtx(() => [
  20585. vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  20586. class: vue.normalizeClass([
  20587. _ctx.nsCascader.b(),
  20588. _ctx.nsCascader.m(_ctx.realSize),
  20589. _ctx.nsCascader.is("disabled", _ctx.isDisabled),
  20590. _ctx.$attrs.class
  20591. ]),
  20592. style: vue.normalizeStyle(_ctx.$attrs.style),
  20593. onClick: _cache[11] || (_cache[11] = () => _ctx.togglePopperVisible(_ctx.readonly ? void 0 : true)),
  20594. onKeydown: _cache[12] || (_cache[12] = (...args) => _ctx.handleKeyDown && _ctx.handleKeyDown(...args)),
  20595. onMouseenter: _cache[13] || (_cache[13] = ($event) => _ctx.inputHover = true),
  20596. onMouseleave: _cache[14] || (_cache[14] = ($event) => _ctx.inputHover = false)
  20597. }, [
  20598. vue.createVNode(_component_el_input, {
  20599. ref: "input",
  20600. modelValue: _ctx.inputValue,
  20601. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.inputValue = $event),
  20602. placeholder: _ctx.currentPlaceholder,
  20603. readonly: _ctx.readonly,
  20604. disabled: _ctx.isDisabled,
  20605. "validate-event": false,
  20606. size: _ctx.realSize,
  20607. class: vue.normalizeClass(_ctx.nsCascader.is("focus", _ctx.popperVisible)),
  20608. onCompositionstart: _ctx.handleComposition,
  20609. onCompositionupdate: _ctx.handleComposition,
  20610. onCompositionend: _ctx.handleComposition,
  20611. onFocus: _cache[2] || (_cache[2] = (e) => _ctx.$emit("focus", e)),
  20612. onBlur: _cache[3] || (_cache[3] = (e) => _ctx.$emit("blur", e)),
  20613. onInput: _ctx.handleInput
  20614. }, {
  20615. suffix: vue.withCtx(() => [
  20616. _ctx.clearBtnVisible ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  20617. key: "clear",
  20618. class: vue.normalizeClass([_ctx.nsInput.e("icon"), "icon-circle-close"]),
  20619. onClick: vue.withModifiers(_ctx.handleClear, ["stop"])
  20620. }, {
  20621. default: vue.withCtx(() => [
  20622. vue.createVNode(_component_circle_close)
  20623. ]),
  20624. _: 1
  20625. }, 8, ["class", "onClick"])) : (vue.openBlock(), vue.createBlock(_component_el_icon, {
  20626. key: "arrow-down",
  20627. class: vue.normalizeClass([
  20628. _ctx.nsInput.e("icon"),
  20629. "icon-arrow-down",
  20630. _ctx.nsCascader.is("reverse", _ctx.popperVisible)
  20631. ]),
  20632. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.togglePopperVisible(), ["stop"]))
  20633. }, {
  20634. default: vue.withCtx(() => [
  20635. vue.createVNode(_component_arrow_down)
  20636. ]),
  20637. _: 1
  20638. }, 8, ["class"]))
  20639. ]),
  20640. _: 1
  20641. }, 8, ["modelValue", "placeholder", "readonly", "disabled", "size", "class", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onInput"]),
  20642. _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
  20643. key: 0,
  20644. ref: "tagWrapper",
  20645. class: vue.normalizeClass(_ctx.nsCascader.e("tags"))
  20646. }, [
  20647. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.presentTags, (tag) => {
  20648. return vue.openBlock(), vue.createBlock(_component_el_tag, {
  20649. key: tag.key,
  20650. type: _ctx.tagType,
  20651. size: _ctx.tagSize,
  20652. hit: tag.hitState,
  20653. closable: tag.closable,
  20654. "disable-transitions": "",
  20655. onClose: ($event) => _ctx.deleteTag(tag)
  20656. }, {
  20657. default: vue.withCtx(() => [
  20658. tag.isCollapseTag === false ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$O, vue.toDisplayString(tag.text), 1)) : (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  20659. key: 1,
  20660. disabled: _ctx.popperVisible || !_ctx.collapseTagsTooltip,
  20661. "fallback-placements": ["bottom", "top", "right", "left"],
  20662. placement: "bottom",
  20663. effect: "light"
  20664. }, {
  20665. default: vue.withCtx(() => [
  20666. vue.createElementVNode("span", null, vue.toDisplayString(tag.text), 1)
  20667. ]),
  20668. content: vue.withCtx(() => [
  20669. vue.createElementVNode("div", {
  20670. class: vue.normalizeClass(_ctx.nsCascader.e("collapse-tags"))
  20671. }, [
  20672. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.allPresentTags.slice(1), (tag2, idx) => {
  20673. return vue.openBlock(), vue.createElementBlock("div", {
  20674. key: idx,
  20675. class: vue.normalizeClass(_ctx.nsCascader.e("collapse-tag"))
  20676. }, [
  20677. (vue.openBlock(), vue.createBlock(_component_el_tag, {
  20678. key: tag2.key,
  20679. class: "in-tooltip",
  20680. type: _ctx.tagType,
  20681. size: _ctx.tagSize,
  20682. hit: tag2.hitState,
  20683. closable: tag2.closable,
  20684. "disable-transitions": "",
  20685. onClose: ($event) => _ctx.deleteTag(tag2)
  20686. }, {
  20687. default: vue.withCtx(() => [
  20688. vue.createElementVNode("span", null, vue.toDisplayString(tag2.text), 1)
  20689. ]),
  20690. _: 2
  20691. }, 1032, ["type", "size", "hit", "closable", "onClose"]))
  20692. ], 2);
  20693. }), 128))
  20694. ], 2)
  20695. ]),
  20696. _: 2
  20697. }, 1032, ["disabled"]))
  20698. ]),
  20699. _: 2
  20700. }, 1032, ["type", "size", "hit", "closable", "onClose"]);
  20701. }), 128)),
  20702. _ctx.filterable && !_ctx.isDisabled ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  20703. key: 0,
  20704. "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => _ctx.searchInputValue = $event),
  20705. type: "text",
  20706. class: vue.normalizeClass(_ctx.nsCascader.e("search-input")),
  20707. placeholder: _ctx.presentText ? "" : _ctx.inputPlaceholder,
  20708. onInput: _cache[5] || (_cache[5] = (e) => _ctx.handleInput(_ctx.searchInputValue, e)),
  20709. onClick: _cache[6] || (_cache[6] = vue.withModifiers(($event) => _ctx.togglePopperVisible(true), ["stop"])),
  20710. onKeydown: _cache[7] || (_cache[7] = vue.withKeys((...args) => _ctx.handleDelete && _ctx.handleDelete(...args), ["delete"])),
  20711. onCompositionstart: _cache[8] || (_cache[8] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  20712. onCompositionupdate: _cache[9] || (_cache[9] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  20713. onCompositionend: _cache[10] || (_cache[10] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args))
  20714. }, null, 42, _hoisted_2$w)), [
  20715. [vue.vModelText, _ctx.searchInputValue]
  20716. ]) : vue.createCommentVNode("v-if", true)
  20717. ], 2)) : vue.createCommentVNode("v-if", true)
  20718. ], 38)), [
  20719. [_directive_clickoutside, () => _ctx.togglePopperVisible(false), _ctx.popperPaneRef]
  20720. ])
  20721. ]),
  20722. content: vue.withCtx(() => [
  20723. vue.withDirectives(vue.createVNode(_component_el_cascader_panel, {
  20724. ref: "panel",
  20725. modelValue: _ctx.checkedValue,
  20726. "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.checkedValue = $event),
  20727. options: _ctx.options,
  20728. props: _ctx.props,
  20729. border: false,
  20730. "render-label": _ctx.$slots.default,
  20731. onExpandChange: _ctx.handleExpandChange,
  20732. onClose: _cache[16] || (_cache[16] = ($event) => _ctx.$nextTick(() => _ctx.togglePopperVisible(false)))
  20733. }, null, 8, ["modelValue", "options", "props", "render-label", "onExpandChange"]), [
  20734. [vue.vShow, !_ctx.filtering]
  20735. ]),
  20736. _ctx.filterable ? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_scrollbar, {
  20737. key: 0,
  20738. ref: "suggestionPanel",
  20739. tag: "ul",
  20740. class: vue.normalizeClass(_ctx.nsCascader.e("suggestion-panel")),
  20741. "view-class": _ctx.nsCascader.e("suggestion-list"),
  20742. onKeydown: _ctx.handleSuggestionKeyDown
  20743. }, {
  20744. default: vue.withCtx(() => [
  20745. _ctx.suggestions.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.suggestions, (item) => {
  20746. return vue.openBlock(), vue.createElementBlock("li", {
  20747. key: item.uid,
  20748. class: vue.normalizeClass([
  20749. _ctx.nsCascader.e("suggestion-item"),
  20750. _ctx.nsCascader.is("checked", item.checked)
  20751. ]),
  20752. tabindex: -1,
  20753. onClick: ($event) => _ctx.handleSuggestionClick(item)
  20754. }, [
  20755. vue.createElementVNode("span", null, vue.toDisplayString(item.text), 1),
  20756. item.checked ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
  20757. default: vue.withCtx(() => [
  20758. vue.createVNode(_component_check)
  20759. ]),
  20760. _: 1
  20761. })) : vue.createCommentVNode("v-if", true)
  20762. ], 10, _hoisted_3$h);
  20763. }), 128)) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
  20764. vue.createElementVNode("li", {
  20765. class: vue.normalizeClass(_ctx.nsCascader.e("empty-text"))
  20766. }, vue.toDisplayString(_ctx.t("el.cascader.noMatch")), 3)
  20767. ])
  20768. ]),
  20769. _: 3
  20770. }, 8, ["class", "view-class", "onKeydown"])), [
  20771. [vue.vShow, _ctx.filtering]
  20772. ]) : vue.createCommentVNode("v-if", true)
  20773. ]),
  20774. _: 3
  20775. }, 8, ["visible", "teleported", "popper-class", "popper-options", "transition", "onHide"]);
  20776. }
  20777. var Cascader = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["render", _sfc_render$u], ["__file", "index.vue"]]);
  20778. Cascader.install = (app) => {
  20779. app.component(Cascader.name, Cascader);
  20780. };
  20781. const _Cascader = Cascader;
  20782. const ElCascader = _Cascader;
  20783. const checkTagProps = buildProps({
  20784. checked: {
  20785. type: Boolean,
  20786. default: false
  20787. }
  20788. });
  20789. const checkTagEmits = {
  20790. "update:checked": (value) => isBoolean(value),
  20791. [CHANGE_EVENT]: (value) => isBoolean(value)
  20792. };
  20793. const __default__$11 = vue.defineComponent({
  20794. name: "ElCheckTag"
  20795. });
  20796. const _sfc_main$1C = /* @__PURE__ */ vue.defineComponent({
  20797. ...__default__$11,
  20798. props: checkTagProps,
  20799. emits: checkTagEmits,
  20800. setup(__props, { emit }) {
  20801. const props = __props;
  20802. const ns = useNamespace("check-tag");
  20803. const handleChange = () => {
  20804. const checked = !props.checked;
  20805. emit(CHANGE_EVENT, checked);
  20806. emit("update:checked", checked);
  20807. };
  20808. return (_ctx, _cache) => {
  20809. return vue.openBlock(), vue.createElementBlock("span", {
  20810. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is("checked", _ctx.checked)]),
  20811. onClick: handleChange
  20812. }, [
  20813. vue.renderSlot(_ctx.$slots, "default")
  20814. ], 2);
  20815. };
  20816. }
  20817. });
  20818. var CheckTag = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__file", "check-tag.vue"]]);
  20819. const ElCheckTag = withInstall(CheckTag);
  20820. const colProps = buildProps({
  20821. tag: {
  20822. type: String,
  20823. default: "div"
  20824. },
  20825. span: {
  20826. type: Number,
  20827. default: 24
  20828. },
  20829. offset: {
  20830. type: Number,
  20831. default: 0
  20832. },
  20833. pull: {
  20834. type: Number,
  20835. default: 0
  20836. },
  20837. push: {
  20838. type: Number,
  20839. default: 0
  20840. },
  20841. xs: {
  20842. type: definePropType([Number, Object]),
  20843. default: () => mutable({})
  20844. },
  20845. sm: {
  20846. type: definePropType([Number, Object]),
  20847. default: () => mutable({})
  20848. },
  20849. md: {
  20850. type: definePropType([Number, Object]),
  20851. default: () => mutable({})
  20852. },
  20853. lg: {
  20854. type: definePropType([Number, Object]),
  20855. default: () => mutable({})
  20856. },
  20857. xl: {
  20858. type: definePropType([Number, Object]),
  20859. default: () => mutable({})
  20860. }
  20861. });
  20862. const __default__$10 = vue.defineComponent({
  20863. name: "ElCol"
  20864. });
  20865. const _sfc_main$1B = /* @__PURE__ */ vue.defineComponent({
  20866. ...__default__$10,
  20867. props: colProps,
  20868. setup(__props) {
  20869. const props = __props;
  20870. const { gutter } = vue.inject(rowContextKey, { gutter: vue.computed(() => 0) });
  20871. const ns = useNamespace("col");
  20872. const style = vue.computed(() => {
  20873. const styles = {};
  20874. if (gutter.value) {
  20875. styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
  20876. }
  20877. return styles;
  20878. });
  20879. const colKls = vue.computed(() => {
  20880. const classes = [];
  20881. const pos = ["span", "offset", "pull", "push"];
  20882. pos.forEach((prop) => {
  20883. const size = props[prop];
  20884. if (isNumber(size)) {
  20885. if (prop === "span")
  20886. classes.push(ns.b(`${props[prop]}`));
  20887. else if (size > 0)
  20888. classes.push(ns.b(`${prop}-${props[prop]}`));
  20889. }
  20890. });
  20891. const sizes = ["xs", "sm", "md", "lg", "xl"];
  20892. sizes.forEach((size) => {
  20893. if (isNumber(props[size])) {
  20894. classes.push(ns.b(`${size}-${props[size]}`));
  20895. } else if (isObject$1(props[size])) {
  20896. Object.entries(props[size]).forEach(([prop, sizeProp]) => {
  20897. classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
  20898. });
  20899. }
  20900. });
  20901. if (gutter.value) {
  20902. classes.push(ns.is("guttered"));
  20903. }
  20904. return [ns.b(), classes];
  20905. });
  20906. return (_ctx, _cache) => {
  20907. return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
  20908. class: vue.normalizeClass(vue.unref(colKls)),
  20909. style: vue.normalizeStyle(vue.unref(style))
  20910. }, {
  20911. default: vue.withCtx(() => [
  20912. vue.renderSlot(_ctx.$slots, "default")
  20913. ]),
  20914. _: 3
  20915. }, 8, ["class", "style"]);
  20916. };
  20917. }
  20918. });
  20919. var Col = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["__file", "col.vue"]]);
  20920. const ElCol = withInstall(Col);
  20921. const emitChangeFn = (value) => typeof isNumber(value);
  20922. const collapseProps = buildProps({
  20923. accordion: Boolean,
  20924. modelValue: {
  20925. type: definePropType([Array, String, Number]),
  20926. default: () => mutable([])
  20927. }
  20928. });
  20929. const collapseEmits = {
  20930. [UPDATE_MODEL_EVENT]: emitChangeFn,
  20931. [CHANGE_EVENT]: emitChangeFn
  20932. };
  20933. const useCollapse = (props, emit) => {
  20934. const activeNames = vue.ref(castArray$1(props.modelValue));
  20935. const setActiveNames = (_activeNames) => {
  20936. activeNames.value = _activeNames;
  20937. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  20938. emit(UPDATE_MODEL_EVENT, value);
  20939. emit(CHANGE_EVENT, value);
  20940. };
  20941. const handleItemClick = (name) => {
  20942. if (props.accordion) {
  20943. setActiveNames([activeNames.value[0] === name ? "" : name]);
  20944. } else {
  20945. const _activeNames = [...activeNames.value];
  20946. const index = _activeNames.indexOf(name);
  20947. if (index > -1) {
  20948. _activeNames.splice(index, 1);
  20949. } else {
  20950. _activeNames.push(name);
  20951. }
  20952. setActiveNames(_activeNames);
  20953. }
  20954. };
  20955. vue.watch(() => props.modelValue, () => activeNames.value = castArray$1(props.modelValue), { deep: true });
  20956. vue.provide(collapseContextKey, {
  20957. activeNames,
  20958. handleItemClick
  20959. });
  20960. return {
  20961. activeNames,
  20962. setActiveNames
  20963. };
  20964. };
  20965. const useCollapseDOM = () => {
  20966. const ns = useNamespace("collapse");
  20967. const rootKls = vue.computed(() => ns.b());
  20968. return {
  20969. rootKls
  20970. };
  20971. };
  20972. const __default__$$ = vue.defineComponent({
  20973. name: "ElCollapse"
  20974. });
  20975. const _sfc_main$1A = /* @__PURE__ */ vue.defineComponent({
  20976. ...__default__$$,
  20977. props: collapseProps,
  20978. emits: collapseEmits,
  20979. setup(__props, { expose, emit }) {
  20980. const props = __props;
  20981. const { activeNames, setActiveNames } = useCollapse(props, emit);
  20982. const { rootKls } = useCollapseDOM();
  20983. expose({
  20984. activeNames,
  20985. setActiveNames
  20986. });
  20987. return (_ctx, _cache) => {
  20988. return vue.openBlock(), vue.createElementBlock("div", {
  20989. class: vue.normalizeClass(vue.unref(rootKls)),
  20990. role: "tablist",
  20991. "aria-multiselectable": "true"
  20992. }, [
  20993. vue.renderSlot(_ctx.$slots, "default")
  20994. ], 2);
  20995. };
  20996. }
  20997. });
  20998. var Collapse = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["__file", "collapse.vue"]]);
  20999. const __default__$_ = vue.defineComponent({
  21000. name: "ElCollapseTransition"
  21001. });
  21002. const _sfc_main$1z = /* @__PURE__ */ vue.defineComponent({
  21003. ...__default__$_,
  21004. setup(__props) {
  21005. const ns = useNamespace("collapse-transition");
  21006. const on = {
  21007. beforeEnter(el) {
  21008. if (!el.dataset)
  21009. el.dataset = {};
  21010. el.dataset.oldPaddingTop = el.style.paddingTop;
  21011. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  21012. el.style.maxHeight = 0;
  21013. el.style.paddingTop = 0;
  21014. el.style.paddingBottom = 0;
  21015. },
  21016. enter(el) {
  21017. el.dataset.oldOverflow = el.style.overflow;
  21018. if (el.scrollHeight !== 0) {
  21019. el.style.maxHeight = `${el.scrollHeight}px`;
  21020. el.style.paddingTop = el.dataset.oldPaddingTop;
  21021. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  21022. } else {
  21023. el.style.maxHeight = 0;
  21024. el.style.paddingTop = el.dataset.oldPaddingTop;
  21025. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  21026. }
  21027. el.style.overflow = "hidden";
  21028. },
  21029. afterEnter(el) {
  21030. el.style.maxHeight = "";
  21031. el.style.overflow = el.dataset.oldOverflow;
  21032. },
  21033. beforeLeave(el) {
  21034. if (!el.dataset)
  21035. el.dataset = {};
  21036. el.dataset.oldPaddingTop = el.style.paddingTop;
  21037. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  21038. el.dataset.oldOverflow = el.style.overflow;
  21039. el.style.maxHeight = `${el.scrollHeight}px`;
  21040. el.style.overflow = "hidden";
  21041. },
  21042. leave(el) {
  21043. if (el.scrollHeight !== 0) {
  21044. el.style.maxHeight = 0;
  21045. el.style.paddingTop = 0;
  21046. el.style.paddingBottom = 0;
  21047. }
  21048. },
  21049. afterLeave(el) {
  21050. el.style.maxHeight = "";
  21051. el.style.overflow = el.dataset.oldOverflow;
  21052. el.style.paddingTop = el.dataset.oldPaddingTop;
  21053. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  21054. }
  21055. };
  21056. return (_ctx, _cache) => {
  21057. return vue.openBlock(), vue.createBlock(vue.Transition, vue.mergeProps({
  21058. name: vue.unref(ns).b()
  21059. }, vue.toHandlers(on)), {
  21060. default: vue.withCtx(() => [
  21061. vue.renderSlot(_ctx.$slots, "default")
  21062. ]),
  21063. _: 3
  21064. }, 16, ["name"]);
  21065. };
  21066. }
  21067. });
  21068. var CollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["__file", "collapse-transition.vue"]]);
  21069. CollapseTransition.install = (app) => {
  21070. app.component(CollapseTransition.name, CollapseTransition);
  21071. };
  21072. const _CollapseTransition = CollapseTransition;
  21073. const ElCollapseTransition = _CollapseTransition;
  21074. const collapseItemProps = buildProps({
  21075. title: {
  21076. type: String,
  21077. default: ""
  21078. },
  21079. name: {
  21080. type: definePropType([String, Number]),
  21081. default: () => generateId()
  21082. },
  21083. disabled: Boolean
  21084. });
  21085. const useCollapseItem = (props) => {
  21086. const collapse = vue.inject(collapseContextKey);
  21087. const focusing = vue.ref(false);
  21088. const isClick = vue.ref(false);
  21089. const id = vue.ref(generateId());
  21090. const isActive = vue.computed(() => collapse == null ? void 0 : collapse.activeNames.value.includes(props.name));
  21091. const handleFocus = () => {
  21092. setTimeout(() => {
  21093. if (!isClick.value) {
  21094. focusing.value = true;
  21095. } else {
  21096. isClick.value = false;
  21097. }
  21098. }, 50);
  21099. };
  21100. const handleHeaderClick = () => {
  21101. if (props.disabled)
  21102. return;
  21103. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  21104. focusing.value = false;
  21105. isClick.value = true;
  21106. };
  21107. const handleEnterClick = () => {
  21108. collapse == null ? void 0 : collapse.handleItemClick(props.name);
  21109. };
  21110. return {
  21111. focusing,
  21112. id,
  21113. isActive,
  21114. handleFocus,
  21115. handleHeaderClick,
  21116. handleEnterClick
  21117. };
  21118. };
  21119. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  21120. const ns = useNamespace("collapse");
  21121. const rootKls = vue.computed(() => [
  21122. ns.b("item"),
  21123. ns.is("active", vue.unref(isActive)),
  21124. ns.is("disabled", props.disabled)
  21125. ]);
  21126. const headKls = vue.computed(() => [
  21127. ns.be("item", "header"),
  21128. ns.is("active", vue.unref(isActive)),
  21129. { focusing: vue.unref(focusing) && !props.disabled }
  21130. ]);
  21131. const arrowKls = vue.computed(() => [
  21132. ns.be("item", "arrow"),
  21133. ns.is("active", vue.unref(isActive))
  21134. ]);
  21135. const itemWrapperKls = vue.computed(() => ns.be("item", "wrap"));
  21136. const itemContentKls = vue.computed(() => ns.be("item", "content"));
  21137. const scopedContentId = vue.computed(() => ns.b(`content-${vue.unref(id)}`));
  21138. const scopedHeadId = vue.computed(() => ns.b(`head-${vue.unref(id)}`));
  21139. return {
  21140. arrowKls,
  21141. headKls,
  21142. rootKls,
  21143. itemWrapperKls,
  21144. itemContentKls,
  21145. scopedContentId,
  21146. scopedHeadId
  21147. };
  21148. };
  21149. const _hoisted_1$N = ["aria-expanded", "aria-controls", "aria-describedby"];
  21150. const _hoisted_2$v = ["id", "tabindex"];
  21151. const _hoisted_3$g = ["id", "aria-hidden", "aria-labelledby"];
  21152. const __default__$Z = vue.defineComponent({
  21153. name: "ElCollapseItem"
  21154. });
  21155. const _sfc_main$1y = /* @__PURE__ */ vue.defineComponent({
  21156. ...__default__$Z,
  21157. props: collapseItemProps,
  21158. setup(__props, { expose }) {
  21159. const props = __props;
  21160. const {
  21161. focusing,
  21162. id,
  21163. isActive,
  21164. handleFocus,
  21165. handleHeaderClick,
  21166. handleEnterClick
  21167. } = useCollapseItem(props);
  21168. const {
  21169. arrowKls,
  21170. headKls,
  21171. rootKls,
  21172. itemWrapperKls,
  21173. itemContentKls,
  21174. scopedContentId,
  21175. scopedHeadId
  21176. } = useCollapseItemDOM(props, { focusing, isActive, id });
  21177. expose({
  21178. isActive
  21179. });
  21180. return (_ctx, _cache) => {
  21181. return vue.openBlock(), vue.createElementBlock("div", {
  21182. class: vue.normalizeClass(vue.unref(rootKls))
  21183. }, [
  21184. vue.createElementVNode("div", {
  21185. role: "tab",
  21186. "aria-expanded": vue.unref(isActive),
  21187. "aria-controls": vue.unref(scopedContentId),
  21188. "aria-describedby": vue.unref(scopedContentId)
  21189. }, [
  21190. vue.createElementVNode("div", {
  21191. id: vue.unref(scopedHeadId),
  21192. class: vue.normalizeClass(vue.unref(headKls)),
  21193. role: "button",
  21194. tabindex: _ctx.disabled ? -1 : 0,
  21195. onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(handleHeaderClick) && vue.unref(handleHeaderClick)(...args)),
  21196. onKeypress: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers((...args) => vue.unref(handleEnterClick) && vue.unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
  21197. onFocus: _cache[2] || (_cache[2] = (...args) => vue.unref(handleFocus) && vue.unref(handleFocus)(...args)),
  21198. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  21199. }, [
  21200. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  21201. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  21202. ]),
  21203. vue.createVNode(vue.unref(ElIcon), {
  21204. class: vue.normalizeClass(vue.unref(arrowKls))
  21205. }, {
  21206. default: vue.withCtx(() => [
  21207. vue.createVNode(vue.unref(arrow_right_default))
  21208. ]),
  21209. _: 1
  21210. }, 8, ["class"])
  21211. ], 42, _hoisted_2$v)
  21212. ], 8, _hoisted_1$N),
  21213. vue.createVNode(vue.unref(_CollapseTransition), null, {
  21214. default: vue.withCtx(() => [
  21215. vue.withDirectives(vue.createElementVNode("div", {
  21216. id: vue.unref(scopedContentId),
  21217. class: vue.normalizeClass(vue.unref(itemWrapperKls)),
  21218. role: "tabpanel",
  21219. "aria-hidden": !vue.unref(isActive),
  21220. "aria-labelledby": vue.unref(scopedHeadId)
  21221. }, [
  21222. vue.createElementVNode("div", {
  21223. class: vue.normalizeClass(vue.unref(itemContentKls))
  21224. }, [
  21225. vue.renderSlot(_ctx.$slots, "default")
  21226. ], 2)
  21227. ], 10, _hoisted_3$g), [
  21228. [vue.vShow, vue.unref(isActive)]
  21229. ])
  21230. ]),
  21231. _: 3
  21232. })
  21233. ], 2);
  21234. };
  21235. }
  21236. });
  21237. var CollapseItem = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["__file", "collapse-item.vue"]]);
  21238. const ElCollapse = withInstall(Collapse, {
  21239. CollapseItem
  21240. });
  21241. const ElCollapseItem = withNoopInstall(CollapseItem);
  21242. let isDragging = false;
  21243. function draggable(element, options) {
  21244. if (!isClient)
  21245. return;
  21246. const moveFn = function(event) {
  21247. var _a;
  21248. (_a = options.drag) == null ? void 0 : _a.call(options, event);
  21249. };
  21250. const upFn = function(event) {
  21251. var _a;
  21252. document.removeEventListener("mousemove", moveFn);
  21253. document.removeEventListener("mouseup", upFn);
  21254. document.removeEventListener("touchmove", moveFn);
  21255. document.removeEventListener("touchend", upFn);
  21256. document.onselectstart = null;
  21257. document.ondragstart = null;
  21258. isDragging = false;
  21259. (_a = options.end) == null ? void 0 : _a.call(options, event);
  21260. };
  21261. const downFn = function(event) {
  21262. var _a;
  21263. if (isDragging)
  21264. return;
  21265. event.preventDefault();
  21266. document.onselectstart = () => false;
  21267. document.ondragstart = () => false;
  21268. document.addEventListener("mousemove", moveFn);
  21269. document.addEventListener("mouseup", upFn);
  21270. document.addEventListener("touchmove", moveFn);
  21271. document.addEventListener("touchend", upFn);
  21272. isDragging = true;
  21273. (_a = options.start) == null ? void 0 : _a.call(options, event);
  21274. };
  21275. element.addEventListener("mousedown", downFn);
  21276. element.addEventListener("touchstart", downFn);
  21277. }
  21278. const _sfc_main$1x = vue.defineComponent({
  21279. name: "ElColorAlphaSlider",
  21280. props: {
  21281. color: {
  21282. type: Object,
  21283. required: true
  21284. },
  21285. vertical: {
  21286. type: Boolean,
  21287. default: false
  21288. }
  21289. },
  21290. setup(props) {
  21291. const ns = useNamespace("color-alpha-slider");
  21292. const instance = vue.getCurrentInstance();
  21293. const thumb = vue.shallowRef();
  21294. const bar = vue.shallowRef();
  21295. const thumbLeft = vue.ref(0);
  21296. const thumbTop = vue.ref(0);
  21297. const background = vue.ref();
  21298. vue.watch(() => props.color.get("alpha"), () => {
  21299. update();
  21300. });
  21301. vue.watch(() => props.color.value, () => {
  21302. update();
  21303. });
  21304. function getThumbLeft() {
  21305. if (!thumb.value)
  21306. return 0;
  21307. if (props.vertical)
  21308. return 0;
  21309. const el = instance.vnode.el;
  21310. const alpha = props.color.get("alpha");
  21311. if (!el)
  21312. return 0;
  21313. return Math.round(alpha * (el.offsetWidth - thumb.value.offsetWidth / 2) / 100);
  21314. }
  21315. function getThumbTop() {
  21316. if (!thumb.value)
  21317. return 0;
  21318. const el = instance.vnode.el;
  21319. if (!props.vertical)
  21320. return 0;
  21321. const alpha = props.color.get("alpha");
  21322. if (!el)
  21323. return 0;
  21324. return Math.round(alpha * (el.offsetHeight - thumb.value.offsetHeight / 2) / 100);
  21325. }
  21326. function getBackground() {
  21327. if (props.color && props.color.value) {
  21328. const { r, g, b } = props.color.toRgb();
  21329. return `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`;
  21330. }
  21331. return "";
  21332. }
  21333. function handleClick(event) {
  21334. const target = event.target;
  21335. if (target !== thumb.value) {
  21336. handleDrag(event);
  21337. }
  21338. }
  21339. function handleDrag(event) {
  21340. if (!bar.value || !thumb.value)
  21341. return;
  21342. const el = instance.vnode.el;
  21343. const rect = el.getBoundingClientRect();
  21344. const { clientX, clientY } = getClientXY(event);
  21345. if (!props.vertical) {
  21346. let left = clientX - rect.left;
  21347. left = Math.max(thumb.value.offsetWidth / 2, left);
  21348. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  21349. props.color.set("alpha", Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 100));
  21350. } else {
  21351. let top = clientY - rect.top;
  21352. top = Math.max(thumb.value.offsetHeight / 2, top);
  21353. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  21354. props.color.set("alpha", Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 100));
  21355. }
  21356. }
  21357. function update() {
  21358. thumbLeft.value = getThumbLeft();
  21359. thumbTop.value = getThumbTop();
  21360. background.value = getBackground();
  21361. }
  21362. vue.onMounted(() => {
  21363. if (!bar.value || !thumb.value)
  21364. return;
  21365. const dragConfig = {
  21366. drag: (event) => {
  21367. handleDrag(event);
  21368. },
  21369. end: (event) => {
  21370. handleDrag(event);
  21371. }
  21372. };
  21373. draggable(bar.value, dragConfig);
  21374. draggable(thumb.value, dragConfig);
  21375. update();
  21376. });
  21377. return {
  21378. thumb,
  21379. bar,
  21380. thumbLeft,
  21381. thumbTop,
  21382. background,
  21383. handleClick,
  21384. update,
  21385. ns
  21386. };
  21387. }
  21388. });
  21389. function _sfc_render$t(_ctx, _cache, $props, $setup, $data, $options) {
  21390. return vue.openBlock(), vue.createElementBlock("div", {
  21391. class: vue.normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
  21392. }, [
  21393. vue.createElementVNode("div", {
  21394. ref: "bar",
  21395. class: vue.normalizeClass(_ctx.ns.e("bar")),
  21396. style: vue.normalizeStyle({
  21397. background: _ctx.background
  21398. }),
  21399. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  21400. }, null, 6),
  21401. vue.createElementVNode("div", {
  21402. ref: "thumb",
  21403. class: vue.normalizeClass(_ctx.ns.e("thumb")),
  21404. style: vue.normalizeStyle({
  21405. left: _ctx.thumbLeft + "px",
  21406. top: _ctx.thumbTop + "px"
  21407. })
  21408. }, null, 6)
  21409. ], 2);
  21410. }
  21411. var AlphaSlider = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$t], ["__file", "alpha-slider.vue"]]);
  21412. const _sfc_main$1w = vue.defineComponent({
  21413. name: "ElColorHueSlider",
  21414. props: {
  21415. color: {
  21416. type: Object,
  21417. required: true
  21418. },
  21419. vertical: Boolean
  21420. },
  21421. setup(props) {
  21422. const ns = useNamespace("color-hue-slider");
  21423. const instance = vue.getCurrentInstance();
  21424. const thumb = vue.ref();
  21425. const bar = vue.ref();
  21426. const thumbLeft = vue.ref(0);
  21427. const thumbTop = vue.ref(0);
  21428. const hueValue = vue.computed(() => {
  21429. return props.color.get("hue");
  21430. });
  21431. vue.watch(() => hueValue.value, () => {
  21432. update();
  21433. });
  21434. function handleClick(event) {
  21435. const target = event.target;
  21436. if (target !== thumb.value) {
  21437. handleDrag(event);
  21438. }
  21439. }
  21440. function handleDrag(event) {
  21441. if (!bar.value || !thumb.value)
  21442. return;
  21443. const el = instance.vnode.el;
  21444. const rect = el.getBoundingClientRect();
  21445. const { clientX, clientY } = getClientXY(event);
  21446. let hue;
  21447. if (!props.vertical) {
  21448. let left = clientX - rect.left;
  21449. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  21450. left = Math.max(thumb.value.offsetWidth / 2, left);
  21451. hue = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * 360);
  21452. } else {
  21453. let top = clientY - rect.top;
  21454. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  21455. top = Math.max(thumb.value.offsetHeight / 2, top);
  21456. hue = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * 360);
  21457. }
  21458. props.color.set("hue", hue);
  21459. }
  21460. function getThumbLeft() {
  21461. if (!thumb.value)
  21462. return 0;
  21463. const el = instance.vnode.el;
  21464. if (props.vertical)
  21465. return 0;
  21466. const hue = props.color.get("hue");
  21467. if (!el)
  21468. return 0;
  21469. return Math.round(hue * (el.offsetWidth - thumb.value.offsetWidth / 2) / 360);
  21470. }
  21471. function getThumbTop() {
  21472. if (!thumb.value)
  21473. return 0;
  21474. const el = instance.vnode.el;
  21475. if (!props.vertical)
  21476. return 0;
  21477. const hue = props.color.get("hue");
  21478. if (!el)
  21479. return 0;
  21480. return Math.round(hue * (el.offsetHeight - thumb.value.offsetHeight / 2) / 360);
  21481. }
  21482. function update() {
  21483. thumbLeft.value = getThumbLeft();
  21484. thumbTop.value = getThumbTop();
  21485. }
  21486. vue.onMounted(() => {
  21487. if (!bar.value || !thumb.value)
  21488. return;
  21489. const dragConfig = {
  21490. drag: (event) => {
  21491. handleDrag(event);
  21492. },
  21493. end: (event) => {
  21494. handleDrag(event);
  21495. }
  21496. };
  21497. draggable(bar.value, dragConfig);
  21498. draggable(thumb.value, dragConfig);
  21499. update();
  21500. });
  21501. return {
  21502. bar,
  21503. thumb,
  21504. thumbLeft,
  21505. thumbTop,
  21506. hueValue,
  21507. handleClick,
  21508. update,
  21509. ns
  21510. };
  21511. }
  21512. });
  21513. function _sfc_render$s(_ctx, _cache, $props, $setup, $data, $options) {
  21514. return vue.openBlock(), vue.createElementBlock("div", {
  21515. class: vue.normalizeClass([_ctx.ns.b(), _ctx.ns.is("vertical", _ctx.vertical)])
  21516. }, [
  21517. vue.createElementVNode("div", {
  21518. ref: "bar",
  21519. class: vue.normalizeClass(_ctx.ns.e("bar")),
  21520. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  21521. }, null, 2),
  21522. vue.createElementVNode("div", {
  21523. ref: "thumb",
  21524. class: vue.normalizeClass(_ctx.ns.e("thumb")),
  21525. style: vue.normalizeStyle({
  21526. left: _ctx.thumbLeft + "px",
  21527. top: _ctx.thumbTop + "px"
  21528. })
  21529. }, null, 6)
  21530. ], 2);
  21531. }
  21532. var HueSlider = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$s], ["__file", "hue-slider.vue"]]);
  21533. const colorPickerProps = buildProps({
  21534. modelValue: String,
  21535. id: String,
  21536. showAlpha: Boolean,
  21537. colorFormat: String,
  21538. disabled: Boolean,
  21539. size: useSizeProp,
  21540. popperClass: {
  21541. type: String,
  21542. default: ""
  21543. },
  21544. label: {
  21545. type: String,
  21546. default: void 0
  21547. },
  21548. tabindex: {
  21549. type: [String, Number],
  21550. default: 0
  21551. },
  21552. predefine: {
  21553. type: definePropType(Array)
  21554. },
  21555. validateEvent: {
  21556. type: Boolean,
  21557. default: true
  21558. }
  21559. });
  21560. const colorPickerEmits = {
  21561. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  21562. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  21563. activeChange: (val) => isString(val) || isNil(val)
  21564. };
  21565. const colorPickerContextKey = Symbol("colorPickerContextKey");
  21566. const hsv2hsl = function(hue, sat, val) {
  21567. return [
  21568. hue,
  21569. sat * val / ((hue = (2 - sat) * val) < 1 ? hue : 2 - hue) || 0,
  21570. hue / 2
  21571. ];
  21572. };
  21573. const isOnePointZero = function(n) {
  21574. return typeof n === "string" && n.includes(".") && Number.parseFloat(n) === 1;
  21575. };
  21576. const isPercentage = function(n) {
  21577. return typeof n === "string" && n.includes("%");
  21578. };
  21579. const bound01 = function(value, max) {
  21580. if (isOnePointZero(value))
  21581. value = "100%";
  21582. const processPercent = isPercentage(value);
  21583. value = Math.min(max, Math.max(0, Number.parseFloat(`${value}`)));
  21584. if (processPercent) {
  21585. value = Number.parseInt(`${value * max}`, 10) / 100;
  21586. }
  21587. if (Math.abs(value - max) < 1e-6) {
  21588. return 1;
  21589. }
  21590. return value % max / Number.parseFloat(max);
  21591. };
  21592. const INT_HEX_MAP = {
  21593. 10: "A",
  21594. 11: "B",
  21595. 12: "C",
  21596. 13: "D",
  21597. 14: "E",
  21598. 15: "F"
  21599. };
  21600. const hexOne = (value) => {
  21601. value = Math.min(Math.round(value), 255);
  21602. const high = Math.floor(value / 16);
  21603. const low = value % 16;
  21604. return `${INT_HEX_MAP[high] || high}${INT_HEX_MAP[low] || low}`;
  21605. };
  21606. const toHex = function({ r, g, b }) {
  21607. if (Number.isNaN(+r) || Number.isNaN(+g) || Number.isNaN(+b))
  21608. return "";
  21609. return `#${hexOne(r)}${hexOne(g)}${hexOne(b)}`;
  21610. };
  21611. const HEX_INT_MAP = {
  21612. A: 10,
  21613. B: 11,
  21614. C: 12,
  21615. D: 13,
  21616. E: 14,
  21617. F: 15
  21618. };
  21619. const parseHexChannel = function(hex) {
  21620. if (hex.length === 2) {
  21621. return (HEX_INT_MAP[hex[0].toUpperCase()] || +hex[0]) * 16 + (HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1]);
  21622. }
  21623. return HEX_INT_MAP[hex[1].toUpperCase()] || +hex[1];
  21624. };
  21625. const hsl2hsv = function(hue, sat, light) {
  21626. sat = sat / 100;
  21627. light = light / 100;
  21628. let smin = sat;
  21629. const lmin = Math.max(light, 0.01);
  21630. light *= 2;
  21631. sat *= light <= 1 ? light : 2 - light;
  21632. smin *= lmin <= 1 ? lmin : 2 - lmin;
  21633. const v = (light + sat) / 2;
  21634. const sv = light === 0 ? 2 * smin / (lmin + smin) : 2 * sat / (light + sat);
  21635. return {
  21636. h: hue,
  21637. s: sv * 100,
  21638. v: v * 100
  21639. };
  21640. };
  21641. const rgb2hsv = (r, g, b) => {
  21642. r = bound01(r, 255);
  21643. g = bound01(g, 255);
  21644. b = bound01(b, 255);
  21645. const max = Math.max(r, g, b);
  21646. const min = Math.min(r, g, b);
  21647. let h;
  21648. const v = max;
  21649. const d = max - min;
  21650. const s = max === 0 ? 0 : d / max;
  21651. if (max === min) {
  21652. h = 0;
  21653. } else {
  21654. switch (max) {
  21655. case r: {
  21656. h = (g - b) / d + (g < b ? 6 : 0);
  21657. break;
  21658. }
  21659. case g: {
  21660. h = (b - r) / d + 2;
  21661. break;
  21662. }
  21663. case b: {
  21664. h = (r - g) / d + 4;
  21665. break;
  21666. }
  21667. }
  21668. h /= 6;
  21669. }
  21670. return { h: h * 360, s: s * 100, v: v * 100 };
  21671. };
  21672. const hsv2rgb = function(h, s, v) {
  21673. h = bound01(h, 360) * 6;
  21674. s = bound01(s, 100);
  21675. v = bound01(v, 100);
  21676. const i = Math.floor(h);
  21677. const f = h - i;
  21678. const p = v * (1 - s);
  21679. const q = v * (1 - f * s);
  21680. const t = v * (1 - (1 - f) * s);
  21681. const mod = i % 6;
  21682. const r = [v, q, p, p, t, v][mod];
  21683. const g = [t, v, v, q, p, p][mod];
  21684. const b = [p, p, t, v, v, q][mod];
  21685. return {
  21686. r: Math.round(r * 255),
  21687. g: Math.round(g * 255),
  21688. b: Math.round(b * 255)
  21689. };
  21690. };
  21691. class Color {
  21692. constructor(options = {}) {
  21693. this._hue = 0;
  21694. this._saturation = 100;
  21695. this._value = 100;
  21696. this._alpha = 100;
  21697. this.enableAlpha = false;
  21698. this.format = "hex";
  21699. this.value = "";
  21700. for (const option in options) {
  21701. if (hasOwn(options, option)) {
  21702. this[option] = options[option];
  21703. }
  21704. }
  21705. if (options.value) {
  21706. this.fromString(options.value);
  21707. } else {
  21708. this.doOnChange();
  21709. }
  21710. }
  21711. set(prop, value) {
  21712. if (arguments.length === 1 && typeof prop === "object") {
  21713. for (const p in prop) {
  21714. if (hasOwn(prop, p)) {
  21715. this.set(p, prop[p]);
  21716. }
  21717. }
  21718. return;
  21719. }
  21720. this[`_${prop}`] = value;
  21721. this.doOnChange();
  21722. }
  21723. get(prop) {
  21724. if (prop === "alpha") {
  21725. return Math.floor(this[`_${prop}`]);
  21726. }
  21727. return this[`_${prop}`];
  21728. }
  21729. toRgb() {
  21730. return hsv2rgb(this._hue, this._saturation, this._value);
  21731. }
  21732. fromString(value) {
  21733. if (!value) {
  21734. this._hue = 0;
  21735. this._saturation = 100;
  21736. this._value = 100;
  21737. this.doOnChange();
  21738. return;
  21739. }
  21740. const fromHSV = (h, s, v) => {
  21741. this._hue = Math.max(0, Math.min(360, h));
  21742. this._saturation = Math.max(0, Math.min(100, s));
  21743. this._value = Math.max(0, Math.min(100, v));
  21744. this.doOnChange();
  21745. };
  21746. if (value.includes("hsl")) {
  21747. const parts = value.replace(/hsla|hsl|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  21748. if (parts.length === 4) {
  21749. this._alpha = Number.parseFloat(parts[3]) * 100;
  21750. } else if (parts.length === 3) {
  21751. this._alpha = 100;
  21752. }
  21753. if (parts.length >= 3) {
  21754. const { h, s, v } = hsl2hsv(parts[0], parts[1], parts[2]);
  21755. fromHSV(h, s, v);
  21756. }
  21757. } else if (value.includes("hsv")) {
  21758. const parts = value.replace(/hsva|hsv|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  21759. if (parts.length === 4) {
  21760. this._alpha = Number.parseFloat(parts[3]) * 100;
  21761. } else if (parts.length === 3) {
  21762. this._alpha = 100;
  21763. }
  21764. if (parts.length >= 3) {
  21765. fromHSV(parts[0], parts[1], parts[2]);
  21766. }
  21767. } else if (value.includes("rgb")) {
  21768. const parts = value.replace(/rgba|rgb|\(|\)/gm, "").split(/\s|,/g).filter((val) => val !== "").map((val, index) => index > 2 ? Number.parseFloat(val) : Number.parseInt(val, 10));
  21769. if (parts.length === 4) {
  21770. this._alpha = Number.parseFloat(parts[3]) * 100;
  21771. } else if (parts.length === 3) {
  21772. this._alpha = 100;
  21773. }
  21774. if (parts.length >= 3) {
  21775. const { h, s, v } = rgb2hsv(parts[0], parts[1], parts[2]);
  21776. fromHSV(h, s, v);
  21777. }
  21778. } else if (value.includes("#")) {
  21779. const hex = value.replace("#", "").trim();
  21780. if (!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$|^[0-9a-fA-F]{8}$/.test(hex))
  21781. return;
  21782. let r, g, b;
  21783. if (hex.length === 3) {
  21784. r = parseHexChannel(hex[0] + hex[0]);
  21785. g = parseHexChannel(hex[1] + hex[1]);
  21786. b = parseHexChannel(hex[2] + hex[2]);
  21787. } else if (hex.length === 6 || hex.length === 8) {
  21788. r = parseHexChannel(hex.slice(0, 2));
  21789. g = parseHexChannel(hex.slice(2, 4));
  21790. b = parseHexChannel(hex.slice(4, 6));
  21791. }
  21792. if (hex.length === 8) {
  21793. this._alpha = parseHexChannel(hex.slice(6)) / 255 * 100;
  21794. } else if (hex.length === 3 || hex.length === 6) {
  21795. this._alpha = 100;
  21796. }
  21797. const { h, s, v } = rgb2hsv(r, g, b);
  21798. fromHSV(h, s, v);
  21799. }
  21800. }
  21801. compare(color) {
  21802. return Math.abs(color._hue - this._hue) < 2 && Math.abs(color._saturation - this._saturation) < 1 && Math.abs(color._value - this._value) < 1 && Math.abs(color._alpha - this._alpha) < 1;
  21803. }
  21804. doOnChange() {
  21805. const { _hue, _saturation, _value, _alpha, format } = this;
  21806. if (this.enableAlpha) {
  21807. switch (format) {
  21808. case "hsl": {
  21809. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  21810. this.value = `hsla(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%, ${this.get("alpha") / 100})`;
  21811. break;
  21812. }
  21813. case "hsv": {
  21814. this.value = `hsva(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%, ${this.get("alpha") / 100})`;
  21815. break;
  21816. }
  21817. case "hex": {
  21818. this.value = `${toHex(hsv2rgb(_hue, _saturation, _value))}${hexOne(_alpha * 255 / 100)}`;
  21819. break;
  21820. }
  21821. default: {
  21822. const { r, g, b } = hsv2rgb(_hue, _saturation, _value);
  21823. this.value = `rgba(${r}, ${g}, ${b}, ${this.get("alpha") / 100})`;
  21824. }
  21825. }
  21826. } else {
  21827. switch (format) {
  21828. case "hsl": {
  21829. const hsl = hsv2hsl(_hue, _saturation / 100, _value / 100);
  21830. this.value = `hsl(${_hue}, ${Math.round(hsl[1] * 100)}%, ${Math.round(hsl[2] * 100)}%)`;
  21831. break;
  21832. }
  21833. case "hsv": {
  21834. this.value = `hsv(${_hue}, ${Math.round(_saturation)}%, ${Math.round(_value)}%)`;
  21835. break;
  21836. }
  21837. case "rgb": {
  21838. const { r, g, b } = hsv2rgb(_hue, _saturation, _value);
  21839. this.value = `rgb(${r}, ${g}, ${b})`;
  21840. break;
  21841. }
  21842. default: {
  21843. this.value = toHex(hsv2rgb(_hue, _saturation, _value));
  21844. }
  21845. }
  21846. }
  21847. }
  21848. }
  21849. const _sfc_main$1v = vue.defineComponent({
  21850. props: {
  21851. colors: {
  21852. type: Array,
  21853. required: true
  21854. },
  21855. color: {
  21856. type: Object,
  21857. required: true
  21858. }
  21859. },
  21860. setup(props) {
  21861. const ns = useNamespace("color-predefine");
  21862. const { currentColor } = vue.inject(colorPickerContextKey);
  21863. const rgbaColors = vue.ref(parseColors(props.colors, props.color));
  21864. vue.watch(() => currentColor.value, (val) => {
  21865. const color = new Color();
  21866. color.fromString(val);
  21867. rgbaColors.value.forEach((item) => {
  21868. item.selected = color.compare(item);
  21869. });
  21870. });
  21871. vue.watchEffect(() => {
  21872. rgbaColors.value = parseColors(props.colors, props.color);
  21873. });
  21874. function handleSelect(index) {
  21875. props.color.fromString(props.colors[index]);
  21876. }
  21877. function parseColors(colors, color) {
  21878. return colors.map((value) => {
  21879. const c = new Color();
  21880. c.enableAlpha = true;
  21881. c.format = "rgba";
  21882. c.fromString(value);
  21883. c.selected = c.value === color.value;
  21884. return c;
  21885. });
  21886. }
  21887. return {
  21888. rgbaColors,
  21889. handleSelect,
  21890. ns
  21891. };
  21892. }
  21893. });
  21894. const _hoisted_1$M = ["onClick"];
  21895. function _sfc_render$r(_ctx, _cache, $props, $setup, $data, $options) {
  21896. return vue.openBlock(), vue.createElementBlock("div", {
  21897. class: vue.normalizeClass(_ctx.ns.b())
  21898. }, [
  21899. vue.createElementVNode("div", {
  21900. class: vue.normalizeClass(_ctx.ns.e("colors"))
  21901. }, [
  21902. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rgbaColors, (item, index) => {
  21903. return vue.openBlock(), vue.createElementBlock("div", {
  21904. key: _ctx.colors[index],
  21905. class: vue.normalizeClass([
  21906. _ctx.ns.e("color-selector"),
  21907. _ctx.ns.is("alpha", item._alpha < 100),
  21908. { selected: item.selected }
  21909. ]),
  21910. onClick: ($event) => _ctx.handleSelect(index)
  21911. }, [
  21912. vue.createElementVNode("div", {
  21913. style: vue.normalizeStyle({ backgroundColor: item.value })
  21914. }, null, 4)
  21915. ], 10, _hoisted_1$M);
  21916. }), 128))
  21917. ], 2)
  21918. ], 2);
  21919. }
  21920. var Predefine = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["render", _sfc_render$r], ["__file", "predefine.vue"]]);
  21921. const _sfc_main$1u = vue.defineComponent({
  21922. name: "ElSlPanel",
  21923. props: {
  21924. color: {
  21925. type: Object,
  21926. required: true
  21927. }
  21928. },
  21929. setup(props) {
  21930. const ns = useNamespace("color-svpanel");
  21931. const instance = vue.getCurrentInstance();
  21932. const cursorTop = vue.ref(0);
  21933. const cursorLeft = vue.ref(0);
  21934. const background = vue.ref("hsl(0, 100%, 50%)");
  21935. const colorValue = vue.computed(() => {
  21936. const hue = props.color.get("hue");
  21937. const value = props.color.get("value");
  21938. return { hue, value };
  21939. });
  21940. function update() {
  21941. const saturation = props.color.get("saturation");
  21942. const value = props.color.get("value");
  21943. const el = instance.vnode.el;
  21944. const { clientWidth: width, clientHeight: height } = el;
  21945. cursorLeft.value = saturation * width / 100;
  21946. cursorTop.value = (100 - value) * height / 100;
  21947. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  21948. }
  21949. function handleDrag(event) {
  21950. const el = instance.vnode.el;
  21951. const rect = el.getBoundingClientRect();
  21952. const { clientX, clientY } = getClientXY(event);
  21953. let left = clientX - rect.left;
  21954. let top = clientY - rect.top;
  21955. left = Math.max(0, left);
  21956. left = Math.min(left, rect.width);
  21957. top = Math.max(0, top);
  21958. top = Math.min(top, rect.height);
  21959. cursorLeft.value = left;
  21960. cursorTop.value = top;
  21961. props.color.set({
  21962. saturation: left / rect.width * 100,
  21963. value: 100 - top / rect.height * 100
  21964. });
  21965. }
  21966. vue.watch(() => colorValue.value, () => {
  21967. update();
  21968. });
  21969. vue.onMounted(() => {
  21970. draggable(instance.vnode.el, {
  21971. drag: (event) => {
  21972. handleDrag(event);
  21973. },
  21974. end: (event) => {
  21975. handleDrag(event);
  21976. }
  21977. });
  21978. update();
  21979. });
  21980. return {
  21981. cursorTop,
  21982. cursorLeft,
  21983. background,
  21984. colorValue,
  21985. handleDrag,
  21986. update,
  21987. ns
  21988. };
  21989. }
  21990. });
  21991. const _hoisted_1$L = /* @__PURE__ */ vue.createElementVNode("div", null, null, -1);
  21992. const _hoisted_2$u = [
  21993. _hoisted_1$L
  21994. ];
  21995. function _sfc_render$q(_ctx, _cache, $props, $setup, $data, $options) {
  21996. return vue.openBlock(), vue.createElementBlock("div", {
  21997. class: vue.normalizeClass(_ctx.ns.b()),
  21998. style: vue.normalizeStyle({
  21999. backgroundColor: _ctx.background
  22000. })
  22001. }, [
  22002. vue.createElementVNode("div", {
  22003. class: vue.normalizeClass(_ctx.ns.e("white"))
  22004. }, null, 2),
  22005. vue.createElementVNode("div", {
  22006. class: vue.normalizeClass(_ctx.ns.e("black"))
  22007. }, null, 2),
  22008. vue.createElementVNode("div", {
  22009. class: vue.normalizeClass(_ctx.ns.e("cursor")),
  22010. style: vue.normalizeStyle({
  22011. top: _ctx.cursorTop + "px",
  22012. left: _ctx.cursorLeft + "px"
  22013. })
  22014. }, _hoisted_2$u, 6)
  22015. ], 6);
  22016. }
  22017. var SvPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["render", _sfc_render$q], ["__file", "sv-panel.vue"]]);
  22018. const _hoisted_1$K = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex", "onKeydown"];
  22019. const __default__$Y = vue.defineComponent({
  22020. name: "ElColorPicker"
  22021. });
  22022. const _sfc_main$1t = /* @__PURE__ */ vue.defineComponent({
  22023. ...__default__$Y,
  22024. props: colorPickerProps,
  22025. emits: colorPickerEmits,
  22026. setup(__props, { expose, emit }) {
  22027. const props = __props;
  22028. const { t } = useLocale();
  22029. const ns = useNamespace("color");
  22030. const { formItem } = useFormItem();
  22031. const colorSize = useSize();
  22032. const colorDisabled = useDisabled();
  22033. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, {
  22034. formItemContext: formItem
  22035. });
  22036. const hue = vue.ref();
  22037. const sv = vue.ref();
  22038. const alpha = vue.ref();
  22039. const popper = vue.ref();
  22040. let shouldActiveChange = true;
  22041. const color = vue.reactive(new Color({
  22042. enableAlpha: props.showAlpha,
  22043. format: props.colorFormat || "",
  22044. value: props.modelValue
  22045. }));
  22046. const showPicker = vue.ref(false);
  22047. const showPanelColor = vue.ref(false);
  22048. const customInput = vue.ref("");
  22049. const displayedColor = vue.computed(() => {
  22050. if (!props.modelValue && !showPanelColor.value) {
  22051. return "transparent";
  22052. }
  22053. return displayedRgb(color, props.showAlpha);
  22054. });
  22055. const currentColor = vue.computed(() => {
  22056. return !props.modelValue && !showPanelColor.value ? "" : color.value;
  22057. });
  22058. const buttonAriaLabel = vue.computed(() => {
  22059. return !isLabeledByFormItem.value ? props.label || t("el.colorpicker.defaultLabel") : void 0;
  22060. });
  22061. const buttonAriaLabelledby = vue.computed(() => {
  22062. return isLabeledByFormItem.value ? formItem == null ? void 0 : formItem.labelId : void 0;
  22063. });
  22064. const btnKls = vue.computed(() => {
  22065. return [
  22066. ns.b("picker"),
  22067. ns.is("disabled", colorDisabled.value),
  22068. ns.bm("picker", colorSize.value)
  22069. ];
  22070. });
  22071. function displayedRgb(color2, showAlpha) {
  22072. if (!(color2 instanceof Color)) {
  22073. throw new TypeError("color should be instance of _color Class");
  22074. }
  22075. const { r, g, b } = color2.toRgb();
  22076. return showAlpha ? `rgba(${r}, ${g}, ${b}, ${color2.get("alpha") / 100})` : `rgb(${r}, ${g}, ${b})`;
  22077. }
  22078. function setShowPicker(value) {
  22079. showPicker.value = value;
  22080. }
  22081. const debounceSetShowPicker = debounce(setShowPicker, 100);
  22082. function hide() {
  22083. debounceSetShowPicker(false);
  22084. resetColor();
  22085. }
  22086. function resetColor() {
  22087. vue.nextTick(() => {
  22088. if (props.modelValue) {
  22089. color.fromString(props.modelValue);
  22090. } else {
  22091. color.value = "";
  22092. vue.nextTick(() => {
  22093. showPanelColor.value = false;
  22094. });
  22095. }
  22096. });
  22097. }
  22098. function handleTrigger() {
  22099. if (colorDisabled.value)
  22100. return;
  22101. debounceSetShowPicker(!showPicker.value);
  22102. }
  22103. function handleConfirm() {
  22104. color.fromString(customInput.value);
  22105. }
  22106. function confirmValue() {
  22107. const value = color.value;
  22108. emit(UPDATE_MODEL_EVENT, value);
  22109. emit("change", value);
  22110. if (props.validateEvent) {
  22111. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  22112. }
  22113. debounceSetShowPicker(false);
  22114. vue.nextTick(() => {
  22115. const newColor = new Color({
  22116. enableAlpha: props.showAlpha,
  22117. format: props.colorFormat || "",
  22118. value: props.modelValue
  22119. });
  22120. if (!color.compare(newColor)) {
  22121. resetColor();
  22122. }
  22123. });
  22124. }
  22125. function clear() {
  22126. debounceSetShowPicker(false);
  22127. emit(UPDATE_MODEL_EVENT, null);
  22128. emit("change", null);
  22129. if (props.modelValue !== null && props.validateEvent) {
  22130. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  22131. }
  22132. resetColor();
  22133. }
  22134. vue.onMounted(() => {
  22135. if (props.modelValue) {
  22136. customInput.value = currentColor.value;
  22137. }
  22138. });
  22139. vue.watch(() => props.modelValue, (newVal) => {
  22140. if (!newVal) {
  22141. showPanelColor.value = false;
  22142. } else if (newVal && newVal !== color.value) {
  22143. shouldActiveChange = false;
  22144. color.fromString(newVal);
  22145. }
  22146. });
  22147. vue.watch(() => currentColor.value, (val) => {
  22148. customInput.value = val;
  22149. shouldActiveChange && emit("activeChange", val);
  22150. shouldActiveChange = true;
  22151. });
  22152. vue.watch(() => color.value, () => {
  22153. if (!props.modelValue && !showPanelColor.value) {
  22154. showPanelColor.value = true;
  22155. }
  22156. });
  22157. vue.watch(() => showPicker.value, () => {
  22158. vue.nextTick(() => {
  22159. var _a, _b, _c;
  22160. (_a = hue.value) == null ? void 0 : _a.update();
  22161. (_b = sv.value) == null ? void 0 : _b.update();
  22162. (_c = alpha.value) == null ? void 0 : _c.update();
  22163. });
  22164. });
  22165. vue.provide(colorPickerContextKey, {
  22166. currentColor
  22167. });
  22168. expose({
  22169. color
  22170. });
  22171. return (_ctx, _cache) => {
  22172. return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), {
  22173. ref_key: "popper",
  22174. ref: popper,
  22175. visible: showPicker.value,
  22176. "show-arrow": false,
  22177. "fallback-placements": ["bottom", "top", "right", "left"],
  22178. offset: 0,
  22179. "gpu-acceleration": false,
  22180. "popper-class": [vue.unref(ns).be("picker", "panel"), vue.unref(ns).b("dropdown"), _ctx.popperClass],
  22181. "stop-popper-mouse-event": false,
  22182. effect: "light",
  22183. trigger: "click",
  22184. transition: `${vue.unref(ns).namespace.value}-zoom-in-top`,
  22185. persistent: ""
  22186. }, {
  22187. content: vue.withCtx(() => [
  22188. vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", null, [
  22189. vue.createElementVNode("div", {
  22190. class: vue.normalizeClass(vue.unref(ns).be("dropdown", "main-wrapper"))
  22191. }, [
  22192. vue.createVNode(HueSlider, {
  22193. ref_key: "hue",
  22194. ref: hue,
  22195. class: "hue-slider",
  22196. color: vue.unref(color),
  22197. vertical: ""
  22198. }, null, 8, ["color"]),
  22199. vue.createVNode(SvPanel, {
  22200. ref: "svPanel",
  22201. color: vue.unref(color)
  22202. }, null, 8, ["color"])
  22203. ], 2),
  22204. _ctx.showAlpha ? (vue.openBlock(), vue.createBlock(AlphaSlider, {
  22205. key: 0,
  22206. ref_key: "alpha",
  22207. ref: alpha,
  22208. color: vue.unref(color)
  22209. }, null, 8, ["color"])) : vue.createCommentVNode("v-if", true),
  22210. _ctx.predefine ? (vue.openBlock(), vue.createBlock(Predefine, {
  22211. key: 1,
  22212. ref: "predefine",
  22213. color: vue.unref(color),
  22214. colors: _ctx.predefine
  22215. }, null, 8, ["color", "colors"])) : vue.createCommentVNode("v-if", true),
  22216. vue.createElementVNode("div", {
  22217. class: vue.normalizeClass(vue.unref(ns).be("dropdown", "btns"))
  22218. }, [
  22219. vue.createElementVNode("span", {
  22220. class: vue.normalizeClass(vue.unref(ns).be("dropdown", "value"))
  22221. }, [
  22222. vue.createVNode(vue.unref(ElInput), {
  22223. modelValue: customInput.value,
  22224. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  22225. "validate-event": false,
  22226. size: "small",
  22227. onKeyup: vue.withKeys(handleConfirm, ["enter"]),
  22228. onBlur: handleConfirm
  22229. }, null, 8, ["modelValue", "onKeyup"])
  22230. ], 2),
  22231. vue.createVNode(vue.unref(ElButton), {
  22232. class: vue.normalizeClass(vue.unref(ns).be("dropdown", "link-btn")),
  22233. text: "",
  22234. size: "small",
  22235. onClick: clear
  22236. }, {
  22237. default: vue.withCtx(() => [
  22238. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.colorpicker.clear")), 1)
  22239. ]),
  22240. _: 1
  22241. }, 8, ["class"]),
  22242. vue.createVNode(vue.unref(ElButton), {
  22243. plain: "",
  22244. size: "small",
  22245. class: vue.normalizeClass(vue.unref(ns).be("dropdown", "btn")),
  22246. onClick: confirmValue
  22247. }, {
  22248. default: vue.withCtx(() => [
  22249. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.colorpicker.confirm")), 1)
  22250. ]),
  22251. _: 1
  22252. }, 8, ["class"])
  22253. ], 2)
  22254. ])), [
  22255. [vue.unref(ClickOutside), hide]
  22256. ])
  22257. ]),
  22258. default: vue.withCtx(() => [
  22259. vue.createElementVNode("div", {
  22260. id: vue.unref(buttonId),
  22261. class: vue.normalizeClass(vue.unref(btnKls)),
  22262. role: "button",
  22263. "aria-label": vue.unref(buttonAriaLabel),
  22264. "aria-labelledby": vue.unref(buttonAriaLabelledby),
  22265. "aria-description": vue.unref(t)("el.colorpicker.description", { color: _ctx.modelValue || "" }),
  22266. tabindex: _ctx.tabindex,
  22267. onKeydown: vue.withKeys(handleTrigger, ["enter"])
  22268. }, [
  22269. vue.unref(colorDisabled) ? (vue.openBlock(), vue.createElementBlock("div", {
  22270. key: 0,
  22271. class: vue.normalizeClass(vue.unref(ns).be("picker", "mask"))
  22272. }, null, 2)) : vue.createCommentVNode("v-if", true),
  22273. vue.createElementVNode("div", {
  22274. class: vue.normalizeClass(vue.unref(ns).be("picker", "trigger")),
  22275. onClick: handleTrigger
  22276. }, [
  22277. vue.createElementVNode("span", {
  22278. class: vue.normalizeClass([vue.unref(ns).be("picker", "color"), vue.unref(ns).is("alpha", _ctx.showAlpha)])
  22279. }, [
  22280. vue.createElementVNode("span", {
  22281. class: vue.normalizeClass(vue.unref(ns).be("picker", "color-inner")),
  22282. style: vue.normalizeStyle({
  22283. backgroundColor: vue.unref(displayedColor)
  22284. })
  22285. }, [
  22286. vue.withDirectives(vue.createVNode(vue.unref(ElIcon), {
  22287. class: vue.normalizeClass([vue.unref(ns).be("picker", "icon"), vue.unref(ns).is("icon-arrow-down")])
  22288. }, {
  22289. default: vue.withCtx(() => [
  22290. vue.createVNode(vue.unref(arrow_down_default))
  22291. ]),
  22292. _: 1
  22293. }, 8, ["class"]), [
  22294. [vue.vShow, _ctx.modelValue || showPanelColor.value]
  22295. ]),
  22296. !_ctx.modelValue && !showPanelColor.value ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  22297. key: 0,
  22298. class: vue.normalizeClass([vue.unref(ns).be("picker", "empty"), vue.unref(ns).is("icon-close")])
  22299. }, {
  22300. default: vue.withCtx(() => [
  22301. vue.createVNode(vue.unref(close_default))
  22302. ]),
  22303. _: 1
  22304. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  22305. ], 6)
  22306. ], 2)
  22307. ], 2)
  22308. ], 42, _hoisted_1$K)
  22309. ]),
  22310. _: 1
  22311. }, 8, ["visible", "popper-class", "transition"]);
  22312. };
  22313. }
  22314. });
  22315. var ColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["__file", "color-picker.vue"]]);
  22316. const ElColorPicker = withInstall(ColorPicker);
  22317. const messageConfig = {};
  22318. const configProviderProps = buildProps({
  22319. a11y: {
  22320. type: Boolean,
  22321. default: true
  22322. },
  22323. locale: {
  22324. type: definePropType(Object)
  22325. },
  22326. size: useSizeProp,
  22327. button: {
  22328. type: definePropType(Object)
  22329. },
  22330. experimentalFeatures: {
  22331. type: definePropType(Object)
  22332. },
  22333. keyboardNavigation: {
  22334. type: Boolean,
  22335. default: true
  22336. },
  22337. message: {
  22338. type: definePropType(Object)
  22339. },
  22340. zIndex: Number,
  22341. namespace: {
  22342. type: String,
  22343. default: "el"
  22344. }
  22345. });
  22346. const ConfigProvider = vue.defineComponent({
  22347. name: "ElConfigProvider",
  22348. props: configProviderProps,
  22349. setup(props, { slots }) {
  22350. vue.watch(() => props.message, (val) => {
  22351. Object.assign(messageConfig, val != null ? val : {});
  22352. }, { immediate: true, deep: true });
  22353. const config = provideGlobalConfig(props);
  22354. return () => vue.renderSlot(slots, "default", { config: config == null ? void 0 : config.value });
  22355. }
  22356. });
  22357. const ElConfigProvider = withInstall(ConfigProvider);
  22358. const __default__$X = vue.defineComponent({
  22359. name: "ElContainer"
  22360. });
  22361. const _sfc_main$1s = /* @__PURE__ */ vue.defineComponent({
  22362. ...__default__$X,
  22363. props: {
  22364. direction: {
  22365. type: String
  22366. }
  22367. },
  22368. setup(__props) {
  22369. const props = __props;
  22370. const slots = vue.useSlots();
  22371. const ns = useNamespace("container");
  22372. const isVertical = vue.computed(() => {
  22373. if (props.direction === "vertical") {
  22374. return true;
  22375. } else if (props.direction === "horizontal") {
  22376. return false;
  22377. }
  22378. if (slots && slots.default) {
  22379. const vNodes = slots.default();
  22380. return vNodes.some((vNode) => {
  22381. const tag = vNode.type.name;
  22382. return tag === "ElHeader" || tag === "ElFooter";
  22383. });
  22384. } else {
  22385. return false;
  22386. }
  22387. });
  22388. return (_ctx, _cache) => {
  22389. return vue.openBlock(), vue.createElementBlock("section", {
  22390. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).is("vertical", vue.unref(isVertical))])
  22391. }, [
  22392. vue.renderSlot(_ctx.$slots, "default")
  22393. ], 2);
  22394. };
  22395. }
  22396. });
  22397. var Container = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["__file", "container.vue"]]);
  22398. const __default__$W = vue.defineComponent({
  22399. name: "ElAside"
  22400. });
  22401. const _sfc_main$1r = /* @__PURE__ */ vue.defineComponent({
  22402. ...__default__$W,
  22403. props: {
  22404. width: {
  22405. type: String,
  22406. default: null
  22407. }
  22408. },
  22409. setup(__props) {
  22410. const props = __props;
  22411. const ns = useNamespace("aside");
  22412. const style = vue.computed(() => props.width ? ns.cssVarBlock({ width: props.width }) : {});
  22413. return (_ctx, _cache) => {
  22414. return vue.openBlock(), vue.createElementBlock("aside", {
  22415. class: vue.normalizeClass(vue.unref(ns).b()),
  22416. style: vue.normalizeStyle(vue.unref(style))
  22417. }, [
  22418. vue.renderSlot(_ctx.$slots, "default")
  22419. ], 6);
  22420. };
  22421. }
  22422. });
  22423. var Aside = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["__file", "aside.vue"]]);
  22424. const __default__$V = vue.defineComponent({
  22425. name: "ElFooter"
  22426. });
  22427. const _sfc_main$1q = /* @__PURE__ */ vue.defineComponent({
  22428. ...__default__$V,
  22429. props: {
  22430. height: {
  22431. type: String,
  22432. default: null
  22433. }
  22434. },
  22435. setup(__props) {
  22436. const props = __props;
  22437. const ns = useNamespace("footer");
  22438. const style = vue.computed(() => props.height ? ns.cssVarBlock({ height: props.height }) : {});
  22439. return (_ctx, _cache) => {
  22440. return vue.openBlock(), vue.createElementBlock("footer", {
  22441. class: vue.normalizeClass(vue.unref(ns).b()),
  22442. style: vue.normalizeStyle(vue.unref(style))
  22443. }, [
  22444. vue.renderSlot(_ctx.$slots, "default")
  22445. ], 6);
  22446. };
  22447. }
  22448. });
  22449. var Footer$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["__file", "footer.vue"]]);
  22450. const __default__$U = vue.defineComponent({
  22451. name: "ElHeader"
  22452. });
  22453. const _sfc_main$1p = /* @__PURE__ */ vue.defineComponent({
  22454. ...__default__$U,
  22455. props: {
  22456. height: {
  22457. type: String,
  22458. default: null
  22459. }
  22460. },
  22461. setup(__props) {
  22462. const props = __props;
  22463. const ns = useNamespace("header");
  22464. const style = vue.computed(() => {
  22465. return props.height ? ns.cssVarBlock({
  22466. height: props.height
  22467. }) : {};
  22468. });
  22469. return (_ctx, _cache) => {
  22470. return vue.openBlock(), vue.createElementBlock("header", {
  22471. class: vue.normalizeClass(vue.unref(ns).b()),
  22472. style: vue.normalizeStyle(vue.unref(style))
  22473. }, [
  22474. vue.renderSlot(_ctx.$slots, "default")
  22475. ], 6);
  22476. };
  22477. }
  22478. });
  22479. var Header$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["__file", "header.vue"]]);
  22480. const __default__$T = vue.defineComponent({
  22481. name: "ElMain"
  22482. });
  22483. const _sfc_main$1o = /* @__PURE__ */ vue.defineComponent({
  22484. ...__default__$T,
  22485. setup(__props) {
  22486. const ns = useNamespace("main");
  22487. return (_ctx, _cache) => {
  22488. return vue.openBlock(), vue.createElementBlock("main", {
  22489. class: vue.normalizeClass(vue.unref(ns).b())
  22490. }, [
  22491. vue.renderSlot(_ctx.$slots, "default")
  22492. ], 2);
  22493. };
  22494. }
  22495. });
  22496. var Main = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["__file", "main.vue"]]);
  22497. const ElContainer = withInstall(Container, {
  22498. Aside,
  22499. Footer: Footer$2,
  22500. Header: Header$1,
  22501. Main
  22502. });
  22503. const ElAside = withNoopInstall(Aside);
  22504. const ElFooter = withNoopInstall(Footer$2);
  22505. const ElHeader = withNoopInstall(Header$1);
  22506. const ElMain = withNoopInstall(Main);
  22507. var advancedFormat$1 = {exports: {}};
  22508. (function(module, exports) {
  22509. !function(e, t) {
  22510. module.exports = t() ;
  22511. }(commonjsGlobal, function() {
  22512. return function(e, t, r) {
  22513. var n = t.prototype, s = n.format;
  22514. r.en.ordinal = function(e2) {
  22515. var t2 = ["th", "st", "nd", "rd"], r2 = e2 % 100;
  22516. return "[" + e2 + (t2[(r2 - 20) % 10] || t2[r2] || t2[0]) + "]";
  22517. }, n.format = function(e2) {
  22518. var t2 = this, r2 = this.$locale();
  22519. if (!this.isValid())
  22520. return s.bind(this)(e2);
  22521. var n2 = this.$utils(), a = (e2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g, function(e3) {
  22522. switch (e3) {
  22523. case "Q":
  22524. return Math.ceil((t2.$M + 1) / 3);
  22525. case "Do":
  22526. return r2.ordinal(t2.$D);
  22527. case "gggg":
  22528. return t2.weekYear();
  22529. case "GGGG":
  22530. return t2.isoWeekYear();
  22531. case "wo":
  22532. return r2.ordinal(t2.week(), "W");
  22533. case "w":
  22534. case "ww":
  22535. return n2.s(t2.week(), e3 === "w" ? 1 : 2, "0");
  22536. case "W":
  22537. case "WW":
  22538. return n2.s(t2.isoWeek(), e3 === "W" ? 1 : 2, "0");
  22539. case "k":
  22540. case "kk":
  22541. return n2.s(String(t2.$H === 0 ? 24 : t2.$H), e3 === "k" ? 1 : 2, "0");
  22542. case "X":
  22543. return Math.floor(t2.$d.getTime() / 1e3);
  22544. case "x":
  22545. return t2.$d.getTime();
  22546. case "z":
  22547. return "[" + t2.offsetName() + "]";
  22548. case "zzz":
  22549. return "[" + t2.offsetName("long") + "]";
  22550. default:
  22551. return e3;
  22552. }
  22553. });
  22554. return s.bind(this)(a);
  22555. };
  22556. };
  22557. });
  22558. })(advancedFormat$1);
  22559. var advancedFormat = advancedFormat$1.exports;
  22560. var weekOfYear$1 = {exports: {}};
  22561. (function(module, exports) {
  22562. !function(e, t) {
  22563. module.exports = t() ;
  22564. }(commonjsGlobal, function() {
  22565. var e = "week", t = "year";
  22566. return function(i, n, r) {
  22567. var f = n.prototype;
  22568. f.week = function(i2) {
  22569. if (i2 === void 0 && (i2 = null), i2 !== null)
  22570. return this.add(7 * (i2 - this.week()), "day");
  22571. var n2 = this.$locale().yearStart || 1;
  22572. if (this.month() === 11 && this.date() > 25) {
  22573. var f2 = r(this).startOf(t).add(1, t).date(n2), s = r(this).endOf(e);
  22574. if (f2.isBefore(s))
  22575. return 1;
  22576. }
  22577. var a = r(this).startOf(t).date(n2).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, true);
  22578. return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
  22579. }, f.weeks = function(e2) {
  22580. return e2 === void 0 && (e2 = null), this.week(e2);
  22581. };
  22582. };
  22583. });
  22584. })(weekOfYear$1);
  22585. var weekOfYear = weekOfYear$1.exports;
  22586. var weekYear$1 = {exports: {}};
  22587. (function(module, exports) {
  22588. !function(e, t) {
  22589. module.exports = t() ;
  22590. }(commonjsGlobal, function() {
  22591. return function(e, t) {
  22592. t.prototype.weekYear = function() {
  22593. var e2 = this.month(), t2 = this.week(), n = this.year();
  22594. return t2 === 1 && e2 === 11 ? n + 1 : e2 === 0 && t2 >= 52 ? n - 1 : n;
  22595. };
  22596. };
  22597. });
  22598. })(weekYear$1);
  22599. var weekYear = weekYear$1.exports;
  22600. var dayOfYear$1 = {exports: {}};
  22601. (function(module, exports) {
  22602. !function(e, t) {
  22603. module.exports = t() ;
  22604. }(commonjsGlobal, function() {
  22605. return function(e, t, n) {
  22606. t.prototype.dayOfYear = function(e2) {
  22607. var t2 = Math.round((n(this).startOf("day") - n(this).startOf("year")) / 864e5) + 1;
  22608. return e2 == null ? t2 : this.add(e2 - t2, "day");
  22609. };
  22610. };
  22611. });
  22612. })(dayOfYear$1);
  22613. var dayOfYear = dayOfYear$1.exports;
  22614. var isSameOrAfter$1 = {exports: {}};
  22615. (function(module, exports) {
  22616. !function(e, t) {
  22617. module.exports = t() ;
  22618. }(commonjsGlobal, function() {
  22619. return function(e, t) {
  22620. t.prototype.isSameOrAfter = function(e2, t2) {
  22621. return this.isSame(e2, t2) || this.isAfter(e2, t2);
  22622. };
  22623. };
  22624. });
  22625. })(isSameOrAfter$1);
  22626. var isSameOrAfter = isSameOrAfter$1.exports;
  22627. var isSameOrBefore$1 = {exports: {}};
  22628. (function(module, exports) {
  22629. !function(e, i) {
  22630. module.exports = i() ;
  22631. }(commonjsGlobal, function() {
  22632. return function(e, i) {
  22633. i.prototype.isSameOrBefore = function(e2, i2) {
  22634. return this.isSame(e2, i2) || this.isBefore(e2, i2);
  22635. };
  22636. };
  22637. });
  22638. })(isSameOrBefore$1);
  22639. var isSameOrBefore = isSameOrBefore$1.exports;
  22640. const datePickerProps = buildProps({
  22641. type: {
  22642. type: definePropType(String),
  22643. default: "date"
  22644. }
  22645. });
  22646. const selectionModes = ["date", "dates", "year", "month", "week", "range"];
  22647. const datePickerSharedProps = buildProps({
  22648. disabledDate: {
  22649. type: definePropType(Function)
  22650. },
  22651. date: {
  22652. type: definePropType(Object),
  22653. required: true
  22654. },
  22655. minDate: {
  22656. type: definePropType(Object)
  22657. },
  22658. maxDate: {
  22659. type: definePropType(Object)
  22660. },
  22661. parsedValue: {
  22662. type: definePropType([Object, Array])
  22663. },
  22664. rangeState: {
  22665. type: definePropType(Object),
  22666. default: () => ({
  22667. endDate: null,
  22668. selecting: false
  22669. })
  22670. }
  22671. });
  22672. const panelSharedProps = buildProps({
  22673. type: {
  22674. type: definePropType(String),
  22675. required: true,
  22676. values: datePickTypes
  22677. }
  22678. });
  22679. const panelRangeSharedProps = buildProps({
  22680. unlinkPanels: Boolean,
  22681. parsedValue: {
  22682. type: definePropType(Array)
  22683. }
  22684. });
  22685. const selectionModeWithDefault = (mode) => {
  22686. return {
  22687. type: String,
  22688. values: selectionModes,
  22689. default: mode
  22690. };
  22691. };
  22692. const panelDatePickProps = buildProps({
  22693. ...panelSharedProps,
  22694. parsedValue: {
  22695. type: definePropType([Object, Array])
  22696. },
  22697. visible: {
  22698. type: Boolean
  22699. },
  22700. format: {
  22701. type: String,
  22702. default: ""
  22703. }
  22704. });
  22705. const basicDateTableProps = buildProps({
  22706. ...datePickerSharedProps,
  22707. cellClassName: {
  22708. type: definePropType(Function)
  22709. },
  22710. showWeekNumber: Boolean,
  22711. selectionMode: selectionModeWithDefault("date")
  22712. });
  22713. const isValidRange = (range) => {
  22714. if (!isArray(range))
  22715. return false;
  22716. const [left, right] = range;
  22717. return dayjs.isDayjs(left) && dayjs.isDayjs(right) && left.isSameOrBefore(right);
  22718. };
  22719. const getDefaultValue = (defaultValue, { lang, unit, unlinkPanels }) => {
  22720. let start;
  22721. if (isArray(defaultValue)) {
  22722. let [left, right] = defaultValue.map((d) => dayjs(d).locale(lang));
  22723. if (!unlinkPanels) {
  22724. right = left.add(1, unit);
  22725. }
  22726. return [left, right];
  22727. } else if (defaultValue) {
  22728. start = dayjs(defaultValue);
  22729. } else {
  22730. start = dayjs();
  22731. }
  22732. start = start.locale(lang);
  22733. return [start, start.add(1, unit)];
  22734. };
  22735. const buildPickerTable = (dimension, rows, {
  22736. columnIndexOffset,
  22737. startDate,
  22738. nextEndDate,
  22739. now,
  22740. unit,
  22741. relativeDateGetter,
  22742. setCellMetadata,
  22743. setRowMetadata
  22744. }) => {
  22745. for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {
  22746. const row = rows[rowIndex];
  22747. for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {
  22748. let cell = row[columnIndex + columnIndexOffset];
  22749. if (!cell) {
  22750. cell = {
  22751. row: rowIndex,
  22752. column: columnIndex,
  22753. type: "normal",
  22754. inRange: false,
  22755. start: false,
  22756. end: false
  22757. };
  22758. }
  22759. const index = rowIndex * dimension.column + columnIndex;
  22760. const nextStartDate = relativeDateGetter(index);
  22761. cell.dayjs = nextStartDate;
  22762. cell.date = nextStartDate.toDate();
  22763. cell.timestamp = nextStartDate.valueOf();
  22764. cell.type = "normal";
  22765. cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit));
  22766. if (startDate == null ? void 0 : startDate.isSameOrAfter(nextEndDate)) {
  22767. cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  22768. cell.end = startDate && nextStartDate.isSame(startDate, unit);
  22769. } else {
  22770. cell.start = !!startDate && nextStartDate.isSame(startDate, unit);
  22771. cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  22772. }
  22773. const isToday = nextStartDate.isSame(now, unit);
  22774. if (isToday) {
  22775. cell.type = "today";
  22776. }
  22777. setCellMetadata == null ? void 0 : setCellMetadata(cell, { rowIndex, columnIndex });
  22778. row[columnIndex + columnIndexOffset] = cell;
  22779. }
  22780. setRowMetadata == null ? void 0 : setRowMetadata(row);
  22781. }
  22782. };
  22783. const basicCellProps = buildProps({
  22784. cell: {
  22785. type: definePropType(Object)
  22786. }
  22787. });
  22788. var ElDatePickerCell = vue.defineComponent({
  22789. name: "ElDatePickerCell",
  22790. props: basicCellProps,
  22791. setup(props) {
  22792. const ns = useNamespace("date-table-cell");
  22793. const {
  22794. slots
  22795. } = vue.inject(ROOT_PICKER_INJECTION_KEY);
  22796. return () => {
  22797. const {
  22798. cell
  22799. } = props;
  22800. if (slots.default) {
  22801. const list = slots.default(cell).filter((item) => {
  22802. return item.patchFlag !== -2 && item.type.toString() !== "Symbol(Comment)";
  22803. });
  22804. if (list.length) {
  22805. return list;
  22806. }
  22807. }
  22808. return vue.createVNode("div", {
  22809. "class": ns.b()
  22810. }, [vue.createVNode("span", {
  22811. "class": ns.e("text")
  22812. }, [cell == null ? void 0 : cell.text])]);
  22813. };
  22814. }
  22815. });
  22816. const _hoisted_1$J = ["aria-label", "onMousedown"];
  22817. const _hoisted_2$t = {
  22818. key: 0,
  22819. scope: "col"
  22820. };
  22821. const _hoisted_3$f = ["aria-label"];
  22822. const _hoisted_4$b = ["aria-current", "aria-selected", "tabindex"];
  22823. const _sfc_main$1n = /* @__PURE__ */ vue.defineComponent({
  22824. __name: "basic-date-table",
  22825. props: basicDateTableProps,
  22826. emits: ["changerange", "pick", "select"],
  22827. setup(__props, { expose, emit }) {
  22828. const props = __props;
  22829. const ns = useNamespace("date-table");
  22830. const { t, lang } = useLocale();
  22831. const tbodyRef = vue.ref();
  22832. const currentCellRef = vue.ref();
  22833. const lastRow = vue.ref();
  22834. const lastColumn = vue.ref();
  22835. const tableRows = vue.ref([[], [], [], [], [], []]);
  22836. let focusWithClick = false;
  22837. const firstDayOfWeek = props.date.$locale().weekStart || 7;
  22838. const WEEKS_CONSTANT = props.date.locale("en").localeData().weekdaysShort().map((_) => _.toLowerCase());
  22839. const offsetDay = vue.computed(() => {
  22840. return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek;
  22841. });
  22842. const startDate = vue.computed(() => {
  22843. const startDayOfMonth = props.date.startOf("month");
  22844. return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
  22845. });
  22846. const WEEKS = vue.computed(() => {
  22847. return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7);
  22848. });
  22849. const hasCurrent = vue.computed(() => {
  22850. return flatten(rows.value).some((row) => {
  22851. return row.isCurrent;
  22852. });
  22853. });
  22854. const days = vue.computed(() => {
  22855. const startOfMonth = props.date.startOf("month");
  22856. const startOfMonthDay = startOfMonth.day() || 7;
  22857. const dateCountOfMonth = startOfMonth.daysInMonth();
  22858. const dateCountOfLastMonth = startOfMonth.subtract(1, "month").daysInMonth();
  22859. return {
  22860. startOfMonthDay,
  22861. dateCountOfMonth,
  22862. dateCountOfLastMonth
  22863. };
  22864. });
  22865. const selectedDate = vue.computed(() => {
  22866. return props.selectionMode === "dates" ? castArray(props.parsedValue) : [];
  22867. });
  22868. const setDateText = (cell, {
  22869. count,
  22870. rowIndex,
  22871. columnIndex
  22872. }) => {
  22873. const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = vue.unref(days);
  22874. const offset = vue.unref(offsetDay);
  22875. if (rowIndex >= 0 && rowIndex <= 1) {
  22876. const numberOfDaysFromPreviousMonth = startOfMonthDay + offset < 0 ? 7 + startOfMonthDay + offset : startOfMonthDay + offset;
  22877. if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) {
  22878. cell.text = count;
  22879. return true;
  22880. } else {
  22881. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7;
  22882. cell.type = "prev-month";
  22883. }
  22884. } else {
  22885. if (count <= dateCountOfMonth) {
  22886. cell.text = count;
  22887. } else {
  22888. cell.text = count - dateCountOfMonth;
  22889. cell.type = "next-month";
  22890. }
  22891. return true;
  22892. }
  22893. return false;
  22894. };
  22895. const setCellMetadata = (cell, {
  22896. columnIndex,
  22897. rowIndex
  22898. }, count) => {
  22899. const { disabledDate, cellClassName } = props;
  22900. const _selectedDate = vue.unref(selectedDate);
  22901. const shouldIncrement = setDateText(cell, { count, rowIndex, columnIndex });
  22902. const cellDate = cell.dayjs.toDate();
  22903. cell.selected = _selectedDate.find((d) => d.valueOf() === cell.dayjs.valueOf());
  22904. cell.isSelected = !!cell.selected;
  22905. cell.isCurrent = isCurrent(cell);
  22906. cell.disabled = disabledDate == null ? void 0 : disabledDate(cellDate);
  22907. cell.customClass = cellClassName == null ? void 0 : cellClassName(cellDate);
  22908. return shouldIncrement;
  22909. };
  22910. const setRowMetadata = (row) => {
  22911. if (props.selectionMode === "week") {
  22912. const [start, end] = props.showWeekNumber ? [1, 7] : [0, 6];
  22913. const isActive = isWeekActive(row[start + 1]);
  22914. row[start].inRange = isActive;
  22915. row[start].start = isActive;
  22916. row[end].inRange = isActive;
  22917. row[end].end = isActive;
  22918. }
  22919. };
  22920. const rows = vue.computed(() => {
  22921. const { minDate, maxDate, rangeState, showWeekNumber } = props;
  22922. const offset = offsetDay.value;
  22923. const rows_ = tableRows.value;
  22924. const dateUnit = "day";
  22925. let count = 1;
  22926. if (showWeekNumber) {
  22927. for (let rowIndex = 0; rowIndex < 6; rowIndex++) {
  22928. if (!rows_[rowIndex][0]) {
  22929. rows_[rowIndex][0] = {
  22930. type: "week",
  22931. text: startDate.value.add(rowIndex * 7 + 1, dateUnit).week()
  22932. };
  22933. }
  22934. }
  22935. }
  22936. buildPickerTable({ row: 6, column: 7 }, rows_, {
  22937. startDate: minDate,
  22938. columnIndexOffset: showWeekNumber ? 1 : 0,
  22939. nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null,
  22940. now: dayjs().locale(vue.unref(lang)).startOf(dateUnit),
  22941. unit: dateUnit,
  22942. relativeDateGetter: (idx) => startDate.value.add(idx - offset, dateUnit),
  22943. setCellMetadata: (...args) => {
  22944. if (setCellMetadata(...args, count)) {
  22945. count += 1;
  22946. }
  22947. },
  22948. setRowMetadata
  22949. });
  22950. return rows_;
  22951. });
  22952. vue.watch(() => props.date, async () => {
  22953. var _a, _b;
  22954. if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
  22955. await vue.nextTick();
  22956. (_b = currentCellRef.value) == null ? void 0 : _b.focus();
  22957. }
  22958. });
  22959. const focus = async () => {
  22960. var _a;
  22961. (_a = currentCellRef.value) == null ? void 0 : _a.focus();
  22962. };
  22963. const isNormalDay = (type = "") => {
  22964. return ["normal", "today"].includes(type);
  22965. };
  22966. const isCurrent = (cell) => {
  22967. return props.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props.parsedValue);
  22968. };
  22969. const cellMatchesDate = (cell, date) => {
  22970. if (!date)
  22971. return false;
  22972. return dayjs(date).locale(lang.value).isSame(props.date.date(Number(cell.text)), "day");
  22973. };
  22974. const getCellClasses = (cell) => {
  22975. const classes = [];
  22976. if (isNormalDay(cell.type) && !cell.disabled) {
  22977. classes.push("available");
  22978. if (cell.type === "today") {
  22979. classes.push("today");
  22980. }
  22981. } else {
  22982. classes.push(cell.type);
  22983. }
  22984. if (isCurrent(cell)) {
  22985. classes.push("current");
  22986. }
  22987. if (cell.inRange && (isNormalDay(cell.type) || props.selectionMode === "week")) {
  22988. classes.push("in-range");
  22989. if (cell.start) {
  22990. classes.push("start-date");
  22991. }
  22992. if (cell.end) {
  22993. classes.push("end-date");
  22994. }
  22995. }
  22996. if (cell.disabled) {
  22997. classes.push("disabled");
  22998. }
  22999. if (cell.selected) {
  23000. classes.push("selected");
  23001. }
  23002. if (cell.customClass) {
  23003. classes.push(cell.customClass);
  23004. }
  23005. return classes.join(" ");
  23006. };
  23007. const getDateOfCell = (row, column) => {
  23008. const offsetFromStart = row * 7 + (column - (props.showWeekNumber ? 1 : 0)) - offsetDay.value;
  23009. return startDate.value.add(offsetFromStart, "day");
  23010. };
  23011. const handleMouseMove = (event) => {
  23012. var _a;
  23013. if (!props.rangeState.selecting)
  23014. return;
  23015. let target = event.target;
  23016. if (target.tagName === "SPAN") {
  23017. target = (_a = target.parentNode) == null ? void 0 : _a.parentNode;
  23018. }
  23019. if (target.tagName === "DIV") {
  23020. target = target.parentNode;
  23021. }
  23022. if (target.tagName !== "TD")
  23023. return;
  23024. const row = target.parentNode.rowIndex - 1;
  23025. const column = target.cellIndex;
  23026. if (rows.value[row][column].disabled)
  23027. return;
  23028. if (row !== lastRow.value || column !== lastColumn.value) {
  23029. lastRow.value = row;
  23030. lastColumn.value = column;
  23031. emit("changerange", {
  23032. selecting: true,
  23033. endDate: getDateOfCell(row, column)
  23034. });
  23035. }
  23036. };
  23037. const isSelectedCell = (cell) => {
  23038. return !hasCurrent.value && (cell == null ? void 0 : cell.text) === 1 && cell.type === "normal" || cell.isCurrent;
  23039. };
  23040. const handleFocus = (event) => {
  23041. if (focusWithClick || hasCurrent.value || props.selectionMode !== "date")
  23042. return;
  23043. handlePickDate(event, true);
  23044. };
  23045. const handleMouseDown = (event) => {
  23046. const target = event.target.closest("td");
  23047. if (!target)
  23048. return;
  23049. focusWithClick = true;
  23050. };
  23051. const handleMouseUp = (event) => {
  23052. const target = event.target.closest("td");
  23053. if (!target)
  23054. return;
  23055. focusWithClick = false;
  23056. };
  23057. const handlePickDate = (event, isKeyboardMovement = false) => {
  23058. const target = event.target.closest("td");
  23059. if (!target)
  23060. return;
  23061. const row = target.parentNode.rowIndex - 1;
  23062. const column = target.cellIndex;
  23063. const cell = rows.value[row][column];
  23064. if (cell.disabled || cell.type === "week")
  23065. return;
  23066. const newDate = getDateOfCell(row, column);
  23067. if (props.selectionMode === "range") {
  23068. if (!props.rangeState.selecting || !props.minDate) {
  23069. emit("pick", { minDate: newDate, maxDate: null });
  23070. emit("select", true);
  23071. } else {
  23072. if (newDate >= props.minDate) {
  23073. emit("pick", { minDate: props.minDate, maxDate: newDate });
  23074. } else {
  23075. emit("pick", { minDate: newDate, maxDate: props.minDate });
  23076. }
  23077. emit("select", false);
  23078. }
  23079. } else if (props.selectionMode === "date") {
  23080. emit("pick", newDate, isKeyboardMovement);
  23081. } else if (props.selectionMode === "week") {
  23082. const weekNumber = newDate.week();
  23083. const value = `${newDate.year()}w${weekNumber}`;
  23084. emit("pick", {
  23085. year: newDate.year(),
  23086. week: weekNumber,
  23087. value,
  23088. date: newDate.startOf("week")
  23089. });
  23090. } else if (props.selectionMode === "dates") {
  23091. const newValue = cell.selected ? castArray(props.parsedValue).filter((d) => (d == null ? void 0 : d.valueOf()) !== newDate.valueOf()) : castArray(props.parsedValue).concat([newDate]);
  23092. emit("pick", newValue);
  23093. }
  23094. };
  23095. const isWeekActive = (cell) => {
  23096. if (props.selectionMode !== "week")
  23097. return false;
  23098. let newDate = props.date.startOf("day");
  23099. if (cell.type === "prev-month") {
  23100. newDate = newDate.subtract(1, "month");
  23101. }
  23102. if (cell.type === "next-month") {
  23103. newDate = newDate.add(1, "month");
  23104. }
  23105. newDate = newDate.date(Number.parseInt(cell.text, 10));
  23106. if (props.parsedValue && !Array.isArray(props.parsedValue)) {
  23107. const dayOffset = (props.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
  23108. const weekDate = props.parsedValue.subtract(dayOffset, "day");
  23109. return weekDate.isSame(newDate, "day");
  23110. }
  23111. return false;
  23112. };
  23113. expose({
  23114. focus
  23115. });
  23116. return (_ctx, _cache) => {
  23117. return vue.openBlock(), vue.createElementBlock("table", {
  23118. role: "grid",
  23119. "aria-label": vue.unref(t)("el.datepicker.dateTablePrompt"),
  23120. cellspacing: "0",
  23121. cellpadding: "0",
  23122. class: vue.normalizeClass([vue.unref(ns).b(), { "is-week-mode": _ctx.selectionMode === "week" }]),
  23123. onClick: handlePickDate,
  23124. onMousemove: handleMouseMove,
  23125. onMousedown: vue.withModifiers(handleMouseDown, ["prevent"]),
  23126. onMouseup: handleMouseUp
  23127. }, [
  23128. vue.createElementVNode("tbody", {
  23129. ref_key: "tbodyRef",
  23130. ref: tbodyRef
  23131. }, [
  23132. vue.createElementVNode("tr", null, [
  23133. _ctx.showWeekNumber ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_2$t, vue.toDisplayString(vue.unref(t)("el.datepicker.week")), 1)) : vue.createCommentVNode("v-if", true),
  23134. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(WEEKS), (week, key) => {
  23135. return vue.openBlock(), vue.createElementBlock("th", {
  23136. key,
  23137. scope: "col",
  23138. "aria-label": vue.unref(t)("el.datepicker.weeksFull." + week)
  23139. }, vue.toDisplayString(vue.unref(t)("el.datepicker.weeks." + week)), 9, _hoisted_3$f);
  23140. }), 128))
  23141. ]),
  23142. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rows), (row, rowKey) => {
  23143. return vue.openBlock(), vue.createElementBlock("tr", {
  23144. key: rowKey,
  23145. class: vue.normalizeClass([vue.unref(ns).e("row"), { current: isWeekActive(row[1]) }])
  23146. }, [
  23147. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, columnKey) => {
  23148. return vue.openBlock(), vue.createElementBlock("td", {
  23149. key: `${rowKey}.${columnKey}`,
  23150. ref_for: true,
  23151. ref: (el) => isSelectedCell(cell) && (currentCellRef.value = el),
  23152. class: vue.normalizeClass(getCellClasses(cell)),
  23153. "aria-current": cell.isCurrent ? "date" : void 0,
  23154. "aria-selected": cell.isCurrent,
  23155. tabindex: isSelectedCell(cell) ? 0 : -1,
  23156. onFocus: handleFocus
  23157. }, [
  23158. vue.createVNode(vue.unref(ElDatePickerCell), { cell }, null, 8, ["cell"])
  23159. ], 42, _hoisted_4$b);
  23160. }), 128))
  23161. ], 2);
  23162. }), 128))
  23163. ], 512)
  23164. ], 42, _hoisted_1$J);
  23165. };
  23166. }
  23167. });
  23168. var DateTable = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["__file", "basic-date-table.vue"]]);
  23169. const basicMonthTableProps = buildProps({
  23170. ...datePickerSharedProps,
  23171. selectionMode: selectionModeWithDefault("month")
  23172. });
  23173. const _hoisted_1$I = ["aria-label"];
  23174. const _hoisted_2$s = ["aria-selected", "aria-label", "tabindex", "onKeydown"];
  23175. const _hoisted_3$e = { class: "cell" };
  23176. const _sfc_main$1m = /* @__PURE__ */ vue.defineComponent({
  23177. __name: "basic-month-table",
  23178. props: basicMonthTableProps,
  23179. emits: ["changerange", "pick", "select"],
  23180. setup(__props, { expose, emit }) {
  23181. const props = __props;
  23182. const datesInMonth = (year, month, lang2) => {
  23183. const firstDay = dayjs().locale(lang2).startOf("month").month(month).year(year);
  23184. const numOfDays = firstDay.daysInMonth();
  23185. return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
  23186. };
  23187. const ns = useNamespace("month-table");
  23188. const { t, lang } = useLocale();
  23189. const tbodyRef = vue.ref();
  23190. const currentCellRef = vue.ref();
  23191. const months = vue.ref(props.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase()));
  23192. const tableRows = vue.ref([
  23193. [],
  23194. [],
  23195. []
  23196. ]);
  23197. const lastRow = vue.ref();
  23198. const lastColumn = vue.ref();
  23199. const rows = vue.computed(() => {
  23200. var _a, _b;
  23201. const rows2 = tableRows.value;
  23202. const now = dayjs().locale(lang.value).startOf("month");
  23203. for (let i = 0; i < 3; i++) {
  23204. const row = rows2[i];
  23205. for (let j = 0; j < 4; j++) {
  23206. const cell = row[j] || (row[j] = {
  23207. row: i,
  23208. column: j,
  23209. type: "normal",
  23210. inRange: false,
  23211. start: false,
  23212. end: false,
  23213. text: -1,
  23214. disabled: false
  23215. });
  23216. cell.type = "normal";
  23217. const index = i * 4 + j;
  23218. const calTime = props.date.startOf("year").month(index);
  23219. const calEndDate = props.rangeState.endDate || props.maxDate || props.rangeState.selecting && props.minDate || null;
  23220. cell.inRange = !!(props.minDate && calTime.isSameOrAfter(props.minDate, "month") && calEndDate && calTime.isSameOrBefore(calEndDate, "month")) || !!(props.minDate && calTime.isSameOrBefore(props.minDate, "month") && calEndDate && calTime.isSameOrAfter(calEndDate, "month"));
  23221. if ((_a = props.minDate) == null ? void 0 : _a.isSameOrAfter(calEndDate)) {
  23222. cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  23223. cell.end = props.minDate && calTime.isSame(props.minDate, "month");
  23224. } else {
  23225. cell.start = !!(props.minDate && calTime.isSame(props.minDate, "month"));
  23226. cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  23227. }
  23228. const isToday = now.isSame(calTime);
  23229. if (isToday) {
  23230. cell.type = "today";
  23231. }
  23232. cell.text = index;
  23233. cell.disabled = ((_b = props.disabledDate) == null ? void 0 : _b.call(props, calTime.toDate())) || false;
  23234. }
  23235. }
  23236. return rows2;
  23237. });
  23238. const focus = () => {
  23239. var _a;
  23240. (_a = currentCellRef.value) == null ? void 0 : _a.focus();
  23241. };
  23242. const getCellStyle = (cell) => {
  23243. const style = {};
  23244. const year = props.date.year();
  23245. const today = new Date();
  23246. const month = cell.text;
  23247. style.disabled = props.disabledDate ? datesInMonth(year, month, lang.value).every(props.disabledDate) : false;
  23248. style.current = castArray(props.parsedValue).findIndex((date) => dayjs.isDayjs(date) && date.year() === year && date.month() === month) >= 0;
  23249. style.today = today.getFullYear() === year && today.getMonth() === month;
  23250. if (cell.inRange) {
  23251. style["in-range"] = true;
  23252. if (cell.start) {
  23253. style["start-date"] = true;
  23254. }
  23255. if (cell.end) {
  23256. style["end-date"] = true;
  23257. }
  23258. }
  23259. return style;
  23260. };
  23261. const isSelectedCell = (cell) => {
  23262. const year = props.date.year();
  23263. const month = cell.text;
  23264. return castArray(props.date).findIndex((date) => date.year() === year && date.month() === month) >= 0;
  23265. };
  23266. const handleMouseMove = (event) => {
  23267. var _a;
  23268. if (!props.rangeState.selecting)
  23269. return;
  23270. let target = event.target;
  23271. if (target.tagName === "A") {
  23272. target = (_a = target.parentNode) == null ? void 0 : _a.parentNode;
  23273. }
  23274. if (target.tagName === "DIV") {
  23275. target = target.parentNode;
  23276. }
  23277. if (target.tagName !== "TD")
  23278. return;
  23279. const row = target.parentNode.rowIndex;
  23280. const column = target.cellIndex;
  23281. if (rows.value[row][column].disabled)
  23282. return;
  23283. if (row !== lastRow.value || column !== lastColumn.value) {
  23284. lastRow.value = row;
  23285. lastColumn.value = column;
  23286. emit("changerange", {
  23287. selecting: true,
  23288. endDate: props.date.startOf("year").month(row * 4 + column)
  23289. });
  23290. }
  23291. };
  23292. const handleMonthTableClick = (event) => {
  23293. var _a;
  23294. const target = (_a = event.target) == null ? void 0 : _a.closest("td");
  23295. if ((target == null ? void 0 : target.tagName) !== "TD")
  23296. return;
  23297. if (hasClass(target, "disabled"))
  23298. return;
  23299. const column = target.cellIndex;
  23300. const row = target.parentNode.rowIndex;
  23301. const month = row * 4 + column;
  23302. const newDate = props.date.startOf("year").month(month);
  23303. if (props.selectionMode === "range") {
  23304. if (!props.rangeState.selecting) {
  23305. emit("pick", { minDate: newDate, maxDate: null });
  23306. emit("select", true);
  23307. } else {
  23308. if (props.minDate && newDate >= props.minDate) {
  23309. emit("pick", { minDate: props.minDate, maxDate: newDate });
  23310. } else {
  23311. emit("pick", { minDate: newDate, maxDate: props.minDate });
  23312. }
  23313. emit("select", false);
  23314. }
  23315. } else {
  23316. emit("pick", month);
  23317. }
  23318. };
  23319. vue.watch(() => props.date, async () => {
  23320. var _a, _b;
  23321. if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
  23322. await vue.nextTick();
  23323. (_b = currentCellRef.value) == null ? void 0 : _b.focus();
  23324. }
  23325. });
  23326. expose({
  23327. focus
  23328. });
  23329. return (_ctx, _cache) => {
  23330. return vue.openBlock(), vue.createElementBlock("table", {
  23331. role: "grid",
  23332. "aria-label": vue.unref(t)("el.datepicker.monthTablePrompt"),
  23333. class: vue.normalizeClass(vue.unref(ns).b()),
  23334. onClick: handleMonthTableClick,
  23335. onMousemove: handleMouseMove
  23336. }, [
  23337. vue.createElementVNode("tbody", {
  23338. ref_key: "tbodyRef",
  23339. ref: tbodyRef
  23340. }, [
  23341. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(rows), (row, key) => {
  23342. return vue.openBlock(), vue.createElementBlock("tr", { key }, [
  23343. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(row, (cell, key_) => {
  23344. return vue.openBlock(), vue.createElementBlock("td", {
  23345. key: key_,
  23346. ref_for: true,
  23347. ref: (el) => isSelectedCell(cell) && (currentCellRef.value = el),
  23348. class: vue.normalizeClass(getCellStyle(cell)),
  23349. "aria-selected": `${isSelectedCell(cell)}`,
  23350. "aria-label": vue.unref(t)(`el.datepicker.month${+cell.text + 1}`),
  23351. tabindex: isSelectedCell(cell) ? 0 : -1,
  23352. onKeydown: [
  23353. vue.withKeys(vue.withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["space"]),
  23354. vue.withKeys(vue.withModifiers(handleMonthTableClick, ["prevent", "stop"]), ["enter"])
  23355. ]
  23356. }, [
  23357. vue.createElementVNode("div", null, [
  23358. vue.createElementVNode("span", _hoisted_3$e, vue.toDisplayString(vue.unref(t)("el.datepicker.months." + months.value[cell.text])), 1)
  23359. ])
  23360. ], 42, _hoisted_2$s);
  23361. }), 128))
  23362. ]);
  23363. }), 128))
  23364. ], 512)
  23365. ], 42, _hoisted_1$I);
  23366. };
  23367. }
  23368. });
  23369. var MonthTable = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__file", "basic-month-table.vue"]]);
  23370. const { date, disabledDate, parsedValue } = datePickerSharedProps;
  23371. const basicYearTableProps = buildProps({
  23372. date,
  23373. disabledDate,
  23374. parsedValue
  23375. });
  23376. const _hoisted_1$H = ["aria-label"];
  23377. const _hoisted_2$r = ["aria-selected", "tabindex", "onKeydown"];
  23378. const _hoisted_3$d = { class: "cell" };
  23379. const _hoisted_4$a = { key: 1 };
  23380. const _sfc_main$1l = /* @__PURE__ */ vue.defineComponent({
  23381. __name: "basic-year-table",
  23382. props: basicYearTableProps,
  23383. emits: ["pick"],
  23384. setup(__props, { expose, emit }) {
  23385. const props = __props;
  23386. const datesInYear = (year, lang2) => {
  23387. const firstDay = dayjs(String(year)).locale(lang2).startOf("year");
  23388. const lastDay = firstDay.endOf("year");
  23389. const numOfDays = lastDay.dayOfYear();
  23390. return rangeArr(numOfDays).map((n) => firstDay.add(n, "day").toDate());
  23391. };
  23392. const ns = useNamespace("year-table");
  23393. const { t, lang } = useLocale();
  23394. const tbodyRef = vue.ref();
  23395. const currentCellRef = vue.ref();
  23396. const startYear = vue.computed(() => {
  23397. return Math.floor(props.date.year() / 10) * 10;
  23398. });
  23399. const focus = () => {
  23400. var _a;
  23401. (_a = currentCellRef.value) == null ? void 0 : _a.focus();
  23402. };
  23403. const getCellKls = (year) => {
  23404. const kls = {};
  23405. const today = dayjs().locale(lang.value);
  23406. kls.disabled = props.disabledDate ? datesInYear(year, lang.value).every(props.disabledDate) : false;
  23407. kls.current = castArray(props.parsedValue).findIndex((d) => d.year() === year) >= 0;
  23408. kls.today = today.year() === year;
  23409. return kls;
  23410. };
  23411. const isSelectedCell = (year) => {
  23412. return year === startYear.value && props.date.year() < startYear.value && props.date.year() > startYear.value + 9 || castArray(props.date).findIndex((date) => date.year() === year) >= 0;
  23413. };
  23414. const handleYearTableClick = (event) => {
  23415. const clickTarget = event.target;
  23416. const target = clickTarget.closest("td");
  23417. if (target && target.textContent) {
  23418. if (hasClass(target, "disabled"))
  23419. return;
  23420. const year = target.textContent || target.innerText;
  23421. emit("pick", Number(year));
  23422. }
  23423. };
  23424. vue.watch(() => props.date, async () => {
  23425. var _a, _b;
  23426. if ((_a = tbodyRef.value) == null ? void 0 : _a.contains(document.activeElement)) {
  23427. await vue.nextTick();
  23428. (_b = currentCellRef.value) == null ? void 0 : _b.focus();
  23429. }
  23430. });
  23431. expose({
  23432. focus
  23433. });
  23434. return (_ctx, _cache) => {
  23435. return vue.openBlock(), vue.createElementBlock("table", {
  23436. role: "grid",
  23437. "aria-label": vue.unref(t)("el.datepicker.yearTablePrompt"),
  23438. class: vue.normalizeClass(vue.unref(ns).b()),
  23439. onClick: handleYearTableClick
  23440. }, [
  23441. vue.createElementVNode("tbody", {
  23442. ref_key: "tbodyRef",
  23443. ref: tbodyRef
  23444. }, [
  23445. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(3, (_, i) => {
  23446. return vue.createElementVNode("tr", { key: i }, [
  23447. (vue.openBlock(), vue.createElementBlock(vue.Fragment, null, vue.renderList(4, (__, j) => {
  23448. return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
  23449. key: i + "_" + j
  23450. }, [
  23451. i * 4 + j < 10 ? (vue.openBlock(), vue.createElementBlock("td", {
  23452. key: 0,
  23453. ref_for: true,
  23454. ref: (el) => isSelectedCell(vue.unref(startYear) + i * 4 + j) && (currentCellRef.value = el),
  23455. class: vue.normalizeClass(["available", getCellKls(vue.unref(startYear) + i * 4 + j)]),
  23456. "aria-selected": `${isSelectedCell(vue.unref(startYear) + i * 4 + j)}`,
  23457. tabindex: isSelectedCell(vue.unref(startYear) + i * 4 + j) ? 0 : -1,
  23458. onKeydown: [
  23459. vue.withKeys(vue.withModifiers(handleYearTableClick, ["prevent", "stop"]), ["space"]),
  23460. vue.withKeys(vue.withModifiers(handleYearTableClick, ["prevent", "stop"]), ["enter"])
  23461. ]
  23462. }, [
  23463. vue.createElementVNode("span", _hoisted_3$d, vue.toDisplayString(vue.unref(startYear) + i * 4 + j), 1)
  23464. ], 42, _hoisted_2$r)) : (vue.openBlock(), vue.createElementBlock("td", _hoisted_4$a))
  23465. ], 64);
  23466. }), 64))
  23467. ]);
  23468. }), 64))
  23469. ], 512)
  23470. ], 10, _hoisted_1$H);
  23471. };
  23472. }
  23473. });
  23474. var YearTable = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__file", "basic-year-table.vue"]]);
  23475. const _hoisted_1$G = ["onClick"];
  23476. const _hoisted_2$q = ["aria-label"];
  23477. const _hoisted_3$c = ["aria-label"];
  23478. const _hoisted_4$9 = ["aria-label"];
  23479. const _hoisted_5$7 = ["aria-label"];
  23480. const _sfc_main$1k = /* @__PURE__ */ vue.defineComponent({
  23481. __name: "panel-date-pick",
  23482. props: panelDatePickProps,
  23483. emits: ["pick", "set-picker-option", "panel-change"],
  23484. setup(__props, { emit: contextEmit }) {
  23485. const props = __props;
  23486. const timeWithinRange = (_, __, ___) => true;
  23487. const ppNs = useNamespace("picker-panel");
  23488. const dpNs = useNamespace("date-picker");
  23489. const attrs = vue.useAttrs();
  23490. const slots = vue.useSlots();
  23491. const { t, lang } = useLocale();
  23492. const pickerBase = vue.inject("EP_PICKER_BASE");
  23493. const popper = vue.inject(TOOLTIP_INJECTION_KEY);
  23494. const { shortcuts, disabledDate, cellClassName, defaultTime, arrowControl } = pickerBase.props;
  23495. const defaultValue = vue.toRef(pickerBase.props, "defaultValue");
  23496. const currentViewRef = vue.ref();
  23497. const innerDate = vue.ref(dayjs().locale(lang.value));
  23498. const isChangeToNow = vue.ref(false);
  23499. const defaultTimeD = vue.computed(() => {
  23500. return dayjs(defaultTime).locale(lang.value);
  23501. });
  23502. const month = vue.computed(() => {
  23503. return innerDate.value.month();
  23504. });
  23505. const year = vue.computed(() => {
  23506. return innerDate.value.year();
  23507. });
  23508. const selectableRange = vue.ref([]);
  23509. const userInputDate = vue.ref(null);
  23510. const userInputTime = vue.ref(null);
  23511. const checkDateWithinRange = (date) => {
  23512. return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || "HH:mm:ss") : true;
  23513. };
  23514. const formatEmit = (emitDayjs) => {
  23515. if (defaultTime && !visibleTime.value && !isChangeToNow.value) {
  23516. return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  23517. }
  23518. if (showTime.value)
  23519. return emitDayjs.millisecond(0);
  23520. return emitDayjs.startOf("day");
  23521. };
  23522. const emit = (value, ...args) => {
  23523. if (!value) {
  23524. contextEmit("pick", value, ...args);
  23525. } else if (isArray(value)) {
  23526. const dates = value.map(formatEmit);
  23527. contextEmit("pick", dates, ...args);
  23528. } else {
  23529. contextEmit("pick", formatEmit(value), ...args);
  23530. }
  23531. userInputDate.value = null;
  23532. userInputTime.value = null;
  23533. isChangeToNow.value = false;
  23534. };
  23535. const handleDatePick = (value, keepOpen) => {
  23536. if (selectionMode.value === "date") {
  23537. value = value;
  23538. let newDate = props.parsedValue ? props.parsedValue.year(value.year()).month(value.month()).date(value.date()) : value;
  23539. if (!checkDateWithinRange(newDate)) {
  23540. newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
  23541. }
  23542. innerDate.value = newDate;
  23543. emit(newDate, showTime.value || keepOpen);
  23544. } else if (selectionMode.value === "week") {
  23545. emit(value.date);
  23546. } else if (selectionMode.value === "dates") {
  23547. emit(value, true);
  23548. }
  23549. };
  23550. const moveByMonth = (forward) => {
  23551. const action = forward ? "add" : "subtract";
  23552. innerDate.value = innerDate.value[action](1, "month");
  23553. handlePanelChange("month");
  23554. };
  23555. const moveByYear = (forward) => {
  23556. const currentDate = innerDate.value;
  23557. const action = forward ? "add" : "subtract";
  23558. innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
  23559. handlePanelChange("year");
  23560. };
  23561. const currentView = vue.ref("date");
  23562. const yearLabel = vue.computed(() => {
  23563. const yearTranslation = t("el.datepicker.year");
  23564. if (currentView.value === "year") {
  23565. const startYear = Math.floor(year.value / 10) * 10;
  23566. if (yearTranslation) {
  23567. return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
  23568. }
  23569. return `${startYear} - ${startYear + 9}`;
  23570. }
  23571. return `${year.value} ${yearTranslation}`;
  23572. });
  23573. const handleShortcutClick = (shortcut) => {
  23574. const shortcutValue = isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
  23575. if (shortcutValue) {
  23576. emit(dayjs(shortcutValue).locale(lang.value));
  23577. return;
  23578. }
  23579. if (shortcut.onClick) {
  23580. shortcut.onClick({
  23581. attrs,
  23582. slots,
  23583. emit: contextEmit
  23584. });
  23585. }
  23586. };
  23587. const selectionMode = vue.computed(() => {
  23588. const { type } = props;
  23589. if (["week", "month", "year", "dates"].includes(type))
  23590. return type;
  23591. return "date";
  23592. });
  23593. const keyboardMode = vue.computed(() => {
  23594. return selectionMode.value === "date" ? currentView.value : selectionMode.value;
  23595. });
  23596. const hasShortcuts = vue.computed(() => !!shortcuts.length);
  23597. const handleMonthPick = async (month2) => {
  23598. innerDate.value = innerDate.value.startOf("month").month(month2);
  23599. if (selectionMode.value === "month") {
  23600. emit(innerDate.value, false);
  23601. } else {
  23602. currentView.value = "date";
  23603. if (["month", "year", "date", "week"].includes(selectionMode.value)) {
  23604. emit(innerDate.value, true);
  23605. await vue.nextTick();
  23606. handleFocusPicker();
  23607. }
  23608. }
  23609. handlePanelChange("month");
  23610. };
  23611. const handleYearPick = async (year2) => {
  23612. if (selectionMode.value === "year") {
  23613. innerDate.value = innerDate.value.startOf("year").year(year2);
  23614. emit(innerDate.value, false);
  23615. } else {
  23616. innerDate.value = innerDate.value.year(year2);
  23617. currentView.value = "month";
  23618. if (["month", "year", "date", "week"].includes(selectionMode.value)) {
  23619. emit(innerDate.value, true);
  23620. await vue.nextTick();
  23621. handleFocusPicker();
  23622. }
  23623. }
  23624. handlePanelChange("year");
  23625. };
  23626. const showPicker = async (view) => {
  23627. currentView.value = view;
  23628. await vue.nextTick();
  23629. handleFocusPicker();
  23630. };
  23631. const showTime = vue.computed(() => props.type === "datetime" || props.type === "datetimerange");
  23632. const footerVisible = vue.computed(() => {
  23633. return showTime.value || selectionMode.value === "dates";
  23634. });
  23635. const onConfirm = () => {
  23636. if (selectionMode.value === "dates") {
  23637. emit(props.parsedValue);
  23638. } else {
  23639. let result = props.parsedValue;
  23640. if (!result) {
  23641. const defaultTimeD2 = dayjs(defaultTime).locale(lang.value);
  23642. const defaultValueD = getDefaultValue();
  23643. result = defaultTimeD2.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
  23644. }
  23645. innerDate.value = result;
  23646. emit(result);
  23647. }
  23648. };
  23649. const changeToNow = () => {
  23650. const now = dayjs().locale(lang.value);
  23651. const nowDate = now.toDate();
  23652. isChangeToNow.value = true;
  23653. if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
  23654. innerDate.value = dayjs().locale(lang.value);
  23655. emit(innerDate.value);
  23656. }
  23657. };
  23658. const timeFormat = vue.computed(() => {
  23659. return extractTimeFormat(props.format);
  23660. });
  23661. const dateFormat = vue.computed(() => {
  23662. return extractDateFormat(props.format);
  23663. });
  23664. const visibleTime = vue.computed(() => {
  23665. if (userInputTime.value)
  23666. return userInputTime.value;
  23667. if (!props.parsedValue && !defaultValue.value)
  23668. return;
  23669. return (props.parsedValue || innerDate.value).format(timeFormat.value);
  23670. });
  23671. const visibleDate = vue.computed(() => {
  23672. if (userInputDate.value)
  23673. return userInputDate.value;
  23674. if (!props.parsedValue && !defaultValue.value)
  23675. return;
  23676. return (props.parsedValue || innerDate.value).format(dateFormat.value);
  23677. });
  23678. const timePickerVisible = vue.ref(false);
  23679. const onTimePickerInputFocus = () => {
  23680. timePickerVisible.value = true;
  23681. };
  23682. const handleTimePickClose = () => {
  23683. timePickerVisible.value = false;
  23684. };
  23685. const getUnits = (date) => {
  23686. return {
  23687. hour: date.hour(),
  23688. minute: date.minute(),
  23689. second: date.second(),
  23690. year: date.year(),
  23691. month: date.month(),
  23692. date: date.date()
  23693. };
  23694. };
  23695. const handleTimePick = (value, visible, first) => {
  23696. const { hour, minute, second } = getUnits(value);
  23697. const newDate = props.parsedValue ? props.parsedValue.hour(hour).minute(minute).second(second) : value;
  23698. innerDate.value = newDate;
  23699. emit(innerDate.value, true);
  23700. if (!first) {
  23701. timePickerVisible.value = visible;
  23702. }
  23703. };
  23704. const handleVisibleTimeChange = (value) => {
  23705. const newDate = dayjs(value, timeFormat.value).locale(lang.value);
  23706. if (newDate.isValid() && checkDateWithinRange(newDate)) {
  23707. const { year: year2, month: month2, date } = getUnits(innerDate.value);
  23708. innerDate.value = newDate.year(year2).month(month2).date(date);
  23709. userInputTime.value = null;
  23710. timePickerVisible.value = false;
  23711. emit(innerDate.value, true);
  23712. }
  23713. };
  23714. const handleVisibleDateChange = (value) => {
  23715. const newDate = dayjs(value, dateFormat.value).locale(lang.value);
  23716. if (newDate.isValid()) {
  23717. if (disabledDate && disabledDate(newDate.toDate())) {
  23718. return;
  23719. }
  23720. const { hour, minute, second } = getUnits(innerDate.value);
  23721. innerDate.value = newDate.hour(hour).minute(minute).second(second);
  23722. userInputDate.value = null;
  23723. emit(innerDate.value, true);
  23724. }
  23725. };
  23726. const isValidValue = (date) => {
  23727. return dayjs.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
  23728. };
  23729. const formatToString = (value) => {
  23730. if (selectionMode.value === "dates") {
  23731. return value.map((_) => _.format(props.format));
  23732. }
  23733. return value.format(props.format);
  23734. };
  23735. const parseUserInput = (value) => {
  23736. return dayjs(value, props.format).locale(lang.value);
  23737. };
  23738. const getDefaultValue = () => {
  23739. const parseDate = dayjs(defaultValue.value).locale(lang.value);
  23740. if (!defaultValue.value) {
  23741. const defaultTimeDValue = defaultTimeD.value;
  23742. return dayjs().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
  23743. }
  23744. return parseDate;
  23745. };
  23746. const handleFocusPicker = async () => {
  23747. var _a;
  23748. if (["week", "month", "year", "date"].includes(selectionMode.value)) {
  23749. (_a = currentViewRef.value) == null ? void 0 : _a.focus();
  23750. if (selectionMode.value === "week") {
  23751. handleKeyControl(EVENT_CODE.down);
  23752. }
  23753. }
  23754. };
  23755. const handleKeydownTable = (event) => {
  23756. const { code } = event;
  23757. const validCode = [
  23758. EVENT_CODE.up,
  23759. EVENT_CODE.down,
  23760. EVENT_CODE.left,
  23761. EVENT_CODE.right,
  23762. EVENT_CODE.home,
  23763. EVENT_CODE.end,
  23764. EVENT_CODE.pageUp,
  23765. EVENT_CODE.pageDown
  23766. ];
  23767. if (validCode.includes(code)) {
  23768. handleKeyControl(code);
  23769. event.stopPropagation();
  23770. event.preventDefault();
  23771. }
  23772. if ([EVENT_CODE.enter, EVENT_CODE.space].includes(code) && userInputDate.value === null && userInputTime.value === null) {
  23773. event.preventDefault();
  23774. emit(innerDate.value, false);
  23775. }
  23776. };
  23777. const handleKeyControl = (code) => {
  23778. var _a;
  23779. const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE;
  23780. const mapping = {
  23781. year: {
  23782. [up]: -4,
  23783. [down]: 4,
  23784. [left]: -1,
  23785. [right]: 1,
  23786. offset: (date, step) => date.setFullYear(date.getFullYear() + step)
  23787. },
  23788. month: {
  23789. [up]: -4,
  23790. [down]: 4,
  23791. [left]: -1,
  23792. [right]: 1,
  23793. offset: (date, step) => date.setMonth(date.getMonth() + step)
  23794. },
  23795. week: {
  23796. [up]: -1,
  23797. [down]: 1,
  23798. [left]: -1,
  23799. [right]: 1,
  23800. offset: (date, step) => date.setDate(date.getDate() + step * 7)
  23801. },
  23802. date: {
  23803. [up]: -7,
  23804. [down]: 7,
  23805. [left]: -1,
  23806. [right]: 1,
  23807. [home]: (date) => -date.getDay(),
  23808. [end]: (date) => -date.getDay() + 6,
  23809. [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
  23810. [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
  23811. offset: (date, step) => date.setDate(date.getDate() + step)
  23812. }
  23813. };
  23814. const newDate = innerDate.value.toDate();
  23815. while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
  23816. const map = mapping[keyboardMode.value];
  23817. if (!map)
  23818. return;
  23819. map.offset(newDate, isFunction(map[code]) ? map[code](newDate) : (_a = map[code]) != null ? _a : 0);
  23820. if (disabledDate && disabledDate(newDate)) {
  23821. break;
  23822. }
  23823. const result = dayjs(newDate).locale(lang.value);
  23824. innerDate.value = result;
  23825. contextEmit("pick", result, true);
  23826. break;
  23827. }
  23828. };
  23829. const handlePanelChange = (mode) => {
  23830. contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
  23831. };
  23832. vue.watch(() => selectionMode.value, (val) => {
  23833. if (["month", "year"].includes(val)) {
  23834. currentView.value = val;
  23835. return;
  23836. }
  23837. currentView.value = "date";
  23838. }, { immediate: true });
  23839. vue.watch(() => currentView.value, () => {
  23840. popper == null ? void 0 : popper.updatePopper();
  23841. });
  23842. vue.watch(() => defaultValue.value, (val) => {
  23843. if (val) {
  23844. innerDate.value = getDefaultValue();
  23845. }
  23846. }, { immediate: true });
  23847. vue.watch(() => props.parsedValue, (val) => {
  23848. if (val) {
  23849. if (selectionMode.value === "dates")
  23850. return;
  23851. if (Array.isArray(val))
  23852. return;
  23853. innerDate.value = val;
  23854. } else {
  23855. innerDate.value = getDefaultValue();
  23856. }
  23857. }, { immediate: true });
  23858. contextEmit("set-picker-option", ["isValidValue", isValidValue]);
  23859. contextEmit("set-picker-option", ["formatToString", formatToString]);
  23860. contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
  23861. contextEmit("set-picker-option", ["handleFocusPicker", handleFocusPicker]);
  23862. return (_ctx, _cache) => {
  23863. return vue.openBlock(), vue.createElementBlock("div", {
  23864. class: vue.normalizeClass([
  23865. vue.unref(ppNs).b(),
  23866. vue.unref(dpNs).b(),
  23867. {
  23868. "has-sidebar": _ctx.$slots.sidebar || vue.unref(hasShortcuts),
  23869. "has-time": vue.unref(showTime)
  23870. }
  23871. ])
  23872. }, [
  23873. vue.createElementVNode("div", {
  23874. class: vue.normalizeClass(vue.unref(ppNs).e("body-wrapper"))
  23875. }, [
  23876. vue.renderSlot(_ctx.$slots, "sidebar", {
  23877. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  23878. }),
  23879. vue.unref(hasShortcuts) ? (vue.openBlock(), vue.createElementBlock("div", {
  23880. key: 0,
  23881. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  23882. }, [
  23883. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(shortcuts), (shortcut, key) => {
  23884. return vue.openBlock(), vue.createElementBlock("button", {
  23885. key,
  23886. type: "button",
  23887. class: vue.normalizeClass(vue.unref(ppNs).e("shortcut")),
  23888. onClick: ($event) => handleShortcutClick(shortcut)
  23889. }, vue.toDisplayString(shortcut.text), 11, _hoisted_1$G);
  23890. }), 128))
  23891. ], 2)) : vue.createCommentVNode("v-if", true),
  23892. vue.createElementVNode("div", {
  23893. class: vue.normalizeClass(vue.unref(ppNs).e("body"))
  23894. }, [
  23895. vue.unref(showTime) ? (vue.openBlock(), vue.createElementBlock("div", {
  23896. key: 0,
  23897. class: vue.normalizeClass(vue.unref(dpNs).e("time-header"))
  23898. }, [
  23899. vue.createElementVNode("span", {
  23900. class: vue.normalizeClass(vue.unref(dpNs).e("editor-wrap"))
  23901. }, [
  23902. vue.createVNode(vue.unref(ElInput), {
  23903. placeholder: vue.unref(t)("el.datepicker.selectDate"),
  23904. "model-value": vue.unref(visibleDate),
  23905. size: "small",
  23906. "validate-event": false,
  23907. onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
  23908. onChange: handleVisibleDateChange
  23909. }, null, 8, ["placeholder", "model-value"])
  23910. ], 2),
  23911. vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  23912. class: vue.normalizeClass(vue.unref(dpNs).e("editor-wrap"))
  23913. }, [
  23914. vue.createVNode(vue.unref(ElInput), {
  23915. placeholder: vue.unref(t)("el.datepicker.selectTime"),
  23916. "model-value": vue.unref(visibleTime),
  23917. size: "small",
  23918. "validate-event": false,
  23919. onFocus: onTimePickerInputFocus,
  23920. onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
  23921. onChange: handleVisibleTimeChange
  23922. }, null, 8, ["placeholder", "model-value"]),
  23923. vue.createVNode(vue.unref(TimePickPanel), {
  23924. visible: timePickerVisible.value,
  23925. format: vue.unref(timeFormat),
  23926. "time-arrow-control": vue.unref(arrowControl),
  23927. "parsed-value": innerDate.value,
  23928. onPick: handleTimePick
  23929. }, null, 8, ["visible", "format", "time-arrow-control", "parsed-value"])
  23930. ], 2)), [
  23931. [vue.unref(ClickOutside), handleTimePickClose]
  23932. ])
  23933. ], 2)) : vue.createCommentVNode("v-if", true),
  23934. vue.withDirectives(vue.createElementVNode("div", {
  23935. class: vue.normalizeClass([
  23936. vue.unref(dpNs).e("header"),
  23937. (currentView.value === "year" || currentView.value === "month") && vue.unref(dpNs).e("header--bordered")
  23938. ])
  23939. }, [
  23940. vue.createElementVNode("span", {
  23941. class: vue.normalizeClass(vue.unref(dpNs).e("prev-btn"))
  23942. }, [
  23943. vue.createElementVNode("button", {
  23944. type: "button",
  23945. "aria-label": vue.unref(t)(`el.datepicker.prevYear`),
  23946. class: vue.normalizeClass(["d-arrow-left", vue.unref(ppNs).e("icon-btn")]),
  23947. onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
  23948. }, [
  23949. vue.createVNode(vue.unref(ElIcon), null, {
  23950. default: vue.withCtx(() => [
  23951. vue.createVNode(vue.unref(d_arrow_left_default))
  23952. ]),
  23953. _: 1
  23954. })
  23955. ], 10, _hoisted_2$q),
  23956. vue.withDirectives(vue.createElementVNode("button", {
  23957. type: "button",
  23958. "aria-label": vue.unref(t)(`el.datepicker.prevMonth`),
  23959. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "arrow-left"]),
  23960. onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
  23961. }, [
  23962. vue.createVNode(vue.unref(ElIcon), null, {
  23963. default: vue.withCtx(() => [
  23964. vue.createVNode(vue.unref(arrow_left_default))
  23965. ]),
  23966. _: 1
  23967. })
  23968. ], 10, _hoisted_3$c), [
  23969. [vue.vShow, currentView.value === "date"]
  23970. ])
  23971. ], 2),
  23972. vue.createElementVNode("span", {
  23973. role: "button",
  23974. class: vue.normalizeClass(vue.unref(dpNs).e("header-label")),
  23975. "aria-live": "polite",
  23976. tabindex: "0",
  23977. onKeydown: _cache[4] || (_cache[4] = vue.withKeys(($event) => showPicker("year"), ["enter"])),
  23978. onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
  23979. }, vue.toDisplayString(vue.unref(yearLabel)), 35),
  23980. vue.withDirectives(vue.createElementVNode("span", {
  23981. role: "button",
  23982. "aria-live": "polite",
  23983. tabindex: "0",
  23984. class: vue.normalizeClass([
  23985. vue.unref(dpNs).e("header-label"),
  23986. { active: currentView.value === "month" }
  23987. ]),
  23988. onKeydown: _cache[6] || (_cache[6] = vue.withKeys(($event) => showPicker("month"), ["enter"])),
  23989. onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
  23990. }, vue.toDisplayString(vue.unref(t)(`el.datepicker.month${vue.unref(month) + 1}`)), 35), [
  23991. [vue.vShow, currentView.value === "date"]
  23992. ]),
  23993. vue.createElementVNode("span", {
  23994. class: vue.normalizeClass(vue.unref(dpNs).e("next-btn"))
  23995. }, [
  23996. vue.withDirectives(vue.createElementVNode("button", {
  23997. type: "button",
  23998. "aria-label": vue.unref(t)(`el.datepicker.nextMonth`),
  23999. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "arrow-right"]),
  24000. onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
  24001. }, [
  24002. vue.createVNode(vue.unref(ElIcon), null, {
  24003. default: vue.withCtx(() => [
  24004. vue.createVNode(vue.unref(arrow_right_default))
  24005. ]),
  24006. _: 1
  24007. })
  24008. ], 10, _hoisted_4$9), [
  24009. [vue.vShow, currentView.value === "date"]
  24010. ]),
  24011. vue.createElementVNode("button", {
  24012. type: "button",
  24013. "aria-label": vue.unref(t)(`el.datepicker.nextYear`),
  24014. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  24015. onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
  24016. }, [
  24017. vue.createVNode(vue.unref(ElIcon), null, {
  24018. default: vue.withCtx(() => [
  24019. vue.createVNode(vue.unref(d_arrow_right_default))
  24020. ]),
  24021. _: 1
  24022. })
  24023. ], 10, _hoisted_5$7)
  24024. ], 2)
  24025. ], 2), [
  24026. [vue.vShow, currentView.value !== "time"]
  24027. ]),
  24028. vue.createElementVNode("div", {
  24029. class: vue.normalizeClass(vue.unref(ppNs).e("content")),
  24030. onKeydown: handleKeydownTable
  24031. }, [
  24032. currentView.value === "date" ? (vue.openBlock(), vue.createBlock(DateTable, {
  24033. key: 0,
  24034. ref_key: "currentViewRef",
  24035. ref: currentViewRef,
  24036. "selection-mode": vue.unref(selectionMode),
  24037. date: innerDate.value,
  24038. "parsed-value": _ctx.parsedValue,
  24039. "disabled-date": vue.unref(disabledDate),
  24040. "cell-class-name": vue.unref(cellClassName),
  24041. onPick: handleDatePick
  24042. }, null, 8, ["selection-mode", "date", "parsed-value", "disabled-date", "cell-class-name"])) : vue.createCommentVNode("v-if", true),
  24043. currentView.value === "year" ? (vue.openBlock(), vue.createBlock(YearTable, {
  24044. key: 1,
  24045. ref_key: "currentViewRef",
  24046. ref: currentViewRef,
  24047. date: innerDate.value,
  24048. "disabled-date": vue.unref(disabledDate),
  24049. "parsed-value": _ctx.parsedValue,
  24050. onPick: handleYearPick
  24051. }, null, 8, ["date", "disabled-date", "parsed-value"])) : vue.createCommentVNode("v-if", true),
  24052. currentView.value === "month" ? (vue.openBlock(), vue.createBlock(MonthTable, {
  24053. key: 2,
  24054. ref_key: "currentViewRef",
  24055. ref: currentViewRef,
  24056. date: innerDate.value,
  24057. "parsed-value": _ctx.parsedValue,
  24058. "disabled-date": vue.unref(disabledDate),
  24059. onPick: handleMonthPick
  24060. }, null, 8, ["date", "parsed-value", "disabled-date"])) : vue.createCommentVNode("v-if", true)
  24061. ], 34)
  24062. ], 2)
  24063. ], 2),
  24064. vue.withDirectives(vue.createElementVNode("div", {
  24065. class: vue.normalizeClass(vue.unref(ppNs).e("footer"))
  24066. }, [
  24067. vue.withDirectives(vue.createVNode(vue.unref(ElButton), {
  24068. text: "",
  24069. size: "small",
  24070. class: vue.normalizeClass(vue.unref(ppNs).e("link-btn")),
  24071. onClick: changeToNow
  24072. }, {
  24073. default: vue.withCtx(() => [
  24074. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.now")), 1)
  24075. ]),
  24076. _: 1
  24077. }, 8, ["class"]), [
  24078. [vue.vShow, vue.unref(selectionMode) !== "dates"]
  24079. ]),
  24080. vue.createVNode(vue.unref(ElButton), {
  24081. plain: "",
  24082. size: "small",
  24083. class: vue.normalizeClass(vue.unref(ppNs).e("link-btn")),
  24084. onClick: onConfirm
  24085. }, {
  24086. default: vue.withCtx(() => [
  24087. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.confirm")), 1)
  24088. ]),
  24089. _: 1
  24090. }, 8, ["class"])
  24091. ], 2), [
  24092. [vue.vShow, vue.unref(footerVisible) && currentView.value === "date"]
  24093. ])
  24094. ], 2);
  24095. };
  24096. }
  24097. });
  24098. var DatePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__file", "panel-date-pick.vue"]]);
  24099. const panelDateRangeProps = buildProps({
  24100. ...panelSharedProps,
  24101. ...panelRangeSharedProps
  24102. });
  24103. const useShortcut = (lang) => {
  24104. const { emit } = vue.getCurrentInstance();
  24105. const attrs = vue.useAttrs();
  24106. const slots = vue.useSlots();
  24107. const handleShortcutClick = (shortcut) => {
  24108. const shortcutValues = isFunction(shortcut.value) ? shortcut.value() : shortcut.value;
  24109. if (shortcutValues) {
  24110. emit("pick", [
  24111. dayjs(shortcutValues[0]).locale(lang.value),
  24112. dayjs(shortcutValues[1]).locale(lang.value)
  24113. ]);
  24114. return;
  24115. }
  24116. if (shortcut.onClick) {
  24117. shortcut.onClick({
  24118. attrs,
  24119. slots,
  24120. emit
  24121. });
  24122. }
  24123. };
  24124. return handleShortcutClick;
  24125. };
  24126. const useRangePicker = (props, {
  24127. defaultValue,
  24128. leftDate,
  24129. rightDate,
  24130. unit,
  24131. onParsedValueChanged
  24132. }) => {
  24133. const { emit } = vue.getCurrentInstance();
  24134. const { pickerNs } = vue.inject(ROOT_PICKER_INJECTION_KEY);
  24135. const drpNs = useNamespace("date-range-picker");
  24136. const { t, lang } = useLocale();
  24137. const handleShortcutClick = useShortcut(lang);
  24138. const minDate = vue.ref();
  24139. const maxDate = vue.ref();
  24140. const rangeState = vue.ref({
  24141. endDate: null,
  24142. selecting: false
  24143. });
  24144. const handleChangeRange = (val) => {
  24145. rangeState.value = val;
  24146. };
  24147. const handleRangeConfirm = (visible = false) => {
  24148. const _minDate = vue.unref(minDate);
  24149. const _maxDate = vue.unref(maxDate);
  24150. if (isValidRange([_minDate, _maxDate])) {
  24151. emit("pick", [_minDate, _maxDate], visible);
  24152. }
  24153. };
  24154. const onSelect = (selecting) => {
  24155. rangeState.value.selecting = selecting;
  24156. if (!selecting) {
  24157. rangeState.value.endDate = null;
  24158. }
  24159. };
  24160. const restoreDefault = () => {
  24161. const [start, end] = getDefaultValue(vue.unref(defaultValue), {
  24162. lang: vue.unref(lang),
  24163. unit,
  24164. unlinkPanels: props.unlinkPanels
  24165. });
  24166. minDate.value = void 0;
  24167. maxDate.value = void 0;
  24168. leftDate.value = start;
  24169. rightDate.value = end;
  24170. };
  24171. vue.watch(defaultValue, (val) => {
  24172. if (val) {
  24173. restoreDefault();
  24174. }
  24175. }, { immediate: true });
  24176. vue.watch(() => props.parsedValue, (parsedValue) => {
  24177. if (isArray(parsedValue) && parsedValue.length === 2) {
  24178. const [start, end] = parsedValue;
  24179. minDate.value = start;
  24180. leftDate.value = start;
  24181. maxDate.value = end;
  24182. onParsedValueChanged(vue.unref(minDate), vue.unref(maxDate));
  24183. } else {
  24184. restoreDefault();
  24185. }
  24186. }, { immediate: true });
  24187. return {
  24188. minDate,
  24189. maxDate,
  24190. rangeState,
  24191. lang,
  24192. ppNs: pickerNs,
  24193. drpNs,
  24194. handleChangeRange,
  24195. handleRangeConfirm,
  24196. handleShortcutClick,
  24197. onSelect,
  24198. t
  24199. };
  24200. };
  24201. const _hoisted_1$F = ["onClick"];
  24202. const _hoisted_2$p = ["disabled"];
  24203. const _hoisted_3$b = ["disabled"];
  24204. const _hoisted_4$8 = ["disabled"];
  24205. const _hoisted_5$6 = ["disabled"];
  24206. const unit$1 = "month";
  24207. const _sfc_main$1j = /* @__PURE__ */ vue.defineComponent({
  24208. __name: "panel-date-range",
  24209. props: panelDateRangeProps,
  24210. emits: [
  24211. "pick",
  24212. "set-picker-option",
  24213. "calendar-change",
  24214. "panel-change"
  24215. ],
  24216. setup(__props, { emit }) {
  24217. const props = __props;
  24218. const pickerBase = vue.inject("EP_PICKER_BASE");
  24219. const {
  24220. disabledDate,
  24221. cellClassName,
  24222. format,
  24223. defaultTime,
  24224. arrowControl,
  24225. clearable
  24226. } = pickerBase.props;
  24227. const shortcuts = vue.toRef(pickerBase.props, "shortcuts");
  24228. const defaultValue = vue.toRef(pickerBase.props, "defaultValue");
  24229. const { lang } = useLocale();
  24230. const leftDate = vue.ref(dayjs().locale(lang.value));
  24231. const rightDate = vue.ref(dayjs().locale(lang.value).add(1, unit$1));
  24232. const {
  24233. minDate,
  24234. maxDate,
  24235. rangeState,
  24236. ppNs,
  24237. drpNs,
  24238. handleChangeRange,
  24239. handleRangeConfirm,
  24240. handleShortcutClick,
  24241. onSelect,
  24242. t
  24243. } = useRangePicker(props, {
  24244. defaultValue,
  24245. leftDate,
  24246. rightDate,
  24247. unit: unit$1,
  24248. onParsedValueChanged
  24249. });
  24250. const dateUserInput = vue.ref({
  24251. min: null,
  24252. max: null
  24253. });
  24254. const timeUserInput = vue.ref({
  24255. min: null,
  24256. max: null
  24257. });
  24258. const leftLabel = vue.computed(() => {
  24259. return `${leftDate.value.year()} ${t("el.datepicker.year")} ${t(`el.datepicker.month${leftDate.value.month() + 1}`)}`;
  24260. });
  24261. const rightLabel = vue.computed(() => {
  24262. return `${rightDate.value.year()} ${t("el.datepicker.year")} ${t(`el.datepicker.month${rightDate.value.month() + 1}`)}`;
  24263. });
  24264. const leftYear = vue.computed(() => {
  24265. return leftDate.value.year();
  24266. });
  24267. const leftMonth = vue.computed(() => {
  24268. return leftDate.value.month();
  24269. });
  24270. const rightYear = vue.computed(() => {
  24271. return rightDate.value.year();
  24272. });
  24273. const rightMonth = vue.computed(() => {
  24274. return rightDate.value.month();
  24275. });
  24276. const hasShortcuts = vue.computed(() => !!shortcuts.value.length);
  24277. const minVisibleDate = vue.computed(() => {
  24278. if (dateUserInput.value.min !== null)
  24279. return dateUserInput.value.min;
  24280. if (minDate.value)
  24281. return minDate.value.format(dateFormat.value);
  24282. return "";
  24283. });
  24284. const maxVisibleDate = vue.computed(() => {
  24285. if (dateUserInput.value.max !== null)
  24286. return dateUserInput.value.max;
  24287. if (maxDate.value || minDate.value)
  24288. return (maxDate.value || minDate.value).format(dateFormat.value);
  24289. return "";
  24290. });
  24291. const minVisibleTime = vue.computed(() => {
  24292. if (timeUserInput.value.min !== null)
  24293. return timeUserInput.value.min;
  24294. if (minDate.value)
  24295. return minDate.value.format(timeFormat.value);
  24296. return "";
  24297. });
  24298. const maxVisibleTime = vue.computed(() => {
  24299. if (timeUserInput.value.max !== null)
  24300. return timeUserInput.value.max;
  24301. if (maxDate.value || minDate.value)
  24302. return (maxDate.value || minDate.value).format(timeFormat.value);
  24303. return "";
  24304. });
  24305. const timeFormat = vue.computed(() => {
  24306. return extractTimeFormat(format);
  24307. });
  24308. const dateFormat = vue.computed(() => {
  24309. return extractDateFormat(format);
  24310. });
  24311. const leftPrevYear = () => {
  24312. leftDate.value = leftDate.value.subtract(1, "year");
  24313. if (!props.unlinkPanels) {
  24314. rightDate.value = leftDate.value.add(1, "month");
  24315. }
  24316. handlePanelChange("year");
  24317. };
  24318. const leftPrevMonth = () => {
  24319. leftDate.value = leftDate.value.subtract(1, "month");
  24320. if (!props.unlinkPanels) {
  24321. rightDate.value = leftDate.value.add(1, "month");
  24322. }
  24323. handlePanelChange("month");
  24324. };
  24325. const rightNextYear = () => {
  24326. if (!props.unlinkPanels) {
  24327. leftDate.value = leftDate.value.add(1, "year");
  24328. rightDate.value = leftDate.value.add(1, "month");
  24329. } else {
  24330. rightDate.value = rightDate.value.add(1, "year");
  24331. }
  24332. handlePanelChange("year");
  24333. };
  24334. const rightNextMonth = () => {
  24335. if (!props.unlinkPanels) {
  24336. leftDate.value = leftDate.value.add(1, "month");
  24337. rightDate.value = leftDate.value.add(1, "month");
  24338. } else {
  24339. rightDate.value = rightDate.value.add(1, "month");
  24340. }
  24341. handlePanelChange("month");
  24342. };
  24343. const leftNextYear = () => {
  24344. leftDate.value = leftDate.value.add(1, "year");
  24345. handlePanelChange("year");
  24346. };
  24347. const leftNextMonth = () => {
  24348. leftDate.value = leftDate.value.add(1, "month");
  24349. handlePanelChange("month");
  24350. };
  24351. const rightPrevYear = () => {
  24352. rightDate.value = rightDate.value.subtract(1, "year");
  24353. handlePanelChange("year");
  24354. };
  24355. const rightPrevMonth = () => {
  24356. rightDate.value = rightDate.value.subtract(1, "month");
  24357. handlePanelChange("month");
  24358. };
  24359. const handlePanelChange = (mode) => {
  24360. emit("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode);
  24361. };
  24362. const enableMonthArrow = vue.computed(() => {
  24363. const nextMonth = (leftMonth.value + 1) % 12;
  24364. const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0;
  24365. return props.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value);
  24366. });
  24367. const enableYearArrow = vue.computed(() => {
  24368. return props.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12;
  24369. });
  24370. const btnDisabled = vue.computed(() => {
  24371. return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]));
  24372. });
  24373. const showTime = vue.computed(() => props.type === "datetime" || props.type === "datetimerange");
  24374. const formatEmit = (emitDayjs, index) => {
  24375. if (!emitDayjs)
  24376. return;
  24377. if (defaultTime) {
  24378. const defaultTimeD = dayjs(defaultTime[index] || defaultTime).locale(lang.value);
  24379. return defaultTimeD.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  24380. }
  24381. return emitDayjs;
  24382. };
  24383. const handleRangePick = (val, close = true) => {
  24384. const min_ = val.minDate;
  24385. const max_ = val.maxDate;
  24386. const minDate_ = formatEmit(min_, 0);
  24387. const maxDate_ = formatEmit(max_, 1);
  24388. if (maxDate.value === maxDate_ && minDate.value === minDate_) {
  24389. return;
  24390. }
  24391. emit("calendar-change", [min_.toDate(), max_ && max_.toDate()]);
  24392. maxDate.value = maxDate_;
  24393. minDate.value = minDate_;
  24394. if (!close || showTime.value)
  24395. return;
  24396. handleRangeConfirm();
  24397. };
  24398. const minTimePickerVisible = vue.ref(false);
  24399. const maxTimePickerVisible = vue.ref(false);
  24400. const handleMinTimeClose = () => {
  24401. minTimePickerVisible.value = false;
  24402. };
  24403. const handleMaxTimeClose = () => {
  24404. maxTimePickerVisible.value = false;
  24405. };
  24406. const handleDateInput = (value, type) => {
  24407. dateUserInput.value[type] = value;
  24408. const parsedValueD = dayjs(value, dateFormat.value).locale(lang.value);
  24409. if (parsedValueD.isValid()) {
  24410. if (disabledDate && disabledDate(parsedValueD.toDate())) {
  24411. return;
  24412. }
  24413. if (type === "min") {
  24414. leftDate.value = parsedValueD;
  24415. minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  24416. if (!props.unlinkPanels) {
  24417. rightDate.value = parsedValueD.add(1, "month");
  24418. maxDate.value = minDate.value.add(1, "month");
  24419. }
  24420. } else {
  24421. rightDate.value = parsedValueD;
  24422. maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  24423. if (!props.unlinkPanels) {
  24424. leftDate.value = parsedValueD.subtract(1, "month");
  24425. minDate.value = maxDate.value.subtract(1, "month");
  24426. }
  24427. }
  24428. }
  24429. };
  24430. const handleDateChange = (_, type) => {
  24431. dateUserInput.value[type] = null;
  24432. };
  24433. const handleTimeInput = (value, type) => {
  24434. timeUserInput.value[type] = value;
  24435. const parsedValueD = dayjs(value, timeFormat.value).locale(lang.value);
  24436. if (parsedValueD.isValid()) {
  24437. if (type === "min") {
  24438. minTimePickerVisible.value = true;
  24439. minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  24440. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
  24441. maxDate.value = minDate.value;
  24442. }
  24443. } else {
  24444. maxTimePickerVisible.value = true;
  24445. maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  24446. rightDate.value = maxDate.value;
  24447. if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
  24448. minDate.value = maxDate.value;
  24449. }
  24450. }
  24451. }
  24452. };
  24453. const handleTimeChange = (value, type) => {
  24454. timeUserInput.value[type] = null;
  24455. if (type === "min") {
  24456. leftDate.value = minDate.value;
  24457. minTimePickerVisible.value = false;
  24458. } else {
  24459. rightDate.value = maxDate.value;
  24460. maxTimePickerVisible.value = false;
  24461. }
  24462. };
  24463. const handleMinTimePick = (value, visible, first) => {
  24464. if (timeUserInput.value.min)
  24465. return;
  24466. if (value) {
  24467. leftDate.value = value;
  24468. minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  24469. }
  24470. if (!first) {
  24471. minTimePickerVisible.value = visible;
  24472. }
  24473. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
  24474. maxDate.value = minDate.value;
  24475. rightDate.value = value;
  24476. }
  24477. };
  24478. const handleMaxTimePick = (value, visible, first) => {
  24479. if (timeUserInput.value.max)
  24480. return;
  24481. if (value) {
  24482. rightDate.value = value;
  24483. maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  24484. }
  24485. if (!first) {
  24486. maxTimePickerVisible.value = visible;
  24487. }
  24488. if (maxDate.value && maxDate.value.isBefore(minDate.value)) {
  24489. minDate.value = maxDate.value;
  24490. }
  24491. };
  24492. const handleClear = () => {
  24493. leftDate.value = getDefaultValue(vue.unref(defaultValue), {
  24494. lang: vue.unref(lang),
  24495. unit: "month",
  24496. unlinkPanels: props.unlinkPanels
  24497. })[0];
  24498. rightDate.value = leftDate.value.add(1, "month");
  24499. emit("pick", null);
  24500. };
  24501. const formatToString = (value) => {
  24502. return isArray(value) ? value.map((_) => _.format(format)) : value.format(format);
  24503. };
  24504. const parseUserInput = (value) => {
  24505. return isArray(value) ? value.map((_) => dayjs(_, format).locale(lang.value)) : dayjs(value, format).locale(lang.value);
  24506. };
  24507. function onParsedValueChanged(minDate2, maxDate2) {
  24508. if (props.unlinkPanels && maxDate2) {
  24509. const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
  24510. const minDateMonth = (minDate2 == null ? void 0 : minDate2.month()) || 0;
  24511. const maxDateYear = maxDate2.year();
  24512. const maxDateMonth = maxDate2.month();
  24513. rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate2.add(1, unit$1) : maxDate2;
  24514. } else {
  24515. rightDate.value = leftDate.value.add(1, unit$1);
  24516. if (maxDate2) {
  24517. rightDate.value = rightDate.value.hour(maxDate2.hour()).minute(maxDate2.minute()).second(maxDate2.second());
  24518. }
  24519. }
  24520. }
  24521. emit("set-picker-option", ["isValidValue", isValidRange]);
  24522. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  24523. emit("set-picker-option", ["formatToString", formatToString]);
  24524. emit("set-picker-option", ["handleClear", handleClear]);
  24525. return (_ctx, _cache) => {
  24526. return vue.openBlock(), vue.createElementBlock("div", {
  24527. class: vue.normalizeClass([
  24528. vue.unref(ppNs).b(),
  24529. vue.unref(drpNs).b(),
  24530. {
  24531. "has-sidebar": _ctx.$slots.sidebar || vue.unref(hasShortcuts),
  24532. "has-time": vue.unref(showTime)
  24533. }
  24534. ])
  24535. }, [
  24536. vue.createElementVNode("div", {
  24537. class: vue.normalizeClass(vue.unref(ppNs).e("body-wrapper"))
  24538. }, [
  24539. vue.renderSlot(_ctx.$slots, "sidebar", {
  24540. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  24541. }),
  24542. vue.unref(hasShortcuts) ? (vue.openBlock(), vue.createElementBlock("div", {
  24543. key: 0,
  24544. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  24545. }, [
  24546. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(shortcuts), (shortcut, key) => {
  24547. return vue.openBlock(), vue.createElementBlock("button", {
  24548. key,
  24549. type: "button",
  24550. class: vue.normalizeClass(vue.unref(ppNs).e("shortcut")),
  24551. onClick: ($event) => vue.unref(handleShortcutClick)(shortcut)
  24552. }, vue.toDisplayString(shortcut.text), 11, _hoisted_1$F);
  24553. }), 128))
  24554. ], 2)) : vue.createCommentVNode("v-if", true),
  24555. vue.createElementVNode("div", {
  24556. class: vue.normalizeClass(vue.unref(ppNs).e("body"))
  24557. }, [
  24558. vue.unref(showTime) ? (vue.openBlock(), vue.createElementBlock("div", {
  24559. key: 0,
  24560. class: vue.normalizeClass(vue.unref(drpNs).e("time-header"))
  24561. }, [
  24562. vue.createElementVNode("span", {
  24563. class: vue.normalizeClass(vue.unref(drpNs).e("editors-wrap"))
  24564. }, [
  24565. vue.createElementVNode("span", {
  24566. class: vue.normalizeClass(vue.unref(drpNs).e("time-picker-wrap"))
  24567. }, [
  24568. vue.createVNode(vue.unref(ElInput), {
  24569. size: "small",
  24570. disabled: vue.unref(rangeState).selecting,
  24571. placeholder: vue.unref(t)("el.datepicker.startDate"),
  24572. class: vue.normalizeClass(vue.unref(drpNs).e("editor")),
  24573. "model-value": vue.unref(minVisibleDate),
  24574. "validate-event": false,
  24575. onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")),
  24576. onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min"))
  24577. }, null, 8, ["disabled", "placeholder", "class", "model-value"])
  24578. ], 2),
  24579. vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  24580. class: vue.normalizeClass(vue.unref(drpNs).e("time-picker-wrap"))
  24581. }, [
  24582. vue.createVNode(vue.unref(ElInput), {
  24583. size: "small",
  24584. class: vue.normalizeClass(vue.unref(drpNs).e("editor")),
  24585. disabled: vue.unref(rangeState).selecting,
  24586. placeholder: vue.unref(t)("el.datepicker.startTime"),
  24587. "model-value": vue.unref(minVisibleTime),
  24588. "validate-event": false,
  24589. onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true),
  24590. onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")),
  24591. onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min"))
  24592. }, null, 8, ["class", "disabled", "placeholder", "model-value"]),
  24593. vue.createVNode(vue.unref(TimePickPanel), {
  24594. visible: minTimePickerVisible.value,
  24595. format: vue.unref(timeFormat),
  24596. "datetime-role": "start",
  24597. "time-arrow-control": vue.unref(arrowControl),
  24598. "parsed-value": leftDate.value,
  24599. onPick: handleMinTimePick
  24600. }, null, 8, ["visible", "format", "time-arrow-control", "parsed-value"])
  24601. ], 2)), [
  24602. [vue.unref(ClickOutside), handleMinTimeClose]
  24603. ])
  24604. ], 2),
  24605. vue.createElementVNode("span", null, [
  24606. vue.createVNode(vue.unref(ElIcon), null, {
  24607. default: vue.withCtx(() => [
  24608. vue.createVNode(vue.unref(arrow_right_default))
  24609. ]),
  24610. _: 1
  24611. })
  24612. ]),
  24613. vue.createElementVNode("span", {
  24614. class: vue.normalizeClass([vue.unref(drpNs).e("editors-wrap"), "is-right"])
  24615. }, [
  24616. vue.createElementVNode("span", {
  24617. class: vue.normalizeClass(vue.unref(drpNs).e("time-picker-wrap"))
  24618. }, [
  24619. vue.createVNode(vue.unref(ElInput), {
  24620. size: "small",
  24621. class: vue.normalizeClass(vue.unref(drpNs).e("editor")),
  24622. disabled: vue.unref(rangeState).selecting,
  24623. placeholder: vue.unref(t)("el.datepicker.endDate"),
  24624. "model-value": vue.unref(maxVisibleDate),
  24625. readonly: !vue.unref(minDate),
  24626. "validate-event": false,
  24627. onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")),
  24628. onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max"))
  24629. }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"])
  24630. ], 2),
  24631. vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  24632. class: vue.normalizeClass(vue.unref(drpNs).e("time-picker-wrap"))
  24633. }, [
  24634. vue.createVNode(vue.unref(ElInput), {
  24635. size: "small",
  24636. class: vue.normalizeClass(vue.unref(drpNs).e("editor")),
  24637. disabled: vue.unref(rangeState).selecting,
  24638. placeholder: vue.unref(t)("el.datepicker.endTime"),
  24639. "model-value": vue.unref(maxVisibleTime),
  24640. readonly: !vue.unref(minDate),
  24641. "validate-event": false,
  24642. onFocus: _cache[7] || (_cache[7] = ($event) => vue.unref(minDate) && (maxTimePickerVisible.value = true)),
  24643. onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")),
  24644. onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max"))
  24645. }, null, 8, ["class", "disabled", "placeholder", "model-value", "readonly"]),
  24646. vue.createVNode(vue.unref(TimePickPanel), {
  24647. "datetime-role": "end",
  24648. visible: maxTimePickerVisible.value,
  24649. format: vue.unref(timeFormat),
  24650. "time-arrow-control": vue.unref(arrowControl),
  24651. "parsed-value": rightDate.value,
  24652. onPick: handleMaxTimePick
  24653. }, null, 8, ["visible", "format", "time-arrow-control", "parsed-value"])
  24654. ], 2)), [
  24655. [vue.unref(ClickOutside), handleMaxTimeClose]
  24656. ])
  24657. ], 2)
  24658. ], 2)) : vue.createCommentVNode("v-if", true),
  24659. vue.createElementVNode("div", {
  24660. class: vue.normalizeClass([[vue.unref(ppNs).e("content"), vue.unref(drpNs).e("content")], "is-left"])
  24661. }, [
  24662. vue.createElementVNode("div", {
  24663. class: vue.normalizeClass(vue.unref(drpNs).e("header"))
  24664. }, [
  24665. vue.createElementVNode("button", {
  24666. type: "button",
  24667. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "d-arrow-left"]),
  24668. onClick: leftPrevYear
  24669. }, [
  24670. vue.createVNode(vue.unref(ElIcon), null, {
  24671. default: vue.withCtx(() => [
  24672. vue.createVNode(vue.unref(d_arrow_left_default))
  24673. ]),
  24674. _: 1
  24675. })
  24676. ], 2),
  24677. vue.createElementVNode("button", {
  24678. type: "button",
  24679. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "arrow-left"]),
  24680. onClick: leftPrevMonth
  24681. }, [
  24682. vue.createVNode(vue.unref(ElIcon), null, {
  24683. default: vue.withCtx(() => [
  24684. vue.createVNode(vue.unref(arrow_left_default))
  24685. ]),
  24686. _: 1
  24687. })
  24688. ], 2),
  24689. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  24690. key: 0,
  24691. type: "button",
  24692. disabled: !vue.unref(enableYearArrow),
  24693. class: vue.normalizeClass([[vue.unref(ppNs).e("icon-btn"), { "is-disabled": !vue.unref(enableYearArrow) }], "d-arrow-right"]),
  24694. onClick: leftNextYear
  24695. }, [
  24696. vue.createVNode(vue.unref(ElIcon), null, {
  24697. default: vue.withCtx(() => [
  24698. vue.createVNode(vue.unref(d_arrow_right_default))
  24699. ]),
  24700. _: 1
  24701. })
  24702. ], 10, _hoisted_2$p)) : vue.createCommentVNode("v-if", true),
  24703. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  24704. key: 1,
  24705. type: "button",
  24706. disabled: !vue.unref(enableMonthArrow),
  24707. class: vue.normalizeClass([[
  24708. vue.unref(ppNs).e("icon-btn"),
  24709. { "is-disabled": !vue.unref(enableMonthArrow) }
  24710. ], "arrow-right"]),
  24711. onClick: leftNextMonth
  24712. }, [
  24713. vue.createVNode(vue.unref(ElIcon), null, {
  24714. default: vue.withCtx(() => [
  24715. vue.createVNode(vue.unref(arrow_right_default))
  24716. ]),
  24717. _: 1
  24718. })
  24719. ], 10, _hoisted_3$b)) : vue.createCommentVNode("v-if", true),
  24720. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(leftLabel)), 1)
  24721. ], 2),
  24722. vue.createVNode(DateTable, {
  24723. "selection-mode": "range",
  24724. date: leftDate.value,
  24725. "min-date": vue.unref(minDate),
  24726. "max-date": vue.unref(maxDate),
  24727. "range-state": vue.unref(rangeState),
  24728. "disabled-date": vue.unref(disabledDate),
  24729. "cell-class-name": vue.unref(cellClassName),
  24730. onChangerange: vue.unref(handleChangeRange),
  24731. onPick: handleRangePick,
  24732. onSelect: vue.unref(onSelect)
  24733. }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "onSelect"])
  24734. ], 2),
  24735. vue.createElementVNode("div", {
  24736. class: vue.normalizeClass([[vue.unref(ppNs).e("content"), vue.unref(drpNs).e("content")], "is-right"])
  24737. }, [
  24738. vue.createElementVNode("div", {
  24739. class: vue.normalizeClass(vue.unref(drpNs).e("header"))
  24740. }, [
  24741. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  24742. key: 0,
  24743. type: "button",
  24744. disabled: !vue.unref(enableYearArrow),
  24745. class: vue.normalizeClass([[vue.unref(ppNs).e("icon-btn"), { "is-disabled": !vue.unref(enableYearArrow) }], "d-arrow-left"]),
  24746. onClick: rightPrevYear
  24747. }, [
  24748. vue.createVNode(vue.unref(ElIcon), null, {
  24749. default: vue.withCtx(() => [
  24750. vue.createVNode(vue.unref(d_arrow_left_default))
  24751. ]),
  24752. _: 1
  24753. })
  24754. ], 10, _hoisted_4$8)) : vue.createCommentVNode("v-if", true),
  24755. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  24756. key: 1,
  24757. type: "button",
  24758. disabled: !vue.unref(enableMonthArrow),
  24759. class: vue.normalizeClass([[
  24760. vue.unref(ppNs).e("icon-btn"),
  24761. { "is-disabled": !vue.unref(enableMonthArrow) }
  24762. ], "arrow-left"]),
  24763. onClick: rightPrevMonth
  24764. }, [
  24765. vue.createVNode(vue.unref(ElIcon), null, {
  24766. default: vue.withCtx(() => [
  24767. vue.createVNode(vue.unref(arrow_left_default))
  24768. ]),
  24769. _: 1
  24770. })
  24771. ], 10, _hoisted_5$6)) : vue.createCommentVNode("v-if", true),
  24772. vue.createElementVNode("button", {
  24773. type: "button",
  24774. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  24775. onClick: rightNextYear
  24776. }, [
  24777. vue.createVNode(vue.unref(ElIcon), null, {
  24778. default: vue.withCtx(() => [
  24779. vue.createVNode(vue.unref(d_arrow_right_default))
  24780. ]),
  24781. _: 1
  24782. })
  24783. ], 2),
  24784. vue.createElementVNode("button", {
  24785. type: "button",
  24786. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "arrow-right"]),
  24787. onClick: rightNextMonth
  24788. }, [
  24789. vue.createVNode(vue.unref(ElIcon), null, {
  24790. default: vue.withCtx(() => [
  24791. vue.createVNode(vue.unref(arrow_right_default))
  24792. ]),
  24793. _: 1
  24794. })
  24795. ], 2),
  24796. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(rightLabel)), 1)
  24797. ], 2),
  24798. vue.createVNode(DateTable, {
  24799. "selection-mode": "range",
  24800. date: rightDate.value,
  24801. "min-date": vue.unref(minDate),
  24802. "max-date": vue.unref(maxDate),
  24803. "range-state": vue.unref(rangeState),
  24804. "disabled-date": vue.unref(disabledDate),
  24805. "cell-class-name": vue.unref(cellClassName),
  24806. onChangerange: vue.unref(handleChangeRange),
  24807. onPick: handleRangePick,
  24808. onSelect: vue.unref(onSelect)
  24809. }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "cell-class-name", "onChangerange", "onSelect"])
  24810. ], 2)
  24811. ], 2)
  24812. ], 2),
  24813. vue.unref(showTime) ? (vue.openBlock(), vue.createElementBlock("div", {
  24814. key: 0,
  24815. class: vue.normalizeClass(vue.unref(ppNs).e("footer"))
  24816. }, [
  24817. vue.unref(clearable) ? (vue.openBlock(), vue.createBlock(vue.unref(ElButton), {
  24818. key: 0,
  24819. text: "",
  24820. size: "small",
  24821. class: vue.normalizeClass(vue.unref(ppNs).e("link-btn")),
  24822. onClick: handleClear
  24823. }, {
  24824. default: vue.withCtx(() => [
  24825. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.clear")), 1)
  24826. ]),
  24827. _: 1
  24828. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  24829. vue.createVNode(vue.unref(ElButton), {
  24830. plain: "",
  24831. size: "small",
  24832. class: vue.normalizeClass(vue.unref(ppNs).e("link-btn")),
  24833. disabled: vue.unref(btnDisabled),
  24834. onClick: _cache[10] || (_cache[10] = ($event) => vue.unref(handleRangeConfirm)(false))
  24835. }, {
  24836. default: vue.withCtx(() => [
  24837. vue.createTextVNode(vue.toDisplayString(vue.unref(t)("el.datepicker.confirm")), 1)
  24838. ]),
  24839. _: 1
  24840. }, 8, ["class", "disabled"])
  24841. ], 2)) : vue.createCommentVNode("v-if", true)
  24842. ], 2);
  24843. };
  24844. }
  24845. });
  24846. var DateRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__file", "panel-date-range.vue"]]);
  24847. const panelMonthRangeProps = buildProps({
  24848. ...panelRangeSharedProps
  24849. });
  24850. const panelMonthRangeEmits = ["pick", "set-picker-option"];
  24851. const useMonthRangeHeader = ({
  24852. unlinkPanels,
  24853. leftDate,
  24854. rightDate
  24855. }) => {
  24856. const { t } = useLocale();
  24857. const leftPrevYear = () => {
  24858. leftDate.value = leftDate.value.subtract(1, "year");
  24859. if (!unlinkPanels.value) {
  24860. rightDate.value = rightDate.value.subtract(1, "year");
  24861. }
  24862. };
  24863. const rightNextYear = () => {
  24864. if (!unlinkPanels.value) {
  24865. leftDate.value = leftDate.value.add(1, "year");
  24866. }
  24867. rightDate.value = rightDate.value.add(1, "year");
  24868. };
  24869. const leftNextYear = () => {
  24870. leftDate.value = leftDate.value.add(1, "year");
  24871. };
  24872. const rightPrevYear = () => {
  24873. rightDate.value = rightDate.value.subtract(1, "year");
  24874. };
  24875. const leftLabel = vue.computed(() => {
  24876. return `${leftDate.value.year()} ${t("el.datepicker.year")}`;
  24877. });
  24878. const rightLabel = vue.computed(() => {
  24879. return `${rightDate.value.year()} ${t("el.datepicker.year")}`;
  24880. });
  24881. const leftYear = vue.computed(() => {
  24882. return leftDate.value.year();
  24883. });
  24884. const rightYear = vue.computed(() => {
  24885. return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year();
  24886. });
  24887. return {
  24888. leftPrevYear,
  24889. rightNextYear,
  24890. leftNextYear,
  24891. rightPrevYear,
  24892. leftLabel,
  24893. rightLabel,
  24894. leftYear,
  24895. rightYear
  24896. };
  24897. };
  24898. const _hoisted_1$E = ["onClick"];
  24899. const _hoisted_2$o = ["disabled"];
  24900. const _hoisted_3$a = ["disabled"];
  24901. const unit = "year";
  24902. const __default__$S = vue.defineComponent({
  24903. name: "DatePickerMonthRange"
  24904. });
  24905. const _sfc_main$1i = /* @__PURE__ */ vue.defineComponent({
  24906. ...__default__$S,
  24907. props: panelMonthRangeProps,
  24908. emits: panelMonthRangeEmits,
  24909. setup(__props, { emit }) {
  24910. const props = __props;
  24911. const { lang } = useLocale();
  24912. const pickerBase = vue.inject("EP_PICKER_BASE");
  24913. const { shortcuts, disabledDate, format } = pickerBase.props;
  24914. const defaultValue = vue.toRef(pickerBase.props, "defaultValue");
  24915. const leftDate = vue.ref(dayjs().locale(lang.value));
  24916. const rightDate = vue.ref(dayjs().locale(lang.value).add(1, unit));
  24917. const {
  24918. minDate,
  24919. maxDate,
  24920. rangeState,
  24921. ppNs,
  24922. drpNs,
  24923. handleChangeRange,
  24924. handleRangeConfirm,
  24925. handleShortcutClick,
  24926. onSelect
  24927. } = useRangePicker(props, {
  24928. defaultValue,
  24929. leftDate,
  24930. rightDate,
  24931. unit,
  24932. onParsedValueChanged
  24933. });
  24934. const hasShortcuts = vue.computed(() => !!shortcuts.length);
  24935. const {
  24936. leftPrevYear,
  24937. rightNextYear,
  24938. leftNextYear,
  24939. rightPrevYear,
  24940. leftLabel,
  24941. rightLabel,
  24942. leftYear,
  24943. rightYear
  24944. } = useMonthRangeHeader({
  24945. unlinkPanels: vue.toRef(props, "unlinkPanels"),
  24946. leftDate,
  24947. rightDate
  24948. });
  24949. const enableYearArrow = vue.computed(() => {
  24950. return props.unlinkPanels && rightYear.value > leftYear.value + 1;
  24951. });
  24952. const handleRangePick = (val, close = true) => {
  24953. const minDate_ = val.minDate;
  24954. const maxDate_ = val.maxDate;
  24955. if (maxDate.value === maxDate_ && minDate.value === minDate_) {
  24956. return;
  24957. }
  24958. maxDate.value = maxDate_;
  24959. minDate.value = minDate_;
  24960. if (!close)
  24961. return;
  24962. handleRangeConfirm();
  24963. };
  24964. const formatToString = (days) => {
  24965. return days.map((day) => day.format(format));
  24966. };
  24967. function onParsedValueChanged(minDate2, maxDate2) {
  24968. if (props.unlinkPanels && maxDate2) {
  24969. const minDateYear = (minDate2 == null ? void 0 : minDate2.year()) || 0;
  24970. const maxDateYear = maxDate2.year();
  24971. rightDate.value = minDateYear === maxDateYear ? maxDate2.add(1, unit) : maxDate2;
  24972. } else {
  24973. rightDate.value = leftDate.value.add(1, unit);
  24974. }
  24975. }
  24976. emit("set-picker-option", ["formatToString", formatToString]);
  24977. return (_ctx, _cache) => {
  24978. return vue.openBlock(), vue.createElementBlock("div", {
  24979. class: vue.normalizeClass([
  24980. vue.unref(ppNs).b(),
  24981. vue.unref(drpNs).b(),
  24982. {
  24983. "has-sidebar": Boolean(_ctx.$slots.sidebar) || vue.unref(hasShortcuts)
  24984. }
  24985. ])
  24986. }, [
  24987. vue.createElementVNode("div", {
  24988. class: vue.normalizeClass(vue.unref(ppNs).e("body-wrapper"))
  24989. }, [
  24990. vue.renderSlot(_ctx.$slots, "sidebar", {
  24991. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  24992. }),
  24993. vue.unref(hasShortcuts) ? (vue.openBlock(), vue.createElementBlock("div", {
  24994. key: 0,
  24995. class: vue.normalizeClass(vue.unref(ppNs).e("sidebar"))
  24996. }, [
  24997. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(shortcuts), (shortcut, key) => {
  24998. return vue.openBlock(), vue.createElementBlock("button", {
  24999. key,
  25000. type: "button",
  25001. class: vue.normalizeClass(vue.unref(ppNs).e("shortcut")),
  25002. onClick: ($event) => vue.unref(handleShortcutClick)(shortcut)
  25003. }, vue.toDisplayString(shortcut.text), 11, _hoisted_1$E);
  25004. }), 128))
  25005. ], 2)) : vue.createCommentVNode("v-if", true),
  25006. vue.createElementVNode("div", {
  25007. class: vue.normalizeClass(vue.unref(ppNs).e("body"))
  25008. }, [
  25009. vue.createElementVNode("div", {
  25010. class: vue.normalizeClass([[vue.unref(ppNs).e("content"), vue.unref(drpNs).e("content")], "is-left"])
  25011. }, [
  25012. vue.createElementVNode("div", {
  25013. class: vue.normalizeClass(vue.unref(drpNs).e("header"))
  25014. }, [
  25015. vue.createElementVNode("button", {
  25016. type: "button",
  25017. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "d-arrow-left"]),
  25018. onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(leftPrevYear) && vue.unref(leftPrevYear)(...args))
  25019. }, [
  25020. vue.createVNode(vue.unref(ElIcon), null, {
  25021. default: vue.withCtx(() => [
  25022. vue.createVNode(vue.unref(d_arrow_left_default))
  25023. ]),
  25024. _: 1
  25025. })
  25026. ], 2),
  25027. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  25028. key: 0,
  25029. type: "button",
  25030. disabled: !vue.unref(enableYearArrow),
  25031. class: vue.normalizeClass([[
  25032. vue.unref(ppNs).e("icon-btn"),
  25033. { [vue.unref(ppNs).is("disabled")]: !vue.unref(enableYearArrow) }
  25034. ], "d-arrow-right"]),
  25035. onClick: _cache[1] || (_cache[1] = (...args) => vue.unref(leftNextYear) && vue.unref(leftNextYear)(...args))
  25036. }, [
  25037. vue.createVNode(vue.unref(ElIcon), null, {
  25038. default: vue.withCtx(() => [
  25039. vue.createVNode(vue.unref(d_arrow_right_default))
  25040. ]),
  25041. _: 1
  25042. })
  25043. ], 10, _hoisted_2$o)) : vue.createCommentVNode("v-if", true),
  25044. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(leftLabel)), 1)
  25045. ], 2),
  25046. vue.createVNode(MonthTable, {
  25047. "selection-mode": "range",
  25048. date: leftDate.value,
  25049. "min-date": vue.unref(minDate),
  25050. "max-date": vue.unref(maxDate),
  25051. "range-state": vue.unref(rangeState),
  25052. "disabled-date": vue.unref(disabledDate),
  25053. onChangerange: vue.unref(handleChangeRange),
  25054. onPick: handleRangePick,
  25055. onSelect: vue.unref(onSelect)
  25056. }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "onChangerange", "onSelect"])
  25057. ], 2),
  25058. vue.createElementVNode("div", {
  25059. class: vue.normalizeClass([[vue.unref(ppNs).e("content"), vue.unref(drpNs).e("content")], "is-right"])
  25060. }, [
  25061. vue.createElementVNode("div", {
  25062. class: vue.normalizeClass(vue.unref(drpNs).e("header"))
  25063. }, [
  25064. _ctx.unlinkPanels ? (vue.openBlock(), vue.createElementBlock("button", {
  25065. key: 0,
  25066. type: "button",
  25067. disabled: !vue.unref(enableYearArrow),
  25068. class: vue.normalizeClass([[vue.unref(ppNs).e("icon-btn"), { "is-disabled": !vue.unref(enableYearArrow) }], "d-arrow-left"]),
  25069. onClick: _cache[2] || (_cache[2] = (...args) => vue.unref(rightPrevYear) && vue.unref(rightPrevYear)(...args))
  25070. }, [
  25071. vue.createVNode(vue.unref(ElIcon), null, {
  25072. default: vue.withCtx(() => [
  25073. vue.createVNode(vue.unref(d_arrow_left_default))
  25074. ]),
  25075. _: 1
  25076. })
  25077. ], 10, _hoisted_3$a)) : vue.createCommentVNode("v-if", true),
  25078. vue.createElementVNode("button", {
  25079. type: "button",
  25080. class: vue.normalizeClass([vue.unref(ppNs).e("icon-btn"), "d-arrow-right"]),
  25081. onClick: _cache[3] || (_cache[3] = (...args) => vue.unref(rightNextYear) && vue.unref(rightNextYear)(...args))
  25082. }, [
  25083. vue.createVNode(vue.unref(ElIcon), null, {
  25084. default: vue.withCtx(() => [
  25085. vue.createVNode(vue.unref(d_arrow_right_default))
  25086. ]),
  25087. _: 1
  25088. })
  25089. ], 2),
  25090. vue.createElementVNode("div", null, vue.toDisplayString(vue.unref(rightLabel)), 1)
  25091. ], 2),
  25092. vue.createVNode(MonthTable, {
  25093. "selection-mode": "range",
  25094. date: rightDate.value,
  25095. "min-date": vue.unref(minDate),
  25096. "max-date": vue.unref(maxDate),
  25097. "range-state": vue.unref(rangeState),
  25098. "disabled-date": vue.unref(disabledDate),
  25099. onChangerange: vue.unref(handleChangeRange),
  25100. onPick: handleRangePick,
  25101. onSelect: vue.unref(onSelect)
  25102. }, null, 8, ["date", "min-date", "max-date", "range-state", "disabled-date", "onChangerange", "onSelect"])
  25103. ], 2)
  25104. ], 2)
  25105. ], 2)
  25106. ], 2);
  25107. };
  25108. }
  25109. });
  25110. var MonthRangePickPanel = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__file", "panel-month-range.vue"]]);
  25111. const getPanel = function(type) {
  25112. switch (type) {
  25113. case "daterange":
  25114. case "datetimerange": {
  25115. return DateRangePickPanel;
  25116. }
  25117. case "monthrange": {
  25118. return MonthRangePickPanel;
  25119. }
  25120. default: {
  25121. return DatePickPanel;
  25122. }
  25123. }
  25124. };
  25125. dayjs.extend(localeData);
  25126. dayjs.extend(advancedFormat);
  25127. dayjs.extend(customParseFormat);
  25128. dayjs.extend(weekOfYear);
  25129. dayjs.extend(weekYear);
  25130. dayjs.extend(dayOfYear);
  25131. dayjs.extend(isSameOrAfter);
  25132. dayjs.extend(isSameOrBefore);
  25133. var DatePicker = vue.defineComponent({
  25134. name: "ElDatePicker",
  25135. install: null,
  25136. props: {
  25137. ...timePickerDefaultProps,
  25138. ...datePickerProps
  25139. },
  25140. emits: ["update:modelValue"],
  25141. setup(props, {
  25142. expose,
  25143. emit,
  25144. slots
  25145. }) {
  25146. const ns = useNamespace("picker-panel");
  25147. vue.provide("ElPopperOptions", vue.reactive(vue.toRef(props, "popperOptions")));
  25148. vue.provide(ROOT_PICKER_INJECTION_KEY, {
  25149. slots,
  25150. pickerNs: ns
  25151. });
  25152. const commonPicker = vue.ref();
  25153. const refProps = {
  25154. focus: (focusStartInput = true) => {
  25155. var _a;
  25156. (_a = commonPicker.value) == null ? void 0 : _a.focus(focusStartInput);
  25157. },
  25158. handleOpen: () => {
  25159. var _a;
  25160. (_a = commonPicker.value) == null ? void 0 : _a.handleOpen();
  25161. },
  25162. handleClose: () => {
  25163. var _a;
  25164. (_a = commonPicker.value) == null ? void 0 : _a.handleClose();
  25165. }
  25166. };
  25167. expose(refProps);
  25168. const onModelValueUpdated = (val) => {
  25169. emit("update:modelValue", val);
  25170. };
  25171. return () => {
  25172. var _a;
  25173. const format = (_a = props.format) != null ? _a : DEFAULT_FORMATS_DATEPICKER[props.type] || DEFAULT_FORMATS_DATE;
  25174. const Component = getPanel(props.type);
  25175. return vue.createVNode(CommonPicker, vue.mergeProps(props, {
  25176. "format": format,
  25177. "type": props.type,
  25178. "ref": commonPicker,
  25179. "onUpdate:modelValue": onModelValueUpdated
  25180. }), {
  25181. default: (scopedProps) => vue.createVNode(Component, scopedProps, null),
  25182. "range-separator": slots["range-separator"]
  25183. });
  25184. };
  25185. }
  25186. });
  25187. const _DatePicker = DatePicker;
  25188. _DatePicker.install = (app) => {
  25189. app.component(_DatePicker.name, _DatePicker);
  25190. };
  25191. const ElDatePicker = _DatePicker;
  25192. const descriptionsKey = "elDescriptions";
  25193. var ElDescriptionsCell = vue.defineComponent({
  25194. name: "ElDescriptionsCell",
  25195. props: {
  25196. cell: {
  25197. type: Object
  25198. },
  25199. tag: {
  25200. type: String
  25201. },
  25202. type: {
  25203. type: String
  25204. }
  25205. },
  25206. setup() {
  25207. const descriptions = vue.inject(descriptionsKey, {});
  25208. return {
  25209. descriptions
  25210. };
  25211. },
  25212. render() {
  25213. var _a, _b, _c, _d, _e, _f;
  25214. const item = getNormalizedProps(this.cell);
  25215. const { border, direction } = this.descriptions;
  25216. const isVertical = direction === "vertical";
  25217. const label = ((_c = (_b = (_a = this.cell) == null ? void 0 : _a.children) == null ? void 0 : _b.label) == null ? void 0 : _c.call(_b)) || item.label;
  25218. const content = (_f = (_e = (_d = this.cell) == null ? void 0 : _d.children) == null ? void 0 : _e.default) == null ? void 0 : _f.call(_e);
  25219. const span = item.span;
  25220. const align = item.align ? `is-${item.align}` : "";
  25221. const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
  25222. const className = item.className;
  25223. const labelClassName = item.labelClassName;
  25224. const style = {
  25225. width: addUnit(item.width),
  25226. minWidth: addUnit(item.minWidth)
  25227. };
  25228. const ns = useNamespace("descriptions");
  25229. switch (this.type) {
  25230. case "label":
  25231. return vue.h(this.tag, {
  25232. style,
  25233. class: [
  25234. ns.e("cell"),
  25235. ns.e("label"),
  25236. ns.is("bordered-label", border),
  25237. ns.is("vertical-label", isVertical),
  25238. labelAlign,
  25239. labelClassName
  25240. ],
  25241. colSpan: isVertical ? span : 1
  25242. }, label);
  25243. case "content":
  25244. return vue.h(this.tag, {
  25245. style,
  25246. class: [
  25247. ns.e("cell"),
  25248. ns.e("content"),
  25249. ns.is("bordered-content", border),
  25250. ns.is("vertical-content", isVertical),
  25251. align,
  25252. className
  25253. ],
  25254. colSpan: isVertical ? span : span * 2 - 1
  25255. }, content);
  25256. default:
  25257. return vue.h("td", {
  25258. style,
  25259. class: [ns.e("cell"), align],
  25260. colSpan: span
  25261. }, [
  25262. vue.h("span", {
  25263. class: [ns.e("label"), labelClassName]
  25264. }, label),
  25265. vue.h("span", {
  25266. class: [ns.e("content"), className]
  25267. }, content)
  25268. ]);
  25269. }
  25270. }
  25271. });
  25272. const descriptionsRowProps = buildProps({
  25273. row: {
  25274. type: Array,
  25275. default: () => []
  25276. }
  25277. });
  25278. const _hoisted_1$D = { key: 1 };
  25279. const __default__$R = vue.defineComponent({
  25280. name: "ElDescriptionsRow"
  25281. });
  25282. const _sfc_main$1h = /* @__PURE__ */ vue.defineComponent({
  25283. ...__default__$R,
  25284. props: descriptionsRowProps,
  25285. setup(__props) {
  25286. const descriptions = vue.inject(descriptionsKey, {});
  25287. return (_ctx, _cache) => {
  25288. return vue.unref(descriptions).direction === "vertical" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  25289. vue.createElementVNode("tr", null, [
  25290. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, index) => {
  25291. return vue.openBlock(), vue.createBlock(vue.unref(ElDescriptionsCell), {
  25292. key: `tr1-${index}`,
  25293. cell,
  25294. tag: "th",
  25295. type: "label"
  25296. }, null, 8, ["cell"]);
  25297. }), 128))
  25298. ]),
  25299. vue.createElementVNode("tr", null, [
  25300. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, index) => {
  25301. return vue.openBlock(), vue.createBlock(vue.unref(ElDescriptionsCell), {
  25302. key: `tr2-${index}`,
  25303. cell,
  25304. tag: "td",
  25305. type: "content"
  25306. }, null, 8, ["cell"]);
  25307. }), 128))
  25308. ])
  25309. ], 64)) : (vue.openBlock(), vue.createElementBlock("tr", _hoisted_1$D, [
  25310. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.row, (cell, index) => {
  25311. return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
  25312. key: `tr3-${index}`
  25313. }, [
  25314. vue.unref(descriptions).border ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  25315. vue.createVNode(vue.unref(ElDescriptionsCell), {
  25316. cell,
  25317. tag: "td",
  25318. type: "label"
  25319. }, null, 8, ["cell"]),
  25320. vue.createVNode(vue.unref(ElDescriptionsCell), {
  25321. cell,
  25322. tag: "td",
  25323. type: "content"
  25324. }, null, 8, ["cell"])
  25325. ], 64)) : (vue.openBlock(), vue.createBlock(vue.unref(ElDescriptionsCell), {
  25326. key: 1,
  25327. cell,
  25328. tag: "td",
  25329. type: "both"
  25330. }, null, 8, ["cell"]))
  25331. ], 64);
  25332. }), 128))
  25333. ]));
  25334. };
  25335. }
  25336. });
  25337. var ElDescriptionsRow = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__file", "descriptions-row.vue"]]);
  25338. const descriptionProps = buildProps({
  25339. border: {
  25340. type: Boolean,
  25341. default: false
  25342. },
  25343. column: {
  25344. type: Number,
  25345. default: 3
  25346. },
  25347. direction: {
  25348. type: String,
  25349. values: ["horizontal", "vertical"],
  25350. default: "horizontal"
  25351. },
  25352. size: useSizeProp,
  25353. title: {
  25354. type: String,
  25355. default: ""
  25356. },
  25357. extra: {
  25358. type: String,
  25359. default: ""
  25360. }
  25361. });
  25362. const __default__$Q = vue.defineComponent({
  25363. name: "ElDescriptions"
  25364. });
  25365. const _sfc_main$1g = /* @__PURE__ */ vue.defineComponent({
  25366. ...__default__$Q,
  25367. props: descriptionProps,
  25368. setup(__props) {
  25369. const props = __props;
  25370. const ns = useNamespace("descriptions");
  25371. const descriptionsSize = useSize();
  25372. const slots = vue.useSlots();
  25373. vue.provide(descriptionsKey, props);
  25374. const descriptionKls = vue.computed(() => [ns.b(), ns.m(descriptionsSize.value)]);
  25375. const filledNode = (node, span, count, isLast = false) => {
  25376. if (!node.props) {
  25377. node.props = {};
  25378. }
  25379. if (span > count) {
  25380. node.props.span = count;
  25381. }
  25382. if (isLast) {
  25383. node.props.span = span;
  25384. }
  25385. return node;
  25386. };
  25387. const getRows = () => {
  25388. var _a;
  25389. const children = flattedChildren((_a = slots.default) == null ? void 0 : _a.call(slots)).filter((node) => {
  25390. var _a2;
  25391. return ((_a2 = node == null ? void 0 : node.type) == null ? void 0 : _a2.name) === "ElDescriptionsItem";
  25392. });
  25393. const rows = [];
  25394. let temp = [];
  25395. let count = props.column;
  25396. let totalSpan = 0;
  25397. children.forEach((node, index) => {
  25398. var _a2;
  25399. const span = ((_a2 = node.props) == null ? void 0 : _a2.span) || 1;
  25400. if (index < children.length - 1) {
  25401. totalSpan += span > count ? count : span;
  25402. }
  25403. if (index === children.length - 1) {
  25404. const lastSpan = props.column - totalSpan % props.column;
  25405. temp.push(filledNode(node, lastSpan, count, true));
  25406. rows.push(temp);
  25407. return;
  25408. }
  25409. if (span < count) {
  25410. count -= span;
  25411. temp.push(node);
  25412. } else {
  25413. temp.push(filledNode(node, span, count));
  25414. rows.push(temp);
  25415. count = props.column;
  25416. temp = [];
  25417. }
  25418. });
  25419. return rows;
  25420. };
  25421. return (_ctx, _cache) => {
  25422. return vue.openBlock(), vue.createElementBlock("div", {
  25423. class: vue.normalizeClass(vue.unref(descriptionKls))
  25424. }, [
  25425. _ctx.title || _ctx.extra || _ctx.$slots.title || _ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", {
  25426. key: 0,
  25427. class: vue.normalizeClass(vue.unref(ns).e("header"))
  25428. }, [
  25429. vue.createElementVNode("div", {
  25430. class: vue.normalizeClass(vue.unref(ns).e("title"))
  25431. }, [
  25432. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  25433. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  25434. ])
  25435. ], 2),
  25436. vue.createElementVNode("div", {
  25437. class: vue.normalizeClass(vue.unref(ns).e("extra"))
  25438. }, [
  25439. vue.renderSlot(_ctx.$slots, "extra", {}, () => [
  25440. vue.createTextVNode(vue.toDisplayString(_ctx.extra), 1)
  25441. ])
  25442. ], 2)
  25443. ], 2)) : vue.createCommentVNode("v-if", true),
  25444. vue.createElementVNode("div", {
  25445. class: vue.normalizeClass(vue.unref(ns).e("body"))
  25446. }, [
  25447. vue.createElementVNode("table", {
  25448. class: vue.normalizeClass([vue.unref(ns).e("table"), vue.unref(ns).is("bordered", _ctx.border)])
  25449. }, [
  25450. vue.createElementVNode("tbody", null, [
  25451. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getRows(), (row, index) => {
  25452. return vue.openBlock(), vue.createBlock(ElDescriptionsRow, {
  25453. key: index,
  25454. row
  25455. }, null, 8, ["row"]);
  25456. }), 128))
  25457. ])
  25458. ], 2)
  25459. ], 2)
  25460. ], 2);
  25461. };
  25462. }
  25463. });
  25464. var Descriptions = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__file", "description.vue"]]);
  25465. var DescriptionsItem = vue.defineComponent({
  25466. name: "ElDescriptionsItem",
  25467. props: {
  25468. label: {
  25469. type: String,
  25470. default: ""
  25471. },
  25472. span: {
  25473. type: Number,
  25474. default: 1
  25475. },
  25476. width: {
  25477. type: [String, Number],
  25478. default: ""
  25479. },
  25480. minWidth: {
  25481. type: [String, Number],
  25482. default: ""
  25483. },
  25484. align: {
  25485. type: String,
  25486. default: "left"
  25487. },
  25488. labelAlign: {
  25489. type: String,
  25490. default: ""
  25491. },
  25492. className: {
  25493. type: String,
  25494. default: ""
  25495. },
  25496. labelClassName: {
  25497. type: String,
  25498. default: ""
  25499. }
  25500. }
  25501. });
  25502. const ElDescriptions = withInstall(Descriptions, {
  25503. DescriptionsItem
  25504. });
  25505. const ElDescriptionsItem = withNoopInstall(DescriptionsItem);
  25506. const overlayProps = buildProps({
  25507. mask: {
  25508. type: Boolean,
  25509. default: true
  25510. },
  25511. customMaskEvent: {
  25512. type: Boolean,
  25513. default: false
  25514. },
  25515. overlayClass: {
  25516. type: definePropType([
  25517. String,
  25518. Array,
  25519. Object
  25520. ])
  25521. },
  25522. zIndex: {
  25523. type: definePropType([String, Number])
  25524. }
  25525. });
  25526. const overlayEmits = {
  25527. click: (evt) => evt instanceof MouseEvent
  25528. };
  25529. var Overlay$1 = vue.defineComponent({
  25530. name: "ElOverlay",
  25531. props: overlayProps,
  25532. emits: overlayEmits,
  25533. setup(props, { slots, emit }) {
  25534. const ns = useNamespace("overlay");
  25535. const onMaskClick = (e) => {
  25536. emit("click", e);
  25537. };
  25538. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  25539. return () => {
  25540. return props.mask ? vue.createVNode("div", {
  25541. class: [ns.b(), props.overlayClass],
  25542. style: {
  25543. zIndex: props.zIndex
  25544. },
  25545. onClick,
  25546. onMousedown,
  25547. onMouseup
  25548. }, [vue.renderSlot(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, ["onClick", "onMouseup", "onMousedown"]) : vue.h("div", {
  25549. class: props.overlayClass,
  25550. style: {
  25551. zIndex: props.zIndex,
  25552. position: "fixed",
  25553. top: "0px",
  25554. right: "0px",
  25555. bottom: "0px",
  25556. left: "0px"
  25557. }
  25558. }, [vue.renderSlot(slots, "default")]);
  25559. };
  25560. }
  25561. });
  25562. const ElOverlay = Overlay$1;
  25563. const dialogContentProps = buildProps({
  25564. center: {
  25565. type: Boolean,
  25566. default: false
  25567. },
  25568. alignCenter: {
  25569. type: Boolean,
  25570. default: false
  25571. },
  25572. closeIcon: {
  25573. type: iconPropType
  25574. },
  25575. customClass: {
  25576. type: String,
  25577. default: ""
  25578. },
  25579. draggable: {
  25580. type: Boolean,
  25581. default: false
  25582. },
  25583. fullscreen: {
  25584. type: Boolean,
  25585. default: false
  25586. },
  25587. showClose: {
  25588. type: Boolean,
  25589. default: true
  25590. },
  25591. title: {
  25592. type: String,
  25593. default: ""
  25594. }
  25595. });
  25596. const dialogContentEmits = {
  25597. close: () => true
  25598. };
  25599. const _hoisted_1$C = ["aria-label"];
  25600. const _hoisted_2$n = ["id"];
  25601. const __default__$P = vue.defineComponent({ name: "ElDialogContent" });
  25602. const _sfc_main$1f = /* @__PURE__ */ vue.defineComponent({
  25603. ...__default__$P,
  25604. props: dialogContentProps,
  25605. emits: dialogContentEmits,
  25606. setup(__props) {
  25607. const props = __props;
  25608. const { t } = useLocale();
  25609. const { Close } = CloseComponents;
  25610. const { dialogRef, headerRef, bodyId, ns, style } = vue.inject(dialogInjectionKey);
  25611. const { focusTrapRef } = vue.inject(FOCUS_TRAP_INJECTION_KEY);
  25612. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  25613. const draggable = vue.computed(() => props.draggable);
  25614. useDraggable(dialogRef, headerRef, draggable);
  25615. return (_ctx, _cache) => {
  25616. return vue.openBlock(), vue.createElementBlock("div", {
  25617. ref: vue.unref(composedDialogRef),
  25618. class: vue.normalizeClass([
  25619. vue.unref(ns).b(),
  25620. vue.unref(ns).is("fullscreen", _ctx.fullscreen),
  25621. vue.unref(ns).is("draggable", vue.unref(draggable)),
  25622. vue.unref(ns).is("align-center", _ctx.alignCenter),
  25623. { [vue.unref(ns).m("center")]: _ctx.center },
  25624. _ctx.customClass
  25625. ]),
  25626. style: vue.normalizeStyle(vue.unref(style)),
  25627. tabindex: "-1"
  25628. }, [
  25629. vue.createElementVNode("header", {
  25630. ref_key: "headerRef",
  25631. ref: headerRef,
  25632. class: vue.normalizeClass(vue.unref(ns).e("header"))
  25633. }, [
  25634. vue.renderSlot(_ctx.$slots, "header", {}, () => [
  25635. vue.createElementVNode("span", {
  25636. role: "heading",
  25637. class: vue.normalizeClass(vue.unref(ns).e("title"))
  25638. }, vue.toDisplayString(_ctx.title), 3)
  25639. ]),
  25640. _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
  25641. key: 0,
  25642. "aria-label": vue.unref(t)("el.dialog.close"),
  25643. class: vue.normalizeClass(vue.unref(ns).e("headerbtn")),
  25644. type: "button",
  25645. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  25646. }, [
  25647. vue.createVNode(vue.unref(ElIcon), {
  25648. class: vue.normalizeClass(vue.unref(ns).e("close"))
  25649. }, {
  25650. default: vue.withCtx(() => [
  25651. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.closeIcon || vue.unref(Close))))
  25652. ]),
  25653. _: 1
  25654. }, 8, ["class"])
  25655. ], 10, _hoisted_1$C)) : vue.createCommentVNode("v-if", true)
  25656. ], 2),
  25657. vue.createElementVNode("div", {
  25658. id: vue.unref(bodyId),
  25659. class: vue.normalizeClass(vue.unref(ns).e("body"))
  25660. }, [
  25661. vue.renderSlot(_ctx.$slots, "default")
  25662. ], 10, _hoisted_2$n),
  25663. _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("footer", {
  25664. key: 0,
  25665. class: vue.normalizeClass(vue.unref(ns).e("footer"))
  25666. }, [
  25667. vue.renderSlot(_ctx.$slots, "footer")
  25668. ], 2)) : vue.createCommentVNode("v-if", true)
  25669. ], 6);
  25670. };
  25671. }
  25672. });
  25673. var ElDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__file", "dialog-content.vue"]]);
  25674. const dialogProps = buildProps({
  25675. ...dialogContentProps,
  25676. appendToBody: {
  25677. type: Boolean,
  25678. default: false
  25679. },
  25680. beforeClose: {
  25681. type: definePropType(Function)
  25682. },
  25683. destroyOnClose: {
  25684. type: Boolean,
  25685. default: false
  25686. },
  25687. closeOnClickModal: {
  25688. type: Boolean,
  25689. default: true
  25690. },
  25691. closeOnPressEscape: {
  25692. type: Boolean,
  25693. default: true
  25694. },
  25695. lockScroll: {
  25696. type: Boolean,
  25697. default: true
  25698. },
  25699. modal: {
  25700. type: Boolean,
  25701. default: true
  25702. },
  25703. openDelay: {
  25704. type: Number,
  25705. default: 0
  25706. },
  25707. closeDelay: {
  25708. type: Number,
  25709. default: 0
  25710. },
  25711. top: {
  25712. type: String
  25713. },
  25714. modelValue: {
  25715. type: Boolean,
  25716. default: false
  25717. },
  25718. modalClass: String,
  25719. width: {
  25720. type: [String, Number]
  25721. },
  25722. zIndex: {
  25723. type: Number
  25724. },
  25725. trapFocus: {
  25726. type: Boolean,
  25727. default: false
  25728. }
  25729. });
  25730. const dialogEmits = {
  25731. open: () => true,
  25732. opened: () => true,
  25733. close: () => true,
  25734. closed: () => true,
  25735. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  25736. openAutoFocus: () => true,
  25737. closeAutoFocus: () => true
  25738. };
  25739. const useDialog = (props, targetRef) => {
  25740. const instance = vue.getCurrentInstance();
  25741. const emit = instance.emit;
  25742. const { nextZIndex } = useZIndex();
  25743. let lastPosition = "";
  25744. const titleId = useId();
  25745. const bodyId = useId();
  25746. const visible = vue.ref(false);
  25747. const closed = vue.ref(false);
  25748. const rendered = vue.ref(false);
  25749. const zIndex = vue.ref(props.zIndex || nextZIndex());
  25750. let openTimer = void 0;
  25751. let closeTimer = void 0;
  25752. const namespace = useGlobalConfig("namespace", defaultNamespace);
  25753. const style = vue.computed(() => {
  25754. const style2 = {};
  25755. const varPrefix = `--${namespace.value}-dialog`;
  25756. if (!props.fullscreen) {
  25757. if (props.top) {
  25758. style2[`${varPrefix}-margin-top`] = props.top;
  25759. }
  25760. if (props.width) {
  25761. style2[`${varPrefix}-width`] = addUnit(props.width);
  25762. }
  25763. }
  25764. return style2;
  25765. });
  25766. const overlayDialogStyle = vue.computed(() => {
  25767. if (props.alignCenter) {
  25768. return { display: "flex" };
  25769. }
  25770. return {};
  25771. });
  25772. function afterEnter() {
  25773. emit("opened");
  25774. }
  25775. function afterLeave() {
  25776. emit("closed");
  25777. emit(UPDATE_MODEL_EVENT, false);
  25778. if (props.destroyOnClose) {
  25779. rendered.value = false;
  25780. }
  25781. }
  25782. function beforeLeave() {
  25783. emit("close");
  25784. }
  25785. function open() {
  25786. closeTimer == null ? void 0 : closeTimer();
  25787. openTimer == null ? void 0 : openTimer();
  25788. if (props.openDelay && props.openDelay > 0) {
  25789. ({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay));
  25790. } else {
  25791. doOpen();
  25792. }
  25793. }
  25794. function close() {
  25795. openTimer == null ? void 0 : openTimer();
  25796. closeTimer == null ? void 0 : closeTimer();
  25797. if (props.closeDelay && props.closeDelay > 0) {
  25798. ({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay));
  25799. } else {
  25800. doClose();
  25801. }
  25802. }
  25803. function handleClose() {
  25804. function hide(shouldCancel) {
  25805. if (shouldCancel)
  25806. return;
  25807. closed.value = true;
  25808. visible.value = false;
  25809. }
  25810. if (props.beforeClose) {
  25811. props.beforeClose(hide);
  25812. } else {
  25813. close();
  25814. }
  25815. }
  25816. function onModalClick() {
  25817. if (props.closeOnClickModal) {
  25818. handleClose();
  25819. }
  25820. }
  25821. function doOpen() {
  25822. if (!isClient)
  25823. return;
  25824. visible.value = true;
  25825. }
  25826. function doClose() {
  25827. visible.value = false;
  25828. }
  25829. function onOpenAutoFocus() {
  25830. emit("openAutoFocus");
  25831. }
  25832. function onCloseAutoFocus() {
  25833. emit("closeAutoFocus");
  25834. }
  25835. function onFocusoutPrevented(event) {
  25836. var _a;
  25837. if (((_a = event.detail) == null ? void 0 : _a.focusReason) === "pointer") {
  25838. event.preventDefault();
  25839. }
  25840. }
  25841. if (props.lockScroll) {
  25842. useLockscreen(visible);
  25843. }
  25844. function onCloseRequested() {
  25845. if (props.closeOnPressEscape) {
  25846. handleClose();
  25847. }
  25848. }
  25849. vue.watch(() => props.modelValue, (val) => {
  25850. if (val) {
  25851. closed.value = false;
  25852. open();
  25853. rendered.value = true;
  25854. zIndex.value = props.zIndex ? zIndex.value++ : nextZIndex();
  25855. vue.nextTick(() => {
  25856. emit("open");
  25857. if (targetRef.value) {
  25858. targetRef.value.scrollTop = 0;
  25859. }
  25860. });
  25861. } else {
  25862. if (visible.value) {
  25863. close();
  25864. }
  25865. }
  25866. });
  25867. vue.watch(() => props.fullscreen, (val) => {
  25868. if (!targetRef.value)
  25869. return;
  25870. if (val) {
  25871. lastPosition = targetRef.value.style.transform;
  25872. targetRef.value.style.transform = "";
  25873. } else {
  25874. targetRef.value.style.transform = lastPosition;
  25875. }
  25876. });
  25877. vue.onMounted(() => {
  25878. if (props.modelValue) {
  25879. visible.value = true;
  25880. rendered.value = true;
  25881. open();
  25882. }
  25883. });
  25884. return {
  25885. afterEnter,
  25886. afterLeave,
  25887. beforeLeave,
  25888. handleClose,
  25889. onModalClick,
  25890. close,
  25891. doClose,
  25892. onOpenAutoFocus,
  25893. onCloseAutoFocus,
  25894. onCloseRequested,
  25895. onFocusoutPrevented,
  25896. titleId,
  25897. bodyId,
  25898. closed,
  25899. style,
  25900. overlayDialogStyle,
  25901. rendered,
  25902. visible,
  25903. zIndex
  25904. };
  25905. };
  25906. const _hoisted_1$B = ["aria-label", "aria-labelledby", "aria-describedby"];
  25907. const __default__$O = vue.defineComponent({
  25908. name: "ElDialog",
  25909. inheritAttrs: false
  25910. });
  25911. const _sfc_main$1e = /* @__PURE__ */ vue.defineComponent({
  25912. ...__default__$O,
  25913. props: dialogProps,
  25914. emits: dialogEmits,
  25915. setup(__props, { expose }) {
  25916. const props = __props;
  25917. const slots = vue.useSlots();
  25918. useDeprecated({
  25919. scope: "el-dialog",
  25920. from: "the title slot",
  25921. replacement: "the header slot",
  25922. version: "3.0.0",
  25923. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  25924. }, vue.computed(() => !!slots.title));
  25925. useDeprecated({
  25926. scope: "el-dialog",
  25927. from: "custom-class",
  25928. replacement: "class",
  25929. version: "2.3.0",
  25930. ref: "https://element-plus.org/en-US/component/dialog.html#attributes",
  25931. type: "Attribute"
  25932. }, vue.computed(() => !!props.customClass));
  25933. const ns = useNamespace("dialog");
  25934. const dialogRef = vue.ref();
  25935. const headerRef = vue.ref();
  25936. const dialogContentRef = vue.ref();
  25937. const {
  25938. visible,
  25939. titleId,
  25940. bodyId,
  25941. style,
  25942. overlayDialogStyle,
  25943. rendered,
  25944. zIndex,
  25945. afterEnter,
  25946. afterLeave,
  25947. beforeLeave,
  25948. handleClose,
  25949. onModalClick,
  25950. onOpenAutoFocus,
  25951. onCloseAutoFocus,
  25952. onCloseRequested,
  25953. onFocusoutPrevented
  25954. } = useDialog(props, dialogRef);
  25955. vue.provide(dialogInjectionKey, {
  25956. dialogRef,
  25957. headerRef,
  25958. bodyId,
  25959. ns,
  25960. rendered,
  25961. style
  25962. });
  25963. const overlayEvent = useSameTarget(onModalClick);
  25964. const draggable = vue.computed(() => props.draggable && !props.fullscreen);
  25965. expose({
  25966. visible,
  25967. dialogContentRef
  25968. });
  25969. return (_ctx, _cache) => {
  25970. return vue.openBlock(), vue.createBlock(vue.Teleport, {
  25971. to: "body",
  25972. disabled: !_ctx.appendToBody
  25973. }, [
  25974. vue.createVNode(vue.Transition, {
  25975. name: "dialog-fade",
  25976. onAfterEnter: vue.unref(afterEnter),
  25977. onAfterLeave: vue.unref(afterLeave),
  25978. onBeforeLeave: vue.unref(beforeLeave),
  25979. persisted: ""
  25980. }, {
  25981. default: vue.withCtx(() => [
  25982. vue.withDirectives(vue.createVNode(vue.unref(ElOverlay), {
  25983. "custom-mask-event": "",
  25984. mask: _ctx.modal,
  25985. "overlay-class": _ctx.modalClass,
  25986. "z-index": vue.unref(zIndex)
  25987. }, {
  25988. default: vue.withCtx(() => [
  25989. vue.createElementVNode("div", {
  25990. role: "dialog",
  25991. "aria-modal": "true",
  25992. "aria-label": _ctx.title || void 0,
  25993. "aria-labelledby": !_ctx.title ? vue.unref(titleId) : void 0,
  25994. "aria-describedby": vue.unref(bodyId),
  25995. class: vue.normalizeClass(`${vue.unref(ns).namespace.value}-overlay-dialog`),
  25996. style: vue.normalizeStyle(vue.unref(overlayDialogStyle)),
  25997. onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(overlayEvent).onClick && vue.unref(overlayEvent).onClick(...args)),
  25998. onMousedown: _cache[1] || (_cache[1] = (...args) => vue.unref(overlayEvent).onMousedown && vue.unref(overlayEvent).onMousedown(...args)),
  25999. onMouseup: _cache[2] || (_cache[2] = (...args) => vue.unref(overlayEvent).onMouseup && vue.unref(overlayEvent).onMouseup(...args))
  26000. }, [
  26001. vue.createVNode(vue.unref(ElFocusTrap), {
  26002. loop: "",
  26003. trapped: vue.unref(visible),
  26004. "focus-start-el": "container",
  26005. onFocusAfterTrapped: vue.unref(onOpenAutoFocus),
  26006. onFocusAfterReleased: vue.unref(onCloseAutoFocus),
  26007. onFocusoutPrevented: vue.unref(onFocusoutPrevented),
  26008. onReleaseRequested: vue.unref(onCloseRequested)
  26009. }, {
  26010. default: vue.withCtx(() => [
  26011. vue.unref(rendered) ? (vue.openBlock(), vue.createBlock(ElDialogContent, vue.mergeProps({
  26012. key: 0,
  26013. ref_key: "dialogContentRef",
  26014. ref: dialogContentRef
  26015. }, _ctx.$attrs, {
  26016. "custom-class": _ctx.customClass,
  26017. center: _ctx.center,
  26018. "align-center": _ctx.alignCenter,
  26019. "close-icon": _ctx.closeIcon,
  26020. draggable: vue.unref(draggable),
  26021. fullscreen: _ctx.fullscreen,
  26022. "show-close": _ctx.showClose,
  26023. title: _ctx.title,
  26024. onClose: vue.unref(handleClose)
  26025. }), vue.createSlots({
  26026. header: vue.withCtx(() => [
  26027. !_ctx.$slots.title ? vue.renderSlot(_ctx.$slots, "header", {
  26028. key: 0,
  26029. close: vue.unref(handleClose),
  26030. titleId: vue.unref(titleId),
  26031. titleClass: vue.unref(ns).e("title")
  26032. }) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
  26033. ]),
  26034. default: vue.withCtx(() => [
  26035. vue.renderSlot(_ctx.$slots, "default")
  26036. ]),
  26037. _: 2
  26038. }, [
  26039. _ctx.$slots.footer ? {
  26040. name: "footer",
  26041. fn: vue.withCtx(() => [
  26042. vue.renderSlot(_ctx.$slots, "footer")
  26043. ])
  26044. } : void 0
  26045. ]), 1040, ["custom-class", "center", "align-center", "close-icon", "draggable", "fullscreen", "show-close", "title", "onClose"])) : vue.createCommentVNode("v-if", true)
  26046. ]),
  26047. _: 3
  26048. }, 8, ["trapped", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusoutPrevented", "onReleaseRequested"])
  26049. ], 46, _hoisted_1$B)
  26050. ]),
  26051. _: 3
  26052. }, 8, ["mask", "overlay-class", "z-index"]), [
  26053. [vue.vShow, vue.unref(visible)]
  26054. ])
  26055. ]),
  26056. _: 3
  26057. }, 8, ["onAfterEnter", "onAfterLeave", "onBeforeLeave"])
  26058. ], 8, ["disabled"]);
  26059. };
  26060. }
  26061. });
  26062. var Dialog = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__file", "dialog.vue"]]);
  26063. const ElDialog = withInstall(Dialog);
  26064. const dividerProps = buildProps({
  26065. direction: {
  26066. type: String,
  26067. values: ["horizontal", "vertical"],
  26068. default: "horizontal"
  26069. },
  26070. contentPosition: {
  26071. type: String,
  26072. values: ["left", "center", "right"],
  26073. default: "center"
  26074. },
  26075. borderStyle: {
  26076. type: definePropType(String),
  26077. default: "solid"
  26078. }
  26079. });
  26080. const __default__$N = vue.defineComponent({
  26081. name: "ElDivider"
  26082. });
  26083. const _sfc_main$1d = /* @__PURE__ */ vue.defineComponent({
  26084. ...__default__$N,
  26085. props: dividerProps,
  26086. setup(__props) {
  26087. const props = __props;
  26088. const ns = useNamespace("divider");
  26089. const dividerStyle = vue.computed(() => {
  26090. return ns.cssVar({
  26091. "border-style": props.borderStyle
  26092. });
  26093. });
  26094. return (_ctx, _cache) => {
  26095. return vue.openBlock(), vue.createElementBlock("div", {
  26096. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.direction)]),
  26097. style: vue.normalizeStyle(vue.unref(dividerStyle)),
  26098. role: "separator"
  26099. }, [
  26100. _ctx.$slots.default && _ctx.direction !== "vertical" ? (vue.openBlock(), vue.createElementBlock("div", {
  26101. key: 0,
  26102. class: vue.normalizeClass([vue.unref(ns).e("text"), vue.unref(ns).is(_ctx.contentPosition)])
  26103. }, [
  26104. vue.renderSlot(_ctx.$slots, "default")
  26105. ], 2)) : vue.createCommentVNode("v-if", true)
  26106. ], 6);
  26107. };
  26108. }
  26109. });
  26110. var Divider = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__file", "divider.vue"]]);
  26111. const ElDivider = withInstall(Divider);
  26112. const drawerProps = buildProps({
  26113. ...dialogProps,
  26114. direction: {
  26115. type: String,
  26116. default: "rtl",
  26117. values: ["ltr", "rtl", "ttb", "btt"]
  26118. },
  26119. size: {
  26120. type: [String, Number],
  26121. default: "30%"
  26122. },
  26123. withHeader: {
  26124. type: Boolean,
  26125. default: true
  26126. },
  26127. modalFade: {
  26128. type: Boolean,
  26129. default: true
  26130. }
  26131. });
  26132. const drawerEmits = dialogEmits;
  26133. const _sfc_main$1c = vue.defineComponent({
  26134. name: "ElDrawer",
  26135. components: {
  26136. ElOverlay,
  26137. ElFocusTrap,
  26138. ElIcon,
  26139. Close: close_default
  26140. },
  26141. inheritAttrs: false,
  26142. props: drawerProps,
  26143. emits: drawerEmits,
  26144. setup(props, { slots }) {
  26145. useDeprecated({
  26146. scope: "el-drawer",
  26147. from: "the title slot",
  26148. replacement: "the header slot",
  26149. version: "3.0.0",
  26150. ref: "https://element-plus.org/en-US/component/drawer.html#slots"
  26151. }, vue.computed(() => !!slots.title));
  26152. useDeprecated({
  26153. scope: "el-drawer",
  26154. from: "custom-class",
  26155. replacement: "class",
  26156. version: "2.3.0",
  26157. ref: "https://element-plus.org/en-US/component/drawer.html#attributes",
  26158. type: "Attribute"
  26159. }, vue.computed(() => !!props.customClass));
  26160. const drawerRef = vue.ref();
  26161. const focusStartRef = vue.ref();
  26162. const ns = useNamespace("drawer");
  26163. const { t } = useLocale();
  26164. const isHorizontal = vue.computed(() => props.direction === "rtl" || props.direction === "ltr");
  26165. const drawerSize = vue.computed(() => addUnit(props.size));
  26166. return {
  26167. ...useDialog(props, drawerRef),
  26168. drawerRef,
  26169. focusStartRef,
  26170. isHorizontal,
  26171. drawerSize,
  26172. ns,
  26173. t
  26174. };
  26175. }
  26176. });
  26177. const _hoisted_1$A = ["aria-label", "aria-labelledby", "aria-describedby"];
  26178. const _hoisted_2$m = ["id"];
  26179. const _hoisted_3$9 = ["aria-label"];
  26180. const _hoisted_4$7 = ["id"];
  26181. function _sfc_render$p(_ctx, _cache, $props, $setup, $data, $options) {
  26182. const _component_close = vue.resolveComponent("close");
  26183. const _component_el_icon = vue.resolveComponent("el-icon");
  26184. const _component_el_focus_trap = vue.resolveComponent("el-focus-trap");
  26185. const _component_el_overlay = vue.resolveComponent("el-overlay");
  26186. return vue.openBlock(), vue.createBlock(vue.Teleport, {
  26187. to: "body",
  26188. disabled: !_ctx.appendToBody
  26189. }, [
  26190. vue.createVNode(vue.Transition, {
  26191. name: _ctx.ns.b("fade"),
  26192. onAfterEnter: _ctx.afterEnter,
  26193. onAfterLeave: _ctx.afterLeave,
  26194. onBeforeLeave: _ctx.beforeLeave,
  26195. persisted: ""
  26196. }, {
  26197. default: vue.withCtx(() => [
  26198. vue.withDirectives(vue.createVNode(_component_el_overlay, {
  26199. mask: _ctx.modal,
  26200. "overlay-class": _ctx.modalClass,
  26201. "z-index": _ctx.zIndex,
  26202. onClick: _ctx.onModalClick
  26203. }, {
  26204. default: vue.withCtx(() => [
  26205. vue.createVNode(_component_el_focus_trap, {
  26206. loop: "",
  26207. trapped: _ctx.visible,
  26208. "focus-trap-el": _ctx.drawerRef,
  26209. "focus-start-el": _ctx.focusStartRef,
  26210. onReleaseRequested: _ctx.onCloseRequested
  26211. }, {
  26212. default: vue.withCtx(() => [
  26213. vue.createElementVNode("div", vue.mergeProps({
  26214. ref: "drawerRef",
  26215. "aria-modal": "true",
  26216. "aria-label": _ctx.title || void 0,
  26217. "aria-labelledby": !_ctx.title ? _ctx.titleId : void 0,
  26218. "aria-describedby": _ctx.bodyId
  26219. }, _ctx.$attrs, {
  26220. class: [_ctx.ns.b(), _ctx.direction, _ctx.visible && "open", _ctx.customClass],
  26221. style: _ctx.isHorizontal ? "width: " + _ctx.drawerSize : "height: " + _ctx.drawerSize,
  26222. role: "dialog",
  26223. onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
  26224. }, ["stop"]))
  26225. }), [
  26226. vue.createElementVNode("span", {
  26227. ref: "focusStartRef",
  26228. class: vue.normalizeClass(_ctx.ns.e("sr-focus")),
  26229. tabindex: "-1"
  26230. }, null, 2),
  26231. _ctx.withHeader ? (vue.openBlock(), vue.createElementBlock("header", {
  26232. key: 0,
  26233. class: vue.normalizeClass(_ctx.ns.e("header"))
  26234. }, [
  26235. !_ctx.$slots.title ? vue.renderSlot(_ctx.$slots, "header", {
  26236. key: 0,
  26237. close: _ctx.handleClose,
  26238. titleId: _ctx.titleId,
  26239. titleClass: _ctx.ns.e("title")
  26240. }, () => [
  26241. !_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
  26242. key: 0,
  26243. id: _ctx.titleId,
  26244. role: "heading",
  26245. class: vue.normalizeClass(_ctx.ns.e("title"))
  26246. }, vue.toDisplayString(_ctx.title), 11, _hoisted_2$m)) : vue.createCommentVNode("v-if", true)
  26247. ]) : vue.renderSlot(_ctx.$slots, "title", { key: 1 }, () => [
  26248. vue.createCommentVNode(" DEPRECATED SLOT ")
  26249. ]),
  26250. _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
  26251. key: 2,
  26252. "aria-label": _ctx.t("el.drawer.close"),
  26253. class: vue.normalizeClass(_ctx.ns.e("close-btn")),
  26254. type: "button",
  26255. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClose && _ctx.handleClose(...args))
  26256. }, [
  26257. vue.createVNode(_component_el_icon, {
  26258. class: vue.normalizeClass(_ctx.ns.e("close"))
  26259. }, {
  26260. default: vue.withCtx(() => [
  26261. vue.createVNode(_component_close)
  26262. ]),
  26263. _: 1
  26264. }, 8, ["class"])
  26265. ], 10, _hoisted_3$9)) : vue.createCommentVNode("v-if", true)
  26266. ], 2)) : vue.createCommentVNode("v-if", true),
  26267. _ctx.rendered ? (vue.openBlock(), vue.createElementBlock("div", {
  26268. key: 1,
  26269. id: _ctx.bodyId,
  26270. class: vue.normalizeClass(_ctx.ns.e("body"))
  26271. }, [
  26272. vue.renderSlot(_ctx.$slots, "default")
  26273. ], 10, _hoisted_4$7)) : vue.createCommentVNode("v-if", true),
  26274. _ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", {
  26275. key: 2,
  26276. class: vue.normalizeClass(_ctx.ns.e("footer"))
  26277. }, [
  26278. vue.renderSlot(_ctx.$slots, "footer")
  26279. ], 2)) : vue.createCommentVNode("v-if", true)
  26280. ], 16, _hoisted_1$A)
  26281. ]),
  26282. _: 3
  26283. }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
  26284. ]),
  26285. _: 3
  26286. }, 8, ["mask", "overlay-class", "z-index", "onClick"]), [
  26287. [vue.vShow, _ctx.visible]
  26288. ])
  26289. ]),
  26290. _: 3
  26291. }, 8, ["name", "onAfterEnter", "onAfterLeave", "onBeforeLeave"])
  26292. ], 8, ["disabled"]);
  26293. }
  26294. var Drawer = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["render", _sfc_render$p], ["__file", "drawer.vue"]]);
  26295. const ElDrawer = withInstall(Drawer);
  26296. const _sfc_main$1b = /* @__PURE__ */ vue.defineComponent({
  26297. inheritAttrs: false
  26298. });
  26299. function _sfc_render$o(_ctx, _cache, $props, $setup, $data, $options) {
  26300. return vue.renderSlot(_ctx.$slots, "default");
  26301. }
  26302. var Collection = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["render", _sfc_render$o], ["__file", "collection.vue"]]);
  26303. const _sfc_main$1a = /* @__PURE__ */ vue.defineComponent({
  26304. name: "ElCollectionItem",
  26305. inheritAttrs: false
  26306. });
  26307. function _sfc_render$n(_ctx, _cache, $props, $setup, $data, $options) {
  26308. return vue.renderSlot(_ctx.$slots, "default");
  26309. }
  26310. var CollectionItem = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["render", _sfc_render$n], ["__file", "collection-item.vue"]]);
  26311. const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
  26312. const createCollectionWithScope = (name) => {
  26313. const COLLECTION_NAME = `El${name}Collection`;
  26314. const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
  26315. const COLLECTION_INJECTION_KEY = Symbol(COLLECTION_NAME);
  26316. const COLLECTION_ITEM_INJECTION_KEY = Symbol(COLLECTION_ITEM_NAME);
  26317. const ElCollection = {
  26318. ...Collection,
  26319. name: COLLECTION_NAME,
  26320. setup() {
  26321. const collectionRef = vue.ref(null);
  26322. const itemMap = /* @__PURE__ */ new Map();
  26323. const getItems = () => {
  26324. const collectionEl = vue.unref(collectionRef);
  26325. if (!collectionEl)
  26326. return [];
  26327. const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
  26328. const items = [...itemMap.values()];
  26329. return items.sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
  26330. };
  26331. vue.provide(COLLECTION_INJECTION_KEY, {
  26332. itemMap,
  26333. getItems,
  26334. collectionRef
  26335. });
  26336. }
  26337. };
  26338. const ElCollectionItem = {
  26339. ...CollectionItem,
  26340. name: COLLECTION_ITEM_NAME,
  26341. setup(_, { attrs }) {
  26342. const collectionItemRef = vue.ref(null);
  26343. const collectionInjection = vue.inject(COLLECTION_INJECTION_KEY, void 0);
  26344. vue.provide(COLLECTION_ITEM_INJECTION_KEY, {
  26345. collectionItemRef
  26346. });
  26347. vue.onMounted(() => {
  26348. const collectionItemEl = vue.unref(collectionItemRef);
  26349. if (collectionItemEl) {
  26350. collectionInjection.itemMap.set(collectionItemEl, {
  26351. ref: collectionItemEl,
  26352. ...attrs
  26353. });
  26354. }
  26355. });
  26356. vue.onBeforeUnmount(() => {
  26357. const collectionItemEl = vue.unref(collectionItemRef);
  26358. collectionInjection.itemMap.delete(collectionItemEl);
  26359. });
  26360. }
  26361. };
  26362. return {
  26363. COLLECTION_INJECTION_KEY,
  26364. COLLECTION_ITEM_INJECTION_KEY,
  26365. ElCollection,
  26366. ElCollectionItem
  26367. };
  26368. };
  26369. const rovingFocusGroupProps = buildProps({
  26370. style: { type: definePropType([String, Array, Object]) },
  26371. currentTabId: {
  26372. type: definePropType(String)
  26373. },
  26374. defaultCurrentTabId: String,
  26375. loop: Boolean,
  26376. dir: {
  26377. type: String,
  26378. values: ["ltr", "rtl"],
  26379. default: "ltr"
  26380. },
  26381. orientation: {
  26382. type: definePropType(String)
  26383. },
  26384. onBlur: Function,
  26385. onFocus: Function,
  26386. onMousedown: Function
  26387. });
  26388. const {
  26389. ElCollection: ElCollection$1,
  26390. ElCollectionItem: ElCollectionItem$1,
  26391. COLLECTION_INJECTION_KEY: COLLECTION_INJECTION_KEY$1,
  26392. COLLECTION_ITEM_INJECTION_KEY: COLLECTION_ITEM_INJECTION_KEY$1
  26393. } = createCollectionWithScope("RovingFocusGroup");
  26394. const ROVING_FOCUS_GROUP_INJECTION_KEY = Symbol("elRovingFocusGroup");
  26395. const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = Symbol("elRovingFocusGroupItem");
  26396. const MAP_KEY_TO_FOCUS_INTENT = {
  26397. ArrowLeft: "prev",
  26398. ArrowUp: "prev",
  26399. ArrowRight: "next",
  26400. ArrowDown: "next",
  26401. PageUp: "first",
  26402. Home: "first",
  26403. PageDown: "last",
  26404. End: "last"
  26405. };
  26406. const getDirectionAwareKey = (key, dir) => {
  26407. if (dir !== "rtl")
  26408. return key;
  26409. switch (key) {
  26410. case EVENT_CODE.right:
  26411. return EVENT_CODE.left;
  26412. case EVENT_CODE.left:
  26413. return EVENT_CODE.right;
  26414. default:
  26415. return key;
  26416. }
  26417. };
  26418. const getFocusIntent = (event, orientation, dir) => {
  26419. const key = getDirectionAwareKey(event.key, dir);
  26420. if (orientation === "vertical" && [EVENT_CODE.left, EVENT_CODE.right].includes(key))
  26421. return void 0;
  26422. if (orientation === "horizontal" && [EVENT_CODE.up, EVENT_CODE.down].includes(key))
  26423. return void 0;
  26424. return MAP_KEY_TO_FOCUS_INTENT[key];
  26425. };
  26426. const reorderArray = (array, atIdx) => {
  26427. return array.map((_, idx) => array[(idx + atIdx) % array.length]);
  26428. };
  26429. const focusFirst = (elements) => {
  26430. const { activeElement: prevActive } = document;
  26431. for (const element of elements) {
  26432. if (element === prevActive)
  26433. return;
  26434. element.focus();
  26435. if (prevActive !== document.activeElement)
  26436. return;
  26437. }
  26438. };
  26439. const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
  26440. const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
  26441. const EVT_OPTS = { bubbles: false, cancelable: true };
  26442. const _sfc_main$19 = vue.defineComponent({
  26443. name: "ElRovingFocusGroupImpl",
  26444. inheritAttrs: false,
  26445. props: rovingFocusGroupProps,
  26446. emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"],
  26447. setup(props, { emit }) {
  26448. var _a;
  26449. const currentTabbedId = vue.ref((_a = props.currentTabId || props.defaultCurrentTabId) != null ? _a : null);
  26450. const isBackingOut = vue.ref(false);
  26451. const isClickFocus = vue.ref(false);
  26452. const rovingFocusGroupRef = vue.ref(null);
  26453. const { getItems } = vue.inject(COLLECTION_INJECTION_KEY$1, void 0);
  26454. const rovingFocusGroupRootStyle = vue.computed(() => {
  26455. return [
  26456. {
  26457. outline: "none"
  26458. },
  26459. props.style
  26460. ];
  26461. });
  26462. const onItemFocus = (tabbedId) => {
  26463. emit(CURRENT_TAB_ID_CHANGE_EVT, tabbedId);
  26464. };
  26465. const onItemShiftTab = () => {
  26466. isBackingOut.value = true;
  26467. };
  26468. const onMousedown = composeEventHandlers((e) => {
  26469. var _a2;
  26470. (_a2 = props.onMousedown) == null ? void 0 : _a2.call(props, e);
  26471. }, () => {
  26472. isClickFocus.value = true;
  26473. });
  26474. const onFocus = composeEventHandlers((e) => {
  26475. var _a2;
  26476. (_a2 = props.onFocus) == null ? void 0 : _a2.call(props, e);
  26477. }, (e) => {
  26478. const isKeyboardFocus = !vue.unref(isClickFocus);
  26479. const { target, currentTarget } = e;
  26480. if (target === currentTarget && isKeyboardFocus && !vue.unref(isBackingOut)) {
  26481. const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS);
  26482. currentTarget == null ? void 0 : currentTarget.dispatchEvent(entryFocusEvt);
  26483. if (!entryFocusEvt.defaultPrevented) {
  26484. const items = getItems().filter((item) => item.focusable);
  26485. const activeItem = items.find((item) => item.active);
  26486. const currentItem = items.find((item) => item.id === vue.unref(currentTabbedId));
  26487. const candidates = [activeItem, currentItem, ...items].filter(Boolean);
  26488. const candidateNodes = candidates.map((item) => item.ref);
  26489. focusFirst(candidateNodes);
  26490. }
  26491. }
  26492. isClickFocus.value = false;
  26493. });
  26494. const onBlur = composeEventHandlers((e) => {
  26495. var _a2;
  26496. (_a2 = props.onBlur) == null ? void 0 : _a2.call(props, e);
  26497. }, () => {
  26498. isBackingOut.value = false;
  26499. });
  26500. const handleEntryFocus = (...args) => {
  26501. emit("entryFocus", ...args);
  26502. };
  26503. vue.provide(ROVING_FOCUS_GROUP_INJECTION_KEY, {
  26504. currentTabbedId: vue.readonly(currentTabbedId),
  26505. loop: vue.toRef(props, "loop"),
  26506. tabIndex: vue.computed(() => {
  26507. return vue.unref(isBackingOut) ? -1 : 0;
  26508. }),
  26509. rovingFocusGroupRef,
  26510. rovingFocusGroupRootStyle,
  26511. orientation: vue.toRef(props, "orientation"),
  26512. dir: vue.toRef(props, "dir"),
  26513. onItemFocus,
  26514. onItemShiftTab,
  26515. onBlur,
  26516. onFocus,
  26517. onMousedown
  26518. });
  26519. vue.watch(() => props.currentTabId, (val) => {
  26520. currentTabbedId.value = val != null ? val : null;
  26521. });
  26522. useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
  26523. }
  26524. });
  26525. function _sfc_render$m(_ctx, _cache, $props, $setup, $data, $options) {
  26526. return vue.renderSlot(_ctx.$slots, "default");
  26527. }
  26528. var ElRovingFocusGroupImpl = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["render", _sfc_render$m], ["__file", "roving-focus-group-impl.vue"]]);
  26529. const _sfc_main$18 = vue.defineComponent({
  26530. name: "ElRovingFocusGroup",
  26531. components: {
  26532. ElFocusGroupCollection: ElCollection$1,
  26533. ElRovingFocusGroupImpl
  26534. }
  26535. });
  26536. function _sfc_render$l(_ctx, _cache, $props, $setup, $data, $options) {
  26537. const _component_el_roving_focus_group_impl = vue.resolveComponent("el-roving-focus-group-impl");
  26538. const _component_el_focus_group_collection = vue.resolveComponent("el-focus-group-collection");
  26539. return vue.openBlock(), vue.createBlock(_component_el_focus_group_collection, null, {
  26540. default: vue.withCtx(() => [
  26541. vue.createVNode(_component_el_roving_focus_group_impl, vue.normalizeProps(vue.guardReactiveProps(_ctx.$attrs)), {
  26542. default: vue.withCtx(() => [
  26543. vue.renderSlot(_ctx.$slots, "default")
  26544. ]),
  26545. _: 3
  26546. }, 16)
  26547. ]),
  26548. _: 3
  26549. });
  26550. }
  26551. var ElRovingFocusGroup = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["render", _sfc_render$l], ["__file", "roving-focus-group.vue"]]);
  26552. const _sfc_main$17 = vue.defineComponent({
  26553. components: {
  26554. ElRovingFocusCollectionItem: ElCollectionItem$1
  26555. },
  26556. props: {
  26557. focusable: {
  26558. type: Boolean,
  26559. default: true
  26560. },
  26561. active: {
  26562. type: Boolean,
  26563. default: false
  26564. }
  26565. },
  26566. emits: ["mousedown", "focus", "keydown"],
  26567. setup(props, { emit }) {
  26568. const { currentTabbedId, loop, onItemFocus, onItemShiftTab } = vue.inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  26569. const { getItems } = vue.inject(COLLECTION_INJECTION_KEY$1, void 0);
  26570. const id = useId();
  26571. const rovingFocusGroupItemRef = vue.ref(null);
  26572. const handleMousedown = composeEventHandlers((e) => {
  26573. emit("mousedown", e);
  26574. }, (e) => {
  26575. if (!props.focusable) {
  26576. e.preventDefault();
  26577. } else {
  26578. onItemFocus(vue.unref(id));
  26579. }
  26580. });
  26581. const handleFocus = composeEventHandlers((e) => {
  26582. emit("focus", e);
  26583. }, () => {
  26584. onItemFocus(vue.unref(id));
  26585. });
  26586. const handleKeydown = composeEventHandlers((e) => {
  26587. emit("keydown", e);
  26588. }, (e) => {
  26589. const { key, shiftKey, target, currentTarget } = e;
  26590. if (key === EVENT_CODE.tab && shiftKey) {
  26591. onItemShiftTab();
  26592. return;
  26593. }
  26594. if (target !== currentTarget)
  26595. return;
  26596. const focusIntent = getFocusIntent(e);
  26597. if (focusIntent) {
  26598. e.preventDefault();
  26599. const items = getItems().filter((item) => item.focusable);
  26600. let elements = items.map((item) => item.ref);
  26601. switch (focusIntent) {
  26602. case "last": {
  26603. elements.reverse();
  26604. break;
  26605. }
  26606. case "prev":
  26607. case "next": {
  26608. if (focusIntent === "prev") {
  26609. elements.reverse();
  26610. }
  26611. const currentIdx = elements.indexOf(currentTarget);
  26612. elements = loop.value ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1);
  26613. break;
  26614. }
  26615. }
  26616. vue.nextTick(() => {
  26617. focusFirst(elements);
  26618. });
  26619. }
  26620. });
  26621. const isCurrentTab = vue.computed(() => currentTabbedId.value === vue.unref(id));
  26622. vue.provide(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
  26623. rovingFocusGroupItemRef,
  26624. tabIndex: vue.computed(() => vue.unref(isCurrentTab) ? 0 : -1),
  26625. handleMousedown,
  26626. handleFocus,
  26627. handleKeydown
  26628. });
  26629. return {
  26630. id,
  26631. handleKeydown,
  26632. handleFocus,
  26633. handleMousedown
  26634. };
  26635. }
  26636. });
  26637. function _sfc_render$k(_ctx, _cache, $props, $setup, $data, $options) {
  26638. const _component_el_roving_focus_collection_item = vue.resolveComponent("el-roving-focus-collection-item");
  26639. return vue.openBlock(), vue.createBlock(_component_el_roving_focus_collection_item, {
  26640. id: _ctx.id,
  26641. focusable: _ctx.focusable,
  26642. active: _ctx.active
  26643. }, {
  26644. default: vue.withCtx(() => [
  26645. vue.renderSlot(_ctx.$slots, "default")
  26646. ]),
  26647. _: 3
  26648. }, 8, ["id", "focusable", "active"]);
  26649. }
  26650. var ElRovingFocusItem = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["render", _sfc_render$k], ["__file", "roving-focus-item.vue"]]);
  26651. const dropdownProps = buildProps({
  26652. trigger: useTooltipTriggerProps.trigger,
  26653. effect: {
  26654. ...useTooltipContentProps.effect,
  26655. default: "light"
  26656. },
  26657. type: {
  26658. type: definePropType(String)
  26659. },
  26660. placement: {
  26661. type: definePropType(String),
  26662. default: "bottom"
  26663. },
  26664. popperOptions: {
  26665. type: definePropType(Object),
  26666. default: () => ({})
  26667. },
  26668. id: String,
  26669. size: {
  26670. type: String,
  26671. default: ""
  26672. },
  26673. splitButton: Boolean,
  26674. hideOnClick: {
  26675. type: Boolean,
  26676. default: true
  26677. },
  26678. loop: {
  26679. type: Boolean,
  26680. default: true
  26681. },
  26682. showTimeout: {
  26683. type: Number,
  26684. default: 150
  26685. },
  26686. hideTimeout: {
  26687. type: Number,
  26688. default: 150
  26689. },
  26690. tabindex: {
  26691. type: definePropType([Number, String]),
  26692. default: 0
  26693. },
  26694. maxHeight: {
  26695. type: definePropType([Number, String]),
  26696. default: ""
  26697. },
  26698. popperClass: {
  26699. type: String,
  26700. default: ""
  26701. },
  26702. disabled: {
  26703. type: Boolean,
  26704. default: false
  26705. },
  26706. role: {
  26707. type: String,
  26708. default: "menu"
  26709. },
  26710. buttonProps: {
  26711. type: definePropType(Object)
  26712. },
  26713. teleported: useTooltipContentProps.teleported
  26714. });
  26715. const dropdownItemProps = buildProps({
  26716. command: {
  26717. type: [Object, String, Number],
  26718. default: () => ({})
  26719. },
  26720. disabled: Boolean,
  26721. divided: Boolean,
  26722. textValue: String,
  26723. icon: {
  26724. type: iconPropType
  26725. }
  26726. });
  26727. const dropdownMenuProps = buildProps({
  26728. onKeydown: { type: definePropType(Function) }
  26729. });
  26730. const FIRST_KEYS = [
  26731. EVENT_CODE.down,
  26732. EVENT_CODE.pageDown,
  26733. EVENT_CODE.home
  26734. ];
  26735. const LAST_KEYS = [EVENT_CODE.up, EVENT_CODE.pageUp, EVENT_CODE.end];
  26736. const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
  26737. const {
  26738. ElCollection,
  26739. ElCollectionItem,
  26740. COLLECTION_INJECTION_KEY,
  26741. COLLECTION_ITEM_INJECTION_KEY
  26742. } = createCollectionWithScope("Dropdown");
  26743. const DROPDOWN_INJECTION_KEY = Symbol("elDropdown");
  26744. const { ButtonGroup: ElButtonGroup } = ElButton;
  26745. const _sfc_main$16 = vue.defineComponent({
  26746. name: "ElDropdown",
  26747. components: {
  26748. ElButton,
  26749. ElButtonGroup,
  26750. ElScrollbar,
  26751. ElDropdownCollection: ElCollection,
  26752. ElTooltip,
  26753. ElRovingFocusGroup,
  26754. ElOnlyChild: OnlyChild,
  26755. ElIcon,
  26756. ArrowDown: arrow_down_default
  26757. },
  26758. props: dropdownProps,
  26759. emits: ["visible-change", "click", "command"],
  26760. setup(props, { emit }) {
  26761. const _instance = vue.getCurrentInstance();
  26762. const ns = useNamespace("dropdown");
  26763. const { t } = useLocale();
  26764. const triggeringElementRef = vue.ref();
  26765. const referenceElementRef = vue.ref();
  26766. const popperRef = vue.ref(null);
  26767. const contentRef = vue.ref(null);
  26768. const scrollbar = vue.ref(null);
  26769. const currentTabId = vue.ref(null);
  26770. const isUsingKeyboard = vue.ref(false);
  26771. const triggerKeys = [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.down];
  26772. const wrapStyle = vue.computed(() => ({
  26773. maxHeight: addUnit(props.maxHeight)
  26774. }));
  26775. const dropdownTriggerKls = vue.computed(() => [ns.m(dropdownSize.value)]);
  26776. const defaultTriggerId = useId().value;
  26777. const triggerId = vue.computed(() => {
  26778. return props.id || defaultTriggerId;
  26779. });
  26780. function handleClick() {
  26781. handleClose();
  26782. }
  26783. function handleClose() {
  26784. var _a;
  26785. (_a = popperRef.value) == null ? void 0 : _a.onClose();
  26786. }
  26787. function handleOpen() {
  26788. var _a;
  26789. (_a = popperRef.value) == null ? void 0 : _a.onOpen();
  26790. }
  26791. const dropdownSize = useSize();
  26792. function commandHandler(...args) {
  26793. emit("command", ...args);
  26794. }
  26795. function onItemEnter() {
  26796. }
  26797. function onItemLeave() {
  26798. const contentEl = vue.unref(contentRef);
  26799. contentEl == null ? void 0 : contentEl.focus();
  26800. currentTabId.value = null;
  26801. }
  26802. function handleCurrentTabIdChange(id) {
  26803. currentTabId.value = id;
  26804. }
  26805. function handleEntryFocus(e) {
  26806. if (!isUsingKeyboard.value) {
  26807. e.preventDefault();
  26808. e.stopImmediatePropagation();
  26809. }
  26810. }
  26811. function handleBeforeShowTooltip() {
  26812. emit("visible-change", true);
  26813. }
  26814. function handleShowTooltip(event) {
  26815. if ((event == null ? void 0 : event.type) === "keydown") {
  26816. contentRef.value.focus();
  26817. }
  26818. }
  26819. function handleBeforeHideTooltip() {
  26820. emit("visible-change", false);
  26821. }
  26822. vue.provide(DROPDOWN_INJECTION_KEY, {
  26823. contentRef,
  26824. role: vue.computed(() => props.role),
  26825. triggerId,
  26826. isUsingKeyboard,
  26827. onItemEnter,
  26828. onItemLeave
  26829. });
  26830. vue.provide("elDropdown", {
  26831. instance: _instance,
  26832. dropdownSize,
  26833. handleClick,
  26834. commandHandler,
  26835. trigger: vue.toRef(props, "trigger"),
  26836. hideOnClick: vue.toRef(props, "hideOnClick")
  26837. });
  26838. const onFocusAfterTrapped = (e) => {
  26839. var _a, _b;
  26840. e.preventDefault();
  26841. (_b = (_a = contentRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a, {
  26842. preventScroll: true
  26843. });
  26844. };
  26845. const handlerMainButtonClick = (event) => {
  26846. emit("click", event);
  26847. };
  26848. return {
  26849. t,
  26850. ns,
  26851. scrollbar,
  26852. wrapStyle,
  26853. dropdownTriggerKls,
  26854. dropdownSize,
  26855. triggerId,
  26856. triggerKeys,
  26857. currentTabId,
  26858. handleCurrentTabIdChange,
  26859. handlerMainButtonClick,
  26860. handleEntryFocus,
  26861. handleClose,
  26862. handleOpen,
  26863. handleBeforeShowTooltip,
  26864. handleShowTooltip,
  26865. handleBeforeHideTooltip,
  26866. onFocusAfterTrapped,
  26867. popperRef,
  26868. contentRef,
  26869. triggeringElementRef,
  26870. referenceElementRef
  26871. };
  26872. }
  26873. });
  26874. function _sfc_render$j(_ctx, _cache, $props, $setup, $data, $options) {
  26875. var _a;
  26876. const _component_el_dropdown_collection = vue.resolveComponent("el-dropdown-collection");
  26877. const _component_el_roving_focus_group = vue.resolveComponent("el-roving-focus-group");
  26878. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  26879. const _component_el_only_child = vue.resolveComponent("el-only-child");
  26880. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  26881. const _component_el_button = vue.resolveComponent("el-button");
  26882. const _component_arrow_down = vue.resolveComponent("arrow-down");
  26883. const _component_el_icon = vue.resolveComponent("el-icon");
  26884. const _component_el_button_group = vue.resolveComponent("el-button-group");
  26885. return vue.openBlock(), vue.createElementBlock("div", {
  26886. class: vue.normalizeClass([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)])
  26887. }, [
  26888. vue.createVNode(_component_el_tooltip, {
  26889. ref: "popperRef",
  26890. role: _ctx.role,
  26891. effect: _ctx.effect,
  26892. "fallback-placements": ["bottom", "top"],
  26893. "popper-options": _ctx.popperOptions,
  26894. "gpu-acceleration": false,
  26895. "hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0,
  26896. "manual-mode": true,
  26897. placement: _ctx.placement,
  26898. "popper-class": [_ctx.ns.e("popper"), _ctx.popperClass],
  26899. "reference-element": (_a = _ctx.referenceElementRef) == null ? void 0 : _a.$el,
  26900. trigger: _ctx.trigger,
  26901. "trigger-keys": _ctx.triggerKeys,
  26902. "trigger-target-el": _ctx.contentRef,
  26903. "show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0,
  26904. "stop-popper-mouse-event": false,
  26905. "virtual-ref": _ctx.triggeringElementRef,
  26906. "virtual-triggering": _ctx.splitButton,
  26907. disabled: _ctx.disabled,
  26908. transition: `${_ctx.ns.namespace.value}-zoom-in-top`,
  26909. teleported: _ctx.teleported,
  26910. pure: "",
  26911. persistent: "",
  26912. onBeforeShow: _ctx.handleBeforeShowTooltip,
  26913. onShow: _ctx.handleShowTooltip,
  26914. onBeforeHide: _ctx.handleBeforeHideTooltip
  26915. }, vue.createSlots({
  26916. content: vue.withCtx(() => [
  26917. vue.createVNode(_component_el_scrollbar, {
  26918. ref: "scrollbar",
  26919. "wrap-style": _ctx.wrapStyle,
  26920. tag: "div",
  26921. "view-class": _ctx.ns.e("list")
  26922. }, {
  26923. default: vue.withCtx(() => [
  26924. vue.createVNode(_component_el_roving_focus_group, {
  26925. loop: _ctx.loop,
  26926. "current-tab-id": _ctx.currentTabId,
  26927. orientation: "horizontal",
  26928. onCurrentTabIdChange: _ctx.handleCurrentTabIdChange,
  26929. onEntryFocus: _ctx.handleEntryFocus
  26930. }, {
  26931. default: vue.withCtx(() => [
  26932. vue.createVNode(_component_el_dropdown_collection, null, {
  26933. default: vue.withCtx(() => [
  26934. vue.renderSlot(_ctx.$slots, "dropdown")
  26935. ]),
  26936. _: 3
  26937. })
  26938. ]),
  26939. _: 3
  26940. }, 8, ["loop", "current-tab-id", "onCurrentTabIdChange", "onEntryFocus"])
  26941. ]),
  26942. _: 3
  26943. }, 8, ["wrap-style", "view-class"])
  26944. ]),
  26945. _: 2
  26946. }, [
  26947. !_ctx.splitButton ? {
  26948. name: "default",
  26949. fn: vue.withCtx(() => [
  26950. vue.createVNode(_component_el_only_child, {
  26951. id: _ctx.triggerId,
  26952. role: "button",
  26953. tabindex: _ctx.tabindex
  26954. }, {
  26955. default: vue.withCtx(() => [
  26956. vue.renderSlot(_ctx.$slots, "default")
  26957. ]),
  26958. _: 3
  26959. }, 8, ["id", "tabindex"])
  26960. ])
  26961. } : void 0
  26962. ]), 1032, ["role", "effect", "popper-options", "hide-after", "placement", "popper-class", "reference-element", "trigger", "trigger-keys", "trigger-target-el", "show-after", "virtual-ref", "virtual-triggering", "disabled", "transition", "teleported", "onBeforeShow", "onShow", "onBeforeHide"]),
  26963. _ctx.splitButton ? (vue.openBlock(), vue.createBlock(_component_el_button_group, { key: 0 }, {
  26964. default: vue.withCtx(() => [
  26965. vue.createVNode(_component_el_button, vue.mergeProps({ ref: "referenceElementRef" }, _ctx.buttonProps, {
  26966. size: _ctx.dropdownSize,
  26967. type: _ctx.type,
  26968. disabled: _ctx.disabled,
  26969. tabindex: _ctx.tabindex,
  26970. onClick: _ctx.handlerMainButtonClick
  26971. }), {
  26972. default: vue.withCtx(() => [
  26973. vue.renderSlot(_ctx.$slots, "default")
  26974. ]),
  26975. _: 3
  26976. }, 16, ["size", "type", "disabled", "tabindex", "onClick"]),
  26977. vue.createVNode(_component_el_button, vue.mergeProps({
  26978. id: _ctx.triggerId,
  26979. ref: "triggeringElementRef"
  26980. }, _ctx.buttonProps, {
  26981. role: "button",
  26982. size: _ctx.dropdownSize,
  26983. type: _ctx.type,
  26984. class: _ctx.ns.e("caret-button"),
  26985. disabled: _ctx.disabled,
  26986. tabindex: _ctx.tabindex,
  26987. "aria-label": _ctx.t("el.dropdown.toggleDropdown")
  26988. }), {
  26989. default: vue.withCtx(() => [
  26990. vue.createVNode(_component_el_icon, {
  26991. class: vue.normalizeClass(_ctx.ns.e("icon"))
  26992. }, {
  26993. default: vue.withCtx(() => [
  26994. vue.createVNode(_component_arrow_down)
  26995. ]),
  26996. _: 1
  26997. }, 8, ["class"])
  26998. ]),
  26999. _: 1
  27000. }, 16, ["id", "size", "type", "class", "disabled", "tabindex", "aria-label"])
  27001. ]),
  27002. _: 3
  27003. })) : vue.createCommentVNode("v-if", true)
  27004. ], 2);
  27005. }
  27006. var Dropdown = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["render", _sfc_render$j], ["__file", "dropdown.vue"]]);
  27007. const _sfc_main$15 = vue.defineComponent({
  27008. name: "DropdownItemImpl",
  27009. components: {
  27010. ElIcon
  27011. },
  27012. props: dropdownItemProps,
  27013. emits: ["pointermove", "pointerleave", "click", "clickimpl"],
  27014. setup(_, { emit }) {
  27015. const ns = useNamespace("dropdown");
  27016. const { role: menuRole } = vue.inject(DROPDOWN_INJECTION_KEY, void 0);
  27017. const { collectionItemRef: dropdownCollectionItemRef } = vue.inject(COLLECTION_ITEM_INJECTION_KEY, void 0);
  27018. const { collectionItemRef: rovingFocusCollectionItemRef } = vue.inject(COLLECTION_ITEM_INJECTION_KEY$1, void 0);
  27019. const {
  27020. rovingFocusGroupItemRef,
  27021. tabIndex,
  27022. handleFocus,
  27023. handleKeydown: handleItemKeydown,
  27024. handleMousedown
  27025. } = vue.inject(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0);
  27026. const itemRef = composeRefs(dropdownCollectionItemRef, rovingFocusCollectionItemRef, rovingFocusGroupItemRef);
  27027. const role = vue.computed(() => {
  27028. if (menuRole.value === "menu") {
  27029. return "menuitem";
  27030. } else if (menuRole.value === "navigation") {
  27031. return "link";
  27032. }
  27033. return "button";
  27034. });
  27035. const handleKeydown = composeEventHandlers((e) => {
  27036. const { code } = e;
  27037. if (code === EVENT_CODE.enter || code === EVENT_CODE.space) {
  27038. e.preventDefault();
  27039. e.stopImmediatePropagation();
  27040. emit("clickimpl", e);
  27041. return true;
  27042. }
  27043. }, handleItemKeydown);
  27044. return {
  27045. ns,
  27046. itemRef,
  27047. dataset: {
  27048. [COLLECTION_ITEM_SIGN]: ""
  27049. },
  27050. role,
  27051. tabIndex,
  27052. handleFocus,
  27053. handleKeydown,
  27054. handleMousedown
  27055. };
  27056. }
  27057. });
  27058. const _hoisted_1$z = ["aria-disabled", "tabindex", "role"];
  27059. function _sfc_render$i(_ctx, _cache, $props, $setup, $data, $options) {
  27060. const _component_el_icon = vue.resolveComponent("el-icon");
  27061. return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
  27062. _ctx.divided ? (vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
  27063. key: 0,
  27064. role: "separator",
  27065. class: _ctx.ns.bem("menu", "item", "divided")
  27066. }, _ctx.$attrs), null, 16)) : vue.createCommentVNode("v-if", true),
  27067. vue.createElementVNode("li", vue.mergeProps({ ref: _ctx.itemRef }, { ..._ctx.dataset, ..._ctx.$attrs }, {
  27068. "aria-disabled": _ctx.disabled,
  27069. class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)],
  27070. tabindex: _ctx.tabIndex,
  27071. role: _ctx.role,
  27072. onClick: _cache[0] || (_cache[0] = (e) => _ctx.$emit("clickimpl", e)),
  27073. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  27074. onKeydown: _cache[2] || (_cache[2] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
  27075. onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)),
  27076. onPointermove: _cache[4] || (_cache[4] = (e) => _ctx.$emit("pointermove", e)),
  27077. onPointerleave: _cache[5] || (_cache[5] = (e) => _ctx.$emit("pointerleave", e))
  27078. }), [
  27079. _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_el_icon, { key: 0 }, {
  27080. default: vue.withCtx(() => [
  27081. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  27082. ]),
  27083. _: 1
  27084. })) : vue.createCommentVNode("v-if", true),
  27085. vue.renderSlot(_ctx.$slots, "default")
  27086. ], 16, _hoisted_1$z)
  27087. ], 64);
  27088. }
  27089. var ElDropdownItemImpl = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["render", _sfc_render$i], ["__file", "dropdown-item-impl.vue"]]);
  27090. const useDropdown = () => {
  27091. const elDropdown = vue.inject("elDropdown", {});
  27092. const _elDropdownSize = vue.computed(() => elDropdown == null ? void 0 : elDropdown.dropdownSize);
  27093. return {
  27094. elDropdown,
  27095. _elDropdownSize
  27096. };
  27097. };
  27098. const _sfc_main$14 = vue.defineComponent({
  27099. name: "ElDropdownItem",
  27100. components: {
  27101. ElDropdownCollectionItem: ElCollectionItem,
  27102. ElRovingFocusItem,
  27103. ElDropdownItemImpl
  27104. },
  27105. inheritAttrs: false,
  27106. props: dropdownItemProps,
  27107. emits: ["pointermove", "pointerleave", "click"],
  27108. setup(props, { emit, attrs }) {
  27109. const { elDropdown } = useDropdown();
  27110. const _instance = vue.getCurrentInstance();
  27111. const itemRef = vue.ref(null);
  27112. const textContent = vue.computed(() => {
  27113. var _a, _b;
  27114. return (_b = (_a = vue.unref(itemRef)) == null ? void 0 : _a.textContent) != null ? _b : "";
  27115. });
  27116. const { onItemEnter, onItemLeave } = vue.inject(DROPDOWN_INJECTION_KEY, void 0);
  27117. const handlePointerMove = composeEventHandlers((e) => {
  27118. emit("pointermove", e);
  27119. return e.defaultPrevented;
  27120. }, whenMouse((e) => {
  27121. var _a;
  27122. if (props.disabled) {
  27123. onItemLeave(e);
  27124. } else {
  27125. onItemEnter(e);
  27126. if (!e.defaultPrevented) {
  27127. (_a = e.currentTarget) == null ? void 0 : _a.focus();
  27128. }
  27129. }
  27130. }));
  27131. const handlePointerLeave = composeEventHandlers((e) => {
  27132. emit("pointerleave", e);
  27133. return e.defaultPrevented;
  27134. }, whenMouse((e) => {
  27135. onItemLeave(e);
  27136. }));
  27137. const handleClick = composeEventHandlers((e) => {
  27138. if (props.disabled) {
  27139. return;
  27140. }
  27141. emit("click", e);
  27142. return e.type !== "keydown" && e.defaultPrevented;
  27143. }, (e) => {
  27144. var _a, _b, _c;
  27145. if (props.disabled) {
  27146. e.stopImmediatePropagation();
  27147. return;
  27148. }
  27149. if ((_a = elDropdown == null ? void 0 : elDropdown.hideOnClick) == null ? void 0 : _a.value) {
  27150. (_b = elDropdown.handleClick) == null ? void 0 : _b.call(elDropdown);
  27151. }
  27152. (_c = elDropdown.commandHandler) == null ? void 0 : _c.call(elDropdown, props.command, _instance, e);
  27153. });
  27154. const propsAndAttrs = vue.computed(() => {
  27155. return { ...props, ...attrs };
  27156. });
  27157. return {
  27158. handleClick,
  27159. handlePointerMove,
  27160. handlePointerLeave,
  27161. textContent,
  27162. propsAndAttrs
  27163. };
  27164. }
  27165. });
  27166. function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
  27167. var _a;
  27168. const _component_el_dropdown_item_impl = vue.resolveComponent("el-dropdown-item-impl");
  27169. const _component_el_roving_focus_item = vue.resolveComponent("el-roving-focus-item");
  27170. const _component_el_dropdown_collection_item = vue.resolveComponent("el-dropdown-collection-item");
  27171. return vue.openBlock(), vue.createBlock(_component_el_dropdown_collection_item, {
  27172. disabled: _ctx.disabled,
  27173. "text-value": (_a = _ctx.textValue) != null ? _a : _ctx.textContent
  27174. }, {
  27175. default: vue.withCtx(() => [
  27176. vue.createVNode(_component_el_roving_focus_item, {
  27177. focusable: !_ctx.disabled
  27178. }, {
  27179. default: vue.withCtx(() => [
  27180. vue.createVNode(_component_el_dropdown_item_impl, vue.mergeProps(_ctx.propsAndAttrs, {
  27181. onPointerleave: _ctx.handlePointerLeave,
  27182. onPointermove: _ctx.handlePointerMove,
  27183. onClickimpl: _ctx.handleClick
  27184. }), {
  27185. default: vue.withCtx(() => [
  27186. vue.renderSlot(_ctx.$slots, "default")
  27187. ]),
  27188. _: 3
  27189. }, 16, ["onPointerleave", "onPointermove", "onClickimpl"])
  27190. ]),
  27191. _: 3
  27192. }, 8, ["focusable"])
  27193. ]),
  27194. _: 3
  27195. }, 8, ["disabled", "text-value"]);
  27196. }
  27197. var DropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["render", _sfc_render$h], ["__file", "dropdown-item.vue"]]);
  27198. const _sfc_main$13 = vue.defineComponent({
  27199. name: "ElDropdownMenu",
  27200. props: dropdownMenuProps,
  27201. setup(props) {
  27202. const ns = useNamespace("dropdown");
  27203. const { _elDropdownSize } = useDropdown();
  27204. const size = _elDropdownSize.value;
  27205. const { focusTrapRef, onKeydown } = vue.inject(FOCUS_TRAP_INJECTION_KEY, void 0);
  27206. const { contentRef, role, triggerId } = vue.inject(DROPDOWN_INJECTION_KEY, void 0);
  27207. const { collectionRef: dropdownCollectionRef, getItems } = vue.inject(COLLECTION_INJECTION_KEY, void 0);
  27208. const {
  27209. rovingFocusGroupRef,
  27210. rovingFocusGroupRootStyle,
  27211. tabIndex,
  27212. onBlur,
  27213. onFocus,
  27214. onMousedown
  27215. } = vue.inject(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  27216. const { collectionRef: rovingFocusGroupCollectionRef } = vue.inject(COLLECTION_INJECTION_KEY$1, void 0);
  27217. const dropdownKls = vue.computed(() => {
  27218. return [ns.b("menu"), ns.bm("menu", size == null ? void 0 : size.value)];
  27219. });
  27220. const dropdownListWrapperRef = composeRefs(contentRef, dropdownCollectionRef, focusTrapRef, rovingFocusGroupRef, rovingFocusGroupCollectionRef);
  27221. const composedKeydown = composeEventHandlers((e) => {
  27222. var _a;
  27223. (_a = props.onKeydown) == null ? void 0 : _a.call(props, e);
  27224. }, (e) => {
  27225. const { currentTarget, code, target } = e;
  27226. currentTarget.contains(target);
  27227. if (EVENT_CODE.tab === code) {
  27228. e.stopImmediatePropagation();
  27229. }
  27230. e.preventDefault();
  27231. if (target !== vue.unref(contentRef))
  27232. return;
  27233. if (!FIRST_LAST_KEYS.includes(code))
  27234. return;
  27235. const items = getItems().filter((item) => !item.disabled);
  27236. const targets = items.map((item) => item.ref);
  27237. if (LAST_KEYS.includes(code)) {
  27238. targets.reverse();
  27239. }
  27240. focusFirst(targets);
  27241. });
  27242. const handleKeydown = (e) => {
  27243. composedKeydown(e);
  27244. onKeydown(e);
  27245. };
  27246. return {
  27247. size,
  27248. rovingFocusGroupRootStyle,
  27249. tabIndex,
  27250. dropdownKls,
  27251. role,
  27252. triggerId,
  27253. dropdownListWrapperRef,
  27254. handleKeydown,
  27255. onBlur,
  27256. onFocus,
  27257. onMousedown
  27258. };
  27259. }
  27260. });
  27261. const _hoisted_1$y = ["role", "aria-labelledby"];
  27262. function _sfc_render$g(_ctx, _cache, $props, $setup, $data, $options) {
  27263. return vue.openBlock(), vue.createElementBlock("ul", {
  27264. ref: _ctx.dropdownListWrapperRef,
  27265. class: vue.normalizeClass(_ctx.dropdownKls),
  27266. style: vue.normalizeStyle(_ctx.rovingFocusGroupRootStyle),
  27267. tabindex: -1,
  27268. role: _ctx.role,
  27269. "aria-labelledby": _ctx.triggerId,
  27270. onBlur: _cache[0] || (_cache[0] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
  27271. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
  27272. onKeydown: _cache[2] || (_cache[2] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
  27273. onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.onMousedown && _ctx.onMousedown(...args))
  27274. }, [
  27275. vue.renderSlot(_ctx.$slots, "default")
  27276. ], 46, _hoisted_1$y);
  27277. }
  27278. var DropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["render", _sfc_render$g], ["__file", "dropdown-menu.vue"]]);
  27279. const ElDropdown = withInstall(Dropdown, {
  27280. DropdownItem,
  27281. DropdownMenu
  27282. });
  27283. const ElDropdownItem = withNoopInstall(DropdownItem);
  27284. const ElDropdownMenu = withNoopInstall(DropdownMenu);
  27285. let id = 0;
  27286. const _sfc_main$12 = vue.defineComponent({
  27287. name: "ImgEmpty",
  27288. setup() {
  27289. const ns = useNamespace("empty");
  27290. return {
  27291. ns,
  27292. id: ++id
  27293. };
  27294. }
  27295. });
  27296. const _hoisted_1$x = {
  27297. viewBox: "0 0 79 86",
  27298. version: "1.1",
  27299. xmlns: "http://www.w3.org/2000/svg",
  27300. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  27301. };
  27302. const _hoisted_2$l = ["id"];
  27303. const _hoisted_3$8 = ["stop-color"];
  27304. const _hoisted_4$6 = ["stop-color"];
  27305. const _hoisted_5$5 = ["id"];
  27306. const _hoisted_6$1 = ["stop-color"];
  27307. const _hoisted_7 = ["stop-color"];
  27308. const _hoisted_8 = ["id"];
  27309. const _hoisted_9 = {
  27310. id: "Illustrations",
  27311. stroke: "none",
  27312. "stroke-width": "1",
  27313. fill: "none",
  27314. "fill-rule": "evenodd"
  27315. };
  27316. const _hoisted_10 = {
  27317. id: "B-type",
  27318. transform: "translate(-1268.000000, -535.000000)"
  27319. };
  27320. const _hoisted_11 = {
  27321. id: "Group-2",
  27322. transform: "translate(1268.000000, 535.000000)"
  27323. };
  27324. const _hoisted_12 = ["fill"];
  27325. const _hoisted_13 = ["fill"];
  27326. const _hoisted_14 = {
  27327. id: "Group-Copy",
  27328. transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)"
  27329. };
  27330. const _hoisted_15 = ["fill"];
  27331. const _hoisted_16 = ["fill"];
  27332. const _hoisted_17 = ["fill"];
  27333. const _hoisted_18 = ["fill"];
  27334. const _hoisted_19 = ["fill"];
  27335. const _hoisted_20 = {
  27336. id: "Rectangle-Copy-17",
  27337. transform: "translate(53.000000, 45.000000)"
  27338. };
  27339. const _hoisted_21 = ["fill", "xlink:href"];
  27340. const _hoisted_22 = ["fill", "mask"];
  27341. const _hoisted_23 = ["fill"];
  27342. function _sfc_render$f(_ctx, _cache, $props, $setup, $data, $options) {
  27343. return vue.openBlock(), vue.createElementBlock("svg", _hoisted_1$x, [
  27344. vue.createElementVNode("defs", null, [
  27345. vue.createElementVNode("linearGradient", {
  27346. id: `linearGradient-1-${_ctx.id}`,
  27347. x1: "38.8503086%",
  27348. y1: "0%",
  27349. x2: "61.1496914%",
  27350. y2: "100%"
  27351. }, [
  27352. vue.createElementVNode("stop", {
  27353. "stop-color": `var(${_ctx.ns.cssVarBlockName("fill-color-1")})`,
  27354. offset: "0%"
  27355. }, null, 8, _hoisted_3$8),
  27356. vue.createElementVNode("stop", {
  27357. "stop-color": `var(${_ctx.ns.cssVarBlockName("fill-color-4")})`,
  27358. offset: "100%"
  27359. }, null, 8, _hoisted_4$6)
  27360. ], 8, _hoisted_2$l),
  27361. vue.createElementVNode("linearGradient", {
  27362. id: `linearGradient-2-${_ctx.id}`,
  27363. x1: "0%",
  27364. y1: "9.5%",
  27365. x2: "100%",
  27366. y2: "90.5%"
  27367. }, [
  27368. vue.createElementVNode("stop", {
  27369. "stop-color": `var(${_ctx.ns.cssVarBlockName("fill-color-1")})`,
  27370. offset: "0%"
  27371. }, null, 8, _hoisted_6$1),
  27372. vue.createElementVNode("stop", {
  27373. "stop-color": `var(${_ctx.ns.cssVarBlockName("fill-color-6")})`,
  27374. offset: "100%"
  27375. }, null, 8, _hoisted_7)
  27376. ], 8, _hoisted_5$5),
  27377. vue.createElementVNode("rect", {
  27378. id: `path-3-${_ctx.id}`,
  27379. x: "0",
  27380. y: "0",
  27381. width: "17",
  27382. height: "36"
  27383. }, null, 8, _hoisted_8)
  27384. ]),
  27385. vue.createElementVNode("g", _hoisted_9, [
  27386. vue.createElementVNode("g", _hoisted_10, [
  27387. vue.createElementVNode("g", _hoisted_11, [
  27388. vue.createElementVNode("path", {
  27389. id: "Oval-Copy-2",
  27390. d: "M39.5,86 C61.3152476,86 79,83.9106622 79,81.3333333 C79,78.7560045 57.3152476,78 35.5,78 C13.6847524,78 0,78.7560045 0,81.3333333 C0,83.9106622 17.6847524,86 39.5,86 Z",
  27391. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-3")})`
  27392. }, null, 8, _hoisted_12),
  27393. vue.createElementVNode("polygon", {
  27394. id: "Rectangle-Copy-14",
  27395. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-7")})`,
  27396. transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  27397. points: "13 58 53 58 42 45 2 45"
  27398. }, null, 8, _hoisted_13),
  27399. vue.createElementVNode("g", _hoisted_14, [
  27400. vue.createElementVNode("polygon", {
  27401. id: "Rectangle-Copy-10",
  27402. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-7")})`,
  27403. transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  27404. points: "2.84078316e-14 3 18 3 23 7 5 7"
  27405. }, null, 8, _hoisted_15),
  27406. vue.createElementVNode("polygon", {
  27407. id: "Rectangle-Copy-11",
  27408. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-5")})`,
  27409. points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  27410. }, null, 8, _hoisted_16),
  27411. vue.createElementVNode("rect", {
  27412. id: "Rectangle-Copy-12",
  27413. fill: `url(#linearGradient-1-${_ctx.id})`,
  27414. transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  27415. x: "38",
  27416. y: "7",
  27417. width: "17",
  27418. height: "36"
  27419. }, null, 8, _hoisted_17),
  27420. vue.createElementVNode("polygon", {
  27421. id: "Rectangle-Copy-13",
  27422. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-2")})`,
  27423. transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  27424. points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  27425. }, null, 8, _hoisted_18)
  27426. ]),
  27427. vue.createElementVNode("rect", {
  27428. id: "Rectangle-Copy-15",
  27429. fill: `url(#linearGradient-2-${_ctx.id})`,
  27430. x: "13",
  27431. y: "45",
  27432. width: "40",
  27433. height: "36"
  27434. }, null, 8, _hoisted_19),
  27435. vue.createElementVNode("g", _hoisted_20, [
  27436. vue.createElementVNode("use", {
  27437. id: "Mask",
  27438. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-8")})`,
  27439. transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  27440. "xlink:href": `#path-3-${_ctx.id}`
  27441. }, null, 8, _hoisted_21),
  27442. vue.createElementVNode("polygon", {
  27443. id: "Rectangle-Copy",
  27444. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-9")})`,
  27445. mask: `url(#mask-4-${_ctx.id})`,
  27446. transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  27447. points: "7 0 24 0 20 18 7 16.5"
  27448. }, null, 8, _hoisted_22)
  27449. ]),
  27450. vue.createElementVNode("polygon", {
  27451. id: "Rectangle-Copy-18",
  27452. fill: `var(${_ctx.ns.cssVarBlockName("fill-color-2")})`,
  27453. transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  27454. points: "62 45 79 45 70 58 53 58"
  27455. }, null, 8, _hoisted_23)
  27456. ])
  27457. ])
  27458. ])
  27459. ]);
  27460. }
  27461. var ImgEmpty = /* @__PURE__ */ _export_sfc(_sfc_main$12, [["render", _sfc_render$f], ["__file", "img-empty.vue"]]);
  27462. const emptyProps = {
  27463. image: {
  27464. type: String,
  27465. default: ""
  27466. },
  27467. imageSize: Number,
  27468. description: {
  27469. type: String,
  27470. default: ""
  27471. }
  27472. };
  27473. const _hoisted_1$w = ["src"];
  27474. const _hoisted_2$k = { key: 1 };
  27475. const __default__$M = vue.defineComponent({
  27476. name: "ElEmpty"
  27477. });
  27478. const _sfc_main$11 = /* @__PURE__ */ vue.defineComponent({
  27479. ...__default__$M,
  27480. props: emptyProps,
  27481. setup(__props) {
  27482. const props = __props;
  27483. const { t } = useLocale();
  27484. const ns = useNamespace("empty");
  27485. const emptyDescription = vue.computed(() => props.description || t("el.table.emptyText"));
  27486. const imageStyle = vue.computed(() => ({
  27487. width: props.imageSize ? `${props.imageSize}px` : ""
  27488. }));
  27489. return (_ctx, _cache) => {
  27490. return vue.openBlock(), vue.createElementBlock("div", {
  27491. class: vue.normalizeClass(vue.unref(ns).b())
  27492. }, [
  27493. vue.createElementVNode("div", {
  27494. class: vue.normalizeClass(vue.unref(ns).e("image")),
  27495. style: vue.normalizeStyle(vue.unref(imageStyle))
  27496. }, [
  27497. _ctx.image ? (vue.openBlock(), vue.createElementBlock("img", {
  27498. key: 0,
  27499. src: _ctx.image,
  27500. ondragstart: "return false"
  27501. }, null, 8, _hoisted_1$w)) : vue.renderSlot(_ctx.$slots, "image", { key: 1 }, () => [
  27502. vue.createVNode(ImgEmpty)
  27503. ])
  27504. ], 6),
  27505. vue.createElementVNode("div", {
  27506. class: vue.normalizeClass(vue.unref(ns).e("description"))
  27507. }, [
  27508. _ctx.$slots.description ? vue.renderSlot(_ctx.$slots, "description", { key: 0 }) : (vue.openBlock(), vue.createElementBlock("p", _hoisted_2$k, vue.toDisplayString(vue.unref(emptyDescription)), 1))
  27509. ], 2),
  27510. _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", {
  27511. key: 0,
  27512. class: vue.normalizeClass(vue.unref(ns).e("bottom"))
  27513. }, [
  27514. vue.renderSlot(_ctx.$slots, "default")
  27515. ], 2)) : vue.createCommentVNode("v-if", true)
  27516. ], 2);
  27517. };
  27518. }
  27519. });
  27520. var Empty = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__file", "empty.vue"]]);
  27521. const ElEmpty = withInstall(Empty);
  27522. const formProps = buildProps({
  27523. model: Object,
  27524. rules: {
  27525. type: definePropType(Object)
  27526. },
  27527. labelPosition: {
  27528. type: String,
  27529. values: ["left", "right", "top"],
  27530. default: "right"
  27531. },
  27532. requireAsteriskPosition: {
  27533. type: String,
  27534. values: ["left", "right"],
  27535. default: "left"
  27536. },
  27537. labelWidth: {
  27538. type: [String, Number],
  27539. default: ""
  27540. },
  27541. labelSuffix: {
  27542. type: String,
  27543. default: ""
  27544. },
  27545. inline: Boolean,
  27546. inlineMessage: Boolean,
  27547. statusIcon: Boolean,
  27548. showMessage: {
  27549. type: Boolean,
  27550. default: true
  27551. },
  27552. size: {
  27553. type: String,
  27554. values: componentSizes
  27555. },
  27556. disabled: Boolean,
  27557. validateOnRuleChange: {
  27558. type: Boolean,
  27559. default: true
  27560. },
  27561. hideRequiredAsterisk: {
  27562. type: Boolean,
  27563. default: false
  27564. },
  27565. scrollToError: Boolean
  27566. });
  27567. const formEmits = {
  27568. validate: (prop, isValid, message) => (isArray(prop) || isString(prop)) && isBoolean(isValid) && isString(message)
  27569. };
  27570. function useFormLabelWidth() {
  27571. const potentialLabelWidthArr = vue.ref([]);
  27572. const autoLabelWidth = vue.computed(() => {
  27573. if (!potentialLabelWidthArr.value.length)
  27574. return "0";
  27575. const max = Math.max(...potentialLabelWidthArr.value);
  27576. return max ? `${max}px` : "";
  27577. });
  27578. function getLabelWidthIndex(width) {
  27579. const index = potentialLabelWidthArr.value.indexOf(width);
  27580. if (index === -1 && autoLabelWidth.value === "0") ;
  27581. return index;
  27582. }
  27583. function registerLabelWidth(val, oldVal) {
  27584. if (val && oldVal) {
  27585. const index = getLabelWidthIndex(oldVal);
  27586. potentialLabelWidthArr.value.splice(index, 1, val);
  27587. } else if (val) {
  27588. potentialLabelWidthArr.value.push(val);
  27589. }
  27590. }
  27591. function deregisterLabelWidth(val) {
  27592. const index = getLabelWidthIndex(val);
  27593. if (index > -1) {
  27594. potentialLabelWidthArr.value.splice(index, 1);
  27595. }
  27596. }
  27597. return {
  27598. autoLabelWidth,
  27599. registerLabelWidth,
  27600. deregisterLabelWidth
  27601. };
  27602. }
  27603. const filterFields = (fields, props) => {
  27604. const normalized = castArray$1(props);
  27605. return normalized.length > 0 ? fields.filter((field) => field.prop && normalized.includes(field.prop)) : fields;
  27606. };
  27607. const COMPONENT_NAME$e = "ElForm";
  27608. const __default__$L = vue.defineComponent({
  27609. name: COMPONENT_NAME$e
  27610. });
  27611. const _sfc_main$10 = /* @__PURE__ */ vue.defineComponent({
  27612. ...__default__$L,
  27613. props: formProps,
  27614. emits: formEmits,
  27615. setup(__props, { expose, emit }) {
  27616. const props = __props;
  27617. const fields = [];
  27618. const formSize = useSize();
  27619. const ns = useNamespace("form");
  27620. const formClasses = vue.computed(() => {
  27621. const { labelPosition, inline } = props;
  27622. return [
  27623. ns.b(),
  27624. ns.m(formSize.value || "default"),
  27625. {
  27626. [ns.m(`label-${labelPosition}`)]: labelPosition,
  27627. [ns.m("inline")]: inline
  27628. }
  27629. ];
  27630. });
  27631. const addField = (field) => {
  27632. fields.push(field);
  27633. };
  27634. const removeField = (field) => {
  27635. if (field.prop) {
  27636. fields.splice(fields.indexOf(field), 1);
  27637. }
  27638. };
  27639. const resetFields = (properties = []) => {
  27640. if (!props.model) {
  27641. return;
  27642. }
  27643. filterFields(fields, properties).forEach((field) => field.resetField());
  27644. };
  27645. const clearValidate = (props2 = []) => {
  27646. filterFields(fields, props2).forEach((field) => field.clearValidate());
  27647. };
  27648. const isValidatable = vue.computed(() => {
  27649. const hasModel = !!props.model;
  27650. return hasModel;
  27651. });
  27652. const obtainValidateFields = (props2) => {
  27653. if (fields.length === 0)
  27654. return [];
  27655. const filteredFields = filterFields(fields, props2);
  27656. if (!filteredFields.length) {
  27657. return [];
  27658. }
  27659. return filteredFields;
  27660. };
  27661. const validate = async (callback) => validateField(void 0, callback);
  27662. const doValidateField = async (props2 = []) => {
  27663. if (!isValidatable.value)
  27664. return false;
  27665. const fields2 = obtainValidateFields(props2);
  27666. if (fields2.length === 0)
  27667. return true;
  27668. let validationErrors = {};
  27669. for (const field of fields2) {
  27670. try {
  27671. await field.validate("");
  27672. } catch (fields3) {
  27673. validationErrors = {
  27674. ...validationErrors,
  27675. ...fields3
  27676. };
  27677. }
  27678. }
  27679. if (Object.keys(validationErrors).length === 0)
  27680. return true;
  27681. return Promise.reject(validationErrors);
  27682. };
  27683. const validateField = async (modelProps = [], callback) => {
  27684. const shouldThrow = !isFunction(callback);
  27685. try {
  27686. const result = await doValidateField(modelProps);
  27687. if (result === true) {
  27688. callback == null ? void 0 : callback(result);
  27689. }
  27690. return result;
  27691. } catch (e) {
  27692. if (e instanceof Error)
  27693. throw e;
  27694. const invalidFields = e;
  27695. if (props.scrollToError) {
  27696. scrollToField(Object.keys(invalidFields)[0]);
  27697. }
  27698. callback == null ? void 0 : callback(false, invalidFields);
  27699. return shouldThrow && Promise.reject(invalidFields);
  27700. }
  27701. };
  27702. const scrollToField = (prop) => {
  27703. var _a;
  27704. const field = filterFields(fields, prop)[0];
  27705. if (field) {
  27706. (_a = field.$el) == null ? void 0 : _a.scrollIntoView();
  27707. }
  27708. };
  27709. vue.watch(() => props.rules, () => {
  27710. if (props.validateOnRuleChange) {
  27711. validate().catch((err) => debugWarn());
  27712. }
  27713. }, { deep: true });
  27714. vue.provide(formContextKey, vue.reactive({
  27715. ...vue.toRefs(props),
  27716. emit,
  27717. resetFields,
  27718. clearValidate,
  27719. validateField,
  27720. addField,
  27721. removeField,
  27722. ...useFormLabelWidth()
  27723. }));
  27724. expose({
  27725. validate,
  27726. validateField,
  27727. resetFields,
  27728. clearValidate,
  27729. scrollToField
  27730. });
  27731. return (_ctx, _cache) => {
  27732. return vue.openBlock(), vue.createElementBlock("form", {
  27733. class: vue.normalizeClass(vue.unref(formClasses))
  27734. }, [
  27735. vue.renderSlot(_ctx.$slots, "default")
  27736. ], 2);
  27737. };
  27738. }
  27739. });
  27740. var Form = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__file", "form.vue"]]);
  27741. function _extends() {
  27742. _extends = Object.assign ? Object.assign.bind() : function(target) {
  27743. for (var i = 1; i < arguments.length; i++) {
  27744. var source = arguments[i];
  27745. for (var key in source) {
  27746. if (Object.prototype.hasOwnProperty.call(source, key)) {
  27747. target[key] = source[key];
  27748. }
  27749. }
  27750. }
  27751. return target;
  27752. };
  27753. return _extends.apply(this, arguments);
  27754. }
  27755. function _inheritsLoose(subClass, superClass) {
  27756. subClass.prototype = Object.create(superClass.prototype);
  27757. subClass.prototype.constructor = subClass;
  27758. _setPrototypeOf(subClass, superClass);
  27759. }
  27760. function _getPrototypeOf(o) {
  27761. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
  27762. return o2.__proto__ || Object.getPrototypeOf(o2);
  27763. };
  27764. return _getPrototypeOf(o);
  27765. }
  27766. function _setPrototypeOf(o, p) {
  27767. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
  27768. o2.__proto__ = p2;
  27769. return o2;
  27770. };
  27771. return _setPrototypeOf(o, p);
  27772. }
  27773. function _isNativeReflectConstruct() {
  27774. if (typeof Reflect === "undefined" || !Reflect.construct)
  27775. return false;
  27776. if (Reflect.construct.sham)
  27777. return false;
  27778. if (typeof Proxy === "function")
  27779. return true;
  27780. try {
  27781. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
  27782. }));
  27783. return true;
  27784. } catch (e) {
  27785. return false;
  27786. }
  27787. }
  27788. function _construct(Parent, args, Class) {
  27789. if (_isNativeReflectConstruct()) {
  27790. _construct = Reflect.construct.bind();
  27791. } else {
  27792. _construct = function _construct2(Parent2, args2, Class2) {
  27793. var a = [null];
  27794. a.push.apply(a, args2);
  27795. var Constructor = Function.bind.apply(Parent2, a);
  27796. var instance = new Constructor();
  27797. if (Class2)
  27798. _setPrototypeOf(instance, Class2.prototype);
  27799. return instance;
  27800. };
  27801. }
  27802. return _construct.apply(null, arguments);
  27803. }
  27804. function _isNativeFunction(fn) {
  27805. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  27806. }
  27807. function _wrapNativeSuper(Class) {
  27808. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  27809. _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
  27810. if (Class2 === null || !_isNativeFunction(Class2))
  27811. return Class2;
  27812. if (typeof Class2 !== "function") {
  27813. throw new TypeError("Super expression must either be null or a function");
  27814. }
  27815. if (typeof _cache !== "undefined") {
  27816. if (_cache.has(Class2))
  27817. return _cache.get(Class2);
  27818. _cache.set(Class2, Wrapper);
  27819. }
  27820. function Wrapper() {
  27821. return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
  27822. }
  27823. Wrapper.prototype = Object.create(Class2.prototype, {
  27824. constructor: {
  27825. value: Wrapper,
  27826. enumerable: false,
  27827. writable: true,
  27828. configurable: true
  27829. }
  27830. });
  27831. return _setPrototypeOf(Wrapper, Class2);
  27832. };
  27833. return _wrapNativeSuper(Class);
  27834. }
  27835. var formatRegExp = /%[sdj%]/g;
  27836. var warning = function warning2() {
  27837. };
  27838. if (typeof process !== "undefined" && process.env && false) {
  27839. warning = function warning3(type4, errors) {
  27840. if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
  27841. if (errors.every(function(e) {
  27842. return typeof e === "string";
  27843. })) {
  27844. console.warn(type4, errors);
  27845. }
  27846. }
  27847. };
  27848. }
  27849. function convertFieldsError(errors) {
  27850. if (!errors || !errors.length)
  27851. return null;
  27852. var fields = {};
  27853. errors.forEach(function(error) {
  27854. var field = error.field;
  27855. fields[field] = fields[field] || [];
  27856. fields[field].push(error);
  27857. });
  27858. return fields;
  27859. }
  27860. function format(template) {
  27861. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  27862. args[_key - 1] = arguments[_key];
  27863. }
  27864. var i = 0;
  27865. var len = args.length;
  27866. if (typeof template === "function") {
  27867. return template.apply(null, args);
  27868. }
  27869. if (typeof template === "string") {
  27870. var str = template.replace(formatRegExp, function(x) {
  27871. if (x === "%%") {
  27872. return "%";
  27873. }
  27874. if (i >= len) {
  27875. return x;
  27876. }
  27877. switch (x) {
  27878. case "%s":
  27879. return String(args[i++]);
  27880. case "%d":
  27881. return Number(args[i++]);
  27882. case "%j":
  27883. try {
  27884. return JSON.stringify(args[i++]);
  27885. } catch (_) {
  27886. return "[Circular]";
  27887. }
  27888. break;
  27889. default:
  27890. return x;
  27891. }
  27892. });
  27893. return str;
  27894. }
  27895. return template;
  27896. }
  27897. function isNativeStringType(type4) {
  27898. return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
  27899. }
  27900. function isEmptyValue(value, type4) {
  27901. if (value === void 0 || value === null) {
  27902. return true;
  27903. }
  27904. if (type4 === "array" && Array.isArray(value) && !value.length) {
  27905. return true;
  27906. }
  27907. if (isNativeStringType(type4) && typeof value === "string" && !value) {
  27908. return true;
  27909. }
  27910. return false;
  27911. }
  27912. function asyncParallelArray(arr, func, callback) {
  27913. var results = [];
  27914. var total = 0;
  27915. var arrLength = arr.length;
  27916. function count(errors) {
  27917. results.push.apply(results, errors || []);
  27918. total++;
  27919. if (total === arrLength) {
  27920. callback(results);
  27921. }
  27922. }
  27923. arr.forEach(function(a) {
  27924. func(a, count);
  27925. });
  27926. }
  27927. function asyncSerialArray(arr, func, callback) {
  27928. var index = 0;
  27929. var arrLength = arr.length;
  27930. function next(errors) {
  27931. if (errors && errors.length) {
  27932. callback(errors);
  27933. return;
  27934. }
  27935. var original = index;
  27936. index = index + 1;
  27937. if (original < arrLength) {
  27938. func(arr[original], next);
  27939. } else {
  27940. callback([]);
  27941. }
  27942. }
  27943. next([]);
  27944. }
  27945. function flattenObjArr(objArr) {
  27946. var ret = [];
  27947. Object.keys(objArr).forEach(function(k) {
  27948. ret.push.apply(ret, objArr[k] || []);
  27949. });
  27950. return ret;
  27951. }
  27952. var AsyncValidationError = /* @__PURE__ */ function(_Error) {
  27953. _inheritsLoose(AsyncValidationError2, _Error);
  27954. function AsyncValidationError2(errors, fields) {
  27955. var _this;
  27956. _this = _Error.call(this, "Async Validation Error") || this;
  27957. _this.errors = errors;
  27958. _this.fields = fields;
  27959. return _this;
  27960. }
  27961. return AsyncValidationError2;
  27962. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  27963. function asyncMap(objArr, option, func, callback, source) {
  27964. if (option.first) {
  27965. var _pending = new Promise(function(resolve, reject) {
  27966. var next = function next2(errors) {
  27967. callback(errors);
  27968. return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
  27969. };
  27970. var flattenArr = flattenObjArr(objArr);
  27971. asyncSerialArray(flattenArr, func, next);
  27972. });
  27973. _pending["catch"](function(e) {
  27974. return e;
  27975. });
  27976. return _pending;
  27977. }
  27978. var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
  27979. var objArrKeys = Object.keys(objArr);
  27980. var objArrLength = objArrKeys.length;
  27981. var total = 0;
  27982. var results = [];
  27983. var pending = new Promise(function(resolve, reject) {
  27984. var next = function next2(errors) {
  27985. results.push.apply(results, errors);
  27986. total++;
  27987. if (total === objArrLength) {
  27988. callback(results);
  27989. return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
  27990. }
  27991. };
  27992. if (!objArrKeys.length) {
  27993. callback(results);
  27994. resolve(source);
  27995. }
  27996. objArrKeys.forEach(function(key) {
  27997. var arr = objArr[key];
  27998. if (firstFields.indexOf(key) !== -1) {
  27999. asyncSerialArray(arr, func, next);
  28000. } else {
  28001. asyncParallelArray(arr, func, next);
  28002. }
  28003. });
  28004. });
  28005. pending["catch"](function(e) {
  28006. return e;
  28007. });
  28008. return pending;
  28009. }
  28010. function isErrorObj(obj) {
  28011. return !!(obj && obj.message !== void 0);
  28012. }
  28013. function getValue(value, path) {
  28014. var v = value;
  28015. for (var i = 0; i < path.length; i++) {
  28016. if (v == void 0) {
  28017. return v;
  28018. }
  28019. v = v[path[i]];
  28020. }
  28021. return v;
  28022. }
  28023. function complementError(rule, source) {
  28024. return function(oe) {
  28025. var fieldValue;
  28026. if (rule.fullFields) {
  28027. fieldValue = getValue(source, rule.fullFields);
  28028. } else {
  28029. fieldValue = source[oe.field || rule.fullField];
  28030. }
  28031. if (isErrorObj(oe)) {
  28032. oe.field = oe.field || rule.fullField;
  28033. oe.fieldValue = fieldValue;
  28034. return oe;
  28035. }
  28036. return {
  28037. message: typeof oe === "function" ? oe() : oe,
  28038. fieldValue,
  28039. field: oe.field || rule.fullField
  28040. };
  28041. };
  28042. }
  28043. function deepMerge(target, source) {
  28044. if (source) {
  28045. for (var s in source) {
  28046. if (source.hasOwnProperty(s)) {
  28047. var value = source[s];
  28048. if (typeof value === "object" && typeof target[s] === "object") {
  28049. target[s] = _extends({}, target[s], value);
  28050. } else {
  28051. target[s] = value;
  28052. }
  28053. }
  28054. }
  28055. }
  28056. return target;
  28057. }
  28058. var required$1 = function required(rule, value, source, errors, options, type4) {
  28059. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
  28060. errors.push(format(options.messages.required, rule.fullField));
  28061. }
  28062. };
  28063. var whitespace = function whitespace2(rule, value, source, errors, options) {
  28064. if (/^\s+$/.test(value) || value === "") {
  28065. errors.push(format(options.messages.whitespace, rule.fullField));
  28066. }
  28067. };
  28068. var urlReg;
  28069. var getUrlRegex = function() {
  28070. if (urlReg) {
  28071. return urlReg;
  28072. }
  28073. var word = "[a-fA-F\\d:]";
  28074. var b = function b2(options) {
  28075. return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
  28076. };
  28077. var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
  28078. var v6seg = "[a-fA-F\\d]{1,4}";
  28079. var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
  28080. var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
  28081. var v4exact = new RegExp("^" + v4 + "$");
  28082. var v6exact = new RegExp("^" + v6 + "$");
  28083. var ip = function ip2(options) {
  28084. return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", "g");
  28085. };
  28086. ip.v4 = function(options) {
  28087. return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), "g");
  28088. };
  28089. ip.v6 = function(options) {
  28090. return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), "g");
  28091. };
  28092. var protocol = "(?:(?:[a-z]+:)?//)";
  28093. var auth = "(?:\\S+(?::\\S*)?@)?";
  28094. var ipv4 = ip.v4().source;
  28095. var ipv6 = ip.v6().source;
  28096. var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
  28097. var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
  28098. var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
  28099. var port = "(?::\\d{2,5})?";
  28100. var path = '(?:[/?#][^\\s"]*)?';
  28101. var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
  28102. urlReg = new RegExp("(?:^" + regex + "$)", "i");
  28103. return urlReg;
  28104. };
  28105. var pattern$2 = {
  28106. email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
  28107. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  28108. };
  28109. var types = {
  28110. integer: function integer(value) {
  28111. return types.number(value) && parseInt(value, 10) === value;
  28112. },
  28113. "float": function float(value) {
  28114. return types.number(value) && !types.integer(value);
  28115. },
  28116. array: function array(value) {
  28117. return Array.isArray(value);
  28118. },
  28119. regexp: function regexp(value) {
  28120. if (value instanceof RegExp) {
  28121. return true;
  28122. }
  28123. try {
  28124. return !!new RegExp(value);
  28125. } catch (e) {
  28126. return false;
  28127. }
  28128. },
  28129. date: function date(value) {
  28130. return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
  28131. },
  28132. number: function number(value) {
  28133. if (isNaN(value)) {
  28134. return false;
  28135. }
  28136. return typeof value === "number";
  28137. },
  28138. object: function object(value) {
  28139. return typeof value === "object" && !types.array(value);
  28140. },
  28141. method: function method(value) {
  28142. return typeof value === "function";
  28143. },
  28144. email: function email(value) {
  28145. return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
  28146. },
  28147. url: function url(value) {
  28148. return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
  28149. },
  28150. hex: function hex(value) {
  28151. return typeof value === "string" && !!value.match(pattern$2.hex);
  28152. }
  28153. };
  28154. var type$1 = function type(rule, value, source, errors, options) {
  28155. if (rule.required && value === void 0) {
  28156. required$1(rule, value, source, errors, options);
  28157. return;
  28158. }
  28159. var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
  28160. var ruleType = rule.type;
  28161. if (custom.indexOf(ruleType) > -1) {
  28162. if (!types[ruleType](value)) {
  28163. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  28164. }
  28165. } else if (ruleType && typeof value !== rule.type) {
  28166. errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  28167. }
  28168. };
  28169. var range = function range2(rule, value, source, errors, options) {
  28170. var len = typeof rule.len === "number";
  28171. var min = typeof rule.min === "number";
  28172. var max = typeof rule.max === "number";
  28173. var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
  28174. var val = value;
  28175. var key = null;
  28176. var num = typeof value === "number";
  28177. var str = typeof value === "string";
  28178. var arr = Array.isArray(value);
  28179. if (num) {
  28180. key = "number";
  28181. } else if (str) {
  28182. key = "string";
  28183. } else if (arr) {
  28184. key = "array";
  28185. }
  28186. if (!key) {
  28187. return false;
  28188. }
  28189. if (arr) {
  28190. val = value.length;
  28191. }
  28192. if (str) {
  28193. val = value.replace(spRegexp, "_").length;
  28194. }
  28195. if (len) {
  28196. if (val !== rule.len) {
  28197. errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  28198. }
  28199. } else if (min && !max && val < rule.min) {
  28200. errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  28201. } else if (max && !min && val > rule.max) {
  28202. errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  28203. } else if (min && max && (val < rule.min || val > rule.max)) {
  28204. errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  28205. }
  28206. };
  28207. var ENUM$1 = "enum";
  28208. var enumerable$1 = function enumerable(rule, value, source, errors, options) {
  28209. rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
  28210. if (rule[ENUM$1].indexOf(value) === -1) {
  28211. errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
  28212. }
  28213. };
  28214. var pattern$1 = function pattern(rule, value, source, errors, options) {
  28215. if (rule.pattern) {
  28216. if (rule.pattern instanceof RegExp) {
  28217. rule.pattern.lastIndex = 0;
  28218. if (!rule.pattern.test(value)) {
  28219. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  28220. }
  28221. } else if (typeof rule.pattern === "string") {
  28222. var _pattern = new RegExp(rule.pattern);
  28223. if (!_pattern.test(value)) {
  28224. errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  28225. }
  28226. }
  28227. }
  28228. };
  28229. var rules = {
  28230. required: required$1,
  28231. whitespace,
  28232. type: type$1,
  28233. range,
  28234. "enum": enumerable$1,
  28235. pattern: pattern$1
  28236. };
  28237. var string = function string2(rule, value, callback, source, options) {
  28238. var errors = [];
  28239. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28240. if (validate) {
  28241. if (isEmptyValue(value, "string") && !rule.required) {
  28242. return callback();
  28243. }
  28244. rules.required(rule, value, source, errors, options, "string");
  28245. if (!isEmptyValue(value, "string")) {
  28246. rules.type(rule, value, source, errors, options);
  28247. rules.range(rule, value, source, errors, options);
  28248. rules.pattern(rule, value, source, errors, options);
  28249. if (rule.whitespace === true) {
  28250. rules.whitespace(rule, value, source, errors, options);
  28251. }
  28252. }
  28253. }
  28254. callback(errors);
  28255. };
  28256. var method2 = function method3(rule, value, callback, source, options) {
  28257. var errors = [];
  28258. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28259. if (validate) {
  28260. if (isEmptyValue(value) && !rule.required) {
  28261. return callback();
  28262. }
  28263. rules.required(rule, value, source, errors, options);
  28264. if (value !== void 0) {
  28265. rules.type(rule, value, source, errors, options);
  28266. }
  28267. }
  28268. callback(errors);
  28269. };
  28270. var number2 = function number3(rule, value, callback, source, options) {
  28271. var errors = [];
  28272. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28273. if (validate) {
  28274. if (value === "") {
  28275. value = void 0;
  28276. }
  28277. if (isEmptyValue(value) && !rule.required) {
  28278. return callback();
  28279. }
  28280. rules.required(rule, value, source, errors, options);
  28281. if (value !== void 0) {
  28282. rules.type(rule, value, source, errors, options);
  28283. rules.range(rule, value, source, errors, options);
  28284. }
  28285. }
  28286. callback(errors);
  28287. };
  28288. var _boolean = function _boolean2(rule, value, callback, source, options) {
  28289. var errors = [];
  28290. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28291. if (validate) {
  28292. if (isEmptyValue(value) && !rule.required) {
  28293. return callback();
  28294. }
  28295. rules.required(rule, value, source, errors, options);
  28296. if (value !== void 0) {
  28297. rules.type(rule, value, source, errors, options);
  28298. }
  28299. }
  28300. callback(errors);
  28301. };
  28302. var regexp2 = function regexp3(rule, value, callback, source, options) {
  28303. var errors = [];
  28304. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28305. if (validate) {
  28306. if (isEmptyValue(value) && !rule.required) {
  28307. return callback();
  28308. }
  28309. rules.required(rule, value, source, errors, options);
  28310. if (!isEmptyValue(value)) {
  28311. rules.type(rule, value, source, errors, options);
  28312. }
  28313. }
  28314. callback(errors);
  28315. };
  28316. var integer2 = function integer3(rule, value, callback, source, options) {
  28317. var errors = [];
  28318. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28319. if (validate) {
  28320. if (isEmptyValue(value) && !rule.required) {
  28321. return callback();
  28322. }
  28323. rules.required(rule, value, source, errors, options);
  28324. if (value !== void 0) {
  28325. rules.type(rule, value, source, errors, options);
  28326. rules.range(rule, value, source, errors, options);
  28327. }
  28328. }
  28329. callback(errors);
  28330. };
  28331. var floatFn = function floatFn2(rule, value, callback, source, options) {
  28332. var errors = [];
  28333. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28334. if (validate) {
  28335. if (isEmptyValue(value) && !rule.required) {
  28336. return callback();
  28337. }
  28338. rules.required(rule, value, source, errors, options);
  28339. if (value !== void 0) {
  28340. rules.type(rule, value, source, errors, options);
  28341. rules.range(rule, value, source, errors, options);
  28342. }
  28343. }
  28344. callback(errors);
  28345. };
  28346. var array2 = function array3(rule, value, callback, source, options) {
  28347. var errors = [];
  28348. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28349. if (validate) {
  28350. if ((value === void 0 || value === null) && !rule.required) {
  28351. return callback();
  28352. }
  28353. rules.required(rule, value, source, errors, options, "array");
  28354. if (value !== void 0 && value !== null) {
  28355. rules.type(rule, value, source, errors, options);
  28356. rules.range(rule, value, source, errors, options);
  28357. }
  28358. }
  28359. callback(errors);
  28360. };
  28361. var object2 = function object3(rule, value, callback, source, options) {
  28362. var errors = [];
  28363. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28364. if (validate) {
  28365. if (isEmptyValue(value) && !rule.required) {
  28366. return callback();
  28367. }
  28368. rules.required(rule, value, source, errors, options);
  28369. if (value !== void 0) {
  28370. rules.type(rule, value, source, errors, options);
  28371. }
  28372. }
  28373. callback(errors);
  28374. };
  28375. var ENUM = "enum";
  28376. var enumerable2 = function enumerable3(rule, value, callback, source, options) {
  28377. var errors = [];
  28378. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28379. if (validate) {
  28380. if (isEmptyValue(value) && !rule.required) {
  28381. return callback();
  28382. }
  28383. rules.required(rule, value, source, errors, options);
  28384. if (value !== void 0) {
  28385. rules[ENUM](rule, value, source, errors, options);
  28386. }
  28387. }
  28388. callback(errors);
  28389. };
  28390. var pattern2 = function pattern3(rule, value, callback, source, options) {
  28391. var errors = [];
  28392. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28393. if (validate) {
  28394. if (isEmptyValue(value, "string") && !rule.required) {
  28395. return callback();
  28396. }
  28397. rules.required(rule, value, source, errors, options);
  28398. if (!isEmptyValue(value, "string")) {
  28399. rules.pattern(rule, value, source, errors, options);
  28400. }
  28401. }
  28402. callback(errors);
  28403. };
  28404. var date2 = function date3(rule, value, callback, source, options) {
  28405. var errors = [];
  28406. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28407. if (validate) {
  28408. if (isEmptyValue(value, "date") && !rule.required) {
  28409. return callback();
  28410. }
  28411. rules.required(rule, value, source, errors, options);
  28412. if (!isEmptyValue(value, "date")) {
  28413. var dateObject;
  28414. if (value instanceof Date) {
  28415. dateObject = value;
  28416. } else {
  28417. dateObject = new Date(value);
  28418. }
  28419. rules.type(rule, dateObject, source, errors, options);
  28420. if (dateObject) {
  28421. rules.range(rule, dateObject.getTime(), source, errors, options);
  28422. }
  28423. }
  28424. }
  28425. callback(errors);
  28426. };
  28427. var required2 = function required3(rule, value, callback, source, options) {
  28428. var errors = [];
  28429. var type4 = Array.isArray(value) ? "array" : typeof value;
  28430. rules.required(rule, value, source, errors, options, type4);
  28431. callback(errors);
  28432. };
  28433. var type2 = function type3(rule, value, callback, source, options) {
  28434. var ruleType = rule.type;
  28435. var errors = [];
  28436. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28437. if (validate) {
  28438. if (isEmptyValue(value, ruleType) && !rule.required) {
  28439. return callback();
  28440. }
  28441. rules.required(rule, value, source, errors, options, ruleType);
  28442. if (!isEmptyValue(value, ruleType)) {
  28443. rules.type(rule, value, source, errors, options);
  28444. }
  28445. }
  28446. callback(errors);
  28447. };
  28448. var any = function any2(rule, value, callback, source, options) {
  28449. var errors = [];
  28450. var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
  28451. if (validate) {
  28452. if (isEmptyValue(value) && !rule.required) {
  28453. return callback();
  28454. }
  28455. rules.required(rule, value, source, errors, options);
  28456. }
  28457. callback(errors);
  28458. };
  28459. var validators = {
  28460. string,
  28461. method: method2,
  28462. number: number2,
  28463. "boolean": _boolean,
  28464. regexp: regexp2,
  28465. integer: integer2,
  28466. "float": floatFn,
  28467. array: array2,
  28468. object: object2,
  28469. "enum": enumerable2,
  28470. pattern: pattern2,
  28471. date: date2,
  28472. url: type2,
  28473. hex: type2,
  28474. email: type2,
  28475. required: required2,
  28476. any
  28477. };
  28478. function newMessages() {
  28479. return {
  28480. "default": "Validation error on field %s",
  28481. required: "%s is required",
  28482. "enum": "%s must be one of %s",
  28483. whitespace: "%s cannot be empty",
  28484. date: {
  28485. format: "%s date %s is invalid for format %s",
  28486. parse: "%s date could not be parsed, %s is invalid ",
  28487. invalid: "%s date %s is invalid"
  28488. },
  28489. types: {
  28490. string: "%s is not a %s",
  28491. method: "%s is not a %s (function)",
  28492. array: "%s is not an %s",
  28493. object: "%s is not an %s",
  28494. number: "%s is not a %s",
  28495. date: "%s is not a %s",
  28496. "boolean": "%s is not a %s",
  28497. integer: "%s is not an %s",
  28498. "float": "%s is not a %s",
  28499. regexp: "%s is not a valid %s",
  28500. email: "%s is not a valid %s",
  28501. url: "%s is not a valid %s",
  28502. hex: "%s is not a valid %s"
  28503. },
  28504. string: {
  28505. len: "%s must be exactly %s characters",
  28506. min: "%s must be at least %s characters",
  28507. max: "%s cannot be longer than %s characters",
  28508. range: "%s must be between %s and %s characters"
  28509. },
  28510. number: {
  28511. len: "%s must equal %s",
  28512. min: "%s cannot be less than %s",
  28513. max: "%s cannot be greater than %s",
  28514. range: "%s must be between %s and %s"
  28515. },
  28516. array: {
  28517. len: "%s must be exactly %s in length",
  28518. min: "%s cannot be less than %s in length",
  28519. max: "%s cannot be greater than %s in length",
  28520. range: "%s must be between %s and %s in length"
  28521. },
  28522. pattern: {
  28523. mismatch: "%s value %s does not match pattern %s"
  28524. },
  28525. clone: function clone() {
  28526. var cloned = JSON.parse(JSON.stringify(this));
  28527. cloned.clone = this.clone;
  28528. return cloned;
  28529. }
  28530. };
  28531. }
  28532. var messages = newMessages();
  28533. var Schema = /* @__PURE__ */ function() {
  28534. function Schema2(descriptor) {
  28535. this.rules = null;
  28536. this._messages = messages;
  28537. this.define(descriptor);
  28538. }
  28539. var _proto = Schema2.prototype;
  28540. _proto.define = function define(rules2) {
  28541. var _this = this;
  28542. if (!rules2) {
  28543. throw new Error("Cannot configure a schema with no rules");
  28544. }
  28545. if (typeof rules2 !== "object" || Array.isArray(rules2)) {
  28546. throw new Error("Rules must be an object");
  28547. }
  28548. this.rules = {};
  28549. Object.keys(rules2).forEach(function(name) {
  28550. var item = rules2[name];
  28551. _this.rules[name] = Array.isArray(item) ? item : [item];
  28552. });
  28553. };
  28554. _proto.messages = function messages2(_messages) {
  28555. if (_messages) {
  28556. this._messages = deepMerge(newMessages(), _messages);
  28557. }
  28558. return this._messages;
  28559. };
  28560. _proto.validate = function validate(source_, o, oc) {
  28561. var _this2 = this;
  28562. if (o === void 0) {
  28563. o = {};
  28564. }
  28565. if (oc === void 0) {
  28566. oc = function oc2() {
  28567. };
  28568. }
  28569. var source = source_;
  28570. var options = o;
  28571. var callback = oc;
  28572. if (typeof options === "function") {
  28573. callback = options;
  28574. options = {};
  28575. }
  28576. if (!this.rules || Object.keys(this.rules).length === 0) {
  28577. if (callback) {
  28578. callback(null, source);
  28579. }
  28580. return Promise.resolve(source);
  28581. }
  28582. function complete(results) {
  28583. var errors = [];
  28584. var fields = {};
  28585. function add(e) {
  28586. if (Array.isArray(e)) {
  28587. var _errors;
  28588. errors = (_errors = errors).concat.apply(_errors, e);
  28589. } else {
  28590. errors.push(e);
  28591. }
  28592. }
  28593. for (var i = 0; i < results.length; i++) {
  28594. add(results[i]);
  28595. }
  28596. if (!errors.length) {
  28597. callback(null, source);
  28598. } else {
  28599. fields = convertFieldsError(errors);
  28600. callback(errors, fields);
  28601. }
  28602. }
  28603. if (options.messages) {
  28604. var messages$1 = this.messages();
  28605. if (messages$1 === messages) {
  28606. messages$1 = newMessages();
  28607. }
  28608. deepMerge(messages$1, options.messages);
  28609. options.messages = messages$1;
  28610. } else {
  28611. options.messages = this.messages();
  28612. }
  28613. var series = {};
  28614. var keys = options.keys || Object.keys(this.rules);
  28615. keys.forEach(function(z) {
  28616. var arr = _this2.rules[z];
  28617. var value = source[z];
  28618. arr.forEach(function(r) {
  28619. var rule = r;
  28620. if (typeof rule.transform === "function") {
  28621. if (source === source_) {
  28622. source = _extends({}, source);
  28623. }
  28624. value = source[z] = rule.transform(value);
  28625. }
  28626. if (typeof rule === "function") {
  28627. rule = {
  28628. validator: rule
  28629. };
  28630. } else {
  28631. rule = _extends({}, rule);
  28632. }
  28633. rule.validator = _this2.getValidationMethod(rule);
  28634. if (!rule.validator) {
  28635. return;
  28636. }
  28637. rule.field = z;
  28638. rule.fullField = rule.fullField || z;
  28639. rule.type = _this2.getType(rule);
  28640. series[z] = series[z] || [];
  28641. series[z].push({
  28642. rule,
  28643. value,
  28644. source,
  28645. field: z
  28646. });
  28647. });
  28648. });
  28649. var errorFields = {};
  28650. return asyncMap(series, options, function(data, doIt) {
  28651. var rule = data.rule;
  28652. var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
  28653. deep = deep && (rule.required || !rule.required && data.value);
  28654. rule.field = data.field;
  28655. function addFullField(key, schema) {
  28656. return _extends({}, schema, {
  28657. fullField: rule.fullField + "." + key,
  28658. fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
  28659. });
  28660. }
  28661. function cb(e) {
  28662. if (e === void 0) {
  28663. e = [];
  28664. }
  28665. var errorList = Array.isArray(e) ? e : [e];
  28666. if (!options.suppressWarning && errorList.length) {
  28667. Schema2.warning("async-validator:", errorList);
  28668. }
  28669. if (errorList.length && rule.message !== void 0) {
  28670. errorList = [].concat(rule.message);
  28671. }
  28672. var filledErrors = errorList.map(complementError(rule, source));
  28673. if (options.first && filledErrors.length) {
  28674. errorFields[rule.field] = 1;
  28675. return doIt(filledErrors);
  28676. }
  28677. if (!deep) {
  28678. doIt(filledErrors);
  28679. } else {
  28680. if (rule.required && !data.value) {
  28681. if (rule.message !== void 0) {
  28682. filledErrors = [].concat(rule.message).map(complementError(rule, source));
  28683. } else if (options.error) {
  28684. filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
  28685. }
  28686. return doIt(filledErrors);
  28687. }
  28688. var fieldsSchema = {};
  28689. if (rule.defaultField) {
  28690. Object.keys(data.value).map(function(key) {
  28691. fieldsSchema[key] = rule.defaultField;
  28692. });
  28693. }
  28694. fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
  28695. var paredFieldsSchema = {};
  28696. Object.keys(fieldsSchema).forEach(function(field) {
  28697. var fieldSchema = fieldsSchema[field];
  28698. var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
  28699. paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
  28700. });
  28701. var schema = new Schema2(paredFieldsSchema);
  28702. schema.messages(options.messages);
  28703. if (data.rule.options) {
  28704. data.rule.options.messages = options.messages;
  28705. data.rule.options.error = options.error;
  28706. }
  28707. schema.validate(data.value, data.rule.options || options, function(errs) {
  28708. var finalErrors = [];
  28709. if (filledErrors && filledErrors.length) {
  28710. finalErrors.push.apply(finalErrors, filledErrors);
  28711. }
  28712. if (errs && errs.length) {
  28713. finalErrors.push.apply(finalErrors, errs);
  28714. }
  28715. doIt(finalErrors.length ? finalErrors : null);
  28716. });
  28717. }
  28718. }
  28719. var res;
  28720. if (rule.asyncValidator) {
  28721. res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  28722. } else if (rule.validator) {
  28723. try {
  28724. res = rule.validator(rule, data.value, cb, data.source, options);
  28725. } catch (error) {
  28726. console.error == null ? void 0 : console.error(error);
  28727. if (!options.suppressValidatorError) {
  28728. setTimeout(function() {
  28729. throw error;
  28730. }, 0);
  28731. }
  28732. cb(error.message);
  28733. }
  28734. if (res === true) {
  28735. cb();
  28736. } else if (res === false) {
  28737. cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
  28738. } else if (res instanceof Array) {
  28739. cb(res);
  28740. } else if (res instanceof Error) {
  28741. cb(res.message);
  28742. }
  28743. }
  28744. if (res && res.then) {
  28745. res.then(function() {
  28746. return cb();
  28747. }, function(e) {
  28748. return cb(e);
  28749. });
  28750. }
  28751. }, function(results) {
  28752. complete(results);
  28753. }, source);
  28754. };
  28755. _proto.getType = function getType(rule) {
  28756. if (rule.type === void 0 && rule.pattern instanceof RegExp) {
  28757. rule.type = "pattern";
  28758. }
  28759. if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
  28760. throw new Error(format("Unknown rule type %s", rule.type));
  28761. }
  28762. return rule.type || "string";
  28763. };
  28764. _proto.getValidationMethod = function getValidationMethod(rule) {
  28765. if (typeof rule.validator === "function") {
  28766. return rule.validator;
  28767. }
  28768. var keys = Object.keys(rule);
  28769. var messageIndex = keys.indexOf("message");
  28770. if (messageIndex !== -1) {
  28771. keys.splice(messageIndex, 1);
  28772. }
  28773. if (keys.length === 1 && keys[0] === "required") {
  28774. return validators.required;
  28775. }
  28776. return validators[this.getType(rule)] || void 0;
  28777. };
  28778. return Schema2;
  28779. }();
  28780. Schema.register = function register(type4, validator) {
  28781. if (typeof validator !== "function") {
  28782. throw new Error("Cannot register a validator by type, validator is not a function");
  28783. }
  28784. validators[type4] = validator;
  28785. };
  28786. Schema.warning = warning;
  28787. Schema.messages = messages;
  28788. Schema.validators = validators;
  28789. const formItemValidateStates = [
  28790. "",
  28791. "error",
  28792. "validating",
  28793. "success"
  28794. ];
  28795. const formItemProps = buildProps({
  28796. label: String,
  28797. labelWidth: {
  28798. type: [String, Number],
  28799. default: ""
  28800. },
  28801. prop: {
  28802. type: definePropType([String, Array])
  28803. },
  28804. required: {
  28805. type: Boolean,
  28806. default: void 0
  28807. },
  28808. rules: {
  28809. type: definePropType([Object, Array])
  28810. },
  28811. error: String,
  28812. validateStatus: {
  28813. type: String,
  28814. values: formItemValidateStates
  28815. },
  28816. for: String,
  28817. inlineMessage: {
  28818. type: [String, Boolean],
  28819. default: ""
  28820. },
  28821. showMessage: {
  28822. type: Boolean,
  28823. default: true
  28824. },
  28825. size: {
  28826. type: String,
  28827. values: componentSizes
  28828. }
  28829. });
  28830. const COMPONENT_NAME$d = "ElLabelWrap";
  28831. var FormLabelWrap = vue.defineComponent({
  28832. name: COMPONENT_NAME$d,
  28833. props: {
  28834. isAutoWidth: Boolean,
  28835. updateAll: Boolean
  28836. },
  28837. setup(props, {
  28838. slots
  28839. }) {
  28840. const formContext = vue.inject(formContextKey, void 0);
  28841. const formItemContext = vue.inject(formItemContextKey);
  28842. if (!formItemContext)
  28843. throwError(COMPONENT_NAME$d, "usage: <el-form-item><label-wrap /></el-form-item>");
  28844. const ns = useNamespace("form");
  28845. const el = vue.ref();
  28846. const computedWidth = vue.ref(0);
  28847. const getLabelWidth = () => {
  28848. var _a;
  28849. if ((_a = el.value) == null ? void 0 : _a.firstElementChild) {
  28850. const width = window.getComputedStyle(el.value.firstElementChild).width;
  28851. return Math.ceil(Number.parseFloat(width));
  28852. } else {
  28853. return 0;
  28854. }
  28855. };
  28856. const updateLabelWidth = (action = "update") => {
  28857. vue.nextTick(() => {
  28858. if (slots.default && props.isAutoWidth) {
  28859. if (action === "update") {
  28860. computedWidth.value = getLabelWidth();
  28861. } else if (action === "remove") {
  28862. formContext == null ? void 0 : formContext.deregisterLabelWidth(computedWidth.value);
  28863. }
  28864. }
  28865. });
  28866. };
  28867. const updateLabelWidthFn = () => updateLabelWidth("update");
  28868. vue.onMounted(() => {
  28869. updateLabelWidthFn();
  28870. });
  28871. vue.onBeforeUnmount(() => {
  28872. updateLabelWidth("remove");
  28873. });
  28874. vue.onUpdated(() => updateLabelWidthFn());
  28875. vue.watch(computedWidth, (val, oldVal) => {
  28876. if (props.updateAll) {
  28877. formContext == null ? void 0 : formContext.registerLabelWidth(val, oldVal);
  28878. }
  28879. });
  28880. useResizeObserver(vue.computed(() => {
  28881. var _a, _b;
  28882. return (_b = (_a = el.value) == null ? void 0 : _a.firstElementChild) != null ? _b : null;
  28883. }), updateLabelWidthFn);
  28884. return () => {
  28885. var _a, _b;
  28886. if (!slots)
  28887. return null;
  28888. const {
  28889. isAutoWidth
  28890. } = props;
  28891. if (isAutoWidth) {
  28892. const autoLabelWidth = formContext == null ? void 0 : formContext.autoLabelWidth;
  28893. const hasLabel = formItemContext == null ? void 0 : formItemContext.hasLabel;
  28894. const style = {};
  28895. if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") {
  28896. const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value);
  28897. const marginPosition = formContext.labelPosition === "left" ? "marginRight" : "marginLeft";
  28898. if (marginWidth) {
  28899. style[marginPosition] = `${marginWidth}px`;
  28900. }
  28901. }
  28902. return vue.createVNode("div", {
  28903. "ref": el,
  28904. "class": [ns.be("item", "label-wrap")],
  28905. "style": style
  28906. }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
  28907. } else {
  28908. return vue.createVNode(vue.Fragment, {
  28909. "ref": el
  28910. }, [(_b = slots.default) == null ? void 0 : _b.call(slots)]);
  28911. }
  28912. };
  28913. }
  28914. });
  28915. const _hoisted_1$v = ["role", "aria-labelledby"];
  28916. const __default__$K = vue.defineComponent({
  28917. name: "ElFormItem"
  28918. });
  28919. const _sfc_main$$ = /* @__PURE__ */ vue.defineComponent({
  28920. ...__default__$K,
  28921. props: formItemProps,
  28922. setup(__props, { expose }) {
  28923. const props = __props;
  28924. const slots = vue.useSlots();
  28925. const formContext = vue.inject(formContextKey, void 0);
  28926. const parentFormItemContext = vue.inject(formItemContextKey, void 0);
  28927. const _size = useSize(void 0, { formItem: false });
  28928. const ns = useNamespace("form-item");
  28929. const labelId = useId().value;
  28930. const inputIds = vue.ref([]);
  28931. const validateState = vue.ref("");
  28932. const validateStateDebounced = refDebounced(validateState, 100);
  28933. const validateMessage = vue.ref("");
  28934. const formItemRef = vue.ref();
  28935. let initialValue = void 0;
  28936. let isResettingField = false;
  28937. const labelStyle = vue.computed(() => {
  28938. if ((formContext == null ? void 0 : formContext.labelPosition) === "top") {
  28939. return {};
  28940. }
  28941. const labelWidth = addUnit(props.labelWidth || (formContext == null ? void 0 : formContext.labelWidth) || "");
  28942. if (labelWidth)
  28943. return { width: labelWidth };
  28944. return {};
  28945. });
  28946. const contentStyle = vue.computed(() => {
  28947. if ((formContext == null ? void 0 : formContext.labelPosition) === "top" || (formContext == null ? void 0 : formContext.inline)) {
  28948. return {};
  28949. }
  28950. if (!props.label && !props.labelWidth && isNested) {
  28951. return {};
  28952. }
  28953. const labelWidth = addUnit(props.labelWidth || (formContext == null ? void 0 : formContext.labelWidth) || "");
  28954. if (!props.label && !slots.label) {
  28955. return { marginLeft: labelWidth };
  28956. }
  28957. return {};
  28958. });
  28959. const formItemClasses = vue.computed(() => [
  28960. ns.b(),
  28961. ns.m(_size.value),
  28962. ns.is("error", validateState.value === "error"),
  28963. ns.is("validating", validateState.value === "validating"),
  28964. ns.is("success", validateState.value === "success"),
  28965. ns.is("required", isRequired.value || props.required),
  28966. ns.is("no-asterisk", formContext == null ? void 0 : formContext.hideRequiredAsterisk),
  28967. (formContext == null ? void 0 : formContext.requireAsteriskPosition) === "right" ? "asterisk-right" : "asterisk-left",
  28968. { [ns.m("feedback")]: formContext == null ? void 0 : formContext.statusIcon }
  28969. ]);
  28970. const _inlineMessage = vue.computed(() => isBoolean(props.inlineMessage) ? props.inlineMessage : (formContext == null ? void 0 : formContext.inlineMessage) || false);
  28971. const validateClasses = vue.computed(() => [
  28972. ns.e("error"),
  28973. { [ns.em("error", "inline")]: _inlineMessage.value }
  28974. ]);
  28975. const propString = vue.computed(() => {
  28976. if (!props.prop)
  28977. return "";
  28978. return isString(props.prop) ? props.prop : props.prop.join(".");
  28979. });
  28980. const hasLabel = vue.computed(() => {
  28981. return !!(props.label || slots.label);
  28982. });
  28983. const labelFor = vue.computed(() => {
  28984. return props.for || inputIds.value.length === 1 ? inputIds.value[0] : void 0;
  28985. });
  28986. const isGroup = vue.computed(() => {
  28987. return !labelFor.value && hasLabel.value;
  28988. });
  28989. const isNested = !!parentFormItemContext;
  28990. const fieldValue = vue.computed(() => {
  28991. const model = formContext == null ? void 0 : formContext.model;
  28992. if (!model || !props.prop) {
  28993. return;
  28994. }
  28995. return getProp(model, props.prop).value;
  28996. });
  28997. const normalizedRules = vue.computed(() => {
  28998. const { required } = props;
  28999. const rules = [];
  29000. if (props.rules) {
  29001. rules.push(...castArray$1(props.rules));
  29002. }
  29003. const formRules = formContext == null ? void 0 : formContext.rules;
  29004. if (formRules && props.prop) {
  29005. const _rules = getProp(formRules, props.prop).value;
  29006. if (_rules) {
  29007. rules.push(...castArray$1(_rules));
  29008. }
  29009. }
  29010. if (required !== void 0) {
  29011. const requiredRules = rules.map((rule, i) => [rule, i]).filter(([rule]) => Object.keys(rule).includes("required"));
  29012. if (requiredRules.length > 0) {
  29013. for (const [rule, i] of requiredRules) {
  29014. if (rule.required === required)
  29015. continue;
  29016. rules[i] = { ...rule, required };
  29017. }
  29018. } else {
  29019. rules.push({ required });
  29020. }
  29021. }
  29022. return rules;
  29023. });
  29024. const validateEnabled = vue.computed(() => normalizedRules.value.length > 0);
  29025. const getFilteredRule = (trigger) => {
  29026. const rules = normalizedRules.value;
  29027. return rules.filter((rule) => {
  29028. if (!rule.trigger || !trigger)
  29029. return true;
  29030. if (Array.isArray(rule.trigger)) {
  29031. return rule.trigger.includes(trigger);
  29032. } else {
  29033. return rule.trigger === trigger;
  29034. }
  29035. }).map(({ trigger: trigger2, ...rule }) => rule);
  29036. };
  29037. const isRequired = vue.computed(() => normalizedRules.value.some((rule) => rule.required));
  29038. const shouldShowError = vue.computed(() => {
  29039. var _a;
  29040. return validateStateDebounced.value === "error" && props.showMessage && ((_a = formContext == null ? void 0 : formContext.showMessage) != null ? _a : true);
  29041. });
  29042. const currentLabel = vue.computed(() => `${props.label || ""}${(formContext == null ? void 0 : formContext.labelSuffix) || ""}`);
  29043. const setValidationState = (state) => {
  29044. validateState.value = state;
  29045. };
  29046. const onValidationFailed = (error) => {
  29047. var _a, _b;
  29048. const { errors, fields } = error;
  29049. if (!errors || !fields) {
  29050. console.error(error);
  29051. }
  29052. setValidationState("error");
  29053. validateMessage.value = errors ? (_b = (_a = errors == null ? void 0 : errors[0]) == null ? void 0 : _a.message) != null ? _b : `${props.prop} is required` : "";
  29054. formContext == null ? void 0 : formContext.emit("validate", props.prop, false, validateMessage.value);
  29055. };
  29056. const onValidationSucceeded = () => {
  29057. setValidationState("success");
  29058. formContext == null ? void 0 : formContext.emit("validate", props.prop, true, "");
  29059. };
  29060. const doValidate = async (rules) => {
  29061. const modelName = propString.value;
  29062. const validator = new Schema({
  29063. [modelName]: rules
  29064. });
  29065. return validator.validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => {
  29066. onValidationSucceeded();
  29067. return true;
  29068. }).catch((err) => {
  29069. onValidationFailed(err);
  29070. return Promise.reject(err);
  29071. });
  29072. };
  29073. const validate = async (trigger, callback) => {
  29074. if (isResettingField || !props.prop) {
  29075. return false;
  29076. }
  29077. const hasCallback = isFunction(callback);
  29078. if (!validateEnabled.value) {
  29079. callback == null ? void 0 : callback(false);
  29080. return false;
  29081. }
  29082. const rules = getFilteredRule(trigger);
  29083. if (rules.length === 0) {
  29084. callback == null ? void 0 : callback(true);
  29085. return true;
  29086. }
  29087. setValidationState("validating");
  29088. return doValidate(rules).then(() => {
  29089. callback == null ? void 0 : callback(true);
  29090. return true;
  29091. }).catch((err) => {
  29092. const { fields } = err;
  29093. callback == null ? void 0 : callback(false, fields);
  29094. return hasCallback ? false : Promise.reject(fields);
  29095. });
  29096. };
  29097. const clearValidate = () => {
  29098. setValidationState("");
  29099. validateMessage.value = "";
  29100. isResettingField = false;
  29101. };
  29102. const resetField = async () => {
  29103. const model = formContext == null ? void 0 : formContext.model;
  29104. if (!model || !props.prop)
  29105. return;
  29106. const computedValue = getProp(model, props.prop);
  29107. isResettingField = true;
  29108. computedValue.value = clone(initialValue);
  29109. await vue.nextTick();
  29110. clearValidate();
  29111. isResettingField = false;
  29112. };
  29113. const addInputId = (id) => {
  29114. if (!inputIds.value.includes(id)) {
  29115. inputIds.value.push(id);
  29116. }
  29117. };
  29118. const removeInputId = (id) => {
  29119. inputIds.value = inputIds.value.filter((listId) => listId !== id);
  29120. };
  29121. vue.watch(() => props.error, (val) => {
  29122. validateMessage.value = val || "";
  29123. setValidationState(val ? "error" : "");
  29124. }, { immediate: true });
  29125. vue.watch(() => props.validateStatus, (val) => setValidationState(val || ""));
  29126. const context = vue.reactive({
  29127. ...vue.toRefs(props),
  29128. $el: formItemRef,
  29129. size: _size,
  29130. validateState,
  29131. labelId,
  29132. inputIds,
  29133. isGroup,
  29134. hasLabel,
  29135. addInputId,
  29136. removeInputId,
  29137. resetField,
  29138. clearValidate,
  29139. validate
  29140. });
  29141. vue.provide(formItemContextKey, context);
  29142. vue.onMounted(() => {
  29143. if (props.prop) {
  29144. formContext == null ? void 0 : formContext.addField(context);
  29145. initialValue = clone(fieldValue.value);
  29146. }
  29147. });
  29148. vue.onBeforeUnmount(() => {
  29149. formContext == null ? void 0 : formContext.removeField(context);
  29150. });
  29151. expose({
  29152. size: _size,
  29153. validateMessage,
  29154. validateState,
  29155. validate,
  29156. clearValidate,
  29157. resetField
  29158. });
  29159. return (_ctx, _cache) => {
  29160. var _a;
  29161. return vue.openBlock(), vue.createElementBlock("div", {
  29162. ref_key: "formItemRef",
  29163. ref: formItemRef,
  29164. class: vue.normalizeClass(vue.unref(formItemClasses)),
  29165. role: vue.unref(isGroup) ? "group" : void 0,
  29166. "aria-labelledby": vue.unref(isGroup) ? vue.unref(labelId) : void 0
  29167. }, [
  29168. vue.createVNode(vue.unref(FormLabelWrap), {
  29169. "is-auto-width": vue.unref(labelStyle).width === "auto",
  29170. "update-all": ((_a = vue.unref(formContext)) == null ? void 0 : _a.labelWidth) === "auto"
  29171. }, {
  29172. default: vue.withCtx(() => [
  29173. vue.unref(hasLabel) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(labelFor) ? "label" : "div"), {
  29174. key: 0,
  29175. id: vue.unref(labelId),
  29176. for: vue.unref(labelFor),
  29177. class: vue.normalizeClass(vue.unref(ns).e("label")),
  29178. style: vue.normalizeStyle(vue.unref(labelStyle))
  29179. }, {
  29180. default: vue.withCtx(() => [
  29181. vue.renderSlot(_ctx.$slots, "label", { label: vue.unref(currentLabel) }, () => [
  29182. vue.createTextVNode(vue.toDisplayString(vue.unref(currentLabel)), 1)
  29183. ])
  29184. ]),
  29185. _: 3
  29186. }, 8, ["id", "for", "class", "style"])) : vue.createCommentVNode("v-if", true)
  29187. ]),
  29188. _: 3
  29189. }, 8, ["is-auto-width", "update-all"]),
  29190. vue.createElementVNode("div", {
  29191. class: vue.normalizeClass(vue.unref(ns).e("content")),
  29192. style: vue.normalizeStyle(vue.unref(contentStyle))
  29193. }, [
  29194. vue.renderSlot(_ctx.$slots, "default"),
  29195. vue.createVNode(vue.Transition, {
  29196. name: `${vue.unref(ns).namespace.value}-zoom-in-top`
  29197. }, {
  29198. default: vue.withCtx(() => [
  29199. vue.unref(shouldShowError) ? vue.renderSlot(_ctx.$slots, "error", {
  29200. key: 0,
  29201. error: validateMessage.value
  29202. }, () => [
  29203. vue.createElementVNode("div", {
  29204. class: vue.normalizeClass(vue.unref(validateClasses))
  29205. }, vue.toDisplayString(validateMessage.value), 3)
  29206. ]) : vue.createCommentVNode("v-if", true)
  29207. ]),
  29208. _: 3
  29209. }, 8, ["name"])
  29210. ], 6)
  29211. ], 10, _hoisted_1$v);
  29212. };
  29213. }
  29214. });
  29215. var FormItem = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__file", "form-item.vue"]]);
  29216. const ElForm = withInstall(Form, {
  29217. FormItem
  29218. });
  29219. const ElFormItem = withNoopInstall(FormItem);
  29220. const imageViewerProps = buildProps({
  29221. urlList: {
  29222. type: definePropType(Array),
  29223. default: () => mutable([])
  29224. },
  29225. zIndex: {
  29226. type: Number
  29227. },
  29228. initialIndex: {
  29229. type: Number,
  29230. default: 0
  29231. },
  29232. infinite: {
  29233. type: Boolean,
  29234. default: true
  29235. },
  29236. hideOnClickModal: {
  29237. type: Boolean,
  29238. default: false
  29239. },
  29240. teleported: {
  29241. type: Boolean,
  29242. default: false
  29243. },
  29244. closeOnPressEscape: {
  29245. type: Boolean,
  29246. default: true
  29247. },
  29248. zoomRate: {
  29249. type: Number,
  29250. default: 1.2
  29251. }
  29252. });
  29253. const imageViewerEmits = {
  29254. close: () => true,
  29255. switch: (index) => isNumber(index)
  29256. };
  29257. const _hoisted_1$u = ["src"];
  29258. const __default__$J = vue.defineComponent({
  29259. name: "ElImageViewer"
  29260. });
  29261. const _sfc_main$_ = /* @__PURE__ */ vue.defineComponent({
  29262. ...__default__$J,
  29263. props: imageViewerProps,
  29264. emits: imageViewerEmits,
  29265. setup(__props, { expose, emit }) {
  29266. const props = __props;
  29267. const modes = {
  29268. CONTAIN: {
  29269. name: "contain",
  29270. icon: vue.markRaw(full_screen_default)
  29271. },
  29272. ORIGINAL: {
  29273. name: "original",
  29274. icon: vue.markRaw(scale_to_original_default)
  29275. }
  29276. };
  29277. const mousewheelEventName = isFirefox() ? "DOMMouseScroll" : "mousewheel";
  29278. const { t } = useLocale();
  29279. const ns = useNamespace("image-viewer");
  29280. const { nextZIndex } = useZIndex();
  29281. const wrapper = vue.ref();
  29282. const imgRefs = vue.ref([]);
  29283. const scopeEventListener = vue.effectScope();
  29284. const loading = vue.ref(true);
  29285. const activeIndex = vue.ref(props.initialIndex);
  29286. const mode = vue.shallowRef(modes.CONTAIN);
  29287. const transform = vue.ref({
  29288. scale: 1,
  29289. deg: 0,
  29290. offsetX: 0,
  29291. offsetY: 0,
  29292. enableTransition: false
  29293. });
  29294. const isSingle = vue.computed(() => {
  29295. const { urlList } = props;
  29296. return urlList.length <= 1;
  29297. });
  29298. const isFirst = vue.computed(() => {
  29299. return activeIndex.value === 0;
  29300. });
  29301. const isLast = vue.computed(() => {
  29302. return activeIndex.value === props.urlList.length - 1;
  29303. });
  29304. const currentImg = vue.computed(() => {
  29305. return props.urlList[activeIndex.value];
  29306. });
  29307. const imgStyle = vue.computed(() => {
  29308. const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
  29309. let translateX = offsetX / scale;
  29310. let translateY = offsetY / scale;
  29311. switch (deg % 360) {
  29312. case 90:
  29313. case -270:
  29314. [translateX, translateY] = [translateY, -translateX];
  29315. break;
  29316. case 180:
  29317. case -180:
  29318. [translateX, translateY] = [-translateX, -translateY];
  29319. break;
  29320. case 270:
  29321. case -90:
  29322. [translateX, translateY] = [-translateY, translateX];
  29323. break;
  29324. }
  29325. const style = {
  29326. transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
  29327. transition: enableTransition ? "transform .3s" : ""
  29328. };
  29329. if (mode.value.name === modes.CONTAIN.name) {
  29330. style.maxWidth = style.maxHeight = "100%";
  29331. }
  29332. return style;
  29333. });
  29334. const computedZIndex = vue.computed(() => {
  29335. return isNumber(props.zIndex) ? props.zIndex : nextZIndex();
  29336. });
  29337. function hide() {
  29338. unregisterEventListener();
  29339. emit("close");
  29340. }
  29341. function registerEventListener() {
  29342. const keydownHandler = throttle((e) => {
  29343. switch (e.code) {
  29344. case EVENT_CODE.esc:
  29345. props.closeOnPressEscape && hide();
  29346. break;
  29347. case EVENT_CODE.space:
  29348. toggleMode();
  29349. break;
  29350. case EVENT_CODE.left:
  29351. prev();
  29352. break;
  29353. case EVENT_CODE.up:
  29354. handleActions("zoomIn");
  29355. break;
  29356. case EVENT_CODE.right:
  29357. next();
  29358. break;
  29359. case EVENT_CODE.down:
  29360. handleActions("zoomOut");
  29361. break;
  29362. }
  29363. });
  29364. const mousewheelHandler = throttle((e) => {
  29365. const delta = e.wheelDelta ? e.wheelDelta : -e.detail;
  29366. if (delta > 0) {
  29367. handleActions("zoomIn", {
  29368. zoomRate: props.zoomRate,
  29369. enableTransition: false
  29370. });
  29371. } else {
  29372. handleActions("zoomOut", {
  29373. zoomRate: props.zoomRate,
  29374. enableTransition: false
  29375. });
  29376. }
  29377. });
  29378. scopeEventListener.run(() => {
  29379. useEventListener(document, "keydown", keydownHandler);
  29380. useEventListener(document, mousewheelEventName, mousewheelHandler);
  29381. });
  29382. }
  29383. function unregisterEventListener() {
  29384. scopeEventListener.stop();
  29385. }
  29386. function handleImgLoad() {
  29387. loading.value = false;
  29388. }
  29389. function handleImgError(e) {
  29390. loading.value = false;
  29391. e.target.alt = t("el.image.error");
  29392. }
  29393. function handleMouseDown(e) {
  29394. if (loading.value || e.button !== 0 || !wrapper.value)
  29395. return;
  29396. transform.value.enableTransition = false;
  29397. const { offsetX, offsetY } = transform.value;
  29398. const startX = e.pageX;
  29399. const startY = e.pageY;
  29400. const dragHandler = throttle((ev) => {
  29401. transform.value = {
  29402. ...transform.value,
  29403. offsetX: offsetX + ev.pageX - startX,
  29404. offsetY: offsetY + ev.pageY - startY
  29405. };
  29406. });
  29407. const removeMousemove = useEventListener(document, "mousemove", dragHandler);
  29408. useEventListener(document, "mouseup", () => {
  29409. removeMousemove();
  29410. });
  29411. e.preventDefault();
  29412. }
  29413. function reset() {
  29414. transform.value = {
  29415. scale: 1,
  29416. deg: 0,
  29417. offsetX: 0,
  29418. offsetY: 0,
  29419. enableTransition: false
  29420. };
  29421. }
  29422. function toggleMode() {
  29423. if (loading.value)
  29424. return;
  29425. const modeNames = keysOf(modes);
  29426. const modeValues = Object.values(modes);
  29427. const currentMode = mode.value.name;
  29428. const index = modeValues.findIndex((i) => i.name === currentMode);
  29429. const nextIndex = (index + 1) % modeNames.length;
  29430. mode.value = modes[modeNames[nextIndex]];
  29431. reset();
  29432. }
  29433. function setActiveItem(index) {
  29434. const len = props.urlList.length;
  29435. activeIndex.value = (index + len) % len;
  29436. }
  29437. function prev() {
  29438. if (isFirst.value && !props.infinite)
  29439. return;
  29440. setActiveItem(activeIndex.value - 1);
  29441. }
  29442. function next() {
  29443. if (isLast.value && !props.infinite)
  29444. return;
  29445. setActiveItem(activeIndex.value + 1);
  29446. }
  29447. function handleActions(action, options = {}) {
  29448. if (loading.value)
  29449. return;
  29450. const { zoomRate, rotateDeg, enableTransition } = {
  29451. zoomRate: props.zoomRate,
  29452. rotateDeg: 90,
  29453. enableTransition: true,
  29454. ...options
  29455. };
  29456. switch (action) {
  29457. case "zoomOut":
  29458. if (transform.value.scale > 0.2) {
  29459. transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3));
  29460. }
  29461. break;
  29462. case "zoomIn":
  29463. if (transform.value.scale < 7) {
  29464. transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3));
  29465. }
  29466. break;
  29467. case "clockwise":
  29468. transform.value.deg += rotateDeg;
  29469. break;
  29470. case "anticlockwise":
  29471. transform.value.deg -= rotateDeg;
  29472. break;
  29473. }
  29474. transform.value.enableTransition = enableTransition;
  29475. }
  29476. vue.watch(currentImg, () => {
  29477. vue.nextTick(() => {
  29478. const $img = imgRefs.value[0];
  29479. if (!($img == null ? void 0 : $img.complete)) {
  29480. loading.value = true;
  29481. }
  29482. });
  29483. });
  29484. vue.watch(activeIndex, (val) => {
  29485. reset();
  29486. emit("switch", val);
  29487. });
  29488. vue.onMounted(() => {
  29489. var _a, _b;
  29490. registerEventListener();
  29491. (_b = (_a = wrapper.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  29492. });
  29493. expose({
  29494. setActiveItem
  29495. });
  29496. return (_ctx, _cache) => {
  29497. return vue.openBlock(), vue.createBlock(vue.Teleport, {
  29498. to: "body",
  29499. disabled: !_ctx.teleported
  29500. }, [
  29501. vue.createVNode(vue.Transition, {
  29502. name: "viewer-fade",
  29503. appear: ""
  29504. }, {
  29505. default: vue.withCtx(() => [
  29506. vue.createElementVNode("div", {
  29507. ref_key: "wrapper",
  29508. ref: wrapper,
  29509. tabindex: -1,
  29510. class: vue.normalizeClass(vue.unref(ns).e("wrapper")),
  29511. style: vue.normalizeStyle({ zIndex: vue.unref(computedZIndex) })
  29512. }, [
  29513. vue.createElementVNode("div", {
  29514. class: vue.normalizeClass(vue.unref(ns).e("mask")),
  29515. onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.hideOnClickModal && hide(), ["self"]))
  29516. }, null, 2),
  29517. vue.createCommentVNode(" CLOSE "),
  29518. vue.createElementVNode("span", {
  29519. class: vue.normalizeClass([vue.unref(ns).e("btn"), vue.unref(ns).e("close")]),
  29520. onClick: hide
  29521. }, [
  29522. vue.createVNode(vue.unref(ElIcon), null, {
  29523. default: vue.withCtx(() => [
  29524. vue.createVNode(vue.unref(close_default))
  29525. ]),
  29526. _: 1
  29527. })
  29528. ], 2),
  29529. vue.createCommentVNode(" ARROW "),
  29530. !vue.unref(isSingle) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  29531. vue.createElementVNode("span", {
  29532. class: vue.normalizeClass([
  29533. vue.unref(ns).e("btn"),
  29534. vue.unref(ns).e("prev"),
  29535. vue.unref(ns).is("disabled", !_ctx.infinite && vue.unref(isFirst))
  29536. ]),
  29537. onClick: prev
  29538. }, [
  29539. vue.createVNode(vue.unref(ElIcon), null, {
  29540. default: vue.withCtx(() => [
  29541. vue.createVNode(vue.unref(arrow_left_default))
  29542. ]),
  29543. _: 1
  29544. })
  29545. ], 2),
  29546. vue.createElementVNode("span", {
  29547. class: vue.normalizeClass([
  29548. vue.unref(ns).e("btn"),
  29549. vue.unref(ns).e("next"),
  29550. vue.unref(ns).is("disabled", !_ctx.infinite && vue.unref(isLast))
  29551. ]),
  29552. onClick: next
  29553. }, [
  29554. vue.createVNode(vue.unref(ElIcon), null, {
  29555. default: vue.withCtx(() => [
  29556. vue.createVNode(vue.unref(arrow_right_default))
  29557. ]),
  29558. _: 1
  29559. })
  29560. ], 2)
  29561. ], 64)) : vue.createCommentVNode("v-if", true),
  29562. vue.createCommentVNode(" ACTIONS "),
  29563. vue.createElementVNode("div", {
  29564. class: vue.normalizeClass([vue.unref(ns).e("btn"), vue.unref(ns).e("actions")])
  29565. }, [
  29566. vue.createElementVNode("div", {
  29567. class: vue.normalizeClass(vue.unref(ns).e("actions__inner"))
  29568. }, [
  29569. vue.createVNode(vue.unref(ElIcon), {
  29570. onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut"))
  29571. }, {
  29572. default: vue.withCtx(() => [
  29573. vue.createVNode(vue.unref(zoom_out_default))
  29574. ]),
  29575. _: 1
  29576. }),
  29577. vue.createVNode(vue.unref(ElIcon), {
  29578. onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn"))
  29579. }, {
  29580. default: vue.withCtx(() => [
  29581. vue.createVNode(vue.unref(zoom_in_default))
  29582. ]),
  29583. _: 1
  29584. }),
  29585. vue.createElementVNode("i", {
  29586. class: vue.normalizeClass(vue.unref(ns).e("actions__divider"))
  29587. }, null, 2),
  29588. vue.createVNode(vue.unref(ElIcon), { onClick: toggleMode }, {
  29589. default: vue.withCtx(() => [
  29590. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(mode).icon)))
  29591. ]),
  29592. _: 1
  29593. }),
  29594. vue.createElementVNode("i", {
  29595. class: vue.normalizeClass(vue.unref(ns).e("actions__divider"))
  29596. }, null, 2),
  29597. vue.createVNode(vue.unref(ElIcon), {
  29598. onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise"))
  29599. }, {
  29600. default: vue.withCtx(() => [
  29601. vue.createVNode(vue.unref(refresh_left_default))
  29602. ]),
  29603. _: 1
  29604. }),
  29605. vue.createVNode(vue.unref(ElIcon), {
  29606. onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise"))
  29607. }, {
  29608. default: vue.withCtx(() => [
  29609. vue.createVNode(vue.unref(refresh_right_default))
  29610. ]),
  29611. _: 1
  29612. })
  29613. ], 2)
  29614. ], 2),
  29615. vue.createCommentVNode(" CANVAS "),
  29616. vue.createElementVNode("div", {
  29617. class: vue.normalizeClass(vue.unref(ns).e("canvas"))
  29618. }, [
  29619. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.urlList, (url, i) => {
  29620. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("img", {
  29621. ref_for: true,
  29622. ref: (el) => imgRefs.value[i] = el,
  29623. key: url,
  29624. src: url,
  29625. style: vue.normalizeStyle(vue.unref(imgStyle)),
  29626. class: vue.normalizeClass(vue.unref(ns).e("img")),
  29627. onLoad: handleImgLoad,
  29628. onError: handleImgError,
  29629. onMousedown: handleMouseDown
  29630. }, null, 46, _hoisted_1$u)), [
  29631. [vue.vShow, i === activeIndex.value]
  29632. ]);
  29633. }), 128))
  29634. ], 2),
  29635. vue.renderSlot(_ctx.$slots, "default")
  29636. ], 6)
  29637. ]),
  29638. _: 3
  29639. })
  29640. ], 8, ["disabled"]);
  29641. };
  29642. }
  29643. });
  29644. var ImageViewer = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__file", "image-viewer.vue"]]);
  29645. const ElImageViewer = withInstall(ImageViewer);
  29646. const imageProps = buildProps({
  29647. hideOnClickModal: {
  29648. type: Boolean,
  29649. default: false
  29650. },
  29651. src: {
  29652. type: String,
  29653. default: ""
  29654. },
  29655. fit: {
  29656. type: String,
  29657. values: ["", "contain", "cover", "fill", "none", "scale-down"],
  29658. default: ""
  29659. },
  29660. loading: {
  29661. type: String,
  29662. values: ["eager", "lazy"]
  29663. },
  29664. lazy: {
  29665. type: Boolean,
  29666. default: false
  29667. },
  29668. scrollContainer: {
  29669. type: definePropType([String, Object])
  29670. },
  29671. previewSrcList: {
  29672. type: definePropType(Array),
  29673. default: () => mutable([])
  29674. },
  29675. previewTeleported: {
  29676. type: Boolean,
  29677. default: false
  29678. },
  29679. zIndex: {
  29680. type: Number
  29681. },
  29682. initialIndex: {
  29683. type: Number,
  29684. default: 0
  29685. },
  29686. infinite: {
  29687. type: Boolean,
  29688. default: true
  29689. },
  29690. closeOnPressEscape: {
  29691. type: Boolean,
  29692. default: true
  29693. },
  29694. zoomRate: {
  29695. type: Number,
  29696. default: 1.2
  29697. }
  29698. });
  29699. const imageEmits = {
  29700. load: (evt) => evt instanceof Event,
  29701. error: (evt) => evt instanceof Event,
  29702. switch: (val) => isNumber(val),
  29703. close: () => true,
  29704. show: () => true
  29705. };
  29706. const _hoisted_1$t = ["src", "loading"];
  29707. const _hoisted_2$j = { key: 0 };
  29708. const __default__$I = vue.defineComponent({
  29709. name: "ElImage",
  29710. inheritAttrs: false
  29711. });
  29712. const _sfc_main$Z = /* @__PURE__ */ vue.defineComponent({
  29713. ...__default__$I,
  29714. props: imageProps,
  29715. emits: imageEmits,
  29716. setup(__props, { emit }) {
  29717. const props = __props;
  29718. let prevOverflow = "";
  29719. const { t } = useLocale();
  29720. const ns = useNamespace("image");
  29721. const rawAttrs = vue.useAttrs();
  29722. const attrs = useAttrs();
  29723. const imageSrc = vue.ref();
  29724. const hasLoadError = vue.ref(false);
  29725. const isLoading = vue.ref(true);
  29726. const showViewer = vue.ref(false);
  29727. const container = vue.ref();
  29728. const _scrollContainer = vue.ref();
  29729. const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
  29730. let stopScrollListener;
  29731. let stopWheelListener;
  29732. const containerStyle = vue.computed(() => rawAttrs.style);
  29733. const imageStyle = vue.computed(() => {
  29734. const { fit } = props;
  29735. if (isClient && fit) {
  29736. return { objectFit: fit };
  29737. }
  29738. return {};
  29739. });
  29740. const preview = vue.computed(() => {
  29741. const { previewSrcList } = props;
  29742. return Array.isArray(previewSrcList) && previewSrcList.length > 0;
  29743. });
  29744. const imageIndex = vue.computed(() => {
  29745. const { previewSrcList, initialIndex } = props;
  29746. let previewIndex = initialIndex;
  29747. if (initialIndex > previewSrcList.length - 1) {
  29748. previewIndex = 0;
  29749. }
  29750. return previewIndex;
  29751. });
  29752. const isManual = vue.computed(() => {
  29753. if (props.loading === "eager")
  29754. return false;
  29755. return !supportLoading && props.loading === "lazy" || props.lazy;
  29756. });
  29757. const loadImage = () => {
  29758. if (!isClient)
  29759. return;
  29760. isLoading.value = true;
  29761. hasLoadError.value = false;
  29762. imageSrc.value = props.src;
  29763. };
  29764. function handleLoad(event) {
  29765. isLoading.value = false;
  29766. hasLoadError.value = false;
  29767. emit("load", event);
  29768. }
  29769. function handleError(event) {
  29770. isLoading.value = false;
  29771. hasLoadError.value = true;
  29772. emit("error", event);
  29773. }
  29774. function handleLazyLoad() {
  29775. if (isInContainer(container.value, _scrollContainer.value)) {
  29776. loadImage();
  29777. removeLazyLoadListener();
  29778. }
  29779. }
  29780. const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200);
  29781. async function addLazyLoadListener() {
  29782. var _a;
  29783. if (!isClient)
  29784. return;
  29785. await vue.nextTick();
  29786. const { scrollContainer } = props;
  29787. if (isElement$1(scrollContainer)) {
  29788. _scrollContainer.value = scrollContainer;
  29789. } else if (isString(scrollContainer) && scrollContainer !== "") {
  29790. _scrollContainer.value = (_a = document.querySelector(scrollContainer)) != null ? _a : void 0;
  29791. } else if (container.value) {
  29792. _scrollContainer.value = getScrollContainer(container.value);
  29793. }
  29794. if (_scrollContainer.value) {
  29795. stopScrollListener = useEventListener(_scrollContainer, "scroll", lazyLoadHandler);
  29796. setTimeout(() => handleLazyLoad(), 100);
  29797. }
  29798. }
  29799. function removeLazyLoadListener() {
  29800. if (!isClient || !_scrollContainer.value || !lazyLoadHandler)
  29801. return;
  29802. stopScrollListener == null ? void 0 : stopScrollListener();
  29803. _scrollContainer.value = void 0;
  29804. }
  29805. function wheelHandler(e) {
  29806. if (!e.ctrlKey)
  29807. return;
  29808. if (e.deltaY < 0) {
  29809. e.preventDefault();
  29810. return false;
  29811. } else if (e.deltaY > 0) {
  29812. e.preventDefault();
  29813. return false;
  29814. }
  29815. }
  29816. function clickHandler() {
  29817. if (!preview.value)
  29818. return;
  29819. stopWheelListener = useEventListener("wheel", wheelHandler, {
  29820. passive: false
  29821. });
  29822. prevOverflow = document.body.style.overflow;
  29823. document.body.style.overflow = "hidden";
  29824. showViewer.value = true;
  29825. emit("show");
  29826. }
  29827. function closeViewer() {
  29828. stopWheelListener == null ? void 0 : stopWheelListener();
  29829. document.body.style.overflow = prevOverflow;
  29830. showViewer.value = false;
  29831. emit("close");
  29832. }
  29833. function switchViewer(val) {
  29834. emit("switch", val);
  29835. }
  29836. vue.watch(() => props.src, () => {
  29837. if (isManual.value) {
  29838. isLoading.value = true;
  29839. hasLoadError.value = false;
  29840. removeLazyLoadListener();
  29841. addLazyLoadListener();
  29842. } else {
  29843. loadImage();
  29844. }
  29845. });
  29846. vue.onMounted(() => {
  29847. if (isManual.value) {
  29848. addLazyLoadListener();
  29849. } else {
  29850. loadImage();
  29851. }
  29852. });
  29853. return (_ctx, _cache) => {
  29854. return vue.openBlock(), vue.createElementBlock("div", {
  29855. ref_key: "container",
  29856. ref: container,
  29857. class: vue.normalizeClass([vue.unref(ns).b(), _ctx.$attrs.class]),
  29858. style: vue.normalizeStyle(vue.unref(containerStyle))
  29859. }, [
  29860. imageSrc.value !== void 0 && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", vue.mergeProps({ key: 0 }, vue.unref(attrs), {
  29861. src: imageSrc.value,
  29862. loading: _ctx.loading,
  29863. style: vue.unref(imageStyle),
  29864. class: [
  29865. vue.unref(ns).e("inner"),
  29866. vue.unref(preview) && vue.unref(ns).e("preview"),
  29867. isLoading.value && vue.unref(ns).is("loading")
  29868. ],
  29869. onClick: clickHandler,
  29870. onLoad: handleLoad,
  29871. onError: handleError
  29872. }), null, 16, _hoisted_1$t)) : vue.createCommentVNode("v-if", true),
  29873. isLoading.value || hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("div", {
  29874. key: 1,
  29875. class: vue.normalizeClass(vue.unref(ns).e("wrapper"))
  29876. }, [
  29877. isLoading.value ? vue.renderSlot(_ctx.$slots, "placeholder", { key: 0 }, () => [
  29878. vue.createElementVNode("div", {
  29879. class: vue.normalizeClass(vue.unref(ns).e("placeholder"))
  29880. }, null, 2)
  29881. ]) : hasLoadError.value ? vue.renderSlot(_ctx.$slots, "error", { key: 1 }, () => [
  29882. vue.createElementVNode("div", {
  29883. class: vue.normalizeClass(vue.unref(ns).e("error"))
  29884. }, vue.toDisplayString(vue.unref(t)("el.image.error")), 3)
  29885. ]) : vue.createCommentVNode("v-if", true)
  29886. ], 2)) : vue.createCommentVNode("v-if", true),
  29887. vue.unref(preview) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  29888. showViewer.value ? (vue.openBlock(), vue.createBlock(vue.unref(ElImageViewer), {
  29889. key: 0,
  29890. "z-index": _ctx.zIndex,
  29891. "initial-index": vue.unref(imageIndex),
  29892. infinite: _ctx.infinite,
  29893. "zoom-rate": _ctx.zoomRate,
  29894. "url-list": _ctx.previewSrcList,
  29895. "hide-on-click-modal": _ctx.hideOnClickModal,
  29896. teleported: _ctx.previewTeleported,
  29897. "close-on-press-escape": _ctx.closeOnPressEscape,
  29898. onClose: closeViewer,
  29899. onSwitch: switchViewer
  29900. }, {
  29901. default: vue.withCtx(() => [
  29902. _ctx.$slots.viewer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$j, [
  29903. vue.renderSlot(_ctx.$slots, "viewer")
  29904. ])) : vue.createCommentVNode("v-if", true)
  29905. ]),
  29906. _: 3
  29907. }, 8, ["z-index", "initial-index", "infinite", "zoom-rate", "url-list", "hide-on-click-modal", "teleported", "close-on-press-escape"])) : vue.createCommentVNode("v-if", true)
  29908. ], 64)) : vue.createCommentVNode("v-if", true)
  29909. ], 6);
  29910. };
  29911. }
  29912. });
  29913. var Image = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__file", "image.vue"]]);
  29914. const ElImage = withInstall(Image);
  29915. const inputNumberProps = buildProps({
  29916. id: {
  29917. type: String,
  29918. default: void 0
  29919. },
  29920. step: {
  29921. type: Number,
  29922. default: 1
  29923. },
  29924. stepStrictly: Boolean,
  29925. max: {
  29926. type: Number,
  29927. default: Number.POSITIVE_INFINITY
  29928. },
  29929. min: {
  29930. type: Number,
  29931. default: Number.NEGATIVE_INFINITY
  29932. },
  29933. modelValue: Number,
  29934. readonly: Boolean,
  29935. disabled: Boolean,
  29936. size: useSizeProp,
  29937. controls: {
  29938. type: Boolean,
  29939. default: true
  29940. },
  29941. controlsPosition: {
  29942. type: String,
  29943. default: "",
  29944. values: ["", "right"]
  29945. },
  29946. valueOnClear: {
  29947. type: [String, Number, null],
  29948. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  29949. default: null
  29950. },
  29951. name: String,
  29952. label: String,
  29953. placeholder: String,
  29954. precision: {
  29955. type: Number,
  29956. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  29957. },
  29958. validateEvent: {
  29959. type: Boolean,
  29960. default: true
  29961. }
  29962. });
  29963. const inputNumberEmits = {
  29964. [CHANGE_EVENT]: (prev, cur) => prev !== cur,
  29965. blur: (e) => e instanceof FocusEvent,
  29966. focus: (e) => e instanceof FocusEvent,
  29967. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  29968. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  29969. };
  29970. const _hoisted_1$s = ["aria-label", "onKeydown"];
  29971. const _hoisted_2$i = ["aria-label", "onKeydown"];
  29972. const __default__$H = vue.defineComponent({
  29973. name: "ElInputNumber"
  29974. });
  29975. const _sfc_main$Y = /* @__PURE__ */ vue.defineComponent({
  29976. ...__default__$H,
  29977. props: inputNumberProps,
  29978. emits: inputNumberEmits,
  29979. setup(__props, { expose, emit }) {
  29980. const props = __props;
  29981. const { t } = useLocale();
  29982. const ns = useNamespace("input-number");
  29983. const input = vue.ref();
  29984. const data = vue.reactive({
  29985. currentValue: props.modelValue,
  29986. userInput: null
  29987. });
  29988. const { formItem } = useFormItem();
  29989. const minDisabled = vue.computed(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  29990. const maxDisabled = vue.computed(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  29991. const numPrecision = vue.computed(() => {
  29992. const stepPrecision = getPrecision(props.step);
  29993. if (!isUndefined(props.precision)) {
  29994. if (stepPrecision > props.precision) ;
  29995. return props.precision;
  29996. } else {
  29997. return Math.max(getPrecision(props.modelValue), stepPrecision);
  29998. }
  29999. });
  30000. const controlsAtRight = vue.computed(() => {
  30001. return props.controls && props.controlsPosition === "right";
  30002. });
  30003. const inputNumberSize = useSize();
  30004. const inputNumberDisabled = useDisabled();
  30005. const displayValue = vue.computed(() => {
  30006. if (data.userInput !== null) {
  30007. return data.userInput;
  30008. }
  30009. let currentValue = data.currentValue;
  30010. if (isNil(currentValue))
  30011. return "";
  30012. if (isNumber(currentValue)) {
  30013. if (Number.isNaN(currentValue))
  30014. return "";
  30015. if (!isUndefined(props.precision)) {
  30016. currentValue = currentValue.toFixed(props.precision);
  30017. }
  30018. }
  30019. return currentValue;
  30020. });
  30021. const toPrecision = (num, pre) => {
  30022. if (isUndefined(pre))
  30023. pre = numPrecision.value;
  30024. if (pre === 0)
  30025. return Math.round(num);
  30026. let snum = String(num);
  30027. const pointPos = snum.indexOf(".");
  30028. if (pointPos === -1)
  30029. return num;
  30030. const nums = snum.replace(".", "").split("");
  30031. const datum = nums[pointPos + pre];
  30032. if (!datum)
  30033. return num;
  30034. const length = snum.length;
  30035. if (snum.charAt(length - 1) === "5") {
  30036. snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  30037. }
  30038. return Number.parseFloat(Number(snum).toFixed(pre));
  30039. };
  30040. const getPrecision = (value) => {
  30041. if (isNil(value))
  30042. return 0;
  30043. const valueString = value.toString();
  30044. const dotPosition = valueString.indexOf(".");
  30045. let precision = 0;
  30046. if (dotPosition !== -1) {
  30047. precision = valueString.length - dotPosition - 1;
  30048. }
  30049. return precision;
  30050. };
  30051. const ensurePrecision = (val, coefficient = 1) => {
  30052. if (!isNumber(val))
  30053. return data.currentValue;
  30054. return toPrecision(val + props.step * coefficient);
  30055. };
  30056. const increase = () => {
  30057. if (props.readonly || inputNumberDisabled.value || maxDisabled.value)
  30058. return;
  30059. const value = Number(displayValue.value) || 0;
  30060. const newVal = ensurePrecision(value);
  30061. setCurrentValue(newVal);
  30062. emit(INPUT_EVENT, data.currentValue);
  30063. };
  30064. const decrease = () => {
  30065. if (props.readonly || inputNumberDisabled.value || minDisabled.value)
  30066. return;
  30067. const value = Number(displayValue.value) || 0;
  30068. const newVal = ensurePrecision(value, -1);
  30069. setCurrentValue(newVal);
  30070. emit(INPUT_EVENT, data.currentValue);
  30071. };
  30072. const verifyValue = (value, update) => {
  30073. const { max, min, step, precision, stepStrictly, valueOnClear } = props;
  30074. let newVal = Number(value);
  30075. if (isNil(value) || Number.isNaN(newVal)) {
  30076. return null;
  30077. }
  30078. if (value === "") {
  30079. if (valueOnClear === null) {
  30080. return null;
  30081. }
  30082. newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
  30083. }
  30084. if (stepStrictly) {
  30085. newVal = toPrecision(Math.round(newVal / step) * step, precision);
  30086. }
  30087. if (!isUndefined(precision)) {
  30088. newVal = toPrecision(newVal, precision);
  30089. }
  30090. if (newVal > max || newVal < min) {
  30091. newVal = newVal > max ? max : min;
  30092. update && emit(UPDATE_MODEL_EVENT, newVal);
  30093. }
  30094. return newVal;
  30095. };
  30096. const setCurrentValue = (value, emitChange = true) => {
  30097. var _a;
  30098. const oldVal = data.currentValue;
  30099. const newVal = verifyValue(value);
  30100. if (oldVal === newVal)
  30101. return;
  30102. if (!emitChange) {
  30103. emit(UPDATE_MODEL_EVENT, newVal);
  30104. return;
  30105. }
  30106. data.userInput = null;
  30107. emit(UPDATE_MODEL_EVENT, newVal);
  30108. emit(CHANGE_EVENT, newVal, oldVal);
  30109. if (props.validateEvent) {
  30110. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn());
  30111. }
  30112. data.currentValue = newVal;
  30113. };
  30114. const handleInput = (value) => {
  30115. data.userInput = value;
  30116. const newVal = value === "" ? null : Number(value);
  30117. emit(INPUT_EVENT, newVal);
  30118. setCurrentValue(newVal, false);
  30119. };
  30120. const handleInputChange = (value) => {
  30121. const newVal = value !== "" ? Number(value) : "";
  30122. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") {
  30123. setCurrentValue(newVal);
  30124. }
  30125. data.userInput = null;
  30126. };
  30127. const focus = () => {
  30128. var _a, _b;
  30129. (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  30130. };
  30131. const blur = () => {
  30132. var _a, _b;
  30133. (_b = (_a = input.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
  30134. };
  30135. const handleFocus = (event) => {
  30136. emit("focus", event);
  30137. };
  30138. const handleBlur = (event) => {
  30139. var _a;
  30140. emit("blur", event);
  30141. if (props.validateEvent) {
  30142. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "blur").catch((err) => debugWarn());
  30143. }
  30144. };
  30145. vue.watch(() => props.modelValue, (value) => {
  30146. const userInput = verifyValue(data.userInput);
  30147. const newValue = verifyValue(value, true);
  30148. if (!isNumber(userInput) && (!userInput || userInput !== newValue)) {
  30149. data.currentValue = newValue;
  30150. data.userInput = null;
  30151. }
  30152. }, { immediate: true });
  30153. vue.onMounted(() => {
  30154. var _a;
  30155. const { min, max, modelValue } = props;
  30156. const innerInput = (_a = input.value) == null ? void 0 : _a.input;
  30157. innerInput.setAttribute("role", "spinbutton");
  30158. if (Number.isFinite(max)) {
  30159. innerInput.setAttribute("aria-valuemax", String(max));
  30160. } else {
  30161. innerInput.removeAttribute("aria-valuemax");
  30162. }
  30163. if (Number.isFinite(min)) {
  30164. innerInput.setAttribute("aria-valuemin", String(min));
  30165. } else {
  30166. innerInput.removeAttribute("aria-valuemin");
  30167. }
  30168. innerInput.setAttribute("aria-valuenow", String(data.currentValue));
  30169. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  30170. if (!isNumber(modelValue) && modelValue != null) {
  30171. let val = Number(modelValue);
  30172. if (Number.isNaN(val)) {
  30173. val = null;
  30174. }
  30175. emit(UPDATE_MODEL_EVENT, val);
  30176. }
  30177. });
  30178. vue.onUpdated(() => {
  30179. var _a;
  30180. const innerInput = (_a = input.value) == null ? void 0 : _a.input;
  30181. innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${data.currentValue}`);
  30182. });
  30183. expose({
  30184. focus,
  30185. blur
  30186. });
  30187. return (_ctx, _cache) => {
  30188. return vue.openBlock(), vue.createElementBlock("div", {
  30189. class: vue.normalizeClass([
  30190. vue.unref(ns).b(),
  30191. vue.unref(ns).m(vue.unref(inputNumberSize)),
  30192. vue.unref(ns).is("disabled", vue.unref(inputNumberDisabled)),
  30193. vue.unref(ns).is("without-controls", !_ctx.controls),
  30194. vue.unref(ns).is("controls-right", vue.unref(controlsAtRight))
  30195. ]),
  30196. onDragstart: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  30197. }, ["prevent"]))
  30198. }, [
  30199. _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  30200. key: 0,
  30201. role: "button",
  30202. "aria-label": vue.unref(t)("el.inputNumber.decrease"),
  30203. class: vue.normalizeClass([vue.unref(ns).e("decrease"), vue.unref(ns).is("disabled", vue.unref(minDisabled))]),
  30204. onKeydown: vue.withKeys(decrease, ["enter"])
  30205. }, [
  30206. vue.createVNode(vue.unref(ElIcon), null, {
  30207. default: vue.withCtx(() => [
  30208. vue.unref(controlsAtRight) ? (vue.openBlock(), vue.createBlock(vue.unref(arrow_down_default), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(minus_default), { key: 1 }))
  30209. ]),
  30210. _: 1
  30211. })
  30212. ], 42, _hoisted_1$s)), [
  30213. [vue.unref(vRepeatClick), decrease]
  30214. ]) : vue.createCommentVNode("v-if", true),
  30215. _ctx.controls ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  30216. key: 1,
  30217. role: "button",
  30218. "aria-label": vue.unref(t)("el.inputNumber.increase"),
  30219. class: vue.normalizeClass([vue.unref(ns).e("increase"), vue.unref(ns).is("disabled", vue.unref(maxDisabled))]),
  30220. onKeydown: vue.withKeys(increase, ["enter"])
  30221. }, [
  30222. vue.createVNode(vue.unref(ElIcon), null, {
  30223. default: vue.withCtx(() => [
  30224. vue.unref(controlsAtRight) ? (vue.openBlock(), vue.createBlock(vue.unref(arrow_up_default), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(plus_default), { key: 1 }))
  30225. ]),
  30226. _: 1
  30227. })
  30228. ], 42, _hoisted_2$i)), [
  30229. [vue.unref(vRepeatClick), increase]
  30230. ]) : vue.createCommentVNode("v-if", true),
  30231. vue.createVNode(vue.unref(ElInput), {
  30232. id: _ctx.id,
  30233. ref_key: "input",
  30234. ref: input,
  30235. type: "number",
  30236. step: _ctx.step,
  30237. "model-value": vue.unref(displayValue),
  30238. placeholder: _ctx.placeholder,
  30239. readonly: _ctx.readonly,
  30240. disabled: vue.unref(inputNumberDisabled),
  30241. size: vue.unref(inputNumberSize),
  30242. max: _ctx.max,
  30243. min: _ctx.min,
  30244. name: _ctx.name,
  30245. label: _ctx.label,
  30246. "validate-event": false,
  30247. onKeydown: [
  30248. vue.withKeys(vue.withModifiers(increase, ["prevent"]), ["up"]),
  30249. vue.withKeys(vue.withModifiers(decrease, ["prevent"]), ["down"])
  30250. ],
  30251. onBlur: handleBlur,
  30252. onFocus: handleFocus,
  30253. onInput: handleInput,
  30254. onChange: handleInputChange
  30255. }, null, 8, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "label", "onKeydown"])
  30256. ], 34);
  30257. };
  30258. }
  30259. });
  30260. var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__file", "input-number.vue"]]);
  30261. const ElInputNumber = withInstall(InputNumber);
  30262. const linkProps = buildProps({
  30263. type: {
  30264. type: String,
  30265. values: ["primary", "success", "warning", "info", "danger", "default"],
  30266. default: "default"
  30267. },
  30268. underline: {
  30269. type: Boolean,
  30270. default: true
  30271. },
  30272. disabled: { type: Boolean, default: false },
  30273. href: { type: String, default: "" },
  30274. icon: {
  30275. type: iconPropType
  30276. }
  30277. });
  30278. const linkEmits = {
  30279. click: (evt) => evt instanceof MouseEvent
  30280. };
  30281. const _hoisted_1$r = ["href"];
  30282. const __default__$G = vue.defineComponent({
  30283. name: "ElLink"
  30284. });
  30285. const _sfc_main$X = /* @__PURE__ */ vue.defineComponent({
  30286. ...__default__$G,
  30287. props: linkProps,
  30288. emits: linkEmits,
  30289. setup(__props, { emit }) {
  30290. const props = __props;
  30291. const ns = useNamespace("link");
  30292. const linkKls = vue.computed(() => [
  30293. ns.b(),
  30294. ns.m(props.type),
  30295. ns.is("disabled", props.disabled),
  30296. ns.is("underline", props.underline && !props.disabled)
  30297. ]);
  30298. function handleClick(event) {
  30299. if (!props.disabled)
  30300. emit("click", event);
  30301. }
  30302. return (_ctx, _cache) => {
  30303. return vue.openBlock(), vue.createElementBlock("a", {
  30304. class: vue.normalizeClass(vue.unref(linkKls)),
  30305. href: _ctx.disabled || !_ctx.href ? void 0 : _ctx.href,
  30306. onClick: handleClick
  30307. }, [
  30308. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 0 }, {
  30309. default: vue.withCtx(() => [
  30310. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  30311. ]),
  30312. _: 1
  30313. })) : vue.createCommentVNode("v-if", true),
  30314. _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("span", {
  30315. key: 1,
  30316. class: vue.normalizeClass(vue.unref(ns).e("inner"))
  30317. }, [
  30318. vue.renderSlot(_ctx.$slots, "default")
  30319. ], 2)) : vue.createCommentVNode("v-if", true),
  30320. _ctx.$slots.icon ? vue.renderSlot(_ctx.$slots, "icon", { key: 2 }) : vue.createCommentVNode("v-if", true)
  30321. ], 10, _hoisted_1$r);
  30322. };
  30323. }
  30324. });
  30325. var Link = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__file", "link.vue"]]);
  30326. const ElLink = withInstall(Link);
  30327. class SubMenu$1 {
  30328. constructor(parent, domNode) {
  30329. this.parent = parent;
  30330. this.domNode = domNode;
  30331. this.subIndex = 0;
  30332. this.subIndex = 0;
  30333. this.init();
  30334. }
  30335. init() {
  30336. this.subMenuItems = this.domNode.querySelectorAll("li");
  30337. this.addListeners();
  30338. }
  30339. gotoSubIndex(idx) {
  30340. if (idx === this.subMenuItems.length) {
  30341. idx = 0;
  30342. } else if (idx < 0) {
  30343. idx = this.subMenuItems.length - 1;
  30344. }
  30345. this.subMenuItems[idx].focus();
  30346. this.subIndex = idx;
  30347. }
  30348. addListeners() {
  30349. const parentNode = this.parent.domNode;
  30350. Array.prototype.forEach.call(this.subMenuItems, (el) => {
  30351. el.addEventListener("keydown", (event) => {
  30352. let prevDef = false;
  30353. switch (event.code) {
  30354. case EVENT_CODE.down: {
  30355. this.gotoSubIndex(this.subIndex + 1);
  30356. prevDef = true;
  30357. break;
  30358. }
  30359. case EVENT_CODE.up: {
  30360. this.gotoSubIndex(this.subIndex - 1);
  30361. prevDef = true;
  30362. break;
  30363. }
  30364. case EVENT_CODE.tab: {
  30365. triggerEvent(parentNode, "mouseleave");
  30366. break;
  30367. }
  30368. case EVENT_CODE.enter:
  30369. case EVENT_CODE.space: {
  30370. prevDef = true;
  30371. event.currentTarget.click();
  30372. break;
  30373. }
  30374. }
  30375. if (prevDef) {
  30376. event.preventDefault();
  30377. event.stopPropagation();
  30378. }
  30379. return false;
  30380. });
  30381. });
  30382. }
  30383. }
  30384. var SubMenu$2 = SubMenu$1;
  30385. class MenuItem$1 {
  30386. constructor(domNode, namespace) {
  30387. this.domNode = domNode;
  30388. this.submenu = null;
  30389. this.submenu = null;
  30390. this.init(namespace);
  30391. }
  30392. init(namespace) {
  30393. this.domNode.setAttribute("tabindex", "0");
  30394. const menuChild = this.domNode.querySelector(`.${namespace}-menu`);
  30395. if (menuChild) {
  30396. this.submenu = new SubMenu$2(this, menuChild);
  30397. }
  30398. this.addListeners();
  30399. }
  30400. addListeners() {
  30401. this.domNode.addEventListener("keydown", (event) => {
  30402. let prevDef = false;
  30403. switch (event.code) {
  30404. case EVENT_CODE.down: {
  30405. triggerEvent(event.currentTarget, "mouseenter");
  30406. this.submenu && this.submenu.gotoSubIndex(0);
  30407. prevDef = true;
  30408. break;
  30409. }
  30410. case EVENT_CODE.up: {
  30411. triggerEvent(event.currentTarget, "mouseenter");
  30412. this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
  30413. prevDef = true;
  30414. break;
  30415. }
  30416. case EVENT_CODE.tab: {
  30417. triggerEvent(event.currentTarget, "mouseleave");
  30418. break;
  30419. }
  30420. case EVENT_CODE.enter:
  30421. case EVENT_CODE.space: {
  30422. prevDef = true;
  30423. event.currentTarget.click();
  30424. break;
  30425. }
  30426. }
  30427. if (prevDef) {
  30428. event.preventDefault();
  30429. }
  30430. });
  30431. }
  30432. }
  30433. var MenuItem$2 = MenuItem$1;
  30434. class Menu$1 {
  30435. constructor(domNode, namespace) {
  30436. this.domNode = domNode;
  30437. this.init(namespace);
  30438. }
  30439. init(namespace) {
  30440. const menuChildren = this.domNode.childNodes;
  30441. Array.from(menuChildren).forEach((child) => {
  30442. if (child.nodeType === 1) {
  30443. new MenuItem$2(child, namespace);
  30444. }
  30445. });
  30446. }
  30447. }
  30448. var Menubar = Menu$1;
  30449. const _sfc_main$W = vue.defineComponent({
  30450. name: "ElMenuCollapseTransition",
  30451. setup() {
  30452. const ns = useNamespace("menu");
  30453. const listeners = {
  30454. onBeforeEnter: (el) => el.style.opacity = "0.2",
  30455. onEnter(el, done) {
  30456. addClass(el, `${ns.namespace.value}-opacity-transition`);
  30457. el.style.opacity = "1";
  30458. done();
  30459. },
  30460. onAfterEnter(el) {
  30461. removeClass(el, `${ns.namespace.value}-opacity-transition`);
  30462. el.style.opacity = "";
  30463. },
  30464. onBeforeLeave(el) {
  30465. if (!el.dataset) {
  30466. el.dataset = {};
  30467. }
  30468. if (hasClass(el, ns.m("collapse"))) {
  30469. removeClass(el, ns.m("collapse"));
  30470. el.dataset.oldOverflow = el.style.overflow;
  30471. el.dataset.scrollWidth = el.clientWidth.toString();
  30472. addClass(el, ns.m("collapse"));
  30473. } else {
  30474. addClass(el, ns.m("collapse"));
  30475. el.dataset.oldOverflow = el.style.overflow;
  30476. el.dataset.scrollWidth = el.clientWidth.toString();
  30477. removeClass(el, ns.m("collapse"));
  30478. }
  30479. el.style.width = `${el.scrollWidth}px`;
  30480. el.style.overflow = "hidden";
  30481. },
  30482. onLeave(el) {
  30483. addClass(el, "horizontal-collapse-transition");
  30484. el.style.width = `${el.dataset.scrollWidth}px`;
  30485. }
  30486. };
  30487. return {
  30488. listeners
  30489. };
  30490. }
  30491. });
  30492. function _sfc_render$e(_ctx, _cache, $props, $setup, $data, $options) {
  30493. return vue.openBlock(), vue.createBlock(vue.Transition, vue.mergeProps({ mode: "out-in" }, _ctx.listeners), {
  30494. default: vue.withCtx(() => [
  30495. vue.renderSlot(_ctx.$slots, "default")
  30496. ]),
  30497. _: 3
  30498. }, 16);
  30499. }
  30500. var ElMenuCollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["render", _sfc_render$e], ["__file", "menu-collapse-transition.vue"]]);
  30501. function useMenu(instance, currentIndex) {
  30502. const indexPath = vue.computed(() => {
  30503. let parent = instance.parent;
  30504. const path = [currentIndex.value];
  30505. while (parent.type.name !== "ElMenu") {
  30506. if (parent.props.index) {
  30507. path.unshift(parent.props.index);
  30508. }
  30509. parent = parent.parent;
  30510. }
  30511. return path;
  30512. });
  30513. const parentMenu = vue.computed(() => {
  30514. let parent = instance.parent;
  30515. while (parent && !["ElMenu", "ElSubMenu"].includes(parent.type.name)) {
  30516. parent = parent.parent;
  30517. }
  30518. return parent;
  30519. });
  30520. return {
  30521. parentMenu,
  30522. indexPath
  30523. };
  30524. }
  30525. function useMenuColor(props) {
  30526. const menuBarColor = vue.computed(() => {
  30527. const color = props.backgroundColor;
  30528. if (!color) {
  30529. return "";
  30530. } else {
  30531. return new TinyColor(color).shade(20).toString();
  30532. }
  30533. });
  30534. return menuBarColor;
  30535. }
  30536. const useMenuCssVar = (props, level) => {
  30537. const ns = useNamespace("menu");
  30538. return vue.computed(() => {
  30539. return ns.cssVarBlock({
  30540. "text-color": props.textColor || "",
  30541. "hover-text-color": props.textColor || "",
  30542. "bg-color": props.backgroundColor || "",
  30543. "hover-bg-color": useMenuColor(props).value || "",
  30544. "active-color": props.activeTextColor || "",
  30545. level: `${level}`
  30546. });
  30547. });
  30548. };
  30549. const subMenuProps = buildProps({
  30550. index: {
  30551. type: String,
  30552. required: true
  30553. },
  30554. showTimeout: {
  30555. type: Number,
  30556. default: 300
  30557. },
  30558. hideTimeout: {
  30559. type: Number,
  30560. default: 300
  30561. },
  30562. popperClass: String,
  30563. disabled: Boolean,
  30564. popperAppendToBody: {
  30565. type: Boolean,
  30566. default: void 0
  30567. },
  30568. popperOffset: {
  30569. type: Number,
  30570. default: 6
  30571. },
  30572. expandCloseIcon: {
  30573. type: iconPropType
  30574. },
  30575. expandOpenIcon: {
  30576. type: iconPropType
  30577. },
  30578. collapseCloseIcon: {
  30579. type: iconPropType
  30580. },
  30581. collapseOpenIcon: {
  30582. type: iconPropType
  30583. }
  30584. });
  30585. const COMPONENT_NAME$c = "ElSubMenu";
  30586. var SubMenu = vue.defineComponent({
  30587. name: COMPONENT_NAME$c,
  30588. props: subMenuProps,
  30589. setup(props, { slots, expose }) {
  30590. const instance = vue.getCurrentInstance();
  30591. const { indexPath, parentMenu } = useMenu(instance, vue.computed(() => props.index));
  30592. const nsMenu = useNamespace("menu");
  30593. const nsSubMenu = useNamespace("sub-menu");
  30594. const rootMenu = vue.inject("rootMenu");
  30595. if (!rootMenu)
  30596. throwError(COMPONENT_NAME$c, "can not inject root menu");
  30597. const subMenu = vue.inject(`subMenu:${parentMenu.value.uid}`);
  30598. if (!subMenu)
  30599. throwError(COMPONENT_NAME$c, "can not inject sub menu");
  30600. const items = vue.ref({});
  30601. const subMenus = vue.ref({});
  30602. let timeout;
  30603. const mouseInChild = vue.ref(false);
  30604. const verticalTitleRef = vue.ref();
  30605. const vPopper = vue.ref(null);
  30606. const currentPlacement = vue.computed(() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start");
  30607. const subMenuTitleIcon = vue.computed(() => {
  30608. return mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse ? props.expandCloseIcon && props.expandOpenIcon ? opened.value ? props.expandOpenIcon : props.expandCloseIcon : arrow_down_default : props.collapseCloseIcon && props.collapseOpenIcon ? opened.value ? props.collapseOpenIcon : props.collapseCloseIcon : arrow_right_default;
  30609. });
  30610. const isFirstLevel = vue.computed(() => {
  30611. return subMenu.level === 0;
  30612. });
  30613. const appendToBody = vue.computed(() => {
  30614. return props.popperAppendToBody === void 0 ? isFirstLevel.value : Boolean(props.popperAppendToBody);
  30615. });
  30616. const menuTransitionName = vue.computed(() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`);
  30617. const fallbackPlacements = vue.computed(() => mode.value === "horizontal" && isFirstLevel.value ? [
  30618. "bottom-start",
  30619. "bottom-end",
  30620. "top-start",
  30621. "top-end",
  30622. "right-start",
  30623. "left-start"
  30624. ] : [
  30625. "right-start",
  30626. "left-start",
  30627. "bottom-start",
  30628. "bottom-end",
  30629. "top-start",
  30630. "top-end"
  30631. ]);
  30632. const opened = vue.computed(() => rootMenu.openedMenus.includes(props.index));
  30633. const active = vue.computed(() => {
  30634. let isActive = false;
  30635. Object.values(items.value).forEach((item2) => {
  30636. if (item2.active) {
  30637. isActive = true;
  30638. }
  30639. });
  30640. Object.values(subMenus.value).forEach((subItem) => {
  30641. if (subItem.active) {
  30642. isActive = true;
  30643. }
  30644. });
  30645. return isActive;
  30646. });
  30647. const backgroundColor = vue.computed(() => rootMenu.props.backgroundColor || "");
  30648. const activeTextColor = vue.computed(() => rootMenu.props.activeTextColor || "");
  30649. const textColor = vue.computed(() => rootMenu.props.textColor || "");
  30650. const mode = vue.computed(() => rootMenu.props.mode);
  30651. const item = vue.reactive({
  30652. index: props.index,
  30653. indexPath,
  30654. active
  30655. });
  30656. const titleStyle = vue.computed(() => {
  30657. if (mode.value !== "horizontal") {
  30658. return {
  30659. color: textColor.value
  30660. };
  30661. }
  30662. return {
  30663. borderBottomColor: active.value ? rootMenu.props.activeTextColor ? activeTextColor.value : "" : "transparent",
  30664. color: active.value ? activeTextColor.value : textColor.value
  30665. };
  30666. });
  30667. const doDestroy = () => {
  30668. var _a, _b, _c;
  30669. return (_c = (_b = (_a = vPopper.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.popperInstanceRef) == null ? void 0 : _c.destroy();
  30670. };
  30671. const handleCollapseToggle = (value) => {
  30672. if (!value) {
  30673. doDestroy();
  30674. }
  30675. };
  30676. const handleClick = () => {
  30677. if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled)
  30678. return;
  30679. rootMenu.handleSubMenuClick({
  30680. index: props.index,
  30681. indexPath: indexPath.value,
  30682. active: active.value
  30683. });
  30684. };
  30685. const handleMouseenter = (event, showTimeout = props.showTimeout) => {
  30686. var _a;
  30687. if (event.type === "focus") {
  30688. return;
  30689. }
  30690. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled) {
  30691. return;
  30692. }
  30693. subMenu.mouseInChild.value = true;
  30694. timeout == null ? void 0 : timeout();
  30695. ({ stop: timeout } = useTimeoutFn(() => {
  30696. rootMenu.openMenu(props.index, indexPath.value);
  30697. }, showTimeout));
  30698. if (appendToBody.value) {
  30699. (_a = parentMenu.value.vnode.el) == null ? void 0 : _a.dispatchEvent(new MouseEvent("mouseenter"));
  30700. }
  30701. };
  30702. const handleMouseleave = (deepDispatch = false) => {
  30703. var _a, _b;
  30704. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") {
  30705. return;
  30706. }
  30707. timeout == null ? void 0 : timeout();
  30708. subMenu.mouseInChild.value = false;
  30709. ({ stop: timeout } = useTimeoutFn(() => !mouseInChild.value && rootMenu.closeMenu(props.index, indexPath.value), props.hideTimeout));
  30710. if (appendToBody.value && deepDispatch) {
  30711. if (((_a = instance.parent) == null ? void 0 : _a.type.name) === "ElSubMenu") {
  30712. (_b = subMenu.handleMouseleave) == null ? void 0 : _b.call(subMenu, true);
  30713. }
  30714. }
  30715. };
  30716. vue.watch(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value)));
  30717. {
  30718. const addSubMenu = (item2) => {
  30719. subMenus.value[item2.index] = item2;
  30720. };
  30721. const removeSubMenu = (item2) => {
  30722. delete subMenus.value[item2.index];
  30723. };
  30724. vue.provide(`subMenu:${instance.uid}`, {
  30725. addSubMenu,
  30726. removeSubMenu,
  30727. handleMouseleave,
  30728. mouseInChild,
  30729. level: subMenu.level + 1
  30730. });
  30731. }
  30732. expose({
  30733. opened
  30734. });
  30735. vue.onMounted(() => {
  30736. rootMenu.addSubMenu(item);
  30737. subMenu.addSubMenu(item);
  30738. });
  30739. vue.onBeforeUnmount(() => {
  30740. subMenu.removeSubMenu(item);
  30741. rootMenu.removeSubMenu(item);
  30742. });
  30743. return () => {
  30744. var _a;
  30745. const titleTag = [
  30746. (_a = slots.title) == null ? void 0 : _a.call(slots),
  30747. vue.h(ElIcon, {
  30748. class: nsSubMenu.e("icon-arrow"),
  30749. style: {
  30750. transform: opened.value ? props.expandCloseIcon && props.expandOpenIcon || props.collapseCloseIcon && props.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none"
  30751. }
  30752. }, {
  30753. default: () => isString(subMenuTitleIcon.value) ? vue.h(instance.appContext.components[subMenuTitleIcon.value]) : vue.h(subMenuTitleIcon.value)
  30754. })
  30755. ];
  30756. const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1);
  30757. const child = rootMenu.isMenuPopup ? vue.h(ElTooltip, {
  30758. ref: vPopper,
  30759. visible: opened.value,
  30760. effect: "light",
  30761. pure: true,
  30762. offset: props.popperOffset,
  30763. showArrow: false,
  30764. persistent: true,
  30765. popperClass: props.popperClass,
  30766. placement: currentPlacement.value,
  30767. teleported: appendToBody.value,
  30768. fallbackPlacements: fallbackPlacements.value,
  30769. transition: menuTransitionName.value,
  30770. gpuAcceleration: false
  30771. }, {
  30772. content: () => {
  30773. var _a2;
  30774. return vue.h("div", {
  30775. class: [
  30776. nsMenu.m(mode.value),
  30777. nsMenu.m("popup-container"),
  30778. props.popperClass
  30779. ],
  30780. onMouseenter: (evt) => handleMouseenter(evt, 100),
  30781. onMouseleave: () => handleMouseleave(true),
  30782. onFocus: (evt) => handleMouseenter(evt, 100)
  30783. }, [
  30784. vue.h("ul", {
  30785. class: [
  30786. nsMenu.b(),
  30787. nsMenu.m("popup"),
  30788. nsMenu.m(`popup-${currentPlacement.value}`)
  30789. ],
  30790. style: ulStyle.value
  30791. }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)])
  30792. ]);
  30793. },
  30794. default: () => vue.h("div", {
  30795. class: nsSubMenu.e("title"),
  30796. style: [
  30797. titleStyle.value,
  30798. { backgroundColor: backgroundColor.value }
  30799. ],
  30800. onClick: handleClick
  30801. }, titleTag)
  30802. }) : vue.h(vue.Fragment, {}, [
  30803. vue.h("div", {
  30804. class: nsSubMenu.e("title"),
  30805. style: [
  30806. titleStyle.value,
  30807. { backgroundColor: backgroundColor.value }
  30808. ],
  30809. ref: verticalTitleRef,
  30810. onClick: handleClick
  30811. }, titleTag),
  30812. vue.h(_CollapseTransition, {}, {
  30813. default: () => {
  30814. var _a2;
  30815. return vue.withDirectives(vue.h("ul", {
  30816. role: "menu",
  30817. class: [nsMenu.b(), nsMenu.m("inline")],
  30818. style: ulStyle.value
  30819. }, [(_a2 = slots.default) == null ? void 0 : _a2.call(slots)]), [[vue.vShow, opened.value]]);
  30820. }
  30821. })
  30822. ]);
  30823. return vue.h("li", {
  30824. class: [
  30825. nsSubMenu.b(),
  30826. nsSubMenu.is("active", active.value),
  30827. nsSubMenu.is("opened", opened.value),
  30828. nsSubMenu.is("disabled", props.disabled)
  30829. ],
  30830. role: "menuitem",
  30831. ariaHaspopup: true,
  30832. ariaExpanded: opened.value,
  30833. onMouseenter: handleMouseenter,
  30834. onMouseleave: () => handleMouseleave(true),
  30835. onFocus: handleMouseenter
  30836. }, [child]);
  30837. };
  30838. }
  30839. });
  30840. const menuProps = buildProps({
  30841. mode: {
  30842. type: String,
  30843. values: ["horizontal", "vertical"],
  30844. default: "vertical"
  30845. },
  30846. defaultActive: {
  30847. type: String,
  30848. default: ""
  30849. },
  30850. defaultOpeneds: {
  30851. type: definePropType(Array),
  30852. default: () => mutable([])
  30853. },
  30854. uniqueOpened: Boolean,
  30855. router: Boolean,
  30856. menuTrigger: {
  30857. type: String,
  30858. values: ["hover", "click"],
  30859. default: "hover"
  30860. },
  30861. collapse: Boolean,
  30862. backgroundColor: String,
  30863. textColor: String,
  30864. activeTextColor: String,
  30865. collapseTransition: {
  30866. type: Boolean,
  30867. default: true
  30868. },
  30869. ellipsis: {
  30870. type: Boolean,
  30871. default: true
  30872. },
  30873. popperEffect: {
  30874. type: String,
  30875. values: ["dark", "light"],
  30876. default: "dark"
  30877. }
  30878. });
  30879. const checkIndexPath = (indexPath) => Array.isArray(indexPath) && indexPath.every((path) => isString(path));
  30880. const menuEmits = {
  30881. close: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  30882. open: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  30883. select: (index, indexPath, item, routerResult) => isString(index) && checkIndexPath(indexPath) && isObject$1(item) && (routerResult === void 0 || routerResult instanceof Promise)
  30884. };
  30885. var Menu = vue.defineComponent({
  30886. name: "ElMenu",
  30887. props: menuProps,
  30888. emits: menuEmits,
  30889. setup(props, { emit, slots, expose }) {
  30890. const instance = vue.getCurrentInstance();
  30891. const router = instance.appContext.config.globalProperties.$router;
  30892. const menu = vue.ref();
  30893. const nsMenu = useNamespace("menu");
  30894. const nsSubMenu = useNamespace("sub-menu");
  30895. const sliceIndex = vue.ref(-1);
  30896. const openedMenus = vue.ref(props.defaultOpeneds && !props.collapse ? props.defaultOpeneds.slice(0) : []);
  30897. const activeIndex = vue.ref(props.defaultActive);
  30898. const items = vue.ref({});
  30899. const subMenus = vue.ref({});
  30900. const isMenuPopup = vue.computed(() => {
  30901. return props.mode === "horizontal" || props.mode === "vertical" && props.collapse;
  30902. });
  30903. const initMenu = () => {
  30904. const activeItem = activeIndex.value && items.value[activeIndex.value];
  30905. if (!activeItem || props.mode === "horizontal" || props.collapse)
  30906. return;
  30907. const indexPath = activeItem.indexPath;
  30908. indexPath.forEach((index) => {
  30909. const subMenu = subMenus.value[index];
  30910. subMenu && openMenu(index, subMenu.indexPath);
  30911. });
  30912. };
  30913. const openMenu = (index, indexPath) => {
  30914. if (openedMenus.value.includes(index))
  30915. return;
  30916. if (props.uniqueOpened) {
  30917. openedMenus.value = openedMenus.value.filter((index2) => indexPath.includes(index2));
  30918. }
  30919. openedMenus.value.push(index);
  30920. emit("open", index, indexPath);
  30921. };
  30922. const closeMenu = (index, indexPath) => {
  30923. const i = openedMenus.value.indexOf(index);
  30924. if (i !== -1) {
  30925. openedMenus.value.splice(i, 1);
  30926. }
  30927. emit("close", index, indexPath);
  30928. };
  30929. const handleSubMenuClick = ({
  30930. index,
  30931. indexPath
  30932. }) => {
  30933. const isOpened = openedMenus.value.includes(index);
  30934. if (isOpened) {
  30935. closeMenu(index, indexPath);
  30936. } else {
  30937. openMenu(index, indexPath);
  30938. }
  30939. };
  30940. const handleMenuItemClick = (menuItem) => {
  30941. if (props.mode === "horizontal" || props.collapse) {
  30942. openedMenus.value = [];
  30943. }
  30944. const { index, indexPath } = menuItem;
  30945. if (index === void 0 || indexPath === void 0)
  30946. return;
  30947. if (props.router && router) {
  30948. const route = menuItem.route || index;
  30949. const routerResult = router.push(route).then((res) => {
  30950. if (!res)
  30951. activeIndex.value = index;
  30952. return res;
  30953. });
  30954. emit("select", index, indexPath, { index, indexPath, route }, routerResult);
  30955. } else {
  30956. activeIndex.value = index;
  30957. emit("select", index, indexPath, { index, indexPath });
  30958. }
  30959. };
  30960. const updateActiveIndex = (val) => {
  30961. const itemsInData = items.value;
  30962. const item = itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props.defaultActive];
  30963. if (item) {
  30964. activeIndex.value = item.index;
  30965. } else {
  30966. activeIndex.value = val;
  30967. }
  30968. };
  30969. const calcSliceIndex = () => {
  30970. var _a, _b;
  30971. if (!menu.value)
  30972. return -1;
  30973. const items2 = Array.from((_b = (_a = menu.value) == null ? void 0 : _a.childNodes) != null ? _b : []).filter((item) => item.nodeName !== "#text" || item.nodeValue);
  30974. const moreItemWidth = 64;
  30975. const paddingLeft = Number.parseInt(getComputedStyle(menu.value).paddingLeft, 10);
  30976. const paddingRight = Number.parseInt(getComputedStyle(menu.value).paddingRight, 10);
  30977. const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight;
  30978. let calcWidth = 0;
  30979. let sliceIndex2 = 0;
  30980. items2.forEach((item, index) => {
  30981. calcWidth += item.offsetWidth || 0;
  30982. if (calcWidth <= menuWidth - moreItemWidth) {
  30983. sliceIndex2 = index + 1;
  30984. }
  30985. });
  30986. return sliceIndex2 === items2.length ? -1 : sliceIndex2;
  30987. };
  30988. const debounce = (fn, wait = 33.34) => {
  30989. let timmer;
  30990. return () => {
  30991. timmer && clearTimeout(timmer);
  30992. timmer = setTimeout(() => {
  30993. fn();
  30994. }, wait);
  30995. };
  30996. };
  30997. let isFirstTimeRender = true;
  30998. const handleResize = () => {
  30999. const callback = () => {
  31000. sliceIndex.value = -1;
  31001. vue.nextTick(() => {
  31002. sliceIndex.value = calcSliceIndex();
  31003. });
  31004. };
  31005. isFirstTimeRender ? callback() : debounce(callback)();
  31006. isFirstTimeRender = false;
  31007. };
  31008. vue.watch(() => props.defaultActive, (currentActive) => {
  31009. if (!items.value[currentActive]) {
  31010. activeIndex.value = "";
  31011. }
  31012. updateActiveIndex(currentActive);
  31013. });
  31014. vue.watch(() => props.collapse, (value) => {
  31015. if (value)
  31016. openedMenus.value = [];
  31017. });
  31018. vue.watch(items.value, initMenu);
  31019. let resizeStopper;
  31020. vue.watchEffect(() => {
  31021. if (props.mode === "horizontal" && props.ellipsis)
  31022. resizeStopper = useResizeObserver(menu, handleResize).stop;
  31023. else
  31024. resizeStopper == null ? void 0 : resizeStopper();
  31025. });
  31026. {
  31027. const addSubMenu = (item) => {
  31028. subMenus.value[item.index] = item;
  31029. };
  31030. const removeSubMenu = (item) => {
  31031. delete subMenus.value[item.index];
  31032. };
  31033. const addMenuItem = (item) => {
  31034. items.value[item.index] = item;
  31035. };
  31036. const removeMenuItem = (item) => {
  31037. delete items.value[item.index];
  31038. };
  31039. vue.provide("rootMenu", vue.reactive({
  31040. props,
  31041. openedMenus,
  31042. items,
  31043. subMenus,
  31044. activeIndex,
  31045. isMenuPopup,
  31046. addMenuItem,
  31047. removeMenuItem,
  31048. addSubMenu,
  31049. removeSubMenu,
  31050. openMenu,
  31051. closeMenu,
  31052. handleMenuItemClick,
  31053. handleSubMenuClick
  31054. }));
  31055. vue.provide(`subMenu:${instance.uid}`, {
  31056. addSubMenu,
  31057. removeSubMenu,
  31058. mouseInChild: vue.ref(false),
  31059. level: 0
  31060. });
  31061. }
  31062. vue.onMounted(() => {
  31063. if (props.mode === "horizontal") {
  31064. new Menubar(instance.vnode.el, nsMenu.namespace.value);
  31065. }
  31066. });
  31067. {
  31068. const open = (index) => {
  31069. const { indexPath } = subMenus.value[index];
  31070. indexPath.forEach((i) => openMenu(i, indexPath));
  31071. };
  31072. expose({
  31073. open,
  31074. close: closeMenu,
  31075. handleResize
  31076. });
  31077. }
  31078. return () => {
  31079. var _a, _b;
  31080. let slot = (_b = (_a = slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : [];
  31081. const vShowMore = [];
  31082. if (props.mode === "horizontal" && menu.value) {
  31083. const originalSlot = flattedChildren(slot);
  31084. const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value);
  31085. const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value);
  31086. if ((slotMore == null ? void 0 : slotMore.length) && props.ellipsis) {
  31087. slot = slotDefault;
  31088. vShowMore.push(vue.h(SubMenu, {
  31089. index: "sub-menu-more",
  31090. class: nsSubMenu.e("hide-arrow")
  31091. }, {
  31092. title: () => vue.h(ElIcon, {
  31093. class: nsSubMenu.e("icon-more")
  31094. }, { default: () => vue.h(more_default) }),
  31095. default: () => slotMore
  31096. }));
  31097. }
  31098. }
  31099. const ulStyle = useMenuCssVar(props, 0);
  31100. const vMenu = vue.h("ul", {
  31101. key: String(props.collapse),
  31102. role: "menubar",
  31103. ref: menu,
  31104. style: ulStyle.value,
  31105. class: {
  31106. [nsMenu.b()]: true,
  31107. [nsMenu.m(props.mode)]: true,
  31108. [nsMenu.m("collapse")]: props.collapse
  31109. }
  31110. }, [...slot, ...vShowMore]);
  31111. if (props.collapseTransition && props.mode === "vertical") {
  31112. return vue.h(ElMenuCollapseTransition, () => vMenu);
  31113. }
  31114. return vMenu;
  31115. };
  31116. }
  31117. });
  31118. const menuItemProps = buildProps({
  31119. index: {
  31120. type: definePropType([String, null]),
  31121. default: null
  31122. },
  31123. route: {
  31124. type: definePropType([String, Object])
  31125. },
  31126. disabled: Boolean
  31127. });
  31128. const menuItemEmits = {
  31129. click: (item) => isString(item.index) && Array.isArray(item.indexPath)
  31130. };
  31131. const COMPONENT_NAME$b = "ElMenuItem";
  31132. const _sfc_main$V = vue.defineComponent({
  31133. name: COMPONENT_NAME$b,
  31134. components: {
  31135. ElTooltip
  31136. },
  31137. props: menuItemProps,
  31138. emits: menuItemEmits,
  31139. setup(props, { emit }) {
  31140. const instance = vue.getCurrentInstance();
  31141. const rootMenu = vue.inject("rootMenu");
  31142. const nsMenu = useNamespace("menu");
  31143. const nsMenuItem = useNamespace("menu-item");
  31144. if (!rootMenu)
  31145. throwError(COMPONENT_NAME$b, "can not inject root menu");
  31146. const { parentMenu, indexPath } = useMenu(instance, vue.toRef(props, "index"));
  31147. const subMenu = vue.inject(`subMenu:${parentMenu.value.uid}`);
  31148. if (!subMenu)
  31149. throwError(COMPONENT_NAME$b, "can not inject sub menu");
  31150. const active = vue.computed(() => props.index === rootMenu.activeIndex);
  31151. const item = vue.reactive({
  31152. index: props.index,
  31153. indexPath,
  31154. active
  31155. });
  31156. const handleClick = () => {
  31157. if (!props.disabled) {
  31158. rootMenu.handleMenuItemClick({
  31159. index: props.index,
  31160. indexPath: indexPath.value,
  31161. route: props.route
  31162. });
  31163. emit("click", item);
  31164. }
  31165. };
  31166. vue.onMounted(() => {
  31167. subMenu.addSubMenu(item);
  31168. rootMenu.addMenuItem(item);
  31169. });
  31170. vue.onBeforeUnmount(() => {
  31171. subMenu.removeSubMenu(item);
  31172. rootMenu.removeMenuItem(item);
  31173. });
  31174. return {
  31175. parentMenu,
  31176. rootMenu,
  31177. active,
  31178. nsMenu,
  31179. nsMenuItem,
  31180. handleClick
  31181. };
  31182. }
  31183. });
  31184. function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
  31185. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  31186. return vue.openBlock(), vue.createElementBlock("li", {
  31187. class: vue.normalizeClass([
  31188. _ctx.nsMenuItem.b(),
  31189. _ctx.nsMenuItem.is("active", _ctx.active),
  31190. _ctx.nsMenuItem.is("disabled", _ctx.disabled)
  31191. ]),
  31192. role: "menuitem",
  31193. tabindex: "-1",
  31194. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.handleClick && _ctx.handleClick(...args))
  31195. }, [
  31196. _ctx.parentMenu.type.name === "ElMenu" && _ctx.rootMenu.props.collapse && _ctx.$slots.title ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  31197. key: 0,
  31198. effect: _ctx.rootMenu.props.popperEffect,
  31199. placement: "right",
  31200. "fallback-placements": ["left"],
  31201. persistent: ""
  31202. }, {
  31203. content: vue.withCtx(() => [
  31204. vue.renderSlot(_ctx.$slots, "title")
  31205. ]),
  31206. default: vue.withCtx(() => [
  31207. vue.createElementVNode("div", {
  31208. class: vue.normalizeClass(_ctx.nsMenu.be("tooltip", "trigger"))
  31209. }, [
  31210. vue.renderSlot(_ctx.$slots, "default")
  31211. ], 2)
  31212. ]),
  31213. _: 3
  31214. }, 8, ["effect"])) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  31215. vue.renderSlot(_ctx.$slots, "default"),
  31216. vue.renderSlot(_ctx.$slots, "title")
  31217. ], 64))
  31218. ], 2);
  31219. }
  31220. var MenuItem = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["render", _sfc_render$d], ["__file", "menu-item.vue"]]);
  31221. const menuItemGroupProps = {
  31222. title: String
  31223. };
  31224. const COMPONENT_NAME$a = "ElMenuItemGroup";
  31225. const _sfc_main$U = vue.defineComponent({
  31226. name: COMPONENT_NAME$a,
  31227. props: menuItemGroupProps,
  31228. setup() {
  31229. const ns = useNamespace("menu-item-group");
  31230. return {
  31231. ns
  31232. };
  31233. }
  31234. });
  31235. function _sfc_render$c(_ctx, _cache, $props, $setup, $data, $options) {
  31236. return vue.openBlock(), vue.createElementBlock("li", {
  31237. class: vue.normalizeClass(_ctx.ns.b())
  31238. }, [
  31239. vue.createElementVNode("div", {
  31240. class: vue.normalizeClass(_ctx.ns.e("title"))
  31241. }, [
  31242. !_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  31243. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  31244. ], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
  31245. ], 2),
  31246. vue.createElementVNode("ul", null, [
  31247. vue.renderSlot(_ctx.$slots, "default")
  31248. ])
  31249. ], 2);
  31250. }
  31251. var MenuItemGroup = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["render", _sfc_render$c], ["__file", "menu-item-group.vue"]]);
  31252. const ElMenu = withInstall(Menu, {
  31253. MenuItem,
  31254. MenuItemGroup,
  31255. SubMenu
  31256. });
  31257. const ElMenuItem = withNoopInstall(MenuItem);
  31258. const ElMenuItemGroup = withNoopInstall(MenuItemGroup);
  31259. const ElSubMenu = withNoopInstall(SubMenu);
  31260. const pageHeaderProps = buildProps({
  31261. icon: {
  31262. type: iconPropType,
  31263. default: () => back_default
  31264. },
  31265. title: String,
  31266. content: {
  31267. type: String,
  31268. default: ""
  31269. }
  31270. });
  31271. const pageHeaderEmits = {
  31272. back: () => true
  31273. };
  31274. const _hoisted_1$q = ["aria-label"];
  31275. const __default__$F = vue.defineComponent({
  31276. name: "ElPageHeader"
  31277. });
  31278. const _sfc_main$T = /* @__PURE__ */ vue.defineComponent({
  31279. ...__default__$F,
  31280. props: pageHeaderProps,
  31281. emits: pageHeaderEmits,
  31282. setup(__props, { emit }) {
  31283. const slots = vue.useSlots();
  31284. const { t } = useLocale();
  31285. const ns = useNamespace("page-header");
  31286. const kls = vue.computed(() => {
  31287. return [
  31288. ns.b(),
  31289. {
  31290. [ns.m("has-breadcrumb")]: !!slots.breadcrumb,
  31291. [ns.m("has-extra")]: !!slots.extra,
  31292. [ns.is("contentful")]: !!slots.default
  31293. }
  31294. ];
  31295. });
  31296. function handleClick() {
  31297. emit("back");
  31298. }
  31299. return (_ctx, _cache) => {
  31300. return vue.openBlock(), vue.createElementBlock("div", {
  31301. class: vue.normalizeClass(vue.unref(kls))
  31302. }, [
  31303. _ctx.$slots.breadcrumb ? (vue.openBlock(), vue.createElementBlock("div", {
  31304. key: 0,
  31305. class: vue.normalizeClass(vue.unref(ns).e("breadcrumb"))
  31306. }, [
  31307. vue.renderSlot(_ctx.$slots, "breadcrumb")
  31308. ], 2)) : vue.createCommentVNode("v-if", true),
  31309. vue.createElementVNode("div", {
  31310. class: vue.normalizeClass(vue.unref(ns).e("header"))
  31311. }, [
  31312. vue.createElementVNode("div", {
  31313. class: vue.normalizeClass(vue.unref(ns).e("left"))
  31314. }, [
  31315. vue.createElementVNode("div", {
  31316. class: vue.normalizeClass(vue.unref(ns).e("back")),
  31317. role: "button",
  31318. tabindex: "0",
  31319. onClick: handleClick
  31320. }, [
  31321. _ctx.icon || _ctx.$slots.icon ? (vue.openBlock(), vue.createElementBlock("div", {
  31322. key: 0,
  31323. "aria-label": _ctx.title || vue.unref(t)("el.pageHeader.title"),
  31324. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  31325. }, [
  31326. vue.renderSlot(_ctx.$slots, "icon", {}, () => [
  31327. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 0 }, {
  31328. default: vue.withCtx(() => [
  31329. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  31330. ]),
  31331. _: 1
  31332. })) : vue.createCommentVNode("v-if", true)
  31333. ])
  31334. ], 10, _hoisted_1$q)) : vue.createCommentVNode("v-if", true),
  31335. vue.createElementVNode("div", {
  31336. class: vue.normalizeClass(vue.unref(ns).e("title"))
  31337. }, [
  31338. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  31339. vue.createTextVNode(vue.toDisplayString(_ctx.title || vue.unref(t)("el.pageHeader.title")), 1)
  31340. ])
  31341. ], 2)
  31342. ], 2),
  31343. vue.createVNode(vue.unref(ElDivider), { direction: "vertical" }),
  31344. vue.createElementVNode("div", {
  31345. class: vue.normalizeClass(vue.unref(ns).e("content"))
  31346. }, [
  31347. vue.renderSlot(_ctx.$slots, "content", {}, () => [
  31348. vue.createTextVNode(vue.toDisplayString(_ctx.content), 1)
  31349. ])
  31350. ], 2)
  31351. ], 2),
  31352. _ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", {
  31353. key: 0,
  31354. class: vue.normalizeClass(vue.unref(ns).e("extra"))
  31355. }, [
  31356. vue.renderSlot(_ctx.$slots, "extra")
  31357. ], 2)) : vue.createCommentVNode("v-if", true)
  31358. ], 2),
  31359. _ctx.$slots.default ? (vue.openBlock(), vue.createElementBlock("div", {
  31360. key: 1,
  31361. class: vue.normalizeClass(vue.unref(ns).e("main"))
  31362. }, [
  31363. vue.renderSlot(_ctx.$slots, "default")
  31364. ], 2)) : vue.createCommentVNode("v-if", true)
  31365. ], 2);
  31366. };
  31367. }
  31368. });
  31369. var PageHeader = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__file", "page-header.vue"]]);
  31370. const ElPageHeader = withInstall(PageHeader);
  31371. const paginationPrevProps = buildProps({
  31372. disabled: Boolean,
  31373. currentPage: {
  31374. type: Number,
  31375. default: 1
  31376. },
  31377. prevText: {
  31378. type: String
  31379. },
  31380. prevIcon: {
  31381. type: iconPropType
  31382. }
  31383. });
  31384. const paginationPrevEmits = {
  31385. click: (evt) => evt instanceof MouseEvent
  31386. };
  31387. const _hoisted_1$p = ["disabled", "aria-disabled"];
  31388. const _hoisted_2$h = { key: 0 };
  31389. const __default__$E = vue.defineComponent({
  31390. name: "ElPaginationPrev"
  31391. });
  31392. const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
  31393. ...__default__$E,
  31394. props: paginationPrevProps,
  31395. emits: paginationPrevEmits,
  31396. setup(__props) {
  31397. const props = __props;
  31398. const internalDisabled = vue.computed(() => props.disabled || props.currentPage <= 1);
  31399. return (_ctx, _cache) => {
  31400. return vue.openBlock(), vue.createElementBlock("button", {
  31401. type: "button",
  31402. class: "btn-prev",
  31403. disabled: vue.unref(internalDisabled),
  31404. "aria-disabled": vue.unref(internalDisabled),
  31405. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  31406. }, [
  31407. _ctx.prevText ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$h, vue.toDisplayString(_ctx.prevText), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 1 }, {
  31408. default: vue.withCtx(() => [
  31409. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prevIcon)))
  31410. ]),
  31411. _: 1
  31412. }))
  31413. ], 8, _hoisted_1$p);
  31414. };
  31415. }
  31416. });
  31417. var Prev = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__file", "prev.vue"]]);
  31418. const paginationNextProps = buildProps({
  31419. disabled: Boolean,
  31420. currentPage: {
  31421. type: Number,
  31422. default: 1
  31423. },
  31424. pageCount: {
  31425. type: Number,
  31426. default: 50
  31427. },
  31428. nextText: {
  31429. type: String
  31430. },
  31431. nextIcon: {
  31432. type: iconPropType
  31433. }
  31434. });
  31435. const _hoisted_1$o = ["disabled", "aria-disabled"];
  31436. const _hoisted_2$g = { key: 0 };
  31437. const __default__$D = vue.defineComponent({
  31438. name: "ElPaginationNext"
  31439. });
  31440. const _sfc_main$R = /* @__PURE__ */ vue.defineComponent({
  31441. ...__default__$D,
  31442. props: paginationNextProps,
  31443. emits: ["click"],
  31444. setup(__props) {
  31445. const props = __props;
  31446. const internalDisabled = vue.computed(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
  31447. return (_ctx, _cache) => {
  31448. return vue.openBlock(), vue.createElementBlock("button", {
  31449. type: "button",
  31450. class: "btn-next",
  31451. disabled: vue.unref(internalDisabled),
  31452. "aria-disabled": vue.unref(internalDisabled),
  31453. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  31454. }, [
  31455. _ctx.nextText ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$g, vue.toDisplayString(_ctx.nextText), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 1 }, {
  31456. default: vue.withCtx(() => [
  31457. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.nextIcon)))
  31458. ]),
  31459. _: 1
  31460. }))
  31461. ], 8, _hoisted_1$o);
  31462. };
  31463. }
  31464. });
  31465. var Next = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__file", "next.vue"]]);
  31466. const selectGroupKey = "ElSelectGroup";
  31467. const selectKey = "ElSelect";
  31468. function useOption$1(props, states) {
  31469. const select = vue.inject(selectKey);
  31470. const selectGroup = vue.inject(selectGroupKey, { disabled: false });
  31471. const isObject = vue.computed(() => {
  31472. return Object.prototype.toString.call(props.value).toLowerCase() === "[object object]";
  31473. });
  31474. const itemSelected = vue.computed(() => {
  31475. if (!select.props.multiple) {
  31476. return isEqual(props.value, select.props.modelValue);
  31477. } else {
  31478. return contains(select.props.modelValue, props.value);
  31479. }
  31480. });
  31481. const limitReached = vue.computed(() => {
  31482. if (select.props.multiple) {
  31483. const modelValue = select.props.modelValue || [];
  31484. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  31485. } else {
  31486. return false;
  31487. }
  31488. });
  31489. const currentLabel = vue.computed(() => {
  31490. return props.label || (isObject.value ? "" : props.value);
  31491. });
  31492. const currentValue = vue.computed(() => {
  31493. return props.value || props.label || "";
  31494. });
  31495. const isDisabled = vue.computed(() => {
  31496. return props.disabled || states.groupDisabled || limitReached.value;
  31497. });
  31498. const instance = vue.getCurrentInstance();
  31499. const contains = (arr = [], target) => {
  31500. if (!isObject.value) {
  31501. return arr && arr.includes(target);
  31502. } else {
  31503. const valueKey = select.props.valueKey;
  31504. return arr && arr.some((item) => {
  31505. return vue.toRaw(get(item, valueKey)) === get(target, valueKey);
  31506. });
  31507. }
  31508. };
  31509. const isEqual = (a, b) => {
  31510. if (!isObject.value) {
  31511. return a === b;
  31512. } else {
  31513. const { valueKey } = select.props;
  31514. return get(a, valueKey) === get(b, valueKey);
  31515. }
  31516. };
  31517. const hoverItem = () => {
  31518. if (!props.disabled && !selectGroup.disabled) {
  31519. select.hoverIndex = select.optionsArray.indexOf(instance.proxy);
  31520. }
  31521. };
  31522. vue.watch(() => currentLabel.value, () => {
  31523. if (!props.created && !select.props.remote)
  31524. select.setSelected();
  31525. });
  31526. vue.watch(() => props.value, (val, oldVal) => {
  31527. const { remote, valueKey } = select.props;
  31528. if (!Object.is(val, oldVal)) {
  31529. select.onOptionDestroy(oldVal, instance.proxy);
  31530. select.onOptionCreate(instance.proxy);
  31531. }
  31532. if (!props.created && !remote) {
  31533. if (valueKey && typeof val === "object" && typeof oldVal === "object" && val[valueKey] === oldVal[valueKey]) {
  31534. return;
  31535. }
  31536. select.setSelected();
  31537. }
  31538. });
  31539. vue.watch(() => selectGroup.disabled, () => {
  31540. states.groupDisabled = selectGroup.disabled;
  31541. }, { immediate: true });
  31542. const { queryChange } = vue.toRaw(select);
  31543. vue.watch(queryChange, (changes) => {
  31544. const { query } = vue.unref(changes);
  31545. const regexp = new RegExp(escapeStringRegexp(query), "i");
  31546. states.visible = regexp.test(currentLabel.value) || props.created;
  31547. if (!states.visible) {
  31548. select.filteredOptionsCount--;
  31549. }
  31550. });
  31551. return {
  31552. select,
  31553. currentLabel,
  31554. currentValue,
  31555. itemSelected,
  31556. isDisabled,
  31557. hoverItem
  31558. };
  31559. }
  31560. const _sfc_main$Q = vue.defineComponent({
  31561. name: "ElOption",
  31562. componentName: "ElOption",
  31563. props: {
  31564. value: {
  31565. required: true,
  31566. type: [String, Number, Boolean, Object]
  31567. },
  31568. label: [String, Number],
  31569. created: Boolean,
  31570. disabled: {
  31571. type: Boolean,
  31572. default: false
  31573. }
  31574. },
  31575. setup(props) {
  31576. const ns = useNamespace("select");
  31577. const states = vue.reactive({
  31578. index: -1,
  31579. groupDisabled: false,
  31580. visible: true,
  31581. hitState: false,
  31582. hover: false
  31583. });
  31584. const { currentLabel, itemSelected, isDisabled, select, hoverItem } = useOption$1(props, states);
  31585. const { visible, hover } = vue.toRefs(states);
  31586. const vm = vue.getCurrentInstance().proxy;
  31587. select.onOptionCreate(vm);
  31588. vue.onBeforeUnmount(() => {
  31589. const key = vm.value;
  31590. const { selected } = select;
  31591. const selectedOptions = select.props.multiple ? selected : [selected];
  31592. const doesSelected = selectedOptions.some((item) => {
  31593. return item.value === vm.value;
  31594. });
  31595. vue.nextTick(() => {
  31596. if (select.cachedOptions.get(key) === vm && !doesSelected) {
  31597. select.cachedOptions.delete(key);
  31598. }
  31599. });
  31600. select.onOptionDestroy(key, vm);
  31601. });
  31602. function selectOptionClick() {
  31603. if (props.disabled !== true && states.groupDisabled !== true) {
  31604. select.handleOptionSelect(vm, true);
  31605. }
  31606. }
  31607. return {
  31608. ns,
  31609. currentLabel,
  31610. itemSelected,
  31611. isDisabled,
  31612. select,
  31613. hoverItem,
  31614. visible,
  31615. hover,
  31616. selectOptionClick,
  31617. states
  31618. };
  31619. }
  31620. });
  31621. function _sfc_render$b(_ctx, _cache, $props, $setup, $data, $options) {
  31622. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("li", {
  31623. class: vue.normalizeClass([
  31624. _ctx.ns.be("dropdown", "item"),
  31625. _ctx.ns.is("disabled", _ctx.isDisabled),
  31626. {
  31627. selected: _ctx.itemSelected,
  31628. hover: _ctx.hover
  31629. }
  31630. ]),
  31631. onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  31632. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  31633. }, [
  31634. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  31635. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.currentLabel), 1)
  31636. ])
  31637. ], 34)), [
  31638. [vue.vShow, _ctx.visible]
  31639. ]);
  31640. }
  31641. var Option = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["render", _sfc_render$b], ["__file", "option.vue"]]);
  31642. const _sfc_main$P = vue.defineComponent({
  31643. name: "ElSelectDropdown",
  31644. componentName: "ElSelectDropdown",
  31645. setup() {
  31646. const select = vue.inject(selectKey);
  31647. const ns = useNamespace("select");
  31648. const popperClass = vue.computed(() => select.props.popperClass);
  31649. const isMultiple = vue.computed(() => select.props.multiple);
  31650. const isFitInputWidth = vue.computed(() => select.props.fitInputWidth);
  31651. const minWidth = vue.ref("");
  31652. function updateMinWidth() {
  31653. var _a;
  31654. minWidth.value = `${(_a = select.selectWrapper) == null ? void 0 : _a.offsetWidth}px`;
  31655. }
  31656. vue.onMounted(() => {
  31657. updateMinWidth();
  31658. useResizeObserver(select.selectWrapper, updateMinWidth);
  31659. });
  31660. return {
  31661. ns,
  31662. minWidth,
  31663. popperClass,
  31664. isMultiple,
  31665. isFitInputWidth
  31666. };
  31667. }
  31668. });
  31669. function _sfc_render$a(_ctx, _cache, $props, $setup, $data, $options) {
  31670. return vue.openBlock(), vue.createElementBlock("div", {
  31671. class: vue.normalizeClass([_ctx.ns.b("dropdown"), _ctx.ns.is("multiple", _ctx.isMultiple), _ctx.popperClass]),
  31672. style: vue.normalizeStyle({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  31673. }, [
  31674. vue.renderSlot(_ctx.$slots, "default")
  31675. ], 6);
  31676. }
  31677. var ElSelectMenu$1 = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$a], ["__file", "select-dropdown.vue"]]);
  31678. function useSelectStates(props) {
  31679. const { t } = useLocale();
  31680. return vue.reactive({
  31681. options: /* @__PURE__ */ new Map(),
  31682. cachedOptions: /* @__PURE__ */ new Map(),
  31683. createdLabel: null,
  31684. createdSelected: false,
  31685. selected: props.multiple ? [] : {},
  31686. inputLength: 20,
  31687. inputWidth: 0,
  31688. optionsCount: 0,
  31689. filteredOptionsCount: 0,
  31690. visible: false,
  31691. softFocus: false,
  31692. selectedLabel: "",
  31693. hoverIndex: -1,
  31694. query: "",
  31695. previousQuery: null,
  31696. inputHovering: false,
  31697. cachedPlaceHolder: "",
  31698. currentPlaceholder: t("el.select.placeholder"),
  31699. menuVisibleOnFocus: false,
  31700. isOnComposition: false,
  31701. isSilentBlur: false,
  31702. prefixWidth: 11,
  31703. tagInMultiLine: false,
  31704. mouseEnter: false
  31705. });
  31706. }
  31707. const useSelect$3 = (props, states, ctx) => {
  31708. const { t } = useLocale();
  31709. const ns = useNamespace("select");
  31710. useDeprecated({
  31711. from: "suffixTransition",
  31712. replacement: "override style scheme",
  31713. version: "2.3.0",
  31714. scope: "props",
  31715. ref: "https://element-plus.org/en-US/component/select.html#select-attributes"
  31716. }, vue.computed(() => props.suffixTransition === false));
  31717. const reference = vue.ref(null);
  31718. const input = vue.ref(null);
  31719. const tooltipRef = vue.ref(null);
  31720. const tags = vue.ref(null);
  31721. const selectWrapper = vue.ref(null);
  31722. const scrollbar = vue.ref(null);
  31723. const hoverOption = vue.ref(-1);
  31724. const queryChange = vue.shallowRef({ query: "" });
  31725. const groupQueryChange = vue.shallowRef("");
  31726. const { form, formItem } = useFormItem();
  31727. const readonly = vue.computed(() => !props.filterable || props.multiple || !states.visible);
  31728. const selectDisabled = vue.computed(() => props.disabled || (form == null ? void 0 : form.disabled));
  31729. const showClose = vue.computed(() => {
  31730. const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : props.modelValue !== void 0 && props.modelValue !== null && props.modelValue !== "";
  31731. const criteria = props.clearable && !selectDisabled.value && states.inputHovering && hasValue;
  31732. return criteria;
  31733. });
  31734. const iconComponent = vue.computed(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  31735. const iconReverse = vue.computed(() => ns.is("reverse", iconComponent.value && states.visible && props.suffixTransition));
  31736. const debounce$1 = vue.computed(() => props.remote ? 300 : 0);
  31737. const emptyText = vue.computed(() => {
  31738. if (props.loading) {
  31739. return props.loadingText || t("el.select.loading");
  31740. } else {
  31741. if (props.remote && states.query === "" && states.options.size === 0)
  31742. return false;
  31743. if (props.filterable && states.query && states.options.size > 0 && states.filteredOptionsCount === 0) {
  31744. return props.noMatchText || t("el.select.noMatch");
  31745. }
  31746. if (states.options.size === 0) {
  31747. return props.noDataText || t("el.select.noData");
  31748. }
  31749. }
  31750. return null;
  31751. });
  31752. const optionsArray = vue.computed(() => Array.from(states.options.values()));
  31753. const cachedOptionsArray = vue.computed(() => Array.from(states.cachedOptions.values()));
  31754. const showNewOption = vue.computed(() => {
  31755. const hasExistingOption = optionsArray.value.filter((option) => {
  31756. return !option.created;
  31757. }).some((option) => {
  31758. return option.currentLabel === states.query;
  31759. });
  31760. return props.filterable && props.allowCreate && states.query !== "" && !hasExistingOption;
  31761. });
  31762. const selectSize = useSize();
  31763. const collapseTagSize = vue.computed(() => ["small"].includes(selectSize.value) ? "small" : "default");
  31764. const dropMenuVisible = vue.computed({
  31765. get() {
  31766. return states.visible && emptyText.value !== false;
  31767. },
  31768. set(val) {
  31769. states.visible = val;
  31770. }
  31771. });
  31772. vue.watch([() => selectDisabled.value, () => selectSize.value, () => form == null ? void 0 : form.size], () => {
  31773. vue.nextTick(() => {
  31774. resetInputHeight();
  31775. });
  31776. });
  31777. vue.watch(() => props.placeholder, (val) => {
  31778. states.cachedPlaceHolder = states.currentPlaceholder = val;
  31779. });
  31780. vue.watch(() => props.modelValue, (val, oldVal) => {
  31781. if (props.multiple) {
  31782. resetInputHeight();
  31783. if (val && val.length > 0 || input.value && states.query !== "") {
  31784. states.currentPlaceholder = "";
  31785. } else {
  31786. states.currentPlaceholder = states.cachedPlaceHolder;
  31787. }
  31788. if (props.filterable && !props.reserveKeyword) {
  31789. states.query = "";
  31790. handleQueryChange(states.query);
  31791. }
  31792. }
  31793. setSelected();
  31794. if (props.filterable && !props.multiple) {
  31795. states.inputLength = 20;
  31796. }
  31797. if (!isEqual$1(val, oldVal) && props.validateEvent) {
  31798. formItem == null ? void 0 : formItem.validate("change").catch((err) => debugWarn());
  31799. }
  31800. }, {
  31801. flush: "post",
  31802. deep: true
  31803. });
  31804. vue.watch(() => states.visible, (val) => {
  31805. var _a, _b, _c;
  31806. if (!val) {
  31807. if (props.filterable) {
  31808. if (isFunction(props.filterMethod)) {
  31809. props.filterMethod("");
  31810. }
  31811. if (isFunction(props.remoteMethod)) {
  31812. props.remoteMethod("");
  31813. }
  31814. }
  31815. input.value && input.value.blur();
  31816. states.query = "";
  31817. states.previousQuery = null;
  31818. states.selectedLabel = "";
  31819. states.inputLength = 20;
  31820. states.menuVisibleOnFocus = false;
  31821. resetHoverIndex();
  31822. vue.nextTick(() => {
  31823. if (input.value && input.value.value === "" && states.selected.length === 0) {
  31824. states.currentPlaceholder = states.cachedPlaceHolder;
  31825. }
  31826. });
  31827. if (!props.multiple) {
  31828. if (states.selected) {
  31829. if (props.filterable && props.allowCreate && states.createdSelected && states.createdLabel) {
  31830. states.selectedLabel = states.createdLabel;
  31831. } else {
  31832. states.selectedLabel = states.selected.currentLabel;
  31833. }
  31834. if (props.filterable)
  31835. states.query = states.selectedLabel;
  31836. }
  31837. if (props.filterable) {
  31838. states.currentPlaceholder = states.cachedPlaceHolder;
  31839. }
  31840. }
  31841. } else {
  31842. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  31843. if (props.filterable) {
  31844. states.filteredOptionsCount = states.optionsCount;
  31845. states.query = props.remote ? "" : states.selectedLabel;
  31846. if (props.multiple) {
  31847. (_c = input.value) == null ? void 0 : _c.focus();
  31848. } else {
  31849. if (states.selectedLabel) {
  31850. states.currentPlaceholder = `${states.selectedLabel}`;
  31851. states.selectedLabel = "";
  31852. }
  31853. }
  31854. handleQueryChange(states.query);
  31855. if (!props.multiple && !props.remote) {
  31856. queryChange.value.query = "";
  31857. vue.triggerRef(queryChange);
  31858. vue.triggerRef(groupQueryChange);
  31859. }
  31860. }
  31861. }
  31862. ctx.emit("visible-change", val);
  31863. });
  31864. vue.watch(() => states.options.entries(), () => {
  31865. var _a, _b, _c;
  31866. if (!isClient)
  31867. return;
  31868. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  31869. if (props.multiple) {
  31870. resetInputHeight();
  31871. }
  31872. const inputs = ((_c = selectWrapper.value) == null ? void 0 : _c.querySelectorAll("input")) || [];
  31873. if (!Array.from(inputs).includes(document.activeElement)) {
  31874. setSelected();
  31875. }
  31876. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  31877. checkDefaultFirstOption();
  31878. }
  31879. }, {
  31880. flush: "post"
  31881. });
  31882. vue.watch(() => states.hoverIndex, (val) => {
  31883. if (isNumber(val) && val > -1) {
  31884. hoverOption.value = optionsArray.value[val] || {};
  31885. } else {
  31886. hoverOption.value = {};
  31887. }
  31888. optionsArray.value.forEach((option) => {
  31889. option.hover = hoverOption.value === option;
  31890. });
  31891. });
  31892. const resetInputHeight = () => {
  31893. if (props.collapseTags && !props.filterable)
  31894. return;
  31895. vue.nextTick(() => {
  31896. var _a, _b;
  31897. if (!reference.value)
  31898. return;
  31899. const input2 = reference.value.$el.querySelector("input");
  31900. const _tags = tags.value;
  31901. const sizeInMap = getComponentSize(selectSize.value || (form == null ? void 0 : form.size));
  31902. input2.style.height = `${(states.selected.length === 0 ? sizeInMap : Math.max(_tags ? _tags.clientHeight + (_tags.clientHeight > sizeInMap ? 6 : 0) : 0, sizeInMap)) - 2}px`;
  31903. states.tagInMultiLine = Number.parseFloat(input2.style.height) >= sizeInMap;
  31904. if (states.visible && emptyText.value !== false) {
  31905. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  31906. }
  31907. });
  31908. };
  31909. const handleQueryChange = async (val) => {
  31910. if (states.previousQuery === val || states.isOnComposition)
  31911. return;
  31912. if (states.previousQuery === null && (isFunction(props.filterMethod) || isFunction(props.remoteMethod))) {
  31913. states.previousQuery = val;
  31914. return;
  31915. }
  31916. states.previousQuery = val;
  31917. vue.nextTick(() => {
  31918. var _a, _b;
  31919. if (states.visible)
  31920. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  31921. });
  31922. states.hoverIndex = -1;
  31923. if (props.multiple && props.filterable) {
  31924. vue.nextTick(() => {
  31925. const length = input.value.value.length * 15 + 20;
  31926. states.inputLength = props.collapseTags ? Math.min(50, length) : length;
  31927. managePlaceholder();
  31928. resetInputHeight();
  31929. });
  31930. }
  31931. if (props.remote && isFunction(props.remoteMethod)) {
  31932. states.hoverIndex = -1;
  31933. props.remoteMethod(val);
  31934. } else if (isFunction(props.filterMethod)) {
  31935. props.filterMethod(val);
  31936. vue.triggerRef(groupQueryChange);
  31937. } else {
  31938. states.filteredOptionsCount = states.optionsCount;
  31939. queryChange.value.query = val;
  31940. vue.triggerRef(queryChange);
  31941. vue.triggerRef(groupQueryChange);
  31942. }
  31943. if (props.defaultFirstOption && (props.filterable || props.remote) && states.filteredOptionsCount) {
  31944. await vue.nextTick();
  31945. checkDefaultFirstOption();
  31946. }
  31947. };
  31948. const managePlaceholder = () => {
  31949. if (states.currentPlaceholder !== "") {
  31950. states.currentPlaceholder = input.value.value ? "" : states.cachedPlaceHolder;
  31951. }
  31952. };
  31953. const checkDefaultFirstOption = () => {
  31954. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  31955. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  31956. const firstOriginOption = optionsInDropdown[0];
  31957. states.hoverIndex = getValueIndex(optionsArray.value, userCreatedOption || firstOriginOption);
  31958. };
  31959. const setSelected = () => {
  31960. var _a;
  31961. if (!props.multiple) {
  31962. const option = getOption(props.modelValue);
  31963. if ((_a = option.props) == null ? void 0 : _a.created) {
  31964. states.createdLabel = option.props.value;
  31965. states.createdSelected = true;
  31966. } else {
  31967. states.createdSelected = false;
  31968. }
  31969. states.selectedLabel = option.currentLabel;
  31970. states.selected = option;
  31971. if (props.filterable)
  31972. states.query = states.selectedLabel;
  31973. return;
  31974. } else {
  31975. states.selectedLabel = "";
  31976. }
  31977. const result = [];
  31978. if (Array.isArray(props.modelValue)) {
  31979. props.modelValue.forEach((value) => {
  31980. result.push(getOption(value));
  31981. });
  31982. }
  31983. states.selected = result;
  31984. vue.nextTick(() => {
  31985. resetInputHeight();
  31986. });
  31987. };
  31988. const getOption = (value) => {
  31989. let option;
  31990. const isObjectValue = toRawType(value).toLowerCase() === "object";
  31991. const isNull = toRawType(value).toLowerCase() === "null";
  31992. const isUndefined = toRawType(value).toLowerCase() === "undefined";
  31993. for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
  31994. const cachedOption = cachedOptionsArray.value[i];
  31995. const isEqualValue = isObjectValue ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey) : cachedOption.value === value;
  31996. if (isEqualValue) {
  31997. option = {
  31998. value,
  31999. currentLabel: cachedOption.currentLabel,
  32000. isDisabled: cachedOption.isDisabled
  32001. };
  32002. break;
  32003. }
  32004. }
  32005. if (option)
  32006. return option;
  32007. const label = isObjectValue ? value.label : !isNull && !isUndefined ? value : "";
  32008. const newOption = {
  32009. value,
  32010. currentLabel: label
  32011. };
  32012. if (props.multiple) {
  32013. newOption.hitState = false;
  32014. }
  32015. return newOption;
  32016. };
  32017. const resetHoverIndex = () => {
  32018. setTimeout(() => {
  32019. const valueKey = props.valueKey;
  32020. if (!props.multiple) {
  32021. states.hoverIndex = optionsArray.value.findIndex((item) => {
  32022. return getValueKey(item) === getValueKey(states.selected);
  32023. });
  32024. } else {
  32025. if (states.selected.length > 0) {
  32026. states.hoverIndex = Math.min.apply(null, states.selected.map((selected) => {
  32027. return optionsArray.value.findIndex((item) => {
  32028. return get(item, valueKey) === get(selected, valueKey);
  32029. });
  32030. }));
  32031. } else {
  32032. states.hoverIndex = -1;
  32033. }
  32034. }
  32035. }, 300);
  32036. };
  32037. const handleResize = () => {
  32038. var _a, _b;
  32039. resetInputWidth();
  32040. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  32041. if (props.multiple && !props.filterable)
  32042. resetInputHeight();
  32043. };
  32044. const resetInputWidth = () => {
  32045. var _a;
  32046. states.inputWidth = (_a = reference.value) == null ? void 0 : _a.$el.getBoundingClientRect().width;
  32047. };
  32048. const onInputChange = () => {
  32049. if (props.filterable && states.query !== states.selectedLabel) {
  32050. states.query = states.selectedLabel;
  32051. handleQueryChange(states.query);
  32052. }
  32053. };
  32054. const debouncedOnInputChange = debounce(() => {
  32055. onInputChange();
  32056. }, debounce$1.value);
  32057. const debouncedQueryChange = debounce((e) => {
  32058. handleQueryChange(e.target.value);
  32059. }, debounce$1.value);
  32060. const emitChange = (val) => {
  32061. if (!isEqual$1(props.modelValue, val)) {
  32062. ctx.emit(CHANGE_EVENT, val);
  32063. }
  32064. };
  32065. const deletePrevTag = (e) => {
  32066. if (e.target.value.length <= 0 && !toggleLastOptionHitState()) {
  32067. const value = props.modelValue.slice();
  32068. value.pop();
  32069. ctx.emit(UPDATE_MODEL_EVENT, value);
  32070. emitChange(value);
  32071. }
  32072. if (e.target.value.length === 1 && props.modelValue.length === 0) {
  32073. states.currentPlaceholder = states.cachedPlaceHolder;
  32074. }
  32075. };
  32076. const deleteTag = (event, tag) => {
  32077. const index = states.selected.indexOf(tag);
  32078. if (index > -1 && !selectDisabled.value) {
  32079. const value = props.modelValue.slice();
  32080. value.splice(index, 1);
  32081. ctx.emit(UPDATE_MODEL_EVENT, value);
  32082. emitChange(value);
  32083. ctx.emit("remove-tag", tag.value);
  32084. }
  32085. event.stopPropagation();
  32086. };
  32087. const deleteSelected = (event) => {
  32088. event.stopPropagation();
  32089. const value = props.multiple ? [] : "";
  32090. if (!isString(value)) {
  32091. for (const item of states.selected) {
  32092. if (item.isDisabled)
  32093. value.push(item.value);
  32094. }
  32095. }
  32096. ctx.emit(UPDATE_MODEL_EVENT, value);
  32097. emitChange(value);
  32098. states.hoverIndex = -1;
  32099. states.visible = false;
  32100. ctx.emit("clear");
  32101. };
  32102. const handleOptionSelect = (option, byClick) => {
  32103. var _a;
  32104. if (props.multiple) {
  32105. const value = (props.modelValue || []).slice();
  32106. const optionIndex = getValueIndex(value, option.value);
  32107. if (optionIndex > -1) {
  32108. value.splice(optionIndex, 1);
  32109. } else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) {
  32110. value.push(option.value);
  32111. }
  32112. ctx.emit(UPDATE_MODEL_EVENT, value);
  32113. emitChange(value);
  32114. if (option.created) {
  32115. states.query = "";
  32116. handleQueryChange("");
  32117. states.inputLength = 20;
  32118. }
  32119. if (props.filterable)
  32120. (_a = input.value) == null ? void 0 : _a.focus();
  32121. } else {
  32122. ctx.emit(UPDATE_MODEL_EVENT, option.value);
  32123. emitChange(option.value);
  32124. states.visible = false;
  32125. }
  32126. states.isSilentBlur = byClick;
  32127. setSoftFocus();
  32128. if (states.visible)
  32129. return;
  32130. vue.nextTick(() => {
  32131. scrollToOption(option);
  32132. });
  32133. };
  32134. const getValueIndex = (arr = [], value) => {
  32135. if (!isObject$1(value))
  32136. return arr.indexOf(value);
  32137. const valueKey = props.valueKey;
  32138. let index = -1;
  32139. arr.some((item, i) => {
  32140. if (vue.toRaw(get(item, valueKey)) === get(value, valueKey)) {
  32141. index = i;
  32142. return true;
  32143. }
  32144. return false;
  32145. });
  32146. return index;
  32147. };
  32148. const setSoftFocus = () => {
  32149. states.softFocus = true;
  32150. const _input = input.value || reference.value;
  32151. if (_input) {
  32152. _input == null ? void 0 : _input.focus();
  32153. }
  32154. };
  32155. const scrollToOption = (option) => {
  32156. var _a, _b, _c, _d, _e;
  32157. const targetOption = Array.isArray(option) ? option[0] : option;
  32158. let target = null;
  32159. if (targetOption == null ? void 0 : targetOption.value) {
  32160. const options = optionsArray.value.filter((item) => item.value === targetOption.value);
  32161. if (options.length > 0) {
  32162. target = options[0].$el;
  32163. }
  32164. }
  32165. if (tooltipRef.value && target) {
  32166. const menu = (_d = (_c = (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef) == null ? void 0 : _c.querySelector) == null ? void 0 : _d.call(_c, `.${ns.be("dropdown", "wrap")}`);
  32167. if (menu) {
  32168. scrollIntoView(menu, target);
  32169. }
  32170. }
  32171. (_e = scrollbar.value) == null ? void 0 : _e.handleScroll();
  32172. };
  32173. const onOptionCreate = (vm) => {
  32174. states.optionsCount++;
  32175. states.filteredOptionsCount++;
  32176. states.options.set(vm.value, vm);
  32177. states.cachedOptions.set(vm.value, vm);
  32178. };
  32179. const onOptionDestroy = (key, vm) => {
  32180. if (states.options.get(key) === vm) {
  32181. states.optionsCount--;
  32182. states.filteredOptionsCount--;
  32183. states.options.delete(key);
  32184. }
  32185. };
  32186. const resetInputState = (e) => {
  32187. if (e.code !== EVENT_CODE.backspace)
  32188. toggleLastOptionHitState(false);
  32189. states.inputLength = input.value.value.length * 15 + 20;
  32190. resetInputHeight();
  32191. };
  32192. const toggleLastOptionHitState = (hit) => {
  32193. if (!Array.isArray(states.selected))
  32194. return;
  32195. const option = states.selected[states.selected.length - 1];
  32196. if (!option)
  32197. return;
  32198. if (hit === true || hit === false) {
  32199. option.hitState = hit;
  32200. return hit;
  32201. }
  32202. option.hitState = !option.hitState;
  32203. return option.hitState;
  32204. };
  32205. const handleComposition = (event) => {
  32206. const text = event.target.value;
  32207. if (event.type === "compositionend") {
  32208. states.isOnComposition = false;
  32209. vue.nextTick(() => handleQueryChange(text));
  32210. } else {
  32211. const lastCharacter = text[text.length - 1] || "";
  32212. states.isOnComposition = !isKorean(lastCharacter);
  32213. }
  32214. };
  32215. const handleMenuEnter = () => {
  32216. vue.nextTick(() => scrollToOption(states.selected));
  32217. };
  32218. const handleFocus = (event) => {
  32219. if (!states.softFocus) {
  32220. if (props.automaticDropdown || props.filterable) {
  32221. if (props.filterable && !states.visible) {
  32222. states.menuVisibleOnFocus = true;
  32223. }
  32224. states.visible = true;
  32225. }
  32226. ctx.emit("focus", event);
  32227. } else {
  32228. states.softFocus = false;
  32229. }
  32230. };
  32231. const blur = () => {
  32232. var _a;
  32233. states.visible = false;
  32234. (_a = reference.value) == null ? void 0 : _a.blur();
  32235. };
  32236. const handleBlur = (event) => {
  32237. vue.nextTick(() => {
  32238. if (states.isSilentBlur) {
  32239. states.isSilentBlur = false;
  32240. } else {
  32241. ctx.emit("blur", event);
  32242. }
  32243. });
  32244. states.softFocus = false;
  32245. };
  32246. const handleClearClick = (event) => {
  32247. deleteSelected(event);
  32248. };
  32249. const handleClose = () => {
  32250. states.visible = false;
  32251. };
  32252. const handleKeydownEscape = (event) => {
  32253. if (states.visible) {
  32254. event.preventDefault();
  32255. event.stopPropagation();
  32256. states.visible = false;
  32257. }
  32258. };
  32259. const toggleMenu = (e) => {
  32260. var _a;
  32261. if (e && !states.mouseEnter) {
  32262. return;
  32263. }
  32264. if (!selectDisabled.value) {
  32265. if (states.menuVisibleOnFocus) {
  32266. states.menuVisibleOnFocus = false;
  32267. } else {
  32268. if (!tooltipRef.value || !tooltipRef.value.isFocusInsideContent()) {
  32269. states.visible = !states.visible;
  32270. }
  32271. }
  32272. if (states.visible) {
  32273. (_a = input.value || reference.value) == null ? void 0 : _a.focus();
  32274. }
  32275. }
  32276. };
  32277. const selectOption = () => {
  32278. if (!states.visible) {
  32279. toggleMenu();
  32280. } else {
  32281. if (optionsArray.value[states.hoverIndex]) {
  32282. handleOptionSelect(optionsArray.value[states.hoverIndex], void 0);
  32283. }
  32284. }
  32285. };
  32286. const getValueKey = (item) => {
  32287. return isObject$1(item.value) ? get(item.value, props.valueKey) : item.value;
  32288. };
  32289. const optionsAllDisabled = vue.computed(() => optionsArray.value.filter((option) => option.visible).every((option) => option.disabled));
  32290. const navigateOptions = (direction) => {
  32291. if (!states.visible) {
  32292. states.visible = true;
  32293. return;
  32294. }
  32295. if (states.options.size === 0 || states.filteredOptionsCount === 0)
  32296. return;
  32297. if (states.isOnComposition)
  32298. return;
  32299. if (!optionsAllDisabled.value) {
  32300. if (direction === "next") {
  32301. states.hoverIndex++;
  32302. if (states.hoverIndex === states.options.size) {
  32303. states.hoverIndex = 0;
  32304. }
  32305. } else if (direction === "prev") {
  32306. states.hoverIndex--;
  32307. if (states.hoverIndex < 0) {
  32308. states.hoverIndex = states.options.size - 1;
  32309. }
  32310. }
  32311. const option = optionsArray.value[states.hoverIndex];
  32312. if (option.disabled === true || option.states.groupDisabled === true || !option.visible) {
  32313. navigateOptions(direction);
  32314. }
  32315. vue.nextTick(() => scrollToOption(hoverOption.value));
  32316. }
  32317. };
  32318. const handleMouseEnter = () => {
  32319. states.mouseEnter = true;
  32320. };
  32321. const handleMouseLeave = () => {
  32322. states.mouseEnter = false;
  32323. };
  32324. return {
  32325. optionsArray,
  32326. selectSize,
  32327. handleResize,
  32328. debouncedOnInputChange,
  32329. debouncedQueryChange,
  32330. deletePrevTag,
  32331. deleteTag,
  32332. deleteSelected,
  32333. handleOptionSelect,
  32334. scrollToOption,
  32335. readonly,
  32336. resetInputHeight,
  32337. showClose,
  32338. iconComponent,
  32339. iconReverse,
  32340. showNewOption,
  32341. collapseTagSize,
  32342. setSelected,
  32343. managePlaceholder,
  32344. selectDisabled,
  32345. emptyText,
  32346. toggleLastOptionHitState,
  32347. resetInputState,
  32348. handleComposition,
  32349. onOptionCreate,
  32350. onOptionDestroy,
  32351. handleMenuEnter,
  32352. handleFocus,
  32353. blur,
  32354. handleBlur,
  32355. handleClearClick,
  32356. handleClose,
  32357. handleKeydownEscape,
  32358. toggleMenu,
  32359. selectOption,
  32360. getValueKey,
  32361. navigateOptions,
  32362. dropMenuVisible,
  32363. queryChange,
  32364. groupQueryChange,
  32365. reference,
  32366. input,
  32367. tooltipRef,
  32368. tags,
  32369. selectWrapper,
  32370. scrollbar,
  32371. handleMouseEnter,
  32372. handleMouseLeave
  32373. };
  32374. };
  32375. const COMPONENT_NAME$9 = "ElSelect";
  32376. const _sfc_main$O = vue.defineComponent({
  32377. name: COMPONENT_NAME$9,
  32378. componentName: COMPONENT_NAME$9,
  32379. components: {
  32380. ElInput,
  32381. ElSelectMenu: ElSelectMenu$1,
  32382. ElOption: Option,
  32383. ElTag,
  32384. ElScrollbar,
  32385. ElTooltip,
  32386. ElIcon
  32387. },
  32388. directives: { ClickOutside },
  32389. props: {
  32390. name: String,
  32391. id: String,
  32392. modelValue: {
  32393. type: [Array, String, Number, Boolean, Object],
  32394. default: void 0
  32395. },
  32396. autocomplete: {
  32397. type: String,
  32398. default: "off"
  32399. },
  32400. automaticDropdown: Boolean,
  32401. size: {
  32402. type: String,
  32403. validator: isValidComponentSize
  32404. },
  32405. effect: {
  32406. type: String,
  32407. default: "light"
  32408. },
  32409. disabled: Boolean,
  32410. clearable: Boolean,
  32411. filterable: Boolean,
  32412. allowCreate: Boolean,
  32413. loading: Boolean,
  32414. popperClass: {
  32415. type: String,
  32416. default: ""
  32417. },
  32418. remote: Boolean,
  32419. loadingText: String,
  32420. noMatchText: String,
  32421. noDataText: String,
  32422. remoteMethod: Function,
  32423. filterMethod: Function,
  32424. multiple: Boolean,
  32425. multipleLimit: {
  32426. type: Number,
  32427. default: 0
  32428. },
  32429. placeholder: {
  32430. type: String
  32431. },
  32432. defaultFirstOption: Boolean,
  32433. reserveKeyword: {
  32434. type: Boolean,
  32435. default: true
  32436. },
  32437. valueKey: {
  32438. type: String,
  32439. default: "value"
  32440. },
  32441. collapseTags: Boolean,
  32442. collapseTagsTooltip: {
  32443. type: Boolean,
  32444. default: false
  32445. },
  32446. teleported: useTooltipContentProps.teleported,
  32447. persistent: {
  32448. type: Boolean,
  32449. default: true
  32450. },
  32451. clearIcon: {
  32452. type: iconPropType,
  32453. default: circle_close_default
  32454. },
  32455. fitInputWidth: {
  32456. type: Boolean,
  32457. default: false
  32458. },
  32459. suffixIcon: {
  32460. type: iconPropType,
  32461. default: arrow_down_default
  32462. },
  32463. tagType: { ...tagProps.type, default: "info" },
  32464. validateEvent: {
  32465. type: Boolean,
  32466. default: true
  32467. },
  32468. remoteShowSuffix: {
  32469. type: Boolean,
  32470. default: false
  32471. },
  32472. suffixTransition: {
  32473. type: Boolean,
  32474. default: true
  32475. },
  32476. placement: {
  32477. type: String,
  32478. values: Ee,
  32479. default: "bottom-start"
  32480. }
  32481. },
  32482. emits: [
  32483. UPDATE_MODEL_EVENT,
  32484. CHANGE_EVENT,
  32485. "remove-tag",
  32486. "clear",
  32487. "visible-change",
  32488. "focus",
  32489. "blur"
  32490. ],
  32491. setup(props, ctx) {
  32492. const nsSelect = useNamespace("select");
  32493. const nsInput = useNamespace("input");
  32494. const { t } = useLocale();
  32495. const states = useSelectStates(props);
  32496. const {
  32497. optionsArray,
  32498. selectSize,
  32499. readonly,
  32500. handleResize,
  32501. collapseTagSize,
  32502. debouncedOnInputChange,
  32503. debouncedQueryChange,
  32504. deletePrevTag,
  32505. deleteTag,
  32506. deleteSelected,
  32507. handleOptionSelect,
  32508. scrollToOption,
  32509. setSelected,
  32510. resetInputHeight,
  32511. managePlaceholder,
  32512. showClose,
  32513. selectDisabled,
  32514. iconComponent,
  32515. iconReverse,
  32516. showNewOption,
  32517. emptyText,
  32518. toggleLastOptionHitState,
  32519. resetInputState,
  32520. handleComposition,
  32521. onOptionCreate,
  32522. onOptionDestroy,
  32523. handleMenuEnter,
  32524. handleFocus,
  32525. blur,
  32526. handleBlur,
  32527. handleClearClick,
  32528. handleClose,
  32529. handleKeydownEscape,
  32530. toggleMenu,
  32531. selectOption,
  32532. getValueKey,
  32533. navigateOptions,
  32534. dropMenuVisible,
  32535. reference,
  32536. input,
  32537. tooltipRef,
  32538. tags,
  32539. selectWrapper,
  32540. scrollbar,
  32541. queryChange,
  32542. groupQueryChange,
  32543. handleMouseEnter,
  32544. handleMouseLeave
  32545. } = useSelect$3(props, states, ctx);
  32546. const { focus } = useFocus(reference);
  32547. const {
  32548. inputWidth,
  32549. selected,
  32550. inputLength,
  32551. filteredOptionsCount,
  32552. visible,
  32553. softFocus,
  32554. selectedLabel,
  32555. hoverIndex,
  32556. query,
  32557. inputHovering,
  32558. currentPlaceholder,
  32559. menuVisibleOnFocus,
  32560. isOnComposition,
  32561. isSilentBlur,
  32562. options,
  32563. cachedOptions,
  32564. optionsCount,
  32565. prefixWidth,
  32566. tagInMultiLine
  32567. } = vue.toRefs(states);
  32568. const wrapperKls = vue.computed(() => {
  32569. const classList = [nsSelect.b()];
  32570. const _selectSize = vue.unref(selectSize);
  32571. if (_selectSize) {
  32572. classList.push(nsSelect.m(_selectSize));
  32573. }
  32574. if (props.disabled) {
  32575. classList.push(nsSelect.m("disabled"));
  32576. }
  32577. return classList;
  32578. });
  32579. const selectTagsStyle = vue.computed(() => ({
  32580. maxWidth: `${vue.unref(inputWidth) - 32}px`,
  32581. width: "100%"
  32582. }));
  32583. const tagTextStyle = vue.computed(() => {
  32584. const maxWidth = vue.unref(inputWidth) > 123 ? vue.unref(inputWidth) - 123 : vue.unref(inputWidth) - 75;
  32585. return { maxWidth: `${maxWidth}px` };
  32586. });
  32587. vue.provide(selectKey, vue.reactive({
  32588. props,
  32589. options,
  32590. optionsArray,
  32591. cachedOptions,
  32592. optionsCount,
  32593. filteredOptionsCount,
  32594. hoverIndex,
  32595. handleOptionSelect,
  32596. onOptionCreate,
  32597. onOptionDestroy,
  32598. selectWrapper,
  32599. selected,
  32600. setSelected,
  32601. queryChange,
  32602. groupQueryChange
  32603. }));
  32604. vue.onMounted(() => {
  32605. states.cachedPlaceHolder = currentPlaceholder.value = props.placeholder || t("el.select.placeholder");
  32606. if (props.multiple && Array.isArray(props.modelValue) && props.modelValue.length > 0) {
  32607. currentPlaceholder.value = "";
  32608. }
  32609. useResizeObserver(selectWrapper, handleResize);
  32610. if (props.remote && props.multiple) {
  32611. resetInputHeight();
  32612. }
  32613. vue.nextTick(() => {
  32614. const refEl = reference.value && reference.value.$el;
  32615. if (!refEl)
  32616. return;
  32617. inputWidth.value = refEl.getBoundingClientRect().width;
  32618. if (ctx.slots.prefix) {
  32619. const prefix = refEl.querySelector(`.${nsInput.e("prefix")}`);
  32620. prefixWidth.value = Math.max(prefix.getBoundingClientRect().width + 5, 30);
  32621. }
  32622. });
  32623. setSelected();
  32624. });
  32625. if (props.multiple && !Array.isArray(props.modelValue)) {
  32626. ctx.emit(UPDATE_MODEL_EVENT, []);
  32627. }
  32628. if (!props.multiple && Array.isArray(props.modelValue)) {
  32629. ctx.emit(UPDATE_MODEL_EVENT, "");
  32630. }
  32631. const popperPaneRef = vue.computed(() => {
  32632. var _a, _b;
  32633. return (_b = (_a = tooltipRef.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  32634. });
  32635. return {
  32636. tagInMultiLine,
  32637. prefixWidth,
  32638. selectSize,
  32639. readonly,
  32640. handleResize,
  32641. collapseTagSize,
  32642. debouncedOnInputChange,
  32643. debouncedQueryChange,
  32644. deletePrevTag,
  32645. deleteTag,
  32646. deleteSelected,
  32647. handleOptionSelect,
  32648. scrollToOption,
  32649. inputWidth,
  32650. selected,
  32651. inputLength,
  32652. filteredOptionsCount,
  32653. visible,
  32654. softFocus,
  32655. selectedLabel,
  32656. hoverIndex,
  32657. query,
  32658. inputHovering,
  32659. currentPlaceholder,
  32660. menuVisibleOnFocus,
  32661. isOnComposition,
  32662. isSilentBlur,
  32663. options,
  32664. resetInputHeight,
  32665. managePlaceholder,
  32666. showClose,
  32667. selectDisabled,
  32668. iconComponent,
  32669. iconReverse,
  32670. showNewOption,
  32671. emptyText,
  32672. toggleLastOptionHitState,
  32673. resetInputState,
  32674. handleComposition,
  32675. handleMenuEnter,
  32676. handleFocus,
  32677. blur,
  32678. handleBlur,
  32679. handleClearClick,
  32680. handleClose,
  32681. handleKeydownEscape,
  32682. toggleMenu,
  32683. selectOption,
  32684. getValueKey,
  32685. navigateOptions,
  32686. dropMenuVisible,
  32687. focus,
  32688. reference,
  32689. input,
  32690. tooltipRef,
  32691. popperPaneRef,
  32692. tags,
  32693. selectWrapper,
  32694. scrollbar,
  32695. wrapperKls,
  32696. selectTagsStyle,
  32697. nsSelect,
  32698. tagTextStyle,
  32699. handleMouseEnter,
  32700. handleMouseLeave
  32701. };
  32702. }
  32703. });
  32704. const _hoisted_1$n = ["disabled", "autocomplete"];
  32705. const _hoisted_2$f = { style: { "height": "100%", "display": "flex", "justify-content": "center", "align-items": "center" } };
  32706. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  32707. const _component_el_tag = vue.resolveComponent("el-tag");
  32708. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  32709. const _component_el_icon = vue.resolveComponent("el-icon");
  32710. const _component_el_input = vue.resolveComponent("el-input");
  32711. const _component_el_option = vue.resolveComponent("el-option");
  32712. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  32713. const _component_el_select_menu = vue.resolveComponent("el-select-menu");
  32714. const _directive_click_outside = vue.resolveDirective("click-outside");
  32715. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  32716. ref: "selectWrapper",
  32717. class: vue.normalizeClass(_ctx.wrapperKls),
  32718. onMouseenter: _cache[22] || (_cache[22] = (...args) => _ctx.handleMouseEnter && _ctx.handleMouseEnter(...args)),
  32719. onMouseleave: _cache[23] || (_cache[23] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args)),
  32720. onClick: _cache[24] || (_cache[24] = vue.withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  32721. }, [
  32722. vue.createVNode(_component_el_tooltip, {
  32723. ref: "tooltipRef",
  32724. visible: _ctx.dropMenuVisible,
  32725. placement: _ctx.placement,
  32726. teleported: _ctx.teleported,
  32727. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  32728. "fallback-placements": ["bottom-start", "top-start", "right", "left"],
  32729. effect: _ctx.effect,
  32730. pure: "",
  32731. trigger: "click",
  32732. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  32733. "stop-popper-mouse-event": false,
  32734. "gpu-acceleration": false,
  32735. persistent: _ctx.persistent,
  32736. onShow: _ctx.handleMenuEnter
  32737. }, {
  32738. default: vue.withCtx(() => [
  32739. vue.createElementVNode("div", {
  32740. class: "select-trigger",
  32741. onMouseenter: _cache[20] || (_cache[20] = ($event) => _ctx.inputHovering = true),
  32742. onMouseleave: _cache[21] || (_cache[21] = ($event) => _ctx.inputHovering = false)
  32743. }, [
  32744. _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
  32745. key: 0,
  32746. ref: "tags",
  32747. class: vue.normalizeClass(_ctx.nsSelect.e("tags")),
  32748. style: vue.normalizeStyle(_ctx.selectTagsStyle)
  32749. }, [
  32750. _ctx.collapseTags && _ctx.selected.length ? (vue.openBlock(), vue.createElementBlock("span", {
  32751. key: 0,
  32752. class: vue.normalizeClass([
  32753. _ctx.nsSelect.b("tags-wrapper"),
  32754. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  32755. ])
  32756. }, [
  32757. vue.createVNode(_component_el_tag, {
  32758. closable: !_ctx.selectDisabled && !_ctx.selected[0].isDisabled,
  32759. size: _ctx.collapseTagSize,
  32760. hit: _ctx.selected[0].hitState,
  32761. type: _ctx.tagType,
  32762. "disable-transitions": "",
  32763. onClose: _cache[0] || (_cache[0] = ($event) => _ctx.deleteTag($event, _ctx.selected[0]))
  32764. }, {
  32765. default: vue.withCtx(() => [
  32766. vue.createElementVNode("span", {
  32767. class: vue.normalizeClass(_ctx.nsSelect.e("tags-text")),
  32768. style: vue.normalizeStyle(_ctx.tagTextStyle)
  32769. }, vue.toDisplayString(_ctx.selected[0].currentLabel), 7)
  32770. ]),
  32771. _: 1
  32772. }, 8, ["closable", "size", "hit", "type"]),
  32773. _ctx.selected.length > 1 ? (vue.openBlock(), vue.createBlock(_component_el_tag, {
  32774. key: 0,
  32775. closable: false,
  32776. size: _ctx.collapseTagSize,
  32777. type: _ctx.tagType,
  32778. "disable-transitions": ""
  32779. }, {
  32780. default: vue.withCtx(() => [
  32781. _ctx.collapseTagsTooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  32782. key: 0,
  32783. disabled: _ctx.dropMenuVisible,
  32784. "fallback-placements": ["bottom", "top", "right", "left"],
  32785. effect: _ctx.effect,
  32786. placement: "bottom",
  32787. teleported: _ctx.teleported
  32788. }, {
  32789. default: vue.withCtx(() => [
  32790. vue.createElementVNode("span", {
  32791. class: vue.normalizeClass(_ctx.nsSelect.e("tags-text"))
  32792. }, "+ " + vue.toDisplayString(_ctx.selected.length - 1), 3)
  32793. ]),
  32794. content: vue.withCtx(() => [
  32795. vue.createElementVNode("div", {
  32796. class: vue.normalizeClass(_ctx.nsSelect.e("collapse-tags"))
  32797. }, [
  32798. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selected.slice(1), (item, idx) => {
  32799. return vue.openBlock(), vue.createElementBlock("div", {
  32800. key: idx,
  32801. class: vue.normalizeClass(_ctx.nsSelect.e("collapse-tag"))
  32802. }, [
  32803. (vue.openBlock(), vue.createBlock(_component_el_tag, {
  32804. key: _ctx.getValueKey(item),
  32805. class: "in-tooltip",
  32806. closable: !_ctx.selectDisabled && !item.isDisabled,
  32807. size: _ctx.collapseTagSize,
  32808. hit: item.hitState,
  32809. type: _ctx.tagType,
  32810. "disable-transitions": "",
  32811. style: { margin: "2px" },
  32812. onClose: ($event) => _ctx.deleteTag($event, item)
  32813. }, {
  32814. default: vue.withCtx(() => [
  32815. vue.createElementVNode("span", {
  32816. class: vue.normalizeClass(_ctx.nsSelect.e("tags-text")),
  32817. style: vue.normalizeStyle({
  32818. maxWidth: _ctx.inputWidth - 75 + "px"
  32819. })
  32820. }, vue.toDisplayString(item.currentLabel), 7)
  32821. ]),
  32822. _: 2
  32823. }, 1032, ["closable", "size", "hit", "type", "onClose"]))
  32824. ], 2);
  32825. }), 128))
  32826. ], 2)
  32827. ]),
  32828. _: 1
  32829. }, 8, ["disabled", "effect", "teleported"])) : (vue.openBlock(), vue.createElementBlock("span", {
  32830. key: 1,
  32831. class: vue.normalizeClass(_ctx.nsSelect.e("tags-text"))
  32832. }, "+ " + vue.toDisplayString(_ctx.selected.length - 1), 3))
  32833. ]),
  32834. _: 1
  32835. }, 8, ["size", "type"])) : vue.createCommentVNode("v-if", true)
  32836. ], 2)) : vue.createCommentVNode("v-if", true),
  32837. vue.createCommentVNode(" <div> "),
  32838. !_ctx.collapseTags ? (vue.openBlock(), vue.createBlock(vue.Transition, {
  32839. key: 1,
  32840. onAfterLeave: _ctx.resetInputHeight
  32841. }, {
  32842. default: vue.withCtx(() => [
  32843. vue.createElementVNode("span", {
  32844. class: vue.normalizeClass([
  32845. _ctx.nsSelect.b("tags-wrapper"),
  32846. { "has-prefix": _ctx.prefixWidth && _ctx.selected.length }
  32847. ])
  32848. }, [
  32849. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.selected, (item) => {
  32850. return vue.openBlock(), vue.createBlock(_component_el_tag, {
  32851. key: _ctx.getValueKey(item),
  32852. closable: !_ctx.selectDisabled && !item.isDisabled,
  32853. size: _ctx.collapseTagSize,
  32854. hit: item.hitState,
  32855. type: _ctx.tagType,
  32856. "disable-transitions": "",
  32857. onClose: ($event) => _ctx.deleteTag($event, item)
  32858. }, {
  32859. default: vue.withCtx(() => [
  32860. vue.createElementVNode("span", {
  32861. class: vue.normalizeClass(_ctx.nsSelect.e("tags-text")),
  32862. style: vue.normalizeStyle({ maxWidth: _ctx.inputWidth - 75 + "px" })
  32863. }, vue.toDisplayString(item.currentLabel), 7)
  32864. ]),
  32865. _: 2
  32866. }, 1032, ["closable", "size", "hit", "type", "onClose"]);
  32867. }), 128))
  32868. ], 2)
  32869. ]),
  32870. _: 1
  32871. }, 8, ["onAfterLeave"])) : vue.createCommentVNode("v-if", true),
  32872. vue.createCommentVNode(" </div> "),
  32873. _ctx.filterable ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", {
  32874. key: 2,
  32875. ref: "input",
  32876. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.query = $event),
  32877. type: "text",
  32878. class: vue.normalizeClass([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  32879. disabled: _ctx.selectDisabled,
  32880. autocomplete: _ctx.autocomplete,
  32881. style: vue.normalizeStyle({
  32882. marginLeft: _ctx.prefixWidth && !_ctx.selected.length || _ctx.tagInMultiLine ? `${_ctx.prefixWidth}px` : "",
  32883. flexGrow: 1,
  32884. width: `${_ctx.inputLength / (_ctx.inputWidth - 32)}%`,
  32885. maxWidth: `${_ctx.inputWidth - 42}px`
  32886. }),
  32887. onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  32888. onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  32889. onKeyup: _cache[4] || (_cache[4] = (...args) => _ctx.managePlaceholder && _ctx.managePlaceholder(...args)),
  32890. onKeydown: [
  32891. _cache[5] || (_cache[5] = (...args) => _ctx.resetInputState && _ctx.resetInputState(...args)),
  32892. _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers(($event) => _ctx.navigateOptions("next"), ["prevent"]), ["down"])),
  32893. _cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers(($event) => _ctx.navigateOptions("prev"), ["prevent"]), ["up"])),
  32894. _cache[8] || (_cache[8] = vue.withKeys((...args) => _ctx.handleKeydownEscape && _ctx.handleKeydownEscape(...args), ["esc"])),
  32895. _cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers((...args) => _ctx.selectOption && _ctx.selectOption(...args), ["stop", "prevent"]), ["enter"])),
  32896. _cache[10] || (_cache[10] = vue.withKeys((...args) => _ctx.deletePrevTag && _ctx.deletePrevTag(...args), ["delete"])),
  32897. _cache[11] || (_cache[11] = vue.withKeys(($event) => _ctx.visible = false, ["tab"]))
  32898. ],
  32899. onCompositionstart: _cache[12] || (_cache[12] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  32900. onCompositionupdate: _cache[13] || (_cache[13] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  32901. onCompositionend: _cache[14] || (_cache[14] = (...args) => _ctx.handleComposition && _ctx.handleComposition(...args)),
  32902. onInput: _cache[15] || (_cache[15] = (...args) => _ctx.debouncedQueryChange && _ctx.debouncedQueryChange(...args))
  32903. }, null, 46, _hoisted_1$n)), [
  32904. [vue.vModelText, _ctx.query]
  32905. ]) : vue.createCommentVNode("v-if", true)
  32906. ], 6)) : vue.createCommentVNode("v-if", true),
  32907. vue.createVNode(_component_el_input, {
  32908. id: _ctx.id,
  32909. ref: "reference",
  32910. modelValue: _ctx.selectedLabel,
  32911. "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => _ctx.selectedLabel = $event),
  32912. type: "text",
  32913. placeholder: _ctx.currentPlaceholder,
  32914. name: _ctx.name,
  32915. autocomplete: _ctx.autocomplete,
  32916. size: _ctx.selectSize,
  32917. disabled: _ctx.selectDisabled,
  32918. readonly: _ctx.readonly,
  32919. "validate-event": false,
  32920. class: vue.normalizeClass([_ctx.nsSelect.is("focus", _ctx.visible)]),
  32921. tabindex: _ctx.multiple && _ctx.filterable ? -1 : void 0,
  32922. onFocus: _ctx.handleFocus,
  32923. onBlur: _ctx.handleBlur,
  32924. onInput: _ctx.debouncedOnInputChange,
  32925. onPaste: _ctx.debouncedOnInputChange,
  32926. onCompositionstart: _ctx.handleComposition,
  32927. onCompositionupdate: _ctx.handleComposition,
  32928. onCompositionend: _ctx.handleComposition,
  32929. onKeydown: [
  32930. _cache[17] || (_cache[17] = vue.withKeys(vue.withModifiers(($event) => _ctx.navigateOptions("next"), ["stop", "prevent"]), ["down"])),
  32931. _cache[18] || (_cache[18] = vue.withKeys(vue.withModifiers(($event) => _ctx.navigateOptions("prev"), ["stop", "prevent"]), ["up"])),
  32932. vue.withKeys(vue.withModifiers(_ctx.selectOption, ["stop", "prevent"]), ["enter"]),
  32933. vue.withKeys(_ctx.handleKeydownEscape, ["esc"]),
  32934. _cache[19] || (_cache[19] = vue.withKeys(($event) => _ctx.visible = false, ["tab"]))
  32935. ]
  32936. }, vue.createSlots({
  32937. suffix: vue.withCtx(() => [
  32938. _ctx.iconComponent && !_ctx.showClose ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  32939. key: 0,
  32940. class: vue.normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon"), _ctx.iconReverse])
  32941. }, {
  32942. default: vue.withCtx(() => [
  32943. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
  32944. ]),
  32945. _: 1
  32946. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  32947. _ctx.showClose && _ctx.clearIcon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  32948. key: 1,
  32949. class: vue.normalizeClass([_ctx.nsSelect.e("caret"), _ctx.nsSelect.e("icon")]),
  32950. onClick: _ctx.handleClearClick
  32951. }, {
  32952. default: vue.withCtx(() => [
  32953. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.clearIcon)))
  32954. ]),
  32955. _: 1
  32956. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  32957. ]),
  32958. _: 2
  32959. }, [
  32960. _ctx.$slots.prefix ? {
  32961. name: "prefix",
  32962. fn: vue.withCtx(() => [
  32963. vue.createElementVNode("div", _hoisted_2$f, [
  32964. vue.renderSlot(_ctx.$slots, "prefix")
  32965. ])
  32966. ])
  32967. } : void 0
  32968. ]), 1032, ["id", "modelValue", "placeholder", "name", "autocomplete", "size", "disabled", "readonly", "class", "tabindex", "onFocus", "onBlur", "onInput", "onPaste", "onCompositionstart", "onCompositionupdate", "onCompositionend", "onKeydown"])
  32969. ], 32)
  32970. ]),
  32971. content: vue.withCtx(() => [
  32972. vue.createVNode(_component_el_select_menu, null, {
  32973. default: vue.withCtx(() => [
  32974. vue.withDirectives(vue.createVNode(_component_el_scrollbar, {
  32975. ref: "scrollbar",
  32976. tag: "ul",
  32977. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  32978. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  32979. class: vue.normalizeClass([
  32980. _ctx.nsSelect.is("empty", !_ctx.allowCreate && Boolean(_ctx.query) && _ctx.filteredOptionsCount === 0)
  32981. ])
  32982. }, {
  32983. default: vue.withCtx(() => [
  32984. _ctx.showNewOption ? (vue.openBlock(), vue.createBlock(_component_el_option, {
  32985. key: 0,
  32986. value: _ctx.query,
  32987. created: true
  32988. }, null, 8, ["value"])) : vue.createCommentVNode("v-if", true),
  32989. vue.renderSlot(_ctx.$slots, "default")
  32990. ]),
  32991. _: 3
  32992. }, 8, ["wrap-class", "view-class", "class"]), [
  32993. [vue.vShow, _ctx.options.size > 0 && !_ctx.loading]
  32994. ]),
  32995. _ctx.emptyText && (!_ctx.allowCreate || _ctx.loading || _ctx.allowCreate && _ctx.options.size === 0) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  32996. _ctx.$slots.empty ? vue.renderSlot(_ctx.$slots, "empty", { key: 0 }) : (vue.openBlock(), vue.createElementBlock("p", {
  32997. key: 1,
  32998. class: vue.normalizeClass(_ctx.nsSelect.be("dropdown", "empty"))
  32999. }, vue.toDisplayString(_ctx.emptyText), 3))
  33000. ], 64)) : vue.createCommentVNode("v-if", true)
  33001. ]),
  33002. _: 3
  33003. })
  33004. ]),
  33005. _: 3
  33006. }, 8, ["visible", "placement", "teleported", "popper-class", "effect", "transition", "persistent", "onShow"])
  33007. ], 34)), [
  33008. [_directive_click_outside, _ctx.handleClose, _ctx.popperPaneRef]
  33009. ]);
  33010. }
  33011. var Select$1 = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$9], ["__file", "select.vue"]]);
  33012. const _sfc_main$N = vue.defineComponent({
  33013. name: "ElOptionGroup",
  33014. componentName: "ElOptionGroup",
  33015. props: {
  33016. label: String,
  33017. disabled: {
  33018. type: Boolean,
  33019. default: false
  33020. }
  33021. },
  33022. setup(props) {
  33023. const ns = useNamespace("select");
  33024. const visible = vue.ref(true);
  33025. const instance = vue.getCurrentInstance();
  33026. const children = vue.ref([]);
  33027. vue.provide(selectGroupKey, vue.reactive({
  33028. ...vue.toRefs(props)
  33029. }));
  33030. const select = vue.inject(selectKey);
  33031. vue.onMounted(() => {
  33032. children.value = flattedChildren(instance.subTree);
  33033. });
  33034. const flattedChildren = (node) => {
  33035. const children2 = [];
  33036. if (Array.isArray(node.children)) {
  33037. node.children.forEach((child) => {
  33038. var _a;
  33039. if (child.type && child.type.name === "ElOption" && child.component && child.component.proxy) {
  33040. children2.push(child.component.proxy);
  33041. } else if ((_a = child.children) == null ? void 0 : _a.length) {
  33042. children2.push(...flattedChildren(child));
  33043. }
  33044. });
  33045. }
  33046. return children2;
  33047. };
  33048. const { groupQueryChange } = vue.toRaw(select);
  33049. vue.watch(groupQueryChange, () => {
  33050. visible.value = children.value.some((option) => option.visible === true);
  33051. }, { flush: "post" });
  33052. return {
  33053. visible,
  33054. ns
  33055. };
  33056. }
  33057. });
  33058. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  33059. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("ul", {
  33060. class: vue.normalizeClass(_ctx.ns.be("group", "wrap"))
  33061. }, [
  33062. vue.createElementVNode("li", {
  33063. class: vue.normalizeClass(_ctx.ns.be("group", "title"))
  33064. }, vue.toDisplayString(_ctx.label), 3),
  33065. vue.createElementVNode("li", null, [
  33066. vue.createElementVNode("ul", {
  33067. class: vue.normalizeClass(_ctx.ns.b("group"))
  33068. }, [
  33069. vue.renderSlot(_ctx.$slots, "default")
  33070. ], 2)
  33071. ])
  33072. ], 2)), [
  33073. [vue.vShow, _ctx.visible]
  33074. ]);
  33075. }
  33076. var OptionGroup = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["render", _sfc_render$8], ["__file", "option-group.vue"]]);
  33077. const ElSelect = withInstall(Select$1, {
  33078. Option,
  33079. OptionGroup
  33080. });
  33081. const ElOption = withNoopInstall(Option);
  33082. const ElOptionGroup = withNoopInstall(OptionGroup);
  33083. const usePagination = () => vue.inject(elPaginationKey, {});
  33084. const paginationSizesProps = buildProps({
  33085. pageSize: {
  33086. type: Number,
  33087. required: true
  33088. },
  33089. pageSizes: {
  33090. type: definePropType(Array),
  33091. default: () => mutable([10, 20, 30, 40, 50, 100])
  33092. },
  33093. popperClass: {
  33094. type: String
  33095. },
  33096. disabled: Boolean,
  33097. size: {
  33098. type: String,
  33099. values: componentSizes
  33100. }
  33101. });
  33102. const __default__$C = vue.defineComponent({
  33103. name: "ElPaginationSizes"
  33104. });
  33105. const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
  33106. ...__default__$C,
  33107. props: paginationSizesProps,
  33108. emits: ["page-size-change"],
  33109. setup(__props, { emit }) {
  33110. const props = __props;
  33111. const { t } = useLocale();
  33112. const ns = useNamespace("pagination");
  33113. const pagination = usePagination();
  33114. const innerPageSize = vue.ref(props.pageSize);
  33115. vue.watch(() => props.pageSizes, (newVal, oldVal) => {
  33116. if (isEqual$1(newVal, oldVal))
  33117. return;
  33118. if (Array.isArray(newVal)) {
  33119. const pageSize = newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0];
  33120. emit("page-size-change", pageSize);
  33121. }
  33122. });
  33123. vue.watch(() => props.pageSize, (newVal) => {
  33124. innerPageSize.value = newVal;
  33125. });
  33126. const innerPageSizes = vue.computed(() => props.pageSizes);
  33127. function handleChange(val) {
  33128. var _a;
  33129. if (val !== innerPageSize.value) {
  33130. innerPageSize.value = val;
  33131. (_a = pagination.handleSizeChange) == null ? void 0 : _a.call(pagination, Number(val));
  33132. }
  33133. }
  33134. return (_ctx, _cache) => {
  33135. return vue.openBlock(), vue.createElementBlock("span", {
  33136. class: vue.normalizeClass(vue.unref(ns).e("sizes"))
  33137. }, [
  33138. vue.createVNode(vue.unref(ElSelect), {
  33139. "model-value": innerPageSize.value,
  33140. disabled: _ctx.disabled,
  33141. "popper-class": _ctx.popperClass,
  33142. size: _ctx.size,
  33143. "validate-event": false,
  33144. onChange: handleChange
  33145. }, {
  33146. default: vue.withCtx(() => [
  33147. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(innerPageSizes), (item) => {
  33148. return vue.openBlock(), vue.createBlock(vue.unref(ElOption), {
  33149. key: item,
  33150. value: item,
  33151. label: item + vue.unref(t)("el.pagination.pagesize")
  33152. }, null, 8, ["value", "label"]);
  33153. }), 128))
  33154. ]),
  33155. _: 1
  33156. }, 8, ["model-value", "disabled", "popper-class", "size"])
  33157. ], 2);
  33158. };
  33159. }
  33160. });
  33161. var Sizes = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__file", "sizes.vue"]]);
  33162. const paginationJumperProps = buildProps({
  33163. size: {
  33164. type: String,
  33165. values: componentSizes
  33166. }
  33167. });
  33168. const _hoisted_1$m = ["disabled"];
  33169. const __default__$B = vue.defineComponent({
  33170. name: "ElPaginationJumper"
  33171. });
  33172. const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
  33173. ...__default__$B,
  33174. props: paginationJumperProps,
  33175. setup(__props) {
  33176. const { t } = useLocale();
  33177. const ns = useNamespace("pagination");
  33178. const { pageCount, disabled, currentPage, changeEvent } = usePagination();
  33179. const userInput = vue.ref();
  33180. const innerValue = vue.computed(() => {
  33181. var _a;
  33182. return (_a = userInput.value) != null ? _a : currentPage == null ? void 0 : currentPage.value;
  33183. });
  33184. function handleInput(val) {
  33185. userInput.value = +val;
  33186. }
  33187. function handleChange(val) {
  33188. val = Math.trunc(+val);
  33189. changeEvent == null ? void 0 : changeEvent(+val);
  33190. userInput.value = void 0;
  33191. }
  33192. return (_ctx, _cache) => {
  33193. return vue.openBlock(), vue.createElementBlock("span", {
  33194. class: vue.normalizeClass(vue.unref(ns).e("jump")),
  33195. disabled: vue.unref(disabled)
  33196. }, [
  33197. vue.createElementVNode("span", {
  33198. class: vue.normalizeClass([vue.unref(ns).e("goto")])
  33199. }, vue.toDisplayString(vue.unref(t)("el.pagination.goto")), 3),
  33200. vue.createVNode(vue.unref(ElInput), {
  33201. size: _ctx.size,
  33202. class: vue.normalizeClass([vue.unref(ns).e("editor"), vue.unref(ns).is("in-pagination")]),
  33203. min: 1,
  33204. max: vue.unref(pageCount),
  33205. disabled: vue.unref(disabled),
  33206. "model-value": vue.unref(innerValue),
  33207. "validate-event": false,
  33208. type: "number",
  33209. "onUpdate:modelValue": handleInput,
  33210. onChange: handleChange
  33211. }, null, 8, ["size", "class", "max", "disabled", "model-value"]),
  33212. vue.createElementVNode("span", {
  33213. class: vue.normalizeClass([vue.unref(ns).e("classifier")])
  33214. }, vue.toDisplayString(vue.unref(t)("el.pagination.pageClassifier")), 3)
  33215. ], 10, _hoisted_1$m);
  33216. };
  33217. }
  33218. });
  33219. var Jumper = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__file", "jumper.vue"]]);
  33220. const paginationTotalProps = buildProps({
  33221. total: {
  33222. type: Number,
  33223. default: 1e3
  33224. }
  33225. });
  33226. const _hoisted_1$l = ["disabled"];
  33227. const __default__$A = vue.defineComponent({
  33228. name: "ElPaginationTotal"
  33229. });
  33230. const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
  33231. ...__default__$A,
  33232. props: paginationTotalProps,
  33233. setup(__props) {
  33234. const { t } = useLocale();
  33235. const ns = useNamespace("pagination");
  33236. const { disabled } = usePagination();
  33237. return (_ctx, _cache) => {
  33238. return vue.openBlock(), vue.createElementBlock("span", {
  33239. class: vue.normalizeClass(vue.unref(ns).e("total")),
  33240. disabled: vue.unref(disabled)
  33241. }, vue.toDisplayString(vue.unref(t)("el.pagination.total", {
  33242. total: _ctx.total
  33243. })), 11, _hoisted_1$l);
  33244. };
  33245. }
  33246. });
  33247. var Total = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__file", "total.vue"]]);
  33248. const paginationPagerProps = buildProps({
  33249. currentPage: {
  33250. type: Number,
  33251. default: 1
  33252. },
  33253. pageCount: {
  33254. type: Number,
  33255. required: true
  33256. },
  33257. pagerCount: {
  33258. type: Number,
  33259. default: 7
  33260. },
  33261. disabled: Boolean
  33262. });
  33263. const _hoisted_1$k = ["onKeyup"];
  33264. const _hoisted_2$e = ["aria-current", "tabindex"];
  33265. const _hoisted_3$7 = ["tabindex"];
  33266. const _hoisted_4$5 = ["aria-current", "tabindex"];
  33267. const _hoisted_5$4 = ["tabindex"];
  33268. const _hoisted_6 = ["aria-current", "tabindex"];
  33269. const __default__$z = vue.defineComponent({
  33270. name: "ElPaginationPager"
  33271. });
  33272. const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
  33273. ...__default__$z,
  33274. props: paginationPagerProps,
  33275. emits: ["change"],
  33276. setup(__props, { emit }) {
  33277. const props = __props;
  33278. const nsPager = useNamespace("pager");
  33279. const nsIcon = useNamespace("icon");
  33280. const showPrevMore = vue.ref(false);
  33281. const showNextMore = vue.ref(false);
  33282. const quickPrevHover = vue.ref(false);
  33283. const quickNextHover = vue.ref(false);
  33284. const quickPrevFocus = vue.ref(false);
  33285. const quickNextFocus = vue.ref(false);
  33286. const pagers = vue.computed(() => {
  33287. const pagerCount = props.pagerCount;
  33288. const halfPagerCount = (pagerCount - 1) / 2;
  33289. const currentPage = Number(props.currentPage);
  33290. const pageCount = Number(props.pageCount);
  33291. let showPrevMore2 = false;
  33292. let showNextMore2 = false;
  33293. if (pageCount > pagerCount) {
  33294. if (currentPage > pagerCount - halfPagerCount) {
  33295. showPrevMore2 = true;
  33296. }
  33297. if (currentPage < pageCount - halfPagerCount) {
  33298. showNextMore2 = true;
  33299. }
  33300. }
  33301. const array = [];
  33302. if (showPrevMore2 && !showNextMore2) {
  33303. const startPage = pageCount - (pagerCount - 2);
  33304. for (let i = startPage; i < pageCount; i++) {
  33305. array.push(i);
  33306. }
  33307. } else if (!showPrevMore2 && showNextMore2) {
  33308. for (let i = 2; i < pagerCount; i++) {
  33309. array.push(i);
  33310. }
  33311. } else if (showPrevMore2 && showNextMore2) {
  33312. const offset = Math.floor(pagerCount / 2) - 1;
  33313. for (let i = currentPage - offset; i <= currentPage + offset; i++) {
  33314. array.push(i);
  33315. }
  33316. } else {
  33317. for (let i = 2; i < pageCount; i++) {
  33318. array.push(i);
  33319. }
  33320. }
  33321. return array;
  33322. });
  33323. const tabindex = vue.computed(() => props.disabled ? -1 : 0);
  33324. vue.watchEffect(() => {
  33325. const halfPagerCount = (props.pagerCount - 1) / 2;
  33326. showPrevMore.value = false;
  33327. showNextMore.value = false;
  33328. if (props.pageCount > props.pagerCount) {
  33329. if (props.currentPage > props.pagerCount - halfPagerCount) {
  33330. showPrevMore.value = true;
  33331. }
  33332. if (props.currentPage < props.pageCount - halfPagerCount) {
  33333. showNextMore.value = true;
  33334. }
  33335. }
  33336. });
  33337. function onMouseEnter(forward = false) {
  33338. if (props.disabled)
  33339. return;
  33340. if (forward) {
  33341. quickPrevHover.value = true;
  33342. } else {
  33343. quickNextHover.value = true;
  33344. }
  33345. }
  33346. function onFocus(forward = false) {
  33347. if (forward) {
  33348. quickPrevFocus.value = true;
  33349. } else {
  33350. quickNextFocus.value = true;
  33351. }
  33352. }
  33353. function onEnter(e) {
  33354. const target = e.target;
  33355. if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
  33356. const newPage = Number(target.textContent);
  33357. if (newPage !== props.currentPage) {
  33358. emit("change", newPage);
  33359. }
  33360. } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
  33361. onPagerClick(e);
  33362. }
  33363. }
  33364. function onPagerClick(event) {
  33365. const target = event.target;
  33366. if (target.tagName.toLowerCase() === "ul" || props.disabled) {
  33367. return;
  33368. }
  33369. let newPage = Number(target.textContent);
  33370. const pageCount = props.pageCount;
  33371. const currentPage = props.currentPage;
  33372. const pagerCountOffset = props.pagerCount - 2;
  33373. if (target.className.includes("more")) {
  33374. if (target.className.includes("quickprev")) {
  33375. newPage = currentPage - pagerCountOffset;
  33376. } else if (target.className.includes("quicknext")) {
  33377. newPage = currentPage + pagerCountOffset;
  33378. }
  33379. }
  33380. if (!Number.isNaN(+newPage)) {
  33381. if (newPage < 1) {
  33382. newPage = 1;
  33383. }
  33384. if (newPage > pageCount) {
  33385. newPage = pageCount;
  33386. }
  33387. }
  33388. if (newPage !== currentPage) {
  33389. emit("change", newPage);
  33390. }
  33391. }
  33392. return (_ctx, _cache) => {
  33393. return vue.openBlock(), vue.createElementBlock("ul", {
  33394. class: vue.normalizeClass(vue.unref(nsPager).b()),
  33395. onClick: onPagerClick,
  33396. onKeyup: vue.withKeys(onEnter, ["enter"])
  33397. }, [
  33398. _ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
  33399. key: 0,
  33400. class: vue.normalizeClass([[
  33401. vue.unref(nsPager).is("active", _ctx.currentPage === 1),
  33402. vue.unref(nsPager).is("disabled", _ctx.disabled)
  33403. ], "number"]),
  33404. "aria-current": _ctx.currentPage === 1,
  33405. tabindex: vue.unref(tabindex)
  33406. }, " 1 ", 10, _hoisted_2$e)) : vue.createCommentVNode("v-if", true),
  33407. showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
  33408. key: 1,
  33409. class: vue.normalizeClass([
  33410. "more",
  33411. "btn-quickprev",
  33412. vue.unref(nsIcon).b(),
  33413. vue.unref(nsPager).is("disabled", _ctx.disabled)
  33414. ]),
  33415. tabindex: vue.unref(tabindex),
  33416. onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
  33417. onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
  33418. onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
  33419. onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
  33420. }, [
  33421. (quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(d_arrow_left_default), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(more_filled_default), { key: 1 }))
  33422. ], 42, _hoisted_3$7)) : vue.createCommentVNode("v-if", true),
  33423. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
  33424. return vue.openBlock(), vue.createElementBlock("li", {
  33425. key: pager,
  33426. class: vue.normalizeClass([[
  33427. vue.unref(nsPager).is("active", _ctx.currentPage === pager),
  33428. vue.unref(nsPager).is("disabled", _ctx.disabled)
  33429. ], "number"]),
  33430. "aria-current": _ctx.currentPage === pager,
  33431. tabindex: vue.unref(tabindex)
  33432. }, vue.toDisplayString(pager), 11, _hoisted_4$5);
  33433. }), 128)),
  33434. showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
  33435. key: 2,
  33436. class: vue.normalizeClass([
  33437. "more",
  33438. "btn-quicknext",
  33439. vue.unref(nsIcon).b(),
  33440. vue.unref(nsPager).is("disabled", _ctx.disabled)
  33441. ]),
  33442. tabindex: vue.unref(tabindex),
  33443. onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
  33444. onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
  33445. onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
  33446. onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
  33447. }, [
  33448. (quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(d_arrow_right_default), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(more_filled_default), { key: 1 }))
  33449. ], 42, _hoisted_5$4)) : vue.createCommentVNode("v-if", true),
  33450. _ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
  33451. key: 3,
  33452. class: vue.normalizeClass([[
  33453. vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
  33454. vue.unref(nsPager).is("disabled", _ctx.disabled)
  33455. ], "number"]),
  33456. "aria-current": _ctx.currentPage === _ctx.pageCount,
  33457. tabindex: vue.unref(tabindex)
  33458. }, vue.toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : vue.createCommentVNode("v-if", true)
  33459. ], 42, _hoisted_1$k);
  33460. };
  33461. }
  33462. });
  33463. var Pager = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__file", "pager.vue"]]);
  33464. const isAbsent = (v) => typeof v !== "number";
  33465. const paginationProps = buildProps({
  33466. total: Number,
  33467. pageSize: Number,
  33468. defaultPageSize: Number,
  33469. currentPage: Number,
  33470. defaultCurrentPage: Number,
  33471. pageCount: Number,
  33472. pagerCount: {
  33473. type: Number,
  33474. validator: (value) => {
  33475. return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
  33476. },
  33477. default: 7
  33478. },
  33479. layout: {
  33480. type: String,
  33481. default: ["prev", "pager", "next", "jumper", "->", "total"].join(", ")
  33482. },
  33483. pageSizes: {
  33484. type: definePropType(Array),
  33485. default: () => mutable([10, 20, 30, 40, 50, 100])
  33486. },
  33487. popperClass: {
  33488. type: String,
  33489. default: ""
  33490. },
  33491. prevText: {
  33492. type: String,
  33493. default: ""
  33494. },
  33495. prevIcon: {
  33496. type: iconPropType,
  33497. default: () => arrow_left_default
  33498. },
  33499. nextText: {
  33500. type: String,
  33501. default: ""
  33502. },
  33503. nextIcon: {
  33504. type: iconPropType,
  33505. default: () => arrow_right_default
  33506. },
  33507. small: Boolean,
  33508. background: Boolean,
  33509. disabled: Boolean,
  33510. hideOnSinglePage: Boolean
  33511. });
  33512. const paginationEmits = {
  33513. "update:current-page": (val) => isNumber(val),
  33514. "update:page-size": (val) => isNumber(val),
  33515. "size-change": (val) => isNumber(val),
  33516. "current-change": (val) => isNumber(val),
  33517. "prev-click": (val) => isNumber(val),
  33518. "next-click": (val) => isNumber(val)
  33519. };
  33520. const componentName = "ElPagination";
  33521. var Pagination = vue.defineComponent({
  33522. name: componentName,
  33523. props: paginationProps,
  33524. emits: paginationEmits,
  33525. setup(props, { emit, slots }) {
  33526. const { t } = useLocale();
  33527. const ns = useNamespace("pagination");
  33528. const vnodeProps = vue.getCurrentInstance().vnode.props || {};
  33529. const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
  33530. const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
  33531. const assertValidUsage = vue.computed(() => {
  33532. if (isAbsent(props.total) && isAbsent(props.pageCount))
  33533. return false;
  33534. if (!isAbsent(props.currentPage) && !hasCurrentPageListener)
  33535. return false;
  33536. if (props.layout.includes("sizes")) {
  33537. if (!isAbsent(props.pageCount)) {
  33538. if (!hasPageSizeListener)
  33539. return false;
  33540. } else if (!isAbsent(props.total)) {
  33541. if (!isAbsent(props.pageSize)) {
  33542. if (!hasPageSizeListener) {
  33543. return false;
  33544. }
  33545. }
  33546. }
  33547. }
  33548. return true;
  33549. });
  33550. const innerPageSize = vue.ref(isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize);
  33551. const innerCurrentPage = vue.ref(isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage);
  33552. const pageSizeBridge = vue.computed({
  33553. get() {
  33554. return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize;
  33555. },
  33556. set(v) {
  33557. if (isAbsent(props.pageSize)) {
  33558. innerPageSize.value = v;
  33559. }
  33560. if (hasPageSizeListener) {
  33561. emit("update:page-size", v);
  33562. emit("size-change", v);
  33563. }
  33564. }
  33565. });
  33566. const pageCountBridge = vue.computed(() => {
  33567. let pageCount = 0;
  33568. if (!isAbsent(props.pageCount)) {
  33569. pageCount = props.pageCount;
  33570. } else if (!isAbsent(props.total)) {
  33571. pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value));
  33572. }
  33573. return pageCount;
  33574. });
  33575. const currentPageBridge = vue.computed({
  33576. get() {
  33577. return isAbsent(props.currentPage) ? innerCurrentPage.value : props.currentPage;
  33578. },
  33579. set(v) {
  33580. let newCurrentPage = v;
  33581. if (v < 1) {
  33582. newCurrentPage = 1;
  33583. } else if (v > pageCountBridge.value) {
  33584. newCurrentPage = pageCountBridge.value;
  33585. }
  33586. if (isAbsent(props.currentPage)) {
  33587. innerCurrentPage.value = newCurrentPage;
  33588. }
  33589. if (hasCurrentPageListener) {
  33590. emit("update:current-page", newCurrentPage);
  33591. emit("current-change", newCurrentPage);
  33592. }
  33593. }
  33594. });
  33595. vue.watch(pageCountBridge, (val) => {
  33596. if (currentPageBridge.value > val)
  33597. currentPageBridge.value = val;
  33598. });
  33599. function handleCurrentChange(val) {
  33600. currentPageBridge.value = val;
  33601. }
  33602. function handleSizeChange(val) {
  33603. pageSizeBridge.value = val;
  33604. const newPageCount = pageCountBridge.value;
  33605. if (currentPageBridge.value > newPageCount) {
  33606. currentPageBridge.value = newPageCount;
  33607. }
  33608. }
  33609. function prev() {
  33610. if (props.disabled)
  33611. return;
  33612. currentPageBridge.value -= 1;
  33613. emit("prev-click", currentPageBridge.value);
  33614. }
  33615. function next() {
  33616. if (props.disabled)
  33617. return;
  33618. currentPageBridge.value += 1;
  33619. emit("next-click", currentPageBridge.value);
  33620. }
  33621. function addClass(element, cls) {
  33622. if (element) {
  33623. if (!element.props) {
  33624. element.props = {};
  33625. }
  33626. element.props.class = [element.props.class, cls].join(" ");
  33627. }
  33628. }
  33629. vue.provide(elPaginationKey, {
  33630. pageCount: pageCountBridge,
  33631. disabled: vue.computed(() => props.disabled),
  33632. currentPage: currentPageBridge,
  33633. changeEvent: handleCurrentChange,
  33634. handleSizeChange
  33635. });
  33636. return () => {
  33637. var _a, _b;
  33638. if (!assertValidUsage.value) {
  33639. debugWarn(componentName, t("el.pagination.deprecationWarning"));
  33640. return null;
  33641. }
  33642. if (!props.layout)
  33643. return null;
  33644. if (props.hideOnSinglePage && pageCountBridge.value <= 1)
  33645. return null;
  33646. const rootChildren = [];
  33647. const rightWrapperChildren = [];
  33648. const rightWrapperRoot = vue.h("div", { class: ns.e("rightwrapper") }, rightWrapperChildren);
  33649. const TEMPLATE_MAP = {
  33650. prev: vue.h(Prev, {
  33651. disabled: props.disabled,
  33652. currentPage: currentPageBridge.value,
  33653. prevText: props.prevText,
  33654. prevIcon: props.prevIcon,
  33655. onClick: prev
  33656. }),
  33657. jumper: vue.h(Jumper, {
  33658. size: props.small ? "small" : "default"
  33659. }),
  33660. pager: vue.h(Pager, {
  33661. currentPage: currentPageBridge.value,
  33662. pageCount: pageCountBridge.value,
  33663. pagerCount: props.pagerCount,
  33664. onChange: handleCurrentChange,
  33665. disabled: props.disabled
  33666. }),
  33667. next: vue.h(Next, {
  33668. disabled: props.disabled,
  33669. currentPage: currentPageBridge.value,
  33670. pageCount: pageCountBridge.value,
  33671. nextText: props.nextText,
  33672. nextIcon: props.nextIcon,
  33673. onClick: next
  33674. }),
  33675. sizes: vue.h(Sizes, {
  33676. pageSize: pageSizeBridge.value,
  33677. pageSizes: props.pageSizes,
  33678. popperClass: props.popperClass,
  33679. disabled: props.disabled,
  33680. size: props.small ? "small" : "default"
  33681. }),
  33682. slot: (_b = (_a = slots == null ? void 0 : slots.default) == null ? void 0 : _a.call(slots)) != null ? _b : null,
  33683. total: vue.h(Total, { total: isAbsent(props.total) ? 0 : props.total })
  33684. };
  33685. const components = props.layout.split(",").map((item) => item.trim());
  33686. let haveRightWrapper = false;
  33687. components.forEach((c) => {
  33688. if (c === "->") {
  33689. haveRightWrapper = true;
  33690. return;
  33691. }
  33692. if (!haveRightWrapper) {
  33693. rootChildren.push(TEMPLATE_MAP[c]);
  33694. } else {
  33695. rightWrapperChildren.push(TEMPLATE_MAP[c]);
  33696. }
  33697. });
  33698. addClass(rootChildren[0], ns.is("first"));
  33699. addClass(rootChildren[rootChildren.length - 1], ns.is("last"));
  33700. if (haveRightWrapper && rightWrapperChildren.length > 0) {
  33701. addClass(rightWrapperChildren[0], ns.is("first"));
  33702. addClass(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last"));
  33703. rootChildren.push(rightWrapperRoot);
  33704. }
  33705. return vue.h("div", {
  33706. role: "pagination",
  33707. "aria-label": "pagination",
  33708. class: [
  33709. ns.b(),
  33710. ns.is("background", props.background),
  33711. {
  33712. [ns.m("small")]: props.small
  33713. }
  33714. ]
  33715. }, rootChildren);
  33716. };
  33717. }
  33718. });
  33719. const ElPagination = withInstall(Pagination);
  33720. const popconfirmProps = buildProps({
  33721. title: String,
  33722. confirmButtonText: String,
  33723. cancelButtonText: String,
  33724. confirmButtonType: {
  33725. type: String,
  33726. values: buttonTypes,
  33727. default: "primary"
  33728. },
  33729. cancelButtonType: {
  33730. type: String,
  33731. values: buttonTypes,
  33732. default: "text"
  33733. },
  33734. icon: {
  33735. type: iconPropType,
  33736. default: () => question_filled_default
  33737. },
  33738. iconColor: {
  33739. type: String,
  33740. default: "#f90"
  33741. },
  33742. hideIcon: {
  33743. type: Boolean,
  33744. default: false
  33745. },
  33746. hideAfter: {
  33747. type: Number,
  33748. default: 200
  33749. },
  33750. onConfirm: {
  33751. type: definePropType(Function)
  33752. },
  33753. onCancel: {
  33754. type: definePropType(Function)
  33755. },
  33756. teleported: useTooltipContentProps.teleported,
  33757. persistent: useTooltipContentProps.persistent,
  33758. width: {
  33759. type: [String, Number],
  33760. default: 150
  33761. }
  33762. });
  33763. const __default__$y = vue.defineComponent({
  33764. name: "ElPopconfirm"
  33765. });
  33766. const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
  33767. ...__default__$y,
  33768. props: popconfirmProps,
  33769. setup(__props) {
  33770. const props = __props;
  33771. const { t } = useLocale();
  33772. const ns = useNamespace("popconfirm");
  33773. const tooltipRef = vue.ref();
  33774. const hidePopper = () => {
  33775. var _a, _b;
  33776. (_b = (_a = tooltipRef.value) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
  33777. };
  33778. const style = vue.computed(() => {
  33779. return {
  33780. width: addUnit(props.width)
  33781. };
  33782. });
  33783. const confirm = (e) => {
  33784. var _a;
  33785. (_a = props.onConfirm) == null ? void 0 : _a.call(props, e);
  33786. hidePopper();
  33787. };
  33788. const cancel = (e) => {
  33789. var _a;
  33790. (_a = props.onCancel) == null ? void 0 : _a.call(props, e);
  33791. hidePopper();
  33792. };
  33793. const finalConfirmButtonText = vue.computed(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
  33794. const finalCancelButtonText = vue.computed(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
  33795. return (_ctx, _cache) => {
  33796. return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), vue.mergeProps({
  33797. ref_key: "tooltipRef",
  33798. ref: tooltipRef,
  33799. trigger: "click",
  33800. effect: "light"
  33801. }, _ctx.$attrs, {
  33802. "popper-class": `${vue.unref(ns).namespace.value}-popover`,
  33803. "popper-style": vue.unref(style),
  33804. teleported: _ctx.teleported,
  33805. "fallback-placements": ["bottom", "top", "right", "left"],
  33806. "hide-after": _ctx.hideAfter,
  33807. persistent: _ctx.persistent
  33808. }), {
  33809. content: vue.withCtx(() => [
  33810. vue.createElementVNode("div", {
  33811. class: vue.normalizeClass(vue.unref(ns).b())
  33812. }, [
  33813. vue.createElementVNode("div", {
  33814. class: vue.normalizeClass(vue.unref(ns).e("main"))
  33815. }, [
  33816. !_ctx.hideIcon && _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  33817. key: 0,
  33818. class: vue.normalizeClass(vue.unref(ns).e("icon")),
  33819. style: vue.normalizeStyle({ color: _ctx.iconColor })
  33820. }, {
  33821. default: vue.withCtx(() => [
  33822. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  33823. ]),
  33824. _: 1
  33825. }, 8, ["class", "style"])) : vue.createCommentVNode("v-if", true),
  33826. vue.createTextVNode(" " + vue.toDisplayString(_ctx.title), 1)
  33827. ], 2),
  33828. vue.createElementVNode("div", {
  33829. class: vue.normalizeClass(vue.unref(ns).e("action"))
  33830. }, [
  33831. vue.createVNode(vue.unref(ElButton), {
  33832. size: "small",
  33833. type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
  33834. text: _ctx.cancelButtonType === "text",
  33835. onClick: cancel
  33836. }, {
  33837. default: vue.withCtx(() => [
  33838. vue.createTextVNode(vue.toDisplayString(vue.unref(finalCancelButtonText)), 1)
  33839. ]),
  33840. _: 1
  33841. }, 8, ["type", "text"]),
  33842. vue.createVNode(vue.unref(ElButton), {
  33843. size: "small",
  33844. type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
  33845. text: _ctx.confirmButtonType === "text",
  33846. onClick: confirm
  33847. }, {
  33848. default: vue.withCtx(() => [
  33849. vue.createTextVNode(vue.toDisplayString(vue.unref(finalConfirmButtonText)), 1)
  33850. ]),
  33851. _: 1
  33852. }, 8, ["type", "text"])
  33853. ], 2)
  33854. ], 2)
  33855. ]),
  33856. default: vue.withCtx(() => [
  33857. _ctx.$slots.reference ? vue.renderSlot(_ctx.$slots, "reference", { key: 0 }) : vue.createCommentVNode("v-if", true)
  33858. ]),
  33859. _: 3
  33860. }, 16, ["popper-class", "popper-style", "teleported", "hide-after", "persistent"]);
  33861. };
  33862. }
  33863. });
  33864. var Popconfirm = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__file", "popconfirm.vue"]]);
  33865. const ElPopconfirm = withInstall(Popconfirm);
  33866. const popoverProps = buildProps({
  33867. trigger: useTooltipTriggerProps.trigger,
  33868. placement: dropdownProps.placement,
  33869. disabled: useTooltipTriggerProps.disabled,
  33870. visible: useTooltipContentProps.visible,
  33871. transition: useTooltipContentProps.transition,
  33872. popperOptions: dropdownProps.popperOptions,
  33873. tabindex: dropdownProps.tabindex,
  33874. content: useTooltipContentProps.content,
  33875. popperStyle: useTooltipContentProps.popperStyle,
  33876. popperClass: useTooltipContentProps.popperClass,
  33877. enterable: {
  33878. ...useTooltipContentProps.enterable,
  33879. default: true
  33880. },
  33881. effect: {
  33882. ...useTooltipContentProps.effect,
  33883. default: "light"
  33884. },
  33885. teleported: useTooltipContentProps.teleported,
  33886. title: String,
  33887. width: {
  33888. type: [String, Number],
  33889. default: 150
  33890. },
  33891. offset: {
  33892. type: Number,
  33893. default: void 0
  33894. },
  33895. showAfter: {
  33896. type: Number,
  33897. default: 0
  33898. },
  33899. hideAfter: {
  33900. type: Number,
  33901. default: 200
  33902. },
  33903. autoClose: {
  33904. type: Number,
  33905. default: 0
  33906. },
  33907. showArrow: {
  33908. type: Boolean,
  33909. default: true
  33910. },
  33911. persistent: {
  33912. type: Boolean,
  33913. default: true
  33914. },
  33915. "onUpdate:visible": {
  33916. type: Function
  33917. }
  33918. });
  33919. const popoverEmits = {
  33920. "update:visible": (value) => isBoolean(value),
  33921. "before-enter": () => true,
  33922. "before-leave": () => true,
  33923. "after-enter": () => true,
  33924. "after-leave": () => true
  33925. };
  33926. const updateEventKeyRaw = `onUpdate:visible`;
  33927. const __default__$x = vue.defineComponent({
  33928. name: "ElPopover"
  33929. });
  33930. const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
  33931. ...__default__$x,
  33932. props: popoverProps,
  33933. emits: popoverEmits,
  33934. setup(__props, { expose, emit }) {
  33935. const props = __props;
  33936. const onUpdateVisible = vue.computed(() => {
  33937. return props[updateEventKeyRaw];
  33938. });
  33939. const ns = useNamespace("popover");
  33940. const tooltipRef = vue.ref();
  33941. const popperRef = vue.computed(() => {
  33942. var _a;
  33943. return (_a = vue.unref(tooltipRef)) == null ? void 0 : _a.popperRef;
  33944. });
  33945. const style = vue.computed(() => {
  33946. return [
  33947. {
  33948. width: addUnit(props.width)
  33949. },
  33950. props.popperStyle
  33951. ];
  33952. });
  33953. const kls = vue.computed(() => {
  33954. return [ns.b(), props.popperClass, { [ns.m("plain")]: !!props.content }];
  33955. });
  33956. const gpuAcceleration = vue.computed(() => {
  33957. return props.transition === `${ns.namespace.value}-fade-in-linear`;
  33958. });
  33959. const hide = () => {
  33960. var _a;
  33961. (_a = tooltipRef.value) == null ? void 0 : _a.hide();
  33962. };
  33963. const beforeEnter = () => {
  33964. emit("before-enter");
  33965. };
  33966. const beforeLeave = () => {
  33967. emit("before-leave");
  33968. };
  33969. const afterEnter = () => {
  33970. emit("after-enter");
  33971. };
  33972. const afterLeave = () => {
  33973. emit("update:visible", false);
  33974. emit("after-leave");
  33975. };
  33976. expose({
  33977. popperRef,
  33978. hide
  33979. });
  33980. return (_ctx, _cache) => {
  33981. return vue.openBlock(), vue.createBlock(vue.unref(ElTooltip), vue.mergeProps({
  33982. ref_key: "tooltipRef",
  33983. ref: tooltipRef
  33984. }, _ctx.$attrs, {
  33985. trigger: _ctx.trigger,
  33986. placement: _ctx.placement,
  33987. disabled: _ctx.disabled,
  33988. visible: _ctx.visible,
  33989. transition: _ctx.transition,
  33990. "popper-options": _ctx.popperOptions,
  33991. tabindex: _ctx.tabindex,
  33992. content: _ctx.content,
  33993. offset: _ctx.offset,
  33994. "show-after": _ctx.showAfter,
  33995. "hide-after": _ctx.hideAfter,
  33996. "auto-close": _ctx.autoClose,
  33997. "show-arrow": _ctx.showArrow,
  33998. "aria-label": _ctx.title,
  33999. effect: _ctx.effect,
  34000. enterable: _ctx.enterable,
  34001. "popper-class": vue.unref(kls),
  34002. "popper-style": vue.unref(style),
  34003. teleported: _ctx.teleported,
  34004. persistent: _ctx.persistent,
  34005. "gpu-acceleration": vue.unref(gpuAcceleration),
  34006. "onUpdate:visible": vue.unref(onUpdateVisible),
  34007. onBeforeShow: beforeEnter,
  34008. onBeforeHide: beforeLeave,
  34009. onShow: afterEnter,
  34010. onHide: afterLeave
  34011. }), {
  34012. content: vue.withCtx(() => [
  34013. _ctx.title ? (vue.openBlock(), vue.createElementBlock("div", {
  34014. key: 0,
  34015. class: vue.normalizeClass(vue.unref(ns).e("title")),
  34016. role: "title"
  34017. }, vue.toDisplayString(_ctx.title), 3)) : vue.createCommentVNode("v-if", true),
  34018. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  34019. vue.createTextVNode(vue.toDisplayString(_ctx.content), 1)
  34020. ])
  34021. ]),
  34022. default: vue.withCtx(() => [
  34023. _ctx.$slots.reference ? vue.renderSlot(_ctx.$slots, "reference", { key: 0 }) : vue.createCommentVNode("v-if", true)
  34024. ]),
  34025. _: 3
  34026. }, 16, ["trigger", "placement", "disabled", "visible", "transition", "popper-options", "tabindex", "content", "offset", "show-after", "hide-after", "auto-close", "show-arrow", "aria-label", "effect", "enterable", "popper-class", "popper-style", "teleported", "persistent", "gpu-acceleration", "onUpdate:visible"]);
  34027. };
  34028. }
  34029. });
  34030. var Popover = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__file", "popover.vue"]]);
  34031. const attachEvents = (el, binding) => {
  34032. const popperComponent = binding.arg || binding.value;
  34033. const popover = popperComponent == null ? void 0 : popperComponent.popperRef;
  34034. if (popover) {
  34035. popover.triggerRef = el;
  34036. }
  34037. };
  34038. var PopoverDirective = {
  34039. mounted(el, binding) {
  34040. attachEvents(el, binding);
  34041. },
  34042. updated(el, binding) {
  34043. attachEvents(el, binding);
  34044. }
  34045. };
  34046. const VPopover = "popover";
  34047. const ElPopoverDirective = withInstallDirective(PopoverDirective, VPopover);
  34048. const ElPopover = withInstall(Popover, {
  34049. directive: ElPopoverDirective
  34050. });
  34051. const progressProps = buildProps({
  34052. type: {
  34053. type: String,
  34054. default: "line",
  34055. values: ["line", "circle", "dashboard"]
  34056. },
  34057. percentage: {
  34058. type: Number,
  34059. default: 0,
  34060. validator: (val) => val >= 0 && val <= 100
  34061. },
  34062. status: {
  34063. type: String,
  34064. default: "",
  34065. values: ["", "success", "exception", "warning"]
  34066. },
  34067. indeterminate: {
  34068. type: Boolean,
  34069. default: false
  34070. },
  34071. duration: {
  34072. type: Number,
  34073. default: 3
  34074. },
  34075. strokeWidth: {
  34076. type: Number,
  34077. default: 6
  34078. },
  34079. strokeLinecap: {
  34080. type: definePropType(String),
  34081. default: "round"
  34082. },
  34083. textInside: {
  34084. type: Boolean,
  34085. default: false
  34086. },
  34087. width: {
  34088. type: Number,
  34089. default: 126
  34090. },
  34091. showText: {
  34092. type: Boolean,
  34093. default: true
  34094. },
  34095. color: {
  34096. type: definePropType([
  34097. String,
  34098. Array,
  34099. Function
  34100. ]),
  34101. default: ""
  34102. },
  34103. format: {
  34104. type: definePropType(Function),
  34105. default: (percentage) => `${percentage}%`
  34106. }
  34107. });
  34108. const _hoisted_1$j = ["aria-valuenow"];
  34109. const _hoisted_2$d = { viewBox: "0 0 100 100" };
  34110. const _hoisted_3$6 = ["d", "stroke", "stroke-width"];
  34111. const _hoisted_4$4 = ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"];
  34112. const _hoisted_5$3 = { key: 0 };
  34113. const __default__$w = vue.defineComponent({
  34114. name: "ElProgress"
  34115. });
  34116. const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
  34117. ...__default__$w,
  34118. props: progressProps,
  34119. setup(__props) {
  34120. const props = __props;
  34121. const STATUS_COLOR_MAP = {
  34122. success: "#13ce66",
  34123. exception: "#ff4949",
  34124. warning: "#e6a23c",
  34125. default: "#20a0ff"
  34126. };
  34127. const ns = useNamespace("progress");
  34128. const barStyle = vue.computed(() => ({
  34129. width: `${props.percentage}%`,
  34130. animationDuration: `${props.duration}s`,
  34131. backgroundColor: getCurrentColor(props.percentage)
  34132. }));
  34133. const relativeStrokeWidth = vue.computed(() => (props.strokeWidth / props.width * 100).toFixed(1));
  34134. const radius = vue.computed(() => {
  34135. if (["circle", "dashboard"].includes(props.type)) {
  34136. return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10);
  34137. }
  34138. return 0;
  34139. });
  34140. const trackPath = vue.computed(() => {
  34141. const r = radius.value;
  34142. const isDashboard = props.type === "dashboard";
  34143. return `
  34144. M 50 50
  34145. m 0 ${isDashboard ? "" : "-"}${r}
  34146. a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
  34147. a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
  34148. `;
  34149. });
  34150. const perimeter = vue.computed(() => 2 * Math.PI * radius.value);
  34151. const rate = vue.computed(() => props.type === "dashboard" ? 0.75 : 1);
  34152. const strokeDashoffset = vue.computed(() => {
  34153. const offset = -1 * perimeter.value * (1 - rate.value) / 2;
  34154. return `${offset}px`;
  34155. });
  34156. const trailPathStyle = vue.computed(() => ({
  34157. strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
  34158. strokeDashoffset: strokeDashoffset.value
  34159. }));
  34160. const circlePathStyle = vue.computed(() => ({
  34161. strokeDasharray: `${perimeter.value * rate.value * (props.percentage / 100)}px, ${perimeter.value}px`,
  34162. strokeDashoffset: strokeDashoffset.value,
  34163. transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
  34164. }));
  34165. const stroke = vue.computed(() => {
  34166. let ret;
  34167. if (props.color) {
  34168. ret = getCurrentColor(props.percentage);
  34169. } else {
  34170. ret = STATUS_COLOR_MAP[props.status] || STATUS_COLOR_MAP.default;
  34171. }
  34172. return ret;
  34173. });
  34174. const statusIcon = vue.computed(() => {
  34175. if (props.status === "warning") {
  34176. return warning_filled_default;
  34177. }
  34178. if (props.type === "line") {
  34179. return props.status === "success" ? circle_check_default : circle_close_default;
  34180. } else {
  34181. return props.status === "success" ? check_default : close_default;
  34182. }
  34183. });
  34184. const progressTextSize = vue.computed(() => {
  34185. return props.type === "line" ? 12 + props.strokeWidth * 0.4 : props.width * 0.111111 + 2;
  34186. });
  34187. const content = vue.computed(() => props.format(props.percentage));
  34188. function getColors(color) {
  34189. const span = 100 / color.length;
  34190. const seriesColors = color.map((seriesColor, index) => {
  34191. if (isString(seriesColor)) {
  34192. return {
  34193. color: seriesColor,
  34194. percentage: (index + 1) * span
  34195. };
  34196. }
  34197. return seriesColor;
  34198. });
  34199. return seriesColors.sort((a, b) => a.percentage - b.percentage);
  34200. }
  34201. const getCurrentColor = (percentage) => {
  34202. var _a;
  34203. const { color } = props;
  34204. if (isFunction(color)) {
  34205. return color(percentage);
  34206. } else if (isString(color)) {
  34207. return color;
  34208. } else {
  34209. const colors = getColors(color);
  34210. for (const color2 of colors) {
  34211. if (color2.percentage > percentage)
  34212. return color2.color;
  34213. }
  34214. return (_a = colors[colors.length - 1]) == null ? void 0 : _a.color;
  34215. }
  34216. };
  34217. return (_ctx, _cache) => {
  34218. return vue.openBlock(), vue.createElementBlock("div", {
  34219. class: vue.normalizeClass([
  34220. vue.unref(ns).b(),
  34221. vue.unref(ns).m(_ctx.type),
  34222. vue.unref(ns).is(_ctx.status),
  34223. {
  34224. [vue.unref(ns).m("without-text")]: !_ctx.showText,
  34225. [vue.unref(ns).m("text-inside")]: _ctx.textInside
  34226. }
  34227. ]),
  34228. role: "progressbar",
  34229. "aria-valuenow": _ctx.percentage,
  34230. "aria-valuemin": "0",
  34231. "aria-valuemax": "100"
  34232. }, [
  34233. _ctx.type === "line" ? (vue.openBlock(), vue.createElementBlock("div", {
  34234. key: 0,
  34235. class: vue.normalizeClass(vue.unref(ns).b("bar"))
  34236. }, [
  34237. vue.createElementVNode("div", {
  34238. class: vue.normalizeClass(vue.unref(ns).be("bar", "outer")),
  34239. style: vue.normalizeStyle({ height: `${_ctx.strokeWidth}px` })
  34240. }, [
  34241. vue.createElementVNode("div", {
  34242. class: vue.normalizeClass([
  34243. vue.unref(ns).be("bar", "inner"),
  34244. { [vue.unref(ns).bem("bar", "inner", "indeterminate")]: _ctx.indeterminate }
  34245. ]),
  34246. style: vue.normalizeStyle(vue.unref(barStyle))
  34247. }, [
  34248. (_ctx.showText || _ctx.$slots.default) && _ctx.textInside ? (vue.openBlock(), vue.createElementBlock("div", {
  34249. key: 0,
  34250. class: vue.normalizeClass(vue.unref(ns).be("bar", "innerText"))
  34251. }, [
  34252. vue.renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
  34253. vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(content)), 1)
  34254. ])
  34255. ], 2)) : vue.createCommentVNode("v-if", true)
  34256. ], 6)
  34257. ], 6)
  34258. ], 2)) : (vue.openBlock(), vue.createElementBlock("div", {
  34259. key: 1,
  34260. class: vue.normalizeClass(vue.unref(ns).b("circle")),
  34261. style: vue.normalizeStyle({ height: `${_ctx.width}px`, width: `${_ctx.width}px` })
  34262. }, [
  34263. (vue.openBlock(), vue.createElementBlock("svg", _hoisted_2$d, [
  34264. vue.createElementVNode("path", {
  34265. class: vue.normalizeClass(vue.unref(ns).be("circle", "track")),
  34266. d: vue.unref(trackPath),
  34267. stroke: `var(${vue.unref(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
  34268. "stroke-width": vue.unref(relativeStrokeWidth),
  34269. fill: "none",
  34270. style: vue.normalizeStyle(vue.unref(trailPathStyle))
  34271. }, null, 14, _hoisted_3$6),
  34272. vue.createElementVNode("path", {
  34273. class: vue.normalizeClass(vue.unref(ns).be("circle", "path")),
  34274. d: vue.unref(trackPath),
  34275. stroke: vue.unref(stroke),
  34276. fill: "none",
  34277. opacity: _ctx.percentage ? 1 : 0,
  34278. "stroke-linecap": _ctx.strokeLinecap,
  34279. "stroke-width": vue.unref(relativeStrokeWidth),
  34280. style: vue.normalizeStyle(vue.unref(circlePathStyle))
  34281. }, null, 14, _hoisted_4$4)
  34282. ]))
  34283. ], 6)),
  34284. (_ctx.showText || _ctx.$slots.default) && !_ctx.textInside ? (vue.openBlock(), vue.createElementBlock("div", {
  34285. key: 2,
  34286. class: vue.normalizeClass(vue.unref(ns).e("text")),
  34287. style: vue.normalizeStyle({ fontSize: `${vue.unref(progressTextSize)}px` })
  34288. }, [
  34289. vue.renderSlot(_ctx.$slots, "default", { percentage: _ctx.percentage }, () => [
  34290. !_ctx.status ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5$3, vue.toDisplayString(vue.unref(content)), 1)) : (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 1 }, {
  34291. default: vue.withCtx(() => [
  34292. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(statusIcon))))
  34293. ]),
  34294. _: 1
  34295. }))
  34296. ])
  34297. ], 6)) : vue.createCommentVNode("v-if", true)
  34298. ], 10, _hoisted_1$j);
  34299. };
  34300. }
  34301. });
  34302. var Progress = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__file", "progress.vue"]]);
  34303. const ElProgress = withInstall(Progress);
  34304. const rateProps = buildProps({
  34305. modelValue: {
  34306. type: Number,
  34307. default: 0
  34308. },
  34309. id: {
  34310. type: String,
  34311. default: void 0
  34312. },
  34313. lowThreshold: {
  34314. type: Number,
  34315. default: 2
  34316. },
  34317. highThreshold: {
  34318. type: Number,
  34319. default: 4
  34320. },
  34321. max: {
  34322. type: Number,
  34323. default: 5
  34324. },
  34325. colors: {
  34326. type: definePropType([Array, Object]),
  34327. default: () => mutable(["", "", ""])
  34328. },
  34329. voidColor: {
  34330. type: String,
  34331. default: ""
  34332. },
  34333. disabledVoidColor: {
  34334. type: String,
  34335. default: ""
  34336. },
  34337. icons: {
  34338. type: definePropType([Array, Object]),
  34339. default: () => [star_filled_default, star_filled_default, star_filled_default]
  34340. },
  34341. voidIcon: {
  34342. type: iconPropType,
  34343. default: () => star_default
  34344. },
  34345. disabledVoidIcon: {
  34346. type: iconPropType,
  34347. default: () => star_filled_default
  34348. },
  34349. disabled: {
  34350. type: Boolean
  34351. },
  34352. allowHalf: {
  34353. type: Boolean
  34354. },
  34355. showText: {
  34356. type: Boolean
  34357. },
  34358. showScore: {
  34359. type: Boolean
  34360. },
  34361. textColor: {
  34362. type: String,
  34363. default: ""
  34364. },
  34365. texts: {
  34366. type: definePropType(Array),
  34367. default: () => mutable([
  34368. "Extremely bad",
  34369. "Disappointed",
  34370. "Fair",
  34371. "Satisfied",
  34372. "Surprise"
  34373. ])
  34374. },
  34375. scoreTemplate: {
  34376. type: String,
  34377. default: "{value}"
  34378. },
  34379. size: {
  34380. type: String,
  34381. validator: isValidComponentSize
  34382. },
  34383. label: {
  34384. type: String,
  34385. default: void 0
  34386. },
  34387. clearable: {
  34388. type: Boolean,
  34389. default: false
  34390. }
  34391. });
  34392. const rateEmits = {
  34393. [CHANGE_EVENT]: (value) => isNumber(value),
  34394. [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
  34395. };
  34396. const _hoisted_1$i = ["id", "aria-label", "aria-labelledby", "aria-valuenow", "aria-valuetext", "aria-valuemax"];
  34397. const _hoisted_2$c = ["onMousemove", "onClick"];
  34398. const __default__$v = vue.defineComponent({
  34399. name: "ElRate"
  34400. });
  34401. const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
  34402. ...__default__$v,
  34403. props: rateProps,
  34404. emits: rateEmits,
  34405. setup(__props, { expose, emit }) {
  34406. const props = __props;
  34407. function getValueFromMap(value, map) {
  34408. const isExcludedObject = (val) => isObject$1(val);
  34409. const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
  34410. const val = map[key];
  34411. const excluded = isExcludedObject(val) ? val.excluded : false;
  34412. return excluded ? value < key : value <= key;
  34413. }).sort((a, b) => a - b);
  34414. const matchedValue = map[matchedKeys[0]];
  34415. return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
  34416. }
  34417. const formContext = vue.inject(formContextKey, void 0);
  34418. const formItemContext = vue.inject(formItemContextKey, void 0);
  34419. const rateSize = useSize();
  34420. const ns = useNamespace("rate");
  34421. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
  34422. formItemContext
  34423. });
  34424. const currentValue = vue.ref(props.modelValue);
  34425. const hoverIndex = vue.ref(-1);
  34426. const pointerAtLeftHalf = vue.ref(true);
  34427. const rateClasses = vue.computed(() => [ns.b(), ns.m(rateSize.value)]);
  34428. const rateDisabled = vue.computed(() => props.disabled || (formContext == null ? void 0 : formContext.disabled));
  34429. const rateStyles = vue.computed(() => {
  34430. return ns.cssVarBlock({
  34431. "void-color": props.voidColor,
  34432. "disabled-void-color": props.disabledVoidColor,
  34433. "fill-color": activeColor.value
  34434. });
  34435. });
  34436. const text = vue.computed(() => {
  34437. let result = "";
  34438. if (props.showScore) {
  34439. result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
  34440. } else if (props.showText) {
  34441. result = props.texts[Math.ceil(currentValue.value) - 1];
  34442. }
  34443. return result;
  34444. });
  34445. const valueDecimal = vue.computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
  34446. const colorMap = vue.computed(() => isArray(props.colors) ? {
  34447. [props.lowThreshold]: props.colors[0],
  34448. [props.highThreshold]: { value: props.colors[1], excluded: true },
  34449. [props.max]: props.colors[2]
  34450. } : props.colors);
  34451. const activeColor = vue.computed(() => {
  34452. const color = getValueFromMap(currentValue.value, colorMap.value);
  34453. return isObject$1(color) ? "" : color;
  34454. });
  34455. const decimalStyle = vue.computed(() => {
  34456. let width = "";
  34457. if (rateDisabled.value) {
  34458. width = `${valueDecimal.value}%`;
  34459. } else if (props.allowHalf) {
  34460. width = "50%";
  34461. }
  34462. return {
  34463. color: activeColor.value,
  34464. width
  34465. };
  34466. });
  34467. const componentMap = vue.computed(() => {
  34468. let icons = isArray(props.icons) ? [...props.icons] : { ...props.icons };
  34469. icons = vue.markRaw(icons);
  34470. return isArray(icons) ? {
  34471. [props.lowThreshold]: icons[0],
  34472. [props.highThreshold]: {
  34473. value: icons[1],
  34474. excluded: true
  34475. },
  34476. [props.max]: icons[2]
  34477. } : icons;
  34478. });
  34479. const decimalIconComponent = vue.computed(() => getValueFromMap(props.modelValue, componentMap.value));
  34480. const voidComponent = vue.computed(() => rateDisabled.value ? isString(props.disabledVoidIcon) ? props.disabledVoidIcon : vue.markRaw(props.disabledVoidIcon) : isString(props.voidIcon) ? props.voidIcon : vue.markRaw(props.voidIcon));
  34481. const activeComponent = vue.computed(() => getValueFromMap(currentValue.value, componentMap.value));
  34482. function showDecimalIcon(item) {
  34483. const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
  34484. const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
  34485. return showWhenDisabled || showWhenAllowHalf;
  34486. }
  34487. function emitValue(value) {
  34488. if (props.clearable && value === props.modelValue) {
  34489. value = 0;
  34490. }
  34491. emit(UPDATE_MODEL_EVENT, value);
  34492. if (props.modelValue !== value) {
  34493. emit("change", value);
  34494. }
  34495. }
  34496. function selectValue(value) {
  34497. if (rateDisabled.value) {
  34498. return;
  34499. }
  34500. if (props.allowHalf && pointerAtLeftHalf.value) {
  34501. emitValue(currentValue.value);
  34502. } else {
  34503. emitValue(value);
  34504. }
  34505. }
  34506. function handleKey(e) {
  34507. if (rateDisabled.value) {
  34508. return;
  34509. }
  34510. let _currentValue = currentValue.value;
  34511. const code = e.code;
  34512. if (code === EVENT_CODE.up || code === EVENT_CODE.right) {
  34513. if (props.allowHalf) {
  34514. _currentValue += 0.5;
  34515. } else {
  34516. _currentValue += 1;
  34517. }
  34518. e.stopPropagation();
  34519. e.preventDefault();
  34520. } else if (code === EVENT_CODE.left || code === EVENT_CODE.down) {
  34521. if (props.allowHalf) {
  34522. _currentValue -= 0.5;
  34523. } else {
  34524. _currentValue -= 1;
  34525. }
  34526. e.stopPropagation();
  34527. e.preventDefault();
  34528. }
  34529. _currentValue = _currentValue < 0 ? 0 : _currentValue;
  34530. _currentValue = _currentValue > props.max ? props.max : _currentValue;
  34531. emit(UPDATE_MODEL_EVENT, _currentValue);
  34532. emit("change", _currentValue);
  34533. return _currentValue;
  34534. }
  34535. function setCurrentValue(value, event) {
  34536. if (rateDisabled.value) {
  34537. return;
  34538. }
  34539. if (props.allowHalf) {
  34540. let target = event.target;
  34541. if (hasClass(target, ns.e("item"))) {
  34542. target = target.querySelector(`.${ns.e("icon")}`);
  34543. }
  34544. if (target.clientWidth === 0 || hasClass(target, ns.e("decimal"))) {
  34545. target = target.parentNode;
  34546. }
  34547. pointerAtLeftHalf.value = event.offsetX * 2 <= target.clientWidth;
  34548. currentValue.value = pointerAtLeftHalf.value ? value - 0.5 : value;
  34549. } else {
  34550. currentValue.value = value;
  34551. }
  34552. hoverIndex.value = value;
  34553. }
  34554. function resetCurrentValue() {
  34555. if (rateDisabled.value) {
  34556. return;
  34557. }
  34558. if (props.allowHalf) {
  34559. pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  34560. }
  34561. currentValue.value = props.modelValue;
  34562. hoverIndex.value = -1;
  34563. }
  34564. vue.watch(() => props.modelValue, (val) => {
  34565. currentValue.value = val;
  34566. pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  34567. });
  34568. if (!props.modelValue) {
  34569. emit(UPDATE_MODEL_EVENT, 0);
  34570. }
  34571. expose({
  34572. setCurrentValue,
  34573. resetCurrentValue
  34574. });
  34575. return (_ctx, _cache) => {
  34576. var _a;
  34577. return vue.openBlock(), vue.createElementBlock("div", {
  34578. id: vue.unref(inputId),
  34579. class: vue.normalizeClass([vue.unref(rateClasses), vue.unref(ns).is("disabled", vue.unref(rateDisabled))]),
  34580. role: "slider",
  34581. "aria-label": !vue.unref(isLabeledByFormItem) ? _ctx.label || "rating" : void 0,
  34582. "aria-labelledby": vue.unref(isLabeledByFormItem) ? (_a = vue.unref(formItemContext)) == null ? void 0 : _a.labelId : void 0,
  34583. "aria-valuenow": currentValue.value,
  34584. "aria-valuetext": vue.unref(text) || void 0,
  34585. "aria-valuemin": "0",
  34586. "aria-valuemax": _ctx.max,
  34587. tabindex: "0",
  34588. style: vue.normalizeStyle(vue.unref(rateStyles)),
  34589. onKeydown: handleKey
  34590. }, [
  34591. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.max, (item, key) => {
  34592. return vue.openBlock(), vue.createElementBlock("span", {
  34593. key,
  34594. class: vue.normalizeClass(vue.unref(ns).e("item")),
  34595. onMousemove: ($event) => setCurrentValue(item, $event),
  34596. onMouseleave: resetCurrentValue,
  34597. onClick: ($event) => selectValue(item)
  34598. }, [
  34599. vue.createVNode(vue.unref(ElIcon), {
  34600. class: vue.normalizeClass([
  34601. vue.unref(ns).e("icon"),
  34602. { hover: hoverIndex.value === item },
  34603. vue.unref(ns).is("active", item <= currentValue.value)
  34604. ])
  34605. }, {
  34606. default: vue.withCtx(() => [
  34607. !showDecimalIcon(item) ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  34608. vue.withDirectives((vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(activeComponent)), null, null, 512)), [
  34609. [vue.vShow, item <= currentValue.value]
  34610. ]),
  34611. vue.withDirectives((vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(voidComponent)), null, null, 512)), [
  34612. [vue.vShow, !(item <= currentValue.value)]
  34613. ])
  34614. ], 64)) : vue.createCommentVNode("v-if", true),
  34615. showDecimalIcon(item) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  34616. key: 1,
  34617. style: vue.normalizeStyle(vue.unref(decimalStyle)),
  34618. class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(ns).e("decimal")])
  34619. }, {
  34620. default: vue.withCtx(() => [
  34621. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(decimalIconComponent))))
  34622. ]),
  34623. _: 1
  34624. }, 8, ["style", "class"])) : vue.createCommentVNode("v-if", true)
  34625. ]),
  34626. _: 2
  34627. }, 1032, ["class"])
  34628. ], 42, _hoisted_2$c);
  34629. }), 128)),
  34630. _ctx.showText || _ctx.showScore ? (vue.openBlock(), vue.createElementBlock("span", {
  34631. key: 0,
  34632. class: vue.normalizeClass(vue.unref(ns).e("text"))
  34633. }, vue.toDisplayString(vue.unref(text)), 3)) : vue.createCommentVNode("v-if", true)
  34634. ], 46, _hoisted_1$i);
  34635. };
  34636. }
  34637. });
  34638. var Rate = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__file", "rate.vue"]]);
  34639. const ElRate = withInstall(Rate);
  34640. const IconMap = {
  34641. success: "icon-success",
  34642. warning: "icon-warning",
  34643. error: "icon-error",
  34644. info: "icon-info"
  34645. };
  34646. const IconComponentMap = {
  34647. [IconMap.success]: circle_check_filled_default,
  34648. [IconMap.warning]: warning_filled_default,
  34649. [IconMap.error]: circle_close_filled_default,
  34650. [IconMap.info]: info_filled_default
  34651. };
  34652. const resultProps = buildProps({
  34653. title: {
  34654. type: String,
  34655. default: ""
  34656. },
  34657. subTitle: {
  34658. type: String,
  34659. default: ""
  34660. },
  34661. icon: {
  34662. type: String,
  34663. values: ["success", "warning", "info", "error"],
  34664. default: "info"
  34665. }
  34666. });
  34667. const __default__$u = vue.defineComponent({
  34668. name: "ElResult"
  34669. });
  34670. const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
  34671. ...__default__$u,
  34672. props: resultProps,
  34673. setup(__props) {
  34674. const props = __props;
  34675. const ns = useNamespace("result");
  34676. const resultIcon = vue.computed(() => {
  34677. const icon = props.icon;
  34678. const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
  34679. const iconComponent = IconComponentMap[iconClass] || IconComponentMap["icon-info"];
  34680. return {
  34681. class: iconClass,
  34682. component: iconComponent
  34683. };
  34684. });
  34685. return (_ctx, _cache) => {
  34686. return vue.openBlock(), vue.createElementBlock("div", {
  34687. class: vue.normalizeClass(vue.unref(ns).b())
  34688. }, [
  34689. vue.createElementVNode("div", {
  34690. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  34691. }, [
  34692. vue.renderSlot(_ctx.$slots, "icon", {}, () => [
  34693. vue.unref(resultIcon).component ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(resultIcon).component), {
  34694. key: 0,
  34695. class: vue.normalizeClass(vue.unref(resultIcon).class)
  34696. }, null, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  34697. ])
  34698. ], 2),
  34699. _ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("div", {
  34700. key: 0,
  34701. class: vue.normalizeClass(vue.unref(ns).e("title"))
  34702. }, [
  34703. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  34704. vue.createElementVNode("p", null, vue.toDisplayString(_ctx.title), 1)
  34705. ])
  34706. ], 2)) : vue.createCommentVNode("v-if", true),
  34707. _ctx.subTitle || _ctx.$slots["sub-title"] ? (vue.openBlock(), vue.createElementBlock("div", {
  34708. key: 1,
  34709. class: vue.normalizeClass(vue.unref(ns).e("subtitle"))
  34710. }, [
  34711. vue.renderSlot(_ctx.$slots, "sub-title", {}, () => [
  34712. vue.createElementVNode("p", null, vue.toDisplayString(_ctx.subTitle), 1)
  34713. ])
  34714. ], 2)) : vue.createCommentVNode("v-if", true),
  34715. _ctx.$slots.extra ? (vue.openBlock(), vue.createElementBlock("div", {
  34716. key: 2,
  34717. class: vue.normalizeClass(vue.unref(ns).e("extra"))
  34718. }, [
  34719. vue.renderSlot(_ctx.$slots, "extra")
  34720. ], 2)) : vue.createCommentVNode("v-if", true)
  34721. ], 2);
  34722. };
  34723. }
  34724. });
  34725. var Result = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__file", "result.vue"]]);
  34726. const ElResult = withInstall(Result);
  34727. const RowJustify = [
  34728. "start",
  34729. "center",
  34730. "end",
  34731. "space-around",
  34732. "space-between",
  34733. "space-evenly"
  34734. ];
  34735. const RowAlign = ["top", "middle", "bottom"];
  34736. const rowProps = buildProps({
  34737. tag: {
  34738. type: String,
  34739. default: "div"
  34740. },
  34741. gutter: {
  34742. type: Number,
  34743. default: 0
  34744. },
  34745. justify: {
  34746. type: String,
  34747. values: RowJustify,
  34748. default: "start"
  34749. },
  34750. align: {
  34751. type: String,
  34752. values: RowAlign,
  34753. default: "top"
  34754. }
  34755. });
  34756. const __default__$t = vue.defineComponent({
  34757. name: "ElRow"
  34758. });
  34759. const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
  34760. ...__default__$t,
  34761. props: rowProps,
  34762. setup(__props) {
  34763. const props = __props;
  34764. const ns = useNamespace("row");
  34765. const gutter = vue.computed(() => props.gutter);
  34766. vue.provide(rowContextKey, {
  34767. gutter
  34768. });
  34769. const style = vue.computed(() => {
  34770. const styles = {};
  34771. if (!props.gutter) {
  34772. return styles;
  34773. }
  34774. styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
  34775. return styles;
  34776. });
  34777. const rowKls = vue.computed(() => [
  34778. ns.b(),
  34779. ns.is(`justify-${props.justify}`, props.justify !== "start"),
  34780. ns.is(`align-${props.align}`, props.align !== "top")
  34781. ]);
  34782. return (_ctx, _cache) => {
  34783. return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), {
  34784. class: vue.normalizeClass(vue.unref(rowKls)),
  34785. style: vue.normalizeStyle(vue.unref(style))
  34786. }, {
  34787. default: vue.withCtx(() => [
  34788. vue.renderSlot(_ctx.$slots, "default")
  34789. ]),
  34790. _: 3
  34791. }, 8, ["class", "style"]);
  34792. };
  34793. }
  34794. });
  34795. var Row$1 = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__file", "row.vue"]]);
  34796. const ElRow = withInstall(Row$1);
  34797. var safeIsNaN = Number.isNaN || function ponyfill(value) {
  34798. return typeof value === "number" && value !== value;
  34799. };
  34800. function isEqual(first, second) {
  34801. if (first === second) {
  34802. return true;
  34803. }
  34804. if (safeIsNaN(first) && safeIsNaN(second)) {
  34805. return true;
  34806. }
  34807. return false;
  34808. }
  34809. function areInputsEqual(newInputs, lastInputs) {
  34810. if (newInputs.length !== lastInputs.length) {
  34811. return false;
  34812. }
  34813. for (var i = 0; i < newInputs.length; i++) {
  34814. if (!isEqual(newInputs[i], lastInputs[i])) {
  34815. return false;
  34816. }
  34817. }
  34818. return true;
  34819. }
  34820. function memoizeOne(resultFn, isEqual2) {
  34821. if (isEqual2 === void 0) {
  34822. isEqual2 = areInputsEqual;
  34823. }
  34824. var cache = null;
  34825. function memoized() {
  34826. var newArgs = [];
  34827. for (var _i = 0; _i < arguments.length; _i++) {
  34828. newArgs[_i] = arguments[_i];
  34829. }
  34830. if (cache && cache.lastThis === this && isEqual2(newArgs, cache.lastArgs)) {
  34831. return cache.lastResult;
  34832. }
  34833. var lastResult = resultFn.apply(this, newArgs);
  34834. cache = {
  34835. lastResult,
  34836. lastArgs: newArgs,
  34837. lastThis: this
  34838. };
  34839. return lastResult;
  34840. }
  34841. memoized.clear = function clear() {
  34842. cache = null;
  34843. };
  34844. return memoized;
  34845. }
  34846. const useCache = () => {
  34847. const vm = vue.getCurrentInstance();
  34848. const props = vm.proxy.$props;
  34849. return vue.computed(() => {
  34850. const _getItemStyleCache = (_, __, ___) => ({});
  34851. return props.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
  34852. });
  34853. };
  34854. const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
  34855. const ITEM_RENDER_EVT = "itemRendered";
  34856. const SCROLL_EVT = "scroll";
  34857. const FORWARD = "forward";
  34858. const BACKWARD = "backward";
  34859. const AUTO_ALIGNMENT = "auto";
  34860. const SMART_ALIGNMENT = "smart";
  34861. const START_ALIGNMENT = "start";
  34862. const CENTERED_ALIGNMENT = "center";
  34863. const END_ALIGNMENT = "end";
  34864. const HORIZONTAL = "horizontal";
  34865. const VERTICAL = "vertical";
  34866. const LTR = "ltr";
  34867. const RTL = "rtl";
  34868. const RTL_OFFSET_NAG = "negative";
  34869. const RTL_OFFSET_POS_ASC = "positive-ascending";
  34870. const RTL_OFFSET_POS_DESC = "positive-descending";
  34871. const ScrollbarDirKey = {
  34872. [HORIZONTAL]: "left",
  34873. [VERTICAL]: "top"
  34874. };
  34875. const SCROLLBAR_MIN_SIZE = 20;
  34876. const LayoutKeys = {
  34877. [HORIZONTAL]: "deltaX",
  34878. [VERTICAL]: "deltaY"
  34879. };
  34880. const useWheel = ({ atEndEdge, atStartEdge, layout }, onWheelDelta) => {
  34881. let frameHandle;
  34882. let offset = 0;
  34883. const hasReachedEdge = (offset2) => {
  34884. const edgeReached = offset2 < 0 && atStartEdge.value || offset2 > 0 && atEndEdge.value;
  34885. return edgeReached;
  34886. };
  34887. const onWheel = (e) => {
  34888. cAF(frameHandle);
  34889. const newOffset = e[LayoutKeys[layout.value]];
  34890. if (hasReachedEdge(offset) && hasReachedEdge(offset + newOffset))
  34891. return;
  34892. offset += newOffset;
  34893. if (!isFirefox()) {
  34894. e.preventDefault();
  34895. }
  34896. frameHandle = rAF(() => {
  34897. onWheelDelta(offset);
  34898. offset = 0;
  34899. });
  34900. };
  34901. return {
  34902. hasReachedEdge,
  34903. onWheel
  34904. };
  34905. };
  34906. var useWheel$1 = useWheel;
  34907. const itemSize$1 = buildProp({
  34908. type: definePropType([Number, Function]),
  34909. required: true
  34910. });
  34911. const estimatedItemSize = buildProp({
  34912. type: Number
  34913. });
  34914. const cache = buildProp({
  34915. type: Number,
  34916. default: 2
  34917. });
  34918. const direction = buildProp({
  34919. type: String,
  34920. values: ["ltr", "rtl"],
  34921. default: "ltr"
  34922. });
  34923. const initScrollOffset = buildProp({
  34924. type: Number,
  34925. default: 0
  34926. });
  34927. const total = buildProp({
  34928. type: Number,
  34929. required: true
  34930. });
  34931. const layout = buildProp({
  34932. type: String,
  34933. values: ["horizontal", "vertical"],
  34934. default: VERTICAL
  34935. });
  34936. const virtualizedProps = buildProps({
  34937. className: {
  34938. type: String,
  34939. default: ""
  34940. },
  34941. containerElement: {
  34942. type: definePropType([String, Object]),
  34943. default: "div"
  34944. },
  34945. data: {
  34946. type: definePropType(Array),
  34947. default: () => mutable([])
  34948. },
  34949. direction,
  34950. height: {
  34951. type: [String, Number],
  34952. required: true
  34953. },
  34954. innerElement: {
  34955. type: [String, Object],
  34956. default: "div"
  34957. },
  34958. style: {
  34959. type: definePropType([Object, String, Array])
  34960. },
  34961. useIsScrolling: {
  34962. type: Boolean,
  34963. default: false
  34964. },
  34965. width: {
  34966. type: [Number, String],
  34967. required: false
  34968. },
  34969. perfMode: {
  34970. type: Boolean,
  34971. default: true
  34972. },
  34973. scrollbarAlwaysOn: {
  34974. type: Boolean,
  34975. default: false
  34976. }
  34977. });
  34978. const virtualizedListProps = buildProps({
  34979. cache,
  34980. estimatedItemSize,
  34981. layout,
  34982. initScrollOffset,
  34983. total,
  34984. itemSize: itemSize$1,
  34985. ...virtualizedProps
  34986. });
  34987. const scrollbarSize = {
  34988. type: Number,
  34989. default: 6
  34990. };
  34991. const startGap = { type: Number, default: 0 };
  34992. const endGap = { type: Number, default: 2 };
  34993. const virtualizedGridProps = buildProps({
  34994. columnCache: cache,
  34995. columnWidth: itemSize$1,
  34996. estimatedColumnWidth: estimatedItemSize,
  34997. estimatedRowHeight: estimatedItemSize,
  34998. initScrollLeft: initScrollOffset,
  34999. initScrollTop: initScrollOffset,
  35000. itemKey: {
  35001. type: definePropType(Function),
  35002. default: ({
  35003. columnIndex,
  35004. rowIndex
  35005. }) => `${rowIndex}:${columnIndex}`
  35006. },
  35007. rowCache: cache,
  35008. rowHeight: itemSize$1,
  35009. totalColumn: total,
  35010. totalRow: total,
  35011. hScrollbarSize: scrollbarSize,
  35012. vScrollbarSize: scrollbarSize,
  35013. scrollbarStartGap: startGap,
  35014. scrollbarEndGap: endGap,
  35015. ...virtualizedProps
  35016. });
  35017. const virtualizedScrollbarProps = buildProps({
  35018. alwaysOn: Boolean,
  35019. class: String,
  35020. layout,
  35021. total,
  35022. ratio: {
  35023. type: Number,
  35024. required: true
  35025. },
  35026. clientSize: {
  35027. type: Number,
  35028. required: true
  35029. },
  35030. scrollFrom: {
  35031. type: Number,
  35032. required: true
  35033. },
  35034. scrollbarSize,
  35035. startGap,
  35036. endGap,
  35037. visible: Boolean
  35038. });
  35039. const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
  35040. const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
  35041. const isRTL = (dir) => dir === RTL;
  35042. let cachedRTLResult = null;
  35043. function getRTLOffsetType(recalculate = false) {
  35044. if (cachedRTLResult === null || recalculate) {
  35045. const outerDiv = document.createElement("div");
  35046. const outerStyle = outerDiv.style;
  35047. outerStyle.width = "50px";
  35048. outerStyle.height = "50px";
  35049. outerStyle.overflow = "scroll";
  35050. outerStyle.direction = "rtl";
  35051. const innerDiv = document.createElement("div");
  35052. const innerStyle = innerDiv.style;
  35053. innerStyle.width = "100px";
  35054. innerStyle.height = "100px";
  35055. outerDiv.appendChild(innerDiv);
  35056. document.body.appendChild(outerDiv);
  35057. if (outerDiv.scrollLeft > 0) {
  35058. cachedRTLResult = RTL_OFFSET_POS_DESC;
  35059. } else {
  35060. outerDiv.scrollLeft = 1;
  35061. if (outerDiv.scrollLeft === 0) {
  35062. cachedRTLResult = RTL_OFFSET_NAG;
  35063. } else {
  35064. cachedRTLResult = RTL_OFFSET_POS_ASC;
  35065. }
  35066. }
  35067. document.body.removeChild(outerDiv);
  35068. return cachedRTLResult;
  35069. }
  35070. return cachedRTLResult;
  35071. }
  35072. function renderThumbStyle({ move, size, bar }, layout) {
  35073. const style = {};
  35074. const translate = `translate${bar.axis}(${move}px)`;
  35075. style[bar.size] = size;
  35076. style.transform = translate;
  35077. style.msTransform = translate;
  35078. style.webkitTransform = translate;
  35079. if (layout === "horizontal") {
  35080. style.height = "100%";
  35081. } else {
  35082. style.width = "100%";
  35083. }
  35084. return style;
  35085. }
  35086. const ScrollBar = vue.defineComponent({
  35087. name: "ElVirtualScrollBar",
  35088. props: virtualizedScrollbarProps,
  35089. emits: ["scroll", "start-move", "stop-move"],
  35090. setup(props, { emit }) {
  35091. const GAP = vue.computed(() => props.startGap + props.endGap);
  35092. const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
  35093. const nsScrollbar = useNamespace("scrollbar");
  35094. const trackRef = vue.ref();
  35095. const thumbRef = vue.ref();
  35096. let frameHandle = null;
  35097. let onselectstartStore = null;
  35098. const state = vue.reactive({
  35099. isDragging: false,
  35100. traveled: 0
  35101. });
  35102. const bar = vue.computed(() => BAR_MAP[props.layout]);
  35103. const trackSize = vue.computed(() => props.clientSize - vue.unref(GAP));
  35104. const trackStyle = vue.computed(() => ({
  35105. position: "absolute",
  35106. width: `${HORIZONTAL === props.layout ? trackSize.value : props.scrollbarSize}px`,
  35107. height: `${HORIZONTAL === props.layout ? props.scrollbarSize : trackSize.value}px`,
  35108. [ScrollbarDirKey[props.layout]]: "2px",
  35109. right: "2px",
  35110. bottom: "2px",
  35111. borderRadius: "4px"
  35112. }));
  35113. const thumbSize = vue.computed(() => {
  35114. const ratio = props.ratio;
  35115. const clientSize = props.clientSize;
  35116. if (ratio >= 100) {
  35117. return Number.POSITIVE_INFINITY;
  35118. }
  35119. if (ratio >= 50) {
  35120. return ratio * clientSize / 100;
  35121. }
  35122. const SCROLLBAR_MAX_SIZE = clientSize / 3;
  35123. return Math.floor(Math.min(Math.max(ratio * clientSize, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
  35124. });
  35125. const thumbStyle = vue.computed(() => {
  35126. if (!Number.isFinite(thumbSize.value)) {
  35127. return {
  35128. display: "none"
  35129. };
  35130. }
  35131. const thumb = `${thumbSize.value}px`;
  35132. const style = renderThumbStyle({
  35133. bar: bar.value,
  35134. size: thumb,
  35135. move: state.traveled
  35136. }, props.layout);
  35137. return style;
  35138. });
  35139. const totalSteps = vue.computed(() => Math.floor(props.clientSize - thumbSize.value - vue.unref(GAP)));
  35140. const attachEvents = () => {
  35141. window.addEventListener("mousemove", onMouseMove);
  35142. window.addEventListener("mouseup", onMouseUp);
  35143. const thumbEl = vue.unref(thumbRef);
  35144. if (!thumbEl)
  35145. return;
  35146. onselectstartStore = document.onselectstart;
  35147. document.onselectstart = () => false;
  35148. thumbEl.addEventListener("touchmove", onMouseMove);
  35149. thumbEl.addEventListener("touchend", onMouseUp);
  35150. };
  35151. const detachEvents = () => {
  35152. window.removeEventListener("mousemove", onMouseMove);
  35153. window.removeEventListener("mouseup", onMouseUp);
  35154. document.onselectstart = onselectstartStore;
  35155. onselectstartStore = null;
  35156. const thumbEl = vue.unref(thumbRef);
  35157. if (!thumbEl)
  35158. return;
  35159. thumbEl.removeEventListener("touchmove", onMouseMove);
  35160. thumbEl.removeEventListener("touchend", onMouseUp);
  35161. };
  35162. const onThumbMouseDown = (e) => {
  35163. e.stopImmediatePropagation();
  35164. if (e.ctrlKey || [1, 2].includes(e.button)) {
  35165. return;
  35166. }
  35167. state.isDragging = true;
  35168. state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
  35169. emit("start-move");
  35170. attachEvents();
  35171. };
  35172. const onMouseUp = () => {
  35173. state.isDragging = false;
  35174. state[bar.value.axis] = 0;
  35175. emit("stop-move");
  35176. detachEvents();
  35177. };
  35178. const onMouseMove = (e) => {
  35179. const { isDragging } = state;
  35180. if (!isDragging)
  35181. return;
  35182. if (!thumbRef.value || !trackRef.value)
  35183. return;
  35184. const prevPage = state[bar.value.axis];
  35185. if (!prevPage)
  35186. return;
  35187. cAF(frameHandle);
  35188. const offset = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1;
  35189. const thumbClickPosition = thumbRef.value[bar.value.offset] - prevPage;
  35190. const distance = offset - thumbClickPosition;
  35191. frameHandle = rAF(() => {
  35192. state.traveled = Math.max(props.startGap, Math.min(distance, totalSteps.value));
  35193. emit("scroll", distance, totalSteps.value);
  35194. });
  35195. };
  35196. const clickTrackHandler = (e) => {
  35197. const offset = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]);
  35198. const thumbHalf = thumbRef.value[bar.value.offset] / 2;
  35199. const distance = offset - thumbHalf;
  35200. state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
  35201. emit("scroll", distance, totalSteps.value);
  35202. };
  35203. vue.watch(() => props.scrollFrom, (v) => {
  35204. if (state.isDragging)
  35205. return;
  35206. state.traveled = Math.ceil(v * totalSteps.value);
  35207. });
  35208. vue.onBeforeUnmount(() => {
  35209. detachEvents();
  35210. });
  35211. return () => {
  35212. return vue.h("div", {
  35213. role: "presentation",
  35214. ref: trackRef,
  35215. class: [
  35216. nsVirtualScrollbar.b(),
  35217. props.class,
  35218. (props.alwaysOn || state.isDragging) && "always-on"
  35219. ],
  35220. style: trackStyle.value,
  35221. onMousedown: vue.withModifiers(clickTrackHandler, ["stop", "prevent"]),
  35222. onTouchstartPrevent: onThumbMouseDown
  35223. }, vue.h("div", {
  35224. ref: thumbRef,
  35225. class: nsScrollbar.e("thumb"),
  35226. style: thumbStyle.value,
  35227. onMousedown: onThumbMouseDown
  35228. }, []));
  35229. };
  35230. }
  35231. });
  35232. var Scrollbar = ScrollBar;
  35233. const createList = ({
  35234. name,
  35235. getOffset,
  35236. getItemSize,
  35237. getItemOffset,
  35238. getEstimatedTotalSize,
  35239. getStartIndexForOffset,
  35240. getStopIndexForStartIndex,
  35241. initCache,
  35242. clearCache,
  35243. validateProps
  35244. }) => {
  35245. return vue.defineComponent({
  35246. name: name != null ? name : "ElVirtualList",
  35247. props: virtualizedListProps,
  35248. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  35249. setup(props, { emit, expose }) {
  35250. validateProps(props);
  35251. const instance = vue.getCurrentInstance();
  35252. const ns = useNamespace("vl");
  35253. const dynamicSizeCache = vue.ref(initCache(props, instance));
  35254. const getItemStyleCache = useCache();
  35255. const windowRef = vue.ref();
  35256. const innerRef = vue.ref();
  35257. const scrollbarRef = vue.ref();
  35258. const states = vue.ref({
  35259. isScrolling: false,
  35260. scrollDir: "forward",
  35261. scrollOffset: isNumber(props.initScrollOffset) ? props.initScrollOffset : 0,
  35262. updateRequested: false,
  35263. isScrollbarDragging: false,
  35264. scrollbarAlwaysOn: props.scrollbarAlwaysOn
  35265. });
  35266. const itemsToRender = vue.computed(() => {
  35267. const { total, cache } = props;
  35268. const { isScrolling, scrollDir, scrollOffset } = vue.unref(states);
  35269. if (total === 0) {
  35270. return [0, 0, 0, 0];
  35271. }
  35272. const startIndex = getStartIndexForOffset(props, scrollOffset, vue.unref(dynamicSizeCache));
  35273. const stopIndex = getStopIndexForStartIndex(props, startIndex, scrollOffset, vue.unref(dynamicSizeCache));
  35274. const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache) : 1;
  35275. const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache) : 1;
  35276. return [
  35277. Math.max(0, startIndex - cacheBackward),
  35278. Math.max(0, Math.min(total - 1, stopIndex + cacheForward)),
  35279. startIndex,
  35280. stopIndex
  35281. ];
  35282. });
  35283. const estimatedTotalSize = vue.computed(() => getEstimatedTotalSize(props, vue.unref(dynamicSizeCache)));
  35284. const _isHorizontal = vue.computed(() => isHorizontal(props.layout));
  35285. const windowStyle = vue.computed(() => [
  35286. {
  35287. position: "relative",
  35288. [`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
  35289. WebkitOverflowScrolling: "touch",
  35290. willChange: "transform"
  35291. },
  35292. {
  35293. direction: props.direction,
  35294. height: isNumber(props.height) ? `${props.height}px` : props.height,
  35295. width: isNumber(props.width) ? `${props.width}px` : props.width
  35296. },
  35297. props.style
  35298. ]);
  35299. const innerStyle = vue.computed(() => {
  35300. const size = vue.unref(estimatedTotalSize);
  35301. const horizontal = vue.unref(_isHorizontal);
  35302. return {
  35303. height: horizontal ? "100%" : `${size}px`,
  35304. pointerEvents: vue.unref(states).isScrolling ? "none" : void 0,
  35305. width: horizontal ? `${size}px` : "100%"
  35306. };
  35307. });
  35308. const clientSize = vue.computed(() => _isHorizontal.value ? props.width : props.height);
  35309. const { onWheel } = useWheel$1({
  35310. atStartEdge: vue.computed(() => states.value.scrollOffset <= 0),
  35311. atEndEdge: vue.computed(() => states.value.scrollOffset >= estimatedTotalSize.value),
  35312. layout: vue.computed(() => props.layout)
  35313. }, (offset) => {
  35314. var _a, _b;
  35315. (_b = (_a = scrollbarRef.value).onMouseUp) == null ? void 0 : _b.call(_a);
  35316. scrollTo(Math.min(states.value.scrollOffset + offset, estimatedTotalSize.value - clientSize.value));
  35317. });
  35318. const emitEvents = () => {
  35319. const { total } = props;
  35320. if (total > 0) {
  35321. const [cacheStart, cacheEnd, visibleStart, visibleEnd] = vue.unref(itemsToRender);
  35322. emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
  35323. }
  35324. const { scrollDir, scrollOffset, updateRequested } = vue.unref(states);
  35325. emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
  35326. };
  35327. const scrollVertically = (e) => {
  35328. const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
  35329. const _states = vue.unref(states);
  35330. if (_states.scrollOffset === scrollTop) {
  35331. return;
  35332. }
  35333. const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
  35334. states.value = {
  35335. ..._states,
  35336. isScrolling: true,
  35337. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  35338. scrollOffset,
  35339. updateRequested: false
  35340. };
  35341. vue.nextTick(resetIsScrolling);
  35342. };
  35343. const scrollHorizontally = (e) => {
  35344. const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
  35345. const _states = vue.unref(states);
  35346. if (_states.scrollOffset === scrollLeft) {
  35347. return;
  35348. }
  35349. const { direction } = props;
  35350. let scrollOffset = scrollLeft;
  35351. if (direction === RTL) {
  35352. switch (getRTLOffsetType()) {
  35353. case RTL_OFFSET_NAG: {
  35354. scrollOffset = -scrollLeft;
  35355. break;
  35356. }
  35357. case RTL_OFFSET_POS_DESC: {
  35358. scrollOffset = scrollWidth - clientWidth - scrollLeft;
  35359. break;
  35360. }
  35361. }
  35362. }
  35363. scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
  35364. states.value = {
  35365. ..._states,
  35366. isScrolling: true,
  35367. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  35368. scrollOffset,
  35369. updateRequested: false
  35370. };
  35371. vue.nextTick(resetIsScrolling);
  35372. };
  35373. const onScroll = (e) => {
  35374. vue.unref(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
  35375. emitEvents();
  35376. };
  35377. const onScrollbarScroll = (distanceToGo, totalSteps) => {
  35378. const offset = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
  35379. scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset));
  35380. };
  35381. const scrollTo = (offset) => {
  35382. offset = Math.max(offset, 0);
  35383. if (offset === vue.unref(states).scrollOffset) {
  35384. return;
  35385. }
  35386. states.value = {
  35387. ...vue.unref(states),
  35388. scrollOffset: offset,
  35389. scrollDir: getScrollDir(vue.unref(states).scrollOffset, offset),
  35390. updateRequested: true
  35391. };
  35392. vue.nextTick(resetIsScrolling);
  35393. };
  35394. const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
  35395. const { scrollOffset } = vue.unref(states);
  35396. idx = Math.max(0, Math.min(idx, props.total - 1));
  35397. scrollTo(getOffset(props, idx, alignment, scrollOffset, vue.unref(dynamicSizeCache)));
  35398. };
  35399. const getItemStyle = (idx) => {
  35400. const { direction, itemSize, layout } = props;
  35401. const itemStyleCache = getItemStyleCache.value(clearCache && itemSize, clearCache && layout, clearCache && direction);
  35402. let style;
  35403. if (hasOwn(itemStyleCache, String(idx))) {
  35404. style = itemStyleCache[idx];
  35405. } else {
  35406. const offset = getItemOffset(props, idx, vue.unref(dynamicSizeCache));
  35407. const size = getItemSize(props, idx, vue.unref(dynamicSizeCache));
  35408. const horizontal = vue.unref(_isHorizontal);
  35409. const isRtl = direction === RTL;
  35410. const offsetHorizontal = horizontal ? offset : 0;
  35411. itemStyleCache[idx] = style = {
  35412. position: "absolute",
  35413. left: isRtl ? void 0 : `${offsetHorizontal}px`,
  35414. right: isRtl ? `${offsetHorizontal}px` : void 0,
  35415. top: !horizontal ? `${offset}px` : 0,
  35416. height: !horizontal ? `${size}px` : "100%",
  35417. width: horizontal ? `${size}px` : "100%"
  35418. };
  35419. }
  35420. return style;
  35421. };
  35422. const resetIsScrolling = () => {
  35423. states.value.isScrolling = false;
  35424. vue.nextTick(() => {
  35425. getItemStyleCache.value(-1, null, null);
  35426. });
  35427. };
  35428. const resetScrollTop = () => {
  35429. const window = windowRef.value;
  35430. if (window) {
  35431. window.scrollTop = 0;
  35432. }
  35433. };
  35434. vue.onMounted(() => {
  35435. if (!isClient)
  35436. return;
  35437. const { initScrollOffset } = props;
  35438. const windowElement = vue.unref(windowRef);
  35439. if (isNumber(initScrollOffset) && windowElement) {
  35440. if (vue.unref(_isHorizontal)) {
  35441. windowElement.scrollLeft = initScrollOffset;
  35442. } else {
  35443. windowElement.scrollTop = initScrollOffset;
  35444. }
  35445. }
  35446. emitEvents();
  35447. });
  35448. vue.onUpdated(() => {
  35449. const { direction, layout } = props;
  35450. const { scrollOffset, updateRequested } = vue.unref(states);
  35451. const windowElement = vue.unref(windowRef);
  35452. if (updateRequested && windowElement) {
  35453. if (layout === HORIZONTAL) {
  35454. if (direction === RTL) {
  35455. switch (getRTLOffsetType()) {
  35456. case RTL_OFFSET_NAG: {
  35457. windowElement.scrollLeft = -scrollOffset;
  35458. break;
  35459. }
  35460. case RTL_OFFSET_POS_ASC: {
  35461. windowElement.scrollLeft = scrollOffset;
  35462. break;
  35463. }
  35464. default: {
  35465. const { clientWidth, scrollWidth } = windowElement;
  35466. windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
  35467. break;
  35468. }
  35469. }
  35470. } else {
  35471. windowElement.scrollLeft = scrollOffset;
  35472. }
  35473. } else {
  35474. windowElement.scrollTop = scrollOffset;
  35475. }
  35476. }
  35477. });
  35478. const api = {
  35479. ns,
  35480. clientSize,
  35481. estimatedTotalSize,
  35482. windowStyle,
  35483. windowRef,
  35484. innerRef,
  35485. innerStyle,
  35486. itemsToRender,
  35487. scrollbarRef,
  35488. states,
  35489. getItemStyle,
  35490. onScroll,
  35491. onScrollbarScroll,
  35492. onWheel,
  35493. scrollTo,
  35494. scrollToItem,
  35495. resetScrollTop
  35496. };
  35497. expose({
  35498. windowRef,
  35499. innerRef,
  35500. getItemStyleCache,
  35501. scrollTo,
  35502. scrollToItem,
  35503. resetScrollTop,
  35504. states
  35505. });
  35506. return api;
  35507. },
  35508. render(ctx) {
  35509. var _a;
  35510. const {
  35511. $slots,
  35512. className,
  35513. clientSize,
  35514. containerElement,
  35515. data,
  35516. getItemStyle,
  35517. innerElement,
  35518. itemsToRender,
  35519. innerStyle,
  35520. layout,
  35521. total,
  35522. onScroll,
  35523. onScrollbarScroll,
  35524. onWheel,
  35525. states,
  35526. useIsScrolling,
  35527. windowStyle,
  35528. ns
  35529. } = ctx;
  35530. const [start, end] = itemsToRender;
  35531. const Container = vue.resolveDynamicComponent(containerElement);
  35532. const Inner = vue.resolveDynamicComponent(innerElement);
  35533. const children = [];
  35534. if (total > 0) {
  35535. for (let i = start; i <= end; i++) {
  35536. children.push((_a = $slots.default) == null ? void 0 : _a.call($slots, {
  35537. data,
  35538. key: i,
  35539. index: i,
  35540. isScrolling: useIsScrolling ? states.isScrolling : void 0,
  35541. style: getItemStyle(i)
  35542. }));
  35543. }
  35544. }
  35545. const InnerNode = [
  35546. vue.h(Inner, {
  35547. style: innerStyle,
  35548. ref: "innerRef"
  35549. }, !isString(Inner) ? {
  35550. default: () => children
  35551. } : children)
  35552. ];
  35553. const scrollbar = vue.h(Scrollbar, {
  35554. ref: "scrollbarRef",
  35555. clientSize,
  35556. layout,
  35557. onScroll: onScrollbarScroll,
  35558. ratio: clientSize * 100 / this.estimatedTotalSize,
  35559. scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
  35560. total
  35561. });
  35562. const listContainer = vue.h(Container, {
  35563. class: [ns.e("window"), className],
  35564. style: windowStyle,
  35565. onScroll,
  35566. onWheel,
  35567. ref: "windowRef",
  35568. key: 0
  35569. }, !isString(Container) ? { default: () => [InnerNode] } : [InnerNode]);
  35570. return vue.h("div", {
  35571. key: 0,
  35572. class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
  35573. }, [listContainer, scrollbar]);
  35574. }
  35575. });
  35576. };
  35577. var createList$1 = createList;
  35578. const FixedSizeList = createList$1({
  35579. name: "ElFixedSizeList",
  35580. getItemOffset: ({ itemSize }, index) => index * itemSize,
  35581. getItemSize: ({ itemSize }) => itemSize,
  35582. getEstimatedTotalSize: ({ total, itemSize }) => itemSize * total,
  35583. getOffset: ({ height, total, itemSize, layout, width }, index, alignment, scrollOffset) => {
  35584. const size = isHorizontal(layout) ? width : height;
  35585. const lastItemOffset = Math.max(0, total * itemSize - size);
  35586. const maxOffset = Math.min(lastItemOffset, index * itemSize);
  35587. const minOffset = Math.max(0, (index + 1) * itemSize - size);
  35588. if (alignment === SMART_ALIGNMENT) {
  35589. if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
  35590. alignment = AUTO_ALIGNMENT;
  35591. } else {
  35592. alignment = CENTERED_ALIGNMENT;
  35593. }
  35594. }
  35595. switch (alignment) {
  35596. case START_ALIGNMENT: {
  35597. return maxOffset;
  35598. }
  35599. case END_ALIGNMENT: {
  35600. return minOffset;
  35601. }
  35602. case CENTERED_ALIGNMENT: {
  35603. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  35604. if (middleOffset < Math.ceil(size / 2)) {
  35605. return 0;
  35606. } else if (middleOffset > lastItemOffset + Math.floor(size / 2)) {
  35607. return lastItemOffset;
  35608. } else {
  35609. return middleOffset;
  35610. }
  35611. }
  35612. case AUTO_ALIGNMENT:
  35613. default: {
  35614. if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
  35615. return scrollOffset;
  35616. } else if (scrollOffset < minOffset) {
  35617. return minOffset;
  35618. } else {
  35619. return maxOffset;
  35620. }
  35621. }
  35622. }
  35623. },
  35624. getStartIndexForOffset: ({ total, itemSize }, offset) => Math.max(0, Math.min(total - 1, Math.floor(offset / itemSize))),
  35625. getStopIndexForStartIndex: ({ height, total, itemSize, layout, width }, startIndex, scrollOffset) => {
  35626. const offset = startIndex * itemSize;
  35627. const size = isHorizontal(layout) ? width : height;
  35628. const numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
  35629. return Math.max(0, Math.min(total - 1, startIndex + numVisibleItems - 1));
  35630. },
  35631. initCache() {
  35632. return void 0;
  35633. },
  35634. clearCache: true,
  35635. validateProps() {
  35636. }
  35637. });
  35638. var FixedSizeList$1 = FixedSizeList;
  35639. const getItemFromCache$1 = (props, index, listCache) => {
  35640. const { itemSize } = props;
  35641. const { items, lastVisitedIndex } = listCache;
  35642. if (index > lastVisitedIndex) {
  35643. let offset = 0;
  35644. if (lastVisitedIndex >= 0) {
  35645. const item = items[lastVisitedIndex];
  35646. offset = item.offset + item.size;
  35647. }
  35648. for (let i = lastVisitedIndex + 1; i <= index; i++) {
  35649. const size = itemSize(i);
  35650. items[i] = {
  35651. offset,
  35652. size
  35653. };
  35654. offset += size;
  35655. }
  35656. listCache.lastVisitedIndex = index;
  35657. }
  35658. return items[index];
  35659. };
  35660. const findItem$1 = (props, listCache, offset) => {
  35661. const { items, lastVisitedIndex } = listCache;
  35662. const lastVisitedOffset = lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0;
  35663. if (lastVisitedOffset >= offset) {
  35664. return bs$1(props, listCache, 0, lastVisitedIndex, offset);
  35665. }
  35666. return es$1(props, listCache, Math.max(0, lastVisitedIndex), offset);
  35667. };
  35668. const bs$1 = (props, listCache, low, high, offset) => {
  35669. while (low <= high) {
  35670. const mid = low + Math.floor((high - low) / 2);
  35671. const currentOffset = getItemFromCache$1(props, mid, listCache).offset;
  35672. if (currentOffset === offset) {
  35673. return mid;
  35674. } else if (currentOffset < offset) {
  35675. low = mid + 1;
  35676. } else if (currentOffset > offset) {
  35677. high = mid - 1;
  35678. }
  35679. }
  35680. return Math.max(0, low - 1);
  35681. };
  35682. const es$1 = (props, listCache, index, offset) => {
  35683. const { total } = props;
  35684. let exponent = 1;
  35685. while (index < total && getItemFromCache$1(props, index, listCache).offset < offset) {
  35686. index += exponent;
  35687. exponent *= 2;
  35688. }
  35689. return bs$1(props, listCache, Math.floor(index / 2), Math.min(index, total - 1), offset);
  35690. };
  35691. const getEstimatedTotalSize = ({ total }, { items, estimatedItemSize, lastVisitedIndex }) => {
  35692. let totalSizeOfMeasuredItems = 0;
  35693. if (lastVisitedIndex >= total) {
  35694. lastVisitedIndex = total - 1;
  35695. }
  35696. if (lastVisitedIndex >= 0) {
  35697. const item = items[lastVisitedIndex];
  35698. totalSizeOfMeasuredItems = item.offset + item.size;
  35699. }
  35700. const numUnmeasuredItems = total - lastVisitedIndex - 1;
  35701. const totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
  35702. return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
  35703. };
  35704. const DynamicSizeList = createList$1({
  35705. name: "ElDynamicSizeList",
  35706. getItemOffset: (props, index, listCache) => getItemFromCache$1(props, index, listCache).offset,
  35707. getItemSize: (_, index, { items }) => items[index].size,
  35708. getEstimatedTotalSize,
  35709. getOffset: (props, index, alignment, scrollOffset, listCache) => {
  35710. const { height, layout, width } = props;
  35711. const size = isHorizontal(layout) ? width : height;
  35712. const item = getItemFromCache$1(props, index, listCache);
  35713. const estimatedTotalSize = getEstimatedTotalSize(props, listCache);
  35714. const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
  35715. const minOffset = Math.max(0, item.offset - size + item.size);
  35716. if (alignment === SMART_ALIGNMENT) {
  35717. if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
  35718. alignment = AUTO_ALIGNMENT;
  35719. } else {
  35720. alignment = CENTERED_ALIGNMENT;
  35721. }
  35722. }
  35723. switch (alignment) {
  35724. case START_ALIGNMENT: {
  35725. return maxOffset;
  35726. }
  35727. case END_ALIGNMENT: {
  35728. return minOffset;
  35729. }
  35730. case CENTERED_ALIGNMENT: {
  35731. return Math.round(minOffset + (maxOffset - minOffset) / 2);
  35732. }
  35733. case AUTO_ALIGNMENT:
  35734. default: {
  35735. if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
  35736. return scrollOffset;
  35737. } else if (scrollOffset < minOffset) {
  35738. return minOffset;
  35739. } else {
  35740. return maxOffset;
  35741. }
  35742. }
  35743. }
  35744. },
  35745. getStartIndexForOffset: (props, offset, listCache) => findItem$1(props, listCache, offset),
  35746. getStopIndexForStartIndex: (props, startIndex, scrollOffset, listCache) => {
  35747. const { height, total, layout, width } = props;
  35748. const size = isHorizontal(layout) ? width : height;
  35749. const item = getItemFromCache$1(props, startIndex, listCache);
  35750. const maxOffset = scrollOffset + size;
  35751. let offset = item.offset + item.size;
  35752. let stopIndex = startIndex;
  35753. while (stopIndex < total - 1 && offset < maxOffset) {
  35754. stopIndex++;
  35755. offset += getItemFromCache$1(props, stopIndex, listCache).size;
  35756. }
  35757. return stopIndex;
  35758. },
  35759. initCache({ estimatedItemSize = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
  35760. const cache = {
  35761. items: {},
  35762. estimatedItemSize,
  35763. lastVisitedIndex: -1
  35764. };
  35765. cache.clearCacheAfterIndex = (index, forceUpdate = true) => {
  35766. var _a, _b;
  35767. cache.lastVisitedIndex = Math.min(cache.lastVisitedIndex, index - 1);
  35768. (_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache(-1);
  35769. if (forceUpdate) {
  35770. (_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
  35771. }
  35772. };
  35773. return cache;
  35774. },
  35775. clearCache: false,
  35776. validateProps: ({ itemSize }) => {
  35777. }
  35778. });
  35779. var DynamicSizeList$1 = DynamicSizeList;
  35780. const useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => {
  35781. let frameHandle = null;
  35782. let xOffset = 0;
  35783. let yOffset = 0;
  35784. const hasReachedEdge = (x, y) => {
  35785. const xEdgeReached = x < 0 && atXStartEdge.value || x > 0 && atXEndEdge.value;
  35786. const yEdgeReached = y < 0 && atYStartEdge.value || y > 0 && atYEndEdge.value;
  35787. return xEdgeReached && yEdgeReached;
  35788. };
  35789. const onWheel = (e) => {
  35790. cAF(frameHandle);
  35791. let x = e.deltaX;
  35792. let y = e.deltaY;
  35793. if (Math.abs(x) > Math.abs(y)) {
  35794. y = 0;
  35795. } else {
  35796. x = 0;
  35797. }
  35798. if (e.shiftKey && y !== 0) {
  35799. x = y;
  35800. y = 0;
  35801. }
  35802. if (hasReachedEdge(xOffset, yOffset) && hasReachedEdge(xOffset + x, yOffset + y))
  35803. return;
  35804. xOffset += x;
  35805. yOffset += y;
  35806. if (!isFirefox()) {
  35807. e.preventDefault();
  35808. }
  35809. frameHandle = rAF(() => {
  35810. onWheelDelta(xOffset, yOffset);
  35811. xOffset = 0;
  35812. yOffset = 0;
  35813. });
  35814. };
  35815. return {
  35816. hasReachedEdge,
  35817. onWheel
  35818. };
  35819. };
  35820. const createGrid = ({
  35821. name,
  35822. clearCache,
  35823. getColumnPosition,
  35824. getColumnStartIndexForOffset,
  35825. getColumnStopIndexForStartIndex,
  35826. getEstimatedTotalHeight,
  35827. getEstimatedTotalWidth,
  35828. getColumnOffset,
  35829. getRowOffset,
  35830. getRowPosition,
  35831. getRowStartIndexForOffset,
  35832. getRowStopIndexForStartIndex,
  35833. initCache,
  35834. injectToInstance,
  35835. validateProps
  35836. }) => {
  35837. return vue.defineComponent({
  35838. name: name != null ? name : "ElVirtualList",
  35839. props: virtualizedGridProps,
  35840. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  35841. setup(props, { emit, expose, slots }) {
  35842. const ns = useNamespace("vl");
  35843. validateProps(props);
  35844. const instance = vue.getCurrentInstance();
  35845. const cache = vue.ref(initCache(props, instance));
  35846. injectToInstance == null ? void 0 : injectToInstance(instance, cache);
  35847. const windowRef = vue.ref();
  35848. const hScrollbar = vue.ref();
  35849. const vScrollbar = vue.ref();
  35850. const innerRef = vue.ref(null);
  35851. const states = vue.ref({
  35852. isScrolling: false,
  35853. scrollLeft: isNumber(props.initScrollLeft) ? props.initScrollLeft : 0,
  35854. scrollTop: isNumber(props.initScrollTop) ? props.initScrollTop : 0,
  35855. updateRequested: false,
  35856. xAxisScrollDir: FORWARD,
  35857. yAxisScrollDir: FORWARD
  35858. });
  35859. const getItemStyleCache = useCache();
  35860. const parsedHeight = vue.computed(() => Number.parseInt(`${props.height}`, 10));
  35861. const parsedWidth = vue.computed(() => Number.parseInt(`${props.width}`, 10));
  35862. const columnsToRender = vue.computed(() => {
  35863. const { totalColumn, totalRow, columnCache } = props;
  35864. const { isScrolling, xAxisScrollDir, scrollLeft } = vue.unref(states);
  35865. if (totalColumn === 0 || totalRow === 0) {
  35866. return [0, 0, 0, 0];
  35867. }
  35868. const startIndex = getColumnStartIndexForOffset(props, scrollLeft, vue.unref(cache));
  35869. const stopIndex = getColumnStopIndexForStartIndex(props, startIndex, scrollLeft, vue.unref(cache));
  35870. const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1;
  35871. const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1;
  35872. return [
  35873. Math.max(0, startIndex - cacheBackward),
  35874. Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)),
  35875. startIndex,
  35876. stopIndex
  35877. ];
  35878. });
  35879. const rowsToRender = vue.computed(() => {
  35880. const { totalColumn, totalRow, rowCache } = props;
  35881. const { isScrolling, yAxisScrollDir, scrollTop } = vue.unref(states);
  35882. if (totalColumn === 0 || totalRow === 0) {
  35883. return [0, 0, 0, 0];
  35884. }
  35885. const startIndex = getRowStartIndexForOffset(props, scrollTop, vue.unref(cache));
  35886. const stopIndex = getRowStopIndexForStartIndex(props, startIndex, scrollTop, vue.unref(cache));
  35887. const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1;
  35888. const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1;
  35889. return [
  35890. Math.max(0, startIndex - cacheBackward),
  35891. Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)),
  35892. startIndex,
  35893. stopIndex
  35894. ];
  35895. });
  35896. const estimatedTotalHeight = vue.computed(() => getEstimatedTotalHeight(props, vue.unref(cache)));
  35897. const estimatedTotalWidth = vue.computed(() => getEstimatedTotalWidth(props, vue.unref(cache)));
  35898. const windowStyle = vue.computed(() => {
  35899. var _a;
  35900. return [
  35901. {
  35902. position: "relative",
  35903. overflow: "hidden",
  35904. WebkitOverflowScrolling: "touch",
  35905. willChange: "transform"
  35906. },
  35907. {
  35908. direction: props.direction,
  35909. height: isNumber(props.height) ? `${props.height}px` : props.height,
  35910. width: isNumber(props.width) ? `${props.width}px` : props.width
  35911. },
  35912. (_a = props.style) != null ? _a : {}
  35913. ];
  35914. });
  35915. const innerStyle = vue.computed(() => {
  35916. const width = `${vue.unref(estimatedTotalWidth)}px`;
  35917. const height = `${vue.unref(estimatedTotalHeight)}px`;
  35918. return {
  35919. height,
  35920. pointerEvents: vue.unref(states).isScrolling ? "none" : void 0,
  35921. width
  35922. };
  35923. });
  35924. const emitEvents = () => {
  35925. const { totalColumn, totalRow } = props;
  35926. if (totalColumn > 0 && totalRow > 0) {
  35927. const [
  35928. columnCacheStart,
  35929. columnCacheEnd,
  35930. columnVisibleStart,
  35931. columnVisibleEnd
  35932. ] = vue.unref(columnsToRender);
  35933. const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = vue.unref(rowsToRender);
  35934. emit(ITEM_RENDER_EVT, {
  35935. columnCacheStart,
  35936. columnCacheEnd,
  35937. rowCacheStart,
  35938. rowCacheEnd,
  35939. columnVisibleStart,
  35940. columnVisibleEnd,
  35941. rowVisibleStart,
  35942. rowVisibleEnd
  35943. });
  35944. }
  35945. const {
  35946. scrollLeft,
  35947. scrollTop,
  35948. updateRequested,
  35949. xAxisScrollDir,
  35950. yAxisScrollDir
  35951. } = vue.unref(states);
  35952. emit(SCROLL_EVT, {
  35953. xAxisScrollDir,
  35954. scrollLeft,
  35955. yAxisScrollDir,
  35956. scrollTop,
  35957. updateRequested
  35958. });
  35959. };
  35960. const onScroll = (e) => {
  35961. const {
  35962. clientHeight,
  35963. clientWidth,
  35964. scrollHeight,
  35965. scrollLeft,
  35966. scrollTop,
  35967. scrollWidth
  35968. } = e.currentTarget;
  35969. const _states = vue.unref(states);
  35970. if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) {
  35971. return;
  35972. }
  35973. let _scrollLeft = scrollLeft;
  35974. if (isRTL(props.direction)) {
  35975. switch (getRTLOffsetType()) {
  35976. case RTL_OFFSET_NAG:
  35977. _scrollLeft = -scrollLeft;
  35978. break;
  35979. case RTL_OFFSET_POS_DESC:
  35980. _scrollLeft = scrollWidth - clientWidth - scrollLeft;
  35981. break;
  35982. }
  35983. }
  35984. states.value = {
  35985. ..._states,
  35986. isScrolling: true,
  35987. scrollLeft: _scrollLeft,
  35988. scrollTop: Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)),
  35989. updateRequested: true,
  35990. xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft),
  35991. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop)
  35992. };
  35993. vue.nextTick(() => resetIsScrolling());
  35994. onUpdated();
  35995. emitEvents();
  35996. };
  35997. const onVerticalScroll = (distance, totalSteps) => {
  35998. const height = vue.unref(parsedHeight);
  35999. const offset = (estimatedTotalHeight.value - height) / totalSteps * distance;
  36000. scrollTo({
  36001. scrollTop: Math.min(estimatedTotalHeight.value - height, offset)
  36002. });
  36003. };
  36004. const onHorizontalScroll = (distance, totalSteps) => {
  36005. const width = vue.unref(parsedWidth);
  36006. const offset = (estimatedTotalWidth.value - width) / totalSteps * distance;
  36007. scrollTo({
  36008. scrollLeft: Math.min(estimatedTotalWidth.value - width, offset)
  36009. });
  36010. };
  36011. const { onWheel } = useGridWheel({
  36012. atXStartEdge: vue.computed(() => states.value.scrollLeft <= 0),
  36013. atXEndEdge: vue.computed(() => states.value.scrollLeft >= estimatedTotalWidth.value),
  36014. atYStartEdge: vue.computed(() => states.value.scrollTop <= 0),
  36015. atYEndEdge: vue.computed(() => states.value.scrollTop >= estimatedTotalHeight.value)
  36016. }, (x, y) => {
  36017. var _a, _b, _c, _d;
  36018. (_b = (_a = hScrollbar.value) == null ? void 0 : _a.onMouseUp) == null ? void 0 : _b.call(_a);
  36019. (_d = (_c = hScrollbar.value) == null ? void 0 : _c.onMouseUp) == null ? void 0 : _d.call(_c);
  36020. const width = vue.unref(parsedWidth);
  36021. const height = vue.unref(parsedHeight);
  36022. scrollTo({
  36023. scrollLeft: Math.min(states.value.scrollLeft + x, estimatedTotalWidth.value - width),
  36024. scrollTop: Math.min(states.value.scrollTop + y, estimatedTotalHeight.value - height)
  36025. });
  36026. });
  36027. const scrollTo = ({
  36028. scrollLeft = states.value.scrollLeft,
  36029. scrollTop = states.value.scrollTop
  36030. }) => {
  36031. scrollLeft = Math.max(scrollLeft, 0);
  36032. scrollTop = Math.max(scrollTop, 0);
  36033. const _states = vue.unref(states);
  36034. if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) {
  36035. return;
  36036. }
  36037. states.value = {
  36038. ..._states,
  36039. xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft),
  36040. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop),
  36041. scrollLeft,
  36042. scrollTop,
  36043. updateRequested: true
  36044. };
  36045. vue.nextTick(() => resetIsScrolling());
  36046. onUpdated();
  36047. emitEvents();
  36048. };
  36049. const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => {
  36050. const _states = vue.unref(states);
  36051. columnIdx = Math.max(0, Math.min(columnIdx, props.totalColumn - 1));
  36052. rowIndex = Math.max(0, Math.min(rowIndex, props.totalRow - 1));
  36053. const scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  36054. const _cache = vue.unref(cache);
  36055. const estimatedHeight = getEstimatedTotalHeight(props, _cache);
  36056. const estimatedWidth = getEstimatedTotalWidth(props, _cache);
  36057. scrollTo({
  36058. scrollLeft: getColumnOffset(props, columnIdx, alignment, _states.scrollLeft, _cache, estimatedWidth > props.width ? scrollBarWidth : 0),
  36059. scrollTop: getRowOffset(props, rowIndex, alignment, _states.scrollTop, _cache, estimatedHeight > props.height ? scrollBarWidth : 0)
  36060. });
  36061. };
  36062. const getItemStyle = (rowIndex, columnIndex) => {
  36063. const { columnWidth, direction, rowHeight } = props;
  36064. const itemStyleCache = getItemStyleCache.value(clearCache && columnWidth, clearCache && rowHeight, clearCache && direction);
  36065. const key = `${rowIndex},${columnIndex}`;
  36066. if (hasOwn(itemStyleCache, key)) {
  36067. return itemStyleCache[key];
  36068. } else {
  36069. const [, left] = getColumnPosition(props, columnIndex, vue.unref(cache));
  36070. const _cache = vue.unref(cache);
  36071. const rtl = isRTL(direction);
  36072. const [height, top] = getRowPosition(props, rowIndex, _cache);
  36073. const [width] = getColumnPosition(props, columnIndex, _cache);
  36074. itemStyleCache[key] = {
  36075. position: "absolute",
  36076. left: rtl ? void 0 : `${left}px`,
  36077. right: rtl ? `${left}px` : void 0,
  36078. top: `${top}px`,
  36079. height: `${height}px`,
  36080. width: `${width}px`
  36081. };
  36082. return itemStyleCache[key];
  36083. }
  36084. };
  36085. const resetIsScrolling = () => {
  36086. states.value.isScrolling = false;
  36087. vue.nextTick(() => {
  36088. getItemStyleCache.value(-1, null, null);
  36089. });
  36090. };
  36091. vue.onMounted(() => {
  36092. if (!isClient)
  36093. return;
  36094. const { initScrollLeft, initScrollTop } = props;
  36095. const windowElement = vue.unref(windowRef);
  36096. if (windowElement) {
  36097. if (isNumber(initScrollLeft)) {
  36098. windowElement.scrollLeft = initScrollLeft;
  36099. }
  36100. if (isNumber(initScrollTop)) {
  36101. windowElement.scrollTop = initScrollTop;
  36102. }
  36103. }
  36104. emitEvents();
  36105. });
  36106. const onUpdated = () => {
  36107. const { direction } = props;
  36108. const { scrollLeft, scrollTop, updateRequested } = vue.unref(states);
  36109. const windowElement = vue.unref(windowRef);
  36110. if (updateRequested && windowElement) {
  36111. if (direction === RTL) {
  36112. switch (getRTLOffsetType()) {
  36113. case RTL_OFFSET_NAG: {
  36114. windowElement.scrollLeft = -scrollLeft;
  36115. break;
  36116. }
  36117. case RTL_OFFSET_POS_ASC: {
  36118. windowElement.scrollLeft = scrollLeft;
  36119. break;
  36120. }
  36121. default: {
  36122. const { clientWidth, scrollWidth } = windowElement;
  36123. windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft;
  36124. break;
  36125. }
  36126. }
  36127. } else {
  36128. windowElement.scrollLeft = Math.max(0, scrollLeft);
  36129. }
  36130. windowElement.scrollTop = Math.max(0, scrollTop);
  36131. }
  36132. };
  36133. const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy;
  36134. expose({
  36135. windowRef,
  36136. innerRef,
  36137. getItemStyleCache,
  36138. scrollTo,
  36139. scrollToItem,
  36140. states,
  36141. resetAfterColumnIndex,
  36142. resetAfterRowIndex,
  36143. resetAfter
  36144. });
  36145. const renderScrollbars = () => {
  36146. const {
  36147. scrollbarAlwaysOn,
  36148. scrollbarStartGap,
  36149. scrollbarEndGap,
  36150. totalColumn,
  36151. totalRow
  36152. } = props;
  36153. const width = vue.unref(parsedWidth);
  36154. const height = vue.unref(parsedHeight);
  36155. const estimatedWidth = vue.unref(estimatedTotalWidth);
  36156. const estimatedHeight = vue.unref(estimatedTotalHeight);
  36157. const { scrollLeft, scrollTop } = vue.unref(states);
  36158. const horizontalScrollbar = vue.h(Scrollbar, {
  36159. ref: hScrollbar,
  36160. alwaysOn: scrollbarAlwaysOn,
  36161. startGap: scrollbarStartGap,
  36162. endGap: scrollbarEndGap,
  36163. class: ns.e("horizontal"),
  36164. clientSize: width,
  36165. layout: "horizontal",
  36166. onScroll: onHorizontalScroll,
  36167. ratio: width * 100 / estimatedWidth,
  36168. scrollFrom: scrollLeft / (estimatedWidth - width),
  36169. total: totalRow,
  36170. visible: true
  36171. });
  36172. const verticalScrollbar = vue.h(Scrollbar, {
  36173. ref: vScrollbar,
  36174. alwaysOn: scrollbarAlwaysOn,
  36175. startGap: scrollbarStartGap,
  36176. endGap: scrollbarEndGap,
  36177. class: ns.e("vertical"),
  36178. clientSize: height,
  36179. layout: "vertical",
  36180. onScroll: onVerticalScroll,
  36181. ratio: height * 100 / estimatedHeight,
  36182. scrollFrom: scrollTop / (estimatedHeight - height),
  36183. total: totalColumn,
  36184. visible: true
  36185. });
  36186. return {
  36187. horizontalScrollbar,
  36188. verticalScrollbar
  36189. };
  36190. };
  36191. const renderItems = () => {
  36192. var _a;
  36193. const [columnStart, columnEnd] = vue.unref(columnsToRender);
  36194. const [rowStart, rowEnd] = vue.unref(rowsToRender);
  36195. const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props;
  36196. const children = [];
  36197. if (totalRow > 0 && totalColumn > 0) {
  36198. for (let row = rowStart; row <= rowEnd; row++) {
  36199. for (let column = columnStart; column <= columnEnd; column++) {
  36200. children.push((_a = slots.default) == null ? void 0 : _a.call(slots, {
  36201. columnIndex: column,
  36202. data,
  36203. key: itemKey({ columnIndex: column, data, rowIndex: row }),
  36204. isScrolling: useIsScrolling ? vue.unref(states).isScrolling : void 0,
  36205. style: getItemStyle(row, column),
  36206. rowIndex: row
  36207. }));
  36208. }
  36209. }
  36210. }
  36211. return children;
  36212. };
  36213. const renderInner = () => {
  36214. const Inner = vue.resolveDynamicComponent(props.innerElement);
  36215. const children = renderItems();
  36216. return [
  36217. vue.h(Inner, {
  36218. style: vue.unref(innerStyle),
  36219. ref: innerRef
  36220. }, !isString(Inner) ? {
  36221. default: () => children
  36222. } : children)
  36223. ];
  36224. };
  36225. const renderWindow = () => {
  36226. const Container = vue.resolveDynamicComponent(props.containerElement);
  36227. const { horizontalScrollbar, verticalScrollbar } = renderScrollbars();
  36228. const Inner = renderInner();
  36229. return vue.h("div", {
  36230. key: 0,
  36231. class: ns.e("wrapper")
  36232. }, [
  36233. vue.h(Container, {
  36234. class: props.className,
  36235. style: vue.unref(windowStyle),
  36236. onScroll,
  36237. onWheel,
  36238. ref: windowRef
  36239. }, !isString(Container) ? { default: () => Inner } : Inner),
  36240. horizontalScrollbar,
  36241. verticalScrollbar
  36242. ]);
  36243. };
  36244. return renderWindow;
  36245. }
  36246. });
  36247. };
  36248. var createGrid$1 = createGrid;
  36249. const FixedSizeGrid = createGrid$1({
  36250. name: "ElFixedSizeGrid",
  36251. getColumnPosition: ({ columnWidth }, index) => [
  36252. columnWidth,
  36253. index * columnWidth
  36254. ],
  36255. getRowPosition: ({ rowHeight }, index) => [
  36256. rowHeight,
  36257. index * rowHeight
  36258. ],
  36259. getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow,
  36260. getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn,
  36261. getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _, scrollBarWidth) => {
  36262. width = Number(width);
  36263. const lastColumnOffset = Math.max(0, totalColumn * columnWidth - width);
  36264. const maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth);
  36265. const minOffset = Math.max(0, columnIndex * columnWidth - width + scrollBarWidth + columnWidth);
  36266. if (alignment === "smart") {
  36267. if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) {
  36268. alignment = AUTO_ALIGNMENT;
  36269. } else {
  36270. alignment = CENTERED_ALIGNMENT;
  36271. }
  36272. }
  36273. switch (alignment) {
  36274. case START_ALIGNMENT:
  36275. return maxOffset;
  36276. case END_ALIGNMENT:
  36277. return minOffset;
  36278. case CENTERED_ALIGNMENT: {
  36279. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  36280. if (middleOffset < Math.ceil(width / 2)) {
  36281. return 0;
  36282. } else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) {
  36283. return lastColumnOffset;
  36284. } else {
  36285. return middleOffset;
  36286. }
  36287. }
  36288. case AUTO_ALIGNMENT:
  36289. default:
  36290. if (scrollLeft >= minOffset && scrollLeft <= maxOffset) {
  36291. return scrollLeft;
  36292. } else if (minOffset > maxOffset) {
  36293. return minOffset;
  36294. } else if (scrollLeft < minOffset) {
  36295. return minOffset;
  36296. } else {
  36297. return maxOffset;
  36298. }
  36299. }
  36300. },
  36301. getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _, scrollBarWidth) => {
  36302. height = Number(height);
  36303. const lastRowOffset = Math.max(0, totalRow * rowHeight - height);
  36304. const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
  36305. const minOffset = Math.max(0, rowIndex * rowHeight - height + scrollBarWidth + rowHeight);
  36306. if (align === SMART_ALIGNMENT) {
  36307. if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) {
  36308. align = AUTO_ALIGNMENT;
  36309. } else {
  36310. align = CENTERED_ALIGNMENT;
  36311. }
  36312. }
  36313. switch (align) {
  36314. case START_ALIGNMENT:
  36315. return maxOffset;
  36316. case END_ALIGNMENT:
  36317. return minOffset;
  36318. case CENTERED_ALIGNMENT: {
  36319. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  36320. if (middleOffset < Math.ceil(height / 2)) {
  36321. return 0;
  36322. } else if (middleOffset > lastRowOffset + Math.floor(height / 2)) {
  36323. return lastRowOffset;
  36324. } else {
  36325. return middleOffset;
  36326. }
  36327. }
  36328. case AUTO_ALIGNMENT:
  36329. default:
  36330. if (scrollTop >= minOffset && scrollTop <= maxOffset) {
  36331. return scrollTop;
  36332. } else if (minOffset > maxOffset) {
  36333. return minOffset;
  36334. } else if (scrollTop < minOffset) {
  36335. return minOffset;
  36336. } else {
  36337. return maxOffset;
  36338. }
  36339. }
  36340. },
  36341. getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(0, Math.min(totalColumn - 1, Math.floor(scrollLeft / columnWidth))),
  36342. getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => {
  36343. const left = startIndex * columnWidth;
  36344. const visibleColumnsCount = Math.ceil((width + scrollLeft - left) / columnWidth);
  36345. return Math.max(0, Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1));
  36346. },
  36347. getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(0, Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))),
  36348. getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => {
  36349. const top = startIndex * rowHeight;
  36350. const numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight);
  36351. return Math.max(0, Math.min(totalRow - 1, startIndex + numVisibleRows - 1));
  36352. },
  36353. initCache: () => void 0,
  36354. clearCache: true,
  36355. validateProps: ({ columnWidth, rowHeight }) => {
  36356. }
  36357. });
  36358. var FixedSizeGrid$1 = FixedSizeGrid;
  36359. const { max, min, floor } = Math;
  36360. const ACCESS_SIZER_KEY_MAP = {
  36361. column: "columnWidth",
  36362. row: "rowHeight"
  36363. };
  36364. const ACCESS_LAST_VISITED_KEY_MAP = {
  36365. column: "lastVisitedColumnIndex",
  36366. row: "lastVisitedRowIndex"
  36367. };
  36368. const getItemFromCache = (props, index, gridCache, type) => {
  36369. const [cachedItems, sizer, lastVisited] = [
  36370. gridCache[type],
  36371. props[ACCESS_SIZER_KEY_MAP[type]],
  36372. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
  36373. ];
  36374. if (index > lastVisited) {
  36375. let offset = 0;
  36376. if (lastVisited >= 0) {
  36377. const item = cachedItems[lastVisited];
  36378. offset = item.offset + item.size;
  36379. }
  36380. for (let i = lastVisited + 1; i <= index; i++) {
  36381. const size = sizer(i);
  36382. cachedItems[i] = {
  36383. offset,
  36384. size
  36385. };
  36386. offset += size;
  36387. }
  36388. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index;
  36389. }
  36390. return cachedItems[index];
  36391. };
  36392. const bs = (props, gridCache, low, high, offset, type) => {
  36393. while (low <= high) {
  36394. const mid = low + floor((high - low) / 2);
  36395. const currentOffset = getItemFromCache(props, mid, gridCache, type).offset;
  36396. if (currentOffset === offset) {
  36397. return mid;
  36398. } else if (currentOffset < offset) {
  36399. low = mid + 1;
  36400. } else {
  36401. high = mid - 1;
  36402. }
  36403. }
  36404. return max(0, low - 1);
  36405. };
  36406. const es = (props, gridCache, idx, offset, type) => {
  36407. const total = type === "column" ? props.totalColumn : props.totalRow;
  36408. let exponent = 1;
  36409. while (idx < total && getItemFromCache(props, idx, gridCache, type).offset < offset) {
  36410. idx += exponent;
  36411. exponent *= 2;
  36412. }
  36413. return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
  36414. };
  36415. const findItem = (props, gridCache, offset, type) => {
  36416. const [cache, lastVisitedIndex] = [
  36417. gridCache[type],
  36418. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
  36419. ];
  36420. const lastVisitedItemOffset = lastVisitedIndex > 0 ? cache[lastVisitedIndex].offset : 0;
  36421. if (lastVisitedItemOffset >= offset) {
  36422. return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
  36423. }
  36424. return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
  36425. };
  36426. const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
  36427. let sizeOfVisitedRows = 0;
  36428. if (lastVisitedRowIndex >= totalRow) {
  36429. lastVisitedRowIndex = totalRow - 1;
  36430. }
  36431. if (lastVisitedRowIndex >= 0) {
  36432. const item = row[lastVisitedRowIndex];
  36433. sizeOfVisitedRows = item.offset + item.size;
  36434. }
  36435. const unvisitedItems = totalRow - lastVisitedRowIndex - 1;
  36436. const sizeOfUnvisitedItems = unvisitedItems * estimatedRowHeight;
  36437. return sizeOfVisitedRows + sizeOfUnvisitedItems;
  36438. };
  36439. const getEstimatedTotalWidth = ({ totalColumn }, { column, estimatedColumnWidth, lastVisitedColumnIndex }) => {
  36440. let sizeOfVisitedColumns = 0;
  36441. if (lastVisitedColumnIndex > totalColumn) {
  36442. lastVisitedColumnIndex = totalColumn - 1;
  36443. }
  36444. if (lastVisitedColumnIndex >= 0) {
  36445. const item = column[lastVisitedColumnIndex];
  36446. sizeOfVisitedColumns = item.offset + item.size;
  36447. }
  36448. const unvisitedItems = totalColumn - lastVisitedColumnIndex - 1;
  36449. const sizeOfUnvisitedItems = unvisitedItems * estimatedColumnWidth;
  36450. return sizeOfVisitedColumns + sizeOfUnvisitedItems;
  36451. };
  36452. const ACCESS_ESTIMATED_SIZE_KEY_MAP = {
  36453. column: getEstimatedTotalWidth,
  36454. row: getEstimatedTotalHeight
  36455. };
  36456. const getOffset$1 = (props, index, alignment, scrollOffset, cache, type, scrollBarWidth) => {
  36457. const [size, estimatedSizeAssociates] = [
  36458. type === "row" ? props.height : props.width,
  36459. ACCESS_ESTIMATED_SIZE_KEY_MAP[type]
  36460. ];
  36461. const item = getItemFromCache(props, index, cache, type);
  36462. const estimatedSize = estimatedSizeAssociates(props, cache);
  36463. const maxOffset = max(0, min(estimatedSize - size, item.offset));
  36464. const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
  36465. if (alignment === SMART_ALIGNMENT) {
  36466. if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
  36467. alignment = AUTO_ALIGNMENT;
  36468. } else {
  36469. alignment = CENTERED_ALIGNMENT;
  36470. }
  36471. }
  36472. switch (alignment) {
  36473. case START_ALIGNMENT: {
  36474. return maxOffset;
  36475. }
  36476. case END_ALIGNMENT: {
  36477. return minOffset;
  36478. }
  36479. case CENTERED_ALIGNMENT: {
  36480. return Math.round(minOffset + (maxOffset - minOffset) / 2);
  36481. }
  36482. case AUTO_ALIGNMENT:
  36483. default: {
  36484. if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
  36485. return scrollOffset;
  36486. } else if (minOffset > maxOffset) {
  36487. return minOffset;
  36488. } else if (scrollOffset < minOffset) {
  36489. return minOffset;
  36490. } else {
  36491. return maxOffset;
  36492. }
  36493. }
  36494. }
  36495. };
  36496. const DynamicSizeGrid = createGrid$1({
  36497. name: "ElDynamicSizeGrid",
  36498. getColumnPosition: (props, idx, cache) => {
  36499. const item = getItemFromCache(props, idx, cache, "column");
  36500. return [item.size, item.offset];
  36501. },
  36502. getRowPosition: (props, idx, cache) => {
  36503. const item = getItemFromCache(props, idx, cache, "row");
  36504. return [item.size, item.offset];
  36505. },
  36506. getColumnOffset: (props, columnIndex, alignment, scrollLeft, cache, scrollBarWidth) => getOffset$1(props, columnIndex, alignment, scrollLeft, cache, "column", scrollBarWidth),
  36507. getRowOffset: (props, rowIndex, alignment, scrollTop, cache, scrollBarWidth) => getOffset$1(props, rowIndex, alignment, scrollTop, cache, "row", scrollBarWidth),
  36508. getColumnStartIndexForOffset: (props, scrollLeft, cache) => findItem(props, cache, scrollLeft, "column"),
  36509. getColumnStopIndexForStartIndex: (props, startIndex, scrollLeft, cache) => {
  36510. const item = getItemFromCache(props, startIndex, cache, "column");
  36511. const maxOffset = scrollLeft + props.width;
  36512. let offset = item.offset + item.size;
  36513. let stopIndex = startIndex;
  36514. while (stopIndex < props.totalColumn - 1 && offset < maxOffset) {
  36515. stopIndex++;
  36516. offset += getItemFromCache(props, startIndex, cache, "column").size;
  36517. }
  36518. return stopIndex;
  36519. },
  36520. getEstimatedTotalHeight,
  36521. getEstimatedTotalWidth,
  36522. getRowStartIndexForOffset: (props, scrollTop, cache) => findItem(props, cache, scrollTop, "row"),
  36523. getRowStopIndexForStartIndex: (props, startIndex, scrollTop, cache) => {
  36524. const { totalRow, height } = props;
  36525. const item = getItemFromCache(props, startIndex, cache, "row");
  36526. const maxOffset = scrollTop + height;
  36527. let offset = item.size + item.offset;
  36528. let stopIndex = startIndex;
  36529. while (stopIndex < totalRow - 1 && offset < maxOffset) {
  36530. stopIndex++;
  36531. offset += getItemFromCache(props, stopIndex, cache, "row").size;
  36532. }
  36533. return stopIndex;
  36534. },
  36535. injectToInstance: (instance, cache) => {
  36536. const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => {
  36537. var _a, _b;
  36538. forceUpdate = isUndefined(forceUpdate) ? true : forceUpdate;
  36539. if (isNumber(columnIndex)) {
  36540. cache.value.lastVisitedColumnIndex = Math.min(cache.value.lastVisitedColumnIndex, columnIndex - 1);
  36541. }
  36542. if (isNumber(rowIndex)) {
  36543. cache.value.lastVisitedRowIndex = Math.min(cache.value.lastVisitedRowIndex, rowIndex - 1);
  36544. }
  36545. (_a = instance.exposed) == null ? void 0 : _a.getItemStyleCache.value(-1, null, null);
  36546. if (forceUpdate)
  36547. (_b = instance.proxy) == null ? void 0 : _b.$forceUpdate();
  36548. };
  36549. const resetAfterColumnIndex = (columnIndex, forceUpdate) => {
  36550. resetAfter({
  36551. columnIndex
  36552. }, forceUpdate);
  36553. };
  36554. const resetAfterRowIndex = (rowIndex, forceUpdate) => {
  36555. resetAfter({
  36556. rowIndex
  36557. }, forceUpdate);
  36558. };
  36559. Object.assign(instance.proxy, {
  36560. resetAfterColumnIndex,
  36561. resetAfterRowIndex,
  36562. resetAfter
  36563. });
  36564. },
  36565. initCache: ({
  36566. estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE,
  36567. estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE
  36568. }) => {
  36569. const cache = {
  36570. column: {},
  36571. estimatedColumnWidth,
  36572. estimatedRowHeight,
  36573. lastVisitedColumnIndex: -1,
  36574. lastVisitedRowIndex: -1,
  36575. row: {}
  36576. };
  36577. return cache;
  36578. },
  36579. clearCache: false,
  36580. validateProps: ({ columnWidth, rowHeight }) => {
  36581. }
  36582. });
  36583. var DynamicSizeGrid$1 = DynamicSizeGrid;
  36584. const _sfc_main$C = vue.defineComponent({
  36585. props: {
  36586. item: {
  36587. type: Object,
  36588. required: true
  36589. },
  36590. style: Object,
  36591. height: Number
  36592. },
  36593. setup() {
  36594. const ns = useNamespace("select");
  36595. return {
  36596. ns
  36597. };
  36598. }
  36599. });
  36600. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  36601. return _ctx.item.isTitle ? (vue.openBlock(), vue.createElementBlock("div", {
  36602. key: 0,
  36603. class: vue.normalizeClass(_ctx.ns.be("group", "title")),
  36604. style: vue.normalizeStyle([_ctx.style, { lineHeight: `${_ctx.height}px` }])
  36605. }, vue.toDisplayString(_ctx.item.label), 7)) : (vue.openBlock(), vue.createElementBlock("div", {
  36606. key: 1,
  36607. class: vue.normalizeClass(_ctx.ns.be("group", "split")),
  36608. style: vue.normalizeStyle(_ctx.style)
  36609. }, [
  36610. vue.createElementVNode("span", {
  36611. class: vue.normalizeClass(_ctx.ns.be("group", "split-dash")),
  36612. style: vue.normalizeStyle({ top: `${_ctx.height / 2}px` })
  36613. }, null, 6)
  36614. ], 6));
  36615. }
  36616. var GroupItem = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$7], ["__file", "group-item.vue"]]);
  36617. function useOption(props, { emit }) {
  36618. return {
  36619. hoverItem: () => {
  36620. if (!props.disabled) {
  36621. emit("hover", props.index);
  36622. }
  36623. },
  36624. selectOptionClick: () => {
  36625. if (!props.disabled) {
  36626. emit("select", props.item, props.index);
  36627. }
  36628. }
  36629. };
  36630. }
  36631. const SelectProps = {
  36632. allowCreate: Boolean,
  36633. autocomplete: {
  36634. type: String,
  36635. default: "none"
  36636. },
  36637. automaticDropdown: Boolean,
  36638. clearable: Boolean,
  36639. clearIcon: {
  36640. type: [String, Object],
  36641. default: circle_close_default
  36642. },
  36643. effect: {
  36644. type: String,
  36645. default: "light"
  36646. },
  36647. collapseTags: Boolean,
  36648. collapseTagsTooltip: {
  36649. type: Boolean,
  36650. default: false
  36651. },
  36652. defaultFirstOption: Boolean,
  36653. disabled: Boolean,
  36654. estimatedOptionHeight: {
  36655. type: Number,
  36656. default: void 0
  36657. },
  36658. filterable: Boolean,
  36659. filterMethod: Function,
  36660. height: {
  36661. type: Number,
  36662. default: 170
  36663. },
  36664. itemHeight: {
  36665. type: Number,
  36666. default: 34
  36667. },
  36668. id: String,
  36669. loading: Boolean,
  36670. loadingText: String,
  36671. label: String,
  36672. modelValue: [Array, String, Number, Boolean, Object],
  36673. multiple: Boolean,
  36674. multipleLimit: {
  36675. type: Number,
  36676. default: 0
  36677. },
  36678. name: String,
  36679. noDataText: String,
  36680. noMatchText: String,
  36681. remoteMethod: Function,
  36682. reserveKeyword: {
  36683. type: Boolean,
  36684. default: true
  36685. },
  36686. options: {
  36687. type: Array,
  36688. required: true
  36689. },
  36690. placeholder: {
  36691. type: String
  36692. },
  36693. teleported: useTooltipContentProps.teleported,
  36694. persistent: {
  36695. type: Boolean,
  36696. default: true
  36697. },
  36698. popperClass: {
  36699. type: String,
  36700. default: ""
  36701. },
  36702. popperOptions: {
  36703. type: Object,
  36704. default: () => ({})
  36705. },
  36706. remote: Boolean,
  36707. size: {
  36708. type: String,
  36709. validator: isValidComponentSize
  36710. },
  36711. valueKey: {
  36712. type: String,
  36713. default: "value"
  36714. },
  36715. scrollbarAlwaysOn: {
  36716. type: Boolean,
  36717. default: false
  36718. },
  36719. validateEvent: {
  36720. type: Boolean,
  36721. default: true
  36722. },
  36723. placement: {
  36724. type: definePropType(String),
  36725. values: Ee,
  36726. default: "bottom-start"
  36727. }
  36728. };
  36729. const OptionProps = {
  36730. data: Array,
  36731. disabled: Boolean,
  36732. hovering: Boolean,
  36733. item: Object,
  36734. index: Number,
  36735. style: Object,
  36736. selected: Boolean,
  36737. created: Boolean
  36738. };
  36739. const _sfc_main$B = vue.defineComponent({
  36740. props: OptionProps,
  36741. emits: ["select", "hover"],
  36742. setup(props, { emit }) {
  36743. const ns = useNamespace("select");
  36744. const { hoverItem, selectOptionClick } = useOption(props, { emit });
  36745. return {
  36746. ns,
  36747. hoverItem,
  36748. selectOptionClick
  36749. };
  36750. }
  36751. });
  36752. const _hoisted_1$h = ["aria-selected"];
  36753. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  36754. return vue.openBlock(), vue.createElementBlock("li", {
  36755. "aria-selected": _ctx.selected,
  36756. style: vue.normalizeStyle(_ctx.style),
  36757. class: vue.normalizeClass([
  36758. _ctx.ns.be("dropdown", "option-item"),
  36759. _ctx.ns.is("selected", _ctx.selected),
  36760. _ctx.ns.is("disabled", _ctx.disabled),
  36761. _ctx.ns.is("created", _ctx.created),
  36762. { hover: _ctx.hovering }
  36763. ]),
  36764. onMouseenter: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  36765. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  36766. }, [
  36767. vue.renderSlot(_ctx.$slots, "default", {
  36768. item: _ctx.item,
  36769. index: _ctx.index,
  36770. disabled: _ctx.disabled
  36771. }, () => [
  36772. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.item.label), 1)
  36773. ])
  36774. ], 46, _hoisted_1$h);
  36775. }
  36776. var OptionItem = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render$6], ["__file", "option-item.vue"]]);
  36777. const selectV2InjectionKey = "ElSelectV2Injection";
  36778. var ElSelectMenu = vue.defineComponent({
  36779. name: "ElSelectDropdown",
  36780. props: {
  36781. data: {
  36782. type: Array,
  36783. required: true
  36784. },
  36785. hoveringIndex: Number,
  36786. width: Number
  36787. },
  36788. setup(props, {
  36789. slots,
  36790. expose
  36791. }) {
  36792. const select = vue.inject(selectV2InjectionKey);
  36793. const ns = useNamespace("select");
  36794. const cachedHeights = vue.ref([]);
  36795. const listRef = vue.ref();
  36796. const size = vue.computed(() => props.data.length);
  36797. vue.watch(() => size.value, () => {
  36798. var _a, _b;
  36799. (_b = (_a = select.popper.value).updatePopper) == null ? void 0 : _b.call(_a);
  36800. });
  36801. const isSized = vue.computed(() => isUndefined(select.props.estimatedOptionHeight));
  36802. const listProps = vue.computed(() => {
  36803. if (isSized.value) {
  36804. return {
  36805. itemSize: select.props.itemHeight
  36806. };
  36807. }
  36808. return {
  36809. estimatedSize: select.props.estimatedOptionHeight,
  36810. itemSize: (idx) => cachedHeights.value[idx]
  36811. };
  36812. });
  36813. const contains = (arr = [], target) => {
  36814. const {
  36815. props: {
  36816. valueKey
  36817. }
  36818. } = select;
  36819. if (!isObject$1(target)) {
  36820. return arr.includes(target);
  36821. }
  36822. return arr && arr.some((item) => {
  36823. return get(item, valueKey) === get(target, valueKey);
  36824. });
  36825. };
  36826. const isEqual = (selected, target) => {
  36827. if (!isObject$1(target)) {
  36828. return selected === target;
  36829. } else {
  36830. const {
  36831. valueKey
  36832. } = select.props;
  36833. return get(selected, valueKey) === get(target, valueKey);
  36834. }
  36835. };
  36836. const isItemSelected = (modelValue, target) => {
  36837. const {
  36838. valueKey
  36839. } = select.props;
  36840. if (select.props.multiple) {
  36841. return contains(modelValue, get(target, valueKey));
  36842. }
  36843. return isEqual(modelValue, get(target, valueKey));
  36844. };
  36845. const isItemDisabled = (modelValue, selected) => {
  36846. const {
  36847. disabled,
  36848. multiple,
  36849. multipleLimit
  36850. } = select.props;
  36851. return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
  36852. };
  36853. const isItemHovering = (target) => props.hoveringIndex === target;
  36854. const scrollToItem = (index) => {
  36855. const list = listRef.value;
  36856. if (list) {
  36857. list.scrollToItem(index);
  36858. }
  36859. };
  36860. const resetScrollTop = () => {
  36861. const list = listRef.value;
  36862. if (list) {
  36863. list.resetScrollTop();
  36864. }
  36865. };
  36866. expose({
  36867. listRef,
  36868. isSized,
  36869. isItemDisabled,
  36870. isItemHovering,
  36871. isItemSelected,
  36872. scrollToItem,
  36873. resetScrollTop
  36874. });
  36875. const Item = (itemProps) => {
  36876. const {
  36877. index,
  36878. data,
  36879. style
  36880. } = itemProps;
  36881. const sized = vue.unref(isSized);
  36882. const {
  36883. itemSize,
  36884. estimatedSize
  36885. } = vue.unref(listProps);
  36886. const {
  36887. modelValue
  36888. } = select.props;
  36889. const {
  36890. onSelect,
  36891. onHover
  36892. } = select;
  36893. const item = data[index];
  36894. if (item.type === "Group") {
  36895. return vue.createVNode(GroupItem, {
  36896. "item": item,
  36897. "style": style,
  36898. "height": sized ? itemSize : estimatedSize
  36899. }, null);
  36900. }
  36901. const isSelected = isItemSelected(modelValue, item);
  36902. const isDisabled = isItemDisabled(modelValue, isSelected);
  36903. const isHovering = isItemHovering(index);
  36904. return vue.createVNode(OptionItem, vue.mergeProps(itemProps, {
  36905. "selected": isSelected,
  36906. "disabled": item.disabled || isDisabled,
  36907. "created": !!item.created,
  36908. "hovering": isHovering,
  36909. "item": item,
  36910. "onSelect": onSelect,
  36911. "onHover": onHover
  36912. }), {
  36913. default: (props2) => {
  36914. var _a;
  36915. return ((_a = slots.default) == null ? void 0 : _a.call(slots, props2)) || vue.createVNode("span", null, [item.label]);
  36916. }
  36917. });
  36918. };
  36919. const {
  36920. onKeyboardNavigate,
  36921. onKeyboardSelect
  36922. } = select;
  36923. const onForward = () => {
  36924. onKeyboardNavigate("forward");
  36925. };
  36926. const onBackward = () => {
  36927. onKeyboardNavigate("backward");
  36928. };
  36929. const onEscOrTab = () => {
  36930. select.expanded = false;
  36931. };
  36932. const onKeydown = (e) => {
  36933. const {
  36934. code
  36935. } = e;
  36936. const {
  36937. tab,
  36938. esc,
  36939. down,
  36940. up,
  36941. enter
  36942. } = EVENT_CODE;
  36943. if (code !== tab) {
  36944. e.preventDefault();
  36945. e.stopPropagation();
  36946. }
  36947. switch (code) {
  36948. case tab:
  36949. case esc: {
  36950. onEscOrTab();
  36951. break;
  36952. }
  36953. case down: {
  36954. onForward();
  36955. break;
  36956. }
  36957. case up: {
  36958. onBackward();
  36959. break;
  36960. }
  36961. case enter: {
  36962. onKeyboardSelect();
  36963. break;
  36964. }
  36965. }
  36966. };
  36967. return () => {
  36968. var _a;
  36969. const {
  36970. data,
  36971. width
  36972. } = props;
  36973. const {
  36974. height,
  36975. multiple,
  36976. scrollbarAlwaysOn
  36977. } = select.props;
  36978. if (data.length === 0) {
  36979. return vue.createVNode("div", {
  36980. "class": ns.b("dropdown"),
  36981. "style": {
  36982. width: `${width}px`
  36983. }
  36984. }, [(_a = slots.empty) == null ? void 0 : _a.call(slots)]);
  36985. }
  36986. const List = vue.unref(isSized) ? FixedSizeList$1 : DynamicSizeList$1;
  36987. return vue.createVNode("div", {
  36988. "class": [ns.b("dropdown"), ns.is("multiple", multiple)]
  36989. }, [vue.createVNode(List, vue.mergeProps({
  36990. "ref": listRef
  36991. }, vue.unref(listProps), {
  36992. "className": ns.be("dropdown", "list"),
  36993. "scrollbarAlwaysOn": scrollbarAlwaysOn,
  36994. "data": data,
  36995. "height": height,
  36996. "width": width,
  36997. "total": data.length,
  36998. "onKeydown": onKeydown
  36999. }), {
  37000. default: (props2) => vue.createVNode(Item, props2, null)
  37001. })]);
  37002. };
  37003. }
  37004. });
  37005. function useAllowCreate(props, states) {
  37006. const createOptionCount = vue.ref(0);
  37007. const cachedSelectedOption = vue.ref(null);
  37008. const enableAllowCreateMode = vue.computed(() => {
  37009. return props.allowCreate && props.filterable;
  37010. });
  37011. function hasExistingOption(query) {
  37012. const hasValue = (option) => option.value === query;
  37013. return props.options && props.options.some(hasValue) || states.createdOptions.some(hasValue);
  37014. }
  37015. function selectNewOption(option) {
  37016. if (!enableAllowCreateMode.value) {
  37017. return;
  37018. }
  37019. if (props.multiple && option.created) {
  37020. createOptionCount.value++;
  37021. } else {
  37022. cachedSelectedOption.value = option;
  37023. }
  37024. }
  37025. function createNewOption(query) {
  37026. if (enableAllowCreateMode.value) {
  37027. if (query && query.length > 0 && !hasExistingOption(query)) {
  37028. const newOption = {
  37029. value: query,
  37030. label: query,
  37031. created: true,
  37032. disabled: false
  37033. };
  37034. if (states.createdOptions.length >= createOptionCount.value) {
  37035. states.createdOptions[createOptionCount.value] = newOption;
  37036. } else {
  37037. states.createdOptions.push(newOption);
  37038. }
  37039. } else {
  37040. if (props.multiple) {
  37041. states.createdOptions.length = createOptionCount.value;
  37042. } else {
  37043. const selectedOption = cachedSelectedOption.value;
  37044. states.createdOptions.length = 0;
  37045. if (selectedOption && selectedOption.created) {
  37046. states.createdOptions.push(selectedOption);
  37047. }
  37048. }
  37049. }
  37050. }
  37051. }
  37052. function removeNewOption(option) {
  37053. if (!enableAllowCreateMode.value || !option || !option.created || option.created && props.reserveKeyword && states.inputValue === option.label) {
  37054. return;
  37055. }
  37056. const idx = states.createdOptions.findIndex((it) => it.value === option.value);
  37057. if (~idx) {
  37058. states.createdOptions.splice(idx, 1);
  37059. createOptionCount.value--;
  37060. }
  37061. }
  37062. function clearAllNewOption() {
  37063. if (enableAllowCreateMode.value) {
  37064. states.createdOptions.length = 0;
  37065. createOptionCount.value = 0;
  37066. }
  37067. }
  37068. return {
  37069. createNewOption,
  37070. removeNewOption,
  37071. selectNewOption,
  37072. clearAllNewOption
  37073. };
  37074. }
  37075. const flattenOptions = (options) => {
  37076. const flattened = [];
  37077. options.forEach((option) => {
  37078. if (isArray(option.options)) {
  37079. flattened.push({
  37080. label: option.label,
  37081. isTitle: true,
  37082. type: "Group"
  37083. });
  37084. option.options.forEach((o) => {
  37085. flattened.push(o);
  37086. });
  37087. flattened.push({
  37088. type: "Group"
  37089. });
  37090. } else {
  37091. flattened.push(option);
  37092. }
  37093. });
  37094. return flattened;
  37095. };
  37096. function useInput(handleInput) {
  37097. const isComposing = vue.ref(false);
  37098. const handleCompositionStart = () => {
  37099. isComposing.value = true;
  37100. };
  37101. const handleCompositionUpdate = (event) => {
  37102. const text = event.target.value;
  37103. const lastCharacter = text[text.length - 1] || "";
  37104. isComposing.value = !isKorean(lastCharacter);
  37105. };
  37106. const handleCompositionEnd = (event) => {
  37107. if (isComposing.value) {
  37108. isComposing.value = false;
  37109. if (isFunction(handleInput)) {
  37110. handleInput(event);
  37111. }
  37112. }
  37113. };
  37114. return {
  37115. handleCompositionStart,
  37116. handleCompositionUpdate,
  37117. handleCompositionEnd
  37118. };
  37119. }
  37120. const DEFAULT_INPUT_PLACEHOLDER = "";
  37121. const MINIMUM_INPUT_WIDTH = 11;
  37122. const TAG_BASE_WIDTH = {
  37123. larget: 51,
  37124. default: 42,
  37125. small: 33
  37126. };
  37127. const useSelect$1 = (props, emit) => {
  37128. const { t } = useLocale();
  37129. const nsSelectV2 = useNamespace("select-v2");
  37130. const nsInput = useNamespace("input");
  37131. const { form: elForm, formItem: elFormItem } = useFormItem();
  37132. const states = vue.reactive({
  37133. inputValue: DEFAULT_INPUT_PLACEHOLDER,
  37134. displayInputValue: DEFAULT_INPUT_PLACEHOLDER,
  37135. calculatedWidth: 0,
  37136. cachedPlaceholder: "",
  37137. cachedOptions: [],
  37138. createdOptions: [],
  37139. createdLabel: "",
  37140. createdSelected: false,
  37141. currentPlaceholder: "",
  37142. hoveringIndex: -1,
  37143. comboBoxHovering: false,
  37144. isOnComposition: false,
  37145. isSilentBlur: false,
  37146. isComposing: false,
  37147. inputLength: 20,
  37148. selectWidth: 200,
  37149. initialInputHeight: 0,
  37150. previousQuery: null,
  37151. previousValue: void 0,
  37152. query: "",
  37153. selectedLabel: "",
  37154. softFocus: false,
  37155. tagInMultiLine: false
  37156. });
  37157. const selectedIndex = vue.ref(-1);
  37158. const popperSize = vue.ref(-1);
  37159. const controlRef = vue.ref(null);
  37160. const inputRef = vue.ref(null);
  37161. const menuRef = vue.ref(null);
  37162. const popper = vue.ref(null);
  37163. const selectRef = vue.ref(null);
  37164. const selectionRef = vue.ref(null);
  37165. const calculatorRef = vue.ref(null);
  37166. const expanded = vue.ref(false);
  37167. const selectDisabled = vue.computed(() => props.disabled || (elForm == null ? void 0 : elForm.disabled));
  37168. const popupHeight = vue.computed(() => {
  37169. const totalHeight = filteredOptions.value.length * 34;
  37170. return totalHeight > props.height ? props.height : totalHeight;
  37171. });
  37172. const hasModelValue = vue.computed(() => {
  37173. return !isNil(props.modelValue);
  37174. });
  37175. const showClearBtn = vue.computed(() => {
  37176. const hasValue = props.multiple ? Array.isArray(props.modelValue) && props.modelValue.length > 0 : hasModelValue.value;
  37177. const criteria = props.clearable && !selectDisabled.value && states.comboBoxHovering && hasValue;
  37178. return criteria;
  37179. });
  37180. const iconComponent = vue.computed(() => props.remote && props.filterable ? "" : arrow_up_default);
  37181. const iconReverse = vue.computed(() => iconComponent.value && nsSelectV2.is("reverse", expanded.value));
  37182. const validateState = vue.computed(() => (elFormItem == null ? void 0 : elFormItem.validateState) || "");
  37183. const validateIcon = vue.computed(() => ValidateComponentsMap[validateState.value]);
  37184. const debounce$1 = vue.computed(() => props.remote ? 300 : 0);
  37185. const emptyText = vue.computed(() => {
  37186. const options = filteredOptions.value;
  37187. if (props.loading) {
  37188. return props.loadingText || t("el.select.loading");
  37189. } else {
  37190. if (props.remote && states.inputValue === "" && options.length === 0)
  37191. return false;
  37192. if (props.filterable && states.inputValue && options.length > 0) {
  37193. return props.noMatchText || t("el.select.noMatch");
  37194. }
  37195. if (options.length === 0) {
  37196. return props.noDataText || t("el.select.noData");
  37197. }
  37198. }
  37199. return null;
  37200. });
  37201. const filteredOptions = vue.computed(() => {
  37202. const isValidOption = (o) => {
  37203. const query = states.inputValue;
  37204. const regexp = new RegExp(escapeStringRegexp(query), "i");
  37205. const containsQueryString = query ? regexp.test(o.label || "") : true;
  37206. return containsQueryString;
  37207. };
  37208. if (props.loading) {
  37209. return [];
  37210. }
  37211. return flattenOptions(props.options.concat(states.createdOptions).map((v) => {
  37212. if (isArray(v.options)) {
  37213. const filtered = v.options.filter(isValidOption);
  37214. if (filtered.length > 0) {
  37215. return {
  37216. ...v,
  37217. options: filtered
  37218. };
  37219. }
  37220. } else {
  37221. if (props.remote || isValidOption(v)) {
  37222. return v;
  37223. }
  37224. }
  37225. return null;
  37226. }).filter((v) => v !== null));
  37227. });
  37228. const optionsAllDisabled = vue.computed(() => filteredOptions.value.every((option) => option.disabled));
  37229. const selectSize = useSize();
  37230. const collapseTagSize = vue.computed(() => selectSize.value === "small" ? "small" : "default");
  37231. const tagMaxWidth = vue.computed(() => {
  37232. const select = selectionRef.value;
  37233. const size = collapseTagSize.value || "default";
  37234. const paddingLeft = select ? Number.parseInt(getComputedStyle(select).paddingLeft) : 0;
  37235. const paddingRight = select ? Number.parseInt(getComputedStyle(select).paddingRight) : 0;
  37236. return states.selectWidth - paddingRight - paddingLeft - TAG_BASE_WIDTH[size];
  37237. });
  37238. const calculatePopperSize = () => {
  37239. var _a;
  37240. popperSize.value = ((_a = selectRef.value) == null ? void 0 : _a.offsetWidth) || 200;
  37241. };
  37242. const inputWrapperStyle = vue.computed(() => {
  37243. return {
  37244. width: `${states.calculatedWidth === 0 ? MINIMUM_INPUT_WIDTH : Math.ceil(states.calculatedWidth) + MINIMUM_INPUT_WIDTH}px`
  37245. };
  37246. });
  37247. const shouldShowPlaceholder = vue.computed(() => {
  37248. if (isArray(props.modelValue)) {
  37249. return props.modelValue.length === 0 && !states.displayInputValue;
  37250. }
  37251. return props.filterable ? states.displayInputValue.length === 0 : true;
  37252. });
  37253. const currentPlaceholder = vue.computed(() => {
  37254. const _placeholder = props.placeholder || t("el.select.placeholder");
  37255. return props.multiple || isNil(props.modelValue) ? _placeholder : states.selectedLabel;
  37256. });
  37257. const popperRef = vue.computed(() => {
  37258. var _a, _b;
  37259. return (_b = (_a = popper.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  37260. });
  37261. const indexRef = vue.computed(() => {
  37262. if (props.multiple) {
  37263. const len = props.modelValue.length;
  37264. if (props.modelValue.length > 0) {
  37265. return filteredOptions.value.findIndex((o) => o.value === props.modelValue[len - 1]);
  37266. }
  37267. } else {
  37268. if (props.modelValue) {
  37269. return filteredOptions.value.findIndex((o) => o.value === props.modelValue);
  37270. }
  37271. }
  37272. return -1;
  37273. });
  37274. const dropdownMenuVisible = vue.computed({
  37275. get() {
  37276. return expanded.value && emptyText.value !== false;
  37277. },
  37278. set(val) {
  37279. expanded.value = val;
  37280. }
  37281. });
  37282. const {
  37283. createNewOption,
  37284. removeNewOption,
  37285. selectNewOption,
  37286. clearAllNewOption
  37287. } = useAllowCreate(props, states);
  37288. const {
  37289. handleCompositionStart,
  37290. handleCompositionUpdate,
  37291. handleCompositionEnd
  37292. } = useInput((e) => onInput(e));
  37293. const focusAndUpdatePopup = () => {
  37294. var _a, _b, _c;
  37295. (_b = (_a = inputRef.value).focus) == null ? void 0 : _b.call(_a);
  37296. (_c = popper.value) == null ? void 0 : _c.updatePopper();
  37297. };
  37298. const toggleMenu = () => {
  37299. if (props.automaticDropdown)
  37300. return;
  37301. if (!selectDisabled.value) {
  37302. if (states.isComposing)
  37303. states.softFocus = true;
  37304. return vue.nextTick(() => {
  37305. var _a, _b;
  37306. expanded.value = !expanded.value;
  37307. (_b = (_a = inputRef.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  37308. });
  37309. }
  37310. };
  37311. const onInputChange = () => {
  37312. if (props.filterable && states.inputValue !== states.selectedLabel) {
  37313. states.query = states.selectedLabel;
  37314. }
  37315. handleQueryChange(states.inputValue);
  37316. return vue.nextTick(() => {
  37317. createNewOption(states.inputValue);
  37318. });
  37319. };
  37320. const debouncedOnInputChange = debounce(onInputChange, debounce$1.value);
  37321. const handleQueryChange = (val) => {
  37322. if (states.previousQuery === val) {
  37323. return;
  37324. }
  37325. states.previousQuery = val;
  37326. if (props.filterable && isFunction(props.filterMethod)) {
  37327. props.filterMethod(val);
  37328. } else if (props.filterable && props.remote && isFunction(props.remoteMethod)) {
  37329. props.remoteMethod(val);
  37330. }
  37331. };
  37332. const emitChange = (val) => {
  37333. if (!isEqual$1(props.modelValue, val)) {
  37334. emit(CHANGE_EVENT, val);
  37335. }
  37336. };
  37337. const update = (val) => {
  37338. emit(UPDATE_MODEL_EVENT, val);
  37339. emitChange(val);
  37340. states.previousValue = val == null ? void 0 : val.toString();
  37341. };
  37342. const getValueIndex = (arr = [], value) => {
  37343. if (!isObject$1(value)) {
  37344. return arr.indexOf(value);
  37345. }
  37346. const valueKey = props.valueKey;
  37347. let index = -1;
  37348. arr.some((item, i) => {
  37349. if (get(item, valueKey) === get(value, valueKey)) {
  37350. index = i;
  37351. return true;
  37352. }
  37353. return false;
  37354. });
  37355. return index;
  37356. };
  37357. const getValueKey = (item) => {
  37358. return isObject$1(item) ? get(item, props.valueKey) : item;
  37359. };
  37360. const getLabel = (item) => {
  37361. return isObject$1(item) ? item.label : item;
  37362. };
  37363. const resetInputHeight = () => {
  37364. if (props.collapseTags && !props.filterable) {
  37365. return;
  37366. }
  37367. return vue.nextTick(() => {
  37368. var _a, _b;
  37369. if (!inputRef.value)
  37370. return;
  37371. const selection = selectionRef.value;
  37372. selectRef.value.height = selection.offsetHeight;
  37373. if (expanded.value && emptyText.value !== false) {
  37374. (_b = (_a = popper.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  37375. }
  37376. });
  37377. };
  37378. const handleResize = () => {
  37379. var _a, _b;
  37380. resetInputWidth();
  37381. calculatePopperSize();
  37382. (_b = (_a = popper.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
  37383. if (props.multiple) {
  37384. return resetInputHeight();
  37385. }
  37386. };
  37387. const resetInputWidth = () => {
  37388. const select = selectionRef.value;
  37389. if (select) {
  37390. states.selectWidth = select.getBoundingClientRect().width;
  37391. }
  37392. };
  37393. const onSelect = (option, idx, byClick = true) => {
  37394. var _a, _b;
  37395. if (props.multiple) {
  37396. let selectedOptions = props.modelValue.slice();
  37397. const index = getValueIndex(selectedOptions, getValueKey(option));
  37398. if (index > -1) {
  37399. selectedOptions = [
  37400. ...selectedOptions.slice(0, index),
  37401. ...selectedOptions.slice(index + 1)
  37402. ];
  37403. states.cachedOptions.splice(index, 1);
  37404. removeNewOption(option);
  37405. } else if (props.multipleLimit <= 0 || selectedOptions.length < props.multipleLimit) {
  37406. selectedOptions = [...selectedOptions, getValueKey(option)];
  37407. states.cachedOptions.push(option);
  37408. selectNewOption(option);
  37409. updateHoveringIndex(idx);
  37410. }
  37411. update(selectedOptions);
  37412. if (option.created) {
  37413. states.query = "";
  37414. handleQueryChange("");
  37415. states.inputLength = 20;
  37416. }
  37417. if (props.filterable && !props.reserveKeyword) {
  37418. (_b = (_a = inputRef.value).focus) == null ? void 0 : _b.call(_a);
  37419. onUpdateInputValue("");
  37420. }
  37421. if (props.filterable) {
  37422. states.calculatedWidth = calculatorRef.value.getBoundingClientRect().width;
  37423. }
  37424. resetInputHeight();
  37425. setSoftFocus();
  37426. } else {
  37427. selectedIndex.value = idx;
  37428. states.selectedLabel = option.label;
  37429. update(getValueKey(option));
  37430. expanded.value = false;
  37431. states.isComposing = false;
  37432. states.isSilentBlur = byClick;
  37433. selectNewOption(option);
  37434. if (!option.created) {
  37435. clearAllNewOption();
  37436. }
  37437. updateHoveringIndex(idx);
  37438. }
  37439. };
  37440. const deleteTag = (event, tag) => {
  37441. const { valueKey } = props;
  37442. const index = props.modelValue.indexOf(get(tag, valueKey));
  37443. if (index > -1 && !selectDisabled.value) {
  37444. const value = [
  37445. ...props.modelValue.slice(0, index),
  37446. ...props.modelValue.slice(index + 1)
  37447. ];
  37448. states.cachedOptions.splice(index, 1);
  37449. update(value);
  37450. emit("remove-tag", get(tag, valueKey));
  37451. states.softFocus = true;
  37452. removeNewOption(tag);
  37453. return vue.nextTick(focusAndUpdatePopup);
  37454. }
  37455. event.stopPropagation();
  37456. };
  37457. const handleFocus = (event) => {
  37458. const focused = states.isComposing;
  37459. states.isComposing = true;
  37460. if (!states.softFocus) {
  37461. if (!focused)
  37462. emit("focus", event);
  37463. } else {
  37464. states.softFocus = false;
  37465. }
  37466. };
  37467. const handleBlur = (event) => {
  37468. states.softFocus = false;
  37469. return vue.nextTick(() => {
  37470. var _a, _b;
  37471. (_b = (_a = inputRef.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
  37472. if (calculatorRef.value) {
  37473. states.calculatedWidth = calculatorRef.value.getBoundingClientRect().width;
  37474. }
  37475. if (states.isSilentBlur) {
  37476. states.isSilentBlur = false;
  37477. } else {
  37478. if (states.isComposing) {
  37479. emit("blur", event);
  37480. }
  37481. }
  37482. states.isComposing = false;
  37483. });
  37484. };
  37485. const handleEsc = () => {
  37486. if (states.displayInputValue.length > 0) {
  37487. onUpdateInputValue("");
  37488. } else {
  37489. expanded.value = false;
  37490. }
  37491. };
  37492. const handleDel = (e) => {
  37493. if (states.displayInputValue.length === 0) {
  37494. e.preventDefault();
  37495. const selected = props.modelValue.slice();
  37496. selected.pop();
  37497. removeNewOption(states.cachedOptions.pop());
  37498. update(selected);
  37499. }
  37500. };
  37501. const handleClear = () => {
  37502. let emptyValue;
  37503. if (isArray(props.modelValue)) {
  37504. emptyValue = [];
  37505. } else {
  37506. emptyValue = void 0;
  37507. }
  37508. states.softFocus = true;
  37509. if (props.multiple) {
  37510. states.cachedOptions = [];
  37511. } else {
  37512. states.selectedLabel = "";
  37513. }
  37514. expanded.value = false;
  37515. update(emptyValue);
  37516. emit("clear");
  37517. clearAllNewOption();
  37518. return vue.nextTick(focusAndUpdatePopup);
  37519. };
  37520. const onUpdateInputValue = (val) => {
  37521. states.displayInputValue = val;
  37522. states.inputValue = val;
  37523. };
  37524. const onKeyboardNavigate = (direction, hoveringIndex = void 0) => {
  37525. const options = filteredOptions.value;
  37526. if (!["forward", "backward"].includes(direction) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value) {
  37527. return;
  37528. }
  37529. if (!expanded.value) {
  37530. return toggleMenu();
  37531. }
  37532. if (hoveringIndex === void 0) {
  37533. hoveringIndex = states.hoveringIndex;
  37534. }
  37535. let newIndex = -1;
  37536. if (direction === "forward") {
  37537. newIndex = hoveringIndex + 1;
  37538. if (newIndex >= options.length) {
  37539. newIndex = 0;
  37540. }
  37541. } else if (direction === "backward") {
  37542. newIndex = hoveringIndex - 1;
  37543. if (newIndex < 0 || newIndex >= options.length) {
  37544. newIndex = options.length - 1;
  37545. }
  37546. }
  37547. const option = options[newIndex];
  37548. if (option.disabled || option.type === "Group") {
  37549. return onKeyboardNavigate(direction, newIndex);
  37550. } else {
  37551. updateHoveringIndex(newIndex);
  37552. scrollToItem(newIndex);
  37553. }
  37554. };
  37555. const onKeyboardSelect = () => {
  37556. if (!expanded.value) {
  37557. return toggleMenu();
  37558. } else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) {
  37559. onSelect(filteredOptions.value[states.hoveringIndex], states.hoveringIndex, false);
  37560. }
  37561. };
  37562. const updateHoveringIndex = (idx) => {
  37563. states.hoveringIndex = idx;
  37564. };
  37565. const resetHoveringIndex = () => {
  37566. states.hoveringIndex = -1;
  37567. };
  37568. const setSoftFocus = () => {
  37569. var _a;
  37570. const _input = inputRef.value;
  37571. if (_input) {
  37572. (_a = _input.focus) == null ? void 0 : _a.call(_input);
  37573. }
  37574. };
  37575. const onInput = (event) => {
  37576. const value = event.target.value;
  37577. onUpdateInputValue(value);
  37578. if (states.displayInputValue.length > 0 && !expanded.value) {
  37579. expanded.value = true;
  37580. }
  37581. states.calculatedWidth = calculatorRef.value.getBoundingClientRect().width;
  37582. if (props.multiple) {
  37583. resetInputHeight();
  37584. }
  37585. if (props.remote) {
  37586. debouncedOnInputChange();
  37587. } else {
  37588. return onInputChange();
  37589. }
  37590. };
  37591. const handleClickOutside = () => {
  37592. expanded.value = false;
  37593. return handleBlur();
  37594. };
  37595. const handleMenuEnter = () => {
  37596. states.inputValue = states.displayInputValue;
  37597. return vue.nextTick(() => {
  37598. if (~indexRef.value) {
  37599. updateHoveringIndex(indexRef.value);
  37600. scrollToItem(states.hoveringIndex);
  37601. }
  37602. });
  37603. };
  37604. const scrollToItem = (index) => {
  37605. menuRef.value.scrollToItem(index);
  37606. };
  37607. const initStates = () => {
  37608. resetHoveringIndex();
  37609. if (props.multiple) {
  37610. if (props.modelValue.length > 0) {
  37611. let initHovering = false;
  37612. states.cachedOptions.length = 0;
  37613. states.previousValue = props.modelValue.toString();
  37614. props.modelValue.forEach((selected) => {
  37615. const itemIndex = filteredOptions.value.findIndex((option) => getValueKey(option) === selected);
  37616. if (~itemIndex) {
  37617. states.cachedOptions.push(filteredOptions.value[itemIndex]);
  37618. if (!initHovering) {
  37619. updateHoveringIndex(itemIndex);
  37620. }
  37621. initHovering = true;
  37622. }
  37623. });
  37624. } else {
  37625. states.cachedOptions = [];
  37626. states.previousValue = void 0;
  37627. }
  37628. } else {
  37629. if (hasModelValue.value) {
  37630. states.previousValue = props.modelValue;
  37631. const options = filteredOptions.value;
  37632. const selectedItemIndex = options.findIndex((option) => getValueKey(option) === getValueKey(props.modelValue));
  37633. if (~selectedItemIndex) {
  37634. states.selectedLabel = options[selectedItemIndex].label;
  37635. updateHoveringIndex(selectedItemIndex);
  37636. } else {
  37637. states.selectedLabel = `${props.modelValue}`;
  37638. }
  37639. } else {
  37640. states.selectedLabel = "";
  37641. states.previousValue = void 0;
  37642. }
  37643. }
  37644. clearAllNewOption();
  37645. calculatePopperSize();
  37646. };
  37647. vue.watch(expanded, (val) => {
  37648. var _a, _b;
  37649. emit("visible-change", val);
  37650. if (val) {
  37651. (_b = (_a = popper.value).update) == null ? void 0 : _b.call(_a);
  37652. } else {
  37653. states.displayInputValue = "";
  37654. states.previousQuery = null;
  37655. createNewOption("");
  37656. }
  37657. });
  37658. vue.watch(() => props.modelValue, (val, oldVal) => {
  37659. var _a;
  37660. if (!val || val.toString() !== states.previousValue) {
  37661. initStates();
  37662. }
  37663. if (!isEqual$1(val, oldVal) && props.validateEvent) {
  37664. (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn());
  37665. }
  37666. }, {
  37667. deep: true
  37668. });
  37669. vue.watch(() => props.options, () => {
  37670. const input = inputRef.value;
  37671. if (!input || input && document.activeElement !== input) {
  37672. initStates();
  37673. }
  37674. }, {
  37675. deep: true
  37676. });
  37677. vue.watch(filteredOptions, () => {
  37678. return vue.nextTick(menuRef.value.resetScrollTop);
  37679. });
  37680. vue.onMounted(() => {
  37681. initStates();
  37682. });
  37683. useResizeObserver(selectRef, handleResize);
  37684. return {
  37685. collapseTagSize,
  37686. currentPlaceholder,
  37687. expanded,
  37688. emptyText,
  37689. popupHeight,
  37690. debounce: debounce$1,
  37691. filteredOptions,
  37692. iconComponent,
  37693. iconReverse,
  37694. inputWrapperStyle,
  37695. popperSize,
  37696. dropdownMenuVisible,
  37697. hasModelValue,
  37698. shouldShowPlaceholder,
  37699. selectDisabled,
  37700. selectSize,
  37701. showClearBtn,
  37702. states,
  37703. tagMaxWidth,
  37704. nsSelectV2,
  37705. nsInput,
  37706. calculatorRef,
  37707. controlRef,
  37708. inputRef,
  37709. menuRef,
  37710. popper,
  37711. selectRef,
  37712. selectionRef,
  37713. popperRef,
  37714. validateState,
  37715. validateIcon,
  37716. debouncedOnInputChange,
  37717. deleteTag,
  37718. getLabel,
  37719. getValueKey,
  37720. handleBlur,
  37721. handleClear,
  37722. handleClickOutside,
  37723. handleDel,
  37724. handleEsc,
  37725. handleFocus,
  37726. handleMenuEnter,
  37727. handleResize,
  37728. toggleMenu,
  37729. scrollTo: scrollToItem,
  37730. onInput,
  37731. onKeyboardNavigate,
  37732. onKeyboardSelect,
  37733. onSelect,
  37734. onHover: updateHoveringIndex,
  37735. onUpdateInputValue,
  37736. handleCompositionStart,
  37737. handleCompositionEnd,
  37738. handleCompositionUpdate
  37739. };
  37740. };
  37741. var useSelect$2 = useSelect$1;
  37742. const _sfc_main$A = vue.defineComponent({
  37743. name: "ElSelectV2",
  37744. components: {
  37745. ElSelectMenu,
  37746. ElTag,
  37747. ElTooltip,
  37748. ElIcon
  37749. },
  37750. directives: { ClickOutside, ModelText: vue.vModelText },
  37751. props: SelectProps,
  37752. emits: [
  37753. UPDATE_MODEL_EVENT,
  37754. CHANGE_EVENT,
  37755. "remove-tag",
  37756. "clear",
  37757. "visible-change",
  37758. "focus",
  37759. "blur"
  37760. ],
  37761. setup(props, { emit }) {
  37762. const modelValue = vue.computed(() => {
  37763. const { modelValue: rawModelValue, multiple } = props;
  37764. const fallback = multiple ? [] : void 0;
  37765. if (isArray(rawModelValue)) {
  37766. return multiple ? rawModelValue : fallback;
  37767. }
  37768. return multiple ? fallback : rawModelValue;
  37769. });
  37770. const API = useSelect$2(vue.reactive({
  37771. ...vue.toRefs(props),
  37772. modelValue
  37773. }), emit);
  37774. vue.provide(selectV2InjectionKey, {
  37775. props: vue.reactive({
  37776. ...vue.toRefs(props),
  37777. height: API.popupHeight,
  37778. modelValue
  37779. }),
  37780. popper: API.popper,
  37781. onSelect: API.onSelect,
  37782. onHover: API.onHover,
  37783. onKeyboardNavigate: API.onKeyboardNavigate,
  37784. onKeyboardSelect: API.onKeyboardSelect
  37785. });
  37786. return {
  37787. ...API,
  37788. modelValue
  37789. };
  37790. }
  37791. });
  37792. const _hoisted_1$g = { key: 0 };
  37793. const _hoisted_2$b = ["id", "autocomplete", "aria-expanded", "aria-labelledby", "disabled", "readonly", "name", "unselectable"];
  37794. const _hoisted_3$5 = ["textContent"];
  37795. const _hoisted_4$3 = ["id", "aria-labelledby", "aria-expanded", "autocomplete", "disabled", "name", "readonly", "unselectable"];
  37796. const _hoisted_5$2 = ["textContent"];
  37797. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  37798. const _component_el_tag = vue.resolveComponent("el-tag");
  37799. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  37800. const _component_el_icon = vue.resolveComponent("el-icon");
  37801. const _component_el_select_menu = vue.resolveComponent("el-select-menu");
  37802. const _directive_model_text = vue.resolveDirective("model-text");
  37803. const _directive_click_outside = vue.resolveDirective("click-outside");
  37804. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  37805. ref: "selectRef",
  37806. class: vue.normalizeClass([_ctx.nsSelectV2.b(), _ctx.nsSelectV2.m(_ctx.selectSize)]),
  37807. onClick: _cache[25] || (_cache[25] = vue.withModifiers((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"])),
  37808. onMouseenter: _cache[26] || (_cache[26] = ($event) => _ctx.states.comboBoxHovering = true),
  37809. onMouseleave: _cache[27] || (_cache[27] = ($event) => _ctx.states.comboBoxHovering = false)
  37810. }, [
  37811. vue.createVNode(_component_el_tooltip, {
  37812. ref: "popper",
  37813. visible: _ctx.dropdownMenuVisible,
  37814. teleported: _ctx.teleported,
  37815. "popper-class": [_ctx.nsSelectV2.e("popper"), _ctx.popperClass],
  37816. "gpu-acceleration": false,
  37817. "stop-popper-mouse-event": false,
  37818. "popper-options": _ctx.popperOptions,
  37819. "fallback-placements": ["bottom-start", "top-start", "right", "left"],
  37820. effect: _ctx.effect,
  37821. placement: _ctx.placement,
  37822. pure: "",
  37823. transition: `${_ctx.nsSelectV2.namespace.value}-zoom-in-top`,
  37824. trigger: "click",
  37825. persistent: _ctx.persistent,
  37826. onBeforeShow: _ctx.handleMenuEnter,
  37827. onHide: _cache[24] || (_cache[24] = ($event) => _ctx.states.inputValue = _ctx.states.displayInputValue)
  37828. }, {
  37829. default: vue.withCtx(() => {
  37830. var _a;
  37831. return [
  37832. vue.createElementVNode("div", {
  37833. ref: "selectionRef",
  37834. class: vue.normalizeClass([
  37835. _ctx.nsSelectV2.e("wrapper"),
  37836. _ctx.nsSelectV2.is("focused", _ctx.states.isComposing || _ctx.expanded),
  37837. _ctx.nsSelectV2.is("hovering", _ctx.states.comboBoxHovering),
  37838. _ctx.nsSelectV2.is("filterable", _ctx.filterable),
  37839. _ctx.nsSelectV2.is("disabled", _ctx.selectDisabled)
  37840. ])
  37841. }, [
  37842. _ctx.$slots.prefix ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$g, [
  37843. vue.renderSlot(_ctx.$slots, "prefix")
  37844. ])) : vue.createCommentVNode("v-if", true),
  37845. _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", {
  37846. key: 1,
  37847. class: vue.normalizeClass(_ctx.nsSelectV2.e("selection"))
  37848. }, [
  37849. _ctx.collapseTags && _ctx.modelValue.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", {
  37850. key: 0,
  37851. class: vue.normalizeClass(_ctx.nsSelectV2.e("selected-item"))
  37852. }, [
  37853. vue.createVNode(_component_el_tag, {
  37854. closable: !_ctx.selectDisabled && !((_a = _ctx.states.cachedOptions[0]) == null ? void 0 : _a.disable),
  37855. size: _ctx.collapseTagSize,
  37856. type: "info",
  37857. "disable-transitions": "",
  37858. onClose: _cache[0] || (_cache[0] = ($event) => _ctx.deleteTag($event, _ctx.states.cachedOptions[0]))
  37859. }, {
  37860. default: vue.withCtx(() => {
  37861. var _a2;
  37862. return [
  37863. vue.createElementVNode("span", {
  37864. class: vue.normalizeClass(_ctx.nsSelectV2.e("tags-text")),
  37865. style: vue.normalizeStyle({
  37866. maxWidth: `${_ctx.tagMaxWidth}px`
  37867. })
  37868. }, vue.toDisplayString((_a2 = _ctx.states.cachedOptions[0]) == null ? void 0 : _a2.label), 7)
  37869. ];
  37870. }),
  37871. _: 1
  37872. }, 8, ["closable", "size"]),
  37873. _ctx.modelValue.length > 1 ? (vue.openBlock(), vue.createBlock(_component_el_tag, {
  37874. key: 0,
  37875. closable: false,
  37876. size: _ctx.collapseTagSize,
  37877. type: "info",
  37878. "disable-transitions": ""
  37879. }, {
  37880. default: vue.withCtx(() => [
  37881. _ctx.collapseTagsTooltip ? (vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  37882. key: 0,
  37883. disabled: _ctx.dropdownMenuVisible,
  37884. "fallback-placements": ["bottom", "top", "right", "left"],
  37885. effect: _ctx.effect,
  37886. placement: "bottom",
  37887. teleported: false
  37888. }, {
  37889. default: vue.withCtx(() => [
  37890. vue.createElementVNode("span", {
  37891. class: vue.normalizeClass(_ctx.nsSelectV2.e("tags-text")),
  37892. style: vue.normalizeStyle({
  37893. maxWidth: `${_ctx.tagMaxWidth}px`
  37894. })
  37895. }, "+ " + vue.toDisplayString(_ctx.modelValue.length - 1), 7)
  37896. ]),
  37897. content: vue.withCtx(() => [
  37898. vue.createElementVNode("div", {
  37899. class: vue.normalizeClass(_ctx.nsSelectV2.e("selection"))
  37900. }, [
  37901. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.states.cachedOptions.slice(1), (selected, idx) => {
  37902. return vue.openBlock(), vue.createElementBlock("div", {
  37903. key: idx,
  37904. class: vue.normalizeClass(_ctx.nsSelectV2.e("selected-item"))
  37905. }, [
  37906. (vue.openBlock(), vue.createBlock(_component_el_tag, {
  37907. key: _ctx.getValueKey(selected),
  37908. closable: !_ctx.selectDisabled && !selected.disabled,
  37909. size: _ctx.collapseTagSize,
  37910. class: "in-tooltip",
  37911. type: "info",
  37912. "disable-transitions": "",
  37913. onClose: ($event) => _ctx.deleteTag($event, selected)
  37914. }, {
  37915. default: vue.withCtx(() => [
  37916. vue.createElementVNode("span", {
  37917. class: vue.normalizeClass(_ctx.nsSelectV2.e("tags-text")),
  37918. style: vue.normalizeStyle({
  37919. maxWidth: `${_ctx.tagMaxWidth}px`
  37920. })
  37921. }, vue.toDisplayString(_ctx.getLabel(selected)), 7)
  37922. ]),
  37923. _: 2
  37924. }, 1032, ["closable", "size", "onClose"]))
  37925. ], 2);
  37926. }), 128))
  37927. ], 2)
  37928. ]),
  37929. _: 1
  37930. }, 8, ["disabled", "effect"])) : (vue.openBlock(), vue.createElementBlock("span", {
  37931. key: 1,
  37932. class: vue.normalizeClass(_ctx.nsSelectV2.e("tags-text")),
  37933. style: vue.normalizeStyle({
  37934. maxWidth: `${_ctx.tagMaxWidth}px`
  37935. })
  37936. }, "+ " + vue.toDisplayString(_ctx.modelValue.length - 1), 7))
  37937. ]),
  37938. _: 1
  37939. }, 8, ["size"])) : vue.createCommentVNode("v-if", true)
  37940. ], 2)) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(_ctx.states.cachedOptions, (selected, idx) => {
  37941. return vue.openBlock(), vue.createElementBlock("div", {
  37942. key: idx,
  37943. class: vue.normalizeClass(_ctx.nsSelectV2.e("selected-item"))
  37944. }, [
  37945. (vue.openBlock(), vue.createBlock(_component_el_tag, {
  37946. key: _ctx.getValueKey(selected),
  37947. closable: !_ctx.selectDisabled && !selected.disabled,
  37948. size: _ctx.collapseTagSize,
  37949. type: "info",
  37950. "disable-transitions": "",
  37951. onClose: ($event) => _ctx.deleteTag($event, selected)
  37952. }, {
  37953. default: vue.withCtx(() => [
  37954. vue.createElementVNode("span", {
  37955. class: vue.normalizeClass(_ctx.nsSelectV2.e("tags-text")),
  37956. style: vue.normalizeStyle({
  37957. maxWidth: `${_ctx.tagMaxWidth}px`
  37958. })
  37959. }, vue.toDisplayString(_ctx.getLabel(selected)), 7)
  37960. ]),
  37961. _: 2
  37962. }, 1032, ["closable", "size", "onClose"]))
  37963. ], 2);
  37964. }), 128)),
  37965. vue.createElementVNode("div", {
  37966. class: vue.normalizeClass([
  37967. _ctx.nsSelectV2.e("selected-item"),
  37968. _ctx.nsSelectV2.e("input-wrapper")
  37969. ]),
  37970. style: vue.normalizeStyle(_ctx.inputWrapperStyle)
  37971. }, [
  37972. vue.withDirectives(vue.createElementVNode("input", {
  37973. id: _ctx.id,
  37974. ref: "inputRef",
  37975. autocomplete: _ctx.autocomplete,
  37976. "aria-autocomplete": "list",
  37977. "aria-haspopup": "listbox",
  37978. autocapitalize: "off",
  37979. "aria-expanded": _ctx.expanded,
  37980. "aria-labelledby": _ctx.label,
  37981. class: vue.normalizeClass([
  37982. _ctx.nsSelectV2.is(_ctx.selectSize),
  37983. _ctx.nsSelectV2.e("combobox-input")
  37984. ]),
  37985. disabled: _ctx.disabled,
  37986. role: "combobox",
  37987. readonly: !_ctx.filterable,
  37988. spellcheck: "false",
  37989. type: "text",
  37990. name: _ctx.name,
  37991. unselectable: _ctx.expanded ? "on" : void 0,
  37992. "onUpdate:modelValue": _cache[1] || (_cache[1] = (...args) => _ctx.onUpdateInputValue && _ctx.onUpdateInputValue(...args)),
  37993. onFocus: _cache[2] || (_cache[2] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  37994. onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  37995. onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  37996. onCompositionstart: _cache[5] || (_cache[5] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  37997. onCompositionupdate: _cache[6] || (_cache[6] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  37998. onCompositionend: _cache[7] || (_cache[7] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  37999. onKeydown: [
  38000. _cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
  38001. _cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
  38002. _cache[10] || (_cache[10] = vue.withKeys(vue.withModifiers((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])),
  38003. _cache[11] || (_cache[11] = vue.withKeys(vue.withModifiers((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"])),
  38004. _cache[12] || (_cache[12] = vue.withKeys(vue.withModifiers((...args) => _ctx.handleDel && _ctx.handleDel(...args), ["stop"]), ["delete"]))
  38005. ]
  38006. }, null, 42, _hoisted_2$b), [
  38007. [_directive_model_text, _ctx.states.displayInputValue]
  38008. ]),
  38009. _ctx.filterable ? (vue.openBlock(), vue.createElementBlock("span", {
  38010. key: 0,
  38011. ref: "calculatorRef",
  38012. "aria-hidden": "true",
  38013. class: vue.normalizeClass(_ctx.nsSelectV2.e("input-calculator")),
  38014. textContent: vue.toDisplayString(_ctx.states.displayInputValue)
  38015. }, null, 10, _hoisted_3$5)) : vue.createCommentVNode("v-if", true)
  38016. ], 6)
  38017. ], 2)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  38018. vue.createElementVNode("div", {
  38019. class: vue.normalizeClass([
  38020. _ctx.nsSelectV2.e("selected-item"),
  38021. _ctx.nsSelectV2.e("input-wrapper")
  38022. ])
  38023. }, [
  38024. vue.withDirectives(vue.createElementVNode("input", {
  38025. id: _ctx.id,
  38026. ref: "inputRef",
  38027. "aria-autocomplete": "list",
  38028. "aria-haspopup": "listbox",
  38029. "aria-labelledby": _ctx.label,
  38030. "aria-expanded": _ctx.expanded,
  38031. autocapitalize: "off",
  38032. autocomplete: _ctx.autocomplete,
  38033. class: vue.normalizeClass(_ctx.nsSelectV2.e("combobox-input")),
  38034. disabled: _ctx.disabled,
  38035. name: _ctx.name,
  38036. role: "combobox",
  38037. readonly: !_ctx.filterable,
  38038. spellcheck: "false",
  38039. type: "text",
  38040. unselectable: _ctx.expanded ? "on" : void 0,
  38041. onCompositionstart: _cache[13] || (_cache[13] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  38042. onCompositionupdate: _cache[14] || (_cache[14] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  38043. onCompositionend: _cache[15] || (_cache[15] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  38044. onFocus: _cache[16] || (_cache[16] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  38045. onBlur: _cache[17] || (_cache[17] = (...args) => _ctx.handleBlur && _ctx.handleBlur(...args)),
  38046. onInput: _cache[18] || (_cache[18] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  38047. onKeydown: [
  38048. _cache[19] || (_cache[19] = vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
  38049. _cache[20] || (_cache[20] = vue.withKeys(vue.withModifiers(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
  38050. _cache[21] || (_cache[21] = vue.withKeys(vue.withModifiers((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])),
  38051. _cache[22] || (_cache[22] = vue.withKeys(vue.withModifiers((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"]))
  38052. ],
  38053. "onUpdate:modelValue": _cache[23] || (_cache[23] = (...args) => _ctx.onUpdateInputValue && _ctx.onUpdateInputValue(...args))
  38054. }, null, 42, _hoisted_4$3), [
  38055. [_directive_model_text, _ctx.states.displayInputValue]
  38056. ])
  38057. ], 2),
  38058. _ctx.filterable ? (vue.openBlock(), vue.createElementBlock("span", {
  38059. key: 0,
  38060. ref: "calculatorRef",
  38061. "aria-hidden": "true",
  38062. class: vue.normalizeClass([
  38063. _ctx.nsSelectV2.e("selected-item"),
  38064. _ctx.nsSelectV2.e("input-calculator")
  38065. ]),
  38066. textContent: vue.toDisplayString(_ctx.states.displayInputValue)
  38067. }, null, 10, _hoisted_5$2)) : vue.createCommentVNode("v-if", true)
  38068. ], 64)),
  38069. _ctx.shouldShowPlaceholder ? (vue.openBlock(), vue.createElementBlock("span", {
  38070. key: 3,
  38071. class: vue.normalizeClass([
  38072. _ctx.nsSelectV2.e("placeholder"),
  38073. _ctx.nsSelectV2.is("transparent", _ctx.multiple ? _ctx.modelValue.length === 0 : !_ctx.hasModelValue)
  38074. ])
  38075. }, vue.toDisplayString(_ctx.currentPlaceholder), 3)) : vue.createCommentVNode("v-if", true),
  38076. vue.createElementVNode("span", {
  38077. class: vue.normalizeClass(_ctx.nsSelectV2.e("suffix"))
  38078. }, [
  38079. _ctx.iconComponent ? vue.withDirectives((vue.openBlock(), vue.createBlock(_component_el_icon, {
  38080. key: 0,
  38081. class: vue.normalizeClass([_ctx.nsSelectV2.e("caret"), _ctx.nsInput.e("icon"), _ctx.iconReverse])
  38082. }, {
  38083. default: vue.withCtx(() => [
  38084. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
  38085. ]),
  38086. _: 1
  38087. }, 8, ["class"])), [
  38088. [vue.vShow, !_ctx.showClearBtn]
  38089. ]) : vue.createCommentVNode("v-if", true),
  38090. _ctx.showClearBtn && _ctx.clearIcon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  38091. key: 1,
  38092. class: vue.normalizeClass([_ctx.nsSelectV2.e("caret"), _ctx.nsInput.e("icon")]),
  38093. onClick: vue.withModifiers(_ctx.handleClear, ["prevent", "stop"])
  38094. }, {
  38095. default: vue.withCtx(() => [
  38096. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.clearIcon)))
  38097. ]),
  38098. _: 1
  38099. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
  38100. _ctx.validateState && _ctx.validateIcon ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  38101. key: 2,
  38102. class: vue.normalizeClass([_ctx.nsInput.e("icon"), _ctx.nsInput.e("validateIcon")])
  38103. }, {
  38104. default: vue.withCtx(() => [
  38105. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.validateIcon)))
  38106. ]),
  38107. _: 1
  38108. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  38109. ], 2)
  38110. ], 2)
  38111. ];
  38112. }),
  38113. content: vue.withCtx(() => [
  38114. vue.createVNode(_component_el_select_menu, {
  38115. ref: "menuRef",
  38116. data: _ctx.filteredOptions,
  38117. width: _ctx.popperSize,
  38118. "hovering-index": _ctx.states.hoveringIndex,
  38119. "scrollbar-always-on": _ctx.scrollbarAlwaysOn
  38120. }, {
  38121. default: vue.withCtx((scope) => [
  38122. vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.guardReactiveProps(scope)))
  38123. ]),
  38124. empty: vue.withCtx(() => [
  38125. vue.renderSlot(_ctx.$slots, "empty", {}, () => [
  38126. vue.createElementVNode("p", {
  38127. class: vue.normalizeClass(_ctx.nsSelectV2.e("empty"))
  38128. }, vue.toDisplayString(_ctx.emptyText ? _ctx.emptyText : ""), 3)
  38129. ])
  38130. ]),
  38131. _: 3
  38132. }, 8, ["data", "width", "hovering-index", "scrollbar-always-on"])
  38133. ]),
  38134. _: 3
  38135. }, 8, ["visible", "teleported", "popper-class", "popper-options", "effect", "placement", "transition", "persistent", "onBeforeShow"])
  38136. ], 34)), [
  38137. [_directive_click_outside, _ctx.handleClickOutside, _ctx.popperRef]
  38138. ]);
  38139. }
  38140. var Select = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["render", _sfc_render$5], ["__file", "select.vue"]]);
  38141. Select.install = (app) => {
  38142. app.component(Select.name, Select);
  38143. };
  38144. const _Select = Select;
  38145. const ElSelectV2 = _Select;
  38146. const skeletonProps = buildProps({
  38147. animated: {
  38148. type: Boolean,
  38149. default: false
  38150. },
  38151. count: {
  38152. type: Number,
  38153. default: 1
  38154. },
  38155. rows: {
  38156. type: Number,
  38157. default: 3
  38158. },
  38159. loading: {
  38160. type: Boolean,
  38161. default: true
  38162. },
  38163. throttle: {
  38164. type: Number
  38165. }
  38166. });
  38167. const skeletonItemProps = buildProps({
  38168. variant: {
  38169. type: String,
  38170. values: [
  38171. "circle",
  38172. "rect",
  38173. "h1",
  38174. "h3",
  38175. "text",
  38176. "caption",
  38177. "p",
  38178. "image",
  38179. "button"
  38180. ],
  38181. default: "text"
  38182. }
  38183. });
  38184. const __default__$s = vue.defineComponent({
  38185. name: "ElSkeletonItem"
  38186. });
  38187. const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
  38188. ...__default__$s,
  38189. props: skeletonItemProps,
  38190. setup(__props) {
  38191. const ns = useNamespace("skeleton");
  38192. return (_ctx, _cache) => {
  38193. return vue.openBlock(), vue.createElementBlock("div", {
  38194. class: vue.normalizeClass([vue.unref(ns).e("item"), vue.unref(ns).e(_ctx.variant)])
  38195. }, [
  38196. _ctx.variant === "image" ? (vue.openBlock(), vue.createBlock(vue.unref(picture_filled_default), { key: 0 })) : vue.createCommentVNode("v-if", true)
  38197. ], 2);
  38198. };
  38199. }
  38200. });
  38201. var SkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__file", "skeleton-item.vue"]]);
  38202. const __default__$r = vue.defineComponent({
  38203. name: "ElSkeleton"
  38204. });
  38205. const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
  38206. ...__default__$r,
  38207. props: skeletonProps,
  38208. setup(__props, { expose }) {
  38209. const props = __props;
  38210. const ns = useNamespace("skeleton");
  38211. const uiLoading = useThrottleRender(vue.toRef(props, "loading"), props.throttle);
  38212. expose({
  38213. uiLoading
  38214. });
  38215. return (_ctx, _cache) => {
  38216. return vue.unref(uiLoading) ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
  38217. key: 0,
  38218. class: [vue.unref(ns).b(), vue.unref(ns).is("animated", _ctx.animated)]
  38219. }, _ctx.$attrs), [
  38220. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.count, (i) => {
  38221. return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i }, [
  38222. _ctx.loading ? vue.renderSlot(_ctx.$slots, "template", { key: i }, () => [
  38223. vue.createVNode(SkeletonItem, {
  38224. class: vue.normalizeClass(vue.unref(ns).is("first")),
  38225. variant: "p"
  38226. }, null, 8, ["class"]),
  38227. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.rows, (item) => {
  38228. return vue.openBlock(), vue.createBlock(SkeletonItem, {
  38229. key: item,
  38230. class: vue.normalizeClass([
  38231. vue.unref(ns).e("paragraph"),
  38232. vue.unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
  38233. ]),
  38234. variant: "p"
  38235. }, null, 8, ["class"]);
  38236. }), 128))
  38237. ]) : vue.createCommentVNode("v-if", true)
  38238. ], 64);
  38239. }), 128))
  38240. ], 16)) : vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.mergeProps({ key: 1 }, _ctx.$attrs)));
  38241. };
  38242. }
  38243. });
  38244. var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__file", "skeleton.vue"]]);
  38245. const ElSkeleton = withInstall(Skeleton, {
  38246. SkeletonItem
  38247. });
  38248. const ElSkeletonItem = withNoopInstall(SkeletonItem);
  38249. const sliderProps = buildProps({
  38250. modelValue: {
  38251. type: definePropType([Number, Array]),
  38252. default: 0
  38253. },
  38254. id: {
  38255. type: String,
  38256. default: void 0
  38257. },
  38258. min: {
  38259. type: Number,
  38260. default: 0
  38261. },
  38262. max: {
  38263. type: Number,
  38264. default: 100
  38265. },
  38266. step: {
  38267. type: Number,
  38268. default: 1
  38269. },
  38270. showInput: Boolean,
  38271. showInputControls: {
  38272. type: Boolean,
  38273. default: true
  38274. },
  38275. size: useSizeProp,
  38276. inputSize: useSizeProp,
  38277. showStops: Boolean,
  38278. showTooltip: {
  38279. type: Boolean,
  38280. default: true
  38281. },
  38282. formatTooltip: {
  38283. type: definePropType(Function),
  38284. default: void 0
  38285. },
  38286. disabled: Boolean,
  38287. range: Boolean,
  38288. vertical: Boolean,
  38289. height: String,
  38290. debounce: {
  38291. type: Number,
  38292. default: 300
  38293. },
  38294. label: {
  38295. type: String,
  38296. default: void 0
  38297. },
  38298. rangeStartLabel: {
  38299. type: String,
  38300. default: void 0
  38301. },
  38302. rangeEndLabel: {
  38303. type: String,
  38304. default: void 0
  38305. },
  38306. formatValueText: {
  38307. type: definePropType(Function),
  38308. default: void 0
  38309. },
  38310. tooltipClass: {
  38311. type: String,
  38312. default: void 0
  38313. },
  38314. placement: {
  38315. type: String,
  38316. values: Ee,
  38317. default: "top"
  38318. },
  38319. marks: {
  38320. type: definePropType(Object)
  38321. },
  38322. validateEvent: {
  38323. type: Boolean,
  38324. default: true
  38325. }
  38326. });
  38327. const isValidValue$1 = (value) => isNumber(value) || isArray(value) && value.every(isNumber);
  38328. const sliderEmits = {
  38329. [UPDATE_MODEL_EVENT]: isValidValue$1,
  38330. [INPUT_EVENT]: isValidValue$1,
  38331. [CHANGE_EVENT]: isValidValue$1
  38332. };
  38333. const useLifecycle = (props, initData, resetSize) => {
  38334. const sliderWrapper = vue.ref();
  38335. vue.onMounted(async () => {
  38336. if (props.range) {
  38337. if (Array.isArray(props.modelValue)) {
  38338. initData.firstValue = Math.max(props.min, props.modelValue[0]);
  38339. initData.secondValue = Math.min(props.max, props.modelValue[1]);
  38340. } else {
  38341. initData.firstValue = props.min;
  38342. initData.secondValue = props.max;
  38343. }
  38344. initData.oldValue = [initData.firstValue, initData.secondValue];
  38345. } else {
  38346. if (typeof props.modelValue !== "number" || Number.isNaN(props.modelValue)) {
  38347. initData.firstValue = props.min;
  38348. } else {
  38349. initData.firstValue = Math.min(props.max, Math.max(props.min, props.modelValue));
  38350. }
  38351. initData.oldValue = initData.firstValue;
  38352. }
  38353. useEventListener(window, "resize", resetSize);
  38354. await vue.nextTick();
  38355. resetSize();
  38356. });
  38357. return {
  38358. sliderWrapper
  38359. };
  38360. };
  38361. const useMarks = (props) => {
  38362. return vue.computed(() => {
  38363. if (!props.marks) {
  38364. return [];
  38365. }
  38366. const marksKeys = Object.keys(props.marks);
  38367. return marksKeys.map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props.max && point >= props.min).map((point) => ({
  38368. point,
  38369. position: (point - props.min) * 100 / (props.max - props.min),
  38370. mark: props.marks[point]
  38371. }));
  38372. });
  38373. };
  38374. const useSlide = (props, initData, emit) => {
  38375. const { form: elForm, formItem: elFormItem } = useFormItem();
  38376. const slider = vue.shallowRef();
  38377. const firstButton = vue.ref();
  38378. const secondButton = vue.ref();
  38379. const buttonRefs = {
  38380. firstButton,
  38381. secondButton
  38382. };
  38383. const sliderDisabled = vue.computed(() => {
  38384. return props.disabled || (elForm == null ? void 0 : elForm.disabled) || false;
  38385. });
  38386. const minValue = vue.computed(() => {
  38387. return Math.min(initData.firstValue, initData.secondValue);
  38388. });
  38389. const maxValue = vue.computed(() => {
  38390. return Math.max(initData.firstValue, initData.secondValue);
  38391. });
  38392. const barSize = vue.computed(() => {
  38393. return props.range ? `${100 * (maxValue.value - minValue.value) / (props.max - props.min)}%` : `${100 * (initData.firstValue - props.min) / (props.max - props.min)}%`;
  38394. });
  38395. const barStart = vue.computed(() => {
  38396. return props.range ? `${100 * (minValue.value - props.min) / (props.max - props.min)}%` : "0%";
  38397. });
  38398. const runwayStyle = vue.computed(() => {
  38399. return props.vertical ? { height: props.height } : {};
  38400. });
  38401. const barStyle = vue.computed(() => {
  38402. return props.vertical ? {
  38403. height: barSize.value,
  38404. bottom: barStart.value
  38405. } : {
  38406. width: barSize.value,
  38407. left: barStart.value
  38408. };
  38409. });
  38410. const resetSize = () => {
  38411. if (slider.value) {
  38412. initData.sliderSize = slider.value[`client${props.vertical ? "Height" : "Width"}`];
  38413. }
  38414. };
  38415. const getButtonRefByPercent = (percent) => {
  38416. const targetValue = props.min + percent * (props.max - props.min) / 100;
  38417. if (!props.range) {
  38418. return firstButton;
  38419. }
  38420. let buttonRefName;
  38421. if (Math.abs(minValue.value - targetValue) < Math.abs(maxValue.value - targetValue)) {
  38422. buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton";
  38423. } else {
  38424. buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton";
  38425. }
  38426. return buttonRefs[buttonRefName];
  38427. };
  38428. const setPosition = (percent) => {
  38429. const buttonRef = getButtonRefByPercent(percent);
  38430. buttonRef.value.setPosition(percent);
  38431. return buttonRef;
  38432. };
  38433. const setFirstValue = (firstValue) => {
  38434. initData.firstValue = firstValue;
  38435. _emit(props.range ? [minValue.value, maxValue.value] : firstValue);
  38436. };
  38437. const setSecondValue = (secondValue) => {
  38438. initData.secondValue = secondValue;
  38439. if (props.range) {
  38440. _emit([minValue.value, maxValue.value]);
  38441. }
  38442. };
  38443. const _emit = (val) => {
  38444. emit(UPDATE_MODEL_EVENT, val);
  38445. emit(INPUT_EVENT, val);
  38446. };
  38447. const emitChange = async () => {
  38448. await vue.nextTick();
  38449. emit(CHANGE_EVENT, props.range ? [minValue.value, maxValue.value] : props.modelValue);
  38450. };
  38451. const handleSliderPointerEvent = (event) => {
  38452. var _a, _b, _c, _d, _e, _f;
  38453. if (sliderDisabled.value || initData.dragging)
  38454. return;
  38455. resetSize();
  38456. let newPercent = 0;
  38457. if (props.vertical) {
  38458. const clientY = (_c = (_b = (_a = event.touches) == null ? void 0 : _a.item(0)) == null ? void 0 : _b.clientY) != null ? _c : event.clientY;
  38459. const sliderOffsetBottom = slider.value.getBoundingClientRect().bottom;
  38460. newPercent = (sliderOffsetBottom - clientY) / initData.sliderSize * 100;
  38461. } else {
  38462. const clientX = (_f = (_e = (_d = event.touches) == null ? void 0 : _d.item(0)) == null ? void 0 : _e.clientX) != null ? _f : event.clientX;
  38463. const sliderOffsetLeft = slider.value.getBoundingClientRect().left;
  38464. newPercent = (clientX - sliderOffsetLeft) / initData.sliderSize * 100;
  38465. }
  38466. if (newPercent < 0 || newPercent > 100)
  38467. return;
  38468. return setPosition(newPercent);
  38469. };
  38470. const onSliderWrapperPrevent = (event) => {
  38471. var _a, _b;
  38472. if (((_a = buttonRefs["firstButton"].value) == null ? void 0 : _a.dragging) || ((_b = buttonRefs["secondButton"].value) == null ? void 0 : _b.dragging)) {
  38473. event.preventDefault();
  38474. }
  38475. };
  38476. const onSliderDown = async (event) => {
  38477. const buttonRef = handleSliderPointerEvent(event);
  38478. if (buttonRef) {
  38479. await vue.nextTick();
  38480. buttonRef.value.onButtonDown(event);
  38481. }
  38482. };
  38483. const onSliderClick = (event) => {
  38484. const buttonRef = handleSliderPointerEvent(event);
  38485. if (buttonRef) {
  38486. emitChange();
  38487. }
  38488. };
  38489. return {
  38490. elFormItem,
  38491. slider,
  38492. firstButton,
  38493. secondButton,
  38494. sliderDisabled,
  38495. minValue,
  38496. maxValue,
  38497. runwayStyle,
  38498. barStyle,
  38499. resetSize,
  38500. setPosition,
  38501. emitChange,
  38502. onSliderWrapperPrevent,
  38503. onSliderClick,
  38504. onSliderDown,
  38505. setFirstValue,
  38506. setSecondValue
  38507. };
  38508. };
  38509. const { left, down, right, up, home, end, pageUp, pageDown } = EVENT_CODE;
  38510. const useTooltip = (props, formatTooltip, showTooltip) => {
  38511. const tooltip = vue.ref();
  38512. const tooltipVisible = vue.ref(false);
  38513. const enableFormat = vue.computed(() => {
  38514. return formatTooltip.value instanceof Function;
  38515. });
  38516. const formatValue = vue.computed(() => {
  38517. return enableFormat.value && formatTooltip.value(props.modelValue) || props.modelValue;
  38518. });
  38519. const displayTooltip = debounce(() => {
  38520. showTooltip.value && (tooltipVisible.value = true);
  38521. }, 50);
  38522. const hideTooltip = debounce(() => {
  38523. showTooltip.value && (tooltipVisible.value = false);
  38524. }, 50);
  38525. return {
  38526. tooltip,
  38527. tooltipVisible,
  38528. formatValue,
  38529. displayTooltip,
  38530. hideTooltip
  38531. };
  38532. };
  38533. const useSliderButton = (props, initData, emit) => {
  38534. const {
  38535. disabled,
  38536. min,
  38537. max,
  38538. step,
  38539. showTooltip,
  38540. precision,
  38541. sliderSize,
  38542. formatTooltip,
  38543. emitChange,
  38544. resetSize,
  38545. updateDragging
  38546. } = vue.inject(sliderContextKey);
  38547. const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props, formatTooltip, showTooltip);
  38548. const button = vue.ref();
  38549. const currentPosition = vue.computed(() => {
  38550. return `${(props.modelValue - min.value) / (max.value - min.value) * 100}%`;
  38551. });
  38552. const wrapperStyle = vue.computed(() => {
  38553. return props.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
  38554. });
  38555. const handleMouseEnter = () => {
  38556. initData.hovering = true;
  38557. displayTooltip();
  38558. };
  38559. const handleMouseLeave = () => {
  38560. initData.hovering = false;
  38561. if (!initData.dragging) {
  38562. hideTooltip();
  38563. }
  38564. };
  38565. const onButtonDown = (event) => {
  38566. if (disabled.value)
  38567. return;
  38568. event.preventDefault();
  38569. onDragStart(event);
  38570. window.addEventListener("mousemove", onDragging);
  38571. window.addEventListener("touchmove", onDragging);
  38572. window.addEventListener("mouseup", onDragEnd);
  38573. window.addEventListener("touchend", onDragEnd);
  38574. window.addEventListener("contextmenu", onDragEnd);
  38575. button.value.focus();
  38576. };
  38577. const incrementPosition = (amount) => {
  38578. if (disabled.value)
  38579. return;
  38580. initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max.value - min.value) * 100;
  38581. setPosition(initData.newPosition);
  38582. emitChange();
  38583. };
  38584. const onLeftKeyDown = () => {
  38585. incrementPosition(-step.value);
  38586. };
  38587. const onRightKeyDown = () => {
  38588. incrementPosition(step.value);
  38589. };
  38590. const onPageDownKeyDown = () => {
  38591. incrementPosition(-step.value * 4);
  38592. };
  38593. const onPageUpKeyDown = () => {
  38594. incrementPosition(step.value * 4);
  38595. };
  38596. const onHomeKeyDown = () => {
  38597. if (disabled.value)
  38598. return;
  38599. setPosition(0);
  38600. emitChange();
  38601. };
  38602. const onEndKeyDown = () => {
  38603. if (disabled.value)
  38604. return;
  38605. setPosition(100);
  38606. emitChange();
  38607. };
  38608. const onKeyDown = (event) => {
  38609. let isPreventDefault = true;
  38610. if ([left, down].includes(event.key)) {
  38611. onLeftKeyDown();
  38612. } else if ([right, up].includes(event.key)) {
  38613. onRightKeyDown();
  38614. } else if (event.key === home) {
  38615. onHomeKeyDown();
  38616. } else if (event.key === end) {
  38617. onEndKeyDown();
  38618. } else if (event.key === pageDown) {
  38619. onPageDownKeyDown();
  38620. } else if (event.key === pageUp) {
  38621. onPageUpKeyDown();
  38622. } else {
  38623. isPreventDefault = false;
  38624. }
  38625. isPreventDefault && event.preventDefault();
  38626. };
  38627. const getClientXY = (event) => {
  38628. let clientX;
  38629. let clientY;
  38630. if (event.type.startsWith("touch")) {
  38631. clientY = event.touches[0].clientY;
  38632. clientX = event.touches[0].clientX;
  38633. } else {
  38634. clientY = event.clientY;
  38635. clientX = event.clientX;
  38636. }
  38637. return {
  38638. clientX,
  38639. clientY
  38640. };
  38641. };
  38642. const onDragStart = (event) => {
  38643. initData.dragging = true;
  38644. initData.isClick = true;
  38645. const { clientX, clientY } = getClientXY(event);
  38646. if (props.vertical) {
  38647. initData.startY = clientY;
  38648. } else {
  38649. initData.startX = clientX;
  38650. }
  38651. initData.startPosition = Number.parseFloat(currentPosition.value);
  38652. initData.newPosition = initData.startPosition;
  38653. };
  38654. const onDragging = (event) => {
  38655. if (initData.dragging) {
  38656. initData.isClick = false;
  38657. displayTooltip();
  38658. resetSize();
  38659. let diff;
  38660. const { clientX, clientY } = getClientXY(event);
  38661. if (props.vertical) {
  38662. initData.currentY = clientY;
  38663. diff = (initData.startY - initData.currentY) / sliderSize.value * 100;
  38664. } else {
  38665. initData.currentX = clientX;
  38666. diff = (initData.currentX - initData.startX) / sliderSize.value * 100;
  38667. }
  38668. initData.newPosition = initData.startPosition + diff;
  38669. setPosition(initData.newPosition);
  38670. }
  38671. };
  38672. const onDragEnd = () => {
  38673. if (initData.dragging) {
  38674. setTimeout(() => {
  38675. initData.dragging = false;
  38676. if (!initData.hovering) {
  38677. hideTooltip();
  38678. }
  38679. if (!initData.isClick) {
  38680. setPosition(initData.newPosition);
  38681. }
  38682. emitChange();
  38683. }, 0);
  38684. window.removeEventListener("mousemove", onDragging);
  38685. window.removeEventListener("touchmove", onDragging);
  38686. window.removeEventListener("mouseup", onDragEnd);
  38687. window.removeEventListener("touchend", onDragEnd);
  38688. window.removeEventListener("contextmenu", onDragEnd);
  38689. }
  38690. };
  38691. const setPosition = async (newPosition) => {
  38692. if (newPosition === null || Number.isNaN(+newPosition))
  38693. return;
  38694. if (newPosition < 0) {
  38695. newPosition = 0;
  38696. } else if (newPosition > 100) {
  38697. newPosition = 100;
  38698. }
  38699. const lengthPerStep = 100 / ((max.value - min.value) / step.value);
  38700. const steps = Math.round(newPosition / lengthPerStep);
  38701. let value = steps * lengthPerStep * (max.value - min.value) * 0.01 + min.value;
  38702. value = Number.parseFloat(value.toFixed(precision.value));
  38703. if (value !== props.modelValue) {
  38704. emit(UPDATE_MODEL_EVENT, value);
  38705. }
  38706. if (!initData.dragging && props.modelValue !== initData.oldValue) {
  38707. initData.oldValue = props.modelValue;
  38708. }
  38709. await vue.nextTick();
  38710. initData.dragging && displayTooltip();
  38711. tooltip.value.updatePopper();
  38712. };
  38713. vue.watch(() => initData.dragging, (val) => {
  38714. updateDragging(val);
  38715. });
  38716. return {
  38717. disabled,
  38718. button,
  38719. tooltip,
  38720. tooltipVisible,
  38721. showTooltip,
  38722. wrapperStyle,
  38723. formatValue,
  38724. handleMouseEnter,
  38725. handleMouseLeave,
  38726. onButtonDown,
  38727. onKeyDown,
  38728. setPosition
  38729. };
  38730. };
  38731. const useStops = (props, initData, minValue, maxValue) => {
  38732. const stops = vue.computed(() => {
  38733. if (!props.showStops || props.min > props.max)
  38734. return [];
  38735. if (props.step === 0) {
  38736. return [];
  38737. }
  38738. const stopCount = (props.max - props.min) / props.step;
  38739. const stepWidth = 100 * props.step / (props.max - props.min);
  38740. const result = Array.from({ length: stopCount - 1 }).map((_, index) => (index + 1) * stepWidth);
  38741. if (props.range) {
  38742. return result.filter((step) => {
  38743. return step < 100 * (minValue.value - props.min) / (props.max - props.min) || step > 100 * (maxValue.value - props.min) / (props.max - props.min);
  38744. });
  38745. } else {
  38746. return result.filter((step) => step > 100 * (initData.firstValue - props.min) / (props.max - props.min));
  38747. }
  38748. });
  38749. const getStopStyle = (position) => {
  38750. return props.vertical ? { bottom: `${position}%` } : { left: `${position}%` };
  38751. };
  38752. return {
  38753. stops,
  38754. getStopStyle
  38755. };
  38756. };
  38757. const useWatch = (props, initData, minValue, maxValue, emit, elFormItem) => {
  38758. const _emit = (val) => {
  38759. emit(UPDATE_MODEL_EVENT, val);
  38760. emit(INPUT_EVENT, val);
  38761. };
  38762. const valueChanged = () => {
  38763. if (props.range) {
  38764. return ![minValue.value, maxValue.value].every((item, index) => item === initData.oldValue[index]);
  38765. } else {
  38766. return props.modelValue !== initData.oldValue;
  38767. }
  38768. };
  38769. const setValues = () => {
  38770. var _a, _b;
  38771. if (props.min > props.max) {
  38772. throwError("Slider", "min should not be greater than max.");
  38773. return;
  38774. }
  38775. const val = props.modelValue;
  38776. if (props.range && Array.isArray(val)) {
  38777. if (val[1] < props.min) {
  38778. _emit([props.min, props.min]);
  38779. } else if (val[0] > props.max) {
  38780. _emit([props.max, props.max]);
  38781. } else if (val[0] < props.min) {
  38782. _emit([props.min, val[1]]);
  38783. } else if (val[1] > props.max) {
  38784. _emit([val[0], props.max]);
  38785. } else {
  38786. initData.firstValue = val[0];
  38787. initData.secondValue = val[1];
  38788. if (valueChanged()) {
  38789. if (props.validateEvent) {
  38790. (_a = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _a.call(elFormItem, "change").catch((err) => debugWarn());
  38791. }
  38792. initData.oldValue = val.slice();
  38793. }
  38794. }
  38795. } else if (!props.range && typeof val === "number" && !Number.isNaN(val)) {
  38796. if (val < props.min) {
  38797. _emit(props.min);
  38798. } else if (val > props.max) {
  38799. _emit(props.max);
  38800. } else {
  38801. initData.firstValue = val;
  38802. if (valueChanged()) {
  38803. if (props.validateEvent) {
  38804. (_b = elFormItem == null ? void 0 : elFormItem.validate) == null ? void 0 : _b.call(elFormItem, "change").catch((err) => debugWarn());
  38805. }
  38806. initData.oldValue = val;
  38807. }
  38808. }
  38809. }
  38810. };
  38811. setValues();
  38812. vue.watch(() => initData.dragging, (val) => {
  38813. if (!val) {
  38814. setValues();
  38815. }
  38816. });
  38817. vue.watch(() => props.modelValue, (val, oldVal) => {
  38818. if (initData.dragging || Array.isArray(val) && Array.isArray(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) {
  38819. return;
  38820. }
  38821. setValues();
  38822. }, {
  38823. deep: true
  38824. });
  38825. vue.watch(() => [props.min, props.max], () => {
  38826. setValues();
  38827. });
  38828. };
  38829. const sliderButtonProps = buildProps({
  38830. modelValue: {
  38831. type: Number,
  38832. default: 0
  38833. },
  38834. vertical: Boolean,
  38835. tooltipClass: String,
  38836. placement: {
  38837. type: String,
  38838. values: Ee,
  38839. default: "top"
  38840. }
  38841. });
  38842. const sliderButtonEmits = {
  38843. [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
  38844. };
  38845. const _hoisted_1$f = ["tabindex"];
  38846. const __default__$q = vue.defineComponent({
  38847. name: "ElSliderButton"
  38848. });
  38849. const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
  38850. ...__default__$q,
  38851. props: sliderButtonProps,
  38852. emits: sliderButtonEmits,
  38853. setup(__props, { expose, emit }) {
  38854. const props = __props;
  38855. const ns = useNamespace("slider");
  38856. const initData = vue.reactive({
  38857. hovering: false,
  38858. dragging: false,
  38859. isClick: false,
  38860. startX: 0,
  38861. currentX: 0,
  38862. startY: 0,
  38863. currentY: 0,
  38864. startPosition: 0,
  38865. newPosition: 0,
  38866. oldValue: props.modelValue
  38867. });
  38868. const {
  38869. disabled,
  38870. button,
  38871. tooltip,
  38872. showTooltip,
  38873. tooltipVisible,
  38874. wrapperStyle,
  38875. formatValue,
  38876. handleMouseEnter,
  38877. handleMouseLeave,
  38878. onButtonDown,
  38879. onKeyDown,
  38880. setPosition
  38881. } = useSliderButton(props, initData, emit);
  38882. const { hovering, dragging } = vue.toRefs(initData);
  38883. expose({
  38884. onButtonDown,
  38885. onKeyDown,
  38886. setPosition,
  38887. hovering,
  38888. dragging
  38889. });
  38890. return (_ctx, _cache) => {
  38891. return vue.openBlock(), vue.createElementBlock("div", {
  38892. ref_key: "button",
  38893. ref: button,
  38894. class: vue.normalizeClass([vue.unref(ns).e("button-wrapper"), { hover: vue.unref(hovering), dragging: vue.unref(dragging) }]),
  38895. style: vue.normalizeStyle(vue.unref(wrapperStyle)),
  38896. tabindex: vue.unref(disabled) ? -1 : 0,
  38897. onMouseenter: _cache[0] || (_cache[0] = (...args) => vue.unref(handleMouseEnter) && vue.unref(handleMouseEnter)(...args)),
  38898. onMouseleave: _cache[1] || (_cache[1] = (...args) => vue.unref(handleMouseLeave) && vue.unref(handleMouseLeave)(...args)),
  38899. onMousedown: _cache[2] || (_cache[2] = (...args) => vue.unref(onButtonDown) && vue.unref(onButtonDown)(...args)),
  38900. onTouchstart: _cache[3] || (_cache[3] = (...args) => vue.unref(onButtonDown) && vue.unref(onButtonDown)(...args)),
  38901. onFocus: _cache[4] || (_cache[4] = (...args) => vue.unref(handleMouseEnter) && vue.unref(handleMouseEnter)(...args)),
  38902. onBlur: _cache[5] || (_cache[5] = (...args) => vue.unref(handleMouseLeave) && vue.unref(handleMouseLeave)(...args)),
  38903. onKeydown: _cache[6] || (_cache[6] = (...args) => vue.unref(onKeyDown) && vue.unref(onKeyDown)(...args))
  38904. }, [
  38905. vue.createVNode(vue.unref(ElTooltip), {
  38906. ref_key: "tooltip",
  38907. ref: tooltip,
  38908. visible: vue.unref(tooltipVisible),
  38909. placement: _ctx.placement,
  38910. "fallback-placements": ["top", "bottom", "right", "left"],
  38911. "stop-popper-mouse-event": false,
  38912. "popper-class": _ctx.tooltipClass,
  38913. disabled: !vue.unref(showTooltip),
  38914. persistent: ""
  38915. }, {
  38916. content: vue.withCtx(() => [
  38917. vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(formatValue)), 1)
  38918. ]),
  38919. default: vue.withCtx(() => [
  38920. vue.createElementVNode("div", {
  38921. class: vue.normalizeClass([vue.unref(ns).e("button"), { hover: vue.unref(hovering), dragging: vue.unref(dragging) }])
  38922. }, null, 2)
  38923. ]),
  38924. _: 1
  38925. }, 8, ["visible", "placement", "popper-class", "disabled"])
  38926. ], 46, _hoisted_1$f);
  38927. };
  38928. }
  38929. });
  38930. var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__file", "button.vue"]]);
  38931. const sliderMarkerProps = buildProps({
  38932. mark: {
  38933. type: definePropType([String, Object]),
  38934. default: void 0
  38935. }
  38936. });
  38937. var SliderMarker = vue.defineComponent({
  38938. name: "ElSliderMarker",
  38939. props: sliderMarkerProps,
  38940. setup(props) {
  38941. const ns = useNamespace("slider");
  38942. const label = vue.computed(() => {
  38943. return isString(props.mark) ? props.mark : props.mark.label;
  38944. });
  38945. const style = vue.computed(() => isString(props.mark) ? void 0 : props.mark.style);
  38946. return () => vue.h("div", {
  38947. class: ns.e("marks-text"),
  38948. style: style.value
  38949. }, label.value);
  38950. }
  38951. });
  38952. const _hoisted_1$e = ["id", "role", "aria-label", "aria-labelledby"];
  38953. const _hoisted_2$a = { key: 1 };
  38954. const __default__$p = vue.defineComponent({
  38955. name: "ElSlider"
  38956. });
  38957. const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
  38958. ...__default__$p,
  38959. props: sliderProps,
  38960. emits: sliderEmits,
  38961. setup(__props, { expose, emit }) {
  38962. const props = __props;
  38963. const ns = useNamespace("slider");
  38964. const { t } = useLocale();
  38965. const initData = vue.reactive({
  38966. firstValue: 0,
  38967. secondValue: 0,
  38968. oldValue: 0,
  38969. dragging: false,
  38970. sliderSize: 1
  38971. });
  38972. const {
  38973. elFormItem,
  38974. slider,
  38975. firstButton,
  38976. secondButton,
  38977. sliderDisabled,
  38978. minValue,
  38979. maxValue,
  38980. runwayStyle,
  38981. barStyle,
  38982. resetSize,
  38983. emitChange,
  38984. onSliderWrapperPrevent,
  38985. onSliderClick,
  38986. onSliderDown,
  38987. setFirstValue,
  38988. setSecondValue
  38989. } = useSlide(props, initData, emit);
  38990. const { stops, getStopStyle } = useStops(props, initData, minValue, maxValue);
  38991. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
  38992. formItemContext: elFormItem
  38993. });
  38994. const sliderWrapperSize = useSize();
  38995. const sliderInputSize = vue.computed(() => props.inputSize || sliderWrapperSize.value);
  38996. const groupLabel = vue.computed(() => {
  38997. return props.label || t("el.slider.defaultLabel", {
  38998. min: props.min,
  38999. max: props.max
  39000. });
  39001. });
  39002. const firstButtonLabel = vue.computed(() => {
  39003. if (props.range) {
  39004. return props.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
  39005. } else {
  39006. return groupLabel.value;
  39007. }
  39008. });
  39009. const firstValueText = vue.computed(() => {
  39010. return props.formatValueText ? props.formatValueText(firstValue.value) : `${firstValue.value}`;
  39011. });
  39012. const secondButtonLabel = vue.computed(() => {
  39013. return props.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
  39014. });
  39015. const secondValueText = vue.computed(() => {
  39016. return props.formatValueText ? props.formatValueText(secondValue.value) : `${secondValue.value}`;
  39017. });
  39018. const sliderKls = vue.computed(() => [
  39019. ns.b(),
  39020. ns.m(sliderWrapperSize.value),
  39021. ns.is("vertical", props.vertical),
  39022. { [ns.m("with-input")]: props.showInput }
  39023. ]);
  39024. const markList = useMarks(props);
  39025. useWatch(props, initData, minValue, maxValue, emit, elFormItem);
  39026. const precision = vue.computed(() => {
  39027. const precisions = [props.min, props.max, props.step].map((item) => {
  39028. const decimal = `${item}`.split(".")[1];
  39029. return decimal ? decimal.length : 0;
  39030. });
  39031. return Math.max.apply(null, precisions);
  39032. });
  39033. const { sliderWrapper } = useLifecycle(props, initData, resetSize);
  39034. const { firstValue, secondValue, sliderSize } = vue.toRefs(initData);
  39035. const updateDragging = (val) => {
  39036. initData.dragging = val;
  39037. };
  39038. vue.provide(sliderContextKey, {
  39039. ...vue.toRefs(props),
  39040. sliderSize,
  39041. disabled: sliderDisabled,
  39042. precision,
  39043. emitChange,
  39044. resetSize,
  39045. updateDragging
  39046. });
  39047. expose({
  39048. onSliderClick
  39049. });
  39050. return (_ctx, _cache) => {
  39051. var _a, _b;
  39052. return vue.openBlock(), vue.createElementBlock("div", {
  39053. id: _ctx.range ? vue.unref(inputId) : void 0,
  39054. ref_key: "sliderWrapper",
  39055. ref: sliderWrapper,
  39056. class: vue.normalizeClass(vue.unref(sliderKls)),
  39057. role: _ctx.range ? "group" : void 0,
  39058. "aria-label": _ctx.range && !vue.unref(isLabeledByFormItem) ? vue.unref(groupLabel) : void 0,
  39059. "aria-labelledby": _ctx.range && vue.unref(isLabeledByFormItem) ? (_a = vue.unref(elFormItem)) == null ? void 0 : _a.labelId : void 0,
  39060. onTouchstart: _cache[2] || (_cache[2] = (...args) => vue.unref(onSliderWrapperPrevent) && vue.unref(onSliderWrapperPrevent)(...args)),
  39061. onTouchmove: _cache[3] || (_cache[3] = (...args) => vue.unref(onSliderWrapperPrevent) && vue.unref(onSliderWrapperPrevent)(...args))
  39062. }, [
  39063. vue.createElementVNode("div", {
  39064. ref_key: "slider",
  39065. ref: slider,
  39066. class: vue.normalizeClass([
  39067. vue.unref(ns).e("runway"),
  39068. { "show-input": _ctx.showInput && !_ctx.range },
  39069. vue.unref(ns).is("disabled", vue.unref(sliderDisabled))
  39070. ]),
  39071. style: vue.normalizeStyle(vue.unref(runwayStyle)),
  39072. onMousedown: _cache[0] || (_cache[0] = (...args) => vue.unref(onSliderDown) && vue.unref(onSliderDown)(...args)),
  39073. onTouchstart: _cache[1] || (_cache[1] = (...args) => vue.unref(onSliderDown) && vue.unref(onSliderDown)(...args))
  39074. }, [
  39075. vue.createElementVNode("div", {
  39076. class: vue.normalizeClass(vue.unref(ns).e("bar")),
  39077. style: vue.normalizeStyle(vue.unref(barStyle))
  39078. }, null, 6),
  39079. vue.createVNode(SliderButton, {
  39080. id: !_ctx.range ? vue.unref(inputId) : void 0,
  39081. ref_key: "firstButton",
  39082. ref: firstButton,
  39083. "model-value": vue.unref(firstValue),
  39084. vertical: _ctx.vertical,
  39085. "tooltip-class": _ctx.tooltipClass,
  39086. placement: _ctx.placement,
  39087. role: "slider",
  39088. "aria-label": _ctx.range || !vue.unref(isLabeledByFormItem) ? vue.unref(firstButtonLabel) : void 0,
  39089. "aria-labelledby": !_ctx.range && vue.unref(isLabeledByFormItem) ? (_b = vue.unref(elFormItem)) == null ? void 0 : _b.labelId : void 0,
  39090. "aria-valuemin": _ctx.min,
  39091. "aria-valuemax": _ctx.range ? vue.unref(secondValue) : _ctx.max,
  39092. "aria-valuenow": vue.unref(firstValue),
  39093. "aria-valuetext": vue.unref(firstValueText),
  39094. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  39095. "aria-disabled": vue.unref(sliderDisabled),
  39096. "onUpdate:modelValue": vue.unref(setFirstValue)
  39097. }, null, 8, ["id", "model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-labelledby", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"]),
  39098. _ctx.range ? (vue.openBlock(), vue.createBlock(SliderButton, {
  39099. key: 0,
  39100. ref_key: "secondButton",
  39101. ref: secondButton,
  39102. "model-value": vue.unref(secondValue),
  39103. vertical: _ctx.vertical,
  39104. "tooltip-class": _ctx.tooltipClass,
  39105. placement: _ctx.placement,
  39106. role: "slider",
  39107. "aria-label": vue.unref(secondButtonLabel),
  39108. "aria-valuemin": vue.unref(firstValue),
  39109. "aria-valuemax": _ctx.max,
  39110. "aria-valuenow": vue.unref(secondValue),
  39111. "aria-valuetext": vue.unref(secondValueText),
  39112. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  39113. "aria-disabled": vue.unref(sliderDisabled),
  39114. "onUpdate:modelValue": vue.unref(setSecondValue)
  39115. }, null, 8, ["model-value", "vertical", "tooltip-class", "placement", "aria-label", "aria-valuemin", "aria-valuemax", "aria-valuenow", "aria-valuetext", "aria-orientation", "aria-disabled", "onUpdate:modelValue"])) : vue.createCommentVNode("v-if", true),
  39116. _ctx.showStops ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
  39117. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(stops), (item, key) => {
  39118. return vue.openBlock(), vue.createElementBlock("div", {
  39119. key,
  39120. class: vue.normalizeClass(vue.unref(ns).e("stop")),
  39121. style: vue.normalizeStyle(vue.unref(getStopStyle)(item))
  39122. }, null, 6);
  39123. }), 128))
  39124. ])) : vue.createCommentVNode("v-if", true),
  39125. vue.unref(markList).length > 0 ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
  39126. vue.createElementVNode("div", null, [
  39127. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(markList), (item, key) => {
  39128. return vue.openBlock(), vue.createElementBlock("div", {
  39129. key,
  39130. style: vue.normalizeStyle(vue.unref(getStopStyle)(item.position)),
  39131. class: vue.normalizeClass([vue.unref(ns).e("stop"), vue.unref(ns).e("marks-stop")])
  39132. }, null, 6);
  39133. }), 128))
  39134. ]),
  39135. vue.createElementVNode("div", {
  39136. class: vue.normalizeClass(vue.unref(ns).e("marks"))
  39137. }, [
  39138. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(markList), (item, key) => {
  39139. return vue.openBlock(), vue.createBlock(vue.unref(SliderMarker), {
  39140. key,
  39141. mark: item.mark,
  39142. style: vue.normalizeStyle(vue.unref(getStopStyle)(item.position))
  39143. }, null, 8, ["mark", "style"]);
  39144. }), 128))
  39145. ], 2)
  39146. ], 64)) : vue.createCommentVNode("v-if", true)
  39147. ], 38),
  39148. _ctx.showInput && !_ctx.range ? (vue.openBlock(), vue.createBlock(vue.unref(ElInputNumber), {
  39149. key: 0,
  39150. ref: "input",
  39151. "model-value": vue.unref(firstValue),
  39152. class: vue.normalizeClass(vue.unref(ns).e("input")),
  39153. step: _ctx.step,
  39154. disabled: vue.unref(sliderDisabled),
  39155. controls: _ctx.showInputControls,
  39156. min: _ctx.min,
  39157. max: _ctx.max,
  39158. debounce: _ctx.debounce,
  39159. size: vue.unref(sliderInputSize),
  39160. "onUpdate:modelValue": vue.unref(setFirstValue),
  39161. onChange: vue.unref(emitChange)
  39162. }, null, 8, ["model-value", "class", "step", "disabled", "controls", "min", "max", "debounce", "size", "onUpdate:modelValue", "onChange"])) : vue.createCommentVNode("v-if", true)
  39163. ], 42, _hoisted_1$e);
  39164. };
  39165. }
  39166. });
  39167. var Slider = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__file", "slider.vue"]]);
  39168. const ElSlider = withInstall(Slider);
  39169. const spaceItemProps = buildProps({
  39170. prefixCls: {
  39171. type: String
  39172. }
  39173. });
  39174. const SpaceItem = vue.defineComponent({
  39175. name: "ElSpaceItem",
  39176. props: spaceItemProps,
  39177. setup(props, { slots }) {
  39178. const ns = useNamespace("space");
  39179. const classes = vue.computed(() => `${props.prefixCls || ns.b()}__item`);
  39180. return () => vue.h("div", { class: classes.value }, vue.renderSlot(slots, "default"));
  39181. }
  39182. });
  39183. var Item = SpaceItem;
  39184. const SIZE_MAP = {
  39185. small: 8,
  39186. default: 12,
  39187. large: 16
  39188. };
  39189. function useSpace(props) {
  39190. const ns = useNamespace("space");
  39191. const classes = vue.computed(() => [ns.b(), ns.m(props.direction), props.class]);
  39192. const horizontalSize = vue.ref(0);
  39193. const verticalSize = vue.ref(0);
  39194. const containerStyle = vue.computed(() => {
  39195. const wrapKls = props.wrap || props.fill ? { flexWrap: "wrap", marginBottom: `-${verticalSize.value}px` } : {};
  39196. const alignment = {
  39197. alignItems: props.alignment
  39198. };
  39199. return [wrapKls, alignment, props.style];
  39200. });
  39201. const itemStyle = vue.computed(() => {
  39202. const itemBaseStyle = {
  39203. paddingBottom: `${verticalSize.value}px`,
  39204. marginRight: `${horizontalSize.value}px`
  39205. };
  39206. const fillStyle = props.fill ? { flexGrow: 1, minWidth: `${props.fillRatio}%` } : {};
  39207. return [itemBaseStyle, fillStyle];
  39208. });
  39209. vue.watchEffect(() => {
  39210. const { size = "small", wrap, direction: dir, fill } = props;
  39211. if (isArray(size)) {
  39212. const [h = 0, v = 0] = size;
  39213. horizontalSize.value = h;
  39214. verticalSize.value = v;
  39215. } else {
  39216. let val;
  39217. if (isNumber(size)) {
  39218. val = size;
  39219. } else {
  39220. val = SIZE_MAP[size || "small"] || SIZE_MAP.small;
  39221. }
  39222. if ((wrap || fill) && dir === "horizontal") {
  39223. horizontalSize.value = verticalSize.value = val;
  39224. } else {
  39225. if (dir === "horizontal") {
  39226. horizontalSize.value = val;
  39227. verticalSize.value = 0;
  39228. } else {
  39229. verticalSize.value = val;
  39230. horizontalSize.value = 0;
  39231. }
  39232. }
  39233. }
  39234. });
  39235. return {
  39236. classes,
  39237. containerStyle,
  39238. itemStyle
  39239. };
  39240. }
  39241. const spaceProps = buildProps({
  39242. direction: {
  39243. type: String,
  39244. values: ["horizontal", "vertical"],
  39245. default: "horizontal"
  39246. },
  39247. class: {
  39248. type: definePropType([
  39249. String,
  39250. Object,
  39251. Array
  39252. ]),
  39253. default: ""
  39254. },
  39255. style: {
  39256. type: definePropType([String, Array, Object]),
  39257. default: ""
  39258. },
  39259. alignment: {
  39260. type: definePropType(String),
  39261. default: "center"
  39262. },
  39263. prefixCls: {
  39264. type: String
  39265. },
  39266. spacer: {
  39267. type: definePropType([Object, String, Number, Array]),
  39268. default: null,
  39269. validator: (val) => vue.isVNode(val) || isNumber(val) || isString(val)
  39270. },
  39271. wrap: Boolean,
  39272. fill: Boolean,
  39273. fillRatio: {
  39274. type: Number,
  39275. default: 100
  39276. },
  39277. size: {
  39278. type: [String, Array, Number],
  39279. values: componentSizes,
  39280. validator: (val) => {
  39281. return isNumber(val) || isArray(val) && val.length === 2 && val.every(isNumber);
  39282. }
  39283. }
  39284. });
  39285. const Space = vue.defineComponent({
  39286. name: "ElSpace",
  39287. props: spaceProps,
  39288. setup(props, { slots }) {
  39289. const { classes, containerStyle, itemStyle } = useSpace(props);
  39290. function extractChildren(children, parentKey = "", extractedChildren = []) {
  39291. const { prefixCls } = props;
  39292. children.forEach((child, loopKey) => {
  39293. if (isFragment(child)) {
  39294. if (isArray(child.children)) {
  39295. child.children.forEach((nested, key) => {
  39296. if (isFragment(nested) && isArray(nested.children)) {
  39297. extractChildren(nested.children, `${parentKey + key}-`, extractedChildren);
  39298. } else {
  39299. extractedChildren.push(vue.createVNode(Item, {
  39300. style: itemStyle.value,
  39301. prefixCls,
  39302. key: `nested-${parentKey + key}`
  39303. }, {
  39304. default: () => [nested]
  39305. }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  39306. }
  39307. });
  39308. }
  39309. } else if (isValidElementNode(child)) {
  39310. extractedChildren.push(vue.createVNode(Item, {
  39311. style: itemStyle.value,
  39312. prefixCls,
  39313. key: `LoopKey${parentKey + loopKey}`
  39314. }, {
  39315. default: () => [child]
  39316. }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  39317. }
  39318. });
  39319. return extractedChildren;
  39320. }
  39321. return () => {
  39322. var _a;
  39323. const { spacer, direction } = props;
  39324. const children = vue.renderSlot(slots, "default", { key: 0 }, () => []);
  39325. if (((_a = children.children) != null ? _a : []).length === 0)
  39326. return null;
  39327. if (isArray(children.children)) {
  39328. let extractedChildren = extractChildren(children.children);
  39329. if (spacer) {
  39330. const len = extractedChildren.length - 1;
  39331. extractedChildren = extractedChildren.reduce((acc, child, idx) => {
  39332. const children2 = [...acc, child];
  39333. if (idx !== len) {
  39334. children2.push(vue.createVNode("span", {
  39335. style: [
  39336. itemStyle.value,
  39337. direction === "vertical" ? "width: 100%" : null
  39338. ],
  39339. key: idx
  39340. }, [
  39341. vue.isVNode(spacer) ? spacer : vue.createTextVNode(spacer, PatchFlags.TEXT)
  39342. ], PatchFlags.STYLE));
  39343. }
  39344. return children2;
  39345. }, []);
  39346. }
  39347. return vue.createVNode("div", {
  39348. class: classes.value,
  39349. style: containerStyle.value
  39350. }, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS);
  39351. }
  39352. return children.children;
  39353. };
  39354. }
  39355. });
  39356. const ElSpace = withInstall(Space);
  39357. const statisticProps = buildProps({
  39358. decimalSeparator: {
  39359. type: String,
  39360. default: "."
  39361. },
  39362. groupSeparator: {
  39363. type: String,
  39364. default: ","
  39365. },
  39366. precision: {
  39367. type: Number,
  39368. default: 0
  39369. },
  39370. formatter: Function,
  39371. value: {
  39372. type: definePropType([Number, Object]),
  39373. default: 0
  39374. },
  39375. prefix: String,
  39376. suffix: String,
  39377. title: String,
  39378. valueStyle: {
  39379. type: definePropType([String, Object, Array])
  39380. }
  39381. });
  39382. const __default__$o = vue.defineComponent({
  39383. name: "ElStatistic"
  39384. });
  39385. const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
  39386. ...__default__$o,
  39387. props: statisticProps,
  39388. setup(__props, { expose }) {
  39389. const props = __props;
  39390. const ns = useNamespace("statistic");
  39391. const displayValue = vue.computed(() => {
  39392. const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
  39393. if (isFunction(formatter))
  39394. return formatter(value);
  39395. if (!isNumber(value))
  39396. return value;
  39397. let [integer, decimal = ""] = String(value).split(".");
  39398. decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
  39399. integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
  39400. return [integer, decimal].join(decimal ? decimalSeparator : "");
  39401. });
  39402. expose({
  39403. displayValue
  39404. });
  39405. return (_ctx, _cache) => {
  39406. return vue.openBlock(), vue.createElementBlock("div", {
  39407. class: vue.normalizeClass(vue.unref(ns).b())
  39408. }, [
  39409. _ctx.$slots.title || _ctx.title ? (vue.openBlock(), vue.createElementBlock("div", {
  39410. key: 0,
  39411. class: vue.normalizeClass(vue.unref(ns).e("head"))
  39412. }, [
  39413. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  39414. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  39415. ])
  39416. ], 2)) : vue.createCommentVNode("v-if", true),
  39417. vue.createElementVNode("div", {
  39418. class: vue.normalizeClass(vue.unref(ns).e("content"))
  39419. }, [
  39420. _ctx.$slots.prefix || _ctx.prefix ? (vue.openBlock(), vue.createElementBlock("div", {
  39421. key: 0,
  39422. class: vue.normalizeClass(vue.unref(ns).e("prefix"))
  39423. }, [
  39424. vue.renderSlot(_ctx.$slots, "prefix", {}, () => [
  39425. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.prefix), 1)
  39426. ])
  39427. ], 2)) : vue.createCommentVNode("v-if", true),
  39428. vue.createElementVNode("span", {
  39429. class: vue.normalizeClass(vue.unref(ns).e("number")),
  39430. style: vue.normalizeStyle(_ctx.valueStyle)
  39431. }, vue.toDisplayString(vue.unref(displayValue)), 7),
  39432. _ctx.$slots.suffix || _ctx.suffix ? (vue.openBlock(), vue.createElementBlock("div", {
  39433. key: 1,
  39434. class: vue.normalizeClass(vue.unref(ns).e("suffix"))
  39435. }, [
  39436. vue.renderSlot(_ctx.$slots, "suffix", {}, () => [
  39437. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.suffix), 1)
  39438. ])
  39439. ], 2)) : vue.createCommentVNode("v-if", true)
  39440. ], 2)
  39441. ], 2);
  39442. };
  39443. }
  39444. });
  39445. var Statistic = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__file", "statistic.vue"]]);
  39446. const ElStatistic = withInstall(Statistic);
  39447. const countdownProps = buildProps({
  39448. format: {
  39449. type: String,
  39450. default: "HH:mm:ss"
  39451. },
  39452. prefix: String,
  39453. suffix: String,
  39454. title: String,
  39455. value: {
  39456. type: definePropType([Number, Object]),
  39457. default: 0
  39458. },
  39459. valueStyle: {
  39460. type: definePropType([String, Object, Array])
  39461. }
  39462. });
  39463. const countdownEmits = {
  39464. finish: () => true,
  39465. [CHANGE_EVENT]: (value) => isNumber(value)
  39466. };
  39467. const timeUnits = [
  39468. ["Y", 1e3 * 60 * 60 * 24 * 365],
  39469. ["M", 1e3 * 60 * 60 * 24 * 30],
  39470. ["D", 1e3 * 60 * 60 * 24],
  39471. ["H", 1e3 * 60 * 60],
  39472. ["m", 1e3 * 60],
  39473. ["s", 1e3],
  39474. ["S", 1]
  39475. ];
  39476. const getTime = (value) => {
  39477. return isNumber(value) ? new Date(value).getTime() : value.valueOf();
  39478. };
  39479. const formatTime$1 = (timestamp, format) => {
  39480. let timeLeft = timestamp;
  39481. const escapeRegex = /\[([^\]]*)]/g;
  39482. const replacedText = timeUnits.reduce((current, [name, unit]) => {
  39483. const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g");
  39484. if (replaceRegex.test(current)) {
  39485. const value = Math.floor(timeLeft / unit);
  39486. timeLeft -= value * unit;
  39487. return current.replace(replaceRegex, (match) => String(value).padStart(match.length, "0"));
  39488. }
  39489. return current;
  39490. }, format);
  39491. return replacedText.replace(escapeRegex, "$1");
  39492. };
  39493. const __default__$n = vue.defineComponent({
  39494. name: "ElCountdown"
  39495. });
  39496. const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
  39497. ...__default__$n,
  39498. props: countdownProps,
  39499. emits: countdownEmits,
  39500. setup(__props, { expose, emit }) {
  39501. const props = __props;
  39502. let timer;
  39503. const rawValue = vue.ref(getTime(props.value) - Date.now());
  39504. const displayValue = vue.computed(() => formatTime$1(rawValue.value, props.format));
  39505. const formatter = (val) => formatTime$1(val, props.format);
  39506. const stopTimer = () => {
  39507. if (timer) {
  39508. cAF(timer);
  39509. timer = void 0;
  39510. }
  39511. };
  39512. const startTimer = () => {
  39513. const timestamp = getTime(props.value);
  39514. const frameFunc = () => {
  39515. let diff = timestamp - Date.now();
  39516. emit("change", diff);
  39517. if (diff <= 0) {
  39518. diff = 0;
  39519. stopTimer();
  39520. emit("finish");
  39521. } else {
  39522. timer = rAF(frameFunc);
  39523. }
  39524. rawValue.value = diff;
  39525. };
  39526. timer = rAF(frameFunc);
  39527. };
  39528. vue.watch(() => [props.value, props.format], () => {
  39529. stopTimer();
  39530. startTimer();
  39531. }, {
  39532. immediate: true
  39533. });
  39534. vue.onBeforeUnmount(() => {
  39535. stopTimer();
  39536. });
  39537. expose({
  39538. displayValue
  39539. });
  39540. return (_ctx, _cache) => {
  39541. return vue.openBlock(), vue.createBlock(vue.unref(ElStatistic), {
  39542. value: rawValue.value,
  39543. title: _ctx.title,
  39544. prefix: _ctx.prefix,
  39545. suffix: _ctx.suffix,
  39546. "value-style": _ctx.valueStyle,
  39547. formatter
  39548. }, vue.createSlots({ _: 2 }, [
  39549. vue.renderList(_ctx.$slots, (_, name) => {
  39550. return {
  39551. name,
  39552. fn: vue.withCtx(() => [
  39553. vue.renderSlot(_ctx.$slots, name)
  39554. ])
  39555. };
  39556. })
  39557. ]), 1032, ["value", "title", "prefix", "suffix", "value-style"]);
  39558. };
  39559. }
  39560. });
  39561. var Countdown = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__file", "countdown.vue"]]);
  39562. const ElCountdown = withInstall(Countdown);
  39563. const stepsProps = buildProps({
  39564. space: {
  39565. type: [Number, String],
  39566. default: ""
  39567. },
  39568. active: {
  39569. type: Number,
  39570. default: 0
  39571. },
  39572. direction: {
  39573. type: String,
  39574. default: "horizontal",
  39575. values: ["horizontal", "vertical"]
  39576. },
  39577. alignCenter: {
  39578. type: Boolean
  39579. },
  39580. simple: {
  39581. type: Boolean
  39582. },
  39583. finishStatus: {
  39584. type: String,
  39585. values: ["wait", "process", "finish", "error", "success"],
  39586. default: "finish"
  39587. },
  39588. processStatus: {
  39589. type: String,
  39590. values: ["wait", "process", "finish", "error", "success"],
  39591. default: "process"
  39592. }
  39593. });
  39594. const stepsEmits = {
  39595. [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber)
  39596. };
  39597. const __default__$m = vue.defineComponent({
  39598. name: "ElSteps"
  39599. });
  39600. const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
  39601. ...__default__$m,
  39602. props: stepsProps,
  39603. emits: stepsEmits,
  39604. setup(__props, { emit }) {
  39605. const props = __props;
  39606. const ns = useNamespace("steps");
  39607. const steps = vue.ref([]);
  39608. vue.watch(steps, () => {
  39609. steps.value.forEach((instance, index) => {
  39610. instance.setIndex(index);
  39611. });
  39612. });
  39613. vue.provide("ElSteps", { props, steps });
  39614. vue.watch(() => props.active, (newVal, oldVal) => {
  39615. emit(CHANGE_EVENT, newVal, oldVal);
  39616. });
  39617. return (_ctx, _cache) => {
  39618. return vue.openBlock(), vue.createElementBlock("div", {
  39619. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.simple ? "simple" : _ctx.direction)])
  39620. }, [
  39621. vue.renderSlot(_ctx.$slots, "default")
  39622. ], 2);
  39623. };
  39624. }
  39625. });
  39626. var Steps = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__file", "steps.vue"]]);
  39627. const stepProps = buildProps({
  39628. title: {
  39629. type: String,
  39630. default: ""
  39631. },
  39632. icon: {
  39633. type: iconPropType
  39634. },
  39635. description: {
  39636. type: String,
  39637. default: ""
  39638. },
  39639. status: {
  39640. type: String,
  39641. values: ["", "wait", "process", "finish", "error", "success"],
  39642. default: ""
  39643. }
  39644. });
  39645. const __default__$l = vue.defineComponent({
  39646. name: "ElStep"
  39647. });
  39648. const _sfc_main$s = vue.defineComponent({
  39649. ...__default__$l,
  39650. props: stepProps,
  39651. setup(__props) {
  39652. const props = __props;
  39653. const ns = useNamespace("step");
  39654. const index = vue.ref(-1);
  39655. const lineStyle = vue.ref({});
  39656. const internalStatus = vue.ref("");
  39657. const parent = vue.inject("ElSteps");
  39658. const currentInstance = vue.getCurrentInstance();
  39659. vue.onMounted(() => {
  39660. vue.watch([
  39661. () => parent.props.active,
  39662. () => parent.props.processStatus,
  39663. () => parent.props.finishStatus
  39664. ], ([active]) => {
  39665. updateStatus(active);
  39666. }, { immediate: true });
  39667. });
  39668. vue.onBeforeUnmount(() => {
  39669. parent.steps.value = parent.steps.value.filter((instance) => instance.uid !== (currentInstance == null ? void 0 : currentInstance.uid));
  39670. });
  39671. const currentStatus = vue.computed(() => {
  39672. return props.status || internalStatus.value;
  39673. });
  39674. const prevStatus = vue.computed(() => {
  39675. const prevStep = parent.steps.value[index.value - 1];
  39676. return prevStep ? prevStep.currentStatus : "wait";
  39677. });
  39678. const isCenter = vue.computed(() => {
  39679. return parent.props.alignCenter;
  39680. });
  39681. const isVertical = vue.computed(() => {
  39682. return parent.props.direction === "vertical";
  39683. });
  39684. const isSimple = vue.computed(() => {
  39685. return parent.props.simple;
  39686. });
  39687. const stepsCount = vue.computed(() => {
  39688. return parent.steps.value.length;
  39689. });
  39690. const isLast = vue.computed(() => {
  39691. var _a;
  39692. return ((_a = parent.steps.value[stepsCount.value - 1]) == null ? void 0 : _a.uid) === (currentInstance == null ? void 0 : currentInstance.uid);
  39693. });
  39694. const space = vue.computed(() => {
  39695. return isSimple.value ? "" : parent.props.space;
  39696. });
  39697. const style = vue.computed(() => {
  39698. const style2 = {
  39699. flexBasis: typeof space.value === "number" ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%`
  39700. };
  39701. if (isVertical.value)
  39702. return style2;
  39703. if (isLast.value) {
  39704. style2.maxWidth = `${100 / stepsCount.value}%`;
  39705. }
  39706. return style2;
  39707. });
  39708. const setIndex = (val) => {
  39709. index.value = val;
  39710. };
  39711. const calcProgress = (status) => {
  39712. let step = 100;
  39713. const style2 = {};
  39714. style2.transitionDelay = `${150 * index.value}ms`;
  39715. if (status === parent.props.processStatus) {
  39716. step = 0;
  39717. } else if (status === "wait") {
  39718. step = 0;
  39719. style2.transitionDelay = `${-150 * index.value}ms`;
  39720. }
  39721. style2.borderWidth = step && !isSimple.value ? "1px" : 0;
  39722. style2[parent.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
  39723. lineStyle.value = style2;
  39724. };
  39725. const updateStatus = (activeIndex) => {
  39726. if (activeIndex > index.value) {
  39727. internalStatus.value = parent.props.finishStatus;
  39728. } else if (activeIndex === index.value && prevStatus.value !== "error") {
  39729. internalStatus.value = parent.props.processStatus;
  39730. } else {
  39731. internalStatus.value = "wait";
  39732. }
  39733. const prevChild = parent.steps.value[index.value - 1];
  39734. if (prevChild)
  39735. prevChild.calcProgress(internalStatus.value);
  39736. };
  39737. const stepItemState = vue.reactive({
  39738. uid: vue.computed(() => currentInstance == null ? void 0 : currentInstance.uid),
  39739. currentStatus,
  39740. setIndex,
  39741. calcProgress
  39742. });
  39743. parent.steps.value = [...parent.steps.value, stepItemState];
  39744. return (_ctx, _cache) => {
  39745. return vue.openBlock(), vue.createElementBlock("div", {
  39746. style: vue.normalizeStyle(vue.unref(style)),
  39747. class: vue.normalizeClass([
  39748. vue.unref(ns).b(),
  39749. vue.unref(ns).is(vue.unref(isSimple) ? "simple" : vue.unref(parent).props.direction),
  39750. vue.unref(ns).is("flex", vue.unref(isLast) && !vue.unref(space) && !vue.unref(isCenter)),
  39751. vue.unref(ns).is("center", vue.unref(isCenter) && !vue.unref(isVertical) && !vue.unref(isSimple))
  39752. ])
  39753. }, [
  39754. vue.createCommentVNode(" icon & line "),
  39755. vue.createElementVNode("div", {
  39756. class: vue.normalizeClass([vue.unref(ns).e("head"), vue.unref(ns).is(vue.unref(currentStatus))])
  39757. }, [
  39758. !vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
  39759. key: 0,
  39760. class: vue.normalizeClass(vue.unref(ns).e("line"))
  39761. }, [
  39762. vue.createElementVNode("i", {
  39763. class: vue.normalizeClass(vue.unref(ns).e("line-inner")),
  39764. style: vue.normalizeStyle(lineStyle.value)
  39765. }, null, 6)
  39766. ], 2)) : vue.createCommentVNode("v-if", true),
  39767. vue.createElementVNode("div", {
  39768. class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(ns).is(_ctx.icon || _ctx.$slots.icon ? "icon" : "text")])
  39769. }, [
  39770. vue.renderSlot(_ctx.$slots, "icon", {}, () => [
  39771. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  39772. key: 0,
  39773. class: vue.normalizeClass(vue.unref(ns).e("icon-inner"))
  39774. }, {
  39775. default: vue.withCtx(() => [
  39776. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  39777. ]),
  39778. _: 1
  39779. }, 8, ["class"])) : vue.unref(currentStatus) === "success" ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  39780. key: 1,
  39781. class: vue.normalizeClass([vue.unref(ns).e("icon-inner"), vue.unref(ns).is("status")])
  39782. }, {
  39783. default: vue.withCtx(() => [
  39784. vue.createVNode(vue.unref(check_default))
  39785. ]),
  39786. _: 1
  39787. }, 8, ["class"])) : vue.unref(currentStatus) === "error" ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  39788. key: 2,
  39789. class: vue.normalizeClass([vue.unref(ns).e("icon-inner"), vue.unref(ns).is("status")])
  39790. }, {
  39791. default: vue.withCtx(() => [
  39792. vue.createVNode(vue.unref(close_default))
  39793. ]),
  39794. _: 1
  39795. }, 8, ["class"])) : !vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
  39796. key: 3,
  39797. class: vue.normalizeClass(vue.unref(ns).e("icon-inner"))
  39798. }, vue.toDisplayString(index.value + 1), 3)) : vue.createCommentVNode("v-if", true)
  39799. ])
  39800. ], 2)
  39801. ], 2),
  39802. vue.createCommentVNode(" title & description "),
  39803. vue.createElementVNode("div", {
  39804. class: vue.normalizeClass(vue.unref(ns).e("main"))
  39805. }, [
  39806. vue.createElementVNode("div", {
  39807. class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(ns).is(vue.unref(currentStatus))])
  39808. }, [
  39809. vue.renderSlot(_ctx.$slots, "title", {}, () => [
  39810. vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
  39811. ])
  39812. ], 2),
  39813. vue.unref(isSimple) ? (vue.openBlock(), vue.createElementBlock("div", {
  39814. key: 0,
  39815. class: vue.normalizeClass(vue.unref(ns).e("arrow"))
  39816. }, null, 2)) : (vue.openBlock(), vue.createElementBlock("div", {
  39817. key: 1,
  39818. class: vue.normalizeClass([vue.unref(ns).e("description"), vue.unref(ns).is(vue.unref(currentStatus))])
  39819. }, [
  39820. vue.renderSlot(_ctx.$slots, "description", {}, () => [
  39821. vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
  39822. ])
  39823. ], 2))
  39824. ], 2)
  39825. ], 6);
  39826. };
  39827. }
  39828. });
  39829. var Step = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__file", "item.vue"]]);
  39830. const ElSteps = withInstall(Steps, {
  39831. Step
  39832. });
  39833. const ElStep = withNoopInstall(Step);
  39834. const switchProps = buildProps({
  39835. modelValue: {
  39836. type: [Boolean, String, Number],
  39837. default: false
  39838. },
  39839. value: {
  39840. type: [Boolean, String, Number],
  39841. default: false
  39842. },
  39843. disabled: {
  39844. type: Boolean,
  39845. default: false
  39846. },
  39847. width: {
  39848. type: [String, Number],
  39849. default: ""
  39850. },
  39851. inlinePrompt: {
  39852. type: Boolean,
  39853. default: false
  39854. },
  39855. activeIcon: {
  39856. type: iconPropType
  39857. },
  39858. inactiveIcon: {
  39859. type: iconPropType
  39860. },
  39861. activeText: {
  39862. type: String,
  39863. default: ""
  39864. },
  39865. inactiveText: {
  39866. type: String,
  39867. default: ""
  39868. },
  39869. activeColor: {
  39870. type: String,
  39871. default: ""
  39872. },
  39873. inactiveColor: {
  39874. type: String,
  39875. default: ""
  39876. },
  39877. borderColor: {
  39878. type: String,
  39879. default: ""
  39880. },
  39881. activeValue: {
  39882. type: [Boolean, String, Number],
  39883. default: true
  39884. },
  39885. inactiveValue: {
  39886. type: [Boolean, String, Number],
  39887. default: false
  39888. },
  39889. name: {
  39890. type: String,
  39891. default: ""
  39892. },
  39893. validateEvent: {
  39894. type: Boolean,
  39895. default: true
  39896. },
  39897. id: String,
  39898. loading: {
  39899. type: Boolean,
  39900. default: false
  39901. },
  39902. beforeChange: {
  39903. type: definePropType(Function)
  39904. },
  39905. size: {
  39906. type: String,
  39907. validator: isValidComponentSize
  39908. },
  39909. tabindex: {
  39910. type: [String, Number]
  39911. }
  39912. });
  39913. const switchEmits = {
  39914. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  39915. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  39916. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  39917. };
  39918. const _hoisted_1$d = ["onClick"];
  39919. const _hoisted_2$9 = ["id", "aria-checked", "aria-disabled", "name", "true-value", "false-value", "disabled", "tabindex", "onKeydown"];
  39920. const _hoisted_3$4 = ["aria-hidden"];
  39921. const _hoisted_4$2 = ["aria-hidden"];
  39922. const _hoisted_5$1 = ["aria-hidden"];
  39923. const COMPONENT_NAME$8 = "ElSwitch";
  39924. const __default__$k = vue.defineComponent({
  39925. name: COMPONENT_NAME$8
  39926. });
  39927. const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
  39928. ...__default__$k,
  39929. props: switchProps,
  39930. emits: switchEmits,
  39931. setup(__props, { expose, emit }) {
  39932. const props = __props;
  39933. const vm = vue.getCurrentInstance();
  39934. const { formItem } = useFormItem();
  39935. const switchSize = useSize();
  39936. const ns = useNamespace("switch");
  39937. useDeprecated({
  39938. from: '"value"',
  39939. replacement: '"model-value" or "v-model"',
  39940. scope: COMPONENT_NAME$8,
  39941. version: "2.3.0",
  39942. ref: "https://element-plus.org/en-US/component/switch.html#attributes",
  39943. type: "Attribute"
  39944. }, vue.computed(() => {
  39945. var _a;
  39946. return !!((_a = vm.vnode.props) == null ? void 0 : _a.value);
  39947. }));
  39948. const { inputId } = useFormItemInputId(props, {
  39949. formItemContext: formItem
  39950. });
  39951. const switchDisabled = useDisabled(vue.computed(() => props.loading));
  39952. const isControlled = vue.ref(props.modelValue !== false);
  39953. const input = vue.ref();
  39954. const core = vue.ref();
  39955. const switchKls = vue.computed(() => [
  39956. ns.b(),
  39957. ns.m(switchSize.value),
  39958. ns.is("disabled", switchDisabled.value),
  39959. ns.is("checked", checked.value)
  39960. ]);
  39961. const coreStyle = vue.computed(() => ({
  39962. width: addUnit(props.width)
  39963. }));
  39964. vue.watch(() => props.modelValue, () => {
  39965. isControlled.value = true;
  39966. });
  39967. vue.watch(() => props.value, () => {
  39968. isControlled.value = false;
  39969. });
  39970. const actualValue = vue.computed(() => {
  39971. return isControlled.value ? props.modelValue : props.value;
  39972. });
  39973. const checked = vue.computed(() => actualValue.value === props.activeValue);
  39974. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  39975. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  39976. emit(CHANGE_EVENT, props.inactiveValue);
  39977. emit(INPUT_EVENT, props.inactiveValue);
  39978. }
  39979. vue.watch(checked, (val) => {
  39980. var _a;
  39981. input.value.checked = val;
  39982. if (props.validateEvent) {
  39983. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn());
  39984. }
  39985. });
  39986. const handleChange = () => {
  39987. const val = checked.value ? props.inactiveValue : props.activeValue;
  39988. emit(UPDATE_MODEL_EVENT, val);
  39989. emit(CHANGE_EVENT, val);
  39990. emit(INPUT_EVENT, val);
  39991. vue.nextTick(() => {
  39992. input.value.checked = checked.value;
  39993. });
  39994. };
  39995. const switchValue = () => {
  39996. if (switchDisabled.value)
  39997. return;
  39998. const { beforeChange } = props;
  39999. if (!beforeChange) {
  40000. handleChange();
  40001. return;
  40002. }
  40003. const shouldChange = beforeChange();
  40004. const isPromiseOrBool = [
  40005. isPromise(shouldChange),
  40006. isBoolean(shouldChange)
  40007. ].includes(true);
  40008. if (!isPromiseOrBool) {
  40009. throwError(COMPONENT_NAME$8, "beforeChange must return type `Promise<boolean>` or `boolean`");
  40010. }
  40011. if (isPromise(shouldChange)) {
  40012. shouldChange.then((result) => {
  40013. if (result) {
  40014. handleChange();
  40015. }
  40016. }).catch((e) => {
  40017. });
  40018. } else if (shouldChange) {
  40019. handleChange();
  40020. }
  40021. };
  40022. const styles = vue.computed(() => {
  40023. return ns.cssVarBlock({
  40024. ...props.activeColor ? { "on-color": props.activeColor } : null,
  40025. ...props.inactiveColor ? { "off-color": props.inactiveColor } : null,
  40026. ...props.borderColor ? { "border-color": props.borderColor } : null
  40027. });
  40028. });
  40029. const focus = () => {
  40030. var _a, _b;
  40031. (_b = (_a = input.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  40032. };
  40033. vue.onMounted(() => {
  40034. input.value.checked = checked.value;
  40035. });
  40036. expose({
  40037. focus,
  40038. checked
  40039. });
  40040. return (_ctx, _cache) => {
  40041. return vue.openBlock(), vue.createElementBlock("div", {
  40042. class: vue.normalizeClass(vue.unref(switchKls)),
  40043. style: vue.normalizeStyle(vue.unref(styles)),
  40044. onClick: vue.withModifiers(switchValue, ["prevent"])
  40045. }, [
  40046. vue.createElementVNode("input", {
  40047. id: vue.unref(inputId),
  40048. ref_key: "input",
  40049. ref: input,
  40050. class: vue.normalizeClass(vue.unref(ns).e("input")),
  40051. type: "checkbox",
  40052. role: "switch",
  40053. "aria-checked": vue.unref(checked),
  40054. "aria-disabled": vue.unref(switchDisabled),
  40055. name: _ctx.name,
  40056. "true-value": _ctx.activeValue,
  40057. "false-value": _ctx.inactiveValue,
  40058. disabled: vue.unref(switchDisabled),
  40059. tabindex: _ctx.tabindex,
  40060. onChange: handleChange,
  40061. onKeydown: vue.withKeys(switchValue, ["enter"])
  40062. }, null, 42, _hoisted_2$9),
  40063. !_ctx.inlinePrompt && (_ctx.inactiveIcon || _ctx.inactiveText) ? (vue.openBlock(), vue.createElementBlock("span", {
  40064. key: 0,
  40065. class: vue.normalizeClass([
  40066. vue.unref(ns).e("label"),
  40067. vue.unref(ns).em("label", "left"),
  40068. vue.unref(ns).is("active", !vue.unref(checked))
  40069. ])
  40070. }, [
  40071. _ctx.inactiveIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 0 }, {
  40072. default: vue.withCtx(() => [
  40073. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.inactiveIcon)))
  40074. ]),
  40075. _: 1
  40076. })) : vue.createCommentVNode("v-if", true),
  40077. !_ctx.inactiveIcon && _ctx.inactiveText ? (vue.openBlock(), vue.createElementBlock("span", {
  40078. key: 1,
  40079. "aria-hidden": vue.unref(checked)
  40080. }, vue.toDisplayString(_ctx.inactiveText), 9, _hoisted_3$4)) : vue.createCommentVNode("v-if", true)
  40081. ], 2)) : vue.createCommentVNode("v-if", true),
  40082. vue.createElementVNode("span", {
  40083. ref_key: "core",
  40084. ref: core,
  40085. class: vue.normalizeClass(vue.unref(ns).e("core")),
  40086. style: vue.normalizeStyle(vue.unref(coreStyle))
  40087. }, [
  40088. _ctx.inlinePrompt ? (vue.openBlock(), vue.createElementBlock("div", {
  40089. key: 0,
  40090. class: vue.normalizeClass(vue.unref(ns).e("inner"))
  40091. }, [
  40092. _ctx.activeIcon || _ctx.inactiveIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  40093. key: 0,
  40094. class: vue.normalizeClass(vue.unref(ns).is("icon"))
  40095. }, {
  40096. default: vue.withCtx(() => [
  40097. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(checked) ? _ctx.activeIcon : _ctx.inactiveIcon)))
  40098. ]),
  40099. _: 1
  40100. }, 8, ["class"])) : _ctx.activeText || _ctx.inactiveText ? (vue.openBlock(), vue.createElementBlock("span", {
  40101. key: 1,
  40102. class: vue.normalizeClass(vue.unref(ns).is("text")),
  40103. "aria-hidden": !vue.unref(checked)
  40104. }, vue.toDisplayString(vue.unref(checked) ? _ctx.activeText : _ctx.inactiveText), 11, _hoisted_4$2)) : vue.createCommentVNode("v-if", true)
  40105. ], 2)) : vue.createCommentVNode("v-if", true),
  40106. vue.createElementVNode("div", {
  40107. class: vue.normalizeClass(vue.unref(ns).e("action"))
  40108. }, [
  40109. _ctx.loading ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  40110. key: 0,
  40111. class: vue.normalizeClass(vue.unref(ns).is("loading"))
  40112. }, {
  40113. default: vue.withCtx(() => [
  40114. vue.createVNode(vue.unref(loading_default))
  40115. ]),
  40116. _: 1
  40117. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  40118. ], 2)
  40119. ], 6),
  40120. !_ctx.inlinePrompt && (_ctx.activeIcon || _ctx.activeText) ? (vue.openBlock(), vue.createElementBlock("span", {
  40121. key: 1,
  40122. class: vue.normalizeClass([
  40123. vue.unref(ns).e("label"),
  40124. vue.unref(ns).em("label", "right"),
  40125. vue.unref(ns).is("active", vue.unref(checked))
  40126. ])
  40127. }, [
  40128. _ctx.activeIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), { key: 0 }, {
  40129. default: vue.withCtx(() => [
  40130. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.activeIcon)))
  40131. ]),
  40132. _: 1
  40133. })) : vue.createCommentVNode("v-if", true),
  40134. !_ctx.activeIcon && _ctx.activeText ? (vue.openBlock(), vue.createElementBlock("span", {
  40135. key: 1,
  40136. "aria-hidden": !vue.unref(checked)
  40137. }, vue.toDisplayString(_ctx.activeText), 9, _hoisted_5$1)) : vue.createCommentVNode("v-if", true)
  40138. ], 2)) : vue.createCommentVNode("v-if", true)
  40139. ], 14, _hoisted_1$d);
  40140. };
  40141. }
  40142. });
  40143. var Switch = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__file", "switch.vue"]]);
  40144. const ElSwitch = withInstall(Switch);
  40145. var matchHtmlRegExp = /["'&<>]/;
  40146. var escapeHtml_1 = escapeHtml;
  40147. function escapeHtml(string) {
  40148. var str = "" + string;
  40149. var match = matchHtmlRegExp.exec(str);
  40150. if (!match) {
  40151. return str;
  40152. }
  40153. var escape;
  40154. var html = "";
  40155. var index = 0;
  40156. var lastIndex = 0;
  40157. for (index = match.index; index < str.length; index++) {
  40158. switch (str.charCodeAt(index)) {
  40159. case 34:
  40160. escape = "&quot;";
  40161. break;
  40162. case 38:
  40163. escape = "&amp;";
  40164. break;
  40165. case 39:
  40166. escape = "&#39;";
  40167. break;
  40168. case 60:
  40169. escape = "&lt;";
  40170. break;
  40171. case 62:
  40172. escape = "&gt;";
  40173. break;
  40174. default:
  40175. continue;
  40176. }
  40177. if (lastIndex !== index) {
  40178. html += str.substring(lastIndex, index);
  40179. }
  40180. lastIndex = index + 1;
  40181. html += escape;
  40182. }
  40183. return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
  40184. }
  40185. /*!
  40186. * escape-html
  40187. * Copyright(c) 2012-2013 TJ Holowaychuk
  40188. * Copyright(c) 2015 Andreas Lubbe
  40189. * Copyright(c) 2015 Tiancheng "Timothy" Gu
  40190. * MIT Licensed
  40191. */
  40192. const getCell = function(event) {
  40193. var _a;
  40194. return (_a = event.target) == null ? void 0 : _a.closest("td");
  40195. };
  40196. const isObject = function(obj) {
  40197. return obj !== null && typeof obj === "object";
  40198. };
  40199. const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
  40200. if (!sortKey && !sortMethod && (!sortBy || Array.isArray(sortBy) && !sortBy.length)) {
  40201. return array;
  40202. }
  40203. if (typeof reverse === "string") {
  40204. reverse = reverse === "descending" ? -1 : 1;
  40205. } else {
  40206. reverse = reverse && reverse < 0 ? -1 : 1;
  40207. }
  40208. const getKey = sortMethod ? null : function(value, index) {
  40209. if (sortBy) {
  40210. if (!Array.isArray(sortBy)) {
  40211. sortBy = [sortBy];
  40212. }
  40213. return sortBy.map((by) => {
  40214. if (typeof by === "string") {
  40215. return get(value, by);
  40216. } else {
  40217. return by(value, index, array);
  40218. }
  40219. });
  40220. }
  40221. if (sortKey !== "$key") {
  40222. if (isObject(value) && "$value" in value)
  40223. value = value.$value;
  40224. }
  40225. return [isObject(value) ? get(value, sortKey) : value];
  40226. };
  40227. const compare = function(a, b) {
  40228. if (sortMethod) {
  40229. return sortMethod(a.value, b.value);
  40230. }
  40231. for (let i = 0, len = a.key.length; i < len; i++) {
  40232. if (a.key[i] < b.key[i]) {
  40233. return -1;
  40234. }
  40235. if (a.key[i] > b.key[i]) {
  40236. return 1;
  40237. }
  40238. }
  40239. return 0;
  40240. };
  40241. return array.map((value, index) => {
  40242. return {
  40243. value,
  40244. index,
  40245. key: getKey ? getKey(value, index) : null
  40246. };
  40247. }).sort((a, b) => {
  40248. let order = compare(a, b);
  40249. if (!order) {
  40250. order = a.index - b.index;
  40251. }
  40252. return order * +reverse;
  40253. }).map((item) => item.value);
  40254. };
  40255. const getColumnById = function(table, columnId) {
  40256. let column = null;
  40257. table.columns.forEach((item) => {
  40258. if (item.id === columnId) {
  40259. column = item;
  40260. }
  40261. });
  40262. return column;
  40263. };
  40264. const getColumnByKey = function(table, columnKey) {
  40265. let column = null;
  40266. for (let i = 0; i < table.columns.length; i++) {
  40267. const item = table.columns[i];
  40268. if (item.columnKey === columnKey) {
  40269. column = item;
  40270. break;
  40271. }
  40272. }
  40273. if (!column)
  40274. throwError("ElTable", `No column matching with column-key: ${columnKey}`);
  40275. return column;
  40276. };
  40277. const getColumnByCell = function(table, cell, namespace) {
  40278. const matches = (cell.className || "").match(new RegExp(`${namespace}-table_[^\\s]+`, "gm"));
  40279. if (matches) {
  40280. return getColumnById(table, matches[0]);
  40281. }
  40282. return null;
  40283. };
  40284. const getRowIdentity = (row, rowKey) => {
  40285. if (!row)
  40286. throw new Error("Row is required when get row identity");
  40287. if (typeof rowKey === "string") {
  40288. if (!rowKey.includes(".")) {
  40289. return `${row[rowKey]}`;
  40290. }
  40291. const key = rowKey.split(".");
  40292. let current = row;
  40293. for (const element of key) {
  40294. current = current[element];
  40295. }
  40296. return `${current}`;
  40297. } else if (typeof rowKey === "function") {
  40298. return rowKey.call(null, row);
  40299. }
  40300. };
  40301. const getKeysMap = function(array, rowKey) {
  40302. const arrayMap = {};
  40303. (array || []).forEach((row, index) => {
  40304. arrayMap[getRowIdentity(row, rowKey)] = { row, index };
  40305. });
  40306. return arrayMap;
  40307. };
  40308. function mergeOptions(defaults, config) {
  40309. const options = {};
  40310. let key;
  40311. for (key in defaults) {
  40312. options[key] = defaults[key];
  40313. }
  40314. for (key in config) {
  40315. if (hasOwn(config, key)) {
  40316. const value = config[key];
  40317. if (typeof value !== "undefined") {
  40318. options[key] = value;
  40319. }
  40320. }
  40321. }
  40322. return options;
  40323. }
  40324. function parseWidth(width) {
  40325. if (width === "")
  40326. return width;
  40327. if (width !== void 0) {
  40328. width = Number.parseInt(width, 10);
  40329. if (Number.isNaN(width)) {
  40330. width = "";
  40331. }
  40332. }
  40333. return width;
  40334. }
  40335. function parseMinWidth(minWidth) {
  40336. if (minWidth === "")
  40337. return minWidth;
  40338. if (minWidth !== void 0) {
  40339. minWidth = parseWidth(minWidth);
  40340. if (Number.isNaN(minWidth)) {
  40341. minWidth = 80;
  40342. }
  40343. }
  40344. return minWidth;
  40345. }
  40346. function parseHeight(height) {
  40347. if (typeof height === "number") {
  40348. return height;
  40349. }
  40350. if (typeof height === "string") {
  40351. if (/^\d+(?:px)?$/.test(height)) {
  40352. return Number.parseInt(height, 10);
  40353. } else {
  40354. return height;
  40355. }
  40356. }
  40357. return null;
  40358. }
  40359. function compose(...funcs) {
  40360. if (funcs.length === 0) {
  40361. return (arg) => arg;
  40362. }
  40363. if (funcs.length === 1) {
  40364. return funcs[0];
  40365. }
  40366. return funcs.reduce((a, b) => (...args) => a(b(...args)));
  40367. }
  40368. function toggleRowStatus(statusArr, row, newVal) {
  40369. let changed = false;
  40370. const index = statusArr.indexOf(row);
  40371. const included = index !== -1;
  40372. const toggleStatus = (type) => {
  40373. if (type === "add") {
  40374. statusArr.push(row);
  40375. } else {
  40376. statusArr.splice(index, 1);
  40377. }
  40378. changed = true;
  40379. if (isArray(row.children)) {
  40380. row.children.forEach((item) => {
  40381. toggleRowStatus(statusArr, item, newVal != null ? newVal : !included);
  40382. });
  40383. }
  40384. };
  40385. if (isBoolean(newVal)) {
  40386. if (newVal && !included) {
  40387. toggleStatus("add");
  40388. } else if (!newVal && included) {
  40389. toggleStatus("remove");
  40390. }
  40391. } else {
  40392. included ? toggleStatus("remove") : toggleStatus("add");
  40393. }
  40394. return changed;
  40395. }
  40396. function walkTreeNode(root, cb, childrenKey = "children", lazyKey = "hasChildren") {
  40397. const isNil = (array) => !(Array.isArray(array) && array.length);
  40398. function _walker(parent, children, level) {
  40399. cb(parent, children, level);
  40400. children.forEach((item) => {
  40401. if (item[lazyKey]) {
  40402. cb(item, null, level + 1);
  40403. return;
  40404. }
  40405. const children2 = item[childrenKey];
  40406. if (!isNil(children2)) {
  40407. _walker(item, children2, level + 1);
  40408. }
  40409. });
  40410. }
  40411. root.forEach((item) => {
  40412. if (item[lazyKey]) {
  40413. cb(item, null, 0);
  40414. return;
  40415. }
  40416. const children = item[childrenKey];
  40417. if (!isNil(children)) {
  40418. _walker(item, children, 0);
  40419. }
  40420. });
  40421. }
  40422. let removePopper;
  40423. function createTablePopper(parentNode, trigger, popperContent, popperOptions, tooltipEffect) {
  40424. const { nextZIndex } = useZIndex();
  40425. const ns = parentNode == null ? void 0 : parentNode.dataset.prefix;
  40426. const scrollContainer = parentNode == null ? void 0 : parentNode.querySelector(`.${ns}-scrollbar__wrap`);
  40427. function renderContent() {
  40428. const isLight = tooltipEffect === "light";
  40429. const content2 = document.createElement("div");
  40430. content2.className = `${ns}-popper ${isLight ? "is-light" : "is-dark"}`;
  40431. popperContent = escapeHtml_1(popperContent);
  40432. content2.innerHTML = popperContent;
  40433. content2.style.zIndex = String(nextZIndex());
  40434. parentNode == null ? void 0 : parentNode.appendChild(content2);
  40435. return content2;
  40436. }
  40437. function renderArrow() {
  40438. const arrow2 = document.createElement("div");
  40439. arrow2.className = `${ns}-popper__arrow`;
  40440. return arrow2;
  40441. }
  40442. function showPopper() {
  40443. popperInstance && popperInstance.update();
  40444. }
  40445. removePopper == null ? void 0 : removePopper();
  40446. removePopper = () => {
  40447. try {
  40448. popperInstance && popperInstance.destroy();
  40449. content && (parentNode == null ? void 0 : parentNode.removeChild(content));
  40450. trigger.removeEventListener("mouseenter", showPopper);
  40451. trigger.removeEventListener("mouseleave", removePopper);
  40452. scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", removePopper);
  40453. removePopper = void 0;
  40454. } catch (e) {
  40455. }
  40456. };
  40457. let popperInstance = null;
  40458. const content = renderContent();
  40459. const arrow = renderArrow();
  40460. content.appendChild(arrow);
  40461. popperInstance = yn(trigger, content, {
  40462. strategy: "absolute",
  40463. modifiers: [
  40464. {
  40465. name: "offset",
  40466. options: {
  40467. offset: [0, 8]
  40468. }
  40469. },
  40470. {
  40471. name: "arrow",
  40472. options: {
  40473. element: arrow,
  40474. padding: 10
  40475. }
  40476. }
  40477. ],
  40478. ...popperOptions
  40479. });
  40480. trigger.addEventListener("mouseenter", showPopper);
  40481. trigger.addEventListener("mouseleave", removePopper);
  40482. scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", removePopper);
  40483. return popperInstance;
  40484. }
  40485. function getCurrentColumns(column) {
  40486. if (column.children) {
  40487. return flatMap(column.children, getCurrentColumns);
  40488. } else {
  40489. return [column];
  40490. }
  40491. }
  40492. function getColSpan(colSpan, column) {
  40493. return colSpan + column.colSpan;
  40494. }
  40495. const isFixedColumn = (index, fixed, store, realColumns) => {
  40496. let start = 0;
  40497. let after = index;
  40498. const columns = store.states.columns.value;
  40499. if (realColumns) {
  40500. const curColumns = getCurrentColumns(realColumns[index]);
  40501. const preColumns = columns.slice(0, columns.indexOf(curColumns[0]));
  40502. start = preColumns.reduce(getColSpan, 0);
  40503. after = start + curColumns.reduce(getColSpan, 0) - 1;
  40504. } else {
  40505. start = index;
  40506. }
  40507. let fixedLayout;
  40508. switch (fixed) {
  40509. case "left":
  40510. if (after < store.states.fixedLeafColumnsLength.value) {
  40511. fixedLayout = "left";
  40512. }
  40513. break;
  40514. case "right":
  40515. if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) {
  40516. fixedLayout = "right";
  40517. }
  40518. break;
  40519. default:
  40520. if (after < store.states.fixedLeafColumnsLength.value) {
  40521. fixedLayout = "left";
  40522. } else if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) {
  40523. fixedLayout = "right";
  40524. }
  40525. }
  40526. return fixedLayout ? {
  40527. direction: fixedLayout,
  40528. start,
  40529. after
  40530. } : {};
  40531. };
  40532. const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset = 0) => {
  40533. const classes = [];
  40534. const { direction, start, after } = isFixedColumn(index, fixed, store, realColumns);
  40535. if (direction) {
  40536. const isLeft = direction === "left";
  40537. classes.push(`${namespace}-fixed-column--${direction}`);
  40538. if (isLeft && after + offset === store.states.fixedLeafColumnsLength.value - 1) {
  40539. classes.push("is-last-column");
  40540. } else if (!isLeft && start - offset === store.states.columns.value.length - store.states.rightFixedLeafColumnsLength.value) {
  40541. classes.push("is-first-column");
  40542. }
  40543. }
  40544. return classes;
  40545. };
  40546. function getOffset(offset, column) {
  40547. return offset + (column.realWidth === null || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
  40548. }
  40549. const getFixedColumnOffset = (index, fixed, store, realColumns) => {
  40550. const {
  40551. direction,
  40552. start = 0,
  40553. after = 0
  40554. } = isFixedColumn(index, fixed, store, realColumns);
  40555. if (!direction) {
  40556. return;
  40557. }
  40558. const styles = {};
  40559. const isLeft = direction === "left";
  40560. const columns = store.states.columns.value;
  40561. if (isLeft) {
  40562. styles.left = columns.slice(0, start).reduce(getOffset, 0);
  40563. } else {
  40564. styles.right = columns.slice(after + 1).reverse().reduce(getOffset, 0);
  40565. }
  40566. return styles;
  40567. };
  40568. const ensurePosition = (style, key) => {
  40569. if (!style)
  40570. return;
  40571. if (!Number.isNaN(style[key])) {
  40572. style[key] = `${style[key]}px`;
  40573. }
  40574. };
  40575. function useExpand(watcherData) {
  40576. const instance = vue.getCurrentInstance();
  40577. const defaultExpandAll = vue.ref(false);
  40578. const expandRows = vue.ref([]);
  40579. const updateExpandRows = () => {
  40580. const data = watcherData.data.value || [];
  40581. const rowKey = watcherData.rowKey.value;
  40582. if (defaultExpandAll.value) {
  40583. expandRows.value = data.slice();
  40584. } else if (rowKey) {
  40585. const expandRowsMap = getKeysMap(expandRows.value, rowKey);
  40586. expandRows.value = data.reduce((prev, row) => {
  40587. const rowId = getRowIdentity(row, rowKey);
  40588. const rowInfo = expandRowsMap[rowId];
  40589. if (rowInfo) {
  40590. prev.push(row);
  40591. }
  40592. return prev;
  40593. }, []);
  40594. } else {
  40595. expandRows.value = [];
  40596. }
  40597. };
  40598. const toggleRowExpansion = (row, expanded) => {
  40599. const changed = toggleRowStatus(expandRows.value, row, expanded);
  40600. if (changed) {
  40601. instance.emit("expand-change", row, expandRows.value.slice());
  40602. }
  40603. };
  40604. const setExpandRowKeys = (rowKeys) => {
  40605. instance.store.assertRowKey();
  40606. const data = watcherData.data.value || [];
  40607. const rowKey = watcherData.rowKey.value;
  40608. const keysMap = getKeysMap(data, rowKey);
  40609. expandRows.value = rowKeys.reduce((prev, cur) => {
  40610. const info = keysMap[cur];
  40611. if (info) {
  40612. prev.push(info.row);
  40613. }
  40614. return prev;
  40615. }, []);
  40616. };
  40617. const isRowExpanded = (row) => {
  40618. const rowKey = watcherData.rowKey.value;
  40619. if (rowKey) {
  40620. const expandMap = getKeysMap(expandRows.value, rowKey);
  40621. return !!expandMap[getRowIdentity(row, rowKey)];
  40622. }
  40623. return expandRows.value.includes(row);
  40624. };
  40625. return {
  40626. updateExpandRows,
  40627. toggleRowExpansion,
  40628. setExpandRowKeys,
  40629. isRowExpanded,
  40630. states: {
  40631. expandRows,
  40632. defaultExpandAll
  40633. }
  40634. };
  40635. }
  40636. function useCurrent(watcherData) {
  40637. const instance = vue.getCurrentInstance();
  40638. const _currentRowKey = vue.ref(null);
  40639. const currentRow = vue.ref(null);
  40640. const setCurrentRowKey = (key) => {
  40641. instance.store.assertRowKey();
  40642. _currentRowKey.value = key;
  40643. setCurrentRowByKey(key);
  40644. };
  40645. const restoreCurrentRowKey = () => {
  40646. _currentRowKey.value = null;
  40647. };
  40648. const setCurrentRowByKey = (key) => {
  40649. const { data, rowKey } = watcherData;
  40650. let _currentRow = null;
  40651. if (rowKey.value) {
  40652. _currentRow = (vue.unref(data) || []).find((item) => getRowIdentity(item, rowKey.value) === key);
  40653. }
  40654. currentRow.value = _currentRow;
  40655. instance.emit("current-change", currentRow.value, null);
  40656. };
  40657. const updateCurrentRow = (_currentRow) => {
  40658. const oldCurrentRow = currentRow.value;
  40659. if (_currentRow && _currentRow !== oldCurrentRow) {
  40660. currentRow.value = _currentRow;
  40661. instance.emit("current-change", currentRow.value, oldCurrentRow);
  40662. return;
  40663. }
  40664. if (!_currentRow && oldCurrentRow) {
  40665. currentRow.value = null;
  40666. instance.emit("current-change", null, oldCurrentRow);
  40667. }
  40668. };
  40669. const updateCurrentRowData = () => {
  40670. const rowKey = watcherData.rowKey.value;
  40671. const data = watcherData.data.value || [];
  40672. const oldCurrentRow = currentRow.value;
  40673. if (!data.includes(oldCurrentRow) && oldCurrentRow) {
  40674. if (rowKey) {
  40675. const currentRowKey = getRowIdentity(oldCurrentRow, rowKey);
  40676. setCurrentRowByKey(currentRowKey);
  40677. } else {
  40678. currentRow.value = null;
  40679. }
  40680. if (currentRow.value === null) {
  40681. instance.emit("current-change", null, oldCurrentRow);
  40682. }
  40683. } else if (_currentRowKey.value) {
  40684. setCurrentRowByKey(_currentRowKey.value);
  40685. restoreCurrentRowKey();
  40686. }
  40687. };
  40688. return {
  40689. setCurrentRowKey,
  40690. restoreCurrentRowKey,
  40691. setCurrentRowByKey,
  40692. updateCurrentRow,
  40693. updateCurrentRowData,
  40694. states: {
  40695. _currentRowKey,
  40696. currentRow
  40697. }
  40698. };
  40699. }
  40700. function useTree$2(watcherData) {
  40701. const expandRowKeys = vue.ref([]);
  40702. const treeData = vue.ref({});
  40703. const indent = vue.ref(16);
  40704. const lazy = vue.ref(false);
  40705. const lazyTreeNodeMap = vue.ref({});
  40706. const lazyColumnIdentifier = vue.ref("hasChildren");
  40707. const childrenColumnName = vue.ref("children");
  40708. const instance = vue.getCurrentInstance();
  40709. const normalizedData = vue.computed(() => {
  40710. if (!watcherData.rowKey.value)
  40711. return {};
  40712. const data = watcherData.data.value || [];
  40713. return normalize(data);
  40714. });
  40715. const normalizedLazyNode = vue.computed(() => {
  40716. const rowKey = watcherData.rowKey.value;
  40717. const keys = Object.keys(lazyTreeNodeMap.value);
  40718. const res = {};
  40719. if (!keys.length)
  40720. return res;
  40721. keys.forEach((key) => {
  40722. if (lazyTreeNodeMap.value[key].length) {
  40723. const item = { children: [] };
  40724. lazyTreeNodeMap.value[key].forEach((row) => {
  40725. const currentRowKey = getRowIdentity(row, rowKey);
  40726. item.children.push(currentRowKey);
  40727. if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) {
  40728. res[currentRowKey] = { children: [] };
  40729. }
  40730. });
  40731. res[key] = item;
  40732. }
  40733. });
  40734. return res;
  40735. });
  40736. const normalize = (data) => {
  40737. const rowKey = watcherData.rowKey.value;
  40738. const res = {};
  40739. walkTreeNode(data, (parent, children, level) => {
  40740. const parentId = getRowIdentity(parent, rowKey);
  40741. if (Array.isArray(children)) {
  40742. res[parentId] = {
  40743. children: children.map((row) => getRowIdentity(row, rowKey)),
  40744. level
  40745. };
  40746. } else if (lazy.value) {
  40747. res[parentId] = {
  40748. children: [],
  40749. lazy: true,
  40750. level
  40751. };
  40752. }
  40753. }, childrenColumnName.value, lazyColumnIdentifier.value);
  40754. return res;
  40755. };
  40756. const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll = ((_a) => (_a = instance.store) == null ? void 0 : _a.states.defaultExpandAll.value)()) => {
  40757. var _a2;
  40758. const nested = normalizedData.value;
  40759. const normalizedLazyNode_ = normalizedLazyNode.value;
  40760. const keys = Object.keys(nested);
  40761. const newTreeData = {};
  40762. if (keys.length) {
  40763. const oldTreeData = vue.unref(treeData);
  40764. const rootLazyRowKeys = [];
  40765. const getExpanded = (oldValue, key) => {
  40766. if (ifChangeExpandRowKeys) {
  40767. if (expandRowKeys.value) {
  40768. return ifExpandAll || expandRowKeys.value.includes(key);
  40769. } else {
  40770. return !!(ifExpandAll || (oldValue == null ? void 0 : oldValue.expanded));
  40771. }
  40772. } else {
  40773. const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key);
  40774. return !!((oldValue == null ? void 0 : oldValue.expanded) || included);
  40775. }
  40776. };
  40777. keys.forEach((key) => {
  40778. const oldValue = oldTreeData[key];
  40779. const newValue = { ...nested[key] };
  40780. newValue.expanded = getExpanded(oldValue, key);
  40781. if (newValue.lazy) {
  40782. const { loaded = false, loading = false } = oldValue || {};
  40783. newValue.loaded = !!loaded;
  40784. newValue.loading = !!loading;
  40785. rootLazyRowKeys.push(key);
  40786. }
  40787. newTreeData[key] = newValue;
  40788. });
  40789. const lazyKeys = Object.keys(normalizedLazyNode_);
  40790. if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) {
  40791. lazyKeys.forEach((key) => {
  40792. const oldValue = oldTreeData[key];
  40793. const lazyNodeChildren = normalizedLazyNode_[key].children;
  40794. if (rootLazyRowKeys.includes(key)) {
  40795. if (newTreeData[key].children.length !== 0) {
  40796. throw new Error("[ElTable]children must be an empty array.");
  40797. }
  40798. newTreeData[key].children = lazyNodeChildren;
  40799. } else {
  40800. const { loaded = false, loading = false } = oldValue || {};
  40801. newTreeData[key] = {
  40802. lazy: true,
  40803. loaded: !!loaded,
  40804. loading: !!loading,
  40805. expanded: getExpanded(oldValue, key),
  40806. children: lazyNodeChildren,
  40807. level: ""
  40808. };
  40809. }
  40810. });
  40811. }
  40812. }
  40813. treeData.value = newTreeData;
  40814. (_a2 = instance.store) == null ? void 0 : _a2.updateTableScrollY();
  40815. };
  40816. vue.watch(() => expandRowKeys.value, () => {
  40817. updateTreeData(true);
  40818. });
  40819. vue.watch(() => normalizedData.value, () => {
  40820. updateTreeData();
  40821. });
  40822. vue.watch(() => normalizedLazyNode.value, () => {
  40823. updateTreeData();
  40824. });
  40825. const updateTreeExpandKeys = (value) => {
  40826. expandRowKeys.value = value;
  40827. updateTreeData();
  40828. };
  40829. const toggleTreeExpansion = (row, expanded) => {
  40830. instance.store.assertRowKey();
  40831. const rowKey = watcherData.rowKey.value;
  40832. const id = getRowIdentity(row, rowKey);
  40833. const data = id && treeData.value[id];
  40834. if (id && data && "expanded" in data) {
  40835. const oldExpanded = data.expanded;
  40836. expanded = typeof expanded === "undefined" ? !data.expanded : expanded;
  40837. treeData.value[id].expanded = expanded;
  40838. if (oldExpanded !== expanded) {
  40839. instance.emit("expand-change", row, expanded);
  40840. }
  40841. instance.store.updateTableScrollY();
  40842. }
  40843. };
  40844. const loadOrToggle = (row) => {
  40845. instance.store.assertRowKey();
  40846. const rowKey = watcherData.rowKey.value;
  40847. const id = getRowIdentity(row, rowKey);
  40848. const data = treeData.value[id];
  40849. if (lazy.value && data && "loaded" in data && !data.loaded) {
  40850. loadData(row, id, data);
  40851. } else {
  40852. toggleTreeExpansion(row, void 0);
  40853. }
  40854. };
  40855. const loadData = (row, key, treeNode) => {
  40856. const { load } = instance.props;
  40857. if (load && !treeData.value[key].loaded) {
  40858. treeData.value[key].loading = true;
  40859. load(row, treeNode, (data) => {
  40860. if (!Array.isArray(data)) {
  40861. throw new TypeError("[ElTable] data must be an array");
  40862. }
  40863. treeData.value[key].loading = false;
  40864. treeData.value[key].loaded = true;
  40865. treeData.value[key].expanded = true;
  40866. if (data.length) {
  40867. lazyTreeNodeMap.value[key] = data;
  40868. }
  40869. instance.emit("expand-change", row, true);
  40870. });
  40871. }
  40872. };
  40873. return {
  40874. loadData,
  40875. loadOrToggle,
  40876. toggleTreeExpansion,
  40877. updateTreeExpandKeys,
  40878. updateTreeData,
  40879. normalize,
  40880. states: {
  40881. expandRowKeys,
  40882. treeData,
  40883. indent,
  40884. lazy,
  40885. lazyTreeNodeMap,
  40886. lazyColumnIdentifier,
  40887. childrenColumnName
  40888. }
  40889. };
  40890. }
  40891. const sortData = (data, states) => {
  40892. const sortingColumn = states.sortingColumn;
  40893. if (!sortingColumn || typeof sortingColumn.sortable === "string") {
  40894. return data;
  40895. }
  40896. return orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  40897. };
  40898. const doFlattenColumns = (columns) => {
  40899. const result = [];
  40900. columns.forEach((column) => {
  40901. if (column.children) {
  40902. result.push.apply(result, doFlattenColumns(column.children));
  40903. } else {
  40904. result.push(column);
  40905. }
  40906. });
  40907. return result;
  40908. };
  40909. function useWatcher$1() {
  40910. var _a;
  40911. const instance = vue.getCurrentInstance();
  40912. const { size: tableSize } = vue.toRefs((_a = instance.proxy) == null ? void 0 : _a.$props);
  40913. const rowKey = vue.ref(null);
  40914. const data = vue.ref([]);
  40915. const _data = vue.ref([]);
  40916. const isComplex = vue.ref(false);
  40917. const _columns = vue.ref([]);
  40918. const originColumns = vue.ref([]);
  40919. const columns = vue.ref([]);
  40920. const fixedColumns = vue.ref([]);
  40921. const rightFixedColumns = vue.ref([]);
  40922. const leafColumns = vue.ref([]);
  40923. const fixedLeafColumns = vue.ref([]);
  40924. const rightFixedLeafColumns = vue.ref([]);
  40925. const leafColumnsLength = vue.ref(0);
  40926. const fixedLeafColumnsLength = vue.ref(0);
  40927. const rightFixedLeafColumnsLength = vue.ref(0);
  40928. const isAllSelected = vue.ref(false);
  40929. const selection = vue.ref([]);
  40930. const reserveSelection = vue.ref(false);
  40931. const selectOnIndeterminate = vue.ref(false);
  40932. const selectable = vue.ref(null);
  40933. const filters = vue.ref({});
  40934. const filteredData = vue.ref(null);
  40935. const sortingColumn = vue.ref(null);
  40936. const sortProp = vue.ref(null);
  40937. const sortOrder = vue.ref(null);
  40938. const hoverRow = vue.ref(null);
  40939. vue.watch(data, () => instance.state && scheduleLayout(false), {
  40940. deep: true
  40941. });
  40942. const assertRowKey = () => {
  40943. if (!rowKey.value)
  40944. throw new Error("[ElTable] prop row-key is required");
  40945. };
  40946. const updateChildFixed = (column) => {
  40947. var _a2;
  40948. (_a2 = column.children) == null ? void 0 : _a2.forEach((childColumn) => {
  40949. childColumn.fixed = column.fixed;
  40950. updateChildFixed(childColumn);
  40951. });
  40952. };
  40953. const updateColumns = () => {
  40954. _columns.value.forEach((column) => {
  40955. updateChildFixed(column);
  40956. });
  40957. fixedColumns.value = _columns.value.filter((column) => column.fixed === true || column.fixed === "left");
  40958. rightFixedColumns.value = _columns.value.filter((column) => column.fixed === "right");
  40959. if (fixedColumns.value.length > 0 && _columns.value[0] && _columns.value[0].type === "selection" && !_columns.value[0].fixed) {
  40960. _columns.value[0].fixed = true;
  40961. fixedColumns.value.unshift(_columns.value[0]);
  40962. }
  40963. const notFixedColumns = _columns.value.filter((column) => !column.fixed);
  40964. originColumns.value = [].concat(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value);
  40965. const leafColumns2 = doFlattenColumns(notFixedColumns);
  40966. const fixedLeafColumns2 = doFlattenColumns(fixedColumns.value);
  40967. const rightFixedLeafColumns2 = doFlattenColumns(rightFixedColumns.value);
  40968. leafColumnsLength.value = leafColumns2.length;
  40969. fixedLeafColumnsLength.value = fixedLeafColumns2.length;
  40970. rightFixedLeafColumnsLength.value = rightFixedLeafColumns2.length;
  40971. columns.value = [].concat(fixedLeafColumns2).concat(leafColumns2).concat(rightFixedLeafColumns2);
  40972. isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0;
  40973. };
  40974. const scheduleLayout = (needUpdateColumns, immediate = false) => {
  40975. if (needUpdateColumns) {
  40976. updateColumns();
  40977. }
  40978. if (immediate) {
  40979. instance.state.doLayout();
  40980. } else {
  40981. instance.state.debouncedUpdateLayout();
  40982. }
  40983. };
  40984. const isSelected = (row) => {
  40985. return selection.value.includes(row);
  40986. };
  40987. const clearSelection = () => {
  40988. isAllSelected.value = false;
  40989. const oldSelection = selection.value;
  40990. if (oldSelection.length) {
  40991. selection.value = [];
  40992. instance.emit("selection-change", []);
  40993. }
  40994. };
  40995. const cleanSelection = () => {
  40996. let deleted;
  40997. if (rowKey.value) {
  40998. deleted = [];
  40999. const selectedMap = getKeysMap(selection.value, rowKey.value);
  41000. const dataMap = getKeysMap(data.value, rowKey.value);
  41001. for (const key in selectedMap) {
  41002. if (hasOwn(selectedMap, key) && !dataMap[key]) {
  41003. deleted.push(selectedMap[key].row);
  41004. }
  41005. }
  41006. } else {
  41007. deleted = selection.value.filter((item) => !data.value.includes(item));
  41008. }
  41009. if (deleted.length) {
  41010. const newSelection = selection.value.filter((item) => !deleted.includes(item));
  41011. selection.value = newSelection;
  41012. instance.emit("selection-change", newSelection.slice());
  41013. }
  41014. };
  41015. const getSelectionRows = () => {
  41016. return (selection.value || []).slice();
  41017. };
  41018. const toggleRowSelection = (row, selected = void 0, emitChange = true) => {
  41019. const changed = toggleRowStatus(selection.value, row, selected);
  41020. if (changed) {
  41021. const newSelection = (selection.value || []).slice();
  41022. if (emitChange) {
  41023. instance.emit("select", newSelection, row);
  41024. }
  41025. instance.emit("selection-change", newSelection);
  41026. }
  41027. };
  41028. const _toggleAllSelection = () => {
  41029. var _a2, _b;
  41030. const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length);
  41031. isAllSelected.value = value;
  41032. let selectionChanged = false;
  41033. let childrenCount = 0;
  41034. const rowKey2 = (_b = (_a2 = instance == null ? void 0 : instance.store) == null ? void 0 : _a2.states) == null ? void 0 : _b.rowKey.value;
  41035. data.value.forEach((row, index) => {
  41036. const rowIndex = index + childrenCount;
  41037. if (selectable.value) {
  41038. if (selectable.value.call(null, row, rowIndex) && toggleRowStatus(selection.value, row, value)) {
  41039. selectionChanged = true;
  41040. }
  41041. } else {
  41042. if (toggleRowStatus(selection.value, row, value)) {
  41043. selectionChanged = true;
  41044. }
  41045. }
  41046. childrenCount += getChildrenCount(getRowIdentity(row, rowKey2));
  41047. });
  41048. if (selectionChanged) {
  41049. instance.emit("selection-change", selection.value ? selection.value.slice() : []);
  41050. }
  41051. instance.emit("select-all", selection.value);
  41052. };
  41053. const updateSelectionByRowKey = () => {
  41054. const selectedMap = getKeysMap(selection.value, rowKey.value);
  41055. data.value.forEach((row) => {
  41056. const rowId = getRowIdentity(row, rowKey.value);
  41057. const rowInfo = selectedMap[rowId];
  41058. if (rowInfo) {
  41059. selection.value[rowInfo.index] = row;
  41060. }
  41061. });
  41062. };
  41063. const updateAllSelected = () => {
  41064. var _a2, _b, _c;
  41065. if (((_a2 = data.value) == null ? void 0 : _a2.length) === 0) {
  41066. isAllSelected.value = false;
  41067. return;
  41068. }
  41069. let selectedMap;
  41070. if (rowKey.value) {
  41071. selectedMap = getKeysMap(selection.value, rowKey.value);
  41072. }
  41073. const isSelected2 = function(row) {
  41074. if (selectedMap) {
  41075. return !!selectedMap[getRowIdentity(row, rowKey.value)];
  41076. } else {
  41077. return selection.value.includes(row);
  41078. }
  41079. };
  41080. let isAllSelected_ = true;
  41081. let selectedCount = 0;
  41082. let childrenCount = 0;
  41083. for (let i = 0, j = (data.value || []).length; i < j; i++) {
  41084. const keyProp = (_c = (_b = instance == null ? void 0 : instance.store) == null ? void 0 : _b.states) == null ? void 0 : _c.rowKey.value;
  41085. const rowIndex = i + childrenCount;
  41086. const item = data.value[i];
  41087. const isRowSelectable = selectable.value && selectable.value.call(null, item, rowIndex);
  41088. if (!isSelected2(item)) {
  41089. if (!selectable.value || isRowSelectable) {
  41090. isAllSelected_ = false;
  41091. break;
  41092. }
  41093. } else {
  41094. selectedCount++;
  41095. }
  41096. childrenCount += getChildrenCount(getRowIdentity(item, keyProp));
  41097. }
  41098. if (selectedCount === 0)
  41099. isAllSelected_ = false;
  41100. isAllSelected.value = isAllSelected_;
  41101. };
  41102. const getChildrenCount = (rowKey2) => {
  41103. var _a2;
  41104. if (!instance || !instance.store)
  41105. return 0;
  41106. const { treeData } = instance.store.states;
  41107. let count = 0;
  41108. const children = (_a2 = treeData.value[rowKey2]) == null ? void 0 : _a2.children;
  41109. if (children) {
  41110. count += children.length;
  41111. children.forEach((childKey) => {
  41112. count += getChildrenCount(childKey);
  41113. });
  41114. }
  41115. return count;
  41116. };
  41117. const updateFilters = (columns2, values) => {
  41118. if (!Array.isArray(columns2)) {
  41119. columns2 = [columns2];
  41120. }
  41121. const filters_ = {};
  41122. columns2.forEach((col) => {
  41123. filters.value[col.id] = values;
  41124. filters_[col.columnKey || col.id] = values;
  41125. });
  41126. return filters_;
  41127. };
  41128. const updateSort = (column, prop, order) => {
  41129. if (sortingColumn.value && sortingColumn.value !== column) {
  41130. sortingColumn.value.order = null;
  41131. }
  41132. sortingColumn.value = column;
  41133. sortProp.value = prop;
  41134. sortOrder.value = order;
  41135. };
  41136. const execFilter = () => {
  41137. let sourceData = vue.unref(_data);
  41138. Object.keys(filters.value).forEach((columnId) => {
  41139. const values = filters.value[columnId];
  41140. if (!values || values.length === 0)
  41141. return;
  41142. const column = getColumnById({
  41143. columns: columns.value
  41144. }, columnId);
  41145. if (column && column.filterMethod) {
  41146. sourceData = sourceData.filter((row) => {
  41147. return values.some((value) => column.filterMethod.call(null, value, row, column));
  41148. });
  41149. }
  41150. });
  41151. filteredData.value = sourceData;
  41152. };
  41153. const execSort = () => {
  41154. data.value = sortData(filteredData.value, {
  41155. sortingColumn: sortingColumn.value,
  41156. sortProp: sortProp.value,
  41157. sortOrder: sortOrder.value
  41158. });
  41159. };
  41160. const execQuery = (ignore = void 0) => {
  41161. if (!(ignore && ignore.filter)) {
  41162. execFilter();
  41163. }
  41164. execSort();
  41165. };
  41166. const clearFilter = (columnKeys) => {
  41167. const { tableHeaderRef } = instance.refs;
  41168. if (!tableHeaderRef)
  41169. return;
  41170. const panels = Object.assign({}, tableHeaderRef.filterPanels);
  41171. const keys = Object.keys(panels);
  41172. if (!keys.length)
  41173. return;
  41174. if (typeof columnKeys === "string") {
  41175. columnKeys = [columnKeys];
  41176. }
  41177. if (Array.isArray(columnKeys)) {
  41178. const columns_ = columnKeys.map((key) => getColumnByKey({
  41179. columns: columns.value
  41180. }, key));
  41181. keys.forEach((key) => {
  41182. const column = columns_.find((col) => col.id === key);
  41183. if (column) {
  41184. column.filteredValue = [];
  41185. }
  41186. });
  41187. instance.store.commit("filterChange", {
  41188. column: columns_,
  41189. values: [],
  41190. silent: true,
  41191. multi: true
  41192. });
  41193. } else {
  41194. keys.forEach((key) => {
  41195. const column = columns.value.find((col) => col.id === key);
  41196. if (column) {
  41197. column.filteredValue = [];
  41198. }
  41199. });
  41200. filters.value = {};
  41201. instance.store.commit("filterChange", {
  41202. column: {},
  41203. values: [],
  41204. silent: true
  41205. });
  41206. }
  41207. };
  41208. const clearSort = () => {
  41209. if (!sortingColumn.value)
  41210. return;
  41211. updateSort(null, null, null);
  41212. instance.store.commit("changeSortCondition", {
  41213. silent: true
  41214. });
  41215. };
  41216. const {
  41217. setExpandRowKeys,
  41218. toggleRowExpansion,
  41219. updateExpandRows,
  41220. states: expandStates,
  41221. isRowExpanded
  41222. } = useExpand({
  41223. data,
  41224. rowKey
  41225. });
  41226. const {
  41227. updateTreeExpandKeys,
  41228. toggleTreeExpansion,
  41229. updateTreeData,
  41230. loadOrToggle,
  41231. states: treeStates
  41232. } = useTree$2({
  41233. data,
  41234. rowKey
  41235. });
  41236. const {
  41237. updateCurrentRowData,
  41238. updateCurrentRow,
  41239. setCurrentRowKey,
  41240. states: currentData
  41241. } = useCurrent({
  41242. data,
  41243. rowKey
  41244. });
  41245. const setExpandRowKeysAdapter = (val) => {
  41246. setExpandRowKeys(val);
  41247. updateTreeExpandKeys(val);
  41248. };
  41249. const toggleRowExpansionAdapter = (row, expanded) => {
  41250. const hasExpandColumn = columns.value.some(({ type }) => type === "expand");
  41251. if (hasExpandColumn) {
  41252. toggleRowExpansion(row, expanded);
  41253. } else {
  41254. toggleTreeExpansion(row, expanded);
  41255. }
  41256. };
  41257. return {
  41258. assertRowKey,
  41259. updateColumns,
  41260. scheduleLayout,
  41261. isSelected,
  41262. clearSelection,
  41263. cleanSelection,
  41264. getSelectionRows,
  41265. toggleRowSelection,
  41266. _toggleAllSelection,
  41267. toggleAllSelection: null,
  41268. updateSelectionByRowKey,
  41269. updateAllSelected,
  41270. updateFilters,
  41271. updateCurrentRow,
  41272. updateSort,
  41273. execFilter,
  41274. execSort,
  41275. execQuery,
  41276. clearFilter,
  41277. clearSort,
  41278. toggleRowExpansion,
  41279. setExpandRowKeysAdapter,
  41280. setCurrentRowKey,
  41281. toggleRowExpansionAdapter,
  41282. isRowExpanded,
  41283. updateExpandRows,
  41284. updateCurrentRowData,
  41285. loadOrToggle,
  41286. updateTreeData,
  41287. states: {
  41288. tableSize,
  41289. rowKey,
  41290. data,
  41291. _data,
  41292. isComplex,
  41293. _columns,
  41294. originColumns,
  41295. columns,
  41296. fixedColumns,
  41297. rightFixedColumns,
  41298. leafColumns,
  41299. fixedLeafColumns,
  41300. rightFixedLeafColumns,
  41301. leafColumnsLength,
  41302. fixedLeafColumnsLength,
  41303. rightFixedLeafColumnsLength,
  41304. isAllSelected,
  41305. selection,
  41306. reserveSelection,
  41307. selectOnIndeterminate,
  41308. selectable,
  41309. filters,
  41310. filteredData,
  41311. sortingColumn,
  41312. sortProp,
  41313. sortOrder,
  41314. hoverRow,
  41315. ...expandStates,
  41316. ...treeStates,
  41317. ...currentData
  41318. }
  41319. };
  41320. }
  41321. function replaceColumn(array, column) {
  41322. return array.map((item) => {
  41323. var _a;
  41324. if (item.id === column.id) {
  41325. return column;
  41326. } else if ((_a = item.children) == null ? void 0 : _a.length) {
  41327. item.children = replaceColumn(item.children, column);
  41328. }
  41329. return item;
  41330. });
  41331. }
  41332. function sortColumn(array) {
  41333. array.forEach((item) => {
  41334. var _a, _b;
  41335. item.no = (_a = item.getColumnIndex) == null ? void 0 : _a.call(item);
  41336. if ((_b = item.children) == null ? void 0 : _b.length) {
  41337. sortColumn(item.children);
  41338. }
  41339. });
  41340. array.sort((cur, pre) => cur.no - pre.no);
  41341. }
  41342. function useStore() {
  41343. const instance = vue.getCurrentInstance();
  41344. const watcher = useWatcher$1();
  41345. const ns = useNamespace("table");
  41346. const mutations = {
  41347. setData(states, data) {
  41348. const dataInstanceChanged = vue.unref(states._data) !== data;
  41349. states.data.value = data;
  41350. states._data.value = data;
  41351. instance.store.execQuery();
  41352. instance.store.updateCurrentRowData();
  41353. instance.store.updateExpandRows();
  41354. instance.store.updateTreeData(instance.store.states.defaultExpandAll.value);
  41355. if (vue.unref(states.reserveSelection)) {
  41356. instance.store.assertRowKey();
  41357. instance.store.updateSelectionByRowKey();
  41358. } else {
  41359. if (dataInstanceChanged) {
  41360. instance.store.clearSelection();
  41361. } else {
  41362. instance.store.cleanSelection();
  41363. }
  41364. }
  41365. instance.store.updateAllSelected();
  41366. if (instance.$ready) {
  41367. instance.store.scheduleLayout();
  41368. }
  41369. },
  41370. insertColumn(states, column, parent) {
  41371. const array = vue.unref(states._columns);
  41372. let newColumns = [];
  41373. if (!parent) {
  41374. array.push(column);
  41375. newColumns = array;
  41376. } else {
  41377. if (parent && !parent.children) {
  41378. parent.children = [];
  41379. }
  41380. parent.children.push(column);
  41381. newColumns = replaceColumn(array, parent);
  41382. }
  41383. sortColumn(newColumns);
  41384. states._columns.value = newColumns;
  41385. if (column.type === "selection") {
  41386. states.selectable.value = column.selectable;
  41387. states.reserveSelection.value = column.reserveSelection;
  41388. }
  41389. if (instance.$ready) {
  41390. instance.store.updateColumns();
  41391. instance.store.scheduleLayout();
  41392. }
  41393. },
  41394. removeColumn(states, column, parent) {
  41395. const array = vue.unref(states._columns) || [];
  41396. if (parent) {
  41397. parent.children.splice(parent.children.findIndex((item) => item.id === column.id), 1);
  41398. vue.nextTick(() => {
  41399. var _a;
  41400. if (((_a = parent.children) == null ? void 0 : _a.length) === 0) {
  41401. delete parent.children;
  41402. }
  41403. });
  41404. states._columns.value = replaceColumn(array, parent);
  41405. } else {
  41406. const index = array.indexOf(column);
  41407. if (index > -1) {
  41408. array.splice(index, 1);
  41409. states._columns.value = array;
  41410. }
  41411. }
  41412. if (instance.$ready) {
  41413. instance.store.updateColumns();
  41414. instance.store.scheduleLayout();
  41415. }
  41416. },
  41417. sort(states, options) {
  41418. const { prop, order, init } = options;
  41419. if (prop) {
  41420. const column = vue.unref(states.columns).find((column2) => column2.property === prop);
  41421. if (column) {
  41422. column.order = order;
  41423. instance.store.updateSort(column, prop, order);
  41424. instance.store.commit("changeSortCondition", { init });
  41425. }
  41426. }
  41427. },
  41428. changeSortCondition(states, options) {
  41429. const { sortingColumn, sortProp, sortOrder } = states;
  41430. const columnValue = vue.unref(sortingColumn), propValue = vue.unref(sortProp), orderValue = vue.unref(sortOrder);
  41431. if (orderValue === null) {
  41432. states.sortingColumn.value = null;
  41433. states.sortProp.value = null;
  41434. }
  41435. const ignore = { filter: true };
  41436. instance.store.execQuery(ignore);
  41437. if (!options || !(options.silent || options.init)) {
  41438. instance.emit("sort-change", {
  41439. column: columnValue,
  41440. prop: propValue,
  41441. order: orderValue
  41442. });
  41443. }
  41444. instance.store.updateTableScrollY();
  41445. },
  41446. filterChange(_states, options) {
  41447. const { column, values, silent } = options;
  41448. const newFilters = instance.store.updateFilters(column, values);
  41449. instance.store.execQuery();
  41450. if (!silent) {
  41451. instance.emit("filter-change", newFilters);
  41452. }
  41453. instance.store.updateTableScrollY();
  41454. },
  41455. toggleAllSelection() {
  41456. instance.store.toggleAllSelection();
  41457. },
  41458. rowSelectedChanged(_states, row) {
  41459. instance.store.toggleRowSelection(row);
  41460. instance.store.updateAllSelected();
  41461. },
  41462. setHoverRow(states, row) {
  41463. states.hoverRow.value = row;
  41464. },
  41465. setCurrentRow(_states, row) {
  41466. instance.store.updateCurrentRow(row);
  41467. }
  41468. };
  41469. const commit = function(name, ...args) {
  41470. const mutations2 = instance.store.mutations;
  41471. if (mutations2[name]) {
  41472. mutations2[name].apply(instance, [instance.store.states].concat(args));
  41473. } else {
  41474. throw new Error(`Action not found: ${name}`);
  41475. }
  41476. };
  41477. const updateTableScrollY = function() {
  41478. vue.nextTick(() => instance.layout.updateScrollY.apply(instance.layout));
  41479. };
  41480. return {
  41481. ns,
  41482. ...watcher,
  41483. mutations,
  41484. commit,
  41485. updateTableScrollY
  41486. };
  41487. }
  41488. const InitialStateMap = {
  41489. rowKey: "rowKey",
  41490. defaultExpandAll: "defaultExpandAll",
  41491. selectOnIndeterminate: "selectOnIndeterminate",
  41492. indent: "indent",
  41493. lazy: "lazy",
  41494. data: "data",
  41495. ["treeProps.hasChildren"]: {
  41496. key: "lazyColumnIdentifier",
  41497. default: "hasChildren"
  41498. },
  41499. ["treeProps.children"]: {
  41500. key: "childrenColumnName",
  41501. default: "children"
  41502. }
  41503. };
  41504. function createStore(table, props) {
  41505. if (!table) {
  41506. throw new Error("Table is required.");
  41507. }
  41508. const store = useStore();
  41509. store.toggleAllSelection = debounce(store._toggleAllSelection, 10);
  41510. Object.keys(InitialStateMap).forEach((key) => {
  41511. handleValue(getArrKeysValue(props, key), key, store);
  41512. });
  41513. proxyTableProps(store, props);
  41514. return store;
  41515. }
  41516. function proxyTableProps(store, props) {
  41517. Object.keys(InitialStateMap).forEach((key) => {
  41518. vue.watch(() => getArrKeysValue(props, key), (value) => {
  41519. handleValue(value, key, store);
  41520. });
  41521. });
  41522. }
  41523. function handleValue(value, propsKey, store) {
  41524. let newVal = value;
  41525. let storeKey = InitialStateMap[propsKey];
  41526. if (typeof InitialStateMap[propsKey] === "object") {
  41527. storeKey = storeKey.key;
  41528. newVal = newVal || InitialStateMap[propsKey].default;
  41529. }
  41530. store.states[storeKey].value = newVal;
  41531. }
  41532. function getArrKeysValue(props, keys) {
  41533. if (keys.includes(".")) {
  41534. const keyList = keys.split(".");
  41535. let value = props;
  41536. keyList.forEach((key) => {
  41537. value = value[key];
  41538. });
  41539. return value;
  41540. } else {
  41541. return props[keys];
  41542. }
  41543. }
  41544. class TableLayout {
  41545. constructor(options) {
  41546. this.observers = [];
  41547. this.table = null;
  41548. this.store = null;
  41549. this.columns = [];
  41550. this.fit = true;
  41551. this.showHeader = true;
  41552. this.height = vue.ref(null);
  41553. this.scrollX = vue.ref(false);
  41554. this.scrollY = vue.ref(false);
  41555. this.bodyWidth = vue.ref(null);
  41556. this.fixedWidth = vue.ref(null);
  41557. this.rightFixedWidth = vue.ref(null);
  41558. this.gutterWidth = 0;
  41559. for (const name in options) {
  41560. if (hasOwn(options, name)) {
  41561. if (vue.isRef(this[name])) {
  41562. this[name].value = options[name];
  41563. } else {
  41564. this[name] = options[name];
  41565. }
  41566. }
  41567. }
  41568. if (!this.table) {
  41569. throw new Error("Table is required for Table Layout");
  41570. }
  41571. if (!this.store) {
  41572. throw new Error("Store is required for Table Layout");
  41573. }
  41574. }
  41575. updateScrollY() {
  41576. const height = this.height.value;
  41577. if (height === null)
  41578. return false;
  41579. const scrollBarRef = this.table.refs.scrollBarRef;
  41580. if (this.table.vnode.el && scrollBarRef) {
  41581. let scrollY = true;
  41582. const prevScrollY = this.scrollY.value;
  41583. scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight;
  41584. this.scrollY.value = scrollY;
  41585. return prevScrollY !== scrollY;
  41586. }
  41587. return false;
  41588. }
  41589. setHeight(value, prop = "height") {
  41590. if (!isClient)
  41591. return;
  41592. const el = this.table.vnode.el;
  41593. value = parseHeight(value);
  41594. this.height.value = Number(value);
  41595. if (!el && (value || value === 0))
  41596. return vue.nextTick(() => this.setHeight(value, prop));
  41597. if (typeof value === "number") {
  41598. el.style[prop] = `${value}px`;
  41599. this.updateElsHeight();
  41600. } else if (typeof value === "string") {
  41601. el.style[prop] = value;
  41602. this.updateElsHeight();
  41603. }
  41604. }
  41605. setMaxHeight(value) {
  41606. this.setHeight(value, "max-height");
  41607. }
  41608. getFlattenColumns() {
  41609. const flattenColumns = [];
  41610. const columns = this.table.store.states.columns.value;
  41611. columns.forEach((column) => {
  41612. if (column.isColumnGroup) {
  41613. flattenColumns.push.apply(flattenColumns, column.columns);
  41614. } else {
  41615. flattenColumns.push(column);
  41616. }
  41617. });
  41618. return flattenColumns;
  41619. }
  41620. updateElsHeight() {
  41621. this.updateScrollY();
  41622. this.notifyObservers("scrollable");
  41623. }
  41624. headerDisplayNone(elm) {
  41625. if (!elm)
  41626. return true;
  41627. let headerChild = elm;
  41628. while (headerChild.tagName !== "DIV") {
  41629. if (getComputedStyle(headerChild).display === "none") {
  41630. return true;
  41631. }
  41632. headerChild = headerChild.parentElement;
  41633. }
  41634. return false;
  41635. }
  41636. updateColumnsWidth() {
  41637. if (!isClient)
  41638. return;
  41639. const fit = this.fit;
  41640. const bodyWidth = this.table.vnode.el.clientWidth;
  41641. let bodyMinWidth = 0;
  41642. const flattenColumns = this.getFlattenColumns();
  41643. const flexColumns = flattenColumns.filter((column) => typeof column.width !== "number");
  41644. flattenColumns.forEach((column) => {
  41645. if (typeof column.width === "number" && column.realWidth)
  41646. column.realWidth = null;
  41647. });
  41648. if (flexColumns.length > 0 && fit) {
  41649. flattenColumns.forEach((column) => {
  41650. bodyMinWidth += Number(column.width || column.minWidth || 80);
  41651. });
  41652. if (bodyMinWidth <= bodyWidth) {
  41653. this.scrollX.value = false;
  41654. const totalFlexWidth = bodyWidth - bodyMinWidth;
  41655. if (flexColumns.length === 1) {
  41656. flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth;
  41657. } else {
  41658. const allColumnsWidth = flexColumns.reduce((prev, column) => prev + Number(column.minWidth || 80), 0);
  41659. const flexWidthPerPixel = totalFlexWidth / allColumnsWidth;
  41660. let noneFirstWidth = 0;
  41661. flexColumns.forEach((column, index) => {
  41662. if (index === 0)
  41663. return;
  41664. const flexWidth = Math.floor(Number(column.minWidth || 80) * flexWidthPerPixel);
  41665. noneFirstWidth += flexWidth;
  41666. column.realWidth = Number(column.minWidth || 80) + flexWidth;
  41667. });
  41668. flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  41669. }
  41670. } else {
  41671. this.scrollX.value = true;
  41672. flexColumns.forEach((column) => {
  41673. column.realWidth = Number(column.minWidth);
  41674. });
  41675. }
  41676. this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth);
  41677. this.table.state.resizeState.value.width = this.bodyWidth.value;
  41678. } else {
  41679. flattenColumns.forEach((column) => {
  41680. if (!column.width && !column.minWidth) {
  41681. column.realWidth = 80;
  41682. } else {
  41683. column.realWidth = Number(column.width || column.minWidth);
  41684. }
  41685. bodyMinWidth += column.realWidth;
  41686. });
  41687. this.scrollX.value = bodyMinWidth > bodyWidth;
  41688. this.bodyWidth.value = bodyMinWidth;
  41689. }
  41690. const fixedColumns = this.store.states.fixedColumns.value;
  41691. if (fixedColumns.length > 0) {
  41692. let fixedWidth = 0;
  41693. fixedColumns.forEach((column) => {
  41694. fixedWidth += Number(column.realWidth || column.width);
  41695. });
  41696. this.fixedWidth.value = fixedWidth;
  41697. }
  41698. const rightFixedColumns = this.store.states.rightFixedColumns.value;
  41699. if (rightFixedColumns.length > 0) {
  41700. let rightFixedWidth = 0;
  41701. rightFixedColumns.forEach((column) => {
  41702. rightFixedWidth += Number(column.realWidth || column.width);
  41703. });
  41704. this.rightFixedWidth.value = rightFixedWidth;
  41705. }
  41706. this.notifyObservers("columns");
  41707. }
  41708. addObserver(observer) {
  41709. this.observers.push(observer);
  41710. }
  41711. removeObserver(observer) {
  41712. const index = this.observers.indexOf(observer);
  41713. if (index !== -1) {
  41714. this.observers.splice(index, 1);
  41715. }
  41716. }
  41717. notifyObservers(event) {
  41718. const observers = this.observers;
  41719. observers.forEach((observer) => {
  41720. var _a, _b;
  41721. switch (event) {
  41722. case "columns":
  41723. (_a = observer.state) == null ? void 0 : _a.onColumnsChange(this);
  41724. break;
  41725. case "scrollable":
  41726. (_b = observer.state) == null ? void 0 : _b.onScrollableChange(this);
  41727. break;
  41728. default:
  41729. throw new Error(`Table Layout don't have event ${event}.`);
  41730. }
  41731. });
  41732. }
  41733. }
  41734. var TableLayout$1 = TableLayout;
  41735. const { CheckboxGroup: ElCheckboxGroup } = ElCheckbox;
  41736. const _sfc_main$q = vue.defineComponent({
  41737. name: "ElTableFilterPanel",
  41738. components: {
  41739. ElCheckbox,
  41740. ElCheckboxGroup,
  41741. ElScrollbar,
  41742. ElTooltip,
  41743. ElIcon,
  41744. ArrowDown: arrow_down_default,
  41745. ArrowUp: arrow_up_default
  41746. },
  41747. directives: { ClickOutside },
  41748. props: {
  41749. placement: {
  41750. type: String,
  41751. default: "bottom-start"
  41752. },
  41753. store: {
  41754. type: Object
  41755. },
  41756. column: {
  41757. type: Object
  41758. },
  41759. upDataColumn: {
  41760. type: Function
  41761. }
  41762. },
  41763. setup(props) {
  41764. const instance = vue.getCurrentInstance();
  41765. const { t } = useLocale();
  41766. const ns = useNamespace("table-filter");
  41767. const parent = instance == null ? void 0 : instance.parent;
  41768. if (!parent.filterPanels.value[props.column.id]) {
  41769. parent.filterPanels.value[props.column.id] = instance;
  41770. }
  41771. const tooltipVisible = vue.ref(false);
  41772. const tooltip = vue.ref(null);
  41773. const filters = vue.computed(() => {
  41774. return props.column && props.column.filters;
  41775. });
  41776. const filterValue = vue.computed({
  41777. get: () => {
  41778. var _a;
  41779. return (((_a = props.column) == null ? void 0 : _a.filteredValue) || [])[0];
  41780. },
  41781. set: (value) => {
  41782. if (filteredValue.value) {
  41783. if (typeof value !== "undefined" && value !== null) {
  41784. filteredValue.value.splice(0, 1, value);
  41785. } else {
  41786. filteredValue.value.splice(0, 1);
  41787. }
  41788. }
  41789. }
  41790. });
  41791. const filteredValue = vue.computed({
  41792. get() {
  41793. if (props.column) {
  41794. return props.column.filteredValue || [];
  41795. }
  41796. return [];
  41797. },
  41798. set(value) {
  41799. if (props.column) {
  41800. props.upDataColumn("filteredValue", value);
  41801. }
  41802. }
  41803. });
  41804. const multiple = vue.computed(() => {
  41805. if (props.column) {
  41806. return props.column.filterMultiple;
  41807. }
  41808. return true;
  41809. });
  41810. const isActive = (filter) => {
  41811. return filter.value === filterValue.value;
  41812. };
  41813. const hidden = () => {
  41814. tooltipVisible.value = false;
  41815. };
  41816. const showFilterPanel = (e) => {
  41817. e.stopPropagation();
  41818. tooltipVisible.value = !tooltipVisible.value;
  41819. };
  41820. const hideFilterPanel = () => {
  41821. tooltipVisible.value = false;
  41822. };
  41823. const handleConfirm = () => {
  41824. confirmFilter(filteredValue.value);
  41825. hidden();
  41826. };
  41827. const handleReset = () => {
  41828. filteredValue.value = [];
  41829. confirmFilter(filteredValue.value);
  41830. hidden();
  41831. };
  41832. const handleSelect = (_filterValue) => {
  41833. filterValue.value = _filterValue;
  41834. if (typeof _filterValue !== "undefined" && _filterValue !== null) {
  41835. confirmFilter(filteredValue.value);
  41836. } else {
  41837. confirmFilter([]);
  41838. }
  41839. hidden();
  41840. };
  41841. const confirmFilter = (filteredValue2) => {
  41842. props.store.commit("filterChange", {
  41843. column: props.column,
  41844. values: filteredValue2
  41845. });
  41846. props.store.updateAllSelected();
  41847. };
  41848. vue.watch(tooltipVisible, (value) => {
  41849. if (props.column) {
  41850. props.upDataColumn("filterOpened", value);
  41851. }
  41852. }, {
  41853. immediate: true
  41854. });
  41855. const popperPaneRef = vue.computed(() => {
  41856. var _a, _b;
  41857. return (_b = (_a = tooltip.value) == null ? void 0 : _a.popperRef) == null ? void 0 : _b.contentRef;
  41858. });
  41859. return {
  41860. tooltipVisible,
  41861. multiple,
  41862. filteredValue,
  41863. filterValue,
  41864. filters,
  41865. handleConfirm,
  41866. handleReset,
  41867. handleSelect,
  41868. isActive,
  41869. t,
  41870. ns,
  41871. showFilterPanel,
  41872. hideFilterPanel,
  41873. popperPaneRef,
  41874. tooltip
  41875. };
  41876. }
  41877. });
  41878. const _hoisted_1$c = { key: 0 };
  41879. const _hoisted_2$8 = ["disabled"];
  41880. const _hoisted_3$3 = ["label", "onClick"];
  41881. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  41882. const _component_el_checkbox = vue.resolveComponent("el-checkbox");
  41883. const _component_el_checkbox_group = vue.resolveComponent("el-checkbox-group");
  41884. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  41885. const _component_arrow_up = vue.resolveComponent("arrow-up");
  41886. const _component_arrow_down = vue.resolveComponent("arrow-down");
  41887. const _component_el_icon = vue.resolveComponent("el-icon");
  41888. const _component_el_tooltip = vue.resolveComponent("el-tooltip");
  41889. const _directive_click_outside = vue.resolveDirective("click-outside");
  41890. return vue.openBlock(), vue.createBlock(_component_el_tooltip, {
  41891. ref: "tooltip",
  41892. visible: _ctx.tooltipVisible,
  41893. offset: 0,
  41894. placement: _ctx.placement,
  41895. "show-arrow": false,
  41896. "stop-popper-mouse-event": false,
  41897. teleported: "",
  41898. effect: "light",
  41899. pure: "",
  41900. "popper-class": _ctx.ns.b(),
  41901. persistent: ""
  41902. }, {
  41903. content: vue.withCtx(() => [
  41904. _ctx.multiple ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
  41905. vue.createElementVNode("div", {
  41906. class: vue.normalizeClass(_ctx.ns.e("content"))
  41907. }, [
  41908. vue.createVNode(_component_el_scrollbar, {
  41909. "wrap-class": _ctx.ns.e("wrap")
  41910. }, {
  41911. default: vue.withCtx(() => [
  41912. vue.createVNode(_component_el_checkbox_group, {
  41913. modelValue: _ctx.filteredValue,
  41914. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event),
  41915. class: vue.normalizeClass(_ctx.ns.e("checkbox-group"))
  41916. }, {
  41917. default: vue.withCtx(() => [
  41918. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.filters, (filter) => {
  41919. return vue.openBlock(), vue.createBlock(_component_el_checkbox, {
  41920. key: filter.value,
  41921. label: filter.value
  41922. }, {
  41923. default: vue.withCtx(() => [
  41924. vue.createTextVNode(vue.toDisplayString(filter.text), 1)
  41925. ]),
  41926. _: 2
  41927. }, 1032, ["label"]);
  41928. }), 128))
  41929. ]),
  41930. _: 1
  41931. }, 8, ["modelValue", "class"])
  41932. ]),
  41933. _: 1
  41934. }, 8, ["wrap-class"])
  41935. ], 2),
  41936. vue.createElementVNode("div", {
  41937. class: vue.normalizeClass(_ctx.ns.e("bottom"))
  41938. }, [
  41939. vue.createElementVNode("button", {
  41940. class: vue.normalizeClass({ [_ctx.ns.is("disabled")]: _ctx.filteredValue.length === 0 }),
  41941. disabled: _ctx.filteredValue.length === 0,
  41942. type: "button",
  41943. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args))
  41944. }, vue.toDisplayString(_ctx.t("el.table.confirmFilter")), 11, _hoisted_2$8),
  41945. vue.createElementVNode("button", {
  41946. type: "button",
  41947. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args))
  41948. }, vue.toDisplayString(_ctx.t("el.table.resetFilter")), 1)
  41949. ], 2)
  41950. ])) : (vue.openBlock(), vue.createElementBlock("ul", {
  41951. key: 1,
  41952. class: vue.normalizeClass(_ctx.ns.e("list"))
  41953. }, [
  41954. vue.createElementVNode("li", {
  41955. class: vue.normalizeClass([
  41956. _ctx.ns.e("list-item"),
  41957. {
  41958. [_ctx.ns.is("active")]: _ctx.filterValue === void 0 || _ctx.filterValue === null
  41959. }
  41960. ]),
  41961. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null))
  41962. }, vue.toDisplayString(_ctx.t("el.table.clearFilter")), 3),
  41963. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.filters, (filter) => {
  41964. return vue.openBlock(), vue.createElementBlock("li", {
  41965. key: filter.value,
  41966. class: vue.normalizeClass([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]),
  41967. label: filter.value,
  41968. onClick: ($event) => _ctx.handleSelect(filter.value)
  41969. }, vue.toDisplayString(filter.text), 11, _hoisted_3$3);
  41970. }), 128))
  41971. ], 2))
  41972. ]),
  41973. default: vue.withCtx(() => [
  41974. vue.withDirectives((vue.openBlock(), vue.createElementBlock("span", {
  41975. class: vue.normalizeClass([
  41976. `${_ctx.ns.namespace.value}-table__column-filter-trigger`,
  41977. `${_ctx.ns.namespace.value}-none-outline`
  41978. ]),
  41979. onClick: _cache[4] || (_cache[4] = (...args) => _ctx.showFilterPanel && _ctx.showFilterPanel(...args))
  41980. }, [
  41981. vue.createVNode(_component_el_icon, null, {
  41982. default: vue.withCtx(() => [
  41983. _ctx.column.filterOpened ? (vue.openBlock(), vue.createBlock(_component_arrow_up, { key: 0 })) : (vue.openBlock(), vue.createBlock(_component_arrow_down, { key: 1 }))
  41984. ]),
  41985. _: 1
  41986. })
  41987. ], 2)), [
  41988. [_directive_click_outside, _ctx.hideFilterPanel, _ctx.popperPaneRef]
  41989. ])
  41990. ]),
  41991. _: 1
  41992. }, 8, ["visible", "placement", "popper-class"]);
  41993. }
  41994. var FilterPanel = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["render", _sfc_render$4], ["__file", "filter-panel.vue"]]);
  41995. function useLayoutObserver(root) {
  41996. const instance = vue.getCurrentInstance();
  41997. vue.onBeforeMount(() => {
  41998. tableLayout.value.addObserver(instance);
  41999. });
  42000. vue.onMounted(() => {
  42001. onColumnsChange(tableLayout.value);
  42002. onScrollableChange(tableLayout.value);
  42003. });
  42004. vue.onUpdated(() => {
  42005. onColumnsChange(tableLayout.value);
  42006. onScrollableChange(tableLayout.value);
  42007. });
  42008. vue.onUnmounted(() => {
  42009. tableLayout.value.removeObserver(instance);
  42010. });
  42011. const tableLayout = vue.computed(() => {
  42012. const layout = root.layout;
  42013. if (!layout) {
  42014. throw new Error("Can not find table layout.");
  42015. }
  42016. return layout;
  42017. });
  42018. const onColumnsChange = (layout) => {
  42019. var _a;
  42020. const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col")) || [];
  42021. if (!cols.length)
  42022. return;
  42023. const flattenColumns = layout.getFlattenColumns();
  42024. const columnsMap = {};
  42025. flattenColumns.forEach((column) => {
  42026. columnsMap[column.id] = column;
  42027. });
  42028. for (let i = 0, j = cols.length; i < j; i++) {
  42029. const col = cols[i];
  42030. const name = col.getAttribute("name");
  42031. const column = columnsMap[name];
  42032. if (column) {
  42033. col.setAttribute("width", column.realWidth || column.width);
  42034. }
  42035. }
  42036. };
  42037. const onScrollableChange = (layout) => {
  42038. var _a, _b;
  42039. const cols = ((_a = root.vnode.el) == null ? void 0 : _a.querySelectorAll("colgroup > col[name=gutter]")) || [];
  42040. for (let i = 0, j = cols.length; i < j; i++) {
  42041. const col = cols[i];
  42042. col.setAttribute("width", layout.scrollY.value ? layout.gutterWidth : "0");
  42043. }
  42044. const ths = ((_b = root.vnode.el) == null ? void 0 : _b.querySelectorAll("th.gutter")) || [];
  42045. for (let i = 0, j = ths.length; i < j; i++) {
  42046. const th = ths[i];
  42047. th.style.width = layout.scrollY.value ? `${layout.gutterWidth}px` : "0";
  42048. th.style.display = layout.scrollY.value ? "" : "none";
  42049. }
  42050. };
  42051. return {
  42052. tableLayout: tableLayout.value,
  42053. onColumnsChange,
  42054. onScrollableChange
  42055. };
  42056. }
  42057. const TABLE_INJECTION_KEY = Symbol("ElTable");
  42058. function useEvent(props, emit) {
  42059. const instance = vue.getCurrentInstance();
  42060. const parent = vue.inject(TABLE_INJECTION_KEY);
  42061. const handleFilterClick = (event) => {
  42062. event.stopPropagation();
  42063. return;
  42064. };
  42065. const handleHeaderClick = (event, column) => {
  42066. if (!column.filters && column.sortable) {
  42067. handleSortClick(event, column, false);
  42068. } else if (column.filterable && !column.sortable) {
  42069. handleFilterClick(event);
  42070. }
  42071. parent == null ? void 0 : parent.emit("header-click", column, event);
  42072. };
  42073. const handleHeaderContextMenu = (event, column) => {
  42074. parent == null ? void 0 : parent.emit("header-contextmenu", column, event);
  42075. };
  42076. const draggingColumn = vue.ref(null);
  42077. const dragging = vue.ref(false);
  42078. const dragState = vue.ref({});
  42079. const handleMouseDown = (event, column) => {
  42080. if (!isClient)
  42081. return;
  42082. if (column.children && column.children.length > 0)
  42083. return;
  42084. if (draggingColumn.value && props.border) {
  42085. dragging.value = true;
  42086. const table = parent;
  42087. emit("set-drag-visible", true);
  42088. const tableEl = table == null ? void 0 : table.vnode.el;
  42089. const tableLeft = tableEl.getBoundingClientRect().left;
  42090. const columnEl = instance.vnode.el.querySelector(`th.${column.id}`);
  42091. const columnRect = columnEl.getBoundingClientRect();
  42092. const minLeft = columnRect.left - tableLeft + 30;
  42093. addClass(columnEl, "noclick");
  42094. dragState.value = {
  42095. startMouseLeft: event.clientX,
  42096. startLeft: columnRect.right - tableLeft,
  42097. startColumnLeft: columnRect.left - tableLeft,
  42098. tableLeft
  42099. };
  42100. const resizeProxy = table == null ? void 0 : table.refs.resizeProxy;
  42101. resizeProxy.style.left = `${dragState.value.startLeft}px`;
  42102. document.onselectstart = function() {
  42103. return false;
  42104. };
  42105. document.ondragstart = function() {
  42106. return false;
  42107. };
  42108. const handleMouseMove2 = (event2) => {
  42109. const deltaLeft = event2.clientX - dragState.value.startMouseLeft;
  42110. const proxyLeft = dragState.value.startLeft + deltaLeft;
  42111. resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`;
  42112. };
  42113. const handleMouseUp = () => {
  42114. if (dragging.value) {
  42115. const { startColumnLeft, startLeft } = dragState.value;
  42116. const finalLeft = Number.parseInt(resizeProxy.style.left, 10);
  42117. const columnWidth = finalLeft - startColumnLeft;
  42118. column.width = column.realWidth = columnWidth;
  42119. table == null ? void 0 : table.emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
  42120. requestAnimationFrame(() => {
  42121. props.store.scheduleLayout(false, true);
  42122. });
  42123. document.body.style.cursor = "";
  42124. dragging.value = false;
  42125. draggingColumn.value = null;
  42126. dragState.value = {};
  42127. emit("set-drag-visible", false);
  42128. }
  42129. document.removeEventListener("mousemove", handleMouseMove2);
  42130. document.removeEventListener("mouseup", handleMouseUp);
  42131. document.onselectstart = null;
  42132. document.ondragstart = null;
  42133. setTimeout(() => {
  42134. removeClass(columnEl, "noclick");
  42135. }, 0);
  42136. };
  42137. document.addEventListener("mousemove", handleMouseMove2);
  42138. document.addEventListener("mouseup", handleMouseUp);
  42139. }
  42140. };
  42141. const handleMouseMove = (event, column) => {
  42142. var _a;
  42143. if (column.children && column.children.length > 0)
  42144. return;
  42145. const target = (_a = event.target) == null ? void 0 : _a.closest("th");
  42146. if (!column || !column.resizable)
  42147. return;
  42148. if (!dragging.value && props.border) {
  42149. const rect = target.getBoundingClientRect();
  42150. const bodyStyle = document.body.style;
  42151. if (rect.width > 12 && rect.right - event.pageX < 8) {
  42152. bodyStyle.cursor = "col-resize";
  42153. if (hasClass(target, "is-sortable")) {
  42154. target.style.cursor = "col-resize";
  42155. }
  42156. draggingColumn.value = column;
  42157. } else if (!dragging.value) {
  42158. bodyStyle.cursor = "";
  42159. if (hasClass(target, "is-sortable")) {
  42160. target.style.cursor = "pointer";
  42161. }
  42162. draggingColumn.value = null;
  42163. }
  42164. }
  42165. };
  42166. const handleMouseOut = () => {
  42167. if (!isClient)
  42168. return;
  42169. document.body.style.cursor = "";
  42170. };
  42171. const toggleOrder = ({ order, sortOrders }) => {
  42172. if (order === "")
  42173. return sortOrders[0];
  42174. const index = sortOrders.indexOf(order || null);
  42175. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  42176. };
  42177. const handleSortClick = (event, column, givenOrder) => {
  42178. var _a;
  42179. event.stopPropagation();
  42180. const order = column.order === givenOrder ? null : givenOrder || toggleOrder(column);
  42181. const target = (_a = event.target) == null ? void 0 : _a.closest("th");
  42182. if (target) {
  42183. if (hasClass(target, "noclick")) {
  42184. removeClass(target, "noclick");
  42185. return;
  42186. }
  42187. }
  42188. if (!column.sortable)
  42189. return;
  42190. const states = props.store.states;
  42191. let sortProp = states.sortProp.value;
  42192. let sortOrder;
  42193. const sortingColumn = states.sortingColumn.value;
  42194. if (sortingColumn !== column || sortingColumn === column && sortingColumn.order === null) {
  42195. if (sortingColumn) {
  42196. sortingColumn.order = null;
  42197. }
  42198. states.sortingColumn.value = column;
  42199. sortProp = column.property;
  42200. }
  42201. if (!order) {
  42202. sortOrder = column.order = null;
  42203. } else {
  42204. sortOrder = column.order = order;
  42205. }
  42206. states.sortProp.value = sortProp;
  42207. states.sortOrder.value = sortOrder;
  42208. parent == null ? void 0 : parent.store.commit("changeSortCondition");
  42209. };
  42210. return {
  42211. handleHeaderClick,
  42212. handleHeaderContextMenu,
  42213. handleMouseDown,
  42214. handleMouseMove,
  42215. handleMouseOut,
  42216. handleSortClick,
  42217. handleFilterClick
  42218. };
  42219. }
  42220. function useStyle$2(props) {
  42221. const parent = vue.inject(TABLE_INJECTION_KEY);
  42222. const ns = useNamespace("table");
  42223. const getHeaderRowStyle = (rowIndex) => {
  42224. const headerRowStyle = parent == null ? void 0 : parent.props.headerRowStyle;
  42225. if (typeof headerRowStyle === "function") {
  42226. return headerRowStyle.call(null, { rowIndex });
  42227. }
  42228. return headerRowStyle;
  42229. };
  42230. const getHeaderRowClass = (rowIndex) => {
  42231. const classes = [];
  42232. const headerRowClassName = parent == null ? void 0 : parent.props.headerRowClassName;
  42233. if (typeof headerRowClassName === "string") {
  42234. classes.push(headerRowClassName);
  42235. } else if (typeof headerRowClassName === "function") {
  42236. classes.push(headerRowClassName.call(null, { rowIndex }));
  42237. }
  42238. return classes.join(" ");
  42239. };
  42240. const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => {
  42241. var _a;
  42242. let headerCellStyles = (_a = parent == null ? void 0 : parent.props.headerCellStyle) != null ? _a : {};
  42243. if (typeof headerCellStyles === "function") {
  42244. headerCellStyles = headerCellStyles.call(null, {
  42245. rowIndex,
  42246. columnIndex,
  42247. row,
  42248. column
  42249. });
  42250. }
  42251. const fixedStyle = getFixedColumnOffset(columnIndex, column.fixed, props.store, row);
  42252. ensurePosition(fixedStyle, "left");
  42253. ensurePosition(fixedStyle, "right");
  42254. return Object.assign({}, headerCellStyles, fixedStyle);
  42255. };
  42256. const getHeaderCellClass = (rowIndex, columnIndex, row, column) => {
  42257. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, column.fixed, props.store, row);
  42258. const classes = [
  42259. column.id,
  42260. column.order,
  42261. column.headerAlign,
  42262. column.className,
  42263. column.labelClassName,
  42264. ...fixedClasses
  42265. ];
  42266. if (!column.children) {
  42267. classes.push("is-leaf");
  42268. }
  42269. if (column.sortable) {
  42270. classes.push("is-sortable");
  42271. }
  42272. const headerCellClassName = parent == null ? void 0 : parent.props.headerCellClassName;
  42273. if (typeof headerCellClassName === "string") {
  42274. classes.push(headerCellClassName);
  42275. } else if (typeof headerCellClassName === "function") {
  42276. classes.push(headerCellClassName.call(null, {
  42277. rowIndex,
  42278. columnIndex,
  42279. row,
  42280. column
  42281. }));
  42282. }
  42283. classes.push(ns.e("cell"));
  42284. return classes.filter((className) => Boolean(className)).join(" ");
  42285. };
  42286. return {
  42287. getHeaderRowStyle,
  42288. getHeaderRowClass,
  42289. getHeaderCellStyle,
  42290. getHeaderCellClass
  42291. };
  42292. }
  42293. const getAllColumns = (columns) => {
  42294. const result = [];
  42295. columns.forEach((column) => {
  42296. if (column.children) {
  42297. result.push(column);
  42298. result.push.apply(result, getAllColumns(column.children));
  42299. } else {
  42300. result.push(column);
  42301. }
  42302. });
  42303. return result;
  42304. };
  42305. const convertToRows = (originColumns) => {
  42306. let maxLevel = 1;
  42307. const traverse = (column, parent) => {
  42308. if (parent) {
  42309. column.level = parent.level + 1;
  42310. if (maxLevel < column.level) {
  42311. maxLevel = column.level;
  42312. }
  42313. }
  42314. if (column.children) {
  42315. let colSpan = 0;
  42316. column.children.forEach((subColumn) => {
  42317. traverse(subColumn, column);
  42318. colSpan += subColumn.colSpan;
  42319. });
  42320. column.colSpan = colSpan;
  42321. } else {
  42322. column.colSpan = 1;
  42323. }
  42324. };
  42325. originColumns.forEach((column) => {
  42326. column.level = 1;
  42327. traverse(column, void 0);
  42328. });
  42329. const rows = [];
  42330. for (let i = 0; i < maxLevel; i++) {
  42331. rows.push([]);
  42332. }
  42333. const allColumns = getAllColumns(originColumns);
  42334. allColumns.forEach((column) => {
  42335. if (!column.children) {
  42336. column.rowSpan = maxLevel - column.level + 1;
  42337. } else {
  42338. column.rowSpan = 1;
  42339. column.children.forEach((col) => col.isSubColumn = true);
  42340. }
  42341. rows[column.level - 1].push(column);
  42342. });
  42343. return rows;
  42344. };
  42345. function useUtils$1(props) {
  42346. const parent = vue.inject(TABLE_INJECTION_KEY);
  42347. const columnRows = vue.computed(() => {
  42348. return convertToRows(props.store.states.originColumns.value);
  42349. });
  42350. const isGroup = vue.computed(() => {
  42351. const result = columnRows.value.length > 1;
  42352. if (result && parent) {
  42353. parent.state.isGroup.value = true;
  42354. }
  42355. return result;
  42356. });
  42357. const toggleAllSelection = (event) => {
  42358. event.stopPropagation();
  42359. parent == null ? void 0 : parent.store.commit("toggleAllSelection");
  42360. };
  42361. return {
  42362. isGroup,
  42363. toggleAllSelection,
  42364. columnRows
  42365. };
  42366. }
  42367. var TableHeader = vue.defineComponent({
  42368. name: "ElTableHeader",
  42369. components: {
  42370. ElCheckbox
  42371. },
  42372. props: {
  42373. fixed: {
  42374. type: String,
  42375. default: ""
  42376. },
  42377. store: {
  42378. required: true,
  42379. type: Object
  42380. },
  42381. border: Boolean,
  42382. defaultSort: {
  42383. type: Object,
  42384. default: () => {
  42385. return {
  42386. prop: "",
  42387. order: ""
  42388. };
  42389. }
  42390. }
  42391. },
  42392. setup(props, { emit }) {
  42393. const instance = vue.getCurrentInstance();
  42394. const parent = vue.inject(TABLE_INJECTION_KEY);
  42395. const ns = useNamespace("table");
  42396. const filterPanels = vue.ref({});
  42397. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  42398. vue.onMounted(async () => {
  42399. await vue.nextTick();
  42400. await vue.nextTick();
  42401. const { prop, order } = props.defaultSort;
  42402. parent == null ? void 0 : parent.store.commit("sort", { prop, order, init: true });
  42403. });
  42404. const {
  42405. handleHeaderClick,
  42406. handleHeaderContextMenu,
  42407. handleMouseDown,
  42408. handleMouseMove,
  42409. handleMouseOut,
  42410. handleSortClick,
  42411. handleFilterClick
  42412. } = useEvent(props, emit);
  42413. const {
  42414. getHeaderRowStyle,
  42415. getHeaderRowClass,
  42416. getHeaderCellStyle,
  42417. getHeaderCellClass
  42418. } = useStyle$2(props);
  42419. const { isGroup, toggleAllSelection, columnRows } = useUtils$1(props);
  42420. instance.state = {
  42421. onColumnsChange,
  42422. onScrollableChange
  42423. };
  42424. instance.filterPanels = filterPanels;
  42425. return {
  42426. ns,
  42427. filterPanels,
  42428. onColumnsChange,
  42429. onScrollableChange,
  42430. columnRows,
  42431. getHeaderRowClass,
  42432. getHeaderRowStyle,
  42433. getHeaderCellClass,
  42434. getHeaderCellStyle,
  42435. handleHeaderClick,
  42436. handleHeaderContextMenu,
  42437. handleMouseDown,
  42438. handleMouseMove,
  42439. handleMouseOut,
  42440. handleSortClick,
  42441. handleFilterClick,
  42442. isGroup,
  42443. toggleAllSelection
  42444. };
  42445. },
  42446. render() {
  42447. const {
  42448. ns,
  42449. isGroup,
  42450. columnRows,
  42451. getHeaderCellStyle,
  42452. getHeaderCellClass,
  42453. getHeaderRowClass,
  42454. getHeaderRowStyle,
  42455. handleHeaderClick,
  42456. handleHeaderContextMenu,
  42457. handleMouseDown,
  42458. handleMouseMove,
  42459. handleSortClick,
  42460. handleMouseOut,
  42461. store,
  42462. $parent
  42463. } = this;
  42464. let rowSpan = 1;
  42465. return vue.h("thead", {
  42466. class: { [ns.is("group")]: isGroup }
  42467. }, columnRows.map((subColumns, rowIndex) => vue.h("tr", {
  42468. class: getHeaderRowClass(rowIndex),
  42469. key: rowIndex,
  42470. style: getHeaderRowStyle(rowIndex)
  42471. }, subColumns.map((column, cellIndex) => {
  42472. if (column.rowSpan > rowSpan) {
  42473. rowSpan = column.rowSpan;
  42474. }
  42475. return vue.h("th", {
  42476. class: getHeaderCellClass(rowIndex, cellIndex, subColumns, column),
  42477. colspan: column.colSpan,
  42478. key: `${column.id}-thead`,
  42479. rowspan: column.rowSpan,
  42480. style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
  42481. onClick: ($event) => handleHeaderClick($event, column),
  42482. onContextmenu: ($event) => handleHeaderContextMenu($event, column),
  42483. onMousedown: ($event) => handleMouseDown($event, column),
  42484. onMousemove: ($event) => handleMouseMove($event, column),
  42485. onMouseout: handleMouseOut
  42486. }, [
  42487. vue.h("div", {
  42488. class: [
  42489. "cell",
  42490. column.filteredValue && column.filteredValue.length > 0 ? "highlight" : ""
  42491. ]
  42492. }, [
  42493. column.renderHeader ? column.renderHeader({
  42494. column,
  42495. $index: cellIndex,
  42496. store,
  42497. _self: $parent
  42498. }) : column.label,
  42499. column.sortable && vue.h("span", {
  42500. onClick: ($event) => handleSortClick($event, column),
  42501. class: "caret-wrapper"
  42502. }, [
  42503. vue.h("i", {
  42504. onClick: ($event) => handleSortClick($event, column, "ascending"),
  42505. class: "sort-caret ascending"
  42506. }),
  42507. vue.h("i", {
  42508. onClick: ($event) => handleSortClick($event, column, "descending"),
  42509. class: "sort-caret descending"
  42510. })
  42511. ]),
  42512. column.filterable && vue.h(FilterPanel, {
  42513. store,
  42514. placement: column.filterPlacement || "bottom-start",
  42515. column,
  42516. upDataColumn: (key, value) => {
  42517. column[key] = value;
  42518. }
  42519. })
  42520. ])
  42521. ]);
  42522. }))));
  42523. }
  42524. });
  42525. function useEvents(props) {
  42526. const parent = vue.inject(TABLE_INJECTION_KEY);
  42527. const tooltipContent = vue.ref("");
  42528. const tooltipTrigger = vue.ref(vue.h("div"));
  42529. const handleEvent = (event, row, name) => {
  42530. var _a;
  42531. const table = parent;
  42532. const cell = getCell(event);
  42533. let column;
  42534. const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix;
  42535. if (cell) {
  42536. column = getColumnByCell({
  42537. columns: props.store.states.columns.value
  42538. }, cell, namespace);
  42539. if (column) {
  42540. table == null ? void 0 : table.emit(`cell-${name}`, row, column, cell, event);
  42541. }
  42542. }
  42543. table == null ? void 0 : table.emit(`row-${name}`, row, column, event);
  42544. };
  42545. const handleDoubleClick = (event, row) => {
  42546. handleEvent(event, row, "dblclick");
  42547. };
  42548. const handleClick = (event, row) => {
  42549. props.store.commit("setCurrentRow", row);
  42550. handleEvent(event, row, "click");
  42551. };
  42552. const handleContextMenu = (event, row) => {
  42553. handleEvent(event, row, "contextmenu");
  42554. };
  42555. const handleMouseEnter = debounce((index) => {
  42556. props.store.commit("setHoverRow", index);
  42557. }, 30);
  42558. const handleMouseLeave = debounce(() => {
  42559. props.store.commit("setHoverRow", null);
  42560. }, 30);
  42561. const handleCellMouseEnter = (event, row, tooltipEffect) => {
  42562. var _a;
  42563. const table = parent;
  42564. const cell = getCell(event);
  42565. const namespace = (_a = table == null ? void 0 : table.vnode.el) == null ? void 0 : _a.dataset.prefix;
  42566. if (cell) {
  42567. const column = getColumnByCell({
  42568. columns: props.store.states.columns.value
  42569. }, cell, namespace);
  42570. const hoverState = table.hoverState = { cell, column, row };
  42571. table == null ? void 0 : table.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, event);
  42572. }
  42573. const cellChild = event.target.querySelector(".cell");
  42574. if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length)) {
  42575. return;
  42576. }
  42577. const range = document.createRange();
  42578. range.setStart(cellChild, 0);
  42579. range.setEnd(cellChild, cellChild.childNodes.length);
  42580. const rangeWidth = Math.round(range.getBoundingClientRect().width);
  42581. const padding = (Number.parseInt(getStyle(cellChild, "paddingLeft"), 10) || 0) + (Number.parseInt(getStyle(cellChild, "paddingRight"), 10) || 0);
  42582. if (rangeWidth + padding > cellChild.offsetWidth || cellChild.scrollWidth > cellChild.offsetWidth) {
  42583. createTablePopper(parent == null ? void 0 : parent.refs.tableWrapper, cell, cell.innerText || cell.textContent, {
  42584. placement: "top",
  42585. strategy: "fixed"
  42586. }, tooltipEffect);
  42587. }
  42588. };
  42589. const handleCellMouseLeave = (event) => {
  42590. const cell = getCell(event);
  42591. if (!cell)
  42592. return;
  42593. const oldHoverState = parent == null ? void 0 : parent.hoverState;
  42594. parent == null ? void 0 : parent.emit("cell-mouse-leave", oldHoverState == null ? void 0 : oldHoverState.row, oldHoverState == null ? void 0 : oldHoverState.column, oldHoverState == null ? void 0 : oldHoverState.cell, event);
  42595. };
  42596. return {
  42597. handleDoubleClick,
  42598. handleClick,
  42599. handleContextMenu,
  42600. handleMouseEnter,
  42601. handleMouseLeave,
  42602. handleCellMouseEnter,
  42603. handleCellMouseLeave,
  42604. tooltipContent,
  42605. tooltipTrigger
  42606. };
  42607. }
  42608. function useStyles$1(props) {
  42609. const parent = vue.inject(TABLE_INJECTION_KEY);
  42610. const ns = useNamespace("table");
  42611. const getRowStyle = (row, rowIndex) => {
  42612. const rowStyle = parent == null ? void 0 : parent.props.rowStyle;
  42613. if (typeof rowStyle === "function") {
  42614. return rowStyle.call(null, {
  42615. row,
  42616. rowIndex
  42617. });
  42618. }
  42619. return rowStyle || null;
  42620. };
  42621. const getRowClass = (row, rowIndex) => {
  42622. const classes = [ns.e("row")];
  42623. if ((parent == null ? void 0 : parent.props.highlightCurrentRow) && row === props.store.states.currentRow.value) {
  42624. classes.push("current-row");
  42625. }
  42626. if (props.stripe && rowIndex % 2 === 1) {
  42627. classes.push(ns.em("row", "striped"));
  42628. }
  42629. const rowClassName = parent == null ? void 0 : parent.props.rowClassName;
  42630. if (typeof rowClassName === "string") {
  42631. classes.push(rowClassName);
  42632. } else if (typeof rowClassName === "function") {
  42633. classes.push(rowClassName.call(null, {
  42634. row,
  42635. rowIndex
  42636. }));
  42637. }
  42638. return classes;
  42639. };
  42640. const getCellStyle = (rowIndex, columnIndex, row, column) => {
  42641. const cellStyle = parent == null ? void 0 : parent.props.cellStyle;
  42642. let cellStyles = cellStyle != null ? cellStyle : {};
  42643. if (typeof cellStyle === "function") {
  42644. cellStyles = cellStyle.call(null, {
  42645. rowIndex,
  42646. columnIndex,
  42647. row,
  42648. column
  42649. });
  42650. }
  42651. const fixedStyle = getFixedColumnOffset(columnIndex, props == null ? void 0 : props.fixed, props.store);
  42652. ensurePosition(fixedStyle, "left");
  42653. ensurePosition(fixedStyle, "right");
  42654. return Object.assign({}, cellStyles, fixedStyle);
  42655. };
  42656. const getCellClass = (rowIndex, columnIndex, row, column, offset) => {
  42657. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, props == null ? void 0 : props.fixed, props.store, void 0, offset);
  42658. const classes = [column.id, column.align, column.className, ...fixedClasses];
  42659. const cellClassName = parent == null ? void 0 : parent.props.cellClassName;
  42660. if (typeof cellClassName === "string") {
  42661. classes.push(cellClassName);
  42662. } else if (typeof cellClassName === "function") {
  42663. classes.push(cellClassName.call(null, {
  42664. rowIndex,
  42665. columnIndex,
  42666. row,
  42667. column
  42668. }));
  42669. }
  42670. classes.push(ns.e("cell"));
  42671. return classes.filter((className) => Boolean(className)).join(" ");
  42672. };
  42673. const getSpan = (row, column, rowIndex, columnIndex) => {
  42674. let rowspan = 1;
  42675. let colspan = 1;
  42676. const fn = parent == null ? void 0 : parent.props.spanMethod;
  42677. if (typeof fn === "function") {
  42678. const result = fn({
  42679. row,
  42680. column,
  42681. rowIndex,
  42682. columnIndex
  42683. });
  42684. if (Array.isArray(result)) {
  42685. rowspan = result[0];
  42686. colspan = result[1];
  42687. } else if (typeof result === "object") {
  42688. rowspan = result.rowspan;
  42689. colspan = result.colspan;
  42690. }
  42691. }
  42692. return { rowspan, colspan };
  42693. };
  42694. const getColspanRealWidth = (columns, colspan, index) => {
  42695. if (colspan < 1) {
  42696. return columns[index].realWidth;
  42697. }
  42698. const widthArr = columns.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan);
  42699. return Number(widthArr.reduce((acc, width) => Number(acc) + Number(width), -1));
  42700. };
  42701. return {
  42702. getRowStyle,
  42703. getRowClass,
  42704. getCellStyle,
  42705. getCellClass,
  42706. getSpan,
  42707. getColspanRealWidth
  42708. };
  42709. }
  42710. function useRender$1(props) {
  42711. const parent = vue.inject(TABLE_INJECTION_KEY);
  42712. const ns = useNamespace("table");
  42713. const {
  42714. handleDoubleClick,
  42715. handleClick,
  42716. handleContextMenu,
  42717. handleMouseEnter,
  42718. handleMouseLeave,
  42719. handleCellMouseEnter,
  42720. handleCellMouseLeave,
  42721. tooltipContent,
  42722. tooltipTrigger
  42723. } = useEvents(props);
  42724. const {
  42725. getRowStyle,
  42726. getRowClass,
  42727. getCellStyle,
  42728. getCellClass,
  42729. getSpan,
  42730. getColspanRealWidth
  42731. } = useStyles$1(props);
  42732. const firstDefaultColumnIndex = vue.computed(() => {
  42733. return props.store.states.columns.value.findIndex(({ type }) => type === "default");
  42734. });
  42735. const getKeyOfRow = (row, index) => {
  42736. const rowKey = parent.props.rowKey;
  42737. if (rowKey) {
  42738. return getRowIdentity(row, rowKey);
  42739. }
  42740. return index;
  42741. };
  42742. const rowRender = (row, $index, treeRowData, expanded = false) => {
  42743. const { tooltipEffect, store } = props;
  42744. const { indent, columns } = store.states;
  42745. const rowClasses = getRowClass(row, $index);
  42746. let display = true;
  42747. if (treeRowData) {
  42748. rowClasses.push(ns.em("row", `level-${treeRowData.level}`));
  42749. display = treeRowData.display;
  42750. }
  42751. const displayStyle = display ? null : {
  42752. display: "none"
  42753. };
  42754. return vue.h("tr", {
  42755. style: [displayStyle, getRowStyle(row, $index)],
  42756. class: rowClasses,
  42757. key: getKeyOfRow(row, $index),
  42758. onDblclick: ($event) => handleDoubleClick($event, row),
  42759. onClick: ($event) => handleClick($event, row),
  42760. onContextmenu: ($event) => handleContextMenu($event, row),
  42761. onMouseenter: () => handleMouseEnter($index),
  42762. onMouseleave: handleMouseLeave
  42763. }, columns.value.map((column, cellIndex) => {
  42764. const { rowspan, colspan } = getSpan(row, column, $index, cellIndex);
  42765. if (!rowspan || !colspan) {
  42766. return null;
  42767. }
  42768. const columnData = { ...column };
  42769. columnData.realWidth = getColspanRealWidth(columns.value, colspan, cellIndex);
  42770. const data = {
  42771. store: props.store,
  42772. _self: props.context || parent,
  42773. column: columnData,
  42774. row,
  42775. $index,
  42776. cellIndex,
  42777. expanded
  42778. };
  42779. if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {
  42780. data.treeNode = {
  42781. indent: treeRowData.level * indent.value,
  42782. level: treeRowData.level
  42783. };
  42784. if (typeof treeRowData.expanded === "boolean") {
  42785. data.treeNode.expanded = treeRowData.expanded;
  42786. if ("loading" in treeRowData) {
  42787. data.treeNode.loading = treeRowData.loading;
  42788. }
  42789. if ("noLazyChildren" in treeRowData) {
  42790. data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  42791. }
  42792. }
  42793. }
  42794. const baseKey = `${$index},${cellIndex}`;
  42795. const patchKey = columnData.columnKey || columnData.rawColumnKey || "";
  42796. const tdChildren = cellChildren(cellIndex, column, data);
  42797. return vue.h("td", {
  42798. style: getCellStyle($index, cellIndex, row, column),
  42799. class: getCellClass($index, cellIndex, row, column, colspan - 1),
  42800. key: `${patchKey}${baseKey}`,
  42801. rowspan,
  42802. colspan,
  42803. onMouseenter: ($event) => handleCellMouseEnter($event, row, tooltipEffect),
  42804. onMouseleave: handleCellMouseLeave
  42805. }, [tdChildren]);
  42806. }));
  42807. };
  42808. const cellChildren = (cellIndex, column, data) => {
  42809. return column.renderCell(data);
  42810. };
  42811. const wrappedRowRender = (row, $index) => {
  42812. const store = props.store;
  42813. const { isRowExpanded, assertRowKey } = store;
  42814. const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } = store.states;
  42815. const columns = store.states.columns.value;
  42816. const hasExpandColumn = columns.some(({ type }) => type === "expand");
  42817. if (hasExpandColumn) {
  42818. const expanded = isRowExpanded(row);
  42819. const tr = rowRender(row, $index, void 0, expanded);
  42820. const renderExpanded = parent.renderExpanded;
  42821. if (expanded) {
  42822. if (!renderExpanded) {
  42823. console.error("[Element Error]renderExpanded is required.");
  42824. return tr;
  42825. }
  42826. return [
  42827. [
  42828. tr,
  42829. vue.h("tr", {
  42830. key: `expanded-row__${tr.key}`
  42831. }, [
  42832. vue.h("td", {
  42833. colspan: columns.length,
  42834. class: `${ns.e("cell")} ${ns.e("expanded-cell")}`
  42835. }, [renderExpanded({ row, $index, store, expanded })])
  42836. ])
  42837. ]
  42838. ];
  42839. } else {
  42840. return [[tr]];
  42841. }
  42842. } else if (Object.keys(treeData.value).length) {
  42843. assertRowKey();
  42844. const key = getRowIdentity(row, rowKey.value);
  42845. let cur = treeData.value[key];
  42846. let treeRowData = null;
  42847. if (cur) {
  42848. treeRowData = {
  42849. expanded: cur.expanded,
  42850. level: cur.level,
  42851. display: true
  42852. };
  42853. if (typeof cur.lazy === "boolean") {
  42854. if (typeof cur.loaded === "boolean" && cur.loaded) {
  42855. treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  42856. }
  42857. treeRowData.loading = cur.loading;
  42858. }
  42859. }
  42860. const tmp = [rowRender(row, $index, treeRowData)];
  42861. if (cur) {
  42862. let i = 0;
  42863. const traverse = (children, parent2) => {
  42864. if (!(children && children.length && parent2))
  42865. return;
  42866. children.forEach((node) => {
  42867. const innerTreeRowData = {
  42868. display: parent2.display && parent2.expanded,
  42869. level: parent2.level + 1,
  42870. expanded: false,
  42871. noLazyChildren: false,
  42872. loading: false
  42873. };
  42874. const childKey = getRowIdentity(node, rowKey.value);
  42875. if (childKey === void 0 || childKey === null) {
  42876. throw new Error("For nested data item, row-key is required.");
  42877. }
  42878. cur = { ...treeData.value[childKey] };
  42879. if (cur) {
  42880. innerTreeRowData.expanded = cur.expanded;
  42881. cur.level = cur.level || innerTreeRowData.level;
  42882. cur.display = !!(cur.expanded && innerTreeRowData.display);
  42883. if (typeof cur.lazy === "boolean") {
  42884. if (typeof cur.loaded === "boolean" && cur.loaded) {
  42885. innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  42886. }
  42887. innerTreeRowData.loading = cur.loading;
  42888. }
  42889. }
  42890. i++;
  42891. tmp.push(rowRender(node, $index + i, innerTreeRowData));
  42892. if (cur) {
  42893. const nodes2 = lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value];
  42894. traverse(nodes2, cur);
  42895. }
  42896. });
  42897. };
  42898. cur.display = true;
  42899. const nodes = lazyTreeNodeMap.value[key] || row[childrenColumnName.value];
  42900. traverse(nodes, cur);
  42901. }
  42902. return tmp;
  42903. } else {
  42904. return rowRender(row, $index, void 0);
  42905. }
  42906. };
  42907. return {
  42908. wrappedRowRender,
  42909. tooltipContent,
  42910. tooltipTrigger
  42911. };
  42912. }
  42913. const defaultProps$2 = {
  42914. store: {
  42915. required: true,
  42916. type: Object
  42917. },
  42918. stripe: Boolean,
  42919. tooltipEffect: String,
  42920. context: {
  42921. default: () => ({}),
  42922. type: Object
  42923. },
  42924. rowClassName: [String, Function],
  42925. rowStyle: [Object, Function],
  42926. fixed: {
  42927. type: String,
  42928. default: ""
  42929. },
  42930. highlight: Boolean
  42931. };
  42932. var defaultProps$3 = defaultProps$2;
  42933. var TableBody = vue.defineComponent({
  42934. name: "ElTableBody",
  42935. props: defaultProps$3,
  42936. setup(props) {
  42937. const instance = vue.getCurrentInstance();
  42938. const parent = vue.inject(TABLE_INJECTION_KEY);
  42939. const ns = useNamespace("table");
  42940. const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender$1(props);
  42941. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  42942. vue.watch(props.store.states.hoverRow, (newVal, oldVal) => {
  42943. if (!props.store.states.isComplex.value || !isClient)
  42944. return;
  42945. let raf = window.requestAnimationFrame;
  42946. if (!raf) {
  42947. raf = (fn) => window.setTimeout(fn, 16);
  42948. }
  42949. raf(() => {
  42950. const el = instance == null ? void 0 : instance.vnode.el;
  42951. const rows = Array.from((el == null ? void 0 : el.children) || []).filter((e) => e == null ? void 0 : e.classList.contains(`${ns.e("row")}`));
  42952. const oldRow = rows[oldVal];
  42953. const newRow = rows[newVal];
  42954. if (oldRow) {
  42955. removeClass(oldRow, "hover-row");
  42956. }
  42957. if (newRow) {
  42958. addClass(newRow, "hover-row");
  42959. }
  42960. });
  42961. });
  42962. vue.onUnmounted(() => {
  42963. var _a;
  42964. (_a = removePopper) == null ? void 0 : _a();
  42965. });
  42966. return {
  42967. ns,
  42968. onColumnsChange,
  42969. onScrollableChange,
  42970. wrappedRowRender,
  42971. tooltipContent,
  42972. tooltipTrigger
  42973. };
  42974. },
  42975. render() {
  42976. const { wrappedRowRender, store } = this;
  42977. const data = store.states.data.value || [];
  42978. return vue.h("tbody", {}, [
  42979. data.reduce((acc, row) => {
  42980. return acc.concat(wrappedRowRender(row, acc.length));
  42981. }, [])
  42982. ]);
  42983. }
  42984. });
  42985. function hColgroup(props) {
  42986. const isAuto = props.tableLayout === "auto";
  42987. let columns = props.columns || [];
  42988. if (isAuto) {
  42989. if (columns.every((column) => column.width === void 0)) {
  42990. columns = [];
  42991. }
  42992. }
  42993. const getPropsData = (column) => {
  42994. const propsData = {
  42995. key: `${props.tableLayout}_${column.id}`,
  42996. style: {},
  42997. name: void 0
  42998. };
  42999. if (isAuto) {
  43000. propsData.style = {
  43001. width: `${column.width}px`
  43002. };
  43003. } else {
  43004. propsData.name = column.id;
  43005. }
  43006. return propsData;
  43007. };
  43008. return vue.h("colgroup", {}, columns.map((column) => vue.h("col", getPropsData(column))));
  43009. }
  43010. hColgroup.props = ["columns", "tableLayout"];
  43011. function useMapState() {
  43012. const table = vue.inject(TABLE_INJECTION_KEY);
  43013. const store = table == null ? void 0 : table.store;
  43014. const leftFixedLeafCount = vue.computed(() => {
  43015. return store.states.fixedLeafColumnsLength.value;
  43016. });
  43017. const rightFixedLeafCount = vue.computed(() => {
  43018. return store.states.rightFixedColumns.value.length;
  43019. });
  43020. const columnsCount = vue.computed(() => {
  43021. return store.states.columns.value.length;
  43022. });
  43023. const leftFixedCount = vue.computed(() => {
  43024. return store.states.fixedColumns.value.length;
  43025. });
  43026. const rightFixedCount = vue.computed(() => {
  43027. return store.states.rightFixedColumns.value.length;
  43028. });
  43029. return {
  43030. leftFixedLeafCount,
  43031. rightFixedLeafCount,
  43032. columnsCount,
  43033. leftFixedCount,
  43034. rightFixedCount,
  43035. columns: store.states.columns
  43036. };
  43037. }
  43038. function useStyle$1(props) {
  43039. const { columns } = useMapState();
  43040. const ns = useNamespace("table");
  43041. const getCellClasses = (columns2, cellIndex) => {
  43042. const column = columns2[cellIndex];
  43043. const classes = [
  43044. ns.e("cell"),
  43045. column.id,
  43046. column.align,
  43047. column.labelClassName,
  43048. ...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props.store)
  43049. ];
  43050. if (column.className) {
  43051. classes.push(column.className);
  43052. }
  43053. if (!column.children) {
  43054. classes.push(ns.is("leaf"));
  43055. }
  43056. return classes;
  43057. };
  43058. const getCellStyles = (column, cellIndex) => {
  43059. const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props.store);
  43060. ensurePosition(fixedStyle, "left");
  43061. ensurePosition(fixedStyle, "right");
  43062. return fixedStyle;
  43063. };
  43064. return {
  43065. getCellClasses,
  43066. getCellStyles,
  43067. columns
  43068. };
  43069. }
  43070. var TableFooter = vue.defineComponent({
  43071. name: "ElTableFooter",
  43072. props: {
  43073. fixed: {
  43074. type: String,
  43075. default: ""
  43076. },
  43077. store: {
  43078. required: true,
  43079. type: Object
  43080. },
  43081. summaryMethod: Function,
  43082. sumText: String,
  43083. border: Boolean,
  43084. defaultSort: {
  43085. type: Object,
  43086. default: () => {
  43087. return {
  43088. prop: "",
  43089. order: ""
  43090. };
  43091. }
  43092. }
  43093. },
  43094. setup(props) {
  43095. const { getCellClasses, getCellStyles, columns } = useStyle$1(props);
  43096. const ns = useNamespace("table");
  43097. return {
  43098. ns,
  43099. getCellClasses,
  43100. getCellStyles,
  43101. columns
  43102. };
  43103. },
  43104. render() {
  43105. const {
  43106. columns,
  43107. getCellStyles,
  43108. getCellClasses,
  43109. summaryMethod,
  43110. sumText,
  43111. ns
  43112. } = this;
  43113. const data = this.store.states.data.value;
  43114. let sums = [];
  43115. if (summaryMethod) {
  43116. sums = summaryMethod({
  43117. columns,
  43118. data
  43119. });
  43120. } else {
  43121. columns.forEach((column, index) => {
  43122. if (index === 0) {
  43123. sums[index] = sumText;
  43124. return;
  43125. }
  43126. const values = data.map((item) => Number(item[column.property]));
  43127. const precisions = [];
  43128. let notNumber = true;
  43129. values.forEach((value) => {
  43130. if (!Number.isNaN(+value)) {
  43131. notNumber = false;
  43132. const decimal = `${value}`.split(".")[1];
  43133. precisions.push(decimal ? decimal.length : 0);
  43134. }
  43135. });
  43136. const precision = Math.max.apply(null, precisions);
  43137. if (!notNumber) {
  43138. sums[index] = values.reduce((prev, curr) => {
  43139. const value = Number(curr);
  43140. if (!Number.isNaN(+value)) {
  43141. return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  43142. } else {
  43143. return prev;
  43144. }
  43145. }, 0);
  43146. } else {
  43147. sums[index] = "";
  43148. }
  43149. });
  43150. }
  43151. return vue.h("table", {
  43152. class: ns.e("footer"),
  43153. cellspacing: "0",
  43154. cellpadding: "0",
  43155. border: "0"
  43156. }, [
  43157. hColgroup({
  43158. columns
  43159. }),
  43160. vue.h("tbody", [
  43161. vue.h("tr", {}, [
  43162. ...columns.map((column, cellIndex) => vue.h("td", {
  43163. key: cellIndex,
  43164. colspan: column.colSpan,
  43165. rowspan: column.rowSpan,
  43166. class: getCellClasses(columns, cellIndex),
  43167. style: getCellStyles(column, cellIndex)
  43168. }, [
  43169. vue.h("div", {
  43170. class: ["cell", column.labelClassName]
  43171. }, [sums[cellIndex]])
  43172. ]))
  43173. ])
  43174. ])
  43175. ]);
  43176. }
  43177. });
  43178. function useUtils(store) {
  43179. const setCurrentRow = (row) => {
  43180. store.commit("setCurrentRow", row);
  43181. };
  43182. const getSelectionRows = () => {
  43183. return store.getSelectionRows();
  43184. };
  43185. const toggleRowSelection = (row, selected) => {
  43186. store.toggleRowSelection(row, selected, false);
  43187. store.updateAllSelected();
  43188. };
  43189. const clearSelection = () => {
  43190. store.clearSelection();
  43191. };
  43192. const clearFilter = (columnKeys) => {
  43193. store.clearFilter(columnKeys);
  43194. };
  43195. const toggleAllSelection = () => {
  43196. store.commit("toggleAllSelection");
  43197. };
  43198. const toggleRowExpansion = (row, expanded) => {
  43199. store.toggleRowExpansionAdapter(row, expanded);
  43200. };
  43201. const clearSort = () => {
  43202. store.clearSort();
  43203. };
  43204. const sort = (prop, order) => {
  43205. store.commit("sort", { prop, order });
  43206. };
  43207. return {
  43208. setCurrentRow,
  43209. getSelectionRows,
  43210. toggleRowSelection,
  43211. clearSelection,
  43212. clearFilter,
  43213. toggleAllSelection,
  43214. toggleRowExpansion,
  43215. clearSort,
  43216. sort
  43217. };
  43218. }
  43219. function useStyle(props, layout, store, table) {
  43220. const isHidden = vue.ref(false);
  43221. const renderExpanded = vue.ref(null);
  43222. const resizeProxyVisible = vue.ref(false);
  43223. const setDragVisible = (visible) => {
  43224. resizeProxyVisible.value = visible;
  43225. };
  43226. const resizeState = vue.ref({
  43227. width: null,
  43228. height: null,
  43229. headerHeight: null
  43230. });
  43231. const isGroup = vue.ref(false);
  43232. const scrollbarViewStyle = {
  43233. display: "inline-block",
  43234. verticalAlign: "middle"
  43235. };
  43236. const tableWidth = vue.ref();
  43237. const tableScrollHeight = vue.ref(0);
  43238. const bodyScrollHeight = vue.ref(0);
  43239. const headerScrollHeight = vue.ref(0);
  43240. const footerScrollHeight = vue.ref(0);
  43241. vue.watchEffect(() => {
  43242. layout.setHeight(props.height);
  43243. });
  43244. vue.watchEffect(() => {
  43245. layout.setMaxHeight(props.maxHeight);
  43246. });
  43247. vue.watch(() => [props.currentRowKey, store.states.rowKey], ([currentRowKey, rowKey]) => {
  43248. if (!vue.unref(rowKey) || !vue.unref(currentRowKey))
  43249. return;
  43250. store.setCurrentRowKey(`${currentRowKey}`);
  43251. }, {
  43252. immediate: true
  43253. });
  43254. vue.watch(() => props.data, (data) => {
  43255. table.store.commit("setData", data);
  43256. }, {
  43257. immediate: true,
  43258. deep: true
  43259. });
  43260. vue.watchEffect(() => {
  43261. if (props.expandRowKeys) {
  43262. store.setExpandRowKeysAdapter(props.expandRowKeys);
  43263. }
  43264. });
  43265. const handleMouseLeave = () => {
  43266. table.store.commit("setHoverRow", null);
  43267. if (table.hoverState)
  43268. table.hoverState = null;
  43269. };
  43270. const handleHeaderFooterMousewheel = (event, data) => {
  43271. const { pixelX, pixelY } = data;
  43272. if (Math.abs(pixelX) >= Math.abs(pixelY)) {
  43273. table.refs.bodyWrapper.scrollLeft += data.pixelX / 5;
  43274. }
  43275. };
  43276. const shouldUpdateHeight = vue.computed(() => {
  43277. return props.height || props.maxHeight || store.states.fixedColumns.value.length > 0 || store.states.rightFixedColumns.value.length > 0;
  43278. });
  43279. const tableBodyStyles = vue.computed(() => {
  43280. return {
  43281. width: layout.bodyWidth.value ? `${layout.bodyWidth.value}px` : ""
  43282. };
  43283. });
  43284. const doLayout = () => {
  43285. if (shouldUpdateHeight.value) {
  43286. layout.updateElsHeight();
  43287. }
  43288. layout.updateColumnsWidth();
  43289. requestAnimationFrame(syncPosition);
  43290. };
  43291. vue.onMounted(async () => {
  43292. await vue.nextTick();
  43293. store.updateColumns();
  43294. bindEvents();
  43295. requestAnimationFrame(doLayout);
  43296. const el = table.vnode.el;
  43297. const tableHeader = table.refs.headerWrapper;
  43298. if (props.flexible && el && el.parentElement) {
  43299. el.parentElement.style.minWidth = "0";
  43300. }
  43301. resizeState.value = {
  43302. width: tableWidth.value = el.offsetWidth,
  43303. height: el.offsetHeight,
  43304. headerHeight: props.showHeader && tableHeader ? tableHeader.offsetHeight : null
  43305. };
  43306. store.states.columns.value.forEach((column) => {
  43307. if (column.filteredValue && column.filteredValue.length) {
  43308. table.store.commit("filterChange", {
  43309. column,
  43310. values: column.filteredValue,
  43311. silent: true
  43312. });
  43313. }
  43314. });
  43315. table.$ready = true;
  43316. });
  43317. const setScrollClassByEl = (el, className) => {
  43318. if (!el)
  43319. return;
  43320. const classList = Array.from(el.classList).filter((item) => !item.startsWith("is-scrolling-"));
  43321. classList.push(layout.scrollX.value ? className : "is-scrolling-none");
  43322. el.className = classList.join(" ");
  43323. };
  43324. const setScrollClass = (className) => {
  43325. const { tableWrapper } = table.refs;
  43326. setScrollClassByEl(tableWrapper, className);
  43327. };
  43328. const hasScrollClass = (className) => {
  43329. const { tableWrapper } = table.refs;
  43330. return !!(tableWrapper && tableWrapper.classList.contains(className));
  43331. };
  43332. const syncPosition = function() {
  43333. if (!table.refs.scrollBarRef)
  43334. return;
  43335. if (!layout.scrollX.value) {
  43336. const scrollingNoneClass = "is-scrolling-none";
  43337. if (!hasScrollClass(scrollingNoneClass)) {
  43338. setScrollClass(scrollingNoneClass);
  43339. }
  43340. return;
  43341. }
  43342. const scrollContainer = table.refs.scrollBarRef.wrapRef;
  43343. if (!scrollContainer)
  43344. return;
  43345. const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
  43346. const { headerWrapper, footerWrapper } = table.refs;
  43347. if (headerWrapper)
  43348. headerWrapper.scrollLeft = scrollLeft;
  43349. if (footerWrapper)
  43350. footerWrapper.scrollLeft = scrollLeft;
  43351. const maxScrollLeftPosition = scrollWidth - offsetWidth - 1;
  43352. if (scrollLeft >= maxScrollLeftPosition) {
  43353. setScrollClass("is-scrolling-right");
  43354. } else if (scrollLeft === 0) {
  43355. setScrollClass("is-scrolling-left");
  43356. } else {
  43357. setScrollClass("is-scrolling-middle");
  43358. }
  43359. };
  43360. const bindEvents = () => {
  43361. if (!table.refs.scrollBarRef)
  43362. return;
  43363. if (table.refs.scrollBarRef.wrapRef) {
  43364. useEventListener(table.refs.scrollBarRef.wrapRef, "scroll", syncPosition, {
  43365. passive: true
  43366. });
  43367. }
  43368. if (props.fit) {
  43369. useResizeObserver(table.vnode.el, resizeListener);
  43370. } else {
  43371. useEventListener(window, "resize", resizeListener);
  43372. }
  43373. useResizeObserver(table.refs.bodyWrapper, () => {
  43374. var _a, _b;
  43375. resizeListener();
  43376. (_b = (_a = table.refs) == null ? void 0 : _a.scrollBarRef) == null ? void 0 : _b.update();
  43377. });
  43378. };
  43379. const resizeListener = () => {
  43380. var _a, _b, _c;
  43381. const el = table.vnode.el;
  43382. if (!table.$ready || !el)
  43383. return;
  43384. let shouldUpdateLayout = false;
  43385. const {
  43386. width: oldWidth,
  43387. height: oldHeight,
  43388. headerHeight: oldHeaderHeight
  43389. } = resizeState.value;
  43390. const width = tableWidth.value = el.offsetWidth;
  43391. if (oldWidth !== width) {
  43392. shouldUpdateLayout = true;
  43393. }
  43394. const height = el.offsetHeight;
  43395. if ((props.height || shouldUpdateHeight.value) && oldHeight !== height) {
  43396. shouldUpdateLayout = true;
  43397. }
  43398. const tableHeader = props.tableLayout === "fixed" ? table.refs.headerWrapper : (_a = table.refs.tableHeaderRef) == null ? void 0 : _a.$el;
  43399. if (props.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) !== oldHeaderHeight) {
  43400. shouldUpdateLayout = true;
  43401. }
  43402. tableScrollHeight.value = ((_b = table.refs.tableWrapper) == null ? void 0 : _b.scrollHeight) || 0;
  43403. headerScrollHeight.value = (tableHeader == null ? void 0 : tableHeader.scrollHeight) || 0;
  43404. footerScrollHeight.value = ((_c = table.refs.footerWrapper) == null ? void 0 : _c.offsetHeight) || 0;
  43405. bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value;
  43406. if (shouldUpdateLayout) {
  43407. resizeState.value = {
  43408. width,
  43409. height,
  43410. headerHeight: props.showHeader && (tableHeader == null ? void 0 : tableHeader.offsetHeight) || 0
  43411. };
  43412. doLayout();
  43413. }
  43414. };
  43415. const tableSize = useSize();
  43416. const bodyWidth = vue.computed(() => {
  43417. const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout;
  43418. return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : "";
  43419. });
  43420. const tableLayout = vue.computed(() => {
  43421. if (props.maxHeight)
  43422. return "fixed";
  43423. return props.tableLayout;
  43424. });
  43425. const emptyBlockStyle = vue.computed(() => {
  43426. if (props.data && props.data.length)
  43427. return null;
  43428. let height = "100%";
  43429. if (props.height && bodyScrollHeight.value) {
  43430. height = `${bodyScrollHeight.value}px`;
  43431. }
  43432. const width = tableWidth.value;
  43433. return {
  43434. width: width ? `${width}px` : "",
  43435. height
  43436. };
  43437. });
  43438. const tableInnerStyle = vue.computed(() => {
  43439. if (props.height) {
  43440. return {
  43441. height: !Number.isNaN(Number(props.height)) ? `${props.height}px` : props.height
  43442. };
  43443. }
  43444. if (props.maxHeight) {
  43445. return {
  43446. maxHeight: !Number.isNaN(Number(props.maxHeight)) ? `${props.maxHeight}px` : props.maxHeight
  43447. };
  43448. }
  43449. return {};
  43450. });
  43451. const scrollbarStyle = vue.computed(() => {
  43452. if (props.height) {
  43453. return {
  43454. height: "100%"
  43455. };
  43456. }
  43457. if (props.maxHeight) {
  43458. if (!Number.isNaN(Number(props.maxHeight))) {
  43459. const maxHeight = props.maxHeight;
  43460. const reachMaxHeight = tableScrollHeight.value >= Number(maxHeight);
  43461. if (reachMaxHeight) {
  43462. return {
  43463. maxHeight: `${tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value}px`
  43464. };
  43465. }
  43466. } else {
  43467. return {
  43468. maxHeight: `calc(${props.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)`
  43469. };
  43470. }
  43471. }
  43472. return {};
  43473. });
  43474. const handleFixedMousewheel = (event, data) => {
  43475. const bodyWrapper = table.refs.bodyWrapper;
  43476. if (Math.abs(data.spinY) > 0) {
  43477. const currentScrollTop = bodyWrapper.scrollTop;
  43478. if (data.pixelY < 0 && currentScrollTop !== 0) {
  43479. event.preventDefault();
  43480. }
  43481. if (data.pixelY > 0 && bodyWrapper.scrollHeight - bodyWrapper.clientHeight > currentScrollTop) {
  43482. event.preventDefault();
  43483. }
  43484. bodyWrapper.scrollTop += Math.ceil(data.pixelY / 5);
  43485. } else {
  43486. bodyWrapper.scrollLeft += Math.ceil(data.pixelX / 5);
  43487. }
  43488. };
  43489. return {
  43490. isHidden,
  43491. renderExpanded,
  43492. setDragVisible,
  43493. isGroup,
  43494. handleMouseLeave,
  43495. handleHeaderFooterMousewheel,
  43496. tableSize,
  43497. emptyBlockStyle,
  43498. handleFixedMousewheel,
  43499. resizeProxyVisible,
  43500. bodyWidth,
  43501. resizeState,
  43502. doLayout,
  43503. tableBodyStyles,
  43504. tableLayout,
  43505. scrollbarViewStyle,
  43506. tableInnerStyle,
  43507. scrollbarStyle
  43508. };
  43509. }
  43510. var defaultProps$1 = {
  43511. data: {
  43512. type: Array,
  43513. default: () => []
  43514. },
  43515. size: String,
  43516. width: [String, Number],
  43517. height: [String, Number],
  43518. maxHeight: [String, Number],
  43519. fit: {
  43520. type: Boolean,
  43521. default: true
  43522. },
  43523. stripe: Boolean,
  43524. border: Boolean,
  43525. rowKey: [String, Function],
  43526. showHeader: {
  43527. type: Boolean,
  43528. default: true
  43529. },
  43530. showSummary: Boolean,
  43531. sumText: String,
  43532. summaryMethod: Function,
  43533. rowClassName: [String, Function],
  43534. rowStyle: [Object, Function],
  43535. cellClassName: [String, Function],
  43536. cellStyle: [Object, Function],
  43537. headerRowClassName: [String, Function],
  43538. headerRowStyle: [Object, Function],
  43539. headerCellClassName: [String, Function],
  43540. headerCellStyle: [Object, Function],
  43541. highlightCurrentRow: Boolean,
  43542. currentRowKey: [String, Number],
  43543. emptyText: String,
  43544. expandRowKeys: Array,
  43545. defaultExpandAll: Boolean,
  43546. defaultSort: Object,
  43547. tooltipEffect: String,
  43548. spanMethod: Function,
  43549. selectOnIndeterminate: {
  43550. type: Boolean,
  43551. default: true
  43552. },
  43553. indent: {
  43554. type: Number,
  43555. default: 16
  43556. },
  43557. treeProps: {
  43558. type: Object,
  43559. default: () => {
  43560. return {
  43561. hasChildren: "hasChildren",
  43562. children: "children"
  43563. };
  43564. }
  43565. },
  43566. lazy: Boolean,
  43567. load: Function,
  43568. style: {
  43569. type: Object,
  43570. default: () => ({})
  43571. },
  43572. className: {
  43573. type: String,
  43574. default: ""
  43575. },
  43576. tableLayout: {
  43577. type: String,
  43578. default: "fixed"
  43579. },
  43580. scrollbarAlwaysOn: {
  43581. type: Boolean,
  43582. default: false
  43583. },
  43584. flexible: Boolean
  43585. };
  43586. const useScrollbar$1 = () => {
  43587. const scrollBarRef = vue.ref();
  43588. const scrollTo = (options, yCoord) => {
  43589. const scrollbar = scrollBarRef.value;
  43590. if (scrollbar) {
  43591. scrollbar.scrollTo(options, yCoord);
  43592. }
  43593. };
  43594. const setScrollPosition = (position, offset) => {
  43595. const scrollbar = scrollBarRef.value;
  43596. if (scrollbar && isNumber(offset) && ["Top", "Left"].includes(position)) {
  43597. scrollbar[`setScroll${position}`](offset);
  43598. }
  43599. };
  43600. const setScrollTop = (top) => setScrollPosition("Top", top);
  43601. const setScrollLeft = (left) => setScrollPosition("Left", left);
  43602. return {
  43603. scrollBarRef,
  43604. scrollTo,
  43605. setScrollTop,
  43606. setScrollLeft
  43607. };
  43608. };
  43609. let tableIdSeed = 1;
  43610. const _sfc_main$p = vue.defineComponent({
  43611. name: "ElTable",
  43612. directives: {
  43613. Mousewheel
  43614. },
  43615. components: {
  43616. TableHeader,
  43617. TableBody,
  43618. TableFooter,
  43619. ElScrollbar,
  43620. hColgroup
  43621. },
  43622. props: defaultProps$1,
  43623. emits: [
  43624. "select",
  43625. "select-all",
  43626. "selection-change",
  43627. "cell-mouse-enter",
  43628. "cell-mouse-leave",
  43629. "cell-contextmenu",
  43630. "cell-click",
  43631. "cell-dblclick",
  43632. "row-click",
  43633. "row-contextmenu",
  43634. "row-dblclick",
  43635. "header-click",
  43636. "header-contextmenu",
  43637. "sort-change",
  43638. "filter-change",
  43639. "current-change",
  43640. "header-dragend",
  43641. "expand-change"
  43642. ],
  43643. setup(props) {
  43644. const { t } = useLocale();
  43645. const ns = useNamespace("table");
  43646. const table = vue.getCurrentInstance();
  43647. vue.provide(TABLE_INJECTION_KEY, table);
  43648. const store = createStore(table, props);
  43649. table.store = store;
  43650. const layout = new TableLayout$1({
  43651. store: table.store,
  43652. table,
  43653. fit: props.fit,
  43654. showHeader: props.showHeader
  43655. });
  43656. table.layout = layout;
  43657. const isEmpty = vue.computed(() => (store.states.data.value || []).length === 0);
  43658. const {
  43659. setCurrentRow,
  43660. getSelectionRows,
  43661. toggleRowSelection,
  43662. clearSelection,
  43663. clearFilter,
  43664. toggleAllSelection,
  43665. toggleRowExpansion,
  43666. clearSort,
  43667. sort
  43668. } = useUtils(store);
  43669. const {
  43670. isHidden,
  43671. renderExpanded,
  43672. setDragVisible,
  43673. isGroup,
  43674. handleMouseLeave,
  43675. handleHeaderFooterMousewheel,
  43676. tableSize,
  43677. emptyBlockStyle,
  43678. handleFixedMousewheel,
  43679. resizeProxyVisible,
  43680. bodyWidth,
  43681. resizeState,
  43682. doLayout,
  43683. tableBodyStyles,
  43684. tableLayout,
  43685. scrollbarViewStyle,
  43686. tableInnerStyle,
  43687. scrollbarStyle
  43688. } = useStyle(props, layout, store, table);
  43689. const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } = useScrollbar$1();
  43690. const debouncedUpdateLayout = debounce(doLayout, 50);
  43691. const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;
  43692. table.tableId = tableId;
  43693. table.state = {
  43694. isGroup,
  43695. resizeState,
  43696. doLayout,
  43697. debouncedUpdateLayout
  43698. };
  43699. const computedSumText = vue.computed(() => props.sumText || t("el.table.sumText"));
  43700. const computedEmptyText = vue.computed(() => {
  43701. return props.emptyText || t("el.table.emptyText");
  43702. });
  43703. return {
  43704. ns,
  43705. layout,
  43706. store,
  43707. handleHeaderFooterMousewheel,
  43708. handleMouseLeave,
  43709. tableId,
  43710. tableSize,
  43711. isHidden,
  43712. isEmpty,
  43713. renderExpanded,
  43714. resizeProxyVisible,
  43715. resizeState,
  43716. isGroup,
  43717. bodyWidth,
  43718. tableBodyStyles,
  43719. emptyBlockStyle,
  43720. debouncedUpdateLayout,
  43721. handleFixedMousewheel,
  43722. setCurrentRow,
  43723. getSelectionRows,
  43724. toggleRowSelection,
  43725. clearSelection,
  43726. clearFilter,
  43727. toggleAllSelection,
  43728. toggleRowExpansion,
  43729. clearSort,
  43730. doLayout,
  43731. sort,
  43732. t,
  43733. setDragVisible,
  43734. context: table,
  43735. computedSumText,
  43736. computedEmptyText,
  43737. tableLayout,
  43738. scrollbarViewStyle,
  43739. tableInnerStyle,
  43740. scrollbarStyle,
  43741. scrollBarRef,
  43742. scrollTo,
  43743. setScrollLeft,
  43744. setScrollTop
  43745. };
  43746. }
  43747. });
  43748. const _hoisted_1$b = ["data-prefix"];
  43749. const _hoisted_2$7 = {
  43750. ref: "hiddenColumns",
  43751. class: "hidden-columns"
  43752. };
  43753. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  43754. const _component_hColgroup = vue.resolveComponent("hColgroup");
  43755. const _component_table_header = vue.resolveComponent("table-header");
  43756. const _component_table_body = vue.resolveComponent("table-body");
  43757. const _component_el_scrollbar = vue.resolveComponent("el-scrollbar");
  43758. const _component_table_footer = vue.resolveComponent("table-footer");
  43759. const _directive_mousewheel = vue.resolveDirective("mousewheel");
  43760. return vue.openBlock(), vue.createElementBlock("div", {
  43761. ref: "tableWrapper",
  43762. class: vue.normalizeClass([
  43763. {
  43764. [_ctx.ns.m("fit")]: _ctx.fit,
  43765. [_ctx.ns.m("striped")]: _ctx.stripe,
  43766. [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
  43767. [_ctx.ns.m("hidden")]: _ctx.isHidden,
  43768. [_ctx.ns.m("group")]: _ctx.isGroup,
  43769. [_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
  43770. [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
  43771. [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
  43772. [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
  43773. [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
  43774. "has-footer": _ctx.showSummary
  43775. },
  43776. _ctx.ns.m(_ctx.tableSize),
  43777. _ctx.className,
  43778. _ctx.ns.b(),
  43779. _ctx.ns.m(`layout-${_ctx.tableLayout}`)
  43780. ]),
  43781. style: vue.normalizeStyle(_ctx.style),
  43782. "data-prefix": _ctx.ns.namespace.value,
  43783. onMouseleave: _cache[0] || (_cache[0] = ($event) => _ctx.handleMouseLeave())
  43784. }, [
  43785. vue.createElementVNode("div", {
  43786. class: vue.normalizeClass(_ctx.ns.e("inner-wrapper")),
  43787. style: vue.normalizeStyle(_ctx.tableInnerStyle)
  43788. }, [
  43789. vue.createElementVNode("div", _hoisted_2$7, [
  43790. vue.renderSlot(_ctx.$slots, "default")
  43791. ], 512),
  43792. _ctx.showHeader && _ctx.tableLayout === "fixed" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  43793. key: 0,
  43794. ref: "headerWrapper",
  43795. class: vue.normalizeClass(_ctx.ns.e("header-wrapper"))
  43796. }, [
  43797. vue.createElementVNode("table", {
  43798. ref: "tableHeader",
  43799. class: vue.normalizeClass(_ctx.ns.e("header")),
  43800. style: vue.normalizeStyle(_ctx.tableBodyStyles),
  43801. border: "0",
  43802. cellpadding: "0",
  43803. cellspacing: "0"
  43804. }, [
  43805. vue.createVNode(_component_hColgroup, {
  43806. columns: _ctx.store.states.columns.value,
  43807. "table-layout": _ctx.tableLayout
  43808. }, null, 8, ["columns", "table-layout"]),
  43809. vue.createVNode(_component_table_header, {
  43810. ref: "tableHeaderRef",
  43811. border: _ctx.border,
  43812. "default-sort": _ctx.defaultSort,
  43813. store: _ctx.store,
  43814. onSetDragVisible: _ctx.setDragVisible
  43815. }, null, 8, ["border", "default-sort", "store", "onSetDragVisible"])
  43816. ], 6)
  43817. ], 2)), [
  43818. [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
  43819. ]) : vue.createCommentVNode("v-if", true),
  43820. vue.createElementVNode("div", {
  43821. ref: "bodyWrapper",
  43822. class: vue.normalizeClass(_ctx.ns.e("body-wrapper"))
  43823. }, [
  43824. vue.createVNode(_component_el_scrollbar, {
  43825. ref: "scrollBarRef",
  43826. "view-style": _ctx.scrollbarViewStyle,
  43827. "wrap-style": _ctx.scrollbarStyle,
  43828. always: _ctx.scrollbarAlwaysOn
  43829. }, {
  43830. default: vue.withCtx(() => [
  43831. vue.createElementVNode("table", {
  43832. ref: "tableBody",
  43833. class: vue.normalizeClass(_ctx.ns.e("body")),
  43834. cellspacing: "0",
  43835. cellpadding: "0",
  43836. border: "0",
  43837. style: vue.normalizeStyle({
  43838. width: _ctx.bodyWidth,
  43839. tableLayout: _ctx.tableLayout
  43840. })
  43841. }, [
  43842. vue.createVNode(_component_hColgroup, {
  43843. columns: _ctx.store.states.columns.value,
  43844. "table-layout": _ctx.tableLayout
  43845. }, null, 8, ["columns", "table-layout"]),
  43846. _ctx.showHeader && _ctx.tableLayout === "auto" ? (vue.openBlock(), vue.createBlock(_component_table_header, {
  43847. key: 0,
  43848. ref: "tableHeaderRef",
  43849. border: _ctx.border,
  43850. "default-sort": _ctx.defaultSort,
  43851. store: _ctx.store,
  43852. onSetDragVisible: _ctx.setDragVisible
  43853. }, null, 8, ["border", "default-sort", "store", "onSetDragVisible"])) : vue.createCommentVNode("v-if", true),
  43854. vue.createVNode(_component_table_body, {
  43855. context: _ctx.context,
  43856. highlight: _ctx.highlightCurrentRow,
  43857. "row-class-name": _ctx.rowClassName,
  43858. "tooltip-effect": _ctx.tooltipEffect,
  43859. "row-style": _ctx.rowStyle,
  43860. store: _ctx.store,
  43861. stripe: _ctx.stripe
  43862. }, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "row-style", "store", "stripe"])
  43863. ], 6),
  43864. _ctx.isEmpty ? (vue.openBlock(), vue.createElementBlock("div", {
  43865. key: 0,
  43866. ref: "emptyBlock",
  43867. style: vue.normalizeStyle(_ctx.emptyBlockStyle),
  43868. class: vue.normalizeClass(_ctx.ns.e("empty-block"))
  43869. }, [
  43870. vue.createElementVNode("span", {
  43871. class: vue.normalizeClass(_ctx.ns.e("empty-text"))
  43872. }, [
  43873. vue.renderSlot(_ctx.$slots, "empty", {}, () => [
  43874. vue.createTextVNode(vue.toDisplayString(_ctx.computedEmptyText), 1)
  43875. ])
  43876. ], 2)
  43877. ], 6)) : vue.createCommentVNode("v-if", true),
  43878. _ctx.$slots.append ? (vue.openBlock(), vue.createElementBlock("div", {
  43879. key: 1,
  43880. ref: "appendWrapper",
  43881. class: vue.normalizeClass(_ctx.ns.e("append-wrapper"))
  43882. }, [
  43883. vue.renderSlot(_ctx.$slots, "append")
  43884. ], 2)) : vue.createCommentVNode("v-if", true)
  43885. ]),
  43886. _: 3
  43887. }, 8, ["view-style", "wrap-style", "always"])
  43888. ], 2),
  43889. _ctx.showSummary ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  43890. key: 1,
  43891. ref: "footerWrapper",
  43892. class: vue.normalizeClass(_ctx.ns.e("footer-wrapper"))
  43893. }, [
  43894. vue.createVNode(_component_table_footer, {
  43895. border: _ctx.border,
  43896. "default-sort": _ctx.defaultSort,
  43897. store: _ctx.store,
  43898. style: vue.normalizeStyle(_ctx.tableBodyStyles),
  43899. "sum-text": _ctx.computedSumText,
  43900. "summary-method": _ctx.summaryMethod
  43901. }, null, 8, ["border", "default-sort", "store", "style", "sum-text", "summary-method"])
  43902. ], 2)), [
  43903. [vue.vShow, !_ctx.isEmpty],
  43904. [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]
  43905. ]) : vue.createCommentVNode("v-if", true),
  43906. _ctx.border || _ctx.isGroup ? (vue.openBlock(), vue.createElementBlock("div", {
  43907. key: 2,
  43908. class: vue.normalizeClass(_ctx.ns.e("border-left-patch"))
  43909. }, null, 2)) : vue.createCommentVNode("v-if", true)
  43910. ], 6),
  43911. vue.withDirectives(vue.createElementVNode("div", {
  43912. ref: "resizeProxy",
  43913. class: vue.normalizeClass(_ctx.ns.e("column-resize-proxy"))
  43914. }, null, 2), [
  43915. [vue.vShow, _ctx.resizeProxyVisible]
  43916. ])
  43917. ], 46, _hoisted_1$b);
  43918. }
  43919. var Table = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["render", _sfc_render$3], ["__file", "table.vue"]]);
  43920. const defaultClassNames = {
  43921. selection: "table-column--selection",
  43922. expand: "table__expand-column"
  43923. };
  43924. const cellStarts = {
  43925. default: {
  43926. order: ""
  43927. },
  43928. selection: {
  43929. width: 48,
  43930. minWidth: 48,
  43931. realWidth: 48,
  43932. order: ""
  43933. },
  43934. expand: {
  43935. width: 48,
  43936. minWidth: 48,
  43937. realWidth: 48,
  43938. order: ""
  43939. },
  43940. index: {
  43941. width: 48,
  43942. minWidth: 48,
  43943. realWidth: 48,
  43944. order: ""
  43945. }
  43946. };
  43947. const getDefaultClassName = (type) => {
  43948. return defaultClassNames[type] || "";
  43949. };
  43950. const cellForced = {
  43951. selection: {
  43952. renderHeader({ store }) {
  43953. function isDisabled() {
  43954. return store.states.data.value && store.states.data.value.length === 0;
  43955. }
  43956. return vue.h(ElCheckbox, {
  43957. disabled: isDisabled(),
  43958. size: store.states.tableSize.value,
  43959. indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value,
  43960. "onUpdate:modelValue": store.toggleAllSelection,
  43961. modelValue: store.states.isAllSelected.value
  43962. });
  43963. },
  43964. renderCell({
  43965. row,
  43966. column,
  43967. store,
  43968. $index
  43969. }) {
  43970. return vue.h(ElCheckbox, {
  43971. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false,
  43972. size: store.states.tableSize.value,
  43973. onChange: () => {
  43974. store.commit("rowSelectedChanged", row);
  43975. },
  43976. onClick: (event) => event.stopPropagation(),
  43977. modelValue: store.isSelected(row)
  43978. });
  43979. },
  43980. sortable: false,
  43981. resizable: false
  43982. },
  43983. index: {
  43984. renderHeader({ column }) {
  43985. return column.label || "#";
  43986. },
  43987. renderCell({
  43988. column,
  43989. $index
  43990. }) {
  43991. let i = $index + 1;
  43992. const index = column.index;
  43993. if (typeof index === "number") {
  43994. i = $index + index;
  43995. } else if (typeof index === "function") {
  43996. i = index($index);
  43997. }
  43998. return vue.h("div", {}, [i]);
  43999. },
  44000. sortable: false
  44001. },
  44002. expand: {
  44003. renderHeader({ column }) {
  44004. return column.label || "";
  44005. },
  44006. renderCell({
  44007. row,
  44008. store,
  44009. expanded
  44010. }) {
  44011. const { ns } = store;
  44012. const classes = [ns.e("expand-icon")];
  44013. if (expanded) {
  44014. classes.push(ns.em("expand-icon", "expanded"));
  44015. }
  44016. const callback = function(e) {
  44017. e.stopPropagation();
  44018. store.toggleRowExpansion(row);
  44019. };
  44020. return vue.h("div", {
  44021. class: classes,
  44022. onClick: callback
  44023. }, {
  44024. default: () => {
  44025. return [
  44026. vue.h(ElIcon, null, {
  44027. default: () => {
  44028. return [vue.h(arrow_right_default)];
  44029. }
  44030. })
  44031. ];
  44032. }
  44033. });
  44034. },
  44035. sortable: false,
  44036. resizable: false
  44037. }
  44038. };
  44039. function defaultRenderCell({
  44040. row,
  44041. column,
  44042. $index
  44043. }) {
  44044. var _a;
  44045. const property = column.property;
  44046. const value = property && getProp(row, property).value;
  44047. if (column && column.formatter) {
  44048. return column.formatter(row, column, value, $index);
  44049. }
  44050. return ((_a = value == null ? void 0 : value.toString) == null ? void 0 : _a.call(value)) || "";
  44051. }
  44052. function treeCellPrefix({
  44053. row,
  44054. treeNode,
  44055. store
  44056. }, createPlacehoder = false) {
  44057. const { ns } = store;
  44058. if (!treeNode) {
  44059. if (createPlacehoder) {
  44060. return [
  44061. vue.h("span", {
  44062. class: ns.e("placeholder")
  44063. })
  44064. ];
  44065. }
  44066. return null;
  44067. }
  44068. const ele = [];
  44069. const callback = function(e) {
  44070. e.stopPropagation();
  44071. if (treeNode.loading) {
  44072. return;
  44073. }
  44074. store.loadOrToggle(row);
  44075. };
  44076. if (treeNode.indent) {
  44077. ele.push(vue.h("span", {
  44078. class: ns.e("indent"),
  44079. style: { "padding-left": `${treeNode.indent}px` }
  44080. }));
  44081. }
  44082. if (typeof treeNode.expanded === "boolean" && !treeNode.noLazyChildren) {
  44083. const expandClasses = [
  44084. ns.e("expand-icon"),
  44085. treeNode.expanded ? ns.em("expand-icon", "expanded") : ""
  44086. ];
  44087. let icon = arrow_right_default;
  44088. if (treeNode.loading) {
  44089. icon = loading_default;
  44090. }
  44091. ele.push(vue.h("div", {
  44092. class: expandClasses,
  44093. onClick: callback
  44094. }, {
  44095. default: () => {
  44096. return [
  44097. vue.h(ElIcon, { class: { [ns.is("loading")]: treeNode.loading } }, {
  44098. default: () => [vue.h(icon)]
  44099. })
  44100. ];
  44101. }
  44102. }));
  44103. } else {
  44104. ele.push(vue.h("span", {
  44105. class: ns.e("placeholder")
  44106. }));
  44107. }
  44108. return ele;
  44109. }
  44110. function getAllAliases(props, aliases) {
  44111. return props.reduce((prev, cur) => {
  44112. prev[cur] = cur;
  44113. return prev;
  44114. }, aliases);
  44115. }
  44116. function useWatcher(owner, props_) {
  44117. const instance = vue.getCurrentInstance();
  44118. const registerComplexWatchers = () => {
  44119. const props = ["fixed"];
  44120. const aliases = {
  44121. realWidth: "width",
  44122. realMinWidth: "minWidth"
  44123. };
  44124. const allAliases = getAllAliases(props, aliases);
  44125. Object.keys(allAliases).forEach((key) => {
  44126. const columnKey = aliases[key];
  44127. if (hasOwn(props_, columnKey)) {
  44128. vue.watch(() => props_[columnKey], (newVal) => {
  44129. let value = newVal;
  44130. if (columnKey === "width" && key === "realWidth") {
  44131. value = parseWidth(newVal);
  44132. }
  44133. if (columnKey === "minWidth" && key === "realMinWidth") {
  44134. value = parseMinWidth(newVal);
  44135. }
  44136. instance.columnConfig.value[columnKey] = value;
  44137. instance.columnConfig.value[key] = value;
  44138. const updateColumns = columnKey === "fixed";
  44139. owner.value.store.scheduleLayout(updateColumns);
  44140. });
  44141. }
  44142. });
  44143. };
  44144. const registerNormalWatchers = () => {
  44145. const props = [
  44146. "label",
  44147. "filters",
  44148. "filterMultiple",
  44149. "sortable",
  44150. "index",
  44151. "formatter",
  44152. "className",
  44153. "labelClassName",
  44154. "showOverflowTooltip"
  44155. ];
  44156. const aliases = {
  44157. property: "prop",
  44158. align: "realAlign",
  44159. headerAlign: "realHeaderAlign"
  44160. };
  44161. const allAliases = getAllAliases(props, aliases);
  44162. Object.keys(allAliases).forEach((key) => {
  44163. const columnKey = aliases[key];
  44164. if (hasOwn(props_, columnKey)) {
  44165. vue.watch(() => props_[columnKey], (newVal) => {
  44166. instance.columnConfig.value[key] = newVal;
  44167. });
  44168. }
  44169. });
  44170. };
  44171. return {
  44172. registerComplexWatchers,
  44173. registerNormalWatchers
  44174. };
  44175. }
  44176. function useRender(props, slots, owner) {
  44177. const instance = vue.getCurrentInstance();
  44178. const columnId = vue.ref("");
  44179. const isSubColumn = vue.ref(false);
  44180. const realAlign = vue.ref();
  44181. const realHeaderAlign = vue.ref();
  44182. const ns = useNamespace("table");
  44183. vue.watchEffect(() => {
  44184. realAlign.value = props.align ? `is-${props.align}` : null;
  44185. realAlign.value;
  44186. });
  44187. vue.watchEffect(() => {
  44188. realHeaderAlign.value = props.headerAlign ? `is-${props.headerAlign}` : realAlign.value;
  44189. realHeaderAlign.value;
  44190. });
  44191. const columnOrTableParent = vue.computed(() => {
  44192. let parent = instance.vnode.vParent || instance.parent;
  44193. while (parent && !parent.tableId && !parent.columnId) {
  44194. parent = parent.vnode.vParent || parent.parent;
  44195. }
  44196. return parent;
  44197. });
  44198. const hasTreeColumn = vue.computed(() => {
  44199. const { store } = instance.parent;
  44200. if (!store)
  44201. return false;
  44202. const { treeData } = store.states;
  44203. const treeDataValue = treeData.value;
  44204. return treeDataValue && Object.keys(treeDataValue).length > 0;
  44205. });
  44206. const realWidth = vue.ref(parseWidth(props.width));
  44207. const realMinWidth = vue.ref(parseMinWidth(props.minWidth));
  44208. const setColumnWidth = (column) => {
  44209. if (realWidth.value)
  44210. column.width = realWidth.value;
  44211. if (realMinWidth.value) {
  44212. column.minWidth = realMinWidth.value;
  44213. }
  44214. if (!realWidth.value && realMinWidth.value) {
  44215. column.width = void 0;
  44216. }
  44217. if (!column.minWidth) {
  44218. column.minWidth = 80;
  44219. }
  44220. column.realWidth = Number(column.width === void 0 ? column.minWidth : column.width);
  44221. return column;
  44222. };
  44223. const setColumnForcedProps = (column) => {
  44224. const type = column.type;
  44225. const source = cellForced[type] || {};
  44226. Object.keys(source).forEach((prop) => {
  44227. const value = source[prop];
  44228. if (prop !== "className" && value !== void 0) {
  44229. column[prop] = value;
  44230. }
  44231. });
  44232. const className = getDefaultClassName(type);
  44233. if (className) {
  44234. const forceClass = `${vue.unref(ns.namespace)}-${className}`;
  44235. column.className = column.className ? `${column.className} ${forceClass}` : forceClass;
  44236. }
  44237. return column;
  44238. };
  44239. const checkSubColumn = (children) => {
  44240. if (Array.isArray(children)) {
  44241. children.forEach((child) => check(child));
  44242. } else {
  44243. check(children);
  44244. }
  44245. function check(item) {
  44246. var _a;
  44247. if (((_a = item == null ? void 0 : item.type) == null ? void 0 : _a.name) === "ElTableColumn") {
  44248. item.vParent = instance;
  44249. }
  44250. }
  44251. };
  44252. const setColumnRenders = (column) => {
  44253. if (props.renderHeader) ; else if (column.type !== "selection") {
  44254. column.renderHeader = (scope) => {
  44255. instance.columnConfig.value["label"];
  44256. const renderHeader = slots.header;
  44257. return renderHeader ? renderHeader(scope) : column.label;
  44258. };
  44259. }
  44260. let originRenderCell = column.renderCell;
  44261. if (column.type === "expand") {
  44262. column.renderCell = (data) => vue.h("div", {
  44263. class: "cell"
  44264. }, [originRenderCell(data)]);
  44265. owner.value.renderExpanded = (data) => {
  44266. return slots.default ? slots.default(data) : slots.default;
  44267. };
  44268. } else {
  44269. originRenderCell = originRenderCell || defaultRenderCell;
  44270. column.renderCell = (data) => {
  44271. let children = null;
  44272. if (slots.default) {
  44273. const vnodes = slots.default(data);
  44274. children = vnodes.some((v) => v.type !== vue.Comment) ? vnodes : originRenderCell(data);
  44275. } else {
  44276. children = originRenderCell(data);
  44277. }
  44278. const shouldCreatePlaceholder = hasTreeColumn.value && data.cellIndex === 0 && data.column.type !== "selection";
  44279. const prefix = treeCellPrefix(data, shouldCreatePlaceholder);
  44280. const props2 = {
  44281. class: "cell",
  44282. style: {}
  44283. };
  44284. if (column.showOverflowTooltip) {
  44285. props2.class = `${props2.class} ${vue.unref(ns.namespace)}-tooltip`;
  44286. props2.style = {
  44287. width: `${(data.column.realWidth || Number(data.column.width)) - 1}px`
  44288. };
  44289. }
  44290. checkSubColumn(children);
  44291. return vue.h("div", props2, [prefix, children]);
  44292. };
  44293. }
  44294. return column;
  44295. };
  44296. const getPropsData = (...propsKey) => {
  44297. return propsKey.reduce((prev, cur) => {
  44298. if (Array.isArray(cur)) {
  44299. cur.forEach((key) => {
  44300. prev[key] = props[key];
  44301. });
  44302. }
  44303. return prev;
  44304. }, {});
  44305. };
  44306. const getColumnElIndex = (children, child) => {
  44307. return Array.prototype.indexOf.call(children, child);
  44308. };
  44309. return {
  44310. columnId,
  44311. realAlign,
  44312. isSubColumn,
  44313. realHeaderAlign,
  44314. columnOrTableParent,
  44315. setColumnWidth,
  44316. setColumnForcedProps,
  44317. setColumnRenders,
  44318. getPropsData,
  44319. getColumnElIndex
  44320. };
  44321. }
  44322. var defaultProps = {
  44323. type: {
  44324. type: String,
  44325. default: "default"
  44326. },
  44327. label: String,
  44328. className: String,
  44329. labelClassName: String,
  44330. property: String,
  44331. prop: String,
  44332. width: {
  44333. type: [String, Number],
  44334. default: ""
  44335. },
  44336. minWidth: {
  44337. type: [String, Number],
  44338. default: ""
  44339. },
  44340. renderHeader: Function,
  44341. sortable: {
  44342. type: [Boolean, String],
  44343. default: false
  44344. },
  44345. sortMethod: Function,
  44346. sortBy: [String, Function, Array],
  44347. resizable: {
  44348. type: Boolean,
  44349. default: true
  44350. },
  44351. columnKey: String,
  44352. align: String,
  44353. headerAlign: String,
  44354. showTooltipWhenOverflow: Boolean,
  44355. showOverflowTooltip: Boolean,
  44356. fixed: [Boolean, String],
  44357. formatter: Function,
  44358. selectable: Function,
  44359. reserveSelection: Boolean,
  44360. filterMethod: Function,
  44361. filteredValue: Array,
  44362. filters: Array,
  44363. filterPlacement: String,
  44364. filterMultiple: {
  44365. type: Boolean,
  44366. default: true
  44367. },
  44368. index: [Number, Function],
  44369. sortOrders: {
  44370. type: Array,
  44371. default: () => {
  44372. return ["ascending", "descending", null];
  44373. },
  44374. validator: (val) => {
  44375. return val.every((order) => ["ascending", "descending", null].includes(order));
  44376. }
  44377. }
  44378. };
  44379. let columnIdSeed = 1;
  44380. var ElTableColumn$1 = vue.defineComponent({
  44381. name: "ElTableColumn",
  44382. components: {
  44383. ElCheckbox
  44384. },
  44385. props: defaultProps,
  44386. setup(props, { slots }) {
  44387. const instance = vue.getCurrentInstance();
  44388. const columnConfig = vue.ref({});
  44389. const owner = vue.computed(() => {
  44390. let parent2 = instance.parent;
  44391. while (parent2 && !parent2.tableId) {
  44392. parent2 = parent2.parent;
  44393. }
  44394. return parent2;
  44395. });
  44396. const { registerNormalWatchers, registerComplexWatchers } = useWatcher(owner, props);
  44397. const {
  44398. columnId,
  44399. isSubColumn,
  44400. realHeaderAlign,
  44401. columnOrTableParent,
  44402. setColumnWidth,
  44403. setColumnForcedProps,
  44404. setColumnRenders,
  44405. getPropsData,
  44406. getColumnElIndex,
  44407. realAlign
  44408. } = useRender(props, slots, owner);
  44409. const parent = columnOrTableParent.value;
  44410. columnId.value = `${parent.tableId || parent.columnId}_column_${columnIdSeed++}`;
  44411. vue.onBeforeMount(() => {
  44412. isSubColumn.value = owner.value !== parent;
  44413. const type = props.type || "default";
  44414. const sortable = props.sortable === "" ? true : props.sortable;
  44415. const defaults = {
  44416. ...cellStarts[type],
  44417. id: columnId.value,
  44418. type,
  44419. property: props.prop || props.property,
  44420. align: realAlign,
  44421. headerAlign: realHeaderAlign,
  44422. showOverflowTooltip: props.showOverflowTooltip || props.showTooltipWhenOverflow,
  44423. filterable: props.filters || props.filterMethod,
  44424. filteredValue: [],
  44425. filterPlacement: "",
  44426. isColumnGroup: false,
  44427. isSubColumn: false,
  44428. filterOpened: false,
  44429. sortable,
  44430. index: props.index,
  44431. rawColumnKey: instance.vnode.key
  44432. };
  44433. const basicProps = [
  44434. "columnKey",
  44435. "label",
  44436. "className",
  44437. "labelClassName",
  44438. "type",
  44439. "renderHeader",
  44440. "formatter",
  44441. "fixed",
  44442. "resizable"
  44443. ];
  44444. const sortProps = ["sortMethod", "sortBy", "sortOrders"];
  44445. const selectProps = ["selectable", "reserveSelection"];
  44446. const filterProps = [
  44447. "filterMethod",
  44448. "filters",
  44449. "filterMultiple",
  44450. "filterOpened",
  44451. "filteredValue",
  44452. "filterPlacement"
  44453. ];
  44454. let column = getPropsData(basicProps, sortProps, selectProps, filterProps);
  44455. column = mergeOptions(defaults, column);
  44456. const chains = compose(setColumnRenders, setColumnWidth, setColumnForcedProps);
  44457. column = chains(column);
  44458. columnConfig.value = column;
  44459. registerNormalWatchers();
  44460. registerComplexWatchers();
  44461. });
  44462. vue.onMounted(() => {
  44463. var _a;
  44464. const parent2 = columnOrTableParent.value;
  44465. const children = isSubColumn.value ? parent2.vnode.el.children : (_a = parent2.refs.hiddenColumns) == null ? void 0 : _a.children;
  44466. const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el);
  44467. columnConfig.value.getColumnIndex = getColumnIndex;
  44468. const columnIndex = getColumnIndex();
  44469. columnIndex > -1 && owner.value.store.commit("insertColumn", columnConfig.value, isSubColumn.value ? parent2.columnConfig.value : null);
  44470. });
  44471. vue.onBeforeUnmount(() => {
  44472. owner.value.store.commit("removeColumn", columnConfig.value, isSubColumn.value ? parent.columnConfig.value : null);
  44473. });
  44474. instance.columnId = columnId.value;
  44475. instance.columnConfig = columnConfig;
  44476. return;
  44477. },
  44478. render() {
  44479. var _a, _b, _c;
  44480. try {
  44481. const renderDefault = (_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a, {
  44482. row: {},
  44483. column: {},
  44484. $index: -1
  44485. });
  44486. const children = [];
  44487. if (Array.isArray(renderDefault)) {
  44488. for (const childNode of renderDefault) {
  44489. if (((_c = childNode.type) == null ? void 0 : _c.name) === "ElTableColumn" || childNode.shapeFlag & 2) {
  44490. children.push(childNode);
  44491. } else if (childNode.type === vue.Fragment && Array.isArray(childNode.children)) {
  44492. childNode.children.forEach((vnode2) => {
  44493. if ((vnode2 == null ? void 0 : vnode2.patchFlag) !== 1024 && !isString(vnode2 == null ? void 0 : vnode2.children)) {
  44494. children.push(vnode2);
  44495. }
  44496. });
  44497. }
  44498. }
  44499. }
  44500. const vnode = vue.h("div", children);
  44501. return vnode;
  44502. } catch (e) {
  44503. return vue.h("div", []);
  44504. }
  44505. }
  44506. });
  44507. const ElTable = withInstall(Table, {
  44508. TableColumn: ElTableColumn$1
  44509. });
  44510. const ElTableColumn = withNoopInstall(ElTableColumn$1);
  44511. var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
  44512. SortOrder2["ASC"] = "asc";
  44513. SortOrder2["DESC"] = "desc";
  44514. return SortOrder2;
  44515. })(SortOrder || {});
  44516. var Alignment = /* @__PURE__ */ ((Alignment2) => {
  44517. Alignment2["CENTER"] = "center";
  44518. Alignment2["RIGHT"] = "right";
  44519. return Alignment2;
  44520. })(Alignment || {});
  44521. var FixedDir = /* @__PURE__ */ ((FixedDir2) => {
  44522. FixedDir2["LEFT"] = "left";
  44523. FixedDir2["RIGHT"] = "right";
  44524. return FixedDir2;
  44525. })(FixedDir || {});
  44526. const oppositeOrderMap = {
  44527. ["asc" /* ASC */]: "desc" /* DESC */,
  44528. ["desc" /* DESC */]: "asc" /* ASC */
  44529. };
  44530. const placeholderSign = Symbol("placeholder");
  44531. const calcColumnStyle = (column, fixedColumn, fixed) => {
  44532. var _a;
  44533. const flex = {
  44534. flexGrow: 0,
  44535. flexShrink: 0,
  44536. ...fixed ? {} : {
  44537. flexGrow: column.flexGrow || 0,
  44538. flexShrink: column.flexShrink || 1
  44539. }
  44540. };
  44541. if (!fixed) {
  44542. flex.flexShrink = 1;
  44543. }
  44544. const style = {
  44545. ...(_a = column.style) != null ? _a : {},
  44546. ...flex,
  44547. flexBasis: "auto",
  44548. width: column.width
  44549. };
  44550. if (!fixedColumn) {
  44551. if (column.maxWidth)
  44552. style.maxWidth = column.maxWidth;
  44553. if (column.minWidth)
  44554. style.minWidth = column.minWidth;
  44555. }
  44556. return style;
  44557. };
  44558. function useColumns(props, columns, fixed) {
  44559. const visibleColumns = vue.computed(() => {
  44560. return vue.unref(columns).filter((column) => !column.hidden);
  44561. });
  44562. const fixedColumnsOnLeft = vue.computed(() => vue.unref(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true));
  44563. const fixedColumnsOnRight = vue.computed(() => vue.unref(visibleColumns).filter((column) => column.fixed === "right"));
  44564. const normalColumns = vue.computed(() => vue.unref(visibleColumns).filter((column) => !column.fixed));
  44565. const mainColumns = vue.computed(() => {
  44566. const ret = [];
  44567. vue.unref(fixedColumnsOnLeft).forEach((column) => {
  44568. ret.push({
  44569. ...column,
  44570. placeholderSign
  44571. });
  44572. });
  44573. vue.unref(normalColumns).forEach((column) => {
  44574. ret.push(column);
  44575. });
  44576. vue.unref(fixedColumnsOnRight).forEach((column) => {
  44577. ret.push({
  44578. ...column,
  44579. placeholderSign
  44580. });
  44581. });
  44582. return ret;
  44583. });
  44584. const hasFixedColumns = vue.computed(() => {
  44585. return vue.unref(fixedColumnsOnLeft).length || vue.unref(fixedColumnsOnRight).length;
  44586. });
  44587. const columnsStyles = vue.computed(() => {
  44588. const _columns = vue.unref(columns);
  44589. return _columns.reduce((style, column) => {
  44590. style[column.key] = calcColumnStyle(column, vue.unref(fixed), props.fixed);
  44591. return style;
  44592. }, {});
  44593. });
  44594. const columnsTotalWidth = vue.computed(() => {
  44595. return vue.unref(visibleColumns).reduce((width, column) => width + column.width, 0);
  44596. });
  44597. const getColumn = (key) => {
  44598. return vue.unref(columns).find((column) => column.key === key);
  44599. };
  44600. const getColumnStyle = (key) => {
  44601. return vue.unref(columnsStyles)[key];
  44602. };
  44603. const updateColumnWidth = (column, width) => {
  44604. column.width = width;
  44605. };
  44606. function onColumnSorted(e) {
  44607. var _a;
  44608. const { key } = e.currentTarget.dataset;
  44609. if (!key)
  44610. return;
  44611. const { sortState, sortBy } = props;
  44612. let order = SortOrder.ASC;
  44613. if (isObject$1(sortState)) {
  44614. order = oppositeOrderMap[sortState[key]];
  44615. } else {
  44616. order = oppositeOrderMap[sortBy.order];
  44617. }
  44618. (_a = props.onColumnSort) == null ? void 0 : _a.call(props, { column: getColumn(key), key, order });
  44619. }
  44620. return {
  44621. columns,
  44622. columnsStyles,
  44623. columnsTotalWidth,
  44624. fixedColumnsOnLeft,
  44625. fixedColumnsOnRight,
  44626. hasFixedColumns,
  44627. mainColumns,
  44628. normalColumns,
  44629. visibleColumns,
  44630. getColumn,
  44631. getColumnStyle,
  44632. updateColumnWidth,
  44633. onColumnSorted
  44634. };
  44635. }
  44636. const useScrollbar = (props, {
  44637. mainTableRef,
  44638. leftTableRef,
  44639. rightTableRef,
  44640. onMaybeEndReached
  44641. }) => {
  44642. const scrollPos = vue.ref({ scrollLeft: 0, scrollTop: 0 });
  44643. function doScroll(params) {
  44644. var _a, _b, _c;
  44645. const { scrollTop } = params;
  44646. (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo(params);
  44647. (_b = leftTableRef.value) == null ? void 0 : _b.scrollToTop(scrollTop);
  44648. (_c = rightTableRef.value) == null ? void 0 : _c.scrollToTop(scrollTop);
  44649. }
  44650. function scrollTo(params) {
  44651. scrollPos.value = params;
  44652. doScroll(params);
  44653. }
  44654. function scrollToTop(scrollTop) {
  44655. scrollPos.value.scrollTop = scrollTop;
  44656. doScroll(vue.unref(scrollPos));
  44657. }
  44658. function scrollToLeft(scrollLeft) {
  44659. var _a, _b;
  44660. scrollPos.value.scrollLeft = scrollLeft;
  44661. (_b = (_a = mainTableRef.value) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, vue.unref(scrollPos));
  44662. }
  44663. function onScroll(params) {
  44664. var _a;
  44665. scrollTo(params);
  44666. (_a = props.onScroll) == null ? void 0 : _a.call(props, params);
  44667. }
  44668. function onVerticalScroll({ scrollTop }) {
  44669. const { scrollTop: currentScrollTop } = vue.unref(scrollPos);
  44670. if (scrollTop !== currentScrollTop)
  44671. scrollToTop(scrollTop);
  44672. }
  44673. function scrollToRow(row, strategy = "auto") {
  44674. var _a;
  44675. (_a = mainTableRef.value) == null ? void 0 : _a.scrollToRow(row, strategy);
  44676. }
  44677. vue.watch(() => vue.unref(scrollPos).scrollTop, (cur, prev) => {
  44678. if (cur > prev)
  44679. onMaybeEndReached();
  44680. });
  44681. return {
  44682. scrollPos,
  44683. scrollTo,
  44684. scrollToLeft,
  44685. scrollToTop,
  44686. scrollToRow,
  44687. onScroll,
  44688. onVerticalScroll
  44689. };
  44690. };
  44691. const useRow = (props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }) => {
  44692. const vm = vue.getCurrentInstance();
  44693. const { emit } = vm;
  44694. const isResetting = vue.shallowRef(false);
  44695. const hoveringRowKey = vue.shallowRef(null);
  44696. const expandedRowKeys = vue.ref(props.defaultExpandedRowKeys || []);
  44697. const lastRenderedRowIndex = vue.ref(-1);
  44698. const resetIndex = vue.shallowRef(null);
  44699. const rowHeights = vue.ref({});
  44700. const pendingRowHeights = vue.ref({});
  44701. const leftTableHeights = vue.shallowRef({});
  44702. const mainTableHeights = vue.shallowRef({});
  44703. const rightTableHeights = vue.shallowRef({});
  44704. const isDynamic = vue.computed(() => isNumber(props.estimatedRowHeight));
  44705. function onRowsRendered(params) {
  44706. var _a;
  44707. (_a = props.onRowsRendered) == null ? void 0 : _a.call(props, params);
  44708. if (params.rowCacheEnd > vue.unref(lastRenderedRowIndex)) {
  44709. lastRenderedRowIndex.value = params.rowCacheEnd;
  44710. }
  44711. }
  44712. function onRowHovered({ hovered, rowKey }) {
  44713. hoveringRowKey.value = hovered ? rowKey : null;
  44714. }
  44715. function onRowExpanded({
  44716. expanded,
  44717. rowData,
  44718. rowIndex,
  44719. rowKey
  44720. }) {
  44721. var _a, _b;
  44722. const _expandedRowKeys = [...vue.unref(expandedRowKeys)];
  44723. const currentKeyIndex = _expandedRowKeys.indexOf(rowKey);
  44724. if (expanded) {
  44725. if (currentKeyIndex === -1)
  44726. _expandedRowKeys.push(rowKey);
  44727. } else {
  44728. if (currentKeyIndex > -1)
  44729. _expandedRowKeys.splice(currentKeyIndex, 1);
  44730. }
  44731. expandedRowKeys.value = _expandedRowKeys;
  44732. emit("update:expandedRowKeys", _expandedRowKeys);
  44733. (_a = props.onRowExpand) == null ? void 0 : _a.call(props, {
  44734. expanded,
  44735. rowData,
  44736. rowIndex,
  44737. rowKey
  44738. });
  44739. (_b = props.onExpandedRowsChange) == null ? void 0 : _b.call(props, _expandedRowKeys);
  44740. }
  44741. const flushingRowHeights = debounce(() => {
  44742. var _a, _b, _c, _d;
  44743. isResetting.value = true;
  44744. rowHeights.value = { ...vue.unref(rowHeights), ...vue.unref(pendingRowHeights) };
  44745. resetAfterIndex(vue.unref(resetIndex), false);
  44746. pendingRowHeights.value = {};
  44747. resetIndex.value = null;
  44748. (_a = mainTableRef.value) == null ? void 0 : _a.forceUpdate();
  44749. (_b = leftTableRef.value) == null ? void 0 : _b.forceUpdate();
  44750. (_c = rightTableRef.value) == null ? void 0 : _c.forceUpdate();
  44751. (_d = vm.proxy) == null ? void 0 : _d.$forceUpdate();
  44752. isResetting.value = false;
  44753. }, 0);
  44754. function resetAfterIndex(index, forceUpdate = false) {
  44755. if (!vue.unref(isDynamic))
  44756. return;
  44757. [mainTableRef, leftTableRef, rightTableRef].forEach((tableRef) => {
  44758. const table = vue.unref(tableRef);
  44759. if (table)
  44760. table.resetAfterRowIndex(index, forceUpdate);
  44761. });
  44762. }
  44763. function resetHeights(rowKey, height, rowIdx) {
  44764. const resetIdx = vue.unref(resetIndex);
  44765. if (resetIdx === null) {
  44766. resetIndex.value = rowIdx;
  44767. } else {
  44768. if (resetIdx > rowIdx) {
  44769. resetIndex.value = rowIdx;
  44770. }
  44771. }
  44772. pendingRowHeights.value[rowKey] = height;
  44773. }
  44774. function onRowHeightChange({ rowKey, height, rowIndex }, fixedDir) {
  44775. if (!fixedDir) {
  44776. mainTableHeights.value[rowKey] = height;
  44777. } else {
  44778. if (fixedDir === FixedDir.RIGHT) {
  44779. rightTableHeights.value[rowKey] = height;
  44780. } else {
  44781. leftTableHeights.value[rowKey] = height;
  44782. }
  44783. }
  44784. const maximumHeight = Math.max(...[leftTableHeights, rightTableHeights, mainTableHeights].map((records) => records.value[rowKey] || 0));
  44785. if (vue.unref(rowHeights)[rowKey] !== maximumHeight) {
  44786. resetHeights(rowKey, maximumHeight, rowIndex);
  44787. flushingRowHeights();
  44788. }
  44789. }
  44790. vue.watch(lastRenderedRowIndex, () => onMaybeEndReached());
  44791. return {
  44792. hoveringRowKey,
  44793. expandedRowKeys,
  44794. lastRenderedRowIndex,
  44795. isDynamic,
  44796. isResetting,
  44797. rowHeights,
  44798. resetAfterIndex,
  44799. onRowExpanded,
  44800. onRowHovered,
  44801. onRowsRendered,
  44802. onRowHeightChange
  44803. };
  44804. };
  44805. const useData = (props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
  44806. const depthMap = vue.ref({});
  44807. const flattenedData = vue.computed(() => {
  44808. const depths = {};
  44809. const { data: data2, rowKey } = props;
  44810. const _expandedRowKeys = vue.unref(expandedRowKeys);
  44811. if (!_expandedRowKeys || !_expandedRowKeys.length)
  44812. return data2;
  44813. const array = [];
  44814. const keysSet = /* @__PURE__ */ new Set();
  44815. _expandedRowKeys.forEach((x) => keysSet.add(x));
  44816. let copy = data2.slice();
  44817. copy.forEach((x) => depths[x[rowKey]] = 0);
  44818. while (copy.length > 0) {
  44819. const item = copy.shift();
  44820. array.push(item);
  44821. if (keysSet.has(item[rowKey]) && Array.isArray(item.children) && item.children.length > 0) {
  44822. copy = [...item.children, ...copy];
  44823. item.children.forEach((child) => depths[child[rowKey]] = depths[item[rowKey]] + 1);
  44824. }
  44825. }
  44826. depthMap.value = depths;
  44827. return array;
  44828. });
  44829. const data = vue.computed(() => {
  44830. const { data: data2, expandColumnKey } = props;
  44831. return expandColumnKey ? vue.unref(flattenedData) : data2;
  44832. });
  44833. vue.watch(data, (val, prev) => {
  44834. if (val !== prev) {
  44835. lastRenderedRowIndex.value = -1;
  44836. resetAfterIndex(0, true);
  44837. }
  44838. });
  44839. return {
  44840. data,
  44841. depthMap
  44842. };
  44843. };
  44844. const sumReducer = (sum2, num) => sum2 + num;
  44845. const sum = (listLike) => {
  44846. return isArray(listLike) ? listLike.reduce(sumReducer, 0) : listLike;
  44847. };
  44848. const tryCall = (fLike, params, defaultRet = {}) => {
  44849. return isFunction(fLike) ? fLike(params) : fLike != null ? fLike : defaultRet;
  44850. };
  44851. const enforceUnit = (style) => {
  44852. ["width", "maxWidth", "minWidth", "height"].forEach((key) => {
  44853. style[key] = addUnit(style[key]);
  44854. });
  44855. return style;
  44856. };
  44857. const componentToSlot = (ComponentLike) => vue.isVNode(ComponentLike) ? (props) => vue.h(ComponentLike, props) : ComponentLike;
  44858. const useStyles = (props, {
  44859. columnsTotalWidth,
  44860. data,
  44861. fixedColumnsOnLeft,
  44862. fixedColumnsOnRight
  44863. }) => {
  44864. const bodyWidth = vue.computed(() => {
  44865. const { fixed, width, vScrollbarSize } = props;
  44866. const ret = width - vScrollbarSize;
  44867. return fixed ? Math.max(Math.round(vue.unref(columnsTotalWidth)), ret) : ret;
  44868. });
  44869. const headerWidth = vue.computed(() => vue.unref(bodyWidth) + (props.fixed ? props.vScrollbarSize : 0));
  44870. const mainTableHeight = vue.computed(() => {
  44871. const { height = 0, maxHeight = 0, footerHeight: footerHeight2, hScrollbarSize } = props;
  44872. if (maxHeight > 0) {
  44873. const _fixedRowsHeight = vue.unref(fixedRowsHeight);
  44874. const _rowsHeight = vue.unref(rowsHeight);
  44875. const _headerHeight = vue.unref(headerHeight);
  44876. const total = _headerHeight + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
  44877. return Math.min(total, maxHeight - footerHeight2);
  44878. }
  44879. return height - footerHeight2;
  44880. });
  44881. const rowsHeight = vue.computed(() => {
  44882. const { rowHeight, estimatedRowHeight } = props;
  44883. const _data = vue.unref(data);
  44884. if (isNumber(estimatedRowHeight)) {
  44885. return _data.length * estimatedRowHeight;
  44886. }
  44887. return _data.length * rowHeight;
  44888. });
  44889. const fixedTableHeight = vue.computed(() => {
  44890. const { maxHeight } = props;
  44891. const tableHeight = vue.unref(mainTableHeight);
  44892. if (isNumber(maxHeight) && maxHeight > 0)
  44893. return tableHeight;
  44894. const totalHeight = vue.unref(rowsHeight) + vue.unref(headerHeight) + vue.unref(fixedRowsHeight);
  44895. return Math.min(tableHeight, totalHeight);
  44896. });
  44897. const mapColumn = (column) => column.width;
  44898. const leftTableWidth = vue.computed(() => sum(vue.unref(fixedColumnsOnLeft).map(mapColumn)));
  44899. const rightTableWidth = vue.computed(() => sum(vue.unref(fixedColumnsOnRight).map(mapColumn)));
  44900. const headerHeight = vue.computed(() => sum(props.headerHeight));
  44901. const fixedRowsHeight = vue.computed(() => {
  44902. var _a;
  44903. return (((_a = props.fixedData) == null ? void 0 : _a.length) || 0) * props.rowHeight;
  44904. });
  44905. const windowHeight = vue.computed(() => {
  44906. return vue.unref(mainTableHeight) - vue.unref(headerHeight) - vue.unref(fixedRowsHeight);
  44907. });
  44908. const rootStyle = vue.computed(() => {
  44909. const { style = {}, height, width } = props;
  44910. return enforceUnit({
  44911. ...style,
  44912. height,
  44913. width
  44914. });
  44915. });
  44916. const footerHeight = vue.computed(() => enforceUnit({ height: props.footerHeight }));
  44917. const emptyStyle = vue.computed(() => ({
  44918. top: addUnit(vue.unref(headerHeight)),
  44919. bottom: addUnit(props.footerHeight),
  44920. width: addUnit(props.width)
  44921. }));
  44922. return {
  44923. bodyWidth,
  44924. fixedTableHeight,
  44925. mainTableHeight,
  44926. leftTableWidth,
  44927. rightTableWidth,
  44928. headerWidth,
  44929. rowsHeight,
  44930. windowHeight,
  44931. footerHeight,
  44932. emptyStyle,
  44933. rootStyle,
  44934. headerHeight
  44935. };
  44936. };
  44937. const useAutoResize = (props) => {
  44938. const sizer = vue.ref();
  44939. const width$ = vue.ref(0);
  44940. const height$ = vue.ref(0);
  44941. let resizerStopper;
  44942. vue.onMounted(() => {
  44943. resizerStopper = useResizeObserver(sizer, ([entry]) => {
  44944. const { width, height } = entry.contentRect;
  44945. const { paddingLeft, paddingRight, paddingTop, paddingBottom } = getComputedStyle(entry.target);
  44946. const left = Number.parseInt(paddingLeft) || 0;
  44947. const right = Number.parseInt(paddingRight) || 0;
  44948. const top = Number.parseInt(paddingTop) || 0;
  44949. const bottom = Number.parseInt(paddingBottom) || 0;
  44950. width$.value = width - left - right;
  44951. height$.value = height - top - bottom;
  44952. }).stop;
  44953. });
  44954. vue.onBeforeUnmount(() => {
  44955. resizerStopper == null ? void 0 : resizerStopper();
  44956. });
  44957. vue.watch([width$, height$], ([width, height]) => {
  44958. var _a;
  44959. (_a = props.onResize) == null ? void 0 : _a.call(props, {
  44960. width,
  44961. height
  44962. });
  44963. });
  44964. return {
  44965. sizer,
  44966. width: width$,
  44967. height: height$
  44968. };
  44969. };
  44970. function useTable(props) {
  44971. const mainTableRef = vue.ref();
  44972. const leftTableRef = vue.ref();
  44973. const rightTableRef = vue.ref();
  44974. const {
  44975. columns,
  44976. columnsStyles,
  44977. columnsTotalWidth,
  44978. fixedColumnsOnLeft,
  44979. fixedColumnsOnRight,
  44980. hasFixedColumns,
  44981. mainColumns,
  44982. onColumnSorted
  44983. } = useColumns(props, vue.toRef(props, "columns"), vue.toRef(props, "fixed"));
  44984. const {
  44985. scrollTo,
  44986. scrollToLeft,
  44987. scrollToTop,
  44988. scrollToRow,
  44989. onScroll,
  44990. onVerticalScroll,
  44991. scrollPos
  44992. } = useScrollbar(props, {
  44993. mainTableRef,
  44994. leftTableRef,
  44995. rightTableRef,
  44996. onMaybeEndReached
  44997. });
  44998. const {
  44999. expandedRowKeys,
  45000. hoveringRowKey,
  45001. lastRenderedRowIndex,
  45002. isDynamic,
  45003. isResetting,
  45004. rowHeights,
  45005. resetAfterIndex,
  45006. onRowExpanded,
  45007. onRowHeightChange,
  45008. onRowHovered,
  45009. onRowsRendered
  45010. } = useRow(props, {
  45011. mainTableRef,
  45012. leftTableRef,
  45013. rightTableRef,
  45014. onMaybeEndReached
  45015. });
  45016. const { data, depthMap } = useData(props, {
  45017. expandedRowKeys,
  45018. lastRenderedRowIndex,
  45019. resetAfterIndex
  45020. });
  45021. const {
  45022. bodyWidth,
  45023. fixedTableHeight,
  45024. mainTableHeight,
  45025. leftTableWidth,
  45026. rightTableWidth,
  45027. headerWidth,
  45028. rowsHeight,
  45029. windowHeight,
  45030. footerHeight,
  45031. emptyStyle,
  45032. rootStyle,
  45033. headerHeight
  45034. } = useStyles(props, {
  45035. columnsTotalWidth,
  45036. data,
  45037. fixedColumnsOnLeft,
  45038. fixedColumnsOnRight
  45039. });
  45040. const isScrolling = vue.shallowRef(false);
  45041. const containerRef = vue.ref();
  45042. const showEmpty = vue.computed(() => {
  45043. const noData = vue.unref(data).length === 0;
  45044. return isArray(props.fixedData) ? props.fixedData.length === 0 && noData : noData;
  45045. });
  45046. function getRowHeight(rowIndex) {
  45047. const { estimatedRowHeight, rowHeight, rowKey } = props;
  45048. if (!estimatedRowHeight)
  45049. return rowHeight;
  45050. return vue.unref(rowHeights)[vue.unref(data)[rowIndex][rowKey]] || estimatedRowHeight;
  45051. }
  45052. function onMaybeEndReached() {
  45053. const { onEndReached } = props;
  45054. if (!onEndReached)
  45055. return;
  45056. const { scrollTop } = vue.unref(scrollPos);
  45057. const _totalHeight = vue.unref(rowsHeight);
  45058. const clientHeight = vue.unref(windowHeight);
  45059. const heightUntilEnd = _totalHeight - (scrollTop + clientHeight) + props.hScrollbarSize;
  45060. if (vue.unref(lastRenderedRowIndex) >= 0 && _totalHeight === scrollTop + vue.unref(mainTableHeight) - vue.unref(headerHeight)) {
  45061. onEndReached(heightUntilEnd);
  45062. }
  45063. }
  45064. vue.watch(() => props.expandedRowKeys, (val) => expandedRowKeys.value = val, {
  45065. deep: true
  45066. });
  45067. return {
  45068. columns,
  45069. containerRef,
  45070. mainTableRef,
  45071. leftTableRef,
  45072. rightTableRef,
  45073. isDynamic,
  45074. isResetting,
  45075. isScrolling,
  45076. hoveringRowKey,
  45077. hasFixedColumns,
  45078. columnsStyles,
  45079. columnsTotalWidth,
  45080. data,
  45081. expandedRowKeys,
  45082. depthMap,
  45083. fixedColumnsOnLeft,
  45084. fixedColumnsOnRight,
  45085. mainColumns,
  45086. bodyWidth,
  45087. emptyStyle,
  45088. rootStyle,
  45089. headerWidth,
  45090. footerHeight,
  45091. mainTableHeight,
  45092. fixedTableHeight,
  45093. leftTableWidth,
  45094. rightTableWidth,
  45095. showEmpty,
  45096. getRowHeight,
  45097. onColumnSorted,
  45098. onRowHovered,
  45099. onRowExpanded,
  45100. onRowsRendered,
  45101. onRowHeightChange,
  45102. scrollTo,
  45103. scrollToLeft,
  45104. scrollToTop,
  45105. scrollToRow,
  45106. onScroll,
  45107. onVerticalScroll
  45108. };
  45109. }
  45110. const TableV2InjectionKey = Symbol("tableV2");
  45111. const classType = String;
  45112. const columns = {
  45113. type: definePropType(Array),
  45114. required: true
  45115. };
  45116. const fixedDataType = {
  45117. type: definePropType(Array)
  45118. };
  45119. const dataType = {
  45120. ...fixedDataType,
  45121. required: true
  45122. };
  45123. const expandColumnKey = String;
  45124. const expandKeys = {
  45125. type: definePropType(Array),
  45126. default: () => mutable([])
  45127. };
  45128. const requiredNumber = {
  45129. type: Number,
  45130. required: true
  45131. };
  45132. const rowKey = {
  45133. type: definePropType([String, Number, Symbol]),
  45134. default: "id"
  45135. };
  45136. const styleType = {
  45137. type: definePropType(Object)
  45138. };
  45139. const tableV2RowProps = buildProps({
  45140. class: String,
  45141. columns,
  45142. columnsStyles: {
  45143. type: definePropType(Object),
  45144. required: true
  45145. },
  45146. depth: Number,
  45147. expandColumnKey,
  45148. estimatedRowHeight: {
  45149. ...virtualizedGridProps.estimatedRowHeight,
  45150. default: void 0
  45151. },
  45152. isScrolling: Boolean,
  45153. onRowExpand: {
  45154. type: definePropType(Function)
  45155. },
  45156. onRowHover: {
  45157. type: definePropType(Function)
  45158. },
  45159. onRowHeightChange: {
  45160. type: definePropType(Function)
  45161. },
  45162. rowData: {
  45163. type: definePropType(Object),
  45164. required: true
  45165. },
  45166. rowEventHandlers: {
  45167. type: definePropType(Object)
  45168. },
  45169. rowIndex: {
  45170. type: Number,
  45171. required: true
  45172. },
  45173. rowKey,
  45174. style: {
  45175. type: definePropType(Object)
  45176. }
  45177. });
  45178. const requiredNumberType = {
  45179. type: Number,
  45180. required: true
  45181. };
  45182. const tableV2HeaderProps = buildProps({
  45183. class: String,
  45184. columns,
  45185. fixedHeaderData: {
  45186. type: definePropType(Array)
  45187. },
  45188. headerData: {
  45189. type: definePropType(Array),
  45190. required: true
  45191. },
  45192. headerHeight: {
  45193. type: definePropType([Number, Array]),
  45194. default: 50
  45195. },
  45196. rowWidth: requiredNumberType,
  45197. rowHeight: {
  45198. type: Number,
  45199. default: 50
  45200. },
  45201. height: requiredNumberType,
  45202. width: requiredNumberType
  45203. });
  45204. const tableV2GridProps = buildProps({
  45205. columns,
  45206. data: dataType,
  45207. fixedData: fixedDataType,
  45208. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  45209. width: requiredNumber,
  45210. height: requiredNumber,
  45211. headerWidth: requiredNumber,
  45212. headerHeight: tableV2HeaderProps.headerHeight,
  45213. bodyWidth: requiredNumber,
  45214. rowHeight: requiredNumber,
  45215. cache: virtualizedListProps.cache,
  45216. useIsScrolling: Boolean,
  45217. scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,
  45218. scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,
  45219. scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,
  45220. class: classType,
  45221. style: styleType,
  45222. containerStyle: styleType,
  45223. getRowHeight: {
  45224. type: definePropType(Function),
  45225. required: true
  45226. },
  45227. rowKey: tableV2RowProps.rowKey,
  45228. onRowsRendered: {
  45229. type: definePropType(Function)
  45230. },
  45231. onScroll: {
  45232. type: definePropType(Function)
  45233. }
  45234. });
  45235. const tableV2Props = buildProps({
  45236. cache: tableV2GridProps.cache,
  45237. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  45238. rowKey,
  45239. headerClass: {
  45240. type: definePropType([
  45241. String,
  45242. Function
  45243. ])
  45244. },
  45245. headerProps: {
  45246. type: definePropType([
  45247. Object,
  45248. Function
  45249. ])
  45250. },
  45251. headerCellProps: {
  45252. type: definePropType([
  45253. Object,
  45254. Function
  45255. ])
  45256. },
  45257. headerHeight: tableV2HeaderProps.headerHeight,
  45258. footerHeight: {
  45259. type: Number,
  45260. default: 0
  45261. },
  45262. rowClass: {
  45263. type: definePropType([String, Function])
  45264. },
  45265. rowProps: {
  45266. type: definePropType([Object, Function])
  45267. },
  45268. rowHeight: {
  45269. type: Number,
  45270. default: 50
  45271. },
  45272. cellProps: {
  45273. type: definePropType([
  45274. Object,
  45275. Function
  45276. ])
  45277. },
  45278. columns,
  45279. data: dataType,
  45280. dataGetter: {
  45281. type: definePropType(Function)
  45282. },
  45283. fixedData: fixedDataType,
  45284. expandColumnKey: tableV2RowProps.expandColumnKey,
  45285. expandedRowKeys: expandKeys,
  45286. defaultExpandedRowKeys: expandKeys,
  45287. class: classType,
  45288. fixed: Boolean,
  45289. style: {
  45290. type: definePropType(Object)
  45291. },
  45292. width: requiredNumber,
  45293. height: requiredNumber,
  45294. maxHeight: Number,
  45295. useIsScrolling: Boolean,
  45296. indentSize: {
  45297. type: Number,
  45298. default: 12
  45299. },
  45300. iconSize: {
  45301. type: Number,
  45302. default: 12
  45303. },
  45304. hScrollbarSize: virtualizedGridProps.hScrollbarSize,
  45305. vScrollbarSize: virtualizedGridProps.vScrollbarSize,
  45306. scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,
  45307. sortBy: {
  45308. type: definePropType(Object),
  45309. default: () => ({})
  45310. },
  45311. sortState: {
  45312. type: definePropType(Object),
  45313. default: void 0
  45314. },
  45315. onColumnSort: {
  45316. type: definePropType(Function)
  45317. },
  45318. onExpandedRowsChange: {
  45319. type: definePropType(Function)
  45320. },
  45321. onEndReached: {
  45322. type: definePropType(Function)
  45323. },
  45324. onRowExpand: tableV2RowProps.onRowExpand,
  45325. onScroll: tableV2GridProps.onScroll,
  45326. onRowsRendered: tableV2GridProps.onRowsRendered,
  45327. rowEventHandlers: tableV2RowProps.rowEventHandlers
  45328. });
  45329. const TableV2Cell = (props, {
  45330. slots
  45331. }) => {
  45332. var _a;
  45333. const {
  45334. cellData,
  45335. style
  45336. } = props;
  45337. const displayText = ((_a = cellData == null ? void 0 : cellData.toString) == null ? void 0 : _a.call(cellData)) || "";
  45338. return vue.createVNode("div", {
  45339. "class": props.class,
  45340. "title": displayText,
  45341. "style": style
  45342. }, [slots.default ? slots.default(props) : displayText]);
  45343. };
  45344. TableV2Cell.displayName = "ElTableV2Cell";
  45345. TableV2Cell.inheritAttrs = false;
  45346. var TableCell = TableV2Cell;
  45347. const HeaderCell = (props, {
  45348. slots
  45349. }) => {
  45350. var _a, _b;
  45351. return slots.default ? slots.default(props) : vue.createVNode("div", {
  45352. "class": props.class,
  45353. "title": (_a = props.column) == null ? void 0 : _a.title
  45354. }, [(_b = props.column) == null ? void 0 : _b.title]);
  45355. };
  45356. HeaderCell.displayName = "ElTableV2HeaderCell";
  45357. HeaderCell.inheritAttrs = false;
  45358. var HeaderCell$1 = HeaderCell;
  45359. const tableV2HeaderRowProps = buildProps({
  45360. class: String,
  45361. columns,
  45362. columnsStyles: {
  45363. type: definePropType(Object),
  45364. required: true
  45365. },
  45366. headerIndex: Number,
  45367. style: { type: definePropType(Object) }
  45368. });
  45369. const TableV2HeaderRow = vue.defineComponent({
  45370. name: "ElTableV2HeaderRow",
  45371. props: tableV2HeaderRowProps,
  45372. setup(props, {
  45373. slots
  45374. }) {
  45375. return () => {
  45376. const {
  45377. columns,
  45378. columnsStyles,
  45379. headerIndex,
  45380. style
  45381. } = props;
  45382. let Cells = columns.map((column, columnIndex) => {
  45383. return slots.cell({
  45384. columns,
  45385. column,
  45386. columnIndex,
  45387. headerIndex,
  45388. style: columnsStyles[column.key]
  45389. });
  45390. });
  45391. if (slots.header) {
  45392. Cells = slots.header({
  45393. cells: Cells.map((node) => {
  45394. if (isArray(node) && node.length === 1) {
  45395. return node[0];
  45396. }
  45397. return node;
  45398. }),
  45399. columns,
  45400. headerIndex
  45401. });
  45402. }
  45403. return vue.createVNode("div", {
  45404. "class": props.class,
  45405. "style": style
  45406. }, [Cells]);
  45407. };
  45408. }
  45409. });
  45410. var HeaderRow = TableV2HeaderRow;
  45411. const COMPONENT_NAME$7 = "ElTableV2Header";
  45412. const TableV2Header = vue.defineComponent({
  45413. name: COMPONENT_NAME$7,
  45414. props: tableV2HeaderProps,
  45415. setup(props, {
  45416. slots,
  45417. expose
  45418. }) {
  45419. const ns = useNamespace("table-v2");
  45420. const headerRef = vue.ref();
  45421. const headerStyle = vue.computed(() => enforceUnit({
  45422. width: props.width,
  45423. height: props.height
  45424. }));
  45425. const rowStyle = vue.computed(() => enforceUnit({
  45426. width: props.rowWidth,
  45427. height: props.height
  45428. }));
  45429. const headerHeights = vue.computed(() => castArray$1(vue.unref(props.headerHeight)));
  45430. const scrollToLeft = (left) => {
  45431. const headerEl = vue.unref(headerRef);
  45432. vue.nextTick(() => {
  45433. (headerEl == null ? void 0 : headerEl.scroll) && headerEl.scroll({
  45434. left
  45435. });
  45436. });
  45437. };
  45438. const renderFixedRows = () => {
  45439. const fixedRowClassName = ns.e("fixed-header-row");
  45440. const {
  45441. columns,
  45442. fixedHeaderData,
  45443. rowHeight
  45444. } = props;
  45445. return fixedHeaderData == null ? void 0 : fixedHeaderData.map((fixedRowData, fixedRowIndex) => {
  45446. var _a;
  45447. const style = enforceUnit({
  45448. height: rowHeight,
  45449. width: "100%"
  45450. });
  45451. return (_a = slots.fixed) == null ? void 0 : _a.call(slots, {
  45452. class: fixedRowClassName,
  45453. columns,
  45454. rowData: fixedRowData,
  45455. rowIndex: -(fixedRowIndex + 1),
  45456. style
  45457. });
  45458. });
  45459. };
  45460. const renderDynamicRows = () => {
  45461. const dynamicRowClassName = ns.e("dynamic-header-row");
  45462. const {
  45463. columns
  45464. } = props;
  45465. return vue.unref(headerHeights).map((rowHeight, rowIndex) => {
  45466. var _a;
  45467. const style = enforceUnit({
  45468. width: "100%",
  45469. height: rowHeight
  45470. });
  45471. return (_a = slots.dynamic) == null ? void 0 : _a.call(slots, {
  45472. class: dynamicRowClassName,
  45473. columns,
  45474. headerIndex: rowIndex,
  45475. style
  45476. });
  45477. });
  45478. };
  45479. expose({
  45480. scrollToLeft
  45481. });
  45482. return () => {
  45483. if (props.height <= 0)
  45484. return;
  45485. return vue.createVNode("div", {
  45486. "ref": headerRef,
  45487. "class": props.class,
  45488. "style": vue.unref(headerStyle)
  45489. }, [vue.createVNode("div", {
  45490. "style": vue.unref(rowStyle),
  45491. "class": ns.e("header")
  45492. }, [renderDynamicRows(), renderFixedRows()])]);
  45493. };
  45494. }
  45495. });
  45496. var Header = TableV2Header;
  45497. const useTableRow = (props) => {
  45498. const {
  45499. isScrolling
  45500. } = vue.inject(TableV2InjectionKey);
  45501. const measured = vue.ref(false);
  45502. const rowRef = vue.ref();
  45503. const measurable = vue.computed(() => {
  45504. return isNumber(props.estimatedRowHeight) && props.rowIndex >= 0;
  45505. });
  45506. const doMeasure = (isInit = false) => {
  45507. const $rowRef = vue.unref(rowRef);
  45508. if (!$rowRef)
  45509. return;
  45510. const {
  45511. columns,
  45512. onRowHeightChange,
  45513. rowKey,
  45514. rowIndex,
  45515. style
  45516. } = props;
  45517. const {
  45518. height
  45519. } = $rowRef.getBoundingClientRect();
  45520. measured.value = true;
  45521. vue.nextTick(() => {
  45522. if (isInit || height !== Number.parseInt(style.height)) {
  45523. const firstColumn = columns[0];
  45524. const isPlaceholder = (firstColumn == null ? void 0 : firstColumn.placeholderSign) === placeholderSign;
  45525. onRowHeightChange == null ? void 0 : onRowHeightChange({
  45526. rowKey,
  45527. height,
  45528. rowIndex
  45529. }, firstColumn && !isPlaceholder && firstColumn.fixed);
  45530. }
  45531. });
  45532. };
  45533. const eventHandlers = vue.computed(() => {
  45534. const {
  45535. rowData,
  45536. rowIndex,
  45537. rowKey,
  45538. onRowHover
  45539. } = props;
  45540. const handlers = props.rowEventHandlers || {};
  45541. const eventHandlers2 = {};
  45542. Object.entries(handlers).forEach(([eventName, handler]) => {
  45543. if (isFunction(handler)) {
  45544. eventHandlers2[eventName] = (event) => {
  45545. handler({
  45546. event,
  45547. rowData,
  45548. rowIndex,
  45549. rowKey
  45550. });
  45551. };
  45552. }
  45553. });
  45554. if (onRowHover) {
  45555. [{
  45556. name: "onMouseleave",
  45557. hovered: false
  45558. }, {
  45559. name: "onMouseenter",
  45560. hovered: true
  45561. }].forEach(({
  45562. name,
  45563. hovered
  45564. }) => {
  45565. const existedHandler = eventHandlers2[name];
  45566. eventHandlers2[name] = (event) => {
  45567. onRowHover({
  45568. event,
  45569. hovered,
  45570. rowData,
  45571. rowIndex,
  45572. rowKey
  45573. });
  45574. existedHandler == null ? void 0 : existedHandler(event);
  45575. };
  45576. });
  45577. }
  45578. return eventHandlers2;
  45579. });
  45580. const onExpand = (expanded) => {
  45581. const {
  45582. onRowExpand,
  45583. rowData,
  45584. rowIndex,
  45585. rowKey
  45586. } = props;
  45587. onRowExpand == null ? void 0 : onRowExpand({
  45588. expanded,
  45589. rowData,
  45590. rowIndex,
  45591. rowKey
  45592. });
  45593. };
  45594. vue.onMounted(() => {
  45595. if (vue.unref(measurable)) {
  45596. doMeasure(true);
  45597. }
  45598. });
  45599. return {
  45600. isScrolling,
  45601. measurable,
  45602. measured,
  45603. rowRef,
  45604. eventHandlers,
  45605. onExpand
  45606. };
  45607. };
  45608. const COMPONENT_NAME$6 = "ElTableV2TableRow";
  45609. const TableV2Row = vue.defineComponent({
  45610. name: COMPONENT_NAME$6,
  45611. props: tableV2RowProps,
  45612. setup(props, {
  45613. expose,
  45614. slots,
  45615. attrs
  45616. }) {
  45617. const {
  45618. eventHandlers,
  45619. isScrolling,
  45620. measurable,
  45621. measured,
  45622. rowRef,
  45623. onExpand
  45624. } = useTableRow(props);
  45625. expose({
  45626. onExpand
  45627. });
  45628. return () => {
  45629. const {
  45630. columns,
  45631. columnsStyles,
  45632. expandColumnKey,
  45633. depth,
  45634. rowData,
  45635. rowIndex,
  45636. style
  45637. } = props;
  45638. let ColumnCells = columns.map((column, columnIndex) => {
  45639. const expandable = isArray(rowData.children) && rowData.children.length > 0 && column.key === expandColumnKey;
  45640. return slots.cell({
  45641. column,
  45642. columns,
  45643. columnIndex,
  45644. depth,
  45645. style: columnsStyles[column.key],
  45646. rowData,
  45647. rowIndex,
  45648. isScrolling: vue.unref(isScrolling),
  45649. expandIconProps: expandable ? {
  45650. rowData,
  45651. rowIndex,
  45652. onExpand
  45653. } : void 0
  45654. });
  45655. });
  45656. if (slots.row) {
  45657. ColumnCells = slots.row({
  45658. cells: ColumnCells.map((node) => {
  45659. if (isArray(node) && node.length === 1) {
  45660. return node[0];
  45661. }
  45662. return node;
  45663. }),
  45664. style,
  45665. columns,
  45666. depth,
  45667. rowData,
  45668. rowIndex,
  45669. isScrolling: vue.unref(isScrolling)
  45670. });
  45671. }
  45672. if (vue.unref(measurable)) {
  45673. const {
  45674. height,
  45675. ...exceptHeightStyle
  45676. } = style || {};
  45677. const _measured = vue.unref(measured);
  45678. return vue.createVNode("div", vue.mergeProps({
  45679. "ref": rowRef,
  45680. "class": props.class,
  45681. "style": _measured ? style : exceptHeightStyle
  45682. }, attrs, vue.unref(eventHandlers)), [ColumnCells]);
  45683. }
  45684. return vue.createVNode("div", vue.mergeProps(attrs, {
  45685. "ref": rowRef,
  45686. "class": props.class,
  45687. "style": style
  45688. }, vue.unref(eventHandlers)), [ColumnCells]);
  45689. };
  45690. }
  45691. });
  45692. var Row = TableV2Row;
  45693. const SortIcon = (props) => {
  45694. const {
  45695. sortOrder
  45696. } = props;
  45697. return vue.createVNode(ElIcon, {
  45698. "size": 14,
  45699. "class": props.class
  45700. }, {
  45701. default: () => [sortOrder === SortOrder.ASC ? vue.createVNode(sort_up_default, null, null) : vue.createVNode(sort_down_default, null, null)]
  45702. });
  45703. };
  45704. var SortIcon$1 = SortIcon;
  45705. const ExpandIcon = (props) => {
  45706. const {
  45707. expanded,
  45708. expandable,
  45709. onExpand,
  45710. style,
  45711. size
  45712. } = props;
  45713. const expandIconProps = {
  45714. onClick: expandable ? () => onExpand(!expanded) : void 0,
  45715. class: props.class
  45716. };
  45717. return vue.createVNode(ElIcon, vue.mergeProps(expandIconProps, {
  45718. "size": size,
  45719. "style": style
  45720. }), {
  45721. default: () => [vue.createVNode(arrow_right_default, null, null)]
  45722. });
  45723. };
  45724. var ExpandIcon$1 = ExpandIcon;
  45725. const COMPONENT_NAME$5 = "ElTableV2Grid";
  45726. const useTableGrid = (props) => {
  45727. const headerRef = vue.ref();
  45728. const bodyRef = vue.ref();
  45729. const totalHeight = vue.computed(() => {
  45730. const {
  45731. data,
  45732. rowHeight,
  45733. estimatedRowHeight
  45734. } = props;
  45735. if (estimatedRowHeight) {
  45736. return;
  45737. }
  45738. return data.length * rowHeight;
  45739. });
  45740. const fixedRowHeight = vue.computed(() => {
  45741. const {
  45742. fixedData,
  45743. rowHeight
  45744. } = props;
  45745. return ((fixedData == null ? void 0 : fixedData.length) || 0) * rowHeight;
  45746. });
  45747. const headerHeight = vue.computed(() => sum(props.headerHeight));
  45748. const gridHeight = vue.computed(() => {
  45749. const {
  45750. height
  45751. } = props;
  45752. return Math.max(0, height - vue.unref(headerHeight) - vue.unref(fixedRowHeight));
  45753. });
  45754. const hasHeader = vue.computed(() => {
  45755. return vue.unref(headerHeight) + vue.unref(fixedRowHeight) > 0;
  45756. });
  45757. const itemKey = ({
  45758. data,
  45759. rowIndex
  45760. }) => data[rowIndex][props.rowKey];
  45761. function onItemRendered({
  45762. rowCacheStart,
  45763. rowCacheEnd,
  45764. rowVisibleStart,
  45765. rowVisibleEnd
  45766. }) {
  45767. var _a;
  45768. (_a = props.onRowsRendered) == null ? void 0 : _a.call(props, {
  45769. rowCacheStart,
  45770. rowCacheEnd,
  45771. rowVisibleStart,
  45772. rowVisibleEnd
  45773. });
  45774. }
  45775. function resetAfterRowIndex(index, forceUpdate2) {
  45776. var _a;
  45777. (_a = bodyRef.value) == null ? void 0 : _a.resetAfterRowIndex(index, forceUpdate2);
  45778. }
  45779. function scrollTo(leftOrOptions, top) {
  45780. const header$ = vue.unref(headerRef);
  45781. const body$ = vue.unref(bodyRef);
  45782. if (!header$ || !body$)
  45783. return;
  45784. if (isObject$1(leftOrOptions)) {
  45785. header$.scrollToLeft(leftOrOptions.scrollLeft);
  45786. body$.scrollTo(leftOrOptions);
  45787. } else {
  45788. header$.scrollToLeft(leftOrOptions);
  45789. body$.scrollTo({
  45790. scrollLeft: leftOrOptions,
  45791. scrollTop: top
  45792. });
  45793. }
  45794. }
  45795. function scrollToTop(scrollTop) {
  45796. var _a;
  45797. (_a = vue.unref(bodyRef)) == null ? void 0 : _a.scrollTo({
  45798. scrollTop
  45799. });
  45800. }
  45801. function scrollToRow(row, strategy) {
  45802. var _a;
  45803. (_a = vue.unref(bodyRef)) == null ? void 0 : _a.scrollToItem(row, 1, strategy);
  45804. }
  45805. function forceUpdate() {
  45806. var _a, _b;
  45807. (_a = vue.unref(bodyRef)) == null ? void 0 : _a.$forceUpdate();
  45808. (_b = vue.unref(headerRef)) == null ? void 0 : _b.$forceUpdate();
  45809. }
  45810. return {
  45811. bodyRef,
  45812. forceUpdate,
  45813. fixedRowHeight,
  45814. gridHeight,
  45815. hasHeader,
  45816. headerHeight,
  45817. headerRef,
  45818. totalHeight,
  45819. itemKey,
  45820. onItemRendered,
  45821. resetAfterRowIndex,
  45822. scrollTo,
  45823. scrollToTop,
  45824. scrollToRow
  45825. };
  45826. };
  45827. const TableGrid = vue.defineComponent({
  45828. name: COMPONENT_NAME$5,
  45829. props: tableV2GridProps,
  45830. setup(props, {
  45831. slots,
  45832. expose
  45833. }) {
  45834. const {
  45835. ns
  45836. } = vue.inject(TableV2InjectionKey);
  45837. const {
  45838. bodyRef,
  45839. fixedRowHeight,
  45840. gridHeight,
  45841. hasHeader,
  45842. headerRef,
  45843. headerHeight,
  45844. totalHeight,
  45845. forceUpdate,
  45846. itemKey,
  45847. onItemRendered,
  45848. resetAfterRowIndex,
  45849. scrollTo,
  45850. scrollToTop,
  45851. scrollToRow
  45852. } = useTableGrid(props);
  45853. expose({
  45854. forceUpdate,
  45855. totalHeight,
  45856. scrollTo,
  45857. scrollToTop,
  45858. scrollToRow,
  45859. resetAfterRowIndex
  45860. });
  45861. const getColumnWidth = () => props.bodyWidth;
  45862. return () => {
  45863. const {
  45864. cache,
  45865. columns,
  45866. data,
  45867. fixedData,
  45868. useIsScrolling,
  45869. scrollbarAlwaysOn,
  45870. scrollbarEndGap,
  45871. scrollbarStartGap,
  45872. style,
  45873. rowHeight,
  45874. bodyWidth,
  45875. estimatedRowHeight,
  45876. headerWidth,
  45877. height,
  45878. width,
  45879. getRowHeight,
  45880. onScroll
  45881. } = props;
  45882. const isDynamicRowEnabled = isNumber(estimatedRowHeight);
  45883. const Grid = isDynamicRowEnabled ? DynamicSizeGrid$1 : FixedSizeGrid$1;
  45884. const _headerHeight = vue.unref(headerHeight);
  45885. return vue.createVNode("div", {
  45886. "role": "table",
  45887. "class": [ns.e("table"), props.class],
  45888. "style": style
  45889. }, [vue.createVNode(Grid, {
  45890. "ref": bodyRef,
  45891. "data": data,
  45892. "useIsScrolling": useIsScrolling,
  45893. "itemKey": itemKey,
  45894. "columnCache": 0,
  45895. "columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth,
  45896. "totalColumn": 1,
  45897. "totalRow": data.length,
  45898. "rowCache": cache,
  45899. "rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight,
  45900. "width": width,
  45901. "height": vue.unref(gridHeight),
  45902. "class": ns.e("body"),
  45903. "scrollbarStartGap": scrollbarStartGap,
  45904. "scrollbarEndGap": scrollbarEndGap,
  45905. "scrollbarAlwaysOn": scrollbarAlwaysOn,
  45906. "onScroll": onScroll,
  45907. "onItemRendered": onItemRendered,
  45908. "perfMode": false
  45909. }, {
  45910. default: (params) => {
  45911. var _a;
  45912. const rowData = data[params.rowIndex];
  45913. return (_a = slots.row) == null ? void 0 : _a.call(slots, {
  45914. ...params,
  45915. columns,
  45916. rowData
  45917. });
  45918. }
  45919. }), vue.unref(hasHeader) && vue.createVNode(Header, {
  45920. "ref": headerRef,
  45921. "class": ns.e("header-wrapper"),
  45922. "columns": columns,
  45923. "headerData": data,
  45924. "headerHeight": props.headerHeight,
  45925. "fixedHeaderData": fixedData,
  45926. "rowWidth": headerWidth,
  45927. "rowHeight": rowHeight,
  45928. "width": width,
  45929. "height": Math.min(_headerHeight + vue.unref(fixedRowHeight), height)
  45930. }, {
  45931. dynamic: slots.header,
  45932. fixed: slots.row
  45933. })]);
  45934. };
  45935. }
  45936. });
  45937. function _isSlot$5(s) {
  45938. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  45939. }
  45940. const MainTable = (props, {
  45941. slots
  45942. }) => {
  45943. const {
  45944. mainTableRef,
  45945. ...rest
  45946. } = props;
  45947. return vue.createVNode(TableGrid, vue.mergeProps({
  45948. "ref": mainTableRef
  45949. }, rest), _isSlot$5(slots) ? slots : {
  45950. default: () => [slots]
  45951. });
  45952. };
  45953. function _isSlot$4(s) {
  45954. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  45955. }
  45956. const LeftTable$1 = (props, {
  45957. slots
  45958. }) => {
  45959. if (!props.columns.length)
  45960. return;
  45961. const {
  45962. leftTableRef,
  45963. ...rest
  45964. } = props;
  45965. return vue.createVNode(TableGrid, vue.mergeProps({
  45966. "ref": leftTableRef
  45967. }, rest), _isSlot$4(slots) ? slots : {
  45968. default: () => [slots]
  45969. });
  45970. };
  45971. function _isSlot$3(s) {
  45972. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  45973. }
  45974. const LeftTable = (props, {
  45975. slots
  45976. }) => {
  45977. if (!props.columns.length)
  45978. return;
  45979. const {
  45980. rightTableRef,
  45981. ...rest
  45982. } = props;
  45983. return vue.createVNode(TableGrid, vue.mergeProps({
  45984. "ref": rightTableRef
  45985. }, rest), _isSlot$3(slots) ? slots : {
  45986. default: () => [slots]
  45987. });
  45988. };
  45989. function _isSlot$2(s) {
  45990. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  45991. }
  45992. const RowRenderer = (props, {
  45993. slots
  45994. }) => {
  45995. const {
  45996. columns,
  45997. columnsStyles,
  45998. depthMap,
  45999. expandColumnKey,
  46000. expandedRowKeys,
  46001. estimatedRowHeight,
  46002. hasFixedColumns,
  46003. hoveringRowKey,
  46004. rowData,
  46005. rowIndex,
  46006. style,
  46007. isScrolling,
  46008. rowProps,
  46009. rowClass,
  46010. rowKey,
  46011. rowEventHandlers,
  46012. ns,
  46013. onRowHovered,
  46014. onRowExpanded
  46015. } = props;
  46016. const rowKls = tryCall(rowClass, {
  46017. columns,
  46018. rowData,
  46019. rowIndex
  46020. }, "");
  46021. const additionalProps = tryCall(rowProps, {
  46022. columns,
  46023. rowData,
  46024. rowIndex
  46025. });
  46026. const _rowKey = rowData[rowKey];
  46027. const depth = depthMap[_rowKey] || 0;
  46028. const canExpand = Boolean(expandColumnKey);
  46029. const isFixedRow = rowIndex < 0;
  46030. const kls = [ns.e("row"), rowKls, {
  46031. [ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0,
  46032. [ns.is("expanded")]: canExpand && expandedRowKeys.includes(_rowKey),
  46033. [ns.is("hovered")]: !isScrolling && _rowKey === hoveringRowKey,
  46034. [ns.is("fixed")]: !depth && isFixedRow,
  46035. [ns.is("customized")]: Boolean(slots.row)
  46036. }];
  46037. const onRowHover = hasFixedColumns ? onRowHovered : void 0;
  46038. const _rowProps = {
  46039. ...additionalProps,
  46040. columns,
  46041. columnsStyles,
  46042. class: kls,
  46043. depth,
  46044. expandColumnKey,
  46045. estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
  46046. isScrolling,
  46047. rowIndex,
  46048. rowData,
  46049. rowKey: _rowKey,
  46050. rowEventHandlers,
  46051. style
  46052. };
  46053. return vue.createVNode(Row, vue.mergeProps(_rowProps, {
  46054. "onRowHover": onRowHover,
  46055. "onRowExpand": onRowExpanded
  46056. }), _isSlot$2(slots) ? slots : {
  46057. default: () => [slots]
  46058. });
  46059. };
  46060. const CellRenderer = ({
  46061. columns,
  46062. column,
  46063. columnIndex,
  46064. depth,
  46065. expandIconProps,
  46066. isScrolling,
  46067. rowData,
  46068. rowIndex,
  46069. style,
  46070. expandedRowKeys,
  46071. ns,
  46072. cellProps: _cellProps,
  46073. expandColumnKey,
  46074. indentSize,
  46075. iconSize,
  46076. rowKey
  46077. }, {
  46078. slots
  46079. }) => {
  46080. const cellStyle = enforceUnit(style);
  46081. if (column.placeholderSign === placeholderSign) {
  46082. return vue.createVNode("div", {
  46083. "class": ns.em("row-cell", "placeholder"),
  46084. "style": cellStyle
  46085. }, null);
  46086. }
  46087. const {
  46088. cellRenderer,
  46089. dataKey,
  46090. dataGetter
  46091. } = column;
  46092. const columnCellRenderer = componentToSlot(cellRenderer);
  46093. const CellComponent = columnCellRenderer || slots.default || ((props) => vue.createVNode(TableCell, props, null));
  46094. const cellData = isFunction(dataGetter) ? dataGetter({
  46095. columns,
  46096. column,
  46097. columnIndex,
  46098. rowData,
  46099. rowIndex
  46100. }) : get(rowData, dataKey != null ? dataKey : "");
  46101. const extraCellProps = tryCall(_cellProps, {
  46102. cellData,
  46103. columns,
  46104. column,
  46105. columnIndex,
  46106. rowIndex,
  46107. rowData
  46108. });
  46109. const cellProps = {
  46110. class: ns.e("cell-text"),
  46111. columns,
  46112. column,
  46113. columnIndex,
  46114. cellData,
  46115. isScrolling,
  46116. rowData,
  46117. rowIndex
  46118. };
  46119. const Cell = CellComponent(cellProps);
  46120. const kls = [ns.e("row-cell"), column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right")];
  46121. const expandable = rowIndex >= 0 && column.key === expandColumnKey;
  46122. const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey]);
  46123. let IconOrPlaceholder;
  46124. const iconStyle = `margin-inline-start: ${depth * indentSize}px;`;
  46125. if (expandable) {
  46126. if (isObject$1(expandIconProps)) {
  46127. IconOrPlaceholder = vue.createVNode(ExpandIcon$1, vue.mergeProps(expandIconProps, {
  46128. "class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
  46129. "size": iconSize,
  46130. "expanded": expanded,
  46131. "style": iconStyle,
  46132. "expandable": true
  46133. }), null);
  46134. } else {
  46135. IconOrPlaceholder = vue.createVNode("div", {
  46136. "style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ")
  46137. }, null);
  46138. }
  46139. }
  46140. return vue.createVNode("div", vue.mergeProps({
  46141. "class": kls,
  46142. "style": cellStyle
  46143. }, extraCellProps), [IconOrPlaceholder, Cell]);
  46144. };
  46145. CellRenderer.inheritAttrs = false;
  46146. function _isSlot$1(s) {
  46147. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  46148. }
  46149. const HeaderRenderer = ({
  46150. columns,
  46151. columnsStyles,
  46152. headerIndex,
  46153. style,
  46154. headerClass,
  46155. headerProps,
  46156. ns
  46157. }, {
  46158. slots
  46159. }) => {
  46160. const param = {
  46161. columns,
  46162. headerIndex
  46163. };
  46164. const kls = [ns.e("header-row"), tryCall(headerClass, param, ""), {
  46165. [ns.is("customized")]: Boolean(slots.header)
  46166. }];
  46167. const extraProps = {
  46168. ...tryCall(headerProps, param),
  46169. columnsStyles,
  46170. class: kls,
  46171. columns,
  46172. headerIndex,
  46173. style
  46174. };
  46175. return vue.createVNode(HeaderRow, extraProps, _isSlot$1(slots) ? slots : {
  46176. default: () => [slots]
  46177. });
  46178. };
  46179. const HeaderCellRenderer = (props, {
  46180. slots
  46181. }) => {
  46182. const {
  46183. column,
  46184. ns,
  46185. style,
  46186. onColumnSorted
  46187. } = props;
  46188. const cellStyle = enforceUnit(style);
  46189. if (column.placeholderSign === placeholderSign) {
  46190. return vue.createVNode("div", {
  46191. "class": ns.em("header-row-cell", "placeholder"),
  46192. "style": cellStyle
  46193. }, null);
  46194. }
  46195. const {
  46196. headerCellRenderer,
  46197. headerClass,
  46198. sortable
  46199. } = column;
  46200. const cellProps = {
  46201. ...props,
  46202. class: ns.e("header-cell-text")
  46203. };
  46204. const cellRenderer = componentToSlot(headerCellRenderer) || slots.default || ((props2) => vue.createVNode(HeaderCell$1, props2, null));
  46205. const Cell = cellRenderer(cellProps);
  46206. const {
  46207. sortBy,
  46208. sortState,
  46209. headerCellProps
  46210. } = props;
  46211. let sorting, sortOrder;
  46212. if (sortState) {
  46213. const order = sortState[column.key];
  46214. sorting = Boolean(oppositeOrderMap[order]);
  46215. sortOrder = sorting ? order : SortOrder.ASC;
  46216. } else {
  46217. sorting = column.key === sortBy.key;
  46218. sortOrder = sorting ? sortBy.order : SortOrder.ASC;
  46219. }
  46220. const cellKls = [ns.e("header-cell"), tryCall(headerClass, props, ""), column.align === Alignment.CENTER && ns.is("align-center"), column.align === Alignment.RIGHT && ns.is("align-right"), sortable && ns.is("sortable")];
  46221. const cellWrapperProps = {
  46222. ...tryCall(headerCellProps, props),
  46223. onClick: column.sortable ? onColumnSorted : void 0,
  46224. class: cellKls,
  46225. style: cellStyle,
  46226. ["data-key"]: column.key
  46227. };
  46228. return vue.createVNode("div", cellWrapperProps, [Cell, sortable && vue.createVNode(SortIcon$1, {
  46229. "class": [ns.e("sort-icon"), sorting && ns.is("sorting")],
  46230. "sortOrder": sortOrder
  46231. }, null)]);
  46232. };
  46233. const Footer$1 = (props, {
  46234. slots
  46235. }) => {
  46236. var _a;
  46237. return vue.createVNode("div", {
  46238. "class": props.class,
  46239. "style": props.style
  46240. }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
  46241. };
  46242. Footer$1.displayName = "ElTableV2Footer";
  46243. const Footer = (props, {
  46244. slots
  46245. }) => {
  46246. return vue.createVNode("div", {
  46247. "class": props.class,
  46248. "style": props.style
  46249. }, [slots.default ? slots.default() : vue.createVNode(ElEmpty, null, null)]);
  46250. };
  46251. Footer.displayName = "ElTableV2Empty";
  46252. const Overlay = (props, {
  46253. slots
  46254. }) => {
  46255. var _a;
  46256. return vue.createVNode("div", {
  46257. "class": props.class,
  46258. "style": props.style
  46259. }, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
  46260. };
  46261. Overlay.displayName = "ElTableV2Overlay";
  46262. function _isSlot(s) {
  46263. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
  46264. }
  46265. const COMPONENT_NAME$4 = "ElTableV2";
  46266. const TableV2 = vue.defineComponent({
  46267. name: COMPONENT_NAME$4,
  46268. props: tableV2Props,
  46269. setup(props, {
  46270. slots,
  46271. expose
  46272. }) {
  46273. const ns = useNamespace("table-v2");
  46274. const {
  46275. columnsStyles,
  46276. fixedColumnsOnLeft,
  46277. fixedColumnsOnRight,
  46278. mainColumns,
  46279. mainTableHeight,
  46280. fixedTableHeight,
  46281. leftTableWidth,
  46282. rightTableWidth,
  46283. data,
  46284. depthMap,
  46285. expandedRowKeys,
  46286. hasFixedColumns,
  46287. hoveringRowKey,
  46288. mainTableRef,
  46289. leftTableRef,
  46290. rightTableRef,
  46291. isDynamic,
  46292. isResetting,
  46293. isScrolling,
  46294. bodyWidth,
  46295. emptyStyle,
  46296. rootStyle,
  46297. headerWidth,
  46298. footerHeight,
  46299. showEmpty,
  46300. scrollTo,
  46301. scrollToLeft,
  46302. scrollToTop,
  46303. scrollToRow,
  46304. getRowHeight,
  46305. onColumnSorted,
  46306. onRowHeightChange,
  46307. onRowHovered,
  46308. onRowExpanded,
  46309. onRowsRendered,
  46310. onScroll,
  46311. onVerticalScroll
  46312. } = useTable(props);
  46313. expose({
  46314. scrollTo,
  46315. scrollToLeft,
  46316. scrollToTop,
  46317. scrollToRow
  46318. });
  46319. vue.provide(TableV2InjectionKey, {
  46320. ns,
  46321. isResetting,
  46322. hoveringRowKey,
  46323. isScrolling
  46324. });
  46325. return () => {
  46326. const {
  46327. cache,
  46328. cellProps,
  46329. estimatedRowHeight,
  46330. expandColumnKey,
  46331. fixedData,
  46332. headerHeight,
  46333. headerClass,
  46334. headerProps,
  46335. headerCellProps,
  46336. sortBy,
  46337. sortState,
  46338. rowHeight,
  46339. rowClass,
  46340. rowEventHandlers,
  46341. rowKey,
  46342. rowProps,
  46343. scrollbarAlwaysOn,
  46344. indentSize,
  46345. iconSize,
  46346. useIsScrolling,
  46347. vScrollbarSize,
  46348. width
  46349. } = props;
  46350. const _data = vue.unref(data);
  46351. const mainTableProps = {
  46352. cache,
  46353. class: ns.e("main"),
  46354. columns: vue.unref(mainColumns),
  46355. data: _data,
  46356. fixedData,
  46357. estimatedRowHeight,
  46358. bodyWidth: vue.unref(bodyWidth),
  46359. headerHeight,
  46360. headerWidth: vue.unref(headerWidth),
  46361. height: vue.unref(mainTableHeight),
  46362. mainTableRef,
  46363. rowKey,
  46364. rowHeight,
  46365. scrollbarAlwaysOn,
  46366. scrollbarStartGap: 2,
  46367. scrollbarEndGap: vScrollbarSize,
  46368. useIsScrolling,
  46369. width,
  46370. getRowHeight,
  46371. onRowsRendered,
  46372. onScroll
  46373. };
  46374. const leftColumnsWidth = vue.unref(leftTableWidth);
  46375. const _fixedTableHeight = vue.unref(fixedTableHeight);
  46376. const leftTableProps = {
  46377. cache,
  46378. class: ns.e("left"),
  46379. columns: vue.unref(fixedColumnsOnLeft),
  46380. data: _data,
  46381. estimatedRowHeight,
  46382. leftTableRef,
  46383. rowHeight,
  46384. bodyWidth: leftColumnsWidth,
  46385. headerWidth: leftColumnsWidth,
  46386. headerHeight,
  46387. height: _fixedTableHeight,
  46388. rowKey,
  46389. scrollbarAlwaysOn,
  46390. scrollbarStartGap: 2,
  46391. scrollbarEndGap: vScrollbarSize,
  46392. useIsScrolling,
  46393. width: leftColumnsWidth,
  46394. getRowHeight,
  46395. onScroll: onVerticalScroll
  46396. };
  46397. const rightColumnsWidth = vue.unref(rightTableWidth);
  46398. const rightColumnsWidthWithScrollbar = rightColumnsWidth + vScrollbarSize;
  46399. const rightTableProps = {
  46400. cache,
  46401. class: ns.e("right"),
  46402. columns: vue.unref(fixedColumnsOnRight),
  46403. data: _data,
  46404. estimatedRowHeight,
  46405. rightTableRef,
  46406. rowHeight,
  46407. bodyWidth: rightColumnsWidthWithScrollbar,
  46408. headerWidth: rightColumnsWidthWithScrollbar,
  46409. headerHeight,
  46410. height: _fixedTableHeight,
  46411. rowKey,
  46412. scrollbarAlwaysOn,
  46413. scrollbarStartGap: 2,
  46414. scrollbarEndGap: vScrollbarSize,
  46415. width: rightColumnsWidthWithScrollbar,
  46416. style: `--${vue.unref(ns.namespace)}-table-scrollbar-size: ${vScrollbarSize}px`,
  46417. useIsScrolling,
  46418. getRowHeight,
  46419. onScroll: onVerticalScroll
  46420. };
  46421. const _columnsStyles = vue.unref(columnsStyles);
  46422. const tableRowProps = {
  46423. ns,
  46424. depthMap: vue.unref(depthMap),
  46425. columnsStyles: _columnsStyles,
  46426. expandColumnKey,
  46427. expandedRowKeys: vue.unref(expandedRowKeys),
  46428. estimatedRowHeight,
  46429. hasFixedColumns: vue.unref(hasFixedColumns),
  46430. hoveringRowKey: vue.unref(hoveringRowKey),
  46431. rowProps,
  46432. rowClass,
  46433. rowKey,
  46434. rowEventHandlers,
  46435. onRowHovered,
  46436. onRowExpanded,
  46437. onRowHeightChange
  46438. };
  46439. const tableCellProps = {
  46440. cellProps,
  46441. expandColumnKey,
  46442. indentSize,
  46443. iconSize,
  46444. rowKey,
  46445. expandedRowKeys: vue.unref(expandedRowKeys),
  46446. ns
  46447. };
  46448. const tableHeaderProps = {
  46449. ns,
  46450. headerClass,
  46451. headerProps,
  46452. columnsStyles: _columnsStyles
  46453. };
  46454. const tableHeaderCellProps = {
  46455. ns,
  46456. sortBy,
  46457. sortState,
  46458. headerCellProps,
  46459. onColumnSorted
  46460. };
  46461. const tableSlots = {
  46462. row: (props2) => vue.createVNode(RowRenderer, vue.mergeProps(props2, tableRowProps), {
  46463. row: slots.row,
  46464. cell: (props3) => {
  46465. let _slot;
  46466. return slots.cell ? vue.createVNode(CellRenderer, vue.mergeProps(props3, tableCellProps, {
  46467. "style": _columnsStyles[props3.column.key]
  46468. }), _isSlot(_slot = slots.cell(props3)) ? _slot : {
  46469. default: () => [_slot]
  46470. }) : vue.createVNode(CellRenderer, vue.mergeProps(props3, tableCellProps, {
  46471. "style": _columnsStyles[props3.column.key]
  46472. }), null);
  46473. }
  46474. }),
  46475. header: (props2) => vue.createVNode(HeaderRenderer, vue.mergeProps(props2, tableHeaderProps), {
  46476. header: slots.header,
  46477. cell: (props3) => {
  46478. let _slot2;
  46479. return slots["header-cell"] ? vue.createVNode(HeaderCellRenderer, vue.mergeProps(props3, tableHeaderCellProps, {
  46480. "style": _columnsStyles[props3.column.key]
  46481. }), _isSlot(_slot2 = slots["header-cell"](props3)) ? _slot2 : {
  46482. default: () => [_slot2]
  46483. }) : vue.createVNode(HeaderCellRenderer, vue.mergeProps(props3, tableHeaderCellProps, {
  46484. "style": _columnsStyles[props3.column.key]
  46485. }), null);
  46486. }
  46487. })
  46488. };
  46489. const rootKls = [props.class, ns.b(), ns.e("root"), {
  46490. [ns.is("dynamic")]: vue.unref(isDynamic)
  46491. }];
  46492. const footerProps = {
  46493. class: ns.e("footer"),
  46494. style: vue.unref(footerHeight)
  46495. };
  46496. return vue.createVNode("div", {
  46497. "class": rootKls,
  46498. "style": vue.unref(rootStyle)
  46499. }, [vue.createVNode(MainTable, mainTableProps, _isSlot(tableSlots) ? tableSlots : {
  46500. default: () => [tableSlots]
  46501. }), vue.createVNode(LeftTable$1, leftTableProps, _isSlot(tableSlots) ? tableSlots : {
  46502. default: () => [tableSlots]
  46503. }), vue.createVNode(LeftTable, rightTableProps, _isSlot(tableSlots) ? tableSlots : {
  46504. default: () => [tableSlots]
  46505. }), slots.footer && vue.createVNode(Footer$1, footerProps, {
  46506. default: slots.footer
  46507. }), vue.unref(showEmpty) && vue.createVNode(Footer, {
  46508. "class": ns.e("empty"),
  46509. "style": vue.unref(emptyStyle)
  46510. }, {
  46511. default: slots.empty
  46512. }), slots.overlay && vue.createVNode(Overlay, {
  46513. "class": ns.e("overlay")
  46514. }, {
  46515. default: slots.overlay
  46516. })]);
  46517. };
  46518. }
  46519. });
  46520. var TableV2$1 = TableV2;
  46521. const autoResizerProps = buildProps({
  46522. disableWidth: Boolean,
  46523. disableHeight: Boolean,
  46524. onResize: {
  46525. type: definePropType(Function)
  46526. }
  46527. });
  46528. const AutoResizer = vue.defineComponent({
  46529. name: "ElAutoResizer",
  46530. props: autoResizerProps,
  46531. setup(props, {
  46532. slots
  46533. }) {
  46534. const ns = useNamespace("auto-resizer");
  46535. const {
  46536. height,
  46537. width,
  46538. sizer
  46539. } = useAutoResize(props);
  46540. const style = {
  46541. width: "100%",
  46542. height: "100%"
  46543. };
  46544. return () => {
  46545. var _a;
  46546. return vue.createVNode("div", {
  46547. "ref": sizer,
  46548. "class": ns.b(),
  46549. "style": style
  46550. }, [(_a = slots.default) == null ? void 0 : _a.call(slots, {
  46551. height: height.value,
  46552. width: width.value
  46553. })]);
  46554. };
  46555. }
  46556. });
  46557. const ElTableV2 = withInstall(TableV2$1);
  46558. const ElAutoResizer = withInstall(AutoResizer);
  46559. const tabBarProps = buildProps({
  46560. tabs: {
  46561. type: definePropType(Array),
  46562. default: () => mutable([])
  46563. }
  46564. });
  46565. const COMPONENT_NAME$3 = "ElTabBar";
  46566. const __default__$j = vue.defineComponent({
  46567. name: COMPONENT_NAME$3
  46568. });
  46569. const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
  46570. ...__default__$j,
  46571. props: tabBarProps,
  46572. setup(__props, { expose }) {
  46573. const props = __props;
  46574. const instance = vue.getCurrentInstance();
  46575. const rootTabs = vue.inject(tabsRootContextKey);
  46576. if (!rootTabs)
  46577. throwError(COMPONENT_NAME$3, "<el-tabs><el-tab-bar /></el-tabs>");
  46578. const ns = useNamespace("tabs");
  46579. const barRef = vue.ref();
  46580. const barStyle = vue.ref();
  46581. const getBarStyle = () => {
  46582. let offset = 0;
  46583. let tabSize = 0;
  46584. const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
  46585. const sizeDir = sizeName === "width" ? "x" : "y";
  46586. const position = sizeDir === "x" ? "left" : "top";
  46587. props.tabs.every((tab) => {
  46588. var _a, _b;
  46589. const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
  46590. if (!$el)
  46591. return false;
  46592. if (!tab.active) {
  46593. return true;
  46594. }
  46595. offset = $el[`offset${capitalize(position)}`];
  46596. tabSize = $el[`client${capitalize(sizeName)}`];
  46597. const tabStyles = window.getComputedStyle($el);
  46598. if (sizeName === "width") {
  46599. if (props.tabs.length > 1) {
  46600. tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
  46601. }
  46602. offset += Number.parseFloat(tabStyles.paddingLeft);
  46603. }
  46604. return false;
  46605. });
  46606. return {
  46607. [sizeName]: `${tabSize}px`,
  46608. transform: `translate${capitalize(sizeDir)}(${offset}px)`
  46609. };
  46610. };
  46611. const update = () => barStyle.value = getBarStyle();
  46612. vue.watch(() => props.tabs, async () => {
  46613. await vue.nextTick();
  46614. update();
  46615. }, { immediate: true });
  46616. useResizeObserver(barRef, () => update());
  46617. expose({
  46618. ref: barRef,
  46619. update
  46620. });
  46621. return (_ctx, _cache) => {
  46622. return vue.openBlock(), vue.createElementBlock("div", {
  46623. ref_key: "barRef",
  46624. ref: barRef,
  46625. class: vue.normalizeClass([vue.unref(ns).e("active-bar"), vue.unref(ns).is(vue.unref(rootTabs).props.tabPosition)]),
  46626. style: vue.normalizeStyle(barStyle.value)
  46627. }, null, 6);
  46628. };
  46629. }
  46630. });
  46631. var TabBar = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__file", "tab-bar.vue"]]);
  46632. const tabNavProps = buildProps({
  46633. panes: {
  46634. type: definePropType(Array),
  46635. default: () => mutable([])
  46636. },
  46637. currentName: {
  46638. type: [String, Number],
  46639. default: ""
  46640. },
  46641. editable: Boolean,
  46642. type: {
  46643. type: String,
  46644. values: ["card", "border-card", ""],
  46645. default: ""
  46646. },
  46647. stretch: Boolean
  46648. });
  46649. const tabNavEmits = {
  46650. tabClick: (tab, tabName, ev) => ev instanceof Event,
  46651. tabRemove: (tab, ev) => ev instanceof Event
  46652. };
  46653. const COMPONENT_NAME$2 = "ElTabNav";
  46654. const TabNav = vue.defineComponent({
  46655. name: COMPONENT_NAME$2,
  46656. props: tabNavProps,
  46657. emits: tabNavEmits,
  46658. setup(props, {
  46659. expose,
  46660. emit
  46661. }) {
  46662. const vm = vue.getCurrentInstance();
  46663. const rootTabs = vue.inject(tabsRootContextKey);
  46664. if (!rootTabs)
  46665. throwError(COMPONENT_NAME$2, `<el-tabs><tab-nav /></el-tabs>`);
  46666. const ns = useNamespace("tabs");
  46667. const visibility = useDocumentVisibility();
  46668. const focused = useWindowFocus();
  46669. const navScroll$ = vue.ref();
  46670. const nav$ = vue.ref();
  46671. const el$ = vue.ref();
  46672. const scrollable = vue.ref(false);
  46673. const navOffset = vue.ref(0);
  46674. const isFocus = vue.ref(false);
  46675. const focusable = vue.ref(true);
  46676. const sizeName = vue.computed(() => ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height");
  46677. const navStyle = vue.computed(() => {
  46678. const dir = sizeName.value === "width" ? "X" : "Y";
  46679. return {
  46680. transform: `translate${dir}(-${navOffset.value}px)`
  46681. };
  46682. });
  46683. const scrollPrev = () => {
  46684. if (!navScroll$.value)
  46685. return;
  46686. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  46687. const currentOffset = navOffset.value;
  46688. if (!currentOffset)
  46689. return;
  46690. const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
  46691. navOffset.value = newOffset;
  46692. };
  46693. const scrollNext = () => {
  46694. if (!navScroll$.value || !nav$.value)
  46695. return;
  46696. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  46697. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  46698. const currentOffset = navOffset.value;
  46699. if (navSize - currentOffset <= containerSize)
  46700. return;
  46701. const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  46702. navOffset.value = newOffset;
  46703. };
  46704. const scrollToActiveTab = async () => {
  46705. const nav = nav$.value;
  46706. if (!scrollable.value || !el$.value || !navScroll$.value || !nav)
  46707. return;
  46708. await vue.nextTick();
  46709. const activeTab = el$.value.querySelector(".is-active");
  46710. if (!activeTab)
  46711. return;
  46712. const navScroll = navScroll$.value;
  46713. const isHorizontal = ["top", "bottom"].includes(rootTabs.props.tabPosition);
  46714. const activeTabBounding = activeTab.getBoundingClientRect();
  46715. const navScrollBounding = navScroll.getBoundingClientRect();
  46716. const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  46717. const currentOffset = navOffset.value;
  46718. let newOffset = currentOffset;
  46719. if (isHorizontal) {
  46720. if (activeTabBounding.left < navScrollBounding.left) {
  46721. newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  46722. }
  46723. if (activeTabBounding.right > navScrollBounding.right) {
  46724. newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  46725. }
  46726. } else {
  46727. if (activeTabBounding.top < navScrollBounding.top) {
  46728. newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  46729. }
  46730. if (activeTabBounding.bottom > navScrollBounding.bottom) {
  46731. newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  46732. }
  46733. }
  46734. newOffset = Math.max(newOffset, 0);
  46735. navOffset.value = Math.min(newOffset, maxOffset);
  46736. };
  46737. const update = () => {
  46738. if (!nav$.value || !navScroll$.value)
  46739. return;
  46740. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  46741. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  46742. const currentOffset = navOffset.value;
  46743. if (containerSize < navSize) {
  46744. const currentOffset2 = navOffset.value;
  46745. scrollable.value = scrollable.value || {};
  46746. scrollable.value.prev = currentOffset2;
  46747. scrollable.value.next = currentOffset2 + containerSize < navSize;
  46748. if (navSize - currentOffset2 < containerSize) {
  46749. navOffset.value = navSize - containerSize;
  46750. }
  46751. } else {
  46752. scrollable.value = false;
  46753. if (currentOffset > 0) {
  46754. navOffset.value = 0;
  46755. }
  46756. }
  46757. };
  46758. const changeTab = (e) => {
  46759. const code = e.code;
  46760. const {
  46761. up,
  46762. down,
  46763. left,
  46764. right
  46765. } = EVENT_CODE;
  46766. if (![up, down, left, right].includes(code))
  46767. return;
  46768. const tabList = Array.from(e.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
  46769. const currentIndex = tabList.indexOf(e.target);
  46770. let nextIndex;
  46771. if (code === left || code === up) {
  46772. if (currentIndex === 0) {
  46773. nextIndex = tabList.length - 1;
  46774. } else {
  46775. nextIndex = currentIndex - 1;
  46776. }
  46777. } else {
  46778. if (currentIndex < tabList.length - 1) {
  46779. nextIndex = currentIndex + 1;
  46780. } else {
  46781. nextIndex = 0;
  46782. }
  46783. }
  46784. tabList[nextIndex].focus({
  46785. preventScroll: true
  46786. });
  46787. tabList[nextIndex].click();
  46788. setFocus();
  46789. };
  46790. const setFocus = () => {
  46791. if (focusable.value)
  46792. isFocus.value = true;
  46793. };
  46794. const removeFocus = () => isFocus.value = false;
  46795. vue.watch(visibility, (visibility2) => {
  46796. if (visibility2 === "hidden") {
  46797. focusable.value = false;
  46798. } else if (visibility2 === "visible") {
  46799. setTimeout(() => focusable.value = true, 50);
  46800. }
  46801. });
  46802. vue.watch(focused, (focused2) => {
  46803. if (focused2) {
  46804. setTimeout(() => focusable.value = true, 50);
  46805. } else {
  46806. focusable.value = false;
  46807. }
  46808. });
  46809. useResizeObserver(el$, update);
  46810. vue.onMounted(() => setTimeout(() => scrollToActiveTab(), 0));
  46811. vue.onUpdated(() => update());
  46812. expose({
  46813. scrollToActiveTab,
  46814. removeFocus
  46815. });
  46816. vue.watch(() => props.panes, () => vm.update(), {
  46817. flush: "post"
  46818. });
  46819. return () => {
  46820. const scrollBtn = scrollable.value ? [vue.createVNode("span", {
  46821. "class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
  46822. "onClick": scrollPrev
  46823. }, [vue.createVNode(ElIcon, null, {
  46824. default: () => [vue.createVNode(arrow_left_default, null, null)]
  46825. })]), vue.createVNode("span", {
  46826. "class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
  46827. "onClick": scrollNext
  46828. }, [vue.createVNode(ElIcon, null, {
  46829. default: () => [vue.createVNode(arrow_right_default, null, null)]
  46830. })])] : null;
  46831. const tabs = props.panes.map((pane, index) => {
  46832. var _a, _b, _c, _d;
  46833. const uid = pane.uid;
  46834. const disabled = pane.props.disabled;
  46835. const tabName = (_b = (_a = pane.props.name) != null ? _a : pane.index) != null ? _b : `${index}`;
  46836. const closable = !disabled && (pane.isClosable || props.editable);
  46837. pane.index = `${index}`;
  46838. const btnClose = closable ? vue.createVNode(ElIcon, {
  46839. "class": "is-icon-close",
  46840. "onClick": (ev) => emit("tabRemove", pane, ev)
  46841. }, {
  46842. default: () => [vue.createVNode(close_default, null, null)]
  46843. }) : null;
  46844. const tabLabelContent = ((_d = (_c = pane.slots).label) == null ? void 0 : _d.call(_c)) || pane.props.label;
  46845. const tabindex = !disabled && pane.active ? 0 : -1;
  46846. return vue.createVNode("div", {
  46847. "ref": `tab-${uid}`,
  46848. "class": [ns.e("item"), ns.is(rootTabs.props.tabPosition), ns.is("active", pane.active), ns.is("disabled", disabled), ns.is("closable", closable), ns.is("focus", isFocus.value)],
  46849. "id": `tab-${tabName}`,
  46850. "key": `tab-${uid}`,
  46851. "aria-controls": `pane-${tabName}`,
  46852. "role": "tab",
  46853. "aria-selected": pane.active,
  46854. "tabindex": tabindex,
  46855. "onFocus": () => setFocus(),
  46856. "onBlur": () => removeFocus(),
  46857. "onClick": (ev) => {
  46858. removeFocus();
  46859. emit("tabClick", pane, tabName, ev);
  46860. },
  46861. "onKeydown": (ev) => {
  46862. if (closable && (ev.code === EVENT_CODE.delete || ev.code === EVENT_CODE.backspace)) {
  46863. emit("tabRemove", pane, ev);
  46864. }
  46865. }
  46866. }, [...[tabLabelContent, btnClose]]);
  46867. });
  46868. return vue.createVNode("div", {
  46869. "ref": el$,
  46870. "class": [ns.e("nav-wrap"), ns.is("scrollable", !!scrollable.value), ns.is(rootTabs.props.tabPosition)]
  46871. }, [scrollBtn, vue.createVNode("div", {
  46872. "class": ns.e("nav-scroll"),
  46873. "ref": navScroll$
  46874. }, [vue.createVNode("div", {
  46875. "class": [ns.e("nav"), ns.is(rootTabs.props.tabPosition), ns.is("stretch", props.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition))],
  46876. "ref": nav$,
  46877. "style": navStyle.value,
  46878. "role": "tablist",
  46879. "onKeydown": changeTab
  46880. }, [...[!props.type ? vue.createVNode(TabBar, {
  46881. "tabs": [...props.panes]
  46882. }, null) : null, tabs]])])]);
  46883. };
  46884. }
  46885. });
  46886. const tabsProps = buildProps({
  46887. type: {
  46888. type: String,
  46889. values: ["card", "border-card", ""],
  46890. default: ""
  46891. },
  46892. activeName: {
  46893. type: [String, Number]
  46894. },
  46895. closable: Boolean,
  46896. addable: Boolean,
  46897. modelValue: {
  46898. type: [String, Number]
  46899. },
  46900. editable: Boolean,
  46901. tabPosition: {
  46902. type: String,
  46903. values: ["top", "right", "bottom", "left"],
  46904. default: "top"
  46905. },
  46906. beforeLeave: {
  46907. type: definePropType(Function),
  46908. default: () => true
  46909. },
  46910. stretch: Boolean
  46911. });
  46912. const isPaneName = (value) => isString(value) || isNumber(value);
  46913. const tabsEmits = {
  46914. [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
  46915. tabClick: (pane, ev) => ev instanceof Event,
  46916. tabChange: (name) => isPaneName(name),
  46917. edit: (paneName, action) => ["remove", "add"].includes(action),
  46918. tabRemove: (name) => isPaneName(name),
  46919. tabAdd: () => true
  46920. };
  46921. var Tabs = vue.defineComponent({
  46922. name: "ElTabs",
  46923. props: tabsProps,
  46924. emits: tabsEmits,
  46925. setup(props, {
  46926. emit,
  46927. slots,
  46928. expose
  46929. }) {
  46930. var _a, _b;
  46931. const ns = useNamespace("tabs");
  46932. const {
  46933. children: panes,
  46934. addChild: registerPane,
  46935. removeChild: unregisterPane
  46936. } = useOrderedChildren(vue.getCurrentInstance(), "ElTabPane");
  46937. const nav$ = vue.ref();
  46938. const currentName = vue.ref((_b = (_a = props.modelValue) != null ? _a : props.activeName) != null ? _b : "0");
  46939. const changeCurrentName = (value) => {
  46940. currentName.value = value;
  46941. emit(UPDATE_MODEL_EVENT, value);
  46942. emit("tabChange", value);
  46943. };
  46944. const setCurrentName = async (value) => {
  46945. var _a2, _b2, _c;
  46946. if (currentName.value === value || isUndefined(value))
  46947. return;
  46948. try {
  46949. const canLeave = await ((_a2 = props.beforeLeave) == null ? void 0 : _a2.call(props, value, currentName.value));
  46950. if (canLeave !== false) {
  46951. changeCurrentName(value);
  46952. (_c = (_b2 = nav$.value) == null ? void 0 : _b2.removeFocus) == null ? void 0 : _c.call(_b2);
  46953. }
  46954. } catch (e) {
  46955. }
  46956. };
  46957. const handleTabClick = (tab, tabName, event) => {
  46958. if (tab.props.disabled)
  46959. return;
  46960. setCurrentName(tabName);
  46961. emit("tabClick", tab, event);
  46962. };
  46963. const handleTabRemove = (pane, ev) => {
  46964. if (pane.props.disabled || isUndefined(pane.props.name))
  46965. return;
  46966. ev.stopPropagation();
  46967. emit("edit", pane.props.name, "remove");
  46968. emit("tabRemove", pane.props.name);
  46969. };
  46970. const handleTabAdd = () => {
  46971. emit("edit", void 0, "add");
  46972. emit("tabAdd");
  46973. };
  46974. useDeprecated({
  46975. from: '"activeName"',
  46976. replacement: '"model-value" or "v-model"',
  46977. scope: "ElTabs",
  46978. version: "2.3.0",
  46979. ref: "https://element-plus.org/en-US/component/tabs.html#attributes",
  46980. type: "Attribute"
  46981. }, vue.computed(() => !!props.activeName));
  46982. vue.watch(() => props.activeName, (modelValue) => setCurrentName(modelValue));
  46983. vue.watch(() => props.modelValue, (modelValue) => setCurrentName(modelValue));
  46984. vue.watch(currentName, async () => {
  46985. var _a2;
  46986. await vue.nextTick();
  46987. (_a2 = nav$.value) == null ? void 0 : _a2.scrollToActiveTab();
  46988. });
  46989. vue.provide(tabsRootContextKey, {
  46990. props,
  46991. currentName,
  46992. registerPane,
  46993. unregisterPane
  46994. });
  46995. expose({
  46996. currentName
  46997. });
  46998. return () => {
  46999. const newButton = props.editable || props.addable ? vue.createVNode("span", {
  47000. "class": ns.e("new-tab"),
  47001. "tabindex": "0",
  47002. "onClick": handleTabAdd,
  47003. "onKeydown": (ev) => {
  47004. if (ev.code === EVENT_CODE.enter)
  47005. handleTabAdd();
  47006. }
  47007. }, [vue.createVNode(ElIcon, {
  47008. "class": ns.is("icon-plus")
  47009. }, {
  47010. default: () => [vue.createVNode(plus_default, null, null)]
  47011. })]) : null;
  47012. const header = vue.createVNode("div", {
  47013. "class": [ns.e("header"), ns.is(props.tabPosition)]
  47014. }, [newButton, vue.createVNode(TabNav, {
  47015. "ref": nav$,
  47016. "currentName": currentName.value,
  47017. "editable": props.editable,
  47018. "type": props.type,
  47019. "panes": panes.value,
  47020. "stretch": props.stretch,
  47021. "onTabClick": handleTabClick,
  47022. "onTabRemove": handleTabRemove
  47023. }, null)]);
  47024. const panels = vue.createVNode("div", {
  47025. "class": ns.e("content")
  47026. }, [vue.renderSlot(slots, "default")]);
  47027. return vue.createVNode("div", {
  47028. "class": [ns.b(), ns.m(props.tabPosition), {
  47029. [ns.m("card")]: props.type === "card",
  47030. [ns.m("border-card")]: props.type === "border-card"
  47031. }]
  47032. }, [...props.tabPosition !== "bottom" ? [header, panels] : [panels, header]]);
  47033. };
  47034. }
  47035. });
  47036. const tabPaneProps = buildProps({
  47037. label: {
  47038. type: String,
  47039. default: ""
  47040. },
  47041. name: {
  47042. type: [String, Number]
  47043. },
  47044. closable: Boolean,
  47045. disabled: Boolean,
  47046. lazy: Boolean
  47047. });
  47048. const _hoisted_1$a = ["id", "aria-hidden", "aria-labelledby"];
  47049. const COMPONENT_NAME$1 = "ElTabPane";
  47050. const __default__$i = vue.defineComponent({
  47051. name: COMPONENT_NAME$1
  47052. });
  47053. const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
  47054. ...__default__$i,
  47055. props: tabPaneProps,
  47056. setup(__props) {
  47057. const props = __props;
  47058. const instance = vue.getCurrentInstance();
  47059. const slots = vue.useSlots();
  47060. const tabsRoot = vue.inject(tabsRootContextKey);
  47061. if (!tabsRoot)
  47062. throwError(COMPONENT_NAME$1, "usage: <el-tabs><el-tab-pane /></el-tabs/>");
  47063. const ns = useNamespace("tab-pane");
  47064. const index = vue.ref();
  47065. const isClosable = vue.computed(() => props.closable || tabsRoot.props.closable);
  47066. const active = computedEager(() => {
  47067. var _a;
  47068. return tabsRoot.currentName.value === ((_a = props.name) != null ? _a : index.value);
  47069. });
  47070. const loaded = vue.ref(active.value);
  47071. const paneName = vue.computed(() => {
  47072. var _a;
  47073. return (_a = props.name) != null ? _a : index.value;
  47074. });
  47075. const shouldBeRender = computedEager(() => !props.lazy || loaded.value || active.value);
  47076. vue.watch(active, (val) => {
  47077. if (val)
  47078. loaded.value = true;
  47079. });
  47080. const pane = vue.reactive({
  47081. uid: instance.uid,
  47082. slots,
  47083. props,
  47084. paneName,
  47085. active,
  47086. index,
  47087. isClosable
  47088. });
  47089. vue.onMounted(() => {
  47090. tabsRoot.registerPane(pane);
  47091. });
  47092. vue.onUnmounted(() => {
  47093. tabsRoot.unregisterPane(pane.uid);
  47094. });
  47095. return (_ctx, _cache) => {
  47096. return vue.unref(shouldBeRender) ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  47097. key: 0,
  47098. id: `pane-${vue.unref(paneName)}`,
  47099. class: vue.normalizeClass(vue.unref(ns).b()),
  47100. role: "tabpanel",
  47101. "aria-hidden": !vue.unref(active),
  47102. "aria-labelledby": `tab-${vue.unref(paneName)}`
  47103. }, [
  47104. vue.renderSlot(_ctx.$slots, "default")
  47105. ], 10, _hoisted_1$a)), [
  47106. [vue.vShow, vue.unref(active)]
  47107. ]) : vue.createCommentVNode("v-if", true);
  47108. };
  47109. }
  47110. });
  47111. var TabPane = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__file", "tab-pane.vue"]]);
  47112. const ElTabs = withInstall(Tabs, {
  47113. TabPane
  47114. });
  47115. const ElTabPane = withNoopInstall(TabPane);
  47116. const timeSelectProps = buildProps({
  47117. format: {
  47118. type: String,
  47119. default: "HH:mm"
  47120. },
  47121. modelValue: String,
  47122. disabled: Boolean,
  47123. editable: {
  47124. type: Boolean,
  47125. default: true
  47126. },
  47127. effect: {
  47128. type: String,
  47129. default: "light"
  47130. },
  47131. clearable: {
  47132. type: Boolean,
  47133. default: true
  47134. },
  47135. size: useSizeProp,
  47136. placeholder: String,
  47137. start: {
  47138. type: String,
  47139. default: "09:00"
  47140. },
  47141. end: {
  47142. type: String,
  47143. default: "18:00"
  47144. },
  47145. step: {
  47146. type: String,
  47147. default: "00:30"
  47148. },
  47149. minTime: String,
  47150. maxTime: String,
  47151. name: String,
  47152. prefixIcon: {
  47153. type: definePropType([String, Object]),
  47154. default: () => clock_default
  47155. },
  47156. clearIcon: {
  47157. type: definePropType([String, Object]),
  47158. default: () => circle_close_default
  47159. }
  47160. });
  47161. const parseTime = (time) => {
  47162. const values = (time || "").split(":");
  47163. if (values.length >= 2) {
  47164. let hours = Number.parseInt(values[0], 10);
  47165. const minutes = Number.parseInt(values[1], 10);
  47166. const timeUpper = time.toUpperCase();
  47167. if (timeUpper.includes("AM") && hours === 12) {
  47168. hours = 0;
  47169. } else if (timeUpper.includes("PM") && hours !== 12) {
  47170. hours += 12;
  47171. }
  47172. return {
  47173. hours,
  47174. minutes
  47175. };
  47176. }
  47177. return null;
  47178. };
  47179. const compareTime = (time1, time2) => {
  47180. const value1 = parseTime(time1);
  47181. if (!value1)
  47182. return -1;
  47183. const value2 = parseTime(time2);
  47184. if (!value2)
  47185. return -1;
  47186. const minutes1 = value1.minutes + value1.hours * 60;
  47187. const minutes2 = value2.minutes + value2.hours * 60;
  47188. if (minutes1 === minutes2) {
  47189. return 0;
  47190. }
  47191. return minutes1 > minutes2 ? 1 : -1;
  47192. };
  47193. const padTime = (time) => {
  47194. return `${time}`.padStart(2, "0");
  47195. };
  47196. const formatTime = (time) => {
  47197. return `${padTime(time.hours)}:${padTime(time.minutes)}`;
  47198. };
  47199. const nextTime = (time, step) => {
  47200. const timeValue = parseTime(time);
  47201. if (!timeValue)
  47202. return "";
  47203. const stepValue = parseTime(step);
  47204. if (!stepValue)
  47205. return "";
  47206. const next = {
  47207. hours: timeValue.hours,
  47208. minutes: timeValue.minutes
  47209. };
  47210. next.minutes += stepValue.minutes;
  47211. next.hours += stepValue.hours;
  47212. next.hours += Math.floor(next.minutes / 60);
  47213. next.minutes = next.minutes % 60;
  47214. return formatTime(next);
  47215. };
  47216. const __default__$h = vue.defineComponent({
  47217. name: "ElTimeSelect"
  47218. });
  47219. const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
  47220. ...__default__$h,
  47221. props: timeSelectProps,
  47222. emits: ["change", "blur", "focus", "update:modelValue"],
  47223. setup(__props, { expose }) {
  47224. const props = __props;
  47225. dayjs.extend(customParseFormat);
  47226. const { Option: ElOption } = ElSelect;
  47227. const nsInput = useNamespace("input");
  47228. const select = vue.ref();
  47229. const _disabled = useDisabled();
  47230. const value = vue.computed(() => props.modelValue);
  47231. const start = vue.computed(() => {
  47232. const time = parseTime(props.start);
  47233. return time ? formatTime(time) : null;
  47234. });
  47235. const end = vue.computed(() => {
  47236. const time = parseTime(props.end);
  47237. return time ? formatTime(time) : null;
  47238. });
  47239. const step = vue.computed(() => {
  47240. const time = parseTime(props.step);
  47241. return time ? formatTime(time) : null;
  47242. });
  47243. const minTime = vue.computed(() => {
  47244. const time = parseTime(props.minTime || "");
  47245. return time ? formatTime(time) : null;
  47246. });
  47247. const maxTime = vue.computed(() => {
  47248. const time = parseTime(props.maxTime || "");
  47249. return time ? formatTime(time) : null;
  47250. });
  47251. const items = vue.computed(() => {
  47252. const result = [];
  47253. if (props.start && props.end && props.step) {
  47254. let current = start.value;
  47255. let currentTime;
  47256. while (current && end.value && compareTime(current, end.value) <= 0) {
  47257. currentTime = dayjs(current, "HH:mm").format(props.format);
  47258. result.push({
  47259. value: currentTime,
  47260. disabled: compareTime(current, minTime.value || "-1:-1") <= 0 || compareTime(current, maxTime.value || "100:100") >= 0
  47261. });
  47262. current = nextTime(current, step.value);
  47263. }
  47264. }
  47265. return result;
  47266. });
  47267. const blur = () => {
  47268. var _a, _b;
  47269. (_b = (_a = select.value) == null ? void 0 : _a.blur) == null ? void 0 : _b.call(_a);
  47270. };
  47271. const focus = () => {
  47272. var _a, _b;
  47273. (_b = (_a = select.value) == null ? void 0 : _a.focus) == null ? void 0 : _b.call(_a);
  47274. };
  47275. expose({
  47276. blur,
  47277. focus
  47278. });
  47279. return (_ctx, _cache) => {
  47280. return vue.openBlock(), vue.createBlock(vue.unref(ElSelect), {
  47281. ref_key: "select",
  47282. ref: select,
  47283. "model-value": vue.unref(value),
  47284. disabled: vue.unref(_disabled),
  47285. clearable: _ctx.clearable,
  47286. "clear-icon": _ctx.clearIcon,
  47287. size: _ctx.size,
  47288. effect: _ctx.effect,
  47289. placeholder: _ctx.placeholder,
  47290. "default-first-option": "",
  47291. filterable: _ctx.editable,
  47292. "onUpdate:modelValue": _cache[0] || (_cache[0] = (event) => _ctx.$emit("update:modelValue", event)),
  47293. onChange: _cache[1] || (_cache[1] = (event) => _ctx.$emit("change", event)),
  47294. onBlur: _cache[2] || (_cache[2] = (event) => _ctx.$emit("blur", event)),
  47295. onFocus: _cache[3] || (_cache[3] = (event) => _ctx.$emit("focus", event))
  47296. }, {
  47297. prefix: vue.withCtx(() => [
  47298. _ctx.prefixIcon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  47299. key: 0,
  47300. class: vue.normalizeClass(vue.unref(nsInput).e("prefix-icon"))
  47301. }, {
  47302. default: vue.withCtx(() => [
  47303. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.prefixIcon)))
  47304. ]),
  47305. _: 1
  47306. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  47307. ]),
  47308. default: vue.withCtx(() => [
  47309. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(items), (item) => {
  47310. return vue.openBlock(), vue.createBlock(vue.unref(ElOption), {
  47311. key: item.value,
  47312. label: item.value,
  47313. value: item.value,
  47314. disabled: item.disabled
  47315. }, null, 8, ["label", "value", "disabled"]);
  47316. }), 128))
  47317. ]),
  47318. _: 1
  47319. }, 8, ["model-value", "disabled", "clearable", "clear-icon", "size", "effect", "placeholder", "filterable"]);
  47320. };
  47321. }
  47322. });
  47323. var TimeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__file", "time-select.vue"]]);
  47324. TimeSelect.install = (app) => {
  47325. app.component(TimeSelect.name, TimeSelect);
  47326. };
  47327. const _TimeSelect = TimeSelect;
  47328. const ElTimeSelect = _TimeSelect;
  47329. const Timeline = vue.defineComponent({
  47330. name: "ElTimeline",
  47331. setup(_, { slots }) {
  47332. const ns = useNamespace("timeline");
  47333. vue.provide("timeline", slots);
  47334. return () => {
  47335. return vue.h("ul", { class: [ns.b()] }, [vue.renderSlot(slots, "default")]);
  47336. };
  47337. }
  47338. });
  47339. var Timeline$1 = Timeline;
  47340. const timelineItemProps = buildProps({
  47341. timestamp: {
  47342. type: String,
  47343. default: ""
  47344. },
  47345. hideTimestamp: {
  47346. type: Boolean,
  47347. default: false
  47348. },
  47349. center: {
  47350. type: Boolean,
  47351. default: false
  47352. },
  47353. placement: {
  47354. type: String,
  47355. values: ["top", "bottom"],
  47356. default: "bottom"
  47357. },
  47358. type: {
  47359. type: String,
  47360. values: ["primary", "success", "warning", "danger", "info"],
  47361. default: ""
  47362. },
  47363. color: {
  47364. type: String,
  47365. default: ""
  47366. },
  47367. size: {
  47368. type: String,
  47369. values: ["normal", "large"],
  47370. default: "normal"
  47371. },
  47372. icon: {
  47373. type: iconPropType
  47374. },
  47375. hollow: {
  47376. type: Boolean,
  47377. default: false
  47378. }
  47379. });
  47380. const __default__$g = vue.defineComponent({
  47381. name: "ElTimelineItem"
  47382. });
  47383. const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
  47384. ...__default__$g,
  47385. props: timelineItemProps,
  47386. setup(__props) {
  47387. const ns = useNamespace("timeline-item");
  47388. return (_ctx, _cache) => {
  47389. return vue.openBlock(), vue.createElementBlock("li", {
  47390. class: vue.normalizeClass([vue.unref(ns).b(), { [vue.unref(ns).e("center")]: _ctx.center }])
  47391. }, [
  47392. vue.createElementVNode("div", {
  47393. class: vue.normalizeClass(vue.unref(ns).e("tail"))
  47394. }, null, 2),
  47395. !_ctx.$slots.dot ? (vue.openBlock(), vue.createElementBlock("div", {
  47396. key: 0,
  47397. class: vue.normalizeClass([
  47398. vue.unref(ns).e("node"),
  47399. vue.unref(ns).em("node", _ctx.size || ""),
  47400. vue.unref(ns).em("node", _ctx.type || ""),
  47401. vue.unref(ns).is("hollow", _ctx.hollow)
  47402. ]),
  47403. style: vue.normalizeStyle({
  47404. backgroundColor: _ctx.color
  47405. })
  47406. }, [
  47407. _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  47408. key: 0,
  47409. class: vue.normalizeClass(vue.unref(ns).e("icon"))
  47410. }, {
  47411. default: vue.withCtx(() => [
  47412. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
  47413. ]),
  47414. _: 1
  47415. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  47416. ], 6)) : vue.createCommentVNode("v-if", true),
  47417. _ctx.$slots.dot ? (vue.openBlock(), vue.createElementBlock("div", {
  47418. key: 1,
  47419. class: vue.normalizeClass(vue.unref(ns).e("dot"))
  47420. }, [
  47421. vue.renderSlot(_ctx.$slots, "dot")
  47422. ], 2)) : vue.createCommentVNode("v-if", true),
  47423. vue.createElementVNode("div", {
  47424. class: vue.normalizeClass(vue.unref(ns).e("wrapper"))
  47425. }, [
  47426. !_ctx.hideTimestamp && _ctx.placement === "top" ? (vue.openBlock(), vue.createElementBlock("div", {
  47427. key: 0,
  47428. class: vue.normalizeClass([vue.unref(ns).e("timestamp"), vue.unref(ns).is("top")])
  47429. }, vue.toDisplayString(_ctx.timestamp), 3)) : vue.createCommentVNode("v-if", true),
  47430. vue.createElementVNode("div", {
  47431. class: vue.normalizeClass(vue.unref(ns).e("content"))
  47432. }, [
  47433. vue.renderSlot(_ctx.$slots, "default")
  47434. ], 2),
  47435. !_ctx.hideTimestamp && _ctx.placement === "bottom" ? (vue.openBlock(), vue.createElementBlock("div", {
  47436. key: 1,
  47437. class: vue.normalizeClass([vue.unref(ns).e("timestamp"), vue.unref(ns).is("bottom")])
  47438. }, vue.toDisplayString(_ctx.timestamp), 3)) : vue.createCommentVNode("v-if", true)
  47439. ], 2)
  47440. ], 2);
  47441. };
  47442. }
  47443. });
  47444. var TimelineItem = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__file", "timeline-item.vue"]]);
  47445. const ElTimeline = withInstall(Timeline$1, {
  47446. TimelineItem
  47447. });
  47448. const ElTimelineItem = withNoopInstall(TimelineItem);
  47449. const tooltipV2CommonProps = buildProps({
  47450. nowrap: Boolean
  47451. });
  47452. var TooltipV2Sides = /* @__PURE__ */ ((TooltipV2Sides2) => {
  47453. TooltipV2Sides2["top"] = "top";
  47454. TooltipV2Sides2["bottom"] = "bottom";
  47455. TooltipV2Sides2["left"] = "left";
  47456. TooltipV2Sides2["right"] = "right";
  47457. return TooltipV2Sides2;
  47458. })(TooltipV2Sides || {});
  47459. const tooltipV2Sides = Object.values(TooltipV2Sides);
  47460. const tooltipV2ArrowProps = buildProps({
  47461. width: {
  47462. type: Number,
  47463. default: 10
  47464. },
  47465. height: {
  47466. type: Number,
  47467. default: 10
  47468. },
  47469. style: {
  47470. type: definePropType(Object),
  47471. default: null
  47472. }
  47473. });
  47474. const tooltipV2ArrowSpecialProps = buildProps({
  47475. side: {
  47476. type: definePropType(String),
  47477. values: tooltipV2Sides,
  47478. required: true
  47479. }
  47480. });
  47481. const tooltipV2Strategies = ["absolute", "fixed"];
  47482. const tooltipV2Placements = [
  47483. "top-start",
  47484. "top-end",
  47485. "top",
  47486. "bottom-start",
  47487. "bottom-end",
  47488. "bottom",
  47489. "left-start",
  47490. "left-end",
  47491. "left",
  47492. "right-start",
  47493. "right-end",
  47494. "right"
  47495. ];
  47496. const tooltipV2ContentProps = buildProps({
  47497. ariaLabel: String,
  47498. arrowPadding: {
  47499. type: definePropType(Number),
  47500. default: 5
  47501. },
  47502. effect: {
  47503. type: String,
  47504. default: ""
  47505. },
  47506. contentClass: String,
  47507. placement: {
  47508. type: definePropType(String),
  47509. values: tooltipV2Placements,
  47510. default: "bottom"
  47511. },
  47512. reference: {
  47513. type: definePropType(Object),
  47514. default: null
  47515. },
  47516. offset: {
  47517. type: Number,
  47518. default: 8
  47519. },
  47520. strategy: {
  47521. type: definePropType(String),
  47522. values: tooltipV2Strategies,
  47523. default: "absolute"
  47524. },
  47525. showArrow: {
  47526. type: Boolean,
  47527. default: false
  47528. }
  47529. });
  47530. const tooltipV2RootProps = buildProps({
  47531. delayDuration: {
  47532. type: Number,
  47533. default: 300
  47534. },
  47535. defaultOpen: Boolean,
  47536. open: {
  47537. type: Boolean,
  47538. default: void 0
  47539. },
  47540. onOpenChange: {
  47541. type: definePropType(Function)
  47542. },
  47543. "onUpdate:open": {
  47544. type: definePropType(Function)
  47545. }
  47546. });
  47547. const EventHandler = {
  47548. type: definePropType(Function)
  47549. };
  47550. const tooltipV2TriggerProps = buildProps({
  47551. onBlur: EventHandler,
  47552. onClick: EventHandler,
  47553. onFocus: EventHandler,
  47554. onMouseDown: EventHandler,
  47555. onMouseEnter: EventHandler,
  47556. onMouseLeave: EventHandler
  47557. });
  47558. const tooltipV2Props = buildProps({
  47559. ...tooltipV2RootProps,
  47560. ...tooltipV2ArrowProps,
  47561. ...tooltipV2TriggerProps,
  47562. ...tooltipV2ContentProps,
  47563. alwaysOn: Boolean,
  47564. fullTransition: Boolean,
  47565. transitionProps: {
  47566. type: definePropType(Object),
  47567. default: null
  47568. },
  47569. teleported: Boolean,
  47570. to: {
  47571. type: definePropType(String),
  47572. default: "body"
  47573. }
  47574. });
  47575. const __default__$f = vue.defineComponent({
  47576. name: "ElTooltipV2Root"
  47577. });
  47578. const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
  47579. ...__default__$f,
  47580. props: tooltipV2RootProps,
  47581. setup(__props, { expose }) {
  47582. const props = __props;
  47583. const _open = vue.ref(props.defaultOpen);
  47584. const triggerRef = vue.ref(null);
  47585. const open = vue.computed({
  47586. get: () => isPropAbsent(props.open) ? _open.value : props.open,
  47587. set: (open2) => {
  47588. var _a;
  47589. _open.value = open2;
  47590. (_a = props["onUpdate:open"]) == null ? void 0 : _a.call(props, open2);
  47591. }
  47592. });
  47593. const isOpenDelayed = vue.computed(() => isNumber(props.delayDuration) && props.delayDuration > 0);
  47594. const { start: onDelayedOpen, stop: clearTimer } = useTimeoutFn(() => {
  47595. open.value = true;
  47596. }, vue.computed(() => props.delayDuration), {
  47597. immediate: false
  47598. });
  47599. const ns = useNamespace("tooltip-v2");
  47600. const contentId = useId();
  47601. const onNormalOpen = () => {
  47602. clearTimer();
  47603. open.value = true;
  47604. };
  47605. const onDelayOpen = () => {
  47606. vue.unref(isOpenDelayed) ? onDelayedOpen() : onNormalOpen();
  47607. };
  47608. const onOpen = onNormalOpen;
  47609. const onClose = () => {
  47610. clearTimer();
  47611. open.value = false;
  47612. };
  47613. const onChange = (open2) => {
  47614. var _a;
  47615. if (open2) {
  47616. document.dispatchEvent(new CustomEvent(TOOLTIP_V2_OPEN));
  47617. onOpen();
  47618. }
  47619. (_a = props.onOpenChange) == null ? void 0 : _a.call(props, open2);
  47620. };
  47621. vue.watch(open, onChange);
  47622. vue.onMounted(() => {
  47623. document.addEventListener(TOOLTIP_V2_OPEN, onClose);
  47624. });
  47625. vue.onBeforeUnmount(() => {
  47626. clearTimer();
  47627. document.removeEventListener(TOOLTIP_V2_OPEN, onClose);
  47628. });
  47629. vue.provide(tooltipV2RootKey, {
  47630. contentId,
  47631. triggerRef,
  47632. ns,
  47633. onClose,
  47634. onDelayOpen,
  47635. onOpen
  47636. });
  47637. expose({
  47638. onOpen,
  47639. onClose
  47640. });
  47641. return (_ctx, _cache) => {
  47642. return vue.renderSlot(_ctx.$slots, "default", { open: vue.unref(open) });
  47643. };
  47644. }
  47645. });
  47646. var TooltipV2Root = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "root.vue"]]);
  47647. const __default__$e = vue.defineComponent({
  47648. name: "ElTooltipV2Arrow"
  47649. });
  47650. const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
  47651. ...__default__$e,
  47652. props: {
  47653. ...tooltipV2ArrowProps,
  47654. ...tooltipV2ArrowSpecialProps
  47655. },
  47656. setup(__props) {
  47657. const props = __props;
  47658. const { ns } = vue.inject(tooltipV2RootKey);
  47659. const { arrowRef } = vue.inject(tooltipV2ContentKey);
  47660. const arrowStyle = vue.computed(() => {
  47661. const { style, width, height } = props;
  47662. const namespace = ns.namespace.value;
  47663. return {
  47664. [`--${namespace}-tooltip-v2-arrow-width`]: `${width}px`,
  47665. [`--${namespace}-tooltip-v2-arrow-height`]: `${height}px`,
  47666. [`--${namespace}-tooltip-v2-arrow-border-width`]: `${width / 2}px`,
  47667. [`--${namespace}-tooltip-v2-arrow-cover-width`]: width / 2 - 1,
  47668. ...style || {}
  47669. };
  47670. });
  47671. return (_ctx, _cache) => {
  47672. return vue.openBlock(), vue.createElementBlock("span", {
  47673. ref_key: "arrowRef",
  47674. ref: arrowRef,
  47675. style: vue.normalizeStyle(vue.unref(arrowStyle)),
  47676. class: vue.normalizeClass(vue.unref(ns).e("arrow"))
  47677. }, null, 6);
  47678. };
  47679. }
  47680. });
  47681. var TooltipV2Arrow = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "arrow.vue"]]);
  47682. const visualHiddenProps = buildProps({
  47683. style: {
  47684. type: definePropType([String, Object, Array]),
  47685. default: () => ({})
  47686. }
  47687. });
  47688. const __default__$d = vue.defineComponent({
  47689. name: "ElVisuallyHidden"
  47690. });
  47691. const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
  47692. ...__default__$d,
  47693. props: visualHiddenProps,
  47694. setup(__props) {
  47695. const props = __props;
  47696. const computedStyle = vue.computed(() => {
  47697. return [
  47698. props.style,
  47699. {
  47700. position: "absolute",
  47701. border: 0,
  47702. width: 1,
  47703. height: 1,
  47704. padding: 0,
  47705. margin: -1,
  47706. overflow: "hidden",
  47707. clip: "rect(0, 0, 0, 0)",
  47708. whiteSpace: "nowrap",
  47709. wordWrap: "normal"
  47710. }
  47711. ];
  47712. });
  47713. return (_ctx, _cache) => {
  47714. return vue.openBlock(), vue.createElementBlock("span", vue.mergeProps(_ctx.$attrs, { style: vue.unref(computedStyle) }), [
  47715. vue.renderSlot(_ctx.$slots, "default")
  47716. ], 16);
  47717. };
  47718. }
  47719. });
  47720. var ElVisuallyHidden = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "visual-hidden.vue"]]);
  47721. const _hoisted_1$9 = ["data-side"];
  47722. const __default__$c = vue.defineComponent({
  47723. name: "ElTooltipV2Content"
  47724. });
  47725. const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
  47726. ...__default__$c,
  47727. props: { ...tooltipV2ContentProps, ...tooltipV2CommonProps },
  47728. setup(__props) {
  47729. const props = __props;
  47730. const { triggerRef, contentId } = vue.inject(tooltipV2RootKey);
  47731. const placement = vue.ref(props.placement);
  47732. const strategy = vue.ref(props.strategy);
  47733. const arrowRef = vue.ref(null);
  47734. const { referenceRef, contentRef, middlewareData, x, y, update } = useFloating({
  47735. placement,
  47736. strategy,
  47737. middleware: vue.computed(() => {
  47738. const middleware = [offset(props.offset)];
  47739. if (props.showArrow) {
  47740. middleware.push(arrowMiddleware({
  47741. arrowRef
  47742. }));
  47743. }
  47744. return middleware;
  47745. })
  47746. });
  47747. const zIndex = useZIndex().nextZIndex();
  47748. const ns = useNamespace("tooltip-v2");
  47749. const side = vue.computed(() => {
  47750. return placement.value.split("-")[0];
  47751. });
  47752. const contentStyle = vue.computed(() => {
  47753. return {
  47754. position: vue.unref(strategy),
  47755. top: `${vue.unref(y) || 0}px`,
  47756. left: `${vue.unref(x) || 0}px`,
  47757. zIndex
  47758. };
  47759. });
  47760. const arrowStyle = vue.computed(() => {
  47761. if (!props.showArrow)
  47762. return {};
  47763. const { arrow } = vue.unref(middlewareData);
  47764. return {
  47765. [`--${ns.namespace.value}-tooltip-v2-arrow-x`]: `${arrow == null ? void 0 : arrow.x}px` || "",
  47766. [`--${ns.namespace.value}-tooltip-v2-arrow-y`]: `${arrow == null ? void 0 : arrow.y}px` || ""
  47767. };
  47768. });
  47769. const contentClass = vue.computed(() => [
  47770. ns.e("content"),
  47771. ns.is("dark", props.effect === "dark"),
  47772. ns.is(vue.unref(strategy)),
  47773. props.contentClass
  47774. ]);
  47775. vue.watch(arrowRef, () => update());
  47776. vue.watch(() => props.placement, (val) => placement.value = val);
  47777. vue.onMounted(() => {
  47778. vue.watch(() => props.reference || triggerRef.value, (el) => {
  47779. referenceRef.value = el || void 0;
  47780. }, {
  47781. immediate: true
  47782. });
  47783. });
  47784. vue.provide(tooltipV2ContentKey, { arrowRef });
  47785. return (_ctx, _cache) => {
  47786. return vue.openBlock(), vue.createElementBlock("div", {
  47787. ref_key: "contentRef",
  47788. ref: contentRef,
  47789. style: vue.normalizeStyle(vue.unref(contentStyle)),
  47790. "data-tooltip-v2-root": ""
  47791. }, [
  47792. !_ctx.nowrap ? (vue.openBlock(), vue.createElementBlock("div", {
  47793. key: 0,
  47794. "data-side": vue.unref(side),
  47795. class: vue.normalizeClass(vue.unref(contentClass))
  47796. }, [
  47797. vue.renderSlot(_ctx.$slots, "default", {
  47798. contentStyle: vue.unref(contentStyle),
  47799. contentClass: vue.unref(contentClass)
  47800. }),
  47801. vue.createVNode(vue.unref(ElVisuallyHidden), {
  47802. id: vue.unref(contentId),
  47803. role: "tooltip"
  47804. }, {
  47805. default: vue.withCtx(() => [
  47806. _ctx.ariaLabel ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
  47807. vue.createTextVNode(vue.toDisplayString(_ctx.ariaLabel), 1)
  47808. ], 64)) : vue.renderSlot(_ctx.$slots, "default", { key: 1 })
  47809. ]),
  47810. _: 3
  47811. }, 8, ["id"]),
  47812. vue.renderSlot(_ctx.$slots, "arrow", {
  47813. style: vue.normalizeStyle(vue.unref(arrowStyle)),
  47814. side: vue.unref(side)
  47815. })
  47816. ], 10, _hoisted_1$9)) : vue.createCommentVNode("v-if", true)
  47817. ], 4);
  47818. };
  47819. }
  47820. });
  47821. var TooltipV2Content = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "content.vue"]]);
  47822. const forwardRefProps = buildProps({
  47823. setRef: {
  47824. type: definePropType(Function),
  47825. required: true
  47826. },
  47827. onlyChild: Boolean
  47828. });
  47829. var ForwardRef = vue.defineComponent({
  47830. props: forwardRefProps,
  47831. setup(props, {
  47832. slots
  47833. }) {
  47834. const fragmentRef = vue.ref();
  47835. const setRef = composeRefs(fragmentRef, (el) => {
  47836. if (el) {
  47837. props.setRef(el.nextElementSibling);
  47838. } else {
  47839. props.setRef(null);
  47840. }
  47841. });
  47842. return () => {
  47843. var _a;
  47844. const [firstChild] = ((_a = slots.default) == null ? void 0 : _a.call(slots)) || [];
  47845. const child = props.onlyChild ? ensureOnlyChild(firstChild.children) : firstChild.children;
  47846. return vue.createVNode(vue.Fragment, {
  47847. "ref": setRef
  47848. }, [child]);
  47849. };
  47850. }
  47851. });
  47852. const __default__$b = vue.defineComponent({
  47853. name: "ElTooltipV2Trigger"
  47854. });
  47855. const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
  47856. ...__default__$b,
  47857. props: {
  47858. ...tooltipV2CommonProps,
  47859. ...tooltipV2TriggerProps
  47860. },
  47861. setup(__props) {
  47862. const props = __props;
  47863. const { onClose, onOpen, onDelayOpen, triggerRef, contentId } = vue.inject(tooltipV2RootKey);
  47864. let isMousedown = false;
  47865. const setTriggerRef = (el) => {
  47866. triggerRef.value = el;
  47867. };
  47868. const onMouseup = () => {
  47869. isMousedown = false;
  47870. };
  47871. const onMouseenter = composeEventHandlers(props.onMouseEnter, onDelayOpen);
  47872. const onMouseleave = composeEventHandlers(props.onMouseLeave, onClose);
  47873. const onMousedown = composeEventHandlers(props.onMouseDown, () => {
  47874. onClose();
  47875. isMousedown = true;
  47876. document.addEventListener("mouseup", onMouseup, { once: true });
  47877. });
  47878. const onFocus = composeEventHandlers(props.onFocus, () => {
  47879. if (!isMousedown)
  47880. onOpen();
  47881. });
  47882. const onBlur = composeEventHandlers(props.onBlur, onClose);
  47883. const onClick = composeEventHandlers(props.onClick, (e) => {
  47884. if (e.detail === 0)
  47885. onClose();
  47886. });
  47887. const events = {
  47888. blur: onBlur,
  47889. click: onClick,
  47890. focus: onFocus,
  47891. mousedown: onMousedown,
  47892. mouseenter: onMouseenter,
  47893. mouseleave: onMouseleave
  47894. };
  47895. const setEvents = (el, events2, type) => {
  47896. if (el) {
  47897. Object.entries(events2).forEach(([name, handler]) => {
  47898. el[type](name, handler);
  47899. });
  47900. }
  47901. };
  47902. vue.watch(triggerRef, (triggerEl, previousTriggerEl) => {
  47903. setEvents(triggerEl, events, "addEventListener");
  47904. setEvents(previousTriggerEl, events, "removeEventListener");
  47905. if (triggerEl) {
  47906. triggerEl.setAttribute("aria-describedby", contentId.value);
  47907. }
  47908. });
  47909. vue.onBeforeUnmount(() => {
  47910. setEvents(triggerRef.value, events, "removeEventListener");
  47911. document.removeEventListener("mouseup", onMouseup);
  47912. });
  47913. return (_ctx, _cache) => {
  47914. return _ctx.nowrap ? (vue.openBlock(), vue.createBlock(vue.unref(ForwardRef), {
  47915. key: 0,
  47916. "set-ref": setTriggerRef,
  47917. "only-child": ""
  47918. }, {
  47919. default: vue.withCtx(() => [
  47920. vue.renderSlot(_ctx.$slots, "default")
  47921. ]),
  47922. _: 3
  47923. })) : (vue.openBlock(), vue.createElementBlock("button", vue.mergeProps({
  47924. key: 1,
  47925. ref_key: "triggerRef",
  47926. ref: triggerRef
  47927. }, _ctx.$attrs), [
  47928. vue.renderSlot(_ctx.$slots, "default")
  47929. ], 16));
  47930. };
  47931. }
  47932. });
  47933. var TooltipV2Trigger = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "trigger.vue"]]);
  47934. const __default__$a = vue.defineComponent({
  47935. name: "ElTooltipV2"
  47936. });
  47937. const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
  47938. ...__default__$a,
  47939. props: tooltipV2Props,
  47940. setup(__props) {
  47941. const props = __props;
  47942. const refedProps = vue.toRefs(props);
  47943. const arrowProps = vue.reactive(pick(refedProps, Object.keys(tooltipV2ArrowProps)));
  47944. const contentProps = vue.reactive(pick(refedProps, Object.keys(tooltipV2ContentProps)));
  47945. const rootProps = vue.reactive(pick(refedProps, Object.keys(tooltipV2RootProps)));
  47946. const triggerProps = vue.reactive(pick(refedProps, Object.keys(tooltipV2TriggerProps)));
  47947. return (_ctx, _cache) => {
  47948. return vue.openBlock(), vue.createBlock(TooltipV2Root, vue.normalizeProps(vue.guardReactiveProps(rootProps)), {
  47949. default: vue.withCtx(({ open }) => [
  47950. vue.createVNode(TooltipV2Trigger, vue.mergeProps(triggerProps, { nowrap: "" }), {
  47951. default: vue.withCtx(() => [
  47952. vue.renderSlot(_ctx.$slots, "trigger")
  47953. ]),
  47954. _: 3
  47955. }, 16),
  47956. (vue.openBlock(), vue.createBlock(vue.Teleport, {
  47957. to: _ctx.to,
  47958. disabled: !_ctx.teleported
  47959. }, [
  47960. _ctx.fullTransition ? (vue.openBlock(), vue.createBlock(vue.Transition, vue.normalizeProps(vue.mergeProps({ key: 0 }, _ctx.transitionProps)), {
  47961. default: vue.withCtx(() => [
  47962. _ctx.alwaysOn || open ? (vue.openBlock(), vue.createBlock(TooltipV2Content, vue.normalizeProps(vue.mergeProps({ key: 0 }, contentProps)), {
  47963. arrow: vue.withCtx(({ style, side }) => [
  47964. _ctx.showArrow ? (vue.openBlock(), vue.createBlock(TooltipV2Arrow, vue.mergeProps({ key: 0 }, arrowProps, {
  47965. style,
  47966. side
  47967. }), null, 16, ["style", "side"])) : vue.createCommentVNode("v-if", true)
  47968. ]),
  47969. default: vue.withCtx(() => [
  47970. vue.renderSlot(_ctx.$slots, "default")
  47971. ]),
  47972. _: 3
  47973. }, 16)) : vue.createCommentVNode("v-if", true)
  47974. ]),
  47975. _: 2
  47976. }, 1040)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  47977. _ctx.alwaysOn || open ? (vue.openBlock(), vue.createBlock(TooltipV2Content, vue.normalizeProps(vue.mergeProps({ key: 0 }, contentProps)), {
  47978. arrow: vue.withCtx(({ style, side }) => [
  47979. _ctx.showArrow ? (vue.openBlock(), vue.createBlock(TooltipV2Arrow, vue.mergeProps({ key: 0 }, arrowProps, {
  47980. style,
  47981. side
  47982. }), null, 16, ["style", "side"])) : vue.createCommentVNode("v-if", true)
  47983. ]),
  47984. default: vue.withCtx(() => [
  47985. vue.renderSlot(_ctx.$slots, "default")
  47986. ]),
  47987. _: 3
  47988. }, 16)) : vue.createCommentVNode("v-if", true)
  47989. ], 64))
  47990. ], 8, ["to", "disabled"]))
  47991. ]),
  47992. _: 3
  47993. }, 16);
  47994. };
  47995. }
  47996. });
  47997. var TooltipV2 = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "tooltip.vue"]]);
  47998. const ElTooltipV2 = withInstall(TooltipV2);
  47999. const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
  48000. const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
  48001. const transferProps = buildProps({
  48002. data: {
  48003. type: definePropType(Array),
  48004. default: () => []
  48005. },
  48006. titles: {
  48007. type: definePropType(Array),
  48008. default: () => []
  48009. },
  48010. buttonTexts: {
  48011. type: definePropType(Array),
  48012. default: () => []
  48013. },
  48014. filterPlaceholder: String,
  48015. filterMethod: {
  48016. type: definePropType(Function)
  48017. },
  48018. leftDefaultChecked: {
  48019. type: definePropType(Array),
  48020. default: () => []
  48021. },
  48022. rightDefaultChecked: {
  48023. type: definePropType(Array),
  48024. default: () => []
  48025. },
  48026. renderContent: {
  48027. type: definePropType(Function)
  48028. },
  48029. modelValue: {
  48030. type: definePropType(Array),
  48031. default: () => []
  48032. },
  48033. format: {
  48034. type: definePropType(Object),
  48035. default: () => ({})
  48036. },
  48037. filterable: Boolean,
  48038. props: {
  48039. type: definePropType(Object),
  48040. default: () => mutable({
  48041. label: "label",
  48042. key: "key",
  48043. disabled: "disabled"
  48044. })
  48045. },
  48046. targetOrder: {
  48047. type: String,
  48048. values: ["original", "push", "unshift"],
  48049. default: "original"
  48050. },
  48051. validateEvent: {
  48052. type: Boolean,
  48053. default: true
  48054. }
  48055. });
  48056. const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray) || isArray(value) && isNil(movedKeys);
  48057. const transferEmits = {
  48058. [CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray) && ["left", "right"].includes(direction),
  48059. [UPDATE_MODEL_EVENT]: (value) => isArray(value),
  48060. [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
  48061. [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
  48062. };
  48063. const CHECKED_CHANGE_EVENT = "checked-change";
  48064. const transferPanelProps = buildProps({
  48065. data: transferProps.data,
  48066. optionRender: {
  48067. type: definePropType(Function)
  48068. },
  48069. placeholder: String,
  48070. title: String,
  48071. filterable: Boolean,
  48072. format: transferProps.format,
  48073. filterMethod: transferProps.filterMethod,
  48074. defaultChecked: transferProps.leftDefaultChecked,
  48075. props: transferProps.props
  48076. });
  48077. const transferPanelEmits = {
  48078. [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn
  48079. };
  48080. const usePropsAlias = (props) => {
  48081. const initProps = {
  48082. label: "label",
  48083. key: "key",
  48084. disabled: "disabled"
  48085. };
  48086. return vue.computed(() => ({
  48087. ...initProps,
  48088. ...props.props
  48089. }));
  48090. };
  48091. const useCheck$1 = (props, panelState, emit) => {
  48092. const propsAlias = usePropsAlias(props);
  48093. const filteredData = vue.computed(() => {
  48094. return props.data.filter((item) => {
  48095. if (isFunction(props.filterMethod)) {
  48096. return props.filterMethod(panelState.query, item);
  48097. } else {
  48098. const label = String(item[propsAlias.value.label] || item[propsAlias.value.key]);
  48099. return label.toLowerCase().includes(panelState.query.toLowerCase());
  48100. }
  48101. });
  48102. });
  48103. const checkableData = vue.computed(() => filteredData.value.filter((item) => !item[propsAlias.value.disabled]));
  48104. const checkedSummary = vue.computed(() => {
  48105. const checkedLength = panelState.checked.length;
  48106. const dataLength = props.data.length;
  48107. const { noChecked, hasChecked } = props.format;
  48108. if (noChecked && hasChecked) {
  48109. return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
  48110. } else {
  48111. return `${checkedLength}/${dataLength}`;
  48112. }
  48113. });
  48114. const isIndeterminate = vue.computed(() => {
  48115. const checkedLength = panelState.checked.length;
  48116. return checkedLength > 0 && checkedLength < checkableData.value.length;
  48117. });
  48118. const updateAllChecked = () => {
  48119. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  48120. panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item));
  48121. };
  48122. const handleAllCheckedChange = (value) => {
  48123. panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
  48124. };
  48125. vue.watch(() => panelState.checked, (val, oldVal) => {
  48126. updateAllChecked();
  48127. if (panelState.checkChangeByUser) {
  48128. const movedKeys = val.concat(oldVal).filter((v) => !val.includes(v) || !oldVal.includes(v));
  48129. emit(CHECKED_CHANGE_EVENT, val, movedKeys);
  48130. } else {
  48131. emit(CHECKED_CHANGE_EVENT, val);
  48132. panelState.checkChangeByUser = true;
  48133. }
  48134. });
  48135. vue.watch(checkableData, () => {
  48136. updateAllChecked();
  48137. });
  48138. vue.watch(() => props.data, () => {
  48139. const checked = [];
  48140. const filteredDataKeys = filteredData.value.map((item) => item[propsAlias.value.key]);
  48141. panelState.checked.forEach((item) => {
  48142. if (filteredDataKeys.includes(item)) {
  48143. checked.push(item);
  48144. }
  48145. });
  48146. panelState.checkChangeByUser = false;
  48147. panelState.checked = checked;
  48148. });
  48149. vue.watch(() => props.defaultChecked, (val, oldVal) => {
  48150. if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item)))
  48151. return;
  48152. const checked = [];
  48153. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  48154. val.forEach((item) => {
  48155. if (checkableDataKeys.includes(item)) {
  48156. checked.push(item);
  48157. }
  48158. });
  48159. panelState.checkChangeByUser = false;
  48160. panelState.checked = checked;
  48161. }, {
  48162. immediate: true
  48163. });
  48164. return {
  48165. filteredData,
  48166. checkableData,
  48167. checkedSummary,
  48168. isIndeterminate,
  48169. updateAllChecked,
  48170. handleAllCheckedChange
  48171. };
  48172. };
  48173. const useCheckedChange = (checkedState, emit) => {
  48174. const onSourceCheckedChange = (val, movedKeys) => {
  48175. checkedState.leftChecked = val;
  48176. if (!movedKeys)
  48177. return;
  48178. emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
  48179. };
  48180. const onTargetCheckedChange = (val, movedKeys) => {
  48181. checkedState.rightChecked = val;
  48182. if (!movedKeys)
  48183. return;
  48184. emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
  48185. };
  48186. return {
  48187. onSourceCheckedChange,
  48188. onTargetCheckedChange
  48189. };
  48190. };
  48191. const useComputedData = (props) => {
  48192. const propsAlias = usePropsAlias(props);
  48193. const dataObj = vue.computed(() => props.data.reduce((o, cur) => (o[cur[propsAlias.value.key]] = cur) && o, {}));
  48194. const sourceData = vue.computed(() => props.data.filter((item) => !props.modelValue.includes(item[propsAlias.value.key])));
  48195. const targetData = vue.computed(() => {
  48196. if (props.targetOrder === "original") {
  48197. return props.data.filter((item) => props.modelValue.includes(item[propsAlias.value.key]));
  48198. } else {
  48199. return props.modelValue.reduce((arr, cur) => {
  48200. const val = dataObj.value[cur];
  48201. if (val) {
  48202. arr.push(val);
  48203. }
  48204. return arr;
  48205. }, []);
  48206. }
  48207. });
  48208. return {
  48209. sourceData,
  48210. targetData
  48211. };
  48212. };
  48213. const useMove = (props, checkedState, emit) => {
  48214. const propsAlias = usePropsAlias(props);
  48215. const _emit = (value, direction, movedKeys) => {
  48216. emit(UPDATE_MODEL_EVENT, value);
  48217. emit(CHANGE_EVENT, value, direction, movedKeys);
  48218. };
  48219. const addToLeft = () => {
  48220. const currentValue = props.modelValue.slice();
  48221. checkedState.rightChecked.forEach((item) => {
  48222. const index = currentValue.indexOf(item);
  48223. if (index > -1) {
  48224. currentValue.splice(index, 1);
  48225. }
  48226. });
  48227. _emit(currentValue, "left", checkedState.rightChecked);
  48228. };
  48229. const addToRight = () => {
  48230. let currentValue = props.modelValue.slice();
  48231. const itemsToBeMoved = props.data.filter((item) => {
  48232. const itemKey = item[propsAlias.value.key];
  48233. return checkedState.leftChecked.includes(itemKey) && !props.modelValue.includes(itemKey);
  48234. }).map((item) => item[propsAlias.value.key]);
  48235. currentValue = props.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  48236. if (props.targetOrder === "original") {
  48237. currentValue = props.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]);
  48238. }
  48239. _emit(currentValue, "right", checkedState.leftChecked);
  48240. };
  48241. return {
  48242. addToLeft,
  48243. addToRight
  48244. };
  48245. };
  48246. const __default__$9 = vue.defineComponent({
  48247. name: "ElTransferPanel"
  48248. });
  48249. const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
  48250. ...__default__$9,
  48251. props: transferPanelProps,
  48252. emits: transferPanelEmits,
  48253. setup(__props, { expose, emit }) {
  48254. const props = __props;
  48255. const slots = vue.useSlots();
  48256. const OptionContent = ({ option }) => option;
  48257. const { t } = useLocale();
  48258. const ns = useNamespace("transfer");
  48259. const panelState = vue.reactive({
  48260. checked: [],
  48261. allChecked: false,
  48262. query: "",
  48263. checkChangeByUser: true
  48264. });
  48265. const propsAlias = usePropsAlias(props);
  48266. const {
  48267. filteredData,
  48268. checkedSummary,
  48269. isIndeterminate,
  48270. handleAllCheckedChange
  48271. } = useCheck$1(props, panelState, emit);
  48272. const hasNoMatch = vue.computed(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
  48273. const hasFooter = vue.computed(() => !isEmpty(slots.default()[0].children));
  48274. const { checked, allChecked, query } = vue.toRefs(panelState);
  48275. expose({
  48276. query
  48277. });
  48278. return (_ctx, _cache) => {
  48279. return vue.openBlock(), vue.createElementBlock("div", {
  48280. class: vue.normalizeClass(vue.unref(ns).b("panel"))
  48281. }, [
  48282. vue.createElementVNode("p", {
  48283. class: vue.normalizeClass(vue.unref(ns).be("panel", "header"))
  48284. }, [
  48285. vue.createVNode(vue.unref(ElCheckbox), {
  48286. modelValue: vue.unref(allChecked),
  48287. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(allChecked) ? allChecked.value = $event : null),
  48288. indeterminate: vue.unref(isIndeterminate),
  48289. "validate-event": false,
  48290. onChange: vue.unref(handleAllCheckedChange)
  48291. }, {
  48292. default: vue.withCtx(() => [
  48293. vue.createTextVNode(vue.toDisplayString(_ctx.title) + " ", 1),
  48294. vue.createElementVNode("span", null, vue.toDisplayString(vue.unref(checkedSummary)), 1)
  48295. ]),
  48296. _: 1
  48297. }, 8, ["modelValue", "indeterminate", "onChange"])
  48298. ], 2),
  48299. vue.createElementVNode("div", {
  48300. class: vue.normalizeClass([vue.unref(ns).be("panel", "body"), vue.unref(ns).is("with-footer", vue.unref(hasFooter))])
  48301. }, [
  48302. _ctx.filterable ? (vue.openBlock(), vue.createBlock(vue.unref(ElInput), {
  48303. key: 0,
  48304. modelValue: vue.unref(query),
  48305. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(query) ? query.value = $event : null),
  48306. class: vue.normalizeClass(vue.unref(ns).be("panel", "filter")),
  48307. size: "default",
  48308. placeholder: _ctx.placeholder,
  48309. "prefix-icon": vue.unref(search_default),
  48310. clearable: "",
  48311. "validate-event": false
  48312. }, null, 8, ["modelValue", "class", "placeholder", "prefix-icon"])) : vue.createCommentVNode("v-if", true),
  48313. vue.withDirectives(vue.createVNode(vue.unref(ElCheckboxGroup$1), {
  48314. modelValue: vue.unref(checked),
  48315. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => vue.isRef(checked) ? checked.value = $event : null),
  48316. "validate-event": false,
  48317. class: vue.normalizeClass([vue.unref(ns).is("filterable", _ctx.filterable), vue.unref(ns).be("panel", "list")])
  48318. }, {
  48319. default: vue.withCtx(() => [
  48320. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(filteredData), (item) => {
  48321. return vue.openBlock(), vue.createBlock(vue.unref(ElCheckbox), {
  48322. key: item[vue.unref(propsAlias).key],
  48323. class: vue.normalizeClass(vue.unref(ns).be("panel", "item")),
  48324. label: item[vue.unref(propsAlias).key],
  48325. disabled: item[vue.unref(propsAlias).disabled],
  48326. "validate-event": false
  48327. }, {
  48328. default: vue.withCtx(() => {
  48329. var _a;
  48330. return [
  48331. vue.createVNode(OptionContent, {
  48332. option: (_a = _ctx.optionRender) == null ? void 0 : _a.call(_ctx, item)
  48333. }, null, 8, ["option"])
  48334. ];
  48335. }),
  48336. _: 2
  48337. }, 1032, ["class", "label", "disabled"]);
  48338. }), 128))
  48339. ]),
  48340. _: 1
  48341. }, 8, ["modelValue", "class"]), [
  48342. [vue.vShow, !vue.unref(hasNoMatch) && !vue.unref(isEmpty)(_ctx.data)]
  48343. ]),
  48344. vue.withDirectives(vue.createElementVNode("p", {
  48345. class: vue.normalizeClass(vue.unref(ns).be("panel", "empty"))
  48346. }, vue.toDisplayString(vue.unref(hasNoMatch) ? vue.unref(t)("el.transfer.noMatch") : vue.unref(t)("el.transfer.noData")), 3), [
  48347. [vue.vShow, vue.unref(hasNoMatch) || vue.unref(isEmpty)(_ctx.data)]
  48348. ])
  48349. ], 2),
  48350. vue.unref(hasFooter) ? (vue.openBlock(), vue.createElementBlock("p", {
  48351. key: 0,
  48352. class: vue.normalizeClass(vue.unref(ns).be("panel", "footer"))
  48353. }, [
  48354. vue.renderSlot(_ctx.$slots, "default")
  48355. ], 2)) : vue.createCommentVNode("v-if", true)
  48356. ], 2);
  48357. };
  48358. }
  48359. });
  48360. var TransferPanel = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "transfer-panel.vue"]]);
  48361. const _hoisted_1$8 = { key: 0 };
  48362. const _hoisted_2$6 = { key: 0 };
  48363. const __default__$8 = vue.defineComponent({
  48364. name: "ElTransfer"
  48365. });
  48366. const _sfc_main$d = /* @__PURE__ */ vue.defineComponent({
  48367. ...__default__$8,
  48368. props: transferProps,
  48369. emits: transferEmits,
  48370. setup(__props, { expose, emit }) {
  48371. const props = __props;
  48372. const slots = vue.useSlots();
  48373. const { t } = useLocale();
  48374. const ns = useNamespace("transfer");
  48375. const { formItem } = useFormItem();
  48376. const checkedState = vue.reactive({
  48377. leftChecked: [],
  48378. rightChecked: []
  48379. });
  48380. const propsAlias = usePropsAlias(props);
  48381. const { sourceData, targetData } = useComputedData(props);
  48382. const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit);
  48383. const { addToLeft, addToRight } = useMove(props, checkedState, emit);
  48384. const leftPanel = vue.ref();
  48385. const rightPanel = vue.ref();
  48386. const clearQuery = (which) => {
  48387. switch (which) {
  48388. case "left":
  48389. leftPanel.value.query = "";
  48390. break;
  48391. case "right":
  48392. rightPanel.value.query = "";
  48393. break;
  48394. }
  48395. };
  48396. const hasButtonTexts = vue.computed(() => props.buttonTexts.length === 2);
  48397. const leftPanelTitle = vue.computed(() => props.titles[0] || t("el.transfer.titles.0"));
  48398. const rightPanelTitle = vue.computed(() => props.titles[1] || t("el.transfer.titles.1"));
  48399. const panelFilterPlaceholder = vue.computed(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
  48400. vue.watch(() => props.modelValue, () => {
  48401. var _a;
  48402. if (props.validateEvent) {
  48403. (_a = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a.call(formItem, "change").catch((err) => debugWarn());
  48404. }
  48405. });
  48406. const optionRender = vue.computed(() => (option) => {
  48407. if (props.renderContent)
  48408. return props.renderContent(vue.h, option);
  48409. if (slots.default)
  48410. return slots.default({ option });
  48411. return vue.h("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
  48412. });
  48413. expose({
  48414. clearQuery,
  48415. leftPanel,
  48416. rightPanel
  48417. });
  48418. return (_ctx, _cache) => {
  48419. return vue.openBlock(), vue.createElementBlock("div", {
  48420. class: vue.normalizeClass(vue.unref(ns).b())
  48421. }, [
  48422. vue.createVNode(TransferPanel, {
  48423. ref_key: "leftPanel",
  48424. ref: leftPanel,
  48425. data: vue.unref(sourceData),
  48426. "option-render": vue.unref(optionRender),
  48427. placeholder: vue.unref(panelFilterPlaceholder),
  48428. title: vue.unref(leftPanelTitle),
  48429. filterable: _ctx.filterable,
  48430. format: _ctx.format,
  48431. "filter-method": _ctx.filterMethod,
  48432. "default-checked": _ctx.leftDefaultChecked,
  48433. props: props.props,
  48434. onCheckedChange: vue.unref(onSourceCheckedChange)
  48435. }, {
  48436. default: vue.withCtx(() => [
  48437. vue.renderSlot(_ctx.$slots, "left-footer")
  48438. ]),
  48439. _: 3
  48440. }, 8, ["data", "option-render", "placeholder", "title", "filterable", "format", "filter-method", "default-checked", "props", "onCheckedChange"]),
  48441. vue.createElementVNode("div", {
  48442. class: vue.normalizeClass(vue.unref(ns).e("buttons"))
  48443. }, [
  48444. vue.createVNode(vue.unref(ElButton), {
  48445. type: "primary",
  48446. class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
  48447. disabled: vue.unref(isEmpty)(checkedState.rightChecked),
  48448. onClick: vue.unref(addToLeft)
  48449. }, {
  48450. default: vue.withCtx(() => [
  48451. vue.createVNode(vue.unref(ElIcon), null, {
  48452. default: vue.withCtx(() => [
  48453. vue.createVNode(vue.unref(arrow_left_default))
  48454. ]),
  48455. _: 1
  48456. }),
  48457. !vue.unref(isUndefined)(_ctx.buttonTexts[0]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$8, vue.toDisplayString(_ctx.buttonTexts[0]), 1)) : vue.createCommentVNode("v-if", true)
  48458. ]),
  48459. _: 1
  48460. }, 8, ["class", "disabled", "onClick"]),
  48461. vue.createVNode(vue.unref(ElButton), {
  48462. type: "primary",
  48463. class: vue.normalizeClass([vue.unref(ns).e("button"), vue.unref(ns).is("with-texts", vue.unref(hasButtonTexts))]),
  48464. disabled: vue.unref(isEmpty)(checkedState.leftChecked),
  48465. onClick: vue.unref(addToRight)
  48466. }, {
  48467. default: vue.withCtx(() => [
  48468. !vue.unref(isUndefined)(_ctx.buttonTexts[1]) ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$6, vue.toDisplayString(_ctx.buttonTexts[1]), 1)) : vue.createCommentVNode("v-if", true),
  48469. vue.createVNode(vue.unref(ElIcon), null, {
  48470. default: vue.withCtx(() => [
  48471. vue.createVNode(vue.unref(arrow_right_default))
  48472. ]),
  48473. _: 1
  48474. })
  48475. ]),
  48476. _: 1
  48477. }, 8, ["class", "disabled", "onClick"])
  48478. ], 2),
  48479. vue.createVNode(TransferPanel, {
  48480. ref_key: "rightPanel",
  48481. ref: rightPanel,
  48482. data: vue.unref(targetData),
  48483. "option-render": vue.unref(optionRender),
  48484. placeholder: vue.unref(panelFilterPlaceholder),
  48485. filterable: _ctx.filterable,
  48486. format: _ctx.format,
  48487. "filter-method": _ctx.filterMethod,
  48488. title: vue.unref(rightPanelTitle),
  48489. "default-checked": _ctx.rightDefaultChecked,
  48490. props: props.props,
  48491. onCheckedChange: vue.unref(onTargetCheckedChange)
  48492. }, {
  48493. default: vue.withCtx(() => [
  48494. vue.renderSlot(_ctx.$slots, "right-footer")
  48495. ]),
  48496. _: 3
  48497. }, 8, ["data", "option-render", "placeholder", "filterable", "format", "filter-method", "title", "default-checked", "props", "onCheckedChange"])
  48498. ], 2);
  48499. };
  48500. }
  48501. });
  48502. var Transfer = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "transfer.vue"]]);
  48503. const ElTransfer = withInstall(Transfer);
  48504. const NODE_KEY = "$treeNodeId";
  48505. const markNodeData = function(node, data) {
  48506. if (!data || data[NODE_KEY])
  48507. return;
  48508. Object.defineProperty(data, NODE_KEY, {
  48509. value: node.id,
  48510. enumerable: false,
  48511. configurable: false,
  48512. writable: false
  48513. });
  48514. };
  48515. const getNodeKey = function(key, data) {
  48516. if (!key)
  48517. return data[NODE_KEY];
  48518. return data[key];
  48519. };
  48520. const handleCurrentChange = (store, emit, setCurrent) => {
  48521. const preCurrentNode = store.value.currentNode;
  48522. setCurrent();
  48523. const currentNode = store.value.currentNode;
  48524. if (preCurrentNode === currentNode)
  48525. return;
  48526. emit("current-change", currentNode ? currentNode.data : null, currentNode);
  48527. };
  48528. const getChildState = (node) => {
  48529. let all = true;
  48530. let none = true;
  48531. let allWithoutDisable = true;
  48532. for (let i = 0, j = node.length; i < j; i++) {
  48533. const n = node[i];
  48534. if (n.checked !== true || n.indeterminate) {
  48535. all = false;
  48536. if (!n.disabled) {
  48537. allWithoutDisable = false;
  48538. }
  48539. }
  48540. if (n.checked !== false || n.indeterminate) {
  48541. none = false;
  48542. }
  48543. }
  48544. return { all, none, allWithoutDisable, half: !all && !none };
  48545. };
  48546. const reInitChecked = function(node) {
  48547. if (node.childNodes.length === 0 || node.loading)
  48548. return;
  48549. const { all, none, half } = getChildState(node.childNodes);
  48550. if (all) {
  48551. node.checked = true;
  48552. node.indeterminate = false;
  48553. } else if (half) {
  48554. node.checked = false;
  48555. node.indeterminate = true;
  48556. } else if (none) {
  48557. node.checked = false;
  48558. node.indeterminate = false;
  48559. }
  48560. const parent = node.parent;
  48561. if (!parent || parent.level === 0)
  48562. return;
  48563. if (!node.store.checkStrictly) {
  48564. reInitChecked(parent);
  48565. }
  48566. };
  48567. const getPropertyFromData = function(node, prop) {
  48568. const props = node.store.props;
  48569. const data = node.data || {};
  48570. const config = props[prop];
  48571. if (typeof config === "function") {
  48572. return config(data, node);
  48573. } else if (typeof config === "string") {
  48574. return data[config];
  48575. } else if (typeof config === "undefined") {
  48576. const dataProp = data[prop];
  48577. return dataProp === void 0 ? "" : dataProp;
  48578. }
  48579. };
  48580. let nodeIdSeed = 0;
  48581. class Node {
  48582. constructor(options) {
  48583. this.id = nodeIdSeed++;
  48584. this.text = null;
  48585. this.checked = false;
  48586. this.indeterminate = false;
  48587. this.data = null;
  48588. this.expanded = false;
  48589. this.parent = null;
  48590. this.visible = true;
  48591. this.isCurrent = false;
  48592. this.canFocus = false;
  48593. for (const name in options) {
  48594. if (hasOwn(options, name)) {
  48595. this[name] = options[name];
  48596. }
  48597. }
  48598. this.level = 0;
  48599. this.loaded = false;
  48600. this.childNodes = [];
  48601. this.loading = false;
  48602. if (this.parent) {
  48603. this.level = this.parent.level + 1;
  48604. }
  48605. }
  48606. initialize() {
  48607. const store = this.store;
  48608. if (!store) {
  48609. throw new Error("[Node]store is required!");
  48610. }
  48611. store.registerNode(this);
  48612. const props = store.props;
  48613. if (props && typeof props.isLeaf !== "undefined") {
  48614. const isLeaf = getPropertyFromData(this, "isLeaf");
  48615. if (typeof isLeaf === "boolean") {
  48616. this.isLeafByUser = isLeaf;
  48617. }
  48618. }
  48619. if (store.lazy !== true && this.data) {
  48620. this.setData(this.data);
  48621. if (store.defaultExpandAll) {
  48622. this.expanded = true;
  48623. this.canFocus = true;
  48624. }
  48625. } else if (this.level > 0 && store.lazy && store.defaultExpandAll) {
  48626. this.expand();
  48627. }
  48628. if (!Array.isArray(this.data)) {
  48629. markNodeData(this, this.data);
  48630. }
  48631. if (!this.data)
  48632. return;
  48633. const defaultExpandedKeys = store.defaultExpandedKeys;
  48634. const key = store.key;
  48635. if (key && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) {
  48636. this.expand(null, store.autoExpandParent);
  48637. }
  48638. if (key && store.currentNodeKey !== void 0 && this.key === store.currentNodeKey) {
  48639. store.currentNode = this;
  48640. store.currentNode.isCurrent = true;
  48641. }
  48642. if (store.lazy) {
  48643. store._initDefaultCheckedNode(this);
  48644. }
  48645. this.updateLeafState();
  48646. if (this.parent && (this.level === 1 || this.parent.expanded === true))
  48647. this.canFocus = true;
  48648. }
  48649. setData(data) {
  48650. if (!Array.isArray(data)) {
  48651. markNodeData(this, data);
  48652. }
  48653. this.data = data;
  48654. this.childNodes = [];
  48655. let children;
  48656. if (this.level === 0 && Array.isArray(this.data)) {
  48657. children = this.data;
  48658. } else {
  48659. children = getPropertyFromData(this, "children") || [];
  48660. }
  48661. for (let i = 0, j = children.length; i < j; i++) {
  48662. this.insertChild({ data: children[i] });
  48663. }
  48664. }
  48665. get label() {
  48666. return getPropertyFromData(this, "label");
  48667. }
  48668. get key() {
  48669. const nodeKey = this.store.key;
  48670. if (this.data)
  48671. return this.data[nodeKey];
  48672. return null;
  48673. }
  48674. get disabled() {
  48675. return getPropertyFromData(this, "disabled");
  48676. }
  48677. get nextSibling() {
  48678. const parent = this.parent;
  48679. if (parent) {
  48680. const index = parent.childNodes.indexOf(this);
  48681. if (index > -1) {
  48682. return parent.childNodes[index + 1];
  48683. }
  48684. }
  48685. return null;
  48686. }
  48687. get previousSibling() {
  48688. const parent = this.parent;
  48689. if (parent) {
  48690. const index = parent.childNodes.indexOf(this);
  48691. if (index > -1) {
  48692. return index > 0 ? parent.childNodes[index - 1] : null;
  48693. }
  48694. }
  48695. return null;
  48696. }
  48697. contains(target, deep = true) {
  48698. return (this.childNodes || []).some((child) => child === target || deep && child.contains(target));
  48699. }
  48700. remove() {
  48701. const parent = this.parent;
  48702. if (parent) {
  48703. parent.removeChild(this);
  48704. }
  48705. }
  48706. insertChild(child, index, batch) {
  48707. if (!child)
  48708. throw new Error("InsertChild error: child is required.");
  48709. if (!(child instanceof Node)) {
  48710. if (!batch) {
  48711. const children = this.getChildren(true);
  48712. if (!children.includes(child.data)) {
  48713. if (typeof index === "undefined" || index < 0) {
  48714. children.push(child.data);
  48715. } else {
  48716. children.splice(index, 0, child.data);
  48717. }
  48718. }
  48719. }
  48720. Object.assign(child, {
  48721. parent: this,
  48722. store: this.store
  48723. });
  48724. child = vue.reactive(new Node(child));
  48725. if (child instanceof Node) {
  48726. child.initialize();
  48727. }
  48728. }
  48729. child.level = this.level + 1;
  48730. if (typeof index === "undefined" || index < 0) {
  48731. this.childNodes.push(child);
  48732. } else {
  48733. this.childNodes.splice(index, 0, child);
  48734. }
  48735. this.updateLeafState();
  48736. }
  48737. insertBefore(child, ref) {
  48738. let index;
  48739. if (ref) {
  48740. index = this.childNodes.indexOf(ref);
  48741. }
  48742. this.insertChild(child, index);
  48743. }
  48744. insertAfter(child, ref) {
  48745. let index;
  48746. if (ref) {
  48747. index = this.childNodes.indexOf(ref);
  48748. if (index !== -1)
  48749. index += 1;
  48750. }
  48751. this.insertChild(child, index);
  48752. }
  48753. removeChild(child) {
  48754. const children = this.getChildren() || [];
  48755. const dataIndex = children.indexOf(child.data);
  48756. if (dataIndex > -1) {
  48757. children.splice(dataIndex, 1);
  48758. }
  48759. const index = this.childNodes.indexOf(child);
  48760. if (index > -1) {
  48761. this.store && this.store.deregisterNode(child);
  48762. child.parent = null;
  48763. this.childNodes.splice(index, 1);
  48764. }
  48765. this.updateLeafState();
  48766. }
  48767. removeChildByData(data) {
  48768. let targetNode = null;
  48769. for (let i = 0; i < this.childNodes.length; i++) {
  48770. if (this.childNodes[i].data === data) {
  48771. targetNode = this.childNodes[i];
  48772. break;
  48773. }
  48774. }
  48775. if (targetNode) {
  48776. this.removeChild(targetNode);
  48777. }
  48778. }
  48779. expand(callback, expandParent) {
  48780. const done = () => {
  48781. if (expandParent) {
  48782. let parent = this.parent;
  48783. while (parent.level > 0) {
  48784. parent.expanded = true;
  48785. parent = parent.parent;
  48786. }
  48787. }
  48788. this.expanded = true;
  48789. if (callback)
  48790. callback();
  48791. this.childNodes.forEach((item) => {
  48792. item.canFocus = true;
  48793. });
  48794. };
  48795. if (this.shouldLoadData()) {
  48796. this.loadData((data) => {
  48797. if (Array.isArray(data)) {
  48798. if (this.checked) {
  48799. this.setChecked(true, true);
  48800. } else if (!this.store.checkStrictly) {
  48801. reInitChecked(this);
  48802. }
  48803. done();
  48804. }
  48805. });
  48806. } else {
  48807. done();
  48808. }
  48809. }
  48810. doCreateChildren(array, defaultProps = {}) {
  48811. array.forEach((item) => {
  48812. this.insertChild(Object.assign({ data: item }, defaultProps), void 0, true);
  48813. });
  48814. }
  48815. collapse() {
  48816. this.expanded = false;
  48817. this.childNodes.forEach((item) => {
  48818. item.canFocus = false;
  48819. });
  48820. }
  48821. shouldLoadData() {
  48822. return this.store.lazy === true && this.store.load && !this.loaded;
  48823. }
  48824. updateLeafState() {
  48825. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") {
  48826. this.isLeaf = this.isLeafByUser;
  48827. return;
  48828. }
  48829. const childNodes = this.childNodes;
  48830. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  48831. this.isLeaf = !childNodes || childNodes.length === 0;
  48832. return;
  48833. }
  48834. this.isLeaf = false;
  48835. }
  48836. setChecked(value, deep, recursion, passValue) {
  48837. this.indeterminate = value === "half";
  48838. this.checked = value === true;
  48839. if (this.store.checkStrictly)
  48840. return;
  48841. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  48842. const { all, allWithoutDisable } = getChildState(this.childNodes);
  48843. if (!this.isLeaf && !all && allWithoutDisable) {
  48844. this.checked = false;
  48845. value = false;
  48846. }
  48847. const handleDescendants = () => {
  48848. if (deep) {
  48849. const childNodes = this.childNodes;
  48850. for (let i = 0, j = childNodes.length; i < j; i++) {
  48851. const child = childNodes[i];
  48852. passValue = passValue || value !== false;
  48853. const isCheck = child.disabled ? child.checked : passValue;
  48854. child.setChecked(isCheck, deep, true, passValue);
  48855. }
  48856. const { half, all: all2 } = getChildState(childNodes);
  48857. if (!all2) {
  48858. this.checked = all2;
  48859. this.indeterminate = half;
  48860. }
  48861. }
  48862. };
  48863. if (this.shouldLoadData()) {
  48864. this.loadData(() => {
  48865. handleDescendants();
  48866. reInitChecked(this);
  48867. }, {
  48868. checked: value !== false
  48869. });
  48870. return;
  48871. } else {
  48872. handleDescendants();
  48873. }
  48874. }
  48875. const parent = this.parent;
  48876. if (!parent || parent.level === 0)
  48877. return;
  48878. if (!recursion) {
  48879. reInitChecked(parent);
  48880. }
  48881. }
  48882. getChildren(forceInit = false) {
  48883. if (this.level === 0)
  48884. return this.data;
  48885. const data = this.data;
  48886. if (!data)
  48887. return null;
  48888. const props = this.store.props;
  48889. let children = "children";
  48890. if (props) {
  48891. children = props.children || "children";
  48892. }
  48893. if (data[children] === void 0) {
  48894. data[children] = null;
  48895. }
  48896. if (forceInit && !data[children]) {
  48897. data[children] = [];
  48898. }
  48899. return data[children];
  48900. }
  48901. updateChildren() {
  48902. const newData = this.getChildren() || [];
  48903. const oldData = this.childNodes.map((node) => node.data);
  48904. const newDataMap = {};
  48905. const newNodes = [];
  48906. newData.forEach((item, index) => {
  48907. const key = item[NODE_KEY];
  48908. const isNodeExists = !!key && oldData.findIndex((data) => data[NODE_KEY] === key) >= 0;
  48909. if (isNodeExists) {
  48910. newDataMap[key] = { index, data: item };
  48911. } else {
  48912. newNodes.push({ index, data: item });
  48913. }
  48914. });
  48915. if (!this.store.lazy) {
  48916. oldData.forEach((item) => {
  48917. if (!newDataMap[item[NODE_KEY]])
  48918. this.removeChildByData(item);
  48919. });
  48920. }
  48921. newNodes.forEach(({ index, data }) => {
  48922. this.insertChild({ data }, index);
  48923. });
  48924. this.updateLeafState();
  48925. }
  48926. loadData(callback, defaultProps = {}) {
  48927. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  48928. this.loading = true;
  48929. const resolve = (children) => {
  48930. this.childNodes = [];
  48931. this.doCreateChildren(children, defaultProps);
  48932. this.loaded = true;
  48933. this.loading = false;
  48934. this.updateLeafState();
  48935. if (callback) {
  48936. callback.call(this, children);
  48937. }
  48938. };
  48939. this.store.load(this, resolve);
  48940. } else {
  48941. if (callback) {
  48942. callback.call(this);
  48943. }
  48944. }
  48945. }
  48946. }
  48947. var Node$1 = Node;
  48948. class TreeStore {
  48949. constructor(options) {
  48950. this.currentNode = null;
  48951. this.currentNodeKey = null;
  48952. for (const option in options) {
  48953. if (hasOwn(options, option)) {
  48954. this[option] = options[option];
  48955. }
  48956. }
  48957. this.nodesMap = {};
  48958. }
  48959. initialize() {
  48960. this.root = new Node$1({
  48961. data: this.data,
  48962. store: this
  48963. });
  48964. this.root.initialize();
  48965. if (this.lazy && this.load) {
  48966. const loadFn = this.load;
  48967. loadFn(this.root, (data) => {
  48968. this.root.doCreateChildren(data);
  48969. this._initDefaultCheckedNodes();
  48970. });
  48971. } else {
  48972. this._initDefaultCheckedNodes();
  48973. }
  48974. }
  48975. filter(value) {
  48976. const filterNodeMethod = this.filterNodeMethod;
  48977. const lazy = this.lazy;
  48978. const traverse = function(node) {
  48979. const childNodes = node.root ? node.root.childNodes : node.childNodes;
  48980. childNodes.forEach((child) => {
  48981. child.visible = filterNodeMethod.call(child, value, child.data, child);
  48982. traverse(child);
  48983. });
  48984. if (!node.visible && childNodes.length) {
  48985. let allHidden = true;
  48986. allHidden = !childNodes.some((child) => child.visible);
  48987. if (node.root) {
  48988. node.root.visible = allHidden === false;
  48989. } else {
  48990. node.visible = allHidden === false;
  48991. }
  48992. }
  48993. if (!value)
  48994. return;
  48995. if (node.visible && !node.isLeaf && !lazy)
  48996. node.expand();
  48997. };
  48998. traverse(this);
  48999. }
  49000. setData(newVal) {
  49001. const instanceChanged = newVal !== this.root.data;
  49002. if (instanceChanged) {
  49003. this.root.setData(newVal);
  49004. this._initDefaultCheckedNodes();
  49005. } else {
  49006. this.root.updateChildren();
  49007. }
  49008. }
  49009. getNode(data) {
  49010. if (data instanceof Node$1)
  49011. return data;
  49012. const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
  49013. return this.nodesMap[key] || null;
  49014. }
  49015. insertBefore(data, refData) {
  49016. const refNode = this.getNode(refData);
  49017. refNode.parent.insertBefore({ data }, refNode);
  49018. }
  49019. insertAfter(data, refData) {
  49020. const refNode = this.getNode(refData);
  49021. refNode.parent.insertAfter({ data }, refNode);
  49022. }
  49023. remove(data) {
  49024. const node = this.getNode(data);
  49025. if (node && node.parent) {
  49026. if (node === this.currentNode) {
  49027. this.currentNode = null;
  49028. }
  49029. node.parent.removeChild(node);
  49030. }
  49031. }
  49032. append(data, parentData) {
  49033. const parentNode = parentData ? this.getNode(parentData) : this.root;
  49034. if (parentNode) {
  49035. parentNode.insertChild({ data });
  49036. }
  49037. }
  49038. _initDefaultCheckedNodes() {
  49039. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49040. const nodesMap = this.nodesMap;
  49041. defaultCheckedKeys.forEach((checkedKey) => {
  49042. const node = nodesMap[checkedKey];
  49043. if (node) {
  49044. node.setChecked(true, !this.checkStrictly);
  49045. }
  49046. });
  49047. }
  49048. _initDefaultCheckedNode(node) {
  49049. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49050. if (defaultCheckedKeys.includes(node.key)) {
  49051. node.setChecked(true, !this.checkStrictly);
  49052. }
  49053. }
  49054. setDefaultCheckedKey(newVal) {
  49055. if (newVal !== this.defaultCheckedKeys) {
  49056. this.defaultCheckedKeys = newVal;
  49057. this._initDefaultCheckedNodes();
  49058. }
  49059. }
  49060. registerNode(node) {
  49061. const key = this.key;
  49062. if (!node || !node.data)
  49063. return;
  49064. if (!key) {
  49065. this.nodesMap[node.id] = node;
  49066. } else {
  49067. const nodeKey = node.key;
  49068. if (nodeKey !== void 0)
  49069. this.nodesMap[node.key] = node;
  49070. }
  49071. }
  49072. deregisterNode(node) {
  49073. const key = this.key;
  49074. if (!key || !node || !node.data)
  49075. return;
  49076. node.childNodes.forEach((child) => {
  49077. this.deregisterNode(child);
  49078. });
  49079. delete this.nodesMap[node.key];
  49080. }
  49081. getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
  49082. const checkedNodes = [];
  49083. const traverse = function(node) {
  49084. const childNodes = node.root ? node.root.childNodes : node.childNodes;
  49085. childNodes.forEach((child) => {
  49086. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) {
  49087. checkedNodes.push(child.data);
  49088. }
  49089. traverse(child);
  49090. });
  49091. };
  49092. traverse(this);
  49093. return checkedNodes;
  49094. }
  49095. getCheckedKeys(leafOnly = false) {
  49096. return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
  49097. }
  49098. getHalfCheckedNodes() {
  49099. const nodes = [];
  49100. const traverse = function(node) {
  49101. const childNodes = node.root ? node.root.childNodes : node.childNodes;
  49102. childNodes.forEach((child) => {
  49103. if (child.indeterminate) {
  49104. nodes.push(child.data);
  49105. }
  49106. traverse(child);
  49107. });
  49108. };
  49109. traverse(this);
  49110. return nodes;
  49111. }
  49112. getHalfCheckedKeys() {
  49113. return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
  49114. }
  49115. _getAllNodes() {
  49116. const allNodes = [];
  49117. const nodesMap = this.nodesMap;
  49118. for (const nodeKey in nodesMap) {
  49119. if (hasOwn(nodesMap, nodeKey)) {
  49120. allNodes.push(nodesMap[nodeKey]);
  49121. }
  49122. }
  49123. return allNodes;
  49124. }
  49125. updateChildren(key, data) {
  49126. const node = this.nodesMap[key];
  49127. if (!node)
  49128. return;
  49129. const childNodes = node.childNodes;
  49130. for (let i = childNodes.length - 1; i >= 0; i--) {
  49131. const child = childNodes[i];
  49132. this.remove(child.data);
  49133. }
  49134. for (let i = 0, j = data.length; i < j; i++) {
  49135. const child = data[i];
  49136. this.append(child, node.data);
  49137. }
  49138. }
  49139. _setCheckedKeys(key, leafOnly = false, checkedKeys) {
  49140. const allNodes = this._getAllNodes().sort((a, b) => b.level - a.level);
  49141. const cache = /* @__PURE__ */ Object.create(null);
  49142. const keys = Object.keys(checkedKeys);
  49143. allNodes.forEach((node) => node.setChecked(false, false));
  49144. for (let i = 0, j = allNodes.length; i < j; i++) {
  49145. const node = allNodes[i];
  49146. const nodeKey = node.data[key].toString();
  49147. const checked = keys.includes(nodeKey);
  49148. if (!checked) {
  49149. if (node.checked && !cache[nodeKey]) {
  49150. node.setChecked(false, false);
  49151. }
  49152. continue;
  49153. }
  49154. let parent = node.parent;
  49155. while (parent && parent.level > 0) {
  49156. cache[parent.data[key]] = true;
  49157. parent = parent.parent;
  49158. }
  49159. if (node.isLeaf || this.checkStrictly) {
  49160. node.setChecked(true, false);
  49161. continue;
  49162. }
  49163. node.setChecked(true, true);
  49164. if (leafOnly) {
  49165. node.setChecked(false, false);
  49166. const traverse = function(node2) {
  49167. const childNodes = node2.childNodes;
  49168. childNodes.forEach((child) => {
  49169. if (!child.isLeaf) {
  49170. child.setChecked(false, false);
  49171. }
  49172. traverse(child);
  49173. });
  49174. };
  49175. traverse(node);
  49176. }
  49177. }
  49178. }
  49179. setCheckedNodes(array, leafOnly = false) {
  49180. const key = this.key;
  49181. const checkedKeys = {};
  49182. array.forEach((item) => {
  49183. checkedKeys[(item || {})[key]] = true;
  49184. });
  49185. this._setCheckedKeys(key, leafOnly, checkedKeys);
  49186. }
  49187. setCheckedKeys(keys, leafOnly = false) {
  49188. this.defaultCheckedKeys = keys;
  49189. const key = this.key;
  49190. const checkedKeys = {};
  49191. keys.forEach((key2) => {
  49192. checkedKeys[key2] = true;
  49193. });
  49194. this._setCheckedKeys(key, leafOnly, checkedKeys);
  49195. }
  49196. setDefaultExpandedKeys(keys) {
  49197. keys = keys || [];
  49198. this.defaultExpandedKeys = keys;
  49199. keys.forEach((key) => {
  49200. const node = this.getNode(key);
  49201. if (node)
  49202. node.expand(null, this.autoExpandParent);
  49203. });
  49204. }
  49205. setChecked(data, checked, deep) {
  49206. const node = this.getNode(data);
  49207. if (node) {
  49208. node.setChecked(!!checked, deep);
  49209. }
  49210. }
  49211. getCurrentNode() {
  49212. return this.currentNode;
  49213. }
  49214. setCurrentNode(currentNode) {
  49215. const prevCurrentNode = this.currentNode;
  49216. if (prevCurrentNode) {
  49217. prevCurrentNode.isCurrent = false;
  49218. }
  49219. this.currentNode = currentNode;
  49220. this.currentNode.isCurrent = true;
  49221. }
  49222. setUserCurrentNode(node, shouldAutoExpandParent = true) {
  49223. const key = node[this.key];
  49224. const currNode = this.nodesMap[key];
  49225. this.setCurrentNode(currNode);
  49226. if (shouldAutoExpandParent && this.currentNode.level > 1) {
  49227. this.currentNode.parent.expand(null, true);
  49228. }
  49229. }
  49230. setCurrentNodeKey(key, shouldAutoExpandParent = true) {
  49231. if (key === null || key === void 0) {
  49232. this.currentNode && (this.currentNode.isCurrent = false);
  49233. this.currentNode = null;
  49234. return;
  49235. }
  49236. const node = this.getNode(key);
  49237. if (node) {
  49238. this.setCurrentNode(node);
  49239. if (shouldAutoExpandParent && this.currentNode.level > 1) {
  49240. this.currentNode.parent.expand(null, true);
  49241. }
  49242. }
  49243. }
  49244. }
  49245. const _sfc_main$c = vue.defineComponent({
  49246. name: "ElTreeNodeContent",
  49247. props: {
  49248. node: {
  49249. type: Object,
  49250. required: true
  49251. },
  49252. renderContent: Function
  49253. },
  49254. setup(props) {
  49255. const ns = useNamespace("tree");
  49256. const nodeInstance = vue.inject("NodeInstance");
  49257. const tree = vue.inject("RootTree");
  49258. return () => {
  49259. const node = props.node;
  49260. const { data, store } = node;
  49261. return props.renderContent ? props.renderContent(vue.h, { _self: nodeInstance, node, data, store }) : tree.ctx.slots.default ? tree.ctx.slots.default({ node, data }) : vue.h("span", { class: ns.be("node", "label") }, [node.label]);
  49262. };
  49263. }
  49264. });
  49265. var NodeContent = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "tree-node-content.vue"]]);
  49266. function useNodeExpandEventBroadcast(props) {
  49267. const parentNodeMap = vue.inject("TreeNodeMap", null);
  49268. const currentNodeMap = {
  49269. treeNodeExpand: (node) => {
  49270. if (props.node !== node) {
  49271. props.node.collapse();
  49272. }
  49273. },
  49274. children: []
  49275. };
  49276. if (parentNodeMap) {
  49277. parentNodeMap.children.push(currentNodeMap);
  49278. }
  49279. vue.provide("TreeNodeMap", currentNodeMap);
  49280. return {
  49281. broadcastExpanded: (node) => {
  49282. if (!props.accordion)
  49283. return;
  49284. for (const childNode of currentNodeMap.children) {
  49285. childNode.treeNodeExpand(node);
  49286. }
  49287. }
  49288. };
  49289. }
  49290. const dragEventsKey = Symbol("dragEvents");
  49291. function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
  49292. const ns = useNamespace("tree");
  49293. const dragState = vue.ref({
  49294. showDropIndicator: false,
  49295. draggingNode: null,
  49296. dropNode: null,
  49297. allowDrop: true,
  49298. dropType: null
  49299. });
  49300. const treeNodeDragStart = ({ event, treeNode }) => {
  49301. if (typeof props.allowDrag === "function" && !props.allowDrag(treeNode.node)) {
  49302. event.preventDefault();
  49303. return false;
  49304. }
  49305. event.dataTransfer.effectAllowed = "move";
  49306. try {
  49307. event.dataTransfer.setData("text/plain", "");
  49308. } catch (e) {
  49309. }
  49310. dragState.value.draggingNode = treeNode;
  49311. ctx.emit("node-drag-start", treeNode.node, event);
  49312. };
  49313. const treeNodeDragOver = ({ event, treeNode }) => {
  49314. const dropNode = treeNode;
  49315. const oldDropNode = dragState.value.dropNode;
  49316. if (oldDropNode && oldDropNode !== dropNode) {
  49317. removeClass(oldDropNode.$el, ns.is("drop-inner"));
  49318. }
  49319. const draggingNode = dragState.value.draggingNode;
  49320. if (!draggingNode || !dropNode)
  49321. return;
  49322. let dropPrev = true;
  49323. let dropInner = true;
  49324. let dropNext = true;
  49325. let userAllowDropInner = true;
  49326. if (typeof props.allowDrop === "function") {
  49327. dropPrev = props.allowDrop(draggingNode.node, dropNode.node, "prev");
  49328. userAllowDropInner = dropInner = props.allowDrop(draggingNode.node, dropNode.node, "inner");
  49329. dropNext = props.allowDrop(draggingNode.node, dropNode.node, "next");
  49330. }
  49331. event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
  49332. if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
  49333. if (oldDropNode) {
  49334. ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
  49335. }
  49336. ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event);
  49337. }
  49338. if (dropPrev || dropInner || dropNext) {
  49339. dragState.value.dropNode = dropNode;
  49340. }
  49341. if (dropNode.node.nextSibling === draggingNode.node) {
  49342. dropNext = false;
  49343. }
  49344. if (dropNode.node.previousSibling === draggingNode.node) {
  49345. dropPrev = false;
  49346. }
  49347. if (dropNode.node.contains(draggingNode.node, false)) {
  49348. dropInner = false;
  49349. }
  49350. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  49351. dropPrev = false;
  49352. dropInner = false;
  49353. dropNext = false;
  49354. }
  49355. const targetPosition = dropNode.$el.getBoundingClientRect();
  49356. const treePosition = el$.value.getBoundingClientRect();
  49357. let dropType;
  49358. const prevPercent = dropPrev ? dropInner ? 0.25 : dropNext ? 0.45 : 1 : -1;
  49359. const nextPercent = dropNext ? dropInner ? 0.75 : dropPrev ? 0.55 : 0 : 1;
  49360. let indicatorTop = -9999;
  49361. const distance = event.clientY - targetPosition.top;
  49362. if (distance < targetPosition.height * prevPercent) {
  49363. dropType = "before";
  49364. } else if (distance > targetPosition.height * nextPercent) {
  49365. dropType = "after";
  49366. } else if (dropInner) {
  49367. dropType = "inner";
  49368. } else {
  49369. dropType = "none";
  49370. }
  49371. const iconPosition = dropNode.$el.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect();
  49372. const dropIndicator = dropIndicator$.value;
  49373. if (dropType === "before") {
  49374. indicatorTop = iconPosition.top - treePosition.top;
  49375. } else if (dropType === "after") {
  49376. indicatorTop = iconPosition.bottom - treePosition.top;
  49377. }
  49378. dropIndicator.style.top = `${indicatorTop}px`;
  49379. dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`;
  49380. if (dropType === "inner") {
  49381. addClass(dropNode.$el, ns.is("drop-inner"));
  49382. } else {
  49383. removeClass(dropNode.$el, ns.is("drop-inner"));
  49384. }
  49385. dragState.value.showDropIndicator = dropType === "before" || dropType === "after";
  49386. dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner;
  49387. dragState.value.dropType = dropType;
  49388. ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event);
  49389. };
  49390. const treeNodeDragEnd = (event) => {
  49391. const { draggingNode, dropType, dropNode } = dragState.value;
  49392. event.preventDefault();
  49393. event.dataTransfer.dropEffect = "move";
  49394. if (draggingNode && dropNode) {
  49395. const draggingNodeCopy = { data: draggingNode.node.data };
  49396. if (dropType !== "none") {
  49397. draggingNode.node.remove();
  49398. }
  49399. if (dropType === "before") {
  49400. dropNode.node.parent.insertBefore(draggingNodeCopy, dropNode.node);
  49401. } else if (dropType === "after") {
  49402. dropNode.node.parent.insertAfter(draggingNodeCopy, dropNode.node);
  49403. } else if (dropType === "inner") {
  49404. dropNode.node.insertChild(draggingNodeCopy);
  49405. }
  49406. if (dropType !== "none") {
  49407. store.value.registerNode(draggingNodeCopy);
  49408. }
  49409. removeClass(dropNode.$el, ns.is("drop-inner"));
  49410. ctx.emit("node-drag-end", draggingNode.node, dropNode.node, dropType, event);
  49411. if (dropType !== "none") {
  49412. ctx.emit("node-drop", draggingNode.node, dropNode.node, dropType, event);
  49413. }
  49414. }
  49415. if (draggingNode && !dropNode) {
  49416. ctx.emit("node-drag-end", draggingNode.node, null, dropType, event);
  49417. }
  49418. dragState.value.showDropIndicator = false;
  49419. dragState.value.draggingNode = null;
  49420. dragState.value.dropNode = null;
  49421. dragState.value.allowDrop = true;
  49422. };
  49423. vue.provide(dragEventsKey, {
  49424. treeNodeDragStart,
  49425. treeNodeDragOver,
  49426. treeNodeDragEnd
  49427. });
  49428. return {
  49429. dragState
  49430. };
  49431. }
  49432. const _sfc_main$b = vue.defineComponent({
  49433. name: "ElTreeNode",
  49434. components: {
  49435. ElCollapseTransition: _CollapseTransition,
  49436. ElCheckbox,
  49437. NodeContent,
  49438. ElIcon,
  49439. Loading: loading_default
  49440. },
  49441. props: {
  49442. node: {
  49443. type: Node$1,
  49444. default: () => ({})
  49445. },
  49446. props: {
  49447. type: Object,
  49448. default: () => ({})
  49449. },
  49450. accordion: Boolean,
  49451. renderContent: Function,
  49452. renderAfterExpand: Boolean,
  49453. showCheckbox: {
  49454. type: Boolean,
  49455. default: false
  49456. }
  49457. },
  49458. emits: ["node-expand"],
  49459. setup(props, ctx) {
  49460. const ns = useNamespace("tree");
  49461. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  49462. const tree = vue.inject("RootTree");
  49463. const expanded = vue.ref(false);
  49464. const childNodeRendered = vue.ref(false);
  49465. const oldChecked = vue.ref(null);
  49466. const oldIndeterminate = vue.ref(null);
  49467. const node$ = vue.ref(null);
  49468. const dragEvents = vue.inject(dragEventsKey);
  49469. const instance = vue.getCurrentInstance();
  49470. vue.provide("NodeInstance", instance);
  49471. if (props.node.expanded) {
  49472. expanded.value = true;
  49473. childNodeRendered.value = true;
  49474. }
  49475. const childrenKey = tree.props["children"] || "children";
  49476. vue.watch(() => {
  49477. const children = props.node.data[childrenKey];
  49478. return children && [...children];
  49479. }, () => {
  49480. props.node.updateChildren();
  49481. });
  49482. vue.watch(() => props.node.indeterminate, (val) => {
  49483. handleSelectChange(props.node.checked, val);
  49484. });
  49485. vue.watch(() => props.node.checked, (val) => {
  49486. handleSelectChange(val, props.node.indeterminate);
  49487. });
  49488. vue.watch(() => props.node.expanded, (val) => {
  49489. vue.nextTick(() => expanded.value = val);
  49490. if (val) {
  49491. childNodeRendered.value = true;
  49492. }
  49493. });
  49494. const getNodeKey$1 = (node) => {
  49495. return getNodeKey(tree.props.nodeKey, node.data);
  49496. };
  49497. const getNodeClass = (node) => {
  49498. const nodeClassFunc = props.props.class;
  49499. if (!nodeClassFunc) {
  49500. return {};
  49501. }
  49502. let className;
  49503. if (isFunction(nodeClassFunc)) {
  49504. const { data } = node;
  49505. className = nodeClassFunc(data, node);
  49506. } else {
  49507. className = nodeClassFunc;
  49508. }
  49509. if (isString(className)) {
  49510. return { [className]: true };
  49511. } else {
  49512. return className;
  49513. }
  49514. };
  49515. const handleSelectChange = (checked, indeterminate) => {
  49516. if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) {
  49517. tree.ctx.emit("check-change", props.node.data, checked, indeterminate);
  49518. }
  49519. oldChecked.value = checked;
  49520. oldIndeterminate.value = indeterminate;
  49521. };
  49522. const handleClick = (e) => {
  49523. handleCurrentChange(tree.store, tree.ctx.emit, () => tree.store.value.setCurrentNode(props.node));
  49524. tree.currentNode.value = props.node;
  49525. if (tree.props.expandOnClickNode) {
  49526. handleExpandIconClick();
  49527. }
  49528. if (tree.props.checkOnClickNode && !props.node.disabled) {
  49529. handleCheckChange(null, {
  49530. target: { checked: !props.node.checked }
  49531. });
  49532. }
  49533. tree.ctx.emit("node-click", props.node.data, props.node, instance, e);
  49534. };
  49535. const handleContextMenu = (event) => {
  49536. if (tree.instance.vnode.props["onNodeContextmenu"]) {
  49537. event.stopPropagation();
  49538. event.preventDefault();
  49539. }
  49540. tree.ctx.emit("node-contextmenu", event, props.node.data, props.node, instance);
  49541. };
  49542. const handleExpandIconClick = () => {
  49543. if (props.node.isLeaf)
  49544. return;
  49545. if (expanded.value) {
  49546. tree.ctx.emit("node-collapse", props.node.data, props.node, instance);
  49547. props.node.collapse();
  49548. } else {
  49549. props.node.expand();
  49550. ctx.emit("node-expand", props.node.data, props.node, instance);
  49551. }
  49552. };
  49553. const handleCheckChange = (value, ev) => {
  49554. props.node.setChecked(ev.target.checked, !tree.props.checkStrictly);
  49555. vue.nextTick(() => {
  49556. const store = tree.store.value;
  49557. tree.ctx.emit("check", props.node.data, {
  49558. checkedNodes: store.getCheckedNodes(),
  49559. checkedKeys: store.getCheckedKeys(),
  49560. halfCheckedNodes: store.getHalfCheckedNodes(),
  49561. halfCheckedKeys: store.getHalfCheckedKeys()
  49562. });
  49563. });
  49564. };
  49565. const handleChildNodeExpand = (nodeData, node, instance2) => {
  49566. broadcastExpanded(node);
  49567. tree.ctx.emit("node-expand", nodeData, node, instance2);
  49568. };
  49569. const handleDragStart = (event) => {
  49570. if (!tree.props.draggable)
  49571. return;
  49572. dragEvents.treeNodeDragStart({ event, treeNode: props });
  49573. };
  49574. const handleDragOver = (event) => {
  49575. event.preventDefault();
  49576. if (!tree.props.draggable)
  49577. return;
  49578. dragEvents.treeNodeDragOver({
  49579. event,
  49580. treeNode: { $el: node$.value, node: props.node }
  49581. });
  49582. };
  49583. const handleDrop = (event) => {
  49584. event.preventDefault();
  49585. };
  49586. const handleDragEnd = (event) => {
  49587. if (!tree.props.draggable)
  49588. return;
  49589. dragEvents.treeNodeDragEnd(event);
  49590. };
  49591. return {
  49592. ns,
  49593. node$,
  49594. tree,
  49595. expanded,
  49596. childNodeRendered,
  49597. oldChecked,
  49598. oldIndeterminate,
  49599. getNodeKey: getNodeKey$1,
  49600. getNodeClass,
  49601. handleSelectChange,
  49602. handleClick,
  49603. handleContextMenu,
  49604. handleExpandIconClick,
  49605. handleCheckChange,
  49606. handleChildNodeExpand,
  49607. handleDragStart,
  49608. handleDragOver,
  49609. handleDrop,
  49610. handleDragEnd,
  49611. CaretRight: caret_right_default
  49612. };
  49613. }
  49614. });
  49615. const _hoisted_1$7 = ["aria-expanded", "aria-disabled", "aria-checked", "draggable", "data-key"];
  49616. const _hoisted_2$5 = ["aria-expanded"];
  49617. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  49618. const _component_el_icon = vue.resolveComponent("el-icon");
  49619. const _component_el_checkbox = vue.resolveComponent("el-checkbox");
  49620. const _component_loading = vue.resolveComponent("loading");
  49621. const _component_node_content = vue.resolveComponent("node-content");
  49622. const _component_el_tree_node = vue.resolveComponent("el-tree-node");
  49623. const _component_el_collapse_transition = vue.resolveComponent("el-collapse-transition");
  49624. return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  49625. ref: "node$",
  49626. class: vue.normalizeClass([
  49627. _ctx.ns.b("node"),
  49628. _ctx.ns.is("expanded", _ctx.expanded),
  49629. _ctx.ns.is("current", _ctx.node.isCurrent),
  49630. _ctx.ns.is("hidden", !_ctx.node.visible),
  49631. _ctx.ns.is("focusable", !_ctx.node.disabled),
  49632. _ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked),
  49633. _ctx.getNodeClass(_ctx.node)
  49634. ]),
  49635. role: "treeitem",
  49636. tabindex: "-1",
  49637. "aria-expanded": _ctx.expanded,
  49638. "aria-disabled": _ctx.node.disabled,
  49639. "aria-checked": _ctx.node.checked,
  49640. draggable: _ctx.tree.props.draggable,
  49641. "data-key": _ctx.getNodeKey(_ctx.node),
  49642. onClick: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
  49643. onContextmenu: _cache[2] || (_cache[2] = (...args) => _ctx.handleContextMenu && _ctx.handleContextMenu(...args)),
  49644. onDragstart: _cache[3] || (_cache[3] = vue.withModifiers((...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args), ["stop"])),
  49645. onDragover: _cache[4] || (_cache[4] = vue.withModifiers((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["stop"])),
  49646. onDragend: _cache[5] || (_cache[5] = vue.withModifiers((...args) => _ctx.handleDragEnd && _ctx.handleDragEnd(...args), ["stop"])),
  49647. onDrop: _cache[6] || (_cache[6] = vue.withModifiers((...args) => _ctx.handleDrop && _ctx.handleDrop(...args), ["stop"]))
  49648. }, [
  49649. vue.createElementVNode("div", {
  49650. class: vue.normalizeClass(_ctx.ns.be("node", "content")),
  49651. style: vue.normalizeStyle({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" })
  49652. }, [
  49653. _ctx.tree.props.icon || _ctx.CaretRight ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  49654. key: 0,
  49655. class: vue.normalizeClass([
  49656. _ctx.ns.be("node", "expand-icon"),
  49657. _ctx.ns.is("leaf", _ctx.node.isLeaf),
  49658. {
  49659. expanded: !_ctx.node.isLeaf && _ctx.expanded
  49660. }
  49661. ]),
  49662. onClick: vue.withModifiers(_ctx.handleExpandIconClick, ["stop"])
  49663. }, {
  49664. default: vue.withCtx(() => [
  49665. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tree.props.icon || _ctx.CaretRight)))
  49666. ]),
  49667. _: 1
  49668. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
  49669. _ctx.showCheckbox ? (vue.openBlock(), vue.createBlock(_component_el_checkbox, {
  49670. key: 1,
  49671. "model-value": _ctx.node.checked,
  49672. indeterminate: _ctx.node.indeterminate,
  49673. disabled: !!_ctx.node.disabled,
  49674. onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  49675. }, ["stop"])),
  49676. onChange: _ctx.handleCheckChange
  49677. }, null, 8, ["model-value", "indeterminate", "disabled", "onChange"])) : vue.createCommentVNode("v-if", true),
  49678. _ctx.node.loading ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  49679. key: 2,
  49680. class: vue.normalizeClass([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")])
  49681. }, {
  49682. default: vue.withCtx(() => [
  49683. vue.createVNode(_component_loading)
  49684. ]),
  49685. _: 1
  49686. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  49687. vue.createVNode(_component_node_content, {
  49688. node: _ctx.node,
  49689. "render-content": _ctx.renderContent
  49690. }, null, 8, ["node", "render-content"])
  49691. ], 6),
  49692. vue.createVNode(_component_el_collapse_transition, null, {
  49693. default: vue.withCtx(() => [
  49694. !_ctx.renderAfterExpand || _ctx.childNodeRendered ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
  49695. key: 0,
  49696. class: vue.normalizeClass(_ctx.ns.be("node", "children")),
  49697. role: "group",
  49698. "aria-expanded": _ctx.expanded
  49699. }, [
  49700. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.node.childNodes, (child) => {
  49701. return vue.openBlock(), vue.createBlock(_component_el_tree_node, {
  49702. key: _ctx.getNodeKey(child),
  49703. "render-content": _ctx.renderContent,
  49704. "render-after-expand": _ctx.renderAfterExpand,
  49705. "show-checkbox": _ctx.showCheckbox,
  49706. node: child,
  49707. accordion: _ctx.accordion,
  49708. props: _ctx.props,
  49709. onNodeExpand: _ctx.handleChildNodeExpand
  49710. }, null, 8, ["render-content", "render-after-expand", "show-checkbox", "node", "accordion", "props", "onNodeExpand"]);
  49711. }), 128))
  49712. ], 10, _hoisted_2$5)), [
  49713. [vue.vShow, _ctx.expanded]
  49714. ]) : vue.createCommentVNode("v-if", true)
  49715. ]),
  49716. _: 1
  49717. })
  49718. ], 42, _hoisted_1$7)), [
  49719. [vue.vShow, _ctx.node.visible]
  49720. ]);
  49721. }
  49722. var ElTreeNode$1 = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["render", _sfc_render$2], ["__file", "tree-node.vue"]]);
  49723. function useKeydown({ el$ }, store) {
  49724. const ns = useNamespace("tree");
  49725. const treeItems = vue.shallowRef([]);
  49726. const checkboxItems = vue.shallowRef([]);
  49727. vue.onMounted(() => {
  49728. initTabIndex();
  49729. });
  49730. vue.onUpdated(() => {
  49731. treeItems.value = Array.from(el$.value.querySelectorAll("[role=treeitem]"));
  49732. checkboxItems.value = Array.from(el$.value.querySelectorAll("input[type=checkbox]"));
  49733. });
  49734. vue.watch(checkboxItems, (val) => {
  49735. val.forEach((checkbox) => {
  49736. checkbox.setAttribute("tabindex", "-1");
  49737. });
  49738. });
  49739. const handleKeydown = (ev) => {
  49740. const currentItem = ev.target;
  49741. if (!currentItem.className.includes(ns.b("node")))
  49742. return;
  49743. const code = ev.code;
  49744. treeItems.value = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  49745. const currentIndex = treeItems.value.indexOf(currentItem);
  49746. let nextIndex;
  49747. if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {
  49748. ev.preventDefault();
  49749. if (code === EVENT_CODE.up) {
  49750. nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.value.length - 1;
  49751. const startIndex = nextIndex;
  49752. while (true) {
  49753. if (store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus)
  49754. break;
  49755. nextIndex--;
  49756. if (nextIndex === startIndex) {
  49757. nextIndex = -1;
  49758. break;
  49759. }
  49760. if (nextIndex < 0) {
  49761. nextIndex = treeItems.value.length - 1;
  49762. }
  49763. }
  49764. } else {
  49765. nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.value.length - 1 ? currentIndex + 1 : 0;
  49766. const startIndex = nextIndex;
  49767. while (true) {
  49768. if (store.value.getNode(treeItems.value[nextIndex].dataset.key).canFocus)
  49769. break;
  49770. nextIndex++;
  49771. if (nextIndex === startIndex) {
  49772. nextIndex = -1;
  49773. break;
  49774. }
  49775. if (nextIndex >= treeItems.value.length) {
  49776. nextIndex = 0;
  49777. }
  49778. }
  49779. }
  49780. nextIndex !== -1 && treeItems.value[nextIndex].focus();
  49781. }
  49782. if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {
  49783. ev.preventDefault();
  49784. currentItem.click();
  49785. }
  49786. const hasInput = currentItem.querySelector('[type="checkbox"]');
  49787. if ([EVENT_CODE.enter, EVENT_CODE.space].includes(code) && hasInput) {
  49788. ev.preventDefault();
  49789. hasInput.click();
  49790. }
  49791. };
  49792. useEventListener(el$, "keydown", handleKeydown);
  49793. const initTabIndex = () => {
  49794. var _a;
  49795. treeItems.value = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  49796. checkboxItems.value = Array.from(el$.value.querySelectorAll("input[type=checkbox]"));
  49797. const checkedItem = el$.value.querySelectorAll(`.${ns.is("checked")}[role=treeitem]`);
  49798. if (checkedItem.length) {
  49799. checkedItem[0].setAttribute("tabindex", "0");
  49800. return;
  49801. }
  49802. (_a = treeItems.value[0]) == null ? void 0 : _a.setAttribute("tabindex", "0");
  49803. };
  49804. }
  49805. const _sfc_main$a = vue.defineComponent({
  49806. name: "ElTree",
  49807. components: { ElTreeNode: ElTreeNode$1 },
  49808. props: {
  49809. data: {
  49810. type: Array,
  49811. default: () => []
  49812. },
  49813. emptyText: {
  49814. type: String
  49815. },
  49816. renderAfterExpand: {
  49817. type: Boolean,
  49818. default: true
  49819. },
  49820. nodeKey: String,
  49821. checkStrictly: Boolean,
  49822. defaultExpandAll: Boolean,
  49823. expandOnClickNode: {
  49824. type: Boolean,
  49825. default: true
  49826. },
  49827. checkOnClickNode: Boolean,
  49828. checkDescendants: {
  49829. type: Boolean,
  49830. default: false
  49831. },
  49832. autoExpandParent: {
  49833. type: Boolean,
  49834. default: true
  49835. },
  49836. defaultCheckedKeys: Array,
  49837. defaultExpandedKeys: Array,
  49838. currentNodeKey: [String, Number],
  49839. renderContent: Function,
  49840. showCheckbox: {
  49841. type: Boolean,
  49842. default: false
  49843. },
  49844. draggable: {
  49845. type: Boolean,
  49846. default: false
  49847. },
  49848. allowDrag: Function,
  49849. allowDrop: Function,
  49850. props: {
  49851. type: Object,
  49852. default: () => ({
  49853. children: "children",
  49854. label: "label",
  49855. disabled: "disabled"
  49856. })
  49857. },
  49858. lazy: {
  49859. type: Boolean,
  49860. default: false
  49861. },
  49862. highlightCurrent: Boolean,
  49863. load: Function,
  49864. filterNodeMethod: Function,
  49865. accordion: Boolean,
  49866. indent: {
  49867. type: Number,
  49868. default: 18
  49869. },
  49870. icon: {
  49871. type: iconPropType
  49872. }
  49873. },
  49874. emits: [
  49875. "check-change",
  49876. "current-change",
  49877. "node-click",
  49878. "node-contextmenu",
  49879. "node-collapse",
  49880. "node-expand",
  49881. "check",
  49882. "node-drag-start",
  49883. "node-drag-end",
  49884. "node-drop",
  49885. "node-drag-leave",
  49886. "node-drag-enter",
  49887. "node-drag-over"
  49888. ],
  49889. setup(props, ctx) {
  49890. const { t } = useLocale();
  49891. const ns = useNamespace("tree");
  49892. const store = vue.ref(new TreeStore({
  49893. key: props.nodeKey,
  49894. data: props.data,
  49895. lazy: props.lazy,
  49896. props: props.props,
  49897. load: props.load,
  49898. currentNodeKey: props.currentNodeKey,
  49899. checkStrictly: props.checkStrictly,
  49900. checkDescendants: props.checkDescendants,
  49901. defaultCheckedKeys: props.defaultCheckedKeys,
  49902. defaultExpandedKeys: props.defaultExpandedKeys,
  49903. autoExpandParent: props.autoExpandParent,
  49904. defaultExpandAll: props.defaultExpandAll,
  49905. filterNodeMethod: props.filterNodeMethod
  49906. }));
  49907. store.value.initialize();
  49908. const root = vue.ref(store.value.root);
  49909. const currentNode = vue.ref(null);
  49910. const el$ = vue.ref(null);
  49911. const dropIndicator$ = vue.ref(null);
  49912. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  49913. const { dragState } = useDragNodeHandler({
  49914. props,
  49915. ctx,
  49916. el$,
  49917. dropIndicator$,
  49918. store
  49919. });
  49920. useKeydown({ el$ }, store);
  49921. const isEmpty = vue.computed(() => {
  49922. const { childNodes } = root.value;
  49923. return !childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible);
  49924. });
  49925. vue.watch(() => props.currentNodeKey, (newVal) => {
  49926. store.value.setCurrentNodeKey(newVal);
  49927. });
  49928. vue.watch(() => props.defaultCheckedKeys, (newVal) => {
  49929. store.value.setDefaultCheckedKey(newVal);
  49930. });
  49931. vue.watch(() => props.defaultExpandedKeys, (newVal) => {
  49932. store.value.setDefaultExpandedKeys(newVal);
  49933. });
  49934. vue.watch(() => props.data, (newVal) => {
  49935. store.value.setData(newVal);
  49936. }, { deep: true });
  49937. vue.watch(() => props.checkStrictly, (newVal) => {
  49938. store.value.checkStrictly = newVal;
  49939. });
  49940. const filter = (value) => {
  49941. if (!props.filterNodeMethod)
  49942. throw new Error("[Tree] filterNodeMethod is required when filter");
  49943. store.value.filter(value);
  49944. };
  49945. const getNodeKey$1 = (node) => {
  49946. return getNodeKey(props.nodeKey, node.data);
  49947. };
  49948. const getNodePath = (data) => {
  49949. if (!props.nodeKey)
  49950. throw new Error("[Tree] nodeKey is required in getNodePath");
  49951. const node = store.value.getNode(data);
  49952. if (!node)
  49953. return [];
  49954. const path = [node.data];
  49955. let parent = node.parent;
  49956. while (parent && parent !== root.value) {
  49957. path.push(parent.data);
  49958. parent = parent.parent;
  49959. }
  49960. return path.reverse();
  49961. };
  49962. const getCheckedNodes = (leafOnly, includeHalfChecked) => {
  49963. return store.value.getCheckedNodes(leafOnly, includeHalfChecked);
  49964. };
  49965. const getCheckedKeys = (leafOnly) => {
  49966. return store.value.getCheckedKeys(leafOnly);
  49967. };
  49968. const getCurrentNode = () => {
  49969. const currentNode2 = store.value.getCurrentNode();
  49970. return currentNode2 ? currentNode2.data : null;
  49971. };
  49972. const getCurrentKey = () => {
  49973. if (!props.nodeKey)
  49974. throw new Error("[Tree] nodeKey is required in getCurrentKey");
  49975. const currentNode2 = getCurrentNode();
  49976. return currentNode2 ? currentNode2[props.nodeKey] : null;
  49977. };
  49978. const setCheckedNodes = (nodes, leafOnly) => {
  49979. if (!props.nodeKey)
  49980. throw new Error("[Tree] nodeKey is required in setCheckedNodes");
  49981. store.value.setCheckedNodes(nodes, leafOnly);
  49982. };
  49983. const setCheckedKeys = (keys, leafOnly) => {
  49984. if (!props.nodeKey)
  49985. throw new Error("[Tree] nodeKey is required in setCheckedKeys");
  49986. store.value.setCheckedKeys(keys, leafOnly);
  49987. };
  49988. const setChecked = (data, checked, deep) => {
  49989. store.value.setChecked(data, checked, deep);
  49990. };
  49991. const getHalfCheckedNodes = () => {
  49992. return store.value.getHalfCheckedNodes();
  49993. };
  49994. const getHalfCheckedKeys = () => {
  49995. return store.value.getHalfCheckedKeys();
  49996. };
  49997. const setCurrentNode = (node, shouldAutoExpandParent = true) => {
  49998. if (!props.nodeKey)
  49999. throw new Error("[Tree] nodeKey is required in setCurrentNode");
  50000. handleCurrentChange(store, ctx.emit, () => store.value.setUserCurrentNode(node, shouldAutoExpandParent));
  50001. };
  50002. const setCurrentKey = (key, shouldAutoExpandParent = true) => {
  50003. if (!props.nodeKey)
  50004. throw new Error("[Tree] nodeKey is required in setCurrentKey");
  50005. handleCurrentChange(store, ctx.emit, () => store.value.setCurrentNodeKey(key, shouldAutoExpandParent));
  50006. };
  50007. const getNode = (data) => {
  50008. return store.value.getNode(data);
  50009. };
  50010. const remove = (data) => {
  50011. store.value.remove(data);
  50012. };
  50013. const append = (data, parentNode) => {
  50014. store.value.append(data, parentNode);
  50015. };
  50016. const insertBefore = (data, refNode) => {
  50017. store.value.insertBefore(data, refNode);
  50018. };
  50019. const insertAfter = (data, refNode) => {
  50020. store.value.insertAfter(data, refNode);
  50021. };
  50022. const handleNodeExpand = (nodeData, node, instance) => {
  50023. broadcastExpanded(node);
  50024. ctx.emit("node-expand", nodeData, node, instance);
  50025. };
  50026. const updateKeyChildren = (key, data) => {
  50027. if (!props.nodeKey)
  50028. throw new Error("[Tree] nodeKey is required in updateKeyChild");
  50029. store.value.updateChildren(key, data);
  50030. };
  50031. vue.provide("RootTree", {
  50032. ctx,
  50033. props,
  50034. store,
  50035. root,
  50036. currentNode,
  50037. instance: vue.getCurrentInstance()
  50038. });
  50039. vue.provide(formItemContextKey, void 0);
  50040. return {
  50041. ns,
  50042. store,
  50043. root,
  50044. currentNode,
  50045. dragState,
  50046. el$,
  50047. dropIndicator$,
  50048. isEmpty,
  50049. filter,
  50050. getNodeKey: getNodeKey$1,
  50051. getNodePath,
  50052. getCheckedNodes,
  50053. getCheckedKeys,
  50054. getCurrentNode,
  50055. getCurrentKey,
  50056. setCheckedNodes,
  50057. setCheckedKeys,
  50058. setChecked,
  50059. getHalfCheckedNodes,
  50060. getHalfCheckedKeys,
  50061. setCurrentNode,
  50062. setCurrentKey,
  50063. t,
  50064. getNode,
  50065. remove,
  50066. append,
  50067. insertBefore,
  50068. insertAfter,
  50069. handleNodeExpand,
  50070. updateKeyChildren
  50071. };
  50072. }
  50073. });
  50074. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  50075. var _a;
  50076. const _component_el_tree_node = vue.resolveComponent("el-tree-node");
  50077. return vue.openBlock(), vue.createElementBlock("div", {
  50078. ref: "el$",
  50079. class: vue.normalizeClass([
  50080. _ctx.ns.b(),
  50081. _ctx.ns.is("dragging", !!_ctx.dragState.draggingNode),
  50082. _ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop),
  50083. _ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"),
  50084. { [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent }
  50085. ]),
  50086. role: "tree"
  50087. }, [
  50088. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.root.childNodes, (child) => {
  50089. return vue.openBlock(), vue.createBlock(_component_el_tree_node, {
  50090. key: _ctx.getNodeKey(child),
  50091. node: child,
  50092. props: _ctx.props,
  50093. accordion: _ctx.accordion,
  50094. "render-after-expand": _ctx.renderAfterExpand,
  50095. "show-checkbox": _ctx.showCheckbox,
  50096. "render-content": _ctx.renderContent,
  50097. onNodeExpand: _ctx.handleNodeExpand
  50098. }, null, 8, ["node", "props", "accordion", "render-after-expand", "show-checkbox", "render-content", "onNodeExpand"]);
  50099. }), 128)),
  50100. _ctx.isEmpty ? (vue.openBlock(), vue.createElementBlock("div", {
  50101. key: 0,
  50102. class: vue.normalizeClass(_ctx.ns.e("empty-block"))
  50103. }, [
  50104. vue.createElementVNode("span", {
  50105. class: vue.normalizeClass(_ctx.ns.e("empty-text"))
  50106. }, vue.toDisplayString((_a = _ctx.emptyText) != null ? _a : _ctx.t("el.tree.emptyText")), 3)
  50107. ], 2)) : vue.createCommentVNode("v-if", true),
  50108. vue.withDirectives(vue.createElementVNode("div", {
  50109. ref: "dropIndicator$",
  50110. class: vue.normalizeClass(_ctx.ns.e("drop-indicator"))
  50111. }, null, 2), [
  50112. [vue.vShow, _ctx.dragState.showDropIndicator]
  50113. ])
  50114. ], 2);
  50115. }
  50116. var Tree = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["render", _sfc_render$1], ["__file", "tree.vue"]]);
  50117. Tree.install = (app) => {
  50118. app.component(Tree.name, Tree);
  50119. };
  50120. const _Tree = Tree;
  50121. const ElTree = _Tree;
  50122. const useSelect = (props, { attrs }, {
  50123. tree,
  50124. key
  50125. }) => {
  50126. const ns = useNamespace("tree-select");
  50127. const result = {
  50128. ...pick(vue.toRefs(props), Object.keys(ElSelect.props)),
  50129. ...attrs,
  50130. valueKey: key,
  50131. popperClass: vue.computed(() => {
  50132. const classes = [ns.e("popper")];
  50133. if (props.popperClass)
  50134. classes.push(props.popperClass);
  50135. return classes.join(" ");
  50136. }),
  50137. filterMethod: (keyword = "") => {
  50138. if (props.filterMethod)
  50139. props.filterMethod(keyword);
  50140. vue.nextTick(() => {
  50141. var _a;
  50142. (_a = tree.value) == null ? void 0 : _a.filter(keyword);
  50143. });
  50144. },
  50145. onVisibleChange: (visible) => {
  50146. var _a;
  50147. (_a = attrs.onVisibleChange) == null ? void 0 : _a.call(attrs, visible);
  50148. if (props.filterable && visible) {
  50149. result.filterMethod();
  50150. }
  50151. }
  50152. };
  50153. return result;
  50154. };
  50155. const component = vue.defineComponent({
  50156. extends: ElOption,
  50157. setup(props, ctx) {
  50158. const result = ElOption.setup(props, ctx);
  50159. delete result.selectOptionClick;
  50160. const vm = vue.getCurrentInstance().proxy;
  50161. vue.nextTick(() => {
  50162. if (!result.select.cachedOptions.get(vm.value)) {
  50163. result.select.onOptionCreate(vm);
  50164. }
  50165. });
  50166. return result;
  50167. },
  50168. methods: {
  50169. selectOptionClick() {
  50170. this.$el.parentElement.click();
  50171. }
  50172. }
  50173. });
  50174. var TreeSelectOption = component;
  50175. function isValidValue(val) {
  50176. return val || val === 0;
  50177. }
  50178. function isValidArray(val) {
  50179. return Array.isArray(val) && val.length;
  50180. }
  50181. function toValidArray(val) {
  50182. return Array.isArray(val) ? val : isValidValue(val) ? [val] : [];
  50183. }
  50184. function treeFind(treeData, findCallback, getChildren, resultCallback, parent) {
  50185. for (let i = 0; i < treeData.length; i++) {
  50186. const data = treeData[i];
  50187. if (findCallback(data, i, treeData, parent)) {
  50188. return resultCallback ? resultCallback(data, i, treeData, parent) : data;
  50189. } else {
  50190. const children = getChildren(data);
  50191. if (isValidArray(children)) {
  50192. const find = treeFind(children, findCallback, getChildren, resultCallback, data);
  50193. if (find)
  50194. return find;
  50195. }
  50196. }
  50197. }
  50198. }
  50199. function treeEach(treeData, callback, getChildren, parent) {
  50200. for (let i = 0; i < treeData.length; i++) {
  50201. const data = treeData[i];
  50202. callback(data, i, treeData, parent);
  50203. const children = getChildren(data);
  50204. if (isValidArray(children)) {
  50205. treeEach(children, callback, getChildren, data);
  50206. }
  50207. }
  50208. }
  50209. const useTree$1 = (props, { attrs, slots, emit }, {
  50210. select,
  50211. tree,
  50212. key
  50213. }) => {
  50214. vue.watch(() => props.modelValue, () => {
  50215. if (props.showCheckbox) {
  50216. vue.nextTick(() => {
  50217. const treeInstance = tree.value;
  50218. if (treeInstance && !isEqual$1(treeInstance.getCheckedKeys(), toValidArray(props.modelValue))) {
  50219. treeInstance.setCheckedKeys(toValidArray(props.modelValue));
  50220. }
  50221. });
  50222. }
  50223. }, {
  50224. immediate: true,
  50225. deep: true
  50226. });
  50227. const propsMap = vue.computed(() => ({
  50228. value: key.value,
  50229. ...props.props
  50230. }));
  50231. const getNodeValByProp = (prop, data) => {
  50232. var _a;
  50233. const propVal = propsMap.value[prop];
  50234. if (isFunction(propVal)) {
  50235. return propVal(data, (_a = tree.value) == null ? void 0 : _a.getNode(getNodeValByProp("value", data)));
  50236. } else {
  50237. return data[propVal];
  50238. }
  50239. };
  50240. const defaultExpandedParentKeys = toValidArray(props.modelValue).map((value) => {
  50241. return treeFind(props.data || [], (data) => getNodeValByProp("value", data) === value, (data) => getNodeValByProp("children", data), (data, index, array, parent) => parent && getNodeValByProp("value", parent));
  50242. }).filter((item) => isValidValue(item));
  50243. const cacheOptions = vue.computed(() => {
  50244. if (!props.renderAfterExpand && !props.lazy)
  50245. return [];
  50246. const options = [];
  50247. treeEach(props.data.concat(props.cacheData), (node) => {
  50248. const value = getNodeValByProp("value", node);
  50249. options.push({
  50250. value,
  50251. currentLabel: getNodeValByProp("label", node),
  50252. isDisabled: getNodeValByProp("disabled", node)
  50253. });
  50254. }, (data) => getNodeValByProp("children", data));
  50255. return options;
  50256. });
  50257. return {
  50258. ...pick(vue.toRefs(props), Object.keys(_Tree.props)),
  50259. ...attrs,
  50260. nodeKey: key,
  50261. expandOnClickNode: vue.computed(() => {
  50262. return !props.checkStrictly && props.expandOnClickNode;
  50263. }),
  50264. defaultExpandedKeys: vue.computed(() => {
  50265. return props.defaultExpandedKeys ? props.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys;
  50266. }),
  50267. renderContent: (h, { node, data, store }) => {
  50268. return h(TreeSelectOption, {
  50269. value: getNodeValByProp("value", data),
  50270. label: getNodeValByProp("label", data),
  50271. disabled: getNodeValByProp("disabled", data)
  50272. }, props.renderContent ? () => props.renderContent(h, { node, data, store }) : slots.default ? () => slots.default({ node, data, store }) : void 0);
  50273. },
  50274. filterNodeMethod: (value, data, node) => {
  50275. var _a;
  50276. if (props.filterNodeMethod)
  50277. return props.filterNodeMethod(value, data, node);
  50278. if (!value)
  50279. return true;
  50280. return (_a = getNodeValByProp("label", data)) == null ? void 0 : _a.includes(value);
  50281. },
  50282. onNodeClick: (data, node, e) => {
  50283. var _a, _b, _c;
  50284. (_a = attrs.onNodeClick) == null ? void 0 : _a.call(attrs, data, node, e);
  50285. if (props.showCheckbox && props.checkOnClickNode)
  50286. return;
  50287. if (!props.showCheckbox && (props.checkStrictly || node.isLeaf)) {
  50288. if (!getNodeValByProp("disabled", data)) {
  50289. const option = (_b = select.value) == null ? void 0 : _b.options.get(getNodeValByProp("value", data));
  50290. (_c = select.value) == null ? void 0 : _c.handleOptionSelect(option, true);
  50291. }
  50292. } else if (props.expandOnClickNode) {
  50293. e.proxy.handleExpandIconClick();
  50294. }
  50295. },
  50296. onCheck: (data, params) => {
  50297. var _a;
  50298. (_a = attrs.onCheck) == null ? void 0 : _a.call(attrs, data, params);
  50299. const dataValue = getNodeValByProp("value", data);
  50300. if (props.checkStrictly) {
  50301. emit(UPDATE_MODEL_EVENT, props.multiple ? params.checkedKeys : params.checkedKeys.includes(dataValue) ? dataValue : void 0);
  50302. } else {
  50303. if (props.multiple) {
  50304. emit(UPDATE_MODEL_EVENT, tree.value.getCheckedKeys(true));
  50305. } else {
  50306. const firstLeaf = treeFind([data], (data2) => !isValidArray(getNodeValByProp("children", data2)) && !getNodeValByProp("disabled", data2), (data2) => getNodeValByProp("children", data2));
  50307. const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0;
  50308. const hasCheckedChild = isValidValue(props.modelValue) && !!treeFind([data], (data2) => getNodeValByProp("value", data2) === props.modelValue, (data2) => getNodeValByProp("children", data2));
  50309. emit(UPDATE_MODEL_EVENT, firstLeafKey === props.modelValue || hasCheckedChild ? void 0 : firstLeafKey);
  50310. }
  50311. }
  50312. },
  50313. cacheOptions
  50314. };
  50315. };
  50316. var CacheOptions = vue.defineComponent({
  50317. props: {
  50318. data: {
  50319. type: Array,
  50320. default: () => []
  50321. }
  50322. },
  50323. setup(props) {
  50324. const select = vue.inject(selectKey);
  50325. vue.watch(() => props.data, () => {
  50326. props.data.forEach((item) => {
  50327. if (!select.cachedOptions.has(item.value)) {
  50328. select.cachedOptions.set(item.value, item);
  50329. }
  50330. });
  50331. select.setSelected();
  50332. }, { immediate: true, deep: true });
  50333. return () => void 0;
  50334. }
  50335. });
  50336. const _sfc_main$9 = vue.defineComponent({
  50337. name: "ElTreeSelect",
  50338. inheritAttrs: false,
  50339. props: {
  50340. ...ElSelect.props,
  50341. ..._Tree.props,
  50342. cacheData: {
  50343. type: Array,
  50344. default: () => []
  50345. }
  50346. },
  50347. setup(props, context) {
  50348. const { slots, expose } = context;
  50349. const select = vue.ref();
  50350. const tree = vue.ref();
  50351. const key = vue.computed(() => props.nodeKey || props.valueKey || "value");
  50352. const selectProps = useSelect(props, context, { select, tree, key });
  50353. const { cacheOptions, ...treeProps } = useTree$1(props, context, {
  50354. select,
  50355. tree,
  50356. key
  50357. });
  50358. const methods = vue.reactive({});
  50359. expose(methods);
  50360. vue.onMounted(() => {
  50361. Object.assign(methods, {
  50362. ...pick(tree.value, [
  50363. "filter",
  50364. "updateKeyChildren",
  50365. "getCheckedNodes",
  50366. "setCheckedNodes",
  50367. "getCheckedKeys",
  50368. "setCheckedKeys",
  50369. "setChecked",
  50370. "getHalfCheckedNodes",
  50371. "getHalfCheckedKeys",
  50372. "getCurrentKey",
  50373. "getCurrentNode",
  50374. "setCurrentKey",
  50375. "setCurrentNode",
  50376. "getNode",
  50377. "remove",
  50378. "append",
  50379. "insertBefore",
  50380. "insertAfter"
  50381. ]),
  50382. ...pick(select.value, ["focus", "blur"])
  50383. });
  50384. });
  50385. return () => vue.h(ElSelect, vue.reactive({
  50386. ...selectProps,
  50387. ref: (ref2) => select.value = ref2
  50388. }), {
  50389. ...slots,
  50390. default: () => [
  50391. vue.h(CacheOptions, { data: cacheOptions.value }),
  50392. vue.h(_Tree, vue.reactive({
  50393. ...treeProps,
  50394. ref: (ref2) => tree.value = ref2
  50395. }))
  50396. ]
  50397. });
  50398. }
  50399. });
  50400. var TreeSelect = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "tree-select.vue"]]);
  50401. TreeSelect.install = (app) => {
  50402. app.component(TreeSelect.name, TreeSelect);
  50403. };
  50404. const _TreeSelect = TreeSelect;
  50405. const ElTreeSelect = _TreeSelect;
  50406. const ROOT_TREE_INJECTION_KEY = Symbol();
  50407. const EMPTY_NODE = {
  50408. key: -1,
  50409. level: -1,
  50410. data: {}
  50411. };
  50412. var TreeOptionsEnum = /* @__PURE__ */ ((TreeOptionsEnum2) => {
  50413. TreeOptionsEnum2["KEY"] = "id";
  50414. TreeOptionsEnum2["LABEL"] = "label";
  50415. TreeOptionsEnum2["CHILDREN"] = "children";
  50416. TreeOptionsEnum2["DISABLED"] = "disabled";
  50417. return TreeOptionsEnum2;
  50418. })(TreeOptionsEnum || {});
  50419. var SetOperationEnum = /* @__PURE__ */ ((SetOperationEnum2) => {
  50420. SetOperationEnum2["ADD"] = "add";
  50421. SetOperationEnum2["DELETE"] = "delete";
  50422. return SetOperationEnum2;
  50423. })(SetOperationEnum || {});
  50424. const treeProps = buildProps({
  50425. data: {
  50426. type: definePropType(Array),
  50427. default: () => mutable([])
  50428. },
  50429. emptyText: {
  50430. type: String
  50431. },
  50432. height: {
  50433. type: Number,
  50434. default: 200
  50435. },
  50436. props: {
  50437. type: definePropType(Object),
  50438. default: () => mutable({
  50439. children: "children" /* CHILDREN */,
  50440. label: "label" /* LABEL */,
  50441. disabled: "disabled" /* DISABLED */,
  50442. value: "id" /* KEY */
  50443. })
  50444. },
  50445. highlightCurrent: {
  50446. type: Boolean,
  50447. default: false
  50448. },
  50449. showCheckbox: {
  50450. type: Boolean,
  50451. default: false
  50452. },
  50453. defaultCheckedKeys: {
  50454. type: definePropType(Array),
  50455. default: () => mutable([])
  50456. },
  50457. checkStrictly: {
  50458. type: Boolean,
  50459. default: false
  50460. },
  50461. defaultExpandedKeys: {
  50462. type: definePropType(Array),
  50463. default: () => mutable([])
  50464. },
  50465. indent: {
  50466. type: Number,
  50467. default: 16
  50468. },
  50469. icon: {
  50470. type: iconPropType
  50471. },
  50472. expandOnClickNode: {
  50473. type: Boolean,
  50474. default: true
  50475. },
  50476. checkOnClickNode: {
  50477. type: Boolean,
  50478. default: false
  50479. },
  50480. currentNodeKey: {
  50481. type: definePropType([String, Number])
  50482. },
  50483. accordion: {
  50484. type: Boolean,
  50485. default: false
  50486. },
  50487. filterMethod: {
  50488. type: definePropType(Function)
  50489. },
  50490. perfMode: {
  50491. type: Boolean,
  50492. default: true
  50493. }
  50494. });
  50495. const treeNodeProps = buildProps({
  50496. node: {
  50497. type: definePropType(Object),
  50498. default: () => mutable(EMPTY_NODE)
  50499. },
  50500. expanded: {
  50501. type: Boolean,
  50502. default: false
  50503. },
  50504. checked: {
  50505. type: Boolean,
  50506. default: false
  50507. },
  50508. indeterminate: {
  50509. type: Boolean,
  50510. default: false
  50511. },
  50512. showCheckbox: {
  50513. type: Boolean,
  50514. default: false
  50515. },
  50516. disabled: {
  50517. type: Boolean,
  50518. default: false
  50519. },
  50520. current: {
  50521. type: Boolean,
  50522. default: false
  50523. },
  50524. hiddenExpandIcon: {
  50525. type: Boolean,
  50526. default: false
  50527. }
  50528. });
  50529. const treeNodeContentProps = buildProps({
  50530. node: {
  50531. type: definePropType(Object),
  50532. required: true
  50533. }
  50534. });
  50535. const NODE_CLICK = "node-click";
  50536. const NODE_EXPAND = "node-expand";
  50537. const NODE_COLLAPSE = "node-collapse";
  50538. const CURRENT_CHANGE = "current-change";
  50539. const NODE_CHECK = "check";
  50540. const NODE_CHECK_CHANGE = "check-change";
  50541. const NODE_CONTEXTMENU = "node-contextmenu";
  50542. const treeEmits = {
  50543. [NODE_CLICK]: (data, node, e) => data && node && e,
  50544. [NODE_EXPAND]: (data, node) => data && node,
  50545. [NODE_COLLAPSE]: (data, node) => data && node,
  50546. [CURRENT_CHANGE]: (data, node) => data && node,
  50547. [NODE_CHECK]: (data, checkedInfo) => data && checkedInfo,
  50548. [NODE_CHECK_CHANGE]: (data, checked) => data && typeof checked === "boolean",
  50549. [NODE_CONTEXTMENU]: (event, data, node) => event && data && node
  50550. };
  50551. const treeNodeEmits = {
  50552. click: (node, e) => !!(node && e),
  50553. toggle: (node) => !!node,
  50554. check: (node, checked) => node && typeof checked === "boolean"
  50555. };
  50556. function useCheck(props, tree) {
  50557. const checkedKeys = vue.ref(/* @__PURE__ */ new Set());
  50558. const indeterminateKeys = vue.ref(/* @__PURE__ */ new Set());
  50559. const { emit } = vue.getCurrentInstance();
  50560. vue.watch([() => tree.value, () => props.defaultCheckedKeys], () => {
  50561. return vue.nextTick(() => {
  50562. _setCheckedKeys(props.defaultCheckedKeys);
  50563. });
  50564. }, {
  50565. immediate: true
  50566. });
  50567. const updateCheckedKeys = () => {
  50568. if (!tree.value || !props.showCheckbox || props.checkStrictly) {
  50569. return;
  50570. }
  50571. const { levelTreeNodeMap, maxLevel } = tree.value;
  50572. const checkedKeySet = checkedKeys.value;
  50573. const indeterminateKeySet = /* @__PURE__ */ new Set();
  50574. for (let level = maxLevel - 1; level >= 1; --level) {
  50575. const nodes = levelTreeNodeMap.get(level);
  50576. if (!nodes)
  50577. continue;
  50578. nodes.forEach((node) => {
  50579. const children = node.children;
  50580. if (children) {
  50581. let allChecked = true;
  50582. let hasChecked = false;
  50583. for (const childNode of children) {
  50584. const key = childNode.key;
  50585. if (checkedKeySet.has(key)) {
  50586. hasChecked = true;
  50587. } else if (indeterminateKeySet.has(key)) {
  50588. allChecked = false;
  50589. hasChecked = true;
  50590. break;
  50591. } else {
  50592. allChecked = false;
  50593. }
  50594. }
  50595. if (allChecked) {
  50596. checkedKeySet.add(node.key);
  50597. } else if (hasChecked) {
  50598. indeterminateKeySet.add(node.key);
  50599. checkedKeySet.delete(node.key);
  50600. } else {
  50601. checkedKeySet.delete(node.key);
  50602. indeterminateKeySet.delete(node.key);
  50603. }
  50604. }
  50605. });
  50606. }
  50607. indeterminateKeys.value = indeterminateKeySet;
  50608. };
  50609. const isChecked = (node) => checkedKeys.value.has(node.key);
  50610. const isIndeterminate = (node) => indeterminateKeys.value.has(node.key);
  50611. const toggleCheckbox = (node, isChecked2, nodeClick = true) => {
  50612. const checkedKeySet = checkedKeys.value;
  50613. const toggle = (node2, checked) => {
  50614. checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](node2.key);
  50615. const children = node2.children;
  50616. if (!props.checkStrictly && children) {
  50617. children.forEach((childNode) => {
  50618. if (!childNode.disabled) {
  50619. toggle(childNode, checked);
  50620. }
  50621. });
  50622. }
  50623. };
  50624. toggle(node, isChecked2);
  50625. updateCheckedKeys();
  50626. if (nodeClick) {
  50627. afterNodeCheck(node, isChecked2);
  50628. }
  50629. };
  50630. const afterNodeCheck = (node, checked) => {
  50631. const { checkedNodes, checkedKeys: checkedKeys2 } = getChecked();
  50632. const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked();
  50633. emit(NODE_CHECK, node.data, {
  50634. checkedKeys: checkedKeys2,
  50635. checkedNodes,
  50636. halfCheckedKeys,
  50637. halfCheckedNodes
  50638. });
  50639. emit(NODE_CHECK_CHANGE, node.data, checked);
  50640. };
  50641. function getCheckedKeys(leafOnly = false) {
  50642. return getChecked(leafOnly).checkedKeys;
  50643. }
  50644. function getCheckedNodes(leafOnly = false) {
  50645. return getChecked(leafOnly).checkedNodes;
  50646. }
  50647. function getHalfCheckedKeys() {
  50648. return getHalfChecked().halfCheckedKeys;
  50649. }
  50650. function getHalfCheckedNodes() {
  50651. return getHalfChecked().halfCheckedNodes;
  50652. }
  50653. function getChecked(leafOnly = false) {
  50654. const checkedNodes = [];
  50655. const keys = [];
  50656. if ((tree == null ? void 0 : tree.value) && props.showCheckbox) {
  50657. const { treeNodeMap } = tree.value;
  50658. checkedKeys.value.forEach((key) => {
  50659. const node = treeNodeMap.get(key);
  50660. if (node && (!leafOnly || leafOnly && node.isLeaf)) {
  50661. keys.push(key);
  50662. checkedNodes.push(node.data);
  50663. }
  50664. });
  50665. }
  50666. return {
  50667. checkedKeys: keys,
  50668. checkedNodes
  50669. };
  50670. }
  50671. function getHalfChecked() {
  50672. const halfCheckedNodes = [];
  50673. const halfCheckedKeys = [];
  50674. if ((tree == null ? void 0 : tree.value) && props.showCheckbox) {
  50675. const { treeNodeMap } = tree.value;
  50676. indeterminateKeys.value.forEach((key) => {
  50677. const node = treeNodeMap.get(key);
  50678. if (node) {
  50679. halfCheckedKeys.push(key);
  50680. halfCheckedNodes.push(node.data);
  50681. }
  50682. });
  50683. }
  50684. return {
  50685. halfCheckedNodes,
  50686. halfCheckedKeys
  50687. };
  50688. }
  50689. function setCheckedKeys(keys) {
  50690. checkedKeys.value.clear();
  50691. indeterminateKeys.value.clear();
  50692. _setCheckedKeys(keys);
  50693. }
  50694. function setChecked(key, isChecked2) {
  50695. if ((tree == null ? void 0 : tree.value) && props.showCheckbox) {
  50696. const node = tree.value.treeNodeMap.get(key);
  50697. if (node) {
  50698. toggleCheckbox(node, isChecked2, false);
  50699. }
  50700. }
  50701. }
  50702. function _setCheckedKeys(keys) {
  50703. if (tree == null ? void 0 : tree.value) {
  50704. const { treeNodeMap } = tree.value;
  50705. if (props.showCheckbox && treeNodeMap && keys) {
  50706. for (const key of keys) {
  50707. const node = treeNodeMap.get(key);
  50708. if (node && !isChecked(node)) {
  50709. toggleCheckbox(node, true, false);
  50710. }
  50711. }
  50712. }
  50713. }
  50714. }
  50715. return {
  50716. updateCheckedKeys,
  50717. toggleCheckbox,
  50718. isChecked,
  50719. isIndeterminate,
  50720. getCheckedKeys,
  50721. getCheckedNodes,
  50722. getHalfCheckedKeys,
  50723. getHalfCheckedNodes,
  50724. setChecked,
  50725. setCheckedKeys
  50726. };
  50727. }
  50728. function useFilter(props, tree) {
  50729. const hiddenNodeKeySet = vue.ref(/* @__PURE__ */ new Set([]));
  50730. const hiddenExpandIconKeySet = vue.ref(/* @__PURE__ */ new Set([]));
  50731. const filterable = vue.computed(() => {
  50732. return isFunction(props.filterMethod);
  50733. });
  50734. function doFilter(query) {
  50735. var _a;
  50736. if (!filterable.value) {
  50737. return;
  50738. }
  50739. const expandKeySet = /* @__PURE__ */ new Set();
  50740. const hiddenExpandIconKeys = hiddenExpandIconKeySet.value;
  50741. const hiddenKeys = hiddenNodeKeySet.value;
  50742. const family = [];
  50743. const nodes = ((_a = tree.value) == null ? void 0 : _a.treeNodes) || [];
  50744. const filter = props.filterMethod;
  50745. hiddenKeys.clear();
  50746. function traverse(nodes2) {
  50747. nodes2.forEach((node) => {
  50748. family.push(node);
  50749. if (filter == null ? void 0 : filter(query, node.data)) {
  50750. family.forEach((member) => {
  50751. expandKeySet.add(member.key);
  50752. });
  50753. } else if (node.isLeaf) {
  50754. hiddenKeys.add(node.key);
  50755. }
  50756. const children = node.children;
  50757. if (children) {
  50758. traverse(children);
  50759. }
  50760. if (!node.isLeaf) {
  50761. if (!expandKeySet.has(node.key)) {
  50762. hiddenKeys.add(node.key);
  50763. } else if (children) {
  50764. let allHidden = true;
  50765. for (const childNode of children) {
  50766. if (!hiddenKeys.has(childNode.key)) {
  50767. allHidden = false;
  50768. break;
  50769. }
  50770. }
  50771. if (allHidden) {
  50772. hiddenExpandIconKeys.add(node.key);
  50773. } else {
  50774. hiddenExpandIconKeys.delete(node.key);
  50775. }
  50776. }
  50777. }
  50778. family.pop();
  50779. });
  50780. }
  50781. traverse(nodes);
  50782. return expandKeySet;
  50783. }
  50784. function isForceHiddenExpandIcon(node) {
  50785. return hiddenExpandIconKeySet.value.has(node.key);
  50786. }
  50787. return {
  50788. hiddenExpandIconKeySet,
  50789. hiddenNodeKeySet,
  50790. doFilter,
  50791. isForceHiddenExpandIcon
  50792. };
  50793. }
  50794. function useTree(props, emit) {
  50795. const expandedKeySet = vue.ref(new Set(props.defaultExpandedKeys));
  50796. const currentKey = vue.ref();
  50797. const tree = vue.shallowRef();
  50798. vue.watch(() => props.currentNodeKey, (key) => {
  50799. currentKey.value = key;
  50800. }, {
  50801. immediate: true
  50802. });
  50803. vue.watch(() => props.data, (data) => {
  50804. setData(data);
  50805. }, {
  50806. immediate: true
  50807. });
  50808. const {
  50809. isIndeterminate,
  50810. isChecked,
  50811. toggleCheckbox,
  50812. getCheckedKeys,
  50813. getCheckedNodes,
  50814. getHalfCheckedKeys,
  50815. getHalfCheckedNodes,
  50816. setChecked,
  50817. setCheckedKeys
  50818. } = useCheck(props, tree);
  50819. const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(props, tree);
  50820. const valueKey = vue.computed(() => {
  50821. var _a;
  50822. return ((_a = props.props) == null ? void 0 : _a.value) || TreeOptionsEnum.KEY;
  50823. });
  50824. const childrenKey = vue.computed(() => {
  50825. var _a;
  50826. return ((_a = props.props) == null ? void 0 : _a.children) || TreeOptionsEnum.CHILDREN;
  50827. });
  50828. const disabledKey = vue.computed(() => {
  50829. var _a;
  50830. return ((_a = props.props) == null ? void 0 : _a.disabled) || TreeOptionsEnum.DISABLED;
  50831. });
  50832. const labelKey = vue.computed(() => {
  50833. var _a;
  50834. return ((_a = props.props) == null ? void 0 : _a.label) || TreeOptionsEnum.LABEL;
  50835. });
  50836. const flattenTree = vue.computed(() => {
  50837. const expandedKeys = expandedKeySet.value;
  50838. const hiddenKeys = hiddenNodeKeySet.value;
  50839. const flattenNodes = [];
  50840. const nodes = tree.value && tree.value.treeNodes || [];
  50841. function traverse() {
  50842. const stack = [];
  50843. for (let i = nodes.length - 1; i >= 0; --i) {
  50844. stack.push(nodes[i]);
  50845. }
  50846. while (stack.length) {
  50847. const node = stack.pop();
  50848. if (!node)
  50849. continue;
  50850. if (!hiddenKeys.has(node.key)) {
  50851. flattenNodes.push(node);
  50852. }
  50853. if (expandedKeys.has(node.key)) {
  50854. const children = node.children;
  50855. if (children) {
  50856. const length = children.length;
  50857. for (let i = length - 1; i >= 0; --i) {
  50858. stack.push(children[i]);
  50859. }
  50860. }
  50861. }
  50862. }
  50863. }
  50864. traverse();
  50865. return flattenNodes;
  50866. });
  50867. const isNotEmpty = vue.computed(() => {
  50868. return flattenTree.value.length > 0;
  50869. });
  50870. function createTree(data) {
  50871. const treeNodeMap = /* @__PURE__ */ new Map();
  50872. const levelTreeNodeMap = /* @__PURE__ */ new Map();
  50873. let maxLevel = 1;
  50874. function traverse(nodes, level = 1, parent = void 0) {
  50875. var _a;
  50876. const siblings = [];
  50877. for (const rawNode of nodes) {
  50878. const value = getKey(rawNode);
  50879. const node = {
  50880. level,
  50881. key: value,
  50882. data: rawNode
  50883. };
  50884. node.label = getLabel(rawNode);
  50885. node.parent = parent;
  50886. const children = getChildren(rawNode);
  50887. node.disabled = getDisabled(rawNode);
  50888. node.isLeaf = !children || children.length === 0;
  50889. if (children && children.length) {
  50890. node.children = traverse(children, level + 1, node);
  50891. }
  50892. siblings.push(node);
  50893. treeNodeMap.set(value, node);
  50894. if (!levelTreeNodeMap.has(level)) {
  50895. levelTreeNodeMap.set(level, []);
  50896. }
  50897. (_a = levelTreeNodeMap.get(level)) == null ? void 0 : _a.push(node);
  50898. }
  50899. if (level > maxLevel) {
  50900. maxLevel = level;
  50901. }
  50902. return siblings;
  50903. }
  50904. const treeNodes = traverse(data);
  50905. return {
  50906. treeNodeMap,
  50907. levelTreeNodeMap,
  50908. maxLevel,
  50909. treeNodes
  50910. };
  50911. }
  50912. function filter(query) {
  50913. const keys = doFilter(query);
  50914. if (keys) {
  50915. expandedKeySet.value = keys;
  50916. }
  50917. }
  50918. function getChildren(node) {
  50919. return node[childrenKey.value];
  50920. }
  50921. function getKey(node) {
  50922. if (!node) {
  50923. return "";
  50924. }
  50925. return node[valueKey.value];
  50926. }
  50927. function getDisabled(node) {
  50928. return node[disabledKey.value];
  50929. }
  50930. function getLabel(node) {
  50931. return node[labelKey.value];
  50932. }
  50933. function toggleExpand(node) {
  50934. const expandedKeys = expandedKeySet.value;
  50935. if (expandedKeys.has(node.key)) {
  50936. collapseNode(node);
  50937. } else {
  50938. expandNode(node);
  50939. }
  50940. }
  50941. function setExpandedKeys(keys) {
  50942. expandedKeySet.value = new Set(keys);
  50943. }
  50944. function handleNodeClick(node, e) {
  50945. emit(NODE_CLICK, node.data, node, e);
  50946. handleCurrentChange(node);
  50947. if (props.expandOnClickNode) {
  50948. toggleExpand(node);
  50949. }
  50950. if (props.showCheckbox && props.checkOnClickNode && !node.disabled) {
  50951. toggleCheckbox(node, !isChecked(node), true);
  50952. }
  50953. }
  50954. function handleCurrentChange(node) {
  50955. if (!isCurrent(node)) {
  50956. currentKey.value = node.key;
  50957. emit(CURRENT_CHANGE, node.data, node);
  50958. }
  50959. }
  50960. function handleNodeCheck(node, checked) {
  50961. toggleCheckbox(node, checked);
  50962. }
  50963. function expandNode(node) {
  50964. const keySet = expandedKeySet.value;
  50965. if (tree.value && props.accordion) {
  50966. const { treeNodeMap } = tree.value;
  50967. keySet.forEach((key) => {
  50968. const treeNode = treeNodeMap.get(key);
  50969. if (node && node.level === (treeNode == null ? void 0 : treeNode.level)) {
  50970. keySet.delete(key);
  50971. }
  50972. });
  50973. }
  50974. keySet.add(node.key);
  50975. emit(NODE_EXPAND, node.data, node);
  50976. }
  50977. function collapseNode(node) {
  50978. expandedKeySet.value.delete(node.key);
  50979. emit(NODE_COLLAPSE, node.data, node);
  50980. }
  50981. function isExpanded(node) {
  50982. return expandedKeySet.value.has(node.key);
  50983. }
  50984. function isDisabled(node) {
  50985. return !!node.disabled;
  50986. }
  50987. function isCurrent(node) {
  50988. const current = currentKey.value;
  50989. return !!current && current === node.key;
  50990. }
  50991. function getCurrentNode() {
  50992. var _a, _b;
  50993. if (!currentKey.value)
  50994. return void 0;
  50995. return (_b = (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(currentKey.value)) == null ? void 0 : _b.data;
  50996. }
  50997. function getCurrentKey() {
  50998. return currentKey.value;
  50999. }
  51000. function setCurrentKey(key) {
  51001. currentKey.value = key;
  51002. }
  51003. function setData(data) {
  51004. vue.nextTick(() => tree.value = createTree(data));
  51005. }
  51006. function getNode(data) {
  51007. var _a;
  51008. const key = isObject$1(data) ? getKey(data) : data;
  51009. return (_a = tree.value) == null ? void 0 : _a.treeNodeMap.get(key);
  51010. }
  51011. return {
  51012. tree,
  51013. flattenTree,
  51014. isNotEmpty,
  51015. getKey,
  51016. getChildren,
  51017. toggleExpand,
  51018. toggleCheckbox,
  51019. isExpanded,
  51020. isChecked,
  51021. isIndeterminate,
  51022. isDisabled,
  51023. isCurrent,
  51024. isForceHiddenExpandIcon,
  51025. handleNodeClick,
  51026. handleNodeCheck,
  51027. getCurrentNode,
  51028. getCurrentKey,
  51029. setCurrentKey,
  51030. getCheckedKeys,
  51031. getCheckedNodes,
  51032. getHalfCheckedKeys,
  51033. getHalfCheckedNodes,
  51034. setChecked,
  51035. setCheckedKeys,
  51036. filter,
  51037. setData,
  51038. getNode,
  51039. expandNode,
  51040. collapseNode,
  51041. setExpandedKeys
  51042. };
  51043. }
  51044. var ElNodeContent = vue.defineComponent({
  51045. name: "ElTreeNodeContent",
  51046. props: treeNodeContentProps,
  51047. setup(props) {
  51048. const tree = vue.inject(ROOT_TREE_INJECTION_KEY);
  51049. const ns = useNamespace("tree");
  51050. return () => {
  51051. const node = props.node;
  51052. const { data } = node;
  51053. return (tree == null ? void 0 : tree.ctx.slots.default) ? tree.ctx.slots.default({ node, data }) : vue.h("span", { class: ns.be("node", "label") }, [node == null ? void 0 : node.label]);
  51054. };
  51055. }
  51056. });
  51057. const _hoisted_1$6 = ["aria-expanded", "aria-disabled", "aria-checked", "data-key", "onClick"];
  51058. const __default__$7 = vue.defineComponent({
  51059. name: "ElTreeNode"
  51060. });
  51061. const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
  51062. ...__default__$7,
  51063. props: treeNodeProps,
  51064. emits: treeNodeEmits,
  51065. setup(__props, { emit }) {
  51066. const props = __props;
  51067. const tree = vue.inject(ROOT_TREE_INJECTION_KEY);
  51068. const ns = useNamespace("tree");
  51069. const indent = vue.computed(() => {
  51070. var _a;
  51071. return (_a = tree == null ? void 0 : tree.props.indent) != null ? _a : 16;
  51072. });
  51073. const icon = vue.computed(() => {
  51074. var _a;
  51075. return (_a = tree == null ? void 0 : tree.props.icon) != null ? _a : caret_right_default;
  51076. });
  51077. const handleClick = (e) => {
  51078. emit("click", props.node, e);
  51079. };
  51080. const handleExpandIconClick = () => {
  51081. emit("toggle", props.node);
  51082. };
  51083. const handleCheckChange = (value) => {
  51084. emit("check", props.node, value);
  51085. };
  51086. const handleContextMenu = (event) => {
  51087. var _a, _b, _c, _d;
  51088. if ((_c = (_b = (_a = tree == null ? void 0 : tree.instance) == null ? void 0 : _a.vnode) == null ? void 0 : _b.props) == null ? void 0 : _c["onNodeContextmenu"]) {
  51089. event.stopPropagation();
  51090. event.preventDefault();
  51091. }
  51092. tree == null ? void 0 : tree.ctx.emit(NODE_CONTEXTMENU, event, (_d = props.node) == null ? void 0 : _d.data, props.node);
  51093. };
  51094. return (_ctx, _cache) => {
  51095. var _a, _b, _c;
  51096. return vue.openBlock(), vue.createElementBlock("div", {
  51097. ref: "node$",
  51098. class: vue.normalizeClass([
  51099. vue.unref(ns).b("node"),
  51100. vue.unref(ns).is("expanded", _ctx.expanded),
  51101. vue.unref(ns).is("current", _ctx.current),
  51102. vue.unref(ns).is("focusable", !_ctx.disabled),
  51103. vue.unref(ns).is("checked", !_ctx.disabled && _ctx.checked)
  51104. ]),
  51105. role: "treeitem",
  51106. tabindex: "-1",
  51107. "aria-expanded": _ctx.expanded,
  51108. "aria-disabled": _ctx.disabled,
  51109. "aria-checked": _ctx.checked,
  51110. "data-key": (_a = _ctx.node) == null ? void 0 : _a.key,
  51111. onClick: vue.withModifiers(handleClick, ["stop"]),
  51112. onContextmenu: handleContextMenu
  51113. }, [
  51114. vue.createElementVNode("div", {
  51115. class: vue.normalizeClass(vue.unref(ns).be("node", "content")),
  51116. style: vue.normalizeStyle({ paddingLeft: `${(_ctx.node.level - 1) * vue.unref(indent)}px` })
  51117. }, [
  51118. vue.unref(icon) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  51119. key: 0,
  51120. class: vue.normalizeClass([
  51121. vue.unref(ns).is("leaf", !!((_b = _ctx.node) == null ? void 0 : _b.isLeaf)),
  51122. vue.unref(ns).is("hidden", _ctx.hiddenExpandIcon),
  51123. {
  51124. expanded: !((_c = _ctx.node) == null ? void 0 : _c.isLeaf) && _ctx.expanded
  51125. },
  51126. vue.unref(ns).be("node", "expand-icon")
  51127. ]),
  51128. onClick: vue.withModifiers(handleExpandIconClick, ["stop"])
  51129. }, {
  51130. default: vue.withCtx(() => [
  51131. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(icon))))
  51132. ]),
  51133. _: 1
  51134. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
  51135. _ctx.showCheckbox ? (vue.openBlock(), vue.createBlock(vue.unref(ElCheckbox), {
  51136. key: 1,
  51137. "model-value": _ctx.checked,
  51138. indeterminate: _ctx.indeterminate,
  51139. disabled: _ctx.disabled,
  51140. onChange: handleCheckChange,
  51141. onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  51142. }, ["stop"]))
  51143. }, null, 8, ["model-value", "indeterminate", "disabled"])) : vue.createCommentVNode("v-if", true),
  51144. vue.createVNode(vue.unref(ElNodeContent), { node: _ctx.node }, null, 8, ["node"])
  51145. ], 6)
  51146. ], 42, _hoisted_1$6);
  51147. };
  51148. }
  51149. });
  51150. var ElTreeNode = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "tree-node.vue"]]);
  51151. const itemSize = 26;
  51152. const __default__$6 = vue.defineComponent({
  51153. name: "ElTreeV2"
  51154. });
  51155. const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
  51156. ...__default__$6,
  51157. props: treeProps,
  51158. emits: treeEmits,
  51159. setup(__props, { expose, emit }) {
  51160. const props = __props;
  51161. const slots = vue.useSlots();
  51162. vue.provide(ROOT_TREE_INJECTION_KEY, {
  51163. ctx: {
  51164. emit,
  51165. slots
  51166. },
  51167. props,
  51168. instance: vue.getCurrentInstance()
  51169. });
  51170. vue.provide(formItemContextKey, void 0);
  51171. const { t } = useLocale();
  51172. const ns = useNamespace("tree");
  51173. const {
  51174. flattenTree,
  51175. isNotEmpty,
  51176. toggleExpand,
  51177. isExpanded,
  51178. isIndeterminate,
  51179. isChecked,
  51180. isDisabled,
  51181. isCurrent,
  51182. isForceHiddenExpandIcon,
  51183. handleNodeClick,
  51184. handleNodeCheck,
  51185. toggleCheckbox,
  51186. getCurrentNode,
  51187. getCurrentKey,
  51188. setCurrentKey,
  51189. getCheckedKeys,
  51190. getCheckedNodes,
  51191. getHalfCheckedKeys,
  51192. getHalfCheckedNodes,
  51193. setChecked,
  51194. setCheckedKeys,
  51195. filter,
  51196. setData,
  51197. getNode,
  51198. expandNode,
  51199. collapseNode,
  51200. setExpandedKeys
  51201. } = useTree(props, emit);
  51202. expose({
  51203. toggleCheckbox,
  51204. getCurrentNode,
  51205. getCurrentKey,
  51206. setCurrentKey,
  51207. getCheckedKeys,
  51208. getCheckedNodes,
  51209. getHalfCheckedKeys,
  51210. getHalfCheckedNodes,
  51211. setChecked,
  51212. setCheckedKeys,
  51213. filter,
  51214. setData,
  51215. getNode,
  51216. expandNode,
  51217. collapseNode,
  51218. setExpandedKeys
  51219. });
  51220. return (_ctx, _cache) => {
  51221. var _a;
  51222. return vue.openBlock(), vue.createElementBlock("div", {
  51223. class: vue.normalizeClass([vue.unref(ns).b(), { [vue.unref(ns).m("highlight-current")]: _ctx.highlightCurrent }]),
  51224. role: "tree"
  51225. }, [
  51226. vue.unref(isNotEmpty) ? (vue.openBlock(), vue.createBlock(vue.unref(FixedSizeList$1), {
  51227. key: 0,
  51228. "class-name": vue.unref(ns).b("virtual-list"),
  51229. data: vue.unref(flattenTree),
  51230. total: vue.unref(flattenTree).length,
  51231. height: _ctx.height,
  51232. "item-size": itemSize,
  51233. "perf-mode": _ctx.perfMode
  51234. }, {
  51235. default: vue.withCtx(({ data, index, style }) => [
  51236. (vue.openBlock(), vue.createBlock(ElTreeNode, {
  51237. key: data[index].key,
  51238. style: vue.normalizeStyle(style),
  51239. node: data[index],
  51240. expanded: vue.unref(isExpanded)(data[index]),
  51241. "show-checkbox": _ctx.showCheckbox,
  51242. checked: vue.unref(isChecked)(data[index]),
  51243. indeterminate: vue.unref(isIndeterminate)(data[index]),
  51244. disabled: vue.unref(isDisabled)(data[index]),
  51245. current: vue.unref(isCurrent)(data[index]),
  51246. "hidden-expand-icon": vue.unref(isForceHiddenExpandIcon)(data[index]),
  51247. onClick: vue.unref(handleNodeClick),
  51248. onToggle: vue.unref(toggleExpand),
  51249. onCheck: vue.unref(handleNodeCheck)
  51250. }, null, 8, ["style", "node", "expanded", "show-checkbox", "checked", "indeterminate", "disabled", "current", "hidden-expand-icon", "onClick", "onToggle", "onCheck"]))
  51251. ]),
  51252. _: 1
  51253. }, 8, ["class-name", "data", "total", "height", "perf-mode"])) : (vue.openBlock(), vue.createElementBlock("div", {
  51254. key: 1,
  51255. class: vue.normalizeClass(vue.unref(ns).e("empty-block"))
  51256. }, [
  51257. vue.createElementVNode("span", {
  51258. class: vue.normalizeClass(vue.unref(ns).e("empty-text"))
  51259. }, vue.toDisplayString((_a = _ctx.emptyText) != null ? _a : vue.unref(t)("el.tree.emptyText")), 3)
  51260. ], 2))
  51261. ], 2);
  51262. };
  51263. }
  51264. });
  51265. var TreeV2 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "tree.vue"]]);
  51266. const ElTreeV2 = withInstall(TreeV2);
  51267. const SCOPE$2 = "ElUpload";
  51268. class UploadAjaxError extends Error {
  51269. constructor(message, status, method, url) {
  51270. super(message);
  51271. this.name = "UploadAjaxError";
  51272. this.status = status;
  51273. this.method = method;
  51274. this.url = url;
  51275. }
  51276. }
  51277. function getError(action, option, xhr) {
  51278. let msg;
  51279. if (xhr.response) {
  51280. msg = `${xhr.response.error || xhr.response}`;
  51281. } else if (xhr.responseText) {
  51282. msg = `${xhr.responseText}`;
  51283. } else {
  51284. msg = `fail to ${option.method} ${action} ${xhr.status}`;
  51285. }
  51286. return new UploadAjaxError(msg, xhr.status, option.method, action);
  51287. }
  51288. function getBody(xhr) {
  51289. const text = xhr.responseText || xhr.response;
  51290. if (!text) {
  51291. return text;
  51292. }
  51293. try {
  51294. return JSON.parse(text);
  51295. } catch (e) {
  51296. return text;
  51297. }
  51298. }
  51299. const ajaxUpload = (option) => {
  51300. if (typeof XMLHttpRequest === "undefined")
  51301. throwError(SCOPE$2, "XMLHttpRequest is undefined");
  51302. const xhr = new XMLHttpRequest();
  51303. const action = option.action;
  51304. if (xhr.upload) {
  51305. xhr.upload.addEventListener("progress", (evt) => {
  51306. const progressEvt = evt;
  51307. progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0;
  51308. option.onProgress(progressEvt);
  51309. });
  51310. }
  51311. const formData = new FormData();
  51312. if (option.data) {
  51313. for (const [key, value] of Object.entries(option.data)) {
  51314. if (Array.isArray(value))
  51315. formData.append(key, ...value);
  51316. else
  51317. formData.append(key, value);
  51318. }
  51319. }
  51320. formData.append(option.filename, option.file, option.file.name);
  51321. xhr.addEventListener("error", () => {
  51322. option.onError(getError(action, option, xhr));
  51323. });
  51324. xhr.addEventListener("load", () => {
  51325. if (xhr.status < 200 || xhr.status >= 300) {
  51326. return option.onError(getError(action, option, xhr));
  51327. }
  51328. option.onSuccess(getBody(xhr));
  51329. });
  51330. xhr.open(option.method, action, true);
  51331. if (option.withCredentials && "withCredentials" in xhr) {
  51332. xhr.withCredentials = true;
  51333. }
  51334. const headers = option.headers || {};
  51335. if (headers instanceof Headers) {
  51336. headers.forEach((value, key) => xhr.setRequestHeader(key, value));
  51337. } else {
  51338. for (const [key, value] of Object.entries(headers)) {
  51339. if (isNil(value))
  51340. continue;
  51341. xhr.setRequestHeader(key, String(value));
  51342. }
  51343. }
  51344. xhr.send(formData);
  51345. return xhr;
  51346. };
  51347. const uploadListTypes = ["text", "picture", "picture-card"];
  51348. let fileId = 1;
  51349. const genFileId = () => Date.now() + fileId++;
  51350. const uploadBaseProps = buildProps({
  51351. action: {
  51352. type: String,
  51353. default: "#"
  51354. },
  51355. headers: {
  51356. type: definePropType(Object)
  51357. },
  51358. method: {
  51359. type: String,
  51360. default: "post"
  51361. },
  51362. data: {
  51363. type: Object,
  51364. default: () => mutable({})
  51365. },
  51366. multiple: {
  51367. type: Boolean,
  51368. default: false
  51369. },
  51370. name: {
  51371. type: String,
  51372. default: "file"
  51373. },
  51374. drag: {
  51375. type: Boolean,
  51376. default: false
  51377. },
  51378. withCredentials: Boolean,
  51379. showFileList: {
  51380. type: Boolean,
  51381. default: true
  51382. },
  51383. accept: {
  51384. type: String,
  51385. default: ""
  51386. },
  51387. type: {
  51388. type: String,
  51389. default: "select"
  51390. },
  51391. fileList: {
  51392. type: definePropType(Array),
  51393. default: () => mutable([])
  51394. },
  51395. autoUpload: {
  51396. type: Boolean,
  51397. default: true
  51398. },
  51399. listType: {
  51400. type: String,
  51401. values: uploadListTypes,
  51402. default: "text"
  51403. },
  51404. httpRequest: {
  51405. type: definePropType(Function),
  51406. default: ajaxUpload
  51407. },
  51408. disabled: Boolean,
  51409. limit: Number
  51410. });
  51411. const uploadProps = buildProps({
  51412. ...uploadBaseProps,
  51413. beforeUpload: {
  51414. type: definePropType(Function),
  51415. default: NOOP
  51416. },
  51417. beforeRemove: {
  51418. type: definePropType(Function)
  51419. },
  51420. onRemove: {
  51421. type: definePropType(Function),
  51422. default: NOOP
  51423. },
  51424. onChange: {
  51425. type: definePropType(Function),
  51426. default: NOOP
  51427. },
  51428. onPreview: {
  51429. type: definePropType(Function),
  51430. default: NOOP
  51431. },
  51432. onSuccess: {
  51433. type: definePropType(Function),
  51434. default: NOOP
  51435. },
  51436. onProgress: {
  51437. type: definePropType(Function),
  51438. default: NOOP
  51439. },
  51440. onError: {
  51441. type: definePropType(Function),
  51442. default: NOOP
  51443. },
  51444. onExceed: {
  51445. type: definePropType(Function),
  51446. default: NOOP
  51447. }
  51448. });
  51449. const uploadListProps = buildProps({
  51450. files: {
  51451. type: definePropType(Array),
  51452. default: () => mutable([])
  51453. },
  51454. disabled: {
  51455. type: Boolean,
  51456. default: false
  51457. },
  51458. handlePreview: {
  51459. type: definePropType(Function),
  51460. default: NOOP
  51461. },
  51462. listType: {
  51463. type: String,
  51464. values: uploadListTypes,
  51465. default: "text"
  51466. }
  51467. });
  51468. const uploadListEmits = {
  51469. remove: (file) => !!file
  51470. };
  51471. const _hoisted_1$5 = ["onKeydown"];
  51472. const _hoisted_2$4 = ["src"];
  51473. const _hoisted_3$2 = ["onClick"];
  51474. const _hoisted_4$1 = ["onClick"];
  51475. const _hoisted_5 = ["onClick"];
  51476. const __default__$5 = vue.defineComponent({
  51477. name: "ElUploadList"
  51478. });
  51479. const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
  51480. ...__default__$5,
  51481. props: uploadListProps,
  51482. emits: uploadListEmits,
  51483. setup(__props, { emit }) {
  51484. const { t } = useLocale();
  51485. const nsUpload = useNamespace("upload");
  51486. const nsIcon = useNamespace("icon");
  51487. const nsList = useNamespace("list");
  51488. const disabled = useDisabled();
  51489. const focusing = vue.ref(false);
  51490. const handleRemove = (file) => {
  51491. emit("remove", file);
  51492. };
  51493. return (_ctx, _cache) => {
  51494. return vue.openBlock(), vue.createBlock(vue.TransitionGroup, {
  51495. tag: "ul",
  51496. class: vue.normalizeClass([
  51497. vue.unref(nsUpload).b("list"),
  51498. vue.unref(nsUpload).bm("list", _ctx.listType),
  51499. vue.unref(nsUpload).is("disabled", vue.unref(disabled))
  51500. ]),
  51501. name: vue.unref(nsList).b()
  51502. }, {
  51503. default: vue.withCtx(() => [
  51504. (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.files, (file) => {
  51505. return vue.openBlock(), vue.createElementBlock("li", {
  51506. key: file.uid || file.name,
  51507. class: vue.normalizeClass([
  51508. vue.unref(nsUpload).be("list", "item"),
  51509. vue.unref(nsUpload).is(file.status),
  51510. { focusing: focusing.value }
  51511. ]),
  51512. tabindex: "0",
  51513. onKeydown: vue.withKeys(($event) => !vue.unref(disabled) && handleRemove(file), ["delete"]),
  51514. onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true),
  51515. onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false),
  51516. onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false)
  51517. }, [
  51518. vue.renderSlot(_ctx.$slots, "default", { file }, () => [
  51519. _ctx.listType === "picture" || file.status !== "uploading" && _ctx.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("img", {
  51520. key: 0,
  51521. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-thumbnail")),
  51522. src: file.url,
  51523. alt: ""
  51524. }, null, 10, _hoisted_2$4)) : vue.createCommentVNode("v-if", true),
  51525. file.status === "uploading" || _ctx.listType !== "picture-card" ? (vue.openBlock(), vue.createElementBlock("div", {
  51526. key: 1,
  51527. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-info"))
  51528. }, [
  51529. vue.createElementVNode("a", {
  51530. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-name")),
  51531. onClick: vue.withModifiers(($event) => _ctx.handlePreview(file), ["prevent"])
  51532. }, [
  51533. vue.createVNode(vue.unref(ElIcon), {
  51534. class: vue.normalizeClass(vue.unref(nsIcon).m("document"))
  51535. }, {
  51536. default: vue.withCtx(() => [
  51537. vue.createVNode(vue.unref(document_default))
  51538. ]),
  51539. _: 1
  51540. }, 8, ["class"]),
  51541. vue.createElementVNode("span", {
  51542. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-file-name"))
  51543. }, vue.toDisplayString(file.name), 3)
  51544. ], 10, _hoisted_3$2),
  51545. file.status === "uploading" ? (vue.openBlock(), vue.createBlock(vue.unref(ElProgress), {
  51546. key: 0,
  51547. type: _ctx.listType === "picture-card" ? "circle" : "line",
  51548. "stroke-width": _ctx.listType === "picture-card" ? 6 : 2,
  51549. percentage: Number(file.percentage),
  51550. style: vue.normalizeStyle(_ctx.listType === "picture-card" ? "" : "margin-top: 0.5rem")
  51551. }, null, 8, ["type", "stroke-width", "percentage", "style"])) : vue.createCommentVNode("v-if", true)
  51552. ], 2)) : vue.createCommentVNode("v-if", true),
  51553. vue.createElementVNode("label", {
  51554. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-status-label"))
  51555. }, [
  51556. _ctx.listType === "text" ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  51557. key: 0,
  51558. class: vue.normalizeClass([vue.unref(nsIcon).m("upload-success"), vue.unref(nsIcon).m("circle-check")])
  51559. }, {
  51560. default: vue.withCtx(() => [
  51561. vue.createVNode(vue.unref(circle_check_default))
  51562. ]),
  51563. _: 1
  51564. }, 8, ["class"])) : ["picture-card", "picture"].includes(_ctx.listType) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  51565. key: 1,
  51566. class: vue.normalizeClass([vue.unref(nsIcon).m("upload-success"), vue.unref(nsIcon).m("check")])
  51567. }, {
  51568. default: vue.withCtx(() => [
  51569. vue.createVNode(vue.unref(check_default))
  51570. ]),
  51571. _: 1
  51572. }, 8, ["class"])) : vue.createCommentVNode("v-if", true)
  51573. ], 2),
  51574. !vue.unref(disabled) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  51575. key: 2,
  51576. class: vue.normalizeClass(vue.unref(nsIcon).m("close")),
  51577. onClick: ($event) => handleRemove(file)
  51578. }, {
  51579. default: vue.withCtx(() => [
  51580. vue.createVNode(vue.unref(close_default))
  51581. ]),
  51582. _: 2
  51583. }, 1032, ["class", "onClick"])) : vue.createCommentVNode("v-if", true),
  51584. vue.createCommentVNode(" Due to close btn only appears when li gets focused disappears after li gets blurred, thus keyboard navigation can never reach close btn"),
  51585. vue.createCommentVNode(" This is a bug which needs to be fixed "),
  51586. vue.createCommentVNode(" TODO: Fix the incorrect navigation interaction "),
  51587. !vue.unref(disabled) ? (vue.openBlock(), vue.createElementBlock("i", {
  51588. key: 3,
  51589. class: vue.normalizeClass(vue.unref(nsIcon).m("close-tip"))
  51590. }, vue.toDisplayString(vue.unref(t)("el.upload.deleteTip")), 3)) : vue.createCommentVNode("v-if", true),
  51591. _ctx.listType === "picture-card" ? (vue.openBlock(), vue.createElementBlock("span", {
  51592. key: 4,
  51593. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-actions"))
  51594. }, [
  51595. vue.createElementVNode("span", {
  51596. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-preview")),
  51597. onClick: ($event) => _ctx.handlePreview(file)
  51598. }, [
  51599. vue.createVNode(vue.unref(ElIcon), {
  51600. class: vue.normalizeClass(vue.unref(nsIcon).m("zoom-in"))
  51601. }, {
  51602. default: vue.withCtx(() => [
  51603. vue.createVNode(vue.unref(zoom_in_default))
  51604. ]),
  51605. _: 1
  51606. }, 8, ["class"])
  51607. ], 10, _hoisted_4$1),
  51608. !vue.unref(disabled) ? (vue.openBlock(), vue.createElementBlock("span", {
  51609. key: 0,
  51610. class: vue.normalizeClass(vue.unref(nsUpload).be("list", "item-delete")),
  51611. onClick: ($event) => handleRemove(file)
  51612. }, [
  51613. vue.createVNode(vue.unref(ElIcon), {
  51614. class: vue.normalizeClass(vue.unref(nsIcon).m("delete"))
  51615. }, {
  51616. default: vue.withCtx(() => [
  51617. vue.createVNode(vue.unref(delete_default))
  51618. ]),
  51619. _: 1
  51620. }, 8, ["class"])
  51621. ], 10, _hoisted_5)) : vue.createCommentVNode("v-if", true)
  51622. ], 2)) : vue.createCommentVNode("v-if", true)
  51623. ])
  51624. ], 42, _hoisted_1$5);
  51625. }), 128)),
  51626. vue.renderSlot(_ctx.$slots, "append")
  51627. ]),
  51628. _: 3
  51629. }, 8, ["class", "name"]);
  51630. };
  51631. }
  51632. });
  51633. var UploadList = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "upload-list.vue"]]);
  51634. const uploadDraggerProps = buildProps({
  51635. disabled: {
  51636. type: Boolean,
  51637. default: false
  51638. }
  51639. });
  51640. const uploadDraggerEmits = {
  51641. file: (file) => isArray(file)
  51642. };
  51643. const _hoisted_1$4 = ["onDrop", "onDragover"];
  51644. const COMPONENT_NAME = "ElUploadDrag";
  51645. const __default__$4 = vue.defineComponent({
  51646. name: COMPONENT_NAME
  51647. });
  51648. const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
  51649. ...__default__$4,
  51650. props: uploadDraggerProps,
  51651. emits: uploadDraggerEmits,
  51652. setup(__props, { emit }) {
  51653. const uploaderContext = vue.inject(uploadContextKey);
  51654. if (!uploaderContext) {
  51655. throwError(COMPONENT_NAME, "usage: <el-upload><el-upload-dragger /></el-upload>");
  51656. }
  51657. const ns = useNamespace("upload");
  51658. const dragover = vue.ref(false);
  51659. const disabled = useDisabled();
  51660. const onDrop = (e) => {
  51661. if (disabled.value)
  51662. return;
  51663. dragover.value = false;
  51664. const files = Array.from(e.dataTransfer.files);
  51665. const accept = uploaderContext.accept.value;
  51666. if (!accept) {
  51667. emit("file", files);
  51668. return;
  51669. }
  51670. const filesFiltered = files.filter((file) => {
  51671. const { type, name } = file;
  51672. const extension = name.includes(".") ? `.${name.split(".").pop()}` : "";
  51673. const baseType = type.replace(/\/.*$/, "");
  51674. return accept.split(",").map((type2) => type2.trim()).filter((type2) => type2).some((acceptedType) => {
  51675. if (acceptedType.startsWith(".")) {
  51676. return extension === acceptedType;
  51677. }
  51678. if (/\/\*$/.test(acceptedType)) {
  51679. return baseType === acceptedType.replace(/\/\*$/, "");
  51680. }
  51681. if (/^[^/]+\/[^/]+$/.test(acceptedType)) {
  51682. return type === acceptedType;
  51683. }
  51684. return false;
  51685. });
  51686. });
  51687. emit("file", filesFiltered);
  51688. };
  51689. const onDragover = () => {
  51690. if (!disabled.value)
  51691. dragover.value = true;
  51692. };
  51693. return (_ctx, _cache) => {
  51694. return vue.openBlock(), vue.createElementBlock("div", {
  51695. class: vue.normalizeClass([vue.unref(ns).b("dragger"), vue.unref(ns).is("dragover", dragover.value)]),
  51696. onDrop: vue.withModifiers(onDrop, ["prevent"]),
  51697. onDragover: vue.withModifiers(onDragover, ["prevent"]),
  51698. onDragleave: _cache[0] || (_cache[0] = vue.withModifiers(($event) => dragover.value = false, ["prevent"]))
  51699. }, [
  51700. vue.renderSlot(_ctx.$slots, "default")
  51701. ], 42, _hoisted_1$4);
  51702. };
  51703. }
  51704. });
  51705. var UploadDragger = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "upload-dragger.vue"]]);
  51706. const uploadContentProps = buildProps({
  51707. ...uploadBaseProps,
  51708. beforeUpload: {
  51709. type: definePropType(Function),
  51710. default: NOOP
  51711. },
  51712. onRemove: {
  51713. type: definePropType(Function),
  51714. default: NOOP
  51715. },
  51716. onStart: {
  51717. type: definePropType(Function),
  51718. default: NOOP
  51719. },
  51720. onSuccess: {
  51721. type: definePropType(Function),
  51722. default: NOOP
  51723. },
  51724. onProgress: {
  51725. type: definePropType(Function),
  51726. default: NOOP
  51727. },
  51728. onError: {
  51729. type: definePropType(Function),
  51730. default: NOOP
  51731. },
  51732. onExceed: {
  51733. type: definePropType(Function),
  51734. default: NOOP
  51735. }
  51736. });
  51737. const _hoisted_1$3 = ["onKeydown"];
  51738. const _hoisted_2$3 = ["name", "multiple", "accept"];
  51739. const __default__$3 = vue.defineComponent({
  51740. name: "ElUploadContent",
  51741. inheritAttrs: false
  51742. });
  51743. const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
  51744. ...__default__$3,
  51745. props: uploadContentProps,
  51746. setup(__props, { expose }) {
  51747. const props = __props;
  51748. const ns = useNamespace("upload");
  51749. const disabled = useDisabled();
  51750. const requests = vue.shallowRef({});
  51751. const inputRef = vue.shallowRef();
  51752. const uploadFiles = (files) => {
  51753. if (files.length === 0)
  51754. return;
  51755. const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props;
  51756. if (limit && fileList.length + files.length > limit) {
  51757. onExceed(files, fileList);
  51758. return;
  51759. }
  51760. if (!multiple) {
  51761. files = files.slice(0, 1);
  51762. }
  51763. for (const file of files) {
  51764. const rawFile = file;
  51765. rawFile.uid = genFileId();
  51766. onStart(rawFile);
  51767. if (autoUpload)
  51768. upload(rawFile);
  51769. }
  51770. };
  51771. const upload = async (rawFile) => {
  51772. inputRef.value.value = "";
  51773. if (!props.beforeUpload) {
  51774. return doUpload(rawFile);
  51775. }
  51776. let hookResult;
  51777. try {
  51778. hookResult = await props.beforeUpload(rawFile);
  51779. } catch (e) {
  51780. hookResult = false;
  51781. }
  51782. if (hookResult === false) {
  51783. props.onRemove(rawFile);
  51784. return;
  51785. }
  51786. let file = rawFile;
  51787. if (hookResult instanceof Blob) {
  51788. if (hookResult instanceof File) {
  51789. file = hookResult;
  51790. } else {
  51791. file = new File([hookResult], rawFile.name, {
  51792. type: rawFile.type
  51793. });
  51794. }
  51795. }
  51796. doUpload(Object.assign(file, {
  51797. uid: rawFile.uid
  51798. }));
  51799. };
  51800. const doUpload = (rawFile) => {
  51801. const {
  51802. headers,
  51803. data,
  51804. method,
  51805. withCredentials,
  51806. name: filename,
  51807. action,
  51808. onProgress,
  51809. onSuccess,
  51810. onError,
  51811. httpRequest
  51812. } = props;
  51813. const { uid } = rawFile;
  51814. const options = {
  51815. headers: headers || {},
  51816. withCredentials,
  51817. file: rawFile,
  51818. data,
  51819. method,
  51820. filename,
  51821. action,
  51822. onProgress: (evt) => {
  51823. onProgress(evt, rawFile);
  51824. },
  51825. onSuccess: (res) => {
  51826. onSuccess(res, rawFile);
  51827. delete requests.value[uid];
  51828. },
  51829. onError: (err) => {
  51830. onError(err, rawFile);
  51831. delete requests.value[uid];
  51832. }
  51833. };
  51834. const request = httpRequest(options);
  51835. requests.value[uid] = request;
  51836. if (request instanceof Promise) {
  51837. request.then(options.onSuccess, options.onError);
  51838. }
  51839. };
  51840. const handleChange = (e) => {
  51841. const files = e.target.files;
  51842. if (!files)
  51843. return;
  51844. uploadFiles(Array.from(files));
  51845. };
  51846. const handleClick = () => {
  51847. if (!disabled.value) {
  51848. inputRef.value.value = "";
  51849. inputRef.value.click();
  51850. }
  51851. };
  51852. const handleKeydown = () => {
  51853. handleClick();
  51854. };
  51855. const abort = (file) => {
  51856. const _reqs = entriesOf(requests.value).filter(file ? ([uid]) => String(file.uid) === uid : () => true);
  51857. _reqs.forEach(([uid, req]) => {
  51858. if (req instanceof XMLHttpRequest)
  51859. req.abort();
  51860. delete requests.value[uid];
  51861. });
  51862. };
  51863. expose({
  51864. abort,
  51865. upload
  51866. });
  51867. return (_ctx, _cache) => {
  51868. return vue.openBlock(), vue.createElementBlock("div", {
  51869. class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.listType), vue.unref(ns).is("drag", _ctx.drag)]),
  51870. tabindex: "0",
  51871. onClick: handleClick,
  51872. onKeydown: vue.withKeys(vue.withModifiers(handleKeydown, ["self"]), ["enter", "space"])
  51873. }, [
  51874. _ctx.drag ? (vue.openBlock(), vue.createBlock(UploadDragger, {
  51875. key: 0,
  51876. disabled: vue.unref(disabled),
  51877. onFile: uploadFiles
  51878. }, {
  51879. default: vue.withCtx(() => [
  51880. vue.renderSlot(_ctx.$slots, "default")
  51881. ]),
  51882. _: 3
  51883. }, 8, ["disabled"])) : vue.renderSlot(_ctx.$slots, "default", { key: 1 }),
  51884. vue.createElementVNode("input", {
  51885. ref_key: "inputRef",
  51886. ref: inputRef,
  51887. class: vue.normalizeClass(vue.unref(ns).e("input")),
  51888. name: _ctx.name,
  51889. multiple: _ctx.multiple,
  51890. accept: _ctx.accept,
  51891. type: "file",
  51892. onChange: handleChange,
  51893. onClick: _cache[0] || (_cache[0] = vue.withModifiers(() => {
  51894. }, ["stop"]))
  51895. }, null, 42, _hoisted_2$3)
  51896. ], 42, _hoisted_1$3);
  51897. };
  51898. }
  51899. });
  51900. var UploadContent = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "upload-content.vue"]]);
  51901. const SCOPE$1 = "ElUpload";
  51902. const revokeObjectURL = (file) => {
  51903. var _a;
  51904. if ((_a = file.url) == null ? void 0 : _a.startsWith("blob:")) {
  51905. URL.revokeObjectURL(file.url);
  51906. }
  51907. };
  51908. const useHandlers = (props, uploadRef) => {
  51909. const uploadFiles = useVModel(props, "fileList", void 0, { passive: true });
  51910. const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
  51911. function abort(file) {
  51912. var _a;
  51913. (_a = uploadRef.value) == null ? void 0 : _a.abort(file);
  51914. }
  51915. function clearFiles(states = ["ready", "uploading", "success", "fail"]) {
  51916. uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
  51917. }
  51918. const handleError = (err, rawFile) => {
  51919. const file = getFile(rawFile);
  51920. if (!file)
  51921. return;
  51922. console.error(err);
  51923. file.status = "fail";
  51924. uploadFiles.value.splice(uploadFiles.value.indexOf(file), 1);
  51925. props.onError(err, file, uploadFiles.value);
  51926. props.onChange(file, uploadFiles.value);
  51927. };
  51928. const handleProgress = (evt, rawFile) => {
  51929. const file = getFile(rawFile);
  51930. if (!file)
  51931. return;
  51932. props.onProgress(evt, file, uploadFiles.value);
  51933. file.status = "uploading";
  51934. file.percentage = Math.round(evt.percent);
  51935. };
  51936. const handleSuccess = (response, rawFile) => {
  51937. const file = getFile(rawFile);
  51938. if (!file)
  51939. return;
  51940. file.status = "success";
  51941. file.response = response;
  51942. props.onSuccess(response, file, uploadFiles.value);
  51943. props.onChange(file, uploadFiles.value);
  51944. };
  51945. const handleStart = (file) => {
  51946. if (isNil(file.uid))
  51947. file.uid = genFileId();
  51948. const uploadFile = {
  51949. name: file.name,
  51950. percentage: 0,
  51951. status: "ready",
  51952. size: file.size,
  51953. raw: file,
  51954. uid: file.uid
  51955. };
  51956. if (props.listType === "picture-card" || props.listType === "picture") {
  51957. try {
  51958. uploadFile.url = URL.createObjectURL(file);
  51959. } catch (err) {
  51960. debugWarn(SCOPE$1, err.message);
  51961. props.onError(err, uploadFile, uploadFiles.value);
  51962. }
  51963. }
  51964. uploadFiles.value = [...uploadFiles.value, uploadFile];
  51965. props.onChange(uploadFile, uploadFiles.value);
  51966. };
  51967. const handleRemove = async (file) => {
  51968. const uploadFile = file instanceof File ? getFile(file) : file;
  51969. if (!uploadFile)
  51970. throwError(SCOPE$1, "file to be removed not found");
  51971. const doRemove = (file2) => {
  51972. abort(file2);
  51973. const fileList = uploadFiles.value;
  51974. fileList.splice(fileList.indexOf(file2), 1);
  51975. props.onRemove(file2, fileList);
  51976. revokeObjectURL(file2);
  51977. };
  51978. if (props.beforeRemove) {
  51979. const before = await props.beforeRemove(uploadFile, uploadFiles.value);
  51980. if (before !== false)
  51981. doRemove(uploadFile);
  51982. } else {
  51983. doRemove(uploadFile);
  51984. }
  51985. };
  51986. function submit() {
  51987. uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => {
  51988. var _a;
  51989. return raw && ((_a = uploadRef.value) == null ? void 0 : _a.upload(raw));
  51990. });
  51991. }
  51992. vue.watch(() => props.listType, (val) => {
  51993. if (val !== "picture-card" && val !== "picture") {
  51994. return;
  51995. }
  51996. uploadFiles.value = uploadFiles.value.map((file) => {
  51997. const { raw, url } = file;
  51998. if (!url && raw) {
  51999. try {
  52000. file.url = URL.createObjectURL(raw);
  52001. } catch (err) {
  52002. props.onError(err, file, uploadFiles.value);
  52003. }
  52004. }
  52005. return file;
  52006. });
  52007. });
  52008. vue.watch(uploadFiles, (files) => {
  52009. for (const file of files) {
  52010. file.uid || (file.uid = genFileId());
  52011. file.status || (file.status = "success");
  52012. }
  52013. }, { immediate: true, deep: true });
  52014. return {
  52015. uploadFiles,
  52016. abort,
  52017. clearFiles,
  52018. handleError,
  52019. handleProgress,
  52020. handleStart,
  52021. handleSuccess,
  52022. handleRemove,
  52023. submit
  52024. };
  52025. };
  52026. const __default__$2 = vue.defineComponent({
  52027. name: "ElUpload"
  52028. });
  52029. const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
  52030. ...__default__$2,
  52031. props: uploadProps,
  52032. setup(__props, { expose }) {
  52033. const props = __props;
  52034. const slots = vue.useSlots();
  52035. const disabled = useDisabled();
  52036. const uploadRef = vue.shallowRef();
  52037. const {
  52038. abort,
  52039. submit,
  52040. clearFiles,
  52041. uploadFiles,
  52042. handleStart,
  52043. handleError,
  52044. handleRemove,
  52045. handleSuccess,
  52046. handleProgress
  52047. } = useHandlers(props, uploadRef);
  52048. const isPictureCard = vue.computed(() => props.listType === "picture-card");
  52049. const uploadContentProps = vue.computed(() => ({
  52050. ...props,
  52051. fileList: uploadFiles.value,
  52052. onStart: handleStart,
  52053. onProgress: handleProgress,
  52054. onSuccess: handleSuccess,
  52055. onError: handleError,
  52056. onRemove: handleRemove
  52057. }));
  52058. vue.onBeforeUnmount(() => {
  52059. uploadFiles.value.forEach(({ url }) => {
  52060. if (url == null ? void 0 : url.startsWith("blob:"))
  52061. URL.revokeObjectURL(url);
  52062. });
  52063. });
  52064. vue.provide(uploadContextKey, {
  52065. accept: vue.toRef(props, "accept")
  52066. });
  52067. expose({
  52068. abort,
  52069. submit,
  52070. clearFiles,
  52071. handleStart,
  52072. handleRemove
  52073. });
  52074. return (_ctx, _cache) => {
  52075. return vue.openBlock(), vue.createElementBlock("div", null, [
  52076. vue.unref(isPictureCard) && _ctx.showFileList ? (vue.openBlock(), vue.createBlock(UploadList, {
  52077. key: 0,
  52078. disabled: vue.unref(disabled),
  52079. "list-type": _ctx.listType,
  52080. files: vue.unref(uploadFiles),
  52081. "handle-preview": _ctx.onPreview,
  52082. onRemove: vue.unref(handleRemove)
  52083. }, vue.createSlots({
  52084. append: vue.withCtx(() => [
  52085. vue.createVNode(UploadContent, vue.mergeProps({
  52086. ref_key: "uploadRef",
  52087. ref: uploadRef
  52088. }, vue.unref(uploadContentProps)), {
  52089. default: vue.withCtx(() => [
  52090. vue.unref(slots).trigger ? vue.renderSlot(_ctx.$slots, "trigger", { key: 0 }) : vue.createCommentVNode("v-if", true),
  52091. !vue.unref(slots).trigger && vue.unref(slots).default ? vue.renderSlot(_ctx.$slots, "default", { key: 1 }) : vue.createCommentVNode("v-if", true)
  52092. ]),
  52093. _: 3
  52094. }, 16)
  52095. ]),
  52096. _: 2
  52097. }, [
  52098. _ctx.$slots.file ? {
  52099. name: "default",
  52100. fn: vue.withCtx(({ file }) => [
  52101. vue.renderSlot(_ctx.$slots, "file", { file })
  52102. ])
  52103. } : void 0
  52104. ]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : vue.createCommentVNode("v-if", true),
  52105. !vue.unref(isPictureCard) || vue.unref(isPictureCard) && !_ctx.showFileList ? (vue.openBlock(), vue.createBlock(UploadContent, vue.mergeProps({
  52106. key: 1,
  52107. ref_key: "uploadRef",
  52108. ref: uploadRef
  52109. }, vue.unref(uploadContentProps)), {
  52110. default: vue.withCtx(() => [
  52111. vue.unref(slots).trigger ? vue.renderSlot(_ctx.$slots, "trigger", { key: 0 }) : vue.createCommentVNode("v-if", true),
  52112. !vue.unref(slots).trigger && vue.unref(slots).default ? vue.renderSlot(_ctx.$slots, "default", { key: 1 }) : vue.createCommentVNode("v-if", true)
  52113. ]),
  52114. _: 3
  52115. }, 16)) : vue.createCommentVNode("v-if", true),
  52116. _ctx.$slots.trigger ? vue.renderSlot(_ctx.$slots, "default", { key: 2 }) : vue.createCommentVNode("v-if", true),
  52117. vue.renderSlot(_ctx.$slots, "tip"),
  52118. !vue.unref(isPictureCard) && _ctx.showFileList ? (vue.openBlock(), vue.createBlock(UploadList, {
  52119. key: 3,
  52120. disabled: vue.unref(disabled),
  52121. "list-type": _ctx.listType,
  52122. files: vue.unref(uploadFiles),
  52123. "handle-preview": _ctx.onPreview,
  52124. onRemove: vue.unref(handleRemove)
  52125. }, vue.createSlots({ _: 2 }, [
  52126. _ctx.$slots.file ? {
  52127. name: "default",
  52128. fn: vue.withCtx(({ file }) => [
  52129. vue.renderSlot(_ctx.$slots, "file", { file })
  52130. ])
  52131. } : void 0
  52132. ]), 1032, ["disabled", "list-type", "files", "handle-preview", "onRemove"])) : vue.createCommentVNode("v-if", true)
  52133. ]);
  52134. };
  52135. }
  52136. });
  52137. var Upload = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "upload.vue"]]);
  52138. const ElUpload = withInstall(Upload);
  52139. var Components = [
  52140. ElAffix,
  52141. ElAlert,
  52142. ElAutocomplete,
  52143. ElAutoResizer,
  52144. ElAvatar,
  52145. ElBacktop,
  52146. ElBadge,
  52147. ElBreadcrumb,
  52148. ElBreadcrumbItem,
  52149. ElButton,
  52150. ElButtonGroup$1,
  52151. ElCalendar,
  52152. ElCard,
  52153. ElCarousel,
  52154. ElCarouselItem,
  52155. ElCascader,
  52156. ElCascaderPanel,
  52157. ElCheckTag,
  52158. ElCheckbox,
  52159. ElCheckboxButton,
  52160. ElCheckboxGroup$1,
  52161. ElCol,
  52162. ElCollapse,
  52163. ElCollapseItem,
  52164. ElCollapseTransition,
  52165. ElColorPicker,
  52166. ElConfigProvider,
  52167. ElContainer,
  52168. ElAside,
  52169. ElFooter,
  52170. ElHeader,
  52171. ElMain,
  52172. ElDatePicker,
  52173. ElDescriptions,
  52174. ElDescriptionsItem,
  52175. ElDialog,
  52176. ElDivider,
  52177. ElDrawer,
  52178. ElDropdown,
  52179. ElDropdownItem,
  52180. ElDropdownMenu,
  52181. ElEmpty,
  52182. ElForm,
  52183. ElFormItem,
  52184. ElIcon,
  52185. ElImage,
  52186. ElImageViewer,
  52187. ElInput,
  52188. ElInputNumber,
  52189. ElLink,
  52190. ElMenu,
  52191. ElMenuItem,
  52192. ElMenuItemGroup,
  52193. ElPageHeader,
  52194. ElPagination,
  52195. ElPopconfirm,
  52196. ElPopover,
  52197. ElPopper,
  52198. ElProgress,
  52199. ElRadio,
  52200. ElRadioButton,
  52201. ElRadioGroup,
  52202. ElRate,
  52203. ElResult,
  52204. ElRow,
  52205. ElScrollbar,
  52206. ElSelect,
  52207. ElOption,
  52208. ElOptionGroup,
  52209. ElSelectV2,
  52210. ElSkeleton,
  52211. ElSkeletonItem,
  52212. ElSlider,
  52213. ElSpace,
  52214. ElStatistic,
  52215. ElCountdown,
  52216. ElSteps,
  52217. ElStep,
  52218. ElSwitch,
  52219. ElTable,
  52220. ElTableColumn,
  52221. ElTableV2,
  52222. ElTabs,
  52223. ElTabPane,
  52224. ElTag,
  52225. ElTimePicker,
  52226. ElTimeSelect,
  52227. ElTimeline,
  52228. ElTimelineItem,
  52229. ElTooltip,
  52230. ElTooltipV2,
  52231. ElTransfer,
  52232. ElTree,
  52233. ElTreeSelect,
  52234. ElTreeV2,
  52235. ElUpload
  52236. ];
  52237. const SCOPE = "ElInfiniteScroll";
  52238. const CHECK_INTERVAL = 50;
  52239. const DEFAULT_DELAY = 200;
  52240. const DEFAULT_DISTANCE = 0;
  52241. const attributes = {
  52242. delay: {
  52243. type: Number,
  52244. default: DEFAULT_DELAY
  52245. },
  52246. distance: {
  52247. type: Number,
  52248. default: DEFAULT_DISTANCE
  52249. },
  52250. disabled: {
  52251. type: Boolean,
  52252. default: false
  52253. },
  52254. immediate: {
  52255. type: Boolean,
  52256. default: true
  52257. }
  52258. };
  52259. const getScrollOptions = (el, instance) => {
  52260. return Object.entries(attributes).reduce((acm, [name, option]) => {
  52261. var _a, _b;
  52262. const { type, default: defaultValue } = option;
  52263. const attrVal = el.getAttribute(`infinite-scroll-${name}`);
  52264. let value = (_b = (_a = instance[attrVal]) != null ? _a : attrVal) != null ? _b : defaultValue;
  52265. value = value === "false" ? false : value;
  52266. value = type(value);
  52267. acm[name] = Number.isNaN(value) ? defaultValue : value;
  52268. return acm;
  52269. }, {});
  52270. };
  52271. const destroyObserver = (el) => {
  52272. const { observer } = el[SCOPE];
  52273. if (observer) {
  52274. observer.disconnect();
  52275. delete el[SCOPE].observer;
  52276. }
  52277. };
  52278. const handleScroll = (el, cb) => {
  52279. const { container, containerEl, instance, observer, lastScrollTop } = el[SCOPE];
  52280. const { disabled, distance } = getScrollOptions(el, instance);
  52281. const { clientHeight, scrollHeight, scrollTop } = containerEl;
  52282. const delta = scrollTop - lastScrollTop;
  52283. el[SCOPE].lastScrollTop = scrollTop;
  52284. if (observer || disabled || delta < 0)
  52285. return;
  52286. let shouldTrigger = false;
  52287. if (container === el) {
  52288. shouldTrigger = scrollHeight - (clientHeight + scrollTop) <= distance;
  52289. } else {
  52290. const { clientTop, scrollHeight: height } = el;
  52291. const offsetTop = getOffsetTopDistance(el, containerEl);
  52292. shouldTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance;
  52293. }
  52294. if (shouldTrigger) {
  52295. cb.call(instance);
  52296. }
  52297. };
  52298. function checkFull(el, cb) {
  52299. const { containerEl, instance } = el[SCOPE];
  52300. const { disabled } = getScrollOptions(el, instance);
  52301. if (disabled || containerEl.clientHeight === 0)
  52302. return;
  52303. if (containerEl.scrollHeight <= containerEl.clientHeight) {
  52304. cb.call(instance);
  52305. } else {
  52306. destroyObserver(el);
  52307. }
  52308. }
  52309. const InfiniteScroll = {
  52310. async mounted(el, binding) {
  52311. const { instance, value: cb } = binding;
  52312. if (!isFunction(cb)) {
  52313. throwError(SCOPE, "'v-infinite-scroll' binding value must be a function");
  52314. }
  52315. await vue.nextTick();
  52316. const { delay, immediate } = getScrollOptions(el, instance);
  52317. const container = getScrollContainer(el, true);
  52318. const containerEl = container === window ? document.documentElement : container;
  52319. const onScroll = throttle(handleScroll.bind(null, el, cb), delay);
  52320. if (!container)
  52321. return;
  52322. el[SCOPE] = {
  52323. instance,
  52324. container,
  52325. containerEl,
  52326. delay,
  52327. cb,
  52328. onScroll,
  52329. lastScrollTop: containerEl.scrollTop
  52330. };
  52331. if (immediate) {
  52332. const observer = new MutationObserver(throttle(checkFull.bind(null, el, cb), CHECK_INTERVAL));
  52333. el[SCOPE].observer = observer;
  52334. observer.observe(el, { childList: true, subtree: true });
  52335. checkFull(el, cb);
  52336. }
  52337. container.addEventListener("scroll", onScroll);
  52338. },
  52339. unmounted(el) {
  52340. const { container, onScroll } = el[SCOPE];
  52341. container == null ? void 0 : container.removeEventListener("scroll", onScroll);
  52342. destroyObserver(el);
  52343. },
  52344. async updated(el) {
  52345. if (!el[SCOPE]) {
  52346. await vue.nextTick();
  52347. }
  52348. const { containerEl, cb, observer } = el[SCOPE];
  52349. if (containerEl.clientHeight && observer) {
  52350. checkFull(el, cb);
  52351. }
  52352. }
  52353. };
  52354. var InfiniteScroll$1 = InfiniteScroll;
  52355. const _InfiniteScroll = InfiniteScroll$1;
  52356. _InfiniteScroll.install = (app) => {
  52357. app.directive("InfiniteScroll", _InfiniteScroll);
  52358. };
  52359. const ElInfiniteScroll = _InfiniteScroll;
  52360. function createLoadingComponent(options) {
  52361. let afterLeaveTimer;
  52362. const ns = useNamespace("loading");
  52363. const afterLeaveFlag = vue.ref(false);
  52364. const data = vue.reactive({
  52365. ...options,
  52366. originalPosition: "",
  52367. originalOverflow: "",
  52368. visible: false
  52369. });
  52370. function setText(text) {
  52371. data.text = text;
  52372. }
  52373. function destroySelf() {
  52374. const target = data.parent;
  52375. if (!target.vLoadingAddClassList) {
  52376. let loadingNumber = target.getAttribute("loading-number");
  52377. loadingNumber = Number.parseInt(loadingNumber) - 1;
  52378. if (!loadingNumber) {
  52379. removeClass(target, ns.bm("parent", "relative"));
  52380. target.removeAttribute("loading-number");
  52381. } else {
  52382. target.setAttribute("loading-number", loadingNumber.toString());
  52383. }
  52384. removeClass(target, ns.bm("parent", "hidden"));
  52385. }
  52386. removeElLoadingChild();
  52387. loadingInstance.unmount();
  52388. }
  52389. function removeElLoadingChild() {
  52390. var _a, _b;
  52391. (_b = (_a = vm.$el) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.removeChild(vm.$el);
  52392. }
  52393. function close() {
  52394. var _a;
  52395. if (options.beforeClose && !options.beforeClose())
  52396. return;
  52397. afterLeaveFlag.value = true;
  52398. clearTimeout(afterLeaveTimer);
  52399. afterLeaveTimer = window.setTimeout(handleAfterLeave, 400);
  52400. data.visible = false;
  52401. (_a = options.closed) == null ? void 0 : _a.call(options);
  52402. }
  52403. function handleAfterLeave() {
  52404. if (!afterLeaveFlag.value)
  52405. return;
  52406. const target = data.parent;
  52407. afterLeaveFlag.value = false;
  52408. target.vLoadingAddClassList = void 0;
  52409. destroySelf();
  52410. }
  52411. const elLoadingComponent = {
  52412. name: "ElLoading",
  52413. setup() {
  52414. return () => {
  52415. const svg = data.spinner || data.svg;
  52416. const spinner = vue.h("svg", {
  52417. class: "circular",
  52418. viewBox: data.svgViewBox ? data.svgViewBox : "0 0 50 50",
  52419. ...svg ? { innerHTML: svg } : {}
  52420. }, [
  52421. vue.h("circle", {
  52422. class: "path",
  52423. cx: "25",
  52424. cy: "25",
  52425. r: "20",
  52426. fill: "none"
  52427. })
  52428. ]);
  52429. const spinnerText = data.text ? vue.h("p", { class: ns.b("text") }, [data.text]) : void 0;
  52430. return vue.h(vue.Transition, {
  52431. name: ns.b("fade"),
  52432. onAfterLeave: handleAfterLeave
  52433. }, {
  52434. default: vue.withCtx(() => [
  52435. vue.withDirectives(vue.createVNode("div", {
  52436. style: {
  52437. backgroundColor: data.background || ""
  52438. },
  52439. class: [
  52440. ns.b("mask"),
  52441. data.customClass,
  52442. data.fullscreen ? "is-fullscreen" : ""
  52443. ]
  52444. }, [
  52445. vue.h("div", {
  52446. class: ns.b("spinner")
  52447. }, [spinner, spinnerText])
  52448. ]), [[vue.vShow, data.visible]])
  52449. ])
  52450. });
  52451. };
  52452. }
  52453. };
  52454. const loadingInstance = vue.createApp(elLoadingComponent);
  52455. const vm = loadingInstance.mount(document.createElement("div"));
  52456. return {
  52457. ...vue.toRefs(data),
  52458. setText,
  52459. removeElLoadingChild,
  52460. close,
  52461. handleAfterLeave,
  52462. vm,
  52463. get $el() {
  52464. return vm.$el;
  52465. }
  52466. };
  52467. }
  52468. let fullscreenInstance = void 0;
  52469. const Loading = function(options = {}) {
  52470. if (!isClient)
  52471. return void 0;
  52472. const resolved = resolveOptions(options);
  52473. if (resolved.fullscreen && fullscreenInstance) {
  52474. return fullscreenInstance;
  52475. }
  52476. const instance = createLoadingComponent({
  52477. ...resolved,
  52478. closed: () => {
  52479. var _a;
  52480. (_a = resolved.closed) == null ? void 0 : _a.call(resolved);
  52481. if (resolved.fullscreen)
  52482. fullscreenInstance = void 0;
  52483. }
  52484. });
  52485. addStyle(resolved, resolved.parent, instance);
  52486. addClassList(resolved, resolved.parent, instance);
  52487. resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance);
  52488. let loadingNumber = resolved.parent.getAttribute("loading-number");
  52489. if (!loadingNumber) {
  52490. loadingNumber = "1";
  52491. } else {
  52492. loadingNumber = `${Number.parseInt(loadingNumber) + 1}`;
  52493. }
  52494. resolved.parent.setAttribute("loading-number", loadingNumber);
  52495. resolved.parent.appendChild(instance.$el);
  52496. vue.nextTick(() => instance.visible.value = resolved.visible);
  52497. if (resolved.fullscreen) {
  52498. fullscreenInstance = instance;
  52499. }
  52500. return instance;
  52501. };
  52502. const resolveOptions = (options) => {
  52503. var _a, _b, _c, _d;
  52504. let target;
  52505. if (isString(options.target)) {
  52506. target = (_a = document.querySelector(options.target)) != null ? _a : document.body;
  52507. } else {
  52508. target = options.target || document.body;
  52509. }
  52510. return {
  52511. parent: target === document.body || options.body ? document.body : target,
  52512. background: options.background || "",
  52513. svg: options.svg || "",
  52514. svgViewBox: options.svgViewBox || "",
  52515. spinner: options.spinner || false,
  52516. text: options.text || "",
  52517. fullscreen: target === document.body && ((_b = options.fullscreen) != null ? _b : true),
  52518. lock: (_c = options.lock) != null ? _c : false,
  52519. customClass: options.customClass || "",
  52520. visible: (_d = options.visible) != null ? _d : true,
  52521. target
  52522. };
  52523. };
  52524. const addStyle = async (options, parent, instance) => {
  52525. const { nextZIndex } = useZIndex();
  52526. const maskStyle = {};
  52527. if (options.fullscreen) {
  52528. instance.originalPosition.value = getStyle(document.body, "position");
  52529. instance.originalOverflow.value = getStyle(document.body, "overflow");
  52530. maskStyle.zIndex = nextZIndex();
  52531. } else if (options.parent === document.body) {
  52532. instance.originalPosition.value = getStyle(document.body, "position");
  52533. await vue.nextTick();
  52534. for (const property of ["top", "left"]) {
  52535. const scroll = property === "top" ? "scrollTop" : "scrollLeft";
  52536. maskStyle[property] = `${options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle(document.body, `margin-${property}`), 10)}px`;
  52537. }
  52538. for (const property of ["height", "width"]) {
  52539. maskStyle[property] = `${options.target.getBoundingClientRect()[property]}px`;
  52540. }
  52541. } else {
  52542. instance.originalPosition.value = getStyle(parent, "position");
  52543. }
  52544. for (const [key, value] of Object.entries(maskStyle)) {
  52545. instance.$el.style[key] = value;
  52546. }
  52547. };
  52548. const addClassList = (options, parent, instance) => {
  52549. const ns = useNamespace("loading");
  52550. if (!["absolute", "fixed", "sticky"].includes(instance.originalPosition.value)) {
  52551. addClass(parent, ns.bm("parent", "relative"));
  52552. } else {
  52553. removeClass(parent, ns.bm("parent", "relative"));
  52554. }
  52555. if (options.fullscreen && options.lock) {
  52556. addClass(parent, ns.bm("parent", "hidden"));
  52557. } else {
  52558. removeClass(parent, ns.bm("parent", "hidden"));
  52559. }
  52560. };
  52561. const INSTANCE_KEY = Symbol("ElLoading");
  52562. const createInstance = (el, binding) => {
  52563. var _a, _b, _c, _d;
  52564. const vm = binding.instance;
  52565. const getBindingProp = (key) => isObject$1(binding.value) ? binding.value[key] : void 0;
  52566. const resolveExpression = (key) => {
  52567. const data = isString(key) && (vm == null ? void 0 : vm[key]) || key;
  52568. if (data)
  52569. return vue.ref(data);
  52570. else
  52571. return data;
  52572. };
  52573. const getProp = (name) => resolveExpression(getBindingProp(name) || el.getAttribute(`element-loading-${hyphenate(name)}`));
  52574. const fullscreen = (_a = getBindingProp("fullscreen")) != null ? _a : binding.modifiers.fullscreen;
  52575. const options = {
  52576. text: getProp("text"),
  52577. svg: getProp("svg"),
  52578. svgViewBox: getProp("svgViewBox"),
  52579. spinner: getProp("spinner"),
  52580. background: getProp("background"),
  52581. customClass: getProp("customClass"),
  52582. fullscreen,
  52583. target: (_b = getBindingProp("target")) != null ? _b : fullscreen ? void 0 : el,
  52584. body: (_c = getBindingProp("body")) != null ? _c : binding.modifiers.body,
  52585. lock: (_d = getBindingProp("lock")) != null ? _d : binding.modifiers.lock
  52586. };
  52587. el[INSTANCE_KEY] = {
  52588. options,
  52589. instance: Loading(options)
  52590. };
  52591. };
  52592. const updateOptions = (newOptions, originalOptions) => {
  52593. for (const key of Object.keys(originalOptions)) {
  52594. if (vue.isRef(originalOptions[key]))
  52595. originalOptions[key].value = newOptions[key];
  52596. }
  52597. };
  52598. const vLoading = {
  52599. mounted(el, binding) {
  52600. if (binding.value) {
  52601. createInstance(el, binding);
  52602. }
  52603. },
  52604. updated(el, binding) {
  52605. const instance = el[INSTANCE_KEY];
  52606. if (binding.oldValue !== binding.value) {
  52607. if (binding.value && !binding.oldValue) {
  52608. createInstance(el, binding);
  52609. } else if (binding.value && binding.oldValue) {
  52610. if (isObject$1(binding.value))
  52611. updateOptions(binding.value, instance.options);
  52612. } else {
  52613. instance == null ? void 0 : instance.instance.close();
  52614. }
  52615. }
  52616. },
  52617. unmounted(el) {
  52618. var _a;
  52619. (_a = el[INSTANCE_KEY]) == null ? void 0 : _a.instance.close();
  52620. }
  52621. };
  52622. const ElLoading = {
  52623. install(app) {
  52624. app.directive("loading", vLoading);
  52625. app.config.globalProperties.$loading = Loading;
  52626. },
  52627. directive: vLoading,
  52628. service: Loading
  52629. };
  52630. const messageTypes = ["success", "info", "warning", "error"];
  52631. const messageDefaults = mutable({
  52632. customClass: "",
  52633. center: false,
  52634. dangerouslyUseHTMLString: false,
  52635. duration: 3e3,
  52636. icon: void 0,
  52637. id: "",
  52638. message: "",
  52639. onClose: void 0,
  52640. showClose: false,
  52641. type: "info",
  52642. offset: 16,
  52643. zIndex: 0,
  52644. grouping: false,
  52645. repeatNum: 1,
  52646. appendTo: isClient ? document.body : void 0
  52647. });
  52648. const messageProps = buildProps({
  52649. customClass: {
  52650. type: String,
  52651. default: messageDefaults.customClass
  52652. },
  52653. center: {
  52654. type: Boolean,
  52655. default: messageDefaults.center
  52656. },
  52657. dangerouslyUseHTMLString: {
  52658. type: Boolean,
  52659. default: messageDefaults.dangerouslyUseHTMLString
  52660. },
  52661. duration: {
  52662. type: Number,
  52663. default: messageDefaults.duration
  52664. },
  52665. icon: {
  52666. type: iconPropType,
  52667. default: messageDefaults.icon
  52668. },
  52669. id: {
  52670. type: String,
  52671. default: messageDefaults.id
  52672. },
  52673. message: {
  52674. type: definePropType([
  52675. String,
  52676. Object,
  52677. Function
  52678. ]),
  52679. default: messageDefaults.message
  52680. },
  52681. onClose: {
  52682. type: definePropType(Function),
  52683. required: false
  52684. },
  52685. showClose: {
  52686. type: Boolean,
  52687. default: messageDefaults.showClose
  52688. },
  52689. type: {
  52690. type: String,
  52691. values: messageTypes,
  52692. default: messageDefaults.type
  52693. },
  52694. offset: {
  52695. type: Number,
  52696. default: messageDefaults.offset
  52697. },
  52698. zIndex: {
  52699. type: Number,
  52700. default: messageDefaults.zIndex
  52701. },
  52702. grouping: {
  52703. type: Boolean,
  52704. default: messageDefaults.grouping
  52705. },
  52706. repeatNum: {
  52707. type: Number,
  52708. default: messageDefaults.repeatNum
  52709. }
  52710. });
  52711. const messageEmits = {
  52712. destroy: () => true
  52713. };
  52714. const instances = vue.shallowReactive([]);
  52715. const getInstance = (id) => {
  52716. const idx = instances.findIndex((instance) => instance.id === id);
  52717. const current = instances[idx];
  52718. let prev;
  52719. if (idx > 0) {
  52720. prev = instances[idx - 1];
  52721. }
  52722. return { current, prev };
  52723. };
  52724. const getLastOffset = (id) => {
  52725. const { prev } = getInstance(id);
  52726. if (!prev)
  52727. return 0;
  52728. return prev.vm.exposed.bottom.value;
  52729. };
  52730. const _hoisted_1$2 = ["id"];
  52731. const _hoisted_2$2 = ["innerHTML"];
  52732. const __default__$1 = vue.defineComponent({
  52733. name: "ElMessage"
  52734. });
  52735. const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
  52736. ...__default__$1,
  52737. props: messageProps,
  52738. emits: messageEmits,
  52739. setup(__props, { expose }) {
  52740. const props = __props;
  52741. const { Close } = TypeComponents;
  52742. const ns = useNamespace("message");
  52743. const messageRef = vue.ref();
  52744. const visible = vue.ref(false);
  52745. const height = vue.ref(0);
  52746. let stopTimer = void 0;
  52747. const badgeType = vue.computed(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
  52748. const typeClass = vue.computed(() => {
  52749. const type = props.type;
  52750. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  52751. });
  52752. const iconComponent = vue.computed(() => props.icon || TypeComponentsMap[props.type] || "");
  52753. const lastOffset = vue.computed(() => getLastOffset(props.id));
  52754. const offset = vue.computed(() => props.offset + lastOffset.value);
  52755. const bottom = vue.computed(() => height.value + offset.value);
  52756. const customStyle = vue.computed(() => ({
  52757. top: `${offset.value}px`,
  52758. zIndex: props.zIndex
  52759. }));
  52760. function startTimer() {
  52761. if (props.duration === 0)
  52762. return;
  52763. ({ stop: stopTimer } = useTimeoutFn(() => {
  52764. close();
  52765. }, props.duration));
  52766. }
  52767. function clearTimer() {
  52768. stopTimer == null ? void 0 : stopTimer();
  52769. }
  52770. function close() {
  52771. visible.value = false;
  52772. }
  52773. function keydown({ code }) {
  52774. if (code === EVENT_CODE.esc) {
  52775. close();
  52776. }
  52777. }
  52778. vue.onMounted(() => {
  52779. startTimer();
  52780. visible.value = true;
  52781. });
  52782. vue.watch(() => props.repeatNum, () => {
  52783. clearTimer();
  52784. startTimer();
  52785. });
  52786. useEventListener(document, "keydown", keydown);
  52787. useResizeObserver(messageRef, () => {
  52788. height.value = messageRef.value.getBoundingClientRect().height;
  52789. });
  52790. expose({
  52791. visible,
  52792. bottom,
  52793. close
  52794. });
  52795. return (_ctx, _cache) => {
  52796. return vue.openBlock(), vue.createBlock(vue.Transition, {
  52797. name: vue.unref(ns).b("fade"),
  52798. onBeforeLeave: _ctx.onClose,
  52799. onAfterLeave: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("destroy")),
  52800. persisted: ""
  52801. }, {
  52802. default: vue.withCtx(() => [
  52803. vue.withDirectives(vue.createElementVNode("div", {
  52804. id: _ctx.id,
  52805. ref_key: "messageRef",
  52806. ref: messageRef,
  52807. class: vue.normalizeClass([
  52808. vue.unref(ns).b(),
  52809. { [vue.unref(ns).m(_ctx.type)]: _ctx.type && !_ctx.icon },
  52810. vue.unref(ns).is("center", _ctx.center),
  52811. vue.unref(ns).is("closable", _ctx.showClose),
  52812. _ctx.customClass
  52813. ]),
  52814. style: vue.normalizeStyle(vue.unref(customStyle)),
  52815. role: "alert",
  52816. onMouseenter: clearTimer,
  52817. onMouseleave: startTimer
  52818. }, [
  52819. _ctx.repeatNum > 1 ? (vue.openBlock(), vue.createBlock(vue.unref(ElBadge), {
  52820. key: 0,
  52821. value: _ctx.repeatNum,
  52822. type: vue.unref(badgeType),
  52823. class: vue.normalizeClass(vue.unref(ns).e("badge"))
  52824. }, null, 8, ["value", "type", "class"])) : vue.createCommentVNode("v-if", true),
  52825. vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  52826. key: 1,
  52827. class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
  52828. }, {
  52829. default: vue.withCtx(() => [
  52830. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
  52831. ]),
  52832. _: 1
  52833. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  52834. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  52835. !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", {
  52836. key: 0,
  52837. class: vue.normalizeClass(vue.unref(ns).e("content"))
  52838. }, vue.toDisplayString(_ctx.message), 3)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  52839. vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
  52840. vue.createElementVNode("p", {
  52841. class: vue.normalizeClass(vue.unref(ns).e("content")),
  52842. innerHTML: _ctx.message
  52843. }, null, 10, _hoisted_2$2)
  52844. ], 2112))
  52845. ]),
  52846. _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  52847. key: 2,
  52848. class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
  52849. onClick: vue.withModifiers(close, ["stop"])
  52850. }, {
  52851. default: vue.withCtx(() => [
  52852. vue.createVNode(vue.unref(Close))
  52853. ]),
  52854. _: 1
  52855. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  52856. ], 46, _hoisted_1$2), [
  52857. [vue.vShow, visible.value]
  52858. ])
  52859. ]),
  52860. _: 3
  52861. }, 8, ["name", "onBeforeLeave"]);
  52862. };
  52863. }
  52864. });
  52865. var MessageConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "message.vue"]]);
  52866. let seed$1 = 1;
  52867. const normalizeOptions = (params) => {
  52868. const options = !params || isString(params) || vue.isVNode(params) || isFunction(params) ? { message: params } : params;
  52869. const normalized = {
  52870. ...messageDefaults,
  52871. ...options
  52872. };
  52873. if (!normalized.appendTo) {
  52874. normalized.appendTo = document.body;
  52875. } else if (isString(normalized.appendTo)) {
  52876. let appendTo = document.querySelector(normalized.appendTo);
  52877. if (!isElement$1(appendTo)) {
  52878. appendTo = document.body;
  52879. }
  52880. normalized.appendTo = appendTo;
  52881. }
  52882. return normalized;
  52883. };
  52884. const closeMessage = (instance) => {
  52885. const idx = instances.indexOf(instance);
  52886. if (idx === -1)
  52887. return;
  52888. instances.splice(idx, 1);
  52889. const { handler } = instance;
  52890. handler.close();
  52891. };
  52892. const createMessage = ({ appendTo, ...options }, context) => {
  52893. const { nextZIndex } = useZIndex();
  52894. const id = `message_${seed$1++}`;
  52895. const userOnClose = options.onClose;
  52896. const container = document.createElement("div");
  52897. const props = {
  52898. ...options,
  52899. zIndex: nextZIndex() + options.zIndex,
  52900. id,
  52901. onClose: () => {
  52902. userOnClose == null ? void 0 : userOnClose();
  52903. closeMessage(instance);
  52904. },
  52905. onDestroy: () => {
  52906. vue.render(null, container);
  52907. }
  52908. };
  52909. const vnode = vue.createVNode(MessageConstructor, props, isFunction(props.message) || vue.isVNode(props.message) ? {
  52910. default: isFunction(props.message) ? props.message : () => props.message
  52911. } : null);
  52912. vnode.appContext = context || message._context;
  52913. vue.render(vnode, container);
  52914. appendTo.appendChild(container.firstElementChild);
  52915. const vm = vnode.component;
  52916. const handler = {
  52917. close: () => {
  52918. vm.exposed.visible.value = false;
  52919. }
  52920. };
  52921. const instance = {
  52922. id,
  52923. vnode,
  52924. vm,
  52925. handler,
  52926. props: vnode.component.props
  52927. };
  52928. return instance;
  52929. };
  52930. const message = (options = {}, context) => {
  52931. if (!isClient)
  52932. return { close: () => void 0 };
  52933. if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) {
  52934. return { close: () => void 0 };
  52935. }
  52936. const normalized = normalizeOptions(options);
  52937. if (normalized.grouping && instances.length) {
  52938. const instance2 = instances.find(({ vnode: vm }) => {
  52939. var _a;
  52940. return ((_a = vm.props) == null ? void 0 : _a.message) === normalized.message;
  52941. });
  52942. if (instance2) {
  52943. instance2.props.repeatNum += 1;
  52944. instance2.props.type = normalized.type;
  52945. return instance2.handler;
  52946. }
  52947. }
  52948. const instance = createMessage(normalized, context);
  52949. instances.push(instance);
  52950. return instance.handler;
  52951. };
  52952. messageTypes.forEach((type) => {
  52953. message[type] = (options = {}, appContext) => {
  52954. const normalized = normalizeOptions(options);
  52955. return message({ ...normalized, type }, appContext);
  52956. };
  52957. });
  52958. function closeAll$1(type) {
  52959. for (const instance of instances) {
  52960. if (!type || type === instance.props.type) {
  52961. instance.handler.close();
  52962. }
  52963. }
  52964. }
  52965. message.closeAll = closeAll$1;
  52966. message._context = null;
  52967. var Message = message;
  52968. const ElMessage = withInstallFunction(Message, "$message");
  52969. const _sfc_main$1 = vue.defineComponent({
  52970. name: "ElMessageBox",
  52971. directives: {
  52972. TrapFocus
  52973. },
  52974. components: {
  52975. ElButton,
  52976. ElFocusTrap,
  52977. ElInput,
  52978. ElOverlay,
  52979. ElIcon,
  52980. ...TypeComponents
  52981. },
  52982. inheritAttrs: false,
  52983. props: {
  52984. buttonSize: {
  52985. type: String,
  52986. validator: isValidComponentSize
  52987. },
  52988. modal: {
  52989. type: Boolean,
  52990. default: true
  52991. },
  52992. lockScroll: {
  52993. type: Boolean,
  52994. default: true
  52995. },
  52996. showClose: {
  52997. type: Boolean,
  52998. default: true
  52999. },
  53000. closeOnClickModal: {
  53001. type: Boolean,
  53002. default: true
  53003. },
  53004. closeOnPressEscape: {
  53005. type: Boolean,
  53006. default: true
  53007. },
  53008. closeOnHashChange: {
  53009. type: Boolean,
  53010. default: true
  53011. },
  53012. center: Boolean,
  53013. draggable: Boolean,
  53014. roundButton: {
  53015. default: false,
  53016. type: Boolean
  53017. },
  53018. container: {
  53019. type: String,
  53020. default: "body"
  53021. },
  53022. boxType: {
  53023. type: String,
  53024. default: ""
  53025. }
  53026. },
  53027. emits: ["vanish", "action"],
  53028. setup(props, { emit }) {
  53029. const { t } = useLocale();
  53030. const ns = useNamespace("message-box");
  53031. const visible = vue.ref(false);
  53032. const { nextZIndex } = useZIndex();
  53033. const state = vue.reactive({
  53034. autofocus: true,
  53035. beforeClose: null,
  53036. callback: null,
  53037. cancelButtonText: "",
  53038. cancelButtonClass: "",
  53039. confirmButtonText: "",
  53040. confirmButtonClass: "",
  53041. customClass: "",
  53042. customStyle: {},
  53043. dangerouslyUseHTMLString: false,
  53044. distinguishCancelAndClose: false,
  53045. icon: "",
  53046. inputPattern: null,
  53047. inputPlaceholder: "",
  53048. inputType: "text",
  53049. inputValue: null,
  53050. inputValidator: null,
  53051. inputErrorMessage: "",
  53052. message: null,
  53053. modalFade: true,
  53054. modalClass: "",
  53055. showCancelButton: false,
  53056. showConfirmButton: true,
  53057. type: "",
  53058. title: void 0,
  53059. showInput: false,
  53060. action: "",
  53061. confirmButtonLoading: false,
  53062. cancelButtonLoading: false,
  53063. confirmButtonDisabled: false,
  53064. editorErrorMessage: "",
  53065. validateError: false,
  53066. zIndex: nextZIndex()
  53067. });
  53068. const typeClass = vue.computed(() => {
  53069. const type = state.type;
  53070. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  53071. });
  53072. const contentId = useId();
  53073. const inputId = useId();
  53074. const btnSize = useSize(vue.computed(() => props.buttonSize), { prop: true, form: true, formItem: true });
  53075. const iconComponent = vue.computed(() => state.icon || TypeComponentsMap[state.type] || "");
  53076. const hasMessage = vue.computed(() => !!state.message);
  53077. const rootRef = vue.ref();
  53078. const headerRef = vue.ref();
  53079. const focusStartRef = vue.ref();
  53080. const inputRef = vue.ref();
  53081. const confirmRef = vue.ref();
  53082. const confirmButtonClasses = vue.computed(() => state.confirmButtonClass);
  53083. vue.watch(() => state.inputValue, async (val) => {
  53084. await vue.nextTick();
  53085. if (props.boxType === "prompt" && val !== null) {
  53086. validate();
  53087. }
  53088. }, { immediate: true });
  53089. vue.watch(() => visible.value, (val) => {
  53090. var _a, _b;
  53091. if (val) {
  53092. if (props.boxType !== "prompt") {
  53093. if (state.autofocus) {
  53094. focusStartRef.value = (_b = (_a = confirmRef.value) == null ? void 0 : _a.$el) != null ? _b : rootRef.value;
  53095. } else {
  53096. focusStartRef.value = rootRef.value;
  53097. }
  53098. }
  53099. state.zIndex = nextZIndex();
  53100. }
  53101. if (props.boxType !== "prompt")
  53102. return;
  53103. if (val) {
  53104. vue.nextTick().then(() => {
  53105. var _a2;
  53106. if (inputRef.value && inputRef.value.$el) {
  53107. if (state.autofocus) {
  53108. focusStartRef.value = (_a2 = getInputElement()) != null ? _a2 : rootRef.value;
  53109. } else {
  53110. focusStartRef.value = rootRef.value;
  53111. }
  53112. }
  53113. });
  53114. } else {
  53115. state.editorErrorMessage = "";
  53116. state.validateError = false;
  53117. }
  53118. });
  53119. const draggable = vue.computed(() => props.draggable);
  53120. useDraggable(rootRef, headerRef, draggable);
  53121. vue.onMounted(async () => {
  53122. await vue.nextTick();
  53123. if (props.closeOnHashChange) {
  53124. window.addEventListener("hashchange", doClose);
  53125. }
  53126. });
  53127. vue.onBeforeUnmount(() => {
  53128. if (props.closeOnHashChange) {
  53129. window.removeEventListener("hashchange", doClose);
  53130. }
  53131. });
  53132. function doClose() {
  53133. if (!visible.value)
  53134. return;
  53135. visible.value = false;
  53136. vue.nextTick(() => {
  53137. if (state.action)
  53138. emit("action", state.action);
  53139. });
  53140. }
  53141. const handleWrapperClick = () => {
  53142. if (props.closeOnClickModal) {
  53143. handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
  53144. }
  53145. };
  53146. const overlayEvent = useSameTarget(handleWrapperClick);
  53147. const handleInputEnter = (e) => {
  53148. if (state.inputType !== "textarea") {
  53149. e.preventDefault();
  53150. return handleAction("confirm");
  53151. }
  53152. };
  53153. const handleAction = (action) => {
  53154. var _a;
  53155. if (props.boxType === "prompt" && action === "confirm" && !validate()) {
  53156. return;
  53157. }
  53158. state.action = action;
  53159. if (state.beforeClose) {
  53160. (_a = state.beforeClose) == null ? void 0 : _a.call(state, action, state, doClose);
  53161. } else {
  53162. doClose();
  53163. }
  53164. };
  53165. const validate = () => {
  53166. if (props.boxType === "prompt") {
  53167. const inputPattern = state.inputPattern;
  53168. if (inputPattern && !inputPattern.test(state.inputValue || "")) {
  53169. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  53170. state.validateError = true;
  53171. return false;
  53172. }
  53173. const inputValidator = state.inputValidator;
  53174. if (typeof inputValidator === "function") {
  53175. const validateResult = inputValidator(state.inputValue);
  53176. if (validateResult === false) {
  53177. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  53178. state.validateError = true;
  53179. return false;
  53180. }
  53181. if (typeof validateResult === "string") {
  53182. state.editorErrorMessage = validateResult;
  53183. state.validateError = true;
  53184. return false;
  53185. }
  53186. }
  53187. }
  53188. state.editorErrorMessage = "";
  53189. state.validateError = false;
  53190. return true;
  53191. };
  53192. const getInputElement = () => {
  53193. const inputRefs = inputRef.value.$refs;
  53194. return inputRefs.input || inputRefs.textarea;
  53195. };
  53196. const handleClose = () => {
  53197. handleAction("close");
  53198. };
  53199. const onCloseRequested = () => {
  53200. if (props.closeOnPressEscape) {
  53201. handleClose();
  53202. }
  53203. };
  53204. if (props.lockScroll) {
  53205. useLockscreen(visible);
  53206. }
  53207. useRestoreActive(visible);
  53208. return {
  53209. ...vue.toRefs(state),
  53210. ns,
  53211. overlayEvent,
  53212. visible,
  53213. hasMessage,
  53214. typeClass,
  53215. contentId,
  53216. inputId,
  53217. btnSize,
  53218. iconComponent,
  53219. confirmButtonClasses,
  53220. rootRef,
  53221. focusStartRef,
  53222. headerRef,
  53223. inputRef,
  53224. confirmRef,
  53225. doClose,
  53226. handleClose,
  53227. onCloseRequested,
  53228. handleWrapperClick,
  53229. handleInputEnter,
  53230. handleAction,
  53231. t
  53232. };
  53233. }
  53234. });
  53235. const _hoisted_1$1 = ["aria-label", "aria-describedby"];
  53236. const _hoisted_2$1 = ["aria-label"];
  53237. const _hoisted_3$1 = ["id"];
  53238. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  53239. const _component_el_icon = vue.resolveComponent("el-icon");
  53240. const _component_close = vue.resolveComponent("close");
  53241. const _component_el_input = vue.resolveComponent("el-input");
  53242. const _component_el_button = vue.resolveComponent("el-button");
  53243. const _component_el_focus_trap = vue.resolveComponent("el-focus-trap");
  53244. const _component_el_overlay = vue.resolveComponent("el-overlay");
  53245. return vue.openBlock(), vue.createBlock(vue.Transition, {
  53246. name: "fade-in-linear",
  53247. onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish")),
  53248. persisted: ""
  53249. }, {
  53250. default: vue.withCtx(() => [
  53251. vue.withDirectives(vue.createVNode(_component_el_overlay, {
  53252. "z-index": _ctx.zIndex,
  53253. "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
  53254. mask: _ctx.modal
  53255. }, {
  53256. default: vue.withCtx(() => [
  53257. vue.createElementVNode("div", {
  53258. role: "dialog",
  53259. "aria-label": _ctx.title,
  53260. "aria-modal": "true",
  53261. "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
  53262. class: vue.normalizeClass(`${_ctx.ns.namespace.value}-overlay-message-box`),
  53263. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)),
  53264. onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)),
  53265. onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args))
  53266. }, [
  53267. vue.createVNode(_component_el_focus_trap, {
  53268. loop: "",
  53269. trapped: _ctx.visible,
  53270. "focus-trap-el": _ctx.rootRef,
  53271. "focus-start-el": _ctx.focusStartRef,
  53272. onReleaseRequested: _ctx.onCloseRequested
  53273. }, {
  53274. default: vue.withCtx(() => [
  53275. vue.createElementVNode("div", {
  53276. ref: "rootRef",
  53277. class: vue.normalizeClass([
  53278. _ctx.ns.b(),
  53279. _ctx.customClass,
  53280. _ctx.ns.is("draggable", _ctx.draggable),
  53281. { [_ctx.ns.m("center")]: _ctx.center }
  53282. ]),
  53283. style: vue.normalizeStyle(_ctx.customStyle),
  53284. tabindex: "-1",
  53285. onClick: _cache[7] || (_cache[7] = vue.withModifiers(() => {
  53286. }, ["stop"]))
  53287. }, [
  53288. _ctx.title !== null && _ctx.title !== void 0 ? (vue.openBlock(), vue.createElementBlock("div", {
  53289. key: 0,
  53290. ref: "headerRef",
  53291. class: vue.normalizeClass(_ctx.ns.e("header"))
  53292. }, [
  53293. vue.createElementVNode("div", {
  53294. class: vue.normalizeClass(_ctx.ns.e("title"))
  53295. }, [
  53296. _ctx.iconComponent && _ctx.center ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  53297. key: 0,
  53298. class: vue.normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
  53299. }, {
  53300. default: vue.withCtx(() => [
  53301. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
  53302. ]),
  53303. _: 1
  53304. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  53305. vue.createElementVNode("span", null, vue.toDisplayString(_ctx.title), 1)
  53306. ], 2),
  53307. _ctx.showClose ? (vue.openBlock(), vue.createElementBlock("button", {
  53308. key: 0,
  53309. type: "button",
  53310. class: vue.normalizeClass(_ctx.ns.e("headerbtn")),
  53311. "aria-label": _ctx.t("el.messagebox.close"),
  53312. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")),
  53313. onKeydown: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"]))
  53314. }, [
  53315. vue.createVNode(_component_el_icon, {
  53316. class: vue.normalizeClass(_ctx.ns.e("close"))
  53317. }, {
  53318. default: vue.withCtx(() => [
  53319. vue.createVNode(_component_close)
  53320. ]),
  53321. _: 1
  53322. }, 8, ["class"])
  53323. ], 42, _hoisted_2$1)) : vue.createCommentVNode("v-if", true)
  53324. ], 2)) : vue.createCommentVNode("v-if", true),
  53325. vue.createElementVNode("div", {
  53326. id: _ctx.contentId,
  53327. class: vue.normalizeClass(_ctx.ns.e("content"))
  53328. }, [
  53329. vue.createElementVNode("div", {
  53330. class: vue.normalizeClass(_ctx.ns.e("container"))
  53331. }, [
  53332. _ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? (vue.openBlock(), vue.createBlock(_component_el_icon, {
  53333. key: 0,
  53334. class: vue.normalizeClass([_ctx.ns.e("status"), _ctx.typeClass])
  53335. }, {
  53336. default: vue.withCtx(() => [
  53337. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.iconComponent)))
  53338. ]),
  53339. _: 1
  53340. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  53341. _ctx.hasMessage ? (vue.openBlock(), vue.createElementBlock("div", {
  53342. key: 1,
  53343. class: vue.normalizeClass(_ctx.ns.e("message"))
  53344. }, [
  53345. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  53346. !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
  53347. key: 0,
  53348. for: _ctx.showInput ? _ctx.inputId : void 0
  53349. }, {
  53350. default: vue.withCtx(() => [
  53351. vue.createTextVNode(vue.toDisplayString(!_ctx.dangerouslyUseHTMLString ? _ctx.message : ""), 1)
  53352. ]),
  53353. _: 1
  53354. }, 8, ["for"])) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.showInput ? "label" : "p"), {
  53355. key: 1,
  53356. for: _ctx.showInput ? _ctx.inputId : void 0,
  53357. innerHTML: _ctx.message
  53358. }, null, 8, ["for", "innerHTML"]))
  53359. ])
  53360. ], 2)) : vue.createCommentVNode("v-if", true)
  53361. ], 2),
  53362. vue.withDirectives(vue.createElementVNode("div", {
  53363. class: vue.normalizeClass(_ctx.ns.e("input"))
  53364. }, [
  53365. vue.createVNode(_component_el_input, {
  53366. id: _ctx.inputId,
  53367. ref: "inputRef",
  53368. modelValue: _ctx.inputValue,
  53369. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
  53370. type: _ctx.inputType,
  53371. placeholder: _ctx.inputPlaceholder,
  53372. "aria-invalid": _ctx.validateError,
  53373. class: vue.normalizeClass({ invalid: _ctx.validateError }),
  53374. onKeydown: vue.withKeys(_ctx.handleInputEnter, ["enter"])
  53375. }, null, 8, ["id", "modelValue", "type", "placeholder", "aria-invalid", "class", "onKeydown"]),
  53376. vue.createElementVNode("div", {
  53377. class: vue.normalizeClass(_ctx.ns.e("errormsg")),
  53378. style: vue.normalizeStyle({
  53379. visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden"
  53380. })
  53381. }, vue.toDisplayString(_ctx.editorErrorMessage), 7)
  53382. ], 2), [
  53383. [vue.vShow, _ctx.showInput]
  53384. ])
  53385. ], 10, _hoisted_3$1),
  53386. vue.createElementVNode("div", {
  53387. class: vue.normalizeClass(_ctx.ns.e("btns"))
  53388. }, [
  53389. _ctx.showCancelButton ? (vue.openBlock(), vue.createBlock(_component_el_button, {
  53390. key: 0,
  53391. loading: _ctx.cancelButtonLoading,
  53392. class: vue.normalizeClass([_ctx.cancelButtonClass]),
  53393. round: _ctx.roundButton,
  53394. size: _ctx.btnSize,
  53395. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
  53396. onKeydown: _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
  53397. }, {
  53398. default: vue.withCtx(() => [
  53399. vue.createTextVNode(vue.toDisplayString(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)
  53400. ]),
  53401. _: 1
  53402. }, 8, ["loading", "class", "round", "size"])) : vue.createCommentVNode("v-if", true),
  53403. vue.withDirectives(vue.createVNode(_component_el_button, {
  53404. ref: "confirmRef",
  53405. type: "primary",
  53406. loading: _ctx.confirmButtonLoading,
  53407. class: vue.normalizeClass([_ctx.confirmButtonClasses]),
  53408. round: _ctx.roundButton,
  53409. disabled: _ctx.confirmButtonDisabled,
  53410. size: _ctx.btnSize,
  53411. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
  53412. onKeydown: _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
  53413. }, {
  53414. default: vue.withCtx(() => [
  53415. vue.createTextVNode(vue.toDisplayString(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)
  53416. ]),
  53417. _: 1
  53418. }, 8, ["loading", "class", "round", "disabled", "size"]), [
  53419. [vue.vShow, _ctx.showConfirmButton]
  53420. ])
  53421. ], 2)
  53422. ], 6)
  53423. ]),
  53424. _: 3
  53425. }, 8, ["trapped", "focus-trap-el", "focus-start-el", "onReleaseRequested"])
  53426. ], 42, _hoisted_1$1)
  53427. ]),
  53428. _: 3
  53429. }, 8, ["z-index", "overlay-class", "mask"]), [
  53430. [vue.vShow, _ctx.visible]
  53431. ])
  53432. ]),
  53433. _: 3
  53434. });
  53435. }
  53436. var MessageBoxConstructor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__file", "index.vue"]]);
  53437. const messageInstance = /* @__PURE__ */ new Map();
  53438. const getAppendToElement = (props) => {
  53439. let appendTo = document.body;
  53440. if (props.appendTo) {
  53441. if (isString(props.appendTo)) {
  53442. appendTo = document.querySelector(props.appendTo);
  53443. }
  53444. if (isElement$1(props.appendTo)) {
  53445. appendTo = props.appendTo;
  53446. }
  53447. if (!isElement$1(appendTo)) {
  53448. appendTo = document.body;
  53449. }
  53450. }
  53451. return appendTo;
  53452. };
  53453. const initInstance = (props, container, appContext = null) => {
  53454. const vnode = vue.createVNode(MessageBoxConstructor, props, isFunction(props.message) || vue.isVNode(props.message) ? {
  53455. default: isFunction(props.message) ? props.message : () => props.message
  53456. } : null);
  53457. vnode.appContext = appContext;
  53458. vue.render(vnode, container);
  53459. getAppendToElement(props).appendChild(container.firstElementChild);
  53460. return vnode.component;
  53461. };
  53462. const genContainer = () => {
  53463. return document.createElement("div");
  53464. };
  53465. const showMessage = (options, appContext) => {
  53466. const container = genContainer();
  53467. options.onVanish = () => {
  53468. vue.render(null, container);
  53469. messageInstance.delete(vm);
  53470. };
  53471. options.onAction = (action) => {
  53472. const currentMsg = messageInstance.get(vm);
  53473. let resolve;
  53474. if (options.showInput) {
  53475. resolve = { value: vm.inputValue, action };
  53476. } else {
  53477. resolve = action;
  53478. }
  53479. if (options.callback) {
  53480. options.callback(resolve, instance.proxy);
  53481. } else {
  53482. if (action === "cancel" || action === "close") {
  53483. if (options.distinguishCancelAndClose && action !== "cancel") {
  53484. currentMsg.reject("close");
  53485. } else {
  53486. currentMsg.reject("cancel");
  53487. }
  53488. } else {
  53489. currentMsg.resolve(resolve);
  53490. }
  53491. }
  53492. };
  53493. const instance = initInstance(options, container, appContext);
  53494. const vm = instance.proxy;
  53495. for (const prop in options) {
  53496. if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) {
  53497. vm[prop] = options[prop];
  53498. }
  53499. }
  53500. vm.visible = true;
  53501. return vm;
  53502. };
  53503. function MessageBox(options, appContext = null) {
  53504. if (!isClient)
  53505. return Promise.reject();
  53506. let callback;
  53507. if (isString(options) || vue.isVNode(options)) {
  53508. options = {
  53509. message: options
  53510. };
  53511. } else {
  53512. callback = options.callback;
  53513. }
  53514. return new Promise((resolve, reject) => {
  53515. const vm = showMessage(options, appContext != null ? appContext : MessageBox._context);
  53516. messageInstance.set(vm, {
  53517. options,
  53518. callback,
  53519. resolve,
  53520. reject
  53521. });
  53522. });
  53523. }
  53524. const MESSAGE_BOX_VARIANTS = ["alert", "confirm", "prompt"];
  53525. const MESSAGE_BOX_DEFAULT_OPTS = {
  53526. alert: { closeOnPressEscape: false, closeOnClickModal: false },
  53527. confirm: { showCancelButton: true },
  53528. prompt: { showCancelButton: true, showInput: true }
  53529. };
  53530. MESSAGE_BOX_VARIANTS.forEach((boxType) => {
  53531. MessageBox[boxType] = messageBoxFactory(boxType);
  53532. });
  53533. function messageBoxFactory(boxType) {
  53534. return (message, title, options, appContext) => {
  53535. let titleOrOpts = "";
  53536. if (isObject$1(title)) {
  53537. options = title;
  53538. titleOrOpts = "";
  53539. } else if (isUndefined(title)) {
  53540. titleOrOpts = "";
  53541. } else {
  53542. titleOrOpts = title;
  53543. }
  53544. return MessageBox(Object.assign({
  53545. title: titleOrOpts,
  53546. message,
  53547. type: "",
  53548. ...MESSAGE_BOX_DEFAULT_OPTS[boxType]
  53549. }, options, {
  53550. boxType
  53551. }), appContext);
  53552. };
  53553. }
  53554. MessageBox.close = () => {
  53555. messageInstance.forEach((_, vm) => {
  53556. vm.doClose();
  53557. });
  53558. messageInstance.clear();
  53559. };
  53560. MessageBox._context = null;
  53561. const _MessageBox = MessageBox;
  53562. _MessageBox.install = (app) => {
  53563. _MessageBox._context = app._context;
  53564. app.config.globalProperties.$msgbox = _MessageBox;
  53565. app.config.globalProperties.$messageBox = _MessageBox;
  53566. app.config.globalProperties.$alert = _MessageBox.alert;
  53567. app.config.globalProperties.$confirm = _MessageBox.confirm;
  53568. app.config.globalProperties.$prompt = _MessageBox.prompt;
  53569. };
  53570. const ElMessageBox = _MessageBox;
  53571. const notificationTypes = [
  53572. "success",
  53573. "info",
  53574. "warning",
  53575. "error"
  53576. ];
  53577. const notificationProps = buildProps({
  53578. customClass: {
  53579. type: String,
  53580. default: ""
  53581. },
  53582. dangerouslyUseHTMLString: {
  53583. type: Boolean,
  53584. default: false
  53585. },
  53586. duration: {
  53587. type: Number,
  53588. default: 4500
  53589. },
  53590. icon: {
  53591. type: iconPropType
  53592. },
  53593. id: {
  53594. type: String,
  53595. default: ""
  53596. },
  53597. message: {
  53598. type: definePropType([String, Object]),
  53599. default: ""
  53600. },
  53601. offset: {
  53602. type: Number,
  53603. default: 0
  53604. },
  53605. onClick: {
  53606. type: definePropType(Function),
  53607. default: () => void 0
  53608. },
  53609. onClose: {
  53610. type: definePropType(Function),
  53611. required: true
  53612. },
  53613. position: {
  53614. type: String,
  53615. values: ["top-right", "top-left", "bottom-right", "bottom-left"],
  53616. default: "top-right"
  53617. },
  53618. showClose: {
  53619. type: Boolean,
  53620. default: true
  53621. },
  53622. title: {
  53623. type: String,
  53624. default: ""
  53625. },
  53626. type: {
  53627. type: String,
  53628. values: [...notificationTypes, ""],
  53629. default: ""
  53630. },
  53631. zIndex: {
  53632. type: Number,
  53633. default: 0
  53634. }
  53635. });
  53636. const notificationEmits = {
  53637. destroy: () => true
  53638. };
  53639. const _hoisted_1 = ["id"];
  53640. const _hoisted_2 = ["textContent"];
  53641. const _hoisted_3 = { key: 0 };
  53642. const _hoisted_4 = ["innerHTML"];
  53643. const __default__ = vue.defineComponent({
  53644. name: "ElNotification"
  53645. });
  53646. const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  53647. ...__default__,
  53648. props: notificationProps,
  53649. emits: notificationEmits,
  53650. setup(__props, { expose }) {
  53651. const props = __props;
  53652. const ns = useNamespace("notification");
  53653. const { Close } = CloseComponents;
  53654. const visible = vue.ref(false);
  53655. let timer = void 0;
  53656. const typeClass = vue.computed(() => {
  53657. const type = props.type;
  53658. return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
  53659. });
  53660. const iconComponent = vue.computed(() => {
  53661. if (!props.type)
  53662. return props.icon;
  53663. return TypeComponentsMap[props.type] || props.icon;
  53664. });
  53665. const horizontalClass = vue.computed(() => props.position.endsWith("right") ? "right" : "left");
  53666. const verticalProperty = vue.computed(() => props.position.startsWith("top") ? "top" : "bottom");
  53667. const positionStyle = vue.computed(() => {
  53668. return {
  53669. [verticalProperty.value]: `${props.offset}px`,
  53670. zIndex: props.zIndex
  53671. };
  53672. });
  53673. function startTimer() {
  53674. if (props.duration > 0) {
  53675. ({ stop: timer } = useTimeoutFn(() => {
  53676. if (visible.value)
  53677. close();
  53678. }, props.duration));
  53679. }
  53680. }
  53681. function clearTimer() {
  53682. timer == null ? void 0 : timer();
  53683. }
  53684. function close() {
  53685. visible.value = false;
  53686. }
  53687. function onKeydown({ code }) {
  53688. if (code === EVENT_CODE.delete || code === EVENT_CODE.backspace) {
  53689. clearTimer();
  53690. } else if (code === EVENT_CODE.esc) {
  53691. if (visible.value) {
  53692. close();
  53693. }
  53694. } else {
  53695. startTimer();
  53696. }
  53697. }
  53698. vue.onMounted(() => {
  53699. startTimer();
  53700. visible.value = true;
  53701. });
  53702. useEventListener(document, "keydown", onKeydown);
  53703. expose({
  53704. visible,
  53705. close
  53706. });
  53707. return (_ctx, _cache) => {
  53708. return vue.openBlock(), vue.createBlock(vue.Transition, {
  53709. name: vue.unref(ns).b("fade"),
  53710. onBeforeLeave: _ctx.onClose,
  53711. onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
  53712. persisted: ""
  53713. }, {
  53714. default: vue.withCtx(() => [
  53715. vue.withDirectives(vue.createElementVNode("div", {
  53716. id: _ctx.id,
  53717. class: vue.normalizeClass([vue.unref(ns).b(), _ctx.customClass, vue.unref(horizontalClass)]),
  53718. style: vue.normalizeStyle(vue.unref(positionStyle)),
  53719. role: "alert",
  53720. onMouseenter: clearTimer,
  53721. onMouseleave: startTimer,
  53722. onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args))
  53723. }, [
  53724. vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  53725. key: 0,
  53726. class: vue.normalizeClass([vue.unref(ns).e("icon"), vue.unref(typeClass)])
  53727. }, {
  53728. default: vue.withCtx(() => [
  53729. (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
  53730. ]),
  53731. _: 1
  53732. }, 8, ["class"])) : vue.createCommentVNode("v-if", true),
  53733. vue.createElementVNode("div", {
  53734. class: vue.normalizeClass(vue.unref(ns).e("group"))
  53735. }, [
  53736. vue.createElementVNode("h2", {
  53737. class: vue.normalizeClass(vue.unref(ns).e("title")),
  53738. textContent: vue.toDisplayString(_ctx.title)
  53739. }, null, 10, _hoisted_2),
  53740. vue.withDirectives(vue.createElementVNode("div", {
  53741. class: vue.normalizeClass(vue.unref(ns).e("content")),
  53742. style: vue.normalizeStyle(!!_ctx.title ? void 0 : { margin: 0 })
  53743. }, [
  53744. vue.renderSlot(_ctx.$slots, "default", {}, () => [
  53745. !_ctx.dangerouslyUseHTMLString ? (vue.openBlock(), vue.createElementBlock("p", _hoisted_3, vue.toDisplayString(_ctx.message), 1)) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
  53746. vue.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),
  53747. vue.createElementVNode("p", { innerHTML: _ctx.message }, null, 8, _hoisted_4)
  53748. ], 2112))
  53749. ])
  53750. ], 6), [
  53751. [vue.vShow, _ctx.message]
  53752. ]),
  53753. _ctx.showClose ? (vue.openBlock(), vue.createBlock(vue.unref(ElIcon), {
  53754. key: 0,
  53755. class: vue.normalizeClass(vue.unref(ns).e("closeBtn")),
  53756. onClick: vue.withModifiers(close, ["stop"])
  53757. }, {
  53758. default: vue.withCtx(() => [
  53759. vue.createVNode(vue.unref(Close))
  53760. ]),
  53761. _: 1
  53762. }, 8, ["class", "onClick"])) : vue.createCommentVNode("v-if", true)
  53763. ], 2)
  53764. ], 46, _hoisted_1), [
  53765. [vue.vShow, visible.value]
  53766. ])
  53767. ]),
  53768. _: 3
  53769. }, 8, ["name", "onBeforeLeave"]);
  53770. };
  53771. }
  53772. });
  53773. var NotificationConstructor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "notification.vue"]]);
  53774. const notifications = {
  53775. "top-left": [],
  53776. "top-right": [],
  53777. "bottom-left": [],
  53778. "bottom-right": []
  53779. };
  53780. const GAP_SIZE = 16;
  53781. let seed = 1;
  53782. const notify = function(options = {}, context = null) {
  53783. if (!isClient)
  53784. return { close: () => void 0 };
  53785. if (typeof options === "string" || vue.isVNode(options)) {
  53786. options = { message: options };
  53787. }
  53788. const position = options.position || "top-right";
  53789. let verticalOffset = options.offset || 0;
  53790. notifications[position].forEach(({ vm: vm2 }) => {
  53791. var _a;
  53792. verticalOffset += (((_a = vm2.el) == null ? void 0 : _a.offsetHeight) || 0) + GAP_SIZE;
  53793. });
  53794. verticalOffset += GAP_SIZE;
  53795. const { nextZIndex } = useZIndex();
  53796. const id = `notification_${seed++}`;
  53797. const userOnClose = options.onClose;
  53798. const props = {
  53799. zIndex: nextZIndex(),
  53800. ...options,
  53801. offset: verticalOffset,
  53802. id,
  53803. onClose: () => {
  53804. close(id, position, userOnClose);
  53805. }
  53806. };
  53807. let appendTo = document.body;
  53808. if (isElement$1(options.appendTo)) {
  53809. appendTo = options.appendTo;
  53810. } else if (isString(options.appendTo)) {
  53811. appendTo = document.querySelector(options.appendTo);
  53812. }
  53813. if (!isElement$1(appendTo)) {
  53814. appendTo = document.body;
  53815. }
  53816. const container = document.createElement("div");
  53817. const vm = vue.createVNode(NotificationConstructor, props, vue.isVNode(props.message) ? {
  53818. default: () => props.message
  53819. } : null);
  53820. vm.appContext = context != null ? context : notify._context;
  53821. vm.props.onDestroy = () => {
  53822. vue.render(null, container);
  53823. };
  53824. vue.render(vm, container);
  53825. notifications[position].push({ vm });
  53826. appendTo.appendChild(container.firstElementChild);
  53827. return {
  53828. close: () => {
  53829. vm.component.exposed.visible.value = false;
  53830. }
  53831. };
  53832. };
  53833. notificationTypes.forEach((type) => {
  53834. notify[type] = (options = {}) => {
  53835. if (typeof options === "string" || vue.isVNode(options)) {
  53836. options = {
  53837. message: options
  53838. };
  53839. }
  53840. return notify({
  53841. ...options,
  53842. type
  53843. });
  53844. };
  53845. });
  53846. function close(id, position, userOnClose) {
  53847. const orientedNotifications = notifications[position];
  53848. const idx = orientedNotifications.findIndex(({ vm: vm2 }) => {
  53849. var _a;
  53850. return ((_a = vm2.component) == null ? void 0 : _a.props.id) === id;
  53851. });
  53852. if (idx === -1)
  53853. return;
  53854. const { vm } = orientedNotifications[idx];
  53855. if (!vm)
  53856. return;
  53857. userOnClose == null ? void 0 : userOnClose(vm);
  53858. const removedHeight = vm.el.offsetHeight;
  53859. const verticalPos = position.split("-")[0];
  53860. orientedNotifications.splice(idx, 1);
  53861. const len = orientedNotifications.length;
  53862. if (len < 1)
  53863. return;
  53864. for (let i = idx; i < len; i++) {
  53865. const { el, component } = orientedNotifications[i].vm;
  53866. const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
  53867. component.props.offset = pos;
  53868. }
  53869. }
  53870. function closeAll() {
  53871. for (const orientedNotifications of Object.values(notifications)) {
  53872. orientedNotifications.forEach(({ vm }) => {
  53873. vm.component.exposed.visible.value = false;
  53874. });
  53875. }
  53876. }
  53877. notify.closeAll = closeAll;
  53878. notify._context = null;
  53879. var Notify = notify;
  53880. const ElNotification = withInstallFunction(Notify, "$notify");
  53881. var Plugins = [
  53882. ElInfiniteScroll,
  53883. ElLoading,
  53884. ElMessage,
  53885. ElMessageBox,
  53886. ElNotification,
  53887. ElPopoverDirective
  53888. ];
  53889. var installer = makeInstaller([...Components, ...Plugins]);
  53890. const install = installer.install;
  53891. const version = installer.version;
  53892. exports.BAR_MAP = BAR_MAP;
  53893. exports.CASCADER_PANEL_INJECTION_KEY = CASCADER_PANEL_INJECTION_KEY;
  53894. exports.CHANGE_EVENT = CHANGE_EVENT;
  53895. exports.ClickOutside = ClickOutside;
  53896. exports.CommonPicker = CommonPicker;
  53897. exports.CommonProps = CommonProps;
  53898. exports.DEFAULT_FORMATS_DATE = DEFAULT_FORMATS_DATE;
  53899. exports.DEFAULT_FORMATS_DATEPICKER = DEFAULT_FORMATS_DATEPICKER;
  53900. exports.DEFAULT_FORMATS_TIME = DEFAULT_FORMATS_TIME;
  53901. exports.DROPDOWN_COLLECTION_INJECTION_KEY = COLLECTION_INJECTION_KEY;
  53902. exports.DROPDOWN_COLLECTION_ITEM_INJECTION_KEY = COLLECTION_ITEM_INJECTION_KEY;
  53903. exports.DROPDOWN_INJECTION_KEY = DROPDOWN_INJECTION_KEY;
  53904. exports.DefaultProps = DefaultProps;
  53905. exports.DynamicSizeGrid = DynamicSizeGrid$1;
  53906. exports.DynamicSizeList = DynamicSizeList$1;
  53907. exports.EVENT_CODE = EVENT_CODE;
  53908. exports.Effect = Effect;
  53909. exports.ElAffix = ElAffix;
  53910. exports.ElAlert = ElAlert;
  53911. exports.ElAside = ElAside;
  53912. exports.ElAutoResizer = ElAutoResizer;
  53913. exports.ElAutocomplete = ElAutocomplete;
  53914. exports.ElAvatar = ElAvatar;
  53915. exports.ElBacktop = ElBacktop;
  53916. exports.ElBadge = ElBadge;
  53917. exports.ElBreadcrumb = ElBreadcrumb;
  53918. exports.ElBreadcrumbItem = ElBreadcrumbItem;
  53919. exports.ElButton = ElButton;
  53920. exports.ElButtonGroup = ElButtonGroup$1;
  53921. exports.ElCalendar = ElCalendar;
  53922. exports.ElCard = ElCard;
  53923. exports.ElCarousel = ElCarousel;
  53924. exports.ElCarouselItem = ElCarouselItem;
  53925. exports.ElCascader = ElCascader;
  53926. exports.ElCascaderPanel = ElCascaderPanel;
  53927. exports.ElCheckTag = ElCheckTag;
  53928. exports.ElCheckbox = ElCheckbox;
  53929. exports.ElCheckboxButton = ElCheckboxButton;
  53930. exports.ElCheckboxGroup = ElCheckboxGroup$1;
  53931. exports.ElCol = ElCol;
  53932. exports.ElCollapse = ElCollapse;
  53933. exports.ElCollapseItem = ElCollapseItem;
  53934. exports.ElCollapseTransition = ElCollapseTransition;
  53935. exports.ElCollection = ElCollection;
  53936. exports.ElCollectionItem = ElCollectionItem;
  53937. exports.ElColorPicker = ElColorPicker;
  53938. exports.ElConfigProvider = ElConfigProvider;
  53939. exports.ElContainer = ElContainer;
  53940. exports.ElCountdown = ElCountdown;
  53941. exports.ElDatePicker = ElDatePicker;
  53942. exports.ElDescriptions = ElDescriptions;
  53943. exports.ElDescriptionsItem = ElDescriptionsItem;
  53944. exports.ElDialog = ElDialog;
  53945. exports.ElDivider = ElDivider;
  53946. exports.ElDrawer = ElDrawer;
  53947. exports.ElDropdown = ElDropdown;
  53948. exports.ElDropdownItem = ElDropdownItem;
  53949. exports.ElDropdownMenu = ElDropdownMenu;
  53950. exports.ElEmpty = ElEmpty;
  53951. exports.ElFooter = ElFooter;
  53952. exports.ElForm = ElForm;
  53953. exports.ElFormItem = ElFormItem;
  53954. exports.ElHeader = ElHeader;
  53955. exports.ElIcon = ElIcon;
  53956. exports.ElImage = ElImage;
  53957. exports.ElImageViewer = ElImageViewer;
  53958. exports.ElInfiniteScroll = ElInfiniteScroll;
  53959. exports.ElInput = ElInput;
  53960. exports.ElInputNumber = ElInputNumber;
  53961. exports.ElLink = ElLink;
  53962. exports.ElLoading = ElLoading;
  53963. exports.ElLoadingDirective = vLoading;
  53964. exports.ElLoadingService = Loading;
  53965. exports.ElMain = ElMain;
  53966. exports.ElMenu = ElMenu;
  53967. exports.ElMenuItem = ElMenuItem;
  53968. exports.ElMenuItemGroup = ElMenuItemGroup;
  53969. exports.ElMessage = ElMessage;
  53970. exports.ElMessageBox = ElMessageBox;
  53971. exports.ElNotification = ElNotification;
  53972. exports.ElOption = ElOption;
  53973. exports.ElOptionGroup = ElOptionGroup;
  53974. exports.ElOverlay = ElOverlay;
  53975. exports.ElPageHeader = ElPageHeader;
  53976. exports.ElPagination = ElPagination;
  53977. exports.ElPopconfirm = ElPopconfirm;
  53978. exports.ElPopover = ElPopover;
  53979. exports.ElPopoverDirective = ElPopoverDirective;
  53980. exports.ElPopper = ElPopper;
  53981. exports.ElPopperArrow = ElPopperArrow;
  53982. exports.ElPopperContent = ElPopperContent;
  53983. exports.ElPopperTrigger = ElPopperTrigger;
  53984. exports.ElProgress = ElProgress;
  53985. exports.ElRadio = ElRadio;
  53986. exports.ElRadioButton = ElRadioButton;
  53987. exports.ElRadioGroup = ElRadioGroup;
  53988. exports.ElRate = ElRate;
  53989. exports.ElResult = ElResult;
  53990. exports.ElRow = ElRow;
  53991. exports.ElScrollbar = ElScrollbar;
  53992. exports.ElSelect = ElSelect;
  53993. exports.ElSelectV2 = ElSelectV2;
  53994. exports.ElSkeleton = ElSkeleton;
  53995. exports.ElSkeletonItem = ElSkeletonItem;
  53996. exports.ElSlider = ElSlider;
  53997. exports.ElSpace = ElSpace;
  53998. exports.ElStatistic = ElStatistic;
  53999. exports.ElStep = ElStep;
  54000. exports.ElSteps = ElSteps;
  54001. exports.ElSubMenu = ElSubMenu;
  54002. exports.ElSwitch = ElSwitch;
  54003. exports.ElTabPane = ElTabPane;
  54004. exports.ElTable = ElTable;
  54005. exports.ElTableColumn = ElTableColumn;
  54006. exports.ElTableV2 = ElTableV2;
  54007. exports.ElTabs = ElTabs;
  54008. exports.ElTag = ElTag;
  54009. exports.ElTimePicker = ElTimePicker;
  54010. exports.ElTimeSelect = ElTimeSelect;
  54011. exports.ElTimeline = ElTimeline;
  54012. exports.ElTimelineItem = ElTimelineItem;
  54013. exports.ElTooltip = ElTooltip;
  54014. exports.ElTransfer = ElTransfer;
  54015. exports.ElTree = ElTree;
  54016. exports.ElTreeSelect = ElTreeSelect;
  54017. exports.ElTreeV2 = ElTreeV2;
  54018. exports.ElUpload = ElUpload;
  54019. exports.FIRST_KEYS = FIRST_KEYS;
  54020. exports.FIRST_LAST_KEYS = FIRST_LAST_KEYS;
  54021. exports.FORWARD_REF_INJECTION_KEY = FORWARD_REF_INJECTION_KEY;
  54022. exports.FixedSizeGrid = FixedSizeGrid$1;
  54023. exports.FixedSizeList = FixedSizeList$1;
  54024. exports.GAP = GAP;
  54025. exports.ID_INJECTION_KEY = ID_INJECTION_KEY;
  54026. exports.INPUT_EVENT = INPUT_EVENT;
  54027. exports.INSTALLED_KEY = INSTALLED_KEY;
  54028. exports.IconComponentMap = IconComponentMap;
  54029. exports.IconMap = IconMap;
  54030. exports.LAST_KEYS = LAST_KEYS;
  54031. exports.LEFT_CHECK_CHANGE_EVENT = LEFT_CHECK_CHANGE_EVENT;
  54032. exports.Mousewheel = Mousewheel;
  54033. exports.POPPER_CONTENT_INJECTION_KEY = POPPER_CONTENT_INJECTION_KEY;
  54034. exports.POPPER_INJECTION_KEY = POPPER_INJECTION_KEY;
  54035. exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
  54036. exports.ROOT_PICKER_INJECTION_KEY = ROOT_PICKER_INJECTION_KEY;
  54037. exports.RowAlign = RowAlign;
  54038. exports.RowJustify = RowJustify;
  54039. exports.TOOLTIP_INJECTION_KEY = TOOLTIP_INJECTION_KEY;
  54040. exports.TOOLTIP_V2_OPEN = TOOLTIP_V2_OPEN;
  54041. exports.TableV2 = TableV2$1;
  54042. exports.TableV2Alignment = Alignment;
  54043. exports.TableV2FixedDir = FixedDir;
  54044. exports.TableV2Placeholder = placeholderSign;
  54045. exports.TableV2SortOrder = SortOrder;
  54046. exports.TimePickPanel = TimePickPanel;
  54047. exports.TrapFocus = TrapFocus;
  54048. exports.UPDATE_MODEL_EVENT = UPDATE_MODEL_EVENT;
  54049. exports.WEEK_DAYS = WEEK_DAYS;
  54050. exports.affixEmits = affixEmits;
  54051. exports.affixProps = affixProps;
  54052. exports.alertEffects = alertEffects;
  54053. exports.alertEmits = alertEmits;
  54054. exports.alertProps = alertProps;
  54055. exports.arrowMiddleware = arrowMiddleware;
  54056. exports.autoResizerProps = autoResizerProps;
  54057. exports.autocompleteEmits = autocompleteEmits;
  54058. exports.autocompleteProps = autocompleteProps;
  54059. exports.avatarEmits = avatarEmits;
  54060. exports.avatarProps = avatarProps;
  54061. exports.backtopEmits = backtopEmits;
  54062. exports.backtopProps = backtopProps;
  54063. exports.badgeProps = badgeProps;
  54064. exports.breadcrumbItemProps = breadcrumbItemProps;
  54065. exports.breadcrumbKey = breadcrumbKey;
  54066. exports.breadcrumbProps = breadcrumbProps;
  54067. exports.buildLocaleContext = buildLocaleContext;
  54068. exports.buildTimeList = buildTimeList;
  54069. exports.buildTranslator = buildTranslator;
  54070. exports.buttonEmits = buttonEmits;
  54071. exports.buttonGroupContextKey = buttonGroupContextKey;
  54072. exports.buttonNativeTypes = buttonNativeTypes;
  54073. exports.buttonProps = buttonProps;
  54074. exports.buttonTypes = buttonTypes;
  54075. exports.calendarEmits = calendarEmits;
  54076. exports.calendarProps = calendarProps;
  54077. exports.cardProps = cardProps;
  54078. exports.carouselContextKey = carouselContextKey;
  54079. exports.carouselEmits = carouselEmits;
  54080. exports.carouselItemProps = carouselItemProps;
  54081. exports.carouselProps = carouselProps;
  54082. exports.checkTagEmits = checkTagEmits;
  54083. exports.checkTagProps = checkTagProps;
  54084. exports.checkboxEmits = checkboxEmits;
  54085. exports.checkboxGroupContextKey = checkboxGroupContextKey;
  54086. exports.checkboxGroupEmits = checkboxGroupEmits;
  54087. exports.checkboxGroupProps = checkboxGroupProps;
  54088. exports.checkboxProps = checkboxProps;
  54089. exports.colProps = colProps;
  54090. exports.collapseContextKey = collapseContextKey;
  54091. exports.collapseEmits = collapseEmits;
  54092. exports.collapseItemProps = collapseItemProps;
  54093. exports.collapseProps = collapseProps;
  54094. exports.colorPickerContextKey = colorPickerContextKey;
  54095. exports.colorPickerEmits = colorPickerEmits;
  54096. exports.colorPickerProps = colorPickerProps;
  54097. exports.componentSizeMap = componentSizeMap;
  54098. exports.componentSizes = componentSizes;
  54099. exports.configProviderContextKey = configProviderContextKey;
  54100. exports.configProviderProps = configProviderProps;
  54101. exports.countdownEmits = countdownEmits;
  54102. exports.countdownProps = countdownProps;
  54103. exports.createModelToggleComposable = createModelToggleComposable;
  54104. exports.dateEquals = dateEquals;
  54105. exports.datePickTypes = datePickTypes;
  54106. exports.dayjs = dayjs;
  54107. exports["default"] = installer;
  54108. exports.defaultNamespace = defaultNamespace;
  54109. exports.descriptionProps = descriptionProps;
  54110. exports.dialogEmits = dialogEmits;
  54111. exports.dialogInjectionKey = dialogInjectionKey;
  54112. exports.dialogProps = dialogProps;
  54113. exports.dividerProps = dividerProps;
  54114. exports.drawerEmits = drawerEmits;
  54115. exports.drawerProps = drawerProps;
  54116. exports.dropdownItemProps = dropdownItemProps;
  54117. exports.dropdownMenuProps = dropdownMenuProps;
  54118. exports.dropdownProps = dropdownProps;
  54119. exports.elPaginationKey = elPaginationKey;
  54120. exports.emitChangeFn = emitChangeFn;
  54121. exports.emptyProps = emptyProps;
  54122. exports.extractDateFormat = extractDateFormat;
  54123. exports.extractTimeFormat = extractTimeFormat;
  54124. exports.formContextKey = formContextKey;
  54125. exports.formEmits = formEmits;
  54126. exports.formItemContextKey = formItemContextKey;
  54127. exports.formItemProps = formItemProps;
  54128. exports.formItemValidateStates = formItemValidateStates;
  54129. exports.formProps = formProps;
  54130. exports.formatter = formatter;
  54131. exports.genFileId = genFileId;
  54132. exports.getPositionDataWithUnit = getPositionDataWithUnit;
  54133. exports.iconProps = iconProps;
  54134. exports.imageEmits = imageEmits;
  54135. exports.imageProps = imageProps;
  54136. exports.imageViewerEmits = imageViewerEmits;
  54137. exports.imageViewerProps = imageViewerProps;
  54138. exports.inputEmits = inputEmits;
  54139. exports.inputNumberEmits = inputNumberEmits;
  54140. exports.inputNumberProps = inputNumberProps;
  54141. exports.inputProps = inputProps;
  54142. exports.install = install;
  54143. exports.linkEmits = linkEmits;
  54144. exports.linkProps = linkProps;
  54145. exports.makeInstaller = makeInstaller;
  54146. exports.makeList = makeList;
  54147. exports.menuEmits = menuEmits;
  54148. exports.menuItemEmits = menuItemEmits;
  54149. exports.menuItemGroupProps = menuItemGroupProps;
  54150. exports.menuItemProps = menuItemProps;
  54151. exports.menuProps = menuProps;
  54152. exports.messageConfig = messageConfig;
  54153. exports.messageDefaults = messageDefaults;
  54154. exports.messageEmits = messageEmits;
  54155. exports.messageProps = messageProps;
  54156. exports.messageTypes = messageTypes;
  54157. exports.notificationEmits = notificationEmits;
  54158. exports.notificationProps = notificationProps;
  54159. exports.notificationTypes = notificationTypes;
  54160. exports.overlayEmits = overlayEmits;
  54161. exports.overlayProps = overlayProps;
  54162. exports.pageHeaderEmits = pageHeaderEmits;
  54163. exports.pageHeaderProps = pageHeaderProps;
  54164. exports.paginationEmits = paginationEmits;
  54165. exports.paginationProps = paginationProps;
  54166. exports.parseDate = parseDate;
  54167. exports.popconfirmProps = popconfirmProps;
  54168. exports.popoverEmits = popoverEmits;
  54169. exports.popoverProps = popoverProps;
  54170. exports.popperArrowProps = popperArrowProps;
  54171. exports.popperContentEmits = popperContentEmits;
  54172. exports.popperContentProps = popperContentProps;
  54173. exports.popperCoreConfigProps = popperCoreConfigProps;
  54174. exports.popperProps = popperProps;
  54175. exports.popperTriggerProps = popperTriggerProps;
  54176. exports.progressProps = progressProps;
  54177. exports.provideGlobalConfig = provideGlobalConfig;
  54178. exports.radioButtonProps = radioButtonProps;
  54179. exports.radioEmits = radioEmits;
  54180. exports.radioGroupEmits = radioGroupEmits;
  54181. exports.radioGroupKey = radioGroupKey;
  54182. exports.radioGroupProps = radioGroupProps;
  54183. exports.radioProps = radioProps;
  54184. exports.radioPropsBase = radioPropsBase;
  54185. exports.rangeArr = rangeArr;
  54186. exports.rateEmits = rateEmits;
  54187. exports.rateProps = rateProps;
  54188. exports.renderThumbStyle = renderThumbStyle$1;
  54189. exports.resultProps = resultProps;
  54190. exports.roleTypes = roleTypes;
  54191. exports.rowContextKey = rowContextKey;
  54192. exports.rowProps = rowProps;
  54193. exports.scrollbarContextKey = scrollbarContextKey;
  54194. exports.scrollbarEmits = scrollbarEmits;
  54195. exports.scrollbarProps = scrollbarProps;
  54196. exports.selectGroupKey = selectGroupKey;
  54197. exports.selectKey = selectKey;
  54198. exports.selectV2InjectionKey = selectV2InjectionKey;
  54199. exports.skeletonItemProps = skeletonItemProps;
  54200. exports.skeletonProps = skeletonProps;
  54201. exports.sliderContextKey = sliderContextKey;
  54202. exports.sliderEmits = sliderEmits;
  54203. exports.sliderProps = sliderProps;
  54204. exports.spaceProps = spaceProps;
  54205. exports.statisticProps = statisticProps;
  54206. exports.stepProps = stepProps;
  54207. exports.stepsEmits = stepsEmits;
  54208. exports.stepsProps = stepsProps;
  54209. exports.subMenuProps = subMenuProps;
  54210. exports.switchEmits = switchEmits;
  54211. exports.switchProps = switchProps;
  54212. exports.tabBarProps = tabBarProps;
  54213. exports.tabNavEmits = tabNavEmits;
  54214. exports.tabNavProps = tabNavProps;
  54215. exports.tabPaneProps = tabPaneProps;
  54216. exports.tableV2Props = tableV2Props;
  54217. exports.tableV2RowProps = tableV2RowProps;
  54218. exports.tabsEmits = tabsEmits;
  54219. exports.tabsProps = tabsProps;
  54220. exports.tabsRootContextKey = tabsRootContextKey;
  54221. exports.tagEmits = tagEmits;
  54222. exports.tagProps = tagProps;
  54223. exports.thumbProps = thumbProps;
  54224. exports.timePickerDefaultProps = timePickerDefaultProps;
  54225. exports.timeUnits = timeUnits$1;
  54226. exports.timelineItemProps = timelineItemProps;
  54227. exports.tooltipEmits = tooltipEmits;
  54228. exports.tooltipV2ContentKey = tooltipV2ContentKey;
  54229. exports.tooltipV2RootKey = tooltipV2RootKey;
  54230. exports.transferCheckedChangeFn = transferCheckedChangeFn;
  54231. exports.transferEmits = transferEmits;
  54232. exports.transferProps = transferProps;
  54233. exports.translate = translate;
  54234. exports.uploadBaseProps = uploadBaseProps;
  54235. exports.uploadContentProps = uploadContentProps;
  54236. exports.uploadContextKey = uploadContextKey;
  54237. exports.uploadDraggerEmits = uploadDraggerEmits;
  54238. exports.uploadDraggerProps = uploadDraggerProps;
  54239. exports.uploadListEmits = uploadListEmits;
  54240. exports.uploadListProps = uploadListProps;
  54241. exports.uploadListTypes = uploadListTypes;
  54242. exports.uploadProps = uploadProps;
  54243. exports.useAttrs = useAttrs;
  54244. exports.useCascaderConfig = useCascaderConfig;
  54245. exports.useCursor = useCursor;
  54246. exports.useDelayedRender = useDelayedRender;
  54247. exports.useDelayedToggle = useDelayedToggle;
  54248. exports.useDelayedToggleProps = useDelayedToggleProps;
  54249. exports.useDeprecated = useDeprecated;
  54250. exports.useDialog = useDialog;
  54251. exports.useDisabled = useDisabled;
  54252. exports.useDraggable = useDraggable;
  54253. exports.useEscapeKeydown = useEscapeKeydown;
  54254. exports.useFloating = useFloating;
  54255. exports.useFloatingProps = useFloatingProps;
  54256. exports.useFocus = useFocus;
  54257. exports.useFormItem = useFormItem;
  54258. exports.useFormItemInputId = useFormItemInputId;
  54259. exports.useForwardRef = useForwardRef;
  54260. exports.useForwardRefDirective = useForwardRefDirective;
  54261. exports.useGlobalConfig = useGlobalConfig;
  54262. exports.useId = useId;
  54263. exports.useIdInjection = useIdInjection;
  54264. exports.useLocale = useLocale;
  54265. exports.useLockscreen = useLockscreen;
  54266. exports.useModal = useModal;
  54267. exports.useModelToggle = useModelToggle;
  54268. exports.useModelToggleEmits = useModelToggleEmits;
  54269. exports.useModelToggleProps = useModelToggleProps;
  54270. exports.useNamespace = useNamespace;
  54271. exports.useOrderedChildren = useOrderedChildren;
  54272. exports.usePopperArrowProps = usePopperArrowProps;
  54273. exports.usePopperContainer = usePopperContainer;
  54274. exports.usePopperContainerId = usePopperContainerId;
  54275. exports.usePopperContentEmits = usePopperContentEmits;
  54276. exports.usePopperContentProps = usePopperContentProps;
  54277. exports.usePopperCoreConfigProps = usePopperCoreConfigProps;
  54278. exports.usePopperProps = usePopperProps;
  54279. exports.usePopperTriggerProps = usePopperTriggerProps;
  54280. exports.usePreventGlobal = usePreventGlobal;
  54281. exports.useProp = useProp;
  54282. exports.useRestoreActive = useRestoreActive;
  54283. exports.useSameTarget = useSameTarget;
  54284. exports.useSize = useSize;
  54285. exports.useSizeProp = useSizeProp;
  54286. exports.useSpace = useSpace;
  54287. exports.useTeleport = useTeleport;
  54288. exports.useThrottleRender = useThrottleRender;
  54289. exports.useTimeout = useTimeout;
  54290. exports.useTooltipContentProps = useTooltipContentProps;
  54291. exports.useTooltipModelToggle = useTooltipModelToggle;
  54292. exports.useTooltipModelToggleEmits = useTooltipModelToggleEmits;
  54293. exports.useTooltipModelToggleProps = useTooltipModelToggleProps;
  54294. exports.useTooltipProps = useTooltipProps;
  54295. exports.useTooltipTriggerProps = useTooltipTriggerProps;
  54296. exports.useTransitionFallthrough = useTransitionFallthrough;
  54297. exports.useTransitionFallthroughEmits = useTransitionFallthroughEmits;
  54298. exports.useZIndex = useZIndex;
  54299. exports.vLoading = vLoading;
  54300. exports.vRepeatClick = vRepeatClick;
  54301. exports.valueEquals = valueEquals;
  54302. exports.version = version;
  54303. exports.virtualizedGridProps = virtualizedGridProps;
  54304. exports.virtualizedListProps = virtualizedListProps;
  54305. exports.virtualizedProps = virtualizedProps;
  54306. exports.virtualizedScrollbarProps = virtualizedScrollbarProps;
  54307. Object.defineProperty(exports, '__esModule', { value: true });
  54308. }));