index.full.js 2.0 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264
  1. /*! Element Plus v2.13.5 */
  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) {
  7. Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
  8. //#region \0rolldown/runtime.js
  9. var __create = Object.create;
  10. var __defProp = Object.defineProperty;
  11. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  12. var __getOwnPropNames = Object.getOwnPropertyNames;
  13. var __getProtoOf = Object.getPrototypeOf;
  14. var __hasOwnProp = Object.prototype.hasOwnProperty;
  15. var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
  16. var __copyProps = (to, from, except, desc) => {
  17. if (from && typeof from === "object" || typeof from === "function") {
  18. for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
  19. key = keys[i];
  20. if (!__hasOwnProp.call(to, key) && key !== except) {
  21. __defProp(to, key, {
  22. get: ((k) => from[k]).bind(null, key),
  23. enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
  24. });
  25. }
  26. }
  27. }
  28. return to;
  29. };
  30. var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
  31. value: mod,
  32. enumerable: true
  33. }) : target, mod));
  34. //#endregion
  35. //#region ../../packages/utils/dom/aria.ts
  36. 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])`;
  37. const isShadowRoot$1 = (e) => {
  38. if (typeof ShadowRoot === "undefined") return false;
  39. return e instanceof ShadowRoot;
  40. };
  41. const isHTMLElement$1 = (e) => {
  42. if (typeof Element === "undefined") return false;
  43. return e instanceof Element;
  44. };
  45. /**
  46. * Determine if the testing element is visible on screen no matter if its on the viewport or not
  47. */
  48. const isVisible = (element) => {
  49. return getComputedStyle(element).position === "fixed" ? false : element.offsetParent !== null;
  50. };
  51. const obtainAllFocusableElements$1 = (element) => {
  52. return Array.from(element.querySelectorAll(FOCUSABLE_ELEMENT_SELECTORS)).filter((item) => isFocusable(item) && isVisible(item));
  53. };
  54. /**
  55. * @desc Determine if target element is focusable
  56. * @param element {HTMLElement}
  57. * @returns {Boolean} true if it is focusable
  58. */
  59. const isFocusable = (element) => {
  60. if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null) return true;
  61. if (element.tabIndex < 0 || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true") return false;
  62. switch (element.nodeName) {
  63. case "A": return !!element.href && element.rel !== "ignore";
  64. case "INPUT": return !(element.type === "hidden" || element.type === "file");
  65. case "BUTTON":
  66. case "SELECT":
  67. case "TEXTAREA": return true;
  68. default: return false;
  69. }
  70. };
  71. /**
  72. * Trigger an event
  73. * mouseenter, mouseleave, mouseover, keyup, change, click, etc.
  74. * @param {HTMLElement} elm
  75. * @param {String} name
  76. * @param {*} opts
  77. */
  78. const triggerEvent = function(elm, name, ...opts) {
  79. let eventName;
  80. if (name.includes("mouse") || name.includes("click")) eventName = "MouseEvents";
  81. else if (name.includes("key")) eventName = "KeyboardEvent";
  82. else eventName = "HTMLEvents";
  83. const evt = document.createEvent(eventName);
  84. evt.initEvent(name, ...opts);
  85. elm.dispatchEvent(evt);
  86. return elm;
  87. };
  88. const isLeaf = (el) => !el.getAttribute("aria-owns");
  89. const getSibling = (el, distance, elClass) => {
  90. const { parentNode } = el;
  91. if (!parentNode) return null;
  92. const siblings = parentNode.querySelectorAll(elClass);
  93. return siblings[Array.prototype.indexOf.call(siblings, el) + distance] || null;
  94. };
  95. const focusElement = (el, options) => {
  96. if (!el || !el.focus) return;
  97. let cleanup = false;
  98. if (isHTMLElement$1(el) && !isFocusable(el) && !el.getAttribute("tabindex")) {
  99. el.setAttribute("tabindex", "-1");
  100. cleanup = true;
  101. }
  102. el.focus(options);
  103. if (isHTMLElement$1(el) && cleanup) el.removeAttribute("tabindex");
  104. };
  105. const focusNode = (el) => {
  106. if (!el) return;
  107. focusElement(el);
  108. !isLeaf(el) && el.click();
  109. };
  110. //#endregion
  111. //#region ../../packages/constants/aria.ts
  112. const EVENT_CODE = {
  113. tab: "Tab",
  114. enter: "Enter",
  115. space: "Space",
  116. left: "ArrowLeft",
  117. up: "ArrowUp",
  118. right: "ArrowRight",
  119. down: "ArrowDown",
  120. esc: "Escape",
  121. delete: "Delete",
  122. backspace: "Backspace",
  123. numpadEnter: "NumpadEnter",
  124. pageUp: "PageUp",
  125. pageDown: "PageDown",
  126. home: "Home",
  127. end: "End"
  128. };
  129. //#endregion
  130. //#region ../../packages/constants/date.ts
  131. const datePickTypes = [
  132. "year",
  133. "years",
  134. "month",
  135. "months",
  136. "date",
  137. "dates",
  138. "week",
  139. "datetime",
  140. "datetimerange",
  141. "daterange",
  142. "monthrange",
  143. "yearrange"
  144. ];
  145. const WEEK_DAYS = [
  146. "sun",
  147. "mon",
  148. "tue",
  149. "wed",
  150. "thu",
  151. "fri",
  152. "sat"
  153. ];
  154. //#endregion
  155. //#region ../../packages/constants/event.ts
  156. const UPDATE_MODEL_EVENT = "update:modelValue";
  157. const CHANGE_EVENT = "change";
  158. const INPUT_EVENT = "input";
  159. //#endregion
  160. //#region ../../packages/constants/key.ts
  161. const INSTALLED_KEY = Symbol("INSTALLED_KEY");
  162. //#endregion
  163. //#region ../../packages/constants/size.ts
  164. const componentSizes = [
  165. "",
  166. "default",
  167. "small",
  168. "large"
  169. ];
  170. const componentSizeMap = {
  171. large: 40,
  172. default: 32,
  173. small: 24
  174. };
  175. //#endregion
  176. //#region ../../packages/constants/column-alignment.ts
  177. const columnAlignment = [
  178. "left",
  179. "center",
  180. "right"
  181. ];
  182. //#endregion
  183. //#region ../../packages/constants/form.ts
  184. const MINIMUM_INPUT_WIDTH = 11;
  185. const BORDER_HORIZONTAL_WIDTH = 2;
  186. //#endregion
  187. //#region ../../node_modules/.pnpm/@vueuse+shared@12.0.0_typescript@5.5.4/node_modules/@vueuse/shared/index.mjs
  188. function computedEager(fn, options) {
  189. var _a;
  190. const result = (0, vue.shallowRef)();
  191. (0, vue.watchEffect)(() => {
  192. result.value = fn();
  193. }, {
  194. ...options,
  195. flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
  196. });
  197. return (0, vue.readonly)(result);
  198. }
  199. function tryOnScopeDispose(fn) {
  200. if ((0, vue.getCurrentScope)()) {
  201. (0, vue.onScopeDispose)(fn);
  202. return true;
  203. }
  204. return false;
  205. }
  206. function toValue$1(r) {
  207. return typeof r === "function" ? r() : (0, vue.unref)(r);
  208. }
  209. function toReactive(objectRef) {
  210. if (!(0, vue.isRef)(objectRef)) return (0, vue.reactive)(objectRef);
  211. return (0, vue.reactive)(new Proxy({}, {
  212. get(_, p, receiver) {
  213. return (0, vue.unref)(Reflect.get(objectRef.value, p, receiver));
  214. },
  215. set(_, p, value) {
  216. if ((0, vue.isRef)(objectRef.value[p]) && !(0, vue.isRef)(value)) objectRef.value[p].value = value;
  217. else objectRef.value[p] = value;
  218. return true;
  219. },
  220. deleteProperty(_, p) {
  221. return Reflect.deleteProperty(objectRef.value, p);
  222. },
  223. has(_, p) {
  224. return Reflect.has(objectRef.value, p);
  225. },
  226. ownKeys() {
  227. return Object.keys(objectRef.value);
  228. },
  229. getOwnPropertyDescriptor() {
  230. return {
  231. enumerable: true,
  232. configurable: true
  233. };
  234. }
  235. }));
  236. }
  237. function reactiveComputed(fn) {
  238. return toReactive((0, vue.computed)(fn));
  239. }
  240. const isClient = typeof window !== "undefined" && typeof document !== "undefined";
  241. const isWorker = typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
  242. const isDef = (val) => typeof val !== "undefined";
  243. const notNullish = (val) => val != null;
  244. const toString$1 = Object.prototype.toString;
  245. const isObject$2 = (val) => toString$1.call(val) === "[object Object]";
  246. const clamp$2 = (n, min, max) => Math.min(max, Math.max(min, n));
  247. const noop$1 = () => {};
  248. const isIOS = /* @__PURE__ */ getIsIOS();
  249. function getIsIOS() {
  250. var _a, _b;
  251. return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
  252. }
  253. function createFilterWrapper(filter, fn) {
  254. function wrapper(...args) {
  255. return new Promise((resolve, reject) => {
  256. Promise.resolve(filter(() => fn.apply(this, args), {
  257. fn,
  258. thisArg: this,
  259. args
  260. })).then(resolve).catch(reject);
  261. });
  262. }
  263. return wrapper;
  264. }
  265. function debounceFilter(ms, options = {}) {
  266. let timer;
  267. let maxTimer;
  268. let lastRejector = noop$1;
  269. const _clearTimeout = (timer2) => {
  270. clearTimeout(timer2);
  271. lastRejector();
  272. lastRejector = noop$1;
  273. };
  274. const filter = (invoke) => {
  275. const duration = toValue$1(ms);
  276. const maxDuration = toValue$1(options.maxWait);
  277. if (timer) _clearTimeout(timer);
  278. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  279. if (maxTimer) {
  280. _clearTimeout(maxTimer);
  281. maxTimer = null;
  282. }
  283. return Promise.resolve(invoke());
  284. }
  285. return new Promise((resolve, reject) => {
  286. lastRejector = options.rejectOnCancel ? reject : resolve;
  287. if (maxDuration && !maxTimer) maxTimer = setTimeout(() => {
  288. if (timer) _clearTimeout(timer);
  289. maxTimer = null;
  290. resolve(invoke());
  291. }, maxDuration);
  292. timer = setTimeout(() => {
  293. if (maxTimer) _clearTimeout(maxTimer);
  294. maxTimer = null;
  295. resolve(invoke());
  296. }, duration);
  297. });
  298. };
  299. return filter;
  300. }
  301. function throttleFilter(...args) {
  302. let lastExec = 0;
  303. let timer;
  304. let isLeading = true;
  305. let lastRejector = noop$1;
  306. let lastValue;
  307. let ms;
  308. let trailing;
  309. let leading;
  310. let rejectOnCancel;
  311. if (!(0, vue.isRef)(args[0]) && typeof args[0] === "object") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);
  312. else [ms, trailing = true, leading = true, rejectOnCancel = false] = args;
  313. const clear = () => {
  314. if (timer) {
  315. clearTimeout(timer);
  316. timer = void 0;
  317. lastRejector();
  318. lastRejector = noop$1;
  319. }
  320. };
  321. const filter = (_invoke) => {
  322. const duration = toValue$1(ms);
  323. const elapsed = Date.now() - lastExec;
  324. const invoke = () => {
  325. return lastValue = _invoke();
  326. };
  327. clear();
  328. if (duration <= 0) {
  329. lastExec = Date.now();
  330. return invoke();
  331. }
  332. if (elapsed > duration && (leading || !isLeading)) {
  333. lastExec = Date.now();
  334. invoke();
  335. } else if (trailing) lastValue = new Promise((resolve, reject) => {
  336. lastRejector = rejectOnCancel ? reject : resolve;
  337. timer = setTimeout(() => {
  338. lastExec = Date.now();
  339. isLeading = true;
  340. resolve(invoke());
  341. clear();
  342. }, Math.max(0, duration - elapsed));
  343. });
  344. if (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);
  345. isLeading = false;
  346. return lastValue;
  347. };
  348. return filter;
  349. }
  350. function cacheStringFunction$1(fn) {
  351. const cache = /* @__PURE__ */ Object.create(null);
  352. return (str) => {
  353. return cache[str] || (cache[str] = fn(str));
  354. };
  355. }
  356. const hyphenateRE$1 = /\B([A-Z])/g;
  357. const hyphenate$1 = cacheStringFunction$1((str) => str.replace(hyphenateRE$1, "-$1").toLowerCase());
  358. const camelizeRE$1 = /-(\w)/g;
  359. const camelize$1 = cacheStringFunction$1((str) => {
  360. return str.replace(camelizeRE$1, (_, c) => c ? c.toUpperCase() : "");
  361. });
  362. function getLifeCycleTarget(target) {
  363. return target || (0, vue.getCurrentInstance)();
  364. }
  365. function useDebounceFn(fn, ms = 200, options = {}) {
  366. return createFilterWrapper(debounceFilter(ms, options), fn);
  367. }
  368. function refDebounced(value, ms = 200, options = {}) {
  369. const debounced = (0, vue.ref)(value.value);
  370. const updater = useDebounceFn(() => {
  371. debounced.value = value.value;
  372. }, ms, options);
  373. (0, vue.watch)(value, () => updater());
  374. return debounced;
  375. }
  376. function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
  377. return createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);
  378. }
  379. function tryOnMounted(fn, sync = true, target) {
  380. if (getLifeCycleTarget()) (0, vue.onMounted)(fn, target);
  381. else if (sync) fn();
  382. else (0, vue.nextTick)(fn);
  383. }
  384. function useTimeoutFn(cb, interval, options = {}) {
  385. const { immediate = true } = options;
  386. const isPending = (0, vue.ref)(false);
  387. let timer = null;
  388. function clear() {
  389. if (timer) {
  390. clearTimeout(timer);
  391. timer = null;
  392. }
  393. }
  394. function stop() {
  395. isPending.value = false;
  396. clear();
  397. }
  398. function start(...args) {
  399. clear();
  400. isPending.value = true;
  401. timer = setTimeout(() => {
  402. isPending.value = false;
  403. timer = null;
  404. cb(...args);
  405. }, toValue$1(interval));
  406. }
  407. if (immediate) {
  408. isPending.value = true;
  409. if (isClient) start();
  410. }
  411. tryOnScopeDispose(stop);
  412. return {
  413. isPending: (0, vue.readonly)(isPending),
  414. start,
  415. stop
  416. };
  417. }
  418. //#endregion
  419. //#region ../../node_modules/.pnpm/@vueuse+core@12.0.0_typescript@5.5.4/node_modules/@vueuse/core/index.mjs
  420. const defaultWindow = isClient ? window : void 0;
  421. const defaultDocument = isClient ? window.document : void 0;
  422. const defaultNavigator = isClient ? window.navigator : void 0;
  423. const defaultLocation = isClient ? window.location : void 0;
  424. function unrefElement(elRef) {
  425. var _a;
  426. const plain = toValue$1(elRef);
  427. return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;
  428. }
  429. function useEventListener(...args) {
  430. let target;
  431. let events;
  432. let listeners;
  433. let options;
  434. if (typeof args[0] === "string" || Array.isArray(args[0])) {
  435. [events, listeners, options] = args;
  436. target = defaultWindow;
  437. } else [target, events, listeners, options] = args;
  438. if (!target) return noop$1;
  439. if (!Array.isArray(events)) events = [events];
  440. if (!Array.isArray(listeners)) listeners = [listeners];
  441. const cleanups = [];
  442. const cleanup = () => {
  443. cleanups.forEach((fn) => fn());
  444. cleanups.length = 0;
  445. };
  446. const register = (el, event, listener, options2) => {
  447. el.addEventListener(event, listener, options2);
  448. return () => el.removeEventListener(event, listener, options2);
  449. };
  450. const stopWatch = (0, vue.watch)(() => [unrefElement(target), toValue$1(options)], ([el, options2]) => {
  451. cleanup();
  452. if (!el) return;
  453. const optionsClone = isObject$2(options2) ? { ...options2 } : options2;
  454. cleanups.push(...events.flatMap((event) => {
  455. return listeners.map((listener) => register(el, event, listener, optionsClone));
  456. }));
  457. }, {
  458. immediate: true,
  459. flush: "post"
  460. });
  461. const stop = () => {
  462. stopWatch();
  463. cleanup();
  464. };
  465. tryOnScopeDispose(stop);
  466. return stop;
  467. }
  468. let _iOSWorkaround = false;
  469. function onClickOutside(target, handler, options = {}) {
  470. const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;
  471. if (!window) return noop$1;
  472. if (isIOS && !_iOSWorkaround) {
  473. _iOSWorkaround = true;
  474. Array.from(window.document.body.children).forEach((el) => el.addEventListener("click", noop$1));
  475. window.document.documentElement.addEventListener("click", noop$1);
  476. }
  477. let shouldListen = true;
  478. const shouldIgnore = (event) => {
  479. return toValue$1(ignore).some((target2) => {
  480. if (typeof target2 === "string") return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));
  481. else {
  482. const el = unrefElement(target2);
  483. return el && (event.target === el || event.composedPath().includes(el));
  484. }
  485. });
  486. };
  487. function hasMultipleRoots(target2) {
  488. const vm = toValue$1(target2);
  489. return vm && vm.$.subTree.shapeFlag === 16;
  490. }
  491. function checkMultipleRoots(target2, event) {
  492. const vm = toValue$1(target2);
  493. const children = vm.$.subTree && vm.$.subTree.children;
  494. if (children == null || !Array.isArray(children)) return false;
  495. return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
  496. }
  497. const listener = (event) => {
  498. const el = unrefElement(target);
  499. if (event.target == null) return;
  500. if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
  501. if (!el || el === event.target || event.composedPath().includes(el)) return;
  502. if (event.detail === 0) shouldListen = !shouldIgnore(event);
  503. if (!shouldListen) {
  504. shouldListen = true;
  505. return;
  506. }
  507. handler(event);
  508. };
  509. let isProcessingClick = false;
  510. const cleanup = [
  511. useEventListener(window, "click", (event) => {
  512. if (!isProcessingClick) {
  513. isProcessingClick = true;
  514. setTimeout(() => {
  515. isProcessingClick = false;
  516. }, 0);
  517. listener(event);
  518. }
  519. }, {
  520. passive: true,
  521. capture
  522. }),
  523. useEventListener(window, "pointerdown", (e) => {
  524. const el = unrefElement(target);
  525. shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
  526. }, { passive: true }),
  527. detectIframe && useEventListener(window, "blur", (event) => {
  528. setTimeout(() => {
  529. var _a;
  530. const el = unrefElement(target);
  531. if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(window.document.activeElement))) handler(event);
  532. }, 0);
  533. })
  534. ].filter(Boolean);
  535. const stop = () => cleanup.forEach((fn) => fn());
  536. return stop;
  537. }
  538. function useMounted() {
  539. const isMounted = (0, vue.ref)(false);
  540. const instance = (0, vue.getCurrentInstance)();
  541. if (instance) (0, vue.onMounted)(() => {
  542. isMounted.value = true;
  543. }, instance);
  544. return isMounted;
  545. }
  546. function useSupported(callback) {
  547. const isMounted = useMounted();
  548. return (0, vue.computed)(() => {
  549. isMounted.value;
  550. return Boolean(callback());
  551. });
  552. }
  553. function useMutationObserver(target, callback, options = {}) {
  554. const { window = defaultWindow, ...mutationOptions } = options;
  555. let observer;
  556. const isSupported = useSupported(() => window && "MutationObserver" in window);
  557. const cleanup = () => {
  558. if (observer) {
  559. observer.disconnect();
  560. observer = void 0;
  561. }
  562. };
  563. const targets = (0, vue.computed)(() => {
  564. const value = toValue$1(target);
  565. const items = (Array.isArray(value) ? value : [value]).map(unrefElement).filter(notNullish);
  566. return new Set(items);
  567. });
  568. const stopWatch = (0, vue.watch)(() => targets.value, (targets2) => {
  569. cleanup();
  570. if (isSupported.value && targets2.size) {
  571. observer = new MutationObserver(callback);
  572. targets2.forEach((el) => observer.observe(el, mutationOptions));
  573. }
  574. }, {
  575. immediate: true,
  576. flush: "post"
  577. });
  578. const takeRecords = () => {
  579. return observer == null ? void 0 : observer.takeRecords();
  580. };
  581. const stop = () => {
  582. stopWatch();
  583. cleanup();
  584. };
  585. tryOnScopeDispose(stop);
  586. return {
  587. isSupported,
  588. stop,
  589. takeRecords
  590. };
  591. }
  592. function useActiveElement(options = {}) {
  593. var _a;
  594. const { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;
  595. const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;
  596. const getDeepActiveElement = () => {
  597. var _a2;
  598. let element = document == null ? void 0 : document.activeElement;
  599. if (deep) while (element == null ? void 0 : element.shadowRoot) element = (_a2 = element == null ? void 0 : element.shadowRoot) == null ? void 0 : _a2.activeElement;
  600. return element;
  601. };
  602. const activeElement = (0, vue.ref)();
  603. const trigger = () => {
  604. activeElement.value = getDeepActiveElement();
  605. };
  606. if (window) {
  607. useEventListener(window, "blur", (event) => {
  608. if (event.relatedTarget !== null) return;
  609. trigger();
  610. }, true);
  611. useEventListener(window, "focus", trigger, true);
  612. }
  613. if (triggerOnRemoval) useMutationObserver(document, (mutations) => {
  614. mutations.filter((m) => m.removedNodes.length).map((n) => Array.from(n.removedNodes)).flat().forEach((node) => {
  615. if (node === activeElement.value) trigger();
  616. });
  617. }, {
  618. childList: true,
  619. subtree: true
  620. });
  621. trigger();
  622. return activeElement;
  623. }
  624. function useMediaQuery(query, options = {}) {
  625. const { window = defaultWindow } = options;
  626. const isSupported = useSupported(() => window && "matchMedia" in window && typeof window.matchMedia === "function");
  627. let mediaQuery;
  628. const matches = (0, vue.ref)(false);
  629. const handler = (event) => {
  630. matches.value = event.matches;
  631. };
  632. const cleanup = () => {
  633. if (!mediaQuery) return;
  634. if ("removeEventListener" in mediaQuery) mediaQuery.removeEventListener("change", handler);
  635. else mediaQuery.removeListener(handler);
  636. };
  637. const stopWatch = (0, vue.watchEffect)(() => {
  638. if (!isSupported.value) return;
  639. cleanup();
  640. mediaQuery = window.matchMedia(toValue$1(query));
  641. if ("addEventListener" in mediaQuery) mediaQuery.addEventListener("change", handler);
  642. else mediaQuery.addListener(handler);
  643. matches.value = mediaQuery.matches;
  644. });
  645. tryOnScopeDispose(() => {
  646. stopWatch();
  647. cleanup();
  648. mediaQuery = void 0;
  649. });
  650. return matches;
  651. }
  652. function cloneFnJSON(source) {
  653. return JSON.parse(JSON.stringify(source));
  654. }
  655. function useCssVar(prop, target, options = {}) {
  656. const { window = defaultWindow, initialValue, observe = false } = options;
  657. const variable = (0, vue.ref)(initialValue);
  658. const elRef = (0, vue.computed)(() => {
  659. var _a;
  660. return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);
  661. });
  662. function updateCssVar() {
  663. var _a;
  664. const key = toValue$1(prop);
  665. const el = toValue$1(elRef);
  666. if (el && window && key) variable.value = ((_a = window.getComputedStyle(el).getPropertyValue(key)) == null ? void 0 : _a.trim()) || initialValue;
  667. }
  668. if (observe) useMutationObserver(elRef, updateCssVar, {
  669. attributeFilter: ["style", "class"],
  670. window
  671. });
  672. (0, vue.watch)([elRef, () => toValue$1(prop)], (_, old) => {
  673. if (old[0] && old[1]) old[0].style.removeProperty(old[1]);
  674. updateCssVar();
  675. }, { immediate: true });
  676. (0, vue.watch)(variable, (val) => {
  677. var _a;
  678. const raw_prop = toValue$1(prop);
  679. if (((_a = elRef.value) == null ? void 0 : _a.style) && raw_prop) if (val == null) elRef.value.style.removeProperty(raw_prop);
  680. else elRef.value.style.setProperty(raw_prop, val);
  681. });
  682. return variable;
  683. }
  684. function useDocumentVisibility(options = {}) {
  685. const { document = defaultDocument } = options;
  686. if (!document) return (0, vue.ref)("visible");
  687. const visibility = (0, vue.ref)(document.visibilityState);
  688. useEventListener(document, "visibilitychange", () => {
  689. visibility.value = document.visibilityState;
  690. });
  691. return visibility;
  692. }
  693. function useResizeObserver(target, callback, options = {}) {
  694. const { window = defaultWindow, ...observerOptions } = options;
  695. let observer;
  696. const isSupported = useSupported(() => window && "ResizeObserver" in window);
  697. const cleanup = () => {
  698. if (observer) {
  699. observer.disconnect();
  700. observer = void 0;
  701. }
  702. };
  703. const stopWatch = (0, vue.watch)((0, vue.computed)(() => {
  704. const _targets = toValue$1(target);
  705. return Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];
  706. }), (els) => {
  707. cleanup();
  708. if (isSupported.value && window) {
  709. observer = new ResizeObserver(callback);
  710. for (const _el of els) if (_el) observer.observe(_el, observerOptions);
  711. }
  712. }, {
  713. immediate: true,
  714. flush: "post"
  715. });
  716. const stop = () => {
  717. cleanup();
  718. stopWatch();
  719. };
  720. tryOnScopeDispose(stop);
  721. return {
  722. isSupported,
  723. stop
  724. };
  725. }
  726. function useElementBounding(target, options = {}) {
  727. const { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = "sync" } = options;
  728. const height = (0, vue.ref)(0);
  729. const bottom = (0, vue.ref)(0);
  730. const left = (0, vue.ref)(0);
  731. const right = (0, vue.ref)(0);
  732. const top = (0, vue.ref)(0);
  733. const width = (0, vue.ref)(0);
  734. const x = (0, vue.ref)(0);
  735. const y = (0, vue.ref)(0);
  736. function recalculate() {
  737. const el = unrefElement(target);
  738. if (!el) {
  739. if (reset) {
  740. height.value = 0;
  741. bottom.value = 0;
  742. left.value = 0;
  743. right.value = 0;
  744. top.value = 0;
  745. width.value = 0;
  746. x.value = 0;
  747. y.value = 0;
  748. }
  749. return;
  750. }
  751. const rect = el.getBoundingClientRect();
  752. height.value = rect.height;
  753. bottom.value = rect.bottom;
  754. left.value = rect.left;
  755. right.value = rect.right;
  756. top.value = rect.top;
  757. width.value = rect.width;
  758. x.value = rect.x;
  759. y.value = rect.y;
  760. }
  761. function update() {
  762. if (updateTiming === "sync") recalculate();
  763. else if (updateTiming === "next-frame") requestAnimationFrame(() => recalculate());
  764. }
  765. useResizeObserver(target, update);
  766. (0, vue.watch)(() => unrefElement(target), (ele) => !ele && update());
  767. useMutationObserver(target, update, { attributeFilter: ["style", "class"] });
  768. if (windowScroll) useEventListener("scroll", update, {
  769. capture: true,
  770. passive: true
  771. });
  772. if (windowResize) useEventListener("resize", update, { passive: true });
  773. tryOnMounted(() => {
  774. if (immediate) update();
  775. });
  776. return {
  777. height,
  778. bottom,
  779. left,
  780. right,
  781. top,
  782. width,
  783. x,
  784. y,
  785. update
  786. };
  787. }
  788. function useElementSize(target, initialSize = {
  789. width: 0,
  790. height: 0
  791. }, options = {}) {
  792. const { window = defaultWindow, box = "content-box" } = options;
  793. const isSVG = (0, vue.computed)(() => {
  794. var _a, _b;
  795. return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes("svg");
  796. });
  797. const width = (0, vue.ref)(initialSize.width);
  798. const height = (0, vue.ref)(initialSize.height);
  799. const { stop: stop1 } = useResizeObserver(target, ([entry]) => {
  800. const boxSize = box === "border-box" ? entry.borderBoxSize : box === "content-box" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;
  801. if (window && isSVG.value) {
  802. const $elem = unrefElement(target);
  803. if ($elem) {
  804. const rect = $elem.getBoundingClientRect();
  805. width.value = rect.width;
  806. height.value = rect.height;
  807. }
  808. } else if (boxSize) {
  809. const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];
  810. width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);
  811. height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);
  812. } else {
  813. width.value = entry.contentRect.width;
  814. height.value = entry.contentRect.height;
  815. }
  816. }, options);
  817. tryOnMounted(() => {
  818. const ele = unrefElement(target);
  819. if (ele) {
  820. width.value = "offsetWidth" in ele ? ele.offsetWidth : initialSize.width;
  821. height.value = "offsetHeight" in ele ? ele.offsetHeight : initialSize.height;
  822. }
  823. });
  824. const stop2 = (0, vue.watch)(() => unrefElement(target), (ele) => {
  825. width.value = ele ? initialSize.width : 0;
  826. height.value = ele ? initialSize.height : 0;
  827. });
  828. function stop() {
  829. stop1();
  830. stop2();
  831. }
  832. return {
  833. width,
  834. height,
  835. stop
  836. };
  837. }
  838. function useIntersectionObserver(target, callback, options = {}) {
  839. const { root, rootMargin = "0px", threshold = 0, window = defaultWindow, immediate = true } = options;
  840. const isSupported = useSupported(() => window && "IntersectionObserver" in window);
  841. const targets = (0, vue.computed)(() => {
  842. const _target = toValue$1(target);
  843. return (Array.isArray(_target) ? _target : [_target]).map(unrefElement).filter(notNullish);
  844. });
  845. let cleanup = noop$1;
  846. const isActive = (0, vue.ref)(immediate);
  847. const stopWatch = isSupported.value ? (0, vue.watch)(() => [
  848. targets.value,
  849. unrefElement(root),
  850. isActive.value
  851. ], ([targets2, root2]) => {
  852. cleanup();
  853. if (!isActive.value) return;
  854. if (!targets2.length) return;
  855. const observer = new IntersectionObserver(callback, {
  856. root: unrefElement(root2),
  857. rootMargin,
  858. threshold
  859. });
  860. targets2.forEach((el) => el && observer.observe(el));
  861. cleanup = () => {
  862. observer.disconnect();
  863. cleanup = noop$1;
  864. };
  865. }, {
  866. immediate,
  867. flush: "post"
  868. }) : noop$1;
  869. const stop = () => {
  870. cleanup();
  871. stopWatch();
  872. isActive.value = false;
  873. };
  874. tryOnScopeDispose(stop);
  875. return {
  876. isSupported,
  877. isActive,
  878. pause() {
  879. cleanup();
  880. isActive.value = false;
  881. },
  882. resume() {
  883. isActive.value = true;
  884. },
  885. stop
  886. };
  887. }
  888. const DEFAULT_UNITS = [
  889. {
  890. max: 6e4,
  891. value: 1e3,
  892. name: "second"
  893. },
  894. {
  895. max: 276e4,
  896. value: 6e4,
  897. name: "minute"
  898. },
  899. {
  900. max: 72e6,
  901. value: 36e5,
  902. name: "hour"
  903. },
  904. {
  905. max: 5184e5,
  906. value: 864e5,
  907. name: "day"
  908. },
  909. {
  910. max: 24192e5,
  911. value: 6048e5,
  912. name: "week"
  913. },
  914. {
  915. max: 28512e6,
  916. value: 2592e6,
  917. name: "month"
  918. },
  919. {
  920. max: Number.POSITIVE_INFINITY,
  921. value: 31536e6,
  922. name: "year"
  923. }
  924. ];
  925. function useVModel(props, key, emit, options = {}) {
  926. var _a, _b, _c;
  927. const { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;
  928. const vm = (0, vue.getCurrentInstance)();
  929. 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));
  930. let event = eventName;
  931. if (!key) key = "modelValue";
  932. event = event || `update:${key.toString()}`;
  933. const cloneFn = (val) => !clone ? val : typeof clone === "function" ? clone(val) : cloneFnJSON(val);
  934. const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;
  935. const triggerEmit = (value) => {
  936. if (shouldEmit) {
  937. if (shouldEmit(value)) _emit(event, value);
  938. } else _emit(event, value);
  939. };
  940. if (passive) {
  941. const proxy = (0, vue.ref)(getValue());
  942. let isUpdating = false;
  943. (0, vue.watch)(() => props[key], (v) => {
  944. if (!isUpdating) {
  945. isUpdating = true;
  946. proxy.value = cloneFn(v);
  947. (0, vue.nextTick)(() => isUpdating = false);
  948. }
  949. });
  950. (0, vue.watch)(proxy, (v) => {
  951. if (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);
  952. }, { deep });
  953. return proxy;
  954. } else return (0, vue.computed)({
  955. get() {
  956. return getValue();
  957. },
  958. set(value) {
  959. triggerEmit(value);
  960. }
  961. });
  962. }
  963. function useWindowFocus(options = {}) {
  964. const { window = defaultWindow } = options;
  965. if (!window) return (0, vue.ref)(false);
  966. const focused = (0, vue.ref)(window.document.hasFocus());
  967. useEventListener(window, "blur", () => {
  968. focused.value = false;
  969. });
  970. useEventListener(window, "focus", () => {
  971. focused.value = true;
  972. });
  973. return focused;
  974. }
  975. function useWindowSize(options = {}) {
  976. const { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = "inner" } = options;
  977. const width = (0, vue.ref)(initialWidth);
  978. const height = (0, vue.ref)(initialHeight);
  979. const update = () => {
  980. if (window) if (type === "outer") {
  981. width.value = window.outerWidth;
  982. height.value = window.outerHeight;
  983. } else if (includeScrollbar) {
  984. width.value = window.innerWidth;
  985. height.value = window.innerHeight;
  986. } else {
  987. width.value = window.document.documentElement.clientWidth;
  988. height.value = window.document.documentElement.clientHeight;
  989. }
  990. };
  991. update();
  992. tryOnMounted(update);
  993. useEventListener("resize", update, { passive: true });
  994. if (listenOrientation) (0, vue.watch)(useMediaQuery("(orientation: portrait)"), () => update());
  995. return {
  996. width,
  997. height
  998. };
  999. }
  1000. //#endregion
  1001. //#region ../../packages/utils/browser.ts
  1002. const isFirefox = () => isClient && /firefox/i.test(window.navigator.userAgent);
  1003. const isAndroid = () => isClient && /android/i.test(window.navigator.userAgent);
  1004. //#endregion
  1005. //#region ../../packages/utils/dom/event.ts
  1006. const composeEventHandlers = (theirsHandler, oursHandler, { checkForDefaultPrevented = true } = {}) => {
  1007. const handleEvent = (event) => {
  1008. const shouldPrevent = theirsHandler?.(event);
  1009. if (checkForDefaultPrevented === false || !shouldPrevent) return oursHandler?.(event);
  1010. };
  1011. return handleEvent;
  1012. };
  1013. const whenMouse = (handler) => {
  1014. return (e) => e.pointerType === "mouse" ? handler(e) : void 0;
  1015. };
  1016. const getEventCode = (event) => {
  1017. if (event.code && event.code !== "Unidentified") return event.code;
  1018. const key = getEventKey(event);
  1019. if (key) {
  1020. if (Object.values(EVENT_CODE).includes(key)) return key;
  1021. switch (key) {
  1022. case " ": return EVENT_CODE.space;
  1023. default: return "";
  1024. }
  1025. }
  1026. return "";
  1027. };
  1028. const getEventKey = (event) => {
  1029. let key = event.key && event.key !== "Unidentified" ? event.key : "";
  1030. if (!key && event.type === "keyup" && isAndroid()) {
  1031. const target = event.target;
  1032. key = target.value.charAt(target.selectionStart - 1);
  1033. }
  1034. return key;
  1035. };
  1036. //#endregion
  1037. //#region ../../packages/utils/dom/position.ts
  1038. const getOffsetTop = (el) => {
  1039. let offset = 0;
  1040. let parent = el;
  1041. while (parent) {
  1042. offset += parent.offsetTop;
  1043. parent = parent.offsetParent;
  1044. }
  1045. return offset;
  1046. };
  1047. const getOffsetTopDistance = (el, containerEl) => {
  1048. return Math.abs(getOffsetTop(el) - getOffsetTop(containerEl));
  1049. };
  1050. const getClientXY = (event) => {
  1051. let clientX;
  1052. let clientY;
  1053. if (event.type === "touchend") {
  1054. clientY = event.changedTouches[0].clientY;
  1055. clientX = event.changedTouches[0].clientX;
  1056. } else if (event.type.startsWith("touch")) {
  1057. clientY = event.touches[0].clientY;
  1058. clientX = event.touches[0].clientX;
  1059. } else {
  1060. clientY = event.clientY;
  1061. clientX = event.clientX;
  1062. }
  1063. return {
  1064. clientX,
  1065. clientY
  1066. };
  1067. };
  1068. //#endregion
  1069. //#region ../../packages/utils/easings.ts
  1070. function easeInOutCubic(t, b, c, d) {
  1071. const cc = c - b;
  1072. t /= d / 2;
  1073. if (t < 1) return cc / 2 * t * t * t + b;
  1074. return cc / 2 * ((t -= 2) * t * t + 2) + b;
  1075. }
  1076. //#endregion
  1077. //#region ../../node_modules/.pnpm/@vue+shared@3.5.25/node_modules/@vue/shared/dist/shared.esm-bundler.js
  1078. /**
  1079. * @vue/shared v3.5.25
  1080. * (c) 2018-present Yuxi (Evan) You and Vue contributors
  1081. * @license MIT
  1082. **/
  1083. /* @__NO_SIDE_EFFECTS__ */
  1084. function makeMap(str) {
  1085. const map = /* @__PURE__ */ Object.create(null);
  1086. for (const key of str.split(",")) map[key] = 1;
  1087. return (val) => val in map;
  1088. }
  1089. const NOOP = () => {};
  1090. const hasOwnProperty$14 = Object.prototype.hasOwnProperty;
  1091. const hasOwn = (val, key) => hasOwnProperty$14.call(val, key);
  1092. const isArray$1 = Array.isArray;
  1093. const isDate = (val) => toTypeString(val) === "[object Date]";
  1094. const isFunction$1 = (val) => typeof val === "function";
  1095. const isString = (val) => typeof val === "string";
  1096. const isObject$1 = (val) => val !== null && typeof val === "object";
  1097. const isPromise = (val) => {
  1098. return (isObject$1(val) || isFunction$1(val)) && isFunction$1(val.then) && isFunction$1(val.catch);
  1099. };
  1100. const objectToString$1 = Object.prototype.toString;
  1101. const toTypeString = (value) => objectToString$1.call(value);
  1102. const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
  1103. const cacheStringFunction = (fn) => {
  1104. const cache = /* @__PURE__ */ Object.create(null);
  1105. return ((str) => {
  1106. return cache[str] || (cache[str] = fn(str));
  1107. });
  1108. };
  1109. const camelizeRE = /-\w/g;
  1110. const camelize = cacheStringFunction((str) => {
  1111. return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
  1112. });
  1113. const hyphenateRE = /\B([A-Z])/g;
  1114. const hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase());
  1115. const capitalize$1 = cacheStringFunction((str) => {
  1116. return str.charAt(0).toUpperCase() + str.slice(1);
  1117. });
  1118. const toHandlerKey = cacheStringFunction((str) => {
  1119. return str ? `on${capitalize$1(str)}` : ``;
  1120. });
  1121. const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
  1122. const isBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);
  1123. //#endregion
  1124. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_freeGlobal.js
  1125. /** Detect free variable `global` from Node.js. */
  1126. var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
  1127. //#endregion
  1128. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_root.js
  1129. /** Detect free variable `self`. */
  1130. var freeSelf = typeof self == "object" && self && self.Object === Object && self;
  1131. /** Used as a reference to the global object. */
  1132. var root = freeGlobal || freeSelf || Function("return this")();
  1133. //#endregion
  1134. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Symbol.js
  1135. /** Built-in value references. */
  1136. var Symbol$1 = root.Symbol;
  1137. //#endregion
  1138. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getRawTag.js
  1139. /** Used for built-in method references. */
  1140. var objectProto$4 = Object.prototype;
  1141. /** Used to check objects for own properties. */
  1142. var hasOwnProperty$13 = objectProto$4.hasOwnProperty;
  1143. /**
  1144. * Used to resolve the
  1145. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1146. * of values.
  1147. */
  1148. var nativeObjectToString$1 = objectProto$4.toString;
  1149. /** Built-in value references. */
  1150. var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : void 0;
  1151. /**
  1152. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  1153. *
  1154. * @private
  1155. * @param {*} value The value to query.
  1156. * @returns {string} Returns the raw `toStringTag`.
  1157. */
  1158. function getRawTag(value) {
  1159. var isOwn = hasOwnProperty$13.call(value, symToStringTag$1), tag = value[symToStringTag$1];
  1160. try {
  1161. value[symToStringTag$1] = void 0;
  1162. var unmasked = true;
  1163. } catch (e) {}
  1164. var result = nativeObjectToString$1.call(value);
  1165. if (unmasked) if (isOwn) value[symToStringTag$1] = tag;
  1166. else delete value[symToStringTag$1];
  1167. return result;
  1168. }
  1169. //#endregion
  1170. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_objectToString.js
  1171. /**
  1172. * Used to resolve the
  1173. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1174. * of values.
  1175. */
  1176. var nativeObjectToString = Object.prototype.toString;
  1177. /**
  1178. * Converts `value` to a string using `Object.prototype.toString`.
  1179. *
  1180. * @private
  1181. * @param {*} value The value to convert.
  1182. * @returns {string} Returns the converted string.
  1183. */
  1184. function objectToString(value) {
  1185. return nativeObjectToString.call(value);
  1186. }
  1187. //#endregion
  1188. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetTag.js
  1189. /** `Object#toString` result references. */
  1190. var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
  1191. /** Built-in value references. */
  1192. var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
  1193. /**
  1194. * The base implementation of `getTag` without fallbacks for buggy environments.
  1195. *
  1196. * @private
  1197. * @param {*} value The value to query.
  1198. * @returns {string} Returns the `toStringTag`.
  1199. */
  1200. function baseGetTag(value) {
  1201. if (value == null) return value === void 0 ? undefinedTag : nullTag;
  1202. return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
  1203. }
  1204. //#endregion
  1205. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObjectLike.js
  1206. /**
  1207. * Checks if `value` is object-like. A value is object-like if it's not `null`
  1208. * and has a `typeof` result of "object".
  1209. *
  1210. * @static
  1211. * @memberOf _
  1212. * @since 4.0.0
  1213. * @category Lang
  1214. * @param {*} value The value to check.
  1215. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  1216. * @example
  1217. *
  1218. * _.isObjectLike({});
  1219. * // => true
  1220. *
  1221. * _.isObjectLike([1, 2, 3]);
  1222. * // => true
  1223. *
  1224. * _.isObjectLike(_.noop);
  1225. * // => false
  1226. *
  1227. * _.isObjectLike(null);
  1228. * // => false
  1229. */
  1230. function isObjectLike(value) {
  1231. return value != null && typeof value == "object";
  1232. }
  1233. //#endregion
  1234. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isSymbol.js
  1235. /** `Object#toString` result references. */
  1236. var symbolTag$3 = "[object Symbol]";
  1237. /**
  1238. * Checks if `value` is classified as a `Symbol` primitive or object.
  1239. *
  1240. * @static
  1241. * @memberOf _
  1242. * @since 4.0.0
  1243. * @category Lang
  1244. * @param {*} value The value to check.
  1245. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  1246. * @example
  1247. *
  1248. * _.isSymbol(Symbol.iterator);
  1249. * // => true
  1250. *
  1251. * _.isSymbol('abc');
  1252. * // => false
  1253. */
  1254. function isSymbol(value) {
  1255. return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag$3;
  1256. }
  1257. //#endregion
  1258. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayMap.js
  1259. /**
  1260. * A specialized version of `_.map` for arrays without support for iteratee
  1261. * shorthands.
  1262. *
  1263. * @private
  1264. * @param {Array} [array] The array to iterate over.
  1265. * @param {Function} iteratee The function invoked per iteration.
  1266. * @returns {Array} Returns the new mapped array.
  1267. */
  1268. function arrayMap(array, iteratee) {
  1269. var index = -1, length = array == null ? 0 : array.length, result = Array(length);
  1270. while (++index < length) result[index] = iteratee(array[index], index, array);
  1271. return result;
  1272. }
  1273. //#endregion
  1274. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArray.js
  1275. /**
  1276. * Checks if `value` is classified as an `Array` object.
  1277. *
  1278. * @static
  1279. * @memberOf _
  1280. * @since 0.1.0
  1281. * @category Lang
  1282. * @param {*} value The value to check.
  1283. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  1284. * @example
  1285. *
  1286. * _.isArray([1, 2, 3]);
  1287. * // => true
  1288. *
  1289. * _.isArray(document.body.children);
  1290. * // => false
  1291. *
  1292. * _.isArray('abc');
  1293. * // => false
  1294. *
  1295. * _.isArray(_.noop);
  1296. * // => false
  1297. */
  1298. var isArray = Array.isArray;
  1299. //#endregion
  1300. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseToString.js
  1301. /** Used as references for various `Number` constants. */
  1302. var INFINITY$3 = Infinity;
  1303. /** Used to convert symbols to primitives and strings. */
  1304. var symbolProto$2 = Symbol$1 ? Symbol$1.prototype : void 0, symbolToString = symbolProto$2 ? symbolProto$2.toString : void 0;
  1305. /**
  1306. * The base implementation of `_.toString` which doesn't convert nullish
  1307. * values to empty strings.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to process.
  1311. * @returns {string} Returns the string.
  1312. */
  1313. function baseToString(value) {
  1314. if (typeof value == "string") return value;
  1315. if (isArray(value)) return arrayMap(value, baseToString) + "";
  1316. if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
  1317. var result = value + "";
  1318. return result == "0" && 1 / value == -INFINITY$3 ? "-0" : result;
  1319. }
  1320. //#endregion
  1321. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_trimmedEndIndex.js
  1322. /** Used to match a single whitespace character. */
  1323. var reWhitespace = /\s/;
  1324. /**
  1325. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  1326. * character of `string`.
  1327. *
  1328. * @private
  1329. * @param {string} string The string to inspect.
  1330. * @returns {number} Returns the index of the last non-whitespace character.
  1331. */
  1332. function trimmedEndIndex(string) {
  1333. var index = string.length;
  1334. while (index-- && reWhitespace.test(string.charAt(index)));
  1335. return index;
  1336. }
  1337. //#endregion
  1338. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTrim.js
  1339. /** Used to match leading whitespace. */
  1340. var reTrimStart = /^\s+/;
  1341. /**
  1342. * The base implementation of `_.trim`.
  1343. *
  1344. * @private
  1345. * @param {string} string The string to trim.
  1346. * @returns {string} Returns the trimmed string.
  1347. */
  1348. function baseTrim(string) {
  1349. return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
  1350. }
  1351. //#endregion
  1352. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isObject.js
  1353. /**
  1354. * Checks if `value` is the
  1355. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1356. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1357. *
  1358. * @static
  1359. * @memberOf _
  1360. * @since 0.1.0
  1361. * @category Lang
  1362. * @param {*} value The value to check.
  1363. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1364. * @example
  1365. *
  1366. * _.isObject({});
  1367. * // => true
  1368. *
  1369. * _.isObject([1, 2, 3]);
  1370. * // => true
  1371. *
  1372. * _.isObject(_.noop);
  1373. * // => true
  1374. *
  1375. * _.isObject(null);
  1376. * // => false
  1377. */
  1378. function isObject(value) {
  1379. var type = typeof value;
  1380. return value != null && (type == "object" || type == "function");
  1381. }
  1382. //#endregion
  1383. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toNumber.js
  1384. /** Used as references for various `Number` constants. */
  1385. var NAN = NaN;
  1386. /** Used to detect bad signed hexadecimal string values. */
  1387. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1388. /** Used to detect binary string values. */
  1389. var reIsBinary = /^0b[01]+$/i;
  1390. /** Used to detect octal string values. */
  1391. var reIsOctal = /^0o[0-7]+$/i;
  1392. /** Built-in method references without a dependency on `root`. */
  1393. var freeParseInt = parseInt;
  1394. /**
  1395. * Converts `value` to a number.
  1396. *
  1397. * @static
  1398. * @memberOf _
  1399. * @since 4.0.0
  1400. * @category Lang
  1401. * @param {*} value The value to process.
  1402. * @returns {number} Returns the number.
  1403. * @example
  1404. *
  1405. * _.toNumber(3.2);
  1406. * // => 3.2
  1407. *
  1408. * _.toNumber(Number.MIN_VALUE);
  1409. * // => 5e-324
  1410. *
  1411. * _.toNumber(Infinity);
  1412. * // => Infinity
  1413. *
  1414. * _.toNumber('3.2');
  1415. * // => 3.2
  1416. */
  1417. function toNumber(value) {
  1418. if (typeof value == "number") return value;
  1419. if (isSymbol(value)) return NAN;
  1420. if (isObject(value)) {
  1421. var other = typeof value.valueOf == "function" ? value.valueOf() : value;
  1422. value = isObject(other) ? other + "" : other;
  1423. }
  1424. if (typeof value != "string") return value === 0 ? value : +value;
  1425. value = baseTrim(value);
  1426. var isBinary = reIsBinary.test(value);
  1427. return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
  1428. }
  1429. //#endregion
  1430. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toFinite.js
  1431. /** Used as references for various `Number` constants. */
  1432. var INFINITY$2 = Infinity, MAX_INTEGER = 17976931348623157e292;
  1433. /**
  1434. * Converts `value` to a finite number.
  1435. *
  1436. * @static
  1437. * @memberOf _
  1438. * @since 4.12.0
  1439. * @category Lang
  1440. * @param {*} value The value to convert.
  1441. * @returns {number} Returns the converted number.
  1442. * @example
  1443. *
  1444. * _.toFinite(3.2);
  1445. * // => 3.2
  1446. *
  1447. * _.toFinite(Number.MIN_VALUE);
  1448. * // => 5e-324
  1449. *
  1450. * _.toFinite(Infinity);
  1451. * // => 1.7976931348623157e+308
  1452. *
  1453. * _.toFinite('3.2');
  1454. * // => 3.2
  1455. */
  1456. function toFinite(value) {
  1457. if (!value) return value === 0 ? value : 0;
  1458. value = toNumber(value);
  1459. if (value === INFINITY$2 || value === -INFINITY$2) return (value < 0 ? -1 : 1) * MAX_INTEGER;
  1460. return value === value ? value : 0;
  1461. }
  1462. //#endregion
  1463. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toInteger.js
  1464. /**
  1465. * Converts `value` to an integer.
  1466. *
  1467. * **Note:** This method is loosely based on
  1468. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  1469. *
  1470. * @static
  1471. * @memberOf _
  1472. * @since 4.0.0
  1473. * @category Lang
  1474. * @param {*} value The value to convert.
  1475. * @returns {number} Returns the converted integer.
  1476. * @example
  1477. *
  1478. * _.toInteger(3.2);
  1479. * // => 3
  1480. *
  1481. * _.toInteger(Number.MIN_VALUE);
  1482. * // => 0
  1483. *
  1484. * _.toInteger(Infinity);
  1485. * // => 1.7976931348623157e+308
  1486. *
  1487. * _.toInteger('3.2');
  1488. * // => 3
  1489. */
  1490. function toInteger(value) {
  1491. var result = toFinite(value), remainder = result % 1;
  1492. return result === result ? remainder ? result - remainder : result : 0;
  1493. }
  1494. //#endregion
  1495. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/identity.js
  1496. /**
  1497. * This method returns the first argument it receives.
  1498. *
  1499. * @static
  1500. * @since 0.1.0
  1501. * @memberOf _
  1502. * @category Util
  1503. * @param {*} value Any value.
  1504. * @returns {*} Returns `value`.
  1505. * @example
  1506. *
  1507. * var object = { 'a': 1 };
  1508. *
  1509. * console.log(_.identity(object) === object);
  1510. * // => true
  1511. */
  1512. function identity(value) {
  1513. return value;
  1514. }
  1515. //#endregion
  1516. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isFunction.js
  1517. /** `Object#toString` result references. */
  1518. var asyncTag = "[object AsyncFunction]", funcTag$2 = "[object Function]", genTag$1 = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
  1519. /**
  1520. * Checks if `value` is classified as a `Function` object.
  1521. *
  1522. * @static
  1523. * @memberOf _
  1524. * @since 0.1.0
  1525. * @category Lang
  1526. * @param {*} value The value to check.
  1527. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1528. * @example
  1529. *
  1530. * _.isFunction(_);
  1531. * // => true
  1532. *
  1533. * _.isFunction(/abc/);
  1534. * // => false
  1535. */
  1536. function isFunction(value) {
  1537. if (!isObject(value)) return false;
  1538. var tag = baseGetTag(value);
  1539. return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
  1540. }
  1541. //#endregion
  1542. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_coreJsData.js
  1543. /** Used to detect overreaching core-js shims. */
  1544. var coreJsData = root["__core-js_shared__"];
  1545. //#endregion
  1546. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isMasked.js
  1547. /** Used to detect methods masquerading as native. */
  1548. var maskSrcKey = function() {
  1549. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
  1550. return uid ? "Symbol(src)_1." + uid : "";
  1551. }();
  1552. /**
  1553. * Checks if `func` has its source masked.
  1554. *
  1555. * @private
  1556. * @param {Function} func The function to check.
  1557. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1558. */
  1559. function isMasked(func) {
  1560. return !!maskSrcKey && maskSrcKey in func;
  1561. }
  1562. //#endregion
  1563. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_toSource.js
  1564. /** Used to resolve the decompiled source of functions. */
  1565. var funcToString$2 = Function.prototype.toString;
  1566. /**
  1567. * Converts `func` to its source code.
  1568. *
  1569. * @private
  1570. * @param {Function} func The function to convert.
  1571. * @returns {string} Returns the source code.
  1572. */
  1573. function toSource(func) {
  1574. if (func != null) {
  1575. try {
  1576. return funcToString$2.call(func);
  1577. } catch (e) {}
  1578. try {
  1579. return func + "";
  1580. } catch (e) {}
  1581. }
  1582. return "";
  1583. }
  1584. //#endregion
  1585. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNative.js
  1586. /**
  1587. * Used to match `RegExp`
  1588. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1589. */
  1590. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1591. /** Used to detect host constructors (Safari). */
  1592. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1593. /** Used for built-in method references. */
  1594. var funcProto$1 = Function.prototype, objectProto$3 = Object.prototype;
  1595. /** Used to resolve the decompiled source of functions. */
  1596. var funcToString$1 = funcProto$1.toString;
  1597. /** Used to check objects for own properties. */
  1598. var hasOwnProperty$12 = objectProto$3.hasOwnProperty;
  1599. /** Used to detect if a method is native. */
  1600. var reIsNative = RegExp("^" + funcToString$1.call(hasOwnProperty$12).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
  1601. /**
  1602. * The base implementation of `_.isNative` without bad shim checks.
  1603. *
  1604. * @private
  1605. * @param {*} value The value to check.
  1606. * @returns {boolean} Returns `true` if `value` is a native function,
  1607. * else `false`.
  1608. */
  1609. function baseIsNative(value) {
  1610. if (!isObject(value) || isMasked(value)) return false;
  1611. return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
  1612. }
  1613. //#endregion
  1614. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getValue.js
  1615. /**
  1616. * Gets the value at `key` of `object`.
  1617. *
  1618. * @private
  1619. * @param {Object} [object] The object to query.
  1620. * @param {string} key The key of the property to get.
  1621. * @returns {*} Returns the property value.
  1622. */
  1623. function getValue$1(object, key) {
  1624. return object == null ? void 0 : object[key];
  1625. }
  1626. //#endregion
  1627. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getNative.js
  1628. /**
  1629. * Gets the native function at `key` of `object`.
  1630. *
  1631. * @private
  1632. * @param {Object} object The object to query.
  1633. * @param {string} key The key of the method to get.
  1634. * @returns {*} Returns the function if it's native, else `undefined`.
  1635. */
  1636. function getNative(object, key) {
  1637. var value = getValue$1(object, key);
  1638. return baseIsNative(value) ? value : void 0;
  1639. }
  1640. //#endregion
  1641. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_WeakMap.js
  1642. var WeakMap$1 = getNative(root, "WeakMap");
  1643. //#endregion
  1644. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseCreate.js
  1645. /** Built-in value references. */
  1646. var objectCreate = Object.create;
  1647. /**
  1648. * The base implementation of `_.create` without support for assigning
  1649. * properties to the created object.
  1650. *
  1651. * @private
  1652. * @param {Object} proto The object to inherit from.
  1653. * @returns {Object} Returns the new object.
  1654. */
  1655. var baseCreate = function() {
  1656. function object() {}
  1657. return function(proto) {
  1658. if (!isObject(proto)) return {};
  1659. if (objectCreate) return objectCreate(proto);
  1660. object.prototype = proto;
  1661. var result = new object();
  1662. object.prototype = void 0;
  1663. return result;
  1664. };
  1665. }();
  1666. //#endregion
  1667. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_apply.js
  1668. /**
  1669. * A faster alternative to `Function#apply`, this function invokes `func`
  1670. * with the `this` binding of `thisArg` and the arguments of `args`.
  1671. *
  1672. * @private
  1673. * @param {Function} func The function to invoke.
  1674. * @param {*} thisArg The `this` binding of `func`.
  1675. * @param {Array} args The arguments to invoke `func` with.
  1676. * @returns {*} Returns the result of `func`.
  1677. */
  1678. function apply(func, thisArg, args) {
  1679. switch (args.length) {
  1680. case 0: return func.call(thisArg);
  1681. case 1: return func.call(thisArg, args[0]);
  1682. case 2: return func.call(thisArg, args[0], args[1]);
  1683. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1684. }
  1685. return func.apply(thisArg, args);
  1686. }
  1687. //#endregion
  1688. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/noop.js
  1689. /**
  1690. * This method returns `undefined`.
  1691. *
  1692. * @static
  1693. * @memberOf _
  1694. * @since 2.3.0
  1695. * @category Util
  1696. * @example
  1697. *
  1698. * _.times(2, _.noop);
  1699. * // => [undefined, undefined]
  1700. */
  1701. function noop() {}
  1702. //#endregion
  1703. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copyArray.js
  1704. /**
  1705. * Copies the values of `source` to `array`.
  1706. *
  1707. * @private
  1708. * @param {Array} source The array to copy values from.
  1709. * @param {Array} [array=[]] The array to copy values to.
  1710. * @returns {Array} Returns `array`.
  1711. */
  1712. function copyArray(source, array) {
  1713. var index = -1, length = source.length;
  1714. array || (array = Array(length));
  1715. while (++index < length) array[index] = source[index];
  1716. return array;
  1717. }
  1718. //#endregion
  1719. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_shortOut.js
  1720. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1721. var HOT_COUNT = 800, HOT_SPAN = 16;
  1722. var nativeNow = Date.now;
  1723. /**
  1724. * Creates a function that'll short out and invoke `identity` instead
  1725. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  1726. * milliseconds.
  1727. *
  1728. * @private
  1729. * @param {Function} func The function to restrict.
  1730. * @returns {Function} Returns the new shortable function.
  1731. */
  1732. function shortOut(func) {
  1733. var count = 0, lastCalled = 0;
  1734. return function() {
  1735. var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
  1736. lastCalled = stamp;
  1737. if (remaining > 0) {
  1738. if (++count >= HOT_COUNT) return arguments[0];
  1739. } else count = 0;
  1740. return func.apply(void 0, arguments);
  1741. };
  1742. }
  1743. //#endregion
  1744. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/constant.js
  1745. /**
  1746. * Creates a function that returns `value`.
  1747. *
  1748. * @static
  1749. * @memberOf _
  1750. * @since 2.4.0
  1751. * @category Util
  1752. * @param {*} value The value to return from the new function.
  1753. * @returns {Function} Returns the new constant function.
  1754. * @example
  1755. *
  1756. * var objects = _.times(2, _.constant({ 'a': 1 }));
  1757. *
  1758. * console.log(objects);
  1759. * // => [{ 'a': 1 }, { 'a': 1 }]
  1760. *
  1761. * console.log(objects[0] === objects[1]);
  1762. * // => true
  1763. */
  1764. function constant(value) {
  1765. return function() {
  1766. return value;
  1767. };
  1768. }
  1769. //#endregion
  1770. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_defineProperty.js
  1771. var defineProperty = function() {
  1772. try {
  1773. var func = getNative(Object, "defineProperty");
  1774. func({}, "", {});
  1775. return func;
  1776. } catch (e) {}
  1777. }();
  1778. //#endregion
  1779. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSetToString.js
  1780. /**
  1781. * The base implementation of `setToString` without support for hot loop shorting.
  1782. *
  1783. * @private
  1784. * @param {Function} func The function to modify.
  1785. * @param {Function} string The `toString` result.
  1786. * @returns {Function} Returns `func`.
  1787. */
  1788. var baseSetToString = !defineProperty ? identity : function(func, string) {
  1789. return defineProperty(func, "toString", {
  1790. "configurable": true,
  1791. "enumerable": false,
  1792. "value": constant(string),
  1793. "writable": true
  1794. });
  1795. };
  1796. //#endregion
  1797. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setToString.js
  1798. /**
  1799. * Sets the `toString` method of `func` to return `string`.
  1800. *
  1801. * @private
  1802. * @param {Function} func The function to modify.
  1803. * @param {Function} string The `toString` result.
  1804. * @returns {Function} Returns `func`.
  1805. */
  1806. var setToString = shortOut(baseSetToString);
  1807. //#endregion
  1808. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayEach.js
  1809. /**
  1810. * A specialized version of `_.forEach` for arrays without support for
  1811. * iteratee shorthands.
  1812. *
  1813. * @private
  1814. * @param {Array} [array] The array to iterate over.
  1815. * @param {Function} iteratee The function invoked per iteration.
  1816. * @returns {Array} Returns `array`.
  1817. */
  1818. function arrayEach(array, iteratee) {
  1819. var index = -1, length = array == null ? 0 : array.length;
  1820. while (++index < length) if (iteratee(array[index], index, array) === false) break;
  1821. return array;
  1822. }
  1823. //#endregion
  1824. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFindIndex.js
  1825. /**
  1826. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1827. * support for iteratee shorthands.
  1828. *
  1829. * @private
  1830. * @param {Array} array The array to inspect.
  1831. * @param {Function} predicate The function invoked per iteration.
  1832. * @param {number} fromIndex The index to search from.
  1833. * @param {boolean} [fromRight] Specify iterating from right to left.
  1834. * @returns {number} Returns the index of the matched value, else `-1`.
  1835. */
  1836. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1837. var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
  1838. while (fromRight ? index-- : ++index < length) if (predicate(array[index], index, array)) return index;
  1839. return -1;
  1840. }
  1841. //#endregion
  1842. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsNaN.js
  1843. /**
  1844. * The base implementation of `_.isNaN` without support for number objects.
  1845. *
  1846. * @private
  1847. * @param {*} value The value to check.
  1848. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1849. */
  1850. function baseIsNaN(value) {
  1851. return value !== value;
  1852. }
  1853. //#endregion
  1854. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_strictIndexOf.js
  1855. /**
  1856. * A specialized version of `_.indexOf` which performs strict equality
  1857. * comparisons of values, i.e. `===`.
  1858. *
  1859. * @private
  1860. * @param {Array} array The array to inspect.
  1861. * @param {*} value The value to search for.
  1862. * @param {number} fromIndex The index to search from.
  1863. * @returns {number} Returns the index of the matched value, else `-1`.
  1864. */
  1865. function strictIndexOf(array, value, fromIndex) {
  1866. var index = fromIndex - 1, length = array.length;
  1867. while (++index < length) if (array[index] === value) return index;
  1868. return -1;
  1869. }
  1870. //#endregion
  1871. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIndexOf.js
  1872. /**
  1873. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1874. *
  1875. * @private
  1876. * @param {Array} array The array to inspect.
  1877. * @param {*} value The value to search for.
  1878. * @param {number} fromIndex The index to search from.
  1879. * @returns {number} Returns the index of the matched value, else `-1`.
  1880. */
  1881. function baseIndexOf(array, value, fromIndex) {
  1882. return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
  1883. }
  1884. //#endregion
  1885. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludes.js
  1886. /**
  1887. * A specialized version of `_.includes` for arrays without support for
  1888. * specifying an index to search from.
  1889. *
  1890. * @private
  1891. * @param {Array} [array] The array to inspect.
  1892. * @param {*} target The value to search for.
  1893. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1894. */
  1895. function arrayIncludes(array, value) {
  1896. return !!(array == null ? 0 : array.length) && baseIndexOf(array, value, 0) > -1;
  1897. }
  1898. //#endregion
  1899. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isIndex.js
  1900. /** Used as references for various `Number` constants. */
  1901. var MAX_SAFE_INTEGER$1 = 9007199254740991;
  1902. /** Used to detect unsigned integer values. */
  1903. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1904. /**
  1905. * Checks if `value` is a valid array-like index.
  1906. *
  1907. * @private
  1908. * @param {*} value The value to check.
  1909. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  1910. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  1911. */
  1912. function isIndex(value, length) {
  1913. var type = typeof value;
  1914. length = length == null ? MAX_SAFE_INTEGER$1 : length;
  1915. return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
  1916. }
  1917. //#endregion
  1918. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignValue.js
  1919. /**
  1920. * The base implementation of `assignValue` and `assignMergeValue` without
  1921. * value checks.
  1922. *
  1923. * @private
  1924. * @param {Object} object The object to modify.
  1925. * @param {string} key The key of the property to assign.
  1926. * @param {*} value The value to assign.
  1927. */
  1928. function baseAssignValue(object, key, value) {
  1929. if (key == "__proto__" && defineProperty) defineProperty(object, key, {
  1930. "configurable": true,
  1931. "enumerable": true,
  1932. "value": value,
  1933. "writable": true
  1934. });
  1935. else object[key] = value;
  1936. }
  1937. //#endregion
  1938. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/eq.js
  1939. /**
  1940. * Performs a
  1941. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1942. * comparison between two values to determine if they are equivalent.
  1943. *
  1944. * @static
  1945. * @memberOf _
  1946. * @since 4.0.0
  1947. * @category Lang
  1948. * @param {*} value The value to compare.
  1949. * @param {*} other The other value to compare.
  1950. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1951. * @example
  1952. *
  1953. * var object = { 'a': 1 };
  1954. * var other = { 'a': 1 };
  1955. *
  1956. * _.eq(object, object);
  1957. * // => true
  1958. *
  1959. * _.eq(object, other);
  1960. * // => false
  1961. *
  1962. * _.eq('a', 'a');
  1963. * // => true
  1964. *
  1965. * _.eq('a', Object('a'));
  1966. * // => false
  1967. *
  1968. * _.eq(NaN, NaN);
  1969. * // => true
  1970. */
  1971. function eq(value, other) {
  1972. return value === other || value !== value && other !== other;
  1973. }
  1974. //#endregion
  1975. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assignValue.js
  1976. /** Used to check objects for own properties. */
  1977. var hasOwnProperty$11 = Object.prototype.hasOwnProperty;
  1978. /**
  1979. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  1980. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1981. * for equality comparisons.
  1982. *
  1983. * @private
  1984. * @param {Object} object The object to modify.
  1985. * @param {string} key The key of the property to assign.
  1986. * @param {*} value The value to assign.
  1987. */
  1988. function assignValue(object, key, value) {
  1989. var objValue = object[key];
  1990. if (!(hasOwnProperty$11.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
  1991. }
  1992. //#endregion
  1993. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copyObject.js
  1994. /**
  1995. * Copies properties of `source` to `object`.
  1996. *
  1997. * @private
  1998. * @param {Object} source The object to copy properties from.
  1999. * @param {Array} props The property identifiers to copy.
  2000. * @param {Object} [object={}] The object to copy properties to.
  2001. * @param {Function} [customizer] The function to customize copied values.
  2002. * @returns {Object} Returns `object`.
  2003. */
  2004. function copyObject(source, props, object, customizer) {
  2005. var isNew = !object;
  2006. object || (object = {});
  2007. var index = -1, length = props.length;
  2008. while (++index < length) {
  2009. var key = props[index];
  2010. var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
  2011. if (newValue === void 0) newValue = source[key];
  2012. if (isNew) baseAssignValue(object, key, newValue);
  2013. else assignValue(object, key, newValue);
  2014. }
  2015. return object;
  2016. }
  2017. //#endregion
  2018. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_overRest.js
  2019. var nativeMax$2 = Math.max;
  2020. /**
  2021. * A specialized version of `baseRest` which transforms the rest array.
  2022. *
  2023. * @private
  2024. * @param {Function} func The function to apply a rest parameter to.
  2025. * @param {number} [start=func.length-1] The start position of the rest parameter.
  2026. * @param {Function} transform The rest array transform.
  2027. * @returns {Function} Returns the new function.
  2028. */
  2029. function overRest(func, start, transform) {
  2030. start = nativeMax$2(start === void 0 ? func.length - 1 : start, 0);
  2031. return function() {
  2032. var args = arguments, index = -1, length = nativeMax$2(args.length - start, 0), array = Array(length);
  2033. while (++index < length) array[index] = args[start + index];
  2034. index = -1;
  2035. var otherArgs = Array(start + 1);
  2036. while (++index < start) otherArgs[index] = args[index];
  2037. otherArgs[start] = transform(array);
  2038. return apply(func, this, otherArgs);
  2039. };
  2040. }
  2041. //#endregion
  2042. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseRest.js
  2043. /**
  2044. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  2045. *
  2046. * @private
  2047. * @param {Function} func The function to apply a rest parameter to.
  2048. * @param {number} [start=func.length-1] The start position of the rest parameter.
  2049. * @returns {Function} Returns the new function.
  2050. */
  2051. function baseRest(func, start) {
  2052. return setToString(overRest(func, start, identity), func + "");
  2053. }
  2054. //#endregion
  2055. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isLength.js
  2056. /** Used as references for various `Number` constants. */
  2057. var MAX_SAFE_INTEGER = 9007199254740991;
  2058. /**
  2059. * Checks if `value` is a valid array-like length.
  2060. *
  2061. * **Note:** This method is loosely based on
  2062. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  2063. *
  2064. * @static
  2065. * @memberOf _
  2066. * @since 4.0.0
  2067. * @category Lang
  2068. * @param {*} value The value to check.
  2069. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  2070. * @example
  2071. *
  2072. * _.isLength(3);
  2073. * // => true
  2074. *
  2075. * _.isLength(Number.MIN_VALUE);
  2076. * // => false
  2077. *
  2078. * _.isLength(Infinity);
  2079. * // => false
  2080. *
  2081. * _.isLength('3');
  2082. * // => false
  2083. */
  2084. function isLength(value) {
  2085. return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  2086. }
  2087. //#endregion
  2088. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArrayLike.js
  2089. /**
  2090. * Checks if `value` is array-like. A value is considered array-like if it's
  2091. * not a function and has a `value.length` that's an integer greater than or
  2092. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  2093. *
  2094. * @static
  2095. * @memberOf _
  2096. * @since 4.0.0
  2097. * @category Lang
  2098. * @param {*} value The value to check.
  2099. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  2100. * @example
  2101. *
  2102. * _.isArrayLike([1, 2, 3]);
  2103. * // => true
  2104. *
  2105. * _.isArrayLike(document.body.children);
  2106. * // => true
  2107. *
  2108. * _.isArrayLike('abc');
  2109. * // => true
  2110. *
  2111. * _.isArrayLike(_.noop);
  2112. * // => false
  2113. */
  2114. function isArrayLike(value) {
  2115. return value != null && isLength(value.length) && !isFunction(value);
  2116. }
  2117. //#endregion
  2118. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isIterateeCall.js
  2119. /**
  2120. * Checks if the given arguments are from an iteratee call.
  2121. *
  2122. * @private
  2123. * @param {*} value The potential iteratee value argument.
  2124. * @param {*} index The potential iteratee index or key argument.
  2125. * @param {*} object The potential iteratee object argument.
  2126. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  2127. * else `false`.
  2128. */
  2129. function isIterateeCall(value, index, object) {
  2130. if (!isObject(object)) return false;
  2131. var type = typeof index;
  2132. if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) return eq(object[index], value);
  2133. return false;
  2134. }
  2135. //#endregion
  2136. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createAssigner.js
  2137. /**
  2138. * Creates a function like `_.assign`.
  2139. *
  2140. * @private
  2141. * @param {Function} assigner The function to assign values.
  2142. * @returns {Function} Returns the new assigner function.
  2143. */
  2144. function createAssigner(assigner) {
  2145. return baseRest(function(object, sources) {
  2146. var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
  2147. customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
  2148. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  2149. customizer = length < 3 ? void 0 : customizer;
  2150. length = 1;
  2151. }
  2152. object = Object(object);
  2153. while (++index < length) {
  2154. var source = sources[index];
  2155. if (source) assigner(object, source, index, customizer);
  2156. }
  2157. return object;
  2158. });
  2159. }
  2160. //#endregion
  2161. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isPrototype.js
  2162. /** Used for built-in method references. */
  2163. var objectProto$2 = Object.prototype;
  2164. /**
  2165. * Checks if `value` is likely a prototype object.
  2166. *
  2167. * @private
  2168. * @param {*} value The value to check.
  2169. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  2170. */
  2171. function isPrototype(value) {
  2172. var Ctor = value && value.constructor;
  2173. return value === (typeof Ctor == "function" && Ctor.prototype || objectProto$2);
  2174. }
  2175. //#endregion
  2176. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseTimes.js
  2177. /**
  2178. * The base implementation of `_.times` without support for iteratee shorthands
  2179. * or max array length checks.
  2180. *
  2181. * @private
  2182. * @param {number} n The number of times to invoke `iteratee`.
  2183. * @param {Function} iteratee The function invoked per iteration.
  2184. * @returns {Array} Returns the array of results.
  2185. */
  2186. function baseTimes(n, iteratee) {
  2187. var index = -1, result = Array(n);
  2188. while (++index < n) result[index] = iteratee(index);
  2189. return result;
  2190. }
  2191. //#endregion
  2192. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsArguments.js
  2193. /** `Object#toString` result references. */
  2194. var argsTag$3 = "[object Arguments]";
  2195. /**
  2196. * The base implementation of `_.isArguments`.
  2197. *
  2198. * @private
  2199. * @param {*} value The value to check.
  2200. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2201. */
  2202. function baseIsArguments(value) {
  2203. return isObjectLike(value) && baseGetTag(value) == argsTag$3;
  2204. }
  2205. //#endregion
  2206. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArguments.js
  2207. /** Used for built-in method references. */
  2208. var objectProto$1 = Object.prototype;
  2209. /** Used to check objects for own properties. */
  2210. var hasOwnProperty$10 = objectProto$1.hasOwnProperty;
  2211. /** Built-in value references. */
  2212. var propertyIsEnumerable$1 = objectProto$1.propertyIsEnumerable;
  2213. /**
  2214. * Checks if `value` is likely an `arguments` object.
  2215. *
  2216. * @static
  2217. * @memberOf _
  2218. * @since 0.1.0
  2219. * @category Lang
  2220. * @param {*} value The value to check.
  2221. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  2222. * else `false`.
  2223. * @example
  2224. *
  2225. * _.isArguments(function() { return arguments; }());
  2226. * // => true
  2227. *
  2228. * _.isArguments([1, 2, 3]);
  2229. * // => false
  2230. */
  2231. var isArguments = baseIsArguments(function() {
  2232. return arguments;
  2233. }()) ? baseIsArguments : function(value) {
  2234. return isObjectLike(value) && hasOwnProperty$10.call(value, "callee") && !propertyIsEnumerable$1.call(value, "callee");
  2235. };
  2236. //#endregion
  2237. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubFalse.js
  2238. /**
  2239. * This method returns `false`.
  2240. *
  2241. * @static
  2242. * @memberOf _
  2243. * @since 4.13.0
  2244. * @category Util
  2245. * @returns {boolean} Returns `false`.
  2246. * @example
  2247. *
  2248. * _.times(2, _.stubFalse);
  2249. * // => [false, false]
  2250. */
  2251. function stubFalse() {
  2252. return false;
  2253. }
  2254. //#endregion
  2255. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isBuffer.js
  2256. /** Detect free variable `exports`. */
  2257. var freeExports$2 = typeof exports == "object" && exports && !exports.nodeType && exports;
  2258. /** Detect free variable `module`. */
  2259. var freeModule$2 = freeExports$2 && typeof module == "object" && module && !module.nodeType && module;
  2260. /** Built-in value references. */
  2261. var Buffer$2 = freeModule$2 && freeModule$2.exports === freeExports$2 ? root.Buffer : void 0;
  2262. /**
  2263. * Checks if `value` is a buffer.
  2264. *
  2265. * @static
  2266. * @memberOf _
  2267. * @since 4.3.0
  2268. * @category Lang
  2269. * @param {*} value The value to check.
  2270. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  2271. * @example
  2272. *
  2273. * _.isBuffer(new Buffer(2));
  2274. * // => true
  2275. *
  2276. * _.isBuffer(new Uint8Array(2));
  2277. * // => false
  2278. */
  2279. var isBuffer = (Buffer$2 ? Buffer$2.isBuffer : void 0) || stubFalse;
  2280. //#endregion
  2281. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsTypedArray.js
  2282. /** `Object#toString` result references. */
  2283. var argsTag$2 = "[object Arguments]", arrayTag$2 = "[object Array]", boolTag$3 = "[object Boolean]", dateTag$3 = "[object Date]", errorTag$2 = "[object Error]", funcTag$1 = "[object Function]", mapTag$5 = "[object Map]", numberTag$3 = "[object Number]", objectTag$4 = "[object Object]", regexpTag$3 = "[object RegExp]", setTag$5 = "[object Set]", stringTag$3 = "[object String]", weakMapTag$2 = "[object WeakMap]";
  2284. var arrayBufferTag$3 = "[object ArrayBuffer]", dataViewTag$4 = "[object DataView]", float32Tag$2 = "[object Float32Array]", float64Tag$2 = "[object Float64Array]", int8Tag$2 = "[object Int8Array]", int16Tag$2 = "[object Int16Array]", int32Tag$2 = "[object Int32Array]", uint8Tag$2 = "[object Uint8Array]", uint8ClampedTag$2 = "[object Uint8ClampedArray]", uint16Tag$2 = "[object Uint16Array]", uint32Tag$2 = "[object Uint32Array]";
  2285. /** Used to identify `toStringTag` values of typed arrays. */
  2286. var typedArrayTags = {};
  2287. 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;
  2288. typedArrayTags[argsTag$2] = typedArrayTags[arrayTag$2] = typedArrayTags[arrayBufferTag$3] = typedArrayTags[boolTag$3] = typedArrayTags[dataViewTag$4] = typedArrayTags[dateTag$3] = typedArrayTags[errorTag$2] = typedArrayTags[funcTag$1] = typedArrayTags[mapTag$5] = typedArrayTags[numberTag$3] = typedArrayTags[objectTag$4] = typedArrayTags[regexpTag$3] = typedArrayTags[setTag$5] = typedArrayTags[stringTag$3] = typedArrayTags[weakMapTag$2] = false;
  2289. /**
  2290. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  2291. *
  2292. * @private
  2293. * @param {*} value The value to check.
  2294. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  2295. */
  2296. function baseIsTypedArray(value) {
  2297. return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  2298. }
  2299. //#endregion
  2300. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUnary.js
  2301. /**
  2302. * The base implementation of `_.unary` without support for storing metadata.
  2303. *
  2304. * @private
  2305. * @param {Function} func The function to cap arguments for.
  2306. * @returns {Function} Returns the new capped function.
  2307. */
  2308. function baseUnary(func) {
  2309. return function(value) {
  2310. return func(value);
  2311. };
  2312. }
  2313. //#endregion
  2314. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nodeUtil.js
  2315. /** Detect free variable `exports`. */
  2316. var freeExports$1 = typeof exports == "object" && exports && !exports.nodeType && exports;
  2317. /** Detect free variable `module`. */
  2318. var freeModule$1 = freeExports$1 && typeof module == "object" && module && !module.nodeType && module;
  2319. /** Detect free variable `process` from Node.js. */
  2320. var freeProcess = freeModule$1 && freeModule$1.exports === freeExports$1 && freeGlobal.process;
  2321. /** Used to access faster Node.js helpers. */
  2322. var nodeUtil = function() {
  2323. try {
  2324. var types = freeModule$1 && freeModule$1.require && freeModule$1.require("util").types;
  2325. if (types) return types;
  2326. return freeProcess && freeProcess.binding && freeProcess.binding("util");
  2327. } catch (e) {}
  2328. }();
  2329. //#endregion
  2330. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isTypedArray.js
  2331. var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2332. /**
  2333. * Checks if `value` is classified as a typed array.
  2334. *
  2335. * @static
  2336. * @memberOf _
  2337. * @since 3.0.0
  2338. * @category Lang
  2339. * @param {*} value The value to check.
  2340. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  2341. * @example
  2342. *
  2343. * _.isTypedArray(new Uint8Array);
  2344. * // => true
  2345. *
  2346. * _.isTypedArray([]);
  2347. * // => false
  2348. */
  2349. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  2350. //#endregion
  2351. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayLikeKeys.js
  2352. /** Used to check objects for own properties. */
  2353. var hasOwnProperty$9 = Object.prototype.hasOwnProperty;
  2354. /**
  2355. * Creates an array of the enumerable property names of the array-like `value`.
  2356. *
  2357. * @private
  2358. * @param {*} value The value to query.
  2359. * @param {boolean} inherited Specify returning inherited property names.
  2360. * @returns {Array} Returns the array of property names.
  2361. */
  2362. function arrayLikeKeys(value, inherited) {
  2363. var isArr = isArray(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;
  2364. for (var key in value) if ((inherited || hasOwnProperty$9.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
  2365. return result;
  2366. }
  2367. //#endregion
  2368. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_overArg.js
  2369. /**
  2370. * Creates a unary function that invokes `func` with its argument transformed.
  2371. *
  2372. * @private
  2373. * @param {Function} func The function to wrap.
  2374. * @param {Function} transform The argument transform.
  2375. * @returns {Function} Returns the new function.
  2376. */
  2377. function overArg(func, transform) {
  2378. return function(arg) {
  2379. return func(transform(arg));
  2380. };
  2381. }
  2382. //#endregion
  2383. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeys.js
  2384. var nativeKeys = overArg(Object.keys, Object);
  2385. //#endregion
  2386. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseKeys.js
  2387. /** Used to check objects for own properties. */
  2388. var hasOwnProperty$8 = Object.prototype.hasOwnProperty;
  2389. /**
  2390. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  2391. *
  2392. * @private
  2393. * @param {Object} object The object to query.
  2394. * @returns {Array} Returns the array of property names.
  2395. */
  2396. function baseKeys(object) {
  2397. if (!isPrototype(object)) return nativeKeys(object);
  2398. var result = [];
  2399. for (var key in Object(object)) if (hasOwnProperty$8.call(object, key) && key != "constructor") result.push(key);
  2400. return result;
  2401. }
  2402. //#endregion
  2403. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/keys.js
  2404. /**
  2405. * Creates an array of the own enumerable property names of `object`.
  2406. *
  2407. * **Note:** Non-object values are coerced to objects. See the
  2408. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2409. * for more details.
  2410. *
  2411. * @static
  2412. * @since 0.1.0
  2413. * @memberOf _
  2414. * @category Object
  2415. * @param {Object} object The object to query.
  2416. * @returns {Array} Returns the array of property names.
  2417. * @example
  2418. *
  2419. * function Foo() {
  2420. * this.a = 1;
  2421. * this.b = 2;
  2422. * }
  2423. *
  2424. * Foo.prototype.c = 3;
  2425. *
  2426. * _.keys(new Foo);
  2427. * // => ['a', 'b'] (iteration order is not guaranteed)
  2428. *
  2429. * _.keys('hi');
  2430. * // => ['0', '1']
  2431. */
  2432. function keys(object) {
  2433. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  2434. }
  2435. //#endregion
  2436. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeKeysIn.js
  2437. /**
  2438. * This function is like
  2439. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  2440. * except that it includes inherited enumerable properties.
  2441. *
  2442. * @private
  2443. * @param {Object} object The object to query.
  2444. * @returns {Array} Returns the array of property names.
  2445. */
  2446. function nativeKeysIn(object) {
  2447. var result = [];
  2448. if (object != null) for (var key in Object(object)) result.push(key);
  2449. return result;
  2450. }
  2451. //#endregion
  2452. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseKeysIn.js
  2453. /** Used to check objects for own properties. */
  2454. var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
  2455. /**
  2456. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  2457. *
  2458. * @private
  2459. * @param {Object} object The object to query.
  2460. * @returns {Array} Returns the array of property names.
  2461. */
  2462. function baseKeysIn(object) {
  2463. if (!isObject(object)) return nativeKeysIn(object);
  2464. var isProto = isPrototype(object), result = [];
  2465. for (var key in object) if (!(key == "constructor" && (isProto || !hasOwnProperty$7.call(object, key)))) result.push(key);
  2466. return result;
  2467. }
  2468. //#endregion
  2469. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/keysIn.js
  2470. /**
  2471. * Creates an array of the own and inherited enumerable property names of `object`.
  2472. *
  2473. * **Note:** Non-object values are coerced to objects.
  2474. *
  2475. * @static
  2476. * @memberOf _
  2477. * @since 3.0.0
  2478. * @category Object
  2479. * @param {Object} object The object to query.
  2480. * @returns {Array} Returns the array of property names.
  2481. * @example
  2482. *
  2483. * function Foo() {
  2484. * this.a = 1;
  2485. * this.b = 2;
  2486. * }
  2487. *
  2488. * Foo.prototype.c = 3;
  2489. *
  2490. * _.keysIn(new Foo);
  2491. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  2492. */
  2493. function keysIn(object) {
  2494. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  2495. }
  2496. //#endregion
  2497. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isKey.js
  2498. /** Used to match property names within property paths. */
  2499. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/;
  2500. /**
  2501. * Checks if `value` is a property name and not a property path.
  2502. *
  2503. * @private
  2504. * @param {*} value The value to check.
  2505. * @param {Object} [object] The object to query keys on.
  2506. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  2507. */
  2508. function isKey(value, object) {
  2509. if (isArray(value)) return false;
  2510. var type = typeof value;
  2511. if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) return true;
  2512. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
  2513. }
  2514. //#endregion
  2515. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_nativeCreate.js
  2516. var nativeCreate = getNative(Object, "create");
  2517. //#endregion
  2518. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashClear.js
  2519. /**
  2520. * Removes all key-value entries from the hash.
  2521. *
  2522. * @private
  2523. * @name clear
  2524. * @memberOf Hash
  2525. */
  2526. function hashClear() {
  2527. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2528. this.size = 0;
  2529. }
  2530. //#endregion
  2531. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashDelete.js
  2532. /**
  2533. * Removes `key` and its value from the hash.
  2534. *
  2535. * @private
  2536. * @name delete
  2537. * @memberOf Hash
  2538. * @param {Object} hash The hash to modify.
  2539. * @param {string} key The key of the value to remove.
  2540. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2541. */
  2542. function hashDelete(key) {
  2543. var result = this.has(key) && delete this.__data__[key];
  2544. this.size -= result ? 1 : 0;
  2545. return result;
  2546. }
  2547. //#endregion
  2548. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashGet.js
  2549. /** Used to stand-in for `undefined` hash values. */
  2550. var HASH_UNDEFINED$2 = "__lodash_hash_undefined__";
  2551. /** Used to check objects for own properties. */
  2552. var hasOwnProperty$6 = Object.prototype.hasOwnProperty;
  2553. /**
  2554. * Gets the hash value for `key`.
  2555. *
  2556. * @private
  2557. * @name get
  2558. * @memberOf Hash
  2559. * @param {string} key The key of the value to get.
  2560. * @returns {*} Returns the entry value.
  2561. */
  2562. function hashGet(key) {
  2563. var data = this.__data__;
  2564. if (nativeCreate) {
  2565. var result = data[key];
  2566. return result === HASH_UNDEFINED$2 ? void 0 : result;
  2567. }
  2568. return hasOwnProperty$6.call(data, key) ? data[key] : void 0;
  2569. }
  2570. //#endregion
  2571. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashHas.js
  2572. /** Used to check objects for own properties. */
  2573. var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
  2574. /**
  2575. * Checks if a hash value for `key` exists.
  2576. *
  2577. * @private
  2578. * @name has
  2579. * @memberOf Hash
  2580. * @param {string} key The key of the entry to check.
  2581. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2582. */
  2583. function hashHas(key) {
  2584. var data = this.__data__;
  2585. return nativeCreate ? data[key] !== void 0 : hasOwnProperty$5.call(data, key);
  2586. }
  2587. //#endregion
  2588. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hashSet.js
  2589. /** Used to stand-in for `undefined` hash values. */
  2590. var HASH_UNDEFINED$1 = "__lodash_hash_undefined__";
  2591. /**
  2592. * Sets the hash `key` to `value`.
  2593. *
  2594. * @private
  2595. * @name set
  2596. * @memberOf Hash
  2597. * @param {string} key The key of the value to set.
  2598. * @param {*} value The value to set.
  2599. * @returns {Object} Returns the hash instance.
  2600. */
  2601. function hashSet(key, value) {
  2602. var data = this.__data__;
  2603. this.size += this.has(key) ? 0 : 1;
  2604. data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED$1 : value;
  2605. return this;
  2606. }
  2607. //#endregion
  2608. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Hash.js
  2609. /**
  2610. * Creates a hash object.
  2611. *
  2612. * @private
  2613. * @constructor
  2614. * @param {Array} [entries] The key-value pairs to cache.
  2615. */
  2616. function Hash(entries) {
  2617. var index = -1, length = entries == null ? 0 : entries.length;
  2618. this.clear();
  2619. while (++index < length) {
  2620. var entry = entries[index];
  2621. this.set(entry[0], entry[1]);
  2622. }
  2623. }
  2624. Hash.prototype.clear = hashClear;
  2625. Hash.prototype["delete"] = hashDelete;
  2626. Hash.prototype.get = hashGet;
  2627. Hash.prototype.has = hashHas;
  2628. Hash.prototype.set = hashSet;
  2629. //#endregion
  2630. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheClear.js
  2631. /**
  2632. * Removes all key-value entries from the list cache.
  2633. *
  2634. * @private
  2635. * @name clear
  2636. * @memberOf ListCache
  2637. */
  2638. function listCacheClear() {
  2639. this.__data__ = [];
  2640. this.size = 0;
  2641. }
  2642. //#endregion
  2643. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assocIndexOf.js
  2644. /**
  2645. * Gets the index at which the `key` is found in `array` of key-value pairs.
  2646. *
  2647. * @private
  2648. * @param {Array} array The array to inspect.
  2649. * @param {*} key The key to search for.
  2650. * @returns {number} Returns the index of the matched value, else `-1`.
  2651. */
  2652. function assocIndexOf(array, key) {
  2653. var length = array.length;
  2654. while (length--) if (eq(array[length][0], key)) return length;
  2655. return -1;
  2656. }
  2657. //#endregion
  2658. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheDelete.js
  2659. /** Built-in value references. */
  2660. var splice = Array.prototype.splice;
  2661. /**
  2662. * Removes `key` and its value from the list cache.
  2663. *
  2664. * @private
  2665. * @name delete
  2666. * @memberOf ListCache
  2667. * @param {string} key The key of the value to remove.
  2668. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2669. */
  2670. function listCacheDelete(key) {
  2671. var data = this.__data__, index = assocIndexOf(data, key);
  2672. if (index < 0) return false;
  2673. if (index == data.length - 1) data.pop();
  2674. else splice.call(data, index, 1);
  2675. --this.size;
  2676. return true;
  2677. }
  2678. //#endregion
  2679. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheGet.js
  2680. /**
  2681. * Gets the list cache value for `key`.
  2682. *
  2683. * @private
  2684. * @name get
  2685. * @memberOf ListCache
  2686. * @param {string} key The key of the value to get.
  2687. * @returns {*} Returns the entry value.
  2688. */
  2689. function listCacheGet(key) {
  2690. var data = this.__data__, index = assocIndexOf(data, key);
  2691. return index < 0 ? void 0 : data[index][1];
  2692. }
  2693. //#endregion
  2694. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheHas.js
  2695. /**
  2696. * Checks if a list cache value for `key` exists.
  2697. *
  2698. * @private
  2699. * @name has
  2700. * @memberOf ListCache
  2701. * @param {string} key The key of the entry to check.
  2702. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2703. */
  2704. function listCacheHas(key) {
  2705. return assocIndexOf(this.__data__, key) > -1;
  2706. }
  2707. //#endregion
  2708. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_listCacheSet.js
  2709. /**
  2710. * Sets the list cache `key` to `value`.
  2711. *
  2712. * @private
  2713. * @name set
  2714. * @memberOf ListCache
  2715. * @param {string} key The key of the value to set.
  2716. * @param {*} value The value to set.
  2717. * @returns {Object} Returns the list cache instance.
  2718. */
  2719. function listCacheSet(key, value) {
  2720. var data = this.__data__, index = assocIndexOf(data, key);
  2721. if (index < 0) {
  2722. ++this.size;
  2723. data.push([key, value]);
  2724. } else data[index][1] = value;
  2725. return this;
  2726. }
  2727. //#endregion
  2728. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_ListCache.js
  2729. /**
  2730. * Creates an list cache object.
  2731. *
  2732. * @private
  2733. * @constructor
  2734. * @param {Array} [entries] The key-value pairs to cache.
  2735. */
  2736. function ListCache(entries) {
  2737. var index = -1, length = entries == null ? 0 : entries.length;
  2738. this.clear();
  2739. while (++index < length) {
  2740. var entry = entries[index];
  2741. this.set(entry[0], entry[1]);
  2742. }
  2743. }
  2744. ListCache.prototype.clear = listCacheClear;
  2745. ListCache.prototype["delete"] = listCacheDelete;
  2746. ListCache.prototype.get = listCacheGet;
  2747. ListCache.prototype.has = listCacheHas;
  2748. ListCache.prototype.set = listCacheSet;
  2749. //#endregion
  2750. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Map.js
  2751. var Map$1 = getNative(root, "Map");
  2752. //#endregion
  2753. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheClear.js
  2754. /**
  2755. * Removes all key-value entries from the map.
  2756. *
  2757. * @private
  2758. * @name clear
  2759. * @memberOf MapCache
  2760. */
  2761. function mapCacheClear() {
  2762. this.size = 0;
  2763. this.__data__ = {
  2764. "hash": new Hash(),
  2765. "map": new (Map$1 || ListCache)(),
  2766. "string": new Hash()
  2767. };
  2768. }
  2769. //#endregion
  2770. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isKeyable.js
  2771. /**
  2772. * Checks if `value` is suitable for use as unique object key.
  2773. *
  2774. * @private
  2775. * @param {*} value The value to check.
  2776. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  2777. */
  2778. function isKeyable(value) {
  2779. var type = typeof value;
  2780. return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
  2781. }
  2782. //#endregion
  2783. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getMapData.js
  2784. /**
  2785. * Gets the data for `map`.
  2786. *
  2787. * @private
  2788. * @param {Object} map The map to query.
  2789. * @param {string} key The reference key.
  2790. * @returns {*} Returns the map data.
  2791. */
  2792. function getMapData(map, key) {
  2793. var data = map.__data__;
  2794. return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
  2795. }
  2796. //#endregion
  2797. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheDelete.js
  2798. /**
  2799. * Removes `key` and its value from the map.
  2800. *
  2801. * @private
  2802. * @name delete
  2803. * @memberOf MapCache
  2804. * @param {string} key The key of the value to remove.
  2805. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2806. */
  2807. function mapCacheDelete(key) {
  2808. var result = getMapData(this, key)["delete"](key);
  2809. this.size -= result ? 1 : 0;
  2810. return result;
  2811. }
  2812. //#endregion
  2813. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheGet.js
  2814. /**
  2815. * Gets the map value for `key`.
  2816. *
  2817. * @private
  2818. * @name get
  2819. * @memberOf MapCache
  2820. * @param {string} key The key of the value to get.
  2821. * @returns {*} Returns the entry value.
  2822. */
  2823. function mapCacheGet(key) {
  2824. return getMapData(this, key).get(key);
  2825. }
  2826. //#endregion
  2827. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheHas.js
  2828. /**
  2829. * Checks if a map value for `key` exists.
  2830. *
  2831. * @private
  2832. * @name has
  2833. * @memberOf MapCache
  2834. * @param {string} key The key of the entry to check.
  2835. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2836. */
  2837. function mapCacheHas(key) {
  2838. return getMapData(this, key).has(key);
  2839. }
  2840. //#endregion
  2841. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapCacheSet.js
  2842. /**
  2843. * Sets the map `key` to `value`.
  2844. *
  2845. * @private
  2846. * @name set
  2847. * @memberOf MapCache
  2848. * @param {string} key The key of the value to set.
  2849. * @param {*} value The value to set.
  2850. * @returns {Object} Returns the map cache instance.
  2851. */
  2852. function mapCacheSet(key, value) {
  2853. var data = getMapData(this, key), size = data.size;
  2854. data.set(key, value);
  2855. this.size += data.size == size ? 0 : 1;
  2856. return this;
  2857. }
  2858. //#endregion
  2859. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_MapCache.js
  2860. /**
  2861. * Creates a map cache object to store key-value pairs.
  2862. *
  2863. * @private
  2864. * @constructor
  2865. * @param {Array} [entries] The key-value pairs to cache.
  2866. */
  2867. function MapCache(entries) {
  2868. var index = -1, length = entries == null ? 0 : entries.length;
  2869. this.clear();
  2870. while (++index < length) {
  2871. var entry = entries[index];
  2872. this.set(entry[0], entry[1]);
  2873. }
  2874. }
  2875. MapCache.prototype.clear = mapCacheClear;
  2876. MapCache.prototype["delete"] = mapCacheDelete;
  2877. MapCache.prototype.get = mapCacheGet;
  2878. MapCache.prototype.has = mapCacheHas;
  2879. MapCache.prototype.set = mapCacheSet;
  2880. //#endregion
  2881. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/memoize.js
  2882. /** Error message constants. */
  2883. var FUNC_ERROR_TEXT$2 = "Expected a function";
  2884. /**
  2885. * Creates a function that memoizes the result of `func`. If `resolver` is
  2886. * provided, it determines the cache key for storing the result based on the
  2887. * arguments provided to the memoized function. By default, the first argument
  2888. * provided to the memoized function is used as the map cache key. The `func`
  2889. * is invoked with the `this` binding of the memoized function.
  2890. *
  2891. * **Note:** The cache is exposed as the `cache` property on the memoized
  2892. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  2893. * constructor with one whose instances implement the
  2894. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  2895. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  2896. *
  2897. * @static
  2898. * @memberOf _
  2899. * @since 0.1.0
  2900. * @category Function
  2901. * @param {Function} func The function to have its output memoized.
  2902. * @param {Function} [resolver] The function to resolve the cache key.
  2903. * @returns {Function} Returns the new memoized function.
  2904. * @example
  2905. *
  2906. * var object = { 'a': 1, 'b': 2 };
  2907. * var other = { 'c': 3, 'd': 4 };
  2908. *
  2909. * var values = _.memoize(_.values);
  2910. * values(object);
  2911. * // => [1, 2]
  2912. *
  2913. * values(other);
  2914. * // => [3, 4]
  2915. *
  2916. * object.a = 2;
  2917. * values(object);
  2918. * // => [1, 2]
  2919. *
  2920. * // Modify the result cache.
  2921. * values.cache.set(object, ['a', 'b']);
  2922. * values(object);
  2923. * // => ['a', 'b']
  2924. *
  2925. * // Replace `_.memoize.Cache`.
  2926. * _.memoize.Cache = WeakMap;
  2927. */
  2928. function memoize(func, resolver) {
  2929. if (typeof func != "function" || resolver != null && typeof resolver != "function") throw new TypeError(FUNC_ERROR_TEXT$2);
  2930. var memoized = function() {
  2931. var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
  2932. if (cache.has(key)) return cache.get(key);
  2933. var result = func.apply(this, args);
  2934. memoized.cache = cache.set(key, result) || cache;
  2935. return result;
  2936. };
  2937. memoized.cache = new (memoize.Cache || MapCache)();
  2938. return memoized;
  2939. }
  2940. memoize.Cache = MapCache;
  2941. //#endregion
  2942. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_memoizeCapped.js
  2943. /** Used as the maximum memoize cache size. */
  2944. var MAX_MEMOIZE_SIZE = 500;
  2945. /**
  2946. * A specialized version of `_.memoize` which clears the memoized function's
  2947. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  2948. *
  2949. * @private
  2950. * @param {Function} func The function to have its output memoized.
  2951. * @returns {Function} Returns the new memoized function.
  2952. */
  2953. function memoizeCapped(func) {
  2954. var result = memoize(func, function(key) {
  2955. if (cache.size === MAX_MEMOIZE_SIZE) cache.clear();
  2956. return key;
  2957. });
  2958. var cache = result.cache;
  2959. return result;
  2960. }
  2961. //#endregion
  2962. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stringToPath.js
  2963. /** Used to match property names within property paths. */
  2964. var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  2965. /** Used to match backslashes in property paths. */
  2966. var reEscapeChar = /\\(\\)?/g;
  2967. /**
  2968. * Converts `string` to a property path array.
  2969. *
  2970. * @private
  2971. * @param {string} string The string to convert.
  2972. * @returns {Array} Returns the property path array.
  2973. */
  2974. var stringToPath = memoizeCapped(function(string) {
  2975. var result = [];
  2976. if (string.charCodeAt(0) === 46) result.push("");
  2977. string.replace(rePropName, function(match, number, quote, subString) {
  2978. result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
  2979. });
  2980. return result;
  2981. });
  2982. //#endregion
  2983. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toString.js
  2984. /**
  2985. * Converts `value` to a string. An empty string is returned for `null`
  2986. * and `undefined` values. The sign of `-0` is preserved.
  2987. *
  2988. * @static
  2989. * @memberOf _
  2990. * @since 4.0.0
  2991. * @category Lang
  2992. * @param {*} value The value to convert.
  2993. * @returns {string} Returns the converted string.
  2994. * @example
  2995. *
  2996. * _.toString(null);
  2997. * // => ''
  2998. *
  2999. * _.toString(-0);
  3000. * // => '-0'
  3001. *
  3002. * _.toString([1, 2, 3]);
  3003. * // => '1,2,3'
  3004. */
  3005. function toString(value) {
  3006. return value == null ? "" : baseToString(value);
  3007. }
  3008. //#endregion
  3009. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_castPath.js
  3010. /**
  3011. * Casts `value` to a path array if it's not one.
  3012. *
  3013. * @private
  3014. * @param {*} value The value to inspect.
  3015. * @param {Object} [object] The object to query keys on.
  3016. * @returns {Array} Returns the cast property path array.
  3017. */
  3018. function castPath(value, object) {
  3019. if (isArray(value)) return value;
  3020. return isKey(value, object) ? [value] : stringToPath(toString(value));
  3021. }
  3022. //#endregion
  3023. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_toKey.js
  3024. /** Used as references for various `Number` constants. */
  3025. var INFINITY$1 = Infinity;
  3026. /**
  3027. * Converts `value` to a string key if it's not a string or symbol.
  3028. *
  3029. * @private
  3030. * @param {*} value The value to inspect.
  3031. * @returns {string|symbol} Returns the key.
  3032. */
  3033. function toKey(value) {
  3034. if (typeof value == "string" || isSymbol(value)) return value;
  3035. var result = value + "";
  3036. return result == "0" && 1 / value == -INFINITY$1 ? "-0" : result;
  3037. }
  3038. //#endregion
  3039. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGet.js
  3040. /**
  3041. * The base implementation of `_.get` without support for default values.
  3042. *
  3043. * @private
  3044. * @param {Object} object The object to query.
  3045. * @param {Array|string} path The path of the property to get.
  3046. * @returns {*} Returns the resolved value.
  3047. */
  3048. function baseGet(object, path) {
  3049. path = castPath(path, object);
  3050. var index = 0, length = path.length;
  3051. while (object != null && index < length) object = object[toKey(path[index++])];
  3052. return index && index == length ? object : void 0;
  3053. }
  3054. //#endregion
  3055. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/get.js
  3056. /**
  3057. * Gets the value at `path` of `object`. If the resolved value is
  3058. * `undefined`, the `defaultValue` is returned in its place.
  3059. *
  3060. * @static
  3061. * @memberOf _
  3062. * @since 3.7.0
  3063. * @category Object
  3064. * @param {Object} object The object to query.
  3065. * @param {Array|string} path The path of the property to get.
  3066. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  3067. * @returns {*} Returns the resolved value.
  3068. * @example
  3069. *
  3070. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  3071. *
  3072. * _.get(object, 'a[0].b.c');
  3073. * // => 3
  3074. *
  3075. * _.get(object, ['a', '0', 'b', 'c']);
  3076. * // => 3
  3077. *
  3078. * _.get(object, 'a.b.c', 'default');
  3079. * // => 'default'
  3080. */
  3081. function get(object, path, defaultValue) {
  3082. var result = object == null ? void 0 : baseGet(object, path);
  3083. return result === void 0 ? defaultValue : result;
  3084. }
  3085. //#endregion
  3086. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayPush.js
  3087. /**
  3088. * Appends the elements of `values` to `array`.
  3089. *
  3090. * @private
  3091. * @param {Array} array The array to modify.
  3092. * @param {Array} values The values to append.
  3093. * @returns {Array} Returns `array`.
  3094. */
  3095. function arrayPush(array, values) {
  3096. var index = -1, length = values.length, offset = array.length;
  3097. while (++index < length) array[offset + index] = values[index];
  3098. return array;
  3099. }
  3100. //#endregion
  3101. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isFlattenable.js
  3102. /** Built-in value references. */
  3103. var spreadableSymbol = Symbol$1 ? Symbol$1.isConcatSpreadable : void 0;
  3104. /**
  3105. * Checks if `value` is a flattenable `arguments` object or array.
  3106. *
  3107. * @private
  3108. * @param {*} value The value to check.
  3109. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  3110. */
  3111. function isFlattenable(value) {
  3112. return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
  3113. }
  3114. //#endregion
  3115. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFlatten.js
  3116. /**
  3117. * The base implementation of `_.flatten` with support for restricting flattening.
  3118. *
  3119. * @private
  3120. * @param {Array} array The array to flatten.
  3121. * @param {number} depth The maximum recursion depth.
  3122. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3123. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3124. * @param {Array} [result=[]] The initial result value.
  3125. * @returns {Array} Returns the new flattened array.
  3126. */
  3127. function baseFlatten(array, depth, predicate, isStrict, result) {
  3128. var index = -1, length = array.length;
  3129. predicate || (predicate = isFlattenable);
  3130. result || (result = []);
  3131. while (++index < length) {
  3132. var value = array[index];
  3133. if (depth > 0 && predicate(value)) if (depth > 1) baseFlatten(value, depth - 1, predicate, isStrict, result);
  3134. else arrayPush(result, value);
  3135. else if (!isStrict) result[result.length] = value;
  3136. }
  3137. return result;
  3138. }
  3139. //#endregion
  3140. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flatten.js
  3141. /**
  3142. * Flattens `array` a single level deep.
  3143. *
  3144. * @static
  3145. * @memberOf _
  3146. * @since 0.1.0
  3147. * @category Array
  3148. * @param {Array} array The array to flatten.
  3149. * @returns {Array} Returns the new flattened array.
  3150. * @example
  3151. *
  3152. * _.flatten([1, [2, [3, [4]], 5]]);
  3153. * // => [1, 2, [3, [4]], 5]
  3154. */
  3155. function flatten(array) {
  3156. return (array == null ? 0 : array.length) ? baseFlatten(array, 1) : [];
  3157. }
  3158. //#endregion
  3159. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_flatRest.js
  3160. /**
  3161. * A specialized version of `baseRest` which flattens the rest array.
  3162. *
  3163. * @private
  3164. * @param {Function} func The function to apply a rest parameter to.
  3165. * @returns {Function} Returns the new function.
  3166. */
  3167. function flatRest(func) {
  3168. return setToString(overRest(func, void 0, flatten), func + "");
  3169. }
  3170. //#endregion
  3171. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getPrototype.js
  3172. /** Built-in value references. */
  3173. var getPrototype = overArg(Object.getPrototypeOf, Object);
  3174. //#endregion
  3175. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isPlainObject.js
  3176. /** `Object#toString` result references. */
  3177. var objectTag$3 = "[object Object]";
  3178. /** Used for built-in method references. */
  3179. var funcProto = Function.prototype, objectProto = Object.prototype;
  3180. /** Used to resolve the decompiled source of functions. */
  3181. var funcToString = funcProto.toString;
  3182. /** Used to check objects for own properties. */
  3183. var hasOwnProperty$4 = objectProto.hasOwnProperty;
  3184. /** Used to infer the `Object` constructor. */
  3185. var objectCtorString = funcToString.call(Object);
  3186. /**
  3187. * Checks if `value` is a plain object, that is, an object created by the
  3188. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  3189. *
  3190. * @static
  3191. * @memberOf _
  3192. * @since 0.8.0
  3193. * @category Lang
  3194. * @param {*} value The value to check.
  3195. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  3196. * @example
  3197. *
  3198. * function Foo() {
  3199. * this.a = 1;
  3200. * }
  3201. *
  3202. * _.isPlainObject(new Foo);
  3203. * // => false
  3204. *
  3205. * _.isPlainObject([1, 2, 3]);
  3206. * // => false
  3207. *
  3208. * _.isPlainObject({ 'x': 0, 'y': 0 });
  3209. * // => true
  3210. *
  3211. * _.isPlainObject(Object.create(null));
  3212. * // => true
  3213. */
  3214. function isPlainObject(value) {
  3215. if (!isObjectLike(value) || baseGetTag(value) != objectTag$3) return false;
  3216. var proto = getPrototype(value);
  3217. if (proto === null) return true;
  3218. var Ctor = hasOwnProperty$4.call(proto, "constructor") && proto.constructor;
  3219. return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
  3220. }
  3221. //#endregion
  3222. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSlice.js
  3223. /**
  3224. * The base implementation of `_.slice` without an iteratee call guard.
  3225. *
  3226. * @private
  3227. * @param {Array} array The array to slice.
  3228. * @param {number} [start=0] The start position.
  3229. * @param {number} [end=array.length] The end position.
  3230. * @returns {Array} Returns the slice of `array`.
  3231. */
  3232. function baseSlice(array, start, end) {
  3233. var index = -1, length = array.length;
  3234. if (start < 0) start = -start > length ? 0 : length + start;
  3235. end = end > length ? length : end;
  3236. if (end < 0) end += length;
  3237. length = start > end ? 0 : end - start >>> 0;
  3238. start >>>= 0;
  3239. var result = Array(length);
  3240. while (++index < length) result[index] = array[index + start];
  3241. return result;
  3242. }
  3243. //#endregion
  3244. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/castArray.js
  3245. /**
  3246. * Casts `value` as an array if it's not one.
  3247. *
  3248. * @static
  3249. * @memberOf _
  3250. * @since 4.4.0
  3251. * @category Lang
  3252. * @param {*} value The value to inspect.
  3253. * @returns {Array} Returns the cast array.
  3254. * @example
  3255. *
  3256. * _.castArray(1);
  3257. * // => [1]
  3258. *
  3259. * _.castArray({ 'a': 1 });
  3260. * // => [{ 'a': 1 }]
  3261. *
  3262. * _.castArray('abc');
  3263. * // => ['abc']
  3264. *
  3265. * _.castArray(null);
  3266. * // => [null]
  3267. *
  3268. * _.castArray(undefined);
  3269. * // => [undefined]
  3270. *
  3271. * _.castArray();
  3272. * // => []
  3273. *
  3274. * var array = [1, 2, 3];
  3275. * console.log(_.castArray(array) === array);
  3276. * // => true
  3277. */
  3278. function castArray$1() {
  3279. if (!arguments.length) return [];
  3280. var value = arguments[0];
  3281. return isArray(value) ? value : [value];
  3282. }
  3283. //#endregion
  3284. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseClamp.js
  3285. /**
  3286. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3287. *
  3288. * @private
  3289. * @param {number} number The number to clamp.
  3290. * @param {number} [lower] The lower bound.
  3291. * @param {number} upper The upper bound.
  3292. * @returns {number} Returns the clamped number.
  3293. */
  3294. function baseClamp(number, lower, upper) {
  3295. if (number === number) {
  3296. if (upper !== void 0) number = number <= upper ? number : upper;
  3297. if (lower !== void 0) number = number >= lower ? number : lower;
  3298. }
  3299. return number;
  3300. }
  3301. //#endregion
  3302. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/clamp.js
  3303. /**
  3304. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  3305. *
  3306. * @static
  3307. * @memberOf _
  3308. * @since 4.0.0
  3309. * @category Number
  3310. * @param {number} number The number to clamp.
  3311. * @param {number} [lower] The lower bound.
  3312. * @param {number} upper The upper bound.
  3313. * @returns {number} Returns the clamped number.
  3314. * @example
  3315. *
  3316. * _.clamp(-10, -5, 5);
  3317. * // => -5
  3318. *
  3319. * _.clamp(10, -5, 5);
  3320. * // => 5
  3321. */
  3322. function clamp$1(number, lower, upper) {
  3323. if (upper === void 0) {
  3324. upper = lower;
  3325. lower = void 0;
  3326. }
  3327. if (upper !== void 0) {
  3328. upper = toNumber(upper);
  3329. upper = upper === upper ? upper : 0;
  3330. }
  3331. if (lower !== void 0) {
  3332. lower = toNumber(lower);
  3333. lower = lower === lower ? lower : 0;
  3334. }
  3335. return baseClamp(toNumber(number), lower, upper);
  3336. }
  3337. //#endregion
  3338. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackClear.js
  3339. /**
  3340. * Removes all key-value entries from the stack.
  3341. *
  3342. * @private
  3343. * @name clear
  3344. * @memberOf Stack
  3345. */
  3346. function stackClear() {
  3347. this.__data__ = new ListCache();
  3348. this.size = 0;
  3349. }
  3350. //#endregion
  3351. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackDelete.js
  3352. /**
  3353. * Removes `key` and its value from the stack.
  3354. *
  3355. * @private
  3356. * @name delete
  3357. * @memberOf Stack
  3358. * @param {string} key The key of the value to remove.
  3359. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3360. */
  3361. function stackDelete(key) {
  3362. var data = this.__data__, result = data["delete"](key);
  3363. this.size = data.size;
  3364. return result;
  3365. }
  3366. //#endregion
  3367. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackGet.js
  3368. /**
  3369. * Gets the stack value for `key`.
  3370. *
  3371. * @private
  3372. * @name get
  3373. * @memberOf Stack
  3374. * @param {string} key The key of the value to get.
  3375. * @returns {*} Returns the entry value.
  3376. */
  3377. function stackGet(key) {
  3378. return this.__data__.get(key);
  3379. }
  3380. //#endregion
  3381. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackHas.js
  3382. /**
  3383. * Checks if a stack value for `key` exists.
  3384. *
  3385. * @private
  3386. * @name has
  3387. * @memberOf Stack
  3388. * @param {string} key The key of the entry to check.
  3389. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3390. */
  3391. function stackHas(key) {
  3392. return this.__data__.has(key);
  3393. }
  3394. //#endregion
  3395. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_stackSet.js
  3396. /** Used as the size to enable large array optimizations. */
  3397. var LARGE_ARRAY_SIZE$1 = 200;
  3398. /**
  3399. * Sets the stack `key` to `value`.
  3400. *
  3401. * @private
  3402. * @name set
  3403. * @memberOf Stack
  3404. * @param {string} key The key of the value to set.
  3405. * @param {*} value The value to set.
  3406. * @returns {Object} Returns the stack cache instance.
  3407. */
  3408. function stackSet(key, value) {
  3409. var data = this.__data__;
  3410. if (data instanceof ListCache) {
  3411. var pairs = data.__data__;
  3412. if (!Map$1 || pairs.length < LARGE_ARRAY_SIZE$1 - 1) {
  3413. pairs.push([key, value]);
  3414. this.size = ++data.size;
  3415. return this;
  3416. }
  3417. data = this.__data__ = new MapCache(pairs);
  3418. }
  3419. data.set(key, value);
  3420. this.size = data.size;
  3421. return this;
  3422. }
  3423. //#endregion
  3424. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Stack.js
  3425. /**
  3426. * Creates a stack cache object to store key-value pairs.
  3427. *
  3428. * @private
  3429. * @constructor
  3430. * @param {Array} [entries] The key-value pairs to cache.
  3431. */
  3432. function Stack(entries) {
  3433. this.size = (this.__data__ = new ListCache(entries)).size;
  3434. }
  3435. Stack.prototype.clear = stackClear;
  3436. Stack.prototype["delete"] = stackDelete;
  3437. Stack.prototype.get = stackGet;
  3438. Stack.prototype.has = stackHas;
  3439. Stack.prototype.set = stackSet;
  3440. //#endregion
  3441. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssign.js
  3442. /**
  3443. * The base implementation of `_.assign` without support for multiple sources
  3444. * or `customizer` functions.
  3445. *
  3446. * @private
  3447. * @param {Object} object The destination object.
  3448. * @param {Object} source The source object.
  3449. * @returns {Object} Returns `object`.
  3450. */
  3451. function baseAssign(object, source) {
  3452. return object && copyObject(source, keys(source), object);
  3453. }
  3454. //#endregion
  3455. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseAssignIn.js
  3456. /**
  3457. * The base implementation of `_.assignIn` without support for multiple sources
  3458. * or `customizer` functions.
  3459. *
  3460. * @private
  3461. * @param {Object} object The destination object.
  3462. * @param {Object} source The source object.
  3463. * @returns {Object} Returns `object`.
  3464. */
  3465. function baseAssignIn(object, source) {
  3466. return object && copyObject(source, keysIn(source), object);
  3467. }
  3468. //#endregion
  3469. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneBuffer.js
  3470. /** Detect free variable `exports`. */
  3471. var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  3472. /** Detect free variable `module`. */
  3473. var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
  3474. /** Built-in value references. */
  3475. var Buffer$1 = freeModule && freeModule.exports === freeExports ? root.Buffer : void 0, allocUnsafe = Buffer$1 ? Buffer$1.allocUnsafe : void 0;
  3476. /**
  3477. * Creates a clone of `buffer`.
  3478. *
  3479. * @private
  3480. * @param {Buffer} buffer The buffer to clone.
  3481. * @param {boolean} [isDeep] Specify a deep clone.
  3482. * @returns {Buffer} Returns the cloned buffer.
  3483. */
  3484. function cloneBuffer(buffer, isDeep) {
  3485. if (isDeep) return buffer.slice();
  3486. var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  3487. buffer.copy(result);
  3488. return result;
  3489. }
  3490. //#endregion
  3491. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayFilter.js
  3492. /**
  3493. * A specialized version of `_.filter` for arrays without support for
  3494. * iteratee shorthands.
  3495. *
  3496. * @private
  3497. * @param {Array} [array] The array to iterate over.
  3498. * @param {Function} predicate The function invoked per iteration.
  3499. * @returns {Array} Returns the new filtered array.
  3500. */
  3501. function arrayFilter(array, predicate) {
  3502. var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
  3503. while (++index < length) {
  3504. var value = array[index];
  3505. if (predicate(value, index, array)) result[resIndex++] = value;
  3506. }
  3507. return result;
  3508. }
  3509. //#endregion
  3510. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/stubArray.js
  3511. /**
  3512. * This method returns a new empty array.
  3513. *
  3514. * @static
  3515. * @memberOf _
  3516. * @since 4.13.0
  3517. * @category Util
  3518. * @returns {Array} Returns the new empty array.
  3519. * @example
  3520. *
  3521. * var arrays = _.times(2, _.stubArray);
  3522. *
  3523. * console.log(arrays);
  3524. * // => [[], []]
  3525. *
  3526. * console.log(arrays[0] === arrays[1]);
  3527. * // => false
  3528. */
  3529. function stubArray() {
  3530. return [];
  3531. }
  3532. //#endregion
  3533. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getSymbols.js
  3534. /** Built-in value references. */
  3535. var propertyIsEnumerable = Object.prototype.propertyIsEnumerable;
  3536. var nativeGetSymbols = Object.getOwnPropertySymbols;
  3537. /**
  3538. * Creates an array of the own enumerable symbols of `object`.
  3539. *
  3540. * @private
  3541. * @param {Object} object The object to query.
  3542. * @returns {Array} Returns the array of symbols.
  3543. */
  3544. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  3545. if (object == null) return [];
  3546. object = Object(object);
  3547. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  3548. return propertyIsEnumerable.call(object, symbol);
  3549. });
  3550. };
  3551. //#endregion
  3552. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copySymbols.js
  3553. /**
  3554. * Copies own symbols of `source` to `object`.
  3555. *
  3556. * @private
  3557. * @param {Object} source The object to copy symbols from.
  3558. * @param {Object} [object={}] The object to copy symbols to.
  3559. * @returns {Object} Returns `object`.
  3560. */
  3561. function copySymbols(source, object) {
  3562. return copyObject(source, getSymbols(source), object);
  3563. }
  3564. //#endregion
  3565. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getSymbolsIn.js
  3566. /**
  3567. * Creates an array of the own and inherited enumerable symbols of `object`.
  3568. *
  3569. * @private
  3570. * @param {Object} object The object to query.
  3571. * @returns {Array} Returns the array of symbols.
  3572. */
  3573. var getSymbolsIn = !Object.getOwnPropertySymbols ? stubArray : function(object) {
  3574. var result = [];
  3575. while (object) {
  3576. arrayPush(result, getSymbols(object));
  3577. object = getPrototype(object);
  3578. }
  3579. return result;
  3580. };
  3581. //#endregion
  3582. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_copySymbolsIn.js
  3583. /**
  3584. * Copies own and inherited symbols of `source` to `object`.
  3585. *
  3586. * @private
  3587. * @param {Object} source The object to copy symbols from.
  3588. * @param {Object} [object={}] The object to copy symbols to.
  3589. * @returns {Object} Returns `object`.
  3590. */
  3591. function copySymbolsIn(source, object) {
  3592. return copyObject(source, getSymbolsIn(source), object);
  3593. }
  3594. //#endregion
  3595. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseGetAllKeys.js
  3596. /**
  3597. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3598. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3599. * symbols of `object`.
  3600. *
  3601. * @private
  3602. * @param {Object} object The object to query.
  3603. * @param {Function} keysFunc The function to get the keys of `object`.
  3604. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3605. * @returns {Array} Returns the array of property names and symbols.
  3606. */
  3607. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3608. var result = keysFunc(object);
  3609. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3610. }
  3611. //#endregion
  3612. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeys.js
  3613. /**
  3614. * Creates an array of own enumerable property names and symbols of `object`.
  3615. *
  3616. * @private
  3617. * @param {Object} object The object to query.
  3618. * @returns {Array} Returns the array of property names and symbols.
  3619. */
  3620. function getAllKeys(object) {
  3621. return baseGetAllKeys(object, keys, getSymbols);
  3622. }
  3623. //#endregion
  3624. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getAllKeysIn.js
  3625. /**
  3626. * Creates an array of own and inherited enumerable property names and
  3627. * symbols of `object`.
  3628. *
  3629. * @private
  3630. * @param {Object} object The object to query.
  3631. * @returns {Array} Returns the array of property names and symbols.
  3632. */
  3633. function getAllKeysIn(object) {
  3634. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  3635. }
  3636. //#endregion
  3637. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_DataView.js
  3638. var DataView = getNative(root, "DataView");
  3639. //#endregion
  3640. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Promise.js
  3641. var Promise$1 = getNative(root, "Promise");
  3642. //#endregion
  3643. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Set.js
  3644. var Set$1 = getNative(root, "Set");
  3645. //#endregion
  3646. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getTag.js
  3647. /** `Object#toString` result references. */
  3648. var mapTag$4 = "[object Map]", objectTag$2 = "[object Object]", promiseTag = "[object Promise]", setTag$4 = "[object Set]", weakMapTag$1 = "[object WeakMap]";
  3649. var dataViewTag$3 = "[object DataView]";
  3650. /** Used to detect maps, sets, and weakmaps. */
  3651. var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map$1), promiseCtorString = toSource(Promise$1), setCtorString = toSource(Set$1), weakMapCtorString = toSource(WeakMap$1);
  3652. /**
  3653. * Gets the `toStringTag` of `value`.
  3654. *
  3655. * @private
  3656. * @param {*} value The value to query.
  3657. * @returns {string} Returns the `toStringTag`.
  3658. */
  3659. var getTag = baseGetTag;
  3660. if (DataView && getTag(new DataView(/* @__PURE__ */ new ArrayBuffer(1))) != dataViewTag$3 || Map$1 && getTag(new Map$1()) != mapTag$4 || Promise$1 && getTag(Promise$1.resolve()) != promiseTag || Set$1 && getTag(new Set$1()) != setTag$4 || WeakMap$1 && getTag(new WeakMap$1()) != weakMapTag$1) getTag = function(value) {
  3661. var result = baseGetTag(value), Ctor = result == objectTag$2 ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
  3662. if (ctorString) switch (ctorString) {
  3663. case dataViewCtorString: return dataViewTag$3;
  3664. case mapCtorString: return mapTag$4;
  3665. case promiseCtorString: return promiseTag;
  3666. case setCtorString: return setTag$4;
  3667. case weakMapCtorString: return weakMapTag$1;
  3668. }
  3669. return result;
  3670. };
  3671. var _getTag_default = getTag;
  3672. //#endregion
  3673. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneArray.js
  3674. /** Used to check objects for own properties. */
  3675. var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
  3676. /**
  3677. * Initializes an array clone.
  3678. *
  3679. * @private
  3680. * @param {Array} array The array to clone.
  3681. * @returns {Array} Returns the initialized clone.
  3682. */
  3683. function initCloneArray(array) {
  3684. var length = array.length, result = new array.constructor(length);
  3685. if (length && typeof array[0] == "string" && hasOwnProperty$3.call(array, "index")) {
  3686. result.index = array.index;
  3687. result.input = array.input;
  3688. }
  3689. return result;
  3690. }
  3691. //#endregion
  3692. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_Uint8Array.js
  3693. /** Built-in value references. */
  3694. var Uint8Array$1 = root.Uint8Array;
  3695. //#endregion
  3696. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneArrayBuffer.js
  3697. /**
  3698. * Creates a clone of `arrayBuffer`.
  3699. *
  3700. * @private
  3701. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  3702. * @returns {ArrayBuffer} Returns the cloned array buffer.
  3703. */
  3704. function cloneArrayBuffer(arrayBuffer) {
  3705. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  3706. new Uint8Array$1(result).set(new Uint8Array$1(arrayBuffer));
  3707. return result;
  3708. }
  3709. //#endregion
  3710. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneDataView.js
  3711. /**
  3712. * Creates a clone of `dataView`.
  3713. *
  3714. * @private
  3715. * @param {Object} dataView The data view to clone.
  3716. * @param {boolean} [isDeep] Specify a deep clone.
  3717. * @returns {Object} Returns the cloned data view.
  3718. */
  3719. function cloneDataView(dataView, isDeep) {
  3720. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  3721. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  3722. }
  3723. //#endregion
  3724. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneRegExp.js
  3725. /** Used to match `RegExp` flags from their coerced string values. */
  3726. var reFlags = /\w*$/;
  3727. /**
  3728. * Creates a clone of `regexp`.
  3729. *
  3730. * @private
  3731. * @param {Object} regexp The regexp to clone.
  3732. * @returns {Object} Returns the cloned regexp.
  3733. */
  3734. function cloneRegExp(regexp) {
  3735. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  3736. result.lastIndex = regexp.lastIndex;
  3737. return result;
  3738. }
  3739. //#endregion
  3740. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneSymbol.js
  3741. /** Used to convert symbols to primitives and strings. */
  3742. var symbolProto$1 = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf$1 = symbolProto$1 ? symbolProto$1.valueOf : void 0;
  3743. /**
  3744. * Creates a clone of the `symbol` object.
  3745. *
  3746. * @private
  3747. * @param {Object} symbol The symbol object to clone.
  3748. * @returns {Object} Returns the cloned symbol object.
  3749. */
  3750. function cloneSymbol(symbol) {
  3751. return symbolValueOf$1 ? Object(symbolValueOf$1.call(symbol)) : {};
  3752. }
  3753. //#endregion
  3754. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cloneTypedArray.js
  3755. /**
  3756. * Creates a clone of `typedArray`.
  3757. *
  3758. * @private
  3759. * @param {Object} typedArray The typed array to clone.
  3760. * @param {boolean} [isDeep] Specify a deep clone.
  3761. * @returns {Object} Returns the cloned typed array.
  3762. */
  3763. function cloneTypedArray(typedArray, isDeep) {
  3764. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  3765. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  3766. }
  3767. //#endregion
  3768. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneByTag.js
  3769. /** `Object#toString` result references. */
  3770. var boolTag$2 = "[object Boolean]", dateTag$2 = "[object Date]", mapTag$3 = "[object Map]", numberTag$2 = "[object Number]", regexpTag$2 = "[object RegExp]", setTag$3 = "[object Set]", stringTag$2 = "[object String]", symbolTag$2 = "[object Symbol]";
  3771. var arrayBufferTag$2 = "[object ArrayBuffer]", dataViewTag$2 = "[object DataView]", float32Tag$1 = "[object Float32Array]", float64Tag$1 = "[object Float64Array]", int8Tag$1 = "[object Int8Array]", int16Tag$1 = "[object Int16Array]", int32Tag$1 = "[object Int32Array]", uint8Tag$1 = "[object Uint8Array]", uint8ClampedTag$1 = "[object Uint8ClampedArray]", uint16Tag$1 = "[object Uint16Array]", uint32Tag$1 = "[object Uint32Array]";
  3772. /**
  3773. * Initializes an object clone based on its `toStringTag`.
  3774. *
  3775. * **Note:** This function only supports cloning values with tags of
  3776. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  3777. *
  3778. * @private
  3779. * @param {Object} object The object to clone.
  3780. * @param {string} tag The `toStringTag` of the object to clone.
  3781. * @param {boolean} [isDeep] Specify a deep clone.
  3782. * @returns {Object} Returns the initialized clone.
  3783. */
  3784. function initCloneByTag(object, tag, isDeep) {
  3785. var Ctor = object.constructor;
  3786. switch (tag) {
  3787. case arrayBufferTag$2: return cloneArrayBuffer(object);
  3788. case boolTag$2:
  3789. case dateTag$2: return new Ctor(+object);
  3790. case dataViewTag$2: return cloneDataView(object, isDeep);
  3791. case float32Tag$1:
  3792. case float64Tag$1:
  3793. case int8Tag$1:
  3794. case int16Tag$1:
  3795. case int32Tag$1:
  3796. case uint8Tag$1:
  3797. case uint8ClampedTag$1:
  3798. case uint16Tag$1:
  3799. case uint32Tag$1: return cloneTypedArray(object, isDeep);
  3800. case mapTag$3: return new Ctor();
  3801. case numberTag$2:
  3802. case stringTag$2: return new Ctor(object);
  3803. case regexpTag$2: return cloneRegExp(object);
  3804. case setTag$3: return new Ctor();
  3805. case symbolTag$2: return cloneSymbol(object);
  3806. }
  3807. }
  3808. //#endregion
  3809. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_initCloneObject.js
  3810. /**
  3811. * Initializes an object clone.
  3812. *
  3813. * @private
  3814. * @param {Object} object The object to clone.
  3815. * @returns {Object} Returns the initialized clone.
  3816. */
  3817. function initCloneObject(object) {
  3818. return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
  3819. }
  3820. //#endregion
  3821. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMap.js
  3822. /** `Object#toString` result references. */
  3823. var mapTag$2 = "[object Map]";
  3824. /**
  3825. * The base implementation of `_.isMap` without Node.js optimizations.
  3826. *
  3827. * @private
  3828. * @param {*} value The value to check.
  3829. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  3830. */
  3831. function baseIsMap(value) {
  3832. return isObjectLike(value) && _getTag_default(value) == mapTag$2;
  3833. }
  3834. //#endregion
  3835. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isMap.js
  3836. var nodeIsMap = nodeUtil && nodeUtil.isMap;
  3837. /**
  3838. * Checks if `value` is classified as a `Map` object.
  3839. *
  3840. * @static
  3841. * @memberOf _
  3842. * @since 4.3.0
  3843. * @category Lang
  3844. * @param {*} value The value to check.
  3845. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  3846. * @example
  3847. *
  3848. * _.isMap(new Map);
  3849. * // => true
  3850. *
  3851. * _.isMap(new WeakMap);
  3852. * // => false
  3853. */
  3854. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  3855. //#endregion
  3856. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsSet.js
  3857. /** `Object#toString` result references. */
  3858. var setTag$2 = "[object Set]";
  3859. /**
  3860. * The base implementation of `_.isSet` without Node.js optimizations.
  3861. *
  3862. * @private
  3863. * @param {*} value The value to check.
  3864. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  3865. */
  3866. function baseIsSet(value) {
  3867. return isObjectLike(value) && _getTag_default(value) == setTag$2;
  3868. }
  3869. //#endregion
  3870. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isSet.js
  3871. var nodeIsSet = nodeUtil && nodeUtil.isSet;
  3872. /**
  3873. * Checks if `value` is classified as a `Set` object.
  3874. *
  3875. * @static
  3876. * @memberOf _
  3877. * @since 4.3.0
  3878. * @category Lang
  3879. * @param {*} value The value to check.
  3880. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  3881. * @example
  3882. *
  3883. * _.isSet(new Set);
  3884. * // => true
  3885. *
  3886. * _.isSet(new WeakSet);
  3887. * // => false
  3888. */
  3889. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  3890. //#endregion
  3891. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseClone.js
  3892. /** Used to compose bitmasks for cloning. */
  3893. var CLONE_DEEP_FLAG$2 = 1, CLONE_FLAT_FLAG$1 = 2, CLONE_SYMBOLS_FLAG$2 = 4;
  3894. /** `Object#toString` result references. */
  3895. var argsTag$1 = "[object Arguments]", arrayTag$1 = "[object Array]", boolTag$1 = "[object Boolean]", dateTag$1 = "[object Date]", errorTag$1 = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag$1 = "[object Map]", numberTag$1 = "[object Number]", objectTag$1 = "[object Object]", regexpTag$1 = "[object RegExp]", setTag$1 = "[object Set]", stringTag$1 = "[object String]", symbolTag$1 = "[object Symbol]", weakMapTag = "[object WeakMap]";
  3896. var arrayBufferTag$1 = "[object ArrayBuffer]", dataViewTag$1 = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
  3897. /** Used to identify `toStringTag` values supported by `_.clone`. */
  3898. var cloneableTags = {};
  3899. cloneableTags[argsTag$1] = cloneableTags[arrayTag$1] = cloneableTags[arrayBufferTag$1] = cloneableTags[dataViewTag$1] = cloneableTags[boolTag$1] = cloneableTags[dateTag$1] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag$1] = cloneableTags[numberTag$1] = cloneableTags[objectTag$1] = cloneableTags[regexpTag$1] = cloneableTags[setTag$1] = cloneableTags[stringTag$1] = cloneableTags[symbolTag$1] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  3900. cloneableTags[errorTag$1] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
  3901. /**
  3902. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3903. * traversed objects.
  3904. *
  3905. * @private
  3906. * @param {*} value The value to clone.
  3907. * @param {boolean} bitmask The bitmask flags.
  3908. * 1 - Deep clone
  3909. * 2 - Flatten inherited properties
  3910. * 4 - Clone symbols
  3911. * @param {Function} [customizer] The function to customize cloning.
  3912. * @param {string} [key] The key of `value`.
  3913. * @param {Object} [object] The parent object of `value`.
  3914. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3915. * @returns {*} Returns the cloned value.
  3916. */
  3917. function baseClone(value, bitmask, customizer, key, object, stack) {
  3918. var result, isDeep = bitmask & CLONE_DEEP_FLAG$2, isFlat = bitmask & CLONE_FLAT_FLAG$1, isFull = bitmask & CLONE_SYMBOLS_FLAG$2;
  3919. if (customizer) result = object ? customizer(value, key, object, stack) : customizer(value);
  3920. if (result !== void 0) return result;
  3921. if (!isObject(value)) return value;
  3922. var isArr = isArray(value);
  3923. if (isArr) {
  3924. result = initCloneArray(value);
  3925. if (!isDeep) return copyArray(value, result);
  3926. } else {
  3927. var tag = _getTag_default(value), isFunc = tag == funcTag || tag == genTag;
  3928. if (isBuffer(value)) return cloneBuffer(value, isDeep);
  3929. if (tag == objectTag$1 || tag == argsTag$1 || isFunc && !object) {
  3930. result = isFlat || isFunc ? {} : initCloneObject(value);
  3931. if (!isDeep) return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
  3932. } else {
  3933. if (!cloneableTags[tag]) return object ? value : {};
  3934. result = initCloneByTag(value, tag, isDeep);
  3935. }
  3936. }
  3937. stack || (stack = new Stack());
  3938. var stacked = stack.get(value);
  3939. if (stacked) return stacked;
  3940. stack.set(value, result);
  3941. if (isSet(value)) value.forEach(function(subValue) {
  3942. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3943. });
  3944. else if (isMap(value)) value.forEach(function(subValue, key) {
  3945. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3946. });
  3947. var props = isArr ? void 0 : (isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys)(value);
  3948. arrayEach(props || value, function(subValue, key) {
  3949. if (props) {
  3950. key = subValue;
  3951. subValue = value[key];
  3952. }
  3953. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3954. });
  3955. return result;
  3956. }
  3957. //#endregion
  3958. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/cloneDeep.js
  3959. /** Used to compose bitmasks for cloning. */
  3960. var CLONE_DEEP_FLAG$1 = 1, CLONE_SYMBOLS_FLAG$1 = 4;
  3961. /**
  3962. * This method is like `_.clone` except that it recursively clones `value`.
  3963. *
  3964. * @static
  3965. * @memberOf _
  3966. * @since 1.0.0
  3967. * @category Lang
  3968. * @param {*} value The value to recursively clone.
  3969. * @returns {*} Returns the deep cloned value.
  3970. * @see _.clone
  3971. * @example
  3972. *
  3973. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  3974. *
  3975. * var deep = _.cloneDeep(objects);
  3976. * console.log(deep[0] === objects[0]);
  3977. * // => false
  3978. */
  3979. function cloneDeep(value) {
  3980. return baseClone(value, CLONE_DEEP_FLAG$1 | CLONE_SYMBOLS_FLAG$1);
  3981. }
  3982. //#endregion
  3983. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheAdd.js
  3984. /** Used to stand-in for `undefined` hash values. */
  3985. var HASH_UNDEFINED = "__lodash_hash_undefined__";
  3986. /**
  3987. * Adds `value` to the array cache.
  3988. *
  3989. * @private
  3990. * @name add
  3991. * @memberOf SetCache
  3992. * @alias push
  3993. * @param {*} value The value to cache.
  3994. * @returns {Object} Returns the cache instance.
  3995. */
  3996. function setCacheAdd(value) {
  3997. this.__data__.set(value, HASH_UNDEFINED);
  3998. return this;
  3999. }
  4000. //#endregion
  4001. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setCacheHas.js
  4002. /**
  4003. * Checks if `value` is in the array cache.
  4004. *
  4005. * @private
  4006. * @name has
  4007. * @memberOf SetCache
  4008. * @param {*} value The value to search for.
  4009. * @returns {number} Returns `true` if `value` is found, else `false`.
  4010. */
  4011. function setCacheHas(value) {
  4012. return this.__data__.has(value);
  4013. }
  4014. //#endregion
  4015. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_SetCache.js
  4016. /**
  4017. *
  4018. * Creates an array cache object to store unique values.
  4019. *
  4020. * @private
  4021. * @constructor
  4022. * @param {Array} [values] The values to cache.
  4023. */
  4024. function SetCache(values) {
  4025. var index = -1, length = values == null ? 0 : values.length;
  4026. this.__data__ = new MapCache();
  4027. while (++index < length) this.add(values[index]);
  4028. }
  4029. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  4030. SetCache.prototype.has = setCacheHas;
  4031. //#endregion
  4032. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arraySome.js
  4033. /**
  4034. * A specialized version of `_.some` for arrays without support for iteratee
  4035. * shorthands.
  4036. *
  4037. * @private
  4038. * @param {Array} [array] The array to iterate over.
  4039. * @param {Function} predicate The function invoked per iteration.
  4040. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4041. * else `false`.
  4042. */
  4043. function arraySome(array, predicate) {
  4044. var index = -1, length = array == null ? 0 : array.length;
  4045. while (++index < length) if (predicate(array[index], index, array)) return true;
  4046. return false;
  4047. }
  4048. //#endregion
  4049. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_cacheHas.js
  4050. /**
  4051. * Checks if a `cache` value for `key` exists.
  4052. *
  4053. * @private
  4054. * @param {Object} cache The cache to query.
  4055. * @param {string} key The key of the entry to check.
  4056. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  4057. */
  4058. function cacheHas(cache, key) {
  4059. return cache.has(key);
  4060. }
  4061. //#endregion
  4062. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalArrays.js
  4063. /** Used to compose bitmasks for value comparisons. */
  4064. var COMPARE_PARTIAL_FLAG$5 = 1, COMPARE_UNORDERED_FLAG$3 = 2;
  4065. /**
  4066. * A specialized version of `baseIsEqualDeep` for arrays with support for
  4067. * partial deep comparisons.
  4068. *
  4069. * @private
  4070. * @param {Array} array The array to compare.
  4071. * @param {Array} other The other array to compare.
  4072. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4073. * @param {Function} customizer The function to customize comparisons.
  4074. * @param {Function} equalFunc The function to determine equivalents of values.
  4075. * @param {Object} stack Tracks traversed `array` and `other` objects.
  4076. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  4077. */
  4078. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  4079. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5, arrLength = array.length, othLength = other.length;
  4080. if (arrLength != othLength && !(isPartial && othLength > arrLength)) return false;
  4081. var arrStacked = stack.get(array);
  4082. var othStacked = stack.get(other);
  4083. if (arrStacked && othStacked) return arrStacked == other && othStacked == array;
  4084. var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG$3 ? new SetCache() : void 0;
  4085. stack.set(array, other);
  4086. stack.set(other, array);
  4087. while (++index < arrLength) {
  4088. var arrValue = array[index], othValue = other[index];
  4089. if (customizer) var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
  4090. if (compared !== void 0) {
  4091. if (compared) continue;
  4092. result = false;
  4093. break;
  4094. }
  4095. if (seen) {
  4096. if (!arraySome(other, function(othValue, othIndex) {
  4097. if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) return seen.push(othIndex);
  4098. })) {
  4099. result = false;
  4100. break;
  4101. }
  4102. } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  4103. result = false;
  4104. break;
  4105. }
  4106. }
  4107. stack["delete"](array);
  4108. stack["delete"](other);
  4109. return result;
  4110. }
  4111. //#endregion
  4112. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_mapToArray.js
  4113. /**
  4114. * Converts `map` to its key-value pairs.
  4115. *
  4116. * @private
  4117. * @param {Object} map The map to convert.
  4118. * @returns {Array} Returns the key-value pairs.
  4119. */
  4120. function mapToArray(map) {
  4121. var index = -1, result = Array(map.size);
  4122. map.forEach(function(value, key) {
  4123. result[++index] = [key, value];
  4124. });
  4125. return result;
  4126. }
  4127. //#endregion
  4128. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_setToArray.js
  4129. /**
  4130. * Converts `set` to an array of its values.
  4131. *
  4132. * @private
  4133. * @param {Object} set The set to convert.
  4134. * @returns {Array} Returns the values.
  4135. */
  4136. function setToArray(set) {
  4137. var index = -1, result = Array(set.size);
  4138. set.forEach(function(value) {
  4139. result[++index] = value;
  4140. });
  4141. return result;
  4142. }
  4143. //#endregion
  4144. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalByTag.js
  4145. /** Used to compose bitmasks for value comparisons. */
  4146. var COMPARE_PARTIAL_FLAG$4 = 1, COMPARE_UNORDERED_FLAG$2 = 2;
  4147. /** `Object#toString` result references. */
  4148. var boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", mapTag = "[object Map]", numberTag = "[object Number]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]";
  4149. var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]";
  4150. /** Used to convert symbols to primitives and strings. */
  4151. var symbolProto = Symbol$1 ? Symbol$1.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
  4152. /**
  4153. * A specialized version of `baseIsEqualDeep` for comparing objects of
  4154. * the same `toStringTag`.
  4155. *
  4156. * **Note:** This function only supports comparing values with tags of
  4157. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  4158. *
  4159. * @private
  4160. * @param {Object} object The object to compare.
  4161. * @param {Object} other The other object to compare.
  4162. * @param {string} tag The `toStringTag` of the objects to compare.
  4163. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4164. * @param {Function} customizer The function to customize comparisons.
  4165. * @param {Function} equalFunc The function to determine equivalents of values.
  4166. * @param {Object} stack Tracks traversed `object` and `other` objects.
  4167. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4168. */
  4169. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  4170. switch (tag) {
  4171. case dataViewTag:
  4172. if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) return false;
  4173. object = object.buffer;
  4174. other = other.buffer;
  4175. case arrayBufferTag:
  4176. if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array$1(object), new Uint8Array$1(other))) return false;
  4177. return true;
  4178. case boolTag:
  4179. case dateTag:
  4180. case numberTag: return eq(+object, +other);
  4181. case errorTag: return object.name == other.name && object.message == other.message;
  4182. case regexpTag:
  4183. case stringTag: return object == other + "";
  4184. case mapTag: var convert = mapToArray;
  4185. case setTag:
  4186. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
  4187. convert || (convert = setToArray);
  4188. if (object.size != other.size && !isPartial) return false;
  4189. var stacked = stack.get(object);
  4190. if (stacked) return stacked == other;
  4191. bitmask |= COMPARE_UNORDERED_FLAG$2;
  4192. stack.set(object, other);
  4193. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  4194. stack["delete"](object);
  4195. return result;
  4196. case symbolTag: if (symbolValueOf) return symbolValueOf.call(object) == symbolValueOf.call(other);
  4197. }
  4198. return false;
  4199. }
  4200. //#endregion
  4201. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_equalObjects.js
  4202. /** Used to compose bitmasks for value comparisons. */
  4203. var COMPARE_PARTIAL_FLAG$3 = 1;
  4204. /** Used to check objects for own properties. */
  4205. var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
  4206. /**
  4207. * A specialized version of `baseIsEqualDeep` for objects with support for
  4208. * partial deep comparisons.
  4209. *
  4210. * @private
  4211. * @param {Object} object The object to compare.
  4212. * @param {Object} other The other object to compare.
  4213. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4214. * @param {Function} customizer The function to customize comparisons.
  4215. * @param {Function} equalFunc The function to determine equivalents of values.
  4216. * @param {Object} stack Tracks traversed `object` and `other` objects.
  4217. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4218. */
  4219. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  4220. var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3, objProps = getAllKeys(object), objLength = objProps.length;
  4221. if (objLength != getAllKeys(other).length && !isPartial) return false;
  4222. var index = objLength;
  4223. while (index--) {
  4224. var key = objProps[index];
  4225. if (!(isPartial ? key in other : hasOwnProperty$2.call(other, key))) return false;
  4226. }
  4227. var objStacked = stack.get(object);
  4228. var othStacked = stack.get(other);
  4229. if (objStacked && othStacked) return objStacked == other && othStacked == object;
  4230. var result = true;
  4231. stack.set(object, other);
  4232. stack.set(other, object);
  4233. var skipCtor = isPartial;
  4234. while (++index < objLength) {
  4235. key = objProps[index];
  4236. var objValue = object[key], othValue = other[key];
  4237. if (customizer) var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
  4238. if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
  4239. result = false;
  4240. break;
  4241. }
  4242. skipCtor || (skipCtor = key == "constructor");
  4243. }
  4244. if (result && !skipCtor) {
  4245. var objCtor = object.constructor, othCtor = other.constructor;
  4246. if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) result = false;
  4247. }
  4248. stack["delete"](object);
  4249. stack["delete"](other);
  4250. return result;
  4251. }
  4252. //#endregion
  4253. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqualDeep.js
  4254. /** Used to compose bitmasks for value comparisons. */
  4255. var COMPARE_PARTIAL_FLAG$2 = 1;
  4256. /** `Object#toString` result references. */
  4257. var argsTag = "[object Arguments]", arrayTag = "[object Array]", objectTag = "[object Object]";
  4258. /** Used to check objects for own properties. */
  4259. var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
  4260. /**
  4261. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4262. * deep comparisons and tracks traversed objects enabling objects with circular
  4263. * references to be compared.
  4264. *
  4265. * @private
  4266. * @param {Object} object The object to compare.
  4267. * @param {Object} other The other object to compare.
  4268. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4269. * @param {Function} customizer The function to customize comparisons.
  4270. * @param {Function} equalFunc The function to determine equivalents of values.
  4271. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4272. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4273. */
  4274. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4275. var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : _getTag_default(object), othTag = othIsArr ? arrayTag : _getTag_default(other);
  4276. objTag = objTag == argsTag ? objectTag : objTag;
  4277. othTag = othTag == argsTag ? objectTag : othTag;
  4278. var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
  4279. if (isSameTag && isBuffer(object)) {
  4280. if (!isBuffer(other)) return false;
  4281. objIsArr = true;
  4282. objIsObj = false;
  4283. }
  4284. if (isSameTag && !objIsObj) {
  4285. stack || (stack = new Stack());
  4286. return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4287. }
  4288. if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
  4289. var objIsWrapped = objIsObj && hasOwnProperty$1.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty$1.call(other, "__wrapped__");
  4290. if (objIsWrapped || othIsWrapped) {
  4291. var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
  4292. stack || (stack = new Stack());
  4293. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4294. }
  4295. }
  4296. if (!isSameTag) return false;
  4297. stack || (stack = new Stack());
  4298. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4299. }
  4300. //#endregion
  4301. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsEqual.js
  4302. /**
  4303. * The base implementation of `_.isEqual` which supports partial comparisons
  4304. * and tracks traversed objects.
  4305. *
  4306. * @private
  4307. * @param {*} value The value to compare.
  4308. * @param {*} other The other value to compare.
  4309. * @param {boolean} bitmask The bitmask flags.
  4310. * 1 - Unordered comparison
  4311. * 2 - Partial comparison
  4312. * @param {Function} [customizer] The function to customize comparisons.
  4313. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4314. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4315. */
  4316. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4317. if (value === other) return true;
  4318. if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) return value !== value && other !== other;
  4319. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4320. }
  4321. //#endregion
  4322. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIsMatch.js
  4323. /** Used to compose bitmasks for value comparisons. */
  4324. var COMPARE_PARTIAL_FLAG$1 = 1, COMPARE_UNORDERED_FLAG$1 = 2;
  4325. /**
  4326. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4327. *
  4328. * @private
  4329. * @param {Object} object The object to inspect.
  4330. * @param {Object} source The object of property values to match.
  4331. * @param {Array} matchData The property names, values, and compare flags to match.
  4332. * @param {Function} [customizer] The function to customize comparisons.
  4333. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4334. */
  4335. function baseIsMatch(object, source, matchData, customizer) {
  4336. var index = matchData.length, length = index, noCustomizer = !customizer;
  4337. if (object == null) return !length;
  4338. object = Object(object);
  4339. while (index--) {
  4340. var data = matchData[index];
  4341. if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) return false;
  4342. }
  4343. while (++index < length) {
  4344. data = matchData[index];
  4345. var key = data[0], objValue = object[key], srcValue = data[1];
  4346. if (noCustomizer && data[2]) {
  4347. if (objValue === void 0 && !(key in object)) return false;
  4348. } else {
  4349. var stack = new Stack();
  4350. if (customizer) var result = customizer(objValue, srcValue, key, object, source, stack);
  4351. if (!(result === void 0 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack) : result)) return false;
  4352. }
  4353. }
  4354. return true;
  4355. }
  4356. //#endregion
  4357. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_isStrictComparable.js
  4358. /**
  4359. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  4360. *
  4361. * @private
  4362. * @param {*} value The value to check.
  4363. * @returns {boolean} Returns `true` if `value` if suitable for strict
  4364. * equality comparisons, else `false`.
  4365. */
  4366. function isStrictComparable(value) {
  4367. return value === value && !isObject(value);
  4368. }
  4369. //#endregion
  4370. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_getMatchData.js
  4371. /**
  4372. * Gets the property names, values, and compare flags of `object`.
  4373. *
  4374. * @private
  4375. * @param {Object} object The object to query.
  4376. * @returns {Array} Returns the match data of `object`.
  4377. */
  4378. function getMatchData(object) {
  4379. var result = keys(object), length = result.length;
  4380. while (length--) {
  4381. var key = result[length], value = object[key];
  4382. result[length] = [
  4383. key,
  4384. value,
  4385. isStrictComparable(value)
  4386. ];
  4387. }
  4388. return result;
  4389. }
  4390. //#endregion
  4391. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_matchesStrictComparable.js
  4392. /**
  4393. * A specialized version of `matchesProperty` for source values suitable
  4394. * for strict equality comparisons, i.e. `===`.
  4395. *
  4396. * @private
  4397. * @param {string} key The key of the property to get.
  4398. * @param {*} srcValue The value to match.
  4399. * @returns {Function} Returns the new spec function.
  4400. */
  4401. function matchesStrictComparable(key, srcValue) {
  4402. return function(object) {
  4403. if (object == null) return false;
  4404. return object[key] === srcValue && (srcValue !== void 0 || key in Object(object));
  4405. };
  4406. }
  4407. //#endregion
  4408. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMatches.js
  4409. /**
  4410. * The base implementation of `_.matches` which doesn't clone `source`.
  4411. *
  4412. * @private
  4413. * @param {Object} source The object of property values to match.
  4414. * @returns {Function} Returns the new spec function.
  4415. */
  4416. function baseMatches(source) {
  4417. var matchData = getMatchData(source);
  4418. if (matchData.length == 1 && matchData[0][2]) return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4419. return function(object) {
  4420. return object === source || baseIsMatch(object, source, matchData);
  4421. };
  4422. }
  4423. //#endregion
  4424. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseHasIn.js
  4425. /**
  4426. * The base implementation of `_.hasIn` without support for deep paths.
  4427. *
  4428. * @private
  4429. * @param {Object} [object] The object to query.
  4430. * @param {Array|string} key The key to check.
  4431. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4432. */
  4433. function baseHasIn(object, key) {
  4434. return object != null && key in Object(object);
  4435. }
  4436. //#endregion
  4437. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_hasPath.js
  4438. /**
  4439. * Checks if `path` exists on `object`.
  4440. *
  4441. * @private
  4442. * @param {Object} object The object to query.
  4443. * @param {Array|string} path The path to check.
  4444. * @param {Function} hasFunc The function to check properties.
  4445. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  4446. */
  4447. function hasPath(object, path, hasFunc) {
  4448. path = castPath(path, object);
  4449. var index = -1, length = path.length, result = false;
  4450. while (++index < length) {
  4451. var key = toKey(path[index]);
  4452. if (!(result = object != null && hasFunc(object, key))) break;
  4453. object = object[key];
  4454. }
  4455. if (result || ++index != length) return result;
  4456. length = object == null ? 0 : object.length;
  4457. return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
  4458. }
  4459. //#endregion
  4460. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/hasIn.js
  4461. /**
  4462. * Checks if `path` is a direct or inherited property of `object`.
  4463. *
  4464. * @static
  4465. * @memberOf _
  4466. * @since 4.0.0
  4467. * @category Object
  4468. * @param {Object} object The object to query.
  4469. * @param {Array|string} path The path to check.
  4470. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  4471. * @example
  4472. *
  4473. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  4474. *
  4475. * _.hasIn(object, 'a');
  4476. * // => true
  4477. *
  4478. * _.hasIn(object, 'a.b');
  4479. * // => true
  4480. *
  4481. * _.hasIn(object, ['a', 'b']);
  4482. * // => true
  4483. *
  4484. * _.hasIn(object, 'b');
  4485. * // => false
  4486. */
  4487. function hasIn(object, path) {
  4488. return object != null && hasPath(object, path, baseHasIn);
  4489. }
  4490. //#endregion
  4491. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMatchesProperty.js
  4492. /** Used to compose bitmasks for value comparisons. */
  4493. var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
  4494. /**
  4495. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4496. *
  4497. * @private
  4498. * @param {string} path The path of the property to get.
  4499. * @param {*} srcValue The value to match.
  4500. * @returns {Function} Returns the new spec function.
  4501. */
  4502. function baseMatchesProperty(path, srcValue) {
  4503. if (isKey(path) && isStrictComparable(srcValue)) return matchesStrictComparable(toKey(path), srcValue);
  4504. return function(object) {
  4505. var objValue = get(object, path);
  4506. return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4507. };
  4508. }
  4509. //#endregion
  4510. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseProperty.js
  4511. /**
  4512. * The base implementation of `_.property` without support for deep paths.
  4513. *
  4514. * @private
  4515. * @param {string} key The key of the property to get.
  4516. * @returns {Function} Returns the new accessor function.
  4517. */
  4518. function baseProperty(key) {
  4519. return function(object) {
  4520. return object == null ? void 0 : object[key];
  4521. };
  4522. }
  4523. //#endregion
  4524. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePropertyDeep.js
  4525. /**
  4526. * A specialized version of `baseProperty` which supports deep paths.
  4527. *
  4528. * @private
  4529. * @param {Array|string} path The path of the property to get.
  4530. * @returns {Function} Returns the new accessor function.
  4531. */
  4532. function basePropertyDeep(path) {
  4533. return function(object) {
  4534. return baseGet(object, path);
  4535. };
  4536. }
  4537. //#endregion
  4538. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/property.js
  4539. /**
  4540. * Creates a function that returns the value at `path` of a given object.
  4541. *
  4542. * @static
  4543. * @memberOf _
  4544. * @since 2.4.0
  4545. * @category Util
  4546. * @param {Array|string} path The path of the property to get.
  4547. * @returns {Function} Returns the new accessor function.
  4548. * @example
  4549. *
  4550. * var objects = [
  4551. * { 'a': { 'b': 2 } },
  4552. * { 'a': { 'b': 1 } }
  4553. * ];
  4554. *
  4555. * _.map(objects, _.property('a.b'));
  4556. * // => [2, 1]
  4557. *
  4558. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  4559. * // => [1, 2]
  4560. */
  4561. function property(path) {
  4562. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  4563. }
  4564. //#endregion
  4565. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseIteratee.js
  4566. /**
  4567. * The base implementation of `_.iteratee`.
  4568. *
  4569. * @private
  4570. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4571. * @returns {Function} Returns the iteratee.
  4572. */
  4573. function baseIteratee(value) {
  4574. if (typeof value == "function") return value;
  4575. if (value == null) return identity;
  4576. if (typeof value == "object") return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
  4577. return property(value);
  4578. }
  4579. //#endregion
  4580. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createBaseFor.js
  4581. /**
  4582. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  4583. *
  4584. * @private
  4585. * @param {boolean} [fromRight] Specify iterating from right to left.
  4586. * @returns {Function} Returns the new base function.
  4587. */
  4588. function createBaseFor(fromRight) {
  4589. return function(object, iteratee, keysFunc) {
  4590. var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
  4591. while (length--) {
  4592. var key = props[fromRight ? length : ++index];
  4593. if (iteratee(iterable[key], key, iterable) === false) break;
  4594. }
  4595. return object;
  4596. };
  4597. }
  4598. //#endregion
  4599. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseFor.js
  4600. /**
  4601. * The base implementation of `baseForOwn` which iterates over `object`
  4602. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4603. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4604. *
  4605. * @private
  4606. * @param {Object} object The object to iterate over.
  4607. * @param {Function} iteratee The function invoked per iteration.
  4608. * @param {Function} keysFunc The function to get the keys of `object`.
  4609. * @returns {Object} Returns `object`.
  4610. */
  4611. var baseFor = createBaseFor();
  4612. //#endregion
  4613. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseForOwn.js
  4614. /**
  4615. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4616. *
  4617. * @private
  4618. * @param {Object} object The object to iterate over.
  4619. * @param {Function} iteratee The function invoked per iteration.
  4620. * @returns {Object} Returns `object`.
  4621. */
  4622. function baseForOwn(object, iteratee) {
  4623. return object && baseFor(object, iteratee, keys);
  4624. }
  4625. //#endregion
  4626. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createBaseEach.js
  4627. /**
  4628. * Creates a `baseEach` or `baseEachRight` function.
  4629. *
  4630. * @private
  4631. * @param {Function} eachFunc The function to iterate over a collection.
  4632. * @param {boolean} [fromRight] Specify iterating from right to left.
  4633. * @returns {Function} Returns the new base function.
  4634. */
  4635. function createBaseEach(eachFunc, fromRight) {
  4636. return function(collection, iteratee) {
  4637. if (collection == null) return collection;
  4638. if (!isArrayLike(collection)) return eachFunc(collection, iteratee);
  4639. var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
  4640. while (fromRight ? index-- : ++index < length) if (iteratee(iterable[index], index, iterable) === false) break;
  4641. return collection;
  4642. };
  4643. }
  4644. //#endregion
  4645. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseEach.js
  4646. /**
  4647. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4648. *
  4649. * @private
  4650. * @param {Array|Object} collection The collection to iterate over.
  4651. * @param {Function} iteratee The function invoked per iteration.
  4652. * @returns {Array|Object} Returns `collection`.
  4653. */
  4654. var baseEach = createBaseEach(baseForOwn);
  4655. //#endregion
  4656. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/now.js
  4657. /**
  4658. * Gets the timestamp of the number of milliseconds that have elapsed since
  4659. * the Unix epoch (1 January 1970 00:00:00 UTC).
  4660. *
  4661. * @static
  4662. * @memberOf _
  4663. * @since 2.4.0
  4664. * @category Date
  4665. * @returns {number} Returns the timestamp.
  4666. * @example
  4667. *
  4668. * _.defer(function(stamp) {
  4669. * console.log(_.now() - stamp);
  4670. * }, _.now());
  4671. * // => Logs the number of milliseconds it took for the deferred invocation.
  4672. */
  4673. var now = function() {
  4674. return root.Date.now();
  4675. };
  4676. //#endregion
  4677. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/debounce.js
  4678. /** Error message constants. */
  4679. var FUNC_ERROR_TEXT$1 = "Expected a function";
  4680. var nativeMax$1 = Math.max, nativeMin$1 = Math.min;
  4681. /**
  4682. * Creates a debounced function that delays invoking `func` until after `wait`
  4683. * milliseconds have elapsed since the last time the debounced function was
  4684. * invoked. The debounced function comes with a `cancel` method to cancel
  4685. * delayed `func` invocations and a `flush` method to immediately invoke them.
  4686. * Provide `options` to indicate whether `func` should be invoked on the
  4687. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  4688. * with the last arguments provided to the debounced function. Subsequent
  4689. * calls to the debounced function return the result of the last `func`
  4690. * invocation.
  4691. *
  4692. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  4693. * invoked on the trailing edge of the timeout only if the debounced function
  4694. * is invoked more than once during the `wait` timeout.
  4695. *
  4696. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  4697. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  4698. *
  4699. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  4700. * for details over the differences between `_.debounce` and `_.throttle`.
  4701. *
  4702. * @static
  4703. * @memberOf _
  4704. * @since 0.1.0
  4705. * @category Function
  4706. * @param {Function} func The function to debounce.
  4707. * @param {number} [wait=0] The number of milliseconds to delay.
  4708. * @param {Object} [options={}] The options object.
  4709. * @param {boolean} [options.leading=false]
  4710. * Specify invoking on the leading edge of the timeout.
  4711. * @param {number} [options.maxWait]
  4712. * The maximum time `func` is allowed to be delayed before it's invoked.
  4713. * @param {boolean} [options.trailing=true]
  4714. * Specify invoking on the trailing edge of the timeout.
  4715. * @returns {Function} Returns the new debounced function.
  4716. * @example
  4717. *
  4718. * // Avoid costly calculations while the window size is in flux.
  4719. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  4720. *
  4721. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  4722. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  4723. * 'leading': true,
  4724. * 'trailing': false
  4725. * }));
  4726. *
  4727. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  4728. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  4729. * var source = new EventSource('/stream');
  4730. * jQuery(source).on('message', debounced);
  4731. *
  4732. * // Cancel the trailing debounced invocation.
  4733. * jQuery(window).on('popstate', debounced.cancel);
  4734. */
  4735. function debounce(func, wait, options) {
  4736. var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
  4737. if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT$1);
  4738. wait = toNumber(wait) || 0;
  4739. if (isObject(options)) {
  4740. leading = !!options.leading;
  4741. maxing = "maxWait" in options;
  4742. maxWait = maxing ? nativeMax$1(toNumber(options.maxWait) || 0, wait) : maxWait;
  4743. trailing = "trailing" in options ? !!options.trailing : trailing;
  4744. }
  4745. function invokeFunc(time) {
  4746. var args = lastArgs, thisArg = lastThis;
  4747. lastArgs = lastThis = void 0;
  4748. lastInvokeTime = time;
  4749. result = func.apply(thisArg, args);
  4750. return result;
  4751. }
  4752. function leadingEdge(time) {
  4753. lastInvokeTime = time;
  4754. timerId = setTimeout(timerExpired, wait);
  4755. return leading ? invokeFunc(time) : result;
  4756. }
  4757. function remainingWait(time) {
  4758. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
  4759. return maxing ? nativeMin$1(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
  4760. }
  4761. function shouldInvoke(time) {
  4762. var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
  4763. return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
  4764. }
  4765. function timerExpired() {
  4766. var time = now();
  4767. if (shouldInvoke(time)) return trailingEdge(time);
  4768. timerId = setTimeout(timerExpired, remainingWait(time));
  4769. }
  4770. function trailingEdge(time) {
  4771. timerId = void 0;
  4772. if (trailing && lastArgs) return invokeFunc(time);
  4773. lastArgs = lastThis = void 0;
  4774. return result;
  4775. }
  4776. function cancel() {
  4777. if (timerId !== void 0) clearTimeout(timerId);
  4778. lastInvokeTime = 0;
  4779. lastArgs = lastCallTime = lastThis = timerId = void 0;
  4780. }
  4781. function flush() {
  4782. return timerId === void 0 ? result : trailingEdge(now());
  4783. }
  4784. function debounced() {
  4785. var time = now(), isInvoking = shouldInvoke(time);
  4786. lastArgs = arguments;
  4787. lastThis = this;
  4788. lastCallTime = time;
  4789. if (isInvoking) {
  4790. if (timerId === void 0) return leadingEdge(lastCallTime);
  4791. if (maxing) {
  4792. clearTimeout(timerId);
  4793. timerId = setTimeout(timerExpired, wait);
  4794. return invokeFunc(lastCallTime);
  4795. }
  4796. }
  4797. if (timerId === void 0) timerId = setTimeout(timerExpired, wait);
  4798. return result;
  4799. }
  4800. debounced.cancel = cancel;
  4801. debounced.flush = flush;
  4802. return debounced;
  4803. }
  4804. //#endregion
  4805. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_assignMergeValue.js
  4806. /**
  4807. * This function is like `assignValue` except that it doesn't assign
  4808. * `undefined` values.
  4809. *
  4810. * @private
  4811. * @param {Object} object The object to modify.
  4812. * @param {string} key The key of the property to assign.
  4813. * @param {*} value The value to assign.
  4814. */
  4815. function assignMergeValue(object, key, value) {
  4816. if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
  4817. }
  4818. //#endregion
  4819. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isArrayLikeObject.js
  4820. /**
  4821. * This method is like `_.isArrayLike` except that it also checks if `value`
  4822. * is an object.
  4823. *
  4824. * @static
  4825. * @memberOf _
  4826. * @since 4.0.0
  4827. * @category Lang
  4828. * @param {*} value The value to check.
  4829. * @returns {boolean} Returns `true` if `value` is an array-like object,
  4830. * else `false`.
  4831. * @example
  4832. *
  4833. * _.isArrayLikeObject([1, 2, 3]);
  4834. * // => true
  4835. *
  4836. * _.isArrayLikeObject(document.body.children);
  4837. * // => true
  4838. *
  4839. * _.isArrayLikeObject('abc');
  4840. * // => false
  4841. *
  4842. * _.isArrayLikeObject(_.noop);
  4843. * // => false
  4844. */
  4845. function isArrayLikeObject(value) {
  4846. return isObjectLike(value) && isArrayLike(value);
  4847. }
  4848. //#endregion
  4849. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_safeGet.js
  4850. /**
  4851. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  4852. *
  4853. * @private
  4854. * @param {Object} object The object to query.
  4855. * @param {string} key The key of the property to get.
  4856. * @returns {*} Returns the property value.
  4857. */
  4858. function safeGet(object, key) {
  4859. if (key === "constructor" && typeof object[key] === "function") return;
  4860. if (key == "__proto__") return;
  4861. return object[key];
  4862. }
  4863. //#endregion
  4864. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/toPlainObject.js
  4865. /**
  4866. * Converts `value` to a plain object flattening inherited enumerable string
  4867. * keyed properties of `value` to own properties of the plain object.
  4868. *
  4869. * @static
  4870. * @memberOf _
  4871. * @since 3.0.0
  4872. * @category Lang
  4873. * @param {*} value The value to convert.
  4874. * @returns {Object} Returns the converted plain object.
  4875. * @example
  4876. *
  4877. * function Foo() {
  4878. * this.b = 2;
  4879. * }
  4880. *
  4881. * Foo.prototype.c = 3;
  4882. *
  4883. * _.assign({ 'a': 1 }, new Foo);
  4884. * // => { 'a': 1, 'b': 2 }
  4885. *
  4886. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  4887. * // => { 'a': 1, 'b': 2, 'c': 3 }
  4888. */
  4889. function toPlainObject(value) {
  4890. return copyObject(value, keysIn(value));
  4891. }
  4892. //#endregion
  4893. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMergeDeep.js
  4894. /**
  4895. * A specialized version of `baseMerge` for arrays and objects which performs
  4896. * deep merges and tracks traversed objects enabling objects with circular
  4897. * references to be merged.
  4898. *
  4899. * @private
  4900. * @param {Object} object The destination object.
  4901. * @param {Object} source The source object.
  4902. * @param {string} key The key of the value to merge.
  4903. * @param {number} srcIndex The index of `source`.
  4904. * @param {Function} mergeFunc The function to merge values.
  4905. * @param {Function} [customizer] The function to customize assigned values.
  4906. * @param {Object} [stack] Tracks traversed source values and their merged
  4907. * counterparts.
  4908. */
  4909. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4910. var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
  4911. if (stacked) {
  4912. assignMergeValue(object, key, stacked);
  4913. return;
  4914. }
  4915. var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
  4916. var isCommon = newValue === void 0;
  4917. if (isCommon) {
  4918. var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4919. newValue = srcValue;
  4920. if (isArr || isBuff || isTyped) if (isArray(objValue)) newValue = objValue;
  4921. else if (isArrayLikeObject(objValue)) newValue = copyArray(objValue);
  4922. else if (isBuff) {
  4923. isCommon = false;
  4924. newValue = cloneBuffer(srcValue, true);
  4925. } else if (isTyped) {
  4926. isCommon = false;
  4927. newValue = cloneTypedArray(srcValue, true);
  4928. } else newValue = [];
  4929. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4930. newValue = objValue;
  4931. if (isArguments(objValue)) newValue = toPlainObject(objValue);
  4932. else if (!isObject(objValue) || isFunction(objValue)) newValue = initCloneObject(srcValue);
  4933. } else isCommon = false;
  4934. }
  4935. if (isCommon) {
  4936. stack.set(srcValue, newValue);
  4937. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4938. stack["delete"](srcValue);
  4939. }
  4940. assignMergeValue(object, key, newValue);
  4941. }
  4942. //#endregion
  4943. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMerge.js
  4944. /**
  4945. * The base implementation of `_.merge` without support for multiple sources.
  4946. *
  4947. * @private
  4948. * @param {Object} object The destination object.
  4949. * @param {Object} source The source object.
  4950. * @param {number} srcIndex The index of `source`.
  4951. * @param {Function} [customizer] The function to customize merged values.
  4952. * @param {Object} [stack] Tracks traversed source values and their merged
  4953. * counterparts.
  4954. */
  4955. function baseMerge(object, source, srcIndex, customizer, stack) {
  4956. if (object === source) return;
  4957. baseFor(source, function(srcValue, key) {
  4958. stack || (stack = new Stack());
  4959. if (isObject(srcValue)) baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4960. else {
  4961. var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
  4962. if (newValue === void 0) newValue = srcValue;
  4963. assignMergeValue(object, key, newValue);
  4964. }
  4965. }, keysIn);
  4966. }
  4967. //#endregion
  4968. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_arrayIncludesWith.js
  4969. /**
  4970. * This function is like `arrayIncludes` except that it accepts a comparator.
  4971. *
  4972. * @private
  4973. * @param {Array} [array] The array to inspect.
  4974. * @param {*} target The value to search for.
  4975. * @param {Function} comparator The comparator invoked per element.
  4976. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  4977. */
  4978. function arrayIncludesWith(array, value, comparator) {
  4979. var index = -1, length = array == null ? 0 : array.length;
  4980. while (++index < length) if (comparator(value, array[index])) return true;
  4981. return false;
  4982. }
  4983. //#endregion
  4984. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/last.js
  4985. /**
  4986. * Gets the last element of `array`.
  4987. *
  4988. * @static
  4989. * @memberOf _
  4990. * @since 0.1.0
  4991. * @category Array
  4992. * @param {Array} array The array to query.
  4993. * @returns {*} Returns the last element of `array`.
  4994. * @example
  4995. *
  4996. * _.last([1, 2, 3]);
  4997. * // => 3
  4998. */
  4999. function last(array) {
  5000. var length = array == null ? 0 : array.length;
  5001. return length ? array[length - 1] : void 0;
  5002. }
  5003. //#endregion
  5004. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/findLastIndex.js
  5005. var nativeMax = Math.max, nativeMin = Math.min;
  5006. /**
  5007. * This method is like `_.findIndex` except that it iterates over elements
  5008. * of `collection` from right to left.
  5009. *
  5010. * @static
  5011. * @memberOf _
  5012. * @since 2.0.0
  5013. * @category Array
  5014. * @param {Array} array The array to inspect.
  5015. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  5016. * @param {number} [fromIndex=array.length-1] The index to search from.
  5017. * @returns {number} Returns the index of the found element, else `-1`.
  5018. * @example
  5019. *
  5020. * var users = [
  5021. * { 'user': 'barney', 'active': true },
  5022. * { 'user': 'fred', 'active': false },
  5023. * { 'user': 'pebbles', 'active': false }
  5024. * ];
  5025. *
  5026. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  5027. * // => 2
  5028. *
  5029. * // The `_.matches` iteratee shorthand.
  5030. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  5031. * // => 0
  5032. *
  5033. * // The `_.matchesProperty` iteratee shorthand.
  5034. * _.findLastIndex(users, ['active', false]);
  5035. * // => 2
  5036. *
  5037. * // The `_.property` iteratee shorthand.
  5038. * _.findLastIndex(users, 'active');
  5039. * // => 0
  5040. */
  5041. function findLastIndex(array, predicate, fromIndex) {
  5042. var length = array == null ? 0 : array.length;
  5043. if (!length) return -1;
  5044. var index = length - 1;
  5045. if (fromIndex !== void 0) {
  5046. index = toInteger(fromIndex);
  5047. index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  5048. }
  5049. return baseFindIndex(array, baseIteratee(predicate, 3), index, true);
  5050. }
  5051. //#endregion
  5052. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseMap.js
  5053. /**
  5054. * The base implementation of `_.map` without support for iteratee shorthands.
  5055. *
  5056. * @private
  5057. * @param {Array|Object} collection The collection to iterate over.
  5058. * @param {Function} iteratee The function invoked per iteration.
  5059. * @returns {Array} Returns the new mapped array.
  5060. */
  5061. function baseMap(collection, iteratee) {
  5062. var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
  5063. baseEach(collection, function(value, key, collection) {
  5064. result[++index] = iteratee(value, key, collection);
  5065. });
  5066. return result;
  5067. }
  5068. //#endregion
  5069. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/map.js
  5070. /**
  5071. * Creates an array of values by running each element in `collection` thru
  5072. * `iteratee`. The iteratee is invoked with three arguments:
  5073. * (value, index|key, collection).
  5074. *
  5075. * Many lodash methods are guarded to work as iteratees for methods like
  5076. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  5077. *
  5078. * The guarded methods are:
  5079. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  5080. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  5081. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  5082. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  5083. *
  5084. * @static
  5085. * @memberOf _
  5086. * @since 0.1.0
  5087. * @category Collection
  5088. * @param {Array|Object} collection The collection to iterate over.
  5089. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  5090. * @returns {Array} Returns the new mapped array.
  5091. * @example
  5092. *
  5093. * function square(n) {
  5094. * return n * n;
  5095. * }
  5096. *
  5097. * _.map([4, 8], square);
  5098. * // => [16, 64]
  5099. *
  5100. * _.map({ 'a': 4, 'b': 8 }, square);
  5101. * // => [16, 64] (iteration order is not guaranteed)
  5102. *
  5103. * var users = [
  5104. * { 'user': 'barney' },
  5105. * { 'user': 'fred' }
  5106. * ];
  5107. *
  5108. * // The `_.property` iteratee shorthand.
  5109. * _.map(users, 'user');
  5110. * // => ['barney', 'fred']
  5111. */
  5112. function map(collection, iteratee) {
  5113. return (isArray(collection) ? arrayMap : baseMap)(collection, baseIteratee(iteratee, 3));
  5114. }
  5115. //#endregion
  5116. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flatMap.js
  5117. /**
  5118. * Creates a flattened array of values by running each element in `collection`
  5119. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  5120. * with three arguments: (value, index|key, collection).
  5121. *
  5122. * @static
  5123. * @memberOf _
  5124. * @since 4.0.0
  5125. * @category Collection
  5126. * @param {Array|Object} collection The collection to iterate over.
  5127. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  5128. * @returns {Array} Returns the new flattened array.
  5129. * @example
  5130. *
  5131. * function duplicate(n) {
  5132. * return [n, n];
  5133. * }
  5134. *
  5135. * _.flatMap([1, 2], duplicate);
  5136. * // => [1, 1, 2, 2]
  5137. */
  5138. function flatMap(collection, iteratee) {
  5139. return baseFlatten(map(collection, iteratee), 1);
  5140. }
  5141. //#endregion
  5142. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/flattenDeep.js
  5143. /** Used as references for various `Number` constants. */
  5144. var INFINITY = Infinity;
  5145. /**
  5146. * Recursively flattens `array`.
  5147. *
  5148. * @static
  5149. * @memberOf _
  5150. * @since 3.0.0
  5151. * @category Array
  5152. * @param {Array} array The array to flatten.
  5153. * @returns {Array} Returns the new flattened array.
  5154. * @example
  5155. *
  5156. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  5157. * // => [1, 2, 3, 4, 5]
  5158. */
  5159. function flattenDeep(array) {
  5160. return (array == null ? 0 : array.length) ? baseFlatten(array, INFINITY) : [];
  5161. }
  5162. //#endregion
  5163. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/fromPairs.js
  5164. /**
  5165. * The inverse of `_.toPairs`; this method returns an object composed
  5166. * from key-value `pairs`.
  5167. *
  5168. * @static
  5169. * @memberOf _
  5170. * @since 4.0.0
  5171. * @category Array
  5172. * @param {Array} pairs The key-value pairs.
  5173. * @returns {Object} Returns the new object.
  5174. * @example
  5175. *
  5176. * _.fromPairs([['a', 1], ['b', 2]]);
  5177. * // => { 'a': 1, 'b': 2 }
  5178. */
  5179. function fromPairs(pairs) {
  5180. var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
  5181. while (++index < length) {
  5182. var pair = pairs[index];
  5183. result[pair[0]] = pair[1];
  5184. }
  5185. return result;
  5186. }
  5187. //#endregion
  5188. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_parent.js
  5189. /**
  5190. * Gets the parent value at `path` of `object`.
  5191. *
  5192. * @private
  5193. * @param {Object} object The object to query.
  5194. * @param {Array} path The path to get the parent value of.
  5195. * @returns {*} Returns the parent value.
  5196. */
  5197. function parent(object, path) {
  5198. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  5199. }
  5200. //#endregion
  5201. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isEqual.js
  5202. /**
  5203. * Performs a deep comparison between two values to determine if they are
  5204. * equivalent.
  5205. *
  5206. * **Note:** This method supports comparing arrays, array buffers, booleans,
  5207. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  5208. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  5209. * by their own, not inherited, enumerable properties. Functions and DOM
  5210. * nodes are compared by strict equality, i.e. `===`.
  5211. *
  5212. * @static
  5213. * @memberOf _
  5214. * @since 0.1.0
  5215. * @category Lang
  5216. * @param {*} value The value to compare.
  5217. * @param {*} other The other value to compare.
  5218. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  5219. * @example
  5220. *
  5221. * var object = { 'a': 1 };
  5222. * var other = { 'a': 1 };
  5223. *
  5224. * _.isEqual(object, other);
  5225. * // => true
  5226. *
  5227. * object === other;
  5228. * // => false
  5229. */
  5230. function isEqual$1(value, other) {
  5231. return baseIsEqual(value, other);
  5232. }
  5233. //#endregion
  5234. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isNil.js
  5235. /**
  5236. * Checks if `value` is `null` or `undefined`.
  5237. *
  5238. * @static
  5239. * @memberOf _
  5240. * @since 4.0.0
  5241. * @category Lang
  5242. * @param {*} value The value to check.
  5243. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  5244. * @example
  5245. *
  5246. * _.isNil(null);
  5247. * // => true
  5248. *
  5249. * _.isNil(void 0);
  5250. * // => true
  5251. *
  5252. * _.isNil(NaN);
  5253. * // => false
  5254. */
  5255. function isNil(value) {
  5256. return value == null;
  5257. }
  5258. //#endregion
  5259. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isNull.js
  5260. /**
  5261. * Checks if `value` is `null`.
  5262. *
  5263. * @static
  5264. * @memberOf _
  5265. * @since 0.1.0
  5266. * @category Lang
  5267. * @param {*} value The value to check.
  5268. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  5269. * @example
  5270. *
  5271. * _.isNull(null);
  5272. * // => true
  5273. *
  5274. * _.isNull(void 0);
  5275. * // => false
  5276. */
  5277. function isNull(value) {
  5278. return value === null;
  5279. }
  5280. //#endregion
  5281. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/isUndefined.js
  5282. /**
  5283. * Checks if `value` is `undefined`.
  5284. *
  5285. * @static
  5286. * @since 0.1.0
  5287. * @memberOf _
  5288. * @category Lang
  5289. * @param {*} value The value to check.
  5290. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  5291. * @example
  5292. *
  5293. * _.isUndefined(void 0);
  5294. * // => true
  5295. *
  5296. * _.isUndefined(null);
  5297. * // => false
  5298. */
  5299. function isUndefined$1(value) {
  5300. return value === void 0;
  5301. }
  5302. //#endregion
  5303. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/merge.js
  5304. /**
  5305. * This method is like `_.assign` except that it recursively merges own and
  5306. * inherited enumerable string keyed properties of source objects into the
  5307. * destination object. Source properties that resolve to `undefined` are
  5308. * skipped if a destination value exists. Array and plain object properties
  5309. * are merged recursively. Other objects and value types are overridden by
  5310. * assignment. Source objects are applied from left to right. Subsequent
  5311. * sources overwrite property assignments of previous sources.
  5312. *
  5313. * **Note:** This method mutates `object`.
  5314. *
  5315. * @static
  5316. * @memberOf _
  5317. * @since 0.5.0
  5318. * @category Object
  5319. * @param {Object} object The destination object.
  5320. * @param {...Object} [sources] The source objects.
  5321. * @returns {Object} Returns `object`.
  5322. * @example
  5323. *
  5324. * var object = {
  5325. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  5326. * };
  5327. *
  5328. * var other = {
  5329. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  5330. * };
  5331. *
  5332. * _.merge(object, other);
  5333. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  5334. */
  5335. var merge = createAssigner(function(object, source, srcIndex) {
  5336. baseMerge(object, source, srcIndex);
  5337. });
  5338. //#endregion
  5339. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUnset.js
  5340. /** Used to check objects for own properties. */
  5341. var hasOwnProperty = Object.prototype.hasOwnProperty;
  5342. /**
  5343. * The base implementation of `_.unset`.
  5344. *
  5345. * @private
  5346. * @param {Object} object The object to modify.
  5347. * @param {Array|string} path The property path to unset.
  5348. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5349. */
  5350. function baseUnset(object, path) {
  5351. path = castPath(path, object);
  5352. var index = -1, length = path.length;
  5353. if (!length) return true;
  5354. var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
  5355. while (++index < length) {
  5356. var key = path[index];
  5357. if (typeof key !== "string") continue;
  5358. if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) return false;
  5359. if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
  5360. if (isRootPrimitive && index === 0) continue;
  5361. return false;
  5362. }
  5363. }
  5364. var obj = parent(object, path);
  5365. return obj == null || delete obj[toKey(last(path))];
  5366. }
  5367. //#endregion
  5368. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_customOmitClone.js
  5369. /**
  5370. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  5371. * objects.
  5372. *
  5373. * @private
  5374. * @param {*} value The value to inspect.
  5375. * @param {string} key The key of the property to inspect.
  5376. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  5377. */
  5378. function customOmitClone(value) {
  5379. return isPlainObject(value) ? void 0 : value;
  5380. }
  5381. //#endregion
  5382. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/omit.js
  5383. /** Used to compose bitmasks for cloning. */
  5384. var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
  5385. /**
  5386. * The opposite of `_.pick`; this method creates an object composed of the
  5387. * own and inherited enumerable property paths of `object` that are not omitted.
  5388. *
  5389. * **Note:** This method is considerably slower than `_.pick`.
  5390. *
  5391. * @static
  5392. * @since 0.1.0
  5393. * @memberOf _
  5394. * @category Object
  5395. * @param {Object} object The source object.
  5396. * @param {...(string|string[])} [paths] The property paths to omit.
  5397. * @returns {Object} Returns the new object.
  5398. * @example
  5399. *
  5400. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  5401. *
  5402. * _.omit(object, ['a', 'c']);
  5403. * // => { 'b': '2' }
  5404. */
  5405. var omit = flatRest(function(object, paths) {
  5406. var result = {};
  5407. if (object == null) return result;
  5408. var isDeep = false;
  5409. paths = arrayMap(paths, function(path) {
  5410. path = castPath(path, object);
  5411. isDeep || (isDeep = path.length > 1);
  5412. return path;
  5413. });
  5414. copyObject(object, getAllKeysIn(object), result);
  5415. if (isDeep) result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  5416. var length = paths.length;
  5417. while (length--) baseUnset(result, paths[length]);
  5418. return result;
  5419. });
  5420. //#endregion
  5421. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseSet.js
  5422. /**
  5423. * The base implementation of `_.set`.
  5424. *
  5425. * @private
  5426. * @param {Object} object The object to modify.
  5427. * @param {Array|string} path The path of the property to set.
  5428. * @param {*} value The value to set.
  5429. * @param {Function} [customizer] The function to customize path creation.
  5430. * @returns {Object} Returns `object`.
  5431. */
  5432. function baseSet(object, path, value, customizer) {
  5433. if (!isObject(object)) return object;
  5434. path = castPath(path, object);
  5435. var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  5436. while (nested != null && ++index < length) {
  5437. var key = toKey(path[index]), newValue = value;
  5438. if (key === "__proto__" || key === "constructor" || key === "prototype") return object;
  5439. if (index != lastIndex) {
  5440. var objValue = nested[key];
  5441. newValue = customizer ? customizer(objValue, key, nested) : void 0;
  5442. if (newValue === void 0) newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
  5443. }
  5444. assignValue(nested, key, newValue);
  5445. nested = nested[key];
  5446. }
  5447. return object;
  5448. }
  5449. //#endregion
  5450. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePickBy.js
  5451. /**
  5452. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5453. *
  5454. * @private
  5455. * @param {Object} object The source object.
  5456. * @param {string[]} paths The property paths to pick.
  5457. * @param {Function} predicate The function invoked per property.
  5458. * @returns {Object} Returns the new object.
  5459. */
  5460. function basePickBy(object, paths, predicate) {
  5461. var index = -1, length = paths.length, result = {};
  5462. while (++index < length) {
  5463. var path = paths[index], value = baseGet(object, path);
  5464. if (predicate(value, path)) baseSet(result, castPath(path, object), value);
  5465. }
  5466. return result;
  5467. }
  5468. //#endregion
  5469. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_basePick.js
  5470. /**
  5471. * The base implementation of `_.pick` without support for individual
  5472. * property identifiers.
  5473. *
  5474. * @private
  5475. * @param {Object} object The source object.
  5476. * @param {string[]} paths The property paths to pick.
  5477. * @returns {Object} Returns the new object.
  5478. */
  5479. function basePick(object, paths) {
  5480. return basePickBy(object, paths, function(value, path) {
  5481. return hasIn(object, path);
  5482. });
  5483. }
  5484. //#endregion
  5485. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/pick.js
  5486. /**
  5487. * Creates an object composed of the picked `object` properties.
  5488. *
  5489. * @static
  5490. * @since 0.1.0
  5491. * @memberOf _
  5492. * @category Object
  5493. * @param {Object} object The source object.
  5494. * @param {...(string|string[])} [paths] The property paths to pick.
  5495. * @returns {Object} Returns the new object.
  5496. * @example
  5497. *
  5498. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  5499. *
  5500. * _.pick(object, ['a', 'c']);
  5501. * // => { 'a': 1, 'c': 3 }
  5502. */
  5503. var pick = flatRest(function(object, paths) {
  5504. return object == null ? {} : basePick(object, paths);
  5505. });
  5506. //#endregion
  5507. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/set.js
  5508. /**
  5509. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  5510. * it's created. Arrays are created for missing index properties while objects
  5511. * are created for all other missing properties. Use `_.setWith` to customize
  5512. * `path` creation.
  5513. *
  5514. * **Note:** This method mutates `object`.
  5515. *
  5516. * @static
  5517. * @memberOf _
  5518. * @since 3.7.0
  5519. * @category Object
  5520. * @param {Object} object The object to modify.
  5521. * @param {Array|string} path The path of the property to set.
  5522. * @param {*} value The value to set.
  5523. * @returns {Object} Returns `object`.
  5524. * @example
  5525. *
  5526. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  5527. *
  5528. * _.set(object, 'a[0].b.c', 4);
  5529. * console.log(object.a[0].b.c);
  5530. * // => 4
  5531. *
  5532. * _.set(object, ['x', '0', 'y', 'z'], 5);
  5533. * console.log(object.x[0].y.z);
  5534. * // => 5
  5535. */
  5536. function set(object, path, value) {
  5537. return object == null ? object : baseSet(object, path, value);
  5538. }
  5539. //#endregion
  5540. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/throttle.js
  5541. /** Error message constants. */
  5542. var FUNC_ERROR_TEXT = "Expected a function";
  5543. /**
  5544. * Creates a throttled function that only invokes `func` at most once per
  5545. * every `wait` milliseconds. The throttled function comes with a `cancel`
  5546. * method to cancel delayed `func` invocations and a `flush` method to
  5547. * immediately invoke them. Provide `options` to indicate whether `func`
  5548. * should be invoked on the leading and/or trailing edge of the `wait`
  5549. * timeout. The `func` is invoked with the last arguments provided to the
  5550. * throttled function. Subsequent calls to the throttled function return the
  5551. * result of the last `func` invocation.
  5552. *
  5553. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  5554. * invoked on the trailing edge of the timeout only if the throttled function
  5555. * is invoked more than once during the `wait` timeout.
  5556. *
  5557. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  5558. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  5559. *
  5560. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  5561. * for details over the differences between `_.throttle` and `_.debounce`.
  5562. *
  5563. * @static
  5564. * @memberOf _
  5565. * @since 0.1.0
  5566. * @category Function
  5567. * @param {Function} func The function to throttle.
  5568. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  5569. * @param {Object} [options={}] The options object.
  5570. * @param {boolean} [options.leading=true]
  5571. * Specify invoking on the leading edge of the timeout.
  5572. * @param {boolean} [options.trailing=true]
  5573. * Specify invoking on the trailing edge of the timeout.
  5574. * @returns {Function} Returns the new throttled function.
  5575. * @example
  5576. *
  5577. * // Avoid excessively updating the position while scrolling.
  5578. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  5579. *
  5580. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  5581. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  5582. * jQuery(element).on('click', throttled);
  5583. *
  5584. * // Cancel the trailing throttled invocation.
  5585. * jQuery(window).on('popstate', throttled.cancel);
  5586. */
  5587. function throttle(func, wait, options) {
  5588. var leading = true, trailing = true;
  5589. if (typeof func != "function") throw new TypeError(FUNC_ERROR_TEXT);
  5590. if (isObject(options)) {
  5591. leading = "leading" in options ? !!options.leading : leading;
  5592. trailing = "trailing" in options ? !!options.trailing : trailing;
  5593. }
  5594. return debounce(func, wait, {
  5595. "leading": leading,
  5596. "maxWait": wait,
  5597. "trailing": trailing
  5598. });
  5599. }
  5600. //#endregion
  5601. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_createSet.js
  5602. /**
  5603. * Creates a set object of `values`.
  5604. *
  5605. * @private
  5606. * @param {Array} values The values to add to the set.
  5607. * @returns {Object} Returns the new set.
  5608. */
  5609. var createSet = !(Set$1 && 1 / setToArray(new Set$1([, -0]))[1] == Infinity) ? noop : function(values) {
  5610. return new Set$1(values);
  5611. };
  5612. //#endregion
  5613. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/_baseUniq.js
  5614. /** Used as the size to enable large array optimizations. */
  5615. var LARGE_ARRAY_SIZE = 200;
  5616. /**
  5617. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5618. *
  5619. * @private
  5620. * @param {Array} array The array to inspect.
  5621. * @param {Function} [iteratee] The iteratee invoked per element.
  5622. * @param {Function} [comparator] The comparator invoked per element.
  5623. * @returns {Array} Returns the new duplicate free array.
  5624. */
  5625. function baseUniq(array, iteratee, comparator) {
  5626. var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
  5627. if (comparator) {
  5628. isCommon = false;
  5629. includes = arrayIncludesWith;
  5630. } else if (length >= LARGE_ARRAY_SIZE) {
  5631. var set = iteratee ? null : createSet(array);
  5632. if (set) return setToArray(set);
  5633. isCommon = false;
  5634. includes = cacheHas;
  5635. seen = new SetCache();
  5636. } else seen = iteratee ? [] : result;
  5637. outer: while (++index < length) {
  5638. var value = array[index], computed = iteratee ? iteratee(value) : value;
  5639. value = comparator || value !== 0 ? value : 0;
  5640. if (isCommon && computed === computed) {
  5641. var seenIndex = seen.length;
  5642. while (seenIndex--) if (seen[seenIndex] === computed) continue outer;
  5643. if (iteratee) seen.push(computed);
  5644. result.push(value);
  5645. } else if (!includes(seen, computed, comparator)) {
  5646. if (seen !== result) seen.push(computed);
  5647. result.push(value);
  5648. }
  5649. }
  5650. return result;
  5651. }
  5652. //#endregion
  5653. //#region ../../node_modules/.pnpm/lodash-es@4.17.23/node_modules/lodash-es/union.js
  5654. /**
  5655. * Creates an array of unique values, in order, from all given arrays using
  5656. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  5657. * for equality comparisons.
  5658. *
  5659. * @static
  5660. * @memberOf _
  5661. * @since 0.1.0
  5662. * @category Array
  5663. * @param {...Array} [arrays] The arrays to inspect.
  5664. * @returns {Array} Returns the new array of combined values.
  5665. * @example
  5666. *
  5667. * _.union([2], [1, 2]);
  5668. * // => [2, 1]
  5669. */
  5670. var union = baseRest(function(arrays) {
  5671. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  5672. });
  5673. //#endregion
  5674. //#region ../../packages/utils/types.ts
  5675. const isUndefined = (val) => val === void 0;
  5676. const isBoolean = (val) => typeof val === "boolean";
  5677. const isNumber = (val) => typeof val === "number";
  5678. const isEmpty = (val) => !val && val !== 0 || isArray$1(val) && val.length === 0 || isObject$1(val) && !Object.keys(val).length;
  5679. const isElement$1 = (e) => {
  5680. if (typeof Element === "undefined") return false;
  5681. return e instanceof Element;
  5682. };
  5683. const isPropAbsent = (prop) => isNil(prop);
  5684. const isStringNumber = (val) => {
  5685. if (!isString(val)) return false;
  5686. return !Number.isNaN(Number(val));
  5687. };
  5688. const isWindow = (val) => val === window;
  5689. //#endregion
  5690. //#region ../../packages/utils/raf.ts
  5691. const rAF = (fn) => isClient ? window.requestAnimationFrame(fn) : setTimeout(fn, 16);
  5692. const cAF = (handle) => isClient ? window.cancelAnimationFrame(handle) : clearTimeout(handle);
  5693. //#endregion
  5694. //#region ../../packages/utils/strings.ts
  5695. /**
  5696. * fork from {@link https://github.com/sindresorhus/escape-string-regexp}
  5697. */
  5698. const escapeStringRegexp = (string = "") => string.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
  5699. const capitalize = (str) => capitalize$1(str);
  5700. //#endregion
  5701. //#region ../../packages/utils/objects.ts
  5702. const keysOf = (arr) => Object.keys(arr);
  5703. const entriesOf = (arr) => Object.entries(arr);
  5704. const getProp = (obj, path, defaultValue) => {
  5705. return {
  5706. get value() {
  5707. return get(obj, path, defaultValue);
  5708. },
  5709. set value(val) {
  5710. set(obj, path, val);
  5711. }
  5712. };
  5713. };
  5714. //#endregion
  5715. //#region ../../packages/utils/error.ts
  5716. var ElementPlusError = class extends Error {
  5717. constructor(m) {
  5718. super(m);
  5719. this.name = "ElementPlusError";
  5720. }
  5721. };
  5722. function throwError(scope, m) {
  5723. throw new ElementPlusError(`[${scope}] ${m}`);
  5724. }
  5725. function debugWarn(scope, message) {}
  5726. //#endregion
  5727. //#region ../../packages/utils/dom/style.ts
  5728. const SCOPE$9 = "utils/dom/style";
  5729. const classNameToArray = (cls = "") => cls.split(" ").filter((item) => !!item.trim());
  5730. const hasClass = (el, cls) => {
  5731. if (!el || !cls) return false;
  5732. if (cls.includes(" ")) throw new Error("className should not contain space.");
  5733. return el.classList.contains(cls);
  5734. };
  5735. const addClass = (el, cls) => {
  5736. if (!el || !cls.trim()) return;
  5737. el.classList.add(...classNameToArray(cls));
  5738. };
  5739. const removeClass = (el, cls) => {
  5740. if (!el || !cls.trim()) return;
  5741. el.classList.remove(...classNameToArray(cls));
  5742. };
  5743. const getStyle = (element, styleName) => {
  5744. if (!isClient || !element || !styleName || isShadowRoot$1(element)) return "";
  5745. let key = camelize(styleName);
  5746. if (key === "float") key = "cssFloat";
  5747. try {
  5748. const style = element.style[key];
  5749. if (style) return style;
  5750. const computed = document.defaultView?.getComputedStyle(element, "");
  5751. return computed ? computed[key] : "";
  5752. } catch {
  5753. return element.style[key];
  5754. }
  5755. };
  5756. const setStyle = (element, styleName, value) => {
  5757. if (!element || !styleName) return;
  5758. if (isObject$1(styleName)) entriesOf(styleName).forEach(([prop, value]) => setStyle(element, prop, value));
  5759. else {
  5760. const key = camelize(styleName);
  5761. element.style[key] = value;
  5762. }
  5763. };
  5764. function addUnit(value, defaultUnit = "px") {
  5765. if (!value && value !== 0) return "";
  5766. if (isNumber(value) || isStringNumber(value)) return `${value}${defaultUnit}`;
  5767. else if (isString(value)) return value;
  5768. /* @__PURE__ */ debugWarn(SCOPE$9, "binding value must be a string or number");
  5769. }
  5770. //#endregion
  5771. //#region ../../packages/utils/dom/scroll.ts
  5772. const isScroll = (el, isVertical) => {
  5773. if (!isClient) return false;
  5774. const key = {
  5775. undefined: "overflow",
  5776. true: "overflow-y",
  5777. false: "overflow-x"
  5778. }[String(isVertical)];
  5779. const overflow = getStyle(el, key);
  5780. return [
  5781. "scroll",
  5782. "auto",
  5783. "overlay"
  5784. ].some((s) => overflow.includes(s));
  5785. };
  5786. const getScrollContainer = (el, isVertical) => {
  5787. if (!isClient) return;
  5788. let parent = el;
  5789. while (parent) {
  5790. if ([
  5791. window,
  5792. document,
  5793. document.documentElement
  5794. ].includes(parent)) return window;
  5795. if (isScroll(parent, isVertical)) return parent;
  5796. if (isShadowRoot$1(parent)) parent = parent.host;
  5797. else parent = parent.parentNode;
  5798. }
  5799. return parent;
  5800. };
  5801. let scrollBarWidth;
  5802. const getScrollBarWidth = (namespace) => {
  5803. if (!isClient) return 0;
  5804. if (scrollBarWidth !== void 0) return scrollBarWidth;
  5805. const outer = document.createElement("div");
  5806. outer.className = `${namespace}-scrollbar__wrap`;
  5807. outer.style.visibility = "hidden";
  5808. outer.style.width = "100px";
  5809. outer.style.position = "absolute";
  5810. outer.style.top = "-9999px";
  5811. document.body.appendChild(outer);
  5812. const widthNoScroll = outer.offsetWidth;
  5813. outer.style.overflow = "scroll";
  5814. const inner = document.createElement("div");
  5815. inner.style.width = "100%";
  5816. outer.appendChild(inner);
  5817. const widthWithScroll = inner.offsetWidth;
  5818. outer.parentNode?.removeChild(outer);
  5819. scrollBarWidth = widthNoScroll - widthWithScroll;
  5820. return scrollBarWidth;
  5821. };
  5822. /**
  5823. * Scroll with in the container element, positioning the **selected** element at the top
  5824. * of the container
  5825. */
  5826. function scrollIntoView(container, selected) {
  5827. if (!isClient) return;
  5828. if (!selected) {
  5829. container.scrollTop = 0;
  5830. return;
  5831. }
  5832. const offsetParents = [];
  5833. let pointer = selected.offsetParent;
  5834. while (pointer !== null && container !== pointer && container.contains(pointer)) {
  5835. offsetParents.push(pointer);
  5836. pointer = pointer.offsetParent;
  5837. }
  5838. const top = selected.offsetTop + offsetParents.reduce((prev, curr) => prev + curr.offsetTop, 0);
  5839. const bottom = top + selected.offsetHeight;
  5840. const viewRectTop = container.scrollTop;
  5841. const viewRectBottom = viewRectTop + container.clientHeight;
  5842. if (top < viewRectTop) container.scrollTop = top;
  5843. else if (bottom > viewRectBottom) container.scrollTop = bottom - container.clientHeight;
  5844. }
  5845. function animateScrollTo(container, from, to, duration, callback) {
  5846. const startTime = Date.now();
  5847. let handle;
  5848. const scroll = () => {
  5849. const time = Date.now() - startTime;
  5850. const nextScrollTop = easeInOutCubic(time > duration ? duration : time, from, to, duration);
  5851. if (isWindow(container)) container.scrollTo(window.pageXOffset, nextScrollTop);
  5852. else container.scrollTop = nextScrollTop;
  5853. if (time < duration) handle = rAF(scroll);
  5854. else if (isFunction$1(callback)) callback();
  5855. };
  5856. scroll();
  5857. return () => {
  5858. handle && cAF(handle);
  5859. };
  5860. }
  5861. const getScrollElement = (target, container) => {
  5862. if (isWindow(container)) return target.ownerDocument.documentElement;
  5863. return container;
  5864. };
  5865. const getScrollTop = (container) => {
  5866. if (isWindow(container)) return window.scrollY;
  5867. return container.scrollTop;
  5868. };
  5869. //#endregion
  5870. //#region ../../packages/utils/dom/element.ts
  5871. const getElement = ((target) => {
  5872. if (!isClient || target === "") return null;
  5873. if (isString(target)) try {
  5874. return document.querySelector(target);
  5875. } catch {
  5876. return null;
  5877. }
  5878. return target;
  5879. });
  5880. //#endregion
  5881. //#region ../../packages/utils/vue/global-node.ts
  5882. const globalNodes = [];
  5883. let target = !isClient ? void 0 : document.body;
  5884. function createGlobalNode(id) {
  5885. const el = document.createElement("div");
  5886. if (id !== void 0) el.setAttribute("id", id);
  5887. if (target) {
  5888. target.appendChild(el);
  5889. globalNodes.push(el);
  5890. }
  5891. return el;
  5892. }
  5893. function removeGlobalNode(el) {
  5894. globalNodes.splice(globalNodes.indexOf(el), 1);
  5895. el.remove();
  5896. }
  5897. //#endregion
  5898. //#region ../../node_modules/.pnpm/@element-plus+icons-vue@2.3.2_vue@3.5.25_typescript@5.5.4_/node_modules/@element-plus/icons-vue/dist/index.js
  5899. /*! Element Plus Icons Vue v2.3.2 */
  5900. var arrow_down_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5901. name: "ArrowDown",
  5902. __name: "arrow-down",
  5903. setup(__props) {
  5904. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5905. xmlns: "http://www.w3.org/2000/svg",
  5906. viewBox: "0 0 1024 1024"
  5907. }, [(0, vue.createElementVNode)("path", {
  5908. fill: "currentColor",
  5909. d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 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.59 30.59 0 0 0-42.752 0z"
  5910. })]));
  5911. }
  5912. });
  5913. var arrow_left_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5914. name: "ArrowLeft",
  5915. __name: "arrow-left",
  5916. setup(__props) {
  5917. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5918. xmlns: "http://www.w3.org/2000/svg",
  5919. viewBox: "0 0 1024 1024"
  5920. }, [(0, vue.createElementVNode)("path", {
  5921. fill: "currentColor",
  5922. 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.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
  5923. })]));
  5924. }
  5925. });
  5926. var arrow_right_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5927. name: "ArrowRight",
  5928. __name: "arrow-right",
  5929. setup(__props) {
  5930. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5931. xmlns: "http://www.w3.org/2000/svg",
  5932. viewBox: "0 0 1024 1024"
  5933. }, [(0, vue.createElementVNode)("path", {
  5934. fill: "currentColor",
  5935. d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 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"
  5936. })]));
  5937. }
  5938. });
  5939. var arrow_up_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5940. name: "ArrowUp",
  5941. __name: "arrow-up",
  5942. setup(__props) {
  5943. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5944. xmlns: "http://www.w3.org/2000/svg",
  5945. viewBox: "0 0 1024 1024"
  5946. }, [(0, vue.createElementVNode)("path", {
  5947. fill: "currentColor",
  5948. 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 0"
  5949. })]));
  5950. }
  5951. });
  5952. var back_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5953. name: "Back",
  5954. __name: "back",
  5955. setup(__props) {
  5956. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5957. xmlns: "http://www.w3.org/2000/svg",
  5958. viewBox: "0 0 1024 1024"
  5959. }, [(0, vue.createElementVNode)("path", {
  5960. fill: "currentColor",
  5961. d: "M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"
  5962. }), (0, vue.createElementVNode)("path", {
  5963. fill: "currentColor",
  5964. 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.312z"
  5965. })]));
  5966. }
  5967. });
  5968. var calendar_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
  5969. name: "Calendar",
  5970. __name: "calendar",
  5971. setup(__props) {
  5972. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5973. xmlns: "http://www.w3.org/2000/svg",
  5974. viewBox: "0 0 1024 1024"
  5975. }, [(0, vue.createElementVNode)("path", {
  5976. fill: "currentColor",
  5977. d: "M128 384v512h768V192H768v32a32 32 0 1 1-64 0v-32H320v32a32 32 0 0 1-64 0v-32H128v128h768v64zm192-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 0zm-32 384h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 0 1 0 64h-64a32 32 0 0 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m192-192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64m0 192h64a32 32 0 1 1 0 64h-64a32 32 0 1 1 0-64"
  5978. })]));
  5979. }
  5980. });
  5981. var caret_right_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5982. name: "CaretRight",
  5983. __name: "caret-right",
  5984. setup(__props) {
  5985. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5986. xmlns: "http://www.w3.org/2000/svg",
  5987. viewBox: "0 0 1024 1024"
  5988. }, [(0, vue.createElementVNode)("path", {
  5989. fill: "currentColor",
  5990. d: "M384 192v640l384-320.064z"
  5991. })]));
  5992. }
  5993. });
  5994. var caret_top_default = /* @__PURE__ */ (0, vue.defineComponent)({
  5995. name: "CaretTop",
  5996. __name: "caret-top",
  5997. setup(__props) {
  5998. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  5999. xmlns: "http://www.w3.org/2000/svg",
  6000. viewBox: "0 0 1024 1024"
  6001. }, [(0, vue.createElementVNode)("path", {
  6002. fill: "currentColor",
  6003. d: "M512 320 192 704h639.936z"
  6004. })]));
  6005. }
  6006. });
  6007. var check_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6008. name: "Check",
  6009. __name: "check",
  6010. setup(__props) {
  6011. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6012. xmlns: "http://www.w3.org/2000/svg",
  6013. viewBox: "0 0 1024 1024"
  6014. }, [(0, vue.createElementVNode)("path", {
  6015. fill: "currentColor",
  6016. 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"
  6017. })]));
  6018. }
  6019. });
  6020. var circle_check_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6021. name: "CircleCheckFilled",
  6022. __name: "circle-check-filled",
  6023. setup(__props) {
  6024. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6025. xmlns: "http://www.w3.org/2000/svg",
  6026. viewBox: "0 0 1024 1024"
  6027. }, [(0, vue.createElementVNode)("path", {
  6028. fill: "currentColor",
  6029. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
  6030. })]));
  6031. }
  6032. });
  6033. var circle_check_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6034. name: "CircleCheck",
  6035. __name: "circle-check",
  6036. setup(__props) {
  6037. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6038. xmlns: "http://www.w3.org/2000/svg",
  6039. viewBox: "0 0 1024 1024"
  6040. }, [(0, vue.createElementVNode)("path", {
  6041. fill: "currentColor",
  6042. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6043. }), (0, vue.createElementVNode)("path", {
  6044. fill: "currentColor",
  6045. 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.752z"
  6046. })]));
  6047. }
  6048. });
  6049. var circle_close_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6050. name: "CircleCloseFilled",
  6051. __name: "circle-close-filled",
  6052. setup(__props) {
  6053. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6054. xmlns: "http://www.w3.org/2000/svg",
  6055. viewBox: "0 0 1024 1024"
  6056. }, [(0, vue.createElementVNode)("path", {
  6057. fill: "currentColor",
  6058. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 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.336z"
  6059. })]));
  6060. }
  6061. });
  6062. var circle_close_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6063. name: "CircleClose",
  6064. __name: "circle-close",
  6065. setup(__props) {
  6066. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6067. xmlns: "http://www.w3.org/2000/svg",
  6068. viewBox: "0 0 1024 1024"
  6069. }, [(0, vue.createElementVNode)("path", {
  6070. fill: "currentColor",
  6071. 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.248z"
  6072. }), (0, vue.createElementVNode)("path", {
  6073. fill: "currentColor",
  6074. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6075. })]));
  6076. }
  6077. });
  6078. var clock_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6079. name: "Clock",
  6080. __name: "clock",
  6081. setup(__props) {
  6082. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6083. xmlns: "http://www.w3.org/2000/svg",
  6084. viewBox: "0 0 1024 1024"
  6085. }, [
  6086. (0, vue.createElementVNode)("path", {
  6087. fill: "currentColor",
  6088. d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
  6089. }),
  6090. (0, vue.createElementVNode)("path", {
  6091. fill: "currentColor",
  6092. d: "M480 256a32 32 0 0 1 32 32v256a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"
  6093. }),
  6094. (0, vue.createElementVNode)("path", {
  6095. fill: "currentColor",
  6096. d: "M480 512h256q32 0 32 32t-32 32H480q-32 0-32-32t32-32"
  6097. })
  6098. ]));
  6099. }
  6100. });
  6101. var close_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6102. name: "Close",
  6103. __name: "close",
  6104. setup(__props) {
  6105. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6106. xmlns: "http://www.w3.org/2000/svg",
  6107. viewBox: "0 0 1024 1024"
  6108. }, [(0, vue.createElementVNode)("path", {
  6109. fill: "currentColor",
  6110. 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"
  6111. })]));
  6112. }
  6113. });
  6114. var d_arrow_left_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6115. name: "DArrowLeft",
  6116. __name: "d-arrow-left",
  6117. setup(__props) {
  6118. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6119. xmlns: "http://www.w3.org/2000/svg",
  6120. viewBox: "0 0 1024 1024"
  6121. }, [(0, vue.createElementVNode)("path", {
  6122. fill: "currentColor",
  6123. d: "M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 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.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 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.672z"
  6124. })]));
  6125. }
  6126. });
  6127. var d_arrow_right_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6128. name: "DArrowRight",
  6129. __name: "d-arrow-right",
  6130. setup(__props) {
  6131. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6132. xmlns: "http://www.w3.org/2000/svg",
  6133. viewBox: "0 0 1024 1024"
  6134. }, [(0, vue.createElementVNode)("path", {
  6135. fill: "currentColor",
  6136. 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.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-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.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"
  6137. })]));
  6138. }
  6139. });
  6140. var delete_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6141. name: "Delete",
  6142. __name: "delete",
  6143. setup(__props) {
  6144. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6145. xmlns: "http://www.w3.org/2000/svg",
  6146. viewBox: "0 0 1024 1024"
  6147. }, [(0, vue.createElementVNode)("path", {
  6148. fill: "currentColor",
  6149. 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-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"
  6150. })]));
  6151. }
  6152. });
  6153. var document_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6154. name: "Document",
  6155. __name: "document",
  6156. setup(__props) {
  6157. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6158. xmlns: "http://www.w3.org/2000/svg",
  6159. viewBox: "0 0 1024 1024"
  6160. }, [(0, vue.createElementVNode)("path", {
  6161. fill: "currentColor",
  6162. d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
  6163. })]));
  6164. }
  6165. });
  6166. var full_screen_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6167. name: "FullScreen",
  6168. __name: "full-screen",
  6169. setup(__props) {
  6170. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6171. xmlns: "http://www.w3.org/2000/svg",
  6172. viewBox: "0 0 1024 1024"
  6173. }, [(0, vue.createElementVNode)("path", {
  6174. fill: "currentColor",
  6175. d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
  6176. })]));
  6177. }
  6178. });
  6179. var hide_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6180. name: "Hide",
  6181. __name: "hide",
  6182. setup(__props) {
  6183. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6184. xmlns: "http://www.w3.org/2000/svg",
  6185. viewBox: "0 0 1024 1024"
  6186. }, [(0, vue.createElementVNode)("path", {
  6187. fill: "currentColor",
  6188. d: "M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-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 176S0 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.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 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.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.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.6q-43.2 72-153.6 172.8c-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-176S1024 528 1024 512s-48.001-73.6-134.401-176"
  6189. }), (0, vue.createElementVNode)("path", {
  6190. fill: "currentColor",
  6191. 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 112s-67.2 48-112 48"
  6192. })]));
  6193. }
  6194. });
  6195. var info_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6196. name: "InfoFilled",
  6197. __name: "info-filled",
  6198. setup(__props) {
  6199. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6200. xmlns: "http://www.w3.org/2000/svg",
  6201. viewBox: "0 0 1024 1024"
  6202. }, [(0, vue.createElementVNode)("path", {
  6203. fill: "currentColor",
  6204. d: "M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.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.344M590.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.99 12.99 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"
  6205. })]));
  6206. }
  6207. });
  6208. var loading_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6209. name: "Loading",
  6210. __name: "loading",
  6211. setup(__props) {
  6212. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6213. xmlns: "http://www.w3.org/2000/svg",
  6214. viewBox: "0 0 1024 1024"
  6215. }, [(0, vue.createElementVNode)("path", {
  6216. fill: "currentColor",
  6217. d: "M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.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.248m452.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.248M828.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 0m-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 0"
  6218. })]));
  6219. }
  6220. });
  6221. var minus_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6222. name: "Minus",
  6223. __name: "minus",
  6224. setup(__props) {
  6225. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6226. xmlns: "http://www.w3.org/2000/svg",
  6227. viewBox: "0 0 1024 1024"
  6228. }, [(0, vue.createElementVNode)("path", {
  6229. fill: "currentColor",
  6230. d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
  6231. })]));
  6232. }
  6233. });
  6234. var more_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6235. name: "MoreFilled",
  6236. __name: "more-filled",
  6237. setup(__props) {
  6238. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6239. xmlns: "http://www.w3.org/2000/svg",
  6240. viewBox: "0 0 1024 1024"
  6241. }, [(0, vue.createElementVNode)("path", {
  6242. fill: "currentColor",
  6243. d: "M176 416a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224m336 0a112 112 0 1 1 0 224 112 112 0 0 1 0-224"
  6244. })]));
  6245. }
  6246. });
  6247. var more_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6248. name: "More",
  6249. __name: "more",
  6250. setup(__props) {
  6251. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6252. xmlns: "http://www.w3.org/2000/svg",
  6253. viewBox: "0 0 1024 1024"
  6254. }, [(0, vue.createElementVNode)("path", {
  6255. fill: "currentColor",
  6256. 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-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96m336-64a112 112 0 1 1 0 224 112 112 0 0 1 0-224m0 64a48 48 0 1 0 0 96 48 48 0 0 0 0-96"
  6257. })]));
  6258. }
  6259. });
  6260. var picture_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6261. name: "PictureFilled",
  6262. __name: "picture-filled",
  6263. setup(__props) {
  6264. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6265. xmlns: "http://www.w3.org/2000/svg",
  6266. viewBox: "0 0 1024 1024"
  6267. }, [(0, vue.createElementVNode)("path", {
  6268. fill: "currentColor",
  6269. 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 32zm315.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.112M256 384a96 96 0 1 0 192.064-.064A96 96 0 0 0 256 384"
  6270. })]));
  6271. }
  6272. });
  6273. var plus_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6274. name: "Plus",
  6275. __name: "plus",
  6276. setup(__props) {
  6277. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6278. xmlns: "http://www.w3.org/2000/svg",
  6279. viewBox: "0 0 1024 1024"
  6280. }, [(0, vue.createElementVNode)("path", {
  6281. fill: "currentColor",
  6282. 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-64z"
  6283. })]));
  6284. }
  6285. });
  6286. var question_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6287. name: "QuestionFilled",
  6288. __name: "question-filled",
  6289. setup(__props) {
  6290. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6291. xmlns: "http://www.w3.org/2000/svg",
  6292. viewBox: "0 0 1024 1024"
  6293. }, [(0, vue.createElementVNode)("path", {
  6294. fill: "currentColor",
  6295. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m23.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.592q0-64.416-42.24-101.376c-28.16-25.344-65.472-37.312-111.232-37.312m-12.672 406.208a54.27 54.27 0 0 0-38.72 14.784 49.4 49.4 0 0 0-15.488 38.016c0 15.488 4.928 28.16 15.488 38.016A54.85 54.85 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.97 51.97 0 0 0-15.488-38.016 55.94 55.94 0 0 0-39.424-14.784"
  6296. })]));
  6297. }
  6298. });
  6299. var refresh_left_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6300. name: "RefreshLeft",
  6301. __name: "refresh-left",
  6302. setup(__props) {
  6303. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6304. xmlns: "http://www.w3.org/2000/svg",
  6305. viewBox: "0 0 1024 1024"
  6306. }, [(0, vue.createElementVNode)("path", {
  6307. fill: "currentColor",
  6308. 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"
  6309. })]));
  6310. }
  6311. });
  6312. var refresh_right_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6313. name: "RefreshRight",
  6314. __name: "refresh-right",
  6315. setup(__props) {
  6316. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6317. xmlns: "http://www.w3.org/2000/svg",
  6318. viewBox: "0 0 1024 1024"
  6319. }, [(0, vue.createElementVNode)("path", {
  6320. fill: "currentColor",
  6321. 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.88"
  6322. })]));
  6323. }
  6324. });
  6325. var scale_to_original_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6326. name: "ScaleToOriginal",
  6327. __name: "scale-to-original",
  6328. setup(__props) {
  6329. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6330. xmlns: "http://www.w3.org/2000/svg",
  6331. viewBox: "0 0 1024 1024"
  6332. }, [(0, vue.createElementVNode)("path", {
  6333. fill: "currentColor",
  6334. 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.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 0 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118m-361.412 0a30.12 30.12 0 0 0-30.118 30.118v301.177a30.118 30.118 0 1 0 60.236 0V331.294a30.12 30.12 0 0 0-30.118-30.118M512 361.412a30.12 30.12 0 0 0-30.118 30.117v30.118a30.118 30.118 0 0 0 60.236 0V391.53A30.12 30.12 0 0 0 512 361.412M512 512a30.12 30.12 0 0 0-30.118 30.118v30.117a30.118 30.118 0 0 0 60.236 0v-30.117A30.12 30.12 0 0 0 512 512"
  6335. })]));
  6336. }
  6337. });
  6338. var search_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6339. name: "Search",
  6340. __name: "search",
  6341. setup(__props) {
  6342. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6343. xmlns: "http://www.w3.org/2000/svg",
  6344. viewBox: "0 0 1024 1024"
  6345. }, [(0, vue.createElementVNode)("path", {
  6346. fill: "currentColor",
  6347. 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 704"
  6348. })]));
  6349. }
  6350. });
  6351. var sort_down_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6352. name: "SortDown",
  6353. __name: "sort-down",
  6354. setup(__props) {
  6355. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6356. xmlns: "http://www.w3.org/2000/svg",
  6357. viewBox: "0 0 1024 1024"
  6358. }, [(0, vue.createElementVNode)("path", {
  6359. fill: "currentColor",
  6360. 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 0"
  6361. })]));
  6362. }
  6363. });
  6364. var sort_up_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6365. name: "SortUp",
  6366. __name: "sort-up",
  6367. setup(__props) {
  6368. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6369. xmlns: "http://www.w3.org/2000/svg",
  6370. viewBox: "0 0 1024 1024"
  6371. }, [(0, vue.createElementVNode)("path", {
  6372. fill: "currentColor",
  6373. 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.248"
  6374. })]));
  6375. }
  6376. });
  6377. var star_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6378. name: "StarFilled",
  6379. __name: "star-filled",
  6380. setup(__props) {
  6381. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6382. xmlns: "http://www.w3.org/2000/svg",
  6383. viewBox: "0 0 1024 1024"
  6384. }, [(0, vue.createElementVNode)("path", {
  6385. fill: "currentColor",
  6386. d: "M313.6 924.48a70.4 70.4 0 0 1-74.152-5.365 70.4 70.4 0 0 1-27.992-68.875l37.888-220.928L88.96 472.96a70.4 70.4 0 0 1 3.788-104.225A70.4 70.4 0 0 1 128 352.896l221.76-32.256 99.2-200.96a70.4 70.4 0 0 1 100.246-28.595 70.4 70.4 0 0 1 25.962 28.595l99.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"
  6387. })]));
  6388. }
  6389. });
  6390. var star_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6391. name: "Star",
  6392. __name: "star",
  6393. setup(__props) {
  6394. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6395. xmlns: "http://www.w3.org/2000/svg",
  6396. viewBox: "0 0 1024 1024"
  6397. }, [(0, vue.createElementVNode)("path", {
  6398. fill: "currentColor",
  6399. 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.72zM313.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"
  6400. })]));
  6401. }
  6402. });
  6403. var success_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6404. name: "SuccessFilled",
  6405. __name: "success-filled",
  6406. setup(__props) {
  6407. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6408. xmlns: "http://www.w3.org/2000/svg",
  6409. viewBox: "0 0 1024 1024"
  6410. }, [(0, vue.createElementVNode)("path", {
  6411. fill: "currentColor",
  6412. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"
  6413. })]));
  6414. }
  6415. });
  6416. var view_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6417. name: "View",
  6418. __name: "view",
  6419. setup(__props) {
  6420. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6421. xmlns: "http://www.w3.org/2000/svg",
  6422. viewBox: "0 0 1024 1024"
  6423. }, [(0, vue.createElementVNode)("path", {
  6424. fill: "currentColor",
  6425. d: "M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 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-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"
  6426. })]));
  6427. }
  6428. });
  6429. var warning_filled_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6430. name: "WarningFilled",
  6431. __name: "warning-filled",
  6432. setup(__props) {
  6433. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6434. xmlns: "http://www.w3.org/2000/svg",
  6435. viewBox: "0 0 1024 1024"
  6436. }, [(0, vue.createElementVNode)("path", {
  6437. fill: "currentColor",
  6438. d: "M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"
  6439. })]));
  6440. }
  6441. });
  6442. var zoom_in_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6443. name: "ZoomIn",
  6444. __name: "zoom-in",
  6445. setup(__props) {
  6446. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6447. xmlns: "http://www.w3.org/2000/svg",
  6448. viewBox: "0 0 1024 1024"
  6449. }, [(0, vue.createElementVNode)("path", {
  6450. fill: "currentColor",
  6451. 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 704m-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-64z"
  6452. })]));
  6453. }
  6454. });
  6455. var zoom_out_default = /* @__PURE__ */ (0, vue.defineComponent)({
  6456. name: "ZoomOut",
  6457. __name: "zoom-out",
  6458. setup(__props) {
  6459. return (_ctx, _cache) => ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  6460. xmlns: "http://www.w3.org/2000/svg",
  6461. viewBox: "0 0 1024 1024"
  6462. }, [(0, vue.createElementVNode)("path", {
  6463. fill: "currentColor",
  6464. 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 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
  6465. })]));
  6466. }
  6467. });
  6468. //#endregion
  6469. //#region ../../packages/utils/vue/props/runtime.ts
  6470. const epPropKey = "__epPropKey";
  6471. const definePropType = (val) => val;
  6472. const isEpProp = (val) => isObject$1(val) && !!val[epPropKey];
  6473. /**
  6474. * @description Build prop. It can better optimize prop types
  6475. * @description 生成 prop,能更好地优化类型
  6476. * @example
  6477. // limited options
  6478. // the type will be PropType<'light' | 'dark'>
  6479. buildProp({
  6480. type: String,
  6481. values: ['light', 'dark'],
  6482. } as const)
  6483. * @example
  6484. // limited options and other types
  6485. // the type will be PropType<'small' | 'large' | number>
  6486. buildProp({
  6487. type: [String, Number],
  6488. values: ['small', 'large'],
  6489. validator: (val: unknown): val is number => typeof val === 'number',
  6490. } as const)
  6491. @link see more: https://github.com/element-plus/element-plus/pull/3341
  6492. */
  6493. const buildProp = (prop, key) => {
  6494. if (!isObject$1(prop) || isEpProp(prop)) return prop;
  6495. const { values, required, default: defaultValue, type, validator } = prop;
  6496. const epProp = {
  6497. type,
  6498. required: !!required,
  6499. validator: values || validator ? (val) => {
  6500. let valid = false;
  6501. let allowedValues = [];
  6502. if (values) {
  6503. allowedValues = Array.from(values);
  6504. if (hasOwn(prop, "default")) allowedValues.push(defaultValue);
  6505. valid ||= allowedValues.includes(val);
  6506. }
  6507. if (validator) valid ||= validator(val);
  6508. if (!valid && allowedValues.length > 0) {
  6509. const allowValuesText = [...new Set(allowedValues)].map((value) => JSON.stringify(value)).join(", ");
  6510. (0, vue.warn)(`Invalid prop: validation failed${key ? ` for prop "${key}"` : ""}. Expected one of [${allowValuesText}], got value ${JSON.stringify(val)}.`);
  6511. }
  6512. return valid;
  6513. } : void 0,
  6514. [epPropKey]: true
  6515. };
  6516. if (hasOwn(prop, "default")) epProp.default = defaultValue;
  6517. return epProp;
  6518. };
  6519. const buildProps = (props) => fromPairs(Object.entries(props).map(([key, option]) => [key, buildProp(option, key)]));
  6520. //#endregion
  6521. //#region ../../packages/utils/vue/icon.ts
  6522. const iconPropType = definePropType([
  6523. String,
  6524. Object,
  6525. Function
  6526. ]);
  6527. const CloseComponents = { Close: close_default };
  6528. const TypeComponents = {
  6529. Close: close_default,
  6530. SuccessFilled: success_filled_default,
  6531. InfoFilled: info_filled_default,
  6532. WarningFilled: warning_filled_default,
  6533. CircleCloseFilled: circle_close_filled_default
  6534. };
  6535. const TypeComponentsMap = {
  6536. primary: info_filled_default,
  6537. success: success_filled_default,
  6538. warning: warning_filled_default,
  6539. error: circle_close_filled_default,
  6540. info: info_filled_default
  6541. };
  6542. const ValidateComponentsMap = {
  6543. validating: loading_default,
  6544. success: circle_check_default,
  6545. error: circle_close_default
  6546. };
  6547. //#endregion
  6548. //#region ../../packages/utils/vue/install.ts
  6549. const withPropsDefaultsSetter = (target) => {
  6550. const _p = target.props;
  6551. const props = isArray$1(_p) ? fromPairs(_p.map((key) => [key, {}])) : _p;
  6552. target.setPropsDefaults = (defaults) => {
  6553. if (!props) return;
  6554. for (const [key, value] of Object.entries(defaults)) {
  6555. const prop = props[key];
  6556. if (!hasOwn(props, key)) continue;
  6557. if (isPlainObject(prop)) {
  6558. props[key] = {
  6559. ...prop,
  6560. default: value
  6561. };
  6562. continue;
  6563. }
  6564. props[key] = {
  6565. type: prop,
  6566. default: value
  6567. };
  6568. }
  6569. target.props = props;
  6570. };
  6571. };
  6572. const withInstall = (main, extra) => {
  6573. main.install = (app) => {
  6574. for (const comp of [main, ...Object.values(extra ?? {})]) app.component(comp.name, comp);
  6575. };
  6576. if (extra) for (const [key, comp] of Object.entries(extra)) main[key] = comp;
  6577. withPropsDefaultsSetter(main);
  6578. return main;
  6579. };
  6580. const withInstallFunction = (fn, name) => {
  6581. fn.install = (app) => {
  6582. fn._context = app._context;
  6583. app.config.globalProperties[name] = fn;
  6584. };
  6585. return fn;
  6586. };
  6587. const withInstallDirective = (directive, name) => {
  6588. directive.install = (app) => {
  6589. app.directive(name, directive);
  6590. };
  6591. return directive;
  6592. };
  6593. const withNoopInstall = (component) => {
  6594. component.install = NOOP;
  6595. withPropsDefaultsSetter(component);
  6596. return component;
  6597. };
  6598. //#endregion
  6599. //#region ../../packages/utils/vue/refs.ts
  6600. const composeRefs = (...refs) => {
  6601. return (el) => {
  6602. refs.forEach((ref) => {
  6603. ref.value = el;
  6604. });
  6605. };
  6606. };
  6607. //#endregion
  6608. //#region ../../packages/utils/vue/validator.ts
  6609. const isValidComponentSize = (val) => ["", ...componentSizes].includes(val);
  6610. //#endregion
  6611. //#region ../../packages/utils/vue/vnode.ts
  6612. const SCOPE$8 = "utils/vue/vnode";
  6613. let PatchFlags = /* @__PURE__ */ function(PatchFlags) {
  6614. PatchFlags[PatchFlags["TEXT"] = 1] = "TEXT";
  6615. PatchFlags[PatchFlags["CLASS"] = 2] = "CLASS";
  6616. PatchFlags[PatchFlags["STYLE"] = 4] = "STYLE";
  6617. PatchFlags[PatchFlags["PROPS"] = 8] = "PROPS";
  6618. PatchFlags[PatchFlags["FULL_PROPS"] = 16] = "FULL_PROPS";
  6619. PatchFlags[PatchFlags["HYDRATE_EVENTS"] = 32] = "HYDRATE_EVENTS";
  6620. PatchFlags[PatchFlags["STABLE_FRAGMENT"] = 64] = "STABLE_FRAGMENT";
  6621. PatchFlags[PatchFlags["KEYED_FRAGMENT"] = 128] = "KEYED_FRAGMENT";
  6622. PatchFlags[PatchFlags["UNKEYED_FRAGMENT"] = 256] = "UNKEYED_FRAGMENT";
  6623. PatchFlags[PatchFlags["NEED_PATCH"] = 512] = "NEED_PATCH";
  6624. PatchFlags[PatchFlags["DYNAMIC_SLOTS"] = 1024] = "DYNAMIC_SLOTS";
  6625. PatchFlags[PatchFlags["HOISTED"] = -1] = "HOISTED";
  6626. PatchFlags[PatchFlags["BAIL"] = -2] = "BAIL";
  6627. return PatchFlags;
  6628. }({});
  6629. function isFragment(node) {
  6630. return (0, vue.isVNode)(node) && node.type === vue.Fragment;
  6631. }
  6632. function isComment(node) {
  6633. return (0, vue.isVNode)(node) && node.type === vue.Comment;
  6634. }
  6635. function isValidElementNode(node) {
  6636. return (0, vue.isVNode)(node) && !isFragment(node) && !isComment(node);
  6637. }
  6638. const getNormalizedProps = (node) => {
  6639. if (!(0, vue.isVNode)(node)) {
  6640. /* @__PURE__ */ debugWarn(SCOPE$8, "[getNormalizedProps] must be a VNode");
  6641. return {};
  6642. }
  6643. const raw = node.props || {};
  6644. const type = ((0, vue.isVNode)(node.type) ? node.type.props : void 0) || {};
  6645. const props = {};
  6646. Object.keys(type).forEach((key) => {
  6647. if (hasOwn(type[key], "default")) props[key] = type[key].default;
  6648. });
  6649. Object.keys(raw).forEach((key) => {
  6650. props[camelize(key)] = raw[key];
  6651. });
  6652. return props;
  6653. };
  6654. const flattedChildren = (children) => {
  6655. const vNodes = isArray$1(children) ? children : [children];
  6656. const result = [];
  6657. vNodes.forEach((child) => {
  6658. if (isArray$1(child)) result.push(...flattedChildren(child));
  6659. else if ((0, vue.isVNode)(child) && child.component?.subTree) result.push(child, ...flattedChildren(child.component.subTree));
  6660. else if ((0, vue.isVNode)(child) && isArray$1(child.children)) result.push(...flattedChildren(child.children));
  6661. else if ((0, vue.isVNode)(child) && child.shapeFlag === 2) result.push(...flattedChildren(child.type()));
  6662. else result.push(child);
  6663. });
  6664. return result;
  6665. };
  6666. //#endregion
  6667. //#region ../../packages/utils/arrays.ts
  6668. const unique = (arr) => [...new Set(arr)];
  6669. const extractFirst = (arr) => {
  6670. return isArray$1(arr) ? arr[0] : arr;
  6671. };
  6672. /** like `_.castArray`, except falsy value returns empty array. */
  6673. const castArray = (arr) => {
  6674. if (!arr && arr !== 0) return [];
  6675. return isArray$1(arr) ? arr : [arr];
  6676. };
  6677. //#endregion
  6678. //#region ../../packages/utils/i18n.ts
  6679. const isKorean = (text) => /([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(text);
  6680. //#endregion
  6681. //#region ../../packages/utils/typescript.ts
  6682. const mutable = (val) => val;
  6683. //#endregion
  6684. //#region ../../packages/utils/throttleByRaf.ts
  6685. function throttleByRaf(cb) {
  6686. let timer = 0;
  6687. const throttle = (...args) => {
  6688. if (timer) cAF(timer);
  6689. timer = rAF(() => {
  6690. cb(...args);
  6691. timer = 0;
  6692. });
  6693. };
  6694. throttle.cancel = () => {
  6695. cAF(timer);
  6696. timer = 0;
  6697. };
  6698. return throttle;
  6699. }
  6700. //#endregion
  6701. //#region ../../packages/hooks/use-attrs/index.ts
  6702. const DEFAULT_EXCLUDE_KEYS = ["class", "style"];
  6703. const LISTENER_PREFIX = /^on[A-Z]/;
  6704. const useAttrs = (params = {}) => {
  6705. const { excludeListeners = false, excludeKeys } = params;
  6706. const allExcludeKeys = (0, vue.computed)(() => {
  6707. return (excludeKeys?.value || []).concat(DEFAULT_EXCLUDE_KEYS);
  6708. });
  6709. const instance = (0, vue.getCurrentInstance)();
  6710. if (!instance) {
  6711. /* @__PURE__ */ debugWarn("use-attrs", "getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function");
  6712. return (0, vue.computed)(() => ({}));
  6713. }
  6714. return (0, vue.computed)(() => fromPairs(Object.entries(instance.proxy?.$attrs).filter(([key]) => !allExcludeKeys.value.includes(key) && !(excludeListeners && LISTENER_PREFIX.test(key)))));
  6715. };
  6716. //#endregion
  6717. //#region ../../packages/hooks/use-calc-input-width/index.ts
  6718. function useCalcInputWidth() {
  6719. const calculatorRef = (0, vue.shallowRef)();
  6720. const calculatorWidth = (0, vue.ref)(0);
  6721. const inputStyle = (0, vue.computed)(() => ({ minWidth: `${Math.max(calculatorWidth.value, MINIMUM_INPUT_WIDTH)}px` }));
  6722. const resetCalculatorWidth = () => {
  6723. calculatorWidth.value = calculatorRef.value?.getBoundingClientRect().width ?? 0;
  6724. };
  6725. useResizeObserver(calculatorRef, resetCalculatorWidth);
  6726. return {
  6727. calculatorRef,
  6728. calculatorWidth,
  6729. inputStyle
  6730. };
  6731. }
  6732. //#endregion
  6733. //#region ../../packages/hooks/use-deprecated/index.ts
  6734. const useDeprecated = ({ from, replacement, scope, version, ref, type = "API" }, condition) => {
  6735. (0, vue.watch)(() => (0, vue.unref)(condition), (val) => {
  6736. if (val) /* @__PURE__ */ debugWarn(scope, `[${type}] ${from} is about to be deprecated in version ${version}, please use ${replacement} instead.
  6737. For more detail, please visit: ${ref}
  6738. `);
  6739. }, { immediate: true });
  6740. };
  6741. //#endregion
  6742. //#region ../../packages/hooks/use-draggable/index.ts
  6743. const useDraggable = (targetRef, dragRef, draggable, overflow) => {
  6744. const transform = {
  6745. offsetX: 0,
  6746. offsetY: 0
  6747. };
  6748. const isDragging = (0, vue.ref)(false);
  6749. const adjustPosition = (moveX, moveY) => {
  6750. if (targetRef.value) {
  6751. const { offsetX, offsetY } = transform;
  6752. const targetRect = targetRef.value.getBoundingClientRect();
  6753. const targetLeft = targetRect.left;
  6754. const targetTop = targetRect.top;
  6755. const targetWidth = targetRect.width;
  6756. const targetHeight = targetRect.height;
  6757. const clientWidth = document.documentElement.clientWidth;
  6758. const clientHeight = document.documentElement.clientHeight;
  6759. const minLeft = -targetLeft + offsetX;
  6760. const minTop = -targetTop + offsetY;
  6761. const maxLeft = clientWidth - targetLeft - targetWidth + offsetX;
  6762. const maxTop = clientHeight - targetTop - (targetHeight < clientHeight ? targetHeight : 0) + offsetY;
  6763. if (!overflow?.value) {
  6764. moveX = Math.min(Math.max(moveX, minLeft), maxLeft);
  6765. moveY = Math.min(Math.max(moveY, minTop), maxTop);
  6766. }
  6767. transform.offsetX = moveX;
  6768. transform.offsetY = moveY;
  6769. targetRef.value.style.transform = `translate(${addUnit(moveX)}, ${addUnit(moveY)})`;
  6770. }
  6771. };
  6772. const onMousedown = (e) => {
  6773. const downX = e.clientX;
  6774. const downY = e.clientY;
  6775. const { offsetX, offsetY } = transform;
  6776. const onMousemove = (e) => {
  6777. if (!isDragging.value) isDragging.value = true;
  6778. adjustPosition(offsetX + e.clientX - downX, offsetY + e.clientY - downY);
  6779. };
  6780. const onMouseup = () => {
  6781. isDragging.value = false;
  6782. document.removeEventListener("mousemove", onMousemove);
  6783. document.removeEventListener("mouseup", onMouseup);
  6784. };
  6785. document.addEventListener("mousemove", onMousemove);
  6786. document.addEventListener("mouseup", onMouseup);
  6787. };
  6788. const onDraggable = () => {
  6789. if (dragRef.value && targetRef.value) {
  6790. dragRef.value.addEventListener("mousedown", onMousedown);
  6791. window.addEventListener("resize", updatePosition);
  6792. }
  6793. };
  6794. const offDraggable = () => {
  6795. if (dragRef.value && targetRef.value) {
  6796. dragRef.value.removeEventListener("mousedown", onMousedown);
  6797. window.removeEventListener("resize", updatePosition);
  6798. }
  6799. };
  6800. const resetPosition = () => {
  6801. transform.offsetX = 0;
  6802. transform.offsetY = 0;
  6803. if (targetRef.value) targetRef.value.style.transform = "";
  6804. };
  6805. const updatePosition = () => {
  6806. const { offsetX, offsetY } = transform;
  6807. adjustPosition(offsetX, offsetY);
  6808. };
  6809. (0, vue.onMounted)(() => {
  6810. (0, vue.watchEffect)(() => {
  6811. if (draggable.value) onDraggable();
  6812. else offDraggable();
  6813. });
  6814. });
  6815. (0, vue.onBeforeUnmount)(() => {
  6816. offDraggable();
  6817. });
  6818. return {
  6819. isDragging,
  6820. resetPosition,
  6821. updatePosition
  6822. };
  6823. };
  6824. //#endregion
  6825. //#region ../../packages/hooks/use-focus/index.ts
  6826. const useFocus = (el) => {
  6827. return { focus: () => {
  6828. el.value?.focus?.();
  6829. } };
  6830. };
  6831. //#endregion
  6832. //#region ../../packages/locale/lang/en.ts
  6833. var en_default = {
  6834. name: "en",
  6835. el: {
  6836. breadcrumb: { label: "Breadcrumb" },
  6837. colorpicker: {
  6838. confirm: "OK",
  6839. clear: "Clear",
  6840. defaultLabel: "color picker",
  6841. description: "current color is {color}. press enter to select a new color.",
  6842. alphaLabel: "pick alpha value",
  6843. alphaDescription: "alpha {alpha}, current color is {color}",
  6844. hueLabel: "pick hue value",
  6845. hueDescription: "hue {hue}, current color is {color}",
  6846. svLabel: "pick saturation and brightness value",
  6847. svDescription: "saturation {saturation}, brightness {brightness}, current color is {color}",
  6848. predefineDescription: "select {value} as the color"
  6849. },
  6850. datepicker: {
  6851. now: "Now",
  6852. today: "Today",
  6853. cancel: "Cancel",
  6854. clear: "Clear",
  6855. confirm: "OK",
  6856. dateTablePrompt: "Use the arrow keys and enter to select the day of the month",
  6857. monthTablePrompt: "Use the arrow keys and enter to select the month",
  6858. yearTablePrompt: "Use the arrow keys and enter to select the year",
  6859. selectedDate: "Selected date",
  6860. selectDate: "Select date",
  6861. selectTime: "Select time",
  6862. startDate: "Start Date",
  6863. startTime: "Start Time",
  6864. endDate: "End Date",
  6865. endTime: "End Time",
  6866. prevYear: "Previous Year",
  6867. nextYear: "Next Year",
  6868. prevMonth: "Previous Month",
  6869. nextMonth: "Next Month",
  6870. year: "",
  6871. month1: "January",
  6872. month2: "February",
  6873. month3: "March",
  6874. month4: "April",
  6875. month5: "May",
  6876. month6: "June",
  6877. month7: "July",
  6878. month8: "August",
  6879. month9: "September",
  6880. month10: "October",
  6881. month11: "November",
  6882. month12: "December",
  6883. weeks: {
  6884. sun: "Sun",
  6885. mon: "Mon",
  6886. tue: "Tue",
  6887. wed: "Wed",
  6888. thu: "Thu",
  6889. fri: "Fri",
  6890. sat: "Sat"
  6891. },
  6892. weeksFull: {
  6893. sun: "Sunday",
  6894. mon: "Monday",
  6895. tue: "Tuesday",
  6896. wed: "Wednesday",
  6897. thu: "Thursday",
  6898. fri: "Friday",
  6899. sat: "Saturday"
  6900. },
  6901. months: {
  6902. jan: "Jan",
  6903. feb: "Feb",
  6904. mar: "Mar",
  6905. apr: "Apr",
  6906. may: "May",
  6907. jun: "Jun",
  6908. jul: "Jul",
  6909. aug: "Aug",
  6910. sep: "Sep",
  6911. oct: "Oct",
  6912. nov: "Nov",
  6913. dec: "Dec"
  6914. }
  6915. },
  6916. inputNumber: {
  6917. decrease: "decrease number",
  6918. increase: "increase number"
  6919. },
  6920. select: {
  6921. loading: "Loading",
  6922. noMatch: "No matching data",
  6923. noData: "No data",
  6924. placeholder: "Select"
  6925. },
  6926. mention: { loading: "Loading" },
  6927. dropdown: { toggleDropdown: "Toggle Dropdown" },
  6928. cascader: {
  6929. noMatch: "No matching data",
  6930. loading: "Loading",
  6931. placeholder: "Select",
  6932. noData: "No data"
  6933. },
  6934. pagination: {
  6935. goto: "Go to",
  6936. pagesize: "/page",
  6937. total: "Total {total}",
  6938. pageClassifier: "",
  6939. page: "Page",
  6940. prev: "Go to previous page",
  6941. next: "Go to next page",
  6942. currentPage: "page {pager}",
  6943. prevPages: "Previous {pager} pages",
  6944. nextPages: "Next {pager} pages",
  6945. deprecationWarning: "Deprecated usages detected, please refer to the el-pagination documentation for more details"
  6946. },
  6947. dialog: { close: "Close this dialog" },
  6948. drawer: { close: "Close this dialog" },
  6949. messagebox: {
  6950. title: "Message",
  6951. confirm: "OK",
  6952. cancel: "Cancel",
  6953. error: "Illegal input",
  6954. close: "Close this dialog"
  6955. },
  6956. upload: {
  6957. deleteTip: "press delete to remove",
  6958. delete: "Delete",
  6959. preview: "Preview",
  6960. continue: "Continue"
  6961. },
  6962. slider: {
  6963. defaultLabel: "slider between {min} and {max}",
  6964. defaultRangeStartLabel: "pick start value",
  6965. defaultRangeEndLabel: "pick end value"
  6966. },
  6967. table: {
  6968. emptyText: "No Data",
  6969. confirmFilter: "Confirm",
  6970. resetFilter: "Reset",
  6971. clearFilter: "All",
  6972. sumText: "Sum",
  6973. selectAllLabel: "Select all rows",
  6974. selectRowLabel: "Select this row",
  6975. expandRowLabel: "Expand this row",
  6976. collapseRowLabel: "Collapse this row",
  6977. sortLabel: "Sort by {column}",
  6978. filterLabel: "Filter by {column}"
  6979. },
  6980. tag: { close: "Close this tag" },
  6981. tour: {
  6982. next: "Next",
  6983. previous: "Previous",
  6984. finish: "Finish",
  6985. close: "Close this dialog"
  6986. },
  6987. tree: { emptyText: "No Data" },
  6988. transfer: {
  6989. noMatch: "No matching data",
  6990. noData: "No data",
  6991. titles: ["List 1", "List 2"],
  6992. filterPlaceholder: "Enter keyword",
  6993. noCheckedFormat: "{total} items",
  6994. hasCheckedFormat: "{checked}/{total} checked"
  6995. },
  6996. image: { error: "FAILED" },
  6997. pageHeader: { title: "Back" },
  6998. popconfirm: {
  6999. confirmButtonText: "Yes",
  7000. cancelButtonText: "No"
  7001. },
  7002. carousel: {
  7003. leftArrow: "Carousel arrow left",
  7004. rightArrow: "Carousel arrow right",
  7005. indicator: "Carousel switch to index {index}"
  7006. }
  7007. }
  7008. };
  7009. //#endregion
  7010. //#region ../../packages/hooks/use-locale/index.ts
  7011. const buildTranslator = (locale) => (path, option) => translate(path, option, (0, vue.unref)(locale));
  7012. const translate = (path, option, locale) => get(locale, path, path).replace(/\{(\w+)\}/g, (_, key) => `${option?.[key] ?? `{${key}}`}`);
  7013. const buildLocaleContext = (locale) => {
  7014. return {
  7015. lang: (0, vue.computed)(() => (0, vue.unref)(locale).name),
  7016. locale: (0, vue.isRef)(locale) ? locale : (0, vue.ref)(locale),
  7017. t: buildTranslator(locale)
  7018. };
  7019. };
  7020. const localeContextKey = Symbol("localeContextKey");
  7021. const useLocale = (localeOverrides) => {
  7022. const locale = localeOverrides || (0, vue.inject)(localeContextKey, (0, vue.ref)());
  7023. return buildLocaleContext((0, vue.computed)(() => locale.value || en_default));
  7024. };
  7025. //#endregion
  7026. //#region ../../packages/hooks/use-namespace/index.ts
  7027. const defaultNamespace = "el";
  7028. const statePrefix = "is-";
  7029. const _bem = (namespace, block, blockSuffix, element, modifier) => {
  7030. let cls = `${namespace}-${block}`;
  7031. if (blockSuffix) cls += `-${blockSuffix}`;
  7032. if (element) cls += `__${element}`;
  7033. if (modifier) cls += `--${modifier}`;
  7034. return cls;
  7035. };
  7036. const namespaceContextKey = Symbol("namespaceContextKey");
  7037. const useGetDerivedNamespace = (namespaceOverrides) => {
  7038. const derivedNamespace = namespaceOverrides || ((0, vue.getCurrentInstance)() ? (0, vue.inject)(namespaceContextKey, (0, vue.ref)(defaultNamespace)) : (0, vue.ref)(defaultNamespace));
  7039. return (0, vue.computed)(() => {
  7040. return (0, vue.unref)(derivedNamespace) || defaultNamespace;
  7041. });
  7042. };
  7043. const useNamespace = (block, namespaceOverrides) => {
  7044. const namespace = useGetDerivedNamespace(namespaceOverrides);
  7045. const b = (blockSuffix = "") => _bem(namespace.value, block, blockSuffix, "", "");
  7046. const e = (element) => element ? _bem(namespace.value, block, "", element, "") : "";
  7047. const m = (modifier) => modifier ? _bem(namespace.value, block, "", "", modifier) : "";
  7048. const be = (blockSuffix, element) => blockSuffix && element ? _bem(namespace.value, block, blockSuffix, element, "") : "";
  7049. const em = (element, modifier) => element && modifier ? _bem(namespace.value, block, "", element, modifier) : "";
  7050. const bm = (blockSuffix, modifier) => blockSuffix && modifier ? _bem(namespace.value, block, blockSuffix, "", modifier) : "";
  7051. const bem = (blockSuffix, element, modifier) => blockSuffix && element && modifier ? _bem(namespace.value, block, blockSuffix, element, modifier) : "";
  7052. const is = (name, ...args) => {
  7053. const state = args.length >= 1 ? args[0] : true;
  7054. return name && state ? `${statePrefix}${name}` : "";
  7055. };
  7056. const cssVar = (object) => {
  7057. const styles = {};
  7058. for (const key in object) if (object[key]) styles[`--${namespace.value}-${key}`] = object[key];
  7059. return styles;
  7060. };
  7061. const cssVarBlock = (object) => {
  7062. const styles = {};
  7063. for (const key in object) if (object[key]) styles[`--${namespace.value}-${block}-${key}`] = object[key];
  7064. return styles;
  7065. };
  7066. const cssVarName = (name) => `--${namespace.value}-${name}`;
  7067. const cssVarBlockName = (name) => `--${namespace.value}-${block}-${name}`;
  7068. return {
  7069. namespace,
  7070. b,
  7071. e,
  7072. m,
  7073. be,
  7074. em,
  7075. bm,
  7076. bem,
  7077. is,
  7078. cssVar,
  7079. cssVarName,
  7080. cssVarBlock,
  7081. cssVarBlockName
  7082. };
  7083. };
  7084. //#endregion
  7085. //#region ../../packages/hooks/use-lockscreen/index.ts
  7086. /**
  7087. * Hook that monitoring the ref value to lock or unlock the screen.
  7088. * When the trigger became true, it assumes modal is now opened and vice versa.
  7089. * @param trigger {Ref<boolean>}
  7090. */
  7091. const useLockscreen = (trigger, options = {}) => {
  7092. if (!(0, vue.isRef)(trigger)) throwError("[useLockscreen]", "You need to pass a ref param to this function");
  7093. const ns = options.ns || useNamespace("popup");
  7094. const hiddenCls = (0, vue.computed)(() => ns.bm("parent", "hidden"));
  7095. let scrollBarWidth = 0;
  7096. let withoutHiddenClass = false;
  7097. let bodyWidth = "0";
  7098. let cleaned = false;
  7099. const cleanup = () => {
  7100. if (cleaned) return;
  7101. cleaned = true;
  7102. setTimeout(() => {
  7103. if (typeof document === "undefined") return;
  7104. if (withoutHiddenClass && document) {
  7105. document.body.style.width = bodyWidth;
  7106. removeClass(document.body, hiddenCls.value);
  7107. }
  7108. }, 200);
  7109. };
  7110. (0, vue.watch)(trigger, (val) => {
  7111. if (!val) {
  7112. cleanup();
  7113. return;
  7114. }
  7115. cleaned = false;
  7116. withoutHiddenClass = !hasClass(document.body, hiddenCls.value);
  7117. if (withoutHiddenClass) {
  7118. bodyWidth = document.body.style.width;
  7119. addClass(document.body, hiddenCls.value);
  7120. }
  7121. scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  7122. const bodyHasOverflow = document.documentElement.clientHeight < document.body.scrollHeight;
  7123. const bodyOverflowY = getStyle(document.body, "overflowY");
  7124. if (scrollBarWidth > 0 && (bodyHasOverflow || bodyOverflowY === "scroll") && withoutHiddenClass) document.body.style.width = `calc(100% - ${scrollBarWidth}px)`;
  7125. });
  7126. (0, vue.onScopeDispose)(() => cleanup());
  7127. };
  7128. //#endregion
  7129. //#region ../../packages/hooks/use-modal/index.ts
  7130. const modalStack = [];
  7131. const closeModal = (e) => {
  7132. if (modalStack.length === 0) return;
  7133. if (getEventCode(e) === EVENT_CODE.esc) {
  7134. e.stopPropagation();
  7135. modalStack[modalStack.length - 1].handleClose();
  7136. }
  7137. };
  7138. const useModal = (instance, visibleRef) => {
  7139. (0, vue.watch)(visibleRef, (val) => {
  7140. if (val) modalStack.push(instance);
  7141. else modalStack.splice(modalStack.indexOf(instance), 1);
  7142. });
  7143. };
  7144. if (isClient) useEventListener(document, "keydown", closeModal);
  7145. //#endregion
  7146. //#region ../../packages/hooks/use-model-toggle/index.ts
  7147. const _prop = buildProp({
  7148. type: definePropType(Boolean),
  7149. default: null
  7150. });
  7151. const _event = buildProp({ type: definePropType(Function) });
  7152. const createModelToggleComposable = (name) => {
  7153. const updateEventKey = `update:${name}`;
  7154. const updateEventKeyRaw = `onUpdate:${name}`;
  7155. const useModelToggleEmits = [updateEventKey];
  7156. const useModelToggleProps = {
  7157. [name]: _prop,
  7158. [updateEventKeyRaw]: _event
  7159. };
  7160. const useModelToggle = ({ indicator, toggleReason, shouldHideWhenRouteChanges, shouldProceed, onShow, onHide }) => {
  7161. const instance = (0, vue.getCurrentInstance)();
  7162. const { emit } = instance;
  7163. const props = instance.props;
  7164. const hasUpdateHandler = (0, vue.computed)(() => isFunction$1(props[updateEventKeyRaw]));
  7165. const isModelBindingAbsent = (0, vue.computed)(() => props[name] === null);
  7166. const doShow = (event) => {
  7167. if (indicator.value === true) return;
  7168. indicator.value = true;
  7169. if (toggleReason) toggleReason.value = event;
  7170. if (isFunction$1(onShow)) onShow(event);
  7171. };
  7172. const doHide = (event) => {
  7173. if (indicator.value === false) return;
  7174. indicator.value = false;
  7175. if (toggleReason) toggleReason.value = event;
  7176. if (isFunction$1(onHide)) onHide(event);
  7177. };
  7178. const show = (event) => {
  7179. if (props.disabled === true || isFunction$1(shouldProceed) && !shouldProceed()) return;
  7180. const shouldEmit = hasUpdateHandler.value && isClient;
  7181. if (shouldEmit) emit(updateEventKey, true);
  7182. if (isModelBindingAbsent.value || !shouldEmit) doShow(event);
  7183. };
  7184. const hide = (event) => {
  7185. if (props.disabled === true || !isClient) return;
  7186. const shouldEmit = hasUpdateHandler.value && isClient;
  7187. if (shouldEmit) emit(updateEventKey, false);
  7188. if (isModelBindingAbsent.value || !shouldEmit) doHide(event);
  7189. };
  7190. const onChange = (val) => {
  7191. if (!isBoolean(val)) return;
  7192. if (props.disabled && val) {
  7193. if (hasUpdateHandler.value) emit(updateEventKey, false);
  7194. } else if (indicator.value !== val) if (val) doShow();
  7195. else doHide();
  7196. };
  7197. const toggle = () => {
  7198. if (indicator.value) hide();
  7199. else show();
  7200. };
  7201. (0, vue.watch)(() => props[name], onChange);
  7202. if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) (0, vue.watch)(() => ({ ...instance.proxy.$route }), () => {
  7203. if (shouldHideWhenRouteChanges.value && indicator.value) hide();
  7204. });
  7205. (0, vue.onMounted)(() => {
  7206. onChange(props[name]);
  7207. });
  7208. return {
  7209. hide,
  7210. show,
  7211. toggle,
  7212. hasUpdateHandler
  7213. };
  7214. };
  7215. return {
  7216. useModelToggle,
  7217. useModelToggleProps,
  7218. useModelToggleEmits
  7219. };
  7220. };
  7221. const { useModelToggle, useModelToggleProps, useModelToggleEmits } = createModelToggleComposable("modelValue");
  7222. //#endregion
  7223. //#region ../../packages/hooks/use-prevent-global/index.ts
  7224. const usePreventGlobal = (indicator, evt, cb) => {
  7225. const prevent = (e) => {
  7226. if (cb(e)) e.stopImmediatePropagation();
  7227. };
  7228. let stop = void 0;
  7229. (0, vue.watch)(() => indicator.value, (val) => {
  7230. if (val) stop = useEventListener(document, evt, prevent, true);
  7231. else stop?.();
  7232. }, { immediate: true });
  7233. };
  7234. //#endregion
  7235. //#region ../../packages/hooks/use-prop/index.ts
  7236. const useProp = (name) => {
  7237. const vm = (0, vue.getCurrentInstance)();
  7238. return (0, vue.computed)(() => (vm?.proxy?.$props)?.[name]);
  7239. };
  7240. //#endregion
  7241. //#region ../../node_modules/.pnpm/@sxzz+popperjs-es@2.11.7/node_modules/@sxzz/popperjs-es/dist/index.mjs
  7242. var E$1 = "top", R = "bottom", W = "right", P$1 = "left", me = "auto", G = [
  7243. E$1,
  7244. R,
  7245. W,
  7246. P$1
  7247. ], U = "start", J = "end", Xe = "clippingParents", je = "viewport", K = "popper", Ye = "reference", De = G.reduce(function(t, e) {
  7248. return t.concat([e + "-" + U, e + "-" + J]);
  7249. }, []), Ee = [].concat(G, [me]).reduce(function(t, e) {
  7250. return t.concat([
  7251. e,
  7252. e + "-" + U,
  7253. e + "-" + J
  7254. ]);
  7255. }, []), Ge = "beforeRead", Je = "read", Ke = "afterRead", Qe = "beforeMain", Ze = "main", et = "afterMain", tt = "beforeWrite", nt = "write", rt = "afterWrite", ot = [
  7256. Ge,
  7257. Je,
  7258. Ke,
  7259. Qe,
  7260. Ze,
  7261. et,
  7262. tt,
  7263. nt,
  7264. rt
  7265. ];
  7266. function C(t) {
  7267. return t ? (t.nodeName || "").toLowerCase() : null;
  7268. }
  7269. function H(t) {
  7270. if (t == null) return window;
  7271. if (t.toString() !== "[object Window]") {
  7272. var e = t.ownerDocument;
  7273. return e && e.defaultView || window;
  7274. }
  7275. return t;
  7276. }
  7277. function Q(t) {
  7278. return t instanceof H(t).Element || t instanceof Element;
  7279. }
  7280. function B(t) {
  7281. return t instanceof H(t).HTMLElement || t instanceof HTMLElement;
  7282. }
  7283. function Pe(t) {
  7284. if (typeof ShadowRoot == "undefined") return !1;
  7285. return t instanceof H(t).ShadowRoot || t instanceof ShadowRoot;
  7286. }
  7287. function Mt(t) {
  7288. var e = t.state;
  7289. Object.keys(e.elements).forEach(function(n) {
  7290. var r = e.styles[n] || {}, o = e.attributes[n] || {}, i = e.elements[n];
  7291. !B(i) || !C(i) || (Object.assign(i.style, r), Object.keys(o).forEach(function(a) {
  7292. var s = o[a];
  7293. s === !1 ? i.removeAttribute(a) : i.setAttribute(a, s === !0 ? "" : s);
  7294. }));
  7295. });
  7296. }
  7297. function Rt(t) {
  7298. var e = t.state, n = {
  7299. popper: {
  7300. position: e.options.strategy,
  7301. left: "0",
  7302. top: "0",
  7303. margin: "0"
  7304. },
  7305. arrow: { position: "absolute" },
  7306. reference: {}
  7307. };
  7308. return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
  7309. Object.keys(e.elements).forEach(function(r) {
  7310. var o = e.elements[r], i = e.attributes[r] || {}, s = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]).reduce(function(f, c) {
  7311. return f[c] = "", f;
  7312. }, {});
  7313. !B(o) || !C(o) || (Object.assign(o.style, s), Object.keys(i).forEach(function(f) {
  7314. o.removeAttribute(f);
  7315. }));
  7316. });
  7317. };
  7318. }
  7319. var Ae = {
  7320. name: "applyStyles",
  7321. enabled: !0,
  7322. phase: "write",
  7323. fn: Mt,
  7324. effect: Rt,
  7325. requires: ["computeStyles"]
  7326. };
  7327. function q(t) {
  7328. return t.split("-")[0];
  7329. }
  7330. var X$1 = Math.max, ve = Math.min, Z = Math.round;
  7331. function ee(t, e) {
  7332. e === void 0 && (e = !1);
  7333. var n = t.getBoundingClientRect(), r = 1, o = 1;
  7334. if (B(t) && e) {
  7335. var i = t.offsetHeight, a = t.offsetWidth;
  7336. a > 0 && (r = Z(n.width) / a || 1), i > 0 && (o = Z(n.height) / i || 1);
  7337. }
  7338. return {
  7339. width: n.width / r,
  7340. height: n.height / o,
  7341. top: n.top / o,
  7342. right: n.right / r,
  7343. bottom: n.bottom / o,
  7344. left: n.left / r,
  7345. x: n.left / r,
  7346. y: n.top / o
  7347. };
  7348. }
  7349. function ke(t) {
  7350. var e = ee(t), n = t.offsetWidth, r = t.offsetHeight;
  7351. return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
  7352. x: t.offsetLeft,
  7353. y: t.offsetTop,
  7354. width: n,
  7355. height: r
  7356. };
  7357. }
  7358. function it(t, e) {
  7359. var n = e.getRootNode && e.getRootNode();
  7360. if (t.contains(e)) return !0;
  7361. if (n && Pe(n)) {
  7362. var r = e;
  7363. do {
  7364. if (r && t.isSameNode(r)) return !0;
  7365. r = r.parentNode || r.host;
  7366. } while (r);
  7367. }
  7368. return !1;
  7369. }
  7370. function N$1(t) {
  7371. return H(t).getComputedStyle(t);
  7372. }
  7373. function Wt(t) {
  7374. return [
  7375. "table",
  7376. "td",
  7377. "th"
  7378. ].indexOf(C(t)) >= 0;
  7379. }
  7380. function I$1(t) {
  7381. return ((Q(t) ? t.ownerDocument : t.document) || window.document).documentElement;
  7382. }
  7383. function ge(t) {
  7384. return C(t) === "html" ? t : t.assignedSlot || t.parentNode || (Pe(t) ? t.host : null) || I$1(t);
  7385. }
  7386. function at(t) {
  7387. return !B(t) || N$1(t).position === "fixed" ? null : t.offsetParent;
  7388. }
  7389. function Bt(t) {
  7390. var e = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
  7391. if (navigator.userAgent.indexOf("Trident") !== -1 && B(t)) {
  7392. if (N$1(t).position === "fixed") return null;
  7393. }
  7394. var o = ge(t);
  7395. for (Pe(o) && (o = o.host); B(o) && ["html", "body"].indexOf(C(o)) < 0;) {
  7396. var i = N$1(o);
  7397. 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;
  7398. o = o.parentNode;
  7399. }
  7400. return null;
  7401. }
  7402. function se(t) {
  7403. for (var e = H(t), n = at(t); n && Wt(n) && N$1(n).position === "static";) n = at(n);
  7404. return n && (C(n) === "html" || C(n) === "body" && N$1(n).position === "static") ? e : n || Bt(t) || e;
  7405. }
  7406. function Le(t) {
  7407. return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
  7408. }
  7409. function fe(t, e, n) {
  7410. return X$1(t, ve(e, n));
  7411. }
  7412. function St(t, e, n) {
  7413. var r = fe(t, e, n);
  7414. return r > n ? n : r;
  7415. }
  7416. function st() {
  7417. return {
  7418. top: 0,
  7419. right: 0,
  7420. bottom: 0,
  7421. left: 0
  7422. };
  7423. }
  7424. function ft(t) {
  7425. return Object.assign({}, st(), t);
  7426. }
  7427. function ct(t, e) {
  7428. return e.reduce(function(n, r) {
  7429. return n[r] = t, n;
  7430. }, {});
  7431. }
  7432. var Tt = function(t, e) {
  7433. return t = typeof t == "function" ? t(Object.assign({}, e.rects, { placement: e.placement })) : t, ft(typeof t != "number" ? t : ct(t, G));
  7434. };
  7435. function Ht(t) {
  7436. 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), u = [P$1, W].indexOf(s) >= 0 ? "height" : "width";
  7437. if (!(!i || !a)) {
  7438. 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;
  7439. n.modifiersData[r] = (e = {}, e[j] = O, e.centerOffset = O - w, e);
  7440. }
  7441. }
  7442. function Ct(t) {
  7443. var e = t.state, r = t.options.element, o = r === void 0 ? "[data-popper-arrow]" : r;
  7444. o != null && (typeof o == "string" && (o = e.elements.popper.querySelector(o), !o) || !it(e.elements.popper, o) || (e.elements.arrow = o));
  7445. }
  7446. var pt = {
  7447. name: "arrow",
  7448. enabled: !0,
  7449. phase: "main",
  7450. fn: Ht,
  7451. effect: Ct,
  7452. requires: ["popperOffsets"],
  7453. requiresIfExists: ["preventOverflow"]
  7454. };
  7455. function te(t) {
  7456. return t.split("-")[1];
  7457. }
  7458. var qt = {
  7459. top: "auto",
  7460. right: "auto",
  7461. bottom: "auto",
  7462. left: "auto"
  7463. };
  7464. function Vt(t) {
  7465. var e = t.x, n = t.y, o = window.devicePixelRatio || 1;
  7466. return {
  7467. x: Z(e * o) / o || 0,
  7468. y: Z(n * o) / o || 0
  7469. };
  7470. }
  7471. function ut(t) {
  7472. 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({
  7473. x: l,
  7474. y: p
  7475. }) : {
  7476. x: l,
  7477. y: p
  7478. };
  7479. l = g.x, p = g.y;
  7480. var x = a.hasOwnProperty("x"), y = a.hasOwnProperty("y"), $ = P$1, d = E$1, b = window;
  7481. if (c) {
  7482. var w = se(n), O = "clientHeight", j = "clientWidth";
  7483. 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) {
  7484. d = R;
  7485. var A = m && w === b && b.visualViewport ? b.visualViewport.height : w[O];
  7486. p -= A - r.height, p *= f ? 1 : -1;
  7487. }
  7488. if (o === P$1 || (o === E$1 || o === R) && i === J) {
  7489. $ = W;
  7490. var k = m && w === b && b.visualViewport ? b.visualViewport.width : w[j];
  7491. l -= k - r.width, l *= f ? 1 : -1;
  7492. }
  7493. }
  7494. var D = Object.assign({ position: s }, c && qt), S = u === !0 ? Vt({
  7495. x: l,
  7496. y: p
  7497. }) : {
  7498. x: l,
  7499. y: p
  7500. };
  7501. if (l = S.x, p = S.y, f) {
  7502. var L;
  7503. 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));
  7504. }
  7505. return Object.assign({}, D, (e = {}, e[d] = y ? p + "px" : "", e[$] = x ? l + "px" : "", e.transform = "", e));
  7506. }
  7507. function Nt(t) {
  7508. 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 = {
  7509. placement: q(e.placement),
  7510. variation: te(e.placement),
  7511. popper: e.elements.popper,
  7512. popperRect: e.rects.popper,
  7513. gpuAcceleration: o,
  7514. isFixed: e.options.strategy === "fixed"
  7515. };
  7516. e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, ut(Object.assign({}, c, {
  7517. offsets: e.modifiersData.popperOffsets,
  7518. position: e.options.strategy,
  7519. adaptive: a,
  7520. roundOffsets: f
  7521. })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, ut(Object.assign({}, c, {
  7522. offsets: e.modifiersData.arrow,
  7523. position: "absolute",
  7524. adaptive: !1,
  7525. roundOffsets: f
  7526. })))), e.attributes.popper = Object.assign({}, e.attributes.popper, { "data-popper-placement": e.placement });
  7527. }
  7528. var Me = {
  7529. name: "computeStyles",
  7530. enabled: !0,
  7531. phase: "beforeWrite",
  7532. fn: Nt,
  7533. data: {}
  7534. }, ye = { passive: !0 };
  7535. function It(t) {
  7536. 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);
  7537. return i && c.forEach(function(u) {
  7538. u.addEventListener("scroll", n.update, ye);
  7539. }), s && f.addEventListener("resize", n.update, ye), function() {
  7540. i && c.forEach(function(u) {
  7541. u.removeEventListener("scroll", n.update, ye);
  7542. }), s && f.removeEventListener("resize", n.update, ye);
  7543. };
  7544. }
  7545. var Re = {
  7546. name: "eventListeners",
  7547. enabled: !0,
  7548. phase: "write",
  7549. fn: function() {},
  7550. effect: It,
  7551. data: {}
  7552. }, _t = {
  7553. left: "right",
  7554. right: "left",
  7555. bottom: "top",
  7556. top: "bottom"
  7557. };
  7558. function be(t) {
  7559. return t.replace(/left|right|bottom|top/g, function(e) {
  7560. return _t[e];
  7561. });
  7562. }
  7563. var zt = {
  7564. start: "end",
  7565. end: "start"
  7566. };
  7567. function lt(t) {
  7568. return t.replace(/start|end/g, function(e) {
  7569. return zt[e];
  7570. });
  7571. }
  7572. function We(t) {
  7573. var e = H(t);
  7574. return {
  7575. scrollLeft: e.pageXOffset,
  7576. scrollTop: e.pageYOffset
  7577. };
  7578. }
  7579. function Be(t) {
  7580. return ee(I$1(t)).left + We(t).scrollLeft;
  7581. }
  7582. function Ft(t) {
  7583. var e = H(t), n = I$1(t), r = e.visualViewport, o = n.clientWidth, i = n.clientHeight, a = 0, s = 0;
  7584. return r && (o = r.width, i = r.height, /^((?!chrome|android).)*safari/i.test(navigator.userAgent) || (a = r.offsetLeft, s = r.offsetTop)), {
  7585. width: o,
  7586. height: i,
  7587. x: a + Be(t),
  7588. y: s
  7589. };
  7590. }
  7591. function Ut(t) {
  7592. 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;
  7593. return N$1(o || n).direction === "rtl" && (s += X$1(n.clientWidth, o ? o.clientWidth : 0) - i), {
  7594. width: i,
  7595. height: a,
  7596. x: s,
  7597. y: f
  7598. };
  7599. }
  7600. function Se(t) {
  7601. var e = N$1(t), n = e.overflow, r = e.overflowX, o = e.overflowY;
  7602. return /auto|scroll|overlay|hidden/.test(n + o + r);
  7603. }
  7604. function dt(t) {
  7605. return [
  7606. "html",
  7607. "body",
  7608. "#document"
  7609. ].indexOf(C(t)) >= 0 ? t.ownerDocument.body : B(t) && Se(t) ? t : dt(ge(t));
  7610. }
  7611. function ce(t, e) {
  7612. var n;
  7613. e === void 0 && (e = []);
  7614. 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);
  7615. return o ? s : s.concat(ce(ge(a)));
  7616. }
  7617. function Te(t) {
  7618. return Object.assign({}, t, {
  7619. left: t.x,
  7620. top: t.y,
  7621. right: t.x + t.width,
  7622. bottom: t.y + t.height
  7623. });
  7624. }
  7625. function Xt(t) {
  7626. var e = ee(t);
  7627. 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;
  7628. }
  7629. function ht(t, e) {
  7630. return e === je ? Te(Ft(t)) : Q(e) ? Xt(e) : Te(Ut(I$1(t)));
  7631. }
  7632. function Yt(t) {
  7633. var e = ce(ge(t)), r = ["absolute", "fixed"].indexOf(N$1(t).position) >= 0 && B(t) ? se(t) : t;
  7634. return Q(r) ? e.filter(function(o) {
  7635. return Q(o) && it(o, r) && C(o) !== "body";
  7636. }) : [];
  7637. }
  7638. function Gt(t, e, n) {
  7639. var r = e === "clippingParents" ? Yt(t) : [].concat(e), o = [].concat(r, [n]), i = o[0], a = o.reduce(function(s, f) {
  7640. var c = ht(t, f);
  7641. 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;
  7642. }, ht(t, i));
  7643. return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
  7644. }
  7645. function mt(t) {
  7646. 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;
  7647. switch (o) {
  7648. case E$1:
  7649. f = {
  7650. x: a,
  7651. y: e.y - n.height
  7652. };
  7653. break;
  7654. case R:
  7655. f = {
  7656. x: a,
  7657. y: e.y + e.height
  7658. };
  7659. break;
  7660. case W:
  7661. f = {
  7662. x: e.x + e.width,
  7663. y: s
  7664. };
  7665. break;
  7666. case P$1:
  7667. f = {
  7668. x: e.x - n.width,
  7669. y: s
  7670. };
  7671. break;
  7672. default: f = {
  7673. x: e.x,
  7674. y: e.y
  7675. };
  7676. }
  7677. var c = o ? Le(o) : null;
  7678. if (c != null) {
  7679. var u = c === "y" ? "height" : "width";
  7680. switch (i) {
  7681. case U:
  7682. f[c] = f[c] - (e[u] / 2 - n[u] / 2);
  7683. break;
  7684. case J:
  7685. f[c] = f[c] + (e[u] / 2 - n[u] / 2);
  7686. break;
  7687. }
  7688. }
  7689. return f;
  7690. }
  7691. function ne(t, e) {
  7692. e === void 0 && (e = {});
  7693. 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({
  7694. reference: d,
  7695. element: x,
  7696. strategy: "absolute",
  7697. placement: o
  7698. }), w = Te(Object.assign({}, x, b)), O = u === K ? w : d, j = {
  7699. top: $.top - O.top + p.top,
  7700. bottom: O.bottom - $.bottom + p.bottom,
  7701. left: $.left - O.left + p.left,
  7702. right: O.right - $.right + p.right
  7703. }, A = t.modifiersData.offset;
  7704. if (u === K && A) {
  7705. var k = A[o];
  7706. Object.keys(j).forEach(function(D) {
  7707. var S = [W, R].indexOf(D) >= 0 ? 1 : -1, L = [E$1, R].indexOf(D) >= 0 ? "y" : "x";
  7708. j[D] += k[L] * S;
  7709. });
  7710. }
  7711. return j;
  7712. }
  7713. function Jt(t, e) {
  7714. e === void 0 && (e = {});
  7715. 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) {
  7716. return te(h) === u;
  7717. }) : G, v = m.filter(function(h) {
  7718. return c.indexOf(h) >= 0;
  7719. });
  7720. v.length === 0 && (v = m);
  7721. var l = v.reduce(function(h, p) {
  7722. return h[p] = ne(t, {
  7723. placement: p,
  7724. boundary: o,
  7725. rootBoundary: i,
  7726. padding: a
  7727. })[q(p)], h;
  7728. }, {});
  7729. return Object.keys(l).sort(function(h, p) {
  7730. return l[h] - l[p];
  7731. });
  7732. }
  7733. function Kt(t) {
  7734. if (q(t) === me) return [];
  7735. var e = be(t);
  7736. return [
  7737. lt(t),
  7738. e,
  7739. lt(e)
  7740. ];
  7741. }
  7742. function Qt(t) {
  7743. var e = t.state, n = t.options, r = t.name;
  7744. if (!e.modifiersData[r]._skip) {
  7745. 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, y = q(g) === g, $ = f || (y || !h ? [be(g)] : Kt(g)), d = [g].concat($).reduce(function(z, V) {
  7746. return z.concat(q(V) === me ? Jt(e, {
  7747. placement: V,
  7748. boundary: u,
  7749. rootBoundary: m,
  7750. padding: c,
  7751. flipVariations: h,
  7752. allowedAutoPlacements: p
  7753. }) : V);
  7754. }, []), b = e.rects.reference, w = e.rects.popper, O = /* @__PURE__ */ new Map(), j = !0, A = d[0], k = 0; k < d.length; k++) {
  7755. var D = d[k], S = q(D), L = te(D) === U, re = [E$1, R].indexOf(S) >= 0, oe = re ? "width" : "height", M = ne(e, {
  7756. placement: D,
  7757. boundary: u,
  7758. rootBoundary: m,
  7759. altBoundary: v,
  7760. padding: c
  7761. }), T = re ? L ? W : P$1 : L ? R : E$1;
  7762. b[oe] > w[oe] && (T = be(T));
  7763. var pe = be(T), _ = [];
  7764. if (i && _.push(M[S] <= 0), s && _.push(M[T] <= 0, M[pe] <= 0), _.every(function(z) {
  7765. return z;
  7766. })) {
  7767. A = D, j = !1;
  7768. break;
  7769. }
  7770. O.set(D, _);
  7771. }
  7772. if (j) {
  7773. for (var ue = h ? 3 : 1, xe = function(z) {
  7774. var V = d.find(function(de) {
  7775. var ae = O.get(de);
  7776. if (ae) return ae.slice(0, z).every(function(Y) {
  7777. return Y;
  7778. });
  7779. });
  7780. if (V) return A = V, "break";
  7781. }, ie = ue; ie > 0; ie--) if (xe(ie) === "break") break;
  7782. }
  7783. e.placement !== A && (e.modifiersData[r]._skip = !0, e.placement = A, e.reset = !0);
  7784. }
  7785. }
  7786. var vt = {
  7787. name: "flip",
  7788. enabled: !0,
  7789. phase: "main",
  7790. fn: Qt,
  7791. requiresIfExists: ["offset"],
  7792. data: { _skip: !1 }
  7793. };
  7794. function gt(t, e, n) {
  7795. return n === void 0 && (n = {
  7796. x: 0,
  7797. y: 0
  7798. }), {
  7799. top: t.top - e.height - n.y,
  7800. right: t.right - e.width + n.x,
  7801. bottom: t.bottom - e.height + n.y,
  7802. left: t.left - e.width - n.x
  7803. };
  7804. }
  7805. function yt(t) {
  7806. return [
  7807. E$1,
  7808. W,
  7809. R,
  7810. P$1
  7811. ].some(function(e) {
  7812. return t[e] >= 0;
  7813. });
  7814. }
  7815. function Zt(t) {
  7816. 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);
  7817. e.modifiersData[n] = {
  7818. referenceClippingOffsets: f,
  7819. popperEscapeOffsets: c,
  7820. isReferenceHidden: u,
  7821. hasPopperEscaped: m
  7822. }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
  7823. "data-popper-reference-hidden": u,
  7824. "data-popper-escaped": m
  7825. });
  7826. }
  7827. var bt = {
  7828. name: "hide",
  7829. enabled: !0,
  7830. phase: "main",
  7831. requiresIfExists: ["preventOverflow"],
  7832. fn: Zt
  7833. };
  7834. function en(t, e, n) {
  7835. 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];
  7836. return a = a || 0, s = (s || 0) * o, [P$1, W].indexOf(r) >= 0 ? {
  7837. x: s,
  7838. y: a
  7839. } : {
  7840. x: a,
  7841. y: s
  7842. };
  7843. }
  7844. function tn(t) {
  7845. 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) {
  7846. return u[m] = en(m, e.rects, i), u;
  7847. }, {}), s = a[e.placement], f = s.x, c = s.y;
  7848. e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += f, e.modifiersData.popperOffsets.y += c), e.modifiersData[r] = a;
  7849. }
  7850. var wt = {
  7851. name: "offset",
  7852. enabled: !0,
  7853. phase: "main",
  7854. requires: ["popperOffsets"],
  7855. fn: tn
  7856. };
  7857. function nn(t) {
  7858. var e = t.state, n = t.name;
  7859. e.modifiersData[n] = mt({
  7860. reference: e.rects.reference,
  7861. element: e.rects.popper,
  7862. strategy: "absolute",
  7863. placement: e.placement
  7864. });
  7865. }
  7866. var He = {
  7867. name: "popperOffsets",
  7868. enabled: !0,
  7869. phase: "read",
  7870. fn: nn,
  7871. data: {}
  7872. };
  7873. function rn(t) {
  7874. return t === "x" ? "y" : "x";
  7875. }
  7876. function on(t) {
  7877. 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, {
  7878. boundary: f,
  7879. rootBoundary: c,
  7880. padding: m,
  7881. altBoundary: u
  7882. }), 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" ? {
  7883. mainAxis: A,
  7884. altAxis: A
  7885. } : Object.assign({
  7886. mainAxis: 0,
  7887. altAxis: 0
  7888. }, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, S = {
  7889. x: 0,
  7890. y: 0
  7891. };
  7892. if (w) {
  7893. if (i) {
  7894. 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 ? O[M] : j[M], ie = y === U ? -j[M] : -O[M], le = e.elements.arrow, z = l && le ? ke(le) : {
  7895. width: 0,
  7896. height: 0
  7897. }, 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) : _);
  7898. w[d] = qe, S[d] = qe - T;
  7899. }
  7900. if (s) {
  7901. 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);
  7902. w[b] = Ue, S[b] = Ue - F;
  7903. }
  7904. e.modifiersData[r] = S;
  7905. }
  7906. }
  7907. var xt = {
  7908. name: "preventOverflow",
  7909. enabled: !0,
  7910. phase: "main",
  7911. fn: on,
  7912. requiresIfExists: ["offset"]
  7913. };
  7914. function an(t) {
  7915. return {
  7916. scrollLeft: t.scrollLeft,
  7917. scrollTop: t.scrollTop
  7918. };
  7919. }
  7920. function sn(t) {
  7921. return t === H(t) || !B(t) ? We(t) : an(t);
  7922. }
  7923. function fn(t) {
  7924. var e = t.getBoundingClientRect(), n = Z(e.width) / t.offsetWidth || 1, r = Z(e.height) / t.offsetHeight || 1;
  7925. return n !== 1 || r !== 1;
  7926. }
  7927. function cn(t, e, n) {
  7928. n === void 0 && (n = !1);
  7929. var r = B(e), o = B(e) && fn(e), i = I$1(e), a = ee(t, o), s = {
  7930. scrollLeft: 0,
  7931. scrollTop: 0
  7932. }, f = {
  7933. x: 0,
  7934. y: 0
  7935. };
  7936. 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))), {
  7937. x: a.left + s.scrollLeft - f.x,
  7938. y: a.top + s.scrollTop - f.y,
  7939. width: a.width,
  7940. height: a.height
  7941. };
  7942. }
  7943. function pn(t) {
  7944. var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
  7945. t.forEach(function(i) {
  7946. e.set(i.name, i);
  7947. });
  7948. function o(i) {
  7949. n.add(i.name);
  7950. [].concat(i.requires || [], i.requiresIfExists || []).forEach(function(s) {
  7951. if (!n.has(s)) {
  7952. var f = e.get(s);
  7953. f && o(f);
  7954. }
  7955. }), r.push(i);
  7956. }
  7957. return t.forEach(function(i) {
  7958. n.has(i.name) || o(i);
  7959. }), r;
  7960. }
  7961. function un(t) {
  7962. var e = pn(t);
  7963. return ot.reduce(function(n, r) {
  7964. return n.concat(e.filter(function(o) {
  7965. return o.phase === r;
  7966. }));
  7967. }, []);
  7968. }
  7969. function ln(t) {
  7970. var e;
  7971. return function() {
  7972. return e || (e = new Promise(function(n) {
  7973. Promise.resolve().then(function() {
  7974. e = void 0, n(t());
  7975. });
  7976. })), e;
  7977. };
  7978. }
  7979. function dn(t) {
  7980. var e = t.reduce(function(n, r) {
  7981. var o = n[r.name];
  7982. return n[r.name] = o ? Object.assign({}, o, r, {
  7983. options: Object.assign({}, o.options, r.options),
  7984. data: Object.assign({}, o.data, r.data)
  7985. }) : r, n;
  7986. }, {});
  7987. return Object.keys(e).map(function(n) {
  7988. return e[n];
  7989. });
  7990. }
  7991. var Ot = {
  7992. placement: "bottom",
  7993. modifiers: [],
  7994. strategy: "absolute"
  7995. };
  7996. function $t() {
  7997. for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
  7998. return !e.some(function(r) {
  7999. return !(r && typeof r.getBoundingClientRect == "function");
  8000. });
  8001. }
  8002. function we(t) {
  8003. t === void 0 && (t = {});
  8004. var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, o = e.defaultOptions, i = o === void 0 ? Ot : o;
  8005. return function(a, s, f) {
  8006. f === void 0 && (f = i);
  8007. var c = {
  8008. placement: "bottom",
  8009. orderedModifiers: [],
  8010. options: Object.assign({}, Ot, i),
  8011. modifiersData: {},
  8012. elements: {
  8013. reference: a,
  8014. popper: s
  8015. },
  8016. attributes: {},
  8017. styles: {}
  8018. }, u = [], m = !1, v = {
  8019. state: c,
  8020. setOptions: function(p) {
  8021. var g = typeof p == "function" ? p(c.options) : p;
  8022. h(), c.options = Object.assign({}, i, c.options, g), c.scrollParents = {
  8023. reference: Q(a) ? ce(a) : a.contextElement ? ce(a.contextElement) : [],
  8024. popper: ce(s)
  8025. };
  8026. var x = un(dn([].concat(r, c.options.modifiers)));
  8027. return c.orderedModifiers = x.filter(function(y) {
  8028. return y.enabled;
  8029. }), l(), v.update();
  8030. },
  8031. forceUpdate: function() {
  8032. if (!m) {
  8033. var p = c.elements, g = p.reference, x = p.popper;
  8034. if ($t(g, x)) {
  8035. c.rects = {
  8036. reference: cn(g, se(x), c.options.strategy === "fixed"),
  8037. popper: ke(x)
  8038. }, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(j) {
  8039. return c.modifiersData[j.name] = Object.assign({}, j.data);
  8040. });
  8041. for (var y = 0; y < c.orderedModifiers.length; y++) {
  8042. if (c.reset === !0) {
  8043. c.reset = !1, y = -1;
  8044. continue;
  8045. }
  8046. var $ = c.orderedModifiers[y], d = $.fn, b = $.options, w = b === void 0 ? {} : b, O = $.name;
  8047. typeof d == "function" && (c = d({
  8048. state: c,
  8049. options: w,
  8050. name: O,
  8051. instance: v
  8052. }) || c);
  8053. }
  8054. }
  8055. }
  8056. },
  8057. update: ln(function() {
  8058. return new Promise(function(p) {
  8059. v.forceUpdate(), p(c);
  8060. });
  8061. }),
  8062. destroy: function() {
  8063. h(), m = !0;
  8064. }
  8065. };
  8066. if (!$t(a, s)) return v;
  8067. v.setOptions(f).then(function(p) {
  8068. !m && f.onFirstUpdate && f.onFirstUpdate(p);
  8069. });
  8070. function l() {
  8071. c.orderedModifiers.forEach(function(p) {
  8072. var g = p.name, x = p.options, y = x === void 0 ? {} : x, $ = p.effect;
  8073. if (typeof $ == "function") {
  8074. var d = $({
  8075. state: c,
  8076. name: g,
  8077. instance: v,
  8078. options: y
  8079. }), b = function() {};
  8080. u.push(d || b);
  8081. }
  8082. });
  8083. }
  8084. function h() {
  8085. u.forEach(function(p) {
  8086. return p();
  8087. }), u = [];
  8088. }
  8089. return v;
  8090. };
  8091. }
  8092. var hn = we(), vn = we({ defaultModifiers: [
  8093. Re,
  8094. He,
  8095. Me,
  8096. Ae
  8097. ] }), yn = we({ defaultModifiers: [
  8098. Re,
  8099. He,
  8100. Me,
  8101. Ae,
  8102. wt,
  8103. vt,
  8104. xt,
  8105. pt,
  8106. bt
  8107. ] });
  8108. //#endregion
  8109. //#region ../../packages/hooks/use-popper/index.ts
  8110. const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
  8111. const stateUpdater = {
  8112. name: "updateState",
  8113. enabled: true,
  8114. phase: "write",
  8115. fn: ({ state }) => {
  8116. const derivedState = deriveState(state);
  8117. Object.assign(states.value, derivedState);
  8118. },
  8119. requires: ["computeStyles"]
  8120. };
  8121. const options = (0, vue.computed)(() => {
  8122. const { onFirstUpdate, placement, strategy, modifiers } = (0, vue.unref)(opts);
  8123. return {
  8124. onFirstUpdate,
  8125. placement: placement || "bottom",
  8126. strategy: strategy || "absolute",
  8127. modifiers: [
  8128. ...modifiers || [],
  8129. stateUpdater,
  8130. {
  8131. name: "applyStyles",
  8132. enabled: false
  8133. }
  8134. ]
  8135. };
  8136. });
  8137. const instanceRef = (0, vue.shallowRef)();
  8138. const states = (0, vue.ref)({
  8139. styles: {
  8140. popper: {
  8141. position: (0, vue.unref)(options).strategy,
  8142. left: "0",
  8143. top: "0"
  8144. },
  8145. arrow: { position: "absolute" }
  8146. },
  8147. attributes: {}
  8148. });
  8149. const destroy = () => {
  8150. if (!instanceRef.value) return;
  8151. instanceRef.value.destroy();
  8152. instanceRef.value = void 0;
  8153. };
  8154. (0, vue.watch)(options, (newOptions) => {
  8155. const instance = (0, vue.unref)(instanceRef);
  8156. if (instance) instance.setOptions(newOptions);
  8157. }, { deep: true });
  8158. (0, vue.watch)([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
  8159. destroy();
  8160. if (!referenceElement || !popperElement) return;
  8161. instanceRef.value = yn(referenceElement, popperElement, (0, vue.unref)(options));
  8162. });
  8163. (0, vue.onBeforeUnmount)(() => {
  8164. destroy();
  8165. });
  8166. return {
  8167. state: (0, vue.computed)(() => ({ ...(0, vue.unref)(instanceRef)?.state || {} })),
  8168. styles: (0, vue.computed)(() => (0, vue.unref)(states).styles),
  8169. attributes: (0, vue.computed)(() => (0, vue.unref)(states).attributes),
  8170. update: () => (0, vue.unref)(instanceRef)?.update(),
  8171. forceUpdate: () => (0, vue.unref)(instanceRef)?.forceUpdate(),
  8172. instanceRef: (0, vue.computed)(() => (0, vue.unref)(instanceRef))
  8173. };
  8174. };
  8175. function deriveState(state) {
  8176. const elements = Object.keys(state.elements);
  8177. return {
  8178. styles: fromPairs(elements.map((element) => [element, state.styles[element] || {}])),
  8179. attributes: fromPairs(elements.map((element) => [element, state.attributes[element]]))
  8180. };
  8181. }
  8182. //#endregion
  8183. //#region ../../packages/hooks/use-same-target/index.ts
  8184. const useSameTarget = (handleClick) => {
  8185. if (!handleClick) return {
  8186. onClick: NOOP,
  8187. onMousedown: NOOP,
  8188. onMouseup: NOOP
  8189. };
  8190. let mousedownTarget = false;
  8191. let mouseupTarget = false;
  8192. const onClick = (e) => {
  8193. if (mousedownTarget && mouseupTarget) handleClick(e);
  8194. mousedownTarget = mouseupTarget = false;
  8195. };
  8196. const onMousedown = (e) => {
  8197. mousedownTarget = e.target === e.currentTarget;
  8198. };
  8199. const onMouseup = (e) => {
  8200. mouseupTarget = e.target === e.currentTarget;
  8201. };
  8202. return {
  8203. onClick,
  8204. onMousedown,
  8205. onMouseup
  8206. };
  8207. };
  8208. //#endregion
  8209. //#region ../../packages/hooks/use-teleport/index.ts
  8210. const useTeleport = (contentRenderer, appendToBody) => {
  8211. const isTeleportVisible = (0, vue.ref)(false);
  8212. if (!isClient) return {
  8213. isTeleportVisible,
  8214. showTeleport: NOOP,
  8215. hideTeleport: NOOP,
  8216. renderTeleport: NOOP
  8217. };
  8218. let $el = null;
  8219. const showTeleport = () => {
  8220. isTeleportVisible.value = true;
  8221. if ($el !== null) return;
  8222. $el = createGlobalNode();
  8223. };
  8224. const hideTeleport = () => {
  8225. isTeleportVisible.value = false;
  8226. if ($el !== null) {
  8227. removeGlobalNode($el);
  8228. $el = null;
  8229. }
  8230. };
  8231. const renderTeleport = () => {
  8232. return appendToBody.value !== true ? contentRenderer() : isTeleportVisible.value ? [(0, vue.h)(vue.Teleport, { to: $el }, contentRenderer())] : void 0;
  8233. };
  8234. (0, vue.onUnmounted)(hideTeleport);
  8235. return {
  8236. isTeleportVisible,
  8237. showTeleport,
  8238. hideTeleport,
  8239. renderTeleport
  8240. };
  8241. };
  8242. //#endregion
  8243. //#region ../../packages/hooks/use-throttle-render/index.ts
  8244. const useThrottleRender = (loading, throttle = 0) => {
  8245. if (throttle === 0) return loading;
  8246. const throttled = (0, vue.ref)(isObject$1(throttle) && Boolean(throttle.initVal));
  8247. let timeoutHandle = null;
  8248. const dispatchThrottling = (timer) => {
  8249. if (isUndefined(timer)) {
  8250. throttled.value = loading.value;
  8251. return;
  8252. }
  8253. if (timeoutHandle) clearTimeout(timeoutHandle);
  8254. timeoutHandle = setTimeout(() => {
  8255. throttled.value = loading.value;
  8256. }, timer);
  8257. };
  8258. const dispatcher = (type) => {
  8259. if (type === "leading") if (isNumber(throttle)) dispatchThrottling(throttle);
  8260. else dispatchThrottling(throttle.leading);
  8261. else if (isObject$1(throttle)) dispatchThrottling(throttle.trailing);
  8262. else throttled.value = false;
  8263. };
  8264. (0, vue.onMounted)(() => dispatcher("leading"));
  8265. (0, vue.watch)(() => loading.value, (val) => {
  8266. dispatcher(val ? "leading" : "trailing");
  8267. });
  8268. return throttled;
  8269. };
  8270. //#endregion
  8271. //#region ../../packages/hooks/use-timeout/index.ts
  8272. function useTimeout() {
  8273. let timeoutHandle;
  8274. const registerTimeout = (fn, delay) => {
  8275. cancelTimeout();
  8276. timeoutHandle = window.setTimeout(fn, delay);
  8277. };
  8278. const cancelTimeout = () => window.clearTimeout(timeoutHandle);
  8279. tryOnScopeDispose(() => cancelTimeout());
  8280. return {
  8281. registerTimeout,
  8282. cancelTimeout
  8283. };
  8284. }
  8285. //#endregion
  8286. //#region ../../packages/hooks/use-transition-fallthrough/index.ts
  8287. /* istanbul ignore file */
  8288. const AFTER_APPEAR = "after-appear";
  8289. const AFTER_ENTER = "after-enter";
  8290. const AFTER_LEAVE = "after-leave";
  8291. const APPEAR = "appear";
  8292. const APPEAR_CANCELLED = "appear-cancelled";
  8293. const BEFORE_ENTER = "before-enter";
  8294. const BEFORE_LEAVE = "before-leave";
  8295. const ENTER = "enter";
  8296. const ENTER_CANCELLED = "enter-cancelled";
  8297. const LEAVE = "leave";
  8298. const LEAVE_CANCELLED = "leave-cancelled";
  8299. const useTransitionFallthroughEmits = [
  8300. AFTER_APPEAR,
  8301. AFTER_ENTER,
  8302. AFTER_LEAVE,
  8303. APPEAR,
  8304. APPEAR_CANCELLED,
  8305. BEFORE_ENTER,
  8306. BEFORE_LEAVE,
  8307. ENTER,
  8308. ENTER_CANCELLED,
  8309. LEAVE,
  8310. LEAVE_CANCELLED
  8311. ];
  8312. /**
  8313. * NOTE:
  8314. * This is only a delegator for delegating transition callbacks.
  8315. * Use this at your need.
  8316. */
  8317. /**
  8318. * Simple usage
  8319. *
  8320. * In your setups:
  8321. *
  8322. * setup() {
  8323. * const fallthroughMethods = useTransitionFallthrough()
  8324. * return fallthrough
  8325. * }
  8326. *
  8327. * In your template:
  8328. *
  8329. * <template>
  8330. * <transition name="whatever" v-bind="fallthrough">
  8331. * <slot />
  8332. * </transition>
  8333. * </template>
  8334. *
  8335. */
  8336. const useTransitionFallthrough = () => {
  8337. const { emit } = (0, vue.getCurrentInstance)();
  8338. return {
  8339. onAfterAppear: () => {
  8340. emit(AFTER_APPEAR);
  8341. },
  8342. onAfterEnter: () => {
  8343. emit(AFTER_ENTER);
  8344. },
  8345. onAfterLeave: () => {
  8346. emit(AFTER_LEAVE);
  8347. },
  8348. onAppearCancelled: () => {
  8349. emit(APPEAR_CANCELLED);
  8350. },
  8351. onBeforeEnter: () => {
  8352. emit(BEFORE_ENTER);
  8353. },
  8354. onBeforeLeave: () => {
  8355. emit(BEFORE_LEAVE);
  8356. },
  8357. onEnter: () => {
  8358. emit(ENTER);
  8359. },
  8360. onEnterCancelled: () => {
  8361. emit(ENTER_CANCELLED);
  8362. },
  8363. onLeave: () => {
  8364. emit(LEAVE);
  8365. },
  8366. onLeaveCancelled: () => {
  8367. emit(LEAVE_CANCELLED);
  8368. }
  8369. };
  8370. };
  8371. //#endregion
  8372. //#region ../../packages/hooks/use-id/index.ts
  8373. const defaultIdInjection = {
  8374. prefix: Math.floor(Math.random() * 1e4),
  8375. current: 0
  8376. };
  8377. const ID_INJECTION_KEY = Symbol("elIdInjection");
  8378. const useIdInjection = () => {
  8379. return (0, vue.getCurrentInstance)() ? (0, vue.inject)(ID_INJECTION_KEY, defaultIdInjection) : defaultIdInjection;
  8380. };
  8381. const useId = (deterministicId) => {
  8382. const idInjection = useIdInjection();
  8383. if (!isClient && idInjection === defaultIdInjection) /* @__PURE__ */ debugWarn("IdInjection", `Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
  8384. usage: app.provide(ID_INJECTION_KEY, {
  8385. prefix: number,
  8386. current: number,
  8387. })`);
  8388. const namespace = useGetDerivedNamespace();
  8389. return computedEager(() => (0, vue.unref)(deterministicId) || `${namespace.value}-id-${idInjection.prefix}-${idInjection.current++}`);
  8390. };
  8391. //#endregion
  8392. //#region ../../packages/hooks/use-escape-keydown/index.ts
  8393. let registeredEscapeHandlers = [];
  8394. const cachedHandler = (event) => {
  8395. if (getEventCode(event) === EVENT_CODE.esc) registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
  8396. };
  8397. const useEscapeKeydown = (handler) => {
  8398. (0, vue.onMounted)(() => {
  8399. if (registeredEscapeHandlers.length === 0) document.addEventListener("keydown", cachedHandler);
  8400. if (isClient) registeredEscapeHandlers.push(handler);
  8401. });
  8402. (0, vue.onBeforeUnmount)(() => {
  8403. registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
  8404. if (registeredEscapeHandlers.length === 0) {
  8405. if (isClient) document.removeEventListener("keydown", cachedHandler);
  8406. }
  8407. });
  8408. };
  8409. //#endregion
  8410. //#region ../../packages/hooks/use-popper-container/index.ts
  8411. const usePopperContainerId = () => {
  8412. const namespace = useGetDerivedNamespace();
  8413. const idInjection = useIdInjection();
  8414. const id = (0, vue.computed)(() => {
  8415. return `${namespace.value}-popper-container-${idInjection.prefix}`;
  8416. });
  8417. return {
  8418. id,
  8419. selector: (0, vue.computed)(() => `#${id.value}`)
  8420. };
  8421. };
  8422. const createContainer = (id) => {
  8423. const container = document.createElement("div");
  8424. container.id = id;
  8425. document.body.appendChild(container);
  8426. return container;
  8427. };
  8428. const usePopperContainer = () => {
  8429. const { id, selector } = usePopperContainerId();
  8430. (0, vue.onBeforeMount)(() => {
  8431. if (!isClient) return;
  8432. if (!document.body.querySelector(selector.value)) createContainer(id.value);
  8433. });
  8434. return {
  8435. id,
  8436. selector
  8437. };
  8438. };
  8439. //#endregion
  8440. //#region ../../packages/hooks/use-intermediate-render/index.ts
  8441. const useDelayedRender = ({ indicator, intermediateIndicator, shouldSetIntermediate = () => true, beforeShow, afterShow, afterHide, beforeHide }) => {
  8442. (0, vue.watch)(() => (0, vue.unref)(indicator), (val) => {
  8443. if (val) {
  8444. beforeShow?.();
  8445. (0, vue.nextTick)(() => {
  8446. if (!(0, vue.unref)(indicator)) return;
  8447. if (shouldSetIntermediate("show")) intermediateIndicator.value = true;
  8448. });
  8449. } else {
  8450. beforeHide?.();
  8451. (0, vue.nextTick)(() => {
  8452. if ((0, vue.unref)(indicator)) return;
  8453. if (shouldSetIntermediate("hide")) intermediateIndicator.value = false;
  8454. });
  8455. }
  8456. });
  8457. (0, vue.watch)(() => intermediateIndicator.value, (val) => {
  8458. if (val) afterShow?.();
  8459. else afterHide?.();
  8460. });
  8461. };
  8462. //#endregion
  8463. //#region ../../packages/hooks/use-delayed-toggle/index.ts
  8464. /**
  8465. * @deprecated Removed after 3.0.0, Use `UseDelayedToggleProps` instead.
  8466. */
  8467. const useDelayedToggleProps = buildProps({
  8468. showAfter: {
  8469. type: Number,
  8470. default: 0
  8471. },
  8472. hideAfter: {
  8473. type: Number,
  8474. default: 200
  8475. },
  8476. autoClose: {
  8477. type: Number,
  8478. default: 0
  8479. }
  8480. });
  8481. const useDelayedTogglePropsDefaults = {
  8482. showAfter: 0,
  8483. hideAfter: 200,
  8484. autoClose: 0
  8485. };
  8486. const useDelayedToggle = ({ showAfter, hideAfter, autoClose, open, close }) => {
  8487. const { registerTimeout } = useTimeout();
  8488. const { registerTimeout: registerTimeoutForAutoClose, cancelTimeout: cancelTimeoutForAutoClose } = useTimeout();
  8489. const onOpen = (event, delay = (0, vue.unref)(showAfter)) => {
  8490. registerTimeout(() => {
  8491. open(event);
  8492. const _autoClose = (0, vue.unref)(autoClose);
  8493. if (isNumber(_autoClose) && _autoClose > 0) registerTimeoutForAutoClose(() => {
  8494. close(event);
  8495. }, _autoClose);
  8496. }, delay);
  8497. };
  8498. const onClose = (event, delay = (0, vue.unref)(hideAfter)) => {
  8499. cancelTimeoutForAutoClose();
  8500. registerTimeout(() => {
  8501. close(event);
  8502. }, delay);
  8503. };
  8504. return {
  8505. onOpen,
  8506. onClose
  8507. };
  8508. };
  8509. //#endregion
  8510. //#region ../../packages/hooks/use-forward-ref/index.ts
  8511. const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
  8512. const useForwardRef = (forwardRef) => {
  8513. const setForwardRef = ((el) => {
  8514. forwardRef.value = el;
  8515. });
  8516. (0, vue.provide)(FORWARD_REF_INJECTION_KEY, { setForwardRef });
  8517. };
  8518. const useForwardRefDirective = (setForwardRef) => {
  8519. return {
  8520. mounted(el) {
  8521. setForwardRef(el);
  8522. },
  8523. updated(el) {
  8524. setForwardRef(el);
  8525. },
  8526. unmounted() {
  8527. setForwardRef(null);
  8528. }
  8529. };
  8530. };
  8531. //#endregion
  8532. //#region ../../packages/hooks/use-z-index/index.ts
  8533. const initial = { current: 0 };
  8534. const zIndex = (0, vue.ref)(0);
  8535. const defaultInitialZIndex = 2e3;
  8536. const ZINDEX_INJECTION_KEY = Symbol("elZIndexContextKey");
  8537. const zIndexContextKey = Symbol("zIndexContextKey");
  8538. const useZIndex = (zIndexOverrides) => {
  8539. const increasingInjection = (0, vue.getCurrentInstance)() ? (0, vue.inject)(ZINDEX_INJECTION_KEY, initial) : initial;
  8540. const zIndexInjection = zIndexOverrides || ((0, vue.getCurrentInstance)() ? (0, vue.inject)(zIndexContextKey, void 0) : void 0);
  8541. const initialZIndex = (0, vue.computed)(() => {
  8542. const zIndexFromInjection = (0, vue.unref)(zIndexInjection);
  8543. return isNumber(zIndexFromInjection) ? zIndexFromInjection : defaultInitialZIndex;
  8544. });
  8545. const currentZIndex = (0, vue.computed)(() => initialZIndex.value + zIndex.value);
  8546. const nextZIndex = () => {
  8547. increasingInjection.current++;
  8548. zIndex.value = increasingInjection.current;
  8549. return currentZIndex.value;
  8550. };
  8551. if (!isClient && !(0, vue.inject)(ZINDEX_INJECTION_KEY)) /* @__PURE__ */ debugWarn("ZIndexInjection", `Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
  8552. usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`);
  8553. return {
  8554. initialZIndex,
  8555. currentZIndex,
  8556. nextZIndex
  8557. };
  8558. };
  8559. //#endregion
  8560. //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
  8561. const min$1 = Math.min;
  8562. const max$1 = Math.max;
  8563. const round = Math.round;
  8564. const floor$1 = Math.floor;
  8565. const createCoords = (v) => ({
  8566. x: v,
  8567. y: v
  8568. });
  8569. const oppositeSideMap = {
  8570. left: "right",
  8571. right: "left",
  8572. bottom: "top",
  8573. top: "bottom"
  8574. };
  8575. const oppositeAlignmentMap = {
  8576. start: "end",
  8577. end: "start"
  8578. };
  8579. function clamp(start, value, end) {
  8580. return max$1(start, min$1(value, end));
  8581. }
  8582. function evaluate(value, param) {
  8583. return typeof value === "function" ? value(param) : value;
  8584. }
  8585. function getSide(placement) {
  8586. return placement.split("-")[0];
  8587. }
  8588. function getAlignment(placement) {
  8589. return placement.split("-")[1];
  8590. }
  8591. function getOppositeAxis(axis) {
  8592. return axis === "x" ? "y" : "x";
  8593. }
  8594. function getAxisLength(axis) {
  8595. return axis === "y" ? "height" : "width";
  8596. }
  8597. const yAxisSides = /* @__PURE__ */ new Set(["top", "bottom"]);
  8598. function getSideAxis(placement) {
  8599. return yAxisSides.has(getSide(placement)) ? "y" : "x";
  8600. }
  8601. function getAlignmentAxis(placement) {
  8602. return getOppositeAxis(getSideAxis(placement));
  8603. }
  8604. function getAlignmentSides(placement, rects, rtl) {
  8605. if (rtl === void 0) rtl = false;
  8606. const alignment = getAlignment(placement);
  8607. const alignmentAxis = getAlignmentAxis(placement);
  8608. const length = getAxisLength(alignmentAxis);
  8609. let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
  8610. if (rects.reference[length] > rects.floating[length]) mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
  8611. return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
  8612. }
  8613. function getExpandedPlacements(placement) {
  8614. const oppositePlacement = getOppositePlacement(placement);
  8615. return [
  8616. getOppositeAlignmentPlacement(placement),
  8617. oppositePlacement,
  8618. getOppositeAlignmentPlacement(oppositePlacement)
  8619. ];
  8620. }
  8621. function getOppositeAlignmentPlacement(placement) {
  8622. return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
  8623. }
  8624. const lrPlacement = ["left", "right"];
  8625. const rlPlacement = ["right", "left"];
  8626. const tbPlacement = ["top", "bottom"];
  8627. const btPlacement = ["bottom", "top"];
  8628. function getSideList(side, isStart, rtl) {
  8629. switch (side) {
  8630. case "top":
  8631. case "bottom":
  8632. if (rtl) return isStart ? rlPlacement : lrPlacement;
  8633. return isStart ? lrPlacement : rlPlacement;
  8634. case "left":
  8635. case "right": return isStart ? tbPlacement : btPlacement;
  8636. default: return [];
  8637. }
  8638. }
  8639. function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
  8640. const alignment = getAlignment(placement);
  8641. let list = getSideList(getSide(placement), direction === "start", rtl);
  8642. if (alignment) {
  8643. list = list.map((side) => side + "-" + alignment);
  8644. if (flipAlignment) list = list.concat(list.map(getOppositeAlignmentPlacement));
  8645. }
  8646. return list;
  8647. }
  8648. function getOppositePlacement(placement) {
  8649. return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
  8650. }
  8651. function expandPaddingObject(padding) {
  8652. return {
  8653. top: 0,
  8654. right: 0,
  8655. bottom: 0,
  8656. left: 0,
  8657. ...padding
  8658. };
  8659. }
  8660. function getPaddingObject(padding) {
  8661. return typeof padding !== "number" ? expandPaddingObject(padding) : {
  8662. top: padding,
  8663. right: padding,
  8664. bottom: padding,
  8665. left: padding
  8666. };
  8667. }
  8668. function rectToClientRect(rect) {
  8669. const { x, y, width, height } = rect;
  8670. return {
  8671. width,
  8672. height,
  8673. top: y,
  8674. left: x,
  8675. right: x + width,
  8676. bottom: y + height,
  8677. x,
  8678. y
  8679. };
  8680. }
  8681. //#endregion
  8682. //#region ../../node_modules/.pnpm/@floating-ui+core@1.7.3/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
  8683. function computeCoordsFromPlacement(_ref, placement, rtl) {
  8684. let { reference, floating } = _ref;
  8685. const sideAxis = getSideAxis(placement);
  8686. const alignmentAxis = getAlignmentAxis(placement);
  8687. const alignLength = getAxisLength(alignmentAxis);
  8688. const side = getSide(placement);
  8689. const isVertical = sideAxis === "y";
  8690. const commonX = reference.x + reference.width / 2 - floating.width / 2;
  8691. const commonY = reference.y + reference.height / 2 - floating.height / 2;
  8692. const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
  8693. let coords;
  8694. switch (side) {
  8695. case "top":
  8696. coords = {
  8697. x: commonX,
  8698. y: reference.y - floating.height
  8699. };
  8700. break;
  8701. case "bottom":
  8702. coords = {
  8703. x: commonX,
  8704. y: reference.y + reference.height
  8705. };
  8706. break;
  8707. case "right":
  8708. coords = {
  8709. x: reference.x + reference.width,
  8710. y: commonY
  8711. };
  8712. break;
  8713. case "left":
  8714. coords = {
  8715. x: reference.x - floating.width,
  8716. y: commonY
  8717. };
  8718. break;
  8719. default: coords = {
  8720. x: reference.x,
  8721. y: reference.y
  8722. };
  8723. }
  8724. switch (getAlignment(placement)) {
  8725. case "start":
  8726. coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
  8727. break;
  8728. case "end":
  8729. coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
  8730. break;
  8731. }
  8732. return coords;
  8733. }
  8734. /**
  8735. * Computes the `x` and `y` coordinates that will place the floating element
  8736. * next to a given reference element.
  8737. *
  8738. * This export does not have any `platform` interface logic. You will need to
  8739. * write one for the platform you are using Floating UI with.
  8740. */
  8741. const computePosition$1 = async (reference, floating, config) => {
  8742. const { placement = "bottom", strategy = "absolute", middleware = [], platform } = config;
  8743. const validMiddleware = middleware.filter(Boolean);
  8744. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
  8745. let rects = await platform.getElementRects({
  8746. reference,
  8747. floating,
  8748. strategy
  8749. });
  8750. let { x, y } = computeCoordsFromPlacement(rects, placement, rtl);
  8751. let statefulPlacement = placement;
  8752. let middlewareData = {};
  8753. let resetCount = 0;
  8754. for (let i = 0; i < validMiddleware.length; i++) {
  8755. const { name, fn } = validMiddleware[i];
  8756. const { x: nextX, y: nextY, data, reset } = await fn({
  8757. x,
  8758. y,
  8759. initialPlacement: placement,
  8760. placement: statefulPlacement,
  8761. strategy,
  8762. middlewareData,
  8763. rects,
  8764. platform,
  8765. elements: {
  8766. reference,
  8767. floating
  8768. }
  8769. });
  8770. x = nextX != null ? nextX : x;
  8771. y = nextY != null ? nextY : y;
  8772. middlewareData = {
  8773. ...middlewareData,
  8774. [name]: {
  8775. ...middlewareData[name],
  8776. ...data
  8777. }
  8778. };
  8779. if (reset && resetCount <= 50) {
  8780. resetCount++;
  8781. if (typeof reset === "object") {
  8782. if (reset.placement) statefulPlacement = reset.placement;
  8783. if (reset.rects) rects = reset.rects === true ? await platform.getElementRects({
  8784. reference,
  8785. floating,
  8786. strategy
  8787. }) : reset.rects;
  8788. ({x, y} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
  8789. }
  8790. i = -1;
  8791. }
  8792. }
  8793. return {
  8794. x,
  8795. y,
  8796. placement: statefulPlacement,
  8797. strategy,
  8798. middlewareData
  8799. };
  8800. };
  8801. /**
  8802. * Resolves with an object of overflow side offsets that determine how much the
  8803. * element is overflowing a given clipping boundary on each side.
  8804. * - positive = overflowing the boundary by that number of pixels
  8805. * - negative = how many pixels left before it will overflow
  8806. * - 0 = lies flush with the boundary
  8807. * @see https://floating-ui.com/docs/detectOverflow
  8808. */
  8809. async function detectOverflow$1(state, options) {
  8810. var _await$platform$isEle;
  8811. if (options === void 0) options = {};
  8812. const { x, y, platform, rects, elements, strategy } = state;
  8813. const { boundary = "clippingAncestors", rootBoundary = "viewport", elementContext = "floating", altBoundary = false, padding = 0 } = evaluate(options, state);
  8814. const paddingObject = getPaddingObject(padding);
  8815. const element = elements[altBoundary ? elementContext === "floating" ? "reference" : "floating" : elementContext];
  8816. const clippingClientRect = rectToClientRect(await platform.getClippingRect({
  8817. element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating)),
  8818. boundary,
  8819. rootBoundary,
  8820. strategy
  8821. }));
  8822. const rect = elementContext === "floating" ? {
  8823. x,
  8824. y,
  8825. width: rects.floating.width,
  8826. height: rects.floating.height
  8827. } : rects.reference;
  8828. const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
  8829. const offsetScale = await (platform.isElement == null ? void 0 : platform.isElement(offsetParent)) ? await (platform.getScale == null ? void 0 : platform.getScale(offsetParent)) || {
  8830. x: 1,
  8831. y: 1
  8832. } : {
  8833. x: 1,
  8834. y: 1
  8835. };
  8836. const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
  8837. elements,
  8838. rect,
  8839. offsetParent,
  8840. strategy
  8841. }) : rect);
  8842. return {
  8843. top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
  8844. bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
  8845. left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
  8846. right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
  8847. };
  8848. }
  8849. /**
  8850. * Provides data to position an inner element of the floating element so that it
  8851. * appears centered to the reference element.
  8852. * @see https://floating-ui.com/docs/arrow
  8853. */
  8854. const arrow$1 = (options) => ({
  8855. name: "arrow",
  8856. options,
  8857. async fn(state) {
  8858. const { x, y, placement, rects, platform, elements, middlewareData } = state;
  8859. const { element, padding = 0 } = evaluate(options, state) || {};
  8860. if (element == null) return {};
  8861. const paddingObject = getPaddingObject(padding);
  8862. const coords = {
  8863. x,
  8864. y
  8865. };
  8866. const axis = getAlignmentAxis(placement);
  8867. const length = getAxisLength(axis);
  8868. const arrowDimensions = await platform.getDimensions(element);
  8869. const isYAxis = axis === "y";
  8870. const minProp = isYAxis ? "top" : "left";
  8871. const maxProp = isYAxis ? "bottom" : "right";
  8872. const clientProp = isYAxis ? "clientHeight" : "clientWidth";
  8873. const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
  8874. const startDiff = coords[axis] - rects.reference[axis];
  8875. const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
  8876. let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
  8877. if (!clientSize || !await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent))) clientSize = elements.floating[clientProp] || rects.floating[length];
  8878. const centerToReference = endDiff / 2 - startDiff / 2;
  8879. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
  8880. const minPadding = min$1(paddingObject[minProp], largestPossiblePadding);
  8881. const maxPadding = min$1(paddingObject[maxProp], largestPossiblePadding);
  8882. const min$1$1 = minPadding;
  8883. const max = clientSize - arrowDimensions[length] - maxPadding;
  8884. const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
  8885. const offset = clamp(min$1$1, center, max);
  8886. const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
  8887. const alignmentOffset = shouldAddOffset ? center < min$1$1 ? center - min$1$1 : center - max : 0;
  8888. return {
  8889. [axis]: coords[axis] + alignmentOffset,
  8890. data: {
  8891. [axis]: offset,
  8892. centerOffset: center - offset - alignmentOffset,
  8893. ...shouldAddOffset && { alignmentOffset }
  8894. },
  8895. reset: shouldAddOffset
  8896. };
  8897. }
  8898. });
  8899. /**
  8900. * Optimizes the visibility of the floating element by flipping the `placement`
  8901. * in order to keep it in view when the preferred placement(s) will overflow the
  8902. * clipping boundary. Alternative to `autoPlacement`.
  8903. * @see https://floating-ui.com/docs/flip
  8904. */
  8905. const flip$1 = function(options) {
  8906. if (options === void 0) options = {};
  8907. return {
  8908. name: "flip",
  8909. options,
  8910. async fn(state) {
  8911. var _middlewareData$arrow, _middlewareData$flip;
  8912. const { placement, middlewareData, rects, initialPlacement, platform, elements } = state;
  8913. const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = "bestFit", fallbackAxisSideDirection = "none", flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state);
  8914. if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
  8915. const side = getSide(placement);
  8916. const initialSideAxis = getSideAxis(initialPlacement);
  8917. const isBasePlacement = getSide(initialPlacement) === initialPlacement;
  8918. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
  8919. const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
  8920. const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
  8921. if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
  8922. const placements = [initialPlacement, ...fallbackPlacements];
  8923. const overflow = await detectOverflow$1(state, detectOverflowOptions);
  8924. const overflows = [];
  8925. let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
  8926. if (checkMainAxis) overflows.push(overflow[side]);
  8927. if (checkCrossAxis) {
  8928. const sides = getAlignmentSides(placement, rects, rtl);
  8929. overflows.push(overflow[sides[0]], overflow[sides[1]]);
  8930. }
  8931. overflowsData = [...overflowsData, {
  8932. placement,
  8933. overflows
  8934. }];
  8935. if (!overflows.every((side) => side <= 0)) {
  8936. var _middlewareData$flip2, _overflowsData$filter;
  8937. const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
  8938. const nextPlacement = placements[nextIndex];
  8939. if (nextPlacement) {
  8940. if (!(checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false) || overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) return {
  8941. data: {
  8942. index: nextIndex,
  8943. overflows: overflowsData
  8944. },
  8945. reset: { placement: nextPlacement }
  8946. };
  8947. }
  8948. let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
  8949. if (!resetPlacement) switch (fallbackStrategy) {
  8950. case "bestFit": {
  8951. var _overflowsData$filter2;
  8952. const placement = (_overflowsData$filter2 = overflowsData.filter((d) => {
  8953. if (hasFallbackAxisSideDirection) {
  8954. const currentSideAxis = getSideAxis(d.placement);
  8955. return currentSideAxis === initialSideAxis || currentSideAxis === "y";
  8956. }
  8957. return true;
  8958. }).map((d) => [d.placement, d.overflows.filter((overflow) => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
  8959. if (placement) resetPlacement = placement;
  8960. break;
  8961. }
  8962. case "initialPlacement":
  8963. resetPlacement = initialPlacement;
  8964. break;
  8965. }
  8966. if (placement !== resetPlacement) return { reset: { placement: resetPlacement } };
  8967. }
  8968. return {};
  8969. }
  8970. };
  8971. };
  8972. const originSides = /* @__PURE__ */ new Set(["left", "top"]);
  8973. async function convertValueToCoords(state, options) {
  8974. const { placement, platform, elements } = state;
  8975. const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
  8976. const side = getSide(placement);
  8977. const alignment = getAlignment(placement);
  8978. const isVertical = getSideAxis(placement) === "y";
  8979. const mainAxisMulti = originSides.has(side) ? -1 : 1;
  8980. const crossAxisMulti = rtl && isVertical ? -1 : 1;
  8981. const rawValue = evaluate(options, state);
  8982. let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === "number" ? {
  8983. mainAxis: rawValue,
  8984. crossAxis: 0,
  8985. alignmentAxis: null
  8986. } : {
  8987. mainAxis: rawValue.mainAxis || 0,
  8988. crossAxis: rawValue.crossAxis || 0,
  8989. alignmentAxis: rawValue.alignmentAxis
  8990. };
  8991. if (alignment && typeof alignmentAxis === "number") crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
  8992. return isVertical ? {
  8993. x: crossAxis * crossAxisMulti,
  8994. y: mainAxis * mainAxisMulti
  8995. } : {
  8996. x: mainAxis * mainAxisMulti,
  8997. y: crossAxis * crossAxisMulti
  8998. };
  8999. }
  9000. /**
  9001. * Modifies the placement by translating the floating element along the
  9002. * specified axes.
  9003. * A number (shorthand for `mainAxis` or distance), or an axes configuration
  9004. * object may be passed.
  9005. * @see https://floating-ui.com/docs/offset
  9006. */
  9007. const offset$1 = function(options) {
  9008. if (options === void 0) options = 0;
  9009. return {
  9010. name: "offset",
  9011. options,
  9012. async fn(state) {
  9013. var _middlewareData$offse, _middlewareData$arrow;
  9014. const { x, y, placement, middlewareData } = state;
  9015. const diffCoords = await convertValueToCoords(state, options);
  9016. if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) return {};
  9017. return {
  9018. x: x + diffCoords.x,
  9019. y: y + diffCoords.y,
  9020. data: {
  9021. ...diffCoords,
  9022. placement
  9023. }
  9024. };
  9025. }
  9026. };
  9027. };
  9028. /**
  9029. * Optimizes the visibility of the floating element by shifting it in order to
  9030. * keep it in view when it will overflow the clipping boundary.
  9031. * @see https://floating-ui.com/docs/shift
  9032. */
  9033. const shift$1 = function(options) {
  9034. if (options === void 0) options = {};
  9035. return {
  9036. name: "shift",
  9037. options,
  9038. async fn(state) {
  9039. const { x, y, placement } = state;
  9040. const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: (_ref) => {
  9041. let { x, y } = _ref;
  9042. return {
  9043. x,
  9044. y
  9045. };
  9046. } }, ...detectOverflowOptions } = evaluate(options, state);
  9047. const coords = {
  9048. x,
  9049. y
  9050. };
  9051. const overflow = await detectOverflow$1(state, detectOverflowOptions);
  9052. const crossAxis = getSideAxis(getSide(placement));
  9053. const mainAxis = getOppositeAxis(crossAxis);
  9054. let mainAxisCoord = coords[mainAxis];
  9055. let crossAxisCoord = coords[crossAxis];
  9056. if (checkMainAxis) {
  9057. const minSide = mainAxis === "y" ? "top" : "left";
  9058. const maxSide = mainAxis === "y" ? "bottom" : "right";
  9059. const min = mainAxisCoord + overflow[minSide];
  9060. const max = mainAxisCoord - overflow[maxSide];
  9061. mainAxisCoord = clamp(min, mainAxisCoord, max);
  9062. }
  9063. if (checkCrossAxis) {
  9064. const minSide = crossAxis === "y" ? "top" : "left";
  9065. const maxSide = crossAxis === "y" ? "bottom" : "right";
  9066. const min = crossAxisCoord + overflow[minSide];
  9067. const max = crossAxisCoord - overflow[maxSide];
  9068. crossAxisCoord = clamp(min, crossAxisCoord, max);
  9069. }
  9070. const limitedCoords = limiter.fn({
  9071. ...state,
  9072. [mainAxis]: mainAxisCoord,
  9073. [crossAxis]: crossAxisCoord
  9074. });
  9075. return {
  9076. ...limitedCoords,
  9077. data: {
  9078. x: limitedCoords.x - x,
  9079. y: limitedCoords.y - y,
  9080. enabled: {
  9081. [mainAxis]: checkMainAxis,
  9082. [crossAxis]: checkCrossAxis
  9083. }
  9084. }
  9085. };
  9086. }
  9087. };
  9088. };
  9089. //#endregion
  9090. //#region ../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
  9091. function hasWindow() {
  9092. return typeof window !== "undefined";
  9093. }
  9094. function getNodeName(node) {
  9095. if (isNode(node)) return (node.nodeName || "").toLowerCase();
  9096. return "#document";
  9097. }
  9098. function getWindow(node) {
  9099. var _node$ownerDocument;
  9100. return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
  9101. }
  9102. function getDocumentElement(node) {
  9103. var _ref;
  9104. return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
  9105. }
  9106. function isNode(value) {
  9107. if (!hasWindow()) return false;
  9108. return value instanceof Node || value instanceof getWindow(value).Node;
  9109. }
  9110. function isElement(value) {
  9111. if (!hasWindow()) return false;
  9112. return value instanceof Element || value instanceof getWindow(value).Element;
  9113. }
  9114. function isHTMLElement(value) {
  9115. if (!hasWindow()) return false;
  9116. return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
  9117. }
  9118. function isShadowRoot(value) {
  9119. if (!hasWindow() || typeof ShadowRoot === "undefined") return false;
  9120. return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
  9121. }
  9122. const invalidOverflowDisplayValues = /* @__PURE__ */ new Set(["inline", "contents"]);
  9123. function isOverflowElement(element) {
  9124. const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element);
  9125. return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display);
  9126. }
  9127. const tableElements = /* @__PURE__ */ new Set([
  9128. "table",
  9129. "td",
  9130. "th"
  9131. ]);
  9132. function isTableElement(element) {
  9133. return tableElements.has(getNodeName(element));
  9134. }
  9135. const topLayerSelectors = [":popover-open", ":modal"];
  9136. function isTopLayer(element) {
  9137. return topLayerSelectors.some((selector) => {
  9138. try {
  9139. return element.matches(selector);
  9140. } catch (_e) {
  9141. return false;
  9142. }
  9143. });
  9144. }
  9145. const transformProperties = [
  9146. "transform",
  9147. "translate",
  9148. "scale",
  9149. "rotate",
  9150. "perspective"
  9151. ];
  9152. const willChangeValues = [
  9153. "transform",
  9154. "translate",
  9155. "scale",
  9156. "rotate",
  9157. "perspective",
  9158. "filter"
  9159. ];
  9160. const containValues = [
  9161. "paint",
  9162. "layout",
  9163. "strict",
  9164. "content"
  9165. ];
  9166. function isContainingBlock(elementOrCss) {
  9167. const webkit = isWebKit();
  9168. const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
  9169. return transformProperties.some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || willChangeValues.some((value) => (css.willChange || "").includes(value)) || containValues.some((value) => (css.contain || "").includes(value));
  9170. }
  9171. function getContainingBlock(element) {
  9172. let currentNode = getParentNode(element);
  9173. while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
  9174. if (isContainingBlock(currentNode)) return currentNode;
  9175. else if (isTopLayer(currentNode)) return null;
  9176. currentNode = getParentNode(currentNode);
  9177. }
  9178. return null;
  9179. }
  9180. function isWebKit() {
  9181. if (typeof CSS === "undefined" || !CSS.supports) return false;
  9182. return CSS.supports("-webkit-backdrop-filter", "none");
  9183. }
  9184. const lastTraversableNodeNames = /* @__PURE__ */ new Set([
  9185. "html",
  9186. "body",
  9187. "#document"
  9188. ]);
  9189. function isLastTraversableNode(node) {
  9190. return lastTraversableNodeNames.has(getNodeName(node));
  9191. }
  9192. function getComputedStyle$1(element) {
  9193. return getWindow(element).getComputedStyle(element);
  9194. }
  9195. function getNodeScroll(element) {
  9196. if (isElement(element)) return {
  9197. scrollLeft: element.scrollLeft,
  9198. scrollTop: element.scrollTop
  9199. };
  9200. return {
  9201. scrollLeft: element.scrollX,
  9202. scrollTop: element.scrollY
  9203. };
  9204. }
  9205. function getParentNode(node) {
  9206. if (getNodeName(node) === "html") return node;
  9207. const result = node.assignedSlot || node.parentNode || isShadowRoot(node) && node.host || getDocumentElement(node);
  9208. return isShadowRoot(result) ? result.host : result;
  9209. }
  9210. function getNearestOverflowAncestor(node) {
  9211. const parentNode = getParentNode(node);
  9212. if (isLastTraversableNode(parentNode)) return node.ownerDocument ? node.ownerDocument.body : node.body;
  9213. if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) return parentNode;
  9214. return getNearestOverflowAncestor(parentNode);
  9215. }
  9216. function getOverflowAncestors(node, list, traverseIframes) {
  9217. var _node$ownerDocument2;
  9218. if (list === void 0) list = [];
  9219. if (traverseIframes === void 0) traverseIframes = true;
  9220. const scrollableAncestor = getNearestOverflowAncestor(node);
  9221. const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
  9222. const win = getWindow(scrollableAncestor);
  9223. if (isBody) {
  9224. const frameElement = getFrameElement(win);
  9225. return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
  9226. }
  9227. return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
  9228. }
  9229. function getFrameElement(win) {
  9230. return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
  9231. }
  9232. //#endregion
  9233. //#region ../../node_modules/.pnpm/@floating-ui+dom@1.7.4/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
  9234. function getCssDimensions(element) {
  9235. const css = getComputedStyle$1(element);
  9236. let width = parseFloat(css.width) || 0;
  9237. let height = parseFloat(css.height) || 0;
  9238. const hasOffset = isHTMLElement(element);
  9239. const offsetWidth = hasOffset ? element.offsetWidth : width;
  9240. const offsetHeight = hasOffset ? element.offsetHeight : height;
  9241. const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
  9242. if (shouldFallback) {
  9243. width = offsetWidth;
  9244. height = offsetHeight;
  9245. }
  9246. return {
  9247. width,
  9248. height,
  9249. $: shouldFallback
  9250. };
  9251. }
  9252. function unwrapElement(element) {
  9253. return !isElement(element) ? element.contextElement : element;
  9254. }
  9255. function getScale(element) {
  9256. const domElement = unwrapElement(element);
  9257. if (!isHTMLElement(domElement)) return createCoords(1);
  9258. const rect = domElement.getBoundingClientRect();
  9259. const { width, height, $ } = getCssDimensions(domElement);
  9260. let x = ($ ? round(rect.width) : rect.width) / width;
  9261. let y = ($ ? round(rect.height) : rect.height) / height;
  9262. if (!x || !Number.isFinite(x)) x = 1;
  9263. if (!y || !Number.isFinite(y)) y = 1;
  9264. return {
  9265. x,
  9266. y
  9267. };
  9268. }
  9269. const noOffsets = /* @__PURE__ */ createCoords(0);
  9270. function getVisualOffsets(element) {
  9271. const win = getWindow(element);
  9272. if (!isWebKit() || !win.visualViewport) return noOffsets;
  9273. return {
  9274. x: win.visualViewport.offsetLeft,
  9275. y: win.visualViewport.offsetTop
  9276. };
  9277. }
  9278. function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
  9279. if (isFixed === void 0) isFixed = false;
  9280. if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) return false;
  9281. return isFixed;
  9282. }
  9283. function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
  9284. if (includeScale === void 0) includeScale = false;
  9285. if (isFixedStrategy === void 0) isFixedStrategy = false;
  9286. const clientRect = element.getBoundingClientRect();
  9287. const domElement = unwrapElement(element);
  9288. let scale = createCoords(1);
  9289. if (includeScale) if (offsetParent) {
  9290. if (isElement(offsetParent)) scale = getScale(offsetParent);
  9291. } else scale = getScale(element);
  9292. const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
  9293. let x = (clientRect.left + visualOffsets.x) / scale.x;
  9294. let y = (clientRect.top + visualOffsets.y) / scale.y;
  9295. let width = clientRect.width / scale.x;
  9296. let height = clientRect.height / scale.y;
  9297. if (domElement) {
  9298. const win = getWindow(domElement);
  9299. const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
  9300. let currentWin = win;
  9301. let currentIFrame = getFrameElement(currentWin);
  9302. while (currentIFrame && offsetParent && offsetWin !== currentWin) {
  9303. const iframeScale = getScale(currentIFrame);
  9304. const iframeRect = currentIFrame.getBoundingClientRect();
  9305. const css = getComputedStyle$1(currentIFrame);
  9306. const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
  9307. const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
  9308. x *= iframeScale.x;
  9309. y *= iframeScale.y;
  9310. width *= iframeScale.x;
  9311. height *= iframeScale.y;
  9312. x += left;
  9313. y += top;
  9314. currentWin = getWindow(currentIFrame);
  9315. currentIFrame = getFrameElement(currentWin);
  9316. }
  9317. }
  9318. return rectToClientRect({
  9319. width,
  9320. height,
  9321. x,
  9322. y
  9323. });
  9324. }
  9325. function getWindowScrollBarX(element, rect) {
  9326. const leftScroll = getNodeScroll(element).scrollLeft;
  9327. if (!rect) return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
  9328. return rect.left + leftScroll;
  9329. }
  9330. function getHTMLOffset(documentElement, scroll) {
  9331. const htmlRect = documentElement.getBoundingClientRect();
  9332. return {
  9333. x: htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect),
  9334. y: htmlRect.top + scroll.scrollTop
  9335. };
  9336. }
  9337. function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
  9338. let { elements, rect, offsetParent, strategy } = _ref;
  9339. const isFixed = strategy === "fixed";
  9340. const documentElement = getDocumentElement(offsetParent);
  9341. const topLayer = elements ? isTopLayer(elements.floating) : false;
  9342. if (offsetParent === documentElement || topLayer && isFixed) return rect;
  9343. let scroll = {
  9344. scrollLeft: 0,
  9345. scrollTop: 0
  9346. };
  9347. let scale = createCoords(1);
  9348. const offsets = createCoords(0);
  9349. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9350. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  9351. if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
  9352. if (isHTMLElement(offsetParent)) {
  9353. const offsetRect = getBoundingClientRect(offsetParent);
  9354. scale = getScale(offsetParent);
  9355. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9356. offsets.y = offsetRect.y + offsetParent.clientTop;
  9357. }
  9358. }
  9359. const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
  9360. return {
  9361. width: rect.width * scale.x,
  9362. height: rect.height * scale.y,
  9363. x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
  9364. y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
  9365. };
  9366. }
  9367. function getClientRects(element) {
  9368. return Array.from(element.getClientRects());
  9369. }
  9370. function getDocumentRect(element) {
  9371. const html = getDocumentElement(element);
  9372. const scroll = getNodeScroll(element);
  9373. const body = element.ownerDocument.body;
  9374. const width = max$1(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
  9375. const height = max$1(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
  9376. let x = -scroll.scrollLeft + getWindowScrollBarX(element);
  9377. const y = -scroll.scrollTop;
  9378. if (getComputedStyle$1(body).direction === "rtl") x += max$1(html.clientWidth, body.clientWidth) - width;
  9379. return {
  9380. width,
  9381. height,
  9382. x,
  9383. y
  9384. };
  9385. }
  9386. const SCROLLBAR_MAX = 25;
  9387. function getViewportRect(element, strategy) {
  9388. const win = getWindow(element);
  9389. const html = getDocumentElement(element);
  9390. const visualViewport = win.visualViewport;
  9391. let width = html.clientWidth;
  9392. let height = html.clientHeight;
  9393. let x = 0;
  9394. let y = 0;
  9395. if (visualViewport) {
  9396. width = visualViewport.width;
  9397. height = visualViewport.height;
  9398. const visualViewportBased = isWebKit();
  9399. if (!visualViewportBased || visualViewportBased && strategy === "fixed") {
  9400. x = visualViewport.offsetLeft;
  9401. y = visualViewport.offsetTop;
  9402. }
  9403. }
  9404. const windowScrollbarX = getWindowScrollBarX(html);
  9405. if (windowScrollbarX <= 0) {
  9406. const doc = html.ownerDocument;
  9407. const body = doc.body;
  9408. const bodyStyles = getComputedStyle(body);
  9409. const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
  9410. const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
  9411. if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) width -= clippingStableScrollbarWidth;
  9412. } else if (windowScrollbarX <= SCROLLBAR_MAX) width += windowScrollbarX;
  9413. return {
  9414. width,
  9415. height,
  9416. x,
  9417. y
  9418. };
  9419. }
  9420. const absoluteOrFixed = /* @__PURE__ */ new Set(["absolute", "fixed"]);
  9421. function getInnerBoundingClientRect(element, strategy) {
  9422. const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
  9423. const top = clientRect.top + element.clientTop;
  9424. const left = clientRect.left + element.clientLeft;
  9425. const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
  9426. return {
  9427. width: element.clientWidth * scale.x,
  9428. height: element.clientHeight * scale.y,
  9429. x: left * scale.x,
  9430. y: top * scale.y
  9431. };
  9432. }
  9433. function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
  9434. let rect;
  9435. if (clippingAncestor === "viewport") rect = getViewportRect(element, strategy);
  9436. else if (clippingAncestor === "document") rect = getDocumentRect(getDocumentElement(element));
  9437. else if (isElement(clippingAncestor)) rect = getInnerBoundingClientRect(clippingAncestor, strategy);
  9438. else {
  9439. const visualOffsets = getVisualOffsets(element);
  9440. rect = {
  9441. x: clippingAncestor.x - visualOffsets.x,
  9442. y: clippingAncestor.y - visualOffsets.y,
  9443. width: clippingAncestor.width,
  9444. height: clippingAncestor.height
  9445. };
  9446. }
  9447. return rectToClientRect(rect);
  9448. }
  9449. function hasFixedPositionAncestor(element, stopNode) {
  9450. const parentNode = getParentNode(element);
  9451. if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) return false;
  9452. return getComputedStyle$1(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode);
  9453. }
  9454. function getClippingElementAncestors(element, cache) {
  9455. const cachedResult = cache.get(element);
  9456. if (cachedResult) return cachedResult;
  9457. let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
  9458. let currentContainingBlockComputedStyle = null;
  9459. const elementIsFixed = getComputedStyle$1(element).position === "fixed";
  9460. let currentNode = elementIsFixed ? getParentNode(element) : element;
  9461. while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
  9462. const computedStyle = getComputedStyle$1(currentNode);
  9463. const currentNodeIsContaining = isContainingBlock(currentNode);
  9464. if (!currentNodeIsContaining && computedStyle.position === "fixed") currentContainingBlockComputedStyle = null;
  9465. if (elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && absoluteOrFixed.has(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode)) result = result.filter((ancestor) => ancestor !== currentNode);
  9466. else currentContainingBlockComputedStyle = computedStyle;
  9467. currentNode = getParentNode(currentNode);
  9468. }
  9469. cache.set(element, result);
  9470. return result;
  9471. }
  9472. function getClippingRect(_ref) {
  9473. let { element, boundary, rootBoundary, strategy } = _ref;
  9474. const clippingAncestors = [...boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary), rootBoundary];
  9475. const firstClippingAncestor = clippingAncestors[0];
  9476. const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
  9477. const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
  9478. accRect.top = max$1(rect.top, accRect.top);
  9479. accRect.right = min$1(rect.right, accRect.right);
  9480. accRect.bottom = min$1(rect.bottom, accRect.bottom);
  9481. accRect.left = max$1(rect.left, accRect.left);
  9482. return accRect;
  9483. }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
  9484. return {
  9485. width: clippingRect.right - clippingRect.left,
  9486. height: clippingRect.bottom - clippingRect.top,
  9487. x: clippingRect.left,
  9488. y: clippingRect.top
  9489. };
  9490. }
  9491. function getDimensions(element) {
  9492. const { width, height } = getCssDimensions(element);
  9493. return {
  9494. width,
  9495. height
  9496. };
  9497. }
  9498. function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
  9499. const isOffsetParentAnElement = isHTMLElement(offsetParent);
  9500. const documentElement = getDocumentElement(offsetParent);
  9501. const isFixed = strategy === "fixed";
  9502. const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
  9503. let scroll = {
  9504. scrollLeft: 0,
  9505. scrollTop: 0
  9506. };
  9507. const offsets = createCoords(0);
  9508. function setLeftRTLScrollbarOffset() {
  9509. offsets.x = getWindowScrollBarX(documentElement);
  9510. }
  9511. if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
  9512. if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) scroll = getNodeScroll(offsetParent);
  9513. if (isOffsetParentAnElement) {
  9514. const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
  9515. offsets.x = offsetRect.x + offsetParent.clientLeft;
  9516. offsets.y = offsetRect.y + offsetParent.clientTop;
  9517. } else if (documentElement) setLeftRTLScrollbarOffset();
  9518. }
  9519. if (isFixed && !isOffsetParentAnElement && documentElement) setLeftRTLScrollbarOffset();
  9520. const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
  9521. return {
  9522. x: rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x,
  9523. y: rect.top + scroll.scrollTop - offsets.y - htmlOffset.y,
  9524. width: rect.width,
  9525. height: rect.height
  9526. };
  9527. }
  9528. function isStaticPositioned(element) {
  9529. return getComputedStyle$1(element).position === "static";
  9530. }
  9531. function getTrueOffsetParent(element, polyfill) {
  9532. if (!isHTMLElement(element) || getComputedStyle$1(element).position === "fixed") return null;
  9533. if (polyfill) return polyfill(element);
  9534. let rawOffsetParent = element.offsetParent;
  9535. if (getDocumentElement(element) === rawOffsetParent) rawOffsetParent = rawOffsetParent.ownerDocument.body;
  9536. return rawOffsetParent;
  9537. }
  9538. function getOffsetParent(element, polyfill) {
  9539. const win = getWindow(element);
  9540. if (isTopLayer(element)) return win;
  9541. if (!isHTMLElement(element)) {
  9542. let svgOffsetParent = getParentNode(element);
  9543. while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
  9544. if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) return svgOffsetParent;
  9545. svgOffsetParent = getParentNode(svgOffsetParent);
  9546. }
  9547. return win;
  9548. }
  9549. let offsetParent = getTrueOffsetParent(element, polyfill);
  9550. while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) offsetParent = getTrueOffsetParent(offsetParent, polyfill);
  9551. if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) return win;
  9552. return offsetParent || getContainingBlock(element) || win;
  9553. }
  9554. const getElementRects = async function(data) {
  9555. const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
  9556. const getDimensionsFn = this.getDimensions;
  9557. const floatingDimensions = await getDimensionsFn(data.floating);
  9558. return {
  9559. reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
  9560. floating: {
  9561. x: 0,
  9562. y: 0,
  9563. width: floatingDimensions.width,
  9564. height: floatingDimensions.height
  9565. }
  9566. };
  9567. };
  9568. function isRTL$1(element) {
  9569. return getComputedStyle$1(element).direction === "rtl";
  9570. }
  9571. const platform = {
  9572. convertOffsetParentRelativeRectToViewportRelativeRect,
  9573. getDocumentElement,
  9574. getClippingRect,
  9575. getOffsetParent,
  9576. getElementRects,
  9577. getClientRects,
  9578. getDimensions,
  9579. getScale,
  9580. isElement,
  9581. isRTL: isRTL$1
  9582. };
  9583. function rectsAreEqual(a, b) {
  9584. return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
  9585. }
  9586. function observeMove(element, onMove) {
  9587. let io = null;
  9588. let timeoutId;
  9589. const root = getDocumentElement(element);
  9590. function cleanup() {
  9591. var _io;
  9592. clearTimeout(timeoutId);
  9593. (_io = io) == null || _io.disconnect();
  9594. io = null;
  9595. }
  9596. function refresh(skip, threshold) {
  9597. if (skip === void 0) skip = false;
  9598. if (threshold === void 0) threshold = 1;
  9599. cleanup();
  9600. const elementRectForRootMargin = element.getBoundingClientRect();
  9601. const { left, top, width, height } = elementRectForRootMargin;
  9602. if (!skip) onMove();
  9603. if (!width || !height) return;
  9604. const insetTop = floor$1(top);
  9605. const insetRight = floor$1(root.clientWidth - (left + width));
  9606. const insetBottom = floor$1(root.clientHeight - (top + height));
  9607. const insetLeft = floor$1(left);
  9608. const options = {
  9609. rootMargin: -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px",
  9610. threshold: max$1(0, min$1(1, threshold)) || 1
  9611. };
  9612. let isFirstUpdate = true;
  9613. function handleObserve(entries) {
  9614. const ratio = entries[0].intersectionRatio;
  9615. if (ratio !== threshold) {
  9616. if (!isFirstUpdate) return refresh();
  9617. if (!ratio) timeoutId = setTimeout(() => {
  9618. refresh(false, 1e-7);
  9619. }, 1e3);
  9620. else refresh(false, ratio);
  9621. }
  9622. if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) refresh();
  9623. isFirstUpdate = false;
  9624. }
  9625. try {
  9626. io = new IntersectionObserver(handleObserve, {
  9627. ...options,
  9628. root: root.ownerDocument
  9629. });
  9630. } catch (_e) {
  9631. io = new IntersectionObserver(handleObserve, options);
  9632. }
  9633. io.observe(element);
  9634. }
  9635. refresh(true);
  9636. return cleanup;
  9637. }
  9638. /**
  9639. * Automatically updates the position of the floating element when necessary.
  9640. * Should only be called when the floating element is mounted on the DOM or
  9641. * visible on the screen.
  9642. * @returns cleanup function that should be invoked when the floating element is
  9643. * removed from the DOM or hidden from the screen.
  9644. * @see https://floating-ui.com/docs/autoUpdate
  9645. */
  9646. function autoUpdate(reference, floating, update, options) {
  9647. if (options === void 0) options = {};
  9648. const { ancestorScroll = true, ancestorResize = true, elementResize = typeof ResizeObserver === "function", layoutShift = typeof IntersectionObserver === "function", animationFrame = false } = options;
  9649. const referenceEl = unwrapElement(reference);
  9650. const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
  9651. ancestors.forEach((ancestor) => {
  9652. ancestorScroll && ancestor.addEventListener("scroll", update, { passive: true });
  9653. ancestorResize && ancestor.addEventListener("resize", update);
  9654. });
  9655. const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
  9656. let reobserveFrame = -1;
  9657. let resizeObserver = null;
  9658. if (elementResize) {
  9659. resizeObserver = new ResizeObserver((_ref) => {
  9660. let [firstEntry] = _ref;
  9661. if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
  9662. resizeObserver.unobserve(floating);
  9663. cancelAnimationFrame(reobserveFrame);
  9664. reobserveFrame = requestAnimationFrame(() => {
  9665. var _resizeObserver;
  9666. (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
  9667. });
  9668. }
  9669. update();
  9670. });
  9671. if (referenceEl && !animationFrame) resizeObserver.observe(referenceEl);
  9672. resizeObserver.observe(floating);
  9673. }
  9674. let frameId;
  9675. let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
  9676. if (animationFrame) frameLoop();
  9677. function frameLoop() {
  9678. const nextRefRect = getBoundingClientRect(reference);
  9679. if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) update();
  9680. prevRefRect = nextRefRect;
  9681. frameId = requestAnimationFrame(frameLoop);
  9682. }
  9683. update();
  9684. return () => {
  9685. var _resizeObserver2;
  9686. ancestors.forEach((ancestor) => {
  9687. ancestorScroll && ancestor.removeEventListener("scroll", update);
  9688. ancestorResize && ancestor.removeEventListener("resize", update);
  9689. });
  9690. cleanupIo?.();
  9691. (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
  9692. resizeObserver = null;
  9693. if (animationFrame) cancelAnimationFrame(frameId);
  9694. };
  9695. }
  9696. /**
  9697. * Resolves with an object of overflow side offsets that determine how much the
  9698. * element is overflowing a given clipping boundary on each side.
  9699. * - positive = overflowing the boundary by that number of pixels
  9700. * - negative = how many pixels left before it will overflow
  9701. * - 0 = lies flush with the boundary
  9702. * @see https://floating-ui.com/docs/detectOverflow
  9703. */
  9704. const detectOverflow = detectOverflow$1;
  9705. /**
  9706. * Modifies the placement by translating the floating element along the
  9707. * specified axes.
  9708. * A number (shorthand for `mainAxis` or distance), or an axes configuration
  9709. * object may be passed.
  9710. * @see https://floating-ui.com/docs/offset
  9711. */
  9712. const offset = offset$1;
  9713. /**
  9714. * Optimizes the visibility of the floating element by shifting it in order to
  9715. * keep it in view when it will overflow the clipping boundary.
  9716. * @see https://floating-ui.com/docs/shift
  9717. */
  9718. const shift = shift$1;
  9719. /**
  9720. * Optimizes the visibility of the floating element by flipping the `placement`
  9721. * in order to keep it in view when the preferred placement(s) will overflow the
  9722. * clipping boundary. Alternative to `autoPlacement`.
  9723. * @see https://floating-ui.com/docs/flip
  9724. */
  9725. const flip = flip$1;
  9726. /**
  9727. * Provides data to position an inner element of the floating element so that it
  9728. * appears centered to the reference element.
  9729. * @see https://floating-ui.com/docs/arrow
  9730. */
  9731. const arrow = arrow$1;
  9732. /**
  9733. * Computes the `x` and `y` coordinates that will place the floating element
  9734. * next to a given reference element.
  9735. */
  9736. const computePosition = (reference, floating, options) => {
  9737. const cache = /* @__PURE__ */ new Map();
  9738. const mergedOptions = {
  9739. platform,
  9740. ...options
  9741. };
  9742. const platformWithCache = {
  9743. ...mergedOptions.platform,
  9744. _c: cache
  9745. };
  9746. return computePosition$1(reference, floating, {
  9747. ...mergedOptions,
  9748. platform: platformWithCache
  9749. });
  9750. };
  9751. //#endregion
  9752. //#region ../../packages/hooks/use-floating/index.ts
  9753. const useFloatingProps = buildProps({});
  9754. const unrefReference = (elRef) => {
  9755. if (!isClient) return;
  9756. if (!elRef) return elRef;
  9757. const unrefEl = unrefElement(elRef);
  9758. if (unrefEl) return unrefEl;
  9759. return (0, vue.isRef)(elRef) ? unrefEl : elRef;
  9760. };
  9761. const getPositionDataWithUnit = (record, key) => {
  9762. const value = record?.[key];
  9763. return isNil(value) ? "" : `${value}px`;
  9764. };
  9765. const useFloating = ({ middleware, placement, strategy }) => {
  9766. const referenceRef = (0, vue.ref)();
  9767. const contentRef = (0, vue.ref)();
  9768. const states = {
  9769. x: (0, vue.ref)(),
  9770. y: (0, vue.ref)(),
  9771. placement,
  9772. strategy,
  9773. middlewareData: (0, vue.ref)({})
  9774. };
  9775. const update = async () => {
  9776. if (!isClient) return;
  9777. const referenceEl = unrefReference(referenceRef);
  9778. const contentEl = unrefElement(contentRef);
  9779. if (!referenceEl || !contentEl) return;
  9780. const data = await computePosition(referenceEl, contentEl, {
  9781. placement: (0, vue.unref)(placement),
  9782. strategy: (0, vue.unref)(strategy),
  9783. middleware: (0, vue.unref)(middleware)
  9784. });
  9785. keysOf(states).forEach((key) => {
  9786. states[key].value = data[key];
  9787. });
  9788. };
  9789. (0, vue.onMounted)(() => {
  9790. (0, vue.watchEffect)(() => {
  9791. update();
  9792. });
  9793. });
  9794. return {
  9795. ...states,
  9796. update,
  9797. referenceRef,
  9798. contentRef
  9799. };
  9800. };
  9801. const arrowMiddleware = ({ arrowRef, padding }) => {
  9802. return {
  9803. name: "arrow",
  9804. options: {
  9805. element: arrowRef,
  9806. padding
  9807. },
  9808. fn(args) {
  9809. const arrowEl = (0, vue.unref)(arrowRef);
  9810. if (!arrowEl) return {};
  9811. return arrow({
  9812. element: arrowEl,
  9813. padding
  9814. }).fn(args);
  9815. }
  9816. };
  9817. };
  9818. //#endregion
  9819. //#region ../../packages/hooks/use-cursor/index.ts
  9820. function useCursor(input) {
  9821. let selectionInfo;
  9822. function recordCursor() {
  9823. if (input.value == void 0) return;
  9824. const { selectionStart, selectionEnd, value } = input.value;
  9825. if (selectionStart == null || selectionEnd == null) return;
  9826. selectionInfo = {
  9827. selectionStart,
  9828. selectionEnd,
  9829. value,
  9830. beforeTxt: value.slice(0, Math.max(0, selectionStart)),
  9831. afterTxt: value.slice(Math.max(0, selectionEnd))
  9832. };
  9833. }
  9834. function setCursor() {
  9835. if (input.value == void 0 || selectionInfo == void 0) return;
  9836. const { value } = input.value;
  9837. const { beforeTxt, afterTxt, selectionStart } = selectionInfo;
  9838. if (beforeTxt == void 0 || afterTxt == void 0 || selectionStart == void 0) return;
  9839. let startPos = value.length;
  9840. if (value.endsWith(afterTxt)) startPos = value.length - afterTxt.length;
  9841. else if (value.startsWith(beforeTxt)) startPos = beforeTxt.length;
  9842. else {
  9843. const beforeLastChar = beforeTxt[selectionStart - 1];
  9844. const newIndex = value.indexOf(beforeLastChar, selectionStart - 1);
  9845. if (newIndex !== -1) startPos = newIndex + 1;
  9846. }
  9847. input.value.setSelectionRange(startPos, startPos);
  9848. }
  9849. return [recordCursor, setCursor];
  9850. }
  9851. //#endregion
  9852. //#region ../../packages/hooks/use-ordered-children/index.ts
  9853. const getOrderedChildren = (vm, childComponentName, children) => {
  9854. return flattedChildren(vm.subTree).filter((n) => (0, vue.isVNode)(n) && n.type?.name === childComponentName && !!n.component).map((n) => n.component.uid).map((uid) => children[uid]).filter((p) => !!p);
  9855. };
  9856. const useOrderedChildren = (vm, childComponentName) => {
  9857. const children = (0, vue.shallowRef)({});
  9858. const orderedChildren = (0, vue.shallowRef)([]);
  9859. const nodesMap = /* @__PURE__ */ new WeakMap();
  9860. const addChild = (child) => {
  9861. children.value[child.uid] = child;
  9862. (0, vue.triggerRef)(children);
  9863. (0, vue.onMounted)(() => {
  9864. const childNode = child.getVnode().el;
  9865. const parentNode = childNode.parentNode;
  9866. if (!nodesMap.has(parentNode)) {
  9867. nodesMap.set(parentNode, []);
  9868. const originalFn = parentNode.insertBefore.bind(parentNode);
  9869. parentNode.insertBefore = (node, anchor) => {
  9870. if (nodesMap.get(parentNode).some((el) => node === el || anchor === el)) (0, vue.triggerRef)(children);
  9871. return originalFn(node, anchor);
  9872. };
  9873. }
  9874. nodesMap.get(parentNode).push(childNode);
  9875. });
  9876. };
  9877. const removeChild = (child) => {
  9878. delete children.value[child.uid];
  9879. (0, vue.triggerRef)(children);
  9880. const childNode = child.getVnode().el;
  9881. const parentNode = childNode.parentNode;
  9882. const childNodes = nodesMap.get(parentNode);
  9883. const index = childNodes.indexOf(childNode);
  9884. childNodes.splice(index, 1);
  9885. };
  9886. const sortChildren = () => {
  9887. orderedChildren.value = getOrderedChildren(vm, childComponentName, children.value);
  9888. };
  9889. const IsolatedRenderer = (props) => {
  9890. return props.render();
  9891. };
  9892. return {
  9893. children: orderedChildren,
  9894. addChild,
  9895. removeChild,
  9896. ChildrenSorter: (0, vue.defineComponent)({ setup(_, { slots }) {
  9897. return () => {
  9898. sortChildren();
  9899. return slots.default ? (0, vue.h)(IsolatedRenderer, { render: slots.default }) : null;
  9900. };
  9901. } })
  9902. };
  9903. };
  9904. //#endregion
  9905. //#region ../../packages/hooks/use-size/index.ts
  9906. const useSizeProp = buildProp({
  9907. type: String,
  9908. values: componentSizes,
  9909. required: false
  9910. });
  9911. const useSizeProps = { size: useSizeProp };
  9912. const SIZE_INJECTION_KEY = Symbol("size");
  9913. const useGlobalSize = () => {
  9914. const injectedSize = (0, vue.inject)(SIZE_INJECTION_KEY, {});
  9915. return (0, vue.computed)(() => {
  9916. return (0, vue.unref)(injectedSize.size) || "";
  9917. });
  9918. };
  9919. //#endregion
  9920. //#region ../../packages/hooks/use-focus-controller/index.ts
  9921. function useFocusController(target, { disabled, beforeFocus, afterFocus, beforeBlur, afterBlur } = {}) {
  9922. const { emit } = (0, vue.getCurrentInstance)();
  9923. const wrapperRef = (0, vue.shallowRef)();
  9924. const isFocused = (0, vue.ref)(false);
  9925. const handleFocus = (event) => {
  9926. const cancelFocus = isFunction$1(beforeFocus) ? beforeFocus(event) : false;
  9927. if ((0, vue.unref)(disabled) || isFocused.value || cancelFocus) return;
  9928. isFocused.value = true;
  9929. emit("focus", event);
  9930. afterFocus?.();
  9931. };
  9932. const handleBlur = (event) => {
  9933. const cancelBlur = isFunction$1(beforeBlur) ? beforeBlur(event) : false;
  9934. if ((0, vue.unref)(disabled) || event.relatedTarget && wrapperRef.value?.contains(event.relatedTarget) || cancelBlur) return;
  9935. isFocused.value = false;
  9936. emit("blur", event);
  9937. afterBlur?.();
  9938. };
  9939. const handleClick = (event) => {
  9940. if ((0, vue.unref)(disabled) || isFocusable(event.target) || wrapperRef.value?.contains(document.activeElement) && wrapperRef.value !== document.activeElement) return;
  9941. target.value?.focus();
  9942. };
  9943. (0, vue.watch)([wrapperRef, () => (0, vue.unref)(disabled)], ([el, disabled]) => {
  9944. if (!el) return;
  9945. if (disabled) el.removeAttribute("tabindex");
  9946. else el.setAttribute("tabindex", "-1");
  9947. });
  9948. useEventListener(wrapperRef, "focus", handleFocus, true);
  9949. useEventListener(wrapperRef, "blur", handleBlur, true);
  9950. useEventListener(wrapperRef, "click", handleClick, true);
  9951. return {
  9952. isFocused,
  9953. wrapperRef,
  9954. handleFocus,
  9955. handleBlur
  9956. };
  9957. }
  9958. //#endregion
  9959. //#region ../../packages/hooks/use-composition/index.ts
  9960. function useComposition({ afterComposition, emit }) {
  9961. const isComposing = (0, vue.ref)(false);
  9962. const handleCompositionStart = (event) => {
  9963. emit?.("compositionstart", event);
  9964. isComposing.value = true;
  9965. };
  9966. const handleCompositionUpdate = (event) => {
  9967. emit?.("compositionupdate", event);
  9968. const text = event.target?.value;
  9969. isComposing.value = !isKorean(text[text.length - 1] || "");
  9970. };
  9971. const handleCompositionEnd = (event) => {
  9972. emit?.("compositionend", event);
  9973. if (isComposing.value) {
  9974. isComposing.value = false;
  9975. (0, vue.nextTick)(() => afterComposition(event));
  9976. }
  9977. };
  9978. const handleComposition = (event) => {
  9979. event.type === "compositionend" ? handleCompositionEnd(event) : handleCompositionUpdate(event);
  9980. };
  9981. return {
  9982. isComposing,
  9983. handleComposition,
  9984. handleCompositionStart,
  9985. handleCompositionUpdate,
  9986. handleCompositionEnd
  9987. };
  9988. }
  9989. //#endregion
  9990. //#region ../../packages/hooks/use-empty-values/index.ts
  9991. const emptyValuesContextKey = Symbol("emptyValuesContextKey");
  9992. const SCOPE = "use-empty-values";
  9993. const DEFAULT_EMPTY_VALUES = [
  9994. "",
  9995. void 0,
  9996. null
  9997. ];
  9998. const DEFAULT_VALUE_ON_CLEAR = void 0;
  9999. /**
  10000. * @deprecated Removed after 3.0.0, Use `UseEmptyValuesProps` instead.
  10001. */
  10002. const useEmptyValuesProps = buildProps({
  10003. emptyValues: Array,
  10004. valueOnClear: {
  10005. type: definePropType([
  10006. String,
  10007. Number,
  10008. Boolean,
  10009. Function
  10010. ]),
  10011. default: void 0,
  10012. validator: (val) => {
  10013. val = isFunction$1(val) ? val() : val;
  10014. if (isArray$1(val)) return val.every((item) => !item);
  10015. return !val;
  10016. }
  10017. }
  10018. });
  10019. const useEmptyValues = (props, defaultValue) => {
  10020. const config = (0, vue.getCurrentInstance)() ? (0, vue.inject)(emptyValuesContextKey, (0, vue.ref)({})) : (0, vue.ref)({});
  10021. const emptyValues = (0, vue.computed)(() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES);
  10022. const valueOnClear = (0, vue.computed)(() => {
  10023. if (isFunction$1(props.valueOnClear)) return props.valueOnClear();
  10024. else if (props.valueOnClear !== void 0) return props.valueOnClear;
  10025. else if (isFunction$1(config.value.valueOnClear)) return config.value.valueOnClear();
  10026. else if (config.value.valueOnClear !== void 0) return config.value.valueOnClear;
  10027. return defaultValue !== void 0 ? defaultValue : DEFAULT_VALUE_ON_CLEAR;
  10028. });
  10029. const isEmptyValue = (value) => {
  10030. let result = true;
  10031. if (isArray$1(value)) result = emptyValues.value.some((emptyValue) => {
  10032. return isEqual$1(value, emptyValue);
  10033. });
  10034. else result = emptyValues.value.includes(value);
  10035. return result;
  10036. };
  10037. if (!isEmptyValue(valueOnClear.value)) /* @__PURE__ */ debugWarn(SCOPE, "value-on-clear should be a value of empty-values");
  10038. return {
  10039. emptyValues,
  10040. valueOnClear,
  10041. isEmptyValue
  10042. };
  10043. };
  10044. //#endregion
  10045. //#region ../../packages/hooks/use-aria/index.ts
  10046. /**
  10047. * @deprecated Removed after 3.0.0, Use `AriaProps` instead.
  10048. */
  10049. const ariaProps = buildProps({
  10050. ariaLabel: String,
  10051. ariaOrientation: {
  10052. type: String,
  10053. values: [
  10054. "horizontal",
  10055. "vertical",
  10056. "undefined"
  10057. ]
  10058. },
  10059. ariaControls: String
  10060. });
  10061. const useAriaProps = (arias) => {
  10062. return pick(ariaProps, arias);
  10063. };
  10064. //#endregion
  10065. //#region ../../packages/components/config-provider/src/constants.ts
  10066. const configProviderContextKey = Symbol();
  10067. //#endregion
  10068. //#region ../../packages/components/config-provider/src/hooks/use-global-config.ts
  10069. const globalConfig = (0, vue.ref)();
  10070. function useGlobalConfig(key, defaultValue = void 0) {
  10071. const config = (0, vue.getCurrentInstance)() ? (0, vue.inject)(configProviderContextKey, globalConfig) : globalConfig;
  10072. if (key) return (0, vue.computed)(() => config.value?.[key] ?? defaultValue);
  10073. else return config;
  10074. }
  10075. function useGlobalComponentSettings(block, sizeFallback) {
  10076. const config = useGlobalConfig();
  10077. const ns = useNamespace(block, (0, vue.computed)(() => config.value?.namespace || defaultNamespace));
  10078. const locale = useLocale((0, vue.computed)(() => config.value?.locale));
  10079. const zIndex = useZIndex((0, vue.computed)(() => config.value?.zIndex || defaultInitialZIndex));
  10080. const size = (0, vue.computed)(() => (0, vue.unref)(sizeFallback) || config.value?.size || "");
  10081. provideGlobalConfig((0, vue.computed)(() => (0, vue.unref)(config) || {}));
  10082. return {
  10083. ns,
  10084. locale,
  10085. zIndex,
  10086. size
  10087. };
  10088. }
  10089. const provideGlobalConfig = (config, app, global = false) => {
  10090. const inSetup = !!(0, vue.getCurrentInstance)();
  10091. const oldConfig = inSetup ? useGlobalConfig() : void 0;
  10092. const provideFn = app?.provide ?? (inSetup ? vue.provide : void 0);
  10093. if (!provideFn) {
  10094. /* @__PURE__ */ debugWarn("provideGlobalConfig", "provideGlobalConfig() can only be used inside setup().");
  10095. return;
  10096. }
  10097. const context = (0, vue.computed)(() => {
  10098. const cfg = (0, vue.unref)(config);
  10099. if (!oldConfig?.value) return cfg;
  10100. return mergeConfig(oldConfig.value, cfg);
  10101. });
  10102. provideFn(configProviderContextKey, context);
  10103. provideFn(localeContextKey, (0, vue.computed)(() => context.value.locale));
  10104. provideFn(namespaceContextKey, (0, vue.computed)(() => context.value.namespace));
  10105. provideFn(zIndexContextKey, (0, vue.computed)(() => context.value.zIndex));
  10106. provideFn(SIZE_INJECTION_KEY, { size: (0, vue.computed)(() => context.value.size || "") });
  10107. provideFn(emptyValuesContextKey, (0, vue.computed)(() => ({
  10108. emptyValues: context.value.emptyValues,
  10109. valueOnClear: context.value.valueOnClear
  10110. })));
  10111. if (global || !globalConfig.value) globalConfig.value = context.value;
  10112. return context;
  10113. };
  10114. const mergeConfig = (a, b) => {
  10115. const keys = [...new Set([...keysOf(a), ...keysOf(b)])];
  10116. const obj = {};
  10117. for (const key of keys) obj[key] = b[key] !== void 0 ? b[key] : a[key];
  10118. return obj;
  10119. };
  10120. //#endregion
  10121. //#region ../../packages/components/config-provider/src/config-provider-props.ts
  10122. const configProviderProps = buildProps({
  10123. a11y: {
  10124. type: Boolean,
  10125. default: true
  10126. },
  10127. locale: { type: definePropType(Object) },
  10128. size: useSizeProp,
  10129. button: { type: definePropType(Object) },
  10130. card: { type: definePropType(Object) },
  10131. dialog: { type: definePropType(Object) },
  10132. link: { type: definePropType(Object) },
  10133. experimentalFeatures: { type: definePropType(Object) },
  10134. keyboardNavigation: {
  10135. type: Boolean,
  10136. default: true
  10137. },
  10138. message: { type: definePropType(Object) },
  10139. zIndex: Number,
  10140. namespace: {
  10141. type: String,
  10142. default: "el"
  10143. },
  10144. table: { type: definePropType(Object) },
  10145. ...useEmptyValuesProps
  10146. });
  10147. //#endregion
  10148. //#region ../../packages/components/config-provider/src/config-provider.ts
  10149. const messageConfig = { placement: "top" };
  10150. const ConfigProvider = (0, vue.defineComponent)({
  10151. name: "ElConfigProvider",
  10152. props: configProviderProps,
  10153. setup(props, { slots }) {
  10154. const config = provideGlobalConfig(props);
  10155. (0, vue.watch)(() => props.message, (val) => {
  10156. Object.assign(messageConfig, config?.value?.message ?? {}, val ?? {});
  10157. }, {
  10158. immediate: true,
  10159. deep: true
  10160. });
  10161. return () => (0, vue.renderSlot)(slots, "default", { config: config?.value });
  10162. }
  10163. });
  10164. //#endregion
  10165. //#region ../../packages/components/config-provider/index.ts
  10166. const ElConfigProvider = withInstall(ConfigProvider);
  10167. //#endregion
  10168. //#region ../../packages/element-plus/version.ts
  10169. const version$1 = "2.13.5";
  10170. //#endregion
  10171. //#region ../../packages/element-plus/make-installer.ts
  10172. const makeInstaller = (components = []) => {
  10173. const install = (app, options) => {
  10174. if (app[INSTALLED_KEY]) return;
  10175. app[INSTALLED_KEY] = true;
  10176. components.forEach((c) => app.use(c));
  10177. if (options) provideGlobalConfig(options, app, true);
  10178. };
  10179. return {
  10180. version: version$1,
  10181. install
  10182. };
  10183. };
  10184. //#endregion
  10185. //#region ../../packages/components/teleport/src/teleport.ts
  10186. const teleportProps = buildProps({
  10187. to: {
  10188. type: definePropType([String, Object]),
  10189. required: true
  10190. },
  10191. disabled: Boolean
  10192. });
  10193. //#endregion
  10194. //#region ../../packages/components/teleport/src/teleport.vue?vue&type=script&setup=true&lang.ts
  10195. var teleport_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10196. __name: "teleport",
  10197. props: teleportProps,
  10198. setup(__props) {
  10199. return (_ctx, _cache) => {
  10200. return _ctx.disabled ? (0, vue.renderSlot)(_ctx.$slots, "default", { key: 0 }) : ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Teleport, {
  10201. key: 1,
  10202. to: _ctx.to
  10203. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, ["to"]));
  10204. };
  10205. }
  10206. });
  10207. //#endregion
  10208. //#region ../../packages/components/teleport/src/teleport.vue
  10209. var teleport_default = teleport_vue_vue_type_script_setup_true_lang_default;
  10210. //#endregion
  10211. //#region ../../packages/components/teleport/index.ts
  10212. const ElTeleport = withInstall(teleport_default);
  10213. //#endregion
  10214. //#region ../../packages/components/affix/src/affix.ts
  10215. /**
  10216. * @deprecated Removed after 3.0.0, Use `AffixProps` instead.
  10217. */
  10218. const affixProps = buildProps({
  10219. zIndex: {
  10220. type: definePropType([Number, String]),
  10221. default: 100
  10222. },
  10223. target: {
  10224. type: String,
  10225. default: ""
  10226. },
  10227. offset: {
  10228. type: Number,
  10229. default: 0
  10230. },
  10231. position: {
  10232. type: String,
  10233. values: ["top", "bottom"],
  10234. default: "top"
  10235. },
  10236. teleported: Boolean,
  10237. appendTo: {
  10238. type: teleportProps.to.type,
  10239. default: "body"
  10240. }
  10241. });
  10242. const affixEmits = {
  10243. scroll: ({ scrollTop, fixed }) => isNumber(scrollTop) && isBoolean(fixed),
  10244. [CHANGE_EVENT]: (fixed) => isBoolean(fixed)
  10245. };
  10246. //#endregion
  10247. //#region ../../packages/components/affix/src/affix.vue?vue&type=script&setup=true&lang.ts
  10248. const COMPONENT_NAME$22 = "ElAffix";
  10249. var affix_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10250. name: COMPONENT_NAME$22,
  10251. __name: "affix",
  10252. props: affixProps,
  10253. emits: affixEmits,
  10254. setup(__props, { expose: __expose, emit: __emit }) {
  10255. const props = __props;
  10256. const emit = __emit;
  10257. const ns = useNamespace("affix");
  10258. const target = (0, vue.shallowRef)();
  10259. const root = (0, vue.shallowRef)();
  10260. const scrollContainer = (0, vue.shallowRef)();
  10261. const { height: windowHeight } = useWindowSize();
  10262. const { height: rootHeight, width: rootWidth, top: rootTop, bottom: rootBottom, left: rootLeft, update: updateRoot } = useElementBounding(root, { windowScroll: false });
  10263. const targetRect = useElementBounding(target);
  10264. const fixed = (0, vue.ref)(false);
  10265. const scrollTop = (0, vue.ref)(0);
  10266. const transform = (0, vue.ref)(0);
  10267. const teleportDisabled = (0, vue.computed)(() => {
  10268. return !props.teleported || !fixed.value;
  10269. });
  10270. const rootStyle = (0, vue.computed)(() => {
  10271. return {
  10272. display: "flow-root",
  10273. height: fixed.value ? `${rootHeight.value}px` : "",
  10274. width: fixed.value ? `${rootWidth.value}px` : ""
  10275. };
  10276. });
  10277. const affixStyle = (0, vue.computed)(() => {
  10278. if (!fixed.value) return {};
  10279. const offset = addUnit(props.offset);
  10280. return {
  10281. height: `${rootHeight.value}px`,
  10282. width: `${rootWidth.value}px`,
  10283. top: props.position === "top" ? offset : "",
  10284. bottom: props.position === "bottom" ? offset : "",
  10285. left: props.teleported ? `${rootLeft.value}px` : "",
  10286. transform: transform.value ? `translateY(${transform.value}px)` : "",
  10287. zIndex: props.zIndex
  10288. };
  10289. });
  10290. const update = () => {
  10291. if (!scrollContainer.value) return;
  10292. scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
  10293. const { position, target, offset } = props;
  10294. const rootHeightOffset = offset + rootHeight.value;
  10295. if (position === "top") if (target) {
  10296. const difference = targetRect.bottom.value - rootHeightOffset;
  10297. fixed.value = offset > rootTop.value && targetRect.bottom.value > 0;
  10298. transform.value = difference < 0 ? difference : 0;
  10299. } else fixed.value = offset > rootTop.value;
  10300. else if (target) {
  10301. const difference = windowHeight.value - targetRect.top.value - rootHeightOffset;
  10302. fixed.value = windowHeight.value - offset < rootBottom.value && windowHeight.value > targetRect.top.value;
  10303. transform.value = difference < 0 ? -difference : 0;
  10304. } else fixed.value = windowHeight.value - offset < rootBottom.value;
  10305. };
  10306. const updateRootRect = async () => {
  10307. if (!fixed.value) {
  10308. updateRoot();
  10309. return;
  10310. }
  10311. fixed.value = false;
  10312. await (0, vue.nextTick)();
  10313. updateRoot();
  10314. fixed.value = true;
  10315. };
  10316. const handleScroll = async () => {
  10317. updateRoot();
  10318. await (0, vue.nextTick)();
  10319. emit("scroll", {
  10320. scrollTop: scrollTop.value,
  10321. fixed: fixed.value
  10322. });
  10323. };
  10324. (0, vue.watch)(fixed, (val) => emit(CHANGE_EVENT, val));
  10325. (0, vue.onMounted)(() => {
  10326. if (props.target) {
  10327. target.value = document.querySelector(props.target) ?? void 0;
  10328. if (!target.value) throwError(COMPONENT_NAME$22, `Target does not exist: ${props.target}`);
  10329. } else target.value = document.documentElement;
  10330. scrollContainer.value = getScrollContainer(root.value, true);
  10331. updateRoot();
  10332. });
  10333. (0, vue.onActivated)(() => {
  10334. (0, vue.nextTick)(updateRootRect);
  10335. });
  10336. (0, vue.onDeactivated)(() => {
  10337. fixed.value = false;
  10338. });
  10339. useEventListener(scrollContainer, "scroll", handleScroll);
  10340. (0, vue.watchEffect)(update);
  10341. __expose({
  10342. update,
  10343. updateRoot: updateRootRect
  10344. });
  10345. return (_ctx, _cache) => {
  10346. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  10347. ref_key: "root",
  10348. ref: root,
  10349. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  10350. style: (0, vue.normalizeStyle)(rootStyle.value)
  10351. }, [(0, vue.createVNode)((0, vue.unref)(ElTeleport), {
  10352. disabled: teleportDisabled.value,
  10353. to: __props.appendTo
  10354. }, {
  10355. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  10356. class: (0, vue.normalizeClass)({ [(0, vue.unref)(ns).m("fixed")]: fixed.value }),
  10357. style: (0, vue.normalizeStyle)(affixStyle.value)
  10358. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6)]),
  10359. _: 3
  10360. }, 8, ["disabled", "to"])], 6);
  10361. };
  10362. }
  10363. });
  10364. //#endregion
  10365. //#region ../../packages/components/affix/src/affix.vue
  10366. var affix_default = affix_vue_vue_type_script_setup_true_lang_default;
  10367. //#endregion
  10368. //#region ../../packages/components/affix/index.ts
  10369. const ElAffix = withInstall(affix_default);
  10370. //#endregion
  10371. //#region ../../packages/components/alert/src/alert.ts
  10372. const alertEffects = ["light", "dark"];
  10373. /**
  10374. * @deprecated Removed after 3.0.0, Use `AlertProps` instead.
  10375. */
  10376. const alertProps = buildProps({
  10377. title: {
  10378. type: String,
  10379. default: ""
  10380. },
  10381. description: {
  10382. type: String,
  10383. default: ""
  10384. },
  10385. type: {
  10386. type: String,
  10387. values: keysOf(TypeComponentsMap),
  10388. default: "info"
  10389. },
  10390. closable: {
  10391. type: Boolean,
  10392. default: true
  10393. },
  10394. closeText: {
  10395. type: String,
  10396. default: ""
  10397. },
  10398. showIcon: Boolean,
  10399. center: Boolean,
  10400. effect: {
  10401. type: String,
  10402. values: alertEffects,
  10403. default: "light"
  10404. }
  10405. });
  10406. const alertEmits = { close: (evt) => evt instanceof MouseEvent };
  10407. //#endregion
  10408. //#region ../../packages/components/icon/src/icon.ts
  10409. /**
  10410. * @deprecated Removed after 3.0.0, Use `IconProps` instead.
  10411. */
  10412. const iconProps = buildProps({
  10413. size: { type: definePropType([Number, String]) },
  10414. color: { type: String }
  10415. });
  10416. //#endregion
  10417. //#region ../../packages/components/icon/src/icon.vue?vue&type=script&setup=true&lang.ts
  10418. var icon_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10419. name: "ElIcon",
  10420. inheritAttrs: false,
  10421. __name: "icon",
  10422. props: iconProps,
  10423. setup(__props) {
  10424. const props = __props;
  10425. const ns = useNamespace("icon");
  10426. const style = (0, vue.computed)(() => {
  10427. const { size, color } = props;
  10428. const fontSize = addUnit(size);
  10429. if (!fontSize && !color) return {};
  10430. return {
  10431. fontSize,
  10432. "--color": color
  10433. };
  10434. });
  10435. return (_ctx, _cache) => {
  10436. return (0, vue.openBlock)(), (0, vue.createElementBlock)("i", (0, vue.mergeProps)({
  10437. class: (0, vue.unref)(ns).b(),
  10438. style: style.value
  10439. }, _ctx.$attrs), [(0, vue.renderSlot)(_ctx.$slots, "default")], 16);
  10440. };
  10441. }
  10442. });
  10443. //#endregion
  10444. //#region ../../packages/components/icon/src/icon.vue
  10445. var icon_default = icon_vue_vue_type_script_setup_true_lang_default;
  10446. //#endregion
  10447. //#region ../../packages/components/icon/index.ts
  10448. const ElIcon = withInstall(icon_default);
  10449. //#endregion
  10450. //#region ../../packages/components/alert/src/alert.vue?vue&type=script&setup=true&lang.ts
  10451. var alert_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10452. name: "ElAlert",
  10453. __name: "alert",
  10454. props: alertProps,
  10455. emits: alertEmits,
  10456. setup(__props, { emit: __emit }) {
  10457. const { Close } = TypeComponents;
  10458. const props = __props;
  10459. const emit = __emit;
  10460. const slots = (0, vue.useSlots)();
  10461. const ns = useNamespace("alert");
  10462. const visible = (0, vue.ref)(true);
  10463. const iconComponent = (0, vue.computed)(() => TypeComponentsMap[props.type]);
  10464. const hasDesc = (0, vue.computed)(() => {
  10465. if (props.description) return true;
  10466. const slotContent = slots.default?.();
  10467. if (!slotContent) return false;
  10468. return flattedChildren(slotContent).some((child) => !isComment(child));
  10469. });
  10470. const close = (evt) => {
  10471. visible.value = false;
  10472. emit("close", evt);
  10473. };
  10474. return (_ctx, _cache) => {
  10475. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  10476. name: (0, vue.unref)(ns).b("fade"),
  10477. persisted: ""
  10478. }, {
  10479. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  10480. class: (0, vue.normalizeClass)([
  10481. (0, vue.unref)(ns).b(),
  10482. (0, vue.unref)(ns).m(__props.type),
  10483. (0, vue.unref)(ns).is("center", __props.center),
  10484. (0, vue.unref)(ns).is(__props.effect)
  10485. ]),
  10486. role: "alert"
  10487. }, [__props.showIcon && (_ctx.$slots.icon || iconComponent.value) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  10488. key: 0,
  10489. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), (0, vue.unref)(ns).is("big", hasDesc.value)])
  10490. }, {
  10491. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(iconComponent.value)))])]),
  10492. _: 3
  10493. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [
  10494. __props.title || _ctx.$slots.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  10495. key: 0,
  10496. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("title"), { "with-description": hasDesc.value }])
  10497. }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  10498. hasDesc.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", {
  10499. key: 1,
  10500. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("description"))
  10501. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.description), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  10502. __props.closable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [__props.closeText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  10503. key: 0,
  10504. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("close-btn"), (0, vue.unref)(ns).is("customed")]),
  10505. onClick: close
  10506. }, (0, vue.toDisplayString)(__props.closeText), 3)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  10507. key: 1,
  10508. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close-btn")),
  10509. onClick: close
  10510. }, {
  10511. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(Close))]),
  10512. _: 1
  10513. }, 8, ["class"]))], 64)) : (0, vue.createCommentVNode)("v-if", true)
  10514. ], 2)], 2), [[vue.vShow, visible.value]])]),
  10515. _: 3
  10516. }, 8, ["name"]);
  10517. };
  10518. }
  10519. });
  10520. //#endregion
  10521. //#region ../../packages/components/alert/src/alert.vue
  10522. var alert_default = alert_vue_vue_type_script_setup_true_lang_default;
  10523. //#endregion
  10524. //#region ../../packages/components/alert/index.ts
  10525. const ElAlert = withInstall(alert_default);
  10526. //#endregion
  10527. //#region ../../packages/components/popper/src/popper.ts
  10528. const Effect = {
  10529. LIGHT: "light",
  10530. DARK: "dark"
  10531. };
  10532. const roleTypes = [
  10533. "dialog",
  10534. "grid",
  10535. "group",
  10536. "listbox",
  10537. "menu",
  10538. "navigation",
  10539. "tooltip",
  10540. "tree"
  10541. ];
  10542. /**
  10543. * @deprecated Removed after 3.0.0, Use `PopperProps` instead.
  10544. */
  10545. const popperProps = buildProps({ role: {
  10546. type: String,
  10547. values: roleTypes,
  10548. default: "tooltip"
  10549. } });
  10550. /** @deprecated use `popperProps` instead, and it will be deprecated in the next major version */
  10551. const usePopperProps = popperProps;
  10552. //#endregion
  10553. //#region ../../packages/components/popper/src/constants.ts
  10554. const POPPER_INJECTION_KEY = Symbol("popper");
  10555. const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
  10556. //#endregion
  10557. //#region ../../packages/components/popper/src/popper.vue?vue&type=script&setup=true&lang.ts
  10558. var popper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10559. name: "ElPopper",
  10560. inheritAttrs: false,
  10561. __name: "popper",
  10562. props: popperProps,
  10563. setup(__props, { expose: __expose }) {
  10564. const props = __props;
  10565. const popperProvides = {
  10566. triggerRef: (0, vue.ref)(),
  10567. popperInstanceRef: (0, vue.ref)(),
  10568. contentRef: (0, vue.ref)(),
  10569. referenceRef: (0, vue.ref)(),
  10570. role: (0, vue.computed)(() => props.role)
  10571. };
  10572. __expose(popperProvides);
  10573. (0, vue.provide)(POPPER_INJECTION_KEY, popperProvides);
  10574. return (_ctx, _cache) => {
  10575. return (0, vue.renderSlot)(_ctx.$slots, "default");
  10576. };
  10577. }
  10578. });
  10579. //#endregion
  10580. //#region ../../packages/components/popper/src/popper.vue
  10581. var popper_default = popper_vue_vue_type_script_setup_true_lang_default;
  10582. //#endregion
  10583. //#region ../../packages/components/popper/src/arrow.vue?vue&type=script&setup=true&lang.ts
  10584. var arrow_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  10585. name: "ElPopperArrow",
  10586. inheritAttrs: false,
  10587. __name: "arrow",
  10588. setup(__props, { expose: __expose }) {
  10589. const ns = useNamespace("popper");
  10590. const { arrowRef, arrowStyle } = (0, vue.inject)(POPPER_CONTENT_INJECTION_KEY, void 0);
  10591. (0, vue.onBeforeUnmount)(() => {
  10592. arrowRef.value = void 0;
  10593. });
  10594. __expose({ arrowRef });
  10595. return (_ctx, _cache) => {
  10596. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  10597. ref_key: "arrowRef",
  10598. ref: arrowRef,
  10599. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("arrow")),
  10600. style: (0, vue.normalizeStyle)((0, vue.unref)(arrowStyle)),
  10601. "data-popper-arrow": ""
  10602. }, null, 6);
  10603. };
  10604. }
  10605. });
  10606. //#endregion
  10607. //#region ../../packages/components/popper/src/arrow.vue
  10608. var arrow_default = arrow_vue_vue_type_script_setup_true_lang_default;
  10609. //#endregion
  10610. //#region ../../packages/components/popper/src/trigger.ts
  10611. /**
  10612. * @deprecated Removed after 3.0.0, Use `PopperTriggerProps` instead.
  10613. */
  10614. const popperTriggerProps = buildProps({
  10615. virtualRef: { type: definePropType(Object) },
  10616. virtualTriggering: Boolean,
  10617. onMouseenter: { type: definePropType(Function) },
  10618. onMouseleave: { type: definePropType(Function) },
  10619. onClick: { type: definePropType(Function) },
  10620. onKeydown: { type: definePropType(Function) },
  10621. onFocus: { type: definePropType(Function) },
  10622. onBlur: { type: definePropType(Function) },
  10623. onContextmenu: { type: definePropType(Function) },
  10624. id: String,
  10625. open: Boolean
  10626. });
  10627. /** @deprecated use `popperTriggerProps` instead, and it will be deprecated in the next major version */
  10628. const usePopperTriggerProps = popperTriggerProps;
  10629. //#endregion
  10630. //#region ../../packages/components/slot/src/only-child.tsx
  10631. const NAME = "ElOnlyChild";
  10632. const OnlyChild = /* @__PURE__ */ (0, vue.defineComponent)({
  10633. name: NAME,
  10634. setup(_, { slots, attrs }) {
  10635. const forwardRefDirective = useForwardRefDirective((0, vue.inject)(FORWARD_REF_INJECTION_KEY)?.setForwardRef ?? NOOP);
  10636. return () => {
  10637. const defaultSlot = slots.default?.(attrs);
  10638. if (!defaultSlot) return null;
  10639. const [firstLegitNode, length] = findFirstLegitChild(defaultSlot);
  10640. if (!firstLegitNode) {
  10641. /* @__PURE__ */ debugWarn(NAME, "no valid child node found");
  10642. return null;
  10643. }
  10644. if (length > 1) /* @__PURE__ */ debugWarn(NAME, "requires exact only one valid child.");
  10645. return (0, vue.withDirectives)((0, vue.cloneVNode)(firstLegitNode, attrs), [[forwardRefDirective]]);
  10646. };
  10647. }
  10648. });
  10649. function findFirstLegitChild(node) {
  10650. if (!node) return [null, 0];
  10651. const children = node;
  10652. const len = children.filter((c) => c.type !== vue.Comment).length;
  10653. for (const child of children) {
  10654. /**
  10655. * when user uses h(Fragment, [text]) to render plain string,
  10656. * this switch case just cannot handle, when the value is primitives
  10657. * we should just return the wrapped string
  10658. */
  10659. if (isObject$1(child)) switch (child.type) {
  10660. case vue.Comment: continue;
  10661. case vue.Text:
  10662. case "svg": return [wrapTextContent(child), len];
  10663. case vue.Fragment: return findFirstLegitChild(child.children);
  10664. default: return [child, len];
  10665. }
  10666. return [wrapTextContent(child), len];
  10667. }
  10668. return [null, 0];
  10669. }
  10670. function wrapTextContent(s) {
  10671. const ns = useNamespace("only-child");
  10672. return (0, vue.createVNode)("span", { "class": ns.e("content") }, [s]);
  10673. }
  10674. //#endregion
  10675. //#region ../../packages/components/popper/src/trigger.vue?vue&type=script&setup=true&lang.ts
  10676. var trigger_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
  10677. name: "ElPopperTrigger",
  10678. inheritAttrs: false,
  10679. __name: "trigger",
  10680. props: popperTriggerProps,
  10681. setup(__props, { expose: __expose }) {
  10682. const props = __props;
  10683. const { role, triggerRef } = (0, vue.inject)(POPPER_INJECTION_KEY, void 0);
  10684. useForwardRef(triggerRef);
  10685. const ariaControls = (0, vue.computed)(() => {
  10686. return ariaHaspopup.value ? props.id : void 0;
  10687. });
  10688. const ariaDescribedby = (0, vue.computed)(() => {
  10689. if (role && role.value === "tooltip") return props.open && props.id ? props.id : void 0;
  10690. });
  10691. const ariaHaspopup = (0, vue.computed)(() => {
  10692. if (role && role.value !== "tooltip") return role.value;
  10693. });
  10694. const ariaExpanded = (0, vue.computed)(() => {
  10695. return ariaHaspopup.value ? `${props.open}` : void 0;
  10696. });
  10697. let virtualTriggerAriaStopWatch = void 0;
  10698. const TRIGGER_ELE_EVENTS = [
  10699. "onMouseenter",
  10700. "onMouseleave",
  10701. "onClick",
  10702. "onKeydown",
  10703. "onFocus",
  10704. "onBlur",
  10705. "onContextmenu"
  10706. ];
  10707. (0, vue.onMounted)(() => {
  10708. (0, vue.watch)(() => props.virtualRef, (virtualEl) => {
  10709. if (virtualEl) triggerRef.value = unrefElement(virtualEl);
  10710. }, { immediate: true });
  10711. (0, vue.watch)(triggerRef, (el, prevEl) => {
  10712. virtualTriggerAriaStopWatch?.();
  10713. virtualTriggerAriaStopWatch = void 0;
  10714. if (isElement$1(prevEl)) TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10715. const handler = props[eventName];
  10716. if (handler) prevEl.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10717. });
  10718. if (isElement$1(el)) {
  10719. TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10720. const handler = props[eventName];
  10721. if (handler) el.addEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10722. });
  10723. if (isFocusable(el)) virtualTriggerAriaStopWatch = (0, vue.watch)([
  10724. ariaControls,
  10725. ariaDescribedby,
  10726. ariaHaspopup,
  10727. ariaExpanded
  10728. ], (watches) => {
  10729. [
  10730. "aria-controls",
  10731. "aria-describedby",
  10732. "aria-haspopup",
  10733. "aria-expanded"
  10734. ].forEach((key, idx) => {
  10735. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  10736. });
  10737. }, { immediate: true });
  10738. }
  10739. if (isElement$1(prevEl) && isFocusable(prevEl)) [
  10740. "aria-controls",
  10741. "aria-describedby",
  10742. "aria-haspopup",
  10743. "aria-expanded"
  10744. ].forEach((key) => prevEl.removeAttribute(key));
  10745. }, { immediate: true });
  10746. });
  10747. (0, vue.onBeforeUnmount)(() => {
  10748. virtualTriggerAriaStopWatch?.();
  10749. virtualTriggerAriaStopWatch = void 0;
  10750. if (triggerRef.value && isElement$1(triggerRef.value)) {
  10751. const el = triggerRef.value;
  10752. TRIGGER_ELE_EVENTS.forEach((eventName) => {
  10753. const handler = props[eventName];
  10754. if (handler) el.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
  10755. });
  10756. triggerRef.value = void 0;
  10757. }
  10758. });
  10759. __expose({ triggerRef });
  10760. return (_ctx, _cache) => {
  10761. return !__props.virtualTriggering ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(OnlyChild), (0, vue.mergeProps)({ key: 0 }, _ctx.$attrs, {
  10762. "aria-controls": ariaControls.value,
  10763. "aria-describedby": ariaDescribedby.value,
  10764. "aria-expanded": ariaExpanded.value,
  10765. "aria-haspopup": ariaHaspopup.value
  10766. }), {
  10767. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  10768. _: 3
  10769. }, 16, [
  10770. "aria-controls",
  10771. "aria-describedby",
  10772. "aria-expanded",
  10773. "aria-haspopup"
  10774. ])) : (0, vue.createCommentVNode)("v-if", true);
  10775. };
  10776. }
  10777. });
  10778. //#endregion
  10779. //#region ../../packages/components/popper/src/trigger.vue
  10780. var trigger_default = trigger_vue_vue_type_script_setup_true_lang_default$1;
  10781. //#endregion
  10782. //#region ../../packages/components/popper/src/arrow.ts
  10783. /**
  10784. * @deprecated Removed after 3.0.0, Use `PopperArrowProps` instead.
  10785. */
  10786. const popperArrowProps = buildProps({ arrowOffset: {
  10787. type: Number,
  10788. default: 5
  10789. } });
  10790. const popperArrowPropsDefaults = { arrowOffset: 5 };
  10791. /** @deprecated use `popperArrowProps` instead, and it will be deprecated in the next major version */
  10792. const usePopperArrowProps = popperArrowProps;
  10793. //#endregion
  10794. //#region ../../packages/components/popper/src/content.ts
  10795. const POSITIONING_STRATEGIES = ["fixed", "absolute"];
  10796. /**
  10797. * @deprecated Removed after 3.0.0, Use `PopperCoreConfigProps` instead.
  10798. */
  10799. const popperCoreConfigProps = buildProps({
  10800. boundariesPadding: {
  10801. type: Number,
  10802. default: 0
  10803. },
  10804. fallbackPlacements: {
  10805. type: definePropType(Array),
  10806. default: void 0
  10807. },
  10808. gpuAcceleration: {
  10809. type: Boolean,
  10810. default: true
  10811. },
  10812. offset: {
  10813. type: Number,
  10814. default: 12
  10815. },
  10816. placement: {
  10817. type: String,
  10818. values: Ee,
  10819. default: "bottom"
  10820. },
  10821. popperOptions: {
  10822. type: definePropType(Object),
  10823. default: () => ({})
  10824. },
  10825. strategy: {
  10826. type: String,
  10827. values: POSITIONING_STRATEGIES,
  10828. default: "absolute"
  10829. }
  10830. });
  10831. /**
  10832. * @deprecated Removed after 3.0.0, Use `PopperContentProps` instead.
  10833. */
  10834. const popperContentProps = buildProps({
  10835. ...popperCoreConfigProps,
  10836. ...popperArrowProps,
  10837. id: String,
  10838. style: { type: definePropType([
  10839. String,
  10840. Array,
  10841. Object
  10842. ]) },
  10843. className: { type: definePropType([
  10844. String,
  10845. Array,
  10846. Object
  10847. ]) },
  10848. effect: {
  10849. type: definePropType(String),
  10850. default: "dark"
  10851. },
  10852. visible: Boolean,
  10853. enterable: {
  10854. type: Boolean,
  10855. default: true
  10856. },
  10857. pure: Boolean,
  10858. focusOnShow: Boolean,
  10859. trapping: Boolean,
  10860. popperClass: { type: definePropType([
  10861. String,
  10862. Array,
  10863. Object
  10864. ]) },
  10865. popperStyle: { type: definePropType([
  10866. String,
  10867. Array,
  10868. Object
  10869. ]) },
  10870. referenceEl: { type: definePropType(Object) },
  10871. triggerTargetEl: { type: definePropType(Object) },
  10872. stopPopperMouseEvent: {
  10873. type: Boolean,
  10874. default: true
  10875. },
  10876. virtualTriggering: Boolean,
  10877. zIndex: Number,
  10878. ...useAriaProps(["ariaLabel"]),
  10879. loop: Boolean
  10880. });
  10881. const popperCoreConfigPropsDefaults = {
  10882. boundariesPadding: 0,
  10883. gpuAcceleration: true,
  10884. offset: 12,
  10885. placement: "bottom",
  10886. popperOptions: () => ({}),
  10887. strategy: "absolute"
  10888. };
  10889. const popperContentPropsDefaults = {
  10890. ...popperCoreConfigPropsDefaults,
  10891. ...popperArrowPropsDefaults,
  10892. effect: "dark",
  10893. enterable: true,
  10894. stopPopperMouseEvent: true,
  10895. visible: false,
  10896. pure: false,
  10897. focusOnShow: false,
  10898. trapping: false,
  10899. virtualTriggering: false,
  10900. loop: false,
  10901. style: void 0,
  10902. popperStyle: void 0
  10903. };
  10904. const popperContentEmits = {
  10905. mouseenter: (evt) => evt instanceof MouseEvent,
  10906. mouseleave: (evt) => evt instanceof MouseEvent,
  10907. focus: () => true,
  10908. blur: () => true,
  10909. close: () => true
  10910. };
  10911. /** @deprecated use `popperCoreConfigProps` instead, and it will be deprecated in the next major version */
  10912. const usePopperCoreConfigProps = popperCoreConfigProps;
  10913. /** @deprecated use `popperContentProps` instead, and it will be deprecated in the next major version */
  10914. const usePopperContentProps = popperContentProps;
  10915. /** @deprecated use `popperContentEmits` instead, and it will be deprecated in the next major version */
  10916. const usePopperContentEmits = popperContentEmits;
  10917. //#endregion
  10918. //#region ../../packages/components/focus-trap/src/tokens.ts
  10919. const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
  10920. const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
  10921. const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
  10922. const FOCUS_AFTER_TRAPPED_OPTS = {
  10923. cancelable: true,
  10924. bubbles: false
  10925. };
  10926. const FOCUSOUT_PREVENTED_OPTS = {
  10927. cancelable: true,
  10928. bubbles: false
  10929. };
  10930. const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
  10931. const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
  10932. const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
  10933. //#endregion
  10934. //#region ../../packages/components/focus-trap/src/utils.ts
  10935. const focusReason = (0, vue.ref)();
  10936. const lastUserFocusTimestamp = (0, vue.ref)(0);
  10937. const lastAutomatedFocusTimestamp = (0, vue.ref)(0);
  10938. let focusReasonUserCount = 0;
  10939. const obtainAllFocusableElements = (element) => {
  10940. const nodes = [];
  10941. const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, { acceptNode: (node) => {
  10942. const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
  10943. if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
  10944. return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
  10945. } });
  10946. while (walker.nextNode()) nodes.push(walker.currentNode);
  10947. return nodes;
  10948. };
  10949. const getVisibleElement = (elements, container) => {
  10950. for (const element of elements) if (!isHidden(element, container)) return element;
  10951. };
  10952. const isHidden = (element, container) => {
  10953. if (getComputedStyle(element).visibility === "hidden") return true;
  10954. while (element) {
  10955. if (container && element === container) return false;
  10956. if (getComputedStyle(element).display === "none") return true;
  10957. element = element.parentElement;
  10958. }
  10959. return false;
  10960. };
  10961. const getEdges = (container) => {
  10962. const focusable = obtainAllFocusableElements(container);
  10963. return [getVisibleElement(focusable, container), getVisibleElement(focusable.reverse(), container)];
  10964. };
  10965. const isSelectable = (element) => {
  10966. return element instanceof HTMLInputElement && "select" in element;
  10967. };
  10968. const tryFocus = (element, shouldSelect) => {
  10969. if (element) {
  10970. const prevFocusedElement = document.activeElement;
  10971. focusElement(element, { preventScroll: true });
  10972. lastAutomatedFocusTimestamp.value = window.performance.now();
  10973. if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) element.select();
  10974. }
  10975. };
  10976. function removeFromStack(list, item) {
  10977. const copy = [...list];
  10978. const idx = list.indexOf(item);
  10979. if (idx !== -1) copy.splice(idx, 1);
  10980. return copy;
  10981. }
  10982. const createFocusableStack = () => {
  10983. let stack = [];
  10984. const push = (layer) => {
  10985. const currentLayer = stack[0];
  10986. if (currentLayer && layer !== currentLayer) currentLayer.pause();
  10987. stack = removeFromStack(stack, layer);
  10988. stack.unshift(layer);
  10989. };
  10990. const remove = (layer) => {
  10991. stack = removeFromStack(stack, layer);
  10992. stack[0]?.resume?.();
  10993. };
  10994. return {
  10995. push,
  10996. remove
  10997. };
  10998. };
  10999. const focusFirstDescendant = (elements, shouldSelect = false) => {
  11000. const prevFocusedElement = document.activeElement;
  11001. for (const element of elements) {
  11002. tryFocus(element, shouldSelect);
  11003. if (document.activeElement !== prevFocusedElement) return;
  11004. }
  11005. };
  11006. const focusableStack = createFocusableStack();
  11007. const isFocusCausedByUserEvent = () => {
  11008. return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
  11009. };
  11010. const notifyFocusReasonPointer = () => {
  11011. focusReason.value = "pointer";
  11012. lastUserFocusTimestamp.value = window.performance.now();
  11013. };
  11014. const notifyFocusReasonKeydown = () => {
  11015. focusReason.value = "keyboard";
  11016. lastUserFocusTimestamp.value = window.performance.now();
  11017. };
  11018. const useFocusReason = () => {
  11019. (0, vue.onMounted)(() => {
  11020. if (focusReasonUserCount === 0) {
  11021. document.addEventListener("mousedown", notifyFocusReasonPointer);
  11022. document.addEventListener("touchstart", notifyFocusReasonPointer);
  11023. document.addEventListener("keydown", notifyFocusReasonKeydown);
  11024. }
  11025. focusReasonUserCount++;
  11026. });
  11027. (0, vue.onBeforeUnmount)(() => {
  11028. focusReasonUserCount--;
  11029. if (focusReasonUserCount <= 0) {
  11030. document.removeEventListener("mousedown", notifyFocusReasonPointer);
  11031. document.removeEventListener("touchstart", notifyFocusReasonPointer);
  11032. document.removeEventListener("keydown", notifyFocusReasonKeydown);
  11033. }
  11034. });
  11035. return {
  11036. focusReason,
  11037. lastUserFocusTimestamp,
  11038. lastAutomatedFocusTimestamp
  11039. };
  11040. };
  11041. const createFocusOutPreventedEvent = (detail) => {
  11042. return new CustomEvent(FOCUSOUT_PREVENTED, {
  11043. ...FOCUSOUT_PREVENTED_OPTS,
  11044. detail
  11045. });
  11046. };
  11047. //#endregion
  11048. //#region ../../packages/components/focus-trap/src/focus-trap.vue?vue&type=script&lang.ts
  11049. var focus_trap_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  11050. name: "ElFocusTrap",
  11051. inheritAttrs: false,
  11052. props: {
  11053. loop: Boolean,
  11054. trapped: Boolean,
  11055. focusTrapEl: Object,
  11056. focusStartEl: {
  11057. type: [Object, String],
  11058. default: "first"
  11059. }
  11060. },
  11061. emits: [
  11062. ON_TRAP_FOCUS_EVT,
  11063. ON_RELEASE_FOCUS_EVT,
  11064. "focusin",
  11065. "focusout",
  11066. "focusout-prevented",
  11067. "release-requested"
  11068. ],
  11069. setup(props, { emit }) {
  11070. const forwardRef = (0, vue.ref)();
  11071. let lastFocusBeforeTrapped;
  11072. let lastFocusAfterTrapped;
  11073. const { focusReason } = useFocusReason();
  11074. useEscapeKeydown((event) => {
  11075. if (props.trapped && !focusLayer.paused) emit("release-requested", event);
  11076. });
  11077. const focusLayer = {
  11078. paused: false,
  11079. pause() {
  11080. this.paused = true;
  11081. },
  11082. resume() {
  11083. this.paused = false;
  11084. }
  11085. };
  11086. const onKeydown = (e) => {
  11087. if (!props.loop && !props.trapped) return;
  11088. if (focusLayer.paused) return;
  11089. const { altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
  11090. const { loop } = props;
  11091. const isTabbing = getEventCode(e) === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
  11092. const currentFocusingEl = document.activeElement;
  11093. if (isTabbing && currentFocusingEl) {
  11094. const container = currentTarget;
  11095. const [first, last] = getEdges(container);
  11096. if (!(first && last)) {
  11097. if (currentFocusingEl === container) {
  11098. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11099. emit("focusout-prevented", focusoutPreventedEvent);
  11100. if (!focusoutPreventedEvent.defaultPrevented) e.preventDefault();
  11101. }
  11102. } else if (!shiftKey && currentFocusingEl === last) {
  11103. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11104. emit("focusout-prevented", focusoutPreventedEvent);
  11105. if (!focusoutPreventedEvent.defaultPrevented) {
  11106. e.preventDefault();
  11107. if (loop) tryFocus(first, true);
  11108. }
  11109. } else if (shiftKey && [first, container].includes(currentFocusingEl)) {
  11110. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11111. emit("focusout-prevented", focusoutPreventedEvent);
  11112. if (!focusoutPreventedEvent.defaultPrevented) {
  11113. e.preventDefault();
  11114. if (loop) tryFocus(last, true);
  11115. }
  11116. }
  11117. }
  11118. };
  11119. (0, vue.provide)(FOCUS_TRAP_INJECTION_KEY, {
  11120. focusTrapRef: forwardRef,
  11121. onKeydown
  11122. });
  11123. (0, vue.watch)(() => props.focusTrapEl, (focusTrapEl) => {
  11124. if (focusTrapEl) forwardRef.value = focusTrapEl;
  11125. }, { immediate: true });
  11126. (0, vue.watch)([forwardRef], ([forwardRef], [oldForwardRef]) => {
  11127. if (forwardRef) {
  11128. forwardRef.addEventListener("keydown", onKeydown);
  11129. forwardRef.addEventListener("focusin", onFocusIn);
  11130. forwardRef.addEventListener("focusout", onFocusOut);
  11131. }
  11132. if (oldForwardRef) {
  11133. oldForwardRef.removeEventListener("keydown", onKeydown);
  11134. oldForwardRef.removeEventListener("focusin", onFocusIn);
  11135. oldForwardRef.removeEventListener("focusout", onFocusOut);
  11136. }
  11137. });
  11138. const trapOnFocus = (e) => {
  11139. emit(ON_TRAP_FOCUS_EVT, e);
  11140. };
  11141. const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
  11142. const onFocusIn = (e) => {
  11143. const trapContainer = (0, vue.unref)(forwardRef);
  11144. if (!trapContainer) return;
  11145. const target = e.target;
  11146. const relatedTarget = e.relatedTarget;
  11147. const isFocusedInTrap = target && trapContainer.contains(target);
  11148. if (!props.trapped) {
  11149. if (!(relatedTarget && trapContainer.contains(relatedTarget))) lastFocusBeforeTrapped = relatedTarget;
  11150. }
  11151. if (isFocusedInTrap) emit("focusin", e);
  11152. if (focusLayer.paused) return;
  11153. if (props.trapped) if (isFocusedInTrap) lastFocusAfterTrapped = target;
  11154. else tryFocus(lastFocusAfterTrapped, true);
  11155. };
  11156. const onFocusOut = (e) => {
  11157. const trapContainer = (0, vue.unref)(forwardRef);
  11158. if (focusLayer.paused || !trapContainer) return;
  11159. if (props.trapped) {
  11160. const relatedTarget = e.relatedTarget;
  11161. if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) setTimeout(() => {
  11162. if (!focusLayer.paused && props.trapped) {
  11163. const focusoutPreventedEvent = createFocusOutPreventedEvent({ focusReason: focusReason.value });
  11164. emit("focusout-prevented", focusoutPreventedEvent);
  11165. if (!focusoutPreventedEvent.defaultPrevented) tryFocus(lastFocusAfterTrapped, true);
  11166. }
  11167. }, 0);
  11168. } else {
  11169. const target = e.target;
  11170. if (!(target && trapContainer.contains(target))) emit("focusout", e);
  11171. }
  11172. };
  11173. async function startTrap() {
  11174. await (0, vue.nextTick)();
  11175. const trapContainer = (0, vue.unref)(forwardRef);
  11176. if (trapContainer) {
  11177. focusableStack.push(focusLayer);
  11178. const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
  11179. lastFocusBeforeTrapped = prevFocusedElement;
  11180. if (!trapContainer.contains(prevFocusedElement)) {
  11181. const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
  11182. trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  11183. trapContainer.dispatchEvent(focusEvent);
  11184. if (!focusEvent.defaultPrevented) (0, vue.nextTick)(() => {
  11185. let focusStartEl = props.focusStartEl;
  11186. if (!isString(focusStartEl)) {
  11187. tryFocus(focusStartEl);
  11188. if (document.activeElement !== focusStartEl) focusStartEl = "first";
  11189. }
  11190. if (focusStartEl === "first") focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
  11191. if (document.activeElement === prevFocusedElement || focusStartEl === "container") tryFocus(trapContainer);
  11192. });
  11193. }
  11194. }
  11195. }
  11196. function stopTrap() {
  11197. const trapContainer = (0, vue.unref)(forwardRef);
  11198. if (trapContainer) {
  11199. trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
  11200. const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
  11201. ...FOCUS_AFTER_TRAPPED_OPTS,
  11202. detail: { focusReason: focusReason.value }
  11203. });
  11204. trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  11205. trapContainer.dispatchEvent(releasedEvent);
  11206. if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) tryFocus(lastFocusBeforeTrapped ?? document.body);
  11207. trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
  11208. focusableStack.remove(focusLayer);
  11209. lastFocusBeforeTrapped = null;
  11210. lastFocusAfterTrapped = null;
  11211. }
  11212. }
  11213. (0, vue.onMounted)(() => {
  11214. if (props.trapped) startTrap();
  11215. (0, vue.watch)(() => props.trapped, (trapped) => {
  11216. if (trapped) startTrap();
  11217. else stopTrap();
  11218. });
  11219. });
  11220. (0, vue.onBeforeUnmount)(() => {
  11221. if (props.trapped) stopTrap();
  11222. if (forwardRef.value) {
  11223. forwardRef.value.removeEventListener("keydown", onKeydown);
  11224. forwardRef.value.removeEventListener("focusin", onFocusIn);
  11225. forwardRef.value.removeEventListener("focusout", onFocusOut);
  11226. forwardRef.value = void 0;
  11227. }
  11228. lastFocusBeforeTrapped = null;
  11229. lastFocusAfterTrapped = null;
  11230. });
  11231. return { onKeydown };
  11232. }
  11233. });
  11234. //#endregion
  11235. //#region \0plugin-vue:export-helper
  11236. var _plugin_vue_export_helper_default = (sfc, props) => {
  11237. const target = sfc.__vccOpts || sfc;
  11238. for (const [key, val] of props) target[key] = val;
  11239. return target;
  11240. };
  11241. //#endregion
  11242. //#region ../../packages/components/focus-trap/src/focus-trap.vue
  11243. function _sfc_render$21(_ctx, _cache, $props, $setup, $data, $options) {
  11244. return (0, vue.renderSlot)(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
  11245. }
  11246. var focus_trap_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(focus_trap_vue_vue_type_script_lang_default, [["render", _sfc_render$21]]);
  11247. //#endregion
  11248. //#region ../../packages/components/focus-trap/index.ts
  11249. var focus_trap_default = focus_trap_default$1;
  11250. //#endregion
  11251. //#region ../../packages/components/form/src/form.ts
  11252. /**
  11253. * @deprecated Removed after 3.0.0, Use `FormMetaProps` instead.
  11254. */
  11255. const formMetaProps = buildProps({
  11256. size: {
  11257. type: String,
  11258. values: componentSizes
  11259. },
  11260. disabled: Boolean
  11261. });
  11262. /**
  11263. * @deprecated Removed after 3.0.0, Use `FormProps` instead.
  11264. */
  11265. const formProps = buildProps({
  11266. ...formMetaProps,
  11267. model: Object,
  11268. rules: { type: definePropType(Object) },
  11269. labelPosition: {
  11270. type: String,
  11271. values: [
  11272. "left",
  11273. "right",
  11274. "top"
  11275. ],
  11276. default: "right"
  11277. },
  11278. requireAsteriskPosition: {
  11279. type: String,
  11280. values: ["left", "right"],
  11281. default: "left"
  11282. },
  11283. labelWidth: {
  11284. type: [String, Number],
  11285. default: ""
  11286. },
  11287. labelSuffix: {
  11288. type: String,
  11289. default: ""
  11290. },
  11291. inline: Boolean,
  11292. inlineMessage: Boolean,
  11293. statusIcon: Boolean,
  11294. showMessage: {
  11295. type: Boolean,
  11296. default: true
  11297. },
  11298. validateOnRuleChange: {
  11299. type: Boolean,
  11300. default: true
  11301. },
  11302. hideRequiredAsterisk: Boolean,
  11303. scrollToError: Boolean,
  11304. scrollIntoViewOptions: {
  11305. type: definePropType([Object, Boolean]),
  11306. default: true
  11307. }
  11308. });
  11309. const formEmits = { validate: (prop, isValid, message) => (isArray$1(prop) || isString(prop)) && isBoolean(isValid) && isString(message) };
  11310. //#endregion
  11311. //#region ../../packages/components/form/src/constants.ts
  11312. const formContextKey = Symbol("formContextKey");
  11313. const formItemContextKey = Symbol("formItemContextKey");
  11314. //#endregion
  11315. //#region ../../packages/components/form/src/hooks/use-form-common-props.ts
  11316. const useFormSize = (fallback, ignore = {}) => {
  11317. const emptyRef = (0, vue.ref)(void 0);
  11318. const size = ignore.prop ? emptyRef : useProp("size");
  11319. const globalConfig = ignore.global ? emptyRef : useGlobalSize();
  11320. const form = ignore.form ? { size: void 0 } : (0, vue.inject)(formContextKey, void 0);
  11321. const formItem = ignore.formItem ? { size: void 0 } : (0, vue.inject)(formItemContextKey, void 0);
  11322. return (0, vue.computed)(() => size.value || (0, vue.unref)(fallback) || formItem?.size || form?.size || globalConfig.value || "");
  11323. };
  11324. const useFormDisabled = (fallback) => {
  11325. const disabled = useProp("disabled");
  11326. const form = (0, vue.inject)(formContextKey, void 0);
  11327. return (0, vue.computed)(() => {
  11328. return disabled.value ?? (0, vue.unref)(fallback) ?? form?.disabled ?? false;
  11329. });
  11330. };
  11331. const useSize = useFormSize;
  11332. const useDisabled = useFormDisabled;
  11333. //#endregion
  11334. //#region ../../packages/components/form/src/hooks/use-form-item.ts
  11335. const useFormItem = () => {
  11336. return {
  11337. form: (0, vue.inject)(formContextKey, void 0),
  11338. formItem: (0, vue.inject)(formItemContextKey, void 0)
  11339. };
  11340. };
  11341. const useFormItemInputId = (props, { formItemContext, disableIdGeneration, disableIdManagement }) => {
  11342. if (!disableIdGeneration) disableIdGeneration = (0, vue.ref)(false);
  11343. if (!disableIdManagement) disableIdManagement = (0, vue.ref)(false);
  11344. const instance = (0, vue.getCurrentInstance)();
  11345. const inLabel = () => {
  11346. let parent = instance?.parent;
  11347. while (parent) {
  11348. if (parent.type.name === "ElFormItem") return false;
  11349. if (parent.type.name === "ElLabelWrap") return true;
  11350. parent = parent.parent;
  11351. }
  11352. return false;
  11353. };
  11354. const inputId = (0, vue.ref)();
  11355. let idUnwatch = void 0;
  11356. const isLabeledByFormItem = (0, vue.computed)(() => {
  11357. return !!(!(props.label || props.ariaLabel) && formItemContext && formItemContext.inputIds && formItemContext.inputIds?.length <= 1);
  11358. });
  11359. (0, vue.onMounted)(() => {
  11360. idUnwatch = (0, vue.watch)([(0, vue.toRef)(props, "id"), disableIdGeneration], ([id, disableIdGeneration]) => {
  11361. const newId = id ?? (!disableIdGeneration ? useId().value : void 0);
  11362. if (newId !== inputId.value) {
  11363. if (formItemContext?.removeInputId && !inLabel()) {
  11364. inputId.value && formItemContext.removeInputId(inputId.value);
  11365. if (!disableIdManagement?.value && !disableIdGeneration && newId) formItemContext.addInputId(newId);
  11366. }
  11367. inputId.value = newId;
  11368. }
  11369. }, { immediate: true });
  11370. });
  11371. (0, vue.onUnmounted)(() => {
  11372. idUnwatch && idUnwatch();
  11373. if (formItemContext?.removeInputId) inputId.value && formItemContext.removeInputId(inputId.value);
  11374. });
  11375. return {
  11376. isLabeledByFormItem,
  11377. inputId
  11378. };
  11379. };
  11380. //#endregion
  11381. //#region ../../packages/components/form/src/utils.ts
  11382. const SCOPE$7 = "ElForm";
  11383. function useFormLabelWidth() {
  11384. const potentialLabelWidthArr = (0, vue.ref)([]);
  11385. const autoLabelWidth = (0, vue.computed)(() => {
  11386. if (!potentialLabelWidthArr.value.length) return "0";
  11387. const max = Math.max(...potentialLabelWidthArr.value);
  11388. return max ? `${max}px` : "";
  11389. });
  11390. function getLabelWidthIndex(width) {
  11391. const index = potentialLabelWidthArr.value.indexOf(width);
  11392. if (index === -1 && autoLabelWidth.value === "0") /* @__PURE__ */ debugWarn(SCOPE$7, `unexpected width ${width}`);
  11393. return index;
  11394. }
  11395. function registerLabelWidth(val, oldVal) {
  11396. if (val && oldVal) {
  11397. const index = getLabelWidthIndex(oldVal);
  11398. potentialLabelWidthArr.value.splice(index, 1, val);
  11399. } else if (val) potentialLabelWidthArr.value.push(val);
  11400. }
  11401. function deregisterLabelWidth(val) {
  11402. const index = getLabelWidthIndex(val);
  11403. if (index > -1) potentialLabelWidthArr.value.splice(index, 1);
  11404. }
  11405. return {
  11406. autoLabelWidth,
  11407. registerLabelWidth,
  11408. deregisterLabelWidth
  11409. };
  11410. }
  11411. const filterFields = (fields, props) => {
  11412. const normalized = castArray$1(props).map((prop) => isArray$1(prop) ? prop.join(".") : prop);
  11413. return normalized.length > 0 ? fields.filter((field) => field.propString && normalized.includes(field.propString)) : fields;
  11414. };
  11415. //#endregion
  11416. //#region ../../packages/components/form/src/form.vue?vue&type=script&setup=true&lang.ts
  11417. const COMPONENT_NAME$21 = "ElForm";
  11418. var form_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  11419. name: COMPONENT_NAME$21,
  11420. __name: "form",
  11421. props: formProps,
  11422. emits: formEmits,
  11423. setup(__props, { expose: __expose, emit: __emit }) {
  11424. const props = __props;
  11425. const emit = __emit;
  11426. const formRef = (0, vue.ref)();
  11427. const fields = (0, vue.reactive)([]);
  11428. const initialValues = /* @__PURE__ */ new Map();
  11429. const formSize = useFormSize();
  11430. const ns = useNamespace("form");
  11431. const formClasses = (0, vue.computed)(() => {
  11432. const { labelPosition, inline } = props;
  11433. return [
  11434. ns.b(),
  11435. ns.m(formSize.value || "default"),
  11436. {
  11437. [ns.m(`label-${labelPosition}`)]: labelPosition,
  11438. [ns.m("inline")]: inline
  11439. }
  11440. ];
  11441. });
  11442. const getField = (prop) => {
  11443. return filterFields(fields, [prop])[0];
  11444. };
  11445. const addField = (field) => {
  11446. fields.push(field);
  11447. if (field.propString) if (initialValues.has(field.propString)) field.setInitialValue(initialValues.get(field.propString));
  11448. else initialValues.set(field.propString, cloneDeep(field.fieldValue));
  11449. };
  11450. const removeField = (field) => {
  11451. if (field.prop) fields.splice(fields.indexOf(field), 1);
  11452. };
  11453. const setInitialValues = (initModel) => {
  11454. if (!props.model) {
  11455. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for setInitialValues to work.");
  11456. return;
  11457. }
  11458. if (!initModel) {
  11459. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "initModel is required for setInitialValues to work.");
  11460. return;
  11461. }
  11462. for (const key of initialValues.keys()) initialValues.set(key, cloneDeep(getProp(initModel, key).value));
  11463. fields.forEach((field) => {
  11464. if (field.prop) field.setInitialValue(getProp(initModel, field.prop).value);
  11465. });
  11466. };
  11467. const resetFields = (properties = []) => {
  11468. if (!props.model) {
  11469. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for resetFields to work.");
  11470. return;
  11471. }
  11472. filterFields(fields, properties).forEach((field) => field.resetField());
  11473. const activePropStrings = new Set(fields.map((f) => f.propString).filter(Boolean));
  11474. const propsToCheck = properties.length > 0 ? castArray$1(properties).map((p) => isArray$1(p) ? p.join(".") : p) : [...initialValues.keys()];
  11475. for (const propString of propsToCheck) if (!activePropStrings.has(propString) && initialValues.has(propString)) getProp(props.model, propString).value = cloneDeep(initialValues.get(propString));
  11476. };
  11477. const clearValidate = (props = []) => {
  11478. filterFields(fields, props).forEach((field) => field.clearValidate());
  11479. };
  11480. const isValidatable = (0, vue.computed)(() => {
  11481. const hasModel = !!props.model;
  11482. if (!hasModel) /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "model is required for validate to work.");
  11483. return hasModel;
  11484. });
  11485. const obtainValidateFields = (props) => {
  11486. if (fields.length === 0) return [];
  11487. const filteredFields = filterFields(fields, props);
  11488. if (!filteredFields.length) {
  11489. /* @__PURE__ */ debugWarn(COMPONENT_NAME$21, "please pass correct props!");
  11490. return [];
  11491. }
  11492. return filteredFields;
  11493. };
  11494. const validate = async (callback) => validateField(void 0, callback);
  11495. const doValidateField = async (props = []) => {
  11496. if (!isValidatable.value) return false;
  11497. const fields = obtainValidateFields(props);
  11498. if (fields.length === 0) return true;
  11499. let validationErrors = {};
  11500. for (const field of fields) try {
  11501. await field.validate("");
  11502. if (field.validateState === "error" && !field.error) field.resetField();
  11503. } catch (fields) {
  11504. validationErrors = {
  11505. ...validationErrors,
  11506. ...fields
  11507. };
  11508. }
  11509. if (Object.keys(validationErrors).length === 0) return true;
  11510. return Promise.reject(validationErrors);
  11511. };
  11512. const validateField = async (modelProps = [], callback) => {
  11513. let result = false;
  11514. const shouldThrow = !isFunction$1(callback);
  11515. try {
  11516. result = await doValidateField(modelProps);
  11517. if (result === true) await callback?.(result);
  11518. return result;
  11519. } catch (e) {
  11520. if (e instanceof Error) throw e;
  11521. const invalidFields = e;
  11522. if (props.scrollToError) {
  11523. if (formRef.value) formRef.value.querySelector(`.${ns.b()}-item.is-error`)?.scrollIntoView(props.scrollIntoViewOptions);
  11524. }
  11525. !result && await callback?.(false, invalidFields);
  11526. return shouldThrow && Promise.reject(invalidFields);
  11527. }
  11528. };
  11529. const scrollToField = (prop) => {
  11530. const field = getField(prop);
  11531. if (field) field.$el?.scrollIntoView(props.scrollIntoViewOptions);
  11532. };
  11533. (0, vue.watch)(() => props.rules, () => {
  11534. if (props.validateOnRuleChange) validate().catch((err) => /* @__PURE__ */ debugWarn(err));
  11535. }, {
  11536. deep: true,
  11537. flush: "post"
  11538. });
  11539. (0, vue.provide)(formContextKey, (0, vue.reactive)({
  11540. ...(0, vue.toRefs)(props),
  11541. emit,
  11542. resetFields,
  11543. clearValidate,
  11544. validateField,
  11545. getField,
  11546. addField,
  11547. removeField,
  11548. setInitialValues,
  11549. ...useFormLabelWidth()
  11550. }));
  11551. __expose({
  11552. validate,
  11553. validateField,
  11554. resetFields,
  11555. clearValidate,
  11556. scrollToField,
  11557. getField,
  11558. fields,
  11559. setInitialValues
  11560. });
  11561. return (_ctx, _cache) => {
  11562. return (0, vue.openBlock)(), (0, vue.createElementBlock)("form", {
  11563. ref_key: "formRef",
  11564. ref: formRef,
  11565. class: (0, vue.normalizeClass)(formClasses.value)
  11566. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  11567. };
  11568. }
  11569. });
  11570. //#endregion
  11571. //#region ../../packages/components/form/src/form.vue
  11572. var form_default = form_vue_vue_type_script_setup_true_lang_default;
  11573. //#endregion
  11574. //#region ../../packages/components/form/src/form-item.ts
  11575. const formItemValidateStates = [
  11576. "",
  11577. "error",
  11578. "validating",
  11579. "success"
  11580. ];
  11581. /**
  11582. * @deprecated Removed after 3.0.0, Use `FormItemProps` instead.
  11583. */
  11584. const formItemProps = buildProps({
  11585. label: String,
  11586. labelWidth: { type: [String, Number] },
  11587. labelPosition: {
  11588. type: String,
  11589. values: [
  11590. "left",
  11591. "right",
  11592. "top",
  11593. ""
  11594. ],
  11595. default: ""
  11596. },
  11597. prop: { type: definePropType([String, Array]) },
  11598. required: {
  11599. type: Boolean,
  11600. default: void 0
  11601. },
  11602. rules: { type: definePropType([Object, Array]) },
  11603. error: String,
  11604. validateStatus: {
  11605. type: String,
  11606. values: formItemValidateStates
  11607. },
  11608. for: String,
  11609. inlineMessage: {
  11610. type: Boolean,
  11611. default: void 0
  11612. },
  11613. showMessage: {
  11614. type: Boolean,
  11615. default: true
  11616. },
  11617. size: {
  11618. type: String,
  11619. values: componentSizes
  11620. }
  11621. });
  11622. //#endregion
  11623. //#region ../../node_modules/.pnpm/async-validator@4.2.5_patch_hash=cc6d77b35ed2a1683012935ca9ed998d418912785fcf78c6497d3268ac596d23/node_modules/async-validator/dist-web/index.js
  11624. function _extends() {
  11625. _extends = Object.assign ? Object.assign.bind() : function(target) {
  11626. for (var i = 1; i < arguments.length; i++) {
  11627. var source = arguments[i];
  11628. for (var key in source) if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
  11629. }
  11630. return target;
  11631. };
  11632. return _extends.apply(this, arguments);
  11633. }
  11634. function _inheritsLoose(subClass, superClass) {
  11635. subClass.prototype = Object.create(superClass.prototype);
  11636. subClass.prototype.constructor = subClass;
  11637. _setPrototypeOf(subClass, superClass);
  11638. }
  11639. function _getPrototypeOf(o) {
  11640. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
  11641. return o.__proto__ || Object.getPrototypeOf(o);
  11642. };
  11643. return _getPrototypeOf(o);
  11644. }
  11645. function _setPrototypeOf(o, p) {
  11646. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  11647. o.__proto__ = p;
  11648. return o;
  11649. };
  11650. return _setPrototypeOf(o, p);
  11651. }
  11652. function _isNativeReflectConstruct() {
  11653. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  11654. if (Reflect.construct.sham) return false;
  11655. if (typeof Proxy === "function") return true;
  11656. try {
  11657. Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
  11658. return true;
  11659. } catch (e) {
  11660. return false;
  11661. }
  11662. }
  11663. function _construct(Parent, args, Class) {
  11664. if (_isNativeReflectConstruct()) _construct = Reflect.construct.bind();
  11665. else _construct = function _construct(Parent, args, Class) {
  11666. var a = [null];
  11667. a.push.apply(a, args);
  11668. var instance = new (Function.bind.apply(Parent, a))();
  11669. if (Class) _setPrototypeOf(instance, Class.prototype);
  11670. return instance;
  11671. };
  11672. return _construct.apply(null, arguments);
  11673. }
  11674. function _isNativeFunction(fn) {
  11675. return Function.toString.call(fn).indexOf("[native code]") !== -1;
  11676. }
  11677. function _wrapNativeSuper(Class) {
  11678. var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
  11679. _wrapNativeSuper = function _wrapNativeSuper(Class) {
  11680. if (Class === null || !_isNativeFunction(Class)) return Class;
  11681. if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
  11682. if (typeof _cache !== "undefined") {
  11683. if (_cache.has(Class)) return _cache.get(Class);
  11684. _cache.set(Class, Wrapper);
  11685. }
  11686. function Wrapper() {
  11687. return _construct(Class, arguments, _getPrototypeOf(this).constructor);
  11688. }
  11689. Wrapper.prototype = Object.create(Class.prototype, { constructor: {
  11690. value: Wrapper,
  11691. enumerable: false,
  11692. writable: true,
  11693. configurable: true
  11694. } });
  11695. return _setPrototypeOf(Wrapper, Class);
  11696. };
  11697. return _wrapNativeSuper(Class);
  11698. }
  11699. var formatRegExp = /%[sdj%]/g;
  11700. var warning = function warning() {};
  11701. if (typeof process !== "undefined" && process.env && false);
  11702. function convertFieldsError(errors) {
  11703. if (!errors || !errors.length) return null;
  11704. var fields = {};
  11705. errors.forEach(function(error) {
  11706. var field = error.field;
  11707. fields[field] = fields[field] || [];
  11708. fields[field].push(error);
  11709. });
  11710. return fields;
  11711. }
  11712. function format(template) {
  11713. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) args[_key - 1] = arguments[_key];
  11714. var i = 0;
  11715. var len = args.length;
  11716. if (typeof template === "function") return template.apply(null, args);
  11717. if (typeof template === "string") return template.replace(formatRegExp, function(x) {
  11718. if (x === "%%") return "%";
  11719. if (i >= len) return x;
  11720. switch (x) {
  11721. case "%s": return String(args[i++]);
  11722. case "%d": return Number(args[i++]);
  11723. case "%j":
  11724. try {
  11725. return JSON.stringify(args[i++]);
  11726. } catch (_) {
  11727. return "[Circular]";
  11728. }
  11729. break;
  11730. default: return x;
  11731. }
  11732. });
  11733. return template;
  11734. }
  11735. function isNativeStringType(type) {
  11736. return type === "string" || type === "url" || type === "hex" || type === "email" || type === "date" || type === "pattern";
  11737. }
  11738. function isEmptyValue(value, type) {
  11739. if (value === void 0 || value === null) return true;
  11740. if (type === "array" && Array.isArray(value) && !value.length) return true;
  11741. if (isNativeStringType(type) && typeof value === "string" && !value) return true;
  11742. return false;
  11743. }
  11744. function asyncParallelArray(arr, func, callback) {
  11745. var results = [];
  11746. var total = 0;
  11747. var arrLength = arr.length;
  11748. function count(errors) {
  11749. results.push.apply(results, errors || []);
  11750. total++;
  11751. if (total === arrLength) callback(results);
  11752. }
  11753. arr.forEach(function(a) {
  11754. func(a, count);
  11755. });
  11756. }
  11757. function asyncSerialArray(arr, func, callback) {
  11758. var index = 0;
  11759. var arrLength = arr.length;
  11760. function next(errors) {
  11761. if (errors && errors.length) {
  11762. callback(errors);
  11763. return;
  11764. }
  11765. var original = index;
  11766. index = index + 1;
  11767. if (original < arrLength) func(arr[original], next);
  11768. else callback([]);
  11769. }
  11770. next([]);
  11771. }
  11772. function flattenObjArr(objArr) {
  11773. var ret = [];
  11774. Object.keys(objArr).forEach(function(k) {
  11775. ret.push.apply(ret, objArr[k] || []);
  11776. });
  11777. return ret;
  11778. }
  11779. var AsyncValidationError = /* @__PURE__ */ function(_Error) {
  11780. _inheritsLoose(AsyncValidationError, _Error);
  11781. function AsyncValidationError(errors, fields) {
  11782. var _this = _Error.call(this, "Async Validation Error") || this;
  11783. _this.errors = errors;
  11784. _this.fields = fields;
  11785. return _this;
  11786. }
  11787. return AsyncValidationError;
  11788. }(/* @__PURE__ */ _wrapNativeSuper(Error));
  11789. function asyncMap(objArr, option, func, callback, source) {
  11790. if (option.first) {
  11791. var _pending = new Promise(function(resolve, reject) {
  11792. asyncSerialArray(flattenObjArr(objArr), func, function next(errors) {
  11793. callback(errors);
  11794. return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
  11795. });
  11796. });
  11797. _pending["catch"](function(e) {
  11798. return e;
  11799. });
  11800. return _pending;
  11801. }
  11802. var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
  11803. var objArrKeys = Object.keys(objArr);
  11804. var objArrLength = objArrKeys.length;
  11805. var total = 0;
  11806. var results = [];
  11807. var pending = new Promise(function(resolve, reject) {
  11808. var next = function next(errors) {
  11809. results.push.apply(results, errors);
  11810. total++;
  11811. if (total === objArrLength) {
  11812. callback(results);
  11813. return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
  11814. }
  11815. };
  11816. if (!objArrKeys.length) {
  11817. callback(results);
  11818. resolve(source);
  11819. }
  11820. objArrKeys.forEach(function(key) {
  11821. var arr = objArr[key];
  11822. if (firstFields.indexOf(key) !== -1) asyncSerialArray(arr, func, next);
  11823. else asyncParallelArray(arr, func, next);
  11824. });
  11825. });
  11826. pending["catch"](function(e) {
  11827. return e;
  11828. });
  11829. return pending;
  11830. }
  11831. function isErrorObj(obj) {
  11832. return !!(obj && obj.message !== void 0);
  11833. }
  11834. function getValue(value, path) {
  11835. var v = value;
  11836. for (var i = 0; i < path.length; i++) {
  11837. if (v == void 0) return v;
  11838. v = v[path[i]];
  11839. }
  11840. return v;
  11841. }
  11842. function complementError(rule, source) {
  11843. return function(oe) {
  11844. var fieldValue;
  11845. if (rule.fullFields) fieldValue = getValue(source, rule.fullFields);
  11846. else fieldValue = source[oe.field || rule.fullField];
  11847. if (isErrorObj(oe)) {
  11848. oe.field = oe.field || rule.fullField;
  11849. oe.fieldValue = fieldValue;
  11850. return oe;
  11851. }
  11852. return {
  11853. message: typeof oe === "function" ? oe() : oe,
  11854. fieldValue,
  11855. field: oe.field || rule.fullField
  11856. };
  11857. };
  11858. }
  11859. function deepMerge(target, source) {
  11860. if (source) {
  11861. for (var s in source) if (source.hasOwnProperty(s)) {
  11862. var value = source[s];
  11863. if (typeof value === "object" && typeof target[s] === "object") target[s] = _extends({}, target[s], value);
  11864. else target[s] = value;
  11865. }
  11866. }
  11867. return target;
  11868. }
  11869. var required$1 = function required(rule, value, source, errors, options, type) {
  11870. if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type || rule.type))) errors.push(format(options.messages.required, rule.fullField));
  11871. };
  11872. /**
  11873. * Rule for validating whitespace.
  11874. *
  11875. * @param rule The validation rule.
  11876. * @param value The value of the field on the source object.
  11877. * @param source The source object being validated.
  11878. * @param errors An array of errors that this rule may add
  11879. * validation errors to.
  11880. * @param options The validation options.
  11881. * @param options.messages The validation messages.
  11882. */
  11883. var whitespace = function whitespace(rule, value, source, errors, options) {
  11884. if (/^\s+$/.test(value) || value === "") errors.push(format(options.messages.whitespace, rule.fullField));
  11885. };
  11886. var urlReg;
  11887. var getUrlRegex = (function() {
  11888. if (urlReg) return urlReg;
  11889. var word = "[a-fA-F\\d:]";
  11890. var b = function b(options) {
  11891. return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
  11892. };
  11893. 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}";
  11894. var v6seg = "[a-fA-F\\d]{1,4}";
  11895. 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();
  11896. var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
  11897. var v4exact = new RegExp("^" + v4 + "$");
  11898. var v6exact = new RegExp("^" + v6 + "$");
  11899. var ip = function ip(options) {
  11900. return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", "g");
  11901. };
  11902. ip.v4 = function(options) {
  11903. return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), "g");
  11904. };
  11905. ip.v6 = function(options) {
  11906. return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), "g");
  11907. };
  11908. var protocol = "(?:(?:[a-z]+:)?//)";
  11909. var auth = "(?:\\S+(?::\\S*)?@)?";
  11910. var ipv4 = ip.v4().source;
  11911. var ipv6 = ip.v6().source;
  11912. var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s\"]*)?";
  11913. urlReg = new RegExp("(?:^" + regex + "$)", "i");
  11914. return urlReg;
  11915. });
  11916. var pattern$2 = {
  11917. 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,}))$/,
  11918. hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
  11919. };
  11920. var types = {
  11921. integer: function integer(value) {
  11922. return types.number(value) && parseInt(value, 10) === value;
  11923. },
  11924. "float": function float(value) {
  11925. return types.number(value) && !types.integer(value);
  11926. },
  11927. array: function array(value) {
  11928. return Array.isArray(value);
  11929. },
  11930. regexp: function regexp(value) {
  11931. if (value instanceof RegExp) return true;
  11932. try {
  11933. return !!new RegExp(value);
  11934. } catch (e) {
  11935. return false;
  11936. }
  11937. },
  11938. date: function date(value) {
  11939. return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
  11940. },
  11941. number: function number(value) {
  11942. if (isNaN(value)) return false;
  11943. return typeof value === "number";
  11944. },
  11945. object: function object(value) {
  11946. return typeof value === "object" && !types.array(value);
  11947. },
  11948. method: function method(value) {
  11949. return typeof value === "function";
  11950. },
  11951. email: function email(value) {
  11952. return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
  11953. },
  11954. url: function url(value) {
  11955. return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
  11956. },
  11957. hex: function hex(value) {
  11958. return typeof value === "string" && !!value.match(pattern$2.hex);
  11959. }
  11960. };
  11961. var type$1 = function type(rule, value, source, errors, options) {
  11962. if (rule.required && value === void 0) {
  11963. required$1(rule, value, source, errors, options);
  11964. return;
  11965. }
  11966. var custom = [
  11967. "integer",
  11968. "float",
  11969. "array",
  11970. "regexp",
  11971. "object",
  11972. "method",
  11973. "email",
  11974. "number",
  11975. "date",
  11976. "url",
  11977. "hex"
  11978. ];
  11979. var ruleType = rule.type;
  11980. if (custom.indexOf(ruleType) > -1) {
  11981. if (!types[ruleType](value)) errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11982. } else if (ruleType && typeof value !== rule.type) errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
  11983. };
  11984. var range = function range(rule, value, source, errors, options) {
  11985. var len = typeof rule.len === "number";
  11986. var min = typeof rule.min === "number";
  11987. var max = typeof rule.max === "number";
  11988. var val = value;
  11989. var key = null;
  11990. var num = typeof value === "number";
  11991. var str = typeof value === "string";
  11992. var arr = Array.isArray(value);
  11993. if (num) key = "number";
  11994. else if (str) key = "string";
  11995. else if (arr) key = "array";
  11996. if (!key) return false;
  11997. if (arr) val = value.length;
  11998. if (str) val = value.length;
  11999. if (len) {
  12000. if (val !== rule.len) errors.push(format(options.messages[key].len, rule.fullField, rule.len));
  12001. } else if (min && !max && val < rule.min) errors.push(format(options.messages[key].min, rule.fullField, rule.min));
  12002. else if (max && !min && val > rule.max) errors.push(format(options.messages[key].max, rule.fullField, rule.max));
  12003. else if (min && max && (val < rule.min || val > rule.max)) errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
  12004. };
  12005. var ENUM$1 = "enum";
  12006. var enumerable$1 = function enumerable(rule, value, source, errors, options) {
  12007. rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
  12008. if (rule[ENUM$1].indexOf(value) === -1) errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
  12009. };
  12010. var pattern$1 = function pattern(rule, value, source, errors, options) {
  12011. if (rule.pattern) {
  12012. if (rule.pattern instanceof RegExp) {
  12013. rule.pattern.lastIndex = 0;
  12014. if (!rule.pattern.test(value)) errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12015. } else if (typeof rule.pattern === "string") {
  12016. if (!new RegExp(rule.pattern).test(value)) errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
  12017. }
  12018. }
  12019. };
  12020. var rules = {
  12021. required: required$1,
  12022. whitespace,
  12023. type: type$1,
  12024. range,
  12025. "enum": enumerable$1,
  12026. pattern: pattern$1
  12027. };
  12028. var string = function string(rule, value, callback, source, options) {
  12029. var errors = [];
  12030. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12031. if (isEmptyValue(value, "string") && !rule.required) return callback();
  12032. rules.required(rule, value, source, errors, options, "string");
  12033. if (!isEmptyValue(value, "string")) {
  12034. rules.type(rule, value, source, errors, options);
  12035. rules.range(rule, value, source, errors, options);
  12036. rules.pattern(rule, value, source, errors, options);
  12037. if (rule.whitespace === true) rules.whitespace(rule, value, source, errors, options);
  12038. }
  12039. }
  12040. callback(errors);
  12041. };
  12042. var method = function method(rule, value, callback, source, options) {
  12043. var errors = [];
  12044. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12045. if (isEmptyValue(value) && !rule.required) return callback();
  12046. rules.required(rule, value, source, errors, options);
  12047. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12048. }
  12049. callback(errors);
  12050. };
  12051. var number = function number(rule, value, callback, source, options) {
  12052. var errors = [];
  12053. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12054. if (value === "") value = void 0;
  12055. if (isEmptyValue(value) && !rule.required) return callback();
  12056. rules.required(rule, value, source, errors, options);
  12057. if (value !== void 0) {
  12058. rules.type(rule, value, source, errors, options);
  12059. rules.range(rule, value, source, errors, options);
  12060. }
  12061. }
  12062. callback(errors);
  12063. };
  12064. var _boolean = function _boolean(rule, value, callback, source, options) {
  12065. var errors = [];
  12066. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12067. if (isEmptyValue(value) && !rule.required) return callback();
  12068. rules.required(rule, value, source, errors, options);
  12069. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12070. }
  12071. callback(errors);
  12072. };
  12073. var regexp = function regexp(rule, value, callback, source, options) {
  12074. var errors = [];
  12075. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12076. if (isEmptyValue(value) && !rule.required) return callback();
  12077. rules.required(rule, value, source, errors, options);
  12078. if (!isEmptyValue(value)) rules.type(rule, value, source, errors, options);
  12079. }
  12080. callback(errors);
  12081. };
  12082. var integer = function integer(rule, value, callback, source, options) {
  12083. var errors = [];
  12084. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12085. if (isEmptyValue(value) && !rule.required) return callback();
  12086. rules.required(rule, value, source, errors, options);
  12087. if (value !== void 0) {
  12088. rules.type(rule, value, source, errors, options);
  12089. rules.range(rule, value, source, errors, options);
  12090. }
  12091. }
  12092. callback(errors);
  12093. };
  12094. var floatFn = function floatFn(rule, value, callback, source, options) {
  12095. var errors = [];
  12096. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12097. if (isEmptyValue(value) && !rule.required) return callback();
  12098. rules.required(rule, value, source, errors, options);
  12099. if (value !== void 0) {
  12100. rules.type(rule, value, source, errors, options);
  12101. rules.range(rule, value, source, errors, options);
  12102. }
  12103. }
  12104. callback(errors);
  12105. };
  12106. var array = function array(rule, value, callback, source, options) {
  12107. var errors = [];
  12108. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12109. if ((value === void 0 || value === null) && !rule.required) return callback();
  12110. rules.required(rule, value, source, errors, options, "array");
  12111. if (value !== void 0 && value !== null) {
  12112. rules.type(rule, value, source, errors, options);
  12113. rules.range(rule, value, source, errors, options);
  12114. }
  12115. }
  12116. callback(errors);
  12117. };
  12118. var object = function object(rule, value, callback, source, options) {
  12119. var errors = [];
  12120. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12121. if (isEmptyValue(value) && !rule.required) return callback();
  12122. rules.required(rule, value, source, errors, options);
  12123. if (value !== void 0) rules.type(rule, value, source, errors, options);
  12124. }
  12125. callback(errors);
  12126. };
  12127. var ENUM = "enum";
  12128. var enumerable = function enumerable(rule, value, callback, source, options) {
  12129. var errors = [];
  12130. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12131. if (isEmptyValue(value) && !rule.required) return callback();
  12132. rules.required(rule, value, source, errors, options);
  12133. if (value !== void 0) rules[ENUM](rule, value, source, errors, options);
  12134. }
  12135. callback(errors);
  12136. };
  12137. var pattern = function pattern(rule, value, callback, source, options) {
  12138. var errors = [];
  12139. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12140. if (isEmptyValue(value, "string") && !rule.required) return callback();
  12141. rules.required(rule, value, source, errors, options);
  12142. if (!isEmptyValue(value, "string")) rules.pattern(rule, value, source, errors, options);
  12143. }
  12144. callback(errors);
  12145. };
  12146. var date = function date(rule, value, callback, source, options) {
  12147. var errors = [];
  12148. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12149. if (isEmptyValue(value, "date") && !rule.required) return callback();
  12150. rules.required(rule, value, source, errors, options);
  12151. if (!isEmptyValue(value, "date")) {
  12152. var dateObject;
  12153. if (value instanceof Date) dateObject = value;
  12154. else dateObject = new Date(value);
  12155. rules.type(rule, dateObject, source, errors, options);
  12156. if (dateObject) rules.range(rule, dateObject.getTime(), source, errors, options);
  12157. }
  12158. }
  12159. callback(errors);
  12160. };
  12161. var required = function required(rule, value, callback, source, options) {
  12162. var errors = [];
  12163. var type = Array.isArray(value) ? "array" : typeof value;
  12164. rules.required(rule, value, source, errors, options, type);
  12165. callback(errors);
  12166. };
  12167. var type = function type(rule, value, callback, source, options) {
  12168. var ruleType = rule.type;
  12169. var errors = [];
  12170. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12171. if (isEmptyValue(value, ruleType) && !rule.required) return callback();
  12172. rules.required(rule, value, source, errors, options, ruleType);
  12173. if (!isEmptyValue(value, ruleType)) rules.type(rule, value, source, errors, options);
  12174. }
  12175. callback(errors);
  12176. };
  12177. var any = function any(rule, value, callback, source, options) {
  12178. var errors = [];
  12179. if (rule.required || !rule.required && source.hasOwnProperty(rule.field)) {
  12180. if (isEmptyValue(value) && !rule.required) return callback();
  12181. rules.required(rule, value, source, errors, options);
  12182. }
  12183. callback(errors);
  12184. };
  12185. var validators = {
  12186. string,
  12187. method,
  12188. number,
  12189. "boolean": _boolean,
  12190. regexp,
  12191. integer,
  12192. "float": floatFn,
  12193. array,
  12194. object,
  12195. "enum": enumerable,
  12196. pattern,
  12197. date,
  12198. url: type,
  12199. hex: type,
  12200. email: type,
  12201. required,
  12202. any
  12203. };
  12204. function newMessages() {
  12205. return {
  12206. "default": "Validation error on field %s",
  12207. required: "%s is required",
  12208. "enum": "%s must be one of %s",
  12209. whitespace: "%s cannot be empty",
  12210. date: {
  12211. format: "%s date %s is invalid for format %s",
  12212. parse: "%s date could not be parsed, %s is invalid ",
  12213. invalid: "%s date %s is invalid"
  12214. },
  12215. types: {
  12216. string: "%s is not a %s",
  12217. method: "%s is not a %s (function)",
  12218. array: "%s is not an %s",
  12219. object: "%s is not an %s",
  12220. number: "%s is not a %s",
  12221. date: "%s is not a %s",
  12222. "boolean": "%s is not a %s",
  12223. integer: "%s is not an %s",
  12224. "float": "%s is not a %s",
  12225. regexp: "%s is not a valid %s",
  12226. email: "%s is not a valid %s",
  12227. url: "%s is not a valid %s",
  12228. hex: "%s is not a valid %s"
  12229. },
  12230. string: {
  12231. len: "%s must be exactly %s characters",
  12232. min: "%s must be at least %s characters",
  12233. max: "%s cannot be longer than %s characters",
  12234. range: "%s must be between %s and %s characters"
  12235. },
  12236. number: {
  12237. len: "%s must equal %s",
  12238. min: "%s cannot be less than %s",
  12239. max: "%s cannot be greater than %s",
  12240. range: "%s must be between %s and %s"
  12241. },
  12242. array: {
  12243. len: "%s must be exactly %s in length",
  12244. min: "%s cannot be less than %s in length",
  12245. max: "%s cannot be greater than %s in length",
  12246. range: "%s must be between %s and %s in length"
  12247. },
  12248. pattern: { mismatch: "%s value %s does not match pattern %s" },
  12249. clone: function clone() {
  12250. var cloned = JSON.parse(JSON.stringify(this));
  12251. cloned.clone = this.clone;
  12252. return cloned;
  12253. }
  12254. };
  12255. }
  12256. var messages = newMessages();
  12257. /**
  12258. * Encapsulates a validation schema.
  12259. *
  12260. * @param descriptor An object declaring validation rules
  12261. * for this schema.
  12262. */
  12263. var Schema = /* @__PURE__ */ function() {
  12264. function Schema(descriptor) {
  12265. this.rules = null;
  12266. this._messages = messages;
  12267. this.define(descriptor);
  12268. }
  12269. var _proto = Schema.prototype;
  12270. _proto.define = function define(rules) {
  12271. var _this = this;
  12272. if (!rules) throw new Error("Cannot configure a schema with no rules");
  12273. if (typeof rules !== "object" || Array.isArray(rules)) throw new Error("Rules must be an object");
  12274. this.rules = {};
  12275. Object.keys(rules).forEach(function(name) {
  12276. var item = rules[name];
  12277. _this.rules[name] = Array.isArray(item) ? item : [item];
  12278. });
  12279. };
  12280. _proto.messages = function messages(_messages) {
  12281. if (_messages) this._messages = deepMerge(newMessages(), _messages);
  12282. return this._messages;
  12283. };
  12284. _proto.validate = function validate(source_, o, oc) {
  12285. var _this2 = this;
  12286. if (o === void 0) o = {};
  12287. if (oc === void 0) oc = function oc() {};
  12288. var source = source_;
  12289. var options = o;
  12290. var callback = oc;
  12291. if (typeof options === "function") {
  12292. callback = options;
  12293. options = {};
  12294. }
  12295. if (!this.rules || Object.keys(this.rules).length === 0) {
  12296. if (callback) callback(null, source);
  12297. return Promise.resolve(source);
  12298. }
  12299. function complete(results) {
  12300. var errors = [];
  12301. var fields = {};
  12302. function add(e) {
  12303. if (Array.isArray(e)) {
  12304. var _errors;
  12305. errors = (_errors = errors).concat.apply(_errors, e);
  12306. } else errors.push(e);
  12307. }
  12308. for (var i = 0; i < results.length; i++) add(results[i]);
  12309. if (!errors.length) callback(null, source);
  12310. else {
  12311. fields = convertFieldsError(errors);
  12312. callback(errors, fields);
  12313. }
  12314. }
  12315. if (options.messages) {
  12316. var messages$1 = this.messages();
  12317. if (messages$1 === messages) messages$1 = newMessages();
  12318. deepMerge(messages$1, options.messages);
  12319. options.messages = messages$1;
  12320. } else options.messages = this.messages();
  12321. var series = {};
  12322. (options.keys || Object.keys(this.rules)).forEach(function(z) {
  12323. var arr = _this2.rules[z];
  12324. var value = source[z];
  12325. arr.forEach(function(r) {
  12326. var rule = r;
  12327. if (typeof rule.transform === "function") {
  12328. if (source === source_) source = _extends({}, source);
  12329. value = source[z] = rule.transform(value);
  12330. }
  12331. if (typeof rule === "function") rule = { validator: rule };
  12332. else rule = _extends({}, rule);
  12333. rule.validator = _this2.getValidationMethod(rule);
  12334. if (!rule.validator) return;
  12335. rule.field = z;
  12336. rule.fullField = rule.fullField || z;
  12337. rule.type = _this2.getType(rule);
  12338. series[z] = series[z] || [];
  12339. series[z].push({
  12340. rule,
  12341. value,
  12342. source,
  12343. field: z
  12344. });
  12345. });
  12346. });
  12347. var errorFields = {};
  12348. return asyncMap(series, options, function(data, doIt) {
  12349. var rule = data.rule;
  12350. var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
  12351. deep = deep && (rule.required || !rule.required && data.value);
  12352. rule.field = data.field;
  12353. function addFullField(key, schema) {
  12354. return _extends({}, schema, {
  12355. fullField: rule.fullField + "." + key,
  12356. fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
  12357. });
  12358. }
  12359. function cb(e) {
  12360. if (e === void 0) e = [];
  12361. var errorList = Array.isArray(e) ? e : [e];
  12362. if (!options.suppressWarning && errorList.length) Schema.warning("async-validator:", errorList);
  12363. if (errorList.length && rule.message !== void 0) errorList = [].concat(rule.message);
  12364. var filledErrors = errorList.map(complementError(rule, source));
  12365. if (options.first && filledErrors.length) {
  12366. errorFields[rule.field] = 1;
  12367. return doIt(filledErrors);
  12368. }
  12369. if (!deep) doIt(filledErrors);
  12370. else {
  12371. if (rule.required && !data.value) {
  12372. if (rule.message !== void 0) filledErrors = [].concat(rule.message).map(complementError(rule, source));
  12373. else if (options.error) filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
  12374. return doIt(filledErrors);
  12375. }
  12376. var fieldsSchema = {};
  12377. if (rule.defaultField) Object.keys(data.value).map(function(key) {
  12378. fieldsSchema[key] = rule.defaultField;
  12379. });
  12380. fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
  12381. var paredFieldsSchema = {};
  12382. Object.keys(fieldsSchema).forEach(function(field) {
  12383. var fieldSchema = fieldsSchema[field];
  12384. paredFieldsSchema[field] = (Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema]).map(addFullField.bind(null, field));
  12385. });
  12386. var schema = new Schema(paredFieldsSchema);
  12387. schema.messages(options.messages);
  12388. if (data.rule.options) {
  12389. data.rule.options.messages = options.messages;
  12390. data.rule.options.error = options.error;
  12391. }
  12392. schema.validate(data.value, data.rule.options || options, function(errs) {
  12393. var finalErrors = [];
  12394. if (filledErrors && filledErrors.length) finalErrors.push.apply(finalErrors, filledErrors);
  12395. if (errs && errs.length) finalErrors.push.apply(finalErrors, errs);
  12396. doIt(finalErrors.length ? finalErrors : null);
  12397. });
  12398. }
  12399. }
  12400. var res;
  12401. if (rule.asyncValidator) res = rule.asyncValidator(rule, data.value, cb, data.source, options);
  12402. else if (rule.validator) {
  12403. try {
  12404. res = rule.validator(rule, data.value, cb, data.source, options);
  12405. } catch (error) {
  12406. console.error == null || console.error(error);
  12407. if (!options.suppressValidatorError) setTimeout(function() {
  12408. throw error;
  12409. }, 0);
  12410. cb(error.message);
  12411. }
  12412. if (res === true) cb();
  12413. else if (res === false) cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
  12414. else if (res instanceof Array) cb(res);
  12415. else if (res instanceof Error) cb(res.message);
  12416. }
  12417. if (res && res.then) res.then(function() {
  12418. return cb();
  12419. }, function(e) {
  12420. return cb(e);
  12421. });
  12422. }, function(results) {
  12423. complete(results);
  12424. }, source);
  12425. };
  12426. _proto.getType = function getType(rule) {
  12427. if (rule.type === void 0 && rule.pattern instanceof RegExp) rule.type = "pattern";
  12428. if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) throw new Error(format("Unknown rule type %s", rule.type));
  12429. return rule.type || "string";
  12430. };
  12431. _proto.getValidationMethod = function getValidationMethod(rule) {
  12432. if (typeof rule.validator === "function") return rule.validator;
  12433. var keys = Object.keys(rule);
  12434. var messageIndex = keys.indexOf("message");
  12435. if (messageIndex !== -1) keys.splice(messageIndex, 1);
  12436. if (keys.length === 1 && keys[0] === "required") return validators.required;
  12437. return validators[this.getType(rule)] || void 0;
  12438. };
  12439. return Schema;
  12440. }();
  12441. Schema.register = function register(type, validator) {
  12442. if (typeof validator !== "function") throw new Error("Cannot register a validator by type, validator is not a function");
  12443. validators[type] = validator;
  12444. };
  12445. Schema.warning = warning;
  12446. Schema.messages = messages;
  12447. Schema.validators = validators;
  12448. //#endregion
  12449. //#region ../../packages/components/form/src/form-label-wrap.tsx
  12450. const COMPONENT_NAME$20 = "ElLabelWrap";
  12451. var form_label_wrap_default = /* @__PURE__ */ (0, vue.defineComponent)({
  12452. name: COMPONENT_NAME$20,
  12453. props: {
  12454. isAutoWidth: Boolean,
  12455. updateAll: Boolean
  12456. },
  12457. setup(props, { slots }) {
  12458. const formContext = (0, vue.inject)(formContextKey, void 0);
  12459. const formItemContext = (0, vue.inject)(formItemContextKey);
  12460. if (!formItemContext) throwError(COMPONENT_NAME$20, "usage: <el-form-item><label-wrap /></el-form-item>");
  12461. const ns = useNamespace("form");
  12462. const el = (0, vue.ref)();
  12463. const computedWidth = (0, vue.ref)(0);
  12464. const getLabelWidth = () => {
  12465. if (el.value?.firstElementChild) {
  12466. const width = window.getComputedStyle(el.value.firstElementChild).width;
  12467. return Math.ceil(Number.parseFloat(width));
  12468. } else return 0;
  12469. };
  12470. const updateLabelWidth = (action = "update") => {
  12471. (0, vue.nextTick)(() => {
  12472. if (slots.default && props.isAutoWidth) {
  12473. if (action === "update") computedWidth.value = getLabelWidth();
  12474. else if (action === "remove") formContext?.deregisterLabelWidth(computedWidth.value);
  12475. }
  12476. });
  12477. };
  12478. const updateLabelWidthFn = () => updateLabelWidth("update");
  12479. (0, vue.onMounted)(() => {
  12480. updateLabelWidthFn();
  12481. });
  12482. (0, vue.onBeforeUnmount)(() => {
  12483. updateLabelWidth("remove");
  12484. });
  12485. (0, vue.onUpdated)(() => updateLabelWidthFn());
  12486. (0, vue.watch)(computedWidth, (val, oldVal) => {
  12487. if (props.updateAll) formContext?.registerLabelWidth(val, oldVal);
  12488. });
  12489. useResizeObserver((0, vue.computed)(() => el.value?.firstElementChild ?? null), updateLabelWidthFn);
  12490. return () => {
  12491. if (!slots) return null;
  12492. const { isAutoWidth } = props;
  12493. if (isAutoWidth) {
  12494. const autoLabelWidth = formContext?.autoLabelWidth;
  12495. const hasLabel = formItemContext?.hasLabel;
  12496. const style = {};
  12497. if (hasLabel && autoLabelWidth && autoLabelWidth !== "auto") {
  12498. const marginWidth = Math.max(0, Number.parseInt(autoLabelWidth, 10) - computedWidth.value);
  12499. const marginPosition = (formItemContext.labelPosition || formContext.labelPosition) === "left" ? "marginRight" : "marginLeft";
  12500. if (marginWidth) style[marginPosition] = `${marginWidth}px`;
  12501. }
  12502. return (0, vue.createVNode)("div", {
  12503. "ref": el,
  12504. "class": [ns.be("item", "label-wrap")],
  12505. "style": style
  12506. }, [slots.default?.()]);
  12507. } else return (0, vue.createVNode)(vue.Fragment, { "ref": el }, [slots.default?.()]);
  12508. };
  12509. }
  12510. });
  12511. //#endregion
  12512. //#region ../../packages/components/form/src/form-item.vue?vue&type=script&setup=true&lang.ts
  12513. const _hoisted_1$78 = ["role", "aria-labelledby"];
  12514. var form_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  12515. name: "ElFormItem",
  12516. __name: "form-item",
  12517. props: formItemProps,
  12518. setup(__props, { expose: __expose }) {
  12519. const props = __props;
  12520. const slots = (0, vue.useSlots)();
  12521. const formContext = (0, vue.inject)(formContextKey, void 0);
  12522. const parentFormItemContext = (0, vue.inject)(formItemContextKey, void 0);
  12523. const _size = useFormSize(void 0, { formItem: false });
  12524. const ns = useNamespace("form-item");
  12525. const labelId = useId().value;
  12526. const inputIds = (0, vue.ref)([]);
  12527. const validateState = (0, vue.ref)("");
  12528. const validateStateDebounced = refDebounced(validateState, 100);
  12529. const validateMessage = (0, vue.ref)("");
  12530. const formItemRef = (0, vue.ref)();
  12531. let initialValue = void 0;
  12532. let isResettingField = false;
  12533. const labelPosition = (0, vue.computed)(() => props.labelPosition || formContext?.labelPosition);
  12534. const labelStyle = (0, vue.computed)(() => {
  12535. if (labelPosition.value === "top") return {};
  12536. return { width: addUnit(props.labelWidth ?? formContext?.labelWidth) };
  12537. });
  12538. const contentStyle = (0, vue.computed)(() => {
  12539. if (labelPosition.value === "top" || formContext?.inline) return {};
  12540. if (!props.label && !props.labelWidth && isNested) return {};
  12541. const labelWidth = addUnit(props.labelWidth ?? formContext?.labelWidth);
  12542. if (!props.label && !slots.label) return { marginLeft: labelWidth };
  12543. return {};
  12544. });
  12545. const formItemClasses = (0, vue.computed)(() => [
  12546. ns.b(),
  12547. ns.m(_size.value),
  12548. ns.is("error", validateState.value === "error"),
  12549. ns.is("validating", validateState.value === "validating"),
  12550. ns.is("success", validateState.value === "success"),
  12551. ns.is("required", isRequired.value || props.required),
  12552. ns.is("no-asterisk", formContext?.hideRequiredAsterisk),
  12553. formContext?.requireAsteriskPosition === "right" ? "asterisk-right" : "asterisk-left",
  12554. {
  12555. [ns.m("feedback")]: formContext?.statusIcon,
  12556. [ns.m(`label-${labelPosition.value}`)]: labelPosition.value
  12557. }
  12558. ]);
  12559. const _inlineMessage = (0, vue.computed)(() => isBoolean(props.inlineMessage) ? props.inlineMessage : formContext?.inlineMessage || false);
  12560. const validateClasses = (0, vue.computed)(() => [ns.e("error"), { [ns.em("error", "inline")]: _inlineMessage.value }]);
  12561. const propString = (0, vue.computed)(() => {
  12562. if (!props.prop) return "";
  12563. return isArray$1(props.prop) ? props.prop.join(".") : props.prop;
  12564. });
  12565. const hasLabel = (0, vue.computed)(() => {
  12566. return !!(props.label || slots.label);
  12567. });
  12568. const labelFor = (0, vue.computed)(() => {
  12569. return props.for ?? (inputIds.value.length === 1 ? inputIds.value[0] : void 0);
  12570. });
  12571. const isGroup = (0, vue.computed)(() => {
  12572. return !labelFor.value && hasLabel.value;
  12573. });
  12574. const isNested = !!parentFormItemContext;
  12575. const fieldValue = (0, vue.computed)(() => {
  12576. const model = formContext?.model;
  12577. if (!model || !props.prop) return;
  12578. return getProp(model, props.prop).value;
  12579. });
  12580. const normalizedRules = (0, vue.computed)(() => {
  12581. const { required } = props;
  12582. const rules = [];
  12583. if (props.rules) rules.push(...castArray$1(props.rules));
  12584. const formRules = formContext?.rules;
  12585. if (formRules && props.prop) {
  12586. const _rules = getProp(formRules, props.prop).value;
  12587. if (_rules) rules.push(...castArray$1(_rules));
  12588. }
  12589. if (required !== void 0) {
  12590. const requiredRules = rules.map((rule, i) => [rule, i]).filter(([rule]) => "required" in rule);
  12591. if (requiredRules.length > 0) for (const [rule, i] of requiredRules) {
  12592. if (rule.required === required) continue;
  12593. rules[i] = {
  12594. ...rule,
  12595. required
  12596. };
  12597. }
  12598. else rules.push({ required });
  12599. }
  12600. return rules;
  12601. });
  12602. const validateEnabled = (0, vue.computed)(() => normalizedRules.value.length > 0);
  12603. const getFilteredRule = (trigger) => {
  12604. return normalizedRules.value.filter((rule) => {
  12605. if (!rule.trigger || !trigger) return true;
  12606. if (isArray$1(rule.trigger)) return rule.trigger.includes(trigger);
  12607. else return rule.trigger === trigger;
  12608. }).map(({ trigger, ...rule }) => rule);
  12609. };
  12610. const isRequired = (0, vue.computed)(() => normalizedRules.value.some((rule) => rule.required));
  12611. const shouldShowError = (0, vue.computed)(() => validateStateDebounced.value === "error" && props.showMessage && (formContext?.showMessage ?? true));
  12612. const currentLabel = (0, vue.computed)(() => `${props.label || ""}${formContext?.labelSuffix || ""}`);
  12613. const setValidationState = (state) => {
  12614. validateState.value = state;
  12615. };
  12616. const onValidationFailed = (error) => {
  12617. const { errors, fields } = error;
  12618. if (!errors || !fields) console.error(error);
  12619. setValidationState("error");
  12620. validateMessage.value = errors ? errors?.[0]?.message ?? `${props.prop} is required` : "";
  12621. formContext?.emit("validate", props.prop, false, validateMessage.value);
  12622. };
  12623. const onValidationSucceeded = () => {
  12624. setValidationState("success");
  12625. formContext?.emit("validate", props.prop, true, "");
  12626. };
  12627. const doValidate = async (rules) => {
  12628. const modelName = propString.value;
  12629. return new Schema({ [modelName]: rules }).validate({ [modelName]: fieldValue.value }, { firstFields: true }).then(() => {
  12630. onValidationSucceeded();
  12631. return true;
  12632. }).catch((err) => {
  12633. onValidationFailed(err);
  12634. return Promise.reject(err);
  12635. });
  12636. };
  12637. const validate = async (trigger, callback) => {
  12638. if (isResettingField || !props.prop) return false;
  12639. const hasCallback = isFunction$1(callback);
  12640. if (!validateEnabled.value) {
  12641. callback?.(false);
  12642. return false;
  12643. }
  12644. const rules = getFilteredRule(trigger);
  12645. if (rules.length === 0) {
  12646. callback?.(true);
  12647. return true;
  12648. }
  12649. setValidationState("validating");
  12650. return doValidate(rules).then(() => {
  12651. callback?.(true);
  12652. return true;
  12653. }).catch((err) => {
  12654. const { fields } = err;
  12655. callback?.(false, fields);
  12656. return hasCallback ? false : Promise.reject(fields);
  12657. });
  12658. };
  12659. const clearValidate = () => {
  12660. setValidationState("");
  12661. validateMessage.value = "";
  12662. isResettingField = false;
  12663. };
  12664. const resetField = async () => {
  12665. const model = formContext?.model;
  12666. if (!model || !props.prop) return;
  12667. const computedValue = getProp(model, props.prop);
  12668. isResettingField = true;
  12669. computedValue.value = cloneDeep(initialValue);
  12670. await (0, vue.nextTick)();
  12671. clearValidate();
  12672. isResettingField = false;
  12673. };
  12674. const addInputId = (id) => {
  12675. if (!inputIds.value.includes(id)) inputIds.value.push(id);
  12676. };
  12677. const removeInputId = (id) => {
  12678. inputIds.value = inputIds.value.filter((listId) => listId !== id);
  12679. };
  12680. const setInitialValue = (value) => {
  12681. initialValue = cloneDeep(value);
  12682. };
  12683. (0, vue.watch)(() => props.error, (val) => {
  12684. validateMessage.value = val || "";
  12685. setValidationState(val ? "error" : "");
  12686. }, { immediate: true });
  12687. (0, vue.watch)(() => props.validateStatus, (val) => setValidationState(val || ""));
  12688. const context = (0, vue.reactive)({
  12689. ...(0, vue.toRefs)(props),
  12690. $el: formItemRef,
  12691. size: _size,
  12692. validateMessage,
  12693. validateState,
  12694. labelId,
  12695. inputIds,
  12696. isGroup,
  12697. hasLabel,
  12698. fieldValue,
  12699. addInputId,
  12700. removeInputId,
  12701. resetField,
  12702. clearValidate,
  12703. validate,
  12704. propString,
  12705. setInitialValue
  12706. });
  12707. (0, vue.provide)(formItemContextKey, context);
  12708. (0, vue.onMounted)(() => {
  12709. if (props.prop) {
  12710. setInitialValue(fieldValue.value);
  12711. formContext?.addField(context);
  12712. }
  12713. });
  12714. (0, vue.onBeforeUnmount)(() => {
  12715. formContext?.removeField(context);
  12716. });
  12717. __expose({
  12718. size: _size,
  12719. validateMessage,
  12720. validateState,
  12721. validate,
  12722. clearValidate,
  12723. resetField,
  12724. setInitialValue
  12725. });
  12726. return (_ctx, _cache) => {
  12727. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  12728. ref_key: "formItemRef",
  12729. ref: formItemRef,
  12730. class: (0, vue.normalizeClass)(formItemClasses.value),
  12731. role: isGroup.value ? "group" : void 0,
  12732. "aria-labelledby": isGroup.value ? (0, vue.unref)(labelId) : void 0
  12733. }, [(0, vue.createVNode)((0, vue.unref)(form_label_wrap_default), {
  12734. "is-auto-width": labelStyle.value.width === "auto",
  12735. "update-all": (0, vue.unref)(formContext)?.labelWidth === "auto"
  12736. }, {
  12737. default: (0, vue.withCtx)(() => [!!(__props.label || _ctx.$slots.label) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(labelFor.value ? "label" : "div"), {
  12738. key: 0,
  12739. id: (0, vue.unref)(labelId),
  12740. for: labelFor.value,
  12741. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("label")),
  12742. style: (0, vue.normalizeStyle)(labelStyle.value)
  12743. }, {
  12744. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "label", { label: currentLabel.value }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(currentLabel.value), 1)])]),
  12745. _: 3
  12746. }, 8, [
  12747. "id",
  12748. "for",
  12749. "class",
  12750. "style"
  12751. ])) : (0, vue.createCommentVNode)("v-if", true)]),
  12752. _: 3
  12753. }, 8, ["is-auto-width", "update-all"]), (0, vue.createElementVNode)("div", {
  12754. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")),
  12755. style: (0, vue.normalizeStyle)(contentStyle.value)
  12756. }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(vue.TransitionGroup, { name: `${(0, vue.unref)(ns).namespace.value}-zoom-in-top` }, {
  12757. default: (0, vue.withCtx)(() => [shouldShowError.value ? (0, vue.renderSlot)(_ctx.$slots, "error", {
  12758. key: 0,
  12759. error: validateMessage.value
  12760. }, () => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(validateClasses.value) }, (0, vue.toDisplayString)(validateMessage.value), 3)]) : (0, vue.createCommentVNode)("v-if", true)]),
  12761. _: 3
  12762. }, 8, ["name"])], 6)], 10, _hoisted_1$78);
  12763. };
  12764. }
  12765. });
  12766. //#endregion
  12767. //#region ../../packages/components/form/src/form-item.vue
  12768. var form_item_default = form_item_vue_vue_type_script_setup_true_lang_default;
  12769. //#endregion
  12770. //#region ../../packages/components/form/index.ts
  12771. const ElForm = withInstall(form_default, { FormItem: form_item_default });
  12772. const ElFormItem = withNoopInstall(form_item_default);
  12773. //#endregion
  12774. //#region ../../packages/components/popper/src/utils.ts
  12775. const buildPopperOptions = (props, modifiers = []) => {
  12776. const { placement, strategy, popperOptions } = props;
  12777. const options = {
  12778. placement,
  12779. strategy,
  12780. ...popperOptions,
  12781. modifiers: [...genModifiers(props), ...modifiers]
  12782. };
  12783. deriveExtraModifiers(options, popperOptions?.modifiers);
  12784. return options;
  12785. };
  12786. const unwrapMeasurableEl = ($el) => {
  12787. if (!isClient) return;
  12788. return unrefElement($el);
  12789. };
  12790. function genModifiers(options) {
  12791. const { offset, gpuAcceleration, fallbackPlacements } = options;
  12792. return [
  12793. {
  12794. name: "offset",
  12795. options: { offset: [0, offset ?? 12] }
  12796. },
  12797. {
  12798. name: "preventOverflow",
  12799. options: { padding: {
  12800. top: 0,
  12801. bottom: 0,
  12802. left: 0,
  12803. right: 0
  12804. } }
  12805. },
  12806. {
  12807. name: "flip",
  12808. options: {
  12809. padding: 5,
  12810. fallbackPlacements
  12811. }
  12812. },
  12813. {
  12814. name: "computeStyles",
  12815. options: { gpuAcceleration }
  12816. }
  12817. ];
  12818. }
  12819. function deriveExtraModifiers(options, modifiers) {
  12820. if (modifiers) options.modifiers = [...options.modifiers, ...modifiers ?? []];
  12821. }
  12822. //#endregion
  12823. //#region ../../packages/components/popper/src/composables/use-content.ts
  12824. const DEFAULT_ARROW_OFFSET = 0;
  12825. const usePopperContent = (props) => {
  12826. const { popperInstanceRef, contentRef, triggerRef, role } = (0, vue.inject)(POPPER_INJECTION_KEY, void 0);
  12827. const arrowRef = (0, vue.ref)();
  12828. const arrowOffset = (0, vue.computed)(() => props.arrowOffset);
  12829. const eventListenerModifier = (0, vue.computed)(() => {
  12830. return {
  12831. name: "eventListeners",
  12832. enabled: !!props.visible
  12833. };
  12834. });
  12835. const arrowModifier = (0, vue.computed)(() => {
  12836. const arrowEl = (0, vue.unref)(arrowRef);
  12837. const offset = (0, vue.unref)(arrowOffset) ?? DEFAULT_ARROW_OFFSET;
  12838. return {
  12839. name: "arrow",
  12840. enabled: !isUndefined$1(arrowEl),
  12841. options: {
  12842. element: arrowEl,
  12843. padding: offset
  12844. }
  12845. };
  12846. });
  12847. const options = (0, vue.computed)(() => {
  12848. return {
  12849. onFirstUpdate: () => {
  12850. update();
  12851. },
  12852. ...buildPopperOptions(props, [(0, vue.unref)(arrowModifier), (0, vue.unref)(eventListenerModifier)])
  12853. };
  12854. });
  12855. const computedReference = (0, vue.computed)(() => unwrapMeasurableEl(props.referenceEl) || (0, vue.unref)(triggerRef));
  12856. const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options);
  12857. (0, vue.watch)(instanceRef, (instance) => popperInstanceRef.value = instance, { flush: "sync" });
  12858. (0, vue.onMounted)(() => {
  12859. (0, vue.watch)(() => (0, vue.unref)(computedReference)?.getBoundingClientRect?.(), () => {
  12860. update();
  12861. });
  12862. });
  12863. (0, vue.onBeforeUnmount)(() => {
  12864. popperInstanceRef.value = void 0;
  12865. });
  12866. return {
  12867. attributes,
  12868. arrowRef,
  12869. contentRef,
  12870. instanceRef,
  12871. state,
  12872. styles,
  12873. role,
  12874. forceUpdate,
  12875. update
  12876. };
  12877. };
  12878. //#endregion
  12879. //#region ../../packages/components/popper/src/composables/use-content-dom.ts
  12880. const usePopperContentDOM = (props, { attributes, styles, role }) => {
  12881. const { nextZIndex } = useZIndex();
  12882. const ns = useNamespace("popper");
  12883. const contentAttrs = (0, vue.computed)(() => (0, vue.unref)(attributes).popper);
  12884. const contentZIndex = (0, vue.ref)(isNumber(props.zIndex) ? props.zIndex : nextZIndex());
  12885. const contentClass = (0, vue.computed)(() => [
  12886. ns.b(),
  12887. ns.is("pure", props.pure),
  12888. ns.is(props.effect),
  12889. props.popperClass
  12890. ]);
  12891. const contentStyle = (0, vue.computed)(() => {
  12892. return [
  12893. { zIndex: (0, vue.unref)(contentZIndex) },
  12894. (0, vue.unref)(styles).popper,
  12895. props.popperStyle || {}
  12896. ];
  12897. });
  12898. const ariaModal = (0, vue.computed)(() => role.value === "dialog" ? "false" : void 0);
  12899. const arrowStyle = (0, vue.computed)(() => (0, vue.unref)(styles).arrow || {});
  12900. const updateZIndex = () => {
  12901. contentZIndex.value = isNumber(props.zIndex) ? props.zIndex : nextZIndex();
  12902. };
  12903. return {
  12904. ariaModal,
  12905. arrowStyle,
  12906. contentAttrs,
  12907. contentClass,
  12908. contentStyle,
  12909. contentZIndex,
  12910. updateZIndex
  12911. };
  12912. };
  12913. //#endregion
  12914. //#region ../../packages/components/popper/src/composables/use-focus-trap.ts
  12915. const usePopperContentFocusTrap = (props, emit) => {
  12916. const trapped = (0, vue.ref)(false);
  12917. const focusStartRef = (0, vue.ref)();
  12918. const onFocusAfterTrapped = () => {
  12919. emit("focus");
  12920. };
  12921. const onFocusAfterReleased = (event) => {
  12922. if (event.detail?.focusReason !== "pointer") {
  12923. focusStartRef.value = "first";
  12924. emit("blur");
  12925. }
  12926. };
  12927. const onFocusInTrap = (event) => {
  12928. if (props.visible && !trapped.value) {
  12929. if (event.target) focusStartRef.value = event.target;
  12930. trapped.value = true;
  12931. }
  12932. };
  12933. const onFocusoutPrevented = (event) => {
  12934. if (!props.trapping) {
  12935. if (event.detail.focusReason === "pointer") event.preventDefault();
  12936. trapped.value = false;
  12937. }
  12938. };
  12939. const onReleaseRequested = () => {
  12940. trapped.value = false;
  12941. emit("close");
  12942. };
  12943. (0, vue.onBeforeUnmount)(() => {
  12944. focusStartRef.value = void 0;
  12945. });
  12946. return {
  12947. focusStartRef,
  12948. trapped,
  12949. onFocusAfterReleased,
  12950. onFocusAfterTrapped,
  12951. onFocusInTrap,
  12952. onFocusoutPrevented,
  12953. onReleaseRequested
  12954. };
  12955. };
  12956. //#endregion
  12957. //#region ../../packages/components/popper/src/content.vue?vue&type=script&setup=true&lang.ts
  12958. var content_vue_vue_type_script_setup_true_lang_default$2 = /* @__PURE__ */ (0, vue.defineComponent)({
  12959. name: "ElPopperContent",
  12960. __name: "content",
  12961. props: popperContentProps,
  12962. emits: popperContentEmits,
  12963. setup(__props, { expose: __expose, emit: __emit }) {
  12964. const emit = __emit;
  12965. const props = __props;
  12966. const { focusStartRef, trapped, onFocusAfterReleased, onFocusAfterTrapped, onFocusInTrap, onFocusoutPrevented, onReleaseRequested } = usePopperContentFocusTrap(props, emit);
  12967. const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
  12968. const { ariaModal, arrowStyle, contentAttrs, contentClass, contentStyle, updateZIndex } = usePopperContentDOM(props, {
  12969. styles,
  12970. attributes,
  12971. role
  12972. });
  12973. const formItemContext = (0, vue.inject)(formItemContextKey, void 0);
  12974. (0, vue.provide)(POPPER_CONTENT_INJECTION_KEY, {
  12975. arrowStyle,
  12976. arrowRef
  12977. });
  12978. if (formItemContext) (0, vue.provide)(formItemContextKey, {
  12979. ...formItemContext,
  12980. addInputId: NOOP,
  12981. removeInputId: NOOP
  12982. });
  12983. let triggerTargetAriaStopWatch = void 0;
  12984. const updatePopper = (shouldUpdateZIndex = true) => {
  12985. update();
  12986. shouldUpdateZIndex && updateZIndex();
  12987. };
  12988. const togglePopperAlive = () => {
  12989. updatePopper(false);
  12990. if (props.visible && props.focusOnShow) trapped.value = true;
  12991. else if (props.visible === false) trapped.value = false;
  12992. };
  12993. (0, vue.onMounted)(() => {
  12994. (0, vue.watch)(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
  12995. triggerTargetAriaStopWatch?.();
  12996. triggerTargetAriaStopWatch = void 0;
  12997. const el = (0, vue.unref)(triggerTargetEl || contentRef.value);
  12998. const prevEl = (0, vue.unref)(prevTriggerTargetEl || contentRef.value);
  12999. if (isElement$1(el)) triggerTargetAriaStopWatch = (0, vue.watch)([
  13000. role,
  13001. () => props.ariaLabel,
  13002. ariaModal,
  13003. () => props.id
  13004. ], (watches) => {
  13005. [
  13006. "role",
  13007. "aria-label",
  13008. "aria-modal",
  13009. "id"
  13010. ].forEach((key, idx) => {
  13011. isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
  13012. });
  13013. }, { immediate: true });
  13014. if (prevEl !== el && isElement$1(prevEl)) [
  13015. "role",
  13016. "aria-label",
  13017. "aria-modal",
  13018. "id"
  13019. ].forEach((key) => {
  13020. prevEl.removeAttribute(key);
  13021. });
  13022. }, { immediate: true });
  13023. (0, vue.watch)(() => props.visible, togglePopperAlive, { immediate: true });
  13024. });
  13025. (0, vue.onBeforeUnmount)(() => {
  13026. triggerTargetAriaStopWatch?.();
  13027. triggerTargetAriaStopWatch = void 0;
  13028. contentRef.value = void 0;
  13029. });
  13030. __expose({
  13031. popperContentRef: contentRef,
  13032. popperInstanceRef: instanceRef,
  13033. updatePopper,
  13034. contentStyle
  13035. });
  13036. return (_ctx, _cache) => {
  13037. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
  13038. ref_key: "contentRef",
  13039. ref: contentRef
  13040. }, (0, vue.unref)(contentAttrs), {
  13041. style: (0, vue.unref)(contentStyle),
  13042. class: (0, vue.unref)(contentClass),
  13043. tabindex: "-1",
  13044. onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
  13045. onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
  13046. }), [(0, vue.createVNode)((0, vue.unref)(focus_trap_default), {
  13047. loop: __props.loop,
  13048. trapped: (0, vue.unref)(trapped),
  13049. "trap-on-focus-in": true,
  13050. "focus-trap-el": (0, vue.unref)(contentRef),
  13051. "focus-start-el": (0, vue.unref)(focusStartRef),
  13052. onFocusAfterTrapped: (0, vue.unref)(onFocusAfterTrapped),
  13053. onFocusAfterReleased: (0, vue.unref)(onFocusAfterReleased),
  13054. onFocusin: (0, vue.unref)(onFocusInTrap),
  13055. onFocusoutPrevented: (0, vue.unref)(onFocusoutPrevented),
  13056. onReleaseRequested: (0, vue.unref)(onReleaseRequested)
  13057. }, {
  13058. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  13059. _: 3
  13060. }, 8, [
  13061. "loop",
  13062. "trapped",
  13063. "focus-trap-el",
  13064. "focus-start-el",
  13065. "onFocusAfterTrapped",
  13066. "onFocusAfterReleased",
  13067. "onFocusin",
  13068. "onFocusoutPrevented",
  13069. "onReleaseRequested"
  13070. ])], 16);
  13071. };
  13072. }
  13073. });
  13074. //#endregion
  13075. //#region ../../packages/components/popper/src/content.vue
  13076. var content_default = content_vue_vue_type_script_setup_true_lang_default$2;
  13077. //#endregion
  13078. //#region ../../packages/components/popper/index.ts
  13079. const ElPopper = withInstall(popper_default);
  13080. //#endregion
  13081. //#region ../../packages/components/tooltip/src/content.ts
  13082. const useTooltipContentPropsDefaults = {
  13083. ...useDelayedTogglePropsDefaults,
  13084. ...popperContentPropsDefaults,
  13085. content: "",
  13086. visible: null,
  13087. teleported: true
  13088. };
  13089. /**
  13090. * @deprecated Removed after 3.0.0, Use `ElTooltipContentProps` instead.
  13091. */
  13092. const useTooltipContentProps = buildProps({
  13093. ...useDelayedToggleProps,
  13094. ...popperContentProps,
  13095. appendTo: { type: teleportProps.to.type },
  13096. content: {
  13097. type: String,
  13098. default: ""
  13099. },
  13100. rawContent: Boolean,
  13101. persistent: Boolean,
  13102. visible: {
  13103. type: definePropType(Boolean),
  13104. default: null
  13105. },
  13106. transition: String,
  13107. teleported: {
  13108. type: Boolean,
  13109. default: true
  13110. },
  13111. disabled: Boolean,
  13112. ...useAriaProps(["ariaLabel"])
  13113. });
  13114. //#endregion
  13115. //#region ../../packages/components/tooltip/src/trigger.ts
  13116. const useTooltipTriggerPropsDefaults = {
  13117. trigger: "hover",
  13118. triggerKeys: () => [
  13119. EVENT_CODE.enter,
  13120. EVENT_CODE.numpadEnter,
  13121. EVENT_CODE.space
  13122. ]
  13123. };
  13124. /**
  13125. * @deprecated Removed after 3.0.0, Use `UseTooltipTriggerProps` instead.
  13126. */
  13127. const useTooltipTriggerProps = buildProps({
  13128. ...popperTriggerProps,
  13129. disabled: Boolean,
  13130. trigger: {
  13131. type: definePropType([String, Array]),
  13132. default: "hover"
  13133. },
  13134. triggerKeys: {
  13135. type: definePropType(Array),
  13136. default: () => [
  13137. EVENT_CODE.enter,
  13138. EVENT_CODE.numpadEnter,
  13139. EVENT_CODE.space
  13140. ]
  13141. },
  13142. focusOnTarget: Boolean
  13143. });
  13144. //#endregion
  13145. //#region ../../packages/components/tooltip/src/tooltip.ts
  13146. const { useModelToggleProps: useTooltipModelToggleProps, useModelToggleEmits: useTooltipModelToggleEmits, useModelToggle: useTooltipModelToggle } = createModelToggleComposable("visible");
  13147. /**
  13148. * @deprecated Removed after 3.0.0, Use `UseTooltipProps` instead.
  13149. */
  13150. const useTooltipProps = buildProps({
  13151. ...popperProps,
  13152. ...useTooltipModelToggleProps,
  13153. ...useTooltipContentProps,
  13154. ...useTooltipTriggerProps,
  13155. ...popperArrowProps,
  13156. showArrow: {
  13157. type: Boolean,
  13158. default: true
  13159. }
  13160. });
  13161. const tooltipEmits = [
  13162. ...useTooltipModelToggleEmits,
  13163. "before-show",
  13164. "before-hide",
  13165. "show",
  13166. "hide",
  13167. "open",
  13168. "close"
  13169. ];
  13170. //#endregion
  13171. //#region ../../packages/components/tooltip/src/constants.ts
  13172. const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
  13173. //#endregion
  13174. //#region ../../packages/components/tooltip/src/utils.ts
  13175. const isTriggerType = (trigger, type) => {
  13176. if (isArray$1(trigger)) return trigger.includes(type);
  13177. return trigger === type;
  13178. };
  13179. const whenTrigger = (trigger, type, handler) => {
  13180. return (e) => {
  13181. isTriggerType((0, vue.unref)(trigger), type) && handler(e);
  13182. };
  13183. };
  13184. //#endregion
  13185. //#region ../../packages/components/tooltip/src/trigger.vue?vue&type=script&setup=true&lang.ts
  13186. var trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  13187. name: "ElTooltipTrigger",
  13188. __name: "trigger",
  13189. props: useTooltipTriggerProps,
  13190. setup(__props, { expose: __expose }) {
  13191. const props = __props;
  13192. const ns = useNamespace("tooltip");
  13193. const { controlled, id, open, onOpen, onClose, onToggle } = (0, vue.inject)(TOOLTIP_INJECTION_KEY, void 0);
  13194. const triggerRef = (0, vue.ref)(null);
  13195. const stopWhenControlledOrDisabled = () => {
  13196. if ((0, vue.unref)(controlled) || props.disabled) return true;
  13197. };
  13198. const trigger = (0, vue.toRef)(props, "trigger");
  13199. const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => {
  13200. onOpen(e);
  13201. if (props.focusOnTarget && e.target) (0, vue.nextTick)(() => {
  13202. focusElement(e.target, { preventScroll: true });
  13203. });
  13204. }));
  13205. const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
  13206. const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
  13207. if (e.button === 0) onToggle(e);
  13208. }));
  13209. const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
  13210. const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
  13211. const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
  13212. e.preventDefault();
  13213. onToggle(e);
  13214. }));
  13215. const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
  13216. const code = getEventCode(e);
  13217. if (props.triggerKeys.includes(code)) {
  13218. e.preventDefault();
  13219. onToggle(e);
  13220. }
  13221. });
  13222. __expose({ triggerRef });
  13223. return (_ctx, _cache) => {
  13224. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(trigger_default), {
  13225. id: (0, vue.unref)(id),
  13226. "virtual-ref": __props.virtualRef,
  13227. open: (0, vue.unref)(open),
  13228. "virtual-triggering": __props.virtualTriggering,
  13229. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("trigger")),
  13230. onBlur: (0, vue.unref)(onBlur),
  13231. onClick: (0, vue.unref)(onClick),
  13232. onContextmenu: (0, vue.unref)(onContextMenu),
  13233. onFocus: (0, vue.unref)(onFocus),
  13234. onMouseenter: (0, vue.unref)(onMouseenter),
  13235. onMouseleave: (0, vue.unref)(onMouseleave),
  13236. onKeydown: (0, vue.unref)(onKeydown)
  13237. }, {
  13238. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  13239. _: 3
  13240. }, 8, [
  13241. "id",
  13242. "virtual-ref",
  13243. "open",
  13244. "virtual-triggering",
  13245. "class",
  13246. "onBlur",
  13247. "onClick",
  13248. "onContextmenu",
  13249. "onFocus",
  13250. "onMouseenter",
  13251. "onMouseleave",
  13252. "onKeydown"
  13253. ]);
  13254. };
  13255. }
  13256. });
  13257. //#endregion
  13258. //#region ../../packages/components/tooltip/src/trigger.vue
  13259. var trigger_default$1 = trigger_vue_vue_type_script_setup_true_lang_default;
  13260. //#endregion
  13261. //#region ../../packages/components/tooltip/src/content.vue?vue&type=script&setup=true&lang.ts
  13262. var content_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
  13263. name: "ElTooltipContent",
  13264. inheritAttrs: false,
  13265. __name: "content",
  13266. props: useTooltipContentProps,
  13267. setup(__props, { expose: __expose }) {
  13268. const props = __props;
  13269. const { selector } = usePopperContainerId();
  13270. const ns = useNamespace("tooltip");
  13271. const contentRef = (0, vue.ref)();
  13272. const popperContentRef = computedEager(() => contentRef.value?.popperContentRef);
  13273. let stopHandle;
  13274. const { controlled, id, open, trigger, onClose, onOpen, onShow, onHide, onBeforeShow, onBeforeHide } = (0, vue.inject)(TOOLTIP_INJECTION_KEY, void 0);
  13275. const transitionClass = (0, vue.computed)(() => {
  13276. return props.transition || `${ns.namespace.value}-fade-in-linear`;
  13277. });
  13278. const persistentRef = (0, vue.computed)(() => {
  13279. return props.persistent;
  13280. });
  13281. (0, vue.onBeforeUnmount)(() => {
  13282. stopHandle?.();
  13283. });
  13284. const shouldRender = (0, vue.computed)(() => {
  13285. return (0, vue.unref)(persistentRef) ? true : (0, vue.unref)(open);
  13286. });
  13287. const shouldShow = (0, vue.computed)(() => {
  13288. return props.disabled ? false : (0, vue.unref)(open);
  13289. });
  13290. const appendTo = (0, vue.computed)(() => {
  13291. return props.appendTo || selector.value;
  13292. });
  13293. const contentStyle = (0, vue.computed)(() => props.style ?? {});
  13294. const ariaHidden = (0, vue.ref)(true);
  13295. const onTransitionLeave = () => {
  13296. onHide();
  13297. isFocusInsideContent() && focusElement(document.body, { preventScroll: true });
  13298. ariaHidden.value = true;
  13299. };
  13300. const stopWhenControlled = () => {
  13301. if ((0, vue.unref)(controlled)) return true;
  13302. };
  13303. const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
  13304. if (props.enterable && isTriggerType((0, vue.unref)(trigger), "hover")) onOpen();
  13305. });
  13306. const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
  13307. if (isTriggerType((0, vue.unref)(trigger), "hover")) onClose();
  13308. });
  13309. const onBeforeEnter = () => {
  13310. contentRef.value?.updatePopper?.();
  13311. onBeforeShow?.();
  13312. };
  13313. const onBeforeLeave = () => {
  13314. onBeforeHide?.();
  13315. };
  13316. const onAfterShow = () => {
  13317. onShow();
  13318. };
  13319. const onBlur = () => {
  13320. if (!props.virtualTriggering) onClose();
  13321. };
  13322. const isFocusInsideContent = (event) => {
  13323. const popperContent = contentRef.value?.popperContentRef;
  13324. const activeElement = event?.relatedTarget || document.activeElement;
  13325. return popperContent?.contains(activeElement);
  13326. };
  13327. (0, vue.watch)(() => (0, vue.unref)(open), (val) => {
  13328. if (!val) stopHandle?.();
  13329. else {
  13330. ariaHidden.value = false;
  13331. stopHandle = onClickOutside(popperContentRef, () => {
  13332. if ((0, vue.unref)(controlled)) return;
  13333. if (castArray((0, vue.unref)(trigger)).every((item) => {
  13334. return item !== "hover" && item !== "focus";
  13335. })) onClose();
  13336. }, { detectIframe: true });
  13337. }
  13338. }, { flush: "post" });
  13339. (0, vue.watch)(() => props.content, () => {
  13340. contentRef.value?.updatePopper?.();
  13341. });
  13342. __expose({
  13343. contentRef,
  13344. isFocusInsideContent
  13345. });
  13346. return (_ctx, _cache) => {
  13347. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTeleport), {
  13348. disabled: !__props.teleported,
  13349. to: appendTo.value
  13350. }, {
  13351. default: (0, vue.withCtx)(() => [shouldRender.value || !ariaHidden.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  13352. key: 0,
  13353. name: transitionClass.value,
  13354. appear: !persistentRef.value,
  13355. onAfterLeave: onTransitionLeave,
  13356. onBeforeEnter,
  13357. onAfterEnter: onAfterShow,
  13358. onBeforeLeave,
  13359. persisted: ""
  13360. }, {
  13361. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(content_default), (0, vue.mergeProps)({
  13362. id: (0, vue.unref)(id),
  13363. ref_key: "contentRef",
  13364. ref: contentRef
  13365. }, _ctx.$attrs, {
  13366. "aria-label": __props.ariaLabel,
  13367. "aria-hidden": ariaHidden.value,
  13368. "boundaries-padding": __props.boundariesPadding,
  13369. "fallback-placements": __props.fallbackPlacements,
  13370. "gpu-acceleration": __props.gpuAcceleration,
  13371. offset: __props.offset,
  13372. placement: __props.placement,
  13373. "popper-options": __props.popperOptions,
  13374. "arrow-offset": __props.arrowOffset,
  13375. strategy: __props.strategy,
  13376. effect: __props.effect,
  13377. enterable: __props.enterable,
  13378. pure: __props.pure,
  13379. "popper-class": __props.popperClass,
  13380. "popper-style": [__props.popperStyle, contentStyle.value],
  13381. "reference-el": __props.referenceEl,
  13382. "trigger-target-el": __props.triggerTargetEl,
  13383. visible: shouldShow.value,
  13384. "z-index": __props.zIndex,
  13385. loop: __props.loop,
  13386. onMouseenter: (0, vue.unref)(onContentEnter),
  13387. onMouseleave: (0, vue.unref)(onContentLeave),
  13388. onBlur,
  13389. onClose: (0, vue.unref)(onClose)
  13390. }), {
  13391. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  13392. _: 3
  13393. }, 16, [
  13394. "id",
  13395. "aria-label",
  13396. "aria-hidden",
  13397. "boundaries-padding",
  13398. "fallback-placements",
  13399. "gpu-acceleration",
  13400. "offset",
  13401. "placement",
  13402. "popper-options",
  13403. "arrow-offset",
  13404. "strategy",
  13405. "effect",
  13406. "enterable",
  13407. "pure",
  13408. "popper-class",
  13409. "popper-style",
  13410. "reference-el",
  13411. "trigger-target-el",
  13412. "visible",
  13413. "z-index",
  13414. "loop",
  13415. "onMouseenter",
  13416. "onMouseleave",
  13417. "onClose"
  13418. ]), [[vue.vShow, shouldShow.value]])]),
  13419. _: 3
  13420. }, 8, ["name", "appear"])) : (0, vue.createCommentVNode)("v-if", true)]),
  13421. _: 3
  13422. }, 8, ["disabled", "to"]);
  13423. };
  13424. }
  13425. });
  13426. //#endregion
  13427. //#region ../../packages/components/tooltip/src/content.vue
  13428. var content_default$2 = content_vue_vue_type_script_setup_true_lang_default$1;
  13429. //#endregion
  13430. //#region ../../packages/components/tooltip/src/tooltip.vue?vue&type=script&setup=true&lang.ts
  13431. const _hoisted_1$77 = ["innerHTML"];
  13432. const _hoisted_2$43 = { key: 1 };
  13433. var tooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  13434. name: "ElTooltip",
  13435. __name: "tooltip",
  13436. props: useTooltipProps,
  13437. emits: tooltipEmits,
  13438. setup(__props, { expose: __expose, emit: __emit }) {
  13439. const props = __props;
  13440. const emit = __emit;
  13441. usePopperContainer();
  13442. const ns = useNamespace("tooltip");
  13443. const id = useId();
  13444. const popperRef = (0, vue.ref)();
  13445. const contentRef = (0, vue.ref)();
  13446. const updatePopper = () => {
  13447. const popperComponent = (0, vue.unref)(popperRef);
  13448. if (popperComponent) popperComponent.popperInstanceRef?.update();
  13449. };
  13450. const open = (0, vue.ref)(false);
  13451. const toggleReason = (0, vue.ref)();
  13452. const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
  13453. indicator: open,
  13454. toggleReason
  13455. });
  13456. const { onOpen, onClose } = useDelayedToggle({
  13457. showAfter: (0, vue.toRef)(props, "showAfter"),
  13458. hideAfter: (0, vue.toRef)(props, "hideAfter"),
  13459. autoClose: (0, vue.toRef)(props, "autoClose"),
  13460. open: show,
  13461. close: hide
  13462. });
  13463. const controlled = (0, vue.computed)(() => isBoolean(props.visible) && !hasUpdateHandler.value);
  13464. const kls = (0, vue.computed)(() => {
  13465. return [ns.b(), props.popperClass];
  13466. });
  13467. (0, vue.provide)(TOOLTIP_INJECTION_KEY, {
  13468. controlled,
  13469. id,
  13470. open: (0, vue.readonly)(open),
  13471. trigger: (0, vue.toRef)(props, "trigger"),
  13472. onOpen,
  13473. onClose,
  13474. onToggle: (event) => {
  13475. if ((0, vue.unref)(open)) onClose(event);
  13476. else onOpen(event);
  13477. },
  13478. onShow: () => {
  13479. emit("show", toggleReason.value);
  13480. },
  13481. onHide: () => {
  13482. emit("hide", toggleReason.value);
  13483. },
  13484. onBeforeShow: () => {
  13485. emit("before-show", toggleReason.value);
  13486. },
  13487. onBeforeHide: () => {
  13488. emit("before-hide", toggleReason.value);
  13489. },
  13490. updatePopper
  13491. });
  13492. (0, vue.watch)(() => props.disabled, (disabled) => {
  13493. if (disabled && open.value) open.value = false;
  13494. });
  13495. const isFocusInsideContent = (event) => {
  13496. return contentRef.value?.isFocusInsideContent(event);
  13497. };
  13498. (0, vue.onDeactivated)(() => open.value && hide());
  13499. (0, vue.onBeforeUnmount)(() => {
  13500. toggleReason.value = void 0;
  13501. });
  13502. __expose({
  13503. popperRef,
  13504. contentRef,
  13505. isFocusInsideContent,
  13506. updatePopper,
  13507. onOpen,
  13508. onClose,
  13509. hide
  13510. });
  13511. return (_ctx, _cache) => {
  13512. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElPopper), {
  13513. ref_key: "popperRef",
  13514. ref: popperRef,
  13515. role: __props.role
  13516. }, {
  13517. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(trigger_default$1, {
  13518. disabled: __props.disabled,
  13519. trigger: __props.trigger,
  13520. "trigger-keys": __props.triggerKeys,
  13521. "virtual-ref": __props.virtualRef,
  13522. "virtual-triggering": __props.virtualTriggering,
  13523. "focus-on-target": __props.focusOnTarget
  13524. }, {
  13525. default: (0, vue.withCtx)(() => [_ctx.$slots.default ? (0, vue.renderSlot)(_ctx.$slots, "default", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true)]),
  13526. _: 3
  13527. }, 8, [
  13528. "disabled",
  13529. "trigger",
  13530. "trigger-keys",
  13531. "virtual-ref",
  13532. "virtual-triggering",
  13533. "focus-on-target"
  13534. ]), (0, vue.createVNode)(content_default$2, {
  13535. ref_key: "contentRef",
  13536. ref: contentRef,
  13537. "aria-label": __props.ariaLabel,
  13538. "boundaries-padding": __props.boundariesPadding,
  13539. content: __props.content,
  13540. disabled: __props.disabled,
  13541. effect: __props.effect,
  13542. enterable: __props.enterable,
  13543. "fallback-placements": __props.fallbackPlacements,
  13544. "hide-after": __props.hideAfter,
  13545. "gpu-acceleration": __props.gpuAcceleration,
  13546. offset: __props.offset,
  13547. persistent: __props.persistent,
  13548. "popper-class": kls.value,
  13549. "popper-style": __props.popperStyle,
  13550. placement: __props.placement,
  13551. "popper-options": __props.popperOptions,
  13552. "arrow-offset": __props.arrowOffset,
  13553. pure: __props.pure,
  13554. "raw-content": __props.rawContent,
  13555. "reference-el": __props.referenceEl,
  13556. "trigger-target-el": __props.triggerTargetEl,
  13557. "show-after": __props.showAfter,
  13558. strategy: __props.strategy,
  13559. teleported: __props.teleported,
  13560. transition: __props.transition,
  13561. "virtual-triggering": __props.virtualTriggering,
  13562. "z-index": __props.zIndex,
  13563. "append-to": __props.appendTo,
  13564. loop: __props.loop
  13565. }, {
  13566. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "content", {}, () => [__props.rawContent ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  13567. key: 0,
  13568. innerHTML: __props.content
  13569. }, null, 8, _hoisted_1$77)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$43, (0, vue.toDisplayString)(__props.content), 1))]), __props.showArrow ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(arrow_default), { key: 0 })) : (0, vue.createCommentVNode)("v-if", true)]),
  13570. _: 3
  13571. }, 8, [
  13572. "aria-label",
  13573. "boundaries-padding",
  13574. "content",
  13575. "disabled",
  13576. "effect",
  13577. "enterable",
  13578. "fallback-placements",
  13579. "hide-after",
  13580. "gpu-acceleration",
  13581. "offset",
  13582. "persistent",
  13583. "popper-class",
  13584. "popper-style",
  13585. "placement",
  13586. "popper-options",
  13587. "arrow-offset",
  13588. "pure",
  13589. "raw-content",
  13590. "reference-el",
  13591. "trigger-target-el",
  13592. "show-after",
  13593. "strategy",
  13594. "teleported",
  13595. "transition",
  13596. "virtual-triggering",
  13597. "z-index",
  13598. "append-to",
  13599. "loop"
  13600. ])]),
  13601. _: 3
  13602. }, 8, ["role"]);
  13603. };
  13604. }
  13605. });
  13606. //#endregion
  13607. //#region ../../packages/components/tooltip/src/tooltip.vue
  13608. var tooltip_default = tooltip_vue_vue_type_script_setup_true_lang_default;
  13609. //#endregion
  13610. //#region ../../packages/components/tooltip/index.ts
  13611. const ElTooltip = withInstall(tooltip_default);
  13612. //#endregion
  13613. //#region ../../packages/components/input/src/input.ts
  13614. /**
  13615. * @deprecated Removed after 3.0.0, Use `InputProps` instead.
  13616. */
  13617. const inputProps = buildProps({
  13618. id: {
  13619. type: String,
  13620. default: void 0
  13621. },
  13622. size: useSizeProp,
  13623. disabled: {
  13624. type: Boolean,
  13625. default: void 0
  13626. },
  13627. modelValue: {
  13628. type: definePropType([
  13629. String,
  13630. Number,
  13631. Object
  13632. ]),
  13633. default: ""
  13634. },
  13635. modelModifiers: {
  13636. type: definePropType(Object),
  13637. default: () => ({})
  13638. },
  13639. maxlength: { type: [String, Number] },
  13640. minlength: { type: [String, Number] },
  13641. type: {
  13642. type: definePropType(String),
  13643. default: "text"
  13644. },
  13645. resize: {
  13646. type: String,
  13647. values: [
  13648. "none",
  13649. "both",
  13650. "horizontal",
  13651. "vertical"
  13652. ]
  13653. },
  13654. autosize: {
  13655. type: definePropType([Boolean, Object]),
  13656. default: false
  13657. },
  13658. autocomplete: {
  13659. type: definePropType(String),
  13660. default: "off"
  13661. },
  13662. formatter: { type: Function },
  13663. parser: { type: Function },
  13664. placeholder: { type: String },
  13665. form: { type: String },
  13666. readonly: Boolean,
  13667. clearable: Boolean,
  13668. clearIcon: {
  13669. type: iconPropType,
  13670. default: circle_close_default
  13671. },
  13672. showPassword: Boolean,
  13673. showWordLimit: Boolean,
  13674. wordLimitPosition: {
  13675. type: String,
  13676. values: ["inside", "outside"],
  13677. default: "inside"
  13678. },
  13679. suffixIcon: { type: iconPropType },
  13680. prefixIcon: { type: iconPropType },
  13681. containerRole: {
  13682. type: String,
  13683. default: void 0
  13684. },
  13685. tabindex: {
  13686. type: [String, Number],
  13687. default: 0
  13688. },
  13689. validateEvent: {
  13690. type: Boolean,
  13691. default: true
  13692. },
  13693. inputStyle: {
  13694. type: definePropType([
  13695. Object,
  13696. Array,
  13697. String
  13698. ]),
  13699. default: () => mutable({})
  13700. },
  13701. autofocus: Boolean,
  13702. rows: {
  13703. type: Number,
  13704. default: 2
  13705. },
  13706. ...useAriaProps(["ariaLabel"]),
  13707. inputmode: {
  13708. type: definePropType(String),
  13709. default: void 0
  13710. },
  13711. name: String
  13712. });
  13713. const inputEmits = {
  13714. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  13715. input: (value) => isString(value),
  13716. change: (value, evt) => isString(value) && (evt instanceof Event || evt === void 0),
  13717. focus: (evt) => evt instanceof FocusEvent,
  13718. blur: (evt) => evt instanceof FocusEvent,
  13719. clear: (evt) => evt === void 0 || evt instanceof MouseEvent,
  13720. mouseleave: (evt) => evt instanceof MouseEvent,
  13721. mouseenter: (evt) => evt instanceof MouseEvent,
  13722. keydown: (evt) => evt instanceof Event,
  13723. compositionstart: (evt) => evt instanceof CompositionEvent,
  13724. compositionupdate: (evt) => evt instanceof CompositionEvent,
  13725. compositionend: (evt) => evt instanceof CompositionEvent
  13726. };
  13727. /**
  13728. * @description default values for InputProps, used in components that extend InputProps like Autocomplete
  13729. */
  13730. const inputPropsDefaults = {
  13731. disabled: void 0,
  13732. modelValue: "",
  13733. modelModifiers: () => ({}),
  13734. type: "text",
  13735. autocomplete: "off",
  13736. clearIcon: (0, vue.markRaw)(circle_close_default),
  13737. wordLimitPosition: "inside",
  13738. tabindex: 0,
  13739. validateEvent: true,
  13740. inputStyle: () => ({}),
  13741. rows: 2
  13742. };
  13743. //#endregion
  13744. //#region ../../packages/components/input/src/utils.ts
  13745. let hiddenTextarea = void 0;
  13746. const HIDDEN_STYLE = {
  13747. height: "0",
  13748. visibility: "hidden",
  13749. overflow: isFirefox() ? "" : "hidden",
  13750. position: "absolute",
  13751. "z-index": "-1000",
  13752. top: "0",
  13753. right: "0"
  13754. };
  13755. const CONTEXT_STYLE = [
  13756. "letter-spacing",
  13757. "line-height",
  13758. "padding-top",
  13759. "padding-bottom",
  13760. "font-family",
  13761. "font-weight",
  13762. "font-size",
  13763. "text-rendering",
  13764. "text-transform",
  13765. "width",
  13766. "text-indent",
  13767. "padding-left",
  13768. "padding-right",
  13769. "border-width",
  13770. "box-sizing",
  13771. "word-break"
  13772. ];
  13773. const looseToNumber = (val) => {
  13774. const n = Number.parseFloat(val);
  13775. return Number.isNaN(n) ? val : n;
  13776. };
  13777. function calculateNodeStyling(targetElement) {
  13778. const style = window.getComputedStyle(targetElement);
  13779. const boxSizing = style.getPropertyValue("box-sizing");
  13780. const paddingSize = Number.parseFloat(style.getPropertyValue("padding-bottom")) + Number.parseFloat(style.getPropertyValue("padding-top"));
  13781. const borderSize = Number.parseFloat(style.getPropertyValue("border-bottom-width")) + Number.parseFloat(style.getPropertyValue("border-top-width"));
  13782. return {
  13783. contextStyle: CONTEXT_STYLE.map((name) => [name, style.getPropertyValue(name)]),
  13784. paddingSize,
  13785. borderSize,
  13786. boxSizing
  13787. };
  13788. }
  13789. function calcTextareaHeight(targetElement, minRows = 1, maxRows) {
  13790. if (!hiddenTextarea) {
  13791. hiddenTextarea = document.createElement("textarea");
  13792. let hostNode = document.body;
  13793. if (!isFirefox() && targetElement.parentNode) hostNode = targetElement.parentNode;
  13794. hostNode.appendChild(hiddenTextarea);
  13795. }
  13796. const { paddingSize, borderSize, boxSizing, contextStyle } = calculateNodeStyling(targetElement);
  13797. contextStyle.forEach(([key, value]) => hiddenTextarea?.style.setProperty(key, value));
  13798. Object.entries(HIDDEN_STYLE).forEach(([key, value]) => hiddenTextarea?.style.setProperty(key, value, "important"));
  13799. hiddenTextarea.value = targetElement.value || targetElement.placeholder || "";
  13800. let height = hiddenTextarea.scrollHeight;
  13801. const result = {};
  13802. if (boxSizing === "border-box") height = height + borderSize;
  13803. else if (boxSizing === "content-box") height = height - paddingSize;
  13804. hiddenTextarea.value = "";
  13805. const singleRowHeight = hiddenTextarea.scrollHeight - paddingSize;
  13806. if (isNumber(minRows)) {
  13807. let minHeight = singleRowHeight * minRows;
  13808. if (boxSizing === "border-box") minHeight = minHeight + paddingSize + borderSize;
  13809. height = Math.max(minHeight, height);
  13810. result.minHeight = `${minHeight}px`;
  13811. }
  13812. if (isNumber(maxRows)) {
  13813. let maxHeight = singleRowHeight * maxRows;
  13814. if (boxSizing === "border-box") maxHeight = maxHeight + paddingSize + borderSize;
  13815. height = Math.min(maxHeight, height);
  13816. }
  13817. result.height = `${height}px`;
  13818. hiddenTextarea.parentNode?.removeChild(hiddenTextarea);
  13819. hiddenTextarea = void 0;
  13820. return result;
  13821. }
  13822. //#endregion
  13823. //#region ../../packages/components/input/src/input.vue?vue&type=script&setup=true&lang.ts
  13824. const _hoisted_1$76 = [
  13825. "id",
  13826. "name",
  13827. "minlength",
  13828. "maxlength",
  13829. "type",
  13830. "disabled",
  13831. "readonly",
  13832. "autocomplete",
  13833. "tabindex",
  13834. "aria-label",
  13835. "placeholder",
  13836. "form",
  13837. "autofocus",
  13838. "role",
  13839. "inputmode"
  13840. ];
  13841. const _hoisted_2$42 = [
  13842. "id",
  13843. "name",
  13844. "minlength",
  13845. "maxlength",
  13846. "tabindex",
  13847. "disabled",
  13848. "readonly",
  13849. "autocomplete",
  13850. "aria-label",
  13851. "placeholder",
  13852. "form",
  13853. "autofocus",
  13854. "rows",
  13855. "role"
  13856. ];
  13857. const COMPONENT_NAME$19 = "ElInput";
  13858. var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  13859. name: COMPONENT_NAME$19,
  13860. inheritAttrs: false,
  13861. __name: "input",
  13862. props: inputProps,
  13863. emits: inputEmits,
  13864. setup(__props, { expose: __expose, emit: __emit }) {
  13865. const props = __props;
  13866. const emit = __emit;
  13867. const rawAttrs = (0, vue.useAttrs)();
  13868. const attrs = useAttrs();
  13869. const slots = (0, vue.useSlots)();
  13870. const containerKls = (0, vue.computed)(() => [
  13871. props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
  13872. nsInput.m(inputSize.value),
  13873. nsInput.is("disabled", inputDisabled.value),
  13874. nsInput.is("exceed", inputExceed.value),
  13875. {
  13876. [nsInput.b("group")]: slots.prepend || slots.append,
  13877. [nsInput.m("prefix")]: slots.prefix || props.prefixIcon,
  13878. [nsInput.m("suffix")]: slots.suffix || props.suffixIcon || props.clearable || props.showPassword,
  13879. [nsInput.bm("suffix", "password-clear")]: showClear.value && showPwdVisible.value,
  13880. [nsInput.b("hidden")]: props.type === "hidden"
  13881. },
  13882. rawAttrs.class
  13883. ]);
  13884. const wrapperKls = (0, vue.computed)(() => [nsInput.e("wrapper"), nsInput.is("focus", isFocused.value)]);
  13885. const { form: elForm, formItem: elFormItem } = useFormItem();
  13886. const { inputId } = useFormItemInputId(props, { formItemContext: elFormItem });
  13887. const inputSize = useFormSize();
  13888. const inputDisabled = useFormDisabled();
  13889. const nsInput = useNamespace("input");
  13890. const nsTextarea = useNamespace("textarea");
  13891. const input = (0, vue.shallowRef)();
  13892. const textarea = (0, vue.shallowRef)();
  13893. const hovering = (0, vue.ref)(false);
  13894. const passwordVisible = (0, vue.ref)(false);
  13895. const countStyle = (0, vue.ref)();
  13896. const textareaCalcStyle = (0, vue.shallowRef)(props.inputStyle);
  13897. const _ref = (0, vue.computed)(() => input.value || textarea.value);
  13898. const { wrapperRef, isFocused, handleFocus, handleBlur } = useFocusController(_ref, {
  13899. disabled: inputDisabled,
  13900. afterBlur() {
  13901. if (props.validateEvent) elFormItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  13902. }
  13903. });
  13904. const needStatusIcon = (0, vue.computed)(() => elForm?.statusIcon ?? false);
  13905. const validateState = (0, vue.computed)(() => elFormItem?.validateState || "");
  13906. const validateIcon = (0, vue.computed)(() => validateState.value && ValidateComponentsMap[validateState.value]);
  13907. const passwordIcon = (0, vue.computed)(() => passwordVisible.value ? view_default : hide_default);
  13908. const containerStyle = (0, vue.computed)(() => [rawAttrs.style]);
  13909. const textareaStyle = (0, vue.computed)(() => [
  13910. props.inputStyle,
  13911. textareaCalcStyle.value,
  13912. { resize: props.resize }
  13913. ]);
  13914. const nativeInputValue = (0, vue.computed)(() => isNil(props.modelValue) ? "" : String(props.modelValue));
  13915. const showClear = (0, vue.computed)(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value));
  13916. const showPwdVisible = (0, vue.computed)(() => props.showPassword && !inputDisabled.value && !!nativeInputValue.value);
  13917. const isWordLimitVisible = (0, vue.computed)(() => props.showWordLimit && !!props.maxlength && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
  13918. const textLength = (0, vue.computed)(() => nativeInputValue.value.length);
  13919. const inputExceed = (0, vue.computed)(() => !!isWordLimitVisible.value && textLength.value > Number(props.maxlength));
  13920. const suffixVisible = (0, vue.computed)(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
  13921. const hasModelModifiers = (0, vue.computed)(() => !!Object.keys(props.modelModifiers).length);
  13922. const [recordCursor, setCursor] = useCursor(input);
  13923. useResizeObserver(textarea, (entries) => {
  13924. onceInitSizeTextarea();
  13925. if (!isWordLimitVisible.value || props.resize !== "both" && props.resize !== "horizontal") return;
  13926. const { width } = entries[0].contentRect;
  13927. countStyle.value = { right: `calc(100% - ${width + 22 - 10}px)` };
  13928. });
  13929. const resizeTextarea = () => {
  13930. const { type, autosize } = props;
  13931. if (!isClient || type !== "textarea" || !textarea.value) return;
  13932. if (autosize) {
  13933. const minRows = isObject$1(autosize) ? autosize.minRows : void 0;
  13934. const maxRows = isObject$1(autosize) ? autosize.maxRows : void 0;
  13935. const textareaStyle = calcTextareaHeight(textarea.value, minRows, maxRows);
  13936. textareaCalcStyle.value = {
  13937. overflowY: "hidden",
  13938. ...textareaStyle
  13939. };
  13940. (0, vue.nextTick)(() => {
  13941. textarea.value.offsetHeight;
  13942. textareaCalcStyle.value = textareaStyle;
  13943. });
  13944. } else textareaCalcStyle.value = { minHeight: calcTextareaHeight(textarea.value).minHeight };
  13945. };
  13946. const createOnceInitResize = (resizeTextarea) => {
  13947. let isInit = false;
  13948. return () => {
  13949. if (isInit || !props.autosize) return;
  13950. if (!(textarea.value?.offsetParent === null)) {
  13951. setTimeout(resizeTextarea);
  13952. isInit = true;
  13953. }
  13954. };
  13955. };
  13956. const onceInitSizeTextarea = createOnceInitResize(resizeTextarea);
  13957. const setNativeInputValue = () => {
  13958. const input = _ref.value;
  13959. const formatterValue = props.formatter ? props.formatter(nativeInputValue.value) : nativeInputValue.value;
  13960. if (!input || input.value === formatterValue || props.type === "file") return;
  13961. input.value = formatterValue;
  13962. };
  13963. const formatValue = (value) => {
  13964. const { trim, number } = props.modelModifiers;
  13965. if (trim) value = value.trim();
  13966. if (number) value = `${looseToNumber(value)}`;
  13967. if (props.formatter && props.parser) value = props.parser(value);
  13968. return value;
  13969. };
  13970. const handleInput = async (event) => {
  13971. if (isComposing.value) return;
  13972. const { lazy } = props.modelModifiers;
  13973. let { value } = event.target;
  13974. if (lazy) {
  13975. emit(INPUT_EVENT, value);
  13976. return;
  13977. }
  13978. value = formatValue(value);
  13979. if (String(value) === nativeInputValue.value) {
  13980. if (props.formatter) setNativeInputValue();
  13981. return;
  13982. }
  13983. recordCursor();
  13984. emit(UPDATE_MODEL_EVENT, value);
  13985. emit(INPUT_EVENT, value);
  13986. await (0, vue.nextTick)();
  13987. if (props.formatter && props.parser || !hasModelModifiers.value) setNativeInputValue();
  13988. setCursor();
  13989. };
  13990. const handleChange = async (event) => {
  13991. let { value } = event.target;
  13992. value = formatValue(value);
  13993. if (props.modelModifiers.lazy) emit(UPDATE_MODEL_EVENT, value);
  13994. emit(CHANGE_EVENT, value, event);
  13995. await (0, vue.nextTick)();
  13996. setNativeInputValue();
  13997. };
  13998. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({
  13999. emit,
  14000. afterComposition: handleInput
  14001. });
  14002. const handlePasswordVisible = () => {
  14003. passwordVisible.value = !passwordVisible.value;
  14004. };
  14005. const focus = () => _ref.value?.focus();
  14006. const blur = () => _ref.value?.blur();
  14007. const handleMouseLeave = (evt) => {
  14008. hovering.value = false;
  14009. emit("mouseleave", evt);
  14010. };
  14011. const handleMouseEnter = (evt) => {
  14012. hovering.value = true;
  14013. emit("mouseenter", evt);
  14014. };
  14015. const handleKeydown = (evt) => {
  14016. emit("keydown", evt);
  14017. };
  14018. const select = () => {
  14019. _ref.value?.select();
  14020. };
  14021. const clear = (evt) => {
  14022. emit(UPDATE_MODEL_EVENT, "");
  14023. emit(CHANGE_EVENT, "");
  14024. emit("clear", evt);
  14025. emit(INPUT_EVENT, "");
  14026. };
  14027. (0, vue.watch)(() => props.modelValue, () => {
  14028. (0, vue.nextTick)(() => resizeTextarea());
  14029. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  14030. });
  14031. (0, vue.watch)(nativeInputValue, (newValue) => {
  14032. if (!_ref.value) return;
  14033. const { trim, number } = props.modelModifiers;
  14034. const elValue = _ref.value.value;
  14035. const displayValue = (number || props.type === "number") && !/^0\d/.test(elValue) ? `${looseToNumber(elValue)}` : elValue;
  14036. if (displayValue === newValue) return;
  14037. if (document.activeElement === _ref.value && _ref.value.type !== "range") {
  14038. if (trim && displayValue.trim() === newValue) return;
  14039. }
  14040. setNativeInputValue();
  14041. });
  14042. (0, vue.watch)(() => props.type, async () => {
  14043. await (0, vue.nextTick)();
  14044. setNativeInputValue();
  14045. resizeTextarea();
  14046. });
  14047. (0, vue.onMounted)(() => {
  14048. if (!props.formatter && props.parser) /* @__PURE__ */ debugWarn(COMPONENT_NAME$19, "If you set the parser, you also need to set the formatter.");
  14049. setNativeInputValue();
  14050. (0, vue.nextTick)(resizeTextarea);
  14051. });
  14052. __expose({
  14053. input,
  14054. textarea,
  14055. ref: _ref,
  14056. textareaStyle,
  14057. autosize: (0, vue.toRef)(props, "autosize"),
  14058. isComposing,
  14059. focus,
  14060. blur,
  14061. select,
  14062. clear,
  14063. resizeTextarea
  14064. });
  14065. return (_ctx, _cache) => {
  14066. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  14067. class: (0, vue.normalizeClass)([containerKls.value, {
  14068. [(0, vue.unref)(nsInput).bm("group", "append")]: _ctx.$slots.append,
  14069. [(0, vue.unref)(nsInput).bm("group", "prepend")]: _ctx.$slots.prepend
  14070. }]),
  14071. style: (0, vue.normalizeStyle)(containerStyle.value),
  14072. onMouseenter: handleMouseEnter,
  14073. onMouseleave: handleMouseLeave
  14074. }, [(0, vue.createCommentVNode)(" input "), __props.type !== "textarea" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [
  14075. (0, vue.createCommentVNode)(" prepend slot "),
  14076. _ctx.$slots.prepend ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  14077. key: 0,
  14078. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).be("group", "prepend"))
  14079. }, [(0, vue.renderSlot)(_ctx.$slots, "prepend")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  14080. (0, vue.createElementVNode)("div", {
  14081. ref_key: "wrapperRef",
  14082. ref: wrapperRef,
  14083. class: (0, vue.normalizeClass)(wrapperKls.value)
  14084. }, [
  14085. (0, vue.createCommentVNode)(" prefix slot "),
  14086. _ctx.$slots.prefix || __props.prefixIcon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  14087. key: 0,
  14088. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("prefix"))
  14089. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("prefix-inner")) }, [(0, vue.renderSlot)(_ctx.$slots, "prefix"), __props.prefixIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14090. key: 0,
  14091. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("icon"))
  14092. }, {
  14093. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.prefixIcon)))]),
  14094. _: 1
  14095. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)], 2)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  14096. (0, vue.createElementVNode)("input", (0, vue.mergeProps)({
  14097. id: (0, vue.unref)(inputId),
  14098. ref_key: "input",
  14099. ref: input,
  14100. class: (0, vue.unref)(nsInput).e("inner")
  14101. }, (0, vue.unref)(attrs), {
  14102. name: __props.name,
  14103. minlength: __props.minlength,
  14104. maxlength: __props.maxlength,
  14105. type: __props.showPassword ? passwordVisible.value ? "text" : "password" : __props.type,
  14106. disabled: (0, vue.unref)(inputDisabled),
  14107. readonly: __props.readonly,
  14108. autocomplete: __props.autocomplete,
  14109. tabindex: __props.tabindex,
  14110. "aria-label": __props.ariaLabel,
  14111. placeholder: __props.placeholder,
  14112. style: __props.inputStyle,
  14113. form: __props.form,
  14114. autofocus: __props.autofocus,
  14115. role: __props.containerRole,
  14116. inputmode: __props.inputmode,
  14117. onCompositionstart: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleCompositionStart) && (0, vue.unref)(handleCompositionStart)(...args)),
  14118. onCompositionupdate: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleCompositionUpdate) && (0, vue.unref)(handleCompositionUpdate)(...args)),
  14119. onCompositionend: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(handleCompositionEnd) && (0, vue.unref)(handleCompositionEnd)(...args)),
  14120. onInput: handleInput,
  14121. onChange: handleChange,
  14122. onKeydown: handleKeydown
  14123. }), null, 16, _hoisted_1$76),
  14124. (0, vue.createCommentVNode)(" suffix slot "),
  14125. suffixVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  14126. key: 1,
  14127. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("suffix"))
  14128. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("suffix-inner")) }, [
  14129. !showClear.value || !showPwdVisible.value || !isWordLimitVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.renderSlot)(_ctx.$slots, "suffix"), __props.suffixIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14130. key: 0,
  14131. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("icon"))
  14132. }, {
  14133. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.suffixIcon)))]),
  14134. _: 1
  14135. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)], 64)) : (0, vue.createCommentVNode)("v-if", true),
  14136. showClear.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14137. key: 1,
  14138. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("icon"), (0, vue.unref)(nsInput).e("clear")]),
  14139. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  14140. onClick: clear
  14141. }, {
  14142. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.clearIcon)))]),
  14143. _: 1
  14144. }, 8, ["class", "onMousedown"])) : (0, vue.createCommentVNode)("v-if", true),
  14145. showPwdVisible.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14146. key: 2,
  14147. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("icon"), (0, vue.unref)(nsInput).e("password")]),
  14148. onClick: handlePasswordVisible,
  14149. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  14150. onMouseup: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"])
  14151. }, {
  14152. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(passwordIcon.value)))]),
  14153. _: 1
  14154. }, 8, [
  14155. "class",
  14156. "onMousedown",
  14157. "onMouseup"
  14158. ])) : (0, vue.createCommentVNode)("v-if", true),
  14159. isWordLimitVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  14160. key: 3,
  14161. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("count"), (0, vue.unref)(nsInput).is("outside", __props.wordLimitPosition === "outside")])
  14162. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("count-inner")) }, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(__props.maxlength), 3)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  14163. validateState.value && validateIcon.value && needStatusIcon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14164. key: 4,
  14165. class: (0, vue.normalizeClass)([
  14166. (0, vue.unref)(nsInput).e("icon"),
  14167. (0, vue.unref)(nsInput).e("validateIcon"),
  14168. (0, vue.unref)(nsInput).is("loading", validateState.value === "validating")
  14169. ])
  14170. }, {
  14171. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(validateIcon.value)))]),
  14172. _: 1
  14173. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  14174. ], 2)], 2)) : (0, vue.createCommentVNode)("v-if", true)
  14175. ], 2),
  14176. (0, vue.createCommentVNode)(" append slot "),
  14177. _ctx.$slots.append ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  14178. key: 1,
  14179. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).be("group", "append"))
  14180. }, [(0, vue.renderSlot)(_ctx.$slots, "append")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  14181. ], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [
  14182. (0, vue.createCommentVNode)(" textarea "),
  14183. (0, vue.createElementVNode)("textarea", (0, vue.mergeProps)({
  14184. id: (0, vue.unref)(inputId),
  14185. ref_key: "textarea",
  14186. ref: textarea,
  14187. class: [
  14188. (0, vue.unref)(nsTextarea).e("inner"),
  14189. (0, vue.unref)(nsInput).is("focus", (0, vue.unref)(isFocused)),
  14190. (0, vue.unref)(nsTextarea).is("clearable", __props.clearable)
  14191. ]
  14192. }, (0, vue.unref)(attrs), {
  14193. name: __props.name,
  14194. minlength: __props.minlength,
  14195. maxlength: __props.maxlength,
  14196. tabindex: __props.tabindex,
  14197. disabled: (0, vue.unref)(inputDisabled),
  14198. readonly: __props.readonly,
  14199. autocomplete: __props.autocomplete,
  14200. style: textareaStyle.value,
  14201. "aria-label": __props.ariaLabel,
  14202. placeholder: __props.placeholder,
  14203. form: __props.form,
  14204. autofocus: __props.autofocus,
  14205. rows: __props.rows,
  14206. role: __props.containerRole,
  14207. onCompositionstart: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(handleCompositionStart) && (0, vue.unref)(handleCompositionStart)(...args)),
  14208. onCompositionupdate: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(handleCompositionUpdate) && (0, vue.unref)(handleCompositionUpdate)(...args)),
  14209. onCompositionend: _cache[5] || (_cache[5] = (...args) => (0, vue.unref)(handleCompositionEnd) && (0, vue.unref)(handleCompositionEnd)(...args)),
  14210. onInput: handleInput,
  14211. onFocus: _cache[6] || (_cache[6] = (...args) => (0, vue.unref)(handleFocus) && (0, vue.unref)(handleFocus)(...args)),
  14212. onBlur: _cache[7] || (_cache[7] = (...args) => (0, vue.unref)(handleBlur) && (0, vue.unref)(handleBlur)(...args)),
  14213. onChange: handleChange,
  14214. onKeydown: handleKeydown
  14215. }), null, 16, _hoisted_2$42),
  14216. showClear.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  14217. key: 0,
  14218. class: (0, vue.normalizeClass)([(0, vue.unref)(nsTextarea).e("icon"), (0, vue.unref)(nsTextarea).e("clear")]),
  14219. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  14220. onClick: clear
  14221. }, {
  14222. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.clearIcon)))]),
  14223. _: 1
  14224. }, 8, ["class", "onMousedown"])) : (0, vue.createCommentVNode)("v-if", true),
  14225. isWordLimitVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  14226. key: 1,
  14227. style: (0, vue.normalizeStyle)(countStyle.value),
  14228. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("count"), (0, vue.unref)(nsInput).is("outside", __props.wordLimitPosition === "outside")])
  14229. }, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(__props.maxlength), 7)) : (0, vue.createCommentVNode)("v-if", true)
  14230. ], 64))], 38);
  14231. };
  14232. }
  14233. });
  14234. //#endregion
  14235. //#region ../../packages/components/input/src/input.vue
  14236. var input_default = input_vue_vue_type_script_setup_true_lang_default;
  14237. //#endregion
  14238. //#region ../../packages/components/input/index.ts
  14239. const ElInput = withInstall(input_default);
  14240. //#endregion
  14241. //#region ../../packages/components/autocomplete/src/autocomplete.ts
  14242. /**
  14243. * @deprecated Removed after 3.0.0, Use `AutocompleteProps` instead.
  14244. */
  14245. const autocompleteProps = buildProps({
  14246. ...inputProps,
  14247. valueKey: {
  14248. type: String,
  14249. default: "value"
  14250. },
  14251. modelValue: {
  14252. type: [String, Number],
  14253. default: ""
  14254. },
  14255. debounce: {
  14256. type: Number,
  14257. default: 300
  14258. },
  14259. placement: {
  14260. type: definePropType(String),
  14261. values: [
  14262. "top",
  14263. "top-start",
  14264. "top-end",
  14265. "bottom",
  14266. "bottom-start",
  14267. "bottom-end"
  14268. ],
  14269. default: "bottom-start"
  14270. },
  14271. fetchSuggestions: {
  14272. type: definePropType([Function, Array]),
  14273. default: NOOP
  14274. },
  14275. popperClass: useTooltipContentProps.popperClass,
  14276. popperStyle: useTooltipContentProps.popperStyle,
  14277. triggerOnFocus: {
  14278. type: Boolean,
  14279. default: true
  14280. },
  14281. selectWhenUnmatched: Boolean,
  14282. hideLoading: Boolean,
  14283. teleported: useTooltipContentProps.teleported,
  14284. appendTo: useTooltipContentProps.appendTo,
  14285. highlightFirstItem: Boolean,
  14286. fitInputWidth: Boolean,
  14287. loopNavigation: {
  14288. type: Boolean,
  14289. default: true
  14290. }
  14291. });
  14292. const autocompleteEmits = {
  14293. [UPDATE_MODEL_EVENT]: (value) => isString(value) || isNumber(value),
  14294. [INPUT_EVENT]: (value) => isString(value) || isNumber(value),
  14295. [CHANGE_EVENT]: (value) => isString(value) || isNumber(value),
  14296. focus: (evt) => evt instanceof FocusEvent,
  14297. blur: (evt) => evt instanceof FocusEvent,
  14298. clear: () => true,
  14299. select: (item) => isObject$1(item)
  14300. };
  14301. //#endregion
  14302. //#region ../../packages/components/scrollbar/src/scrollbar.ts
  14303. /**
  14304. * @deprecated Removed after 3.0.0, Use `ScrollbarProps` instead.
  14305. */
  14306. const scrollbarProps = buildProps({
  14307. distance: {
  14308. type: Number,
  14309. default: 0
  14310. },
  14311. height: {
  14312. type: [String, Number],
  14313. default: ""
  14314. },
  14315. maxHeight: {
  14316. type: [String, Number],
  14317. default: ""
  14318. },
  14319. native: Boolean,
  14320. wrapStyle: {
  14321. type: definePropType([
  14322. String,
  14323. Object,
  14324. Array
  14325. ]),
  14326. default: ""
  14327. },
  14328. wrapClass: {
  14329. type: [String, Array],
  14330. default: ""
  14331. },
  14332. viewClass: {
  14333. type: [String, Array],
  14334. default: ""
  14335. },
  14336. viewStyle: {
  14337. type: [
  14338. String,
  14339. Array,
  14340. Object
  14341. ],
  14342. default: ""
  14343. },
  14344. noresize: Boolean,
  14345. tag: {
  14346. type: String,
  14347. default: "div"
  14348. },
  14349. always: Boolean,
  14350. minSize: {
  14351. type: Number,
  14352. default: 20
  14353. },
  14354. tabindex: {
  14355. type: [String, Number],
  14356. default: void 0
  14357. },
  14358. id: String,
  14359. role: String,
  14360. ...useAriaProps(["ariaLabel", "ariaOrientation"])
  14361. });
  14362. const scrollbarEmits = {
  14363. "end-reached": (direction) => [
  14364. "left",
  14365. "right",
  14366. "top",
  14367. "bottom"
  14368. ].includes(direction),
  14369. scroll: ({ scrollTop, scrollLeft }) => [scrollTop, scrollLeft].every(isNumber)
  14370. };
  14371. //#endregion
  14372. //#region ../../packages/components/scrollbar/src/bar.ts
  14373. /**
  14374. * @deprecated Removed after 3.0.0, Use `BarProps` instead.
  14375. */
  14376. const barProps = buildProps({
  14377. always: {
  14378. type: Boolean,
  14379. default: true
  14380. },
  14381. minSize: {
  14382. type: Number,
  14383. required: true
  14384. }
  14385. });
  14386. //#endregion
  14387. //#region ../../packages/components/scrollbar/src/util.ts
  14388. const GAP = 4;
  14389. const BAR_MAP = {
  14390. vertical: {
  14391. offset: "offsetHeight",
  14392. scroll: "scrollTop",
  14393. scrollSize: "scrollHeight",
  14394. size: "height",
  14395. key: "vertical",
  14396. axis: "Y",
  14397. client: "clientY",
  14398. direction: "top"
  14399. },
  14400. horizontal: {
  14401. offset: "offsetWidth",
  14402. scroll: "scrollLeft",
  14403. scrollSize: "scrollWidth",
  14404. size: "width",
  14405. key: "horizontal",
  14406. axis: "X",
  14407. client: "clientX",
  14408. direction: "left"
  14409. }
  14410. };
  14411. const renderThumbStyle = ({ move, size, bar }) => ({
  14412. [bar.size]: size,
  14413. transform: `translate${bar.axis}(${move}%)`
  14414. });
  14415. //#endregion
  14416. //#region ../../packages/components/scrollbar/src/thumb.ts
  14417. /**
  14418. * @deprecated Removed after 3.0.0, Use `ThumbProps` instead.
  14419. */
  14420. const thumbProps = buildProps({
  14421. vertical: Boolean,
  14422. size: String,
  14423. move: Number,
  14424. ratio: {
  14425. type: Number,
  14426. required: true
  14427. },
  14428. always: Boolean
  14429. });
  14430. //#endregion
  14431. //#region ../../packages/components/scrollbar/src/constants.ts
  14432. const scrollbarContextKey = Symbol("scrollbarContextKey");
  14433. //#endregion
  14434. //#region ../../packages/components/scrollbar/src/thumb.vue?vue&type=script&setup=true&lang.ts
  14435. const COMPONENT_NAME$18 = "Thumb";
  14436. var thumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  14437. __name: "thumb",
  14438. props: thumbProps,
  14439. setup(__props) {
  14440. const props = __props;
  14441. const scrollbar = (0, vue.inject)(scrollbarContextKey);
  14442. const ns = useNamespace("scrollbar");
  14443. if (!scrollbar) throwError(COMPONENT_NAME$18, "can not inject scrollbar context");
  14444. const instance = (0, vue.ref)();
  14445. const thumb = (0, vue.ref)();
  14446. const thumbState = (0, vue.ref)({});
  14447. const visible = (0, vue.ref)(false);
  14448. let cursorDown = false;
  14449. let cursorLeave = false;
  14450. let baseScrollHeight = 0;
  14451. let baseScrollWidth = 0;
  14452. let originalOnSelectStart = isClient ? document.onselectstart : null;
  14453. const bar = (0, vue.computed)(() => BAR_MAP[props.vertical ? "vertical" : "horizontal"]);
  14454. const thumbStyle = (0, vue.computed)(() => renderThumbStyle({
  14455. size: props.size,
  14456. move: props.move,
  14457. bar: bar.value
  14458. }));
  14459. const offsetRatio = (0, vue.computed)(() => instance.value[bar.value.offset] ** 2 / scrollbar.wrapElement[bar.value.scrollSize] / props.ratio / thumb.value[bar.value.offset]);
  14460. const clickThumbHandler = (e) => {
  14461. e.stopPropagation();
  14462. if (e.ctrlKey || [1, 2].includes(e.button)) return;
  14463. window.getSelection()?.removeAllRanges();
  14464. startDrag(e);
  14465. const el = e.currentTarget;
  14466. if (!el) return;
  14467. thumbState.value[bar.value.axis] = el[bar.value.offset] - (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction]);
  14468. };
  14469. const clickTrackHandler = (e) => {
  14470. if (!thumb.value || !instance.value || !scrollbar.wrapElement) return;
  14471. const thumbPositionPercentage = (Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumb.value[bar.value.offset] / 2) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  14472. scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * scrollbar.wrapElement[bar.value.scrollSize] / 100;
  14473. };
  14474. const startDrag = (e) => {
  14475. e.stopImmediatePropagation();
  14476. cursorDown = true;
  14477. baseScrollHeight = scrollbar.wrapElement.scrollHeight;
  14478. baseScrollWidth = scrollbar.wrapElement.scrollWidth;
  14479. document.addEventListener("mousemove", mouseMoveDocumentHandler);
  14480. document.addEventListener("mouseup", mouseUpDocumentHandler);
  14481. originalOnSelectStart = document.onselectstart;
  14482. document.onselectstart = () => false;
  14483. };
  14484. const mouseMoveDocumentHandler = (e) => {
  14485. if (!instance.value || !thumb.value) return;
  14486. if (cursorDown === false) return;
  14487. const prevPage = thumbState.value[bar.value.axis];
  14488. if (!prevPage) return;
  14489. const thumbPositionPercentage = ((instance.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumb.value[bar.value.offset] - prevPage)) * 100 * offsetRatio.value / instance.value[bar.value.offset];
  14490. if (bar.value.scroll === "scrollLeft") scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollWidth / 100;
  14491. else scrollbar.wrapElement[bar.value.scroll] = thumbPositionPercentage * baseScrollHeight / 100;
  14492. };
  14493. const mouseUpDocumentHandler = () => {
  14494. cursorDown = false;
  14495. thumbState.value[bar.value.axis] = 0;
  14496. document.removeEventListener("mousemove", mouseMoveDocumentHandler);
  14497. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  14498. restoreOnselectstart();
  14499. if (cursorLeave) visible.value = false;
  14500. };
  14501. const mouseMoveScrollbarHandler = () => {
  14502. cursorLeave = false;
  14503. visible.value = !!props.size;
  14504. };
  14505. const mouseLeaveScrollbarHandler = () => {
  14506. cursorLeave = true;
  14507. visible.value = cursorDown;
  14508. };
  14509. (0, vue.onBeforeUnmount)(() => {
  14510. restoreOnselectstart();
  14511. document.removeEventListener("mouseup", mouseUpDocumentHandler);
  14512. });
  14513. const restoreOnselectstart = () => {
  14514. if (document.onselectstart !== originalOnSelectStart) document.onselectstart = originalOnSelectStart;
  14515. };
  14516. useEventListener((0, vue.toRef)(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
  14517. useEventListener((0, vue.toRef)(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
  14518. return (_ctx, _cache) => {
  14519. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  14520. name: (0, vue.unref)(ns).b("fade"),
  14521. persisted: ""
  14522. }, {
  14523. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  14524. ref_key: "instance",
  14525. ref: instance,
  14526. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("bar"), (0, vue.unref)(ns).is(bar.value.key)]),
  14527. onMousedown: clickTrackHandler,
  14528. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  14529. }, [(0, vue.createElementVNode)("div", {
  14530. ref_key: "thumb",
  14531. ref: thumb,
  14532. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("thumb")),
  14533. style: (0, vue.normalizeStyle)(thumbStyle.value),
  14534. onMousedown: clickThumbHandler
  14535. }, null, 38)], 34), [[vue.vShow, __props.always || visible.value]])]),
  14536. _: 1
  14537. }, 8, ["name"]);
  14538. };
  14539. }
  14540. });
  14541. //#endregion
  14542. //#region ../../packages/components/scrollbar/src/thumb.vue
  14543. var thumb_default = thumb_vue_vue_type_script_setup_true_lang_default;
  14544. //#endregion
  14545. //#region ../../packages/components/scrollbar/src/bar.vue?vue&type=script&setup=true&lang.ts
  14546. var bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  14547. __name: "bar",
  14548. props: barProps,
  14549. setup(__props, { expose: __expose }) {
  14550. const props = __props;
  14551. const scrollbar = (0, vue.inject)(scrollbarContextKey);
  14552. const moveX = (0, vue.ref)(0);
  14553. const moveY = (0, vue.ref)(0);
  14554. const sizeWidth = (0, vue.ref)("");
  14555. const sizeHeight = (0, vue.ref)("");
  14556. const ratioY = (0, vue.ref)(1);
  14557. const ratioX = (0, vue.ref)(1);
  14558. const handleScroll = (wrap) => {
  14559. if (wrap) {
  14560. const offsetHeight = wrap.offsetHeight - GAP;
  14561. const offsetWidth = wrap.offsetWidth - GAP;
  14562. moveY.value = wrap.scrollTop * 100 / offsetHeight * ratioY.value;
  14563. moveX.value = wrap.scrollLeft * 100 / offsetWidth * ratioX.value;
  14564. }
  14565. };
  14566. const update = () => {
  14567. const wrap = scrollbar?.wrapElement;
  14568. if (!wrap) return;
  14569. const offsetHeight = wrap.offsetHeight - GAP;
  14570. const offsetWidth = wrap.offsetWidth - GAP;
  14571. const originalHeight = offsetHeight ** 2 / wrap.scrollHeight;
  14572. const originalWidth = offsetWidth ** 2 / wrap.scrollWidth;
  14573. const height = Math.max(originalHeight, props.minSize);
  14574. const width = Math.max(originalWidth, props.minSize);
  14575. ratioY.value = originalHeight / (offsetHeight - originalHeight) / (height / (offsetHeight - height));
  14576. ratioX.value = originalWidth / (offsetWidth - originalWidth) / (width / (offsetWidth - width));
  14577. sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : "";
  14578. sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : "";
  14579. };
  14580. __expose({
  14581. handleScroll,
  14582. update
  14583. });
  14584. return (_ctx, _cache) => {
  14585. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createVNode)(thumb_default, {
  14586. move: moveX.value,
  14587. ratio: ratioX.value,
  14588. size: sizeWidth.value,
  14589. always: __props.always
  14590. }, null, 8, [
  14591. "move",
  14592. "ratio",
  14593. "size",
  14594. "always"
  14595. ]), (0, vue.createVNode)(thumb_default, {
  14596. move: moveY.value,
  14597. ratio: ratioY.value,
  14598. size: sizeHeight.value,
  14599. vertical: "",
  14600. always: __props.always
  14601. }, null, 8, [
  14602. "move",
  14603. "ratio",
  14604. "size",
  14605. "always"
  14606. ])], 64);
  14607. };
  14608. }
  14609. });
  14610. //#endregion
  14611. //#region ../../packages/components/scrollbar/src/bar.vue
  14612. var bar_default = bar_vue_vue_type_script_setup_true_lang_default;
  14613. //#endregion
  14614. //#region ../../packages/components/scrollbar/src/scrollbar.vue?vue&type=script&setup=true&lang.ts
  14615. const _hoisted_1$75 = ["tabindex"];
  14616. const COMPONENT_NAME$17 = "ElScrollbar";
  14617. var scrollbar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  14618. name: COMPONENT_NAME$17,
  14619. __name: "scrollbar",
  14620. props: scrollbarProps,
  14621. emits: scrollbarEmits,
  14622. setup(__props, { expose: __expose, emit: __emit }) {
  14623. const props = __props;
  14624. const emit = __emit;
  14625. const ns = useNamespace("scrollbar");
  14626. let stopResizeObserver = void 0;
  14627. let stopWrapResizeObserver = void 0;
  14628. let stopResizeListener = void 0;
  14629. let wrapScrollTop = 0;
  14630. let wrapScrollLeft = 0;
  14631. let direction = "";
  14632. const distanceScrollState = {
  14633. bottom: false,
  14634. top: false,
  14635. right: false,
  14636. left: false
  14637. };
  14638. const scrollbarRef = (0, vue.ref)();
  14639. const wrapRef = (0, vue.ref)();
  14640. const resizeRef = (0, vue.ref)();
  14641. const barRef = (0, vue.ref)();
  14642. const wrapStyle = (0, vue.computed)(() => {
  14643. const style = {};
  14644. const height = addUnit(props.height);
  14645. const maxHeight = addUnit(props.maxHeight);
  14646. if (height) style.height = height;
  14647. if (maxHeight) style.maxHeight = maxHeight;
  14648. return [props.wrapStyle, style];
  14649. });
  14650. const wrapKls = (0, vue.computed)(() => {
  14651. return [
  14652. props.wrapClass,
  14653. ns.e("wrap"),
  14654. { [ns.em("wrap", "hidden-default")]: !props.native }
  14655. ];
  14656. });
  14657. const resizeKls = (0, vue.computed)(() => {
  14658. return [ns.e("view"), props.viewClass];
  14659. });
  14660. const shouldSkipDirection = (direction) => {
  14661. return distanceScrollState[direction] ?? false;
  14662. };
  14663. const DIRECTION_PAIRS = {
  14664. top: "bottom",
  14665. bottom: "top",
  14666. left: "right",
  14667. right: "left"
  14668. };
  14669. const updateTriggerStatus = (arrivedStates) => {
  14670. const oppositeDirection = DIRECTION_PAIRS[direction];
  14671. if (!oppositeDirection) return;
  14672. const arrived = arrivedStates[direction];
  14673. const oppositeArrived = arrivedStates[oppositeDirection];
  14674. if (arrived && !distanceScrollState[direction]) distanceScrollState[direction] = true;
  14675. if (!oppositeArrived && distanceScrollState[oppositeDirection]) distanceScrollState[oppositeDirection] = false;
  14676. };
  14677. const handleScroll = () => {
  14678. if (wrapRef.value) {
  14679. barRef.value?.handleScroll(wrapRef.value);
  14680. const prevTop = wrapScrollTop;
  14681. const prevLeft = wrapScrollLeft;
  14682. wrapScrollTop = wrapRef.value.scrollTop;
  14683. wrapScrollLeft = wrapRef.value.scrollLeft;
  14684. const arrivedStates = {
  14685. bottom: wrapScrollTop + wrapRef.value.clientHeight >= wrapRef.value.scrollHeight - props.distance,
  14686. top: wrapScrollTop <= props.distance && prevTop !== 0,
  14687. right: wrapScrollLeft + wrapRef.value.clientWidth >= wrapRef.value.scrollWidth - props.distance && prevLeft !== wrapScrollLeft,
  14688. left: wrapScrollLeft <= props.distance && prevLeft !== 0
  14689. };
  14690. emit("scroll", {
  14691. scrollTop: wrapScrollTop,
  14692. scrollLeft: wrapScrollLeft
  14693. });
  14694. if (prevTop !== wrapScrollTop) direction = wrapScrollTop > prevTop ? "bottom" : "top";
  14695. if (prevLeft !== wrapScrollLeft) direction = wrapScrollLeft > prevLeft ? "right" : "left";
  14696. if (props.distance > 0) {
  14697. if (shouldSkipDirection(direction)) return;
  14698. updateTriggerStatus(arrivedStates);
  14699. }
  14700. if (arrivedStates[direction]) emit("end-reached", direction);
  14701. }
  14702. };
  14703. function scrollTo(arg1, arg2) {
  14704. if (isObject$1(arg1)) wrapRef.value.scrollTo(arg1);
  14705. else if (isNumber(arg1) && isNumber(arg2)) wrapRef.value.scrollTo(arg1, arg2);
  14706. }
  14707. const setScrollTop = (value) => {
  14708. if (!isNumber(value)) {
  14709. /* @__PURE__ */ debugWarn(COMPONENT_NAME$17, "value must be a number");
  14710. return;
  14711. }
  14712. wrapRef.value.scrollTop = value;
  14713. };
  14714. const setScrollLeft = (value) => {
  14715. if (!isNumber(value)) {
  14716. /* @__PURE__ */ debugWarn(COMPONENT_NAME$17, "value must be a number");
  14717. return;
  14718. }
  14719. wrapRef.value.scrollLeft = value;
  14720. };
  14721. const update = () => {
  14722. barRef.value?.update();
  14723. distanceScrollState[direction] = false;
  14724. };
  14725. (0, vue.watch)(() => props.noresize, (noresize) => {
  14726. if (noresize) {
  14727. stopResizeObserver?.();
  14728. stopWrapResizeObserver?.();
  14729. stopResizeListener?.();
  14730. } else {
  14731. ({stop: stopResizeObserver} = useResizeObserver(resizeRef, update));
  14732. ({stop: stopWrapResizeObserver} = useResizeObserver(wrapRef, update));
  14733. stopResizeListener = useEventListener("resize", update);
  14734. }
  14735. }, { immediate: true });
  14736. (0, vue.watch)(() => [props.maxHeight, props.height], () => {
  14737. if (!props.native) (0, vue.nextTick)(() => {
  14738. update();
  14739. if (wrapRef.value) barRef.value?.handleScroll(wrapRef.value);
  14740. });
  14741. });
  14742. (0, vue.provide)(scrollbarContextKey, (0, vue.reactive)({
  14743. scrollbarElement: scrollbarRef,
  14744. wrapElement: wrapRef
  14745. }));
  14746. (0, vue.onActivated)(() => {
  14747. if (wrapRef.value) {
  14748. wrapRef.value.scrollTop = wrapScrollTop;
  14749. wrapRef.value.scrollLeft = wrapScrollLeft;
  14750. }
  14751. });
  14752. (0, vue.onMounted)(() => {
  14753. if (!props.native) (0, vue.nextTick)(() => {
  14754. update();
  14755. });
  14756. });
  14757. (0, vue.onUpdated)(() => update());
  14758. __expose({
  14759. wrapRef,
  14760. update,
  14761. scrollTo,
  14762. setScrollTop,
  14763. setScrollLeft,
  14764. handleScroll
  14765. });
  14766. return (_ctx, _cache) => {
  14767. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  14768. ref_key: "scrollbarRef",
  14769. ref: scrollbarRef,
  14770. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b())
  14771. }, [(0, vue.createElementVNode)("div", {
  14772. ref_key: "wrapRef",
  14773. ref: wrapRef,
  14774. class: (0, vue.normalizeClass)(wrapKls.value),
  14775. style: (0, vue.normalizeStyle)(wrapStyle.value),
  14776. tabindex: __props.tabindex,
  14777. onScroll: handleScroll
  14778. }, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
  14779. id: __props.id,
  14780. ref_key: "resizeRef",
  14781. ref: resizeRef,
  14782. class: (0, vue.normalizeClass)(resizeKls.value),
  14783. style: (0, vue.normalizeStyle)(__props.viewStyle),
  14784. role: __props.role,
  14785. "aria-label": __props.ariaLabel,
  14786. "aria-orientation": __props.ariaOrientation
  14787. }, {
  14788. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  14789. _: 3
  14790. }, 8, [
  14791. "id",
  14792. "class",
  14793. "style",
  14794. "role",
  14795. "aria-label",
  14796. "aria-orientation"
  14797. ]))], 46, _hoisted_1$75), !__props.native ? ((0, vue.openBlock)(), (0, vue.createBlock)(bar_default, {
  14798. key: 0,
  14799. ref_key: "barRef",
  14800. ref: barRef,
  14801. always: __props.always,
  14802. "min-size": __props.minSize
  14803. }, null, 8, ["always", "min-size"])) : (0, vue.createCommentVNode)("v-if", true)], 2);
  14804. };
  14805. }
  14806. });
  14807. //#endregion
  14808. //#region ../../packages/components/scrollbar/src/scrollbar.vue
  14809. var scrollbar_default = scrollbar_vue_vue_type_script_setup_true_lang_default;
  14810. //#endregion
  14811. //#region ../../packages/components/scrollbar/index.ts
  14812. const ElScrollbar = withInstall(scrollbar_default);
  14813. //#endregion
  14814. //#region ../../packages/components/autocomplete/src/autocomplete.vue?vue&type=script&setup=true&lang.ts
  14815. const _hoisted_1$74 = ["aria-expanded", "aria-owns"];
  14816. const _hoisted_2$41 = { key: 0 };
  14817. const _hoisted_3$18 = [
  14818. "id",
  14819. "aria-selected",
  14820. "onClick"
  14821. ];
  14822. const COMPONENT_NAME$16 = "ElAutocomplete";
  14823. var autocomplete_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  14824. name: COMPONENT_NAME$16,
  14825. inheritAttrs: false,
  14826. __name: "autocomplete",
  14827. props: autocompleteProps,
  14828. emits: autocompleteEmits,
  14829. setup(__props, { expose: __expose, emit: __emit }) {
  14830. const props = __props;
  14831. const emit = __emit;
  14832. const passInputProps = (0, vue.computed)(() => pick(props, Object.keys(inputProps)));
  14833. const rawAttrs = (0, vue.useAttrs)();
  14834. const disabled = useFormDisabled();
  14835. const ns = useNamespace("autocomplete");
  14836. const inputRef = (0, vue.ref)();
  14837. const regionRef = (0, vue.ref)();
  14838. const popperRef = (0, vue.ref)();
  14839. const listboxRef = (0, vue.ref)();
  14840. let readonly = false;
  14841. let ignoreFocusEvent = false;
  14842. const suggestions = (0, vue.ref)([]);
  14843. const highlightedIndex = (0, vue.ref)(-1);
  14844. const dropdownWidth = (0, vue.ref)("");
  14845. const activated = (0, vue.ref)(false);
  14846. const suggestionDisabled = (0, vue.ref)(false);
  14847. const loading = (0, vue.ref)(false);
  14848. const listboxId = useId();
  14849. const styles = (0, vue.computed)(() => rawAttrs.style);
  14850. const suggestionVisible = (0, vue.computed)(() => {
  14851. return (suggestions.value.length > 0 || loading.value) && activated.value;
  14852. });
  14853. const suggestionLoading = (0, vue.computed)(() => !props.hideLoading && loading.value);
  14854. const refInput = (0, vue.computed)(() => {
  14855. if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input"));
  14856. return [];
  14857. });
  14858. const onSuggestionShow = () => {
  14859. if (suggestionVisible.value) dropdownWidth.value = `${inputRef.value.$el.offsetWidth}px`;
  14860. };
  14861. const onHide = () => {
  14862. highlightedIndex.value = -1;
  14863. };
  14864. const getData = async (queryString) => {
  14865. if (suggestionDisabled.value) return;
  14866. const cb = (suggestionList) => {
  14867. loading.value = false;
  14868. if (suggestionDisabled.value) return;
  14869. if (isArray$1(suggestionList)) {
  14870. suggestions.value = suggestionList;
  14871. highlightedIndex.value = props.highlightFirstItem ? 0 : -1;
  14872. } else throwError(COMPONENT_NAME$16, "autocomplete suggestions must be an array");
  14873. };
  14874. loading.value = true;
  14875. if (isArray$1(props.fetchSuggestions)) cb(props.fetchSuggestions);
  14876. else {
  14877. const result = await props.fetchSuggestions(queryString, cb);
  14878. if (isArray$1(result)) cb(result);
  14879. }
  14880. };
  14881. const debouncedGetData = useDebounceFn(getData, (0, vue.computed)(() => props.debounce));
  14882. const handleInput = (value) => {
  14883. const valuePresented = !!value;
  14884. emit(INPUT_EVENT, value);
  14885. emit(UPDATE_MODEL_EVENT, value);
  14886. suggestionDisabled.value = false;
  14887. activated.value ||= valuePresented;
  14888. if (!props.triggerOnFocus && !value) {
  14889. suggestionDisabled.value = true;
  14890. suggestions.value = [];
  14891. return;
  14892. }
  14893. debouncedGetData(value);
  14894. };
  14895. const handleMouseDown = (event) => {
  14896. if (disabled.value) return;
  14897. if (event.target?.tagName !== "INPUT" || refInput.value.includes(document.activeElement)) activated.value = true;
  14898. };
  14899. const handleChange = (value) => {
  14900. emit(CHANGE_EVENT, value);
  14901. };
  14902. const handleFocus = (evt) => {
  14903. if (!ignoreFocusEvent) {
  14904. activated.value = true;
  14905. emit("focus", evt);
  14906. const queryString = props.modelValue ?? "";
  14907. if (props.triggerOnFocus && !readonly) debouncedGetData(String(queryString));
  14908. } else ignoreFocusEvent = false;
  14909. };
  14910. const handleBlur = (evt) => {
  14911. setTimeout(() => {
  14912. if (popperRef.value?.isFocusInsideContent()) {
  14913. ignoreFocusEvent = true;
  14914. return;
  14915. }
  14916. activated.value && close();
  14917. emit("blur", evt);
  14918. });
  14919. };
  14920. const handleClear = () => {
  14921. activated.value = false;
  14922. emit(UPDATE_MODEL_EVENT, "");
  14923. emit("clear");
  14924. };
  14925. const handleKeyEnter = async () => {
  14926. if (inputRef.value?.isComposing) return;
  14927. if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) handleSelect(suggestions.value[highlightedIndex.value]);
  14928. else {
  14929. if (props.selectWhenUnmatched) {
  14930. emit("select", { value: props.modelValue });
  14931. suggestions.value = [];
  14932. highlightedIndex.value = -1;
  14933. }
  14934. activated.value = true;
  14935. debouncedGetData(String(props.modelValue));
  14936. }
  14937. };
  14938. const handleKeyEscape = (evt) => {
  14939. if (suggestionVisible.value) {
  14940. evt.preventDefault();
  14941. evt.stopPropagation();
  14942. close();
  14943. }
  14944. };
  14945. const close = () => {
  14946. activated.value = false;
  14947. };
  14948. const focus = () => {
  14949. inputRef.value?.focus();
  14950. };
  14951. const blur = () => {
  14952. inputRef.value?.blur();
  14953. };
  14954. const handleSelect = async (item) => {
  14955. emit(INPUT_EVENT, item[props.valueKey]);
  14956. emit(UPDATE_MODEL_EVENT, item[props.valueKey]);
  14957. emit("select", item);
  14958. suggestions.value = [];
  14959. highlightedIndex.value = -1;
  14960. };
  14961. const highlight = (index) => {
  14962. if (!suggestionVisible.value || loading.value) return;
  14963. if (index < 0) {
  14964. if (!props.loopNavigation) {
  14965. highlightedIndex.value = -1;
  14966. return;
  14967. }
  14968. index = suggestions.value.length - 1;
  14969. }
  14970. if (index >= suggestions.value.length) index = props.loopNavigation ? 0 : suggestions.value.length - 1;
  14971. const [suggestion, suggestionList] = getSuggestionContext();
  14972. const highlightItem = suggestionList[index];
  14973. const scrollTop = suggestion.scrollTop;
  14974. const { offsetTop, scrollHeight } = highlightItem;
  14975. if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) suggestion.scrollTop = offsetTop + scrollHeight - suggestion.clientHeight;
  14976. if (offsetTop < scrollTop) suggestion.scrollTop = offsetTop;
  14977. highlightedIndex.value = index;
  14978. inputRef.value?.ref?.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
  14979. };
  14980. const getSuggestionContext = () => {
  14981. const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`);
  14982. return [suggestion, suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`)];
  14983. };
  14984. const stopHandle = onClickOutside(listboxRef, (event) => {
  14985. if (popperRef.value?.isFocusInsideContent()) return;
  14986. const hadIgnoredFocus = ignoreFocusEvent;
  14987. ignoreFocusEvent = false;
  14988. if (!suggestionVisible.value) return;
  14989. if (hadIgnoredFocus) handleBlur(new FocusEvent("blur", event));
  14990. else close();
  14991. });
  14992. const handleKeydown = (e) => {
  14993. switch (getEventCode(e)) {
  14994. case EVENT_CODE.up:
  14995. e.preventDefault();
  14996. highlight(highlightedIndex.value - 1);
  14997. break;
  14998. case EVENT_CODE.down:
  14999. e.preventDefault();
  15000. highlight(highlightedIndex.value + 1);
  15001. break;
  15002. case EVENT_CODE.enter:
  15003. case EVENT_CODE.numpadEnter:
  15004. e.preventDefault();
  15005. handleKeyEnter();
  15006. break;
  15007. case EVENT_CODE.tab:
  15008. close();
  15009. break;
  15010. case EVENT_CODE.esc:
  15011. handleKeyEscape(e);
  15012. break;
  15013. case EVENT_CODE.home:
  15014. e.preventDefault();
  15015. highlight(0);
  15016. break;
  15017. case EVENT_CODE.end:
  15018. e.preventDefault();
  15019. highlight(suggestions.value.length - 1);
  15020. break;
  15021. case EVENT_CODE.pageUp:
  15022. e.preventDefault();
  15023. highlight(Math.max(0, highlightedIndex.value - 10));
  15024. break;
  15025. case EVENT_CODE.pageDown:
  15026. e.preventDefault();
  15027. highlight(Math.min(suggestions.value.length - 1, highlightedIndex.value + 10));
  15028. break;
  15029. }
  15030. };
  15031. (0, vue.onBeforeUnmount)(() => {
  15032. stopHandle?.();
  15033. });
  15034. (0, vue.onMounted)(() => {
  15035. const inputElement = inputRef.value?.ref;
  15036. if (!inputElement) return;
  15037. [
  15038. {
  15039. key: "role",
  15040. value: "textbox"
  15041. },
  15042. {
  15043. key: "aria-autocomplete",
  15044. value: "list"
  15045. },
  15046. {
  15047. key: "aria-controls",
  15048. value: listboxId.value
  15049. },
  15050. {
  15051. key: "aria-activedescendant",
  15052. value: `${listboxId.value}-item-${highlightedIndex.value}`
  15053. }
  15054. ].forEach(({ key, value }) => inputElement.setAttribute(key, value));
  15055. readonly = inputElement.hasAttribute("readonly");
  15056. });
  15057. __expose({
  15058. highlightedIndex,
  15059. activated,
  15060. loading,
  15061. inputRef,
  15062. popperRef,
  15063. suggestions,
  15064. handleSelect,
  15065. handleKeyEnter,
  15066. focus,
  15067. blur,
  15068. close,
  15069. highlight,
  15070. getData
  15071. });
  15072. return (_ctx, _cache) => {
  15073. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  15074. ref_key: "popperRef",
  15075. ref: popperRef,
  15076. visible: suggestionVisible.value,
  15077. placement: __props.placement,
  15078. "fallback-placements": ["bottom-start", "top-start"],
  15079. "popper-class": [(0, vue.unref)(ns).e("popper"), __props.popperClass],
  15080. "popper-style": __props.popperStyle,
  15081. teleported: __props.teleported,
  15082. "append-to": __props.appendTo,
  15083. "gpu-acceleration": false,
  15084. pure: "",
  15085. "manual-mode": "",
  15086. effect: "light",
  15087. trigger: "click",
  15088. transition: `${(0, vue.unref)(ns).namespace.value}-zoom-in-top`,
  15089. persistent: "",
  15090. role: "listbox",
  15091. onBeforeShow: onSuggestionShow,
  15092. onHide
  15093. }, {
  15094. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  15095. ref_key: "regionRef",
  15096. ref: regionRef,
  15097. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("suggestion"), (0, vue.unref)(ns).is("loading", suggestionLoading.value)]),
  15098. style: (0, vue.normalizeStyle)({
  15099. [__props.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
  15100. outline: "none"
  15101. }),
  15102. role: "region"
  15103. }, [
  15104. _ctx.$slots.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  15105. key: 0,
  15106. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("suggestion", "header")),
  15107. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  15108. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  15109. (0, vue.createVNode)((0, vue.unref)(ElScrollbar), {
  15110. id: (0, vue.unref)(listboxId),
  15111. tag: "ul",
  15112. "wrap-class": (0, vue.unref)(ns).be("suggestion", "wrap"),
  15113. "view-class": (0, vue.unref)(ns).be("suggestion", "list"),
  15114. role: "listbox"
  15115. }, {
  15116. default: (0, vue.withCtx)(() => [suggestionLoading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", _hoisted_2$41, [(0, vue.renderSlot)(_ctx.$slots, "loading", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(ns).is("loading")) }, {
  15117. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(loading_default))]),
  15118. _: 1
  15119. }, 8, ["class"])])])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(suggestions.value, (item, index) => {
  15120. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  15121. id: `${(0, vue.unref)(listboxId)}-item-${index}`,
  15122. key: index,
  15123. class: (0, vue.normalizeClass)({ highlighted: highlightedIndex.value === index }),
  15124. role: "option",
  15125. "aria-selected": highlightedIndex.value === index,
  15126. onClick: ($event) => handleSelect(item)
  15127. }, [(0, vue.renderSlot)(_ctx.$slots, "default", { item }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(item[__props.valueKey]), 1)])], 10, _hoisted_3$18);
  15128. }), 128))]),
  15129. _: 3
  15130. }, 8, [
  15131. "id",
  15132. "wrap-class",
  15133. "view-class"
  15134. ]),
  15135. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  15136. key: 1,
  15137. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("suggestion", "footer")),
  15138. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["stop"]))
  15139. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  15140. ], 6)]),
  15141. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  15142. ref_key: "listboxRef",
  15143. ref: listboxRef,
  15144. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), _ctx.$attrs.class]),
  15145. style: (0, vue.normalizeStyle)(styles.value),
  15146. role: "combobox",
  15147. "aria-haspopup": "listbox",
  15148. "aria-expanded": suggestionVisible.value,
  15149. "aria-owns": (0, vue.unref)(listboxId)
  15150. }, [(0, vue.createVNode)((0, vue.unref)(ElInput), (0, vue.mergeProps)({
  15151. ref_key: "inputRef",
  15152. ref: inputRef
  15153. }, (0, vue.mergeProps)(passInputProps.value, _ctx.$attrs), {
  15154. "model-value": __props.modelValue,
  15155. disabled: (0, vue.unref)(disabled),
  15156. onInput: handleInput,
  15157. onChange: handleChange,
  15158. onFocus: handleFocus,
  15159. onBlur: handleBlur,
  15160. onClear: handleClear,
  15161. onKeydown: handleKeydown,
  15162. onMousedown: handleMouseDown
  15163. }), (0, vue.createSlots)({ _: 2 }, [
  15164. _ctx.$slots.prepend ? {
  15165. name: "prepend",
  15166. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "prepend")]),
  15167. key: "0"
  15168. } : void 0,
  15169. _ctx.$slots.append ? {
  15170. name: "append",
  15171. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "append")]),
  15172. key: "1"
  15173. } : void 0,
  15174. _ctx.$slots.prefix ? {
  15175. name: "prefix",
  15176. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "prefix")]),
  15177. key: "2"
  15178. } : void 0,
  15179. _ctx.$slots.suffix ? {
  15180. name: "suffix",
  15181. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "suffix")]),
  15182. key: "3"
  15183. } : void 0
  15184. ]), 1040, ["model-value", "disabled"])], 14, _hoisted_1$74)]),
  15185. _: 3
  15186. }, 8, [
  15187. "visible",
  15188. "placement",
  15189. "popper-class",
  15190. "popper-style",
  15191. "teleported",
  15192. "append-to",
  15193. "transition"
  15194. ]);
  15195. };
  15196. }
  15197. });
  15198. //#endregion
  15199. //#region ../../packages/components/autocomplete/src/autocomplete.vue
  15200. var autocomplete_default = autocomplete_vue_vue_type_script_setup_true_lang_default;
  15201. //#endregion
  15202. //#region ../../packages/components/autocomplete/index.ts
  15203. const ElAutocomplete = withInstall(autocomplete_default);
  15204. //#endregion
  15205. //#region ../../packages/components/avatar/src/avatar.ts
  15206. /**
  15207. * @deprecated Removed after 3.0.0, Use `AvatarProps` instead.
  15208. */
  15209. const avatarProps = buildProps({
  15210. size: {
  15211. type: [Number, String],
  15212. values: componentSizes,
  15213. validator: (val) => isNumber(val)
  15214. },
  15215. shape: {
  15216. type: String,
  15217. values: ["circle", "square"]
  15218. },
  15219. icon: { type: iconPropType },
  15220. src: {
  15221. type: String,
  15222. default: ""
  15223. },
  15224. alt: String,
  15225. srcSet: String,
  15226. fit: {
  15227. type: definePropType(String),
  15228. default: "cover"
  15229. }
  15230. });
  15231. const avatarEmits = { error: (evt) => evt instanceof Event };
  15232. //#endregion
  15233. //#region ../../packages/components/avatar/src/constants.ts
  15234. const avatarGroupContextKey = Symbol("avatarGroupContextKey");
  15235. //#endregion
  15236. //#region ../../packages/components/avatar/src/avatar.vue?vue&type=script&setup=true&lang.ts
  15237. const _hoisted_1$73 = [
  15238. "src",
  15239. "alt",
  15240. "srcset"
  15241. ];
  15242. var avatar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15243. name: "ElAvatar",
  15244. __name: "avatar",
  15245. props: avatarProps,
  15246. emits: avatarEmits,
  15247. setup(__props, { emit: __emit }) {
  15248. const props = __props;
  15249. const emit = __emit;
  15250. const avatarGroupContext = (0, vue.inject)(avatarGroupContextKey, void 0);
  15251. const ns = useNamespace("avatar");
  15252. const hasLoadError = (0, vue.ref)(false);
  15253. const size = (0, vue.computed)(() => props.size ?? avatarGroupContext?.size);
  15254. const shape = (0, vue.computed)(() => props.shape ?? avatarGroupContext?.shape ?? "circle");
  15255. const avatarClass = (0, vue.computed)(() => {
  15256. const { icon } = props;
  15257. const classList = [ns.b()];
  15258. if (isString(size.value)) classList.push(ns.m(size.value));
  15259. if (icon) classList.push(ns.m("icon"));
  15260. if (shape.value) classList.push(ns.m(shape.value));
  15261. return classList;
  15262. });
  15263. const sizeStyle = (0, vue.computed)(() => {
  15264. return isNumber(size.value) ? ns.cssVarBlock({ size: addUnit(size.value) }) : void 0;
  15265. });
  15266. const fitStyle = (0, vue.computed)(() => ({ objectFit: props.fit }));
  15267. (0, vue.watch)(() => [props.src, props.srcSet], () => hasLoadError.value = false);
  15268. function handleError(e) {
  15269. hasLoadError.value = true;
  15270. emit("error", e);
  15271. }
  15272. return (_ctx, _cache) => {
  15273. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  15274. class: (0, vue.normalizeClass)(avatarClass.value),
  15275. style: (0, vue.normalizeStyle)(sizeStyle.value)
  15276. }, [(__props.src || __props.srcSet) && !hasLoadError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
  15277. key: 0,
  15278. src: __props.src,
  15279. alt: __props.alt,
  15280. srcset: __props.srcSet,
  15281. style: (0, vue.normalizeStyle)(fitStyle.value),
  15282. onError: handleError
  15283. }, null, 44, _hoisted_1$73)) : __props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 1 }, {
  15284. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  15285. _: 1
  15286. })) : (0, vue.renderSlot)(_ctx.$slots, "default", { key: 2 })], 6);
  15287. };
  15288. }
  15289. });
  15290. //#endregion
  15291. //#region ../../packages/components/avatar/src/avatar.vue
  15292. var avatar_default = avatar_vue_vue_type_script_setup_true_lang_default;
  15293. //#endregion
  15294. //#region ../../packages/components/avatar/src/avatar-group-props.ts
  15295. const avatarGroupProps = {
  15296. size: {
  15297. type: definePropType([Number, String]),
  15298. values: componentSizes,
  15299. validator: (val) => isNumber(val)
  15300. },
  15301. shape: {
  15302. type: definePropType(String),
  15303. values: ["circle", "square"]
  15304. },
  15305. collapseAvatars: Boolean,
  15306. collapseAvatarsTooltip: Boolean,
  15307. maxCollapseAvatars: {
  15308. type: Number,
  15309. default: 1
  15310. },
  15311. effect: {
  15312. type: definePropType(String),
  15313. default: "light"
  15314. },
  15315. placement: {
  15316. type: definePropType(String),
  15317. values: Ee,
  15318. default: "top"
  15319. },
  15320. popperClass: useTooltipContentProps.popperClass,
  15321. popperStyle: useTooltipContentProps.popperStyle,
  15322. collapseClass: String,
  15323. collapseStyle: { type: definePropType([
  15324. String,
  15325. Array,
  15326. Object
  15327. ]) }
  15328. };
  15329. //#endregion
  15330. //#region ../../packages/components/avatar/src/avatar-group.tsx
  15331. var avatar_group_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15332. name: "ElAvatarGroup",
  15333. props: avatarGroupProps,
  15334. setup(props, { slots }) {
  15335. const ns = useNamespace("avatar-group");
  15336. (0, vue.provide)(avatarGroupContextKey, (0, vue.reactive)({
  15337. size: (0, vue.toRef)(props, "size"),
  15338. shape: (0, vue.toRef)(props, "shape")
  15339. }));
  15340. return () => {
  15341. const avatars = flattedChildren(slots.default?.() ?? []);
  15342. let visibleAvatars = avatars;
  15343. if (props.collapseAvatars && avatars.length > props.maxCollapseAvatars) {
  15344. visibleAvatars = avatars.slice(0, props.maxCollapseAvatars);
  15345. const hiddenAvatars = avatars.slice(props.maxCollapseAvatars);
  15346. visibleAvatars.push((0, vue.createVNode)(ElTooltip, {
  15347. "popperClass": props.popperClass,
  15348. "popperStyle": props.popperStyle,
  15349. "placement": props.placement,
  15350. "effect": props.effect,
  15351. "disabled": !props.collapseAvatarsTooltip
  15352. }, {
  15353. default: () => (0, vue.createVNode)(avatar_default, {
  15354. "size": props.size,
  15355. "shape": props.shape,
  15356. "class": props.collapseClass,
  15357. "style": props.collapseStyle
  15358. }, { default: () => [(0, vue.createTextVNode)("+ "), hiddenAvatars.length] }),
  15359. content: () => (0, vue.createVNode)("div", { "class": ns.e("collapse-avatars") }, [hiddenAvatars.map((node, idx) => (0, vue.isVNode)(node) ? (0, vue.cloneVNode)(node, { key: node.key ?? idx }) : node)])
  15360. }));
  15361. }
  15362. return (0, vue.createVNode)("div", { "class": ns.b() }, [visibleAvatars]);
  15363. };
  15364. }
  15365. });
  15366. //#endregion
  15367. //#region ../../packages/components/avatar/index.ts
  15368. const ElAvatar = withInstall(avatar_default, { AvatarGroup: avatar_group_default });
  15369. const ElAvatarGroup = withNoopInstall(avatar_group_default);
  15370. //#endregion
  15371. //#region ../../packages/components/backtop/src/backtop.ts
  15372. /**
  15373. * @deprecated Removed after 3.0.0, Use `BacktopProps` instead.
  15374. */
  15375. const backtopProps = {
  15376. visibilityHeight: {
  15377. type: Number,
  15378. default: 200
  15379. },
  15380. target: {
  15381. type: String,
  15382. default: ""
  15383. },
  15384. right: {
  15385. type: Number,
  15386. default: 40
  15387. },
  15388. bottom: {
  15389. type: Number,
  15390. default: 40
  15391. }
  15392. };
  15393. const backtopEmits = { click: (evt) => evt instanceof MouseEvent };
  15394. //#endregion
  15395. //#region ../../packages/components/backtop/src/use-backtop.ts
  15396. const useBackTop = (props, emit, componentName) => {
  15397. const el = (0, vue.shallowRef)();
  15398. const container = (0, vue.shallowRef)();
  15399. const visible = (0, vue.ref)(false);
  15400. const handleScroll = () => {
  15401. if (el.value) visible.value = el.value.scrollTop >= props.visibilityHeight;
  15402. };
  15403. const handleClick = (event) => {
  15404. el.value?.scrollTo({
  15405. top: 0,
  15406. behavior: "smooth"
  15407. });
  15408. emit("click", event);
  15409. };
  15410. useEventListener(container, "scroll", useThrottleFn(handleScroll, 300, true));
  15411. (0, vue.onMounted)(() => {
  15412. container.value = document;
  15413. el.value = document.documentElement;
  15414. if (props.target) {
  15415. el.value = document.querySelector(props.target) ?? void 0;
  15416. if (!el.value) throwError(componentName, `target does not exist: ${props.target}`);
  15417. container.value = el.value;
  15418. }
  15419. handleScroll();
  15420. });
  15421. return {
  15422. visible,
  15423. handleClick
  15424. };
  15425. };
  15426. //#endregion
  15427. //#region ../../packages/components/backtop/src/backtop.vue?vue&type=script&setup=true&lang.ts
  15428. const COMPONENT_NAME$15 = "ElBacktop";
  15429. var backtop_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15430. name: COMPONENT_NAME$15,
  15431. __name: "backtop",
  15432. props: backtopProps,
  15433. emits: backtopEmits,
  15434. setup(__props, { emit: __emit }) {
  15435. const props = __props;
  15436. const emit = __emit;
  15437. const ns = useNamespace("backtop");
  15438. const { handleClick, visible } = useBackTop(props, emit, COMPONENT_NAME$15);
  15439. const backTopStyle = (0, vue.computed)(() => ({
  15440. right: `${props.right}px`,
  15441. bottom: `${props.bottom}px`
  15442. }));
  15443. return (_ctx, _cache) => {
  15444. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, { name: `${(0, vue.unref)(ns).namespace.value}-fade-in` }, {
  15445. default: (0, vue.withCtx)(() => [(0, vue.unref)(visible) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  15446. key: 0,
  15447. style: (0, vue.normalizeStyle)(backTopStyle.value),
  15448. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  15449. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)((...args) => (0, vue.unref)(handleClick) && (0, vue.unref)(handleClick)(...args), ["stop"]))
  15450. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon")) }, {
  15451. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(caret_top_default))]),
  15452. _: 1
  15453. }, 8, ["class"])])], 6)) : (0, vue.createCommentVNode)("v-if", true)]),
  15454. _: 3
  15455. }, 8, ["name"]);
  15456. };
  15457. }
  15458. });
  15459. //#endregion
  15460. //#region ../../packages/components/backtop/src/backtop.vue
  15461. var backtop_default = backtop_vue_vue_type_script_setup_true_lang_default;
  15462. //#endregion
  15463. //#region ../../packages/components/backtop/index.ts
  15464. const ElBacktop = withInstall(backtop_default);
  15465. //#endregion
  15466. //#region ../../packages/components/badge/src/badge.ts
  15467. /**
  15468. * @deprecated Removed after 3.0.0, Use `BadgeProps` instead.
  15469. */
  15470. const badgeProps = buildProps({
  15471. value: {
  15472. type: [String, Number],
  15473. default: ""
  15474. },
  15475. max: {
  15476. type: Number,
  15477. default: 99
  15478. },
  15479. isDot: Boolean,
  15480. hidden: Boolean,
  15481. type: {
  15482. type: String,
  15483. values: [
  15484. "primary",
  15485. "success",
  15486. "warning",
  15487. "info",
  15488. "danger"
  15489. ],
  15490. default: "danger"
  15491. },
  15492. showZero: {
  15493. type: Boolean,
  15494. default: true
  15495. },
  15496. color: String,
  15497. badgeStyle: { type: definePropType([
  15498. String,
  15499. Object,
  15500. Array
  15501. ]) },
  15502. offset: {
  15503. type: definePropType(Array),
  15504. default: () => [0, 0]
  15505. },
  15506. badgeClass: { type: String }
  15507. });
  15508. //#endregion
  15509. //#region ../../packages/components/badge/src/badge.vue?vue&type=script&setup=true&lang.ts
  15510. var badge_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15511. name: "ElBadge",
  15512. __name: "badge",
  15513. props: badgeProps,
  15514. setup(__props, { expose: __expose }) {
  15515. const props = __props;
  15516. const ns = useNamespace("badge");
  15517. const content = (0, vue.computed)(() => {
  15518. if (props.isDot) return "";
  15519. if (isNumber(props.value) && isNumber(props.max)) return props.max < props.value ? `${props.max}+` : `${props.value}`;
  15520. return `${props.value}`;
  15521. });
  15522. const style = (0, vue.computed)(() => {
  15523. return [{
  15524. backgroundColor: props.color,
  15525. marginRight: addUnit(-props.offset[0]),
  15526. marginTop: addUnit(props.offset[1])
  15527. }, props.badgeStyle ?? {}];
  15528. });
  15529. __expose({ content });
  15530. return (_ctx, _cache) => {
  15531. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)(vue.Transition, { name: `${(0, vue.unref)(ns).namespace.value}-zoom-in-center` }, {
  15532. default: (0, vue.withCtx)(() => [!__props.hidden && (content.value || __props.isDot || _ctx.$slots.content) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("sup", {
  15533. key: 0,
  15534. class: (0, vue.normalizeClass)([
  15535. (0, vue.unref)(ns).e("content"),
  15536. (0, vue.unref)(ns).em("content", __props.type),
  15537. (0, vue.unref)(ns).is("fixed", !!_ctx.$slots.default),
  15538. (0, vue.unref)(ns).is("dot", __props.isDot),
  15539. (0, vue.unref)(ns).is("hide-zero", !__props.showZero && __props.value === 0),
  15540. __props.badgeClass
  15541. ]),
  15542. style: (0, vue.normalizeStyle)(style.value)
  15543. }, [(0, vue.renderSlot)(_ctx.$slots, "content", { value: content.value }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(content.value), 1)])], 6)) : (0, vue.createCommentVNode)("v-if", true)]),
  15544. _: 3
  15545. }, 8, ["name"])], 2);
  15546. };
  15547. }
  15548. });
  15549. //#endregion
  15550. //#region ../../packages/components/badge/src/badge.vue
  15551. var badge_default = badge_vue_vue_type_script_setup_true_lang_default;
  15552. //#endregion
  15553. //#region ../../packages/components/badge/index.ts
  15554. const ElBadge = withInstall(badge_default);
  15555. //#endregion
  15556. //#region ../../packages/components/breadcrumb/src/breadcrumb.ts
  15557. /**
  15558. * @deprecated Removed after 3.0.0, Use `BreadcrumbProps` instead.
  15559. */
  15560. const breadcrumbProps = buildProps({
  15561. separator: {
  15562. type: String,
  15563. default: "/"
  15564. },
  15565. separatorIcon: { type: iconPropType }
  15566. });
  15567. //#endregion
  15568. //#region ../../packages/components/breadcrumb/src/constants.ts
  15569. const breadcrumbKey = Symbol("breadcrumbKey");
  15570. //#endregion
  15571. //#region ../../packages/components/breadcrumb/src/breadcrumb.vue?vue&type=script&setup=true&lang.ts
  15572. const _hoisted_1$72 = ["aria-label"];
  15573. var breadcrumb_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15574. name: "ElBreadcrumb",
  15575. __name: "breadcrumb",
  15576. props: breadcrumbProps,
  15577. setup(__props) {
  15578. const { t } = useLocale();
  15579. const props = __props;
  15580. const ns = useNamespace("breadcrumb");
  15581. const breadcrumb = (0, vue.ref)();
  15582. (0, vue.provide)(breadcrumbKey, props);
  15583. (0, vue.onMounted)(() => {
  15584. const items = breadcrumb.value.querySelectorAll(`.${ns.e("item")}`);
  15585. if (items.length) items[items.length - 1].setAttribute("aria-current", "page");
  15586. });
  15587. return (_ctx, _cache) => {
  15588. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  15589. ref_key: "breadcrumb",
  15590. ref: breadcrumb,
  15591. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  15592. "aria-label": (0, vue.unref)(t)("el.breadcrumb.label"),
  15593. role: "navigation"
  15594. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 10, _hoisted_1$72);
  15595. };
  15596. }
  15597. });
  15598. //#endregion
  15599. //#region ../../packages/components/breadcrumb/src/breadcrumb.vue
  15600. var breadcrumb_default = breadcrumb_vue_vue_type_script_setup_true_lang_default;
  15601. //#endregion
  15602. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.ts
  15603. /**
  15604. * @deprecated Removed after 3.0.0, Use `BreadcrumbItemProps` instead.
  15605. */
  15606. const breadcrumbItemProps = buildProps({
  15607. to: {
  15608. type: definePropType([String, Object]),
  15609. default: ""
  15610. },
  15611. replace: Boolean
  15612. });
  15613. //#endregion
  15614. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.vue?vue&type=script&setup=true&lang.ts
  15615. var breadcrumb_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  15616. name: "ElBreadcrumbItem",
  15617. __name: "breadcrumb-item",
  15618. props: breadcrumbItemProps,
  15619. setup(__props) {
  15620. const props = __props;
  15621. const instance = (0, vue.getCurrentInstance)();
  15622. const breadcrumbContext = (0, vue.inject)(breadcrumbKey, void 0);
  15623. const ns = useNamespace("breadcrumb");
  15624. const router = instance.appContext.config.globalProperties.$router;
  15625. const onClick = () => {
  15626. if (!props.to || !router) return;
  15627. props.replace ? router.replace(props.to) : router.push(props.to);
  15628. };
  15629. return (_ctx, _cache) => {
  15630. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item")) }, [(0, vue.createElementVNode)("span", {
  15631. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("inner"), (0, vue.unref)(ns).is("link", !!__props.to)]),
  15632. role: "link",
  15633. onClick
  15634. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2), (0, vue.unref)(breadcrumbContext)?.separatorIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  15635. key: 0,
  15636. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("separator"))
  15637. }, {
  15638. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(breadcrumbContext).separatorIcon)))]),
  15639. _: 1
  15640. }, 8, ["class"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  15641. key: 1,
  15642. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("separator")),
  15643. role: "presentation"
  15644. }, (0, vue.toDisplayString)((0, vue.unref)(breadcrumbContext)?.separator), 3))], 2);
  15645. };
  15646. }
  15647. });
  15648. //#endregion
  15649. //#region ../../packages/components/breadcrumb/src/breadcrumb-item.vue
  15650. var breadcrumb_item_default = breadcrumb_item_vue_vue_type_script_setup_true_lang_default;
  15651. //#endregion
  15652. //#region ../../packages/components/breadcrumb/index.ts
  15653. const ElBreadcrumb = withInstall(breadcrumb_default, { BreadcrumbItem: breadcrumb_item_default });
  15654. const ElBreadcrumbItem = withNoopInstall(breadcrumb_item_default);
  15655. //#endregion
  15656. //#region ../../packages/components/button/src/button.ts
  15657. const buttonTypes = [
  15658. "default",
  15659. "primary",
  15660. "success",
  15661. "warning",
  15662. "info",
  15663. "danger",
  15664. "text",
  15665. ""
  15666. ];
  15667. const buttonNativeTypes = [
  15668. "button",
  15669. "submit",
  15670. "reset"
  15671. ];
  15672. /**
  15673. * @deprecated Removed after 3.0.0, Use `ButtonProps` instead.
  15674. */
  15675. const buttonProps = buildProps({
  15676. size: useSizeProp,
  15677. disabled: {
  15678. type: Boolean,
  15679. default: void 0
  15680. },
  15681. type: {
  15682. type: String,
  15683. values: buttonTypes,
  15684. default: ""
  15685. },
  15686. icon: { type: iconPropType },
  15687. nativeType: {
  15688. type: String,
  15689. values: buttonNativeTypes,
  15690. default: "button"
  15691. },
  15692. loading: Boolean,
  15693. loadingIcon: {
  15694. type: iconPropType,
  15695. default: () => loading_default
  15696. },
  15697. plain: {
  15698. type: Boolean,
  15699. default: void 0
  15700. },
  15701. text: {
  15702. type: Boolean,
  15703. default: void 0
  15704. },
  15705. link: Boolean,
  15706. bg: Boolean,
  15707. autofocus: Boolean,
  15708. round: {
  15709. type: Boolean,
  15710. default: void 0
  15711. },
  15712. circle: Boolean,
  15713. dashed: {
  15714. type: Boolean,
  15715. default: void 0
  15716. },
  15717. color: String,
  15718. dark: Boolean,
  15719. autoInsertSpace: {
  15720. type: Boolean,
  15721. default: void 0
  15722. },
  15723. tag: {
  15724. type: definePropType([String, Object]),
  15725. default: "button"
  15726. }
  15727. });
  15728. const buttonEmits = { click: (evt) => evt instanceof MouseEvent };
  15729. //#endregion
  15730. //#region ../../packages/components/button/src/constants.ts
  15731. const buttonGroupContextKey = Symbol("buttonGroupContextKey");
  15732. //#endregion
  15733. //#region ../../packages/components/button/src/use-button.ts
  15734. const useButton = (props, emit) => {
  15735. useDeprecated({
  15736. from: "type.text",
  15737. replacement: "link",
  15738. version: "3.0.0",
  15739. scope: "props",
  15740. ref: "https://element-plus.org/en-US/component/button.html#button-attributes"
  15741. }, (0, vue.computed)(() => props.type === "text"));
  15742. const buttonGroupContext = (0, vue.inject)(buttonGroupContextKey, void 0);
  15743. const globalConfig = useGlobalConfig("button");
  15744. const { form } = useFormItem();
  15745. const _size = useFormSize((0, vue.computed)(() => buttonGroupContext?.size));
  15746. const _disabled = useFormDisabled();
  15747. const _ref = (0, vue.ref)();
  15748. const slots = (0, vue.useSlots)();
  15749. const _type = (0, vue.computed)(() => props.type || buttonGroupContext?.type || globalConfig.value?.type || "");
  15750. const autoInsertSpace = (0, vue.computed)(() => props.autoInsertSpace ?? globalConfig.value?.autoInsertSpace ?? false);
  15751. const _plain = (0, vue.computed)(() => props.plain ?? globalConfig.value?.plain ?? false);
  15752. const _round = (0, vue.computed)(() => props.round ?? globalConfig.value?.round ?? false);
  15753. const _text = (0, vue.computed)(() => props.text ?? globalConfig.value?.text ?? false);
  15754. const _dashed = (0, vue.computed)(() => props.dashed ?? globalConfig.value?.dashed ?? false);
  15755. const _props = (0, vue.computed)(() => {
  15756. if (props.tag === "button") return {
  15757. ariaDisabled: _disabled.value || props.loading,
  15758. disabled: _disabled.value || props.loading,
  15759. autofocus: props.autofocus,
  15760. type: props.nativeType
  15761. };
  15762. return {};
  15763. });
  15764. const shouldAddSpace = (0, vue.computed)(() => {
  15765. const defaultSlot = slots.default?.();
  15766. if (autoInsertSpace.value && defaultSlot?.length === 1) {
  15767. const slot = defaultSlot[0];
  15768. if (slot?.type === vue.Text) {
  15769. const text = slot.children;
  15770. return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
  15771. }
  15772. }
  15773. return false;
  15774. });
  15775. const handleClick = (evt) => {
  15776. if (_disabled.value || props.loading) {
  15777. evt.stopPropagation();
  15778. return;
  15779. }
  15780. if (props.nativeType === "reset") form?.resetFields();
  15781. emit("click", evt);
  15782. };
  15783. return {
  15784. _disabled,
  15785. _size,
  15786. _type,
  15787. _ref,
  15788. _props,
  15789. _plain,
  15790. _round,
  15791. _text,
  15792. _dashed,
  15793. shouldAddSpace,
  15794. handleClick
  15795. };
  15796. };
  15797. //#endregion
  15798. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/util.js
  15799. /**
  15800. * Take input from [0, n] and return it as [0, 1]
  15801. * @hidden
  15802. */
  15803. function bound01(n, max) {
  15804. if (isOnePointZero(n)) n = "100%";
  15805. var isPercent = isPercentage(n);
  15806. n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
  15807. if (isPercent) n = parseInt(String(n * max), 10) / 100;
  15808. if (Math.abs(n - max) < 1e-6) return 1;
  15809. if (max === 360) n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
  15810. else n = n % max / parseFloat(String(max));
  15811. return n;
  15812. }
  15813. /**
  15814. * Force a number between 0 and 1
  15815. * @hidden
  15816. */
  15817. function clamp01(val) {
  15818. return Math.min(1, Math.max(0, val));
  15819. }
  15820. /**
  15821. * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
  15822. * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
  15823. * @hidden
  15824. */
  15825. function isOnePointZero(n) {
  15826. return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
  15827. }
  15828. /**
  15829. * Check to see if string passed in is a percentage
  15830. * @hidden
  15831. */
  15832. function isPercentage(n) {
  15833. return typeof n === "string" && n.indexOf("%") !== -1;
  15834. }
  15835. /**
  15836. * Return a valid alpha value [0,1] with all invalid values being set to 1
  15837. * @hidden
  15838. */
  15839. function boundAlpha(a) {
  15840. a = parseFloat(a);
  15841. if (isNaN(a) || a < 0 || a > 1) a = 1;
  15842. return a;
  15843. }
  15844. /**
  15845. * Replace a decimal with it's percentage value
  15846. * @hidden
  15847. */
  15848. function convertToPercentage(n) {
  15849. if (n <= 1) return "".concat(Number(n) * 100, "%");
  15850. return n;
  15851. }
  15852. /**
  15853. * Force a hex value to have 2 characters
  15854. * @hidden
  15855. */
  15856. function pad2(c) {
  15857. return c.length === 1 ? "0" + c : String(c);
  15858. }
  15859. //#endregion
  15860. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/conversion.js
  15861. /**
  15862. * Handle bounds / percentage checking to conform to CSS color spec
  15863. * <http://www.w3.org/TR/css3-color/>
  15864. * *Assumes:* r, g, b in [0, 255] or [0, 1]
  15865. * *Returns:* { r, g, b } in [0, 255]
  15866. */
  15867. function rgbToRgb(r, g, b) {
  15868. return {
  15869. r: bound01(r, 255) * 255,
  15870. g: bound01(g, 255) * 255,
  15871. b: bound01(b, 255) * 255
  15872. };
  15873. }
  15874. /**
  15875. * Converts an RGB color value to HSL.
  15876. * *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
  15877. * *Returns:* { h, s, l } in [0,1]
  15878. */
  15879. function rgbToHsl(r, g, b) {
  15880. r = bound01(r, 255);
  15881. g = bound01(g, 255);
  15882. b = bound01(b, 255);
  15883. var max = Math.max(r, g, b);
  15884. var min = Math.min(r, g, b);
  15885. var h = 0;
  15886. var s = 0;
  15887. var l = (max + min) / 2;
  15888. if (max === min) {
  15889. s = 0;
  15890. h = 0;
  15891. } else {
  15892. var d = max - min;
  15893. s = l > .5 ? d / (2 - max - min) : d / (max + min);
  15894. switch (max) {
  15895. case r:
  15896. h = (g - b) / d + (g < b ? 6 : 0);
  15897. break;
  15898. case g:
  15899. h = (b - r) / d + 2;
  15900. break;
  15901. case b:
  15902. h = (r - g) / d + 4;
  15903. break;
  15904. default: break;
  15905. }
  15906. h /= 6;
  15907. }
  15908. return {
  15909. h,
  15910. s,
  15911. l
  15912. };
  15913. }
  15914. function hue2rgb(p, q, t) {
  15915. if (t < 0) t += 1;
  15916. if (t > 1) t -= 1;
  15917. if (t < 1 / 6) return p + (q - p) * (6 * t);
  15918. if (t < 1 / 2) return q;
  15919. if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;
  15920. return p;
  15921. }
  15922. /**
  15923. * Converts an HSL color value to RGB.
  15924. *
  15925. * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
  15926. * *Returns:* { r, g, b } in the set [0, 255]
  15927. */
  15928. function hslToRgb(h, s, l) {
  15929. var r;
  15930. var g;
  15931. var b;
  15932. h = bound01(h, 360);
  15933. s = bound01(s, 100);
  15934. l = bound01(l, 100);
  15935. if (s === 0) {
  15936. g = l;
  15937. b = l;
  15938. r = l;
  15939. } else {
  15940. var q = l < .5 ? l * (1 + s) : l + s - l * s;
  15941. var p = 2 * l - q;
  15942. r = hue2rgb(p, q, h + 1 / 3);
  15943. g = hue2rgb(p, q, h);
  15944. b = hue2rgb(p, q, h - 1 / 3);
  15945. }
  15946. return {
  15947. r: r * 255,
  15948. g: g * 255,
  15949. b: b * 255
  15950. };
  15951. }
  15952. /**
  15953. * Converts an RGB color value to HSV
  15954. *
  15955. * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
  15956. * *Returns:* { h, s, v } in [0,1]
  15957. */
  15958. function rgbToHsv(r, g, b) {
  15959. r = bound01(r, 255);
  15960. g = bound01(g, 255);
  15961. b = bound01(b, 255);
  15962. var max = Math.max(r, g, b);
  15963. var min = Math.min(r, g, b);
  15964. var h = 0;
  15965. var v = max;
  15966. var d = max - min;
  15967. var s = max === 0 ? 0 : d / max;
  15968. if (max === min) h = 0;
  15969. else {
  15970. switch (max) {
  15971. case r:
  15972. h = (g - b) / d + (g < b ? 6 : 0);
  15973. break;
  15974. case g:
  15975. h = (b - r) / d + 2;
  15976. break;
  15977. case b:
  15978. h = (r - g) / d + 4;
  15979. break;
  15980. default: break;
  15981. }
  15982. h /= 6;
  15983. }
  15984. return {
  15985. h,
  15986. s,
  15987. v
  15988. };
  15989. }
  15990. /**
  15991. * Converts an HSV color value to RGB.
  15992. *
  15993. * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
  15994. * *Returns:* { r, g, b } in the set [0, 255]
  15995. */
  15996. function hsvToRgb(h, s, v) {
  15997. h = bound01(h, 360) * 6;
  15998. s = bound01(s, 100);
  15999. v = bound01(v, 100);
  16000. var i = Math.floor(h);
  16001. var f = h - i;
  16002. var p = v * (1 - s);
  16003. var q = v * (1 - f * s);
  16004. var t = v * (1 - (1 - f) * s);
  16005. var mod = i % 6;
  16006. var r = [
  16007. v,
  16008. q,
  16009. p,
  16010. p,
  16011. t,
  16012. v
  16013. ][mod];
  16014. var g = [
  16015. t,
  16016. v,
  16017. v,
  16018. q,
  16019. p,
  16020. p
  16021. ][mod];
  16022. var b = [
  16023. p,
  16024. p,
  16025. t,
  16026. v,
  16027. v,
  16028. q
  16029. ][mod];
  16030. return {
  16031. r: r * 255,
  16032. g: g * 255,
  16033. b: b * 255
  16034. };
  16035. }
  16036. /**
  16037. * Converts an RGB color to hex
  16038. *
  16039. * Assumes r, g, and b are contained in the set [0, 255]
  16040. * Returns a 3 or 6 character hex
  16041. */
  16042. function rgbToHex(r, g, b, allow3Char) {
  16043. var hex = [
  16044. pad2(Math.round(r).toString(16)),
  16045. pad2(Math.round(g).toString(16)),
  16046. pad2(Math.round(b).toString(16))
  16047. ];
  16048. if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
  16049. return hex.join("");
  16050. }
  16051. /**
  16052. * Converts an RGBA color plus alpha transparency to hex
  16053. *
  16054. * Assumes r, g, b are contained in the set [0, 255] and
  16055. * a in [0, 1]. Returns a 4 or 8 character rgba hex
  16056. */
  16057. function rgbaToHex(r, g, b, a, allow4Char) {
  16058. var hex = [
  16059. pad2(Math.round(r).toString(16)),
  16060. pad2(Math.round(g).toString(16)),
  16061. pad2(Math.round(b).toString(16)),
  16062. pad2(convertDecimalToHex(a))
  16063. ];
  16064. 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))) return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
  16065. return hex.join("");
  16066. }
  16067. /** Converts a decimal to a hex value */
  16068. function convertDecimalToHex(d) {
  16069. return Math.round(parseFloat(d) * 255).toString(16);
  16070. }
  16071. /** Converts a hex value to a decimal */
  16072. function convertHexToDecimal(h) {
  16073. return parseIntFromHex(h) / 255;
  16074. }
  16075. /** Parse a base-16 hex value into a base-10 integer */
  16076. function parseIntFromHex(val) {
  16077. return parseInt(val, 16);
  16078. }
  16079. function numberInputToObject(color) {
  16080. return {
  16081. r: color >> 16,
  16082. g: (color & 65280) >> 8,
  16083. b: color & 255
  16084. };
  16085. }
  16086. //#endregion
  16087. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js
  16088. /**
  16089. * @hidden
  16090. */
  16091. var names = {
  16092. aliceblue: "#f0f8ff",
  16093. antiquewhite: "#faebd7",
  16094. aqua: "#00ffff",
  16095. aquamarine: "#7fffd4",
  16096. azure: "#f0ffff",
  16097. beige: "#f5f5dc",
  16098. bisque: "#ffe4c4",
  16099. black: "#000000",
  16100. blanchedalmond: "#ffebcd",
  16101. blue: "#0000ff",
  16102. blueviolet: "#8a2be2",
  16103. brown: "#a52a2a",
  16104. burlywood: "#deb887",
  16105. cadetblue: "#5f9ea0",
  16106. chartreuse: "#7fff00",
  16107. chocolate: "#d2691e",
  16108. coral: "#ff7f50",
  16109. cornflowerblue: "#6495ed",
  16110. cornsilk: "#fff8dc",
  16111. crimson: "#dc143c",
  16112. cyan: "#00ffff",
  16113. darkblue: "#00008b",
  16114. darkcyan: "#008b8b",
  16115. darkgoldenrod: "#b8860b",
  16116. darkgray: "#a9a9a9",
  16117. darkgreen: "#006400",
  16118. darkgrey: "#a9a9a9",
  16119. darkkhaki: "#bdb76b",
  16120. darkmagenta: "#8b008b",
  16121. darkolivegreen: "#556b2f",
  16122. darkorange: "#ff8c00",
  16123. darkorchid: "#9932cc",
  16124. darkred: "#8b0000",
  16125. darksalmon: "#e9967a",
  16126. darkseagreen: "#8fbc8f",
  16127. darkslateblue: "#483d8b",
  16128. darkslategray: "#2f4f4f",
  16129. darkslategrey: "#2f4f4f",
  16130. darkturquoise: "#00ced1",
  16131. darkviolet: "#9400d3",
  16132. deeppink: "#ff1493",
  16133. deepskyblue: "#00bfff",
  16134. dimgray: "#696969",
  16135. dimgrey: "#696969",
  16136. dodgerblue: "#1e90ff",
  16137. firebrick: "#b22222",
  16138. floralwhite: "#fffaf0",
  16139. forestgreen: "#228b22",
  16140. fuchsia: "#ff00ff",
  16141. gainsboro: "#dcdcdc",
  16142. ghostwhite: "#f8f8ff",
  16143. goldenrod: "#daa520",
  16144. gold: "#ffd700",
  16145. gray: "#808080",
  16146. green: "#008000",
  16147. greenyellow: "#adff2f",
  16148. grey: "#808080",
  16149. honeydew: "#f0fff0",
  16150. hotpink: "#ff69b4",
  16151. indianred: "#cd5c5c",
  16152. indigo: "#4b0082",
  16153. ivory: "#fffff0",
  16154. khaki: "#f0e68c",
  16155. lavenderblush: "#fff0f5",
  16156. lavender: "#e6e6fa",
  16157. lawngreen: "#7cfc00",
  16158. lemonchiffon: "#fffacd",
  16159. lightblue: "#add8e6",
  16160. lightcoral: "#f08080",
  16161. lightcyan: "#e0ffff",
  16162. lightgoldenrodyellow: "#fafad2",
  16163. lightgray: "#d3d3d3",
  16164. lightgreen: "#90ee90",
  16165. lightgrey: "#d3d3d3",
  16166. lightpink: "#ffb6c1",
  16167. lightsalmon: "#ffa07a",
  16168. lightseagreen: "#20b2aa",
  16169. lightskyblue: "#87cefa",
  16170. lightslategray: "#778899",
  16171. lightslategrey: "#778899",
  16172. lightsteelblue: "#b0c4de",
  16173. lightyellow: "#ffffe0",
  16174. lime: "#00ff00",
  16175. limegreen: "#32cd32",
  16176. linen: "#faf0e6",
  16177. magenta: "#ff00ff",
  16178. maroon: "#800000",
  16179. mediumaquamarine: "#66cdaa",
  16180. mediumblue: "#0000cd",
  16181. mediumorchid: "#ba55d3",
  16182. mediumpurple: "#9370db",
  16183. mediumseagreen: "#3cb371",
  16184. mediumslateblue: "#7b68ee",
  16185. mediumspringgreen: "#00fa9a",
  16186. mediumturquoise: "#48d1cc",
  16187. mediumvioletred: "#c71585",
  16188. midnightblue: "#191970",
  16189. mintcream: "#f5fffa",
  16190. mistyrose: "#ffe4e1",
  16191. moccasin: "#ffe4b5",
  16192. navajowhite: "#ffdead",
  16193. navy: "#000080",
  16194. oldlace: "#fdf5e6",
  16195. olive: "#808000",
  16196. olivedrab: "#6b8e23",
  16197. orange: "#ffa500",
  16198. orangered: "#ff4500",
  16199. orchid: "#da70d6",
  16200. palegoldenrod: "#eee8aa",
  16201. palegreen: "#98fb98",
  16202. paleturquoise: "#afeeee",
  16203. palevioletred: "#db7093",
  16204. papayawhip: "#ffefd5",
  16205. peachpuff: "#ffdab9",
  16206. peru: "#cd853f",
  16207. pink: "#ffc0cb",
  16208. plum: "#dda0dd",
  16209. powderblue: "#b0e0e6",
  16210. purple: "#800080",
  16211. rebeccapurple: "#663399",
  16212. red: "#ff0000",
  16213. rosybrown: "#bc8f8f",
  16214. royalblue: "#4169e1",
  16215. saddlebrown: "#8b4513",
  16216. salmon: "#fa8072",
  16217. sandybrown: "#f4a460",
  16218. seagreen: "#2e8b57",
  16219. seashell: "#fff5ee",
  16220. sienna: "#a0522d",
  16221. silver: "#c0c0c0",
  16222. skyblue: "#87ceeb",
  16223. slateblue: "#6a5acd",
  16224. slategray: "#708090",
  16225. slategrey: "#708090",
  16226. snow: "#fffafa",
  16227. springgreen: "#00ff7f",
  16228. steelblue: "#4682b4",
  16229. tan: "#d2b48c",
  16230. teal: "#008080",
  16231. thistle: "#d8bfd8",
  16232. tomato: "#ff6347",
  16233. turquoise: "#40e0d0",
  16234. violet: "#ee82ee",
  16235. wheat: "#f5deb3",
  16236. white: "#ffffff",
  16237. whitesmoke: "#f5f5f5",
  16238. yellow: "#ffff00",
  16239. yellowgreen: "#9acd32"
  16240. };
  16241. //#endregion
  16242. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/format-input.js
  16243. /**
  16244. * Given a string or object, convert that input to RGB
  16245. *
  16246. * Possible string inputs:
  16247. * ```
  16248. * "red"
  16249. * "#f00" or "f00"
  16250. * "#ff0000" or "ff0000"
  16251. * "#ff000000" or "ff000000"
  16252. * "rgb 255 0 0" or "rgb (255, 0, 0)"
  16253. * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
  16254. * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
  16255. * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
  16256. * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
  16257. * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
  16258. * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
  16259. * ```
  16260. */
  16261. function inputToRGB(color) {
  16262. var rgb = {
  16263. r: 0,
  16264. g: 0,
  16265. b: 0
  16266. };
  16267. var a = 1;
  16268. var s = null;
  16269. var v = null;
  16270. var l = null;
  16271. var ok = false;
  16272. var format = false;
  16273. if (typeof color === "string") color = stringInputToObject(color);
  16274. if (typeof color === "object") {
  16275. if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
  16276. rgb = rgbToRgb(color.r, color.g, color.b);
  16277. ok = true;
  16278. format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
  16279. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
  16280. s = convertToPercentage(color.s);
  16281. v = convertToPercentage(color.v);
  16282. rgb = hsvToRgb(color.h, s, v);
  16283. ok = true;
  16284. format = "hsv";
  16285. } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
  16286. s = convertToPercentage(color.s);
  16287. l = convertToPercentage(color.l);
  16288. rgb = hslToRgb(color.h, s, l);
  16289. ok = true;
  16290. format = "hsl";
  16291. }
  16292. if (Object.prototype.hasOwnProperty.call(color, "a")) a = color.a;
  16293. }
  16294. a = boundAlpha(a);
  16295. return {
  16296. ok,
  16297. format: color.format || format,
  16298. r: Math.min(255, Math.max(rgb.r, 0)),
  16299. g: Math.min(255, Math.max(rgb.g, 0)),
  16300. b: Math.min(255, Math.max(rgb.b, 0)),
  16301. a
  16302. };
  16303. }
  16304. var CSS_UNIT = "(?:".concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:").concat("[-\\+]?\\d+%?", ")");
  16305. var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  16306. var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
  16307. var matchers = {
  16308. CSS_UNIT: new RegExp(CSS_UNIT),
  16309. rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
  16310. rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
  16311. hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
  16312. hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
  16313. hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
  16314. hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
  16315. hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  16316. hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
  16317. hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
  16318. hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
  16319. };
  16320. /**
  16321. * Permissive string parsing. Take in a number of formats, and output an object
  16322. * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
  16323. */
  16324. function stringInputToObject(color) {
  16325. color = color.trim().toLowerCase();
  16326. if (color.length === 0) return false;
  16327. var named = false;
  16328. if (names[color]) {
  16329. color = names[color];
  16330. named = true;
  16331. } else if (color === "transparent") return {
  16332. r: 0,
  16333. g: 0,
  16334. b: 0,
  16335. a: 0,
  16336. format: "name"
  16337. };
  16338. var match = matchers.rgb.exec(color);
  16339. if (match) return {
  16340. r: match[1],
  16341. g: match[2],
  16342. b: match[3]
  16343. };
  16344. match = matchers.rgba.exec(color);
  16345. if (match) return {
  16346. r: match[1],
  16347. g: match[2],
  16348. b: match[3],
  16349. a: match[4]
  16350. };
  16351. match = matchers.hsl.exec(color);
  16352. if (match) return {
  16353. h: match[1],
  16354. s: match[2],
  16355. l: match[3]
  16356. };
  16357. match = matchers.hsla.exec(color);
  16358. if (match) return {
  16359. h: match[1],
  16360. s: match[2],
  16361. l: match[3],
  16362. a: match[4]
  16363. };
  16364. match = matchers.hsv.exec(color);
  16365. if (match) return {
  16366. h: match[1],
  16367. s: match[2],
  16368. v: match[3]
  16369. };
  16370. match = matchers.hsva.exec(color);
  16371. if (match) return {
  16372. h: match[1],
  16373. s: match[2],
  16374. v: match[3],
  16375. a: match[4]
  16376. };
  16377. match = matchers.hex8.exec(color);
  16378. if (match) return {
  16379. r: parseIntFromHex(match[1]),
  16380. g: parseIntFromHex(match[2]),
  16381. b: parseIntFromHex(match[3]),
  16382. a: convertHexToDecimal(match[4]),
  16383. format: named ? "name" : "hex8"
  16384. };
  16385. match = matchers.hex6.exec(color);
  16386. if (match) return {
  16387. r: parseIntFromHex(match[1]),
  16388. g: parseIntFromHex(match[2]),
  16389. b: parseIntFromHex(match[3]),
  16390. format: named ? "name" : "hex"
  16391. };
  16392. match = matchers.hex4.exec(color);
  16393. if (match) return {
  16394. r: parseIntFromHex(match[1] + match[1]),
  16395. g: parseIntFromHex(match[2] + match[2]),
  16396. b: parseIntFromHex(match[3] + match[3]),
  16397. a: convertHexToDecimal(match[4] + match[4]),
  16398. format: named ? "name" : "hex8"
  16399. };
  16400. match = matchers.hex3.exec(color);
  16401. if (match) return {
  16402. r: parseIntFromHex(match[1] + match[1]),
  16403. g: parseIntFromHex(match[2] + match[2]),
  16404. b: parseIntFromHex(match[3] + match[3]),
  16405. format: named ? "name" : "hex"
  16406. };
  16407. return false;
  16408. }
  16409. /**
  16410. * Check to see if it looks like a CSS unit
  16411. * (see `matchers` above for definition).
  16412. */
  16413. function isValidCSSUnit(color) {
  16414. return Boolean(matchers.CSS_UNIT.exec(String(color)));
  16415. }
  16416. //#endregion
  16417. //#region ../../node_modules/.pnpm/@ctrl+tinycolor@3.6.1/node_modules/@ctrl/tinycolor/dist/module/index.js
  16418. var TinyColor = function() {
  16419. function TinyColor(color, opts) {
  16420. if (color === void 0) color = "";
  16421. if (opts === void 0) opts = {};
  16422. var _a;
  16423. if (color instanceof TinyColor) return color;
  16424. if (typeof color === "number") color = numberInputToObject(color);
  16425. this.originalInput = color;
  16426. var rgb = inputToRGB(color);
  16427. this.originalInput = color;
  16428. this.r = rgb.r;
  16429. this.g = rgb.g;
  16430. this.b = rgb.b;
  16431. this.a = rgb.a;
  16432. this.roundA = Math.round(100 * this.a) / 100;
  16433. this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
  16434. this.gradientType = opts.gradientType;
  16435. if (this.r < 1) this.r = Math.round(this.r);
  16436. if (this.g < 1) this.g = Math.round(this.g);
  16437. if (this.b < 1) this.b = Math.round(this.b);
  16438. this.isValid = rgb.ok;
  16439. }
  16440. TinyColor.prototype.isDark = function() {
  16441. return this.getBrightness() < 128;
  16442. };
  16443. TinyColor.prototype.isLight = function() {
  16444. return !this.isDark();
  16445. };
  16446. /**
  16447. * Returns the perceived brightness of the color, from 0-255.
  16448. */
  16449. TinyColor.prototype.getBrightness = function() {
  16450. var rgb = this.toRgb();
  16451. return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
  16452. };
  16453. /**
  16454. * Returns the perceived luminance of a color, from 0-1.
  16455. */
  16456. TinyColor.prototype.getLuminance = function() {
  16457. var rgb = this.toRgb();
  16458. var R;
  16459. var G;
  16460. var B;
  16461. var RsRGB = rgb.r / 255;
  16462. var GsRGB = rgb.g / 255;
  16463. var BsRGB = rgb.b / 255;
  16464. if (RsRGB <= .03928) R = RsRGB / 12.92;
  16465. else R = Math.pow((RsRGB + .055) / 1.055, 2.4);
  16466. if (GsRGB <= .03928) G = GsRGB / 12.92;
  16467. else G = Math.pow((GsRGB + .055) / 1.055, 2.4);
  16468. if (BsRGB <= .03928) B = BsRGB / 12.92;
  16469. else B = Math.pow((BsRGB + .055) / 1.055, 2.4);
  16470. return .2126 * R + .7152 * G + .0722 * B;
  16471. };
  16472. /**
  16473. * Returns the alpha value of a color, from 0-1.
  16474. */
  16475. TinyColor.prototype.getAlpha = function() {
  16476. return this.a;
  16477. };
  16478. /**
  16479. * Sets the alpha value on the current color.
  16480. *
  16481. * @param alpha - The new alpha value. The accepted range is 0-1.
  16482. */
  16483. TinyColor.prototype.setAlpha = function(alpha) {
  16484. this.a = boundAlpha(alpha);
  16485. this.roundA = Math.round(100 * this.a) / 100;
  16486. return this;
  16487. };
  16488. /**
  16489. * Returns whether the color is monochrome.
  16490. */
  16491. TinyColor.prototype.isMonochrome = function() {
  16492. return this.toHsl().s === 0;
  16493. };
  16494. /**
  16495. * Returns the object as a HSVA object.
  16496. */
  16497. TinyColor.prototype.toHsv = function() {
  16498. var hsv = rgbToHsv(this.r, this.g, this.b);
  16499. return {
  16500. h: hsv.h * 360,
  16501. s: hsv.s,
  16502. v: hsv.v,
  16503. a: this.a
  16504. };
  16505. };
  16506. /**
  16507. * Returns the hsva values interpolated into a string with the following format:
  16508. * "hsva(xxx, xxx, xxx, xx)".
  16509. */
  16510. TinyColor.prototype.toHsvString = function() {
  16511. var hsv = rgbToHsv(this.r, this.g, this.b);
  16512. var h = Math.round(hsv.h * 360);
  16513. var s = Math.round(hsv.s * 100);
  16514. var v = Math.round(hsv.v * 100);
  16515. return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
  16516. };
  16517. /**
  16518. * Returns the object as a HSLA object.
  16519. */
  16520. TinyColor.prototype.toHsl = function() {
  16521. var hsl = rgbToHsl(this.r, this.g, this.b);
  16522. return {
  16523. h: hsl.h * 360,
  16524. s: hsl.s,
  16525. l: hsl.l,
  16526. a: this.a
  16527. };
  16528. };
  16529. /**
  16530. * Returns the hsla values interpolated into a string with the following format:
  16531. * "hsla(xxx, xxx, xxx, xx)".
  16532. */
  16533. TinyColor.prototype.toHslString = function() {
  16534. var hsl = rgbToHsl(this.r, this.g, this.b);
  16535. var h = Math.round(hsl.h * 360);
  16536. var s = Math.round(hsl.s * 100);
  16537. var l = Math.round(hsl.l * 100);
  16538. return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
  16539. };
  16540. /**
  16541. * Returns the hex value of the color.
  16542. * @param allow3Char will shorten hex value to 3 char if possible
  16543. */
  16544. TinyColor.prototype.toHex = function(allow3Char) {
  16545. if (allow3Char === void 0) allow3Char = false;
  16546. return rgbToHex(this.r, this.g, this.b, allow3Char);
  16547. };
  16548. /**
  16549. * Returns the hex value of the color -with a # prefixed.
  16550. * @param allow3Char will shorten hex value to 3 char if possible
  16551. */
  16552. TinyColor.prototype.toHexString = function(allow3Char) {
  16553. if (allow3Char === void 0) allow3Char = false;
  16554. return "#" + this.toHex(allow3Char);
  16555. };
  16556. /**
  16557. * Returns the hex 8 value of the color.
  16558. * @param allow4Char will shorten hex value to 4 char if possible
  16559. */
  16560. TinyColor.prototype.toHex8 = function(allow4Char) {
  16561. if (allow4Char === void 0) allow4Char = false;
  16562. return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
  16563. };
  16564. /**
  16565. * Returns the hex 8 value of the color -with a # prefixed.
  16566. * @param allow4Char will shorten hex value to 4 char if possible
  16567. */
  16568. TinyColor.prototype.toHex8String = function(allow4Char) {
  16569. if (allow4Char === void 0) allow4Char = false;
  16570. return "#" + this.toHex8(allow4Char);
  16571. };
  16572. /**
  16573. * Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
  16574. * @param allowShortChar will shorten hex value to 3 or 4 char if possible
  16575. */
  16576. TinyColor.prototype.toHexShortString = function(allowShortChar) {
  16577. if (allowShortChar === void 0) allowShortChar = false;
  16578. return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
  16579. };
  16580. /**
  16581. * Returns the object as a RGBA object.
  16582. */
  16583. TinyColor.prototype.toRgb = function() {
  16584. return {
  16585. r: Math.round(this.r),
  16586. g: Math.round(this.g),
  16587. b: Math.round(this.b),
  16588. a: this.a
  16589. };
  16590. };
  16591. /**
  16592. * Returns the RGBA values interpolated into a string with the following format:
  16593. * "RGBA(xxx, xxx, xxx, xx)".
  16594. */
  16595. TinyColor.prototype.toRgbString = function() {
  16596. var r = Math.round(this.r);
  16597. var g = Math.round(this.g);
  16598. var b = Math.round(this.b);
  16599. return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
  16600. };
  16601. /**
  16602. * Returns the object as a RGBA object.
  16603. */
  16604. TinyColor.prototype.toPercentageRgb = function() {
  16605. var fmt = function(x) {
  16606. return "".concat(Math.round(bound01(x, 255) * 100), "%");
  16607. };
  16608. return {
  16609. r: fmt(this.r),
  16610. g: fmt(this.g),
  16611. b: fmt(this.b),
  16612. a: this.a
  16613. };
  16614. };
  16615. /**
  16616. * Returns the RGBA relative values interpolated into a string
  16617. */
  16618. TinyColor.prototype.toPercentageRgbString = function() {
  16619. var rnd = function(x) {
  16620. return Math.round(bound01(x, 255) * 100);
  16621. };
  16622. 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, ")");
  16623. };
  16624. /**
  16625. * The 'real' name of the color -if there is one.
  16626. */
  16627. TinyColor.prototype.toName = function() {
  16628. if (this.a === 0) return "transparent";
  16629. if (this.a < 1) return false;
  16630. var hex = "#" + rgbToHex(this.r, this.g, this.b, false);
  16631. for (var _i = 0, _a = Object.entries(names); _i < _a.length; _i++) {
  16632. var _b = _a[_i], key = _b[0];
  16633. if (hex === _b[1]) return key;
  16634. }
  16635. return false;
  16636. };
  16637. TinyColor.prototype.toString = function(format) {
  16638. var formatSet = Boolean(format);
  16639. format = format !== null && format !== void 0 ? format : this.format;
  16640. var formattedString = false;
  16641. var hasAlpha = this.a < 1 && this.a >= 0;
  16642. if (!formatSet && hasAlpha && (format.startsWith("hex") || format === "name")) {
  16643. if (format === "name" && this.a === 0) return this.toName();
  16644. return this.toRgbString();
  16645. }
  16646. if (format === "rgb") formattedString = this.toRgbString();
  16647. if (format === "prgb") formattedString = this.toPercentageRgbString();
  16648. if (format === "hex" || format === "hex6") formattedString = this.toHexString();
  16649. if (format === "hex3") formattedString = this.toHexString(true);
  16650. if (format === "hex4") formattedString = this.toHex8String(true);
  16651. if (format === "hex8") formattedString = this.toHex8String();
  16652. if (format === "name") formattedString = this.toName();
  16653. if (format === "hsl") formattedString = this.toHslString();
  16654. if (format === "hsv") formattedString = this.toHsvString();
  16655. return formattedString || this.toHexString();
  16656. };
  16657. TinyColor.prototype.toNumber = function() {
  16658. return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
  16659. };
  16660. TinyColor.prototype.clone = function() {
  16661. return new TinyColor(this.toString());
  16662. };
  16663. /**
  16664. * Lighten the color a given amount. Providing 100 will always return white.
  16665. * @param amount - valid between 1-100
  16666. */
  16667. TinyColor.prototype.lighten = function(amount) {
  16668. if (amount === void 0) amount = 10;
  16669. var hsl = this.toHsl();
  16670. hsl.l += amount / 100;
  16671. hsl.l = clamp01(hsl.l);
  16672. return new TinyColor(hsl);
  16673. };
  16674. /**
  16675. * Brighten the color a given amount, from 0 to 100.
  16676. * @param amount - valid between 1-100
  16677. */
  16678. TinyColor.prototype.brighten = function(amount) {
  16679. if (amount === void 0) amount = 10;
  16680. var rgb = this.toRgb();
  16681. rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
  16682. rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
  16683. rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
  16684. return new TinyColor(rgb);
  16685. };
  16686. /**
  16687. * Darken the color a given amount, from 0 to 100.
  16688. * Providing 100 will always return black.
  16689. * @param amount - valid between 1-100
  16690. */
  16691. TinyColor.prototype.darken = function(amount) {
  16692. if (amount === void 0) amount = 10;
  16693. var hsl = this.toHsl();
  16694. hsl.l -= amount / 100;
  16695. hsl.l = clamp01(hsl.l);
  16696. return new TinyColor(hsl);
  16697. };
  16698. /**
  16699. * Mix the color with pure white, from 0 to 100.
  16700. * Providing 0 will do nothing, providing 100 will always return white.
  16701. * @param amount - valid between 1-100
  16702. */
  16703. TinyColor.prototype.tint = function(amount) {
  16704. if (amount === void 0) amount = 10;
  16705. return this.mix("white", amount);
  16706. };
  16707. /**
  16708. * Mix the color with pure black, from 0 to 100.
  16709. * Providing 0 will do nothing, providing 100 will always return black.
  16710. * @param amount - valid between 1-100
  16711. */
  16712. TinyColor.prototype.shade = function(amount) {
  16713. if (amount === void 0) amount = 10;
  16714. return this.mix("black", amount);
  16715. };
  16716. /**
  16717. * Desaturate the color a given amount, from 0 to 100.
  16718. * Providing 100 will is the same as calling greyscale
  16719. * @param amount - valid between 1-100
  16720. */
  16721. TinyColor.prototype.desaturate = function(amount) {
  16722. if (amount === void 0) amount = 10;
  16723. var hsl = this.toHsl();
  16724. hsl.s -= amount / 100;
  16725. hsl.s = clamp01(hsl.s);
  16726. return new TinyColor(hsl);
  16727. };
  16728. /**
  16729. * Saturate the color a given amount, from 0 to 100.
  16730. * @param amount - valid between 1-100
  16731. */
  16732. TinyColor.prototype.saturate = function(amount) {
  16733. if (amount === void 0) amount = 10;
  16734. var hsl = this.toHsl();
  16735. hsl.s += amount / 100;
  16736. hsl.s = clamp01(hsl.s);
  16737. return new TinyColor(hsl);
  16738. };
  16739. /**
  16740. * Completely desaturates a color into greyscale.
  16741. * Same as calling `desaturate(100)`
  16742. */
  16743. TinyColor.prototype.greyscale = function() {
  16744. return this.desaturate(100);
  16745. };
  16746. /**
  16747. * Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
  16748. * Values outside of this range will be wrapped into this range.
  16749. */
  16750. TinyColor.prototype.spin = function(amount) {
  16751. var hsl = this.toHsl();
  16752. var hue = (hsl.h + amount) % 360;
  16753. hsl.h = hue < 0 ? 360 + hue : hue;
  16754. return new TinyColor(hsl);
  16755. };
  16756. /**
  16757. * Mix the current color a given amount with another color, from 0 to 100.
  16758. * 0 means no mixing (return current color).
  16759. */
  16760. TinyColor.prototype.mix = function(color, amount) {
  16761. if (amount === void 0) amount = 50;
  16762. var rgb1 = this.toRgb();
  16763. var rgb2 = new TinyColor(color).toRgb();
  16764. var p = amount / 100;
  16765. return new TinyColor({
  16766. r: (rgb2.r - rgb1.r) * p + rgb1.r,
  16767. g: (rgb2.g - rgb1.g) * p + rgb1.g,
  16768. b: (rgb2.b - rgb1.b) * p + rgb1.b,
  16769. a: (rgb2.a - rgb1.a) * p + rgb1.a
  16770. });
  16771. };
  16772. TinyColor.prototype.analogous = function(results, slices) {
  16773. if (results === void 0) results = 6;
  16774. if (slices === void 0) slices = 30;
  16775. var hsl = this.toHsl();
  16776. var part = 360 / slices;
  16777. var ret = [this];
  16778. for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {
  16779. hsl.h = (hsl.h + part) % 360;
  16780. ret.push(new TinyColor(hsl));
  16781. }
  16782. return ret;
  16783. };
  16784. /**
  16785. * taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
  16786. */
  16787. TinyColor.prototype.complement = function() {
  16788. var hsl = this.toHsl();
  16789. hsl.h = (hsl.h + 180) % 360;
  16790. return new TinyColor(hsl);
  16791. };
  16792. TinyColor.prototype.monochromatic = function(results) {
  16793. if (results === void 0) results = 6;
  16794. var hsv = this.toHsv();
  16795. var h = hsv.h;
  16796. var s = hsv.s;
  16797. var v = hsv.v;
  16798. var res = [];
  16799. var modification = 1 / results;
  16800. while (results--) {
  16801. res.push(new TinyColor({
  16802. h,
  16803. s,
  16804. v
  16805. }));
  16806. v = (v + modification) % 1;
  16807. }
  16808. return res;
  16809. };
  16810. TinyColor.prototype.splitcomplement = function() {
  16811. var hsl = this.toHsl();
  16812. var h = hsl.h;
  16813. return [
  16814. this,
  16815. new TinyColor({
  16816. h: (h + 72) % 360,
  16817. s: hsl.s,
  16818. l: hsl.l
  16819. }),
  16820. new TinyColor({
  16821. h: (h + 216) % 360,
  16822. s: hsl.s,
  16823. l: hsl.l
  16824. })
  16825. ];
  16826. };
  16827. /**
  16828. * Compute how the color would appear on a background
  16829. */
  16830. TinyColor.prototype.onBackground = function(background) {
  16831. var fg = this.toRgb();
  16832. var bg = new TinyColor(background).toRgb();
  16833. var alpha = fg.a + bg.a * (1 - fg.a);
  16834. return new TinyColor({
  16835. r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
  16836. g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
  16837. b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
  16838. a: alpha
  16839. });
  16840. };
  16841. /**
  16842. * Alias for `polyad(3)`
  16843. */
  16844. TinyColor.prototype.triad = function() {
  16845. return this.polyad(3);
  16846. };
  16847. /**
  16848. * Alias for `polyad(4)`
  16849. */
  16850. TinyColor.prototype.tetrad = function() {
  16851. return this.polyad(4);
  16852. };
  16853. /**
  16854. * Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
  16855. * monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
  16856. */
  16857. TinyColor.prototype.polyad = function(n) {
  16858. var hsl = this.toHsl();
  16859. var h = hsl.h;
  16860. var result = [this];
  16861. var increment = 360 / n;
  16862. for (var i = 1; i < n; i++) result.push(new TinyColor({
  16863. h: (h + i * increment) % 360,
  16864. s: hsl.s,
  16865. l: hsl.l
  16866. }));
  16867. return result;
  16868. };
  16869. /**
  16870. * compare color vs current color
  16871. */
  16872. TinyColor.prototype.equals = function(color) {
  16873. return this.toRgbString() === new TinyColor(color).toRgbString();
  16874. };
  16875. return TinyColor;
  16876. }();
  16877. //#endregion
  16878. //#region ../../packages/components/button/src/button-custom.ts
  16879. function darken(color, amount = 20) {
  16880. return color.mix("#141414", amount).toString();
  16881. }
  16882. function useButtonCustomStyle(props) {
  16883. const _disabled = useFormDisabled();
  16884. const ns = useNamespace("button");
  16885. return (0, vue.computed)(() => {
  16886. let styles = {};
  16887. let buttonColor = props.color;
  16888. if (buttonColor) {
  16889. const match = buttonColor.match(/var\((.*?)\)/);
  16890. if (match) buttonColor = window.getComputedStyle(window.document.documentElement).getPropertyValue(match[1]);
  16891. const color = new TinyColor(buttonColor);
  16892. const activeBgColor = props.dark ? color.tint(20).toString() : darken(color, 20);
  16893. if (props.plain) {
  16894. styles = ns.cssVarBlock({
  16895. "bg-color": props.dark ? darken(color, 90) : color.tint(90).toString(),
  16896. "text-color": buttonColor,
  16897. "border-color": props.dark ? darken(color, 50) : color.tint(50).toString(),
  16898. "hover-text-color": `var(${ns.cssVarName("color-white")})`,
  16899. "hover-bg-color": buttonColor,
  16900. "hover-border-color": buttonColor,
  16901. "active-bg-color": activeBgColor,
  16902. "active-text-color": `var(${ns.cssVarName("color-white")})`,
  16903. "active-border-color": activeBgColor
  16904. });
  16905. if (_disabled.value) {
  16906. styles[ns.cssVarBlockName("disabled-bg-color")] = props.dark ? darken(color, 90) : color.tint(90).toString();
  16907. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? darken(color, 50) : color.tint(50).toString();
  16908. styles[ns.cssVarBlockName("disabled-border-color")] = props.dark ? darken(color, 80) : color.tint(80).toString();
  16909. }
  16910. } else {
  16911. const hoverBgColor = props.dark ? darken(color, 30) : color.tint(30).toString();
  16912. const textColor = color.isDark() ? `var(${ns.cssVarName("color-white")})` : `var(${ns.cssVarName("color-black")})`;
  16913. styles = ns.cssVarBlock({
  16914. "bg-color": buttonColor,
  16915. "text-color": textColor,
  16916. "border-color": buttonColor,
  16917. "hover-bg-color": hoverBgColor,
  16918. "hover-text-color": textColor,
  16919. "hover-border-color": hoverBgColor,
  16920. "active-bg-color": activeBgColor,
  16921. "active-border-color": activeBgColor
  16922. });
  16923. if (_disabled.value) {
  16924. const disabledButtonColor = props.dark ? darken(color, 50) : color.tint(50).toString();
  16925. styles[ns.cssVarBlockName("disabled-bg-color")] = disabledButtonColor;
  16926. styles[ns.cssVarBlockName("disabled-text-color")] = props.dark ? "rgba(255, 255, 255, 0.5)" : `var(${ns.cssVarName("color-white")})`;
  16927. styles[ns.cssVarBlockName("disabled-border-color")] = disabledButtonColor;
  16928. }
  16929. }
  16930. }
  16931. return styles;
  16932. });
  16933. }
  16934. //#endregion
  16935. //#region ../../packages/components/button/src/button.vue?vue&type=script&setup=true&lang.ts
  16936. var button_vue_vue_type_script_setup_true_lang_default$1 = /* @__PURE__ */ (0, vue.defineComponent)({
  16937. name: "ElButton",
  16938. __name: "button",
  16939. props: buttonProps,
  16940. emits: buttonEmits,
  16941. setup(__props, { expose: __expose, emit: __emit }) {
  16942. const props = __props;
  16943. const emit = __emit;
  16944. const buttonStyle = useButtonCustomStyle(props);
  16945. const ns = useNamespace("button");
  16946. const { _ref, _size, _type, _disabled, _props, _plain, _round, _text, _dashed, shouldAddSpace, handleClick } = useButton(props, emit);
  16947. const buttonKls = (0, vue.computed)(() => [
  16948. ns.b(),
  16949. ns.m(_type.value),
  16950. ns.m(_size.value),
  16951. ns.is("disabled", _disabled.value),
  16952. ns.is("loading", props.loading),
  16953. ns.is("plain", _plain.value),
  16954. ns.is("round", _round.value),
  16955. ns.is("circle", props.circle),
  16956. ns.is("text", _text.value),
  16957. ns.is("dashed", _dashed.value),
  16958. ns.is("link", props.link),
  16959. ns.is("has-bg", props.bg)
  16960. ]);
  16961. __expose({
  16962. ref: _ref,
  16963. size: _size,
  16964. type: _type,
  16965. disabled: _disabled,
  16966. shouldAddSpace
  16967. });
  16968. return (_ctx, _cache) => {
  16969. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), (0, vue.mergeProps)({
  16970. ref_key: "_ref",
  16971. ref: _ref
  16972. }, (0, vue.unref)(_props), {
  16973. class: buttonKls.value,
  16974. style: (0, vue.unref)(buttonStyle),
  16975. onClick: (0, vue.unref)(handleClick)
  16976. }), {
  16977. default: (0, vue.withCtx)(() => [__props.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [_ctx.$slots.loading ? (0, vue.renderSlot)(_ctx.$slots, "loading", { key: 0 }) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  16978. key: 1,
  16979. class: (0, vue.normalizeClass)((0, vue.unref)(ns).is("loading"))
  16980. }, {
  16981. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.loadingIcon)))]),
  16982. _: 1
  16983. }, 8, ["class"]))], 64)) : __props.icon || _ctx.$slots.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 1 }, {
  16984. default: (0, vue.withCtx)(() => [__props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon), { key: 0 })) : (0, vue.renderSlot)(_ctx.$slots, "icon", { key: 1 })]),
  16985. _: 3
  16986. })) : (0, vue.createCommentVNode)("v-if", true), _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  16987. key: 2,
  16988. class: (0, vue.normalizeClass)({ [(0, vue.unref)(ns).em("text", "expand")]: (0, vue.unref)(shouldAddSpace) })
  16989. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true)]),
  16990. _: 3
  16991. }, 16, [
  16992. "class",
  16993. "style",
  16994. "onClick"
  16995. ]);
  16996. };
  16997. }
  16998. });
  16999. //#endregion
  17000. //#region ../../packages/components/button/src/button.vue
  17001. var button_default$1 = button_vue_vue_type_script_setup_true_lang_default$1;
  17002. //#endregion
  17003. //#region ../../packages/components/button/src/button-group.ts
  17004. /**
  17005. * @deprecated Removed after 3.0.0, Use `ButtonGroupProps` instead.
  17006. */
  17007. const buttonGroupProps = {
  17008. size: buttonProps.size,
  17009. type: buttonProps.type,
  17010. direction: {
  17011. type: definePropType(String),
  17012. values: ["horizontal", "vertical"],
  17013. default: "horizontal"
  17014. }
  17015. };
  17016. //#endregion
  17017. //#region ../../packages/components/button/src/button-group.vue?vue&type=script&setup=true&lang.ts
  17018. var button_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  17019. name: "ElButtonGroup",
  17020. __name: "button-group",
  17021. props: buttonGroupProps,
  17022. setup(__props) {
  17023. const props = __props;
  17024. (0, vue.provide)(buttonGroupContextKey, (0, vue.reactive)({
  17025. size: (0, vue.toRef)(props, "size"),
  17026. type: (0, vue.toRef)(props, "type")
  17027. }));
  17028. const ns = useNamespace("button");
  17029. return (_ctx, _cache) => {
  17030. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("group"), (0, vue.unref)(ns).bm("group", props.direction)]) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  17031. };
  17032. }
  17033. });
  17034. //#endregion
  17035. //#region ../../packages/components/button/src/button-group.vue
  17036. var button_group_default = button_group_vue_vue_type_script_setup_true_lang_default;
  17037. //#endregion
  17038. //#region ../../packages/components/button/index.ts
  17039. const ElButton = withInstall(button_default$1, { ButtonGroup: button_group_default });
  17040. const ElButtonGroup = withNoopInstall(button_group_default);
  17041. //#endregion
  17042. //#region ../../packages/components/calendar/src/calendar.ts
  17043. const isValidRange$1 = (range) => isArray$1(range) && range.length === 2 && range.every((item) => isDate(item));
  17044. /**
  17045. * @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
  17046. */
  17047. const calendarProps = buildProps({
  17048. modelValue: { type: Date },
  17049. range: {
  17050. type: definePropType(Array),
  17051. validator: isValidRange$1
  17052. },
  17053. controllerType: {
  17054. type: String,
  17055. values: ["button", "select"],
  17056. default: "button"
  17057. },
  17058. formatter: { type: definePropType(Function) }
  17059. });
  17060. const calendarEmits = {
  17061. [UPDATE_MODEL_EVENT]: (value) => isDate(value),
  17062. [INPUT_EVENT]: (value) => isDate(value)
  17063. };
  17064. //#endregion
  17065. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/dayjs.min.js
  17066. var require_dayjs_min = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  17067. (function(t, e) {
  17068. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
  17069. })(exports, (function() {
  17070. "use strict";
  17071. var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\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 = {
  17072. name: "en",
  17073. weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
  17074. months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
  17075. ordinal: function(t) {
  17076. var e = [
  17077. "th",
  17078. "st",
  17079. "nd",
  17080. "rd"
  17081. ], n = t % 100;
  17082. return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
  17083. }
  17084. }, m = function(t, e, n) {
  17085. var r = String(t);
  17086. return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
  17087. }, v = {
  17088. s: m,
  17089. z: function(t) {
  17090. var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60;
  17091. return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
  17092. },
  17093. m: function t(e, n) {
  17094. if (e.date() < n.date()) return -t(n, e);
  17095. var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, c), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), c);
  17096. return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
  17097. },
  17098. a: function(t) {
  17099. return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
  17100. },
  17101. p: function(t) {
  17102. return {
  17103. M: c,
  17104. y: h,
  17105. w: o,
  17106. d: a,
  17107. D: d,
  17108. h: u,
  17109. m: s,
  17110. s: i,
  17111. ms: r,
  17112. Q: f
  17113. }[t] || String(t || "").toLowerCase().replace(/s$/, "");
  17114. },
  17115. u: function(t) {
  17116. return void 0 === t;
  17117. }
  17118. }, g = "en", D = {};
  17119. D[g] = M;
  17120. var p = "$isDayjsObject", S = function(t) {
  17121. return t instanceof _ || !(!t || !t[p]);
  17122. }, w = function t(e, n, r) {
  17123. var i;
  17124. if (!e) return g;
  17125. if ("string" == typeof e) {
  17126. var s = e.toLowerCase();
  17127. D[s] && (i = s), n && (D[s] = n, i = s);
  17128. var u = e.split("-");
  17129. if (!i && u.length > 1) return t(u[0]);
  17130. } else {
  17131. var a = e.name;
  17132. D[a] = e, i = a;
  17133. }
  17134. return !r && i && (g = i), i || !r && g;
  17135. }, O = function(t, e) {
  17136. if (S(t)) return t.clone();
  17137. var n = "object" == typeof e ? e : {};
  17138. return n.date = t, n.args = arguments, new _(n);
  17139. }, b = v;
  17140. b.l = w, b.i = S, b.w = function(t, e) {
  17141. return O(t, {
  17142. locale: e.$L,
  17143. utc: e.$u,
  17144. x: e.$x,
  17145. $offset: e.$offset
  17146. });
  17147. };
  17148. var _ = function() {
  17149. function M(t) {
  17150. this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[p] = !0;
  17151. }
  17152. var m = M.prototype;
  17153. return m.parse = function(t) {
  17154. this.$d = function(t) {
  17155. var e = t.date, n = t.utc;
  17156. if (null === e) return /* @__PURE__ */ new Date(NaN);
  17157. if (b.u(e)) return /* @__PURE__ */ new Date();
  17158. if (e instanceof Date) return new Date(e);
  17159. if ("string" == typeof e && !/Z$/i.test(e)) {
  17160. var r = e.match($);
  17161. if (r) {
  17162. var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3);
  17163. return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
  17164. }
  17165. }
  17166. return new Date(e);
  17167. }(t), this.init();
  17168. }, m.init = function() {
  17169. var t = this.$d;
  17170. this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
  17171. }, m.$utils = function() {
  17172. return b;
  17173. }, m.isValid = function() {
  17174. return !(this.$d.toString() === l);
  17175. }, m.isSame = function(t, e) {
  17176. var n = O(t);
  17177. return this.startOf(e) <= n && n <= this.endOf(e);
  17178. }, m.isAfter = function(t, e) {
  17179. return O(t) < this.startOf(e);
  17180. }, m.isBefore = function(t, e) {
  17181. return this.endOf(e) < O(t);
  17182. }, m.$g = function(t, e, n) {
  17183. return b.u(t) ? this[e] : this.set(n, t);
  17184. }, m.unix = function() {
  17185. return Math.floor(this.valueOf() / 1e3);
  17186. }, m.valueOf = function() {
  17187. return this.$d.getTime();
  17188. }, m.startOf = function(t, e) {
  17189. var n = this, r = !!b.u(e) || e, f = b.p(t), l = function(t, e) {
  17190. var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
  17191. return r ? i : i.endOf(a);
  17192. }, $ = function(t, e) {
  17193. return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [
  17194. 0,
  17195. 0,
  17196. 0,
  17197. 0
  17198. ] : [
  17199. 23,
  17200. 59,
  17201. 59,
  17202. 999
  17203. ]).slice(e)), n);
  17204. }, y = this.$W, M = this.$M, m = this.$D, v = "set" + (this.$u ? "UTC" : "");
  17205. switch (f) {
  17206. case h: return r ? l(1, 0) : l(31, 11);
  17207. case c: return r ? l(1, M) : l(0, M + 1);
  17208. case o:
  17209. var g = this.$locale().weekStart || 0, D = (y < g ? y + 7 : y) - g;
  17210. return l(r ? m - D : m + (6 - D), M);
  17211. case a:
  17212. case d: return $(v + "Hours", 0);
  17213. case u: return $(v + "Minutes", 1);
  17214. case s: return $(v + "Seconds", 2);
  17215. case i: return $(v + "Milliseconds", 3);
  17216. default: return this.clone();
  17217. }
  17218. }, m.endOf = function(t) {
  17219. return this.startOf(t, !1);
  17220. }, m.$set = function(t, e) {
  17221. var n, o = b.p(t), f = "set" + (this.$u ? "UTC" : ""), l = (n = {}, n[a] = f + "Date", n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o], $ = o === a ? this.$D + (e - this.$W) : e;
  17222. if (o === c || o === h) {
  17223. var y = this.clone().set(d, 1);
  17224. y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
  17225. } else l && this.$d[l]($);
  17226. return this.init(), this;
  17227. }, m.set = function(t, e) {
  17228. return this.clone().$set(t, e);
  17229. }, m.get = function(t) {
  17230. return this[b.p(t)]();
  17231. }, m.add = function(r, f) {
  17232. var d, l = this;
  17233. r = Number(r);
  17234. var $ = b.p(f), y = function(t) {
  17235. var e = O(l);
  17236. return b.w(e.date(e.date() + Math.round(t * r)), l);
  17237. };
  17238. if ($ === c) return this.set(c, this.$M + r);
  17239. if ($ === h) return this.set(h, this.$y + r);
  17240. if ($ === a) return y(1);
  17241. if ($ === o) return y(7);
  17242. var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, m = this.$d.getTime() + r * M;
  17243. return b.w(m, this);
  17244. }, m.subtract = function(t, e) {
  17245. return this.add(-1 * t, e);
  17246. }, m.format = function(t) {
  17247. var e = this, n = this.$locale();
  17248. if (!this.isValid()) return n.invalidDate || l;
  17249. var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = b.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, c = n.months, f = n.meridiem, h = function(t, n, i, s) {
  17250. return t && (t[n] || t(e, r)) || i[n].slice(0, s);
  17251. }, d = function(t) {
  17252. return b.s(s % 12 || 12, t, "0");
  17253. }, $ = f || function(t, e, n) {
  17254. var r = t < 12 ? "AM" : "PM";
  17255. return n ? r.toLowerCase() : r;
  17256. };
  17257. return r.replace(y, (function(t, r) {
  17258. return r || function(t) {
  17259. switch (t) {
  17260. case "YY": return String(e.$y).slice(-2);
  17261. case "YYYY": return b.s(e.$y, 4, "0");
  17262. case "M": return a + 1;
  17263. case "MM": return b.s(a + 1, 2, "0");
  17264. case "MMM": return h(n.monthsShort, a, c, 3);
  17265. case "MMMM": return h(c, a);
  17266. case "D": return e.$D;
  17267. case "DD": return b.s(e.$D, 2, "0");
  17268. case "d": return String(e.$W);
  17269. case "dd": return h(n.weekdaysMin, e.$W, o, 2);
  17270. case "ddd": return h(n.weekdaysShort, e.$W, o, 3);
  17271. case "dddd": return o[e.$W];
  17272. case "H": return String(s);
  17273. case "HH": return b.s(s, 2, "0");
  17274. case "h": return d(1);
  17275. case "hh": return d(2);
  17276. case "a": return $(s, u, !0);
  17277. case "A": return $(s, u, !1);
  17278. case "m": return String(u);
  17279. case "mm": return b.s(u, 2, "0");
  17280. case "s": return String(e.$s);
  17281. case "ss": return b.s(e.$s, 2, "0");
  17282. case "SSS": return b.s(e.$ms, 3, "0");
  17283. case "Z": return i;
  17284. }
  17285. return null;
  17286. }(t) || i.replace(":", "");
  17287. }));
  17288. }, m.utcOffset = function() {
  17289. return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
  17290. }, m.diff = function(r, d, l) {
  17291. var $, y = this, M = b.p(d), m = O(r), v = (m.utcOffset() - this.utcOffset()) * e, g = this - m, D = function() {
  17292. return b.m(y, m);
  17293. };
  17294. switch (M) {
  17295. case h:
  17296. $ = D() / 12;
  17297. break;
  17298. case c:
  17299. $ = D();
  17300. break;
  17301. case f:
  17302. $ = D() / 3;
  17303. break;
  17304. case o:
  17305. $ = (g - v) / 6048e5;
  17306. break;
  17307. case a:
  17308. $ = (g - v) / 864e5;
  17309. break;
  17310. case u:
  17311. $ = g / n;
  17312. break;
  17313. case s:
  17314. $ = g / e;
  17315. break;
  17316. case i:
  17317. $ = g / t;
  17318. break;
  17319. default: $ = g;
  17320. }
  17321. return l ? $ : b.a($);
  17322. }, m.daysInMonth = function() {
  17323. return this.endOf(c).$D;
  17324. }, m.$locale = function() {
  17325. return D[this.$L];
  17326. }, m.locale = function(t, e) {
  17327. if (!t) return this.$L;
  17328. var n = this.clone(), r = w(t, e, !0);
  17329. return r && (n.$L = r), n;
  17330. }, m.clone = function() {
  17331. return b.w(this.$d, this);
  17332. }, m.toDate = function() {
  17333. return new Date(this.valueOf());
  17334. }, m.toJSON = function() {
  17335. return this.isValid() ? this.toISOString() : null;
  17336. }, m.toISOString = function() {
  17337. return this.$d.toISOString();
  17338. }, m.toString = function() {
  17339. return this.$d.toUTCString();
  17340. }, M;
  17341. }(), k = _.prototype;
  17342. return O.prototype = k, [
  17343. ["$ms", r],
  17344. ["$s", i],
  17345. ["$m", s],
  17346. ["$H", u],
  17347. ["$W", a],
  17348. ["$M", c],
  17349. ["$y", h],
  17350. ["$D", d]
  17351. ].forEach((function(t) {
  17352. k[t[1]] = function(e) {
  17353. return this.$g(e, t[0], t[1]);
  17354. };
  17355. })), O.extend = function(t, e) {
  17356. return t.$i || (t(e, _, O), t.$i = !0), O;
  17357. }, O.locale = w, O.isDayjs = S, O.unix = function(t) {
  17358. return O(1e3 * t);
  17359. }, O.en = D[g], O.Ls = D, O.p = {}, O;
  17360. }));
  17361. }));
  17362. //#endregion
  17363. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/customParseFormat.js
  17364. var require_customParseFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  17365. (function(e, t) {
  17366. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
  17367. })(exports, (function() {
  17368. "use strict";
  17369. var e = {
  17370. LTS: "h:mm:ss A",
  17371. LT: "h:mm A",
  17372. L: "MM/DD/YYYY",
  17373. LL: "MMMM D, YYYY",
  17374. LLL: "MMMM D, YYYY h:mm A",
  17375. LLLL: "dddd, MMMM D, YYYY h:mm A"
  17376. }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e) {
  17377. return (e = +e) + (e > 68 ? 1900 : 2e3);
  17378. };
  17379. var f = function(e) {
  17380. return function(t) {
  17381. this[e] = +t;
  17382. };
  17383. }, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e) {
  17384. (this.zone || (this.zone = {})).offset = function(e) {
  17385. if (!e) return 0;
  17386. if ("Z" === e) return 0;
  17387. var t = e.match(/([+-]|\d\d)/g), n = 60 * t[1] + (+t[2] || 0);
  17388. return 0 === n ? 0 : "+" === t[0] ? -n : n;
  17389. }(e);
  17390. }], u = function(e) {
  17391. var t = s[e];
  17392. return t && (t.indexOf ? t : t.s.concat(t.f));
  17393. }, d = function(e, t) {
  17394. var n, r = s.meridiem;
  17395. if (r) {
  17396. for (var i = 1; i <= 24; i += 1) if (e.indexOf(r(i, 0, t)) > -1) {
  17397. n = i > 12;
  17398. break;
  17399. }
  17400. } else n = e === (t ? "pm" : "PM");
  17401. return n;
  17402. }, c = {
  17403. A: [o, function(e) {
  17404. this.afternoon = d(e, !1);
  17405. }],
  17406. a: [o, function(e) {
  17407. this.afternoon = d(e, !0);
  17408. }],
  17409. Q: [n, function(e) {
  17410. this.month = 3 * (e - 1) + 1;
  17411. }],
  17412. S: [n, function(e) {
  17413. this.milliseconds = 100 * +e;
  17414. }],
  17415. SS: [r, function(e) {
  17416. this.milliseconds = 10 * +e;
  17417. }],
  17418. SSS: [/\d{3}/, function(e) {
  17419. this.milliseconds = +e;
  17420. }],
  17421. s: [i, f("seconds")],
  17422. ss: [i, f("seconds")],
  17423. m: [i, f("minutes")],
  17424. mm: [i, f("minutes")],
  17425. H: [i, f("hours")],
  17426. h: [i, f("hours")],
  17427. HH: [i, f("hours")],
  17428. hh: [i, f("hours")],
  17429. D: [i, f("day")],
  17430. DD: [r, f("day")],
  17431. Do: [o, function(e) {
  17432. var t = s.ordinal;
  17433. if (this.day = e.match(/\d+/)[0], t) for (var r = 1; r <= 31; r += 1) t(r).replace(/\[|\]/g, "") === e && (this.day = r);
  17434. }],
  17435. w: [i, f("week")],
  17436. ww: [r, f("week")],
  17437. M: [i, f("month")],
  17438. MM: [r, f("month")],
  17439. MMM: [o, function(e) {
  17440. var t = u("months"), n = (u("monthsShort") || t.map((function(e) {
  17441. return e.slice(0, 3);
  17442. }))).indexOf(e) + 1;
  17443. if (n < 1) throw new Error();
  17444. this.month = n % 12 || n;
  17445. }],
  17446. MMMM: [o, function(e) {
  17447. var t = u("months").indexOf(e) + 1;
  17448. if (t < 1) throw new Error();
  17449. this.month = t % 12 || t;
  17450. }],
  17451. Y: [/[+-]?\d+/, f("year")],
  17452. YY: [r, function(e) {
  17453. this.year = a(e);
  17454. }],
  17455. YYYY: [/\d{4}/, f("year")],
  17456. Z: h,
  17457. ZZ: h
  17458. };
  17459. function l(n) {
  17460. var r = n, i = s && s.formats;
  17461. for (var o = (n = r.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t, n, r) {
  17462. var o = r && r.toUpperCase();
  17463. return n || i[r] || e[r] || i[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e, t, n) {
  17464. return t || n.slice(1);
  17465. }));
  17466. }))).match(t), a = o.length, f = 0; f < a; f += 1) {
  17467. var h = o[f], u = c[h], d = u && u[0], l = u && u[1];
  17468. o[f] = l ? {
  17469. regex: d,
  17470. parser: l
  17471. } : h.replace(/^\[|\]$/g, "");
  17472. }
  17473. return function(e) {
  17474. for (var t = {}, n = 0, r = 0; n < a; n += 1) {
  17475. var i = o[n];
  17476. if ("string" == typeof i) r += i.length;
  17477. else {
  17478. var s = i.regex, f = i.parser, h = e.slice(r), u = s.exec(h)[0];
  17479. f.call(t, u), e = e.replace(u, "");
  17480. }
  17481. }
  17482. return function(e) {
  17483. var t = e.afternoon;
  17484. if (void 0 !== t) {
  17485. var n = e.hours;
  17486. t ? n < 12 && (e.hours += 12) : 12 === n && (e.hours = 0), delete e.afternoon;
  17487. }
  17488. }(t), t;
  17489. };
  17490. }
  17491. return function(e, t, n) {
  17492. n.p.customParseFormat = !0, e && e.parseTwoDigitYear && (a = e.parseTwoDigitYear);
  17493. var r = t.prototype, i = r.parse;
  17494. r.parse = function(e) {
  17495. var t = e.date, r = e.utc, o = e.args;
  17496. this.$u = r;
  17497. var a = o[1];
  17498. if ("string" == typeof a) {
  17499. var f = !0 === o[2], h = !0 === o[3], u = f || h, d = o[2];
  17500. h && (d = o[2]), s = this.$locale(), !f && d && (s = n.Ls[d]), this.$d = function(e, t, n, r) {
  17501. try {
  17502. if (["x", "X"].indexOf(t) > -1) return /* @__PURE__ */ new Date(("X" === t ? 1e3 : 1) * e);
  17503. var i = l(t)(e), o = i.year, s = i.month, a = i.day, f = i.hours, h = i.minutes, u = i.seconds, d = i.milliseconds, c = i.zone, m = i.week, M = /* @__PURE__ */ new Date(), Y = a || (o || s ? 1 : M.getDate()), p = o || M.getFullYear(), v = 0;
  17504. o && !s || (v = s > 0 ? s - 1 : M.getMonth());
  17505. var D, w = f || 0, g = h || 0, y = u || 0, L = d || 0;
  17506. return c ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c.offset * 1e3)) : n ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m && (D = r(D).week(m).toDate()), D);
  17507. } catch (e) {
  17508. return /* @__PURE__ */ new Date("");
  17509. }
  17510. }(t, a, r, n), this.init(), d && !0 !== d && (this.$L = this.locale(d).$L), u && t != this.format(a) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
  17511. } else if (a instanceof Array) for (var c = a.length, m = 1; m <= c; m += 1) {
  17512. o[1] = a[m - 1];
  17513. var M = n.apply(this, o);
  17514. if (M.isValid()) {
  17515. this.$d = M.$d, this.$L = M.$L, this.init();
  17516. break;
  17517. }
  17518. m === c && (this.$d = /* @__PURE__ */ new Date(""));
  17519. }
  17520. else i.call(this, e);
  17521. };
  17522. };
  17523. }));
  17524. }));
  17525. //#endregion
  17526. //#region ../../packages/components/time-picker/src/constants.ts
  17527. var import_customParseFormat = /* @__PURE__ */ __toESM(require_customParseFormat());
  17528. var import_dayjs_min = /* @__PURE__ */ __toESM(require_dayjs_min());
  17529. const timeUnits = [
  17530. "hours",
  17531. "minutes",
  17532. "seconds"
  17533. ];
  17534. const PICKER_BASE_INJECTION_KEY = "EP_PICKER_BASE";
  17535. const PICKER_POPPER_OPTIONS_INJECTION_KEY = "ElPopperOptions";
  17536. const ROOT_COMMON_PICKER_INJECTION_KEY = Symbol("commonPickerContextKey");
  17537. const DEFAULT_FORMATS_TIME = "HH:mm:ss";
  17538. const DEFAULT_FORMATS_DATE = "YYYY-MM-DD";
  17539. const DEFAULT_FORMATS_DATEPICKER = {
  17540. date: DEFAULT_FORMATS_DATE,
  17541. dates: DEFAULT_FORMATS_DATE,
  17542. week: "gggg[w]ww",
  17543. year: "YYYY",
  17544. years: "YYYY",
  17545. month: "YYYY-MM",
  17546. months: "YYYY-MM",
  17547. datetime: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`,
  17548. monthrange: "YYYY-MM",
  17549. yearrange: "YYYY",
  17550. daterange: DEFAULT_FORMATS_DATE,
  17551. datetimerange: `${DEFAULT_FORMATS_DATE} ${DEFAULT_FORMATS_TIME}`
  17552. };
  17553. //#endregion
  17554. //#region ../../packages/components/time-picker/src/utils.ts
  17555. const buildTimeList = (value, bound) => {
  17556. return [
  17557. value > 0 ? value - 1 : void 0,
  17558. value,
  17559. value < bound ? value + 1 : void 0
  17560. ];
  17561. };
  17562. const rangeArr = (n) => Array.from(Array.from({ length: n }).keys());
  17563. const extractDateFormat = (format) => {
  17564. return format.replace(/\W?m{1,2}|\W?ZZ/g, "").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi, "").trim();
  17565. };
  17566. const extractTimeFormat = (format) => {
  17567. return format.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?Y{2,4}/g, "").trim();
  17568. };
  17569. const dateEquals = function(a, b) {
  17570. const aIsDate = isDate(a);
  17571. const bIsDate = isDate(b);
  17572. if (aIsDate && bIsDate) return a.getTime() === b.getTime();
  17573. if (!aIsDate && !bIsDate) return a === b;
  17574. return false;
  17575. };
  17576. const valueEquals = function(a, b) {
  17577. const aIsArray = isArray$1(a);
  17578. const bIsArray = isArray$1(b);
  17579. if (aIsArray && bIsArray) {
  17580. if (a.length !== b.length) return false;
  17581. return a.every((item, index) => dateEquals(item, b[index]));
  17582. }
  17583. if (!aIsArray && !bIsArray) return dateEquals(a, b);
  17584. return false;
  17585. };
  17586. const parseDate = function(date, format, lang) {
  17587. const day = isEmpty(format) || format === "x" ? (0, import_dayjs_min.default)(date).locale(lang) : (0, import_dayjs_min.default)(date, format).locale(lang);
  17588. return day.isValid() ? day : void 0;
  17589. };
  17590. const formatter = function(date, format, lang) {
  17591. if (isEmpty(format)) return date;
  17592. if (format === "x") return +date;
  17593. return (0, import_dayjs_min.default)(date).locale(lang).format(format);
  17594. };
  17595. const makeList = (total, method) => {
  17596. const arr = [];
  17597. const disabledArr = method?.();
  17598. for (let i = 0; i < total; i++) arr.push(disabledArr?.includes(i) ?? false);
  17599. return arr;
  17600. };
  17601. const dayOrDaysToDate = (dayOrDays) => {
  17602. return isArray$1(dayOrDays) ? dayOrDays.map((d) => d.toDate()) : dayOrDays.toDate();
  17603. };
  17604. //#endregion
  17605. //#region ../../packages/components/time-picker/src/composables/use-common-picker.ts
  17606. const useCommonPicker = (props, emit) => {
  17607. const { lang } = useLocale();
  17608. const pickerVisible = (0, vue.ref)(false);
  17609. const pickerActualVisible = (0, vue.ref)(false);
  17610. const userInput = (0, vue.ref)(null);
  17611. const valueIsEmpty = (0, vue.computed)(() => {
  17612. const { modelValue } = props;
  17613. return !modelValue || isArray$1(modelValue) && !modelValue.filter(Boolean).length;
  17614. });
  17615. const emitInput = (input) => {
  17616. if (!valueEquals(props.modelValue, input)) {
  17617. let formatted;
  17618. if (isArray$1(input)) formatted = input.map((item) => formatter(item, props.valueFormat, lang.value));
  17619. else if (input) formatted = formatter(input, props.valueFormat, lang.value);
  17620. emit(UPDATE_MODEL_EVENT, input ? formatted : input, lang.value);
  17621. }
  17622. };
  17623. const parsedValue = (0, vue.computed)(() => {
  17624. let dayOrDays;
  17625. if (valueIsEmpty.value) {
  17626. if (pickerOptions.value.getDefaultValue) dayOrDays = pickerOptions.value.getDefaultValue();
  17627. } else if (isArray$1(props.modelValue)) dayOrDays = props.modelValue.map((d) => parseDate(d, props.valueFormat, lang.value));
  17628. else dayOrDays = parseDate(props.modelValue ?? "", props.valueFormat, lang.value);
  17629. if (pickerOptions.value.getRangeAvailableTime) {
  17630. const availableResult = pickerOptions.value.getRangeAvailableTime(dayOrDays);
  17631. if (!isEqual$1(availableResult, dayOrDays)) {
  17632. dayOrDays = availableResult;
  17633. if (!valueIsEmpty.value) emitInput(dayOrDaysToDate(dayOrDays));
  17634. }
  17635. }
  17636. if (isArray$1(dayOrDays) && dayOrDays.some((day) => !day)) dayOrDays = [];
  17637. return dayOrDays;
  17638. });
  17639. const pickerOptions = (0, vue.ref)({});
  17640. const onSetPickerOption = (e) => {
  17641. pickerOptions.value[e[0]] = e[1];
  17642. pickerOptions.value.panelReady = true;
  17643. };
  17644. const onCalendarChange = (e) => {
  17645. emit("calendar-change", e);
  17646. };
  17647. const onPanelChange = (value, mode, view) => {
  17648. emit("panel-change", value, mode, view);
  17649. };
  17650. const onPick = (date = "", visible = false) => {
  17651. pickerVisible.value = visible;
  17652. let result;
  17653. if (isArray$1(date)) result = date.map((_) => _.toDate());
  17654. else result = date ? date.toDate() : date;
  17655. userInput.value = null;
  17656. emitInput(result);
  17657. };
  17658. return {
  17659. parsedValue,
  17660. pickerActualVisible,
  17661. pickerOptions,
  17662. pickerVisible,
  17663. userInput,
  17664. valueIsEmpty,
  17665. emitInput,
  17666. onCalendarChange,
  17667. onPanelChange,
  17668. onPick,
  17669. onSetPickerOption
  17670. };
  17671. };
  17672. //#endregion
  17673. //#region ../../packages/components/time-picker/src/props/shared.ts
  17674. const disabledTimeListsProps = buildProps({
  17675. disabledHours: { type: definePropType(Function) },
  17676. disabledMinutes: { type: definePropType(Function) },
  17677. disabledSeconds: { type: definePropType(Function) }
  17678. });
  17679. const timePanelSharedProps = buildProps({
  17680. visible: Boolean,
  17681. actualVisible: {
  17682. type: Boolean,
  17683. default: void 0
  17684. },
  17685. format: {
  17686. type: String,
  17687. default: ""
  17688. }
  17689. });
  17690. //#endregion
  17691. //#region ../../packages/components/time-picker/src/common/props.ts
  17692. const timePickerDefaultProps = buildProps({
  17693. automaticDropdown: {
  17694. type: Boolean,
  17695. default: true
  17696. },
  17697. id: { type: definePropType([Array, String]) },
  17698. name: { type: definePropType([Array, String]) },
  17699. popperClass: useTooltipContentProps.popperClass,
  17700. popperStyle: useTooltipContentProps.popperStyle,
  17701. format: String,
  17702. valueFormat: String,
  17703. dateFormat: String,
  17704. timeFormat: String,
  17705. type: {
  17706. type: String,
  17707. default: ""
  17708. },
  17709. clearable: {
  17710. type: Boolean,
  17711. default: true
  17712. },
  17713. clearIcon: {
  17714. type: definePropType([String, Object]),
  17715. default: circle_close_default
  17716. },
  17717. editable: {
  17718. type: Boolean,
  17719. default: true
  17720. },
  17721. saveOnBlur: {
  17722. type: Boolean,
  17723. default: true
  17724. },
  17725. prefixIcon: {
  17726. type: definePropType([String, Object]),
  17727. default: ""
  17728. },
  17729. size: useSizeProp,
  17730. readonly: Boolean,
  17731. disabled: {
  17732. type: Boolean,
  17733. default: void 0
  17734. },
  17735. placeholder: {
  17736. type: String,
  17737. default: ""
  17738. },
  17739. popperOptions: {
  17740. type: definePropType(Object),
  17741. default: () => ({})
  17742. },
  17743. modelValue: {
  17744. type: definePropType([
  17745. Date,
  17746. Array,
  17747. String,
  17748. Number
  17749. ]),
  17750. default: ""
  17751. },
  17752. rangeSeparator: {
  17753. type: String,
  17754. default: "-"
  17755. },
  17756. startPlaceholder: String,
  17757. endPlaceholder: String,
  17758. defaultValue: { type: definePropType([Date, Array]) },
  17759. defaultTime: { type: definePropType([Date, Array]) },
  17760. isRange: Boolean,
  17761. ...disabledTimeListsProps,
  17762. disabledDate: { type: Function },
  17763. cellClassName: { type: Function },
  17764. shortcuts: {
  17765. type: Array,
  17766. default: () => []
  17767. },
  17768. arrowControl: Boolean,
  17769. tabindex: {
  17770. type: definePropType([String, Number]),
  17771. default: 0
  17772. },
  17773. validateEvent: {
  17774. type: Boolean,
  17775. default: true
  17776. },
  17777. unlinkPanels: Boolean,
  17778. placement: {
  17779. type: definePropType(String),
  17780. values: Ee,
  17781. default: "bottom"
  17782. },
  17783. fallbackPlacements: {
  17784. type: definePropType(Array),
  17785. default: [
  17786. "bottom",
  17787. "top",
  17788. "right",
  17789. "left"
  17790. ]
  17791. },
  17792. ...useEmptyValuesProps,
  17793. ...useAriaProps(["ariaLabel"]),
  17794. showNow: {
  17795. type: Boolean,
  17796. default: true
  17797. },
  17798. showConfirm: {
  17799. type: Boolean,
  17800. default: true
  17801. },
  17802. showFooter: {
  17803. type: Boolean,
  17804. default: true
  17805. },
  17806. showWeekNumber: Boolean
  17807. });
  17808. const timePickerRangeTriggerProps = buildProps({
  17809. id: { type: definePropType(Array) },
  17810. name: { type: definePropType(Array) },
  17811. modelValue: { type: definePropType([Array, String]) },
  17812. startPlaceholder: String,
  17813. endPlaceholder: String,
  17814. disabled: Boolean
  17815. });
  17816. /**
  17817. * @deprecated Use `timePickerRangeTriggerProps` instead. This will be removed in future versions.
  17818. */
  17819. const timePickerRngeTriggerProps = timePickerRangeTriggerProps;
  17820. //#endregion
  17821. //#region ../../packages/components/time-picker/src/common/picker-range-trigger.vue?vue&type=script&setup=true&lang.ts
  17822. const _hoisted_1$71 = [
  17823. "id",
  17824. "name",
  17825. "placeholder",
  17826. "value",
  17827. "disabled"
  17828. ];
  17829. const _hoisted_2$40 = [
  17830. "id",
  17831. "name",
  17832. "placeholder",
  17833. "value",
  17834. "disabled"
  17835. ];
  17836. var picker_range_trigger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  17837. name: "PickerRangeTrigger",
  17838. inheritAttrs: false,
  17839. __name: "picker-range-trigger",
  17840. props: timePickerRangeTriggerProps,
  17841. emits: [
  17842. "mouseenter",
  17843. "mouseleave",
  17844. "click",
  17845. "touchstart",
  17846. "focus",
  17847. "blur",
  17848. "startInput",
  17849. "endInput",
  17850. "startChange",
  17851. "endChange"
  17852. ],
  17853. setup(__props, { expose: __expose, emit: __emit }) {
  17854. const props = __props;
  17855. const emit = __emit;
  17856. const { formItem } = useFormItem();
  17857. const { inputId } = useFormItemInputId((0, vue.reactive)({ id: (0, vue.computed)(() => props.id?.[0]) }), { formItemContext: formItem });
  17858. const attrs = useAttrs();
  17859. const nsDate = useNamespace("date");
  17860. const nsRange = useNamespace("range");
  17861. const inputRef = (0, vue.ref)();
  17862. const endInputRef = (0, vue.ref)();
  17863. const { wrapperRef, isFocused } = useFocusController(inputRef, { disabled: (0, vue.computed)(() => props.disabled) });
  17864. const handleClick = (evt) => {
  17865. emit("click", evt);
  17866. };
  17867. const handleMouseEnter = (evt) => {
  17868. emit("mouseenter", evt);
  17869. };
  17870. const handleMouseLeave = (evt) => {
  17871. emit("mouseleave", evt);
  17872. };
  17873. const handleTouchStart = (evt) => {
  17874. emit("touchstart", evt);
  17875. };
  17876. const handleStartInput = (evt) => {
  17877. emit("startInput", evt);
  17878. };
  17879. const handleEndInput = (evt) => {
  17880. emit("endInput", evt);
  17881. };
  17882. const handleStartChange = (evt) => {
  17883. emit("startChange", evt);
  17884. };
  17885. const handleEndChange = (evt) => {
  17886. emit("endChange", evt);
  17887. };
  17888. const focus = () => {
  17889. inputRef.value?.focus();
  17890. };
  17891. const blur = () => {
  17892. inputRef.value?.blur();
  17893. endInputRef.value?.blur();
  17894. };
  17895. __expose({
  17896. focus,
  17897. blur
  17898. });
  17899. return (_ctx, _cache) => {
  17900. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  17901. ref_key: "wrapperRef",
  17902. ref: wrapperRef,
  17903. class: (0, vue.normalizeClass)([(0, vue.unref)(nsDate).is("active", (0, vue.unref)(isFocused)), _ctx.$attrs.class]),
  17904. style: (0, vue.normalizeStyle)(_ctx.$attrs.style),
  17905. onClick: handleClick,
  17906. onMouseenter: handleMouseEnter,
  17907. onMouseleave: handleMouseLeave,
  17908. onTouchstartPassive: handleTouchStart
  17909. }, [
  17910. (0, vue.renderSlot)(_ctx.$slots, "prefix"),
  17911. (0, vue.createElementVNode)("input", (0, vue.mergeProps)((0, vue.unref)(attrs), {
  17912. id: (0, vue.unref)(inputId),
  17913. ref_key: "inputRef",
  17914. ref: inputRef,
  17915. name: _ctx.name && _ctx.name[0],
  17916. placeholder: _ctx.startPlaceholder,
  17917. value: _ctx.modelValue && _ctx.modelValue[0],
  17918. class: (0, vue.unref)(nsRange).b("input"),
  17919. disabled: _ctx.disabled,
  17920. onInput: handleStartInput,
  17921. onChange: handleStartChange
  17922. }), null, 16, _hoisted_1$71),
  17923. (0, vue.renderSlot)(_ctx.$slots, "range-separator"),
  17924. (0, vue.createElementVNode)("input", (0, vue.mergeProps)((0, vue.unref)(attrs), {
  17925. id: _ctx.id && _ctx.id[1],
  17926. ref_key: "endInputRef",
  17927. ref: endInputRef,
  17928. name: _ctx.name && _ctx.name[1],
  17929. placeholder: _ctx.endPlaceholder,
  17930. value: _ctx.modelValue && _ctx.modelValue[1],
  17931. class: (0, vue.unref)(nsRange).b("input"),
  17932. disabled: _ctx.disabled,
  17933. onInput: handleEndInput,
  17934. onChange: handleEndChange
  17935. }), null, 16, _hoisted_2$40),
  17936. (0, vue.renderSlot)(_ctx.$slots, "suffix")
  17937. ], 38);
  17938. };
  17939. }
  17940. });
  17941. //#endregion
  17942. //#region ../../packages/components/time-picker/src/common/picker-range-trigger.vue
  17943. var picker_range_trigger_default = picker_range_trigger_vue_vue_type_script_setup_true_lang_default;
  17944. //#endregion
  17945. //#region ../../packages/components/time-picker/src/common/picker.vue?vue&type=script&setup=true&lang.ts
  17946. var picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  17947. name: "Picker",
  17948. __name: "picker",
  17949. props: timePickerDefaultProps,
  17950. emits: [
  17951. UPDATE_MODEL_EVENT,
  17952. CHANGE_EVENT,
  17953. "focus",
  17954. "blur",
  17955. "clear",
  17956. "calendar-change",
  17957. "panel-change",
  17958. "visible-change",
  17959. "keydown"
  17960. ],
  17961. setup(__props, { expose: __expose, emit: __emit }) {
  17962. const props = __props;
  17963. const emit = __emit;
  17964. const attrs = (0, vue.useAttrs)();
  17965. const nsDate = useNamespace("date");
  17966. const nsInput = useNamespace("input");
  17967. const nsRange = useNamespace("range");
  17968. const { formItem } = useFormItem();
  17969. const elPopperOptions = (0, vue.inject)(PICKER_POPPER_OPTIONS_INJECTION_KEY, {});
  17970. const emptyValues = useEmptyValues(props, null);
  17971. const refPopper = (0, vue.ref)();
  17972. const inputRef = (0, vue.ref)();
  17973. const valueOnOpen = (0, vue.ref)(null);
  17974. let hasJustTabExitedInput = false;
  17975. const pickerDisabled = useFormDisabled();
  17976. const commonPicker = useCommonPicker(props, emit);
  17977. const { parsedValue, pickerActualVisible, userInput, pickerVisible, pickerOptions, valueIsEmpty, emitInput, onPick, onSetPickerOption, onCalendarChange, onPanelChange } = commonPicker;
  17978. const { isFocused, handleFocus, handleBlur } = useFocusController(inputRef, {
  17979. disabled: pickerDisabled,
  17980. beforeFocus() {
  17981. return props.readonly;
  17982. },
  17983. afterFocus() {
  17984. if (!props.automaticDropdown) return;
  17985. pickerVisible.value = true;
  17986. },
  17987. beforeBlur(event) {
  17988. return !hasJustTabExitedInput && refPopper.value?.isFocusInsideContent(event);
  17989. },
  17990. afterBlur() {
  17991. if (isTimePicker.value && !props.saveOnBlur) {
  17992. if (!valueIsEmpty.value) pickerOptions.value.handleCancel?.();
  17993. } else handleChange();
  17994. pickerVisible.value = false;
  17995. hasJustTabExitedInput = false;
  17996. props.validateEvent && formItem?.validate("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  17997. }
  17998. });
  17999. const hovering = (0, vue.ref)(false);
  18000. const rangeInputKls = (0, vue.computed)(() => [
  18001. nsDate.b("editor"),
  18002. nsDate.bm("editor", props.type),
  18003. nsInput.e("wrapper"),
  18004. nsDate.is("disabled", pickerDisabled.value),
  18005. nsDate.is("active", pickerVisible.value),
  18006. nsRange.b("editor"),
  18007. pickerSize ? nsRange.bm("editor", pickerSize.value) : "",
  18008. attrs.class
  18009. ]);
  18010. const clearIconKls = (0, vue.computed)(() => [
  18011. nsInput.e("icon"),
  18012. nsRange.e("close-icon"),
  18013. !showClearBtn.value ? nsRange.em("close-icon", "hidden") : ""
  18014. ]);
  18015. (0, vue.watch)(pickerVisible, (val) => {
  18016. if (!val) {
  18017. userInput.value = null;
  18018. (0, vue.nextTick)(() => {
  18019. emitChange(props.modelValue);
  18020. });
  18021. } else (0, vue.nextTick)(() => {
  18022. if (val) valueOnOpen.value = props.modelValue;
  18023. });
  18024. });
  18025. const emitChange = (val, isClear) => {
  18026. if (isClear || !valueEquals(val, valueOnOpen.value)) {
  18027. emit(CHANGE_EVENT, val);
  18028. isClear && (valueOnOpen.value = val);
  18029. props.validateEvent && formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  18030. }
  18031. };
  18032. const emitKeydown = (e) => {
  18033. emit("keydown", e);
  18034. };
  18035. const refInput = (0, vue.computed)(() => {
  18036. if (inputRef.value) return Array.from(inputRef.value.$el.querySelectorAll("input"));
  18037. return [];
  18038. });
  18039. const setSelectionRange = (start, end, pos) => {
  18040. const _inputs = refInput.value;
  18041. if (!_inputs.length) return;
  18042. if (!pos || pos === "min") {
  18043. _inputs[0].setSelectionRange(start, end);
  18044. _inputs[0].focus();
  18045. } else if (pos === "max") {
  18046. _inputs[1].setSelectionRange(start, end);
  18047. _inputs[1].focus();
  18048. }
  18049. };
  18050. const onBeforeShow = () => {
  18051. pickerActualVisible.value = true;
  18052. };
  18053. const onShow = () => {
  18054. emit("visible-change", true);
  18055. };
  18056. const onHide = () => {
  18057. pickerActualVisible.value = false;
  18058. pickerVisible.value = false;
  18059. emit("visible-change", false);
  18060. };
  18061. const handleOpen = () => {
  18062. pickerVisible.value = true;
  18063. };
  18064. const handleClose = () => {
  18065. pickerVisible.value = false;
  18066. };
  18067. const displayValue = (0, vue.computed)(() => {
  18068. const formattedValue = formatToString(parsedValue.value);
  18069. if (isArray$1(userInput.value)) return [userInput.value[0] || formattedValue && formattedValue[0] || "", userInput.value[1] || formattedValue && formattedValue[1] || ""];
  18070. else if (userInput.value !== null) return userInput.value;
  18071. if (isTimePicker.value && valueIsEmpty.value && !props.saveOnBlur) return "";
  18072. if (!isTimePicker.value && valueIsEmpty.value) return "";
  18073. if (!pickerVisible.value && valueIsEmpty.value) return "";
  18074. if (formattedValue) return isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value ? formattedValue.join(", ") : formattedValue;
  18075. return "";
  18076. });
  18077. const isTimeLikePicker = (0, vue.computed)(() => props.type.includes("time"));
  18078. const isTimePicker = (0, vue.computed)(() => props.type.startsWith("time"));
  18079. const isDatesPicker = (0, vue.computed)(() => props.type === "dates");
  18080. const isMonthsPicker = (0, vue.computed)(() => props.type === "months");
  18081. const isYearsPicker = (0, vue.computed)(() => props.type === "years");
  18082. const triggerIcon = (0, vue.computed)(() => props.prefixIcon || (isTimeLikePicker.value ? clock_default : calendar_default$1));
  18083. const showClearBtn = (0, vue.computed)(() => props.clearable && !pickerDisabled.value && !props.readonly && !valueIsEmpty.value && (hovering.value || isFocused.value));
  18084. const onClear = (event) => {
  18085. if (props.readonly || pickerDisabled.value) return;
  18086. if (showClearBtn.value) {
  18087. event?.stopPropagation();
  18088. if (pickerOptions.value.handleClear) pickerOptions.value.handleClear();
  18089. else emitInput(emptyValues.valueOnClear.value);
  18090. emitChange(emptyValues.valueOnClear.value, true);
  18091. onHide();
  18092. }
  18093. emit("clear");
  18094. };
  18095. const onMouseDownInput = async (event) => {
  18096. if (props.readonly || pickerDisabled.value) return;
  18097. if (event.target?.tagName !== "INPUT" || isFocused.value || !props.automaticDropdown) pickerVisible.value = true;
  18098. };
  18099. const onMouseEnter = () => {
  18100. if (props.readonly || pickerDisabled.value) return;
  18101. if (!valueIsEmpty.value && props.clearable) hovering.value = true;
  18102. };
  18103. const onMouseLeave = () => {
  18104. hovering.value = false;
  18105. };
  18106. const onTouchStartInput = (event) => {
  18107. if (props.readonly || pickerDisabled.value) return;
  18108. if (event.touches[0].target?.tagName !== "INPUT" || isFocused.value || !props.automaticDropdown) pickerVisible.value = true;
  18109. };
  18110. const isRangeInput = (0, vue.computed)(() => {
  18111. return props.type.includes("range");
  18112. });
  18113. const pickerSize = useFormSize();
  18114. const popperEl = (0, vue.computed)(() => (0, vue.unref)(refPopper)?.popperRef?.contentRef);
  18115. const stophandle = onClickOutside(inputRef, (e) => {
  18116. const unrefedPopperEl = (0, vue.unref)(popperEl);
  18117. const inputEl = unrefElement(inputRef);
  18118. if (unrefedPopperEl && (e.target === unrefedPopperEl || e.composedPath().includes(unrefedPopperEl)) || e.target === inputEl || inputEl && e.composedPath().includes(inputEl)) return;
  18119. pickerVisible.value = false;
  18120. });
  18121. (0, vue.onBeforeUnmount)(() => {
  18122. stophandle?.();
  18123. });
  18124. const handleChange = () => {
  18125. if (isTimePicker.value && !props.saveOnBlur) return;
  18126. if (userInput.value) {
  18127. const value = parseUserInputToDayjs(displayValue.value);
  18128. if (value) {
  18129. if (isValidValue(value)) emitInput(dayOrDaysToDate(value));
  18130. userInput.value = null;
  18131. }
  18132. }
  18133. if (userInput.value === "") {
  18134. emitInput(emptyValues.valueOnClear.value);
  18135. emitChange(emptyValues.valueOnClear.value, true);
  18136. userInput.value = null;
  18137. }
  18138. };
  18139. const parseUserInputToDayjs = (value) => {
  18140. if (!value) return null;
  18141. return pickerOptions.value.parseUserInput(value);
  18142. };
  18143. const formatToString = (value) => {
  18144. if (!value) return null;
  18145. return isArray$1(value) ? value.map((_) => _.format(props.format)) : value.format(props.format);
  18146. };
  18147. const isValidValue = (value) => {
  18148. return pickerOptions.value.isValidValue(value);
  18149. };
  18150. const handleKeydownInput = async (event) => {
  18151. if (props.readonly || pickerDisabled.value) return;
  18152. const code = getEventCode(event);
  18153. emitKeydown(event);
  18154. if (code === EVENT_CODE.esc) {
  18155. if (pickerVisible.value === true) {
  18156. pickerVisible.value = false;
  18157. event.preventDefault();
  18158. event.stopPropagation();
  18159. }
  18160. return;
  18161. }
  18162. if (code === EVENT_CODE.down) {
  18163. if (pickerOptions.value.handleFocusPicker) {
  18164. event.preventDefault();
  18165. event.stopPropagation();
  18166. }
  18167. if (pickerVisible.value === false) {
  18168. pickerVisible.value = true;
  18169. await (0, vue.nextTick)();
  18170. }
  18171. if (pickerOptions.value.handleFocusPicker) {
  18172. pickerOptions.value.handleFocusPicker();
  18173. return;
  18174. }
  18175. }
  18176. if (code === EVENT_CODE.tab) {
  18177. hasJustTabExitedInput = true;
  18178. return;
  18179. }
  18180. if (code === EVENT_CODE.enter || code === EVENT_CODE.numpadEnter) {
  18181. if (!pickerVisible.value) pickerVisible.value = true;
  18182. else if (userInput.value === null || userInput.value === "" || isValidValue(parseUserInputToDayjs(displayValue.value))) {
  18183. handleChange();
  18184. pickerVisible.value = false;
  18185. }
  18186. event.preventDefault();
  18187. event.stopPropagation();
  18188. return;
  18189. }
  18190. if (userInput.value) {
  18191. event.stopPropagation();
  18192. return;
  18193. }
  18194. if (pickerOptions.value.handleKeydownInput) pickerOptions.value.handleKeydownInput(event);
  18195. };
  18196. const onUserInput = (e) => {
  18197. userInput.value = e;
  18198. if (!pickerVisible.value) pickerVisible.value = true;
  18199. };
  18200. const handleStartInput = (event) => {
  18201. const target = event.target;
  18202. if (userInput.value) userInput.value = [target.value, userInput.value[1]];
  18203. else userInput.value = [target.value, null];
  18204. };
  18205. const handleEndInput = (event) => {
  18206. const target = event.target;
  18207. if (userInput.value) userInput.value = [userInput.value[0], target.value];
  18208. else userInput.value = [null, target.value];
  18209. };
  18210. const handleStartChange = () => {
  18211. const values = userInput.value;
  18212. const value = parseUserInputToDayjs(values && values[0]);
  18213. const parsedVal = (0, vue.unref)(parsedValue);
  18214. if (value && value.isValid()) {
  18215. userInput.value = [formatToString(value), displayValue.value?.[1] || null];
  18216. const newValue = [value, parsedVal && (parsedVal[1] || null)];
  18217. if (isValidValue(newValue)) {
  18218. emitInput(dayOrDaysToDate(newValue));
  18219. userInput.value = null;
  18220. }
  18221. }
  18222. };
  18223. const handleEndChange = () => {
  18224. const values = (0, vue.unref)(userInput);
  18225. const value = parseUserInputToDayjs(values && values[1]);
  18226. const parsedVal = (0, vue.unref)(parsedValue);
  18227. if (value && value.isValid()) {
  18228. userInput.value = [(0, vue.unref)(displayValue)?.[0] || null, formatToString(value)];
  18229. const newValue = [parsedVal && parsedVal[0], value];
  18230. if (isValidValue(newValue)) {
  18231. emitInput(dayOrDaysToDate(newValue));
  18232. userInput.value = null;
  18233. }
  18234. }
  18235. };
  18236. const focus = () => {
  18237. inputRef.value?.focus();
  18238. };
  18239. const blur = () => {
  18240. inputRef.value?.blur();
  18241. };
  18242. (0, vue.provide)(PICKER_BASE_INJECTION_KEY, {
  18243. props,
  18244. emptyValues
  18245. });
  18246. (0, vue.provide)(ROOT_COMMON_PICKER_INJECTION_KEY, commonPicker);
  18247. __expose({
  18248. focus,
  18249. blur,
  18250. handleOpen,
  18251. handleClose,
  18252. onPick
  18253. });
  18254. return (_ctx, _cache) => {
  18255. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), (0, vue.mergeProps)({
  18256. ref_key: "refPopper",
  18257. ref: refPopper,
  18258. visible: (0, vue.unref)(pickerVisible),
  18259. effect: "light",
  18260. pure: "",
  18261. trigger: "click"
  18262. }, _ctx.$attrs, {
  18263. role: "dialog",
  18264. teleported: "",
  18265. transition: `${(0, vue.unref)(nsDate).namespace.value}-zoom-in-top`,
  18266. "popper-class": [`${(0, vue.unref)(nsDate).namespace.value}-picker__popper`, _ctx.popperClass],
  18267. "popper-style": _ctx.popperStyle,
  18268. "popper-options": (0, vue.unref)(elPopperOptions),
  18269. "fallback-placements": _ctx.fallbackPlacements,
  18270. "gpu-acceleration": false,
  18271. placement: _ctx.placement,
  18272. "stop-popper-mouse-event": false,
  18273. "hide-after": 0,
  18274. persistent: "",
  18275. onBeforeShow,
  18276. onShow,
  18277. onHide
  18278. }), {
  18279. default: (0, vue.withCtx)(() => [!isRangeInput.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElInput), {
  18280. key: 0,
  18281. id: _ctx.id,
  18282. ref_key: "inputRef",
  18283. ref: inputRef,
  18284. "container-role": "combobox",
  18285. "model-value": displayValue.value,
  18286. name: _ctx.name,
  18287. size: (0, vue.unref)(pickerSize),
  18288. disabled: (0, vue.unref)(pickerDisabled),
  18289. placeholder: _ctx.placeholder,
  18290. class: (0, vue.normalizeClass)([
  18291. (0, vue.unref)(nsDate).b("editor"),
  18292. (0, vue.unref)(nsDate).bm("editor", _ctx.type),
  18293. (0, vue.unref)(nsDate).is("focus", (0, vue.unref)(pickerVisible)),
  18294. _ctx.$attrs.class
  18295. ]),
  18296. style: (0, vue.normalizeStyle)(_ctx.$attrs.style),
  18297. readonly: !_ctx.editable || _ctx.readonly || isDatesPicker.value || isMonthsPicker.value || isYearsPicker.value || _ctx.type === "week",
  18298. "aria-label": _ctx.ariaLabel,
  18299. tabindex: _ctx.tabindex,
  18300. "validate-event": false,
  18301. onInput: onUserInput,
  18302. onFocus: (0, vue.unref)(handleFocus),
  18303. onBlur: (0, vue.unref)(handleBlur),
  18304. onKeydown: handleKeydownInput,
  18305. onChange: handleChange,
  18306. onMousedown: onMouseDownInput,
  18307. onMouseenter: onMouseEnter,
  18308. onMouseleave: onMouseLeave,
  18309. onTouchstartPassive: onTouchStartInput,
  18310. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  18311. }, {
  18312. prefix: (0, vue.withCtx)(() => [triggerIcon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  18313. key: 0,
  18314. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("icon")),
  18315. onMousedown: (0, vue.withModifiers)(onMouseDownInput, ["prevent"]),
  18316. onTouchstartPassive: onTouchStartInput
  18317. }, {
  18318. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(triggerIcon.value)))]),
  18319. _: 1
  18320. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)]),
  18321. suffix: (0, vue.withCtx)(() => [showClearBtn.value && _ctx.clearIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  18322. key: 0,
  18323. class: (0, vue.normalizeClass)(`${(0, vue.unref)(nsInput).e("icon")} clear-icon`),
  18324. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  18325. onClick: onClear
  18326. }, {
  18327. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.clearIcon)))]),
  18328. _: 1
  18329. }, 8, ["class", "onMousedown"])) : (0, vue.createCommentVNode)("v-if", true)]),
  18330. _: 1
  18331. }, 8, [
  18332. "id",
  18333. "model-value",
  18334. "name",
  18335. "size",
  18336. "disabled",
  18337. "placeholder",
  18338. "class",
  18339. "style",
  18340. "readonly",
  18341. "aria-label",
  18342. "tabindex",
  18343. "onFocus",
  18344. "onBlur"
  18345. ])) : ((0, vue.openBlock)(), (0, vue.createBlock)(picker_range_trigger_default, {
  18346. key: 1,
  18347. id: _ctx.id,
  18348. ref_key: "inputRef",
  18349. ref: inputRef,
  18350. "model-value": displayValue.value,
  18351. name: _ctx.name,
  18352. disabled: (0, vue.unref)(pickerDisabled),
  18353. readonly: !_ctx.editable || _ctx.readonly,
  18354. "start-placeholder": _ctx.startPlaceholder,
  18355. "end-placeholder": _ctx.endPlaceholder,
  18356. class: (0, vue.normalizeClass)(rangeInputKls.value),
  18357. style: (0, vue.normalizeStyle)(_ctx.$attrs.style),
  18358. "aria-label": _ctx.ariaLabel,
  18359. tabindex: _ctx.tabindex,
  18360. autocomplete: "off",
  18361. role: "combobox",
  18362. onClick: onMouseDownInput,
  18363. onFocus: (0, vue.unref)(handleFocus),
  18364. onBlur: (0, vue.unref)(handleBlur),
  18365. onStartInput: handleStartInput,
  18366. onStartChange: handleStartChange,
  18367. onEndInput: handleEndInput,
  18368. onEndChange: handleEndChange,
  18369. onMousedown: onMouseDownInput,
  18370. onMouseenter: onMouseEnter,
  18371. onMouseleave: onMouseLeave,
  18372. onTouchstartPassive: onTouchStartInput,
  18373. onKeydown: handleKeydownInput
  18374. }, {
  18375. prefix: (0, vue.withCtx)(() => [triggerIcon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  18376. key: 0,
  18377. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("icon"), (0, vue.unref)(nsRange).e("icon")])
  18378. }, {
  18379. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(triggerIcon.value)))]),
  18380. _: 1
  18381. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)]),
  18382. "range-separator": (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "range-separator", {}, () => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsRange).b("separator")) }, (0, vue.toDisplayString)(_ctx.rangeSeparator), 3)])]),
  18383. suffix: (0, vue.withCtx)(() => [_ctx.clearIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  18384. key: 0,
  18385. class: (0, vue.normalizeClass)(clearIconKls.value),
  18386. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  18387. onClick: onClear
  18388. }, {
  18389. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.clearIcon)))]),
  18390. _: 1
  18391. }, 8, ["class", "onMousedown"])) : (0, vue.createCommentVNode)("v-if", true)]),
  18392. _: 3
  18393. }, 8, [
  18394. "id",
  18395. "model-value",
  18396. "name",
  18397. "disabled",
  18398. "readonly",
  18399. "start-placeholder",
  18400. "end-placeholder",
  18401. "class",
  18402. "style",
  18403. "aria-label",
  18404. "tabindex",
  18405. "onFocus",
  18406. "onBlur"
  18407. ]))]),
  18408. content: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {
  18409. visible: (0, vue.unref)(pickerVisible),
  18410. actualVisible: (0, vue.unref)(pickerActualVisible),
  18411. parsedValue: (0, vue.unref)(parsedValue),
  18412. format: _ctx.format,
  18413. dateFormat: _ctx.dateFormat,
  18414. timeFormat: _ctx.timeFormat,
  18415. unlinkPanels: _ctx.unlinkPanels,
  18416. type: _ctx.type,
  18417. defaultValue: _ctx.defaultValue,
  18418. showNow: _ctx.showNow,
  18419. showConfirm: _ctx.showConfirm,
  18420. showFooter: _ctx.showFooter,
  18421. showWeekNumber: _ctx.showWeekNumber,
  18422. onPick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(onPick) && (0, vue.unref)(onPick)(...args)),
  18423. onSelectRange: setSelectionRange,
  18424. onSetPickerOption: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(onSetPickerOption) && (0, vue.unref)(onSetPickerOption)(...args)),
  18425. onCalendarChange: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(onCalendarChange) && (0, vue.unref)(onCalendarChange)(...args)),
  18426. onClear,
  18427. onPanelChange: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(onPanelChange) && (0, vue.unref)(onPanelChange)(...args)),
  18428. onMousedown: _cache[5] || (_cache[5] = (0, vue.withModifiers)(() => {}, ["stop"]))
  18429. })]),
  18430. _: 3
  18431. }, 16, [
  18432. "visible",
  18433. "transition",
  18434. "popper-class",
  18435. "popper-style",
  18436. "popper-options",
  18437. "fallback-placements",
  18438. "placement"
  18439. ]);
  18440. };
  18441. }
  18442. });
  18443. //#endregion
  18444. //#region ../../packages/components/time-picker/src/common/picker.vue
  18445. var picker_default = picker_vue_vue_type_script_setup_true_lang_default;
  18446. //#endregion
  18447. //#region ../../packages/components/time-picker/src/props/panel-time-picker.ts
  18448. const panelTimePickerProps = buildProps({
  18449. ...timePanelSharedProps,
  18450. datetimeRole: String,
  18451. parsedValue: { type: definePropType(Object) }
  18452. });
  18453. //#endregion
  18454. //#region ../../packages/components/time-picker/src/composables/use-time-panel.ts
  18455. const useTimePanel = ({ getAvailableHours, getAvailableMinutes, getAvailableSeconds }) => {
  18456. const getAvailableTime = (date, role, first, compareDate) => {
  18457. const availableTimeGetters = {
  18458. hour: getAvailableHours,
  18459. minute: getAvailableMinutes,
  18460. second: getAvailableSeconds
  18461. };
  18462. let result = date;
  18463. [
  18464. "hour",
  18465. "minute",
  18466. "second"
  18467. ].forEach((type) => {
  18468. if (availableTimeGetters[type]) {
  18469. let availableTimeSlots;
  18470. const method = availableTimeGetters[type];
  18471. switch (type) {
  18472. case "minute":
  18473. availableTimeSlots = method(result.hour(), role, compareDate);
  18474. break;
  18475. case "second":
  18476. availableTimeSlots = method(result.hour(), result.minute(), role, compareDate);
  18477. break;
  18478. default:
  18479. availableTimeSlots = method(role, compareDate);
  18480. break;
  18481. }
  18482. if (availableTimeSlots?.length && !availableTimeSlots.includes(result[type]())) {
  18483. const pos = first ? 0 : availableTimeSlots.length - 1;
  18484. result = result[type](availableTimeSlots[pos]);
  18485. }
  18486. }
  18487. });
  18488. return result;
  18489. };
  18490. const timePickerOptions = {};
  18491. const onSetOption = ([key, val]) => {
  18492. timePickerOptions[key] = val;
  18493. };
  18494. return {
  18495. timePickerOptions,
  18496. getAvailableTime,
  18497. onSetOption
  18498. };
  18499. };
  18500. //#endregion
  18501. //#region ../../packages/components/time-picker/src/composables/use-time-picker.ts
  18502. const makeAvailableArr = (disabledList) => {
  18503. const trueOrNumber = (isDisabled, index) => isDisabled || index;
  18504. const getNumber = (predicate) => predicate !== true;
  18505. return disabledList.map(trueOrNumber).filter(getNumber);
  18506. };
  18507. const getTimeLists = (disabledHours, disabledMinutes, disabledSeconds) => {
  18508. const getHoursList = (role, compare) => {
  18509. return makeList(24, disabledHours && (() => disabledHours?.(role, compare)));
  18510. };
  18511. const getMinutesList = (hour, role, compare) => {
  18512. return makeList(60, disabledMinutes && (() => disabledMinutes?.(hour, role, compare)));
  18513. };
  18514. const getSecondsList = (hour, minute, role, compare) => {
  18515. return makeList(60, disabledSeconds && (() => disabledSeconds?.(hour, minute, role, compare)));
  18516. };
  18517. return {
  18518. getHoursList,
  18519. getMinutesList,
  18520. getSecondsList
  18521. };
  18522. };
  18523. const buildAvailableTimeSlotGetter = (disabledHours, disabledMinutes, disabledSeconds) => {
  18524. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(disabledHours, disabledMinutes, disabledSeconds);
  18525. const getAvailableHours = (role, compare) => {
  18526. return makeAvailableArr(getHoursList(role, compare));
  18527. };
  18528. const getAvailableMinutes = (hour, role, compare) => {
  18529. return makeAvailableArr(getMinutesList(hour, role, compare));
  18530. };
  18531. const getAvailableSeconds = (hour, minute, role, compare) => {
  18532. return makeAvailableArr(getSecondsList(hour, minute, role, compare));
  18533. };
  18534. return {
  18535. getAvailableHours,
  18536. getAvailableMinutes,
  18537. getAvailableSeconds
  18538. };
  18539. };
  18540. const useOldValue = (props, options) => {
  18541. const oldValue = (0, vue.ref)(props.parsedValue);
  18542. (0, vue.watch)(() => props.visible, (val) => {
  18543. const modelValue = (0, vue.toValue)(options.modelValue);
  18544. const valueOnClear = (0, vue.toValue)(options.valueOnClear);
  18545. if (val && modelValue === valueOnClear) {
  18546. oldValue.value = valueOnClear;
  18547. return;
  18548. }
  18549. if (!val) oldValue.value = props.parsedValue;
  18550. });
  18551. return oldValue;
  18552. };
  18553. //#endregion
  18554. //#region ../../packages/directives/click-outside/index.ts
  18555. const nodeList = /* @__PURE__ */ new Map();
  18556. if (isClient) {
  18557. let startClick;
  18558. document.addEventListener("mousedown", (e) => startClick = e);
  18559. document.addEventListener("mouseup", (e) => {
  18560. if (startClick) {
  18561. for (const handlers of nodeList.values()) for (const { documentHandler } of handlers) documentHandler(e, startClick);
  18562. startClick = void 0;
  18563. }
  18564. });
  18565. }
  18566. function createDocumentHandler(el, binding) {
  18567. let excludes = [];
  18568. if (isArray$1(binding.arg)) excludes = binding.arg;
  18569. else if (isElement$1(binding.arg)) excludes.push(binding.arg);
  18570. return function(mouseup, mousedown) {
  18571. const popperRef = binding.instance.popperRef;
  18572. const mouseUpTarget = mouseup.target;
  18573. const mouseDownTarget = mousedown?.target;
  18574. const isBound = !binding || !binding.instance;
  18575. const isTargetExists = !mouseUpTarget || !mouseDownTarget;
  18576. const isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
  18577. const isSelf = el === mouseUpTarget;
  18578. const isTargetExcluded = excludes.length && excludes.some((item) => item?.contains(mouseUpTarget)) || excludes.length && excludes.includes(mouseDownTarget);
  18579. const isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
  18580. if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) return;
  18581. binding.value(mouseup, mousedown);
  18582. };
  18583. }
  18584. const ClickOutside = {
  18585. beforeMount(el, binding) {
  18586. if (!nodeList.has(el)) nodeList.set(el, []);
  18587. nodeList.get(el).push({
  18588. documentHandler: createDocumentHandler(el, binding),
  18589. bindingFn: binding.value
  18590. });
  18591. },
  18592. updated(el, binding) {
  18593. if (!nodeList.has(el)) nodeList.set(el, []);
  18594. const handlers = nodeList.get(el);
  18595. const oldHandlerIndex = handlers.findIndex((item) => item.bindingFn === binding.oldValue);
  18596. const newHandler = {
  18597. documentHandler: createDocumentHandler(el, binding),
  18598. bindingFn: binding.value
  18599. };
  18600. if (oldHandlerIndex >= 0) handlers.splice(oldHandlerIndex, 1, newHandler);
  18601. else handlers.push(newHandler);
  18602. },
  18603. unmounted(el) {
  18604. nodeList.delete(el);
  18605. }
  18606. };
  18607. //#endregion
  18608. //#region ../../packages/directives/repeat-click/index.ts
  18609. const REPEAT_INTERVAL = 100;
  18610. const REPEAT_DELAY = 600;
  18611. const SCOPE$6 = "_RepeatClick";
  18612. const vRepeatClick = {
  18613. beforeMount(el, binding) {
  18614. const value = binding.value;
  18615. const { interval = REPEAT_INTERVAL, delay = REPEAT_DELAY } = isFunction$1(value) ? {} : value;
  18616. let intervalId;
  18617. let delayId;
  18618. const handler = () => isFunction$1(value) ? value() : value.handler();
  18619. const clear = () => {
  18620. if (delayId) {
  18621. clearTimeout(delayId);
  18622. delayId = void 0;
  18623. }
  18624. if (intervalId) {
  18625. clearInterval(intervalId);
  18626. intervalId = void 0;
  18627. }
  18628. };
  18629. const start = (evt) => {
  18630. if (evt.button !== 0) return;
  18631. clear();
  18632. handler();
  18633. document.addEventListener("mouseup", clear, { once: true });
  18634. delayId = setTimeout(() => {
  18635. intervalId = setInterval(() => {
  18636. handler();
  18637. }, interval);
  18638. }, delay);
  18639. };
  18640. el[SCOPE$6] = {
  18641. start,
  18642. clear
  18643. };
  18644. el.addEventListener("mousedown", start);
  18645. },
  18646. unmounted(el) {
  18647. if (!el[SCOPE$6]) return;
  18648. const { start, clear } = el[SCOPE$6];
  18649. if (start) el.removeEventListener("mousedown", start);
  18650. if (clear) {
  18651. clear();
  18652. document.removeEventListener("mouseup", clear);
  18653. }
  18654. el[SCOPE$6] = null;
  18655. }
  18656. };
  18657. //#endregion
  18658. //#region ../../packages/directives/trap-focus/index.ts
  18659. const FOCUSABLE_CHILDREN = "_trap-focus-children";
  18660. const FOCUS_STACK = [];
  18661. const FOCUS_HANDLER = (e) => {
  18662. if (FOCUS_STACK.length === 0) return;
  18663. const code = getEventCode(e);
  18664. const focusableElement = FOCUS_STACK[FOCUS_STACK.length - 1][FOCUSABLE_CHILDREN];
  18665. if (focusableElement.length > 0 && code === EVENT_CODE.tab) {
  18666. if (focusableElement.length === 1) {
  18667. e.preventDefault();
  18668. if (document.activeElement !== focusableElement[0]) focusableElement[0].focus();
  18669. return;
  18670. }
  18671. const goingBackward = e.shiftKey;
  18672. const isFirst = e.target === focusableElement[0];
  18673. const isLast = e.target === focusableElement[focusableElement.length - 1];
  18674. if (isFirst && goingBackward) {
  18675. e.preventDefault();
  18676. focusableElement[focusableElement.length - 1].focus();
  18677. }
  18678. if (isLast && !goingBackward) {
  18679. e.preventDefault();
  18680. focusableElement[0].focus();
  18681. }
  18682. }
  18683. };
  18684. const TrapFocus = {
  18685. beforeMount(el) {
  18686. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  18687. FOCUS_STACK.push(el);
  18688. if (FOCUS_STACK.length <= 1) document.addEventListener("keydown", FOCUS_HANDLER);
  18689. },
  18690. updated(el) {
  18691. (0, vue.nextTick)(() => {
  18692. el[FOCUSABLE_CHILDREN] = obtainAllFocusableElements$1(el);
  18693. });
  18694. },
  18695. unmounted() {
  18696. FOCUS_STACK.shift();
  18697. if (FOCUS_STACK.length === 0) document.removeEventListener("keydown", FOCUS_HANDLER);
  18698. }
  18699. };
  18700. //#endregion
  18701. //#region ../../node_modules/.pnpm/normalize-wheel-es@1.2.0/node_modules/normalize-wheel-es/dist/index.mjs
  18702. var v = !1, o, f, s, u, d, N, l, p, m, w, D, x, E, M, F;
  18703. function a() {
  18704. if (!v) {
  18705. v = !0;
  18706. 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);
  18707. 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) {
  18708. o = n[1] ? parseFloat(n[1]) : n[5] ? parseFloat(n[5]) : NaN, o && document && document.documentMode && (o = document.documentMode);
  18709. var r = /(?:Trident\/(\d+.\d+))/.exec(e);
  18710. 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;
  18711. } else o = f = s = d = u = NaN;
  18712. if (i) {
  18713. if (i[1]) {
  18714. var t = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);
  18715. l = t ? parseFloat(t[1].replace("_", ".")) : !0;
  18716. } else l = !1;
  18717. p = !!i[2], m = !!i[3];
  18718. } else l = p = m = !1;
  18719. }
  18720. }
  18721. var _ = {
  18722. ie: function() {
  18723. return a() || o;
  18724. },
  18725. ieCompatibilityMode: function() {
  18726. return a() || N > o;
  18727. },
  18728. ie64: function() {
  18729. return _.ie() && D;
  18730. },
  18731. firefox: function() {
  18732. return a() || f;
  18733. },
  18734. opera: function() {
  18735. return a() || s;
  18736. },
  18737. webkit: function() {
  18738. return a() || u;
  18739. },
  18740. safari: function() {
  18741. return _.webkit();
  18742. },
  18743. chrome: function() {
  18744. return a() || d;
  18745. },
  18746. windows: function() {
  18747. return a() || p;
  18748. },
  18749. osx: function() {
  18750. return a() || l;
  18751. },
  18752. linux: function() {
  18753. return a() || m;
  18754. },
  18755. iphone: function() {
  18756. return a() || x;
  18757. },
  18758. mobile: function() {
  18759. return a() || x || E || w || F;
  18760. },
  18761. nativeApp: function() {
  18762. return a() || M;
  18763. },
  18764. android: function() {
  18765. return a() || w;
  18766. },
  18767. ipad: function() {
  18768. return a() || E;
  18769. }
  18770. }, A = _;
  18771. var c = !!(typeof window < "u" && window.document && window.document.createElement), h$26 = {
  18772. canUseDOM: c,
  18773. canUseWorkers: typeof Worker < "u",
  18774. canUseEventListeners: c && !!(window.addEventListener || window.attachEvent),
  18775. canUseViewport: c && !!window.screen,
  18776. isInWorker: !c
  18777. };
  18778. var X;
  18779. h$26.canUseDOM && (X = document.implementation && document.implementation.hasFeature && document.implementation.hasFeature("", "") !== !0);
  18780. function S(e, n) {
  18781. if (!h$26.canUseDOM || n && !("addEventListener" in document)) return !1;
  18782. var i = "on" + e, r = i in document;
  18783. if (!r) {
  18784. var t = document.createElement("div");
  18785. t.setAttribute(i, "return;"), r = typeof t[i] == "function";
  18786. }
  18787. return !r && X && e === "wheel" && (r = document.implementation.hasFeature("Events.wheel", "3.0")), r;
  18788. }
  18789. var b = S;
  18790. var O = 10, I = 40, P = 800;
  18791. function T(e) {
  18792. var n = 0, i = 0, r = 0, t = 0;
  18793. 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), {
  18794. spinX: n,
  18795. spinY: i,
  18796. pixelX: r,
  18797. pixelY: t
  18798. };
  18799. }
  18800. T.getEventType = function() {
  18801. return A.firefox() ? "DOMMouseScroll" : b("wheel") ? "wheel" : "mousewheel";
  18802. };
  18803. var Y = T;
  18804. /**
  18805. * Checks if an event is supported in the current execution environment.
  18806. *
  18807. * NOTE: This will not work correctly for non-generic events such as `change`,
  18808. * `reset`, `load`, `error`, and `select`.
  18809. *
  18810. * Borrows from Modernizr.
  18811. *
  18812. * @param {string} eventNameSuffix Event name, e.g. "click".
  18813. * @param {?boolean} capture Check if the capture phase is supported.
  18814. * @return {boolean} True if the event is supported.
  18815. * @internal
  18816. * @license Modernizr 3.0.0pre (Custom Build) | MIT
  18817. */
  18818. //#endregion
  18819. //#region ../../packages/directives/mousewheel/index.ts
  18820. const SCOPE$5 = "_Mousewheel";
  18821. const mousewheel = function(element, callback) {
  18822. if (element && element.addEventListener) {
  18823. removeWheelHandler(element);
  18824. const fn = function(event) {
  18825. const normalized = Y(event);
  18826. callback && Reflect.apply(callback, this, [event, normalized]);
  18827. };
  18828. element[SCOPE$5] = { wheelHandler: fn };
  18829. element.addEventListener("wheel", fn, { passive: true });
  18830. }
  18831. };
  18832. const removeWheelHandler = (element) => {
  18833. if (element[SCOPE$5]?.wheelHandler) {
  18834. element.removeEventListener("wheel", element[SCOPE$5].wheelHandler);
  18835. element[SCOPE$5] = null;
  18836. }
  18837. };
  18838. const Mousewheel = {
  18839. beforeMount(el, binding) {
  18840. mousewheel(el, binding.value);
  18841. },
  18842. unmounted(el) {
  18843. removeWheelHandler(el);
  18844. },
  18845. updated(el, binding) {
  18846. if (binding.value !== binding.oldValue) mousewheel(el, binding.value);
  18847. }
  18848. };
  18849. //#endregion
  18850. //#region ../../packages/components/time-picker/src/props/basic-time-spinner.ts
  18851. const basicTimeSpinnerProps = buildProps({
  18852. role: {
  18853. type: String,
  18854. required: true
  18855. },
  18856. spinnerDate: {
  18857. type: definePropType(Object),
  18858. required: true
  18859. },
  18860. showSeconds: {
  18861. type: Boolean,
  18862. default: true
  18863. },
  18864. arrowControl: Boolean,
  18865. amPmMode: {
  18866. type: definePropType(String),
  18867. default: ""
  18868. },
  18869. ...disabledTimeListsProps
  18870. });
  18871. //#endregion
  18872. //#region ../../packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue?vue&type=script&setup=true&lang.ts
  18873. const _hoisted_1$70 = ["onClick"];
  18874. const _hoisted_2$39 = ["onMouseenter"];
  18875. var basic_time_spinner_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  18876. __name: "basic-time-spinner",
  18877. props: basicTimeSpinnerProps,
  18878. emits: [
  18879. CHANGE_EVENT,
  18880. "select-range",
  18881. "set-option"
  18882. ],
  18883. setup(__props, { emit: __emit }) {
  18884. const props = __props;
  18885. const { isRange, format, saveOnBlur } = (0, vue.inject)(PICKER_BASE_INJECTION_KEY).props;
  18886. const emit = __emit;
  18887. const ns = useNamespace("time");
  18888. const { getHoursList, getMinutesList, getSecondsList } = getTimeLists(props.disabledHours, props.disabledMinutes, props.disabledSeconds);
  18889. let isScrolling = false;
  18890. const ignoreScroll = {
  18891. hours: false,
  18892. minutes: false,
  18893. seconds: false
  18894. };
  18895. const currentScrollbar = (0, vue.ref)();
  18896. const listRefsMap = {
  18897. hours: (0, vue.ref)(),
  18898. minutes: (0, vue.ref)(),
  18899. seconds: (0, vue.ref)()
  18900. };
  18901. const spinnerItems = (0, vue.computed)(() => {
  18902. return props.showSeconds ? timeUnits : timeUnits.slice(0, 2);
  18903. });
  18904. const timePartials = (0, vue.computed)(() => {
  18905. const { spinnerDate } = props;
  18906. return {
  18907. hours: spinnerDate.hour(),
  18908. minutes: spinnerDate.minute(),
  18909. seconds: spinnerDate.second()
  18910. };
  18911. });
  18912. const timeList = (0, vue.computed)(() => {
  18913. const { hours, minutes } = (0, vue.unref)(timePartials);
  18914. const { role, spinnerDate } = props;
  18915. const compare = !isRange ? spinnerDate : void 0;
  18916. return {
  18917. hours: getHoursList(role, compare),
  18918. minutes: getMinutesList(hours, role, compare),
  18919. seconds: getSecondsList(hours, minutes, role, compare)
  18920. };
  18921. });
  18922. const arrowControlTimeList = (0, vue.computed)(() => {
  18923. const { hours, minutes, seconds } = (0, vue.unref)(timePartials);
  18924. return {
  18925. hours: buildTimeList(hours, 23),
  18926. minutes: buildTimeList(minutes, 59),
  18927. seconds: buildTimeList(seconds, 59)
  18928. };
  18929. });
  18930. const debouncedResetScroll = debounce((type) => {
  18931. isScrolling = false;
  18932. adjustCurrentSpinner(type);
  18933. }, 200);
  18934. const getAmPmFlag = (hour) => {
  18935. if (!!!props.amPmMode) return "";
  18936. const isCapital = props.amPmMode === "A";
  18937. let content = hour < 12 ? " am" : " pm";
  18938. if (isCapital) content = content.toUpperCase();
  18939. return content;
  18940. };
  18941. const emitSelectRange = (type) => {
  18942. let range = [0, 0];
  18943. const actualFormat = format || DEFAULT_FORMATS_TIME;
  18944. const hourIndex = actualFormat.indexOf("HH");
  18945. const minuteIndex = actualFormat.indexOf("mm");
  18946. const secondIndex = actualFormat.indexOf("ss");
  18947. switch (type) {
  18948. case "hours":
  18949. if (hourIndex !== -1) range = [hourIndex, hourIndex + 2];
  18950. break;
  18951. case "minutes":
  18952. if (minuteIndex !== -1) range = [minuteIndex, minuteIndex + 2];
  18953. break;
  18954. case "seconds":
  18955. if (secondIndex !== -1) range = [secondIndex, secondIndex + 2];
  18956. break;
  18957. }
  18958. const [left, right] = range;
  18959. emit("select-range", left, right);
  18960. currentScrollbar.value = type;
  18961. };
  18962. const adjustCurrentSpinner = (type) => {
  18963. adjustSpinner(type, (0, vue.unref)(timePartials)[type]);
  18964. };
  18965. const adjustSpinners = () => {
  18966. adjustCurrentSpinner("hours");
  18967. adjustCurrentSpinner("minutes");
  18968. adjustCurrentSpinner("seconds");
  18969. };
  18970. const getScrollbarElement = (el) => el.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  18971. const adjustSpinner = (type, value) => {
  18972. if (props.arrowControl) return;
  18973. const scrollbar = (0, vue.unref)(listRefsMap[type]);
  18974. if (scrollbar && scrollbar.$el) {
  18975. if (!saveOnBlur) {
  18976. ignoreScroll[type] = true;
  18977. rAF(() => {
  18978. ignoreScroll[type] = false;
  18979. });
  18980. }
  18981. getScrollbarElement(scrollbar.$el).scrollTop = Math.max(0, value * typeItemHeight(type));
  18982. }
  18983. };
  18984. const typeItemHeight = (type) => {
  18985. const listItem = (0, vue.unref)(listRefsMap[type])?.$el.querySelector("li");
  18986. if (listItem) return Number.parseFloat(getStyle(listItem, "height")) || 0;
  18987. return 0;
  18988. };
  18989. const onIncrement = () => {
  18990. scrollDown(1);
  18991. };
  18992. const onDecrement = () => {
  18993. scrollDown(-1);
  18994. };
  18995. const scrollDown = (step) => {
  18996. if (!currentScrollbar.value) emitSelectRange("hours");
  18997. const label = currentScrollbar.value;
  18998. const now = (0, vue.unref)(timePartials)[label];
  18999. const next = findNextUnDisabled(label, now, step, currentScrollbar.value === "hours" ? 24 : 60);
  19000. modifyDateField(label, next);
  19001. adjustSpinner(label, next);
  19002. (0, vue.nextTick)(() => emitSelectRange(label));
  19003. };
  19004. const findNextUnDisabled = (type, now, step, total) => {
  19005. let next = (now + step + total) % total;
  19006. const list = (0, vue.unref)(timeList)[type];
  19007. while (list[next] && next !== now) next = (next + step + total) % total;
  19008. return next;
  19009. };
  19010. const modifyDateField = (type, value) => {
  19011. if ((0, vue.unref)(timeList)[type][value]) return;
  19012. const { hours, minutes, seconds } = (0, vue.unref)(timePartials);
  19013. let changeTo;
  19014. switch (type) {
  19015. case "hours":
  19016. changeTo = props.spinnerDate.hour(value).minute(minutes).second(seconds);
  19017. break;
  19018. case "minutes":
  19019. changeTo = props.spinnerDate.hour(hours).minute(value).second(seconds);
  19020. break;
  19021. case "seconds":
  19022. changeTo = props.spinnerDate.hour(hours).minute(minutes).second(value);
  19023. break;
  19024. }
  19025. emit(CHANGE_EVENT, changeTo);
  19026. };
  19027. const handleClick = (type, { value, disabled }) => {
  19028. if (!disabled) {
  19029. modifyDateField(type, value);
  19030. emitSelectRange(type);
  19031. adjustSpinner(type, value);
  19032. }
  19033. };
  19034. const handleScroll = (type) => {
  19035. if (!saveOnBlur && ignoreScroll[type]) return;
  19036. const scrollbar = (0, vue.unref)(listRefsMap[type]);
  19037. if (!scrollbar) return;
  19038. isScrolling = true;
  19039. debouncedResetScroll(type);
  19040. modifyDateField(type, Math.min(Math.round((getScrollbarElement(scrollbar.$el).scrollTop - (scrollBarHeight(type) * .5 - 10) / typeItemHeight(type) + 3) / typeItemHeight(type)), type === "hours" ? 23 : 59));
  19041. };
  19042. const scrollBarHeight = (type) => {
  19043. return (0, vue.unref)(listRefsMap[type]).$el.offsetHeight;
  19044. };
  19045. const bindScrollEvent = () => {
  19046. const bindFunction = (type) => {
  19047. const scrollbar = (0, vue.unref)(listRefsMap[type]);
  19048. if (scrollbar && scrollbar.$el) getScrollbarElement(scrollbar.$el).onscroll = () => {
  19049. handleScroll(type);
  19050. };
  19051. };
  19052. bindFunction("hours");
  19053. bindFunction("minutes");
  19054. bindFunction("seconds");
  19055. };
  19056. (0, vue.onMounted)(() => {
  19057. (0, vue.nextTick)(() => {
  19058. !props.arrowControl && bindScrollEvent();
  19059. adjustSpinners();
  19060. if (props.role === "start") emitSelectRange("hours");
  19061. });
  19062. });
  19063. const setRef = (scrollbar, type) => {
  19064. listRefsMap[type].value = scrollbar ?? void 0;
  19065. };
  19066. emit("set-option", [`${props.role}_scrollDown`, scrollDown]);
  19067. emit("set-option", [`${props.role}_emitSelectRange`, emitSelectRange]);
  19068. (0, vue.watch)(() => props.spinnerDate, () => {
  19069. if (isScrolling) return;
  19070. adjustSpinners();
  19071. });
  19072. return (_ctx, _cache) => {
  19073. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("spinner"), { "has-seconds": _ctx.showSeconds }]) }, [!_ctx.arrowControl ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, (0, vue.renderList)(spinnerItems.value, (item) => {
  19074. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElScrollbar), {
  19075. key: item,
  19076. ref_for: true,
  19077. ref: (scrollbar) => setRef(scrollbar, item),
  19078. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("spinner", "wrapper")),
  19079. "wrap-style": "max-height: inherit;",
  19080. "view-class": (0, vue.unref)(ns).be("spinner", "list"),
  19081. noresize: "",
  19082. tag: "ul",
  19083. onMouseenter: ($event) => emitSelectRange(item),
  19084. onMousemove: ($event) => adjustCurrentSpinner(item)
  19085. }, {
  19086. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(timeList.value[item], (disabled, key) => {
  19087. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  19088. key,
  19089. class: (0, vue.normalizeClass)([
  19090. (0, vue.unref)(ns).be("spinner", "item"),
  19091. (0, vue.unref)(ns).is("active", key === timePartials.value[item]),
  19092. (0, vue.unref)(ns).is("disabled", disabled)
  19093. ]),
  19094. onClick: ($event) => handleClick(item, {
  19095. value: key,
  19096. disabled
  19097. })
  19098. }, [item === "hours" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(("0" + (_ctx.amPmMode ? key % 12 || 12 : key)).slice(-2)) + (0, vue.toDisplayString)(getAmPmFlag(key)), 1)], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(("0" + key).slice(-2)), 1)], 64))], 10, _hoisted_1$70);
  19099. }), 128))]),
  19100. _: 2
  19101. }, 1032, [
  19102. "class",
  19103. "view-class",
  19104. "onMouseenter",
  19105. "onMousemove"
  19106. ]);
  19107. }), 128)) : (0, vue.createCommentVNode)("v-if", true), _ctx.arrowControl ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)(spinnerItems.value, (item) => {
  19108. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  19109. key: item,
  19110. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("spinner", "wrapper"), (0, vue.unref)(ns).is("arrow")]),
  19111. onMouseenter: ($event) => emitSelectRange(item)
  19112. }, [
  19113. (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)(["arrow-up", (0, vue.unref)(ns).be("spinner", "arrow")]) }, {
  19114. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_up_default))]),
  19115. _: 1
  19116. }, 8, ["class"])), [[(0, vue.unref)(vRepeatClick), onDecrement]]),
  19117. (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)(["arrow-down", (0, vue.unref)(ns).be("spinner", "arrow")]) }, {
  19118. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_down_default))]),
  19119. _: 1
  19120. }, 8, ["class"])), [[(0, vue.unref)(vRepeatClick), onIncrement]]),
  19121. (0, vue.createElementVNode)("ul", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("spinner", "list")) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(arrowControlTimeList.value[item], (time, key) => {
  19122. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  19123. key,
  19124. class: (0, vue.normalizeClass)([
  19125. (0, vue.unref)(ns).be("spinner", "item"),
  19126. (0, vue.unref)(ns).is("active", time === timePartials.value[item]),
  19127. (0, vue.unref)(ns).is("disabled", timeList.value[item][time])
  19128. ])
  19129. }, [(0, vue.unref)(isNumber)(time) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [item === "hours" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(("0" + (_ctx.amPmMode ? time % 12 || 12 : time)).slice(-2)) + (0, vue.toDisplayString)(getAmPmFlag(time)), 1)], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(("0" + time).slice(-2)), 1)], 64))], 64)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  19130. }), 128))], 2)
  19131. ], 42, _hoisted_2$39);
  19132. }), 128)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  19133. };
  19134. }
  19135. });
  19136. //#endregion
  19137. //#region ../../packages/components/time-picker/src/time-picker-com/basic-time-spinner.vue
  19138. var basic_time_spinner_default = basic_time_spinner_vue_vue_type_script_setup_true_lang_default;
  19139. //#endregion
  19140. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-pick.vue?vue&type=script&setup=true&lang.ts
  19141. var panel_time_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  19142. __name: "panel-time-pick",
  19143. props: panelTimePickerProps,
  19144. emits: [
  19145. "pick",
  19146. "select-range",
  19147. "set-picker-option"
  19148. ],
  19149. setup(__props, { emit: __emit }) {
  19150. const props = __props;
  19151. const emit = __emit;
  19152. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  19153. const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props;
  19154. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours, disabledMinutes, disabledSeconds);
  19155. const ns = useNamespace("time");
  19156. const { t, lang } = useLocale();
  19157. const selectionRange = (0, vue.ref)([0, 2]);
  19158. const oldValue = useOldValue(props, {
  19159. modelValue: (0, vue.computed)(() => pickerBase.props.modelValue),
  19160. valueOnClear: (0, vue.computed)(() => pickerBase?.emptyValues ? pickerBase.emptyValues.valueOnClear.value : null)
  19161. });
  19162. const transitionName = (0, vue.computed)(() => {
  19163. return isUndefined(props.actualVisible) ? `${ns.namespace.value}-zoom-in-top` : "";
  19164. });
  19165. const showSeconds = (0, vue.computed)(() => {
  19166. return props.format.includes("ss");
  19167. });
  19168. const amPmMode = (0, vue.computed)(() => {
  19169. if (props.format.includes("A")) return "A";
  19170. if (props.format.includes("a")) return "a";
  19171. return "";
  19172. });
  19173. const isValidValue = (_date) => {
  19174. const parsedDate = (0, import_dayjs_min.default)(_date).locale(lang.value);
  19175. const result = getRangeAvailableTime(parsedDate);
  19176. return parsedDate.isSame(result);
  19177. };
  19178. const handleCancel = () => {
  19179. const old = oldValue.value;
  19180. emit("pick", old, false);
  19181. (0, vue.nextTick)(() => {
  19182. oldValue.value = old;
  19183. });
  19184. };
  19185. const handleConfirm = (visible = false, first = false) => {
  19186. if (first) return;
  19187. emit("pick", props.parsedValue, visible);
  19188. };
  19189. const handleChange = (_date) => {
  19190. if (!props.visible) return;
  19191. emit("pick", getRangeAvailableTime(_date).millisecond(0), true);
  19192. };
  19193. const setSelectionRange = (start, end) => {
  19194. emit("select-range", start, end);
  19195. selectionRange.value = [start, end];
  19196. };
  19197. const changeSelectionRange = (step) => {
  19198. const actualFormat = props.format;
  19199. const hourIndex = actualFormat.indexOf("HH");
  19200. const minuteIndex = actualFormat.indexOf("mm");
  19201. const secondIndex = actualFormat.indexOf("ss");
  19202. const list = [];
  19203. const mapping = [];
  19204. if (hourIndex !== -1) {
  19205. list.push(hourIndex);
  19206. mapping.push("hours");
  19207. }
  19208. if (minuteIndex !== -1) {
  19209. list.push(minuteIndex);
  19210. mapping.push("minutes");
  19211. }
  19212. if (secondIndex !== -1 && showSeconds.value) {
  19213. list.push(secondIndex);
  19214. mapping.push("seconds");
  19215. }
  19216. const next = (list.indexOf(selectionRange.value[0]) + step + list.length) % list.length;
  19217. timePickerOptions["start_emitSelectRange"](mapping[next]);
  19218. };
  19219. const handleKeydown = (event) => {
  19220. const code = getEventCode(event);
  19221. const { left, right, up, down } = EVENT_CODE;
  19222. if ([left, right].includes(code)) {
  19223. changeSelectionRange(code === left ? -1 : 1);
  19224. event.preventDefault();
  19225. return;
  19226. }
  19227. if ([up, down].includes(code)) {
  19228. const step = code === up ? -1 : 1;
  19229. timePickerOptions["start_scrollDown"](step);
  19230. event.preventDefault();
  19231. return;
  19232. }
  19233. };
  19234. const { timePickerOptions, onSetOption, getAvailableTime } = useTimePanel({
  19235. getAvailableHours,
  19236. getAvailableMinutes,
  19237. getAvailableSeconds
  19238. });
  19239. const getRangeAvailableTime = (date) => {
  19240. return getAvailableTime(date, props.datetimeRole || "", true);
  19241. };
  19242. const parseUserInput = (value) => {
  19243. if (!value) return null;
  19244. return (0, import_dayjs_min.default)(value, props.format).locale(lang.value);
  19245. };
  19246. const getDefaultValue = () => {
  19247. return (0, import_dayjs_min.default)(defaultValue).locale(lang.value);
  19248. };
  19249. emit("set-picker-option", ["isValidValue", isValidValue]);
  19250. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  19251. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  19252. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  19253. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  19254. emit("set-picker-option", ["handleCancel", handleCancel]);
  19255. return (_ctx, _cache) => {
  19256. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, { name: transitionName.value }, {
  19257. default: (0, vue.withCtx)(() => [_ctx.actualVisible || _ctx.visible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  19258. key: 0,
  19259. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("panel"))
  19260. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("panel", "content"), { "has-seconds": showSeconds.value }]) }, [(0, vue.createVNode)(basic_time_spinner_default, {
  19261. ref: "spinner",
  19262. role: _ctx.datetimeRole || "start",
  19263. "arrow-control": (0, vue.unref)(arrowControl),
  19264. "show-seconds": showSeconds.value,
  19265. "am-pm-mode": amPmMode.value,
  19266. "spinner-date": _ctx.parsedValue,
  19267. "disabled-hours": (0, vue.unref)(disabledHours),
  19268. "disabled-minutes": (0, vue.unref)(disabledMinutes),
  19269. "disabled-seconds": (0, vue.unref)(disabledSeconds),
  19270. onChange: handleChange,
  19271. onSetOption: (0, vue.unref)(onSetOption),
  19272. onSelectRange: setSelectionRange
  19273. }, null, 8, [
  19274. "role",
  19275. "arrow-control",
  19276. "show-seconds",
  19277. "am-pm-mode",
  19278. "spinner-date",
  19279. "disabled-hours",
  19280. "disabled-minutes",
  19281. "disabled-seconds",
  19282. "onSetOption"
  19283. ])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "footer")) }, [(0, vue.createElementVNode)("button", {
  19284. type: "button",
  19285. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("panel", "btn"), "cancel"]),
  19286. onClick: handleCancel
  19287. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.cancel")), 3), (0, vue.createElementVNode)("button", {
  19288. type: "button",
  19289. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("panel", "btn"), "confirm"]),
  19290. onClick: _cache[0] || (_cache[0] = ($event) => handleConfirm())
  19291. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.confirm")), 3)], 2)], 2)) : (0, vue.createCommentVNode)("v-if", true)]),
  19292. _: 1
  19293. }, 8, ["name"]);
  19294. };
  19295. }
  19296. });
  19297. //#endregion
  19298. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-pick.vue
  19299. var panel_time_pick_default = panel_time_pick_vue_vue_type_script_setup_true_lang_default;
  19300. //#endregion
  19301. //#region ../../packages/components/time-picker/src/props/panel-time-range.ts
  19302. const panelTimeRangeProps = buildProps({
  19303. ...timePanelSharedProps,
  19304. parsedValue: { type: definePropType(Array) }
  19305. });
  19306. //#endregion
  19307. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-range.vue?vue&type=script&setup=true&lang.ts
  19308. const _hoisted_1$69 = ["disabled"];
  19309. var panel_time_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  19310. __name: "panel-time-range",
  19311. props: panelTimeRangeProps,
  19312. emits: [
  19313. "pick",
  19314. "select-range",
  19315. "set-picker-option"
  19316. ],
  19317. setup(__props, { emit: __emit }) {
  19318. const props = __props;
  19319. const emit = __emit;
  19320. const makeSelectRange = (start, end) => {
  19321. const result = [];
  19322. for (let i = start; i <= end; i++) result.push(i);
  19323. return result;
  19324. };
  19325. const { t, lang } = useLocale();
  19326. const nsTime = useNamespace("time");
  19327. const nsPicker = useNamespace("picker");
  19328. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  19329. const { arrowControl, disabledHours, disabledMinutes, disabledSeconds, defaultValue } = pickerBase.props;
  19330. const startContainerKls = (0, vue.computed)(() => [
  19331. nsTime.be("range-picker", "body"),
  19332. nsTime.be("panel", "content"),
  19333. nsTime.is("arrow", arrowControl),
  19334. showSeconds.value ? "has-seconds" : ""
  19335. ]);
  19336. const endContainerKls = (0, vue.computed)(() => [
  19337. nsTime.be("range-picker", "body"),
  19338. nsTime.be("panel", "content"),
  19339. nsTime.is("arrow", arrowControl),
  19340. showSeconds.value ? "has-seconds" : ""
  19341. ]);
  19342. const startTime = (0, vue.computed)(() => props.parsedValue[0]);
  19343. const endTime = (0, vue.computed)(() => props.parsedValue[1]);
  19344. const oldValue = useOldValue(props, {
  19345. modelValue: (0, vue.computed)(() => pickerBase.props.modelValue),
  19346. valueOnClear: (0, vue.computed)(() => pickerBase?.emptyValues ? pickerBase.emptyValues.valueOnClear.value : null)
  19347. });
  19348. const handleCancel = () => {
  19349. const old = oldValue.value;
  19350. emit("pick", old, false);
  19351. (0, vue.nextTick)(() => {
  19352. oldValue.value = old;
  19353. });
  19354. };
  19355. const showSeconds = (0, vue.computed)(() => {
  19356. return props.format.includes("ss");
  19357. });
  19358. const amPmMode = (0, vue.computed)(() => {
  19359. if (props.format.includes("A")) return "A";
  19360. if (props.format.includes("a")) return "a";
  19361. return "";
  19362. });
  19363. const handleConfirm = (visible = false) => {
  19364. emit("pick", [startTime.value, endTime.value], visible);
  19365. };
  19366. const handleMinChange = (date) => {
  19367. handleChange(date.millisecond(0), endTime.value);
  19368. };
  19369. const handleMaxChange = (date) => {
  19370. handleChange(startTime.value, date.millisecond(0));
  19371. };
  19372. const isValidValue = (_date) => {
  19373. const parsedDate = _date.map((_) => (0, import_dayjs_min.default)(_).locale(lang.value));
  19374. const result = getRangeAvailableTime(parsedDate);
  19375. return parsedDate[0].isSame(result[0]) && parsedDate[1].isSame(result[1]);
  19376. };
  19377. const handleChange = (start, end) => {
  19378. if (!props.visible) return;
  19379. emit("pick", [start, end], true);
  19380. };
  19381. const btnConfirmDisabled = (0, vue.computed)(() => {
  19382. return startTime.value > endTime.value;
  19383. });
  19384. const selectionRange = (0, vue.ref)([0, 2]);
  19385. const setMinSelectionRange = (start, end) => {
  19386. emit("select-range", start, end, "min");
  19387. selectionRange.value = [start, end];
  19388. };
  19389. const offset = (0, vue.computed)(() => showSeconds.value ? 11 : 8);
  19390. const setMaxSelectionRange = (start, end) => {
  19391. emit("select-range", start, end, "max");
  19392. const _offset = (0, vue.unref)(offset);
  19393. selectionRange.value = [start + _offset, end + _offset];
  19394. };
  19395. const changeSelectionRange = (step) => {
  19396. const list = showSeconds.value ? [
  19397. 0,
  19398. 3,
  19399. 6,
  19400. 11,
  19401. 14,
  19402. 17
  19403. ] : [
  19404. 0,
  19405. 3,
  19406. 8,
  19407. 11
  19408. ];
  19409. const mapping = ["hours", "minutes"].concat(showSeconds.value ? ["seconds"] : []);
  19410. const next = (list.indexOf(selectionRange.value[0]) + step + list.length) % list.length;
  19411. const half = list.length / 2;
  19412. if (next < half) timePickerOptions["start_emitSelectRange"](mapping[next]);
  19413. else timePickerOptions["end_emitSelectRange"](mapping[next - half]);
  19414. };
  19415. const handleKeydown = (event) => {
  19416. const code = getEventCode(event);
  19417. const { left, right, up, down } = EVENT_CODE;
  19418. if ([left, right].includes(code)) {
  19419. changeSelectionRange(code === left ? -1 : 1);
  19420. event.preventDefault();
  19421. return;
  19422. }
  19423. if ([up, down].includes(code)) {
  19424. const step = code === up ? -1 : 1;
  19425. timePickerOptions[`${selectionRange.value[0] < offset.value ? "start" : "end"}_scrollDown`](step);
  19426. event.preventDefault();
  19427. return;
  19428. }
  19429. };
  19430. const disabledHours_ = (role, compare) => {
  19431. const defaultDisable = disabledHours ? disabledHours(role) : [];
  19432. const isStart = role === "start";
  19433. const compareHour = (compare || (isStart ? endTime.value : startTime.value)).hour();
  19434. return union(defaultDisable, isStart ? makeSelectRange(compareHour + 1, 23) : makeSelectRange(0, compareHour - 1));
  19435. };
  19436. const disabledMinutes_ = (hour, role, compare) => {
  19437. const defaultDisable = disabledMinutes ? disabledMinutes(hour, role) : [];
  19438. const isStart = role === "start";
  19439. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  19440. if (hour !== compareDate.hour()) return defaultDisable;
  19441. const compareMinute = compareDate.minute();
  19442. return union(defaultDisable, isStart ? makeSelectRange(compareMinute + 1, 59) : makeSelectRange(0, compareMinute - 1));
  19443. };
  19444. const disabledSeconds_ = (hour, minute, role, compare) => {
  19445. const defaultDisable = disabledSeconds ? disabledSeconds(hour, minute, role) : [];
  19446. const isStart = role === "start";
  19447. const compareDate = compare || (isStart ? endTime.value : startTime.value);
  19448. const compareHour = compareDate.hour();
  19449. const compareMinute = compareDate.minute();
  19450. if (hour !== compareHour || minute !== compareMinute) return defaultDisable;
  19451. const compareSecond = compareDate.second();
  19452. return union(defaultDisable, isStart ? makeSelectRange(compareSecond + 1, 59) : makeSelectRange(0, compareSecond - 1));
  19453. };
  19454. const getRangeAvailableTime = ([start, end]) => {
  19455. return [getAvailableTime(start, "start", true, end), getAvailableTime(end, "end", false, start)];
  19456. };
  19457. const { getAvailableHours, getAvailableMinutes, getAvailableSeconds } = buildAvailableTimeSlotGetter(disabledHours_, disabledMinutes_, disabledSeconds_);
  19458. const { timePickerOptions, getAvailableTime, onSetOption } = useTimePanel({
  19459. getAvailableHours,
  19460. getAvailableMinutes,
  19461. getAvailableSeconds
  19462. });
  19463. const parseUserInput = (days) => {
  19464. if (!days) return null;
  19465. if (isArray$1(days)) return days.map((d) => (0, import_dayjs_min.default)(d, props.format).locale(lang.value));
  19466. return (0, import_dayjs_min.default)(days, props.format).locale(lang.value);
  19467. };
  19468. const getDefaultValue = () => {
  19469. if (isArray$1(defaultValue)) return defaultValue.map((d) => (0, import_dayjs_min.default)(d).locale(lang.value));
  19470. const defaultDay = (0, import_dayjs_min.default)(defaultValue).locale(lang.value);
  19471. return [defaultDay, defaultDay.add(60, "m")];
  19472. };
  19473. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  19474. emit("set-picker-option", ["isValidValue", isValidValue]);
  19475. emit("set-picker-option", ["handleKeydownInput", handleKeydown]);
  19476. emit("set-picker-option", ["getDefaultValue", getDefaultValue]);
  19477. emit("set-picker-option", ["getRangeAvailableTime", getRangeAvailableTime]);
  19478. emit("set-picker-option", ["handleCancel", handleCancel]);
  19479. return (_ctx, _cache) => {
  19480. return _ctx.actualVisible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  19481. key: 0,
  19482. class: (0, vue.normalizeClass)([(0, vue.unref)(nsTime).b("range-picker"), (0, vue.unref)(nsPicker).b("panel")])
  19483. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("range-picker", "content")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("range-picker", "cell")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("range-picker", "header")) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.startTime")), 3), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(startContainerKls.value) }, [(0, vue.createVNode)(basic_time_spinner_default, {
  19484. ref: "minSpinner",
  19485. role: "start",
  19486. "show-seconds": showSeconds.value,
  19487. "am-pm-mode": amPmMode.value,
  19488. "arrow-control": (0, vue.unref)(arrowControl),
  19489. "spinner-date": startTime.value,
  19490. "disabled-hours": disabledHours_,
  19491. "disabled-minutes": disabledMinutes_,
  19492. "disabled-seconds": disabledSeconds_,
  19493. onChange: handleMinChange,
  19494. onSetOption: (0, vue.unref)(onSetOption),
  19495. onSelectRange: setMinSelectionRange
  19496. }, null, 8, [
  19497. "show-seconds",
  19498. "am-pm-mode",
  19499. "arrow-control",
  19500. "spinner-date",
  19501. "onSetOption"
  19502. ])], 2)], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("range-picker", "cell")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("range-picker", "header")) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.endTime")), 3), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(endContainerKls.value) }, [(0, vue.createVNode)(basic_time_spinner_default, {
  19503. ref: "maxSpinner",
  19504. role: "end",
  19505. "show-seconds": showSeconds.value,
  19506. "am-pm-mode": amPmMode.value,
  19507. "arrow-control": (0, vue.unref)(arrowControl),
  19508. "spinner-date": endTime.value,
  19509. "disabled-hours": disabledHours_,
  19510. "disabled-minutes": disabledMinutes_,
  19511. "disabled-seconds": disabledSeconds_,
  19512. onChange: handleMaxChange,
  19513. onSetOption: (0, vue.unref)(onSetOption),
  19514. onSelectRange: setMaxSelectionRange
  19515. }, null, 8, [
  19516. "show-seconds",
  19517. "am-pm-mode",
  19518. "arrow-control",
  19519. "spinner-date",
  19520. "onSetOption"
  19521. ])], 2)], 2)], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsTime).be("panel", "footer")) }, [(0, vue.createElementVNode)("button", {
  19522. type: "button",
  19523. class: (0, vue.normalizeClass)([(0, vue.unref)(nsTime).be("panel", "btn"), "cancel"]),
  19524. onClick: _cache[0] || (_cache[0] = ($event) => handleCancel())
  19525. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.cancel")), 3), (0, vue.createElementVNode)("button", {
  19526. type: "button",
  19527. class: (0, vue.normalizeClass)([(0, vue.unref)(nsTime).be("panel", "btn"), "confirm"]),
  19528. disabled: btnConfirmDisabled.value,
  19529. onClick: _cache[1] || (_cache[1] = ($event) => handleConfirm())
  19530. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.confirm")), 11, _hoisted_1$69)], 2)], 2)) : (0, vue.createCommentVNode)("v-if", true);
  19531. };
  19532. }
  19533. });
  19534. //#endregion
  19535. //#region ../../packages/components/time-picker/src/time-picker-com/panel-time-range.vue
  19536. var panel_time_range_default = panel_time_range_vue_vue_type_script_setup_true_lang_default;
  19537. //#endregion
  19538. //#region ../../packages/components/time-picker/src/time-picker.tsx
  19539. import_dayjs_min.default.extend(import_customParseFormat.default);
  19540. var time_picker_default = /* @__PURE__ */ (0, vue.defineComponent)({
  19541. name: "ElTimePicker",
  19542. install: null,
  19543. props: {
  19544. ...timePickerDefaultProps,
  19545. isRange: Boolean
  19546. },
  19547. emits: [UPDATE_MODEL_EVENT],
  19548. setup(props, ctx) {
  19549. const commonPicker = (0, vue.ref)();
  19550. const [type, Panel] = props.isRange ? ["timerange", panel_time_range_default] : ["time", panel_time_pick_default];
  19551. const modelUpdater = (value) => ctx.emit(UPDATE_MODEL_EVENT, value);
  19552. (0, vue.provide)(PICKER_POPPER_OPTIONS_INJECTION_KEY, props.popperOptions);
  19553. ctx.expose({
  19554. focus: () => {
  19555. commonPicker.value?.focus();
  19556. },
  19557. blur: () => {
  19558. commonPicker.value?.blur();
  19559. },
  19560. handleOpen: () => {
  19561. commonPicker.value?.handleOpen();
  19562. },
  19563. handleClose: () => {
  19564. commonPicker.value?.handleClose();
  19565. }
  19566. });
  19567. return () => {
  19568. const format = props.format ?? DEFAULT_FORMATS_TIME;
  19569. return (0, vue.createVNode)(picker_default, (0, vue.mergeProps)(props, {
  19570. "ref": commonPicker,
  19571. "type": type,
  19572. "format": format,
  19573. "onUpdate:modelValue": modelUpdater
  19574. }), { default: (props) => (0, vue.createVNode)(Panel, props, null) });
  19575. };
  19576. }
  19577. });
  19578. //#endregion
  19579. //#region ../../packages/components/time-picker/index.ts
  19580. const ElTimePicker = withInstall(time_picker_default);
  19581. //#endregion
  19582. //#region ../../packages/components/calendar/src/date-table.ts
  19583. const getPrevMonthLastDays = (date, count) => {
  19584. const lastDay = date.subtract(1, "month").endOf("month").date();
  19585. return rangeArr(count).map((_, index) => lastDay - (count - index - 1));
  19586. };
  19587. const getMonthDays = (date) => {
  19588. return rangeArr(date.daysInMonth()).map((_, index) => index + 1);
  19589. };
  19590. const toNestedArr = (days) => rangeArr(days.length / 7).map((index) => {
  19591. const start = index * 7;
  19592. return days.slice(start, start + 7);
  19593. });
  19594. /**
  19595. * @deprecated Removed after 3.0.0, Use `DateTableProps` instead.
  19596. */
  19597. const dateTableProps = buildProps({
  19598. selectedDay: { type: definePropType(Object) },
  19599. range: { type: definePropType(Array) },
  19600. date: {
  19601. type: definePropType(Object),
  19602. required: true
  19603. },
  19604. hideHeader: { type: Boolean }
  19605. });
  19606. const dateTableEmits = { pick: (value) => isObject$1(value) };
  19607. //#endregion
  19608. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/localeData.js
  19609. var require_localeData = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  19610. (function(n, e) {
  19611. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (n = "undefined" != typeof globalThis ? globalThis : n || self).dayjs_plugin_localeData = e();
  19612. })(exports, (function() {
  19613. "use strict";
  19614. return function(n, e, t) {
  19615. var r = e.prototype, o = function(n) {
  19616. return n && (n.indexOf ? n : n.s);
  19617. }, u = function(n, e, t, r, u) {
  19618. var i = n.name ? n : n.$locale(), a = o(i[e]), s = o(i[t]), f = a || s.map((function(n) {
  19619. return n.slice(0, r);
  19620. }));
  19621. if (!u) return f;
  19622. var d = i.weekStart;
  19623. return f.map((function(n, e) {
  19624. return f[(e + (d || 0)) % 7];
  19625. }));
  19626. }, i = function() {
  19627. return t.Ls[t.locale()];
  19628. }, a = function(n, e) {
  19629. return n.formats[e] || function(n) {
  19630. return n.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(n, e, t) {
  19631. return e || t.slice(1);
  19632. }));
  19633. }(n.formats[e.toUpperCase()]);
  19634. }, s = function() {
  19635. var n = this;
  19636. return {
  19637. months: function(e) {
  19638. return e ? e.format("MMMM") : u(n, "months");
  19639. },
  19640. monthsShort: function(e) {
  19641. return e ? e.format("MMM") : u(n, "monthsShort", "months", 3);
  19642. },
  19643. firstDayOfWeek: function() {
  19644. return n.$locale().weekStart || 0;
  19645. },
  19646. weekdays: function(e) {
  19647. return e ? e.format("dddd") : u(n, "weekdays");
  19648. },
  19649. weekdaysMin: function(e) {
  19650. return e ? e.format("dd") : u(n, "weekdaysMin", "weekdays", 2);
  19651. },
  19652. weekdaysShort: function(e) {
  19653. return e ? e.format("ddd") : u(n, "weekdaysShort", "weekdays", 3);
  19654. },
  19655. longDateFormat: function(e) {
  19656. return a(n.$locale(), e);
  19657. },
  19658. meridiem: this.$locale().meridiem,
  19659. ordinal: this.$locale().ordinal
  19660. };
  19661. };
  19662. r.localeData = function() {
  19663. return s.bind(this)();
  19664. }, t.localeData = function() {
  19665. var n = i();
  19666. return {
  19667. firstDayOfWeek: function() {
  19668. return n.weekStart || 0;
  19669. },
  19670. weekdays: function() {
  19671. return t.weekdays();
  19672. },
  19673. weekdaysShort: function() {
  19674. return t.weekdaysShort();
  19675. },
  19676. weekdaysMin: function() {
  19677. return t.weekdaysMin();
  19678. },
  19679. months: function() {
  19680. return t.months();
  19681. },
  19682. monthsShort: function() {
  19683. return t.monthsShort();
  19684. },
  19685. longDateFormat: function(e) {
  19686. return a(n, e);
  19687. },
  19688. meridiem: n.meridiem,
  19689. ordinal: n.ordinal
  19690. };
  19691. }, t.months = function() {
  19692. return u(i(), "months");
  19693. }, t.monthsShort = function() {
  19694. return u(i(), "monthsShort", "months", 3);
  19695. }, t.weekdays = function(n) {
  19696. return u(i(), "weekdays", null, null, n);
  19697. }, t.weekdaysShort = function(n) {
  19698. return u(i(), "weekdaysShort", "weekdays", 3, n);
  19699. }, t.weekdaysMin = function(n) {
  19700. return u(i(), "weekdaysMin", "weekdays", 2, n);
  19701. };
  19702. };
  19703. }));
  19704. }));
  19705. //#endregion
  19706. //#region ../../packages/components/calendar/src/use-date-table.ts
  19707. var import_localeData = /* @__PURE__ */ __toESM(require_localeData());
  19708. const useDateTable = (props, emit) => {
  19709. import_dayjs_min.default.extend(import_localeData.default);
  19710. const firstDayOfWeek = import_dayjs_min.default.localeData().firstDayOfWeek();
  19711. const { t, lang } = useLocale();
  19712. const now = (0, import_dayjs_min.default)().locale(lang.value);
  19713. const isInRange = (0, vue.computed)(() => !!props.range && !!props.range.length);
  19714. const rows = (0, vue.computed)(() => {
  19715. let days = [];
  19716. if (isInRange.value) {
  19717. const [start, end] = props.range;
  19718. const currentMonthRange = rangeArr(end.date() - start.date() + 1).map((index) => ({
  19719. text: start.date() + index,
  19720. type: "current"
  19721. }));
  19722. let remaining = currentMonthRange.length % 7;
  19723. remaining = remaining === 0 ? 0 : 7 - remaining;
  19724. const nextMonthRange = rangeArr(remaining).map((_, index) => ({
  19725. text: index + 1,
  19726. type: "next"
  19727. }));
  19728. days = currentMonthRange.concat(nextMonthRange);
  19729. } else {
  19730. const firstDay = props.date.startOf("month").day();
  19731. const prevMonthDays = getPrevMonthLastDays(props.date, (firstDay - firstDayOfWeek + 7) % 7).map((day) => ({
  19732. text: day,
  19733. type: "prev"
  19734. }));
  19735. const currentMonthDays = getMonthDays(props.date).map((day) => ({
  19736. text: day,
  19737. type: "current"
  19738. }));
  19739. days = [...prevMonthDays, ...currentMonthDays];
  19740. const nextMonthDays = rangeArr(7 - (days.length % 7 || 7)).map((_, index) => ({
  19741. text: index + 1,
  19742. type: "next"
  19743. }));
  19744. days = days.concat(nextMonthDays);
  19745. }
  19746. return toNestedArr(days);
  19747. });
  19748. const weekDays = (0, vue.computed)(() => {
  19749. const start = firstDayOfWeek;
  19750. if (start === 0) return WEEK_DAYS.map((_) => t(`el.datepicker.weeks.${_}`));
  19751. else return WEEK_DAYS.slice(start).concat(WEEK_DAYS.slice(0, start)).map((_) => t(`el.datepicker.weeks.${_}`));
  19752. });
  19753. const getFormattedDate = (day, type) => {
  19754. switch (type) {
  19755. case "prev": return props.date.startOf("month").subtract(1, "month").date(day);
  19756. case "next": return props.date.startOf("month").add(1, "month").date(day);
  19757. case "current": return props.date.date(day);
  19758. }
  19759. };
  19760. const handlePickDay = ({ text, type }) => {
  19761. emit("pick", getFormattedDate(text, type));
  19762. };
  19763. const getSlotData = ({ text, type }) => {
  19764. const day = getFormattedDate(text, type);
  19765. return {
  19766. isSelected: day.isSame(props.selectedDay),
  19767. type: `${type}-month`,
  19768. day: day.format("YYYY-MM-DD"),
  19769. date: day.toDate()
  19770. };
  19771. };
  19772. return {
  19773. now,
  19774. isInRange,
  19775. rows,
  19776. weekDays,
  19777. getFormattedDate,
  19778. handlePickDay,
  19779. getSlotData
  19780. };
  19781. };
  19782. //#endregion
  19783. //#region ../../packages/components/calendar/src/date-table.vue?vue&type=script&setup=true&lang.ts
  19784. const _hoisted_1$68 = { key: 0 };
  19785. const _hoisted_2$38 = ["onClick"];
  19786. var date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  19787. name: "DateTable",
  19788. __name: "date-table",
  19789. props: dateTableProps,
  19790. emits: dateTableEmits,
  19791. setup(__props, { expose: __expose, emit: __emit }) {
  19792. const props = __props;
  19793. const { isInRange, now, rows, weekDays, getFormattedDate, handlePickDay, getSlotData } = useDateTable(props, __emit);
  19794. const nsTable = useNamespace("calendar-table");
  19795. const nsDay = useNamespace("calendar-day");
  19796. const getCellClass = ({ text, type }) => {
  19797. const classes = [type];
  19798. if (type === "current") {
  19799. const date = getFormattedDate(text, type);
  19800. if (date.isSame(props.selectedDay, "day")) classes.push(nsDay.is("selected"));
  19801. if (date.isSame(now, "day")) classes.push(nsDay.is("today"));
  19802. }
  19803. return classes;
  19804. };
  19805. __expose({ getFormattedDate });
  19806. return (_ctx, _cache) => {
  19807. return (0, vue.openBlock)(), (0, vue.createElementBlock)("table", {
  19808. class: (0, vue.normalizeClass)([(0, vue.unref)(nsTable).b(), (0, vue.unref)(nsTable).is("range", (0, vue.unref)(isInRange))]),
  19809. cellspacing: "0",
  19810. cellpadding: "0"
  19811. }, [!__props.hideHeader ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("thead", _hoisted_1$68, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(weekDays), (day) => {
  19812. return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
  19813. key: day,
  19814. scope: "col"
  19815. }, (0, vue.toDisplayString)(day), 1);
  19816. }), 128))])])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("tbody", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(rows), (row, index) => {
  19817. return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
  19818. key: index,
  19819. class: (0, vue.normalizeClass)({
  19820. [(0, vue.unref)(nsTable).e("row")]: true,
  19821. [(0, vue.unref)(nsTable).em("row", "hide-border")]: index === 0 && __props.hideHeader
  19822. })
  19823. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(row, (cell, key) => {
  19824. return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
  19825. key,
  19826. class: (0, vue.normalizeClass)(getCellClass(cell)),
  19827. onClick: ($event) => (0, vue.unref)(handlePickDay)(cell)
  19828. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsDay).b()) }, [(0, vue.renderSlot)(_ctx.$slots, "date-cell", { data: (0, vue.unref)(getSlotData)(cell) }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(cell.text), 1)])], 2)], 10, _hoisted_2$38);
  19829. }), 128))], 2);
  19830. }), 128))])], 2);
  19831. };
  19832. }
  19833. });
  19834. //#endregion
  19835. //#region ../../packages/components/calendar/src/date-table.vue
  19836. var date_table_default = date_table_vue_vue_type_script_setup_true_lang_default;
  19837. //#endregion
  19838. //#region ../../packages/components/calendar/src/use-calendar.ts
  19839. const adjacentMonth = (start, end) => {
  19840. const firstMonthLastDay = start.endOf("month");
  19841. const lastMonthFirstDay = end.startOf("month");
  19842. const lastMonthStartDay = firstMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  19843. return [[start, firstMonthLastDay], [lastMonthStartDay.startOf("week"), end]];
  19844. };
  19845. const threeConsecutiveMonth = (start, end) => {
  19846. const firstMonthLastDay = start.endOf("month");
  19847. const secondMonthFirstDay = start.add(1, "month").startOf("month");
  19848. const secondMonthStartDay = firstMonthLastDay.isSame(secondMonthFirstDay, "week") ? secondMonthFirstDay.add(1, "week") : secondMonthFirstDay;
  19849. const secondMonthLastDay = secondMonthStartDay.endOf("month");
  19850. const lastMonthFirstDay = end.startOf("month");
  19851. const lastMonthStartDay = secondMonthLastDay.isSame(lastMonthFirstDay, "week") ? lastMonthFirstDay.add(1, "week") : lastMonthFirstDay;
  19852. return [
  19853. [start, firstMonthLastDay],
  19854. [secondMonthStartDay.startOf("week"), secondMonthLastDay],
  19855. [lastMonthStartDay.startOf("week"), end]
  19856. ];
  19857. };
  19858. const useCalendar = (props, emit, componentName) => {
  19859. const { lang } = useLocale();
  19860. const selectedDay = (0, vue.ref)();
  19861. const now = (0, import_dayjs_min.default)().locale(lang.value);
  19862. const realSelectedDay = (0, vue.computed)({
  19863. get() {
  19864. if (!props.modelValue) return selectedDay.value;
  19865. return date.value;
  19866. },
  19867. set(val) {
  19868. if (!val) return;
  19869. selectedDay.value = val;
  19870. const result = val.toDate();
  19871. emit(INPUT_EVENT, result);
  19872. emit(UPDATE_MODEL_EVENT, result);
  19873. }
  19874. });
  19875. const validatedRange = (0, vue.computed)(() => {
  19876. if (!props.range || !isArray$1(props.range) || props.range.length !== 2 || props.range.some((item) => !isDate(item))) return [];
  19877. const [startDayjs, endDayjs] = props.range.map((_) => (0, import_dayjs_min.default)(_).locale(lang.value));
  19878. if (startDayjs.isAfter(endDayjs)) {
  19879. /* @__PURE__ */ debugWarn(componentName, "end time should be greater than start time");
  19880. return [];
  19881. }
  19882. if (startDayjs.isSame(endDayjs, "month")) return calculateValidatedDateRange(startDayjs, endDayjs);
  19883. else {
  19884. if (startDayjs.add(1, "month").month() !== endDayjs.month()) {
  19885. /* @__PURE__ */ debugWarn(componentName, "start time and end time interval must not exceed two months");
  19886. return [];
  19887. }
  19888. return calculateValidatedDateRange(startDayjs, endDayjs);
  19889. }
  19890. });
  19891. const date = (0, vue.computed)(() => {
  19892. if (!props.modelValue) return realSelectedDay.value || (validatedRange.value.length ? validatedRange.value[0][0] : now);
  19893. else return (0, import_dayjs_min.default)(props.modelValue).locale(lang.value);
  19894. });
  19895. const prevMonthDayjs = (0, vue.computed)(() => date.value.subtract(1, "month").date(1));
  19896. const nextMonthDayjs = (0, vue.computed)(() => date.value.add(1, "month").date(1));
  19897. const prevYearDayjs = (0, vue.computed)(() => date.value.subtract(1, "year").date(1));
  19898. const nextYearDayjs = (0, vue.computed)(() => date.value.add(1, "year").date(1));
  19899. const calculateValidatedDateRange = (startDayjs, endDayjs) => {
  19900. const firstDay = startDayjs.startOf("week");
  19901. const lastDay = endDayjs.endOf("week");
  19902. const firstMonth = firstDay.get("month");
  19903. const lastMonth = lastDay.get("month");
  19904. if (firstMonth === lastMonth) return [[firstDay, lastDay]];
  19905. else if ((firstMonth + 1) % 12 === lastMonth) return adjacentMonth(firstDay, lastDay);
  19906. else if (firstMonth + 2 === lastMonth || (firstMonth + 1) % 11 === lastMonth) return threeConsecutiveMonth(firstDay, lastDay);
  19907. else {
  19908. /* @__PURE__ */ debugWarn(componentName, "start time and end time interval must not exceed two months");
  19909. return [];
  19910. }
  19911. };
  19912. const pickDay = (day) => {
  19913. realSelectedDay.value = day;
  19914. };
  19915. const selectDate = (type) => {
  19916. const day = {
  19917. "prev-month": prevMonthDayjs.value,
  19918. "next-month": nextMonthDayjs.value,
  19919. "prev-year": prevYearDayjs.value,
  19920. "next-year": nextYearDayjs.value,
  19921. today: now
  19922. }[type];
  19923. if (!day.isSame(date.value, "day")) pickDay(day);
  19924. };
  19925. const handleDateChange = (date) => {
  19926. if (date === "today") selectDate("today");
  19927. else pickDay(date);
  19928. };
  19929. return {
  19930. calculateValidatedDateRange,
  19931. date,
  19932. realSelectedDay,
  19933. pickDay,
  19934. selectDate,
  19935. validatedRange,
  19936. handleDateChange
  19937. };
  19938. };
  19939. //#endregion
  19940. //#region ../../packages/components/calendar/src/select-controller.ts
  19941. /**
  19942. * @deprecated Removed after 3.0.0, Use `SelectControllerProps` instead.
  19943. */
  19944. const selectControllerProps = buildProps({
  19945. date: {
  19946. type: definePropType(Object),
  19947. required: true
  19948. },
  19949. formatter: { type: definePropType(Function) }
  19950. });
  19951. const selectControllerEmits = { "date-change": (date) => isObject$1(date) || isString(date) };
  19952. //#endregion
  19953. //#region ../../packages/components/tag/src/tag.ts
  19954. /**
  19955. * @deprecated Removed after 3.0.0, Use `TagProps` instead.
  19956. */
  19957. const tagProps = buildProps({
  19958. type: {
  19959. type: String,
  19960. values: [
  19961. "primary",
  19962. "success",
  19963. "info",
  19964. "warning",
  19965. "danger"
  19966. ],
  19967. default: "primary"
  19968. },
  19969. closable: Boolean,
  19970. disableTransitions: Boolean,
  19971. hit: Boolean,
  19972. color: String,
  19973. size: {
  19974. type: String,
  19975. values: componentSizes
  19976. },
  19977. effect: {
  19978. type: String,
  19979. values: [
  19980. "dark",
  19981. "light",
  19982. "plain"
  19983. ],
  19984. default: "light"
  19985. },
  19986. round: Boolean
  19987. });
  19988. const tagEmits = {
  19989. close: (evt) => evt instanceof MouseEvent,
  19990. click: (evt) => evt instanceof MouseEvent
  19991. };
  19992. //#endregion
  19993. //#region ../../packages/components/tag/src/tag.vue?vue&type=script&setup=true&lang.ts
  19994. const _hoisted_1$67 = ["aria-label"];
  19995. const _hoisted_2$37 = ["aria-label"];
  19996. var tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  19997. name: "ElTag",
  19998. __name: "tag",
  19999. props: tagProps,
  20000. emits: tagEmits,
  20001. setup(__props, { emit: __emit }) {
  20002. const props = __props;
  20003. const emit = __emit;
  20004. const tagSize = useFormSize();
  20005. const { t } = useLocale();
  20006. const ns = useNamespace("tag");
  20007. const containerKls = (0, vue.computed)(() => {
  20008. const { type, hit, effect, closable, round } = props;
  20009. return [
  20010. ns.b(),
  20011. ns.is("closable", closable),
  20012. ns.m(type || "primary"),
  20013. ns.m(tagSize.value),
  20014. ns.m(effect),
  20015. ns.is("hit", hit),
  20016. ns.is("round", round)
  20017. ];
  20018. });
  20019. const handleClose = (event) => {
  20020. emit("close", event);
  20021. };
  20022. const handleClick = (event) => {
  20023. emit("click", event);
  20024. };
  20025. const handleVNodeMounted = (vnode) => {
  20026. if (vnode?.component?.subTree?.component?.bum) vnode.component.subTree.component.bum = null;
  20027. };
  20028. return (_ctx, _cache) => {
  20029. return __props.disableTransitions ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  20030. key: 0,
  20031. class: (0, vue.normalizeClass)(containerKls.value),
  20032. style: (0, vue.normalizeStyle)({ backgroundColor: __props.color }),
  20033. onClick: handleClick
  20034. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2), __props.closable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  20035. key: 0,
  20036. "aria-label": (0, vue.unref)(t)("el.tag.close"),
  20037. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close")),
  20038. type: "button",
  20039. onClick: (0, vue.withModifiers)(handleClose, ["stop"])
  20040. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  20041. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  20042. _: 1
  20043. })], 10, _hoisted_1$67)) : (0, vue.createCommentVNode)("v-if", true)], 6)) : ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  20044. key: 1,
  20045. name: `${(0, vue.unref)(ns).namespace.value}-zoom-in-center`,
  20046. appear: "",
  20047. onVnodeMounted: handleVNodeMounted
  20048. }, {
  20049. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", {
  20050. class: (0, vue.normalizeClass)(containerKls.value),
  20051. style: (0, vue.normalizeStyle)({ backgroundColor: __props.color }),
  20052. onClick: handleClick
  20053. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2), __props.closable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  20054. key: 0,
  20055. "aria-label": (0, vue.unref)(t)("el.tag.close"),
  20056. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close")),
  20057. type: "button",
  20058. onClick: (0, vue.withModifiers)(handleClose, ["stop"])
  20059. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  20060. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  20061. _: 1
  20062. })], 10, _hoisted_2$37)) : (0, vue.createCommentVNode)("v-if", true)], 6)]),
  20063. _: 3
  20064. }, 8, ["name"]));
  20065. };
  20066. }
  20067. });
  20068. //#endregion
  20069. //#region ../../packages/components/tag/src/tag.vue
  20070. var tag_default = tag_vue_vue_type_script_setup_true_lang_default;
  20071. //#endregion
  20072. //#region ../../packages/components/tag/index.ts
  20073. const ElTag = withInstall(tag_default);
  20074. //#endregion
  20075. //#region ../../packages/components/select-v2/src/useProps.ts
  20076. const defaultProps$2 = {
  20077. label: "label",
  20078. value: "value",
  20079. disabled: "disabled",
  20080. options: "options"
  20081. };
  20082. function useProps(props) {
  20083. const aliasProps = (0, vue.ref)({
  20084. ...defaultProps$2,
  20085. ...props.props
  20086. });
  20087. let cache = { ...props.props };
  20088. (0, vue.watch)(() => props.props, (val) => {
  20089. if (!isEqual$1(val, cache)) {
  20090. aliasProps.value = {
  20091. ...defaultProps$2,
  20092. ...val
  20093. };
  20094. cache = { ...val };
  20095. }
  20096. }, { deep: true });
  20097. const getLabel = (option) => get(option, aliasProps.value.label);
  20098. const getValue = (option) => get(option, aliasProps.value.value);
  20099. const getDisabled = (option) => get(option, aliasProps.value.disabled);
  20100. const getOptions = (option) => get(option, aliasProps.value.options);
  20101. return {
  20102. aliasProps,
  20103. getLabel,
  20104. getValue,
  20105. getDisabled,
  20106. getOptions
  20107. };
  20108. }
  20109. //#endregion
  20110. //#region ../../packages/components/select/src/token.ts
  20111. const selectGroupKey = Symbol("ElSelectGroup");
  20112. const selectKey = Symbol("ElSelect");
  20113. //#endregion
  20114. //#region ../../packages/components/select/src/option.ts
  20115. const COMPONENT_NAME$14 = "ElOption";
  20116. const optionProps = buildProps({
  20117. value: {
  20118. type: [
  20119. String,
  20120. Number,
  20121. Boolean,
  20122. Object
  20123. ],
  20124. required: true
  20125. },
  20126. label: { type: [String, Number] },
  20127. created: Boolean,
  20128. disabled: Boolean
  20129. });
  20130. //#endregion
  20131. //#region ../../packages/components/select/src/useOption.ts
  20132. function useOption$1(props, states) {
  20133. const select = (0, vue.inject)(selectKey);
  20134. if (!select) throwError(COMPONENT_NAME$14, "usage: <el-select><el-option /></el-select/>");
  20135. const selectGroup = (0, vue.inject)(selectGroupKey, { disabled: false });
  20136. const itemSelected = (0, vue.computed)(() => {
  20137. return contains(castArray$1(select.props.modelValue), props.value);
  20138. });
  20139. const limitReached = (0, vue.computed)(() => {
  20140. if (select.props.multiple) {
  20141. const modelValue = castArray$1(select.props.modelValue ?? []);
  20142. return !itemSelected.value && modelValue.length >= select.props.multipleLimit && select.props.multipleLimit > 0;
  20143. } else return false;
  20144. });
  20145. const currentLabel = (0, vue.computed)(() => {
  20146. return props.label ?? (isObject$1(props.value) ? "" : props.value);
  20147. });
  20148. const currentValue = (0, vue.computed)(() => {
  20149. return props.value || props.label || "";
  20150. });
  20151. const isDisabled = (0, vue.computed)(() => {
  20152. return props.disabled || states.groupDisabled || limitReached.value;
  20153. });
  20154. const instance = (0, vue.getCurrentInstance)();
  20155. const contains = (arr = [], target) => {
  20156. if (!isObject$1(props.value)) return arr && arr.includes(target);
  20157. else {
  20158. const valueKey = select.props.valueKey;
  20159. return arr && arr.some((item) => {
  20160. return (0, vue.toRaw)(get(item, valueKey)) === get(target, valueKey);
  20161. });
  20162. }
  20163. };
  20164. const hoverItem = () => {
  20165. if (!isDisabled.value) select.states.hoveringIndex = select.optionsArray.indexOf(instance.proxy);
  20166. };
  20167. const updateOption = (query) => {
  20168. states.visible = new RegExp(escapeStringRegexp(query), "i").test(String(currentLabel.value)) || props.created;
  20169. };
  20170. (0, vue.watch)(() => currentLabel.value, () => {
  20171. if (!props.created && !select.props.remote) select.setSelected();
  20172. });
  20173. (0, vue.watch)(() => props.value, (val, oldVal) => {
  20174. const { remote, valueKey } = select.props;
  20175. if (remote ? val !== oldVal : !isEqual$1(val, oldVal)) {
  20176. select.onOptionDestroy(oldVal, instance.proxy);
  20177. select.onOptionCreate(instance.proxy);
  20178. }
  20179. if (!props.created && !remote) {
  20180. if (valueKey && isObject$1(val) && isObject$1(oldVal) && val[valueKey] === oldVal[valueKey]) return;
  20181. select.setSelected();
  20182. }
  20183. });
  20184. (0, vue.watch)(() => selectGroup.disabled, () => {
  20185. states.groupDisabled = selectGroup.disabled;
  20186. }, { immediate: true });
  20187. return {
  20188. select,
  20189. currentLabel,
  20190. currentValue,
  20191. itemSelected,
  20192. isDisabled,
  20193. hoverItem,
  20194. updateOption
  20195. };
  20196. }
  20197. //#endregion
  20198. //#region ../../packages/components/select/src/option.vue?vue&type=script&lang.ts
  20199. var option_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  20200. name: COMPONENT_NAME$14,
  20201. componentName: COMPONENT_NAME$14,
  20202. props: optionProps,
  20203. setup(props) {
  20204. const ns = useNamespace("select");
  20205. const id = useId();
  20206. const containerKls = (0, vue.computed)(() => [
  20207. ns.be("dropdown", "item"),
  20208. ns.is("disabled", (0, vue.unref)(isDisabled)),
  20209. ns.is("selected", (0, vue.unref)(itemSelected)),
  20210. ns.is("hovering", (0, vue.unref)(hover))
  20211. ]);
  20212. const states = (0, vue.reactive)({
  20213. index: -1,
  20214. groupDisabled: false,
  20215. visible: true,
  20216. hover: false
  20217. });
  20218. const { currentLabel, itemSelected, isDisabled, select, hoverItem, updateOption } = useOption$1(props, states);
  20219. const { visible, hover } = (0, vue.toRefs)(states);
  20220. const vm = (0, vue.getCurrentInstance)().proxy;
  20221. select.onOptionCreate(vm);
  20222. (0, vue.onBeforeUnmount)(() => {
  20223. const key = vm.value;
  20224. (0, vue.nextTick)(() => {
  20225. const { selected: selectedOptions } = select.states;
  20226. const doesSelected = selectedOptions.some((item) => {
  20227. return item.value === vm.value;
  20228. });
  20229. if (select.states.cachedOptions.get(key) === vm && !doesSelected) select.states.cachedOptions.delete(key);
  20230. });
  20231. select.onOptionDestroy(key, vm);
  20232. });
  20233. function selectOptionClick() {
  20234. if (!isDisabled.value) select.handleOptionSelect(vm);
  20235. }
  20236. return {
  20237. ns,
  20238. id,
  20239. containerKls,
  20240. currentLabel,
  20241. itemSelected,
  20242. isDisabled,
  20243. select,
  20244. visible,
  20245. hover,
  20246. states,
  20247. hoverItem,
  20248. updateOption,
  20249. selectOptionClick
  20250. };
  20251. }
  20252. });
  20253. //#endregion
  20254. //#region ../../packages/components/select/src/option.vue
  20255. const _hoisted_1$66 = [
  20256. "id",
  20257. "aria-disabled",
  20258. "aria-selected"
  20259. ];
  20260. function _sfc_render$20(_ctx, _cache, $props, $setup, $data, $options) {
  20261. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  20262. id: _ctx.id,
  20263. class: (0, vue.normalizeClass)(_ctx.containerKls),
  20264. role: "option",
  20265. "aria-disabled": _ctx.isDisabled || void 0,
  20266. "aria-selected": _ctx.itemSelected,
  20267. onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  20268. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  20269. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.currentLabel), 1)])], 42, _hoisted_1$66)), [[vue.vShow, _ctx.visible]]);
  20270. }
  20271. var option_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_vue_vue_type_script_lang_default, [["render", _sfc_render$20]]);
  20272. //#endregion
  20273. //#region ../../packages/components/select/src/select-dropdown.vue?vue&type=script&lang.ts
  20274. var select_dropdown_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  20275. name: "ElSelectDropdown",
  20276. componentName: "ElSelectDropdown",
  20277. setup() {
  20278. const select = (0, vue.inject)(selectKey);
  20279. const ns = useNamespace("select");
  20280. const popperClass = (0, vue.computed)(() => select.props.popperClass);
  20281. const isMultiple = (0, vue.computed)(() => select.props.multiple);
  20282. const isFitInputWidth = (0, vue.computed)(() => select.props.fitInputWidth);
  20283. const minWidth = (0, vue.ref)("");
  20284. function updateMinWidth() {
  20285. const offsetWidth = select.selectRef?.offsetWidth;
  20286. if (offsetWidth) minWidth.value = `${offsetWidth - BORDER_HORIZONTAL_WIDTH}px`;
  20287. else minWidth.value = "";
  20288. }
  20289. (0, vue.onMounted)(() => {
  20290. updateMinWidth();
  20291. useResizeObserver(select.selectRef, updateMinWidth);
  20292. });
  20293. return {
  20294. ns,
  20295. minWidth,
  20296. popperClass,
  20297. isMultiple,
  20298. isFitInputWidth
  20299. };
  20300. }
  20301. });
  20302. //#endregion
  20303. //#region ../../packages/components/select/src/select-dropdown.vue
  20304. function _sfc_render$19(_ctx, _cache, $props, $setup, $data, $options) {
  20305. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  20306. class: (0, vue.normalizeClass)([
  20307. _ctx.ns.b("dropdown"),
  20308. _ctx.ns.is("multiple", _ctx.isMultiple),
  20309. _ctx.popperClass
  20310. ]),
  20311. style: (0, vue.normalizeStyle)({ [_ctx.isFitInputWidth ? "width" : "minWidth"]: _ctx.minWidth })
  20312. }, [
  20313. _ctx.$slots.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  20314. key: 0,
  20315. class: (0, vue.normalizeClass)(_ctx.ns.be("dropdown", "header"))
  20316. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  20317. (0, vue.renderSlot)(_ctx.$slots, "default"),
  20318. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  20319. key: 1,
  20320. class: (0, vue.normalizeClass)(_ctx.ns.be("dropdown", "footer"))
  20321. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  20322. ], 6);
  20323. }
  20324. var select_dropdown_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$19]]);
  20325. //#endregion
  20326. //#region ../../packages/components/select/src/useSelect.ts
  20327. const useSelect$2 = (props, emit) => {
  20328. const { t } = useLocale();
  20329. const slots = (0, vue.useSlots)();
  20330. const contentId = useId();
  20331. const nsSelect = useNamespace("select");
  20332. const nsInput = useNamespace("input");
  20333. const states = (0, vue.reactive)({
  20334. inputValue: "",
  20335. options: /* @__PURE__ */ new Map(),
  20336. cachedOptions: /* @__PURE__ */ new Map(),
  20337. optionValues: [],
  20338. selected: [],
  20339. selectionWidth: 0,
  20340. collapseItemWidth: 0,
  20341. selectedLabel: "",
  20342. hoveringIndex: -1,
  20343. previousQuery: null,
  20344. inputHovering: false,
  20345. menuVisibleOnFocus: false,
  20346. isBeforeHide: false
  20347. });
  20348. const selectRef = (0, vue.ref)();
  20349. const selectionRef = (0, vue.ref)();
  20350. const tooltipRef = (0, vue.ref)();
  20351. const tagTooltipRef = (0, vue.ref)();
  20352. const inputRef = (0, vue.ref)();
  20353. const prefixRef = (0, vue.ref)();
  20354. const suffixRef = (0, vue.ref)();
  20355. const menuRef = (0, vue.ref)();
  20356. const tagMenuRef = (0, vue.ref)();
  20357. const collapseItemRef = (0, vue.ref)();
  20358. const scrollbarRef = (0, vue.ref)();
  20359. const expanded = (0, vue.ref)(false);
  20360. const hoverOption = (0, vue.ref)();
  20361. const debouncing = (0, vue.ref)(false);
  20362. const { form, formItem } = useFormItem();
  20363. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  20364. const { valueOnClear, isEmptyValue } = useEmptyValues(props);
  20365. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: (e) => onInput(e) });
  20366. const selectDisabled = useFormDisabled();
  20367. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  20368. disabled: selectDisabled,
  20369. afterFocus() {
  20370. if (props.automaticDropdown && !expanded.value) {
  20371. expanded.value = true;
  20372. states.menuVisibleOnFocus = true;
  20373. }
  20374. },
  20375. beforeBlur(event) {
  20376. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  20377. },
  20378. afterBlur() {
  20379. expanded.value = false;
  20380. states.menuVisibleOnFocus = false;
  20381. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  20382. }
  20383. });
  20384. const hasModelValue = (0, vue.computed)(() => {
  20385. return isArray$1(props.modelValue) ? props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  20386. });
  20387. const needStatusIcon = (0, vue.computed)(() => form?.statusIcon ?? false);
  20388. const showClearBtn = (0, vue.computed)(() => {
  20389. return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
  20390. });
  20391. const iconComponent = (0, vue.computed)(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  20392. const iconReverse = (0, vue.computed)(() => nsSelect.is("reverse", !!(iconComponent.value && expanded.value)));
  20393. const validateState = (0, vue.computed)(() => formItem?.validateState || "");
  20394. const validateIcon = (0, vue.computed)(() => validateState.value && ValidateComponentsMap[validateState.value]);
  20395. const debounce = (0, vue.computed)(() => props.remote ? props.debounce : 0);
  20396. const isRemoteSearchEmpty = (0, vue.computed)(() => props.remote && !states.inputValue && states.options.size === 0);
  20397. const emptyText = (0, vue.computed)(() => {
  20398. if (props.loading) return props.loadingText || t("el.select.loading");
  20399. else {
  20400. if (props.filterable && states.inputValue && states.options.size > 0 && filteredOptionsCount.value === 0) return props.noMatchText || t("el.select.noMatch");
  20401. if (states.options.size === 0) return props.noDataText || t("el.select.noData");
  20402. }
  20403. return null;
  20404. });
  20405. const filteredOptionsCount = (0, vue.computed)(() => optionsArray.value.filter((option) => option.visible).length);
  20406. const optionsArray = (0, vue.computed)(() => {
  20407. const list = Array.from(states.options.values());
  20408. const newList = [];
  20409. states.optionValues.forEach((item) => {
  20410. const index = list.findIndex((i) => i.value === item);
  20411. if (index > -1) newList.push(list[index]);
  20412. });
  20413. return newList.length >= list.length ? newList : list;
  20414. });
  20415. const cachedOptionsArray = (0, vue.computed)(() => Array.from(states.cachedOptions.values()));
  20416. const showNewOption = (0, vue.computed)(() => {
  20417. const hasExistingOption = optionsArray.value.filter((option) => {
  20418. return !option.created;
  20419. }).some((option) => {
  20420. return option.currentLabel === states.inputValue;
  20421. });
  20422. return props.filterable && props.allowCreate && states.inputValue !== "" && !hasExistingOption;
  20423. });
  20424. const updateOptions = () => {
  20425. if (props.filterable && isFunction$1(props.filterMethod)) return;
  20426. if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) return;
  20427. optionsArray.value.forEach((option) => {
  20428. option.updateOption?.(states.inputValue);
  20429. });
  20430. };
  20431. const selectSize = useFormSize();
  20432. const collapseTagSize = (0, vue.computed)(() => ["small"].includes(selectSize.value) ? "small" : "default");
  20433. const dropdownMenuVisible = (0, vue.computed)({
  20434. get() {
  20435. return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
  20436. },
  20437. set(val) {
  20438. expanded.value = val;
  20439. }
  20440. });
  20441. const shouldShowPlaceholder = (0, vue.computed)(() => {
  20442. if (props.multiple && !isUndefined(props.modelValue)) return castArray$1(props.modelValue).length === 0 && !states.inputValue;
  20443. const value = isArray$1(props.modelValue) ? props.modelValue[0] : props.modelValue;
  20444. return props.filterable || isUndefined(value) ? !states.inputValue : true;
  20445. });
  20446. const currentPlaceholder = (0, vue.computed)(() => {
  20447. const _placeholder = props.placeholder ?? t("el.select.placeholder");
  20448. return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  20449. });
  20450. const mouseEnterEventName = (0, vue.computed)(() => isIOS ? null : "mouseenter");
  20451. (0, vue.watch)(() => props.modelValue, (val, oldVal) => {
  20452. if (props.multiple) {
  20453. if (props.filterable && !props.reserveKeyword) {
  20454. states.inputValue = "";
  20455. handleQueryChange("");
  20456. }
  20457. }
  20458. setSelected();
  20459. if (!isEqual$1(val, oldVal) && props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  20460. }, {
  20461. flush: "post",
  20462. deep: true
  20463. });
  20464. (0, vue.watch)(() => expanded.value, (val) => {
  20465. if (val) handleQueryChange(states.inputValue);
  20466. else {
  20467. states.inputValue = "";
  20468. states.previousQuery = null;
  20469. states.isBeforeHide = true;
  20470. states.menuVisibleOnFocus = false;
  20471. }
  20472. });
  20473. (0, vue.watch)(() => states.options.entries(), () => {
  20474. if (!isClient) return;
  20475. setSelected();
  20476. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) checkDefaultFirstOption();
  20477. }, { flush: "post" });
  20478. (0, vue.watch)([() => states.hoveringIndex, optionsArray], ([val]) => {
  20479. if (isNumber(val) && val > -1) hoverOption.value = optionsArray.value[val] || {};
  20480. else hoverOption.value = {};
  20481. optionsArray.value.forEach((option) => {
  20482. option.hover = hoverOption.value === option;
  20483. });
  20484. });
  20485. (0, vue.watchEffect)(() => {
  20486. if (states.isBeforeHide) return;
  20487. updateOptions();
  20488. });
  20489. const handleQueryChange = (val) => {
  20490. if (states.previousQuery === val || isComposing.value) return;
  20491. states.previousQuery = val;
  20492. if (props.filterable && isFunction$1(props.filterMethod)) props.filterMethod(val);
  20493. else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) props.remoteMethod(val);
  20494. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptionsCount.value) (0, vue.nextTick)(checkDefaultFirstOption);
  20495. else (0, vue.nextTick)(updateHoveringIndex);
  20496. };
  20497. /**
  20498. * find and highlight first option as default selected
  20499. * @remark
  20500. * - if the first option in dropdown list is user-created,
  20501. * it would be at the end of the optionsArray
  20502. * so find it and set hover.
  20503. * (NOTE: there must be only one user-created option in dropdown list with query)
  20504. * - if there's no user-created option in list, just find the first one as usual
  20505. * (NOTE: exclude options that are disabled or in disabled-group)
  20506. */
  20507. const checkDefaultFirstOption = () => {
  20508. const optionsInDropdown = optionsArray.value.filter((n) => n.visible && !n.disabled && !n.states.groupDisabled);
  20509. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  20510. const firstOriginOption = optionsInDropdown[0];
  20511. states.hoveringIndex = getValueIndex(optionsArray.value.map((item) => item.value), userCreatedOption || firstOriginOption);
  20512. };
  20513. const setSelected = () => {
  20514. if (!props.multiple) {
  20515. const option = getOption(isArray$1(props.modelValue) ? props.modelValue[0] : props.modelValue);
  20516. states.selectedLabel = option.currentLabel;
  20517. states.selected = [option];
  20518. return;
  20519. } else states.selectedLabel = "";
  20520. const result = [];
  20521. if (!isUndefined(props.modelValue)) castArray$1(props.modelValue).forEach((value) => {
  20522. result.push(getOption(value));
  20523. });
  20524. states.selected = result;
  20525. };
  20526. const getOption = (value) => {
  20527. let option;
  20528. const isObjectValue = isPlainObject$1(value);
  20529. for (let i = states.cachedOptions.size - 1; i >= 0; i--) {
  20530. const cachedOption = cachedOptionsArray.value[i];
  20531. if (isObjectValue ? get(cachedOption.value, props.valueKey) === get(value, props.valueKey) : cachedOption.value === value) {
  20532. option = {
  20533. index: optionsArray.value.filter((opt) => !opt.created).indexOf(cachedOption),
  20534. value,
  20535. currentLabel: cachedOption.currentLabel,
  20536. get isDisabled() {
  20537. return cachedOption.isDisabled;
  20538. }
  20539. };
  20540. break;
  20541. }
  20542. }
  20543. if (option) return option;
  20544. return {
  20545. index: -1,
  20546. value,
  20547. currentLabel: isObjectValue ? value.label : value ?? ""
  20548. };
  20549. };
  20550. const updateHoveringIndex = () => {
  20551. const length = states.selected.length;
  20552. if (length > 0) {
  20553. const lastOption = states.selected[length - 1];
  20554. states.hoveringIndex = optionsArray.value.findIndex((item) => getValueKey(lastOption) === getValueKey(item));
  20555. } else states.hoveringIndex = -1;
  20556. };
  20557. const resetSelectionWidth = () => {
  20558. states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  20559. };
  20560. const resetCollapseItemWidth = () => {
  20561. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  20562. };
  20563. const updateTooltip = () => {
  20564. tooltipRef.value?.updatePopper?.();
  20565. };
  20566. const updateTagTooltip = () => {
  20567. tagTooltipRef.value?.updatePopper?.();
  20568. };
  20569. const onInputChange = () => {
  20570. if (states.inputValue.length > 0 && !expanded.value) expanded.value = true;
  20571. handleQueryChange(states.inputValue);
  20572. };
  20573. const onInput = (event) => {
  20574. states.inputValue = event.target.value;
  20575. if (props.remote) {
  20576. debouncing.value = true;
  20577. debouncedOnInputChange();
  20578. } else return onInputChange();
  20579. };
  20580. const debouncedOnInputChange = useDebounceFn(() => {
  20581. onInputChange();
  20582. debouncing.value = false;
  20583. }, debounce);
  20584. const emitChange = (val) => {
  20585. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  20586. };
  20587. const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => {
  20588. const option = states.cachedOptions.get(it);
  20589. return !option?.disabled && !option?.states.groupDisabled;
  20590. });
  20591. const deletePrevTag = (e) => {
  20592. const code = getEventCode(e);
  20593. if (!props.multiple) return;
  20594. if (code === EVENT_CODE.delete) return;
  20595. if (e.target.value.length <= 0) {
  20596. const value = castArray$1(props.modelValue).slice();
  20597. const lastNotDisabledIndex = getLastNotDisabledIndex(value);
  20598. if (lastNotDisabledIndex < 0) return;
  20599. const removeTagValue = value[lastNotDisabledIndex];
  20600. value.splice(lastNotDisabledIndex, 1);
  20601. emit(UPDATE_MODEL_EVENT, value);
  20602. emitChange(value);
  20603. emit("remove-tag", removeTagValue);
  20604. }
  20605. };
  20606. const deleteTag = (event, tag) => {
  20607. const index = states.selected.indexOf(tag);
  20608. if (index > -1 && !selectDisabled.value) {
  20609. const value = castArray$1(props.modelValue).slice();
  20610. value.splice(index, 1);
  20611. emit(UPDATE_MODEL_EVENT, value);
  20612. emitChange(value);
  20613. emit("remove-tag", tag.value);
  20614. }
  20615. event.stopPropagation();
  20616. focus();
  20617. };
  20618. const deleteSelected = (event) => {
  20619. event.stopPropagation();
  20620. const value = props.multiple ? [] : valueOnClear.value;
  20621. if (props.multiple) {
  20622. for (const item of states.selected) if (item.isDisabled) value.push(item.value);
  20623. }
  20624. emit(UPDATE_MODEL_EVENT, value);
  20625. emitChange(value);
  20626. states.hoveringIndex = -1;
  20627. expanded.value = false;
  20628. emit("clear");
  20629. focus();
  20630. };
  20631. const handleOptionSelect = (option) => {
  20632. if (props.multiple) {
  20633. const value = castArray$1(props.modelValue ?? []).slice();
  20634. const optionIndex = getValueIndex(value, option);
  20635. if (optionIndex > -1) value.splice(optionIndex, 1);
  20636. else if (props.multipleLimit <= 0 || value.length < props.multipleLimit) value.push(option.value);
  20637. emit(UPDATE_MODEL_EVENT, value);
  20638. emitChange(value);
  20639. if (option.created) handleQueryChange("");
  20640. if (props.filterable && (option.created || !props.reserveKeyword)) states.inputValue = "";
  20641. } else {
  20642. !isEqual$1(props.modelValue, option.value) && emit(UPDATE_MODEL_EVENT, option.value);
  20643. emitChange(option.value);
  20644. expanded.value = false;
  20645. }
  20646. focus();
  20647. if (expanded.value) return;
  20648. (0, vue.nextTick)(() => {
  20649. scrollToOption(option);
  20650. });
  20651. };
  20652. const getValueIndex = (arr, option) => {
  20653. if (isUndefined(option)) return -1;
  20654. if (!isObject$1(option.value)) return arr.indexOf(option.value);
  20655. return arr.findIndex((item) => {
  20656. return isEqual$1(get(item, props.valueKey), getValueKey(option));
  20657. });
  20658. };
  20659. const scrollToOption = (option) => {
  20660. const targetOption = isArray$1(option) ? option[option.length - 1] : option;
  20661. let target = null;
  20662. if (!isNil(targetOption?.value)) {
  20663. const options = optionsArray.value.filter((item) => item.value === targetOption.value);
  20664. if (options.length > 0) target = options[0].$el;
  20665. }
  20666. if (tooltipRef.value && target) {
  20667. const menu = tooltipRef.value?.popperRef?.contentRef?.querySelector?.(`.${nsSelect.be("dropdown", "wrap")}`);
  20668. if (menu) scrollIntoView(menu, target);
  20669. }
  20670. scrollbarRef.value?.handleScroll();
  20671. };
  20672. const onOptionCreate = (vm) => {
  20673. states.options.set(vm.value, vm);
  20674. states.cachedOptions.set(vm.value, vm);
  20675. };
  20676. const onOptionDestroy = (key, vm) => {
  20677. if (states.options.get(key) === vm) states.options.delete(key);
  20678. };
  20679. const popperRef = (0, vue.computed)(() => {
  20680. return tooltipRef.value?.popperRef?.contentRef;
  20681. });
  20682. const handleMenuEnter = () => {
  20683. states.isBeforeHide = false;
  20684. (0, vue.nextTick)(() => {
  20685. scrollbarRef.value?.update();
  20686. scrollToOption(states.selected);
  20687. });
  20688. };
  20689. const focus = () => {
  20690. inputRef.value?.focus();
  20691. };
  20692. const blur = () => {
  20693. if (expanded.value) {
  20694. expanded.value = false;
  20695. (0, vue.nextTick)(() => inputRef.value?.blur());
  20696. return;
  20697. }
  20698. inputRef.value?.blur();
  20699. };
  20700. const handleClearClick = (event) => {
  20701. deleteSelected(event);
  20702. };
  20703. const handleClickOutside = (event) => {
  20704. expanded.value = false;
  20705. if (isFocused.value) {
  20706. const _event = new FocusEvent("blur", event);
  20707. (0, vue.nextTick)(() => handleBlur(_event));
  20708. }
  20709. };
  20710. const handleEsc = () => {
  20711. if (states.inputValue.length > 0) states.inputValue = "";
  20712. else expanded.value = false;
  20713. };
  20714. const toggleMenu = (event) => {
  20715. if (selectDisabled.value || props.filterable && expanded.value && event && !suffixRef.value?.contains(event.target)) return;
  20716. if (isIOS) states.inputHovering = true;
  20717. if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false;
  20718. else expanded.value = !expanded.value;
  20719. };
  20720. const selectOption = () => {
  20721. if (!expanded.value) toggleMenu();
  20722. else {
  20723. const option = optionsArray.value[states.hoveringIndex];
  20724. if (option && !option.isDisabled) handleOptionSelect(option);
  20725. }
  20726. };
  20727. const getValueKey = (item) => {
  20728. return isObject$1(item.value) ? get(item.value, props.valueKey) : item.value;
  20729. };
  20730. const optionsAllDisabled = (0, vue.computed)(() => optionsArray.value.filter((option) => option.visible).every((option) => option.isDisabled));
  20731. const showTagList = (0, vue.computed)(() => {
  20732. if (!props.multiple) return [];
  20733. return props.collapseTags ? states.selected.slice(0, props.maxCollapseTags) : states.selected;
  20734. });
  20735. const collapseTagList = (0, vue.computed)(() => {
  20736. if (!props.multiple) return [];
  20737. return props.collapseTags ? states.selected.slice(props.maxCollapseTags) : [];
  20738. });
  20739. const navigateOptions = (direction) => {
  20740. if (!expanded.value) {
  20741. expanded.value = true;
  20742. return;
  20743. }
  20744. if (states.options.size === 0 || filteredOptionsCount.value === 0 || isComposing.value) return;
  20745. if (!optionsAllDisabled.value) {
  20746. if (direction === "next") {
  20747. states.hoveringIndex++;
  20748. if (states.hoveringIndex === states.options.size) states.hoveringIndex = 0;
  20749. } else if (direction === "prev") {
  20750. states.hoveringIndex--;
  20751. if (states.hoveringIndex < 0) states.hoveringIndex = states.options.size - 1;
  20752. }
  20753. const option = optionsArray.value[states.hoveringIndex];
  20754. if (option.isDisabled || !option.visible) navigateOptions(direction);
  20755. (0, vue.nextTick)(() => scrollToOption(hoverOption.value));
  20756. }
  20757. };
  20758. const findFocusableIndex = (arr, start, step, len) => {
  20759. for (let i = start; i >= 0 && i < len; i += step) {
  20760. const obj = arr[i];
  20761. if (!obj?.isDisabled && obj?.visible) return i;
  20762. }
  20763. return null;
  20764. };
  20765. const focusOption = (targetIndex, mode) => {
  20766. const len = states.options.size;
  20767. if (len === 0) return;
  20768. const start = clamp$1(targetIndex, 0, len - 1);
  20769. const options = optionsArray.value;
  20770. const direction = mode === "up" ? -1 : 1;
  20771. const newIndex = findFocusableIndex(options, start, direction, len) ?? findFocusableIndex(options, start - direction, -direction, len);
  20772. if (newIndex != null) {
  20773. states.hoveringIndex = newIndex;
  20774. (0, vue.nextTick)(() => scrollToOption(hoverOption.value));
  20775. }
  20776. };
  20777. const handleKeydown = (e) => {
  20778. const code = getEventCode(e);
  20779. let isPreventDefault = true;
  20780. switch (code) {
  20781. case EVENT_CODE.up:
  20782. navigateOptions("prev");
  20783. break;
  20784. case EVENT_CODE.down:
  20785. navigateOptions("next");
  20786. break;
  20787. case EVENT_CODE.enter:
  20788. case EVENT_CODE.numpadEnter:
  20789. if (!isComposing.value) selectOption();
  20790. break;
  20791. case EVENT_CODE.esc:
  20792. handleEsc();
  20793. break;
  20794. case EVENT_CODE.backspace:
  20795. isPreventDefault = false;
  20796. deletePrevTag(e);
  20797. return;
  20798. case EVENT_CODE.home:
  20799. if (!expanded.value) return;
  20800. focusOption(0, "down");
  20801. break;
  20802. case EVENT_CODE.end:
  20803. if (!expanded.value) return;
  20804. focusOption(states.options.size - 1, "up");
  20805. break;
  20806. case EVENT_CODE.pageUp:
  20807. if (!expanded.value) return;
  20808. focusOption(states.hoveringIndex - 10, "up");
  20809. break;
  20810. case EVENT_CODE.pageDown:
  20811. if (!expanded.value) return;
  20812. focusOption(states.hoveringIndex + 10, "down");
  20813. break;
  20814. default:
  20815. isPreventDefault = false;
  20816. break;
  20817. }
  20818. if (isPreventDefault) {
  20819. e.preventDefault();
  20820. e.stopPropagation();
  20821. }
  20822. };
  20823. const getGapWidth = () => {
  20824. if (!selectionRef.value) return 0;
  20825. const style = window.getComputedStyle(selectionRef.value);
  20826. return Number.parseFloat(style.gap || "6px");
  20827. };
  20828. const tagStyle = (0, vue.computed)(() => {
  20829. const gapWidth = getGapWidth();
  20830. const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
  20831. return { maxWidth: `${collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` };
  20832. });
  20833. const collapseTagStyle = (0, vue.computed)(() => {
  20834. return { maxWidth: `${states.selectionWidth}px` };
  20835. });
  20836. const popupScroll = (data) => {
  20837. emit("popup-scroll", data);
  20838. };
  20839. useResizeObserver(selectionRef, resetSelectionWidth);
  20840. useResizeObserver(wrapperRef, updateTooltip);
  20841. useResizeObserver(tagMenuRef, updateTagTooltip);
  20842. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  20843. let stop;
  20844. (0, vue.watch)(() => dropdownMenuVisible.value, (newVal) => {
  20845. if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop;
  20846. else {
  20847. stop?.();
  20848. stop = void 0;
  20849. }
  20850. emit("visible-change", newVal);
  20851. });
  20852. (0, vue.onMounted)(() => {
  20853. setSelected();
  20854. });
  20855. return {
  20856. inputId,
  20857. contentId,
  20858. nsSelect,
  20859. nsInput,
  20860. states,
  20861. isFocused,
  20862. expanded,
  20863. optionsArray,
  20864. hoverOption,
  20865. selectSize,
  20866. filteredOptionsCount,
  20867. updateTooltip,
  20868. updateTagTooltip,
  20869. debouncedOnInputChange,
  20870. onInput,
  20871. deletePrevTag,
  20872. deleteTag,
  20873. deleteSelected,
  20874. handleOptionSelect,
  20875. scrollToOption,
  20876. hasModelValue,
  20877. shouldShowPlaceholder,
  20878. currentPlaceholder,
  20879. mouseEnterEventName,
  20880. needStatusIcon,
  20881. showClearBtn,
  20882. iconComponent,
  20883. iconReverse,
  20884. validateState,
  20885. validateIcon,
  20886. showNewOption,
  20887. updateOptions,
  20888. collapseTagSize,
  20889. setSelected,
  20890. selectDisabled,
  20891. emptyText,
  20892. handleCompositionStart,
  20893. handleCompositionUpdate,
  20894. handleCompositionEnd,
  20895. handleKeydown,
  20896. onOptionCreate,
  20897. onOptionDestroy,
  20898. handleMenuEnter,
  20899. focus,
  20900. blur,
  20901. handleClearClick,
  20902. handleClickOutside,
  20903. handleEsc,
  20904. toggleMenu,
  20905. selectOption,
  20906. getValueKey,
  20907. navigateOptions,
  20908. dropdownMenuVisible,
  20909. showTagList,
  20910. collapseTagList,
  20911. popupScroll,
  20912. getOption,
  20913. tagStyle,
  20914. collapseTagStyle,
  20915. popperRef,
  20916. inputRef,
  20917. tooltipRef,
  20918. tagTooltipRef,
  20919. prefixRef,
  20920. suffixRef,
  20921. selectRef,
  20922. wrapperRef,
  20923. selectionRef,
  20924. scrollbarRef,
  20925. menuRef,
  20926. tagMenuRef,
  20927. collapseItemRef
  20928. };
  20929. };
  20930. //#endregion
  20931. //#region ../../packages/components/select/src/options.ts
  20932. var options_default = (0, vue.defineComponent)({
  20933. name: "ElOptions",
  20934. setup(_, { slots }) {
  20935. const select = (0, vue.inject)(selectKey);
  20936. let cachedValueList = [];
  20937. return () => {
  20938. const children = slots.default?.();
  20939. const valueList = [];
  20940. function filterOptions(children) {
  20941. if (!isArray$1(children)) return;
  20942. children.forEach((item) => {
  20943. const name = (item?.type || {})?.name;
  20944. if (name === "ElOptionGroup") filterOptions(!isString(item.children) && !isArray$1(item.children) && isFunction$1(item.children?.default) ? item.children?.default() : item.children);
  20945. else if (name === "ElOption") valueList.push(item.props?.value);
  20946. else if (isArray$1(item.children)) filterOptions(item.children);
  20947. });
  20948. }
  20949. if (children.length) filterOptions(children[0]?.children);
  20950. if (!isEqual$1(valueList, cachedValueList)) {
  20951. cachedValueList = valueList;
  20952. if (select) select.states.optionValues = valueList;
  20953. }
  20954. return children;
  20955. };
  20956. }
  20957. });
  20958. //#endregion
  20959. //#region ../../packages/components/select/src/select.ts
  20960. const selectProps = buildProps({
  20961. name: String,
  20962. id: String,
  20963. modelValue: {
  20964. type: definePropType([
  20965. Array,
  20966. String,
  20967. Number,
  20968. Boolean,
  20969. Object
  20970. ]),
  20971. default: void 0
  20972. },
  20973. autocomplete: {
  20974. type: String,
  20975. default: "off"
  20976. },
  20977. automaticDropdown: Boolean,
  20978. size: useSizeProp,
  20979. effect: {
  20980. type: definePropType(String),
  20981. default: "light"
  20982. },
  20983. disabled: {
  20984. type: Boolean,
  20985. default: void 0
  20986. },
  20987. clearable: Boolean,
  20988. filterable: Boolean,
  20989. allowCreate: Boolean,
  20990. loading: Boolean,
  20991. popperClass: {
  20992. type: String,
  20993. default: ""
  20994. },
  20995. popperStyle: { type: definePropType([String, Object]) },
  20996. popperOptions: {
  20997. type: definePropType(Object),
  20998. default: () => ({})
  20999. },
  21000. remote: Boolean,
  21001. debounce: {
  21002. type: Number,
  21003. default: 300
  21004. },
  21005. loadingText: String,
  21006. noMatchText: String,
  21007. noDataText: String,
  21008. remoteMethod: { type: definePropType(Function) },
  21009. filterMethod: { type: definePropType(Function) },
  21010. multiple: Boolean,
  21011. multipleLimit: {
  21012. type: Number,
  21013. default: 0
  21014. },
  21015. placeholder: { type: String },
  21016. defaultFirstOption: Boolean,
  21017. reserveKeyword: {
  21018. type: Boolean,
  21019. default: true
  21020. },
  21021. valueKey: {
  21022. type: String,
  21023. default: "value"
  21024. },
  21025. collapseTags: Boolean,
  21026. collapseTagsTooltip: Boolean,
  21027. tagTooltip: {
  21028. type: definePropType(Object),
  21029. default: () => ({})
  21030. },
  21031. maxCollapseTags: {
  21032. type: Number,
  21033. default: 1
  21034. },
  21035. teleported: useTooltipContentProps.teleported,
  21036. persistent: {
  21037. type: Boolean,
  21038. default: true
  21039. },
  21040. clearIcon: {
  21041. type: iconPropType,
  21042. default: circle_close_default
  21043. },
  21044. fitInputWidth: Boolean,
  21045. suffixIcon: {
  21046. type: iconPropType,
  21047. default: arrow_down_default
  21048. },
  21049. tagType: {
  21050. ...tagProps.type,
  21051. default: "info"
  21052. },
  21053. tagEffect: {
  21054. ...tagProps.effect,
  21055. default: "light"
  21056. },
  21057. validateEvent: {
  21058. type: Boolean,
  21059. default: true
  21060. },
  21061. remoteShowSuffix: Boolean,
  21062. showArrow: {
  21063. type: Boolean,
  21064. default: true
  21065. },
  21066. offset: {
  21067. type: Number,
  21068. default: 12
  21069. },
  21070. placement: {
  21071. type: definePropType(String),
  21072. values: Ee,
  21073. default: "bottom-start"
  21074. },
  21075. fallbackPlacements: {
  21076. type: definePropType(Array),
  21077. default: [
  21078. "bottom-start",
  21079. "top-start",
  21080. "right",
  21081. "left"
  21082. ]
  21083. },
  21084. tabindex: {
  21085. type: [String, Number],
  21086. default: 0
  21087. },
  21088. appendTo: useTooltipContentProps.appendTo,
  21089. options: { type: definePropType(Array) },
  21090. props: {
  21091. type: definePropType(Object),
  21092. default: () => defaultProps$2
  21093. },
  21094. ...useEmptyValuesProps,
  21095. ...useAriaProps(["ariaLabel"])
  21096. });
  21097. const selectEmits = {
  21098. [UPDATE_MODEL_EVENT]: (val) => true,
  21099. [CHANGE_EVENT]: (val) => true,
  21100. "popup-scroll": scrollbarEmits.scroll,
  21101. "remove-tag": (val) => true,
  21102. "visible-change": (visible) => true,
  21103. focus: (evt) => evt instanceof FocusEvent,
  21104. blur: (evt) => evt instanceof FocusEvent,
  21105. clear: () => true
  21106. };
  21107. //#endregion
  21108. //#region ../../packages/components/select/src/option-group.vue?vue&type=script&lang.ts
  21109. var option_group_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  21110. name: "ElOptionGroup",
  21111. componentName: "ElOptionGroup",
  21112. props: {
  21113. label: String,
  21114. disabled: Boolean
  21115. },
  21116. setup(props) {
  21117. const ns = useNamespace("select");
  21118. const groupRef = (0, vue.ref)();
  21119. const instance = (0, vue.getCurrentInstance)();
  21120. const children = (0, vue.ref)([]);
  21121. (0, vue.provide)(selectGroupKey, (0, vue.reactive)({ ...(0, vue.toRefs)(props) }));
  21122. const visible = (0, vue.computed)(() => children.value.some((option) => option.visible === true));
  21123. const isOption = (node) => node.type.name === "ElOption" && !!node.component?.proxy;
  21124. const flattedChildren = (node) => {
  21125. const nodes = castArray$1(node);
  21126. const children = [];
  21127. nodes.forEach((child) => {
  21128. if (!(0, vue.isVNode)(child)) return;
  21129. if (isOption(child)) children.push(child.component.proxy);
  21130. else if (isArray$1(child.children) && child.children.length) children.push(...flattedChildren(child.children));
  21131. else if (child.component?.subTree) children.push(...flattedChildren(child.component.subTree));
  21132. });
  21133. return children;
  21134. };
  21135. const updateChildren = () => {
  21136. children.value = flattedChildren(instance.subTree);
  21137. };
  21138. (0, vue.onMounted)(() => {
  21139. updateChildren();
  21140. });
  21141. useMutationObserver(groupRef, updateChildren, {
  21142. attributes: true,
  21143. subtree: true,
  21144. childList: true
  21145. });
  21146. return {
  21147. groupRef,
  21148. visible,
  21149. ns
  21150. };
  21151. }
  21152. });
  21153. //#endregion
  21154. //#region ../../packages/components/select/src/option-group.vue
  21155. function _sfc_render$18(_ctx, _cache, $props, $setup, $data, $options) {
  21156. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", {
  21157. ref: "groupRef",
  21158. class: (0, vue.normalizeClass)(_ctx.ns.be("group", "wrap"))
  21159. }, [(0, vue.createElementVNode)("li", { class: (0, vue.normalizeClass)(_ctx.ns.be("group", "title")) }, (0, vue.toDisplayString)(_ctx.label), 3), (0, vue.createElementVNode)("li", null, [(0, vue.createElementVNode)("ul", { class: (0, vue.normalizeClass)(_ctx.ns.b("group")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)])], 2)), [[vue.vShow, _ctx.visible]]);
  21160. }
  21161. var option_group_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_group_vue_vue_type_script_lang_default, [["render", _sfc_render$18]]);
  21162. //#endregion
  21163. //#region ../../packages/components/select/src/select.vue?vue&type=script&lang.ts
  21164. const COMPONENT_NAME$13 = "ElSelect";
  21165. const warnHandlerMap = /* @__PURE__ */ new WeakMap();
  21166. const createSelectWarnHandler = (appContext) => {
  21167. return (...args) => {
  21168. const message = args[0];
  21169. if (!message || message.includes("Slot \"default\" invoked outside of the render function") && args[2]?.includes("ElTreeSelect")) return;
  21170. const original = warnHandlerMap.get(appContext)?.originalWarnHandler;
  21171. if (original) {
  21172. original(...args);
  21173. return;
  21174. }
  21175. console.warn(...args);
  21176. };
  21177. };
  21178. const getWarnHandlerRecord = (appContext) => {
  21179. let record = warnHandlerMap.get(appContext);
  21180. if (!record) {
  21181. record = {
  21182. originalWarnHandler: appContext.config.warnHandler,
  21183. handler: createSelectWarnHandler(appContext),
  21184. count: 0
  21185. };
  21186. warnHandlerMap.set(appContext, record);
  21187. }
  21188. return record;
  21189. };
  21190. var select_vue_vue_type_script_lang_default$1 = (0, vue.defineComponent)({
  21191. name: COMPONENT_NAME$13,
  21192. componentName: COMPONENT_NAME$13,
  21193. components: {
  21194. ElSelectMenu: select_dropdown_default$1,
  21195. ElOption: option_default,
  21196. ElOptions: options_default,
  21197. ElOptionGroup: option_group_default,
  21198. ElTag,
  21199. ElScrollbar,
  21200. ElTooltip,
  21201. ElIcon
  21202. },
  21203. directives: { ClickOutside },
  21204. props: selectProps,
  21205. emits: [
  21206. UPDATE_MODEL_EVENT,
  21207. CHANGE_EVENT,
  21208. "remove-tag",
  21209. "clear",
  21210. "visible-change",
  21211. "focus",
  21212. "blur",
  21213. "popup-scroll"
  21214. ],
  21215. setup(props, { emit, slots }) {
  21216. const instance = (0, vue.getCurrentInstance)();
  21217. const warnRecord = getWarnHandlerRecord(instance.appContext);
  21218. warnRecord.count += 1;
  21219. instance.appContext.config.warnHandler = warnRecord.handler;
  21220. const modelValue = (0, vue.computed)(() => {
  21221. const { modelValue: rawModelValue, multiple } = props;
  21222. const fallback = multiple ? [] : void 0;
  21223. if (isArray$1(rawModelValue)) return multiple ? rawModelValue : fallback;
  21224. return multiple ? fallback : rawModelValue;
  21225. });
  21226. const _props = (0, vue.reactive)({
  21227. ...(0, vue.toRefs)(props),
  21228. modelValue
  21229. });
  21230. const API = useSelect$2(_props, emit);
  21231. const { calculatorRef, inputStyle } = useCalcInputWidth();
  21232. const { getLabel, getValue, getOptions, getDisabled } = useProps(props);
  21233. const getOptionProps = (option) => ({
  21234. label: getLabel(option),
  21235. value: getValue(option),
  21236. disabled: getDisabled(option)
  21237. });
  21238. const flatTreeSelectData = (data) => {
  21239. return data.reduce((acc, item) => {
  21240. acc.push(item);
  21241. if (item.children && item.children.length > 0) acc.push(...flatTreeSelectData(item.children));
  21242. return acc;
  21243. }, []);
  21244. };
  21245. const manuallyRenderSlots = (vnodes) => {
  21246. flattedChildren(vnodes || []).forEach((item) => {
  21247. if (isObject$1(item) && (item.type.name === "ElOption" || item.type.name === "ElTree")) {
  21248. const _name = item.type.name;
  21249. if (_name === "ElTree") flatTreeSelectData(item.props?.data || []).forEach((treeItem) => {
  21250. treeItem.currentLabel = treeItem.label || (isObject$1(treeItem.value) ? "" : treeItem.value);
  21251. API.onOptionCreate(treeItem);
  21252. });
  21253. else if (_name === "ElOption") {
  21254. const obj = { ...item.props };
  21255. obj.currentLabel = obj.label || (isObject$1(obj.value) ? "" : obj.value);
  21256. API.onOptionCreate(obj);
  21257. }
  21258. }
  21259. });
  21260. };
  21261. (0, vue.watch)(() => [props.persistent || API.expanded.value || !slots.default ? void 0 : slots.default?.(), modelValue.value], () => {
  21262. if (props.persistent || API.expanded.value) return;
  21263. API.states.options.clear();
  21264. manuallyRenderSlots(slots.default?.());
  21265. }, { immediate: true });
  21266. (0, vue.provide)(selectKey, (0, vue.reactive)({
  21267. props: _props,
  21268. states: API.states,
  21269. selectRef: API.selectRef,
  21270. optionsArray: API.optionsArray,
  21271. setSelected: API.setSelected,
  21272. handleOptionSelect: API.handleOptionSelect,
  21273. onOptionCreate: API.onOptionCreate,
  21274. onOptionDestroy: API.onOptionDestroy
  21275. }));
  21276. const selectedLabel = (0, vue.computed)(() => {
  21277. if (!props.multiple) return API.states.selectedLabel;
  21278. return API.states.selected.map((i) => i.currentLabel);
  21279. });
  21280. (0, vue.onBeforeUnmount)(() => {
  21281. const record = warnHandlerMap.get(instance.appContext);
  21282. if (!record) return;
  21283. record.count -= 1;
  21284. if (record.count <= 0) {
  21285. instance.appContext.config.warnHandler = record.originalWarnHandler;
  21286. warnHandlerMap.delete(instance.appContext);
  21287. }
  21288. });
  21289. return {
  21290. ...API,
  21291. modelValue,
  21292. selectedLabel,
  21293. calculatorRef,
  21294. inputStyle,
  21295. getLabel,
  21296. getValue,
  21297. getOptions,
  21298. getDisabled,
  21299. getOptionProps
  21300. };
  21301. }
  21302. });
  21303. //#endregion
  21304. //#region ../../packages/components/select/src/select.vue
  21305. const _hoisted_1$65 = [
  21306. "id",
  21307. "value",
  21308. "name",
  21309. "disabled",
  21310. "autocomplete",
  21311. "tabindex",
  21312. "readonly",
  21313. "aria-activedescendant",
  21314. "aria-controls",
  21315. "aria-expanded",
  21316. "aria-label"
  21317. ];
  21318. const _hoisted_2$36 = ["textContent"];
  21319. const _hoisted_3$17 = { key: 1 };
  21320. function _sfc_render$17(_ctx, _cache, $props, $setup, $data, $options) {
  21321. const _component_el_tag = (0, vue.resolveComponent)("el-tag");
  21322. const _component_el_tooltip = (0, vue.resolveComponent)("el-tooltip");
  21323. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  21324. const _component_el_option = (0, vue.resolveComponent)("el-option");
  21325. const _component_el_option_group = (0, vue.resolveComponent)("el-option-group");
  21326. const _component_el_options = (0, vue.resolveComponent)("el-options");
  21327. const _component_el_scrollbar = (0, vue.resolveComponent)("el-scrollbar");
  21328. const _component_el_select_menu = (0, vue.resolveComponent)("el-select-menu");
  21329. const _directive_click_outside = (0, vue.resolveDirective)("click-outside");
  21330. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
  21331. ref: "selectRef",
  21332. class: [_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]
  21333. }, { [(0, vue.toHandlerKey)(_ctx.mouseEnterEventName)]: _cache[11] || (_cache[11] = ($event) => _ctx.states.inputHovering = true) }, { onMouseleave: _cache[12] || (_cache[12] = ($event) => _ctx.states.inputHovering = false) }), [(0, vue.createVNode)(_component_el_tooltip, {
  21334. ref: "tooltipRef",
  21335. visible: _ctx.dropdownMenuVisible,
  21336. placement: _ctx.placement,
  21337. teleported: _ctx.teleported,
  21338. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  21339. "popper-style": _ctx.popperStyle,
  21340. "popper-options": _ctx.popperOptions,
  21341. "fallback-placements": _ctx.fallbackPlacements,
  21342. effect: _ctx.effect,
  21343. pure: "",
  21344. trigger: "click",
  21345. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  21346. "stop-popper-mouse-event": false,
  21347. "gpu-acceleration": false,
  21348. persistent: _ctx.persistent,
  21349. "append-to": _ctx.appendTo,
  21350. "show-arrow": _ctx.showArrow,
  21351. offset: _ctx.offset,
  21352. onBeforeShow: _ctx.handleMenuEnter,
  21353. onHide: _cache[10] || (_cache[10] = ($event) => _ctx.states.isBeforeHide = false)
  21354. }, {
  21355. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  21356. ref: "wrapperRef",
  21357. class: (0, vue.normalizeClass)([
  21358. _ctx.nsSelect.e("wrapper"),
  21359. _ctx.nsSelect.is("focused", _ctx.isFocused),
  21360. _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
  21361. _ctx.nsSelect.is("filterable", _ctx.filterable),
  21362. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  21363. ]),
  21364. onClick: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
  21365. }, [
  21366. _ctx.$slots.prefix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21367. key: 0,
  21368. ref: "prefixRef",
  21369. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("prefix"))
  21370. }, [(0, vue.renderSlot)(_ctx.$slots, "prefix")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  21371. (0, vue.createElementVNode)("div", {
  21372. ref: "selectionRef",
  21373. class: (0, vue.normalizeClass)([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.states.selected.length)])
  21374. }, [
  21375. _ctx.multiple ? (0, vue.renderSlot)(_ctx.$slots, "tag", {
  21376. key: 0,
  21377. data: _ctx.states.selected,
  21378. deleteTag: _ctx.deleteTag,
  21379. selectDisabled: _ctx.selectDisabled
  21380. }, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.showTagList, (item) => {
  21381. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21382. key: _ctx.getValueKey(item),
  21383. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  21384. }, [(0, vue.createVNode)(_component_el_tag, {
  21385. closable: !_ctx.selectDisabled && !item.isDisabled,
  21386. size: _ctx.collapseTagSize,
  21387. type: _ctx.tagType,
  21388. effect: _ctx.tagEffect,
  21389. "disable-transitions": "",
  21390. style: (0, vue.normalizeStyle)(_ctx.tagStyle),
  21391. onClose: ($event) => _ctx.deleteTag($event, item)
  21392. }, {
  21393. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, [(0, vue.renderSlot)(_ctx.$slots, "label", {
  21394. index: item.index,
  21395. label: item.currentLabel,
  21396. value: item.value
  21397. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(item.currentLabel), 1)])], 2)]),
  21398. _: 2
  21399. }, 1032, [
  21400. "closable",
  21401. "size",
  21402. "type",
  21403. "effect",
  21404. "style",
  21405. "onClose"
  21406. ])], 2);
  21407. }), 128)), _ctx.collapseTags && _ctx.states.selected.length > _ctx.maxCollapseTags ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tooltip, {
  21408. key: 0,
  21409. ref: "tagTooltipRef",
  21410. disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
  21411. "fallback-placements": _ctx.tagTooltip?.fallbackPlacements ?? [
  21412. "bottom",
  21413. "top",
  21414. "right",
  21415. "left"
  21416. ],
  21417. effect: _ctx.tagTooltip?.effect ?? _ctx.effect,
  21418. placement: _ctx.tagTooltip?.placement ?? "bottom",
  21419. "popper-class": _ctx.tagTooltip?.popperClass ?? _ctx.popperClass,
  21420. "popper-style": _ctx.tagTooltip?.popperStyle ?? _ctx.popperStyle,
  21421. teleported: _ctx.tagTooltip?.teleported ?? _ctx.teleported,
  21422. "append-to": _ctx.tagTooltip?.appendTo ?? _ctx.appendTo,
  21423. "popper-options": _ctx.tagTooltip?.popperOptions ?? _ctx.popperOptions,
  21424. transition: _ctx.tagTooltip?.transition,
  21425. "show-after": _ctx.tagTooltip?.showAfter,
  21426. "hide-after": _ctx.tagTooltip?.hideAfter,
  21427. "auto-close": _ctx.tagTooltip?.autoClose,
  21428. offset: _ctx.tagTooltip?.offset
  21429. }, {
  21430. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  21431. ref: "collapseItemRef",
  21432. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  21433. }, [(0, vue.createVNode)(_component_el_tag, {
  21434. closable: false,
  21435. size: _ctx.collapseTagSize,
  21436. type: _ctx.tagType,
  21437. effect: _ctx.tagEffect,
  21438. "disable-transitions": "",
  21439. style: (0, vue.normalizeStyle)(_ctx.collapseTagStyle)
  21440. }, {
  21441. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, " + " + (0, vue.toDisplayString)(_ctx.states.selected.length - _ctx.maxCollapseTags), 3)]),
  21442. _: 1
  21443. }, 8, [
  21444. "size",
  21445. "type",
  21446. "effect",
  21447. "style"
  21448. ])], 2)]),
  21449. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  21450. ref: "tagMenuRef",
  21451. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selection"))
  21452. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.collapseTagList, (item) => {
  21453. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21454. key: _ctx.getValueKey(item),
  21455. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  21456. }, [(0, vue.createVNode)(_component_el_tag, {
  21457. class: "in-tooltip",
  21458. closable: !_ctx.selectDisabled && !item.isDisabled,
  21459. size: _ctx.collapseTagSize,
  21460. type: _ctx.tagType,
  21461. effect: _ctx.tagEffect,
  21462. "disable-transitions": "",
  21463. onClose: ($event) => _ctx.deleteTag($event, item)
  21464. }, {
  21465. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, [(0, vue.renderSlot)(_ctx.$slots, "label", {
  21466. index: item.index,
  21467. label: item.currentLabel,
  21468. value: item.value
  21469. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(item.currentLabel), 1)])], 2)]),
  21470. _: 2
  21471. }, 1032, [
  21472. "closable",
  21473. "size",
  21474. "type",
  21475. "effect",
  21476. "onClose"
  21477. ])], 2);
  21478. }), 128))], 2)]),
  21479. _: 3
  21480. }, 8, [
  21481. "disabled",
  21482. "fallback-placements",
  21483. "effect",
  21484. "placement",
  21485. "popper-class",
  21486. "popper-style",
  21487. "teleported",
  21488. "append-to",
  21489. "popper-options",
  21490. "transition",
  21491. "show-after",
  21492. "hide-after",
  21493. "auto-close",
  21494. "offset"
  21495. ])) : (0, vue.createCommentVNode)("v-if", true)]) : (0, vue.createCommentVNode)("v-if", true),
  21496. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([
  21497. _ctx.nsSelect.e("selected-item"),
  21498. _ctx.nsSelect.e("input-wrapper"),
  21499. _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused)
  21500. ]) }, [(0, vue.createElementVNode)("input", {
  21501. id: _ctx.inputId,
  21502. ref: "inputRef",
  21503. value: _ctx.states.inputValue,
  21504. type: "text",
  21505. name: _ctx.name,
  21506. class: (0, vue.normalizeClass)([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  21507. disabled: _ctx.selectDisabled,
  21508. autocomplete: _ctx.autocomplete,
  21509. style: (0, vue.normalizeStyle)(_ctx.inputStyle),
  21510. tabindex: _ctx.tabindex,
  21511. role: "combobox",
  21512. readonly: !_ctx.filterable,
  21513. spellcheck: "false",
  21514. "aria-activedescendant": _ctx.hoverOption?.id || "",
  21515. "aria-controls": _ctx.contentId,
  21516. "aria-expanded": _ctx.dropdownMenuVisible,
  21517. "aria-label": _ctx.ariaLabel,
  21518. "aria-autocomplete": "none",
  21519. "aria-haspopup": "listbox",
  21520. onKeydown: _cache[0] || (_cache[0] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args)),
  21521. onCompositionstart: _cache[1] || (_cache[1] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  21522. onCompositionupdate: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  21523. onCompositionend: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  21524. onInput: _cache[4] || (_cache[4] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  21525. onChange: _cache[5] || (_cache[5] = (0, vue.withModifiers)(() => {}, ["stop"])),
  21526. onClick: _cache[6] || (_cache[6] = (0, vue.withModifiers)((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  21527. }, null, 46, _hoisted_1$65), _ctx.filterable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  21528. key: 0,
  21529. ref: "calculatorRef",
  21530. "aria-hidden": "true",
  21531. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("input-calculator")),
  21532. textContent: (0, vue.toDisplayString)(_ctx.states.inputValue)
  21533. }, null, 10, _hoisted_2$36)) : (0, vue.createCommentVNode)("v-if", true)], 2),
  21534. _ctx.shouldShowPlaceholder ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21535. key: 1,
  21536. class: (0, vue.normalizeClass)([
  21537. _ctx.nsSelect.e("selected-item"),
  21538. _ctx.nsSelect.e("placeholder"),
  21539. _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
  21540. ])
  21541. }, [_ctx.hasModelValue ? (0, vue.renderSlot)(_ctx.$slots, "label", {
  21542. key: 0,
  21543. index: _ctx.getOption(_ctx.modelValue).index,
  21544. label: _ctx.currentPlaceholder,
  21545. value: _ctx.modelValue
  21546. }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.currentPlaceholder), 1)]) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$17, (0, vue.toDisplayString)(_ctx.currentPlaceholder), 1))], 2)) : (0, vue.createCommentVNode)("v-if", true)
  21547. ], 2),
  21548. (0, vue.createElementVNode)("div", {
  21549. ref: "suffixRef",
  21550. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("suffix"))
  21551. }, [
  21552. _ctx.iconComponent && !_ctx.showClearBtn ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  21553. key: 0,
  21554. class: (0, vue.normalizeClass)([
  21555. _ctx.nsSelect.e("caret"),
  21556. _ctx.nsSelect.e("icon"),
  21557. _ctx.iconReverse
  21558. ])
  21559. }, {
  21560. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  21561. _: 1
  21562. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true),
  21563. _ctx.showClearBtn && _ctx.clearIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  21564. key: 1,
  21565. class: (0, vue.normalizeClass)([
  21566. _ctx.nsSelect.e("caret"),
  21567. _ctx.nsSelect.e("icon"),
  21568. _ctx.nsSelect.e("clear")
  21569. ]),
  21570. onClick: _ctx.handleClearClick
  21571. }, {
  21572. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.clearIcon)))]),
  21573. _: 1
  21574. }, 8, ["class", "onClick"])) : (0, vue.createCommentVNode)("v-if", true),
  21575. _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  21576. key: 2,
  21577. class: (0, vue.normalizeClass)([
  21578. _ctx.nsInput.e("icon"),
  21579. _ctx.nsInput.e("validateIcon"),
  21580. _ctx.nsInput.is("loading", _ctx.validateState === "validating")
  21581. ])
  21582. }, {
  21583. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.validateIcon)))]),
  21584. _: 1
  21585. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  21586. ], 2)
  21587. ], 2)]),
  21588. content: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_select_menu, { ref: "menuRef" }, {
  21589. default: (0, vue.withCtx)(() => [
  21590. _ctx.$slots.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21591. key: 0,
  21592. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "header")),
  21593. onClick: _cache[8] || (_cache[8] = (0, vue.withModifiers)(() => {}, ["stop"]))
  21594. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  21595. (0, vue.withDirectives)((0, vue.createVNode)(_component_el_scrollbar, {
  21596. id: _ctx.contentId,
  21597. ref: "scrollbarRef",
  21598. tag: "ul",
  21599. "wrap-class": _ctx.nsSelect.be("dropdown", "wrap"),
  21600. "view-class": _ctx.nsSelect.be("dropdown", "list"),
  21601. class: (0, vue.normalizeClass)([_ctx.nsSelect.is("empty", _ctx.filteredOptionsCount === 0)]),
  21602. role: "listbox",
  21603. "aria-label": _ctx.ariaLabel,
  21604. "aria-orientation": "vertical",
  21605. onScroll: _ctx.popupScroll
  21606. }, {
  21607. default: (0, vue.withCtx)(() => [_ctx.showNewOption ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_option, {
  21608. key: 0,
  21609. value: _ctx.states.inputValue,
  21610. created: true
  21611. }, null, 8, ["value"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)(_component_el_options, null, {
  21612. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.options, (option, index) => {
  21613. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: index }, [_ctx.getOptions(option)?.length ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_option_group, {
  21614. key: 0,
  21615. label: _ctx.getLabel(option),
  21616. disabled: _ctx.getDisabled(option)
  21617. }, {
  21618. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.getOptions(option), (item) => {
  21619. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_option, (0, vue.mergeProps)({ key: _ctx.getValue(item) }, { ref_for: true }, _ctx.getOptionProps(item)), null, 16);
  21620. }), 128))]),
  21621. _: 2
  21622. }, 1032, ["label", "disabled"])) : ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_option, (0, vue.mergeProps)({
  21623. key: 1,
  21624. ref_for: true
  21625. }, _ctx.getOptionProps(option)), null, 16))], 64);
  21626. }), 128))])]),
  21627. _: 3
  21628. })]),
  21629. _: 3
  21630. }, 8, [
  21631. "id",
  21632. "wrap-class",
  21633. "view-class",
  21634. "class",
  21635. "aria-label",
  21636. "onScroll"
  21637. ]), [[vue.vShow, _ctx.states.options.size > 0 && !_ctx.loading]]),
  21638. _ctx.$slots.loading && _ctx.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21639. key: 1,
  21640. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "loading"))
  21641. }, [(0, vue.renderSlot)(_ctx.$slots, "loading")], 2)) : _ctx.loading || _ctx.filteredOptionsCount === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21642. key: 2,
  21643. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "empty"))
  21644. }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.emptyText), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  21645. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21646. key: 3,
  21647. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "footer")),
  21648. onClick: _cache[9] || (_cache[9] = (0, vue.withModifiers)(() => {}, ["stop"]))
  21649. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  21650. ]),
  21651. _: 3
  21652. }, 512)]),
  21653. _: 3
  21654. }, 8, [
  21655. "visible",
  21656. "placement",
  21657. "teleported",
  21658. "popper-class",
  21659. "popper-style",
  21660. "popper-options",
  21661. "fallback-placements",
  21662. "effect",
  21663. "transition",
  21664. "persistent",
  21665. "append-to",
  21666. "show-arrow",
  21667. "offset",
  21668. "onBeforeShow"
  21669. ])], 16)), [[
  21670. _directive_click_outside,
  21671. _ctx.handleClickOutside,
  21672. _ctx.popperRef
  21673. ]]);
  21674. }
  21675. var select_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default$1, [["render", _sfc_render$17]]);
  21676. //#endregion
  21677. //#region ../../packages/components/select/index.ts
  21678. const ElSelect = withInstall(select_default$1, {
  21679. Option: option_default,
  21680. OptionGroup: option_group_default
  21681. });
  21682. const ElOption = withNoopInstall(option_default);
  21683. const ElOptionGroup = withNoopInstall(option_group_default);
  21684. //#endregion
  21685. //#region ../../packages/components/calendar/src/select-controller.vue?vue&type=script&setup=true&lang.ts
  21686. var select_controller_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  21687. name: "SelectController",
  21688. __name: "select-controller",
  21689. props: selectControllerProps,
  21690. emits: selectControllerEmits,
  21691. setup(__props, { emit: __emit }) {
  21692. const props = __props;
  21693. const emit = __emit;
  21694. const nsSelect = useNamespace("calendar-select");
  21695. const { t, lang } = useLocale();
  21696. const monthOptions = Array.from({ length: 12 }, (_, index) => {
  21697. const actualMonth = index + 1;
  21698. return {
  21699. value: actualMonth,
  21700. label: isFunction$1(props.formatter) ? props.formatter(actualMonth, "month") : actualMonth
  21701. };
  21702. });
  21703. const yearValue = (0, vue.computed)(() => props.date.year());
  21704. const monthValue = (0, vue.computed)(() => props.date.month() + 1);
  21705. const yearOptions = (0, vue.computed)(() => {
  21706. const years = [];
  21707. for (let i = -10; i < 10; i++) {
  21708. const year = yearValue.value + i;
  21709. if (year > 0) {
  21710. const label = isFunction$1(props.formatter) ? props.formatter(year, "year") : year;
  21711. years.push({
  21712. value: year,
  21713. label
  21714. });
  21715. }
  21716. }
  21717. return years;
  21718. });
  21719. const handleYearChange = (year) => {
  21720. emit("date-change", (0, import_dayjs_min.default)(new Date(year, monthValue.value - 1, 1)).locale(lang.value));
  21721. };
  21722. const handleMonthChange = (month) => {
  21723. emit("date-change", (0, import_dayjs_min.default)(new Date(yearValue.value, month - 1, 1)).locale(lang.value));
  21724. };
  21725. const selectToday = () => {
  21726. emit("date-change", "today");
  21727. };
  21728. return (_ctx, _cache) => {
  21729. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [
  21730. (0, vue.createVNode)((0, vue.unref)(ElSelect), {
  21731. "model-value": yearValue.value,
  21732. size: "small",
  21733. class: (0, vue.normalizeClass)((0, vue.unref)(nsSelect).e("year")),
  21734. "validate-event": false,
  21735. options: yearOptions.value,
  21736. onChange: handleYearChange
  21737. }, null, 8, [
  21738. "model-value",
  21739. "class",
  21740. "options"
  21741. ]),
  21742. (0, vue.createVNode)((0, vue.unref)(ElSelect), {
  21743. "model-value": monthValue.value,
  21744. size: "small",
  21745. class: (0, vue.normalizeClass)((0, vue.unref)(nsSelect).e("month")),
  21746. "validate-event": false,
  21747. options: (0, vue.unref)(monthOptions),
  21748. onChange: handleMonthChange
  21749. }, null, 8, [
  21750. "model-value",
  21751. "class",
  21752. "options"
  21753. ]),
  21754. (0, vue.createVNode)((0, vue.unref)(ElButton), {
  21755. size: "small",
  21756. onClick: selectToday
  21757. }, {
  21758. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.today")), 1)]),
  21759. _: 1
  21760. })
  21761. ], 64);
  21762. };
  21763. }
  21764. });
  21765. //#endregion
  21766. //#region ../../packages/components/calendar/src/select-controller.vue
  21767. var select_controller_default = select_controller_vue_vue_type_script_setup_true_lang_default;
  21768. //#endregion
  21769. //#region ../../packages/components/calendar/src/calendar.vue?vue&type=script&setup=true&lang.ts
  21770. const COMPONENT_NAME$12 = "ElCalendar";
  21771. var calendar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  21772. name: COMPONENT_NAME$12,
  21773. __name: "calendar",
  21774. props: calendarProps,
  21775. emits: calendarEmits,
  21776. setup(__props, { expose: __expose, emit: __emit }) {
  21777. const ns = useNamespace("calendar");
  21778. const { calculateValidatedDateRange, date, pickDay, realSelectedDay, selectDate, validatedRange, handleDateChange } = useCalendar(__props, __emit, COMPONENT_NAME$12);
  21779. const { t } = useLocale();
  21780. const i18nDate = (0, vue.computed)(() => {
  21781. const pickedMonth = `el.datepicker.month${date.value.format("M")}`;
  21782. return `${date.value.year()} ${t("el.datepicker.year")} ${t(pickedMonth)}`;
  21783. });
  21784. __expose({
  21785. selectedDay: realSelectedDay,
  21786. pickDay,
  21787. selectDate,
  21788. calculateValidatedDateRange
  21789. });
  21790. return (_ctx, _cache) => {
  21791. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("header")) }, [(0, vue.renderSlot)(_ctx.$slots, "header", { date: i18nDate.value }, () => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")) }, (0, vue.toDisplayString)(i18nDate.value), 3), (0, vue.unref)(validatedRange).length === 0 && __props.controllerType === "button" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21792. key: 0,
  21793. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("button-group"))
  21794. }, [(0, vue.createVNode)((0, vue.unref)(ElButtonGroup), null, {
  21795. default: (0, vue.withCtx)(() => [
  21796. (0, vue.createVNode)((0, vue.unref)(ElButton), {
  21797. size: "small",
  21798. onClick: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(selectDate)("prev-month"))
  21799. }, {
  21800. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.prevMonth")), 1)]),
  21801. _: 1
  21802. }),
  21803. (0, vue.createVNode)((0, vue.unref)(ElButton), {
  21804. size: "small",
  21805. onClick: _cache[1] || (_cache[1] = ($event) => (0, vue.unref)(selectDate)("today"))
  21806. }, {
  21807. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.today")), 1)]),
  21808. _: 1
  21809. }),
  21810. (0, vue.createVNode)((0, vue.unref)(ElButton), {
  21811. size: "small",
  21812. onClick: _cache[2] || (_cache[2] = ($event) => (0, vue.unref)(selectDate)("next-month"))
  21813. }, {
  21814. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.nextMonth")), 1)]),
  21815. _: 1
  21816. })
  21817. ]),
  21818. _: 1
  21819. })], 2)) : (0, vue.unref)(validatedRange).length === 0 && __props.controllerType === "select" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21820. key: 1,
  21821. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("select-controller"))
  21822. }, [(0, vue.createVNode)(select_controller_default, {
  21823. date: (0, vue.unref)(date),
  21824. formatter: __props.formatter,
  21825. onDateChange: (0, vue.unref)(handleDateChange)
  21826. }, null, 8, [
  21827. "date",
  21828. "formatter",
  21829. "onDateChange"
  21830. ])], 2)) : (0, vue.createCommentVNode)("v-if", true)])], 2), (0, vue.unref)(validatedRange).length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21831. key: 0,
  21832. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("body"))
  21833. }, [(0, vue.createVNode)(date_table_default, {
  21834. date: (0, vue.unref)(date),
  21835. "selected-day": (0, vue.unref)(realSelectedDay),
  21836. onPick: (0, vue.unref)(pickDay)
  21837. }, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots["date-cell"] ? {
  21838. name: "date-cell",
  21839. fn: (0, vue.withCtx)((data) => [(0, vue.renderSlot)(_ctx.$slots, "date-cell", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(data)))]),
  21840. key: "0"
  21841. } : void 0]), 1032, [
  21842. "date",
  21843. "selected-day",
  21844. "onPick"
  21845. ])], 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21846. key: 1,
  21847. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("body"))
  21848. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(validatedRange), (range_, index) => {
  21849. return (0, vue.openBlock)(), (0, vue.createBlock)(date_table_default, {
  21850. key: index,
  21851. date: range_[0],
  21852. "selected-day": (0, vue.unref)(realSelectedDay),
  21853. range: range_,
  21854. "hide-header": index !== 0,
  21855. onPick: (0, vue.unref)(pickDay)
  21856. }, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots["date-cell"] ? {
  21857. name: "date-cell",
  21858. fn: (0, vue.withCtx)((data) => [(0, vue.renderSlot)(_ctx.$slots, "date-cell", (0, vue.mergeProps)({ ref_for: true }, data))]),
  21859. key: "0"
  21860. } : void 0]), 1032, [
  21861. "date",
  21862. "selected-day",
  21863. "range",
  21864. "hide-header",
  21865. "onPick"
  21866. ]);
  21867. }), 128))], 2))], 2);
  21868. };
  21869. }
  21870. });
  21871. //#endregion
  21872. //#region ../../packages/components/calendar/src/calendar.vue
  21873. var calendar_default = calendar_vue_vue_type_script_setup_true_lang_default;
  21874. //#endregion
  21875. //#region ../../packages/components/calendar/index.ts
  21876. const ElCalendar = withInstall(calendar_default);
  21877. //#endregion
  21878. //#region ../../packages/components/card/src/card.ts
  21879. /**
  21880. * @deprecated Removed after 3.0.0, Use `CardProps` instead.
  21881. */
  21882. const cardProps = buildProps({
  21883. header: {
  21884. type: String,
  21885. default: ""
  21886. },
  21887. footer: {
  21888. type: String,
  21889. default: ""
  21890. },
  21891. bodyStyle: {
  21892. type: definePropType([
  21893. String,
  21894. Object,
  21895. Array
  21896. ]),
  21897. default: ""
  21898. },
  21899. headerClass: String,
  21900. bodyClass: String,
  21901. footerClass: String,
  21902. shadow: {
  21903. type: String,
  21904. values: [
  21905. "always",
  21906. "hover",
  21907. "never"
  21908. ],
  21909. default: void 0
  21910. }
  21911. });
  21912. const cardContextKey = Symbol("cardContextKey");
  21913. //#endregion
  21914. //#region ../../packages/components/card/src/card.vue?vue&type=script&setup=true&lang.ts
  21915. var card_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  21916. name: "ElCard",
  21917. __name: "card",
  21918. props: cardProps,
  21919. setup(__props) {
  21920. const globalConfig = useGlobalConfig("card");
  21921. const ns = useNamespace("card");
  21922. return (_ctx, _cache) => {
  21923. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).is(`${__props.shadow || (0, vue.unref)(globalConfig)?.shadow || "always"}-shadow`)]) }, [
  21924. _ctx.$slots.header || __props.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21925. key: 0,
  21926. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("header"), __props.headerClass])
  21927. }, [(0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.header), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  21928. (0, vue.createElementVNode)("div", {
  21929. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("body"), __props.bodyClass]),
  21930. style: (0, vue.normalizeStyle)(__props.bodyStyle)
  21931. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6),
  21932. _ctx.$slots.footer || __props.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  21933. key: 1,
  21934. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("footer"), __props.footerClass])
  21935. }, [(0, vue.renderSlot)(_ctx.$slots, "footer", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.footer), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)
  21936. ], 2);
  21937. };
  21938. }
  21939. });
  21940. //#endregion
  21941. //#region ../../packages/components/card/src/card.vue
  21942. var card_default = card_vue_vue_type_script_setup_true_lang_default;
  21943. //#endregion
  21944. //#region ../../packages/components/card/index.ts
  21945. const ElCard = withInstall(card_default);
  21946. //#endregion
  21947. //#region ../../packages/components/carousel/src/carousel.ts
  21948. /**
  21949. * @deprecated Removed after 3.0.0, Use `CarouselProps` instead.
  21950. */
  21951. const carouselProps = buildProps({
  21952. initialIndex: {
  21953. type: Number,
  21954. default: 0
  21955. },
  21956. height: {
  21957. type: String,
  21958. default: ""
  21959. },
  21960. trigger: {
  21961. type: String,
  21962. values: ["hover", "click"],
  21963. default: "hover"
  21964. },
  21965. autoplay: {
  21966. type: Boolean,
  21967. default: true
  21968. },
  21969. interval: {
  21970. type: Number,
  21971. default: 3e3
  21972. },
  21973. indicatorPosition: {
  21974. type: String,
  21975. values: [
  21976. "",
  21977. "none",
  21978. "outside"
  21979. ],
  21980. default: ""
  21981. },
  21982. arrow: {
  21983. type: String,
  21984. values: [
  21985. "always",
  21986. "hover",
  21987. "never"
  21988. ],
  21989. default: "hover"
  21990. },
  21991. type: {
  21992. type: String,
  21993. values: ["", "card"],
  21994. default: ""
  21995. },
  21996. cardScale: {
  21997. type: Number,
  21998. default: .83
  21999. },
  22000. loop: {
  22001. type: Boolean,
  22002. default: true
  22003. },
  22004. direction: {
  22005. type: String,
  22006. values: ["horizontal", "vertical"],
  22007. default: "horizontal"
  22008. },
  22009. pauseOnHover: {
  22010. type: Boolean,
  22011. default: true
  22012. },
  22013. motionBlur: Boolean
  22014. });
  22015. const carouselEmits = { change: (current, prev) => [current, prev].every(isNumber) };
  22016. //#endregion
  22017. //#region ../../packages/components/carousel/src/constants.ts
  22018. const carouselContextKey = Symbol("carouselContextKey");
  22019. const CAROUSEL_ITEM_NAME = "ElCarouselItem";
  22020. //#endregion
  22021. //#region ../../packages/components/carousel/src/use-carousel.ts
  22022. const THROTTLE_TIME = 300;
  22023. const useCarousel = (props, emit, componentName) => {
  22024. const { children: items, addChild: addItem, removeChild: removeItem, ChildrenSorter: ItemsSorter } = useOrderedChildren((0, vue.getCurrentInstance)(), CAROUSEL_ITEM_NAME);
  22025. const slots = (0, vue.useSlots)();
  22026. const activeIndex = (0, vue.ref)(-1);
  22027. const timer = (0, vue.ref)(null);
  22028. const hover = (0, vue.ref)(false);
  22029. const root = (0, vue.ref)();
  22030. const containerHeight = (0, vue.ref)(0);
  22031. const isItemsTwoLength = (0, vue.ref)(true);
  22032. const arrowDisplay = (0, vue.computed)(() => props.arrow !== "never" && !(0, vue.unref)(isVertical));
  22033. const hasLabel = (0, vue.computed)(() => {
  22034. return items.value.some((item) => item.props.label.toString().length > 0);
  22035. });
  22036. const isCardType = (0, vue.computed)(() => props.type === "card");
  22037. const isVertical = (0, vue.computed)(() => props.direction === "vertical");
  22038. const containerStyle = (0, vue.computed)(() => {
  22039. if (props.height !== "auto") return { height: props.height };
  22040. return {
  22041. height: `${containerHeight.value}px`,
  22042. overflow: "hidden"
  22043. };
  22044. });
  22045. const throttledArrowClick = throttle((index) => {
  22046. setActiveItem(index);
  22047. }, THROTTLE_TIME, { trailing: true });
  22048. const throttledIndicatorHover = throttle((index) => {
  22049. handleIndicatorHover(index);
  22050. }, THROTTLE_TIME);
  22051. const isTwoLengthShow = (index) => {
  22052. if (!isItemsTwoLength.value) return true;
  22053. return activeIndex.value <= 1 ? index <= 1 : index > 1;
  22054. };
  22055. function pauseTimer() {
  22056. if (timer.value) {
  22057. clearInterval(timer.value);
  22058. timer.value = null;
  22059. }
  22060. }
  22061. function startTimer() {
  22062. if (props.interval <= 0 || !props.autoplay || timer.value) return;
  22063. timer.value = setInterval(() => playSlides(), props.interval);
  22064. }
  22065. const playSlides = () => {
  22066. if (activeIndex.value < items.value.length - 1) activeIndex.value = activeIndex.value + 1;
  22067. else if (props.loop) activeIndex.value = 0;
  22068. };
  22069. function setActiveItem(index) {
  22070. if (isString(index)) {
  22071. const filteredItems = items.value.filter((item) => item.props.name === index);
  22072. if (filteredItems.length > 0) index = items.value.indexOf(filteredItems[0]);
  22073. }
  22074. index = Number(index);
  22075. if (Number.isNaN(index) || index !== Math.floor(index)) {
  22076. /* @__PURE__ */ debugWarn(componentName, "index must be integer.");
  22077. return;
  22078. }
  22079. const itemCount = items.value.length;
  22080. const oldIndex = activeIndex.value;
  22081. if (index < 0) activeIndex.value = props.loop ? itemCount - 1 : 0;
  22082. else if (index >= itemCount) activeIndex.value = props.loop ? 0 : itemCount - 1;
  22083. else activeIndex.value = index;
  22084. if (oldIndex === activeIndex.value) resetItemPosition(oldIndex);
  22085. resetTimer();
  22086. }
  22087. function resetItemPosition(oldIndex) {
  22088. items.value.forEach((item, index) => {
  22089. item.translateItem(index, activeIndex.value, oldIndex);
  22090. });
  22091. }
  22092. function itemInStage(item, index) {
  22093. const _items = (0, vue.unref)(items);
  22094. const itemCount = _items.length;
  22095. if (itemCount === 0 || !item.states.inStage) return false;
  22096. const nextItemIndex = index + 1;
  22097. const prevItemIndex = index - 1;
  22098. const lastItemIndex = itemCount - 1;
  22099. const isLastItemActive = _items[lastItemIndex].states.active;
  22100. const isFirstItemActive = _items[0].states.active;
  22101. const isNextItemActive = _items[nextItemIndex]?.states?.active;
  22102. const isPrevItemActive = _items[prevItemIndex]?.states?.active;
  22103. if (index === lastItemIndex && isFirstItemActive || isNextItemActive) return "left";
  22104. else if (index === 0 && isLastItemActive || isPrevItemActive) return "right";
  22105. return false;
  22106. }
  22107. function handleMouseEnter() {
  22108. hover.value = true;
  22109. if (props.pauseOnHover) pauseTimer();
  22110. }
  22111. function handleMouseLeave() {
  22112. hover.value = false;
  22113. startTimer();
  22114. }
  22115. function handleButtonEnter(arrow) {
  22116. if ((0, vue.unref)(isVertical)) return;
  22117. items.value.forEach((item, index) => {
  22118. if (arrow === itemInStage(item, index)) item.states.hover = true;
  22119. });
  22120. }
  22121. function handleButtonLeave() {
  22122. if ((0, vue.unref)(isVertical)) return;
  22123. items.value.forEach((item) => {
  22124. item.states.hover = false;
  22125. });
  22126. }
  22127. function handleIndicatorClick(index) {
  22128. activeIndex.value = index;
  22129. }
  22130. function handleIndicatorHover(index) {
  22131. if (props.trigger === "hover" && index !== activeIndex.value) activeIndex.value = index;
  22132. }
  22133. function prev() {
  22134. setActiveItem(activeIndex.value - 1);
  22135. }
  22136. function next() {
  22137. setActiveItem(activeIndex.value + 1);
  22138. }
  22139. function resetTimer() {
  22140. pauseTimer();
  22141. if (!props.pauseOnHover || !hover.value) startTimer();
  22142. }
  22143. function setContainerHeight(height) {
  22144. if (props.height !== "auto") return;
  22145. containerHeight.value = height;
  22146. }
  22147. function PlaceholderItem() {
  22148. const defaultSlots = slots.default?.();
  22149. if (!defaultSlots) return null;
  22150. const normalizeSlots = flattedChildren(defaultSlots).filter((slot) => {
  22151. return (0, vue.isVNode)(slot) && slot.type.name === CAROUSEL_ITEM_NAME;
  22152. });
  22153. if (normalizeSlots?.length === 2 && props.loop && !isCardType.value) {
  22154. isItemsTwoLength.value = true;
  22155. return normalizeSlots;
  22156. }
  22157. isItemsTwoLength.value = false;
  22158. return null;
  22159. }
  22160. (0, vue.watch)(() => activeIndex.value, (current, prev) => {
  22161. resetItemPosition(prev);
  22162. if (isItemsTwoLength.value) {
  22163. current = current % 2;
  22164. prev = prev % 2;
  22165. }
  22166. if (prev > -1) emit(CHANGE_EVENT, current, prev);
  22167. });
  22168. const exposeActiveIndex = (0, vue.computed)({
  22169. get: () => {
  22170. return isItemsTwoLength.value ? activeIndex.value % 2 : activeIndex.value;
  22171. },
  22172. set: (value) => activeIndex.value = value
  22173. });
  22174. (0, vue.watch)(() => props.autoplay, (autoplay) => {
  22175. autoplay ? startTimer() : pauseTimer();
  22176. });
  22177. (0, vue.watch)(() => props.loop, () => {
  22178. setActiveItem(activeIndex.value);
  22179. });
  22180. (0, vue.watch)(() => props.interval, () => {
  22181. resetTimer();
  22182. });
  22183. const resizeObserver = (0, vue.shallowRef)();
  22184. (0, vue.onMounted)(() => {
  22185. (0, vue.watch)(() => items.value, () => {
  22186. if (items.value.length > 0) setActiveItem(props.initialIndex);
  22187. }, { immediate: true });
  22188. resizeObserver.value = useResizeObserver(root.value, () => {
  22189. resetItemPosition();
  22190. });
  22191. startTimer();
  22192. });
  22193. (0, vue.onBeforeUnmount)(() => {
  22194. pauseTimer();
  22195. if (root.value && resizeObserver.value) resizeObserver.value.stop();
  22196. });
  22197. (0, vue.provide)(carouselContextKey, {
  22198. root,
  22199. isCardType,
  22200. isVertical,
  22201. items,
  22202. loop: props.loop,
  22203. cardScale: props.cardScale,
  22204. addItem,
  22205. removeItem,
  22206. setActiveItem,
  22207. setContainerHeight
  22208. });
  22209. return {
  22210. root,
  22211. activeIndex,
  22212. exposeActiveIndex,
  22213. arrowDisplay,
  22214. hasLabel,
  22215. hover,
  22216. isCardType,
  22217. items,
  22218. isVertical,
  22219. containerStyle,
  22220. isItemsTwoLength,
  22221. handleButtonEnter,
  22222. handleButtonLeave,
  22223. handleIndicatorClick,
  22224. handleMouseEnter,
  22225. handleMouseLeave,
  22226. setActiveItem,
  22227. prev,
  22228. next,
  22229. PlaceholderItem,
  22230. isTwoLengthShow,
  22231. ItemsSorter,
  22232. throttledArrowClick,
  22233. throttledIndicatorHover
  22234. };
  22235. };
  22236. //#endregion
  22237. //#region ../../packages/components/carousel/src/carousel.vue?vue&type=script&setup=true&lang.ts
  22238. const _hoisted_1$64 = ["aria-label"];
  22239. const _hoisted_2$35 = ["aria-label"];
  22240. const _hoisted_3$16 = ["onMouseenter", "onClick"];
  22241. const _hoisted_4$12 = ["aria-label"];
  22242. const _hoisted_5$9 = { key: 0 };
  22243. const _hoisted_6$4 = {
  22244. key: 2,
  22245. xmlns: "http://www.w3.org/2000/svg",
  22246. version: "1.1",
  22247. style: { "display": "none" }
  22248. };
  22249. const COMPONENT_NAME$11 = "ElCarousel";
  22250. var carousel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  22251. name: COMPONENT_NAME$11,
  22252. __name: "carousel",
  22253. props: carouselProps,
  22254. emits: carouselEmits,
  22255. setup(__props, { expose: __expose, emit: __emit }) {
  22256. const props = __props;
  22257. const { root, activeIndex, exposeActiveIndex, arrowDisplay, hasLabel, hover, isCardType, items, isVertical, containerStyle, handleButtonEnter, handleButtonLeave, handleIndicatorClick, handleMouseEnter, handleMouseLeave, setActiveItem, prev, next, PlaceholderItem, isTwoLengthShow, ItemsSorter, throttledArrowClick, throttledIndicatorHover } = useCarousel(props, __emit, COMPONENT_NAME$11);
  22258. const ns = useNamespace("carousel");
  22259. const { t } = useLocale();
  22260. const carouselClasses = (0, vue.computed)(() => {
  22261. const classes = [ns.b(), ns.m(props.direction)];
  22262. if ((0, vue.unref)(isCardType)) classes.push(ns.m("card"));
  22263. classes.push(ns.is("vertical-outside", (0, vue.unref)(isVertical) && props.indicatorPosition === "outside"));
  22264. return classes;
  22265. });
  22266. const indicatorsClasses = (0, vue.computed)(() => {
  22267. const classes = [ns.e("indicators"), ns.em("indicators", props.direction)];
  22268. if ((0, vue.unref)(hasLabel)) classes.push(ns.em("indicators", "labels"));
  22269. if (props.indicatorPosition === "outside") classes.push(ns.em("indicators", "outside"));
  22270. if ((0, vue.unref)(isVertical)) classes.push(ns.em("indicators", "right"));
  22271. return classes;
  22272. });
  22273. function handleTransitionStart(e) {
  22274. if (!props.motionBlur) return;
  22275. const kls = (0, vue.unref)(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
  22276. e.currentTarget.classList.add(kls);
  22277. }
  22278. function handleTransitionEnd(e) {
  22279. if (!props.motionBlur) return;
  22280. const kls = (0, vue.unref)(isVertical) ? `${ns.namespace.value}-transitioning-vertical` : `${ns.namespace.value}-transitioning`;
  22281. e.currentTarget.classList.remove(kls);
  22282. }
  22283. __expose({
  22284. activeIndex: exposeActiveIndex,
  22285. setActiveItem,
  22286. prev,
  22287. next
  22288. });
  22289. return (_ctx, _cache) => {
  22290. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  22291. ref_key: "root",
  22292. ref: root,
  22293. class: (0, vue.normalizeClass)(carouselClasses.value),
  22294. onMouseenter: _cache[6] || (_cache[6] = (0, vue.withModifiers)((...args) => (0, vue.unref)(handleMouseEnter) && (0, vue.unref)(handleMouseEnter)(...args), ["stop"])),
  22295. onMouseleave: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => (0, vue.unref)(handleMouseLeave) && (0, vue.unref)(handleMouseLeave)(...args), ["stop"]))
  22296. }, [
  22297. (0, vue.unref)(arrowDisplay) ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  22298. key: 0,
  22299. name: "carousel-arrow-left",
  22300. persisted: ""
  22301. }, {
  22302. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  22303. type: "button",
  22304. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("arrow"), (0, vue.unref)(ns).em("arrow", "left")]),
  22305. "aria-label": (0, vue.unref)(t)("el.carousel.leftArrow"),
  22306. onMouseenter: _cache[0] || (_cache[0] = ($event) => (0, vue.unref)(handleButtonEnter)("left")),
  22307. onMouseleave: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleButtonLeave) && (0, vue.unref)(handleButtonLeave)(...args)),
  22308. onClick: _cache[2] || (_cache[2] = (0, vue.withModifiers)(($event) => (0, vue.unref)(throttledArrowClick)((0, vue.unref)(activeIndex) - 1), ["stop"]))
  22309. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  22310. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  22311. _: 1
  22312. })], 42, _hoisted_1$64), [[vue.vShow, (__props.arrow === "always" || (0, vue.unref)(hover)) && (__props.loop || (0, vue.unref)(activeIndex) > 0)]])]),
  22313. _: 1
  22314. })) : (0, vue.createCommentVNode)("v-if", true),
  22315. (0, vue.unref)(arrowDisplay) ? ((0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  22316. key: 1,
  22317. name: "carousel-arrow-right",
  22318. persisted: ""
  22319. }, {
  22320. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  22321. type: "button",
  22322. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("arrow"), (0, vue.unref)(ns).em("arrow", "right")]),
  22323. "aria-label": (0, vue.unref)(t)("el.carousel.rightArrow"),
  22324. onMouseenter: _cache[3] || (_cache[3] = ($event) => (0, vue.unref)(handleButtonEnter)("right")),
  22325. onMouseleave: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(handleButtonLeave) && (0, vue.unref)(handleButtonLeave)(...args)),
  22326. onClick: _cache[5] || (_cache[5] = (0, vue.withModifiers)(($event) => (0, vue.unref)(throttledArrowClick)((0, vue.unref)(activeIndex) + 1), ["stop"]))
  22327. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  22328. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  22329. _: 1
  22330. })], 42, _hoisted_2$35), [[vue.vShow, (__props.arrow === "always" || (0, vue.unref)(hover)) && (__props.loop || (0, vue.unref)(activeIndex) < (0, vue.unref)(items).length - 1)]])]),
  22331. _: 1
  22332. })) : (0, vue.createCommentVNode)("v-if", true),
  22333. (0, vue.createElementVNode)("div", {
  22334. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("container")),
  22335. style: (0, vue.normalizeStyle)((0, vue.unref)(containerStyle)),
  22336. onTransitionstart: handleTransitionStart,
  22337. onTransitionend: handleTransitionEnd
  22338. }, [(0, vue.createVNode)((0, vue.unref)(PlaceholderItem)), (0, vue.renderSlot)(_ctx.$slots, "default")], 38),
  22339. (0, vue.createVNode)((0, vue.unref)(ItemsSorter), null, {
  22340. default: (0, vue.withCtx)(() => [__props.indicatorPosition !== "none" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", {
  22341. key: 0,
  22342. class: (0, vue.normalizeClass)(indicatorsClasses.value)
  22343. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(items), (item, index) => {
  22344. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  22345. key: index,
  22346. class: (0, vue.normalizeClass)([
  22347. (0, vue.unref)(ns).e("indicator"),
  22348. (0, vue.unref)(ns).em("indicator", __props.direction),
  22349. (0, vue.unref)(ns).is("active", index === (0, vue.unref)(activeIndex))
  22350. ]),
  22351. onMouseenter: ($event) => (0, vue.unref)(throttledIndicatorHover)(index),
  22352. onClick: (0, vue.withModifiers)(($event) => (0, vue.unref)(handleIndicatorClick)(index), ["stop"])
  22353. }, [(0, vue.createElementVNode)("button", {
  22354. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("button")),
  22355. "aria-label": (0, vue.unref)(t)("el.carousel.indicator", { index: index + 1 })
  22356. }, [(0, vue.unref)(hasLabel) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$9, (0, vue.toDisplayString)(item.props.label), 1)) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_4$12)], 42, _hoisted_3$16)), [[vue.vShow, (0, vue.unref)(isTwoLengthShow)(index)]]);
  22357. }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true)]),
  22358. _: 1
  22359. }),
  22360. __props.motionBlur ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_6$4, [..._cache[8] || (_cache[8] = [(0, vue.createElementVNode)("defs", null, [(0, vue.createElementVNode)("filter", { id: "elCarouselHorizontal" }, [(0, vue.createElementVNode)("feGaussianBlur", {
  22361. in: "SourceGraphic",
  22362. stdDeviation: "12,0"
  22363. })]), (0, vue.createElementVNode)("filter", { id: "elCarouselVertical" }, [(0, vue.createElementVNode)("feGaussianBlur", {
  22364. in: "SourceGraphic",
  22365. stdDeviation: "0,10"
  22366. })])], -1)])])) : (0, vue.createCommentVNode)("v-if", true)
  22367. ], 34);
  22368. };
  22369. }
  22370. });
  22371. //#endregion
  22372. //#region ../../packages/components/carousel/src/carousel.vue
  22373. var carousel_default = carousel_vue_vue_type_script_setup_true_lang_default;
  22374. //#endregion
  22375. //#region ../../packages/components/carousel/src/carousel-item.ts
  22376. /**
  22377. * @deprecated Removed after 3.0.0, Use `CarouselItemProps` instead.
  22378. */
  22379. const carouselItemProps = buildProps({
  22380. name: {
  22381. type: String,
  22382. default: ""
  22383. },
  22384. label: {
  22385. type: [String, Number],
  22386. default: ""
  22387. }
  22388. });
  22389. //#endregion
  22390. //#region ../../packages/components/carousel/src/use-carousel-item.ts
  22391. const useCarouselItem = (props) => {
  22392. const carouselContext = (0, vue.inject)(carouselContextKey);
  22393. const instance = (0, vue.getCurrentInstance)();
  22394. if (!carouselContext) /* @__PURE__ */ debugWarn(CAROUSEL_ITEM_NAME, "usage: <el-carousel></el-carousel-item></el-carousel>");
  22395. if (!instance) /* @__PURE__ */ debugWarn(CAROUSEL_ITEM_NAME, "compositional hook can only be invoked inside setups");
  22396. const carouselItemRef = (0, vue.ref)();
  22397. const hover = (0, vue.ref)(false);
  22398. const translate = (0, vue.ref)(0);
  22399. const scale = (0, vue.ref)(1);
  22400. const active = (0, vue.ref)(false);
  22401. const ready = (0, vue.ref)(false);
  22402. const inStage = (0, vue.ref)(false);
  22403. const animating = (0, vue.ref)(false);
  22404. const { isCardType, isVertical, cardScale } = carouselContext;
  22405. function processIndex(index, activeIndex, length) {
  22406. const lastItemIndex = length - 1;
  22407. const prevItemIndex = activeIndex - 1;
  22408. const nextItemIndex = activeIndex + 1;
  22409. const halfItemIndex = length / 2;
  22410. if (activeIndex === 0 && index === lastItemIndex) return -1;
  22411. else if (activeIndex === lastItemIndex && index === 0) return length;
  22412. else if (index < prevItemIndex && activeIndex - index >= halfItemIndex) return length + 1;
  22413. else if (index > nextItemIndex && index - activeIndex >= halfItemIndex) return -2;
  22414. return index;
  22415. }
  22416. function calcCardTranslate(index, activeIndex) {
  22417. const parentWidth = (0, vue.unref)(isVertical) ? carouselContext.root.value?.offsetHeight || 0 : carouselContext.root.value?.offsetWidth || 0;
  22418. if (inStage.value) return parentWidth * ((2 - cardScale) * (index - activeIndex) + 1) / 4;
  22419. else if (index < activeIndex) return -(1 + cardScale) * parentWidth / 4;
  22420. else return (3 + cardScale) * parentWidth / 4;
  22421. }
  22422. function calcTranslate(index, activeIndex, isVertical) {
  22423. const rootEl = carouselContext.root.value;
  22424. if (!rootEl) return 0;
  22425. return ((isVertical ? rootEl.offsetHeight : rootEl.offsetWidth) || 0) * (index - activeIndex);
  22426. }
  22427. const translateItem = (index, activeIndex, oldIndex) => {
  22428. const _isCardType = (0, vue.unref)(isCardType);
  22429. const carouselItemLength = carouselContext.items.value.length ?? NaN;
  22430. const isActive = index === activeIndex;
  22431. if (!_isCardType && !isUndefined(oldIndex)) animating.value = isActive || index === oldIndex;
  22432. if (!isActive && carouselItemLength > 2 && carouselContext.loop) index = processIndex(index, activeIndex, carouselItemLength);
  22433. const _isVertical = (0, vue.unref)(isVertical);
  22434. active.value = isActive;
  22435. if (_isCardType) {
  22436. inStage.value = Math.round(Math.abs(index - activeIndex)) <= 1;
  22437. translate.value = calcCardTranslate(index, activeIndex);
  22438. scale.value = (0, vue.unref)(active) ? 1 : cardScale;
  22439. } else translate.value = calcTranslate(index, activeIndex, _isVertical);
  22440. ready.value = true;
  22441. if (isActive && carouselItemRef.value) carouselContext.setContainerHeight(carouselItemRef.value.offsetHeight);
  22442. };
  22443. function handleItemClick() {
  22444. if (carouselContext && (0, vue.unref)(isCardType)) {
  22445. const index = carouselContext.items.value.findIndex(({ uid }) => uid === instance.uid);
  22446. carouselContext.setActiveItem(index);
  22447. }
  22448. }
  22449. const carouselItemContext = {
  22450. props,
  22451. states: (0, vue.reactive)({
  22452. hover,
  22453. translate,
  22454. scale,
  22455. active,
  22456. ready,
  22457. inStage,
  22458. animating
  22459. }),
  22460. uid: instance.uid,
  22461. getVnode: () => instance.vnode,
  22462. translateItem
  22463. };
  22464. carouselContext.addItem(carouselItemContext);
  22465. (0, vue.onBeforeUnmount)(() => {
  22466. carouselContext.removeItem(carouselItemContext);
  22467. });
  22468. return {
  22469. carouselItemRef,
  22470. active,
  22471. animating,
  22472. hover,
  22473. inStage,
  22474. isVertical,
  22475. translate,
  22476. isCardType,
  22477. scale,
  22478. ready,
  22479. handleItemClick
  22480. };
  22481. };
  22482. //#endregion
  22483. //#region ../../packages/components/carousel/src/carousel-item.vue?vue&type=script&setup=true&lang.ts
  22484. var carousel_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  22485. name: CAROUSEL_ITEM_NAME,
  22486. __name: "carousel-item",
  22487. props: carouselItemProps,
  22488. setup(__props) {
  22489. const props = __props;
  22490. const ns = useNamespace("carousel");
  22491. const { carouselItemRef, active, animating, hover, inStage, isVertical, translate, isCardType, scale, ready, handleItemClick } = useCarouselItem(props);
  22492. const itemKls = (0, vue.computed)(() => [
  22493. ns.e("item"),
  22494. ns.is("active", active.value),
  22495. ns.is("in-stage", inStage.value),
  22496. ns.is("hover", hover.value),
  22497. ns.is("animating", animating.value),
  22498. {
  22499. [ns.em("item", "card")]: isCardType.value,
  22500. [ns.em("item", "card-vertical")]: isCardType.value && isVertical.value
  22501. }
  22502. ]);
  22503. const itemStyle = (0, vue.computed)(() => {
  22504. return { transform: [`${`translate${(0, vue.unref)(isVertical) ? "Y" : "X"}`}(${(0, vue.unref)(translate)}px)`, `scale(${(0, vue.unref)(scale)})`].join(" ") };
  22505. });
  22506. return (_ctx, _cache) => {
  22507. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  22508. ref_key: "carouselItemRef",
  22509. ref: carouselItemRef,
  22510. class: (0, vue.normalizeClass)(itemKls.value),
  22511. style: (0, vue.normalizeStyle)(itemStyle.value),
  22512. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleItemClick) && (0, vue.unref)(handleItemClick)(...args))
  22513. }, [(0, vue.unref)(isCardType) ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  22514. key: 0,
  22515. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("mask"))
  22516. }, null, 2)), [[vue.vShow, !(0, vue.unref)(active)]]) : (0, vue.createCommentVNode)("v-if", true), (0, vue.renderSlot)(_ctx.$slots, "default")], 6)), [[vue.vShow, (0, vue.unref)(ready)]]);
  22517. };
  22518. }
  22519. });
  22520. //#endregion
  22521. //#region ../../packages/components/carousel/src/carousel-item.vue
  22522. var carousel_item_default = carousel_item_vue_vue_type_script_setup_true_lang_default;
  22523. //#endregion
  22524. //#region ../../packages/components/carousel/index.ts
  22525. const ElCarousel = withInstall(carousel_default, { CarouselItem: carousel_item_default });
  22526. const ElCarouselItem = withNoopInstall(carousel_item_default);
  22527. //#endregion
  22528. //#region ../../packages/components/cascader-panel/src/config.ts
  22529. const CommonProps = buildProps({
  22530. modelValue: { type: definePropType([
  22531. Number,
  22532. String,
  22533. Array,
  22534. Object
  22535. ]) },
  22536. options: {
  22537. type: definePropType(Array),
  22538. default: () => []
  22539. },
  22540. props: {
  22541. type: definePropType(Object),
  22542. default: () => ({})
  22543. }
  22544. });
  22545. const DefaultProps = {
  22546. expandTrigger: "click",
  22547. multiple: false,
  22548. checkStrictly: false,
  22549. emitPath: true,
  22550. lazy: false,
  22551. lazyLoad: NOOP,
  22552. value: "value",
  22553. label: "label",
  22554. children: "children",
  22555. leaf: "leaf",
  22556. disabled: "disabled",
  22557. hoverThreshold: 500,
  22558. checkOnClickNode: false,
  22559. checkOnClickLeaf: true,
  22560. showPrefix: true
  22561. };
  22562. /**
  22563. * @deprecated Removed after 3.0.0, Use `CascaderPanelProps` instead.
  22564. */
  22565. const cascaderPanelProps = buildProps({
  22566. ...CommonProps,
  22567. border: {
  22568. type: Boolean,
  22569. default: true
  22570. },
  22571. renderLabel: { type: Function }
  22572. });
  22573. const emitChangeFn$2 = (value) => true;
  22574. const cascaderPanelEmits = {
  22575. [UPDATE_MODEL_EVENT]: emitChangeFn$2,
  22576. [CHANGE_EVENT]: emitChangeFn$2,
  22577. close: () => true,
  22578. "expand-change": (value) => value
  22579. };
  22580. const useCascaderConfig = (props) => {
  22581. return (0, vue.computed)(() => ({
  22582. ...DefaultProps,
  22583. ...props.props
  22584. }));
  22585. };
  22586. //#endregion
  22587. //#region ../../packages/components/checkbox/src/checkbox.ts
  22588. /**
  22589. * @deprecated Removed after 3.0.0, Use `CheckboxProps` instead.
  22590. */
  22591. const checkboxProps = {
  22592. modelValue: {
  22593. type: [
  22594. Number,
  22595. String,
  22596. Boolean
  22597. ],
  22598. default: void 0
  22599. },
  22600. label: {
  22601. type: [
  22602. String,
  22603. Boolean,
  22604. Number,
  22605. Object
  22606. ],
  22607. default: void 0
  22608. },
  22609. value: {
  22610. type: [
  22611. String,
  22612. Boolean,
  22613. Number,
  22614. Object
  22615. ],
  22616. default: void 0
  22617. },
  22618. indeterminate: Boolean,
  22619. disabled: {
  22620. type: Boolean,
  22621. default: void 0
  22622. },
  22623. checked: Boolean,
  22624. name: {
  22625. type: String,
  22626. default: void 0
  22627. },
  22628. trueValue: {
  22629. type: [String, Number],
  22630. default: void 0
  22631. },
  22632. falseValue: {
  22633. type: [String, Number],
  22634. default: void 0
  22635. },
  22636. trueLabel: {
  22637. type: [String, Number],
  22638. default: void 0
  22639. },
  22640. falseLabel: {
  22641. type: [String, Number],
  22642. default: void 0
  22643. },
  22644. id: {
  22645. type: String,
  22646. default: void 0
  22647. },
  22648. border: Boolean,
  22649. size: useSizeProp,
  22650. tabindex: [String, Number],
  22651. validateEvent: {
  22652. type: Boolean,
  22653. default: true
  22654. },
  22655. ariaLabel: String,
  22656. ...useAriaProps(["ariaControls"])
  22657. };
  22658. const checkboxEmits = {
  22659. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  22660. change: (val) => isString(val) || isNumber(val) || isBoolean(val)
  22661. };
  22662. const checkboxPropsDefaults = {
  22663. modelValue: void 0,
  22664. label: void 0,
  22665. value: void 0,
  22666. disabled: void 0,
  22667. name: void 0,
  22668. trueValue: void 0,
  22669. falseValue: void 0,
  22670. trueLabel: void 0,
  22671. falseLabel: void 0,
  22672. id: void 0,
  22673. validateEvent: true
  22674. };
  22675. //#endregion
  22676. //#region ../../packages/components/checkbox/src/constants.ts
  22677. const checkboxGroupContextKey = Symbol("checkboxGroupContextKey");
  22678. //#endregion
  22679. //#region ../../packages/components/checkbox/src/composables/use-checkbox-disabled.ts
  22680. const useCheckboxDisabled = ({ model, isChecked }) => {
  22681. const checkboxGroup = (0, vue.inject)(checkboxGroupContextKey, void 0);
  22682. const formContext = (0, vue.inject)(formContextKey, void 0);
  22683. const isLimitDisabled = (0, vue.computed)(() => {
  22684. const max = checkboxGroup?.max?.value;
  22685. const min = checkboxGroup?.min?.value;
  22686. return !isUndefined(max) && model.value.length >= max && !isChecked.value || !isUndefined(min) && model.value.length <= min && isChecked.value;
  22687. });
  22688. return {
  22689. isDisabled: useFormDisabled((0, vue.computed)(() => {
  22690. if (checkboxGroup === void 0) return formContext?.disabled ?? isLimitDisabled.value;
  22691. else return checkboxGroup.disabled?.value || isLimitDisabled.value;
  22692. })),
  22693. isLimitDisabled
  22694. };
  22695. };
  22696. //#endregion
  22697. //#region ../../packages/components/checkbox/src/composables/use-checkbox-event.ts
  22698. const useCheckboxEvent = (props, { model, isLimitExceeded, hasOwnLabel, isDisabled, isLabeledByFormItem }) => {
  22699. const checkboxGroup = (0, vue.inject)(checkboxGroupContextKey, void 0);
  22700. const { formItem } = useFormItem();
  22701. const { emit } = (0, vue.getCurrentInstance)();
  22702. function getLabeledValue(value) {
  22703. return [
  22704. true,
  22705. props.trueValue,
  22706. props.trueLabel
  22707. ].includes(value) ? props.trueValue ?? props.trueLabel ?? true : props.falseValue ?? props.falseLabel ?? false;
  22708. }
  22709. function emitChangeEvent(checked, e) {
  22710. emit(CHANGE_EVENT, getLabeledValue(checked), e);
  22711. }
  22712. function handleChange(e) {
  22713. if (isLimitExceeded.value) return;
  22714. const target = e.target;
  22715. emit(CHANGE_EVENT, getLabeledValue(target.checked), e);
  22716. }
  22717. async function onClickRoot(e) {
  22718. if (isLimitExceeded.value) return;
  22719. if (!hasOwnLabel.value && !isDisabled.value && isLabeledByFormItem.value) {
  22720. if (!e.composedPath().some((item) => item.tagName === "LABEL")) {
  22721. model.value = getLabeledValue([
  22722. false,
  22723. props.falseValue,
  22724. props.falseLabel
  22725. ].includes(model.value));
  22726. await (0, vue.nextTick)();
  22727. emitChangeEvent(model.value, e);
  22728. }
  22729. }
  22730. }
  22731. const validateEvent = (0, vue.computed)(() => checkboxGroup?.validateEvent || props.validateEvent);
  22732. (0, vue.watch)(() => props.modelValue, () => {
  22733. if (validateEvent.value) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  22734. });
  22735. return {
  22736. handleChange,
  22737. onClickRoot
  22738. };
  22739. };
  22740. //#endregion
  22741. //#region ../../packages/components/checkbox/src/composables/use-checkbox-model.ts
  22742. const useCheckboxModel = (props) => {
  22743. const selfModel = (0, vue.ref)(false);
  22744. const { emit } = (0, vue.getCurrentInstance)();
  22745. const checkboxGroup = (0, vue.inject)(checkboxGroupContextKey, void 0);
  22746. const isGroup = (0, vue.computed)(() => isUndefined(checkboxGroup) === false);
  22747. const isLimitExceeded = (0, vue.ref)(false);
  22748. const model = (0, vue.computed)({
  22749. get() {
  22750. return isGroup.value ? checkboxGroup?.modelValue?.value : props.modelValue ?? selfModel.value;
  22751. },
  22752. set(val) {
  22753. if (isGroup.value && isArray$1(val)) {
  22754. isLimitExceeded.value = checkboxGroup?.max?.value !== void 0 && val.length > checkboxGroup?.max.value && val.length > model.value.length;
  22755. isLimitExceeded.value === false && checkboxGroup?.changeEvent?.(val);
  22756. } else {
  22757. emit(UPDATE_MODEL_EVENT, val);
  22758. selfModel.value = val;
  22759. }
  22760. }
  22761. });
  22762. return {
  22763. model,
  22764. isGroup,
  22765. isLimitExceeded
  22766. };
  22767. };
  22768. //#endregion
  22769. //#region ../../packages/components/checkbox/src/composables/use-checkbox-status.ts
  22770. const useCheckboxStatus = (props, slots, { model }) => {
  22771. const checkboxGroup = (0, vue.inject)(checkboxGroupContextKey, void 0);
  22772. const isFocused = (0, vue.ref)(false);
  22773. const actualValue = (0, vue.computed)(() => {
  22774. if (!isPropAbsent(props.value)) return props.value;
  22775. return props.label;
  22776. });
  22777. const isChecked = (0, vue.computed)(() => {
  22778. const value = model.value;
  22779. if (isBoolean(value)) return value;
  22780. else if (isArray$1(value)) if (isObject$1(actualValue.value)) return value.map(vue.toRaw).some((o) => isEqual$1(o, actualValue.value));
  22781. else return value.map(vue.toRaw).includes(actualValue.value);
  22782. else if (value !== null && value !== void 0) return value === props.trueValue || value === props.trueLabel;
  22783. else return !!value;
  22784. });
  22785. return {
  22786. checkboxButtonSize: useFormSize((0, vue.computed)(() => checkboxGroup?.size?.value), { prop: true }),
  22787. isChecked,
  22788. isFocused,
  22789. checkboxSize: useFormSize((0, vue.computed)(() => checkboxGroup?.size?.value)),
  22790. hasOwnLabel: (0, vue.computed)(() => {
  22791. return !!slots.default || !isPropAbsent(actualValue.value);
  22792. }),
  22793. actualValue
  22794. };
  22795. };
  22796. //#endregion
  22797. //#region ../../packages/components/checkbox/src/composables/use-checkbox.ts
  22798. const useCheckbox = (props, slots) => {
  22799. const { formItem: elFormItem } = useFormItem();
  22800. const { model, isGroup, isLimitExceeded } = useCheckboxModel(props);
  22801. const { isFocused, isChecked, checkboxButtonSize, checkboxSize, hasOwnLabel, actualValue } = useCheckboxStatus(props, slots, { model });
  22802. const { isDisabled } = useCheckboxDisabled({
  22803. model,
  22804. isChecked
  22805. });
  22806. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, {
  22807. formItemContext: elFormItem,
  22808. disableIdGeneration: hasOwnLabel,
  22809. disableIdManagement: isGroup
  22810. });
  22811. const { handleChange, onClickRoot } = useCheckboxEvent(props, {
  22812. model,
  22813. isLimitExceeded,
  22814. hasOwnLabel,
  22815. isDisabled,
  22816. isLabeledByFormItem
  22817. });
  22818. const setStoreValue = () => {
  22819. function addToStore() {
  22820. if (isArray$1(model.value) && !model.value.includes(actualValue.value)) model.value.push(actualValue.value);
  22821. else model.value = props.trueValue ?? props.trueLabel ?? true;
  22822. }
  22823. props.checked && addToStore();
  22824. };
  22825. setStoreValue();
  22826. useDeprecated({
  22827. from: "label act as value",
  22828. replacement: "value",
  22829. version: "3.0.0",
  22830. scope: "el-checkbox",
  22831. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22832. }, (0, vue.computed)(() => isGroup.value && isPropAbsent(props.value)));
  22833. useDeprecated({
  22834. from: "true-label",
  22835. replacement: "true-value",
  22836. version: "3.0.0",
  22837. scope: "el-checkbox",
  22838. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22839. }, (0, vue.computed)(() => !!props.trueLabel));
  22840. useDeprecated({
  22841. from: "false-label",
  22842. replacement: "false-value",
  22843. version: "3.0.0",
  22844. scope: "el-checkbox",
  22845. ref: "https://element-plus.org/en-US/component/checkbox.html"
  22846. }, (0, vue.computed)(() => !!props.falseLabel));
  22847. return {
  22848. inputId,
  22849. isLabeledByFormItem,
  22850. isChecked,
  22851. isDisabled,
  22852. isFocused,
  22853. checkboxButtonSize,
  22854. checkboxSize,
  22855. hasOwnLabel,
  22856. model,
  22857. actualValue,
  22858. handleChange,
  22859. onClickRoot
  22860. };
  22861. };
  22862. //#endregion
  22863. //#region ../../packages/components/checkbox/src/checkbox.vue?vue&type=script&setup=true&lang.ts
  22864. const _hoisted_1$63 = [
  22865. "id",
  22866. "indeterminate",
  22867. "name",
  22868. "tabindex",
  22869. "disabled"
  22870. ];
  22871. var checkbox_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  22872. name: "ElCheckbox",
  22873. __name: "checkbox",
  22874. props: checkboxProps,
  22875. emits: checkboxEmits,
  22876. setup(__props) {
  22877. const props = __props;
  22878. const { inputId, isLabeledByFormItem, isChecked, isDisabled, isFocused, checkboxSize, hasOwnLabel, model, actualValue, handleChange, onClickRoot } = useCheckbox(props, (0, vue.useSlots)());
  22879. const inputBindings = (0, vue.computed)(() => {
  22880. if (props.trueValue || props.falseValue || props.trueLabel || props.falseLabel) return {
  22881. "true-value": props.trueValue ?? props.trueLabel ?? true,
  22882. "false-value": props.falseValue ?? props.falseLabel ?? false
  22883. };
  22884. return { value: actualValue.value };
  22885. });
  22886. const ns = useNamespace("checkbox");
  22887. const compKls = (0, vue.computed)(() => {
  22888. return [
  22889. ns.b(),
  22890. ns.m(checkboxSize.value),
  22891. ns.is("disabled", isDisabled.value),
  22892. ns.is("bordered", props.border),
  22893. ns.is("checked", isChecked.value)
  22894. ];
  22895. });
  22896. const spanKls = (0, vue.computed)(() => {
  22897. return [
  22898. ns.e("input"),
  22899. ns.is("disabled", isDisabled.value),
  22900. ns.is("checked", isChecked.value),
  22901. ns.is("indeterminate", props.indeterminate),
  22902. ns.is("focus", isFocused.value)
  22903. ];
  22904. });
  22905. return (_ctx, _cache) => {
  22906. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(!(0, vue.unref)(hasOwnLabel) && (0, vue.unref)(isLabeledByFormItem) ? "span" : "label"), {
  22907. for: !(0, vue.unref)(hasOwnLabel) && (0, vue.unref)(isLabeledByFormItem) ? null : (0, vue.unref)(inputId),
  22908. class: (0, vue.normalizeClass)(compKls.value),
  22909. "aria-controls": __props.indeterminate ? __props.ariaControls : null,
  22910. "aria-checked": __props.indeterminate ? "mixed" : void 0,
  22911. "aria-label": __props.ariaLabel,
  22912. onClick: (0, vue.unref)(onClickRoot)
  22913. }, {
  22914. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(spanKls.value) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", (0, vue.mergeProps)({
  22915. id: (0, vue.unref)(inputId),
  22916. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(model) ? model.value = $event : null),
  22917. class: (0, vue.unref)(ns).e("original"),
  22918. type: "checkbox",
  22919. indeterminate: __props.indeterminate,
  22920. name: __props.name,
  22921. tabindex: __props.tabindex,
  22922. disabled: (0, vue.unref)(isDisabled)
  22923. }, inputBindings.value, {
  22924. onChange: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleChange) && (0, vue.unref)(handleChange)(...args)),
  22925. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  22926. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
  22927. onClick: _cache[4] || (_cache[4] = (0, vue.withModifiers)(() => {}, ["stop"]))
  22928. }), null, 16, _hoisted_1$63), [[vue.vModelCheckbox, (0, vue.unref)(model)]]), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner")) }, null, 2)], 2), (0, vue.unref)(hasOwnLabel) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  22929. key: 0,
  22930. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("label"))
  22931. }, [(0, vue.renderSlot)(_ctx.$slots, "default"), !_ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.label), 1)], 64)) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true)]),
  22932. _: 3
  22933. }, 8, [
  22934. "for",
  22935. "class",
  22936. "aria-controls",
  22937. "aria-checked",
  22938. "aria-label",
  22939. "onClick"
  22940. ]);
  22941. };
  22942. }
  22943. });
  22944. //#endregion
  22945. //#region ../../packages/components/checkbox/src/checkbox.vue
  22946. var checkbox_default = checkbox_vue_vue_type_script_setup_true_lang_default;
  22947. //#endregion
  22948. //#region ../../packages/components/checkbox/src/checkbox-button.vue?vue&type=script&setup=true&lang.ts
  22949. const _hoisted_1$62 = [
  22950. "name",
  22951. "tabindex",
  22952. "disabled"
  22953. ];
  22954. var checkbox_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  22955. name: "ElCheckboxButton",
  22956. __name: "checkbox-button",
  22957. props: checkboxProps,
  22958. emits: checkboxEmits,
  22959. setup(__props) {
  22960. const props = __props;
  22961. const { isFocused, isChecked, isDisabled, checkboxButtonSize, model, actualValue, handleChange } = useCheckbox(props, (0, vue.useSlots)());
  22962. const inputBindings = (0, vue.computed)(() => {
  22963. if (props.trueValue || props.falseValue || props.trueLabel || props.falseLabel) return {
  22964. "true-value": props.trueValue ?? props.trueLabel ?? true,
  22965. "false-value": props.falseValue ?? props.falseLabel ?? false
  22966. };
  22967. return { value: actualValue.value };
  22968. });
  22969. const checkboxGroup = (0, vue.inject)(checkboxGroupContextKey, void 0);
  22970. const ns = useNamespace("checkbox");
  22971. const activeStyle = (0, vue.computed)(() => {
  22972. const fillValue = checkboxGroup?.fill?.value ?? "";
  22973. return {
  22974. backgroundColor: fillValue,
  22975. borderColor: fillValue,
  22976. color: checkboxGroup?.textColor?.value ?? "",
  22977. boxShadow: fillValue ? `-1px 0 0 0 ${fillValue}` : void 0
  22978. };
  22979. });
  22980. const labelKls = (0, vue.computed)(() => {
  22981. return [
  22982. ns.b("button"),
  22983. ns.bm("button", checkboxButtonSize.value),
  22984. ns.is("disabled", isDisabled.value),
  22985. ns.is("checked", isChecked.value),
  22986. ns.is("focus", isFocused.value)
  22987. ];
  22988. });
  22989. return (_ctx, _cache) => {
  22990. return (0, vue.openBlock)(), (0, vue.createElementBlock)("label", { class: (0, vue.normalizeClass)(labelKls.value) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", (0, vue.mergeProps)({
  22991. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(model) ? model.value = $event : null),
  22992. class: (0, vue.unref)(ns).be("button", "original"),
  22993. type: "checkbox",
  22994. name: __props.name,
  22995. tabindex: __props.tabindex,
  22996. disabled: (0, vue.unref)(isDisabled)
  22997. }, inputBindings.value, {
  22998. onChange: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleChange) && (0, vue.unref)(handleChange)(...args)),
  22999. onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
  23000. onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
  23001. onClick: _cache[4] || (_cache[4] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23002. }), null, 16, _hoisted_1$62), [[vue.vModelCheckbox, (0, vue.unref)(model)]]), _ctx.$slots.default || __props.label ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  23003. key: 0,
  23004. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("button", "inner")),
  23005. style: (0, vue.normalizeStyle)((0, vue.unref)(isChecked) ? activeStyle.value : void 0)
  23006. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.label), 1)])], 6)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  23007. };
  23008. }
  23009. });
  23010. //#endregion
  23011. //#region ../../packages/components/checkbox/src/checkbox-button.vue
  23012. var checkbox_button_default = checkbox_button_vue_vue_type_script_setup_true_lang_default;
  23013. //#endregion
  23014. //#region ../../packages/components/checkbox/src/checkbox-group.ts
  23015. /**
  23016. * @deprecated Removed after 3.0.0, Use `CheckboxGroupProps` instead.
  23017. */
  23018. const checkboxGroupProps = buildProps({
  23019. modelValue: {
  23020. type: definePropType(Array),
  23021. default: () => []
  23022. },
  23023. disabled: {
  23024. type: Boolean,
  23025. default: void 0
  23026. },
  23027. min: Number,
  23028. max: Number,
  23029. size: useSizeProp,
  23030. fill: String,
  23031. textColor: String,
  23032. tag: {
  23033. type: String,
  23034. default: "div"
  23035. },
  23036. validateEvent: {
  23037. type: Boolean,
  23038. default: true
  23039. },
  23040. options: { type: definePropType(Array) },
  23041. props: {
  23042. type: definePropType(Object),
  23043. default: () => checkboxDefaultProps
  23044. },
  23045. type: {
  23046. type: String,
  23047. values: ["checkbox", "button"],
  23048. default: "checkbox"
  23049. },
  23050. ...useAriaProps(["ariaLabel"])
  23051. });
  23052. const checkboxGroupEmits = {
  23053. [UPDATE_MODEL_EVENT]: (val) => isArray$1(val),
  23054. change: (val) => isArray$1(val)
  23055. };
  23056. const checkboxDefaultProps = {
  23057. label: "label",
  23058. value: "value",
  23059. disabled: "disabled"
  23060. };
  23061. //#endregion
  23062. //#region ../../packages/components/checkbox/src/checkbox-group.vue?vue&type=script&setup=true&lang.ts
  23063. var checkbox_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23064. name: "ElCheckboxGroup",
  23065. __name: "checkbox-group",
  23066. props: checkboxGroupProps,
  23067. emits: checkboxGroupEmits,
  23068. setup(__props, { emit: __emit }) {
  23069. const props = __props;
  23070. const emit = __emit;
  23071. const ns = useNamespace("checkbox");
  23072. const checkboxDisabled = useFormDisabled();
  23073. const { formItem } = useFormItem();
  23074. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  23075. const changeEvent = async (value) => {
  23076. emit(UPDATE_MODEL_EVENT, value);
  23077. await (0, vue.nextTick)();
  23078. emit(CHANGE_EVENT, value);
  23079. };
  23080. const modelValue = (0, vue.computed)({
  23081. get() {
  23082. return props.modelValue;
  23083. },
  23084. set(val) {
  23085. changeEvent(val);
  23086. }
  23087. });
  23088. const aliasProps = (0, vue.computed)(() => ({
  23089. ...checkboxDefaultProps,
  23090. ...props.props
  23091. }));
  23092. const getOptionProps = (option) => {
  23093. const { label, value, disabled } = aliasProps.value;
  23094. const base = {
  23095. label: option[label],
  23096. value: option[value],
  23097. disabled: option[disabled]
  23098. };
  23099. return {
  23100. ...omit(option, [
  23101. label,
  23102. value,
  23103. disabled
  23104. ]),
  23105. ...base
  23106. };
  23107. };
  23108. const optionComponent = (0, vue.computed)(() => props.type === "button" ? checkbox_button_default : checkbox_default);
  23109. (0, vue.provide)(checkboxGroupContextKey, {
  23110. ...pick((0, vue.toRefs)(props), [
  23111. "size",
  23112. "min",
  23113. "max",
  23114. "validateEvent",
  23115. "fill",
  23116. "textColor"
  23117. ]),
  23118. disabled: checkboxDisabled,
  23119. modelValue,
  23120. changeEvent
  23121. });
  23122. (0, vue.watch)(() => props.modelValue, (newVal, oldValue) => {
  23123. if (props.validateEvent && !isEqual$1(newVal, oldValue)) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  23124. });
  23125. return (_ctx, _cache) => {
  23126. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
  23127. id: (0, vue.unref)(groupId),
  23128. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("group")),
  23129. role: "group",
  23130. "aria-label": !(0, vue.unref)(isLabeledByFormItem) ? __props.ariaLabel || "checkbox-group" : void 0,
  23131. "aria-labelledby": (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(formItem)?.labelId : void 0
  23132. }, {
  23133. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.options, (item, index) => {
  23134. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(optionComponent.value), (0, vue.mergeProps)({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16);
  23135. }), 128))])]),
  23136. _: 3
  23137. }, 8, [
  23138. "id",
  23139. "class",
  23140. "aria-label",
  23141. "aria-labelledby"
  23142. ]);
  23143. };
  23144. }
  23145. });
  23146. //#endregion
  23147. //#region ../../packages/components/checkbox/src/checkbox-group.vue
  23148. var checkbox_group_default = checkbox_group_vue_vue_type_script_setup_true_lang_default;
  23149. //#endregion
  23150. //#region ../../packages/components/checkbox/index.ts
  23151. const ElCheckbox = withInstall(checkbox_default, {
  23152. CheckboxButton: checkbox_button_default,
  23153. CheckboxGroup: checkbox_group_default
  23154. });
  23155. const ElCheckboxButton = withNoopInstall(checkbox_button_default);
  23156. const ElCheckboxGroup = withNoopInstall(checkbox_group_default);
  23157. //#endregion
  23158. //#region ../../packages/components/radio/src/radio.ts
  23159. /**
  23160. * @deprecated Removed after 3.0.0, Use `RadioPropsBase` instead.
  23161. */
  23162. const radioPropsBase = buildProps({
  23163. modelValue: {
  23164. type: [
  23165. String,
  23166. Number,
  23167. Boolean
  23168. ],
  23169. default: void 0
  23170. },
  23171. size: useSizeProp,
  23172. disabled: {
  23173. type: Boolean,
  23174. default: void 0
  23175. },
  23176. label: {
  23177. type: [
  23178. String,
  23179. Number,
  23180. Boolean
  23181. ],
  23182. default: void 0
  23183. },
  23184. value: {
  23185. type: [
  23186. String,
  23187. Number,
  23188. Boolean
  23189. ],
  23190. default: void 0
  23191. },
  23192. name: {
  23193. type: String,
  23194. default: void 0
  23195. }
  23196. });
  23197. /**
  23198. * @deprecated Removed after 3.0.0, Use `RadioProps` instead.
  23199. */
  23200. const radioProps = buildProps({
  23201. ...radioPropsBase,
  23202. border: Boolean
  23203. });
  23204. const radioEmits = {
  23205. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  23206. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  23207. };
  23208. /**
  23209. * @description default values for RadioProps
  23210. */
  23211. const radioPropsDefaults = {
  23212. modelValue: void 0,
  23213. disabled: void 0,
  23214. label: void 0,
  23215. value: void 0,
  23216. name: void 0,
  23217. border: false
  23218. };
  23219. //#endregion
  23220. //#region ../../packages/components/radio/src/constants.ts
  23221. const radioGroupKey = Symbol("radioGroupKey");
  23222. //#endregion
  23223. //#region ../../packages/components/radio/src/use-radio.ts
  23224. const useRadio = (props, emit) => {
  23225. const radioRef = (0, vue.ref)();
  23226. const radioGroup = (0, vue.inject)(radioGroupKey, void 0);
  23227. const isGroup = (0, vue.computed)(() => !!radioGroup);
  23228. const actualValue = (0, vue.computed)(() => {
  23229. if (!isPropAbsent(props.value)) return props.value;
  23230. return props.label;
  23231. });
  23232. const modelValue = (0, vue.computed)({
  23233. get() {
  23234. return isGroup.value ? radioGroup.modelValue : props.modelValue;
  23235. },
  23236. set(val) {
  23237. if (isGroup.value) radioGroup.changeEvent(val);
  23238. else emit && emit(UPDATE_MODEL_EVENT, val);
  23239. radioRef.value.checked = props.modelValue === actualValue.value;
  23240. }
  23241. });
  23242. const size = useFormSize((0, vue.computed)(() => radioGroup?.size));
  23243. const disabled = useFormDisabled((0, vue.computed)(() => radioGroup?.disabled));
  23244. const focus = (0, vue.ref)(false);
  23245. const tabIndex = (0, vue.computed)(() => {
  23246. return disabled.value || isGroup.value && modelValue.value !== actualValue.value ? -1 : 0;
  23247. });
  23248. useDeprecated({
  23249. from: "label act as value",
  23250. replacement: "value",
  23251. version: "3.0.0",
  23252. scope: "el-radio",
  23253. ref: "https://element-plus.org/en-US/component/radio.html"
  23254. }, (0, vue.computed)(() => isGroup.value && isPropAbsent(props.value)));
  23255. return {
  23256. radioRef,
  23257. isGroup,
  23258. radioGroup,
  23259. focus,
  23260. size,
  23261. disabled,
  23262. tabIndex,
  23263. modelValue,
  23264. actualValue
  23265. };
  23266. };
  23267. //#endregion
  23268. //#region ../../packages/components/radio/src/radio.vue?vue&type=script&setup=true&lang.ts
  23269. const _hoisted_1$61 = [
  23270. "value",
  23271. "name",
  23272. "disabled",
  23273. "checked"
  23274. ];
  23275. var radio_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23276. name: "ElRadio",
  23277. __name: "radio",
  23278. props: radioProps,
  23279. emits: radioEmits,
  23280. setup(__props, { emit: __emit }) {
  23281. const props = __props;
  23282. const emit = __emit;
  23283. const ns = useNamespace("radio");
  23284. const { radioRef, radioGroup, focus, size, disabled, modelValue, actualValue } = useRadio(props, emit);
  23285. function handleChange() {
  23286. (0, vue.nextTick)(() => emit(CHANGE_EVENT, modelValue.value));
  23287. }
  23288. return (_ctx, _cache) => {
  23289. return (0, vue.openBlock)(), (0, vue.createElementBlock)("label", { class: (0, vue.normalizeClass)([
  23290. (0, vue.unref)(ns).b(),
  23291. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(disabled)),
  23292. (0, vue.unref)(ns).is("focus", (0, vue.unref)(focus)),
  23293. (0, vue.unref)(ns).is("bordered", __props.border),
  23294. (0, vue.unref)(ns).is("checked", (0, vue.unref)(modelValue) === (0, vue.unref)(actualValue)),
  23295. (0, vue.unref)(ns).m((0, vue.unref)(size))
  23296. ]) }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([
  23297. (0, vue.unref)(ns).e("input"),
  23298. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(disabled)),
  23299. (0, vue.unref)(ns).is("checked", (0, vue.unref)(modelValue) === (0, vue.unref)(actualValue))
  23300. ]) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
  23301. ref_key: "radioRef",
  23302. ref: radioRef,
  23303. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(modelValue) ? modelValue.value = $event : null),
  23304. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("original")),
  23305. value: (0, vue.unref)(actualValue),
  23306. name: __props.name || (0, vue.unref)(radioGroup)?.name,
  23307. disabled: (0, vue.unref)(disabled),
  23308. checked: (0, vue.unref)(modelValue) === (0, vue.unref)(actualValue),
  23309. type: "radio",
  23310. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  23311. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  23312. onChange: handleChange,
  23313. onClick: _cache[3] || (_cache[3] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23314. }, null, 42, _hoisted_1$61), [[vue.vModelRadio, (0, vue.unref)(modelValue)]]), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner")) }, null, 2)], 2), (0, vue.createElementVNode)("span", {
  23315. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("label")),
  23316. onKeydown: _cache[4] || (_cache[4] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23317. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.label), 1)])], 34)], 2);
  23318. };
  23319. }
  23320. });
  23321. //#endregion
  23322. //#region ../../packages/components/radio/src/radio.vue
  23323. var radio_default = radio_vue_vue_type_script_setup_true_lang_default;
  23324. //#endregion
  23325. //#region ../../packages/components/radio/src/radio-button.ts
  23326. /**
  23327. * @deprecated Removed after 3.0.0, Use `RadioButtonProps` instead.
  23328. */
  23329. const radioButtonProps = buildProps({ ...radioPropsBase });
  23330. /**
  23331. * @description default values for RadioButtonProps
  23332. */
  23333. const radioButtonPropsDefaults = {
  23334. modelValue: void 0,
  23335. disabled: void 0,
  23336. label: void 0,
  23337. value: void 0,
  23338. name: void 0
  23339. };
  23340. //#endregion
  23341. //#region ../../packages/components/radio/src/radio-button.vue?vue&type=script&setup=true&lang.ts
  23342. const _hoisted_1$60 = [
  23343. "value",
  23344. "name",
  23345. "disabled"
  23346. ];
  23347. var radio_button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23348. name: "ElRadioButton",
  23349. __name: "radio-button",
  23350. props: radioButtonProps,
  23351. setup(__props) {
  23352. const props = __props;
  23353. const ns = useNamespace("radio");
  23354. const { radioRef, focus, size, disabled, modelValue, radioGroup, actualValue } = useRadio(props);
  23355. const activeStyle = (0, vue.computed)(() => {
  23356. return {
  23357. backgroundColor: radioGroup?.fill || "",
  23358. borderColor: radioGroup?.fill || "",
  23359. boxShadow: radioGroup?.fill ? `-1px 0 0 0 ${radioGroup.fill}` : "",
  23360. color: radioGroup?.textColor || ""
  23361. };
  23362. });
  23363. return (_ctx, _cache) => {
  23364. return (0, vue.openBlock)(), (0, vue.createElementBlock)("label", { class: (0, vue.normalizeClass)([
  23365. (0, vue.unref)(ns).b("button"),
  23366. (0, vue.unref)(ns).is("active", (0, vue.unref)(modelValue) === (0, vue.unref)(actualValue)),
  23367. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(disabled)),
  23368. (0, vue.unref)(ns).is("focus", (0, vue.unref)(focus)),
  23369. (0, vue.unref)(ns).bm("button", (0, vue.unref)(size))
  23370. ]) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
  23371. ref_key: "radioRef",
  23372. ref: radioRef,
  23373. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(modelValue) ? modelValue.value = $event : null),
  23374. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("button", "original-radio")),
  23375. value: (0, vue.unref)(actualValue),
  23376. type: "radio",
  23377. name: __props.name || (0, vue.unref)(radioGroup)?.name,
  23378. disabled: (0, vue.unref)(disabled),
  23379. onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
  23380. onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
  23381. onClick: _cache[3] || (_cache[3] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23382. }, null, 42, _hoisted_1$60), [[vue.vModelRadio, (0, vue.unref)(modelValue)]]), (0, vue.createElementVNode)("span", {
  23383. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("button", "inner")),
  23384. style: (0, vue.normalizeStyle)((0, vue.unref)(modelValue) === (0, vue.unref)(actualValue) ? activeStyle.value : {}),
  23385. onKeydown: _cache[4] || (_cache[4] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23386. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.label), 1)])], 38)], 2);
  23387. };
  23388. }
  23389. });
  23390. //#endregion
  23391. //#region ../../packages/components/radio/src/radio-button.vue
  23392. var radio_button_default = radio_button_vue_vue_type_script_setup_true_lang_default;
  23393. //#endregion
  23394. //#region ../../packages/components/radio/src/radio-group.ts
  23395. const radioDefaultProps = {
  23396. label: "label",
  23397. value: "value",
  23398. disabled: "disabled"
  23399. };
  23400. /**
  23401. * @deprecated Removed after 3.0.0, Use `RadioGroupProps` instead.
  23402. */
  23403. const radioGroupProps = buildProps({
  23404. id: {
  23405. type: String,
  23406. default: void 0
  23407. },
  23408. size: useSizeProp,
  23409. disabled: {
  23410. type: Boolean,
  23411. default: void 0
  23412. },
  23413. modelValue: {
  23414. type: [
  23415. String,
  23416. Number,
  23417. Boolean
  23418. ],
  23419. default: void 0
  23420. },
  23421. fill: {
  23422. type: String,
  23423. default: ""
  23424. },
  23425. textColor: {
  23426. type: String,
  23427. default: ""
  23428. },
  23429. name: {
  23430. type: String,
  23431. default: void 0
  23432. },
  23433. validateEvent: {
  23434. type: Boolean,
  23435. default: true
  23436. },
  23437. options: { type: definePropType(Array) },
  23438. props: {
  23439. type: definePropType(Object),
  23440. default: () => radioDefaultProps
  23441. },
  23442. type: {
  23443. type: String,
  23444. values: ["radio", "button"],
  23445. default: "radio"
  23446. },
  23447. ...useAriaProps(["ariaLabel"])
  23448. });
  23449. const radioGroupEmits = radioEmits;
  23450. /**
  23451. * @description default values for RadioGroupProps
  23452. */
  23453. const radioGroupPropsDefaults = {
  23454. id: void 0,
  23455. disabled: void 0,
  23456. modelValue: void 0,
  23457. fill: "",
  23458. textColor: "",
  23459. name: void 0,
  23460. validateEvent: true,
  23461. props: () => radioDefaultProps,
  23462. type: "radio"
  23463. };
  23464. //#endregion
  23465. //#region ../../packages/components/radio/src/radio-group.vue?vue&type=script&setup=true&lang.ts
  23466. const _hoisted_1$59 = [
  23467. "id",
  23468. "aria-label",
  23469. "aria-labelledby"
  23470. ];
  23471. var radio_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23472. name: "ElRadioGroup",
  23473. __name: "radio-group",
  23474. props: radioGroupProps,
  23475. emits: radioGroupEmits,
  23476. setup(__props, { emit: __emit }) {
  23477. const props = __props;
  23478. const emit = __emit;
  23479. const ns = useNamespace("radio");
  23480. const radioId = useId();
  23481. const radioGroupRef = (0, vue.ref)();
  23482. const { formItem } = useFormItem();
  23483. const { inputId: groupId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  23484. const changeEvent = (value) => {
  23485. emit(UPDATE_MODEL_EVENT, value);
  23486. (0, vue.nextTick)(() => emit(CHANGE_EVENT, value));
  23487. };
  23488. (0, vue.onMounted)(() => {
  23489. const radios = radioGroupRef.value.querySelectorAll("[type=radio]");
  23490. const firstLabel = radios[0];
  23491. if (!Array.from(radios).some((radio) => radio.checked) && firstLabel) firstLabel.tabIndex = 0;
  23492. });
  23493. const name = (0, vue.computed)(() => {
  23494. return props.name || radioId.value;
  23495. });
  23496. const aliasProps = (0, vue.computed)(() => ({
  23497. ...radioDefaultProps,
  23498. ...props.props
  23499. }));
  23500. const getOptionProps = (option) => {
  23501. const { label, value, disabled } = aliasProps.value;
  23502. const base = {
  23503. label: option[label],
  23504. value: option[value],
  23505. disabled: option[disabled]
  23506. };
  23507. return {
  23508. ...omit(option, [
  23509. label,
  23510. value,
  23511. disabled
  23512. ]),
  23513. ...base
  23514. };
  23515. };
  23516. const optionComponent = (0, vue.computed)(() => props.type === "button" ? radio_button_default : radio_default);
  23517. (0, vue.provide)(radioGroupKey, (0, vue.reactive)({
  23518. ...(0, vue.toRefs)(props),
  23519. changeEvent,
  23520. name
  23521. }));
  23522. (0, vue.watch)(() => props.modelValue, (newVal, oldValue) => {
  23523. if (props.validateEvent && !isEqual$1(newVal, oldValue)) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  23524. });
  23525. return (_ctx, _cache) => {
  23526. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  23527. id: (0, vue.unref)(groupId),
  23528. ref_key: "radioGroupRef",
  23529. ref: radioGroupRef,
  23530. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("group")),
  23531. role: "radiogroup",
  23532. "aria-label": !(0, vue.unref)(isLabeledByFormItem) ? __props.ariaLabel || "radio-group" : void 0,
  23533. "aria-labelledby": (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(formItem).labelId : void 0
  23534. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.options, (item, index) => {
  23535. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(optionComponent.value), (0, vue.mergeProps)({ key: index }, { ref_for: true }, getOptionProps(item)), null, 16);
  23536. }), 128))])], 10, _hoisted_1$59);
  23537. };
  23538. }
  23539. });
  23540. //#endregion
  23541. //#region ../../packages/components/radio/src/radio-group.vue
  23542. var radio_group_default = radio_group_vue_vue_type_script_setup_true_lang_default;
  23543. //#endregion
  23544. //#region ../../packages/components/radio/index.ts
  23545. const ElRadio = withInstall(radio_default, {
  23546. RadioButton: radio_button_default,
  23547. RadioGroup: radio_group_default
  23548. });
  23549. const ElRadioGroup = withNoopInstall(radio_group_default);
  23550. const ElRadioButton = withNoopInstall(radio_button_default);
  23551. //#endregion
  23552. //#region ../../packages/components/cascader-panel/src/types.ts
  23553. const CASCADER_PANEL_INJECTION_KEY = Symbol();
  23554. //#endregion
  23555. //#region ../../packages/components/cascader-panel/src/node-content.tsx
  23556. function isVNodeEmpty(vnodes) {
  23557. return !!(isArray$1(vnodes) ? vnodes.every(({ type }) => type === vue.Comment) : vnodes?.type === vue.Comment);
  23558. }
  23559. var node_content_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23560. name: "NodeContent",
  23561. props: { node: {
  23562. type: Object,
  23563. required: true
  23564. } },
  23565. setup(props) {
  23566. const ns = useNamespace("cascader-node");
  23567. const { renderLabelFn } = (0, vue.inject)(CASCADER_PANEL_INJECTION_KEY);
  23568. const { node } = props;
  23569. const { data, label: nodeLabel } = node;
  23570. const label = () => {
  23571. const renderLabel = renderLabelFn?.({
  23572. node,
  23573. data
  23574. });
  23575. return isVNodeEmpty(renderLabel) ? nodeLabel : renderLabel ?? nodeLabel;
  23576. };
  23577. return () => (0, vue.createVNode)("span", { "class": ns.e("label") }, [label()]);
  23578. }
  23579. });
  23580. //#endregion
  23581. //#region ../../packages/components/cascader-panel/src/node.vue?vue&type=script&setup=true&lang.ts
  23582. const _hoisted_1$58 = [
  23583. "id",
  23584. "aria-haspopup",
  23585. "aria-owns",
  23586. "aria-expanded",
  23587. "tabindex"
  23588. ];
  23589. var node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23590. name: "ElCascaderNode",
  23591. __name: "node",
  23592. props: {
  23593. node: {
  23594. type: Object,
  23595. required: true
  23596. },
  23597. menuId: String
  23598. },
  23599. emits: ["expand"],
  23600. setup(__props, { emit: __emit }) {
  23601. const props = __props;
  23602. const emit = __emit;
  23603. const panel = (0, vue.inject)(CASCADER_PANEL_INJECTION_KEY);
  23604. const ns = useNamespace("cascader-node");
  23605. const isHoverMenu = (0, vue.computed)(() => panel.isHoverMenu);
  23606. const multiple = (0, vue.computed)(() => panel.config.multiple);
  23607. const checkStrictly = (0, vue.computed)(() => panel.config.checkStrictly);
  23608. const showPrefix = (0, vue.computed)(() => panel.config.showPrefix);
  23609. const checkedNodeId = (0, vue.computed)(() => panel.checkedNodes[0]?.uid);
  23610. const isDisabled = (0, vue.computed)(() => props.node.isDisabled);
  23611. const isLeaf = (0, vue.computed)(() => props.node.isLeaf);
  23612. const expandable = (0, vue.computed)(() => checkStrictly.value && !isLeaf.value || !isDisabled.value);
  23613. const inExpandingPath = (0, vue.computed)(() => isInPath(panel.expandingNode));
  23614. const inCheckedPath = (0, vue.computed)(() => checkStrictly.value && panel.checkedNodes.some(isInPath));
  23615. const isInPath = (node) => {
  23616. const { level, uid } = props.node;
  23617. return node?.pathNodes[level - 1]?.uid === uid;
  23618. };
  23619. const doExpand = () => {
  23620. if (inExpandingPath.value) return;
  23621. panel.expandNode(props.node);
  23622. };
  23623. const doCheck = (checked) => {
  23624. const { node } = props;
  23625. if (checked === node.checked) return;
  23626. panel.handleCheckChange(node, checked);
  23627. };
  23628. const doLoad = () => {
  23629. panel.lazyLoad(props.node, () => {
  23630. if (!isLeaf.value) doExpand();
  23631. });
  23632. };
  23633. const handleHoverExpand = (e) => {
  23634. if (!isHoverMenu.value) return;
  23635. handleExpand();
  23636. !isLeaf.value && emit("expand", e);
  23637. };
  23638. const handleExpand = () => {
  23639. const { node } = props;
  23640. if (!expandable.value || node.loading) return;
  23641. node.loaded ? doExpand() : doLoad();
  23642. };
  23643. const handleClick = () => {
  23644. if (isLeaf.value && !isDisabled.value && !checkStrictly.value && !multiple.value) handleCheck(true);
  23645. else if ((panel.config.checkOnClickNode && (multiple.value || checkStrictly.value) || isLeaf.value && panel.config.checkOnClickLeaf) && !isDisabled.value) handleSelectCheck(!props.node.checked);
  23646. else if (!isHoverMenu.value) handleExpand();
  23647. };
  23648. const handleSelectCheck = (checked) => {
  23649. if (checkStrictly.value) {
  23650. doCheck(checked);
  23651. if (props.node.loaded) doExpand();
  23652. } else handleCheck(checked);
  23653. };
  23654. const handleCheck = (checked) => {
  23655. if (!props.node.loaded) doLoad();
  23656. else {
  23657. doCheck(checked);
  23658. !checkStrictly.value && doExpand();
  23659. }
  23660. };
  23661. return (_ctx, _cache) => {
  23662. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  23663. id: `${__props.menuId}-${__props.node.uid}`,
  23664. role: "menuitem",
  23665. "aria-haspopup": !isLeaf.value,
  23666. "aria-owns": isLeaf.value ? void 0 : __props.menuId,
  23667. "aria-expanded": inExpandingPath.value,
  23668. tabindex: expandable.value ? -1 : void 0,
  23669. class: (0, vue.normalizeClass)([
  23670. (0, vue.unref)(ns).b(),
  23671. (0, vue.unref)(ns).is("selectable", checkStrictly.value),
  23672. (0, vue.unref)(ns).is("active", __props.node.checked),
  23673. (0, vue.unref)(ns).is("disabled", !expandable.value),
  23674. inExpandingPath.value && "in-active-path",
  23675. inCheckedPath.value && "in-checked-path"
  23676. ]),
  23677. onMouseenter: handleHoverExpand,
  23678. onFocus: handleHoverExpand,
  23679. onClick: handleClick
  23680. }, [
  23681. (0, vue.createCommentVNode)(" prefix "),
  23682. multiple.value && showPrefix.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElCheckbox), {
  23683. key: 0,
  23684. "model-value": __props.node.checked,
  23685. indeterminate: __props.node.indeterminate,
  23686. disabled: isDisabled.value,
  23687. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"])),
  23688. "onUpdate:modelValue": handleSelectCheck
  23689. }, null, 8, [
  23690. "model-value",
  23691. "indeterminate",
  23692. "disabled"
  23693. ])) : checkStrictly.value && showPrefix.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElRadio), {
  23694. key: 1,
  23695. "model-value": checkedNodeId.value,
  23696. label: __props.node.uid,
  23697. disabled: isDisabled.value,
  23698. "onUpdate:modelValue": handleSelectCheck,
  23699. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["stop"]))
  23700. }, {
  23701. default: (0, vue.withCtx)(() => [(0, 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 "), _cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", null, null, -1))]),
  23702. _: 1
  23703. }, 8, [
  23704. "model-value",
  23705. "label",
  23706. "disabled"
  23707. ])) : isLeaf.value && __props.node.checked ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  23708. key: 2,
  23709. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("prefix"))
  23710. }, {
  23711. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(check_default))]),
  23712. _: 1
  23713. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true),
  23714. (0, vue.createCommentVNode)(" content "),
  23715. (0, vue.createVNode)((0, vue.unref)(node_content_default), { node: __props.node }, null, 8, ["node"]),
  23716. (0, vue.createCommentVNode)(" postfix "),
  23717. !isLeaf.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 3 }, [__props.node.loading ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  23718. key: 0,
  23719. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).is("loading"), (0, vue.unref)(ns).e("postfix")])
  23720. }, {
  23721. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(loading_default))]),
  23722. _: 1
  23723. }, 8, ["class"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  23724. key: 1,
  23725. class: (0, vue.normalizeClass)(["arrow-right", (0, vue.unref)(ns).e("postfix")])
  23726. }, {
  23727. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  23728. _: 1
  23729. }, 8, ["class"]))], 64)) : (0, vue.createCommentVNode)("v-if", true)
  23730. ], 42, _hoisted_1$58);
  23731. };
  23732. }
  23733. });
  23734. //#endregion
  23735. //#region ../../packages/components/cascader-panel/src/node.vue
  23736. var node_default = node_vue_vue_type_script_setup_true_lang_default;
  23737. //#endregion
  23738. //#region ../../packages/components/cascader-panel/src/menu.vue?vue&type=script&setup=true&lang.ts
  23739. var menu_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  23740. name: "ElCascaderMenu",
  23741. __name: "menu",
  23742. props: {
  23743. nodes: {
  23744. type: Array,
  23745. required: true
  23746. },
  23747. index: {
  23748. type: Number,
  23749. required: true
  23750. }
  23751. },
  23752. setup(__props) {
  23753. const props = __props;
  23754. const instance = (0, vue.getCurrentInstance)();
  23755. const ns = useNamespace("cascader-menu");
  23756. const { t } = useLocale();
  23757. const id = useId();
  23758. let activeNode;
  23759. let hoverTimer;
  23760. const panel = (0, vue.inject)(CASCADER_PANEL_INJECTION_KEY);
  23761. const hoverZone = (0, vue.ref)();
  23762. const isEmpty = (0, vue.computed)(() => !props.nodes.length);
  23763. const isLoading = (0, vue.computed)(() => !panel.initialLoaded);
  23764. const menuId = (0, vue.computed)(() => `${id.value}-${props.index}`);
  23765. const handleExpand = (e) => {
  23766. activeNode = e.target;
  23767. };
  23768. const handleMouseMove = (e) => {
  23769. if (!panel.isHoverMenu || !activeNode || !hoverZone.value) return;
  23770. if (activeNode.contains(e.target)) {
  23771. clearHoverTimer();
  23772. const el = instance.vnode.el;
  23773. const { left } = el.getBoundingClientRect();
  23774. const { offsetWidth, offsetHeight } = el;
  23775. const startX = e.clientX - left;
  23776. const top = activeNode.offsetTop;
  23777. const bottom = top + activeNode.offsetHeight;
  23778. const scrollTop = el.querySelector(`.${ns.e("wrap")}`)?.scrollTop || 0;
  23779. hoverZone.value.innerHTML = `
  23780. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${top} L${offsetWidth} ${scrollTop} V${top} Z" />
  23781. <path style="pointer-events: auto;" fill="transparent" d="M${startX} ${bottom} L${offsetWidth} ${offsetHeight + scrollTop} V${bottom} Z" />
  23782. `;
  23783. } else if (!hoverTimer) hoverTimer = window.setTimeout(clearHoverZone, panel.config.hoverThreshold);
  23784. };
  23785. const clearHoverTimer = () => {
  23786. if (!hoverTimer) return;
  23787. clearTimeout(hoverTimer);
  23788. hoverTimer = void 0;
  23789. };
  23790. const clearHoverZone = () => {
  23791. if (!hoverZone.value) return;
  23792. hoverZone.value.innerHTML = "";
  23793. clearHoverTimer();
  23794. };
  23795. return (_ctx, _cache) => {
  23796. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElScrollbar), {
  23797. key: menuId.value,
  23798. tag: "ul",
  23799. role: "menu",
  23800. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  23801. "wrap-class": (0, vue.unref)(ns).e("wrap"),
  23802. "view-class": [(0, vue.unref)(ns).e("list"), (0, vue.unref)(ns).is("empty", isEmpty.value)],
  23803. onMousemove: handleMouseMove,
  23804. onMouseleave: clearHoverZone
  23805. }, {
  23806. default: (0, vue.withCtx)(() => [
  23807. ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.nodes, (node) => {
  23808. return (0, vue.openBlock)(), (0, vue.createBlock)(node_default, {
  23809. key: node.uid,
  23810. node,
  23811. "menu-id": menuId.value,
  23812. onExpand: handleExpand
  23813. }, null, 8, ["node", "menu-id"]);
  23814. }), 128)),
  23815. isLoading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  23816. key: 0,
  23817. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("empty-text"))
  23818. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), {
  23819. size: "14",
  23820. class: (0, vue.normalizeClass)((0, vue.unref)(ns).is("loading"))
  23821. }, {
  23822. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(loading_default))]),
  23823. _: 1
  23824. }, 8, ["class"]), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("el.cascader.loading")), 1)], 2)) : isEmpty.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  23825. key: 1,
  23826. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("empty-text"))
  23827. }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.cascader.noData")), 1)])], 2)) : (0, vue.unref)(panel)?.isHoverMenu ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.createCommentVNode)(" eslint-disable vue/html-self-closing "), ((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", {
  23828. ref_key: "hoverZone",
  23829. ref: hoverZone,
  23830. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("hover-zone"))
  23831. }, null, 2))], 2112)) : (0, vue.createCommentVNode)("v-if", true),
  23832. (0, vue.createCommentVNode)(" eslint-enable vue/html-self-closing ")
  23833. ]),
  23834. _: 3
  23835. }, 8, [
  23836. "class",
  23837. "wrap-class",
  23838. "view-class"
  23839. ]);
  23840. };
  23841. }
  23842. });
  23843. //#endregion
  23844. //#region ../../packages/components/cascader-panel/src/menu.vue
  23845. var menu_default$1 = menu_vue_vue_type_script_setup_true_lang_default;
  23846. //#endregion
  23847. //#region ../../packages/components/cascader-panel/src/node.ts
  23848. let uid = 0;
  23849. const calculatePathNodes = (node) => {
  23850. const nodes = [node];
  23851. let { parent } = node;
  23852. while (parent) {
  23853. nodes.unshift(parent);
  23854. parent = parent.parent;
  23855. }
  23856. return nodes;
  23857. };
  23858. var Node$2 = class Node$2 {
  23859. constructor(data, config, parent, root = false) {
  23860. this.data = data;
  23861. this.config = config;
  23862. this.parent = parent;
  23863. this.root = root;
  23864. this.uid = uid++;
  23865. this.checked = false;
  23866. this.indeterminate = false;
  23867. this.loading = false;
  23868. const { value: valueKey, label: labelKey, children: childrenKey } = config;
  23869. const childrenData = data[childrenKey];
  23870. const pathNodes = calculatePathNodes(this);
  23871. this.level = root ? 0 : parent ? parent.level + 1 : 1;
  23872. this.value = data[valueKey];
  23873. this.label = data[labelKey];
  23874. this.pathNodes = pathNodes;
  23875. this.pathValues = pathNodes.map((node) => node.value);
  23876. this.pathLabels = pathNodes.map((node) => node.label);
  23877. this.childrenData = childrenData;
  23878. this.children = (childrenData || []).map((child) => new Node$2(child, config, this));
  23879. this.loaded = !config.lazy || this.isLeaf || !isEmpty(childrenData);
  23880. this.text = "";
  23881. }
  23882. get isDisabled() {
  23883. const { data, parent, config } = this;
  23884. const { disabled, checkStrictly } = config;
  23885. return (isFunction$1(disabled) ? disabled(data, this) : !!data[disabled]) || !checkStrictly && !!parent?.isDisabled;
  23886. }
  23887. get isLeaf() {
  23888. const { data, config, childrenData, loaded } = this;
  23889. const { lazy, leaf } = config;
  23890. const isLeaf = isFunction$1(leaf) ? leaf(data, this) : data[leaf];
  23891. return isUndefined(isLeaf) ? lazy && !loaded ? false : !(isArray$1(childrenData) && childrenData.length) : !!isLeaf;
  23892. }
  23893. get valueByOption() {
  23894. return this.config.emitPath ? this.pathValues : this.value;
  23895. }
  23896. appendChild(childData) {
  23897. const { childrenData, children } = this;
  23898. const node = new Node$2(childData, this.config, this);
  23899. if (isArray$1(childrenData)) childrenData.push(childData);
  23900. else this.childrenData = [childData];
  23901. children.push(node);
  23902. return node;
  23903. }
  23904. calcText(allLevels, separator) {
  23905. const text = allLevels ? this.pathLabels.join(separator) : this.label;
  23906. this.text = text;
  23907. return text;
  23908. }
  23909. broadcast(checked) {
  23910. this.children.forEach((child) => {
  23911. if (child) {
  23912. child.broadcast(checked);
  23913. child.onParentCheck?.(checked);
  23914. }
  23915. });
  23916. }
  23917. emit() {
  23918. const { parent } = this;
  23919. if (parent) {
  23920. parent.onChildCheck?.();
  23921. parent.emit();
  23922. }
  23923. }
  23924. onParentCheck(checked) {
  23925. if (!this.isDisabled) this.setCheckState(checked);
  23926. }
  23927. onChildCheck() {
  23928. const { children } = this;
  23929. const validChildren = children.filter((child) => !child.isDisabled);
  23930. const checked = validChildren.length ? validChildren.every((child) => child.checked) : false;
  23931. this.setCheckState(checked);
  23932. }
  23933. setCheckState(checked) {
  23934. const totalNum = this.children.length;
  23935. const checkedNum = this.children.reduce((c, p) => {
  23936. return c + (p.checked ? 1 : p.indeterminate ? .5 : 0);
  23937. }, 0);
  23938. this.checked = this.loaded && this.children.filter((child) => !child.isDisabled).every((child) => child.loaded && child.checked) && checked;
  23939. this.indeterminate = this.loaded && checkedNum !== totalNum && checkedNum > 0;
  23940. }
  23941. doCheck(checked) {
  23942. if (this.checked === checked) return;
  23943. const { checkStrictly, multiple } = this.config;
  23944. if (checkStrictly || !multiple) this.checked = checked;
  23945. else {
  23946. this.broadcast(checked);
  23947. this.setCheckState(checked);
  23948. this.emit();
  23949. }
  23950. }
  23951. };
  23952. //#endregion
  23953. //#region ../../packages/components/cascader-panel/src/store.ts
  23954. const flatNodes = (nodes, leafOnly) => {
  23955. return nodes.reduce((res, node) => {
  23956. if (node.isLeaf) res.push(node);
  23957. else {
  23958. !leafOnly && res.push(node);
  23959. res = res.concat(flatNodes(node.children, leafOnly));
  23960. }
  23961. return res;
  23962. }, []);
  23963. };
  23964. var Store = class {
  23965. constructor(data, config) {
  23966. this.config = config;
  23967. const nodes = (data || []).map((nodeData) => new Node$2(nodeData, this.config));
  23968. this.nodes = nodes;
  23969. this.allNodes = flatNodes(nodes, false);
  23970. this.leafNodes = flatNodes(nodes, true);
  23971. }
  23972. getNodes() {
  23973. return this.nodes;
  23974. }
  23975. getFlattedNodes(leafOnly) {
  23976. return leafOnly ? this.leafNodes : this.allNodes;
  23977. }
  23978. appendNode(nodeData, parentNode) {
  23979. const node = parentNode ? parentNode.appendChild(nodeData) : new Node$2(nodeData, this.config);
  23980. if (!parentNode) this.nodes.push(node);
  23981. this.appendAllNodesAndLeafNodes(node);
  23982. }
  23983. appendNodes(nodeDataList, parentNode) {
  23984. if (nodeDataList.length > 0) nodeDataList.forEach((nodeData) => this.appendNode(nodeData, parentNode));
  23985. else parentNode && parentNode.isLeaf && this.leafNodes.push(parentNode);
  23986. }
  23987. appendAllNodesAndLeafNodes(node) {
  23988. this.allNodes.push(node);
  23989. node.isLeaf && this.leafNodes.push(node);
  23990. if (node.children) node.children.forEach((subNode) => {
  23991. this.appendAllNodesAndLeafNodes(subNode);
  23992. });
  23993. }
  23994. getNodeByValue(value, leafOnly = false) {
  23995. if (isPropAbsent(value)) return null;
  23996. return this.getFlattedNodes(leafOnly).find((node) => isEqual$1(node.value, value) || isEqual$1(node.pathValues, value)) || null;
  23997. }
  23998. getSameNode(node) {
  23999. if (!node) return null;
  24000. return this.getFlattedNodes(false).find(({ value, level }) => isEqual$1(node.value, value) && node.level === level) || null;
  24001. }
  24002. };
  24003. //#endregion
  24004. //#region ../../packages/components/cascader-panel/src/utils.ts
  24005. const getMenuIndex = (el) => {
  24006. if (!el) return 0;
  24007. const pieces = el.id.split("-");
  24008. return Number(pieces[pieces.length - 2]);
  24009. };
  24010. const checkNode = (el) => {
  24011. if (!el) return;
  24012. const input = el.querySelector("input");
  24013. if (input) input.click();
  24014. else if (isLeaf(el)) el.click();
  24015. };
  24016. const sortByOriginalOrder = (oldNodes, newNodes) => {
  24017. const newNodesCopy = newNodes.slice(0);
  24018. const newIds = newNodesCopy.map((node) => node.uid);
  24019. const res = oldNodes.reduce((acc, item) => {
  24020. const index = newIds.indexOf(item.uid);
  24021. if (index > -1) {
  24022. acc.push(item);
  24023. newNodesCopy.splice(index, 1);
  24024. newIds.splice(index, 1);
  24025. }
  24026. return acc;
  24027. }, []);
  24028. res.push(...newNodesCopy);
  24029. return res;
  24030. };
  24031. //#endregion
  24032. //#region ../../packages/components/cascader-panel/src/index.vue?vue&type=script&setup=true&lang.ts
  24033. var index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  24034. name: "ElCascaderPanel",
  24035. __name: "index",
  24036. props: cascaderPanelProps,
  24037. emits: cascaderPanelEmits,
  24038. setup(__props, { expose: __expose, emit: __emit }) {
  24039. const props = __props;
  24040. const emit = __emit;
  24041. let manualChecked = false;
  24042. const ns = useNamespace("cascader");
  24043. const config = useCascaderConfig(props);
  24044. const slots = (0, vue.useSlots)();
  24045. let store;
  24046. const initialLoaded = (0, vue.ref)(true);
  24047. const initialLoadedOnce = (0, vue.ref)(false);
  24048. const menuList = (0, vue.ref)([]);
  24049. const checkedValue = (0, vue.ref)();
  24050. const menus = (0, vue.ref)([]);
  24051. const expandingNode = (0, vue.ref)();
  24052. const checkedNodes = (0, vue.ref)([]);
  24053. const isHoverMenu = (0, vue.computed)(() => config.value.expandTrigger === "hover");
  24054. const renderLabelFn = (0, vue.computed)(() => props.renderLabel || slots.default);
  24055. const initStore = () => {
  24056. const { options } = props;
  24057. const cfg = config.value;
  24058. manualChecked = false;
  24059. store = new Store(options, cfg);
  24060. menus.value = [store.getNodes()];
  24061. if (cfg.lazy && isEmpty(props.options)) {
  24062. initialLoaded.value = false;
  24063. lazyLoad(void 0, (list) => {
  24064. if (list) {
  24065. store = new Store(list, cfg);
  24066. menus.value = [store.getNodes()];
  24067. }
  24068. initialLoaded.value = true;
  24069. syncCheckedValue(false, true);
  24070. });
  24071. } else syncCheckedValue(false, true);
  24072. };
  24073. const lazyLoad = (node, cb) => {
  24074. const cfg = config.value;
  24075. node = node || new Node$2({}, cfg, void 0, true);
  24076. node.loading = true;
  24077. const resolve = (dataList) => {
  24078. const _node = node;
  24079. const parent = _node.root ? null : _node;
  24080. _node.loading = false;
  24081. _node.loaded = true;
  24082. _node.childrenData = _node.childrenData || [];
  24083. dataList && store?.appendNodes(dataList, parent);
  24084. dataList && cb?.(dataList);
  24085. if (node.level === 0) initialLoadedOnce.value = true;
  24086. };
  24087. const reject = () => {
  24088. node.loading = false;
  24089. node.loaded = false;
  24090. if (node.level === 0) initialLoaded.value = true;
  24091. };
  24092. cfg.lazyLoad(node, resolve, reject);
  24093. };
  24094. const expandNode = (node, silent) => {
  24095. const { level } = node;
  24096. const newMenus = menus.value.slice(0, level);
  24097. let newExpandingNode;
  24098. if (node.isLeaf) newExpandingNode = node.pathNodes[level - 2];
  24099. else {
  24100. newExpandingNode = node;
  24101. newMenus.push(node.children);
  24102. }
  24103. if (expandingNode.value?.uid !== newExpandingNode?.uid) {
  24104. expandingNode.value = node;
  24105. menus.value = newMenus;
  24106. !silent && emit("expand-change", node?.pathValues || []);
  24107. }
  24108. };
  24109. const handleCheckChange = (node, checked, emitClose = true) => {
  24110. const { checkStrictly, multiple } = config.value;
  24111. const oldNode = checkedNodes.value[0];
  24112. manualChecked = true;
  24113. !multiple && oldNode?.doCheck(false);
  24114. node.doCheck(checked);
  24115. calculateCheckedValue();
  24116. emitClose && !multiple && !checkStrictly && emit("close");
  24117. !emitClose && !multiple && expandParentNode(node);
  24118. };
  24119. const expandParentNode = (node) => {
  24120. if (!node) return;
  24121. node = node.parent;
  24122. expandParentNode(node);
  24123. node && expandNode(node);
  24124. };
  24125. const getFlattedNodes = (leafOnly) => store?.getFlattedNodes(leafOnly);
  24126. const getCheckedNodes = (leafOnly) => {
  24127. return getFlattedNodes(leafOnly)?.filter(({ checked }) => checked !== false);
  24128. };
  24129. const clearCheckedNodes = () => {
  24130. checkedNodes.value.forEach((node) => node.doCheck(false));
  24131. calculateCheckedValue();
  24132. menus.value = menus.value.slice(0, 1);
  24133. expandingNode.value = void 0;
  24134. emit("expand-change", []);
  24135. };
  24136. const calculateCheckedValue = () => {
  24137. const { checkStrictly, multiple } = config.value;
  24138. const oldNodes = checkedNodes.value;
  24139. const nodes = sortByOriginalOrder(oldNodes, getCheckedNodes(!checkStrictly));
  24140. const values = nodes.map((node) => node.valueByOption);
  24141. checkedNodes.value = nodes;
  24142. checkedValue.value = multiple ? values : values[0] ?? null;
  24143. };
  24144. const syncCheckedValue = (loaded = false, forced = false) => {
  24145. const { modelValue } = props;
  24146. const { lazy, multiple, checkStrictly } = config.value;
  24147. const leafOnly = !checkStrictly;
  24148. if (!initialLoaded.value || manualChecked || !forced && isEqual$1(modelValue, checkedValue.value)) return;
  24149. if (lazy && !loaded) {
  24150. const nodes = unique(flattenDeep(castArray(modelValue))).map((val) => store?.getNodeByValue(val)).filter((node) => !!node && !node.loaded && !node.loading);
  24151. if (nodes.length) nodes.forEach((node) => {
  24152. lazyLoad(node, () => syncCheckedValue(false, forced));
  24153. });
  24154. else syncCheckedValue(true, forced);
  24155. } else {
  24156. syncMenuState(unique((multiple ? castArray(modelValue) : [modelValue]).map((val) => store?.getNodeByValue(val, leafOnly))), forced);
  24157. checkedValue.value = cloneDeep(modelValue ?? void 0);
  24158. }
  24159. };
  24160. const syncMenuState = (newCheckedNodes, reserveExpandingState = true) => {
  24161. const { checkStrictly } = config.value;
  24162. const oldNodes = checkedNodes.value;
  24163. const newNodes = newCheckedNodes.filter((node) => !!node && (checkStrictly || node.isLeaf));
  24164. const oldExpandingNode = store?.getSameNode(expandingNode.value);
  24165. const newExpandingNode = reserveExpandingState && oldExpandingNode || newNodes[0];
  24166. if (newExpandingNode) newExpandingNode.pathNodes.forEach((node) => expandNode(node, true));
  24167. else expandingNode.value = void 0;
  24168. oldNodes.forEach((node) => node.doCheck(false));
  24169. (0, vue.reactive)(newNodes).forEach((node) => node.doCheck(true));
  24170. checkedNodes.value = newNodes;
  24171. (0, vue.nextTick)(scrollToExpandingNode);
  24172. };
  24173. const scrollToExpandingNode = () => {
  24174. if (!isClient) return;
  24175. menuList.value.forEach((menu) => {
  24176. const menuElement = menu?.$el;
  24177. if (menuElement) {
  24178. const container = menuElement.querySelector(`.${ns.namespace.value}-scrollbar__wrap`);
  24179. let activeNode = menuElement.querySelector(`.${ns.b("node")}.in-active-path`);
  24180. if (!activeNode) {
  24181. const activeElements = menuElement.querySelectorAll(`.${ns.b("node")}.${ns.is("active")}`);
  24182. activeNode = activeElements[activeElements.length - 1];
  24183. }
  24184. scrollIntoView(container, activeNode);
  24185. }
  24186. });
  24187. };
  24188. const handleKeyDown = (e) => {
  24189. const target = e.target;
  24190. const code = getEventCode(e);
  24191. switch (code) {
  24192. case EVENT_CODE.up:
  24193. case EVENT_CODE.down:
  24194. e.preventDefault();
  24195. focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${ns.b("node")}[tabindex="-1"]`));
  24196. break;
  24197. case EVENT_CODE.left: {
  24198. e.preventDefault();
  24199. const expandedNode = menuList.value[getMenuIndex(target) - 1]?.$el.querySelector(`.${ns.b("node")}[aria-expanded="true"]`);
  24200. focusNode(expandedNode);
  24201. break;
  24202. }
  24203. case EVENT_CODE.right: {
  24204. e.preventDefault();
  24205. const firstNode = menuList.value[getMenuIndex(target) + 1]?.$el.querySelector(`.${ns.b("node")}[tabindex="-1"]`);
  24206. focusNode(firstNode);
  24207. break;
  24208. }
  24209. case EVENT_CODE.enter:
  24210. case EVENT_CODE.numpadEnter:
  24211. checkNode(target);
  24212. break;
  24213. }
  24214. };
  24215. (0, vue.provide)(CASCADER_PANEL_INJECTION_KEY, (0, vue.reactive)({
  24216. config,
  24217. expandingNode,
  24218. checkedNodes,
  24219. isHoverMenu,
  24220. initialLoaded,
  24221. renderLabelFn,
  24222. lazyLoad,
  24223. expandNode,
  24224. handleCheckChange
  24225. }));
  24226. (0, vue.watch)(config, (newVal, oldVal) => {
  24227. if (isEqual$1(newVal, oldVal)) return;
  24228. initStore();
  24229. }, { immediate: true });
  24230. (0, vue.watch)(() => props.options, initStore, { deep: true });
  24231. (0, vue.watch)(() => props.modelValue, () => {
  24232. manualChecked = false;
  24233. syncCheckedValue();
  24234. }, { deep: true });
  24235. (0, vue.watch)(() => checkedValue.value, (val) => {
  24236. if (!isEqual$1(val, props.modelValue)) {
  24237. emit(UPDATE_MODEL_EVENT, val);
  24238. emit(CHANGE_EVENT, val);
  24239. }
  24240. });
  24241. const loadLazyRootNodes = () => {
  24242. if (initialLoadedOnce.value) return;
  24243. initStore();
  24244. };
  24245. (0, vue.onBeforeUpdate)(() => menuList.value = []);
  24246. (0, vue.onMounted)(() => !isEmpty(props.modelValue) && syncCheckedValue());
  24247. __expose({
  24248. menuList,
  24249. menus,
  24250. checkedNodes,
  24251. handleKeyDown,
  24252. handleCheckChange,
  24253. getFlattedNodes,
  24254. getCheckedNodes,
  24255. clearCheckedNodes,
  24256. calculateCheckedValue,
  24257. scrollToExpandingNode,
  24258. loadLazyRootNodes
  24259. });
  24260. return (_ctx, _cache) => {
  24261. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24262. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("panel"), (0, vue.unref)(ns).is("bordered", __props.border)]),
  24263. onKeydown: handleKeyDown
  24264. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(menus.value, (menu, index) => {
  24265. return (0, vue.openBlock)(), (0, vue.createBlock)(menu_default$1, {
  24266. key: index,
  24267. ref_for: true,
  24268. ref: (item) => menuList.value[index] = item,
  24269. index,
  24270. nodes: [...menu]
  24271. }, {
  24272. empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "empty")]),
  24273. _: 3
  24274. }, 8, ["index", "nodes"]);
  24275. }), 128))], 34);
  24276. };
  24277. }
  24278. });
  24279. //#endregion
  24280. //#region ../../packages/components/cascader-panel/src/index.vue
  24281. var src_default$1 = index_vue_vue_type_script_setup_true_lang_default;
  24282. //#endregion
  24283. //#region ../../packages/components/cascader-panel/index.ts
  24284. const ElCascaderPanel = withInstall(src_default$1);
  24285. //#endregion
  24286. //#region ../../packages/components/cascader/src/cascader.ts
  24287. /**
  24288. * @deprecated Removed after 3.0.0, Use `CascaderComponentProps` instead.
  24289. */
  24290. const cascaderProps = buildProps({
  24291. ...CommonProps,
  24292. size: useSizeProp,
  24293. placeholder: String,
  24294. disabled: {
  24295. type: Boolean,
  24296. default: void 0
  24297. },
  24298. clearable: Boolean,
  24299. clearIcon: {
  24300. type: iconPropType,
  24301. default: circle_close_default
  24302. },
  24303. filterable: Boolean,
  24304. filterMethod: {
  24305. type: definePropType(Function),
  24306. default: (node, keyword) => node.text.includes(keyword)
  24307. },
  24308. separator: {
  24309. type: String,
  24310. default: " / "
  24311. },
  24312. showAllLevels: {
  24313. type: Boolean,
  24314. default: true
  24315. },
  24316. collapseTags: Boolean,
  24317. maxCollapseTags: {
  24318. type: Number,
  24319. default: 1
  24320. },
  24321. collapseTagsTooltip: Boolean,
  24322. maxCollapseTagsTooltipHeight: { type: [String, Number] },
  24323. debounce: {
  24324. type: Number,
  24325. default: 300
  24326. },
  24327. beforeFilter: {
  24328. type: definePropType(Function),
  24329. default: () => true
  24330. },
  24331. placement: {
  24332. type: definePropType(String),
  24333. values: Ee,
  24334. default: "bottom-start"
  24335. },
  24336. fallbackPlacements: {
  24337. type: definePropType(Array),
  24338. default: [
  24339. "bottom-start",
  24340. "bottom",
  24341. "top-start",
  24342. "top",
  24343. "right",
  24344. "left"
  24345. ]
  24346. },
  24347. popperClass: useTooltipContentProps.popperClass,
  24348. popperStyle: useTooltipContentProps.popperStyle,
  24349. teleported: useTooltipContentProps.teleported,
  24350. effect: {
  24351. type: definePropType(String),
  24352. default: "light"
  24353. },
  24354. tagType: {
  24355. ...tagProps.type,
  24356. default: "info"
  24357. },
  24358. tagEffect: {
  24359. ...tagProps.effect,
  24360. default: "light"
  24361. },
  24362. validateEvent: {
  24363. type: Boolean,
  24364. default: true
  24365. },
  24366. persistent: {
  24367. type: Boolean,
  24368. default: true
  24369. },
  24370. showCheckedStrategy: {
  24371. type: String,
  24372. values: ["parent", "child"],
  24373. default: "child"
  24374. },
  24375. checkOnClickNode: Boolean,
  24376. showPrefix: {
  24377. type: Boolean,
  24378. default: true
  24379. },
  24380. ...useEmptyValuesProps
  24381. });
  24382. const emitChangeFn$1 = (value) => true;
  24383. const cascaderEmits = {
  24384. [UPDATE_MODEL_EVENT]: emitChangeFn$1,
  24385. [CHANGE_EVENT]: emitChangeFn$1,
  24386. focus: (evt) => evt instanceof FocusEvent,
  24387. blur: (evt) => evt instanceof FocusEvent,
  24388. clear: () => true,
  24389. visibleChange: (val) => isBoolean(val),
  24390. expandChange: (val) => !!val,
  24391. removeTag: (val) => !!val
  24392. };
  24393. //#endregion
  24394. //#region ../../packages/components/cascader/src/cascader.vue?vue&type=script&setup=true&lang.ts
  24395. const _hoisted_1$57 = ["placeholder"];
  24396. const _hoisted_2$34 = ["onClick"];
  24397. var cascader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  24398. name: "ElCascader",
  24399. __name: "cascader",
  24400. props: cascaderProps,
  24401. emits: cascaderEmits,
  24402. setup(__props, { expose: __expose, emit: __emit }) {
  24403. const popperOptions = { modifiers: [{
  24404. name: "arrowPosition",
  24405. enabled: true,
  24406. phase: "main",
  24407. fn: ({ state }) => {
  24408. const { modifiersData, placement } = state;
  24409. if ([
  24410. "right",
  24411. "left",
  24412. "bottom",
  24413. "top"
  24414. ].includes(placement)) return;
  24415. if (modifiersData.arrow) modifiersData.arrow.x = 35;
  24416. },
  24417. requires: ["arrow"]
  24418. }] };
  24419. const props = __props;
  24420. const emit = __emit;
  24421. const attrs = (0, vue.useAttrs)();
  24422. const slots = (0, vue.useSlots)();
  24423. let inputInitialHeight = 0;
  24424. let pressDeleteCount = 0;
  24425. const nsCascader = useNamespace("cascader");
  24426. const nsInput = useNamespace("input");
  24427. const sizeMapPadding = {
  24428. small: 7,
  24429. default: 11,
  24430. large: 15
  24431. };
  24432. const { t } = useLocale();
  24433. const { formItem } = useFormItem();
  24434. const isDisabled = useFormDisabled();
  24435. const { valueOnClear } = useEmptyValues(props);
  24436. const { isComposing, handleComposition } = useComposition({ afterComposition(event) {
  24437. const text = event.target?.value;
  24438. handleInput(text);
  24439. } });
  24440. const tooltipRef = (0, vue.ref)();
  24441. const tagTooltipRef = (0, vue.ref)();
  24442. const inputRef = (0, vue.ref)();
  24443. const tagWrapper = (0, vue.ref)();
  24444. const cascaderPanelRef = (0, vue.ref)();
  24445. const suggestionPanel = (0, vue.ref)();
  24446. const popperVisible = (0, vue.ref)(false);
  24447. const inputHover = (0, vue.ref)(false);
  24448. const filtering = (0, vue.ref)(false);
  24449. const inputValue = (0, vue.ref)("");
  24450. const searchInputValue = (0, vue.ref)("");
  24451. const tags = (0, vue.ref)([]);
  24452. const suggestions = (0, vue.ref)([]);
  24453. const showTagList = (0, vue.computed)(() => {
  24454. if (!props.props.multiple) return [];
  24455. return props.collapseTags ? tags.value.slice(0, props.maxCollapseTags) : tags.value;
  24456. });
  24457. const collapseTagList = (0, vue.computed)(() => {
  24458. if (!props.props.multiple) return [];
  24459. return props.collapseTags ? tags.value.slice(props.maxCollapseTags) : [];
  24460. });
  24461. const cascaderStyle = (0, vue.computed)(() => {
  24462. return attrs.style;
  24463. });
  24464. const inputPlaceholder = (0, vue.computed)(() => props.placeholder ?? t("el.cascader.placeholder"));
  24465. const currentPlaceholder = (0, vue.computed)(() => searchInputValue.value || tags.value.length > 0 || isComposing.value ? "" : inputPlaceholder.value);
  24466. const realSize = useFormSize();
  24467. const tagSize = (0, vue.computed)(() => realSize.value === "small" ? "small" : "default");
  24468. const multiple = (0, vue.computed)(() => !!props.props.multiple);
  24469. const readonly = (0, vue.computed)(() => !props.filterable || multiple.value);
  24470. const searchKeyword = (0, vue.computed)(() => multiple.value ? searchInputValue.value : inputValue.value);
  24471. const checkedNodes = (0, vue.computed)(() => cascaderPanelRef.value?.checkedNodes || []);
  24472. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  24473. disabled: isDisabled,
  24474. beforeBlur(event) {
  24475. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  24476. },
  24477. afterBlur() {
  24478. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  24479. }
  24480. });
  24481. const clearBtnVisible = (0, vue.computed)(() => {
  24482. if (!props.clearable || isDisabled.value || filtering.value || !inputHover.value && !isFocused.value) return false;
  24483. return !!checkedNodes.value.length;
  24484. });
  24485. const presentText = (0, vue.computed)(() => {
  24486. const { showAllLevels, separator } = props;
  24487. const nodes = checkedNodes.value;
  24488. return nodes.length ? multiple.value ? "" : nodes[0].calcText(showAllLevels, separator) : "";
  24489. });
  24490. const validateState = (0, vue.computed)(() => formItem?.validateState || "");
  24491. const checkedValue = (0, vue.computed)({
  24492. get() {
  24493. return cloneDeep(props.modelValue);
  24494. },
  24495. set(val) {
  24496. const value = val ?? valueOnClear.value;
  24497. emit(UPDATE_MODEL_EVENT, value);
  24498. emit(CHANGE_EVENT, value);
  24499. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  24500. }
  24501. });
  24502. const cascaderKls = (0, vue.computed)(() => {
  24503. return [
  24504. nsCascader.b(),
  24505. nsCascader.m(realSize.value),
  24506. nsCascader.is("disabled", isDisabled.value),
  24507. attrs.class
  24508. ];
  24509. });
  24510. const cascaderIconKls = (0, vue.computed)(() => {
  24511. return [
  24512. nsInput.e("icon"),
  24513. "icon-arrow-down",
  24514. nsCascader.is("reverse", popperVisible.value)
  24515. ];
  24516. });
  24517. const inputClass = (0, vue.computed)(() => nsCascader.is("focus", isFocused.value));
  24518. const contentRef = (0, vue.computed)(() => {
  24519. return tooltipRef.value?.popperRef?.contentRef;
  24520. });
  24521. const handleClickOutside = (event) => {
  24522. if (isFocused.value) handleBlur(new FocusEvent("blur", event));
  24523. togglePopperVisible(false);
  24524. };
  24525. const togglePopperVisible = (visible) => {
  24526. if (isDisabled.value) return;
  24527. visible = visible ?? !popperVisible.value;
  24528. if (visible !== popperVisible.value) {
  24529. popperVisible.value = visible;
  24530. inputRef.value?.input?.setAttribute("aria-expanded", `${visible}`);
  24531. if (visible) {
  24532. updatePopperPosition();
  24533. cascaderPanelRef.value && (0, vue.nextTick)(cascaderPanelRef.value.scrollToExpandingNode);
  24534. } else if (props.filterable) syncPresentTextValue();
  24535. emit("visibleChange", visible);
  24536. }
  24537. };
  24538. const updatePopperPosition = () => {
  24539. (0, vue.nextTick)(() => {
  24540. tooltipRef.value?.updatePopper();
  24541. });
  24542. };
  24543. const hideSuggestionPanel = () => {
  24544. filtering.value = false;
  24545. };
  24546. const genTag = (node) => {
  24547. const { showAllLevels, separator } = props;
  24548. return {
  24549. node,
  24550. key: node.uid,
  24551. text: node.calcText(showAllLevels, separator),
  24552. hitState: false,
  24553. closable: !isDisabled.value && !node.isDisabled
  24554. };
  24555. };
  24556. const deleteTag = (tag) => {
  24557. const node = tag.node;
  24558. node.doCheck(false);
  24559. cascaderPanelRef.value?.calculateCheckedValue();
  24560. emit("removeTag", node.valueByOption);
  24561. };
  24562. const getStrategyCheckedNodes = () => {
  24563. switch (props.showCheckedStrategy) {
  24564. case "child": return checkedNodes.value;
  24565. case "parent": {
  24566. const clickedNodes = getCheckedNodes(false);
  24567. const clickedNodesValue = clickedNodes.map((o) => o.value);
  24568. return clickedNodes.filter((o) => !o.parent || !clickedNodesValue.includes(o.parent.value));
  24569. }
  24570. default: return [];
  24571. }
  24572. };
  24573. const calculatePresentTags = () => {
  24574. if (!multiple.value) return;
  24575. const nodes = getStrategyCheckedNodes();
  24576. const allTags = [];
  24577. nodes.forEach((node) => allTags.push(genTag(node)));
  24578. tags.value = allTags;
  24579. };
  24580. const calculateSuggestions = () => {
  24581. const { filterMethod, showAllLevels, separator } = props;
  24582. const res = cascaderPanelRef.value?.getFlattedNodes(!props.props.checkStrictly)?.filter((node) => {
  24583. if (node.isDisabled) return false;
  24584. node.calcText(showAllLevels, separator);
  24585. return filterMethod(node, searchKeyword.value);
  24586. });
  24587. if (multiple.value) tags.value.forEach((tag) => {
  24588. tag.hitState = false;
  24589. });
  24590. filtering.value = true;
  24591. suggestions.value = res;
  24592. updatePopperPosition();
  24593. };
  24594. const focusFirstNode = () => {
  24595. let firstNode;
  24596. if (filtering.value && suggestionPanel.value) firstNode = suggestionPanel.value.$el.querySelector(`.${nsCascader.e("suggestion-item")}`);
  24597. else firstNode = cascaderPanelRef.value?.$el.querySelector(`.${nsCascader.b("node")}[tabindex="-1"]`);
  24598. if (firstNode) {
  24599. firstNode.focus();
  24600. !filtering.value && firstNode.click();
  24601. }
  24602. };
  24603. const updateStyle = () => {
  24604. const inputInner = inputRef.value?.input;
  24605. const tagWrapperEl = tagWrapper.value;
  24606. const suggestionPanelEl = suggestionPanel.value?.$el;
  24607. if (!isClient || !inputInner) return;
  24608. if (suggestionPanelEl) {
  24609. const suggestionList = suggestionPanelEl.querySelector(`.${nsCascader.e("suggestion-list")}`);
  24610. suggestionList.style.minWidth = `${inputInner.offsetWidth}px`;
  24611. }
  24612. if (tagWrapperEl) {
  24613. const { offsetHeight } = tagWrapperEl;
  24614. const height = tags.value.length > 0 ? `${Math.max(offsetHeight, inputInitialHeight) - 2}px` : `${inputInitialHeight}px`;
  24615. inputInner.style.height = height;
  24616. if (slots.prefix) {
  24617. const prefix = inputRef.value?.$el.querySelector(`.${nsInput.e("prefix")}`);
  24618. let left = 0;
  24619. if (prefix) {
  24620. left = prefix.offsetWidth;
  24621. if (left > 0) left += sizeMapPadding[realSize.value || "default"];
  24622. }
  24623. tagWrapperEl.style.left = `${left}px`;
  24624. } else tagWrapperEl.style.left = `0`;
  24625. updatePopperPosition();
  24626. }
  24627. };
  24628. const getCheckedNodes = (leafOnly) => {
  24629. return cascaderPanelRef.value?.getCheckedNodes(leafOnly);
  24630. };
  24631. const handleExpandChange = (value) => {
  24632. updatePopperPosition();
  24633. emit("expandChange", value);
  24634. };
  24635. const handleKeyDown = (e) => {
  24636. if (isComposing.value) return;
  24637. switch (getEventCode(e)) {
  24638. case EVENT_CODE.enter:
  24639. case EVENT_CODE.numpadEnter:
  24640. togglePopperVisible();
  24641. break;
  24642. case EVENT_CODE.down:
  24643. togglePopperVisible(true);
  24644. (0, vue.nextTick)(focusFirstNode);
  24645. e.preventDefault();
  24646. break;
  24647. case EVENT_CODE.esc:
  24648. if (popperVisible.value === true) {
  24649. e.preventDefault();
  24650. e.stopPropagation();
  24651. togglePopperVisible(false);
  24652. }
  24653. break;
  24654. case EVENT_CODE.tab:
  24655. togglePopperVisible(false);
  24656. break;
  24657. }
  24658. };
  24659. const handleClear = () => {
  24660. cascaderPanelRef.value?.clearCheckedNodes();
  24661. if (!popperVisible.value && props.filterable) syncPresentTextValue();
  24662. togglePopperVisible(false);
  24663. emit("clear");
  24664. };
  24665. const syncPresentTextValue = () => {
  24666. const { value } = presentText;
  24667. inputValue.value = value;
  24668. searchInputValue.value = value;
  24669. };
  24670. const handleSuggestionClick = (node) => {
  24671. const { checked } = node;
  24672. if (multiple.value) cascaderPanelRef.value?.handleCheckChange(node, !checked, false);
  24673. else {
  24674. !checked && cascaderPanelRef.value?.handleCheckChange(node, true, false);
  24675. togglePopperVisible(false);
  24676. }
  24677. };
  24678. const handleSuggestionKeyDown = (e) => {
  24679. const target = e.target;
  24680. const code = getEventCode(e);
  24681. switch (code) {
  24682. case EVENT_CODE.up:
  24683. case EVENT_CODE.down:
  24684. e.preventDefault();
  24685. focusNode(getSibling(target, code === EVENT_CODE.up ? -1 : 1, `.${nsCascader.e("suggestion-item")}[tabindex="-1"]`));
  24686. break;
  24687. case EVENT_CODE.enter:
  24688. case EVENT_CODE.numpadEnter:
  24689. target.click();
  24690. break;
  24691. }
  24692. };
  24693. const handleDelete = () => {
  24694. const lastTag = tags.value[tags.value.length - 1];
  24695. pressDeleteCount = searchInputValue.value ? 0 : pressDeleteCount + 1;
  24696. if (!lastTag || !pressDeleteCount || props.collapseTags && tags.value.length > 1) return;
  24697. if (lastTag.hitState) deleteTag(lastTag);
  24698. else lastTag.hitState = true;
  24699. };
  24700. const handleFilter = useDebounceFn(() => {
  24701. const { value } = searchKeyword;
  24702. if (!value) return;
  24703. const passed = props.beforeFilter(value);
  24704. if (isPromise(passed)) passed.then(calculateSuggestions).catch(() => {});
  24705. else if (passed !== false) calculateSuggestions();
  24706. else hideSuggestionPanel();
  24707. }, (0, vue.computed)(() => props.debounce));
  24708. const handleInput = (val, e) => {
  24709. !popperVisible.value && togglePopperVisible(true);
  24710. if (e?.isComposing) return;
  24711. val ? handleFilter() : hideSuggestionPanel();
  24712. };
  24713. const getInputInnerHeight = (inputInner) => Number.parseFloat(useCssVar(nsInput.cssVarName("input-height"), inputInner).value) - 2;
  24714. const focus = () => {
  24715. inputRef.value?.focus();
  24716. };
  24717. const blur = () => {
  24718. inputRef.value?.blur();
  24719. };
  24720. (0, vue.watch)(filtering, updatePopperPosition);
  24721. (0, vue.watch)([
  24722. checkedNodes,
  24723. isDisabled,
  24724. () => props.collapseTags,
  24725. () => props.maxCollapseTags
  24726. ], calculatePresentTags);
  24727. (0, vue.watch)(tags, () => {
  24728. (0, vue.nextTick)(() => updateStyle());
  24729. });
  24730. (0, vue.watch)(realSize, async () => {
  24731. await (0, vue.nextTick)();
  24732. const inputInner = inputRef.value.input;
  24733. inputInitialHeight = getInputInnerHeight(inputInner) || inputInitialHeight;
  24734. updateStyle();
  24735. });
  24736. (0, vue.watch)(presentText, syncPresentTextValue, { immediate: true });
  24737. (0, vue.watch)(() => popperVisible.value, (val) => {
  24738. if (val && props.props.lazy && props.props.lazyLoad) cascaderPanelRef.value?.loadLazyRootNodes();
  24739. });
  24740. (0, vue.onMounted)(() => {
  24741. const inputInner = inputRef.value.input;
  24742. const inputInnerHeight = getInputInnerHeight(inputInner);
  24743. inputInitialHeight = inputInner.offsetHeight || inputInnerHeight;
  24744. useResizeObserver(inputInner, updateStyle);
  24745. });
  24746. __expose({
  24747. getCheckedNodes,
  24748. cascaderPanelRef,
  24749. togglePopperVisible,
  24750. contentRef,
  24751. presentText,
  24752. focus,
  24753. blur
  24754. });
  24755. return (_ctx, _cache) => {
  24756. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  24757. ref_key: "tooltipRef",
  24758. ref: tooltipRef,
  24759. visible: popperVisible.value,
  24760. teleported: __props.teleported,
  24761. "popper-class": [(0, vue.unref)(nsCascader).e("dropdown"), __props.popperClass],
  24762. "popper-style": __props.popperStyle,
  24763. "popper-options": popperOptions,
  24764. "fallback-placements": __props.fallbackPlacements,
  24765. "stop-popper-mouse-event": false,
  24766. "gpu-acceleration": false,
  24767. placement: __props.placement,
  24768. transition: `${(0, vue.unref)(nsCascader).namespace.value}-zoom-in-top`,
  24769. effect: __props.effect,
  24770. pure: "",
  24771. persistent: __props.persistent,
  24772. onHide: hideSuggestionPanel
  24773. }, {
  24774. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24775. ref_key: "wrapperRef",
  24776. ref: wrapperRef,
  24777. class: (0, vue.normalizeClass)(cascaderKls.value),
  24778. style: (0, vue.normalizeStyle)(cascaderStyle.value),
  24779. onClick: _cache[8] || (_cache[8] = () => togglePopperVisible(readonly.value ? void 0 : true)),
  24780. onKeydown: handleKeyDown,
  24781. onMouseenter: _cache[9] || (_cache[9] = ($event) => inputHover.value = true),
  24782. onMouseleave: _cache[10] || (_cache[10] = ($event) => inputHover.value = false)
  24783. }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  24784. ref_key: "inputRef",
  24785. ref: inputRef,
  24786. modelValue: inputValue.value,
  24787. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => inputValue.value = $event),
  24788. placeholder: currentPlaceholder.value,
  24789. readonly: readonly.value,
  24790. disabled: (0, vue.unref)(isDisabled),
  24791. "validate-event": false,
  24792. size: (0, vue.unref)(realSize),
  24793. class: (0, vue.normalizeClass)(inputClass.value),
  24794. tabindex: multiple.value && __props.filterable && !(0, vue.unref)(isDisabled) ? -1 : void 0,
  24795. onCompositionstart: (0, vue.unref)(handleComposition),
  24796. onCompositionupdate: (0, vue.unref)(handleComposition),
  24797. onCompositionend: (0, vue.unref)(handleComposition),
  24798. onInput: handleInput
  24799. }, (0, vue.createSlots)({
  24800. suffix: (0, vue.withCtx)(() => [clearBtnVisible.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  24801. key: "clear",
  24802. class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("icon"), "icon-circle-close"]),
  24803. onClick: (0, vue.withModifiers)(handleClear, ["stop"])
  24804. }, {
  24805. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.clearIcon)))]),
  24806. _: 1
  24807. }, 8, ["class"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  24808. key: "arrow-down",
  24809. class: (0, vue.normalizeClass)(cascaderIconKls.value),
  24810. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) => togglePopperVisible(), ["stop"]))
  24811. }, {
  24812. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_down_default))]),
  24813. _: 1
  24814. }, 8, ["class"]))]),
  24815. _: 2
  24816. }, [_ctx.$slots.prefix ? {
  24817. name: "prefix",
  24818. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "prefix")]),
  24819. key: "0"
  24820. } : void 0]), 1032, [
  24821. "modelValue",
  24822. "placeholder",
  24823. "readonly",
  24824. "disabled",
  24825. "size",
  24826. "class",
  24827. "tabindex",
  24828. "onCompositionstart",
  24829. "onCompositionupdate",
  24830. "onCompositionend"
  24831. ]), multiple.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24832. key: 0,
  24833. ref_key: "tagWrapper",
  24834. ref: tagWrapper,
  24835. class: (0, vue.normalizeClass)([(0, vue.unref)(nsCascader).e("tags"), (0, vue.unref)(nsCascader).is("validate", Boolean(validateState.value))])
  24836. }, [
  24837. (0, vue.renderSlot)(_ctx.$slots, "tag", {
  24838. data: tags.value,
  24839. deleteTag
  24840. }, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(showTagList.value, (tag) => {
  24841. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTag), {
  24842. key: tag.key,
  24843. type: __props.tagType,
  24844. size: tagSize.value,
  24845. effect: __props.tagEffect,
  24846. hit: tag.hitState,
  24847. closable: tag.closable,
  24848. "disable-transitions": "",
  24849. onClose: ($event) => deleteTag(tag)
  24850. }, {
  24851. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(tag.text), 1)]),
  24852. _: 2
  24853. }, 1032, [
  24854. "type",
  24855. "size",
  24856. "effect",
  24857. "hit",
  24858. "closable",
  24859. "onClose"
  24860. ]);
  24861. }), 128))]),
  24862. __props.collapseTags && tags.value.length > __props.maxCollapseTags ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  24863. key: 0,
  24864. ref_key: "tagTooltipRef",
  24865. ref: tagTooltipRef,
  24866. disabled: popperVisible.value || !__props.collapseTagsTooltip,
  24867. "fallback-placements": [
  24868. "bottom",
  24869. "top",
  24870. "right",
  24871. "left"
  24872. ],
  24873. placement: "bottom",
  24874. "popper-class": __props.popperClass,
  24875. "popper-style": __props.popperStyle,
  24876. effect: __props.effect,
  24877. persistent: __props.persistent
  24878. }, {
  24879. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(ElTag), {
  24880. closable: false,
  24881. size: tagSize.value,
  24882. type: __props.tagType,
  24883. effect: __props.tagEffect,
  24884. "disable-transitions": ""
  24885. }, {
  24886. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("tags-text")) }, " + " + (0, vue.toDisplayString)(tags.value.length - __props.maxCollapseTags), 3)]),
  24887. _: 1
  24888. }, 8, [
  24889. "size",
  24890. "type",
  24891. "effect"
  24892. ])]),
  24893. content: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(ElScrollbar), { "max-height": __props.maxCollapseTagsTooltipHeight }, {
  24894. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("collapse-tags")) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(collapseTagList.value, (tag, idx) => {
  24895. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24896. key: idx,
  24897. class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("collapse-tag"))
  24898. }, [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTag), {
  24899. key: tag.key,
  24900. class: "in-tooltip",
  24901. type: __props.tagType,
  24902. size: tagSize.value,
  24903. effect: __props.tagEffect,
  24904. hit: tag.hitState,
  24905. closable: tag.closable,
  24906. "disable-transitions": "",
  24907. onClose: ($event) => deleteTag(tag)
  24908. }, {
  24909. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(tag.text), 1)]),
  24910. _: 2
  24911. }, 1032, [
  24912. "type",
  24913. "size",
  24914. "effect",
  24915. "hit",
  24916. "closable",
  24917. "onClose"
  24918. ]))], 2);
  24919. }), 128))], 2)]),
  24920. _: 1
  24921. }, 8, ["max-height"])]),
  24922. _: 1
  24923. }, 8, [
  24924. "disabled",
  24925. "popper-class",
  24926. "popper-style",
  24927. "effect",
  24928. "persistent"
  24929. ])) : (0, vue.createCommentVNode)("v-if", true),
  24930. __props.filterable && !(0, vue.unref)(isDisabled) ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
  24931. key: 1,
  24932. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => searchInputValue.value = $event),
  24933. type: "text",
  24934. class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("search-input")),
  24935. placeholder: presentText.value ? "" : inputPlaceholder.value,
  24936. onInput: _cache[3] || (_cache[3] = (e) => handleInput(searchInputValue.value, e)),
  24937. onClick: _cache[4] || (_cache[4] = (0, vue.withModifiers)(($event) => togglePopperVisible(true), ["stop"])),
  24938. onKeydown: (0, vue.withKeys)(handleDelete, ["delete"]),
  24939. onCompositionstart: _cache[5] || (_cache[5] = (...args) => (0, vue.unref)(handleComposition) && (0, vue.unref)(handleComposition)(...args)),
  24940. onCompositionupdate: _cache[6] || (_cache[6] = (...args) => (0, vue.unref)(handleComposition) && (0, vue.unref)(handleComposition)(...args)),
  24941. onCompositionend: _cache[7] || (_cache[7] = (...args) => (0, vue.unref)(handleComposition) && (0, vue.unref)(handleComposition)(...args))
  24942. }, null, 42, _hoisted_1$57)), [[vue.vModelText, searchInputValue.value]]) : (0, vue.createCommentVNode)("v-if", true)
  24943. ], 2)) : (0, vue.createCommentVNode)("v-if", true)], 38)), [[
  24944. (0, vue.unref)(ClickOutside),
  24945. handleClickOutside,
  24946. contentRef.value
  24947. ]])]),
  24948. content: (0, vue.withCtx)(() => [
  24949. _ctx.$slots.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24950. key: 0,
  24951. class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("header")),
  24952. onClick: _cache[11] || (_cache[11] = (0, vue.withModifiers)(() => {}, ["stop"]))
  24953. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  24954. (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElCascaderPanel), {
  24955. ref_key: "cascaderPanelRef",
  24956. ref: cascaderPanelRef,
  24957. modelValue: checkedValue.value,
  24958. "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => checkedValue.value = $event),
  24959. options: __props.options,
  24960. props: props.props,
  24961. border: false,
  24962. "render-label": _ctx.$slots.default,
  24963. onExpandChange: handleExpandChange,
  24964. onClose: _cache[13] || (_cache[13] = ($event) => _ctx.$nextTick(() => togglePopperVisible(false)))
  24965. }, {
  24966. empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "empty")]),
  24967. _: 3
  24968. }, 8, [
  24969. "modelValue",
  24970. "options",
  24971. "props",
  24972. "render-label"
  24973. ]), [[vue.vShow, !filtering.value]]),
  24974. __props.filterable ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElScrollbar), {
  24975. key: 1,
  24976. ref_key: "suggestionPanel",
  24977. ref: suggestionPanel,
  24978. tag: "ul",
  24979. class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("suggestion-panel")),
  24980. "view-class": (0, vue.unref)(nsCascader).e("suggestion-list"),
  24981. onKeydown: handleSuggestionKeyDown
  24982. }, {
  24983. default: (0, vue.withCtx)(() => [suggestions.value.length ? ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, (0, vue.renderList)(suggestions.value, (item) => {
  24984. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  24985. key: item.uid,
  24986. class: (0, vue.normalizeClass)([(0, vue.unref)(nsCascader).e("suggestion-item"), (0, vue.unref)(nsCascader).is("checked", item.checked)]),
  24987. tabindex: -1,
  24988. onClick: ($event) => handleSuggestionClick(item)
  24989. }, [(0, vue.renderSlot)(_ctx.$slots, "suggestion-item", { item }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(item.text), 1), item.checked ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  24990. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(check_default))]),
  24991. _: 1
  24992. })) : (0, vue.createCommentVNode)("v-if", true)])], 10, _hoisted_2$34);
  24993. }), 128)) : (0, vue.renderSlot)(_ctx.$slots, "empty", { key: 1 }, () => [(0, vue.createElementVNode)("li", { class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("empty-text")) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.cascader.noMatch")), 3)])]),
  24994. _: 3
  24995. }, 8, ["class", "view-class"])), [[vue.vShow, filtering.value]]) : (0, vue.createCommentVNode)("v-if", true),
  24996. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  24997. key: 2,
  24998. class: (0, vue.normalizeClass)((0, vue.unref)(nsCascader).e("footer")),
  24999. onClick: _cache[14] || (_cache[14] = (0, vue.withModifiers)(() => {}, ["stop"]))
  25000. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  25001. ]),
  25002. _: 3
  25003. }, 8, [
  25004. "visible",
  25005. "teleported",
  25006. "popper-class",
  25007. "popper-style",
  25008. "fallback-placements",
  25009. "placement",
  25010. "transition",
  25011. "effect",
  25012. "persistent"
  25013. ]);
  25014. };
  25015. }
  25016. });
  25017. //#endregion
  25018. //#region ../../packages/components/cascader/src/cascader.vue
  25019. var cascader_default = cascader_vue_vue_type_script_setup_true_lang_default;
  25020. //#endregion
  25021. //#region ../../packages/components/cascader/index.ts
  25022. const ElCascader = withInstall(cascader_default);
  25023. //#endregion
  25024. //#region ../../packages/components/check-tag/src/check-tag.ts
  25025. /**
  25026. * @deprecated Removed after 3.0.0, Use `CheckTagProps` instead.
  25027. */
  25028. const checkTagProps = buildProps({
  25029. checked: Boolean,
  25030. disabled: Boolean,
  25031. type: {
  25032. type: String,
  25033. values: [
  25034. "primary",
  25035. "success",
  25036. "info",
  25037. "warning",
  25038. "danger"
  25039. ],
  25040. default: "primary"
  25041. }
  25042. });
  25043. const checkTagEmits = {
  25044. "update:checked": (value) => isBoolean(value),
  25045. [CHANGE_EVENT]: (value) => isBoolean(value)
  25046. };
  25047. //#endregion
  25048. //#region ../../packages/components/check-tag/src/check-tag.vue?vue&type=script&setup=true&lang.ts
  25049. var check_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25050. name: "ElCheckTag",
  25051. __name: "check-tag",
  25052. props: checkTagProps,
  25053. emits: checkTagEmits,
  25054. setup(__props, { emit: __emit }) {
  25055. const props = __props;
  25056. const emit = __emit;
  25057. const ns = useNamespace("check-tag");
  25058. const containerKls = (0, vue.computed)(() => [
  25059. ns.b(),
  25060. ns.is("checked", props.checked),
  25061. ns.is("disabled", props.disabled),
  25062. ns.m(props.type || "primary")
  25063. ]);
  25064. const handleChange = () => {
  25065. if (props.disabled) return;
  25066. const checked = !props.checked;
  25067. emit(CHANGE_EVENT, checked);
  25068. emit("update:checked", checked);
  25069. };
  25070. return (_ctx, _cache) => {
  25071. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  25072. class: (0, vue.normalizeClass)(containerKls.value),
  25073. onClick: handleChange
  25074. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  25075. };
  25076. }
  25077. });
  25078. //#endregion
  25079. //#region ../../packages/components/check-tag/src/check-tag.vue
  25080. var check_tag_default = check_tag_vue_vue_type_script_setup_true_lang_default;
  25081. //#endregion
  25082. //#region ../../packages/components/check-tag/index.ts
  25083. const ElCheckTag = withInstall(check_tag_default);
  25084. //#endregion
  25085. //#region ../../packages/components/col/src/col.ts
  25086. /**
  25087. * @deprecated Removed after 3.0.0, Use `ColProps` instead.
  25088. */
  25089. const colProps = buildProps({
  25090. tag: {
  25091. type: String,
  25092. default: "div"
  25093. },
  25094. span: {
  25095. type: Number,
  25096. default: 24
  25097. },
  25098. offset: {
  25099. type: Number,
  25100. default: 0
  25101. },
  25102. pull: {
  25103. type: Number,
  25104. default: 0
  25105. },
  25106. push: {
  25107. type: Number,
  25108. default: 0
  25109. },
  25110. xs: {
  25111. type: definePropType([Number, Object]),
  25112. default: () => mutable({})
  25113. },
  25114. sm: {
  25115. type: definePropType([Number, Object]),
  25116. default: () => mutable({})
  25117. },
  25118. md: {
  25119. type: definePropType([Number, Object]),
  25120. default: () => mutable({})
  25121. },
  25122. lg: {
  25123. type: definePropType([Number, Object]),
  25124. default: () => mutable({})
  25125. },
  25126. xl: {
  25127. type: definePropType([Number, Object]),
  25128. default: () => mutable({})
  25129. }
  25130. });
  25131. //#endregion
  25132. //#region ../../packages/components/row/src/row.ts
  25133. const RowJustify = [
  25134. "start",
  25135. "center",
  25136. "end",
  25137. "space-around",
  25138. "space-between",
  25139. "space-evenly"
  25140. ];
  25141. const RowAlign = [
  25142. "top",
  25143. "middle",
  25144. "bottom"
  25145. ];
  25146. /**
  25147. * @deprecated Removed after 3.0.0, Use `RowProps` instead.
  25148. */
  25149. const rowProps = buildProps({
  25150. tag: {
  25151. type: String,
  25152. default: "div"
  25153. },
  25154. gutter: {
  25155. type: Number,
  25156. default: 0
  25157. },
  25158. justify: {
  25159. type: String,
  25160. values: RowJustify,
  25161. default: "start"
  25162. },
  25163. align: {
  25164. type: String,
  25165. values: RowAlign
  25166. }
  25167. });
  25168. //#endregion
  25169. //#region ../../packages/components/row/src/constants.ts
  25170. const rowContextKey = Symbol("rowContextKey");
  25171. //#endregion
  25172. //#region ../../packages/components/row/src/row.vue?vue&type=script&setup=true&lang.ts
  25173. var row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25174. name: "ElRow",
  25175. __name: "row",
  25176. props: rowProps,
  25177. setup(__props) {
  25178. const props = __props;
  25179. const ns = useNamespace("row");
  25180. (0, vue.provide)(rowContextKey, { gutter: (0, vue.computed)(() => props.gutter) });
  25181. const style = (0, vue.computed)(() => {
  25182. const styles = {};
  25183. if (!props.gutter) return styles;
  25184. styles.marginRight = styles.marginLeft = `-${props.gutter / 2}px`;
  25185. return styles;
  25186. });
  25187. const rowKls = (0, vue.computed)(() => [
  25188. ns.b(),
  25189. ns.is(`justify-${props.justify}`, props.justify !== "start"),
  25190. ns.is(`align-${props.align}`, !!props.align)
  25191. ]);
  25192. return (_ctx, _cache) => {
  25193. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
  25194. class: (0, vue.normalizeClass)(rowKls.value),
  25195. style: (0, vue.normalizeStyle)(style.value)
  25196. }, {
  25197. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  25198. _: 3
  25199. }, 8, ["class", "style"]);
  25200. };
  25201. }
  25202. });
  25203. //#endregion
  25204. //#region ../../packages/components/row/src/row.vue
  25205. var row_default = row_vue_vue_type_script_setup_true_lang_default;
  25206. //#endregion
  25207. //#region ../../packages/components/row/index.ts
  25208. const ElRow = withInstall(row_default);
  25209. //#endregion
  25210. //#region ../../packages/components/col/src/col.vue?vue&type=script&setup=true&lang.ts
  25211. var col_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25212. name: "ElCol",
  25213. __name: "col",
  25214. props: colProps,
  25215. setup(__props) {
  25216. const props = __props;
  25217. const { gutter } = (0, vue.inject)(rowContextKey, { gutter: (0, vue.computed)(() => 0) });
  25218. const ns = useNamespace("col");
  25219. const style = (0, vue.computed)(() => {
  25220. const styles = {};
  25221. if (gutter.value) styles.paddingLeft = styles.paddingRight = `${gutter.value / 2}px`;
  25222. return styles;
  25223. });
  25224. const colKls = (0, vue.computed)(() => {
  25225. const classes = [];
  25226. [
  25227. "span",
  25228. "offset",
  25229. "pull",
  25230. "push"
  25231. ].forEach((prop) => {
  25232. const size = props[prop];
  25233. if (isNumber(size)) {
  25234. if (prop === "span") classes.push(ns.b(`${props[prop]}`));
  25235. else if (size > 0) classes.push(ns.b(`${prop}-${props[prop]}`));
  25236. }
  25237. });
  25238. [
  25239. "xs",
  25240. "sm",
  25241. "md",
  25242. "lg",
  25243. "xl"
  25244. ].forEach((size) => {
  25245. if (isNumber(props[size])) classes.push(ns.b(`${size}-${props[size]}`));
  25246. else if (isObject$1(props[size])) Object.entries(props[size]).forEach(([prop, sizeProp]) => {
  25247. classes.push(prop !== "span" ? ns.b(`${size}-${prop}-${sizeProp}`) : ns.b(`${size}-${sizeProp}`));
  25248. });
  25249. });
  25250. if (gutter.value) classes.push(ns.is("guttered"));
  25251. return [ns.b(), classes];
  25252. });
  25253. return (_ctx, _cache) => {
  25254. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
  25255. class: (0, vue.normalizeClass)(colKls.value),
  25256. style: (0, vue.normalizeStyle)(style.value)
  25257. }, {
  25258. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  25259. _: 3
  25260. }, 8, ["class", "style"]);
  25261. };
  25262. }
  25263. });
  25264. //#endregion
  25265. //#region ../../packages/components/col/src/col.vue
  25266. var col_default = col_vue_vue_type_script_setup_true_lang_default;
  25267. //#endregion
  25268. //#region ../../packages/components/col/index.ts
  25269. const ElCol = withInstall(col_default);
  25270. //#endregion
  25271. //#region ../../packages/components/collapse/src/collapse.ts
  25272. const emitChangeFn = (value) => isNumber(value) || isString(value) || isArray$1(value);
  25273. /**
  25274. * @deprecated Removed after 3.0.0, Use `CollapseProps` instead.
  25275. */
  25276. const collapseProps = buildProps({
  25277. accordion: Boolean,
  25278. modelValue: {
  25279. type: definePropType([
  25280. Array,
  25281. String,
  25282. Number
  25283. ]),
  25284. default: () => mutable([])
  25285. },
  25286. expandIconPosition: {
  25287. type: definePropType([String]),
  25288. default: "right"
  25289. },
  25290. beforeCollapse: { type: definePropType(Function) }
  25291. });
  25292. const collapseEmits = {
  25293. [UPDATE_MODEL_EVENT]: emitChangeFn,
  25294. [CHANGE_EVENT]: emitChangeFn
  25295. };
  25296. //#endregion
  25297. //#region ../../packages/components/collapse/src/constants.ts
  25298. const collapseContextKey = Symbol("collapseContextKey");
  25299. //#endregion
  25300. //#region ../../packages/components/collapse/src/use-collapse.ts
  25301. const SCOPE$4 = "ElCollapse";
  25302. const useCollapse = (props, emit) => {
  25303. const activeNames = (0, vue.ref)(castArray$1(props.modelValue));
  25304. const setActiveNames = (_activeNames) => {
  25305. activeNames.value = _activeNames;
  25306. const value = props.accordion ? activeNames.value[0] : activeNames.value;
  25307. emit(UPDATE_MODEL_EVENT, value);
  25308. emit(CHANGE_EVENT, value);
  25309. };
  25310. const handleChange = (name) => {
  25311. if (props.accordion) setActiveNames([activeNames.value[0] === name ? "" : name]);
  25312. else {
  25313. const _activeNames = [...activeNames.value];
  25314. const index = _activeNames.indexOf(name);
  25315. if (index > -1) _activeNames.splice(index, 1);
  25316. else _activeNames.push(name);
  25317. setActiveNames(_activeNames);
  25318. }
  25319. };
  25320. const handleItemClick = async (name) => {
  25321. const { beforeCollapse } = props;
  25322. if (!beforeCollapse) {
  25323. handleChange(name);
  25324. return;
  25325. }
  25326. const shouldChange = beforeCollapse(name);
  25327. if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(SCOPE$4, "beforeCollapse must return type `Promise<boolean>` or `boolean`");
  25328. if (isPromise(shouldChange)) shouldChange.then((result) => {
  25329. if (result !== false) handleChange(name);
  25330. }).catch((e) => {
  25331. /* @__PURE__ */ debugWarn(SCOPE$4, `some error occurred: ${e}`);
  25332. });
  25333. else if (shouldChange) handleChange(name);
  25334. };
  25335. (0, vue.watch)(() => props.modelValue, () => activeNames.value = castArray$1(props.modelValue), { deep: true });
  25336. (0, vue.provide)(collapseContextKey, {
  25337. activeNames,
  25338. handleItemClick
  25339. });
  25340. return {
  25341. activeNames,
  25342. setActiveNames
  25343. };
  25344. };
  25345. const useCollapseDOM = (props) => {
  25346. const ns = useNamespace("collapse");
  25347. return { rootKls: (0, vue.computed)(() => [ns.b(), ns.b(`icon-position-${props.expandIconPosition}`)]) };
  25348. };
  25349. //#endregion
  25350. //#region ../../packages/components/collapse/src/collapse.vue?vue&type=script&setup=true&lang.ts
  25351. var collapse_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25352. name: "ElCollapse",
  25353. __name: "collapse",
  25354. props: collapseProps,
  25355. emits: collapseEmits,
  25356. setup(__props, { expose: __expose, emit: __emit }) {
  25357. const props = __props;
  25358. const { activeNames, setActiveNames } = useCollapse(props, __emit);
  25359. const { rootKls } = useCollapseDOM(props);
  25360. __expose({
  25361. activeNames,
  25362. setActiveNames
  25363. });
  25364. return (_ctx, _cache) => {
  25365. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  25366. };
  25367. }
  25368. });
  25369. //#endregion
  25370. //#region ../../packages/components/collapse/src/collapse.vue
  25371. var collapse_default = collapse_vue_vue_type_script_setup_true_lang_default;
  25372. //#endregion
  25373. //#region ../../packages/components/collapse/src/collapse-item.ts
  25374. /**
  25375. * @deprecated Removed after 3.0.0, Use `CollapseItemProps` instead.
  25376. */
  25377. const collapseItemProps = buildProps({
  25378. title: {
  25379. type: String,
  25380. default: ""
  25381. },
  25382. name: {
  25383. type: definePropType([String, Number]),
  25384. default: void 0
  25385. },
  25386. icon: {
  25387. type: iconPropType,
  25388. default: arrow_right_default
  25389. },
  25390. disabled: Boolean
  25391. });
  25392. //#endregion
  25393. //#region ../../packages/components/collapse-transition/src/collapse-transition.vue?vue&type=script&setup=true&lang.ts
  25394. var collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25395. name: "ElCollapseTransition",
  25396. __name: "collapse-transition",
  25397. setup(__props) {
  25398. const ns = useNamespace("collapse-transition");
  25399. const reset = (el) => {
  25400. el.style.maxHeight = "";
  25401. el.style.overflow = el.dataset.oldOverflow;
  25402. el.style.paddingTop = el.dataset.oldPaddingTop;
  25403. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  25404. };
  25405. const on = {
  25406. beforeEnter(el) {
  25407. if (!el.dataset) el.dataset = {};
  25408. el.dataset.oldPaddingTop = el.style.paddingTop;
  25409. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  25410. if (el.style.height) el.dataset.elExistsHeight = el.style.height;
  25411. el.style.maxHeight = 0;
  25412. el.style.paddingTop = 0;
  25413. el.style.paddingBottom = 0;
  25414. },
  25415. enter(el) {
  25416. requestAnimationFrame(() => {
  25417. el.dataset.oldOverflow = el.style.overflow;
  25418. if (el.dataset.elExistsHeight) el.style.maxHeight = el.dataset.elExistsHeight;
  25419. else if (el.scrollHeight !== 0) el.style.maxHeight = `${el.scrollHeight}px`;
  25420. else el.style.maxHeight = 0;
  25421. el.style.paddingTop = el.dataset.oldPaddingTop;
  25422. el.style.paddingBottom = el.dataset.oldPaddingBottom;
  25423. el.style.overflow = "hidden";
  25424. });
  25425. },
  25426. afterEnter(el) {
  25427. el.style.maxHeight = "";
  25428. el.style.overflow = el.dataset.oldOverflow;
  25429. },
  25430. enterCancelled(el) {
  25431. reset(el);
  25432. },
  25433. beforeLeave(el) {
  25434. if (!el.dataset) el.dataset = {};
  25435. el.dataset.oldPaddingTop = el.style.paddingTop;
  25436. el.dataset.oldPaddingBottom = el.style.paddingBottom;
  25437. el.dataset.oldOverflow = el.style.overflow;
  25438. el.style.maxHeight = `${el.scrollHeight}px`;
  25439. el.style.overflow = "hidden";
  25440. },
  25441. leave(el) {
  25442. if (el.scrollHeight !== 0) {
  25443. el.style.maxHeight = 0;
  25444. el.style.paddingTop = 0;
  25445. el.style.paddingBottom = 0;
  25446. }
  25447. },
  25448. afterLeave(el) {
  25449. reset(el);
  25450. },
  25451. leaveCancelled(el) {
  25452. reset(el);
  25453. }
  25454. };
  25455. return (_ctx, _cache) => {
  25456. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, (0, vue.mergeProps)({ name: (0, vue.unref)(ns).b() }, (0, vue.toHandlers)(on)), {
  25457. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  25458. _: 3
  25459. }, 16, ["name"]);
  25460. };
  25461. }
  25462. });
  25463. //#endregion
  25464. //#region ../../packages/components/collapse-transition/src/collapse-transition.vue
  25465. var collapse_transition_default = collapse_transition_vue_vue_type_script_setup_true_lang_default;
  25466. //#endregion
  25467. //#region ../../packages/components/collapse-transition/index.ts
  25468. const ElCollapseTransition = withInstall(collapse_transition_default);
  25469. //#endregion
  25470. //#region ../../packages/components/collapse/src/use-collapse-item.ts
  25471. const useCollapseItem = (props) => {
  25472. const collapse = (0, vue.inject)(collapseContextKey);
  25473. const { namespace } = useNamespace("collapse");
  25474. const focusing = (0, vue.ref)(false);
  25475. const isClick = (0, vue.ref)(false);
  25476. const idInjection = useIdInjection();
  25477. const id = (0, vue.computed)(() => idInjection.current++);
  25478. const name = (0, vue.computed)(() => {
  25479. return props.name ?? `${namespace.value}-id-${idInjection.prefix}-${(0, vue.unref)(id)}`;
  25480. });
  25481. const isActive = (0, vue.computed)(() => collapse?.activeNames.value.includes((0, vue.unref)(name)));
  25482. const handleFocus = () => {
  25483. setTimeout(() => {
  25484. if (!isClick.value) focusing.value = true;
  25485. else isClick.value = false;
  25486. }, 50);
  25487. };
  25488. const handleHeaderClick = (e) => {
  25489. if (props.disabled) return;
  25490. if (e.target?.closest("input, textarea, select")) return;
  25491. collapse?.handleItemClick((0, vue.unref)(name));
  25492. focusing.value = false;
  25493. isClick.value = true;
  25494. };
  25495. const handleEnterClick = (e) => {
  25496. if (e.target?.closest("input, textarea, select")) return;
  25497. e.preventDefault();
  25498. collapse?.handleItemClick((0, vue.unref)(name));
  25499. };
  25500. return {
  25501. focusing,
  25502. id,
  25503. isActive,
  25504. handleFocus,
  25505. handleHeaderClick,
  25506. handleEnterClick
  25507. };
  25508. };
  25509. const useCollapseItemDOM = (props, { focusing, isActive, id }) => {
  25510. const ns = useNamespace("collapse");
  25511. const rootKls = (0, vue.computed)(() => [
  25512. ns.b("item"),
  25513. ns.is("active", (0, vue.unref)(isActive)),
  25514. ns.is("disabled", props.disabled)
  25515. ]);
  25516. const headKls = (0, vue.computed)(() => [
  25517. ns.be("item", "header"),
  25518. ns.is("active", (0, vue.unref)(isActive)),
  25519. { focusing: (0, vue.unref)(focusing) && !props.disabled }
  25520. ]);
  25521. const arrowKls = (0, vue.computed)(() => [ns.be("item", "arrow"), ns.is("active", (0, vue.unref)(isActive))]);
  25522. return {
  25523. itemTitleKls: (0, vue.computed)(() => [ns.be("item", "title")]),
  25524. arrowKls,
  25525. headKls,
  25526. rootKls,
  25527. itemWrapperKls: (0, vue.computed)(() => ns.be("item", "wrap")),
  25528. itemContentKls: (0, vue.computed)(() => ns.be("item", "content")),
  25529. scopedContentId: (0, vue.computed)(() => ns.b(`content-${(0, vue.unref)(id)}`)),
  25530. scopedHeadId: (0, vue.computed)(() => ns.b(`head-${(0, vue.unref)(id)}`))
  25531. };
  25532. };
  25533. //#endregion
  25534. //#region ../../packages/components/collapse/src/collapse-item.vue?vue&type=script&setup=true&lang.ts
  25535. const _hoisted_1$56 = [
  25536. "id",
  25537. "aria-expanded",
  25538. "aria-controls",
  25539. "aria-describedby",
  25540. "tabindex",
  25541. "aria-disabled"
  25542. ];
  25543. const _hoisted_2$33 = [
  25544. "id",
  25545. "aria-hidden",
  25546. "aria-labelledby"
  25547. ];
  25548. var collapse_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25549. name: "ElCollapseItem",
  25550. __name: "collapse-item",
  25551. props: collapseItemProps,
  25552. setup(__props, { expose: __expose }) {
  25553. const props = __props;
  25554. const { focusing, id, isActive, handleFocus, handleHeaderClick, handleEnterClick } = useCollapseItem(props);
  25555. const { arrowKls, headKls, rootKls, itemTitleKls, itemWrapperKls, itemContentKls, scopedContentId, scopedHeadId } = useCollapseItemDOM(props, {
  25556. focusing,
  25557. isActive,
  25558. id
  25559. });
  25560. __expose({ isActive });
  25561. return (_ctx, _cache) => {
  25562. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)) }, [(0, vue.createElementVNode)("div", {
  25563. id: (0, vue.unref)(scopedHeadId),
  25564. class: (0, vue.normalizeClass)((0, vue.unref)(headKls)),
  25565. "aria-expanded": (0, vue.unref)(isActive),
  25566. "aria-controls": (0, vue.unref)(scopedContentId),
  25567. "aria-describedby": (0, vue.unref)(scopedContentId),
  25568. tabindex: __props.disabled ? void 0 : 0,
  25569. "aria-disabled": __props.disabled,
  25570. role: "button",
  25571. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleHeaderClick) && (0, vue.unref)(handleHeaderClick)(...args)),
  25572. onKeydown: _cache[1] || (_cache[1] = (0, vue.withKeys)((0, vue.withModifiers)((...args) => (0, vue.unref)(handleEnterClick) && (0, vue.unref)(handleEnterClick)(...args), ["stop"]), ["space", "enter"])),
  25573. onFocus: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(handleFocus) && (0, vue.unref)(handleFocus)(...args)),
  25574. onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
  25575. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(itemTitleKls)) }, [(0, vue.renderSlot)(_ctx.$slots, "title", { isActive: (0, vue.unref)(isActive) }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2), (0, vue.renderSlot)(_ctx.$slots, "icon", { isActive: (0, vue.unref)(isActive) }, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(arrowKls)) }, {
  25576. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  25577. _: 1
  25578. }, 8, ["class"])])], 42, _hoisted_1$56), (0, vue.createVNode)((0, vue.unref)(ElCollapseTransition), null, {
  25579. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  25580. id: (0, vue.unref)(scopedContentId),
  25581. role: "region",
  25582. class: (0, vue.normalizeClass)((0, vue.unref)(itemWrapperKls)),
  25583. "aria-hidden": !(0, vue.unref)(isActive),
  25584. "aria-labelledby": (0, vue.unref)(scopedHeadId)
  25585. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(itemContentKls)) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)], 10, _hoisted_2$33), [[vue.vShow, (0, vue.unref)(isActive)]])]),
  25586. _: 3
  25587. })], 2);
  25588. };
  25589. }
  25590. });
  25591. //#endregion
  25592. //#region ../../packages/components/collapse/src/collapse-item.vue
  25593. var collapse_item_default = collapse_item_vue_vue_type_script_setup_true_lang_default;
  25594. //#endregion
  25595. //#region ../../packages/components/collapse/index.ts
  25596. const ElCollapse = withInstall(collapse_default, { CollapseItem: collapse_item_default });
  25597. const ElCollapseItem = withNoopInstall(collapse_item_default);
  25598. //#endregion
  25599. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.ts
  25600. /**
  25601. * @deprecated Removed after 3.0.0, Use `ColorPickerPanelProps` instead.
  25602. */
  25603. const colorPickerPanelProps = buildProps({
  25604. modelValue: {
  25605. type: definePropType(String),
  25606. default: void 0
  25607. },
  25608. border: {
  25609. type: Boolean,
  25610. default: true
  25611. },
  25612. showAlpha: Boolean,
  25613. colorFormat: { type: definePropType(String) },
  25614. disabled: Boolean,
  25615. predefine: { type: definePropType(Array) },
  25616. validateEvent: {
  25617. type: Boolean,
  25618. default: true
  25619. }
  25620. });
  25621. const colorPickerPanelEmits = { [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val) };
  25622. const ROOT_COMMON_COLOR_INJECTION_KEY = Symbol("colorCommonPickerKey");
  25623. const colorPickerPanelContextKey = Symbol("colorPickerPanelContextKey");
  25624. //#endregion
  25625. //#region ../../packages/components/color-picker-panel/src/props/slider.ts
  25626. /**
  25627. * @deprecated Removed after 3.0.0, Use `AlphaSliderProps` instead.
  25628. */
  25629. const alphaSliderProps = buildProps({
  25630. color: {
  25631. type: definePropType(Object),
  25632. required: true
  25633. },
  25634. vertical: Boolean,
  25635. disabled: Boolean
  25636. });
  25637. /**
  25638. * @deprecated Removed after 3.0.0, Use `HueSliderProps` instead.
  25639. */
  25640. const hueSliderProps = alphaSliderProps;
  25641. //#endregion
  25642. //#region ../../packages/components/color-picker-panel/src/utils/draggable.ts
  25643. let isDragging = false;
  25644. function draggable(element, options) {
  25645. if (!isClient) return;
  25646. const moveFn = function(event) {
  25647. options.drag?.(event);
  25648. };
  25649. const upFn = function(event) {
  25650. document.removeEventListener("mousemove", moveFn);
  25651. document.removeEventListener("mouseup", upFn);
  25652. document.removeEventListener("touchmove", moveFn);
  25653. document.removeEventListener("touchend", upFn);
  25654. document.onselectstart = null;
  25655. document.ondragstart = null;
  25656. isDragging = false;
  25657. options.end?.(event);
  25658. };
  25659. const downFn = function(event) {
  25660. if (isDragging) return;
  25661. document.onselectstart = () => false;
  25662. document.ondragstart = () => false;
  25663. document.addEventListener("mousemove", moveFn);
  25664. document.addEventListener("mouseup", upFn);
  25665. document.addEventListener("touchmove", moveFn);
  25666. document.addEventListener("touchend", upFn);
  25667. isDragging = true;
  25668. options.start?.(event);
  25669. };
  25670. element.addEventListener("mousedown", downFn);
  25671. element.addEventListener("touchstart", downFn, { passive: false });
  25672. }
  25673. //#endregion
  25674. //#region ../../packages/components/color-picker-panel/src/composables/use-slider.ts
  25675. const useSlider = (props, { key, minValue, maxValue }) => {
  25676. const instance = (0, vue.getCurrentInstance)();
  25677. const thumb = (0, vue.shallowRef)();
  25678. const bar = (0, vue.shallowRef)();
  25679. const currentValue = (0, vue.computed)(() => props.color.get(key));
  25680. function handleClick(event) {
  25681. if (props.disabled) return;
  25682. if (event.target !== thumb.value) handleDrag(event);
  25683. thumb.value?.focus();
  25684. }
  25685. function handleDrag(event) {
  25686. if (!bar.value || !thumb.value || props.disabled) return;
  25687. const rect = instance.vnode.el.getBoundingClientRect();
  25688. const { clientX, clientY } = getClientXY(event);
  25689. let value;
  25690. if (!props.vertical) {
  25691. let left = clientX - rect.left;
  25692. left = Math.max(thumb.value.offsetWidth / 2, left);
  25693. left = Math.min(left, rect.width - thumb.value.offsetWidth / 2);
  25694. value = Math.round((left - thumb.value.offsetWidth / 2) / (rect.width - thumb.value.offsetWidth) * maxValue);
  25695. } else {
  25696. let top = clientY - rect.top;
  25697. top = Math.max(thumb.value.offsetHeight / 2, top);
  25698. top = Math.min(top, rect.height - thumb.value.offsetHeight / 2);
  25699. value = Math.round((top - thumb.value.offsetHeight / 2) / (rect.height - thumb.value.offsetHeight) * maxValue);
  25700. }
  25701. props.color.set(key, value);
  25702. }
  25703. function handleKeydown(event) {
  25704. if (props.disabled) return;
  25705. const { shiftKey } = event;
  25706. const code = getEventCode(event);
  25707. const step = shiftKey ? 10 : 1;
  25708. const reverse = key === "hue" ? -1 : 1;
  25709. let isPreventDefault = true;
  25710. switch (code) {
  25711. case EVENT_CODE.left:
  25712. case EVENT_CODE.down:
  25713. incrementPosition(-step * reverse);
  25714. break;
  25715. case EVENT_CODE.right:
  25716. case EVENT_CODE.up:
  25717. incrementPosition(step * reverse);
  25718. break;
  25719. case EVENT_CODE.home:
  25720. props.color.set(key, key === "hue" ? maxValue : minValue);
  25721. break;
  25722. case EVENT_CODE.end:
  25723. props.color.set(key, key === "hue" ? minValue : maxValue);
  25724. break;
  25725. case EVENT_CODE.pageDown:
  25726. incrementPosition(-4 * reverse);
  25727. break;
  25728. case EVENT_CODE.pageUp:
  25729. incrementPosition(4 * reverse);
  25730. break;
  25731. default:
  25732. isPreventDefault = false;
  25733. break;
  25734. }
  25735. isPreventDefault && event.preventDefault();
  25736. }
  25737. function incrementPosition(step) {
  25738. let next = currentValue.value + step;
  25739. next = next < minValue ? minValue : next > maxValue ? maxValue : next;
  25740. props.color.set(key, next);
  25741. }
  25742. return {
  25743. thumb,
  25744. bar,
  25745. currentValue,
  25746. handleDrag,
  25747. handleClick,
  25748. handleKeydown
  25749. };
  25750. };
  25751. const useSliderDOM = (props, { namespace, maxValue, bar, thumb, currentValue, handleDrag, getBackground }) => {
  25752. const instance = (0, vue.getCurrentInstance)();
  25753. const ns = useNamespace(namespace);
  25754. const thumbLeft = (0, vue.ref)(0);
  25755. const thumbTop = (0, vue.ref)(0);
  25756. const background = (0, vue.ref)();
  25757. function getThumbLeft() {
  25758. if (!thumb.value) return 0;
  25759. if (props.vertical) return 0;
  25760. const el = instance.vnode.el;
  25761. const value = currentValue.value;
  25762. if (!el) return 0;
  25763. return Math.round(value * (el.offsetWidth - thumb.value.offsetWidth / 2) / maxValue);
  25764. }
  25765. function getThumbTop() {
  25766. if (!thumb.value) return 0;
  25767. const el = instance.vnode.el;
  25768. if (!props.vertical) return 0;
  25769. const value = currentValue.value;
  25770. if (!el) return 0;
  25771. return Math.round(value * (el.offsetHeight - thumb.value.offsetHeight / 2) / maxValue);
  25772. }
  25773. function update() {
  25774. thumbLeft.value = getThumbLeft();
  25775. thumbTop.value = getThumbTop();
  25776. background.value = getBackground?.();
  25777. }
  25778. (0, vue.onMounted)(() => {
  25779. if (!bar.value || !thumb.value) return;
  25780. const dragConfig = {
  25781. drag: (event) => {
  25782. handleDrag(event);
  25783. },
  25784. end: (event) => {
  25785. handleDrag(event);
  25786. }
  25787. };
  25788. draggable(bar.value, dragConfig);
  25789. draggable(thumb.value, dragConfig);
  25790. update();
  25791. });
  25792. (0, vue.watch)(currentValue, () => update());
  25793. (0, vue.watch)(() => props.color.value, () => update());
  25794. const rootKls = (0, vue.computed)(() => [
  25795. ns.b(),
  25796. ns.is("vertical", props.vertical),
  25797. ns.is("disabled", props.disabled)
  25798. ]);
  25799. const barKls = (0, vue.computed)(() => ns.e("bar"));
  25800. const thumbKls = (0, vue.computed)(() => ns.e("thumb"));
  25801. return {
  25802. rootKls,
  25803. barKls,
  25804. barStyle: (0, vue.computed)(() => ({ background: background.value })),
  25805. thumbKls,
  25806. thumbStyle: (0, vue.computed)(() => ({
  25807. left: addUnit(thumbLeft.value),
  25808. top: addUnit(thumbTop.value)
  25809. })),
  25810. thumbLeft,
  25811. thumbTop,
  25812. update
  25813. };
  25814. };
  25815. //#endregion
  25816. //#region ../../packages/components/color-picker-panel/src/components/alpha-slider.vue?vue&type=script&setup=true&lang.ts
  25817. const _hoisted_1$55 = [
  25818. "aria-label",
  25819. "aria-valuenow",
  25820. "aria-valuetext",
  25821. "aria-orientation",
  25822. "tabindex",
  25823. "aria-disabled"
  25824. ];
  25825. const minValue$1 = 0;
  25826. const maxValue$1 = 100;
  25827. var alpha_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25828. name: "ElColorAlphaSlider",
  25829. __name: "alpha-slider",
  25830. props: alphaSliderProps,
  25831. setup(__props, { expose: __expose }) {
  25832. const props = __props;
  25833. const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props, {
  25834. key: "alpha",
  25835. minValue: minValue$1,
  25836. maxValue: maxValue$1
  25837. });
  25838. const { rootKls, barKls, barStyle, thumbKls, thumbStyle, update } = useSliderDOM(props, {
  25839. namespace: "color-alpha-slider",
  25840. maxValue: maxValue$1,
  25841. currentValue,
  25842. bar,
  25843. thumb,
  25844. handleDrag,
  25845. getBackground
  25846. });
  25847. const { t } = useLocale();
  25848. const ariaLabel = (0, vue.computed)(() => t("el.colorpicker.alphaLabel"));
  25849. const ariaValuetext = (0, vue.computed)(() => {
  25850. return t("el.colorpicker.alphaDescription", {
  25851. alpha: currentValue.value,
  25852. color: props.color.value
  25853. });
  25854. });
  25855. function getBackground() {
  25856. if (props.color && props.color.value) {
  25857. const { r, g, b } = props.color.toRgb();
  25858. return `linear-gradient(to right, rgba(${r}, ${g}, ${b}, 0) 0%, rgba(${r}, ${g}, ${b}, 1) 100%)`;
  25859. }
  25860. return "";
  25861. }
  25862. __expose({
  25863. update,
  25864. bar,
  25865. thumb
  25866. });
  25867. return (_ctx, _cache) => {
  25868. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)) }, [(0, vue.createElementVNode)("div", {
  25869. ref_key: "bar",
  25870. ref: bar,
  25871. class: (0, vue.normalizeClass)((0, vue.unref)(barKls)),
  25872. style: (0, vue.normalizeStyle)((0, vue.unref)(barStyle)),
  25873. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleClick) && (0, vue.unref)(handleClick)(...args))
  25874. }, null, 6), (0, vue.createElementVNode)("div", {
  25875. ref_key: "thumb",
  25876. ref: thumb,
  25877. class: (0, vue.normalizeClass)((0, vue.unref)(thumbKls)),
  25878. style: (0, vue.normalizeStyle)((0, vue.unref)(thumbStyle)),
  25879. "aria-label": ariaLabel.value,
  25880. "aria-valuenow": (0, vue.unref)(currentValue),
  25881. "aria-valuetext": ariaValuetext.value,
  25882. "aria-orientation": __props.vertical ? "vertical" : "horizontal",
  25883. "aria-valuemin": minValue$1,
  25884. "aria-valuemax": maxValue$1,
  25885. role: "slider",
  25886. tabindex: __props.disabled ? void 0 : 0,
  25887. "aria-disabled": __props.disabled,
  25888. onKeydown: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleKeydown) && (0, vue.unref)(handleKeydown)(...args))
  25889. }, null, 46, _hoisted_1$55)], 2);
  25890. };
  25891. }
  25892. });
  25893. //#endregion
  25894. //#region ../../packages/components/color-picker-panel/src/components/alpha-slider.vue
  25895. var alpha_slider_default = alpha_slider_vue_vue_type_script_setup_true_lang_default;
  25896. //#endregion
  25897. //#region ../../packages/components/color-picker-panel/src/components/hue-slider.vue?vue&type=script&setup=true&lang.ts
  25898. const _hoisted_1$54 = [
  25899. "aria-label",
  25900. "aria-valuenow",
  25901. "aria-valuetext",
  25902. "aria-orientation",
  25903. "tabindex",
  25904. "aria-disabled"
  25905. ];
  25906. const minValue = 0;
  25907. const maxValue = 360;
  25908. var hue_slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  25909. name: "ElColorHueSlider",
  25910. __name: "hue-slider",
  25911. props: hueSliderProps,
  25912. setup(__props, { expose: __expose }) {
  25913. const props = __props;
  25914. const { currentValue, bar, thumb, handleDrag, handleClick, handleKeydown } = useSlider(props, {
  25915. key: "hue",
  25916. minValue,
  25917. maxValue
  25918. });
  25919. const { rootKls, barKls, thumbKls, thumbStyle, thumbTop, update } = useSliderDOM(props, {
  25920. namespace: "color-hue-slider",
  25921. maxValue,
  25922. currentValue,
  25923. bar,
  25924. thumb,
  25925. handleDrag
  25926. });
  25927. const { t } = useLocale();
  25928. const ariaLabel = (0, vue.computed)(() => t("el.colorpicker.hueLabel"));
  25929. const ariaValuetext = (0, vue.computed)(() => {
  25930. return t("el.colorpicker.hueDescription", {
  25931. hue: currentValue.value,
  25932. color: props.color.value
  25933. });
  25934. });
  25935. __expose({
  25936. bar,
  25937. thumb,
  25938. thumbTop,
  25939. update
  25940. });
  25941. return (_ctx, _cache) => {
  25942. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)) }, [(0, vue.createElementVNode)("div", {
  25943. ref_key: "bar",
  25944. ref: bar,
  25945. class: (0, vue.normalizeClass)((0, vue.unref)(barKls)),
  25946. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleClick) && (0, vue.unref)(handleClick)(...args))
  25947. }, null, 2), (0, vue.createElementVNode)("div", {
  25948. ref_key: "thumb",
  25949. ref: thumb,
  25950. class: (0, vue.normalizeClass)((0, vue.unref)(thumbKls)),
  25951. style: (0, vue.normalizeStyle)((0, vue.unref)(thumbStyle)),
  25952. "aria-label": ariaLabel.value,
  25953. "aria-valuenow": (0, vue.unref)(currentValue),
  25954. "aria-valuetext": ariaValuetext.value,
  25955. "aria-orientation": __props.vertical ? "vertical" : "horizontal",
  25956. "aria-valuemin": minValue,
  25957. "aria-valuemax": maxValue,
  25958. role: "slider",
  25959. tabindex: __props.disabled ? void 0 : 0,
  25960. "aria-disabled": __props.disabled,
  25961. onKeydown: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleKeydown) && (0, vue.unref)(handleKeydown)(...args))
  25962. }, null, 46, _hoisted_1$54)], 2);
  25963. };
  25964. }
  25965. });
  25966. //#endregion
  25967. //#region ../../packages/components/color-picker-panel/src/components/hue-slider.vue
  25968. var hue_slider_default = hue_slider_vue_vue_type_script_setup_true_lang_default;
  25969. //#endregion
  25970. //#region ../../packages/components/color-picker-panel/src/props/predefine.ts
  25971. /**
  25972. * @deprecated Removed after 3.0.0, Use `PredefineProps` instead.
  25973. */
  25974. const predefineProps = buildProps({
  25975. colors: {
  25976. type: definePropType(Array),
  25977. required: true
  25978. },
  25979. color: {
  25980. type: definePropType(Object),
  25981. required: true
  25982. },
  25983. enableAlpha: {
  25984. type: Boolean,
  25985. required: true
  25986. },
  25987. disabled: Boolean
  25988. });
  25989. //#endregion
  25990. //#region ../../packages/components/color-picker-panel/src/utils/color.ts
  25991. var Color = class {
  25992. constructor(options = {}) {
  25993. this._hue = 0;
  25994. this._saturation = 100;
  25995. this._value = 100;
  25996. this._alpha = 100;
  25997. this._tiny = new TinyColor();
  25998. this._isValid = false;
  25999. this.enableAlpha = false;
  26000. this.format = "";
  26001. this.value = "";
  26002. for (const option in options) if (hasOwn(options, option)) this[option] = options[option];
  26003. if (options.value) this.fromString(options.value);
  26004. else this.doOnChange();
  26005. }
  26006. set(prop, value) {
  26007. if (arguments.length === 1 && typeof prop === "object") {
  26008. for (const p in prop) if (hasOwn(prop, p)) this.set(p, prop[p]);
  26009. return;
  26010. }
  26011. this[`_${prop}`] = value;
  26012. this._isValid = true;
  26013. this.doOnChange();
  26014. }
  26015. get(prop) {
  26016. if ([
  26017. "hue",
  26018. "saturation",
  26019. "value",
  26020. "alpha"
  26021. ].includes(prop)) return Math.round(this[`_${prop}`]);
  26022. return this[`_${prop}`];
  26023. }
  26024. toRgb() {
  26025. return this._isValid ? this._tiny.toRgb() : {
  26026. r: 255,
  26027. g: 255,
  26028. b: 255,
  26029. a: 0
  26030. };
  26031. }
  26032. fromString(value) {
  26033. const color = new TinyColor(value);
  26034. this._isValid = color.isValid;
  26035. if (color.isValid) {
  26036. const { h, s, v, a } = color.toHsv();
  26037. this._hue = h;
  26038. this._saturation = s * 100;
  26039. this._value = v * 100;
  26040. this._alpha = a * 100;
  26041. } else {
  26042. this._hue = 0;
  26043. this._saturation = 100;
  26044. this._value = 100;
  26045. this._alpha = 100;
  26046. }
  26047. this.doOnChange();
  26048. }
  26049. clear() {
  26050. this._isValid = false;
  26051. this.value = "";
  26052. this._hue = 0;
  26053. this._saturation = 100;
  26054. this._value = 100;
  26055. this._alpha = 100;
  26056. }
  26057. compare(color) {
  26058. const compareColor = new TinyColor({
  26059. h: color._hue,
  26060. s: color._saturation / 100,
  26061. v: color._value / 100,
  26062. a: color._alpha / 100
  26063. });
  26064. return this._tiny.equals(compareColor);
  26065. }
  26066. doOnChange() {
  26067. const { _hue, _saturation, _value, _alpha, format, enableAlpha } = this;
  26068. let _format = format || (enableAlpha ? "rgb" : "hex");
  26069. if (format === "hex" && enableAlpha) _format = "hex8";
  26070. this._tiny = new TinyColor({
  26071. h: _hue,
  26072. s: _saturation / 100,
  26073. v: _value / 100,
  26074. a: _alpha / 100
  26075. });
  26076. this.value = this._isValid ? this._tiny.toString(_format) : "";
  26077. }
  26078. };
  26079. //#endregion
  26080. //#region ../../packages/components/color-picker-panel/src/composables/use-predefine.ts
  26081. const usePredefine = (props) => {
  26082. const { currentColor } = (0, vue.inject)(colorPickerPanelContextKey);
  26083. const rgbaColors = (0, vue.ref)(parseColors(props.colors, props.color));
  26084. (0, vue.watch)(() => currentColor.value, (val) => {
  26085. const color = new Color({
  26086. value: val,
  26087. enableAlpha: props.enableAlpha
  26088. });
  26089. rgbaColors.value.forEach((item) => {
  26090. item.selected = color.compare(item);
  26091. });
  26092. });
  26093. (0, vue.watchEffect)(() => {
  26094. rgbaColors.value = parseColors(props.colors, props.color);
  26095. });
  26096. function handleSelect(index) {
  26097. props.color.fromString(props.colors[index]);
  26098. }
  26099. function parseColors(colors, color) {
  26100. return colors.map((value) => {
  26101. const c = new Color({
  26102. value,
  26103. enableAlpha: props.enableAlpha
  26104. });
  26105. c.selected = c.compare(color);
  26106. return c;
  26107. });
  26108. }
  26109. return {
  26110. rgbaColors,
  26111. handleSelect
  26112. };
  26113. };
  26114. const usePredefineDOM = (props) => {
  26115. const ns = useNamespace("color-predefine");
  26116. const rootKls = (0, vue.computed)(() => [ns.b(), ns.is("disabled", props.disabled)]);
  26117. const colorsKls = (0, vue.computed)(() => ns.e("colors"));
  26118. function colorSelectorKls(item) {
  26119. return [
  26120. ns.e("color-selector"),
  26121. ns.is("alpha", item.get("alpha") < 100),
  26122. { selected: item.selected }
  26123. ];
  26124. }
  26125. return {
  26126. rootKls,
  26127. colorsKls,
  26128. colorSelectorKls
  26129. };
  26130. };
  26131. //#endregion
  26132. //#region ../../packages/components/color-picker-panel/src/components/predefine.vue?vue&type=script&setup=true&lang.ts
  26133. const _hoisted_1$53 = [
  26134. "disabled",
  26135. "aria-label",
  26136. "onClick"
  26137. ];
  26138. var predefine_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26139. name: "ElColorPredefine",
  26140. __name: "predefine",
  26141. props: predefineProps,
  26142. setup(__props) {
  26143. const props = __props;
  26144. const { rgbaColors, handleSelect } = usePredefine(props);
  26145. const { rootKls, colorsKls, colorSelectorKls } = usePredefineDOM(props);
  26146. const { t } = useLocale();
  26147. const ariaLabel = (value) => {
  26148. return t("el.colorpicker.predefineDescription", { value });
  26149. };
  26150. return (_ctx, _cache) => {
  26151. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(colorsKls)) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(rgbaColors), (item, index) => {
  26152. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  26153. key: __props.colors[index],
  26154. type: "button",
  26155. disabled: __props.disabled,
  26156. "aria-label": ariaLabel(item.value),
  26157. class: (0, vue.normalizeClass)((0, vue.unref)(colorSelectorKls)(item)),
  26158. onClick: ($event) => (0, vue.unref)(handleSelect)(index)
  26159. }, [(0, vue.createElementVNode)("div", { style: (0, vue.normalizeStyle)({ backgroundColor: item.value }) }, null, 4)], 10, _hoisted_1$53);
  26160. }), 128))], 2)], 2);
  26161. };
  26162. }
  26163. });
  26164. //#endregion
  26165. //#region ../../packages/components/color-picker-panel/src/components/predefine.vue
  26166. var predefine_default = predefine_vue_vue_type_script_setup_true_lang_default;
  26167. //#endregion
  26168. //#region ../../packages/components/color-picker-panel/src/props/sv-panel.ts
  26169. /**
  26170. * @deprecated Removed after 3.0.0, Use `SvPanelProps` instead.
  26171. */
  26172. const svPanelProps = buildProps({
  26173. color: {
  26174. type: definePropType(Object),
  26175. required: true
  26176. },
  26177. disabled: Boolean
  26178. });
  26179. //#endregion
  26180. //#region ../../packages/components/color-picker-panel/src/composables/use-sv-panel.ts
  26181. const useSvPanel = (props) => {
  26182. const instance = (0, vue.getCurrentInstance)();
  26183. const cursorRef = (0, vue.ref)();
  26184. const cursorTop = (0, vue.ref)(0);
  26185. const cursorLeft = (0, vue.ref)(0);
  26186. const background = (0, vue.ref)("hsl(0, 100%, 50%)");
  26187. const saturation = (0, vue.computed)(() => props.color.get("saturation"));
  26188. const brightness = (0, vue.computed)(() => props.color.get("value"));
  26189. const hue = (0, vue.computed)(() => props.color.get("hue"));
  26190. function handleClick(event) {
  26191. if (props.disabled) return;
  26192. if (event.target !== cursorRef.value) handleDrag(event);
  26193. cursorRef.value?.focus({ preventScroll: true });
  26194. }
  26195. function handleDrag(event) {
  26196. if (props.disabled) return;
  26197. const rect = instance.vnode.el.getBoundingClientRect();
  26198. const { clientX, clientY } = getClientXY(event);
  26199. let left = clientX - rect.left;
  26200. let top = clientY - rect.top;
  26201. left = Math.max(0, left);
  26202. left = Math.min(left, rect.width);
  26203. top = Math.max(0, top);
  26204. top = Math.min(top, rect.height);
  26205. cursorLeft.value = left;
  26206. cursorTop.value = top;
  26207. props.color.set({
  26208. saturation: left / rect.width * 100,
  26209. value: 100 - top / rect.height * 100
  26210. });
  26211. }
  26212. function handleKeydown(event) {
  26213. if (props.disabled) return;
  26214. const { shiftKey } = event;
  26215. const code = getEventCode(event);
  26216. const step = shiftKey ? 10 : 1;
  26217. let isPreventDefault = true;
  26218. switch (code) {
  26219. case EVENT_CODE.left:
  26220. incrementSaturation(-step);
  26221. break;
  26222. case EVENT_CODE.right:
  26223. incrementSaturation(step);
  26224. break;
  26225. case EVENT_CODE.up:
  26226. incrementBrightness(step);
  26227. break;
  26228. case EVENT_CODE.down:
  26229. incrementBrightness(-step);
  26230. break;
  26231. default:
  26232. isPreventDefault = false;
  26233. break;
  26234. }
  26235. isPreventDefault && event.preventDefault();
  26236. }
  26237. function incrementSaturation(step) {
  26238. let next = saturation.value + step;
  26239. next = next < 0 ? 0 : next > 100 ? 100 : next;
  26240. props.color.set("saturation", next);
  26241. }
  26242. function incrementBrightness(step) {
  26243. let next = brightness.value + step;
  26244. next = next < 0 ? 0 : next > 100 ? 100 : next;
  26245. props.color.set("value", next);
  26246. }
  26247. return {
  26248. cursorRef,
  26249. cursorTop,
  26250. cursorLeft,
  26251. background,
  26252. saturation,
  26253. brightness,
  26254. hue,
  26255. handleClick,
  26256. handleDrag,
  26257. handleKeydown
  26258. };
  26259. };
  26260. const useSvPanelDOM = (props, { cursorTop, cursorLeft, background, handleDrag }) => {
  26261. const instance = (0, vue.getCurrentInstance)();
  26262. const ns = useNamespace("color-svpanel");
  26263. function update() {
  26264. const saturation = props.color.get("saturation");
  26265. const brightness = props.color.get("value");
  26266. const { clientWidth: width, clientHeight: height } = instance.vnode.el;
  26267. cursorLeft.value = saturation * width / 100;
  26268. cursorTop.value = (100 - brightness) * height / 100;
  26269. background.value = `hsl(${props.color.get("hue")}, 100%, 50%)`;
  26270. }
  26271. (0, vue.onMounted)(() => {
  26272. draggable(instance.vnode.el, {
  26273. drag: (event) => {
  26274. handleDrag(event);
  26275. },
  26276. end: (event) => {
  26277. handleDrag(event);
  26278. }
  26279. });
  26280. update();
  26281. });
  26282. (0, vue.watch)([
  26283. () => props.color.get("hue"),
  26284. () => props.color.get("value"),
  26285. () => props.color.value
  26286. ], () => update());
  26287. return {
  26288. rootKls: (0, vue.computed)(() => ns.b()),
  26289. cursorKls: (0, vue.computed)(() => ns.e("cursor")),
  26290. rootStyle: (0, vue.computed)(() => ({ backgroundColor: background.value })),
  26291. cursorStyle: (0, vue.computed)(() => ({
  26292. top: addUnit(cursorTop.value),
  26293. left: addUnit(cursorLeft.value)
  26294. })),
  26295. update
  26296. };
  26297. };
  26298. //#endregion
  26299. //#region ../../packages/components/color-picker-panel/src/components/sv-panel.vue?vue&type=script&setup=true&lang.ts
  26300. const _hoisted_1$52 = [
  26301. "tabindex",
  26302. "aria-disabled",
  26303. "aria-label",
  26304. "aria-valuenow",
  26305. "aria-valuetext"
  26306. ];
  26307. var sv_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26308. name: "ElSvPanel",
  26309. __name: "sv-panel",
  26310. props: svPanelProps,
  26311. setup(__props, { expose: __expose }) {
  26312. const props = __props;
  26313. const { cursorRef, cursorTop, cursorLeft, background, saturation, brightness, handleClick, handleDrag, handleKeydown } = useSvPanel(props);
  26314. const { rootKls, cursorKls, rootStyle, cursorStyle, update } = useSvPanelDOM(props, {
  26315. cursorTop,
  26316. cursorLeft,
  26317. background,
  26318. handleDrag
  26319. });
  26320. const { t } = useLocale();
  26321. const ariaLabel = (0, vue.computed)(() => t("el.colorpicker.svLabel"));
  26322. const ariaValuetext = (0, vue.computed)(() => {
  26323. return t("el.colorpicker.svDescription", {
  26324. saturation: saturation.value,
  26325. brightness: brightness.value,
  26326. color: props.color.value
  26327. });
  26328. });
  26329. __expose({ update });
  26330. return (_ctx, _cache) => {
  26331. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  26332. class: (0, vue.normalizeClass)((0, vue.unref)(rootKls)),
  26333. style: (0, vue.normalizeStyle)((0, vue.unref)(rootStyle)),
  26334. onClick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleClick) && (0, vue.unref)(handleClick)(...args))
  26335. }, [(0, vue.createElementVNode)("div", {
  26336. ref_key: "cursorRef",
  26337. ref: cursorRef,
  26338. class: (0, vue.normalizeClass)((0, vue.unref)(cursorKls)),
  26339. style: (0, vue.normalizeStyle)((0, vue.unref)(cursorStyle)),
  26340. tabindex: __props.disabled ? void 0 : 0,
  26341. "aria-disabled": __props.disabled,
  26342. role: "slider",
  26343. "aria-valuemin": "0,0",
  26344. "aria-valuemax": "100,100",
  26345. "aria-label": ariaLabel.value,
  26346. "aria-valuenow": `${(0, vue.unref)(saturation)},${(0, vue.unref)(brightness)}`,
  26347. "aria-valuetext": ariaValuetext.value,
  26348. onKeydown: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleKeydown) && (0, vue.unref)(handleKeydown)(...args))
  26349. }, null, 46, _hoisted_1$52)], 6);
  26350. };
  26351. }
  26352. });
  26353. //#endregion
  26354. //#region ../../packages/components/color-picker-panel/src/components/sv-panel.vue
  26355. var sv_panel_default = sv_panel_vue_vue_type_script_setup_true_lang_default;
  26356. //#endregion
  26357. //#region ../../packages/components/color-picker-panel/src/composables/use-common-color.ts
  26358. const useCommonColor = (props, emit) => {
  26359. const color = (0, vue.reactive)(new Color({
  26360. enableAlpha: props.showAlpha,
  26361. format: props.colorFormat || "",
  26362. value: props.modelValue
  26363. }));
  26364. (0, vue.watch)(() => [props.colorFormat, props.showAlpha], () => {
  26365. color.enableAlpha = props.showAlpha;
  26366. color.format = props.colorFormat || color.format;
  26367. color.doOnChange();
  26368. emit(UPDATE_MODEL_EVENT, color.value);
  26369. });
  26370. return { color };
  26371. };
  26372. //#endregion
  26373. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.vue?vue&type=script&setup=true&lang.ts
  26374. var color_picker_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26375. name: "ElColorPickerPanel",
  26376. __name: "color-picker-panel",
  26377. props: colorPickerPanelProps,
  26378. emits: colorPickerPanelEmits,
  26379. setup(__props, { expose: __expose, emit: __emit }) {
  26380. const props = __props;
  26381. const emit = __emit;
  26382. const ns = useNamespace("color-picker-panel");
  26383. const { formItem } = useFormItem();
  26384. const disabled = useFormDisabled();
  26385. const hueRef = (0, vue.ref)();
  26386. const svRef = (0, vue.ref)();
  26387. const alphaRef = (0, vue.ref)();
  26388. const inputRef = (0, vue.ref)();
  26389. const customInput = (0, vue.ref)("");
  26390. const { color } = (0, vue.inject)(ROOT_COMMON_COLOR_INJECTION_KEY, () => useCommonColor(props, emit), true);
  26391. function handleConfirm() {
  26392. color.fromString(customInput.value);
  26393. if (color.value !== customInput.value) customInput.value = color.value;
  26394. }
  26395. function handleFocusout() {
  26396. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  26397. }
  26398. function update() {
  26399. hueRef.value?.update();
  26400. svRef.value?.update();
  26401. alphaRef.value?.update();
  26402. }
  26403. (0, vue.onMounted)(() => {
  26404. if (props.modelValue) customInput.value = color.value;
  26405. (0, vue.nextTick)(update);
  26406. });
  26407. (0, vue.watch)(() => props.modelValue, (newVal) => {
  26408. if (newVal !== color.value) newVal ? color.fromString(newVal) : color.clear();
  26409. });
  26410. (0, vue.watch)(() => color.value, (val) => {
  26411. emit(UPDATE_MODEL_EVENT, val);
  26412. customInput.value = val;
  26413. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26414. });
  26415. (0, vue.provide)(colorPickerPanelContextKey, { currentColor: (0, vue.computed)(() => color.value) });
  26416. __expose({
  26417. color,
  26418. inputRef,
  26419. update
  26420. });
  26421. return (_ctx, _cache) => {
  26422. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  26423. class: (0, vue.normalizeClass)([
  26424. (0, vue.unref)(ns).b(),
  26425. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(disabled)),
  26426. (0, vue.unref)(ns).is("border", __props.border)
  26427. ]),
  26428. onFocusout: handleFocusout
  26429. }, [
  26430. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("wrapper")) }, [(0, vue.createVNode)(hue_slider_default, {
  26431. ref_key: "hueRef",
  26432. ref: hueRef,
  26433. class: "hue-slider",
  26434. color: (0, vue.unref)(color),
  26435. vertical: "",
  26436. disabled: (0, vue.unref)(disabled)
  26437. }, null, 8, ["color", "disabled"]), (0, vue.createVNode)(sv_panel_default, {
  26438. ref_key: "svRef",
  26439. ref: svRef,
  26440. color: (0, vue.unref)(color),
  26441. disabled: (0, vue.unref)(disabled)
  26442. }, null, 8, ["color", "disabled"])], 2),
  26443. __props.showAlpha ? ((0, vue.openBlock)(), (0, vue.createBlock)(alpha_slider_default, {
  26444. key: 0,
  26445. ref_key: "alphaRef",
  26446. ref: alphaRef,
  26447. color: (0, vue.unref)(color),
  26448. disabled: (0, vue.unref)(disabled)
  26449. }, null, 8, ["color", "disabled"])) : (0, vue.createCommentVNode)("v-if", true),
  26450. __props.predefine ? ((0, vue.openBlock)(), (0, vue.createBlock)(predefine_default, {
  26451. key: 1,
  26452. ref: "predefine",
  26453. "enable-alpha": __props.showAlpha,
  26454. color: (0, vue.unref)(color),
  26455. colors: __props.predefine,
  26456. disabled: (0, vue.unref)(disabled)
  26457. }, null, 8, [
  26458. "enable-alpha",
  26459. "color",
  26460. "colors",
  26461. "disabled"
  26462. ])) : (0, vue.createCommentVNode)("v-if", true),
  26463. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("footer")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  26464. ref_key: "inputRef",
  26465. ref: inputRef,
  26466. modelValue: customInput.value,
  26467. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customInput.value = $event),
  26468. "validate-event": false,
  26469. size: "small",
  26470. disabled: (0, vue.unref)(disabled),
  26471. onChange: handleConfirm
  26472. }, null, 8, ["modelValue", "disabled"]), (0, vue.renderSlot)(_ctx.$slots, "footer")], 2)
  26473. ], 34);
  26474. };
  26475. }
  26476. });
  26477. //#endregion
  26478. //#region ../../packages/components/color-picker-panel/src/color-picker-panel.vue
  26479. var color_picker_panel_default = color_picker_panel_vue_vue_type_script_setup_true_lang_default;
  26480. //#endregion
  26481. //#region ../../packages/components/color-picker-panel/index.ts
  26482. const ElColorPickerPanel = withInstall(color_picker_panel_default);
  26483. //#endregion
  26484. //#region ../../packages/components/color-picker/src/color-picker.ts
  26485. /**
  26486. * @deprecated Removed after 3.0.0, Use `ColorPickerProps` instead.
  26487. */
  26488. const colorPickerProps = buildProps({
  26489. persistent: {
  26490. type: Boolean,
  26491. default: true
  26492. },
  26493. modelValue: {
  26494. type: definePropType(String),
  26495. default: void 0
  26496. },
  26497. id: String,
  26498. showAlpha: Boolean,
  26499. colorFormat: { type: definePropType(String) },
  26500. disabled: {
  26501. type: Boolean,
  26502. default: void 0
  26503. },
  26504. clearable: {
  26505. type: Boolean,
  26506. default: true
  26507. },
  26508. size: useSizeProp,
  26509. popperClass: useTooltipContentProps.popperClass,
  26510. popperStyle: useTooltipContentProps.popperStyle,
  26511. tabindex: {
  26512. type: [String, Number],
  26513. default: 0
  26514. },
  26515. teleported: useTooltipContentProps.teleported,
  26516. appendTo: useTooltipContentProps.appendTo,
  26517. predefine: { type: definePropType(Array) },
  26518. validateEvent: {
  26519. type: Boolean,
  26520. default: true
  26521. },
  26522. ...useEmptyValuesProps,
  26523. ...useAriaProps(["ariaLabel"])
  26524. });
  26525. const colorPickerEmits = {
  26526. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNil(val),
  26527. [CHANGE_EVENT]: (val) => isString(val) || isNil(val),
  26528. activeChange: (val) => isString(val) || isNil(val),
  26529. focus: (evt) => evt instanceof FocusEvent,
  26530. blur: (evt) => evt instanceof FocusEvent,
  26531. clear: () => true
  26532. };
  26533. /**
  26534. * @description default values for ColorPickerProps, used in components that extend ColorPickerProps
  26535. */
  26536. const colorPickerPropsDefaults = {
  26537. persistent: true,
  26538. modelValue: void 0,
  26539. disabled: void 0,
  26540. clearable: true,
  26541. popperStyle: void 0,
  26542. tabindex: 0,
  26543. teleported: true,
  26544. validateEvent: true,
  26545. valueOnClear: void 0
  26546. };
  26547. //#endregion
  26548. //#region ../../packages/components/color-picker/src/color-picker.vue?vue&type=script&setup=true&lang.ts
  26549. const _hoisted_1$51 = [
  26550. "id",
  26551. "aria-label",
  26552. "aria-labelledby",
  26553. "aria-description",
  26554. "aria-disabled",
  26555. "tabindex"
  26556. ];
  26557. var color_picker_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26558. name: "ElColorPicker",
  26559. __name: "color-picker",
  26560. props: colorPickerProps,
  26561. emits: colorPickerEmits,
  26562. setup(__props, { expose: __expose, emit: __emit }) {
  26563. const props = __props;
  26564. const emit = __emit;
  26565. const { t } = useLocale();
  26566. const ns = useNamespace("color");
  26567. const { formItem } = useFormItem();
  26568. const colorSize = useFormSize();
  26569. const colorDisabled = useFormDisabled();
  26570. const { valueOnClear, isEmptyValue } = useEmptyValues(props, null);
  26571. const commonColor = useCommonColor(props, emit);
  26572. const { inputId: buttonId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  26573. const popper = (0, vue.ref)();
  26574. const triggerRef = (0, vue.ref)();
  26575. const pickerPanelRef = (0, vue.ref)();
  26576. const showPicker = (0, vue.ref)(false);
  26577. const showPanelColor = (0, vue.ref)(false);
  26578. let shouldActiveChange = true;
  26579. const { isFocused, handleFocus, handleBlur } = useFocusController(triggerRef, {
  26580. disabled: colorDisabled,
  26581. beforeBlur(event) {
  26582. return popper.value?.isFocusInsideContent(event);
  26583. },
  26584. afterBlur() {
  26585. setShowPicker(false);
  26586. resetColor();
  26587. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  26588. }
  26589. });
  26590. const color = reactiveComputed(() => pickerPanelRef.value?.color ?? commonColor.color);
  26591. const panelProps = (0, vue.computed)(() => pick(props, Object.keys(colorPickerPanelProps)));
  26592. const displayedColor = (0, vue.computed)(() => {
  26593. if (!props.modelValue && !showPanelColor.value) return "transparent";
  26594. return displayedRgb(color, props.showAlpha);
  26595. });
  26596. const currentColor = (0, vue.computed)(() => {
  26597. return !props.modelValue && !showPanelColor.value ? "" : color.value;
  26598. });
  26599. const buttonAriaLabel = (0, vue.computed)(() => {
  26600. return !isLabeledByFormItem.value ? props.ariaLabel || t("el.colorpicker.defaultLabel") : void 0;
  26601. });
  26602. const buttonAriaLabelledby = (0, vue.computed)(() => {
  26603. return isLabeledByFormItem.value ? formItem?.labelId : void 0;
  26604. });
  26605. const btnKls = (0, vue.computed)(() => {
  26606. return [
  26607. ns.b("picker"),
  26608. ns.is("disabled", colorDisabled.value),
  26609. ns.bm("picker", colorSize.value),
  26610. ns.is("focused", isFocused.value)
  26611. ];
  26612. });
  26613. function displayedRgb(color, showAlpha) {
  26614. const { r, g, b, a } = color.toRgb();
  26615. return showAlpha ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
  26616. }
  26617. function setShowPicker(value) {
  26618. showPicker.value = value;
  26619. }
  26620. const debounceSetShowPicker = debounce(setShowPicker, 100, { leading: true });
  26621. function show() {
  26622. if (colorDisabled.value) return;
  26623. setShowPicker(true);
  26624. }
  26625. function hide() {
  26626. debounceSetShowPicker(false);
  26627. resetColor();
  26628. }
  26629. function resetColor() {
  26630. (0, vue.nextTick)(() => {
  26631. if (props.modelValue) color.fromString(props.modelValue);
  26632. else {
  26633. color.value = "";
  26634. (0, vue.nextTick)(() => {
  26635. showPanelColor.value = false;
  26636. });
  26637. }
  26638. });
  26639. }
  26640. function handleTrigger() {
  26641. if (colorDisabled.value) return;
  26642. if (showPicker.value) resetColor();
  26643. debounceSetShowPicker(!showPicker.value);
  26644. }
  26645. function confirmValue() {
  26646. const value = isEmptyValue(color.value) ? valueOnClear.value : color.value;
  26647. emit(UPDATE_MODEL_EVENT, value);
  26648. emit(CHANGE_EVENT, value);
  26649. if (props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26650. debounceSetShowPicker(false);
  26651. (0, vue.nextTick)(() => {
  26652. const newColor = new Color({
  26653. enableAlpha: props.showAlpha,
  26654. format: props.colorFormat || "",
  26655. value: props.modelValue
  26656. });
  26657. if (!color.compare(newColor)) resetColor();
  26658. });
  26659. }
  26660. function clear() {
  26661. debounceSetShowPicker(false);
  26662. emit(UPDATE_MODEL_EVENT, valueOnClear.value);
  26663. emit(CHANGE_EVENT, valueOnClear.value);
  26664. if (props.modelValue !== valueOnClear.value && props.validateEvent) formItem?.validate("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  26665. resetColor();
  26666. emit("clear");
  26667. }
  26668. function handleShowTooltip() {
  26669. pickerPanelRef?.value?.inputRef?.focus();
  26670. }
  26671. function handleClickOutside() {
  26672. if (!showPicker.value) return;
  26673. hide();
  26674. isFocused.value && focus();
  26675. }
  26676. function handleEsc(event) {
  26677. event.preventDefault();
  26678. event.stopPropagation();
  26679. setShowPicker(false);
  26680. resetColor();
  26681. }
  26682. function handleKeyDown(event) {
  26683. switch (getEventCode(event)) {
  26684. case EVENT_CODE.enter:
  26685. case EVENT_CODE.numpadEnter:
  26686. case EVENT_CODE.space:
  26687. event.preventDefault();
  26688. event.stopPropagation();
  26689. show();
  26690. break;
  26691. case EVENT_CODE.esc:
  26692. handleEsc(event);
  26693. break;
  26694. }
  26695. }
  26696. function focus() {
  26697. triggerRef.value.focus();
  26698. }
  26699. function blur() {
  26700. triggerRef.value.blur();
  26701. }
  26702. (0, vue.watch)(() => currentColor.value, (val) => {
  26703. shouldActiveChange && emit("activeChange", val);
  26704. shouldActiveChange = true;
  26705. });
  26706. (0, vue.watch)(() => color.value, () => {
  26707. if (!props.modelValue && !showPanelColor.value) showPanelColor.value = true;
  26708. });
  26709. (0, vue.watch)(() => props.modelValue, (newVal) => {
  26710. if (!newVal) showPanelColor.value = false;
  26711. else if (newVal && newVal !== color.value) {
  26712. shouldActiveChange = false;
  26713. color.fromString(newVal);
  26714. }
  26715. });
  26716. (0, vue.watch)(() => showPicker.value, () => {
  26717. pickerPanelRef.value && (0, vue.nextTick)(pickerPanelRef.value.update);
  26718. });
  26719. (0, vue.provide)(ROOT_COMMON_COLOR_INJECTION_KEY, commonColor);
  26720. __expose({
  26721. color,
  26722. show,
  26723. hide,
  26724. focus,
  26725. blur
  26726. });
  26727. return (_ctx, _cache) => {
  26728. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  26729. ref_key: "popper",
  26730. ref: popper,
  26731. visible: showPicker.value,
  26732. "show-arrow": false,
  26733. "fallback-placements": [
  26734. "bottom",
  26735. "top",
  26736. "right",
  26737. "left"
  26738. ],
  26739. offset: 0,
  26740. "gpu-acceleration": false,
  26741. "popper-class": [(0, vue.unref)(ns).be("picker", "panel"), __props.popperClass],
  26742. "popper-style": __props.popperStyle,
  26743. "stop-popper-mouse-event": false,
  26744. pure: "",
  26745. loop: "",
  26746. role: "dialog",
  26747. effect: "light",
  26748. trigger: "click",
  26749. teleported: __props.teleported,
  26750. transition: `${(0, vue.unref)(ns).namespace.value}-zoom-in-top`,
  26751. persistent: __props.persistent,
  26752. "append-to": __props.appendTo,
  26753. onShow: handleShowTooltip,
  26754. onHide: _cache[2] || (_cache[2] = ($event) => setShowPicker(false))
  26755. }, {
  26756. content: (0, vue.withCtx)(() => [(0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElColorPickerPanel), (0, vue.mergeProps)({
  26757. ref_key: "pickerPanelRef",
  26758. ref: pickerPanelRef
  26759. }, panelProps.value, {
  26760. border: false,
  26761. "validate-event": false,
  26762. onKeydown: (0, vue.withKeys)(handleEsc, ["esc"])
  26763. }), {
  26764. footer: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", null, [__props.clearable ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), {
  26765. key: 0,
  26766. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("footer", "link-btn")),
  26767. text: "",
  26768. size: "small",
  26769. onClick: clear
  26770. }, {
  26771. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.colorpicker.clear")), 1)]),
  26772. _: 1
  26773. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)((0, vue.unref)(ElButton), {
  26774. plain: "",
  26775. size: "small",
  26776. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("footer", "btn")),
  26777. onClick: confirmValue
  26778. }, {
  26779. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.colorpicker.confirm")), 1)]),
  26780. _: 1
  26781. }, 8, ["class"])])]),
  26782. _: 1
  26783. }, 16)), [[
  26784. (0, vue.unref)(ClickOutside),
  26785. handleClickOutside,
  26786. triggerRef.value
  26787. ]])]),
  26788. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", (0, vue.mergeProps)({
  26789. id: (0, vue.unref)(buttonId),
  26790. ref_key: "triggerRef",
  26791. ref: triggerRef
  26792. }, _ctx.$attrs, {
  26793. class: btnKls.value,
  26794. role: "button",
  26795. "aria-label": buttonAriaLabel.value,
  26796. "aria-labelledby": buttonAriaLabelledby.value,
  26797. "aria-description": (0, vue.unref)(t)("el.colorpicker.description", { color: __props.modelValue || "" }),
  26798. "aria-disabled": (0, vue.unref)(colorDisabled),
  26799. tabindex: (0, vue.unref)(colorDisabled) ? void 0 : __props.tabindex,
  26800. onKeydown: handleKeyDown,
  26801. onFocus: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleFocus) && (0, vue.unref)(handleFocus)(...args)),
  26802. onBlur: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleBlur) && (0, vue.unref)(handleBlur)(...args))
  26803. }), [(0, vue.createElementVNode)("div", {
  26804. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("picker", "trigger")),
  26805. onClick: handleTrigger
  26806. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "color"), (0, vue.unref)(ns).is("alpha", __props.showAlpha)]) }, [(0, vue.createElementVNode)("span", {
  26807. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("picker", "color-inner")),
  26808. style: (0, vue.normalizeStyle)({ backgroundColor: displayedColor.value })
  26809. }, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "icon"), (0, vue.unref)(ns).is("icon-arrow-down")]) }, {
  26810. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_down_default))]),
  26811. _: 1
  26812. }, 8, ["class"]), [[vue.vShow, __props.modelValue || showPanelColor.value]]), (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("picker", "empty"), (0, vue.unref)(ns).is("icon-close")]) }, {
  26813. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  26814. _: 1
  26815. }, 8, ["class"]), [[vue.vShow, !__props.modelValue && !showPanelColor.value]])], 6)], 2)], 2)], 16, _hoisted_1$51)]),
  26816. _: 1
  26817. }, 8, [
  26818. "visible",
  26819. "popper-class",
  26820. "popper-style",
  26821. "teleported",
  26822. "transition",
  26823. "persistent",
  26824. "append-to"
  26825. ]);
  26826. };
  26827. }
  26828. });
  26829. //#endregion
  26830. //#region ../../packages/components/color-picker/src/color-picker.vue
  26831. var color_picker_default = color_picker_vue_vue_type_script_setup_true_lang_default;
  26832. //#endregion
  26833. //#region ../../packages/components/color-picker/index.ts
  26834. const ElColorPicker = withInstall(color_picker_default);
  26835. //#endregion
  26836. //#region ../../packages/components/container/src/container.vue?vue&type=script&setup=true&lang.ts
  26837. var container_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26838. name: "ElContainer",
  26839. __name: "container",
  26840. props: { direction: {
  26841. type: String,
  26842. required: false
  26843. } },
  26844. setup(__props) {
  26845. const props = __props;
  26846. const slots = (0, vue.useSlots)();
  26847. const ns = useNamespace("container");
  26848. const isVertical = (0, vue.computed)(() => {
  26849. if (props.direction === "vertical") return true;
  26850. else if (props.direction === "horizontal") return false;
  26851. if (slots && slots.default) return slots.default().some((vNode) => {
  26852. const tag = vNode.type.name;
  26853. return tag === "ElHeader" || tag === "ElFooter";
  26854. });
  26855. else return false;
  26856. });
  26857. return (_ctx, _cache) => {
  26858. return (0, vue.openBlock)(), (0, vue.createElementBlock)("section", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).is("vertical", isVertical.value)]) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  26859. };
  26860. }
  26861. });
  26862. //#endregion
  26863. //#region ../../packages/components/container/src/container.vue
  26864. var container_default = container_vue_vue_type_script_setup_true_lang_default;
  26865. //#endregion
  26866. //#region ../../packages/components/container/src/aside.vue?vue&type=script&setup=true&lang.ts
  26867. var aside_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26868. name: "ElAside",
  26869. __name: "aside",
  26870. props: { width: {
  26871. type: [String, null],
  26872. required: false,
  26873. default: null
  26874. } },
  26875. setup(__props) {
  26876. const props = __props;
  26877. const ns = useNamespace("aside");
  26878. const style = (0, vue.computed)(() => props.width ? ns.cssVarBlock({ width: props.width }) : {});
  26879. return (_ctx, _cache) => {
  26880. return (0, vue.openBlock)(), (0, vue.createElementBlock)("aside", {
  26881. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  26882. style: (0, vue.normalizeStyle)(style.value)
  26883. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6);
  26884. };
  26885. }
  26886. });
  26887. //#endregion
  26888. //#region ../../packages/components/container/src/aside.vue
  26889. var aside_default = aside_vue_vue_type_script_setup_true_lang_default;
  26890. //#endregion
  26891. //#region ../../packages/components/container/src/footer.vue?vue&type=script&setup=true&lang.ts
  26892. var footer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26893. name: "ElFooter",
  26894. __name: "footer",
  26895. props: { height: {
  26896. type: [String, null],
  26897. required: false,
  26898. default: null
  26899. } },
  26900. setup(__props) {
  26901. const props = __props;
  26902. const ns = useNamespace("footer");
  26903. const style = (0, vue.computed)(() => props.height ? ns.cssVarBlock({ height: props.height }) : {});
  26904. return (_ctx, _cache) => {
  26905. return (0, vue.openBlock)(), (0, vue.createElementBlock)("footer", {
  26906. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  26907. style: (0, vue.normalizeStyle)(style.value)
  26908. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6);
  26909. };
  26910. }
  26911. });
  26912. //#endregion
  26913. //#region ../../packages/components/container/src/footer.vue
  26914. var footer_default = footer_vue_vue_type_script_setup_true_lang_default;
  26915. //#endregion
  26916. //#region ../../packages/components/container/src/header.vue?vue&type=script&setup=true&lang.ts
  26917. var header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26918. name: "ElHeader",
  26919. __name: "header",
  26920. props: { height: {
  26921. type: [String, null],
  26922. required: false,
  26923. default: null
  26924. } },
  26925. setup(__props) {
  26926. const props = __props;
  26927. const ns = useNamespace("header");
  26928. const style = (0, vue.computed)(() => {
  26929. return props.height ? ns.cssVarBlock({ height: props.height }) : {};
  26930. });
  26931. return (_ctx, _cache) => {
  26932. return (0, vue.openBlock)(), (0, vue.createElementBlock)("header", {
  26933. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  26934. style: (0, vue.normalizeStyle)(style.value)
  26935. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 6);
  26936. };
  26937. }
  26938. });
  26939. //#endregion
  26940. //#region ../../packages/components/container/src/header.vue
  26941. var header_default = header_vue_vue_type_script_setup_true_lang_default;
  26942. //#endregion
  26943. //#region ../../packages/components/container/src/main.vue?vue&type=script&setup=true&lang.ts
  26944. var main_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  26945. name: "ElMain",
  26946. __name: "main",
  26947. setup(__props) {
  26948. const ns = useNamespace("main");
  26949. return (_ctx, _cache) => {
  26950. return (0, vue.openBlock)(), (0, vue.createElementBlock)("main", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2);
  26951. };
  26952. }
  26953. });
  26954. //#endregion
  26955. //#region ../../packages/components/container/src/main.vue
  26956. var main_default = main_vue_vue_type_script_setup_true_lang_default;
  26957. //#endregion
  26958. //#region ../../packages/components/container/index.ts
  26959. const ElContainer = withInstall(container_default, {
  26960. Aside: aside_default,
  26961. Footer: footer_default,
  26962. Header: header_default,
  26963. Main: main_default
  26964. });
  26965. const ElAside = withNoopInstall(aside_default);
  26966. const ElFooter = withNoopInstall(footer_default);
  26967. const ElHeader = withNoopInstall(header_default);
  26968. const ElMain = withNoopInstall(main_default);
  26969. //#endregion
  26970. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/advancedFormat.js
  26971. var require_advancedFormat = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  26972. (function(e, t) {
  26973. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_advancedFormat = t();
  26974. })(exports, (function() {
  26975. "use strict";
  26976. return function(e, t) {
  26977. var r = t.prototype, n = r.format;
  26978. r.format = function(e) {
  26979. var t = this, r = this.$locale();
  26980. if (!this.isValid()) return n.bind(this)(e);
  26981. var s = this.$utils(), a = (e || "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(e) {
  26982. switch (e) {
  26983. case "Q": return Math.ceil((t.$M + 1) / 3);
  26984. case "Do": return r.ordinal(t.$D);
  26985. case "gggg": return t.weekYear();
  26986. case "GGGG": return t.isoWeekYear();
  26987. case "wo": return r.ordinal(t.week(), "W");
  26988. case "w":
  26989. case "ww": return s.s(t.week(), "w" === e ? 1 : 2, "0");
  26990. case "W":
  26991. case "WW": return s.s(t.isoWeek(), "W" === e ? 1 : 2, "0");
  26992. case "k":
  26993. case "kk": return s.s(String(0 === t.$H ? 24 : t.$H), "k" === e ? 1 : 2, "0");
  26994. case "X": return Math.floor(t.$d.getTime() / 1e3);
  26995. case "x": return t.$d.getTime();
  26996. case "z": return "[" + t.offsetName() + "]";
  26997. case "zzz": return "[" + t.offsetName("long") + "]";
  26998. default: return e;
  26999. }
  27000. }));
  27001. return n.bind(this)(a);
  27002. };
  27003. };
  27004. }));
  27005. }));
  27006. //#endregion
  27007. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekOfYear.js
  27008. var require_weekOfYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27009. (function(e, t) {
  27010. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekOfYear = t();
  27011. })(exports, (function() {
  27012. "use strict";
  27013. var e = "week", t = "year";
  27014. return function(i, n, r) {
  27015. var f = n.prototype;
  27016. f.week = function(i) {
  27017. if (void 0 === i && (i = null), null !== i) return this.add(7 * (i - this.week()), "day");
  27018. var n = this.$locale().yearStart || 1;
  27019. if (11 === this.month() && this.date() > 25) {
  27020. var f = r(this).startOf(t).add(1, t).date(n), s = r(this).endOf(e);
  27021. if (f.isBefore(s)) return 1;
  27022. }
  27023. var a = r(this).startOf(t).date(n).startOf(e).subtract(1, "millisecond"), o = this.diff(a, e, !0);
  27024. return o < 0 ? r(this).startOf("week").week() : Math.ceil(o);
  27025. }, f.weeks = function(e) {
  27026. return void 0 === e && (e = null), this.week(e);
  27027. };
  27028. };
  27029. }));
  27030. }));
  27031. //#endregion
  27032. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekYear.js
  27033. var require_weekYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27034. (function(e, t) {
  27035. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_weekYear = t();
  27036. })(exports, (function() {
  27037. "use strict";
  27038. return function(e, t) {
  27039. t.prototype.weekYear = function() {
  27040. var e = this.month(), t = this.week(), n = this.year();
  27041. return 1 === t && 11 === e ? n + 1 : 0 === e && t >= 52 ? n - 1 : n;
  27042. };
  27043. };
  27044. }));
  27045. }));
  27046. //#endregion
  27047. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/dayOfYear.js
  27048. var require_dayOfYear = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27049. (function(e, t) {
  27050. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_dayOfYear = t();
  27051. })(exports, (function() {
  27052. "use strict";
  27053. return function(e, t, n) {
  27054. t.prototype.dayOfYear = function(e) {
  27055. var t = Math.round((n(this).startOf("day") - n(this).startOf("year")) / 864e5) + 1;
  27056. return null == e ? t : this.add(e - t, "day");
  27057. };
  27058. };
  27059. }));
  27060. }));
  27061. //#endregion
  27062. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrAfter.js
  27063. var require_isSameOrAfter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27064. (function(e, t) {
  27065. "object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrAfter = t();
  27066. })(exports, (function() {
  27067. "use strict";
  27068. return function(e, t) {
  27069. t.prototype.isSameOrAfter = function(e, t) {
  27070. return this.isSame(e, t) || this.isAfter(e, t);
  27071. };
  27072. };
  27073. }));
  27074. }));
  27075. //#endregion
  27076. //#region ../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrBefore.js
  27077. var require_isSameOrBefore = /* @__PURE__ */ __commonJSMin(((exports, module) => {
  27078. (function(e, i) {
  27079. "object" == typeof exports && "undefined" != typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define(i) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isSameOrBefore = i();
  27080. })(exports, (function() {
  27081. "use strict";
  27082. return function(e, i) {
  27083. i.prototype.isSameOrBefore = function(e, i) {
  27084. return this.isSame(e, i) || this.isBefore(e, i);
  27085. };
  27086. };
  27087. }));
  27088. }));
  27089. //#endregion
  27090. //#region ../../packages/components/date-picker-panel/src/props/date-picker-panel.ts
  27091. var import_isSameOrBefore = /* @__PURE__ */ __toESM(require_isSameOrBefore());
  27092. var import_isSameOrAfter = /* @__PURE__ */ __toESM(require_isSameOrAfter());
  27093. var import_dayOfYear = /* @__PURE__ */ __toESM(require_dayOfYear());
  27094. var import_weekYear = /* @__PURE__ */ __toESM(require_weekYear());
  27095. var import_weekOfYear = /* @__PURE__ */ __toESM(require_weekOfYear());
  27096. var import_advancedFormat = /* @__PURE__ */ __toESM(require_advancedFormat());
  27097. const datePickerPanelProps = buildProps({
  27098. valueFormat: String,
  27099. dateFormat: String,
  27100. timeFormat: String,
  27101. disabled: {
  27102. type: Boolean,
  27103. default: void 0
  27104. },
  27105. modelValue: {
  27106. type: definePropType([
  27107. Date,
  27108. Array,
  27109. String,
  27110. Number
  27111. ]),
  27112. default: ""
  27113. },
  27114. defaultValue: { type: definePropType([Date, Array]) },
  27115. defaultTime: { type: definePropType([Date, Array]) },
  27116. isRange: Boolean,
  27117. ...disabledTimeListsProps,
  27118. disabledDate: { type: Function },
  27119. cellClassName: { type: Function },
  27120. shortcuts: {
  27121. type: Array,
  27122. default: () => []
  27123. },
  27124. arrowControl: Boolean,
  27125. unlinkPanels: Boolean,
  27126. showNow: {
  27127. type: Boolean,
  27128. default: true
  27129. },
  27130. showConfirm: Boolean,
  27131. showFooter: Boolean,
  27132. showWeekNumber: Boolean,
  27133. type: {
  27134. type: definePropType(String),
  27135. default: "date"
  27136. },
  27137. clearable: {
  27138. type: Boolean,
  27139. default: true
  27140. },
  27141. border: {
  27142. type: Boolean,
  27143. default: true
  27144. },
  27145. editable: {
  27146. type: Boolean,
  27147. default: true
  27148. }
  27149. });
  27150. //#endregion
  27151. //#region ../../packages/components/date-picker-panel/src/constants.ts
  27152. const ROOT_PICKER_INJECTION_KEY = Symbol("rootPickerContextKey");
  27153. const ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY = "ElIsDefaultFormat";
  27154. //#endregion
  27155. //#region ../../packages/components/date-picker-panel/src/props/shared.ts
  27156. const selectionModes = [
  27157. "date",
  27158. "dates",
  27159. "year",
  27160. "years",
  27161. "month",
  27162. "months",
  27163. "week",
  27164. "range"
  27165. ];
  27166. const datePickerSharedProps = buildProps({
  27167. cellClassName: { type: definePropType(Function) },
  27168. disabledDate: { type: definePropType(Function) },
  27169. date: {
  27170. type: definePropType(Object),
  27171. required: true
  27172. },
  27173. minDate: { type: definePropType(Object) },
  27174. maxDate: { type: definePropType(Object) },
  27175. parsedValue: { type: definePropType([Object, Array]) },
  27176. rangeState: {
  27177. type: definePropType(Object),
  27178. default: () => ({
  27179. endDate: null,
  27180. selecting: false
  27181. })
  27182. },
  27183. disabled: Boolean
  27184. });
  27185. const panelSharedProps = buildProps({
  27186. type: {
  27187. type: definePropType(String),
  27188. required: true,
  27189. values: datePickTypes
  27190. },
  27191. dateFormat: String,
  27192. timeFormat: String,
  27193. showNow: {
  27194. type: Boolean,
  27195. default: true
  27196. },
  27197. showConfirm: Boolean,
  27198. showFooter: {
  27199. type: Boolean,
  27200. default: true
  27201. },
  27202. showWeekNumber: Boolean,
  27203. border: Boolean,
  27204. disabled: Boolean,
  27205. editable: {
  27206. type: Boolean,
  27207. default: true
  27208. }
  27209. });
  27210. const panelRangeSharedProps = buildProps({
  27211. unlinkPanels: Boolean,
  27212. visible: {
  27213. type: Boolean,
  27214. default: true
  27215. },
  27216. showConfirm: Boolean,
  27217. showFooter: {
  27218. type: Boolean,
  27219. default: true
  27220. },
  27221. border: Boolean,
  27222. disabled: Boolean,
  27223. parsedValue: { type: definePropType(Array) }
  27224. });
  27225. const selectionModeWithDefault = (mode) => {
  27226. return {
  27227. type: String,
  27228. values: selectionModes,
  27229. default: mode
  27230. };
  27231. };
  27232. //#endregion
  27233. //#region ../../packages/components/date-picker-panel/src/props/panel-date-pick.ts
  27234. const panelDatePickProps = buildProps({
  27235. ...panelSharedProps,
  27236. parsedValue: { type: definePropType([Object, Array]) },
  27237. visible: {
  27238. type: Boolean,
  27239. default: true
  27240. },
  27241. format: {
  27242. type: String,
  27243. default: ""
  27244. }
  27245. });
  27246. //#endregion
  27247. //#region ../../packages/components/date-picker-panel/src/utils.ts
  27248. const isValidRange = (range) => {
  27249. if (!isArray$1(range)) return false;
  27250. const [left, right] = range;
  27251. return import_dayjs_min.default.isDayjs(left) && import_dayjs_min.default.isDayjs(right) && (0, import_dayjs_min.default)(left).isValid() && (0, import_dayjs_min.default)(right).isValid() && left.isSameOrBefore(right);
  27252. };
  27253. const getDefaultValue = (defaultValue, { lang, step = 1, unit, unlinkPanels }) => {
  27254. let start;
  27255. if (isArray$1(defaultValue)) {
  27256. let [left, right] = defaultValue.map((d) => (0, import_dayjs_min.default)(d).locale(lang));
  27257. if (!unlinkPanels) right = left.add(step, unit);
  27258. return [left, right];
  27259. } else if (defaultValue) start = (0, import_dayjs_min.default)(defaultValue);
  27260. else start = (0, import_dayjs_min.default)();
  27261. start = start.locale(lang);
  27262. return [start, start.add(step, unit)];
  27263. };
  27264. const buildPickerTable = (dimension, rows, { columnIndexOffset, startDate, nextEndDate, now, unit, relativeDateGetter, setCellMetadata, setRowMetadata }) => {
  27265. for (let rowIndex = 0; rowIndex < dimension.row; rowIndex++) {
  27266. const row = rows[rowIndex];
  27267. for (let columnIndex = 0; columnIndex < dimension.column; columnIndex++) {
  27268. let cell = row[columnIndex + columnIndexOffset];
  27269. if (!cell) cell = {
  27270. row: rowIndex,
  27271. column: columnIndex,
  27272. type: "normal",
  27273. inRange: false,
  27274. start: false,
  27275. end: false
  27276. };
  27277. const nextStartDate = relativeDateGetter(rowIndex * dimension.column + columnIndex);
  27278. cell.dayjs = nextStartDate;
  27279. cell.date = nextStartDate.toDate();
  27280. cell.timestamp = nextStartDate.valueOf();
  27281. cell.type = "normal";
  27282. cell.inRange = !!(startDate && nextStartDate.isSameOrAfter(startDate, unit) && nextEndDate && nextStartDate.isSameOrBefore(nextEndDate, unit)) || !!(startDate && nextStartDate.isSameOrBefore(startDate, unit) && nextEndDate && nextStartDate.isSameOrAfter(nextEndDate, unit));
  27283. if (startDate?.isSameOrAfter(nextEndDate)) {
  27284. cell.start = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  27285. cell.end = startDate && nextStartDate.isSame(startDate, unit);
  27286. } else {
  27287. cell.start = !!startDate && nextStartDate.isSame(startDate, unit);
  27288. cell.end = !!nextEndDate && nextStartDate.isSame(nextEndDate, unit);
  27289. }
  27290. if (nextStartDate.isSame(now, unit)) cell.type = "today";
  27291. setCellMetadata?.(cell, {
  27292. rowIndex,
  27293. columnIndex
  27294. });
  27295. row[columnIndex + columnIndexOffset] = cell;
  27296. }
  27297. setRowMetadata?.(row);
  27298. }
  27299. };
  27300. const datesInMonth = (date, year, month, lang) => {
  27301. const firstDay = (0, import_dayjs_min.default)().locale(lang).startOf("month").month(month).year(year).hour(date.hour()).minute(date.minute()).second(date.second());
  27302. return rangeArr(firstDay.daysInMonth()).map((n) => firstDay.add(n, "day").toDate());
  27303. };
  27304. const getValidDateOfMonth = (date, year, month, lang, disabledDate) => {
  27305. const _value = (0, import_dayjs_min.default)().year(year).month(month).startOf("month").hour(date.hour()).minute(date.minute()).second(date.second());
  27306. const _date = datesInMonth(date, year, month, lang).find((date) => {
  27307. return !disabledDate?.(date);
  27308. });
  27309. if (_date) return (0, import_dayjs_min.default)(_date).locale(lang);
  27310. return _value.locale(lang);
  27311. };
  27312. const getValidDateOfYear = (value, lang, disabledDate) => {
  27313. const year = value.year();
  27314. if (!disabledDate?.(value.toDate())) return value.locale(lang);
  27315. const month = value.month();
  27316. if (!datesInMonth(value, year, month, lang).every(disabledDate)) return getValidDateOfMonth(value, year, month, lang, disabledDate);
  27317. for (let i = 0; i < 12; i++) if (!datesInMonth(value, year, i, lang).every(disabledDate)) return getValidDateOfMonth(value, year, i, lang, disabledDate);
  27318. return value;
  27319. };
  27320. const correctlyParseUserInput = (value, format, lang, defaultFormat) => {
  27321. if (isArray$1(value)) return value.map((v) => correctlyParseUserInput(v, format, lang, defaultFormat));
  27322. if (isString(value)) {
  27323. const dayjsValue = defaultFormat?.value ? (0, import_dayjs_min.default)(value) : (0, import_dayjs_min.default)(value, format);
  27324. if (!dayjsValue.isValid()) return dayjsValue;
  27325. }
  27326. return (0, import_dayjs_min.default)(value, format).locale(lang);
  27327. };
  27328. //#endregion
  27329. //#region ../../packages/components/date-picker-panel/src/props/basic-date-table.ts
  27330. const basicDateTableProps = buildProps({
  27331. ...datePickerSharedProps,
  27332. showWeekNumber: Boolean,
  27333. selectionMode: selectionModeWithDefault("date")
  27334. });
  27335. const basicDateTableEmits = [
  27336. "changerange",
  27337. "pick",
  27338. "select"
  27339. ];
  27340. //#endregion
  27341. //#region ../../packages/components/date-picker-panel/src/composables/use-basic-date-table.ts
  27342. const isNormalDay = (type = "") => {
  27343. return ["normal", "today"].includes(type);
  27344. };
  27345. const useBasicDateTable = (props, emit) => {
  27346. const { lang } = useLocale();
  27347. const tbodyRef = (0, vue.ref)();
  27348. const currentCellRef = (0, vue.ref)();
  27349. const lastRow = (0, vue.ref)();
  27350. const lastColumn = (0, vue.ref)();
  27351. const tableRows = (0, vue.ref)([
  27352. [],
  27353. [],
  27354. [],
  27355. [],
  27356. [],
  27357. []
  27358. ]);
  27359. let focusWithClick = false;
  27360. const firstDayOfWeek = props.date.$locale().weekStart || 7;
  27361. const WEEKS_CONSTANT = props.date.locale("en").localeData().weekdaysShort().map((_) => _.toLowerCase());
  27362. const offsetDay = (0, vue.computed)(() => {
  27363. return firstDayOfWeek > 3 ? 7 - firstDayOfWeek : -firstDayOfWeek;
  27364. });
  27365. const startDate = (0, vue.computed)(() => {
  27366. const startDayOfMonth = props.date.startOf("month");
  27367. return startDayOfMonth.subtract(startDayOfMonth.day() || 7, "day");
  27368. });
  27369. const WEEKS = (0, vue.computed)(() => {
  27370. return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7);
  27371. });
  27372. const hasCurrent = (0, vue.computed)(() => {
  27373. return flatten((0, vue.unref)(rows)).some((row) => {
  27374. return row.isCurrent;
  27375. });
  27376. });
  27377. const days = (0, vue.computed)(() => {
  27378. const startOfMonth = props.date.startOf("month");
  27379. return {
  27380. startOfMonthDay: startOfMonth.day() || 7,
  27381. dateCountOfMonth: startOfMonth.daysInMonth(),
  27382. dateCountOfLastMonth: startOfMonth.subtract(1, "month").daysInMonth()
  27383. };
  27384. });
  27385. const selectedDate = (0, vue.computed)(() => {
  27386. return props.selectionMode === "dates" ? castArray(props.parsedValue) : [];
  27387. });
  27388. const setDateText = (cell, { count, rowIndex, columnIndex }) => {
  27389. const { startOfMonthDay, dateCountOfMonth, dateCountOfLastMonth } = (0, vue.unref)(days);
  27390. const offset = (0, vue.unref)(offsetDay);
  27391. if (rowIndex >= 0 && rowIndex <= 1) {
  27392. const numberOfDaysFromPreviousMonth = startOfMonthDay + offset < 0 ? 7 + startOfMonthDay + offset : startOfMonthDay + offset;
  27393. if (columnIndex + rowIndex * 7 >= numberOfDaysFromPreviousMonth) {
  27394. cell.text = count;
  27395. return true;
  27396. } else {
  27397. cell.text = dateCountOfLastMonth - (numberOfDaysFromPreviousMonth - columnIndex % 7) + 1 + rowIndex * 7;
  27398. cell.type = "prev-month";
  27399. }
  27400. } else {
  27401. if (count <= dateCountOfMonth) cell.text = count;
  27402. else {
  27403. cell.text = count - dateCountOfMonth;
  27404. cell.type = "next-month";
  27405. }
  27406. return true;
  27407. }
  27408. return false;
  27409. };
  27410. const setCellMetadata = (cell, { columnIndex, rowIndex }, count) => {
  27411. const { disabledDate, cellClassName } = props;
  27412. const _selectedDate = (0, vue.unref)(selectedDate);
  27413. const shouldIncrement = setDateText(cell, {
  27414. count,
  27415. rowIndex,
  27416. columnIndex
  27417. });
  27418. const cellDate = cell.dayjs.toDate();
  27419. cell.selected = _selectedDate.find((d) => d.isSame(cell.dayjs, "day"));
  27420. cell.isSelected = !!cell.selected;
  27421. cell.isCurrent = isCurrent(cell);
  27422. cell.disabled = disabledDate?.(cellDate);
  27423. cell.customClass = cellClassName?.(cellDate);
  27424. return shouldIncrement;
  27425. };
  27426. const setRowMetadata = (row) => {
  27427. if (props.selectionMode === "week") {
  27428. const [start, end] = props.showWeekNumber ? [1, 7] : [0, 6];
  27429. const isActive = isWeekActive(row[start + 1]);
  27430. row[start].inRange = isActive;
  27431. row[start].start = isActive;
  27432. row[end].inRange = isActive;
  27433. row[end].end = isActive;
  27434. }
  27435. };
  27436. const rows = (0, vue.computed)(() => {
  27437. const { minDate, maxDate, rangeState, showWeekNumber } = props;
  27438. const offset = (0, vue.unref)(offsetDay);
  27439. const rows_ = (0, vue.unref)(tableRows);
  27440. const dateUnit = "day";
  27441. let count = 1;
  27442. buildPickerTable({
  27443. row: 6,
  27444. column: 7
  27445. }, rows_, {
  27446. startDate: minDate,
  27447. columnIndexOffset: showWeekNumber ? 1 : 0,
  27448. nextEndDate: rangeState.endDate || maxDate || rangeState.selecting && minDate || null,
  27449. now: (0, import_dayjs_min.default)().locale((0, vue.unref)(lang)).startOf(dateUnit),
  27450. unit: dateUnit,
  27451. relativeDateGetter: (idx) => (0, vue.unref)(startDate).add(idx - offset, dateUnit),
  27452. setCellMetadata: (...args) => {
  27453. if (setCellMetadata(...args, count)) count += 1;
  27454. },
  27455. setRowMetadata
  27456. });
  27457. if (showWeekNumber) {
  27458. for (let rowIndex = 0; rowIndex < 6; rowIndex++) if (rows_[rowIndex][1].dayjs) rows_[rowIndex][0] = {
  27459. type: "week",
  27460. text: rows_[rowIndex][1].dayjs.week()
  27461. };
  27462. }
  27463. return rows_;
  27464. });
  27465. (0, vue.watch)(() => props.date, async () => {
  27466. if ((0, vue.unref)(tbodyRef)?.contains(document.activeElement)) {
  27467. await (0, vue.nextTick)();
  27468. await focus();
  27469. }
  27470. });
  27471. const focus = async () => (0, vue.unref)(currentCellRef)?.focus();
  27472. const isCurrent = (cell) => {
  27473. return props.selectionMode === "date" && isNormalDay(cell.type) && cellMatchesDate(cell, props.parsedValue);
  27474. };
  27475. const cellMatchesDate = (cell, date) => {
  27476. if (!date) return false;
  27477. return (0, import_dayjs_min.default)(date).locale((0, vue.unref)(lang)).isSame(props.date.date(Number(cell.text)), "day");
  27478. };
  27479. const getDateOfCell = (row, column) => {
  27480. const startOfMonthDay = (0, vue.unref)(days).startOfMonthDay;
  27481. const offset = (0, vue.unref)(offsetDay);
  27482. const numberOfDaysFromPreviousMonth = startOfMonthDay + offset < 0 ? 7 + startOfMonthDay + offset : startOfMonthDay + offset;
  27483. const offsetFromStart = row * 7 + (column - (props.showWeekNumber ? 1 : 0));
  27484. return props.date.startOf("month").subtract(numberOfDaysFromPreviousMonth, "day").add(offsetFromStart, "day");
  27485. };
  27486. const handleMouseMove = (event) => {
  27487. if (!props.rangeState.selecting) return;
  27488. let target = event.target;
  27489. if (target.tagName === "SPAN") target = target.parentNode?.parentNode;
  27490. if (target.tagName === "DIV") target = target.parentNode;
  27491. if (target.tagName !== "TD") return;
  27492. const row = target.parentNode.rowIndex - 1;
  27493. const column = target.cellIndex;
  27494. if ((0, vue.unref)(rows)[row][column].disabled) return;
  27495. if (row !== (0, vue.unref)(lastRow) || column !== (0, vue.unref)(lastColumn)) {
  27496. lastRow.value = row;
  27497. lastColumn.value = column;
  27498. emit("changerange", {
  27499. selecting: true,
  27500. endDate: getDateOfCell(row, column)
  27501. });
  27502. }
  27503. };
  27504. const isSelectedCell = (cell) => {
  27505. return !(0, vue.unref)(hasCurrent) && cell?.text === 1 && isNormalDay(cell.type) || cell.isCurrent;
  27506. };
  27507. const handleFocus = (event) => {
  27508. if (focusWithClick || (0, vue.unref)(hasCurrent) || props.selectionMode !== "date") return;
  27509. handlePickDate(event, true);
  27510. };
  27511. const handleMouseDown = (event) => {
  27512. if (!event.target.closest("td")) return;
  27513. focusWithClick = true;
  27514. };
  27515. const handleMouseUp = (event) => {
  27516. if (!event.target.closest("td")) return;
  27517. focusWithClick = false;
  27518. };
  27519. const handleRangePick = (newDate) => {
  27520. if (!props.rangeState.selecting || !props.minDate) {
  27521. emit("pick", {
  27522. minDate: newDate,
  27523. maxDate: null
  27524. });
  27525. emit("select", true);
  27526. } else {
  27527. if (newDate >= props.minDate) emit("pick", {
  27528. minDate: props.minDate,
  27529. maxDate: newDate
  27530. });
  27531. else emit("pick", {
  27532. minDate: newDate,
  27533. maxDate: props.minDate
  27534. });
  27535. emit("select", false);
  27536. }
  27537. };
  27538. const handleWeekPick = (newDate) => {
  27539. const weekNumber = newDate.week();
  27540. const value = `${newDate.year()}w${weekNumber}`;
  27541. emit("pick", {
  27542. year: newDate.year(),
  27543. week: weekNumber,
  27544. value,
  27545. date: newDate.startOf("week")
  27546. });
  27547. };
  27548. const handleDatesPick = (newDate, selected) => {
  27549. emit("pick", selected ? castArray(props.parsedValue).filter((d) => d?.valueOf() !== newDate.valueOf()) : castArray(props.parsedValue).concat([newDate]));
  27550. };
  27551. const handlePickDate = (event, isKeyboardMovement = false) => {
  27552. if (props.disabled) return;
  27553. const target = event.target.closest("td");
  27554. if (!target) return;
  27555. const row = target.parentNode.rowIndex - 1;
  27556. const column = target.cellIndex;
  27557. const cell = (0, vue.unref)(rows)[row][column];
  27558. if (cell.disabled || cell.type === "week") return;
  27559. const newDate = getDateOfCell(row, column);
  27560. switch (props.selectionMode) {
  27561. case "range":
  27562. handleRangePick(newDate);
  27563. break;
  27564. case "date":
  27565. emit("pick", newDate, isKeyboardMovement);
  27566. break;
  27567. case "week":
  27568. handleWeekPick(newDate);
  27569. break;
  27570. case "dates":
  27571. handleDatesPick(newDate, !!cell.selected);
  27572. break;
  27573. default: break;
  27574. }
  27575. };
  27576. const isWeekActive = (cell) => {
  27577. if (props.selectionMode !== "week") return false;
  27578. let newDate = props.date.startOf("day");
  27579. if (cell.type === "prev-month") newDate = newDate.subtract(1, "month");
  27580. if (cell.type === "next-month") newDate = newDate.add(1, "month");
  27581. newDate = newDate.date(Number.parseInt(cell.text, 10));
  27582. if (props.parsedValue && !isArray$1(props.parsedValue)) {
  27583. const dayOffset = (props.parsedValue.day() - firstDayOfWeek + 7) % 7 - 1;
  27584. return props.parsedValue.subtract(dayOffset, "day").isSame(newDate, "day");
  27585. }
  27586. return false;
  27587. };
  27588. return {
  27589. WEEKS,
  27590. rows,
  27591. tbodyRef,
  27592. currentCellRef,
  27593. focus,
  27594. isCurrent,
  27595. isWeekActive,
  27596. isSelectedCell,
  27597. handlePickDate,
  27598. handleMouseUp,
  27599. handleMouseDown,
  27600. handleMouseMove,
  27601. handleFocus
  27602. };
  27603. };
  27604. const useBasicDateTableDOM = (props, { isCurrent, isWeekActive }) => {
  27605. const ns = useNamespace("date-table");
  27606. const { t } = useLocale();
  27607. const tableKls = (0, vue.computed)(() => [ns.b(), ns.is("week-mode", props.selectionMode === "week" && !props.disabled)]);
  27608. const tableLabel = (0, vue.computed)(() => t("el.datepicker.dateTablePrompt"));
  27609. const getCellClasses = (cell) => {
  27610. const classes = [];
  27611. if (isNormalDay(cell.type) && !cell.disabled) {
  27612. classes.push("available");
  27613. if (cell.type === "today") classes.push("today");
  27614. } else classes.push(cell.type);
  27615. if (isCurrent(cell)) classes.push("current");
  27616. if (cell.inRange && (isNormalDay(cell.type) || props.selectionMode === "week")) {
  27617. classes.push("in-range");
  27618. if (cell.start) classes.push("start-date");
  27619. if (cell.end) classes.push("end-date");
  27620. }
  27621. if (cell.disabled || props.disabled) classes.push("disabled");
  27622. if (cell.selected) classes.push("selected");
  27623. if (cell.customClass) classes.push(cell.customClass);
  27624. return classes.join(" ");
  27625. };
  27626. const getRowKls = (cell) => [ns.e("row"), { current: isWeekActive(cell) }];
  27627. return {
  27628. tableKls,
  27629. tableLabel,
  27630. weekHeaderClass: ns.e("week-header"),
  27631. getCellClasses,
  27632. getRowKls,
  27633. t
  27634. };
  27635. };
  27636. //#endregion
  27637. //#region ../../packages/components/date-picker-panel/src/props/basic-cell.ts
  27638. const basicCellProps = buildProps({ cell: { type: definePropType(Object) } });
  27639. //#endregion
  27640. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-cell-render.tsx
  27641. var basic_cell_render_default = /* @__PURE__ */ (0, vue.defineComponent)({
  27642. name: "ElDatePickerCell",
  27643. props: basicCellProps,
  27644. setup(props) {
  27645. const ns = useNamespace("date-table-cell");
  27646. const { slots } = (0, vue.inject)(ROOT_PICKER_INJECTION_KEY);
  27647. return () => {
  27648. const { cell } = props;
  27649. return (0, vue.renderSlot)(slots, "default", { ...cell }, () => [(0, vue.createVNode)("div", { "class": ns.b() }, [(0, vue.createVNode)("span", { "class": ns.e("text") }, [cell?.renderText ?? cell?.text])])]);
  27650. };
  27651. }
  27652. });
  27653. //#endregion
  27654. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-date-table.vue?vue&type=script&setup=true&lang.ts
  27655. const _hoisted_1$50 = ["aria-label"];
  27656. const _hoisted_2$32 = ["aria-label"];
  27657. const _hoisted_3$15 = [
  27658. "aria-current",
  27659. "aria-selected",
  27660. "tabindex",
  27661. "aria-disabled"
  27662. ];
  27663. var basic_date_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  27664. __name: "basic-date-table",
  27665. props: basicDateTableProps,
  27666. emits: basicDateTableEmits,
  27667. setup(__props, { expose: __expose, emit: __emit }) {
  27668. const props = __props;
  27669. const { WEEKS, rows, tbodyRef, currentCellRef, focus, isCurrent, isWeekActive, isSelectedCell, handlePickDate, handleMouseUp, handleMouseDown, handleMouseMove, handleFocus } = useBasicDateTable(props, __emit);
  27670. const { tableLabel, tableKls, getCellClasses, getRowKls, weekHeaderClass, t } = useBasicDateTableDOM(props, {
  27671. isCurrent,
  27672. isWeekActive
  27673. });
  27674. let isUnmounting = false;
  27675. (0, vue.onBeforeUnmount)(() => {
  27676. isUnmounting = true;
  27677. });
  27678. __expose({ focus });
  27679. return (_ctx, _cache) => {
  27680. return (0, vue.openBlock)(), (0, vue.createElementBlock)("table", {
  27681. "aria-label": (0, vue.unref)(tableLabel),
  27682. class: (0, vue.normalizeClass)((0, vue.unref)(tableKls)),
  27683. cellspacing: "0",
  27684. cellpadding: "0",
  27685. role: "grid",
  27686. onClick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handlePickDate) && (0, vue.unref)(handlePickDate)(...args)),
  27687. onMousemove: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(handleMouseMove) && (0, vue.unref)(handleMouseMove)(...args)),
  27688. onMousedown: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(handleMouseDown) && (0, vue.unref)(handleMouseDown)(...args)),
  27689. onMouseup: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(handleMouseUp) && (0, vue.unref)(handleMouseUp)(...args))
  27690. }, [(0, vue.createElementVNode)("tbody", {
  27691. ref_key: "tbodyRef",
  27692. ref: tbodyRef
  27693. }, [(0, vue.createElementVNode)("tr", null, [_ctx.showWeekNumber ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
  27694. key: 0,
  27695. scope: "col",
  27696. class: (0, vue.normalizeClass)((0, vue.unref)(weekHeaderClass))
  27697. }, null, 2)) : (0, vue.createCommentVNode)("v-if", true), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(WEEKS), (week, key) => {
  27698. return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
  27699. key,
  27700. "aria-label": (0, vue.unref)(t)("el.datepicker.weeksFull." + week),
  27701. scope: "col"
  27702. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.weeks." + week)), 9, _hoisted_2$32);
  27703. }), 128))]), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(rows), (row, rowKey) => {
  27704. return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
  27705. key: rowKey,
  27706. class: (0, vue.normalizeClass)((0, vue.unref)(getRowKls)(_ctx.showWeekNumber ? row[2] : row[1]))
  27707. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(row, (cell, columnKey) => {
  27708. return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
  27709. key: `${rowKey}.${columnKey}`,
  27710. ref_for: true,
  27711. ref: (el) => !(0, vue.unref)(isUnmounting) && (0, vue.unref)(isSelectedCell)(cell) && (currentCellRef.value = el),
  27712. class: (0, vue.normalizeClass)((0, vue.unref)(getCellClasses)(cell)),
  27713. "aria-current": cell.isCurrent ? "date" : void 0,
  27714. "aria-selected": cell.isCurrent,
  27715. tabindex: _ctx.disabled ? void 0 : (0, vue.unref)(isSelectedCell)(cell) ? 0 : -1,
  27716. "aria-disabled": _ctx.disabled,
  27717. onFocus: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleFocus) && (0, vue.unref)(handleFocus)(...args))
  27718. }, [(0, vue.createVNode)((0, vue.unref)(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_3$15);
  27719. }), 128))], 2);
  27720. }), 128))], 512)], 42, _hoisted_1$50);
  27721. };
  27722. }
  27723. });
  27724. //#endregion
  27725. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-date-table.vue
  27726. var basic_date_table_default = basic_date_table_vue_vue_type_script_setup_true_lang_default;
  27727. //#endregion
  27728. //#region ../../packages/components/date-picker-panel/src/props/basic-month-table.ts
  27729. const basicMonthTableProps = buildProps({
  27730. ...datePickerSharedProps,
  27731. selectionMode: selectionModeWithDefault("month")
  27732. });
  27733. //#endregion
  27734. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-month-table.vue?vue&type=script&setup=true&lang.ts
  27735. const _hoisted_1$49 = ["aria-label"];
  27736. const _hoisted_2$31 = [
  27737. "aria-selected",
  27738. "aria-label",
  27739. "tabindex",
  27740. "onKeydown"
  27741. ];
  27742. var basic_month_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  27743. __name: "basic-month-table",
  27744. props: basicMonthTableProps,
  27745. emits: [
  27746. "changerange",
  27747. "pick",
  27748. "select"
  27749. ],
  27750. setup(__props, { expose: __expose, emit: __emit }) {
  27751. const props = __props;
  27752. const emit = __emit;
  27753. const ns = useNamespace("month-table");
  27754. const { t, lang } = useLocale();
  27755. const tbodyRef = (0, vue.ref)();
  27756. const currentCellRef = (0, vue.ref)();
  27757. const months = (0, vue.ref)(props.date.locale("en").localeData().monthsShort().map((_) => _.toLowerCase()));
  27758. const tableRows = (0, vue.ref)([
  27759. [],
  27760. [],
  27761. []
  27762. ]);
  27763. const lastRow = (0, vue.ref)();
  27764. const lastColumn = (0, vue.ref)();
  27765. const rows = (0, vue.computed)(() => {
  27766. const rows = tableRows.value;
  27767. const now = (0, import_dayjs_min.default)().locale(lang.value).startOf("month");
  27768. for (let i = 0; i < 3; i++) {
  27769. const row = rows[i];
  27770. for (let j = 0; j < 4; j++) {
  27771. const cell = row[j] ||= {
  27772. row: i,
  27773. column: j,
  27774. type: "normal",
  27775. inRange: false,
  27776. start: false,
  27777. end: false,
  27778. text: -1,
  27779. disabled: false,
  27780. isSelected: false,
  27781. customClass: void 0,
  27782. date: void 0,
  27783. dayjs: void 0,
  27784. isCurrent: void 0,
  27785. selected: void 0,
  27786. renderText: void 0,
  27787. timestamp: void 0
  27788. };
  27789. cell.type = "normal";
  27790. const index = i * 4 + j;
  27791. const calTime = props.date.startOf("year").month(index);
  27792. const calEndDate = props.rangeState.endDate || props.maxDate || props.rangeState.selecting && props.minDate || null;
  27793. 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"));
  27794. if (props.minDate?.isSameOrAfter(calEndDate)) {
  27795. cell.start = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  27796. cell.end = props.minDate && calTime.isSame(props.minDate, "month");
  27797. } else {
  27798. cell.start = !!(props.minDate && calTime.isSame(props.minDate, "month"));
  27799. cell.end = !!(calEndDate && calTime.isSame(calEndDate, "month"));
  27800. }
  27801. if (now.isSame(calTime)) cell.type = "today";
  27802. const cellDate = calTime.toDate();
  27803. cell.text = index;
  27804. cell.disabled = props.disabledDate?.(cellDate) || false;
  27805. cell.date = cellDate;
  27806. cell.customClass = props.cellClassName?.(cellDate);
  27807. cell.dayjs = calTime;
  27808. cell.timestamp = calTime.valueOf();
  27809. cell.isSelected = isSelectedCell(cell);
  27810. }
  27811. }
  27812. return rows;
  27813. });
  27814. const focus = () => {
  27815. currentCellRef.value?.focus();
  27816. };
  27817. const getCellStyle = (cell) => {
  27818. const style = {};
  27819. const year = props.date.year();
  27820. const today = /* @__PURE__ */ new Date();
  27821. const month = cell.text;
  27822. style.disabled = props.disabled || (props.disabledDate ? datesInMonth(props.date, year, month, lang.value).every(props.disabledDate) : false);
  27823. style.current = castArray(props.parsedValue).some((date) => import_dayjs_min.default.isDayjs(date) && date.year() === year && date.month() === month);
  27824. style.today = today.getFullYear() === year && today.getMonth() === month;
  27825. if (cell.customClass) style[cell.customClass] = true;
  27826. if (cell.inRange) {
  27827. style["in-range"] = true;
  27828. if (cell.start) style["start-date"] = true;
  27829. if (cell.end) style["end-date"] = true;
  27830. }
  27831. return style;
  27832. };
  27833. const isSelectedCell = (cell) => {
  27834. const year = props.date.year();
  27835. const month = cell.text;
  27836. return castArray(props.date).some((date) => date.year() === year && date.month() === month);
  27837. };
  27838. const handleMouseMove = (event) => {
  27839. if (!props.rangeState.selecting) return;
  27840. let target = event.target;
  27841. if (target.tagName === "SPAN") target = target.parentNode?.parentNode;
  27842. if (target.tagName === "DIV") target = target.parentNode;
  27843. if (target.tagName !== "TD") return;
  27844. const row = target.parentNode.rowIndex;
  27845. const column = target.cellIndex;
  27846. if (rows.value[row][column].disabled) return;
  27847. if (row !== lastRow.value || column !== lastColumn.value) {
  27848. lastRow.value = row;
  27849. lastColumn.value = column;
  27850. emit("changerange", {
  27851. selecting: true,
  27852. endDate: props.date.startOf("year").month(row * 4 + column)
  27853. });
  27854. }
  27855. };
  27856. const handleMonthTableClick = (event) => {
  27857. if (props.disabled) return;
  27858. const target = event.target?.closest("td");
  27859. if (target?.tagName !== "TD") return;
  27860. if (hasClass(target, "disabled")) return;
  27861. const column = target.cellIndex;
  27862. const month = target.parentNode.rowIndex * 4 + column;
  27863. const newDate = props.date.startOf("year").month(month);
  27864. if (props.selectionMode === "months") {
  27865. if (event.type === "keydown") {
  27866. emit("pick", castArray(props.parsedValue), false);
  27867. return;
  27868. }
  27869. const newMonth = getValidDateOfMonth(props.date, props.date.year(), month, lang.value, props.disabledDate);
  27870. emit("pick", hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => d?.year() !== newMonth.year() || d?.month() !== newMonth.month()) : castArray(props.parsedValue).concat([(0, import_dayjs_min.default)(newMonth)]));
  27871. } else if (props.selectionMode === "range") if (!props.rangeState.selecting) {
  27872. emit("pick", {
  27873. minDate: newDate,
  27874. maxDate: null
  27875. });
  27876. emit("select", true);
  27877. } else {
  27878. if (props.minDate && newDate >= props.minDate) emit("pick", {
  27879. minDate: props.minDate,
  27880. maxDate: newDate
  27881. });
  27882. else emit("pick", {
  27883. minDate: newDate,
  27884. maxDate: props.minDate
  27885. });
  27886. emit("select", false);
  27887. }
  27888. else emit("pick", month);
  27889. };
  27890. (0, vue.watch)(() => props.date, async () => {
  27891. if (tbodyRef.value?.contains(document.activeElement)) {
  27892. await (0, vue.nextTick)();
  27893. currentCellRef.value?.focus();
  27894. }
  27895. });
  27896. __expose({ focus });
  27897. return (_ctx, _cache) => {
  27898. return (0, vue.openBlock)(), (0, vue.createElementBlock)("table", {
  27899. role: "grid",
  27900. "aria-label": (0, vue.unref)(t)("el.datepicker.monthTablePrompt"),
  27901. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  27902. onClick: handleMonthTableClick,
  27903. onMousemove: handleMouseMove
  27904. }, [(0, vue.createElementVNode)("tbody", {
  27905. ref_key: "tbodyRef",
  27906. ref: tbodyRef
  27907. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(rows.value, (row, key) => {
  27908. return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", { key }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(row, (cell, key_) => {
  27909. return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
  27910. key: key_,
  27911. ref_for: true,
  27912. ref: (el) => cell.isSelected && (currentCellRef.value = el),
  27913. class: (0, vue.normalizeClass)(getCellStyle(cell)),
  27914. "aria-selected": !!cell.isSelected,
  27915. "aria-label": (0, vue.unref)(t)(`el.datepicker.month${+cell.text + 1}`),
  27916. tabindex: cell.isSelected ? 0 : -1,
  27917. onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(handleMonthTableClick, ["prevent", "stop"]), ["space"]), (0, vue.withKeys)((0, vue.withModifiers)(handleMonthTableClick, ["prevent", "stop"]), ["enter"])]
  27918. }, [(0, vue.createVNode)((0, vue.unref)(basic_cell_render_default), { cell: {
  27919. ...cell,
  27920. renderText: (0, vue.unref)(t)("el.datepicker.months." + months.value[cell.text])
  27921. } }, null, 8, ["cell"])], 42, _hoisted_2$31);
  27922. }), 128))]);
  27923. }), 128))], 512)], 42, _hoisted_1$49);
  27924. };
  27925. }
  27926. });
  27927. //#endregion
  27928. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-month-table.vue
  27929. var basic_month_table_default = basic_month_table_vue_vue_type_script_setup_true_lang_default;
  27930. //#endregion
  27931. //#region ../../packages/components/date-picker-panel/src/props/basic-year-table.ts
  27932. const basicYearTableProps = buildProps({
  27933. ...datePickerSharedProps,
  27934. selectionMode: selectionModeWithDefault("year")
  27935. });
  27936. //#endregion
  27937. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-year-table.vue?vue&type=script&setup=true&lang.ts
  27938. const _hoisted_1$48 = ["aria-label"];
  27939. const _hoisted_2$30 = [
  27940. "aria-selected",
  27941. "aria-label",
  27942. "tabindex",
  27943. "onKeydown"
  27944. ];
  27945. var basic_year_table_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  27946. __name: "basic-year-table",
  27947. props: basicYearTableProps,
  27948. emits: [
  27949. "changerange",
  27950. "pick",
  27951. "select"
  27952. ],
  27953. setup(__props, { expose: __expose, emit: __emit }) {
  27954. const datesInYear = (year, lang) => {
  27955. const firstDay = (0, import_dayjs_min.default)(String(year)).locale(lang).startOf("year");
  27956. return rangeArr(firstDay.endOf("year").dayOfYear()).map((n) => firstDay.add(n, "day").toDate());
  27957. };
  27958. const props = __props;
  27959. const emit = __emit;
  27960. const ns = useNamespace("year-table");
  27961. const { t, lang } = useLocale();
  27962. const tbodyRef = (0, vue.ref)();
  27963. const currentCellRef = (0, vue.ref)();
  27964. const startYear = (0, vue.computed)(() => {
  27965. return Math.floor(props.date.year() / 10) * 10;
  27966. });
  27967. const tableRows = (0, vue.ref)([
  27968. [],
  27969. [],
  27970. []
  27971. ]);
  27972. const lastRow = (0, vue.ref)();
  27973. const lastColumn = (0, vue.ref)();
  27974. const rows = (0, vue.computed)(() => {
  27975. const rows = tableRows.value;
  27976. const now = (0, import_dayjs_min.default)().locale(lang.value).startOf("year");
  27977. for (let i = 0; i < 3; i++) {
  27978. const row = rows[i];
  27979. for (let j = 0; j < 4; j++) {
  27980. if (i * 4 + j >= 10) break;
  27981. let cell = row[j];
  27982. if (!cell) cell = {
  27983. row: i,
  27984. column: j,
  27985. type: "normal",
  27986. inRange: false,
  27987. start: false,
  27988. end: false,
  27989. text: -1,
  27990. disabled: false,
  27991. isSelected: false,
  27992. customClass: void 0,
  27993. date: void 0,
  27994. dayjs: void 0,
  27995. isCurrent: void 0,
  27996. selected: void 0,
  27997. renderText: void 0,
  27998. timestamp: void 0
  27999. };
  28000. cell.type = "normal";
  28001. const index = i * 4 + j + startYear.value;
  28002. const calTime = (0, import_dayjs_min.default)().year(index);
  28003. const calEndDate = props.rangeState.endDate || props.maxDate || props.rangeState.selecting && props.minDate || null;
  28004. cell.inRange = !!(props.minDate && calTime.isSameOrAfter(props.minDate, "year") && calEndDate && calTime.isSameOrBefore(calEndDate, "year")) || !!(props.minDate && calTime.isSameOrBefore(props.minDate, "year") && calEndDate && calTime.isSameOrAfter(calEndDate, "year"));
  28005. if (props.minDate?.isSameOrAfter(calEndDate)) {
  28006. cell.start = !!(calEndDate && calTime.isSame(calEndDate, "year"));
  28007. cell.end = !!(props.minDate && calTime.isSame(props.minDate, "year"));
  28008. } else {
  28009. cell.start = !!(props.minDate && calTime.isSame(props.minDate, "year"));
  28010. cell.end = !!(calEndDate && calTime.isSame(calEndDate, "year"));
  28011. }
  28012. if (now.isSame(calTime)) cell.type = "today";
  28013. cell.text = index;
  28014. const cellDate = calTime.toDate();
  28015. cell.disabled = props.disabledDate?.(cellDate) || false;
  28016. cell.date = cellDate;
  28017. cell.customClass = props.cellClassName?.(cellDate);
  28018. cell.dayjs = calTime;
  28019. cell.timestamp = calTime.valueOf();
  28020. cell.isSelected = isSelectedCell(cell);
  28021. row[j] = cell;
  28022. }
  28023. }
  28024. return rows;
  28025. });
  28026. const focus = () => {
  28027. currentCellRef.value?.focus();
  28028. };
  28029. const getCellKls = (cell) => {
  28030. const kls = {};
  28031. const today = (0, import_dayjs_min.default)().locale(lang.value);
  28032. const year = cell.text;
  28033. kls.disabled = props.disabled || (props.disabledDate ? datesInYear(year, lang.value).every(props.disabledDate) : false);
  28034. kls.today = today.year() === year;
  28035. kls.current = castArray(props.parsedValue).some((d) => d.year() === year);
  28036. if (cell.customClass) kls[cell.customClass] = true;
  28037. if (cell.inRange) {
  28038. kls["in-range"] = true;
  28039. if (cell.start) kls["start-date"] = true;
  28040. if (cell.end) kls["end-date"] = true;
  28041. }
  28042. return kls;
  28043. };
  28044. const isSelectedCell = (cell) => {
  28045. const year = cell.text;
  28046. return castArray(props.date).some((date) => date.year() === year);
  28047. };
  28048. const handleYearTableClick = (event) => {
  28049. if (props.disabled) return;
  28050. const target = event.target?.closest("td");
  28051. if (!target || !target.textContent || hasClass(target, "disabled")) return;
  28052. const column = target.cellIndex;
  28053. const selectedYear = target.parentNode.rowIndex * 4 + column + startYear.value;
  28054. const newDate = (0, import_dayjs_min.default)().year(selectedYear);
  28055. if (props.selectionMode === "range") if (!props.rangeState.selecting) {
  28056. emit("pick", {
  28057. minDate: newDate,
  28058. maxDate: null
  28059. });
  28060. emit("select", true);
  28061. } else {
  28062. if (props.minDate && newDate >= props.minDate) emit("pick", {
  28063. minDate: props.minDate,
  28064. maxDate: newDate
  28065. });
  28066. else emit("pick", {
  28067. minDate: newDate,
  28068. maxDate: props.minDate
  28069. });
  28070. emit("select", false);
  28071. }
  28072. else if (props.selectionMode === "years") {
  28073. if (event.type === "keydown") {
  28074. emit("pick", castArray(props.parsedValue), false);
  28075. return;
  28076. }
  28077. const vaildYear = getValidDateOfYear(newDate.startOf("year"), lang.value, props.disabledDate);
  28078. emit("pick", hasClass(target, "current") ? castArray(props.parsedValue).filter((d) => d?.year() !== selectedYear) : castArray(props.parsedValue).concat([vaildYear]));
  28079. } else emit("pick", selectedYear);
  28080. };
  28081. const handleMouseMove = (event) => {
  28082. if (!props.rangeState.selecting) return;
  28083. const target = event.target?.closest("td");
  28084. if (!target) return;
  28085. const row = target.parentNode.rowIndex;
  28086. const column = target.cellIndex;
  28087. if (rows.value[row][column].disabled) return;
  28088. if (row !== lastRow.value || column !== lastColumn.value) {
  28089. lastRow.value = row;
  28090. lastColumn.value = column;
  28091. emit("changerange", {
  28092. selecting: true,
  28093. endDate: (0, import_dayjs_min.default)().year(startYear.value).add(row * 4 + column, "year")
  28094. });
  28095. }
  28096. };
  28097. (0, vue.watch)(() => props.date, async () => {
  28098. if (tbodyRef.value?.contains(document.activeElement)) {
  28099. await (0, vue.nextTick)();
  28100. currentCellRef.value?.focus();
  28101. }
  28102. });
  28103. __expose({ focus });
  28104. return (_ctx, _cache) => {
  28105. return (0, vue.openBlock)(), (0, vue.createElementBlock)("table", {
  28106. role: "grid",
  28107. "aria-label": (0, vue.unref)(t)("el.datepicker.yearTablePrompt"),
  28108. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  28109. onClick: handleYearTableClick,
  28110. onMousemove: handleMouseMove
  28111. }, [(0, vue.createElementVNode)("tbody", {
  28112. ref_key: "tbodyRef",
  28113. ref: tbodyRef
  28114. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(rows.value, (row, rowKey) => {
  28115. return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", { key: rowKey }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(row, (cell, cellKey) => {
  28116. return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
  28117. key: `${rowKey}_${cellKey}`,
  28118. ref_for: true,
  28119. ref: (el) => cell.isSelected && (currentCellRef.value = el),
  28120. class: (0, vue.normalizeClass)(["available", getCellKls(cell)]),
  28121. "aria-selected": cell.isSelected,
  28122. "aria-label": String(cell.text),
  28123. tabindex: cell.isSelected ? 0 : -1,
  28124. onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(handleYearTableClick, ["prevent", "stop"]), ["space"]), (0, vue.withKeys)((0, vue.withModifiers)(handleYearTableClick, ["prevent", "stop"]), ["enter"])]
  28125. }, [(0, vue.createVNode)((0, vue.unref)(basic_cell_render_default), { cell }, null, 8, ["cell"])], 42, _hoisted_2$30);
  28126. }), 128))]);
  28127. }), 128))], 512)], 42, _hoisted_1$48);
  28128. };
  28129. }
  28130. });
  28131. //#endregion
  28132. //#region ../../packages/components/date-picker-panel/src/date-picker-com/basic-year-table.vue
  28133. var basic_year_table_default = basic_year_table_vue_vue_type_script_setup_true_lang_default;
  28134. //#endregion
  28135. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue?vue&type=script&setup=true&lang.ts
  28136. const _hoisted_1$47 = ["disabled", "onClick"];
  28137. const _hoisted_2$29 = ["aria-label", "disabled"];
  28138. const _hoisted_3$14 = ["aria-label", "disabled"];
  28139. const _hoisted_4$11 = ["tabindex", "aria-disabled"];
  28140. const _hoisted_5$8 = ["tabindex", "aria-disabled"];
  28141. const _hoisted_6$3 = ["aria-label", "disabled"];
  28142. const _hoisted_7$2 = ["aria-label", "disabled"];
  28143. var panel_date_pick_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  28144. __name: "panel-date-pick",
  28145. props: panelDatePickProps,
  28146. emits: [
  28147. "pick",
  28148. "set-picker-option",
  28149. "panel-change"
  28150. ],
  28151. setup(__props, { emit: __emit }) {
  28152. const timeWithinRange = (_, __, ___) => true;
  28153. const props = __props;
  28154. const contextEmit = __emit;
  28155. const ppNs = useNamespace("picker-panel");
  28156. const dpNs = useNamespace("date-picker");
  28157. const attrs = (0, vue.useAttrs)();
  28158. const slots = (0, vue.useSlots)();
  28159. const { t, lang } = useLocale();
  28160. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  28161. const isDefaultFormat = (0, vue.inject)(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  28162. const { shortcuts, disabledDate, cellClassName, defaultTime } = pickerBase.props;
  28163. const defaultValue = (0, vue.toRef)(pickerBase.props, "defaultValue");
  28164. const currentViewRef = (0, vue.ref)();
  28165. const innerDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value));
  28166. const isChangeToNow = (0, vue.ref)(false);
  28167. let isShortcut = false;
  28168. const defaultTimeD = (0, vue.computed)(() => {
  28169. return (0, import_dayjs_min.default)(defaultTime).locale(lang.value);
  28170. });
  28171. const month = (0, vue.computed)(() => {
  28172. return innerDate.value.month();
  28173. });
  28174. const year = (0, vue.computed)(() => {
  28175. return innerDate.value.year();
  28176. });
  28177. const selectableRange = (0, vue.ref)([]);
  28178. const userInputDate = (0, vue.ref)(null);
  28179. const userInputTime = (0, vue.ref)(null);
  28180. const checkDateWithinRange = (date) => {
  28181. return selectableRange.value.length > 0 ? timeWithinRange(date, selectableRange.value, props.format || "HH:mm:ss") : true;
  28182. };
  28183. const formatEmit = (emitDayjs) => {
  28184. if (defaultTime && !visibleTime.value && !isChangeToNow.value && !isShortcut) return defaultTimeD.value.year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  28185. if (showTime.value) return emitDayjs.millisecond(0);
  28186. return emitDayjs.startOf("day");
  28187. };
  28188. const emit = (value, ...args) => {
  28189. if (!value) contextEmit("pick", value, ...args);
  28190. else if (isArray$1(value)) contextEmit("pick", value.map(formatEmit), ...args);
  28191. else contextEmit("pick", formatEmit(value), ...args);
  28192. userInputDate.value = null;
  28193. userInputTime.value = null;
  28194. isChangeToNow.value = false;
  28195. isShortcut = false;
  28196. };
  28197. const handleDatePick = async (value, keepOpen) => {
  28198. if (selectionMode.value === "date" && import_dayjs_min.default.isDayjs(value)) {
  28199. const parsedDateValue = extractFirst(props.parsedValue);
  28200. let newDate = parsedDateValue ? parsedDateValue.year(value.year()).month(value.month()).date(value.date()) : value;
  28201. if (!checkDateWithinRange(newDate)) newDate = selectableRange.value[0][0].year(value.year()).month(value.month()).date(value.date());
  28202. innerDate.value = newDate;
  28203. emit(newDate, showTime.value || keepOpen);
  28204. } else if (selectionMode.value === "week") emit(value.date);
  28205. else if (selectionMode.value === "dates") emit(value, true);
  28206. };
  28207. const moveByMonth = (forward) => {
  28208. const action = forward ? "add" : "subtract";
  28209. innerDate.value = innerDate.value[action](1, "month");
  28210. handlePanelChange("month");
  28211. };
  28212. const moveByYear = (forward) => {
  28213. const currentDate = innerDate.value;
  28214. const action = forward ? "add" : "subtract";
  28215. innerDate.value = currentView.value === "year" ? currentDate[action](10, "year") : currentDate[action](1, "year");
  28216. handlePanelChange("year");
  28217. };
  28218. const currentView = (0, vue.ref)("date");
  28219. const yearLabel = (0, vue.computed)(() => {
  28220. const yearTranslation = t("el.datepicker.year");
  28221. if (currentView.value === "year") {
  28222. const startYear = Math.floor(year.value / 10) * 10;
  28223. if (yearTranslation) return `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}`;
  28224. return `${startYear} - ${startYear + 9}`;
  28225. }
  28226. return `${year.value} ${yearTranslation}`;
  28227. });
  28228. const handleShortcutClick = (shortcut) => {
  28229. const shortcutValue = isFunction$1(shortcut.value) ? shortcut.value() : shortcut.value;
  28230. if (shortcutValue) {
  28231. isShortcut = true;
  28232. emit((0, import_dayjs_min.default)(shortcutValue).locale(lang.value));
  28233. return;
  28234. }
  28235. if (shortcut.onClick) shortcut.onClick({
  28236. attrs,
  28237. slots,
  28238. emit: contextEmit
  28239. });
  28240. };
  28241. const selectionMode = (0, vue.computed)(() => {
  28242. const { type } = props;
  28243. if ([
  28244. "week",
  28245. "month",
  28246. "months",
  28247. "year",
  28248. "years",
  28249. "dates"
  28250. ].includes(type)) return type;
  28251. return "date";
  28252. });
  28253. const isMultipleType = (0, vue.computed)(() => {
  28254. return selectionMode.value === "dates" || selectionMode.value === "months" || selectionMode.value === "years";
  28255. });
  28256. const keyboardMode = (0, vue.computed)(() => {
  28257. return selectionMode.value === "date" ? currentView.value : selectionMode.value;
  28258. });
  28259. const hasShortcuts = (0, vue.computed)(() => !!shortcuts.length);
  28260. const handleMonthPick = async (month, keepOpen) => {
  28261. if (selectionMode.value === "month") {
  28262. innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month, lang.value, disabledDate);
  28263. emit(innerDate.value, false);
  28264. } else if (selectionMode.value === "months") emit(month, keepOpen ?? true);
  28265. else {
  28266. innerDate.value = getValidDateOfMonth(innerDate.value, innerDate.value.year(), month, lang.value, disabledDate);
  28267. currentView.value = "date";
  28268. if ([
  28269. "month",
  28270. "year",
  28271. "date",
  28272. "week"
  28273. ].includes(selectionMode.value)) {
  28274. emit(innerDate.value, true);
  28275. await (0, vue.nextTick)();
  28276. handleFocusPicker();
  28277. }
  28278. }
  28279. handlePanelChange("month");
  28280. };
  28281. const handleYearPick = async (year, keepOpen) => {
  28282. if (selectionMode.value === "year") {
  28283. innerDate.value = getValidDateOfYear(innerDate.value.startOf("year").year(year), lang.value, disabledDate);
  28284. emit(innerDate.value, false);
  28285. } else if (selectionMode.value === "years") emit(year, keepOpen ?? true);
  28286. else {
  28287. innerDate.value = getValidDateOfYear(innerDate.value.year(year), lang.value, disabledDate);
  28288. currentView.value = "month";
  28289. if ([
  28290. "month",
  28291. "year",
  28292. "date",
  28293. "week"
  28294. ].includes(selectionMode.value)) {
  28295. emit(innerDate.value, true);
  28296. await (0, vue.nextTick)();
  28297. handleFocusPicker();
  28298. }
  28299. }
  28300. handlePanelChange("year");
  28301. };
  28302. const dateDisabled = useFormDisabled();
  28303. const showPicker = async (view) => {
  28304. if (dateDisabled.value) return;
  28305. currentView.value = view;
  28306. await (0, vue.nextTick)();
  28307. handleFocusPicker();
  28308. };
  28309. const showTime = (0, vue.computed)(() => props.type === "datetime" || props.type === "datetimerange");
  28310. const footerVisible = (0, vue.computed)(() => {
  28311. const showDateFooter = showTime.value || selectionMode.value === "dates";
  28312. const showYearFooter = selectionMode.value === "years";
  28313. const showMonthFooter = selectionMode.value === "months";
  28314. const isDateView = currentView.value === "date";
  28315. const isYearView = currentView.value === "year";
  28316. const isMonthView = currentView.value === "month";
  28317. return showDateFooter && isDateView || showYearFooter && isYearView || showMonthFooter && isMonthView;
  28318. });
  28319. const footerFilled = (0, vue.computed)(() => !isMultipleType.value && props.showNow || props.showConfirm);
  28320. const disabledConfirm = (0, vue.computed)(() => {
  28321. if (!disabledDate) return false;
  28322. if (!props.parsedValue) return true;
  28323. if (isArray$1(props.parsedValue)) return disabledDate(props.parsedValue[0].toDate());
  28324. return disabledDate(props.parsedValue.toDate());
  28325. });
  28326. const onConfirm = () => {
  28327. if (isMultipleType.value) emit(props.parsedValue);
  28328. else {
  28329. let result = extractFirst(props.parsedValue);
  28330. if (!result) {
  28331. const defaultTimeD = (0, import_dayjs_min.default)(defaultTime).locale(lang.value);
  28332. const defaultValueD = getDefaultValue();
  28333. result = defaultTimeD.year(defaultValueD.year()).month(defaultValueD.month()).date(defaultValueD.date());
  28334. }
  28335. innerDate.value = result;
  28336. emit(result);
  28337. }
  28338. };
  28339. const disabledNow = (0, vue.computed)(() => {
  28340. if (!disabledDate) return false;
  28341. return disabledDate((0, import_dayjs_min.default)().locale(lang.value).toDate());
  28342. });
  28343. const changeToNow = () => {
  28344. const nowDate = (0, import_dayjs_min.default)().locale(lang.value).toDate();
  28345. isChangeToNow.value = true;
  28346. if ((!disabledDate || !disabledDate(nowDate)) && checkDateWithinRange(nowDate)) {
  28347. innerDate.value = (0, import_dayjs_min.default)().locale(lang.value);
  28348. emit(innerDate.value);
  28349. }
  28350. };
  28351. const timeFormat = (0, vue.computed)(() => {
  28352. return props.timeFormat || extractTimeFormat(props.format) || DEFAULT_FORMATS_TIME;
  28353. });
  28354. const dateFormat = (0, vue.computed)(() => {
  28355. return props.dateFormat || extractDateFormat(props.format) || DEFAULT_FORMATS_DATE;
  28356. });
  28357. const visibleTime = (0, vue.computed)(() => {
  28358. if (userInputTime.value) return userInputTime.value;
  28359. if (!props.parsedValue && !defaultValue.value) return;
  28360. return (extractFirst(props.parsedValue) || innerDate.value).format(timeFormat.value);
  28361. });
  28362. const visibleDate = (0, vue.computed)(() => {
  28363. if (userInputDate.value) return userInputDate.value;
  28364. if (!props.parsedValue && !defaultValue.value) return;
  28365. return (extractFirst(props.parsedValue) || innerDate.value).format(dateFormat.value);
  28366. });
  28367. const timePickerVisible = (0, vue.ref)(false);
  28368. const onTimePickerInputFocus = () => {
  28369. timePickerVisible.value = true;
  28370. };
  28371. const handleTimePickClose = () => {
  28372. timePickerVisible.value = false;
  28373. };
  28374. const getUnits = (date) => {
  28375. return {
  28376. hour: date.hour(),
  28377. minute: date.minute(),
  28378. second: date.second(),
  28379. year: date.year(),
  28380. month: date.month(),
  28381. date: date.date()
  28382. };
  28383. };
  28384. const handleTimePick = (value, visible, first) => {
  28385. const { hour, minute, second } = getUnits(value);
  28386. const parsedDateValue = extractFirst(props.parsedValue);
  28387. innerDate.value = parsedDateValue ? parsedDateValue.hour(hour).minute(minute).second(second) : value;
  28388. emit(innerDate.value, true);
  28389. if (!first) timePickerVisible.value = visible;
  28390. };
  28391. const handleVisibleTimeChange = (value) => {
  28392. const newDate = (0, import_dayjs_min.default)(value, timeFormat.value).locale(lang.value);
  28393. if (newDate.isValid() && checkDateWithinRange(newDate)) {
  28394. const { year, month, date } = getUnits(innerDate.value);
  28395. innerDate.value = newDate.year(year).month(month).date(date);
  28396. userInputTime.value = null;
  28397. timePickerVisible.value = false;
  28398. emit(innerDate.value, true);
  28399. }
  28400. };
  28401. const handleVisibleDateChange = (value) => {
  28402. const newDate = correctlyParseUserInput(value, dateFormat.value, lang.value, isDefaultFormat);
  28403. if (newDate.isValid()) {
  28404. if (disabledDate && disabledDate(newDate.toDate())) return;
  28405. const { hour, minute, second } = getUnits(innerDate.value);
  28406. innerDate.value = newDate.hour(hour).minute(minute).second(second);
  28407. userInputDate.value = null;
  28408. emit(innerDate.value, true);
  28409. }
  28410. };
  28411. const isValidValue = (date) => {
  28412. return import_dayjs_min.default.isDayjs(date) && date.isValid() && (disabledDate ? !disabledDate(date.toDate()) : true);
  28413. };
  28414. const parseUserInput = (value) => {
  28415. return correctlyParseUserInput(value, props.format, lang.value, isDefaultFormat);
  28416. };
  28417. const getDefaultValue = () => {
  28418. const parseDate = (0, import_dayjs_min.default)(defaultValue.value).locale(lang.value);
  28419. if (!defaultValue.value) {
  28420. const defaultTimeDValue = defaultTimeD.value;
  28421. return (0, import_dayjs_min.default)().hour(defaultTimeDValue.hour()).minute(defaultTimeDValue.minute()).second(defaultTimeDValue.second()).locale(lang.value);
  28422. }
  28423. return parseDate;
  28424. };
  28425. const handleFocusPicker = () => {
  28426. if ([
  28427. "week",
  28428. "month",
  28429. "year",
  28430. "date"
  28431. ].includes(selectionMode.value)) currentViewRef.value?.focus();
  28432. };
  28433. const _handleFocusPicker = () => {
  28434. handleFocusPicker();
  28435. if (selectionMode.value === "week") handleKeyControl(EVENT_CODE.down);
  28436. };
  28437. const handleKeydownTable = (event) => {
  28438. const code = getEventCode(event);
  28439. if ([
  28440. EVENT_CODE.up,
  28441. EVENT_CODE.down,
  28442. EVENT_CODE.left,
  28443. EVENT_CODE.right,
  28444. EVENT_CODE.home,
  28445. EVENT_CODE.end,
  28446. EVENT_CODE.pageUp,
  28447. EVENT_CODE.pageDown
  28448. ].includes(code)) {
  28449. handleKeyControl(code);
  28450. event.stopPropagation();
  28451. event.preventDefault();
  28452. }
  28453. if ([
  28454. EVENT_CODE.enter,
  28455. EVENT_CODE.space,
  28456. EVENT_CODE.numpadEnter
  28457. ].includes(code) && userInputDate.value === null && userInputTime.value === null) {
  28458. event.preventDefault();
  28459. emit(innerDate.value, false);
  28460. }
  28461. };
  28462. const handleKeyControl = (code) => {
  28463. const { up, down, left, right, home, end, pageUp, pageDown } = EVENT_CODE;
  28464. const mapping = {
  28465. year: {
  28466. [up]: -4,
  28467. [down]: 4,
  28468. [left]: -1,
  28469. [right]: 1,
  28470. offset: (date, step) => date.setFullYear(date.getFullYear() + step)
  28471. },
  28472. month: {
  28473. [up]: -4,
  28474. [down]: 4,
  28475. [left]: -1,
  28476. [right]: 1,
  28477. offset: (date, step) => date.setMonth(date.getMonth() + step)
  28478. },
  28479. week: {
  28480. [up]: -1,
  28481. [down]: 1,
  28482. [left]: -1,
  28483. [right]: 1,
  28484. offset: (date, step) => date.setDate(date.getDate() + step * 7)
  28485. },
  28486. date: {
  28487. [up]: -7,
  28488. [down]: 7,
  28489. [left]: -1,
  28490. [right]: 1,
  28491. [home]: (date) => -date.getDay(),
  28492. [end]: (date) => -date.getDay() + 6,
  28493. [pageUp]: (date) => -new Date(date.getFullYear(), date.getMonth(), 0).getDate(),
  28494. [pageDown]: (date) => new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate(),
  28495. offset: (date, step) => date.setDate(date.getDate() + step)
  28496. }
  28497. };
  28498. const newDate = innerDate.value.toDate();
  28499. while (Math.abs(innerDate.value.diff(newDate, "year", true)) < 1) {
  28500. const map = mapping[keyboardMode.value];
  28501. if (!map) return;
  28502. map.offset(newDate, isFunction$1(map[code]) ? map[code](newDate) : map[code] ?? 0);
  28503. if (disabledDate && disabledDate(newDate)) break;
  28504. const result = (0, import_dayjs_min.default)(newDate).locale(lang.value);
  28505. innerDate.value = result;
  28506. contextEmit("pick", result, true);
  28507. break;
  28508. }
  28509. };
  28510. const handlePanelChange = (mode) => {
  28511. contextEmit("panel-change", innerDate.value.toDate(), mode, currentView.value);
  28512. };
  28513. (0, vue.watch)(() => selectionMode.value, (val) => {
  28514. if (["month", "year"].includes(val)) {
  28515. currentView.value = val;
  28516. return;
  28517. } else if (val === "years") {
  28518. currentView.value = "year";
  28519. return;
  28520. } else if (val === "months") {
  28521. currentView.value = "month";
  28522. return;
  28523. }
  28524. currentView.value = "date";
  28525. }, { immediate: true });
  28526. (0, vue.watch)(() => defaultValue.value, (val) => {
  28527. if (val) innerDate.value = getDefaultValue();
  28528. }, { immediate: true });
  28529. (0, vue.watch)(() => props.parsedValue, (val) => {
  28530. if (val) {
  28531. if (isMultipleType.value) return;
  28532. if (isArray$1(val)) return;
  28533. innerDate.value = val;
  28534. } else innerDate.value = getDefaultValue();
  28535. }, { immediate: true });
  28536. contextEmit("set-picker-option", ["isValidValue", isValidValue]);
  28537. contextEmit("set-picker-option", ["parseUserInput", parseUserInput]);
  28538. contextEmit("set-picker-option", ["handleFocusPicker", _handleFocusPicker]);
  28539. return (_ctx, _cache) => {
  28540. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([
  28541. (0, vue.unref)(ppNs).b(),
  28542. (0, vue.unref)(dpNs).b(),
  28543. (0, vue.unref)(ppNs).is("border", _ctx.border),
  28544. (0, vue.unref)(ppNs).is("disabled", (0, vue.unref)(dateDisabled)),
  28545. {
  28546. "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
  28547. "has-time": showTime.value
  28548. }
  28549. ]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body-wrapper")) }, [
  28550. (0, vue.renderSlot)(_ctx.$slots, "sidebar", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar")) }),
  28551. hasShortcuts.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  28552. key: 0,
  28553. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar"))
  28554. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(shortcuts), (shortcut, key) => {
  28555. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  28556. key,
  28557. type: "button",
  28558. disabled: (0, vue.unref)(dateDisabled),
  28559. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("shortcut")),
  28560. onClick: ($event) => handleShortcutClick(shortcut)
  28561. }, (0, vue.toDisplayString)(shortcut.text), 11, _hoisted_1$47);
  28562. }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true),
  28563. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body")) }, [
  28564. showTime.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  28565. key: 0,
  28566. class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("time-header"))
  28567. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("editor-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  28568. placeholder: (0, vue.unref)(t)("el.datepicker.selectDate"),
  28569. "model-value": visibleDate.value,
  28570. size: "small",
  28571. "validate-event": false,
  28572. disabled: (0, vue.unref)(dateDisabled),
  28573. readonly: !_ctx.editable,
  28574. onInput: _cache[0] || (_cache[0] = (val) => userInputDate.value = val),
  28575. onChange: handleVisibleDateChange
  28576. }, null, 8, [
  28577. "placeholder",
  28578. "model-value",
  28579. "disabled",
  28580. "readonly"
  28581. ])], 2), (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("editor-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  28582. placeholder: (0, vue.unref)(t)("el.datepicker.selectTime"),
  28583. "model-value": visibleTime.value,
  28584. size: "small",
  28585. "validate-event": false,
  28586. disabled: (0, vue.unref)(dateDisabled),
  28587. readonly: !_ctx.editable,
  28588. onFocus: onTimePickerInputFocus,
  28589. onInput: _cache[1] || (_cache[1] = (val) => userInputTime.value = val),
  28590. onChange: handleVisibleTimeChange
  28591. }, null, 8, [
  28592. "placeholder",
  28593. "model-value",
  28594. "disabled",
  28595. "readonly"
  28596. ]), (0, vue.createVNode)((0, vue.unref)(panel_time_pick_default), {
  28597. visible: timePickerVisible.value,
  28598. format: timeFormat.value,
  28599. "parsed-value": innerDate.value,
  28600. onPick: handleTimePick
  28601. }, null, 8, [
  28602. "visible",
  28603. "format",
  28604. "parsed-value"
  28605. ])], 2)), [[(0, vue.unref)(ClickOutside), handleTimePickClose]])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  28606. (0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(dpNs).e("header"), (currentView.value === "year" || currentView.value === "month") && (0, vue.unref)(dpNs).em("header", "bordered")]) }, [
  28607. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("prev-btn")) }, [(0, vue.createElementVNode)("button", {
  28608. type: "button",
  28609. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevYear`),
  28610. class: (0, vue.normalizeClass)(["d-arrow-left", (0, vue.unref)(ppNs).e("icon-btn")]),
  28611. disabled: (0, vue.unref)(dateDisabled),
  28612. onClick: _cache[2] || (_cache[2] = ($event) => moveByYear(false))
  28613. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  28614. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  28615. _: 1
  28616. })])], 10, _hoisted_2$29), (0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  28617. type: "button",
  28618. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevMonth`),
  28619. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "arrow-left"]),
  28620. disabled: (0, vue.unref)(dateDisabled),
  28621. onClick: _cache[3] || (_cache[3] = ($event) => moveByMonth(false))
  28622. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  28623. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  28624. _: 1
  28625. })])], 10, _hoisted_3$14), [[vue.vShow, currentView.value === "date"]])], 2),
  28626. (0, vue.createElementVNode)("span", {
  28627. role: "button",
  28628. class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("header-label")),
  28629. "aria-live": "polite",
  28630. tabindex: _ctx.disabled ? void 0 : 0,
  28631. "aria-disabled": _ctx.disabled,
  28632. onKeydown: _cache[4] || (_cache[4] = (0, vue.withKeys)(($event) => showPicker("year"), ["enter"])),
  28633. onClick: _cache[5] || (_cache[5] = ($event) => showPicker("year"))
  28634. }, (0, vue.toDisplayString)(yearLabel.value), 43, _hoisted_4$11),
  28635. (0, vue.withDirectives)((0, vue.createElementVNode)("span", {
  28636. role: "button",
  28637. "aria-live": "polite",
  28638. tabindex: _ctx.disabled ? void 0 : 0,
  28639. "aria-disabled": _ctx.disabled,
  28640. class: (0, vue.normalizeClass)([(0, vue.unref)(dpNs).e("header-label"), { active: currentView.value === "month" }]),
  28641. onKeydown: _cache[6] || (_cache[6] = (0, vue.withKeys)(($event) => showPicker("month"), ["enter"])),
  28642. onClick: _cache[7] || (_cache[7] = ($event) => showPicker("month"))
  28643. }, (0, vue.toDisplayString)((0, vue.unref)(t)(`el.datepicker.month${month.value + 1}`)), 43, _hoisted_5$8), [[vue.vShow, currentView.value === "date"]]),
  28644. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(dpNs).e("next-btn")) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  28645. type: "button",
  28646. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextMonth`),
  28647. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "arrow-right"]),
  28648. disabled: (0, vue.unref)(dateDisabled),
  28649. onClick: _cache[8] || (_cache[8] = ($event) => moveByMonth(true))
  28650. }, [(0, vue.renderSlot)(_ctx.$slots, "next-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  28651. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  28652. _: 1
  28653. })])], 10, _hoisted_6$3), [[vue.vShow, currentView.value === "date"]]), (0, vue.createElementVNode)("button", {
  28654. type: "button",
  28655. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextYear`),
  28656. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "d-arrow-right"]),
  28657. disabled: (0, vue.unref)(dateDisabled),
  28658. onClick: _cache[9] || (_cache[9] = ($event) => moveByYear(true))
  28659. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  28660. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  28661. _: 1
  28662. })])], 10, _hoisted_7$2)], 2)
  28663. ], 2), [[vue.vShow, currentView.value !== "time"]]),
  28664. (0, vue.createElementVNode)("div", {
  28665. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("content")),
  28666. onKeydown: handleKeydownTable
  28667. }, [
  28668. currentView.value === "date" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_date_table_default, {
  28669. key: 0,
  28670. ref_key: "currentViewRef",
  28671. ref: currentViewRef,
  28672. "selection-mode": selectionMode.value,
  28673. date: innerDate.value,
  28674. "parsed-value": _ctx.parsedValue,
  28675. "disabled-date": (0, vue.unref)(disabledDate),
  28676. disabled: (0, vue.unref)(dateDisabled),
  28677. "cell-class-name": (0, vue.unref)(cellClassName),
  28678. "show-week-number": _ctx.showWeekNumber,
  28679. onPick: handleDatePick
  28680. }, null, 8, [
  28681. "selection-mode",
  28682. "date",
  28683. "parsed-value",
  28684. "disabled-date",
  28685. "disabled",
  28686. "cell-class-name",
  28687. "show-week-number"
  28688. ])) : (0, vue.createCommentVNode)("v-if", true),
  28689. currentView.value === "year" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_year_table_default, {
  28690. key: 1,
  28691. ref_key: "currentViewRef",
  28692. ref: currentViewRef,
  28693. "selection-mode": selectionMode.value,
  28694. date: innerDate.value,
  28695. "disabled-date": (0, vue.unref)(disabledDate),
  28696. disabled: (0, vue.unref)(dateDisabled),
  28697. "parsed-value": _ctx.parsedValue,
  28698. "cell-class-name": (0, vue.unref)(cellClassName),
  28699. onPick: handleYearPick
  28700. }, null, 8, [
  28701. "selection-mode",
  28702. "date",
  28703. "disabled-date",
  28704. "disabled",
  28705. "parsed-value",
  28706. "cell-class-name"
  28707. ])) : (0, vue.createCommentVNode)("v-if", true),
  28708. currentView.value === "month" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_month_table_default, {
  28709. key: 2,
  28710. ref_key: "currentViewRef",
  28711. ref: currentViewRef,
  28712. "selection-mode": selectionMode.value,
  28713. date: innerDate.value,
  28714. "parsed-value": _ctx.parsedValue,
  28715. "disabled-date": (0, vue.unref)(disabledDate),
  28716. disabled: (0, vue.unref)(dateDisabled),
  28717. "cell-class-name": (0, vue.unref)(cellClassName),
  28718. onPick: handleMonthPick
  28719. }, null, 8, [
  28720. "selection-mode",
  28721. "date",
  28722. "parsed-value",
  28723. "disabled-date",
  28724. "disabled",
  28725. "cell-class-name"
  28726. ])) : (0, vue.createCommentVNode)("v-if", true)
  28727. ], 34)
  28728. ], 2)
  28729. ], 2), _ctx.showFooter && footerVisible.value && footerFilled.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  28730. key: 0,
  28731. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("footer"))
  28732. }, [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElButton), {
  28733. text: "",
  28734. size: "small",
  28735. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("link-btn")),
  28736. disabled: disabledNow.value,
  28737. onClick: changeToNow
  28738. }, {
  28739. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.now")), 1)]),
  28740. _: 1
  28741. }, 8, ["class", "disabled"]), [[vue.vShow, !isMultipleType.value && _ctx.showNow]]), _ctx.showConfirm ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), {
  28742. key: 0,
  28743. plain: "",
  28744. size: "small",
  28745. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("link-btn")),
  28746. disabled: disabledConfirm.value,
  28747. onClick: onConfirm
  28748. }, {
  28749. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.confirm")), 1)]),
  28750. _: 1
  28751. }, 8, ["class", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  28752. };
  28753. }
  28754. });
  28755. //#endregion
  28756. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-pick.vue
  28757. var panel_date_pick_default = panel_date_pick_vue_vue_type_script_setup_true_lang_default;
  28758. //#endregion
  28759. //#region ../../packages/components/date-picker-panel/src/props/panel-date-range.ts
  28760. const panelDateRangeProps = buildProps({
  28761. ...panelSharedProps,
  28762. ...panelRangeSharedProps
  28763. });
  28764. //#endregion
  28765. //#region ../../packages/components/date-picker-panel/src/composables/use-shortcut.ts
  28766. const useShortcut = (lang) => {
  28767. const { emit } = (0, vue.getCurrentInstance)();
  28768. const attrs = (0, vue.useAttrs)();
  28769. const slots = (0, vue.useSlots)();
  28770. const handleShortcutClick = (shortcut) => {
  28771. const shortcutValues = isFunction$1(shortcut.value) ? shortcut.value() : shortcut.value;
  28772. if (shortcutValues) {
  28773. emit("pick", [(0, import_dayjs_min.default)(shortcutValues[0]).locale(lang.value), (0, import_dayjs_min.default)(shortcutValues[1]).locale(lang.value)]);
  28774. return;
  28775. }
  28776. if (shortcut.onClick) shortcut.onClick({
  28777. attrs,
  28778. slots,
  28779. emit
  28780. });
  28781. };
  28782. return handleShortcutClick;
  28783. };
  28784. //#endregion
  28785. //#region ../../packages/components/date-picker-panel/src/composables/use-range-picker.ts
  28786. const useRangePicker = (props, { defaultValue, defaultTime, leftDate, rightDate, step, unit, sortDates }) => {
  28787. const { emit } = (0, vue.getCurrentInstance)();
  28788. const { pickerNs } = (0, vue.inject)(ROOT_PICKER_INJECTION_KEY);
  28789. const drpNs = useNamespace("date-range-picker");
  28790. const { t, lang } = useLocale();
  28791. const handleShortcutClick = useShortcut(lang);
  28792. const minDate = (0, vue.ref)();
  28793. const maxDate = (0, vue.ref)();
  28794. const rangeState = (0, vue.ref)({
  28795. endDate: null,
  28796. selecting: false
  28797. });
  28798. const handleChangeRange = (val) => {
  28799. rangeState.value = val;
  28800. };
  28801. const handleRangeConfirm = (visible = false) => {
  28802. const _minDate = (0, vue.unref)(minDate);
  28803. const _maxDate = (0, vue.unref)(maxDate);
  28804. if (isValidRange([_minDate, _maxDate])) emit("pick", [_minDate, _maxDate], visible);
  28805. };
  28806. const onSelect = (selecting) => {
  28807. rangeState.value.selecting = selecting;
  28808. if (!selecting) rangeState.value.endDate = null;
  28809. };
  28810. const parseValue = (parsedValue) => {
  28811. if (isArray$1(parsedValue) && parsedValue.length === 2) {
  28812. const [start, end] = parsedValue;
  28813. minDate.value = start;
  28814. leftDate.value = start;
  28815. maxDate.value = end;
  28816. sortDates((0, vue.unref)(minDate), (0, vue.unref)(maxDate));
  28817. } else restoreDefault();
  28818. };
  28819. const restoreDefault = () => {
  28820. let [start, end] = getDefaultValue((0, vue.unref)(defaultValue), {
  28821. lang: (0, vue.unref)(lang),
  28822. step,
  28823. unit,
  28824. unlinkPanels: props.unlinkPanels
  28825. });
  28826. const getShift = (day) => {
  28827. return day.diff(day.startOf("d"), "ms");
  28828. };
  28829. const maybeTimes = (0, vue.unref)(defaultTime);
  28830. if (maybeTimes) {
  28831. let leftShift = 0;
  28832. let rightShift = 0;
  28833. if (isArray$1(maybeTimes)) {
  28834. const [timeStart, timeEnd] = maybeTimes.map(import_dayjs_min.default);
  28835. leftShift = getShift(timeStart);
  28836. rightShift = getShift(timeEnd);
  28837. } else {
  28838. const shift = getShift((0, import_dayjs_min.default)(maybeTimes));
  28839. leftShift = shift;
  28840. rightShift = shift;
  28841. }
  28842. start = start.startOf("d").add(leftShift, "ms");
  28843. end = end.startOf("d").add(rightShift, "ms");
  28844. }
  28845. minDate.value = void 0;
  28846. maxDate.value = void 0;
  28847. leftDate.value = start;
  28848. rightDate.value = end;
  28849. };
  28850. (0, vue.watch)(defaultValue, (val) => {
  28851. if (val) restoreDefault();
  28852. }, { immediate: true });
  28853. (0, vue.watch)(() => props.parsedValue, (parsedValue) => {
  28854. if (!parsedValue?.length || !isEqual$1(parsedValue, [minDate.value, maxDate.value])) parseValue(parsedValue);
  28855. }, { immediate: true });
  28856. (0, vue.watch)(() => props.visible, () => {
  28857. if (props.visible) parseValue(props.parsedValue);
  28858. }, { immediate: true });
  28859. return {
  28860. minDate,
  28861. maxDate,
  28862. rangeState,
  28863. lang,
  28864. ppNs: pickerNs,
  28865. drpNs,
  28866. handleChangeRange,
  28867. handleRangeConfirm,
  28868. handleShortcutClick,
  28869. onSelect,
  28870. parseValue,
  28871. t
  28872. };
  28873. };
  28874. //#endregion
  28875. //#region ../../packages/components/date-picker-panel/src/composables/use-panel-date-range.ts
  28876. const usePanelDateRange = (props, emit, leftDate, rightDate) => {
  28877. const leftCurrentView = (0, vue.ref)("date");
  28878. const leftCurrentViewRef = (0, vue.ref)();
  28879. const rightCurrentView = (0, vue.ref)("date");
  28880. const rightCurrentViewRef = (0, vue.ref)();
  28881. const { disabledDate } = (0, vue.inject)(PICKER_BASE_INJECTION_KEY).props;
  28882. const { t, lang } = useLocale();
  28883. const leftYear = (0, vue.computed)(() => {
  28884. return leftDate.value.year();
  28885. });
  28886. const leftMonth = (0, vue.computed)(() => {
  28887. return leftDate.value.month();
  28888. });
  28889. const rightYear = (0, vue.computed)(() => {
  28890. return rightDate.value.year();
  28891. });
  28892. const rightMonth = (0, vue.computed)(() => {
  28893. return rightDate.value.month();
  28894. });
  28895. function computedYearLabel(currentView, yearValue) {
  28896. const yearTranslation = t("el.datepicker.year");
  28897. if (currentView.value === "year") {
  28898. const startYear = Math.floor(yearValue.value / 10) * 10;
  28899. return yearTranslation ? `${startYear} ${yearTranslation} - ${startYear + 9} ${yearTranslation}` : `${startYear} - ${startYear + 9}`;
  28900. }
  28901. return `${yearValue.value} ${yearTranslation}`;
  28902. }
  28903. function focusPicker(currentViewRef) {
  28904. currentViewRef?.focus();
  28905. }
  28906. async function showPicker(pickerType, view) {
  28907. if (props.disabled) return;
  28908. const currentView = pickerType === "left" ? leftCurrentView : rightCurrentView;
  28909. const currentViewRef = pickerType === "left" ? leftCurrentViewRef : rightCurrentViewRef;
  28910. currentView.value = view;
  28911. await (0, vue.nextTick)();
  28912. focusPicker(currentViewRef.value);
  28913. }
  28914. async function handlePick(mode, pickerType, value) {
  28915. if (props.disabled) return;
  28916. const isLeftPicker = pickerType === "left";
  28917. const startDate = isLeftPicker ? leftDate : rightDate;
  28918. const endDate = isLeftPicker ? rightDate : leftDate;
  28919. const currentView = isLeftPicker ? leftCurrentView : rightCurrentView;
  28920. const currentViewRef = isLeftPicker ? leftCurrentViewRef : rightCurrentViewRef;
  28921. if (mode === "year") startDate.value = getValidDateOfYear(startDate.value.year(value), lang.value, disabledDate);
  28922. if (mode === "month") startDate.value = getValidDateOfMonth(startDate.value, startDate.value.year(), value, lang.value, disabledDate);
  28923. if (!props.unlinkPanels) endDate.value = pickerType === "left" ? startDate.value.add(1, "month") : startDate.value.subtract(1, "month");
  28924. currentView.value = mode === "year" ? "month" : "date";
  28925. await (0, vue.nextTick)();
  28926. focusPicker(currentViewRef.value);
  28927. handlePanelChange(mode);
  28928. }
  28929. function handlePanelChange(mode) {
  28930. emit("panel-change", [leftDate.value.toDate(), rightDate.value.toDate()], mode);
  28931. }
  28932. function adjustDateByView(currentView, date, forward) {
  28933. const action = forward ? "add" : "subtract";
  28934. return currentView === "year" ? date[action](10, "year") : date[action](1, "year");
  28935. }
  28936. return {
  28937. leftCurrentView,
  28938. rightCurrentView,
  28939. leftCurrentViewRef,
  28940. rightCurrentViewRef,
  28941. leftYear,
  28942. rightYear,
  28943. leftMonth,
  28944. rightMonth,
  28945. leftYearLabel: (0, vue.computed)(() => computedYearLabel(leftCurrentView, leftYear)),
  28946. rightYearLabel: (0, vue.computed)(() => computedYearLabel(rightCurrentView, rightYear)),
  28947. showLeftPicker: (view) => showPicker("left", view),
  28948. showRightPicker: (view) => showPicker("right", view),
  28949. handleLeftYearPick: (year) => handlePick("year", "left", year),
  28950. handleRightYearPick: (year) => handlePick("year", "right", year),
  28951. handleLeftMonthPick: (month) => handlePick("month", "left", month),
  28952. handleRightMonthPick: (month) => handlePick("month", "right", month),
  28953. handlePanelChange,
  28954. adjustDateByView
  28955. };
  28956. };
  28957. //#endregion
  28958. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue?vue&type=script&setup=true&lang.ts
  28959. const _hoisted_1$46 = ["disabled", "onClick"];
  28960. const _hoisted_2$28 = ["aria-label", "disabled"];
  28961. const _hoisted_3$13 = ["aria-label", "disabled"];
  28962. const _hoisted_4$10 = ["disabled", "aria-label"];
  28963. const _hoisted_5$7 = ["disabled", "aria-label"];
  28964. const _hoisted_6$2 = ["tabindex", "aria-disabled"];
  28965. const _hoisted_7$1 = ["tabindex", "aria-disabled"];
  28966. const _hoisted_8$1 = ["disabled", "aria-label"];
  28967. const _hoisted_9$1 = ["disabled", "aria-label"];
  28968. const _hoisted_10$1 = ["aria-label", "disabled"];
  28969. const _hoisted_11$1 = ["disabled", "aria-label"];
  28970. const _hoisted_12$1 = ["tabindex", "aria-disabled"];
  28971. const _hoisted_13$1 = ["tabindex", "aria-disabled"];
  28972. const unit$2 = "month";
  28973. var panel_date_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  28974. __name: "panel-date-range",
  28975. props: panelDateRangeProps,
  28976. emits: [
  28977. "pick",
  28978. "set-picker-option",
  28979. "calendar-change",
  28980. "panel-change",
  28981. "clear"
  28982. ],
  28983. setup(__props, { emit: __emit }) {
  28984. const props = __props;
  28985. const emit = __emit;
  28986. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  28987. const isDefaultFormat = (0, vue.inject)(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  28988. const { disabledDate, cellClassName, defaultTime, clearable } = pickerBase.props;
  28989. const format = (0, vue.toRef)(pickerBase.props, "format");
  28990. const shortcuts = (0, vue.toRef)(pickerBase.props, "shortcuts");
  28991. const defaultValue = (0, vue.toRef)(pickerBase.props, "defaultValue");
  28992. const { lang } = useLocale();
  28993. const leftDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value));
  28994. const rightDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value).add(1, unit$2));
  28995. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue, t } = useRangePicker(props, {
  28996. defaultValue,
  28997. defaultTime,
  28998. leftDate,
  28999. rightDate,
  29000. unit: unit$2,
  29001. sortDates
  29002. });
  29003. (0, vue.watch)(() => props.visible, (visible) => {
  29004. if (!visible && rangeState.value.selecting) {
  29005. parseValue(props.parsedValue);
  29006. onSelect(false);
  29007. }
  29008. });
  29009. const dateUserInput = (0, vue.ref)({
  29010. min: null,
  29011. max: null
  29012. });
  29013. const timeUserInput = (0, vue.ref)({
  29014. min: null,
  29015. max: null
  29016. });
  29017. const { leftCurrentView, rightCurrentView, leftCurrentViewRef, rightCurrentViewRef, leftYear, rightYear, leftMonth, rightMonth, leftYearLabel, rightYearLabel, showLeftPicker, showRightPicker, handleLeftYearPick, handleRightYearPick, handleLeftMonthPick, handleRightMonthPick, handlePanelChange, adjustDateByView } = usePanelDateRange(props, emit, leftDate, rightDate);
  29018. const hasShortcuts = (0, vue.computed)(() => !!shortcuts.value.length);
  29019. const minVisibleDate = (0, vue.computed)(() => {
  29020. if (dateUserInput.value.min !== null) return dateUserInput.value.min;
  29021. if (minDate.value) return minDate.value.format(dateFormat.value);
  29022. return "";
  29023. });
  29024. const maxVisibleDate = (0, vue.computed)(() => {
  29025. if (dateUserInput.value.max !== null) return dateUserInput.value.max;
  29026. if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(dateFormat.value);
  29027. return "";
  29028. });
  29029. const minVisibleTime = (0, vue.computed)(() => {
  29030. if (timeUserInput.value.min !== null) return timeUserInput.value.min;
  29031. if (minDate.value) return minDate.value.format(timeFormat.value);
  29032. return "";
  29033. });
  29034. const maxVisibleTime = (0, vue.computed)(() => {
  29035. if (timeUserInput.value.max !== null) return timeUserInput.value.max;
  29036. if (maxDate.value || minDate.value) return (maxDate.value || minDate.value).format(timeFormat.value);
  29037. return "";
  29038. });
  29039. const timeFormat = (0, vue.computed)(() => {
  29040. return props.timeFormat || extractTimeFormat(format.value || "") || DEFAULT_FORMATS_TIME;
  29041. });
  29042. const dateFormat = (0, vue.computed)(() => {
  29043. return props.dateFormat || extractDateFormat(format.value || "") || DEFAULT_FORMATS_DATE;
  29044. });
  29045. const isValidValue = (date) => {
  29046. return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
  29047. };
  29048. const leftPrevYear = () => {
  29049. leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, false);
  29050. if (!props.unlinkPanels) rightDate.value = leftDate.value.add(1, "month");
  29051. handlePanelChange("year");
  29052. };
  29053. const leftPrevMonth = () => {
  29054. leftDate.value = leftDate.value.subtract(1, "month");
  29055. if (!props.unlinkPanels) rightDate.value = leftDate.value.add(1, "month");
  29056. handlePanelChange("month");
  29057. };
  29058. const rightNextYear = () => {
  29059. if (!props.unlinkPanels) {
  29060. leftDate.value = adjustDateByView(rightCurrentView.value, leftDate.value, true);
  29061. rightDate.value = leftDate.value.add(1, "month");
  29062. } else rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, true);
  29063. handlePanelChange("year");
  29064. };
  29065. const rightNextMonth = () => {
  29066. if (!props.unlinkPanels) {
  29067. leftDate.value = leftDate.value.add(1, "month");
  29068. rightDate.value = leftDate.value.add(1, "month");
  29069. } else rightDate.value = rightDate.value.add(1, "month");
  29070. handlePanelChange("month");
  29071. };
  29072. const leftNextYear = () => {
  29073. leftDate.value = adjustDateByView(leftCurrentView.value, leftDate.value, true);
  29074. handlePanelChange("year");
  29075. };
  29076. const leftNextMonth = () => {
  29077. leftDate.value = leftDate.value.add(1, "month");
  29078. handlePanelChange("month");
  29079. };
  29080. const rightPrevYear = () => {
  29081. rightDate.value = adjustDateByView(rightCurrentView.value, rightDate.value, false);
  29082. handlePanelChange("year");
  29083. };
  29084. const rightPrevMonth = () => {
  29085. rightDate.value = rightDate.value.subtract(1, "month");
  29086. handlePanelChange("month");
  29087. };
  29088. const enableMonthArrow = (0, vue.computed)(() => {
  29089. const nextMonth = (leftMonth.value + 1) % 12;
  29090. const yearOffset = leftMonth.value + 1 >= 12 ? 1 : 0;
  29091. return props.unlinkPanels && new Date(leftYear.value + yearOffset, nextMonth) < new Date(rightYear.value, rightMonth.value);
  29092. });
  29093. const enableYearArrow = (0, vue.computed)(() => {
  29094. return props.unlinkPanels && rightYear.value * 12 + rightMonth.value - (leftYear.value * 12 + leftMonth.value + 1) >= 12;
  29095. });
  29096. const dateRangeDisabled = useFormDisabled();
  29097. const btnDisabled = (0, vue.computed)(() => {
  29098. return !(minDate.value && maxDate.value && !rangeState.value.selecting && isValidRange([minDate.value, maxDate.value]) && !dateRangeDisabled.value);
  29099. });
  29100. const showTime = (0, vue.computed)(() => props.type === "datetime" || props.type === "datetimerange");
  29101. const formatEmit = (emitDayjs, index) => {
  29102. if (!emitDayjs) return;
  29103. if (defaultTime) return (0, import_dayjs_min.default)(defaultTime[index] || defaultTime).locale(lang.value).year(emitDayjs.year()).month(emitDayjs.month()).date(emitDayjs.date());
  29104. return emitDayjs;
  29105. };
  29106. const handleRangePick = (val, close = true) => {
  29107. const min_ = val.minDate;
  29108. const max_ = val.maxDate;
  29109. const minDate_ = formatEmit(min_, 0);
  29110. const maxDate_ = formatEmit(max_, 1);
  29111. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  29112. emit("calendar-change", [min_.toDate(), max_ && max_.toDate()]);
  29113. maxDate.value = maxDate_;
  29114. minDate.value = minDate_;
  29115. if (!showTime.value && close) close = !minDate_ || !maxDate_;
  29116. handleRangeConfirm(close);
  29117. };
  29118. const minTimePickerVisible = (0, vue.ref)(false);
  29119. const maxTimePickerVisible = (0, vue.ref)(false);
  29120. const handleMinTimeClose = () => {
  29121. minTimePickerVisible.value = false;
  29122. };
  29123. const handleMaxTimeClose = () => {
  29124. maxTimePickerVisible.value = false;
  29125. };
  29126. const handleDateInput = (value, type) => {
  29127. dateUserInput.value[type] = value;
  29128. const parsedValueD = (0, import_dayjs_min.default)(value, dateFormat.value).locale(lang.value);
  29129. if (parsedValueD.isValid()) {
  29130. if (disabledDate && disabledDate(parsedValueD.toDate())) return;
  29131. if (type === "min") {
  29132. leftDate.value = parsedValueD;
  29133. minDate.value = (minDate.value || leftDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  29134. if (!props.unlinkPanels && (!maxDate.value || maxDate.value.isBefore(minDate.value))) {
  29135. rightDate.value = parsedValueD.add(1, "month");
  29136. maxDate.value = minDate.value.add(1, "month");
  29137. }
  29138. } else {
  29139. rightDate.value = parsedValueD;
  29140. maxDate.value = (maxDate.value || rightDate.value).year(parsedValueD.year()).month(parsedValueD.month()).date(parsedValueD.date());
  29141. if (!props.unlinkPanels && (!minDate.value || minDate.value.isAfter(maxDate.value))) {
  29142. leftDate.value = parsedValueD.subtract(1, "month");
  29143. minDate.value = maxDate.value.subtract(1, "month");
  29144. }
  29145. }
  29146. sortDates(minDate.value, maxDate.value);
  29147. handleRangeConfirm(true);
  29148. }
  29149. };
  29150. const handleDateChange = (_, type) => {
  29151. dateUserInput.value[type] = null;
  29152. };
  29153. const handleTimeInput = (value, type) => {
  29154. timeUserInput.value[type] = value;
  29155. const parsedValueD = (0, import_dayjs_min.default)(value, timeFormat.value).locale(lang.value);
  29156. if (parsedValueD.isValid()) if (type === "min") {
  29157. minTimePickerVisible.value = true;
  29158. minDate.value = (minDate.value || leftDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  29159. leftDate.value = minDate.value;
  29160. } else {
  29161. maxTimePickerVisible.value = true;
  29162. maxDate.value = (maxDate.value || rightDate.value).hour(parsedValueD.hour()).minute(parsedValueD.minute()).second(parsedValueD.second());
  29163. rightDate.value = maxDate.value;
  29164. }
  29165. };
  29166. const handleTimeChange = (_value, type) => {
  29167. timeUserInput.value[type] = null;
  29168. if (type === "min") {
  29169. leftDate.value = minDate.value;
  29170. minTimePickerVisible.value = false;
  29171. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) maxDate.value = minDate.value;
  29172. } else {
  29173. rightDate.value = maxDate.value;
  29174. maxTimePickerVisible.value = false;
  29175. if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value;
  29176. }
  29177. handleRangeConfirm(true);
  29178. };
  29179. const handleMinTimePick = (value, visible, first) => {
  29180. if (timeUserInput.value.min) return;
  29181. if (value) minDate.value = (minDate.value || leftDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  29182. if (!first) minTimePickerVisible.value = visible;
  29183. if (!maxDate.value || maxDate.value.isBefore(minDate.value)) {
  29184. maxDate.value = minDate.value;
  29185. rightDate.value = value;
  29186. (0, vue.nextTick)(() => {
  29187. parseValue(props.parsedValue);
  29188. });
  29189. }
  29190. handleRangeConfirm(true);
  29191. };
  29192. const handleMaxTimePick = (value, visible, first) => {
  29193. if (timeUserInput.value.max) return;
  29194. if (value) maxDate.value = (maxDate.value || rightDate.value).hour(value.hour()).minute(value.minute()).second(value.second());
  29195. if (!first) maxTimePickerVisible.value = visible;
  29196. if (maxDate.value && maxDate.value.isBefore(minDate.value)) minDate.value = maxDate.value;
  29197. handleRangeConfirm(true);
  29198. };
  29199. const onClear = () => {
  29200. handleClear();
  29201. emit("clear");
  29202. };
  29203. const handleClear = () => {
  29204. let valueOnClear = null;
  29205. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  29206. leftDate.value = getDefaultValue((0, vue.unref)(defaultValue), {
  29207. lang: (0, vue.unref)(lang),
  29208. unit: "month",
  29209. unlinkPanels: props.unlinkPanels
  29210. })[0];
  29211. rightDate.value = leftDate.value.add(1, "month");
  29212. maxDate.value = void 0;
  29213. minDate.value = void 0;
  29214. handleRangeConfirm(true);
  29215. emit("pick", valueOnClear);
  29216. };
  29217. const parseUserInput = (value) => {
  29218. return correctlyParseUserInput(value, format.value || "", lang.value, isDefaultFormat);
  29219. };
  29220. function sortDates(minDate, maxDate) {
  29221. if (props.unlinkPanels && maxDate) {
  29222. const minDateYear = minDate?.year() || 0;
  29223. const minDateMonth = minDate?.month() || 0;
  29224. const maxDateYear = maxDate.year();
  29225. const maxDateMonth = maxDate.month();
  29226. rightDate.value = minDateYear === maxDateYear && minDateMonth === maxDateMonth ? maxDate.add(1, unit$2) : maxDate;
  29227. } else {
  29228. rightDate.value = leftDate.value.add(1, unit$2);
  29229. if (maxDate) rightDate.value = rightDate.value.hour(maxDate.hour()).minute(maxDate.minute()).second(maxDate.second());
  29230. }
  29231. }
  29232. emit("set-picker-option", ["isValidValue", isValidValue]);
  29233. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  29234. emit("set-picker-option", ["handleClear", handleClear]);
  29235. return (_ctx, _cache) => {
  29236. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([
  29237. (0, vue.unref)(ppNs).b(),
  29238. (0, vue.unref)(drpNs).b(),
  29239. (0, vue.unref)(ppNs).is("border", _ctx.border),
  29240. (0, vue.unref)(ppNs).is("disabled", (0, vue.unref)(dateRangeDisabled)),
  29241. {
  29242. "has-sidebar": _ctx.$slots.sidebar || hasShortcuts.value,
  29243. "has-time": showTime.value
  29244. }
  29245. ]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body-wrapper")) }, [
  29246. (0, vue.renderSlot)(_ctx.$slots, "sidebar", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar")) }),
  29247. hasShortcuts.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  29248. key: 0,
  29249. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar"))
  29250. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(shortcuts.value, (shortcut, key) => {
  29251. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29252. key,
  29253. type: "button",
  29254. disabled: (0, vue.unref)(dateRangeDisabled),
  29255. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("shortcut")),
  29256. onClick: ($event) => (0, vue.unref)(handleShortcutClick)(shortcut)
  29257. }, (0, vue.toDisplayString)(shortcut.text), 11, _hoisted_1$46);
  29258. }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true),
  29259. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body")) }, [
  29260. showTime.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  29261. key: 0,
  29262. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("time-header"))
  29263. }, [
  29264. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("editors-wrap")) }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("time-picker-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  29265. size: "small",
  29266. disabled: (0, vue.unref)(rangeState).selecting || (0, vue.unref)(dateRangeDisabled),
  29267. placeholder: (0, vue.unref)(t)("el.datepicker.startDate"),
  29268. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("editor")),
  29269. "model-value": minVisibleDate.value,
  29270. "validate-event": false,
  29271. readonly: !_ctx.editable,
  29272. onInput: _cache[0] || (_cache[0] = (val) => handleDateInput(val, "min")),
  29273. onChange: _cache[1] || (_cache[1] = (val) => handleDateChange(val, "min"))
  29274. }, null, 8, [
  29275. "disabled",
  29276. "placeholder",
  29277. "class",
  29278. "model-value",
  29279. "readonly"
  29280. ])], 2), (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("time-picker-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  29281. size: "small",
  29282. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("editor")),
  29283. disabled: (0, vue.unref)(rangeState).selecting || (0, vue.unref)(dateRangeDisabled),
  29284. placeholder: (0, vue.unref)(t)("el.datepicker.startTime"),
  29285. "model-value": minVisibleTime.value,
  29286. "validate-event": false,
  29287. readonly: !_ctx.editable,
  29288. onFocus: _cache[2] || (_cache[2] = ($event) => minTimePickerVisible.value = true),
  29289. onInput: _cache[3] || (_cache[3] = (val) => handleTimeInput(val, "min")),
  29290. onChange: _cache[4] || (_cache[4] = (val) => handleTimeChange(val, "min"))
  29291. }, null, 8, [
  29292. "class",
  29293. "disabled",
  29294. "placeholder",
  29295. "model-value",
  29296. "readonly"
  29297. ]), (0, vue.createVNode)((0, vue.unref)(panel_time_pick_default), {
  29298. visible: minTimePickerVisible.value,
  29299. format: timeFormat.value,
  29300. "datetime-role": "start",
  29301. "parsed-value": (0, vue.unref)(minDate) || leftDate.value,
  29302. onPick: handleMinTimePick
  29303. }, null, 8, [
  29304. "visible",
  29305. "format",
  29306. "parsed-value"
  29307. ])], 2)), [[(0, vue.unref)(ClickOutside), handleMinTimeClose]])], 2),
  29308. (0, vue.createElementVNode)("span", null, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29309. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  29310. _: 1
  29311. })]),
  29312. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([(0, vue.unref)(drpNs).e("editors-wrap"), "is-right"]) }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("time-picker-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  29313. size: "small",
  29314. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("editor")),
  29315. disabled: (0, vue.unref)(rangeState).selecting || (0, vue.unref)(dateRangeDisabled),
  29316. placeholder: (0, vue.unref)(t)("el.datepicker.endDate"),
  29317. "model-value": maxVisibleDate.value,
  29318. readonly: !(0, vue.unref)(minDate) || !_ctx.editable,
  29319. "validate-event": false,
  29320. onInput: _cache[5] || (_cache[5] = (val) => handleDateInput(val, "max")),
  29321. onChange: _cache[6] || (_cache[6] = (val) => handleDateChange(val, "max"))
  29322. }, null, 8, [
  29323. "class",
  29324. "disabled",
  29325. "placeholder",
  29326. "model-value",
  29327. "readonly"
  29328. ])], 2), (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("time-picker-wrap")) }, [(0, vue.createVNode)((0, vue.unref)(ElInput), {
  29329. size: "small",
  29330. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("editor")),
  29331. disabled: (0, vue.unref)(rangeState).selecting || (0, vue.unref)(dateRangeDisabled),
  29332. placeholder: (0, vue.unref)(t)("el.datepicker.endTime"),
  29333. "model-value": maxVisibleTime.value,
  29334. readonly: !(0, vue.unref)(minDate) || !_ctx.editable,
  29335. "validate-event": false,
  29336. onFocus: _cache[7] || (_cache[7] = ($event) => (0, vue.unref)(minDate) && (maxTimePickerVisible.value = true)),
  29337. onInput: _cache[8] || (_cache[8] = (val) => handleTimeInput(val, "max")),
  29338. onChange: _cache[9] || (_cache[9] = (val) => handleTimeChange(val, "max"))
  29339. }, null, 8, [
  29340. "class",
  29341. "disabled",
  29342. "placeholder",
  29343. "model-value",
  29344. "readonly"
  29345. ]), (0, vue.createVNode)((0, vue.unref)(panel_time_pick_default), {
  29346. "datetime-role": "end",
  29347. visible: maxTimePickerVisible.value,
  29348. format: timeFormat.value,
  29349. "parsed-value": (0, vue.unref)(maxDate) || rightDate.value,
  29350. onPick: handleMaxTimePick
  29351. }, null, 8, [
  29352. "visible",
  29353. "format",
  29354. "parsed-value"
  29355. ])], 2)), [[(0, vue.unref)(ClickOutside), handleMaxTimeClose]])], 2)
  29356. ], 2)) : (0, vue.createCommentVNode)("v-if", true),
  29357. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("content"), (0, vue.unref)(drpNs).e("content")], "is-left"]) }, [
  29358. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  29359. (0, vue.createElementVNode)("button", {
  29360. type: "button",
  29361. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "d-arrow-left"]),
  29362. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevYear`),
  29363. disabled: (0, vue.unref)(dateRangeDisabled),
  29364. onClick: leftPrevYear
  29365. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29366. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  29367. _: 1
  29368. })])], 10, _hoisted_2$28),
  29369. (0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  29370. type: "button",
  29371. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "arrow-left"]),
  29372. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevMonth`),
  29373. disabled: (0, vue.unref)(dateRangeDisabled),
  29374. onClick: leftPrevMonth
  29375. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29376. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  29377. _: 1
  29378. })])], 10, _hoisted_3$13), [[vue.vShow, (0, vue.unref)(leftCurrentView) === "date"]]),
  29379. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29380. key: 0,
  29381. type: "button",
  29382. disabled: !enableYearArrow.value || (0, vue.unref)(dateRangeDisabled),
  29383. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableYearArrow.value || (0, vue.unref)(dateRangeDisabled))], "d-arrow-right"]),
  29384. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextYear`),
  29385. onClick: leftNextYear
  29386. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29387. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  29388. _: 1
  29389. })])], 10, _hoisted_4$10)) : (0, vue.createCommentVNode)("v-if", true),
  29390. _ctx.unlinkPanels && (0, vue.unref)(leftCurrentView) === "date" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29391. key: 1,
  29392. type: "button",
  29393. disabled: !enableMonthArrow.value || (0, vue.unref)(dateRangeDisabled),
  29394. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableMonthArrow.value || (0, vue.unref)(dateRangeDisabled))], "arrow-right"]),
  29395. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextMonth`),
  29396. onClick: leftNextMonth
  29397. }, [(0, vue.renderSlot)(_ctx.$slots, "next-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29398. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  29399. _: 1
  29400. })])], 10, _hoisted_5$7)) : (0, vue.createCommentVNode)("v-if", true),
  29401. (0, vue.createElementVNode)("div", null, [(0, vue.createElementVNode)("span", {
  29402. role: "button",
  29403. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header-label")),
  29404. "aria-live": "polite",
  29405. tabindex: _ctx.disabled ? void 0 : 0,
  29406. "aria-disabled": _ctx.disabled,
  29407. onKeydown: _cache[10] || (_cache[10] = (0, vue.withKeys)(($event) => (0, vue.unref)(showLeftPicker)("year"), ["enter"])),
  29408. onClick: _cache[11] || (_cache[11] = ($event) => (0, vue.unref)(showLeftPicker)("year"))
  29409. }, (0, vue.toDisplayString)((0, vue.unref)(leftYearLabel)), 43, _hoisted_6$2), (0, vue.withDirectives)((0, vue.createElementVNode)("span", {
  29410. role: "button",
  29411. "aria-live": "polite",
  29412. tabindex: _ctx.disabled ? void 0 : 0,
  29413. "aria-disabled": _ctx.disabled,
  29414. class: (0, vue.normalizeClass)([(0, vue.unref)(drpNs).e("header-label"), { active: (0, vue.unref)(leftCurrentView) === "month" }]),
  29415. onKeydown: _cache[12] || (_cache[12] = (0, vue.withKeys)(($event) => (0, vue.unref)(showLeftPicker)("month"), ["enter"])),
  29416. onClick: _cache[13] || (_cache[13] = ($event) => (0, vue.unref)(showLeftPicker)("month"))
  29417. }, (0, vue.toDisplayString)((0, vue.unref)(t)(`el.datepicker.month${leftDate.value.month() + 1}`)), 43, _hoisted_7$1), [[vue.vShow, (0, vue.unref)(leftCurrentView) === "date"]])])
  29418. ], 2),
  29419. (0, vue.unref)(leftCurrentView) === "date" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_date_table_default, {
  29420. key: 0,
  29421. ref_key: "leftCurrentViewRef",
  29422. ref: leftCurrentViewRef,
  29423. "selection-mode": "range",
  29424. date: leftDate.value,
  29425. "min-date": (0, vue.unref)(minDate),
  29426. "max-date": (0, vue.unref)(maxDate),
  29427. "range-state": (0, vue.unref)(rangeState),
  29428. "disabled-date": (0, vue.unref)(disabledDate),
  29429. "cell-class-name": (0, vue.unref)(cellClassName),
  29430. "show-week-number": _ctx.showWeekNumber,
  29431. disabled: (0, vue.unref)(dateRangeDisabled),
  29432. onChangerange: (0, vue.unref)(handleChangeRange),
  29433. onPick: handleRangePick,
  29434. onSelect: (0, vue.unref)(onSelect)
  29435. }, null, 8, [
  29436. "date",
  29437. "min-date",
  29438. "max-date",
  29439. "range-state",
  29440. "disabled-date",
  29441. "cell-class-name",
  29442. "show-week-number",
  29443. "disabled",
  29444. "onChangerange",
  29445. "onSelect"
  29446. ])) : (0, vue.createCommentVNode)("v-if", true),
  29447. (0, vue.unref)(leftCurrentView) === "year" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_year_table_default, {
  29448. key: 1,
  29449. ref_key: "leftCurrentViewRef",
  29450. ref: leftCurrentViewRef,
  29451. "selection-mode": "year",
  29452. date: leftDate.value,
  29453. "disabled-date": (0, vue.unref)(disabledDate),
  29454. "parsed-value": _ctx.parsedValue,
  29455. disabled: (0, vue.unref)(dateRangeDisabled),
  29456. onPick: (0, vue.unref)(handleLeftYearPick)
  29457. }, null, 8, [
  29458. "date",
  29459. "disabled-date",
  29460. "parsed-value",
  29461. "disabled",
  29462. "onPick"
  29463. ])) : (0, vue.createCommentVNode)("v-if", true),
  29464. (0, vue.unref)(leftCurrentView) === "month" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_month_table_default, {
  29465. key: 2,
  29466. ref_key: "leftCurrentViewRef",
  29467. ref: leftCurrentViewRef,
  29468. "selection-mode": "month",
  29469. date: leftDate.value,
  29470. "parsed-value": _ctx.parsedValue,
  29471. "disabled-date": (0, vue.unref)(disabledDate),
  29472. disabled: (0, vue.unref)(dateRangeDisabled),
  29473. onPick: (0, vue.unref)(handleLeftMonthPick)
  29474. }, null, 8, [
  29475. "date",
  29476. "parsed-value",
  29477. "disabled-date",
  29478. "disabled",
  29479. "onPick"
  29480. ])) : (0, vue.createCommentVNode)("v-if", true)
  29481. ], 2),
  29482. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("content"), (0, vue.unref)(drpNs).e("content")], "is-right"]) }, [
  29483. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  29484. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29485. key: 0,
  29486. type: "button",
  29487. disabled: !enableYearArrow.value || (0, vue.unref)(dateRangeDisabled),
  29488. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableYearArrow.value || (0, vue.unref)(dateRangeDisabled))], "d-arrow-left"]),
  29489. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevYear`),
  29490. onClick: rightPrevYear
  29491. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29492. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  29493. _: 1
  29494. })])], 10, _hoisted_8$1)) : (0, vue.createCommentVNode)("v-if", true),
  29495. _ctx.unlinkPanels && (0, vue.unref)(rightCurrentView) === "date" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29496. key: 1,
  29497. type: "button",
  29498. disabled: !enableMonthArrow.value || (0, vue.unref)(dateRangeDisabled),
  29499. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableMonthArrow.value || (0, vue.unref)(dateRangeDisabled))], "arrow-left"]),
  29500. "aria-label": (0, vue.unref)(t)(`el.datepicker.prevMonth`),
  29501. onClick: rightPrevMonth
  29502. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29503. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  29504. _: 1
  29505. })])], 10, _hoisted_9$1)) : (0, vue.createCommentVNode)("v-if", true),
  29506. (0, vue.createElementVNode)("button", {
  29507. type: "button",
  29508. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextYear`),
  29509. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "d-arrow-right"]),
  29510. disabled: (0, vue.unref)(dateRangeDisabled),
  29511. onClick: rightNextYear
  29512. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29513. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  29514. _: 1
  29515. })])], 10, _hoisted_10$1),
  29516. (0, vue.withDirectives)((0, vue.createElementVNode)("button", {
  29517. type: "button",
  29518. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "arrow-right"]),
  29519. disabled: (0, vue.unref)(dateRangeDisabled),
  29520. "aria-label": (0, vue.unref)(t)(`el.datepicker.nextMonth`),
  29521. onClick: rightNextMonth
  29522. }, [(0, vue.renderSlot)(_ctx.$slots, "next-month", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29523. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  29524. _: 1
  29525. })])], 10, _hoisted_11$1), [[vue.vShow, (0, vue.unref)(rightCurrentView) === "date"]]),
  29526. (0, vue.createElementVNode)("div", null, [(0, vue.createElementVNode)("span", {
  29527. role: "button",
  29528. class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header-label")),
  29529. "aria-live": "polite",
  29530. tabindex: _ctx.disabled ? void 0 : 0,
  29531. "aria-disabled": _ctx.disabled,
  29532. onKeydown: _cache[14] || (_cache[14] = (0, vue.withKeys)(($event) => (0, vue.unref)(showRightPicker)("year"), ["enter"])),
  29533. onClick: _cache[15] || (_cache[15] = ($event) => (0, vue.unref)(showRightPicker)("year"))
  29534. }, (0, vue.toDisplayString)((0, vue.unref)(rightYearLabel)), 43, _hoisted_12$1), (0, vue.withDirectives)((0, vue.createElementVNode)("span", {
  29535. role: "button",
  29536. "aria-live": "polite",
  29537. tabindex: _ctx.disabled ? void 0 : 0,
  29538. "aria-disabled": _ctx.disabled,
  29539. class: (0, vue.normalizeClass)([(0, vue.unref)(drpNs).e("header-label"), { active: (0, vue.unref)(rightCurrentView) === "month" }]),
  29540. onKeydown: _cache[16] || (_cache[16] = (0, vue.withKeys)(($event) => (0, vue.unref)(showRightPicker)("month"), ["enter"])),
  29541. onClick: _cache[17] || (_cache[17] = ($event) => (0, vue.unref)(showRightPicker)("month"))
  29542. }, (0, vue.toDisplayString)((0, vue.unref)(t)(`el.datepicker.month${rightDate.value.month() + 1}`)), 43, _hoisted_13$1), [[vue.vShow, (0, vue.unref)(rightCurrentView) === "date"]])])
  29543. ], 2),
  29544. (0, vue.unref)(rightCurrentView) === "date" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_date_table_default, {
  29545. key: 0,
  29546. ref_key: "rightCurrentViewRef",
  29547. ref: rightCurrentViewRef,
  29548. "selection-mode": "range",
  29549. date: rightDate.value,
  29550. "min-date": (0, vue.unref)(minDate),
  29551. "max-date": (0, vue.unref)(maxDate),
  29552. "range-state": (0, vue.unref)(rangeState),
  29553. "disabled-date": (0, vue.unref)(disabledDate),
  29554. "cell-class-name": (0, vue.unref)(cellClassName),
  29555. "show-week-number": _ctx.showWeekNumber,
  29556. disabled: (0, vue.unref)(dateRangeDisabled),
  29557. onChangerange: (0, vue.unref)(handleChangeRange),
  29558. onPick: handleRangePick,
  29559. onSelect: (0, vue.unref)(onSelect)
  29560. }, null, 8, [
  29561. "date",
  29562. "min-date",
  29563. "max-date",
  29564. "range-state",
  29565. "disabled-date",
  29566. "cell-class-name",
  29567. "show-week-number",
  29568. "disabled",
  29569. "onChangerange",
  29570. "onSelect"
  29571. ])) : (0, vue.createCommentVNode)("v-if", true),
  29572. (0, vue.unref)(rightCurrentView) === "year" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_year_table_default, {
  29573. key: 1,
  29574. ref_key: "rightCurrentViewRef",
  29575. ref: rightCurrentViewRef,
  29576. "selection-mode": "year",
  29577. date: rightDate.value,
  29578. "disabled-date": (0, vue.unref)(disabledDate),
  29579. "parsed-value": _ctx.parsedValue,
  29580. disabled: (0, vue.unref)(dateRangeDisabled),
  29581. onPick: (0, vue.unref)(handleRightYearPick)
  29582. }, null, 8, [
  29583. "date",
  29584. "disabled-date",
  29585. "parsed-value",
  29586. "disabled",
  29587. "onPick"
  29588. ])) : (0, vue.createCommentVNode)("v-if", true),
  29589. (0, vue.unref)(rightCurrentView) === "month" ? ((0, vue.openBlock)(), (0, vue.createBlock)(basic_month_table_default, {
  29590. key: 2,
  29591. ref_key: "rightCurrentViewRef",
  29592. ref: rightCurrentViewRef,
  29593. "selection-mode": "month",
  29594. date: rightDate.value,
  29595. "parsed-value": _ctx.parsedValue,
  29596. "disabled-date": (0, vue.unref)(disabledDate),
  29597. disabled: (0, vue.unref)(dateRangeDisabled),
  29598. onPick: (0, vue.unref)(handleRightMonthPick)
  29599. }, null, 8, [
  29600. "date",
  29601. "parsed-value",
  29602. "disabled-date",
  29603. "disabled",
  29604. "onPick"
  29605. ])) : (0, vue.createCommentVNode)("v-if", true)
  29606. ], 2)
  29607. ], 2)
  29608. ], 2), _ctx.showFooter && showTime.value && (_ctx.showConfirm || (0, vue.unref)(clearable)) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  29609. key: 0,
  29610. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("footer"))
  29611. }, [(0, vue.unref)(clearable) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), {
  29612. key: 0,
  29613. text: "",
  29614. size: "small",
  29615. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("link-btn")),
  29616. onClick: onClear
  29617. }, {
  29618. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.clear")), 1)]),
  29619. _: 1
  29620. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), _ctx.showConfirm ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), {
  29621. key: 1,
  29622. plain: "",
  29623. size: "small",
  29624. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("link-btn")),
  29625. disabled: btnDisabled.value,
  29626. onClick: _cache[18] || (_cache[18] = ($event) => (0, vue.unref)(handleRangeConfirm)(false))
  29627. }, {
  29628. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.datepicker.confirm")), 1)]),
  29629. _: 1
  29630. }, 8, ["class", "disabled"])) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  29631. };
  29632. }
  29633. });
  29634. //#endregion
  29635. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-date-range.vue
  29636. var panel_date_range_default = panel_date_range_vue_vue_type_script_setup_true_lang_default;
  29637. //#endregion
  29638. //#region ../../packages/components/date-picker-panel/src/props/panel-month-range.ts
  29639. const panelMonthRangeProps = buildProps({ ...panelRangeSharedProps });
  29640. const panelMonthRangeEmits = [
  29641. "pick",
  29642. "set-picker-option",
  29643. "calendar-change"
  29644. ];
  29645. //#endregion
  29646. //#region ../../packages/components/date-picker-panel/src/composables/use-month-range-header.ts
  29647. const useMonthRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => {
  29648. const { t } = useLocale();
  29649. const leftPrevYear = () => {
  29650. leftDate.value = leftDate.value.subtract(1, "year");
  29651. if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(1, "year");
  29652. };
  29653. const rightNextYear = () => {
  29654. if (!unlinkPanels.value) leftDate.value = leftDate.value.add(1, "year");
  29655. rightDate.value = rightDate.value.add(1, "year");
  29656. };
  29657. const leftNextYear = () => {
  29658. leftDate.value = leftDate.value.add(1, "year");
  29659. };
  29660. const rightPrevYear = () => {
  29661. rightDate.value = rightDate.value.subtract(1, "year");
  29662. };
  29663. return {
  29664. leftPrevYear,
  29665. rightNextYear,
  29666. leftNextYear,
  29667. rightPrevYear,
  29668. leftLabel: (0, vue.computed)(() => {
  29669. return `${leftDate.value.year()} ${t("el.datepicker.year")}`;
  29670. }),
  29671. rightLabel: (0, vue.computed)(() => {
  29672. return `${rightDate.value.year()} ${t("el.datepicker.year")}`;
  29673. }),
  29674. leftYear: (0, vue.computed)(() => {
  29675. return leftDate.value.year();
  29676. }),
  29677. rightYear: (0, vue.computed)(() => {
  29678. return rightDate.value.year() === leftDate.value.year() ? leftDate.value.year() + 1 : rightDate.value.year();
  29679. })
  29680. };
  29681. };
  29682. //#endregion
  29683. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-month-range.vue?vue&type=script&setup=true&lang.ts
  29684. const _hoisted_1$45 = ["disabled", "onClick"];
  29685. const _hoisted_2$27 = ["disabled"];
  29686. const _hoisted_3$12 = ["disabled"];
  29687. const _hoisted_4$9 = ["disabled"];
  29688. const _hoisted_5$6 = ["disabled"];
  29689. const unit$1 = "year";
  29690. var panel_month_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  29691. name: "DatePickerMonthRange",
  29692. __name: "panel-month-range",
  29693. props: panelMonthRangeProps,
  29694. emits: panelMonthRangeEmits,
  29695. setup(__props, { emit: __emit }) {
  29696. const props = __props;
  29697. const emit = __emit;
  29698. const { lang } = useLocale();
  29699. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  29700. const isDefaultFormat = (0, vue.inject)(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  29701. const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
  29702. const format = (0, vue.toRef)(pickerBase.props, "format");
  29703. const defaultValue = (0, vue.toRef)(pickerBase.props, "defaultValue");
  29704. const leftDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value));
  29705. const rightDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value).add(1, unit$1));
  29706. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props, {
  29707. defaultValue,
  29708. leftDate,
  29709. rightDate,
  29710. unit: unit$1,
  29711. sortDates
  29712. });
  29713. const hasShortcuts = (0, vue.computed)(() => !!shortcuts.length);
  29714. const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useMonthRangeHeader({
  29715. unlinkPanels: (0, vue.toRef)(props, "unlinkPanels"),
  29716. leftDate,
  29717. rightDate
  29718. });
  29719. const enableYearArrow = (0, vue.computed)(() => {
  29720. return props.unlinkPanels && rightYear.value > leftYear.value + 1;
  29721. });
  29722. const handleRangePick = (val, close = true) => {
  29723. const minDate_ = val.minDate;
  29724. const maxDate_ = val.maxDate;
  29725. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  29726. emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
  29727. maxDate.value = maxDate_;
  29728. minDate.value = minDate_;
  29729. if (!close) return;
  29730. handleRangeConfirm();
  29731. };
  29732. const handleClear = () => {
  29733. let valueOnClear = null;
  29734. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  29735. leftDate.value = getDefaultValue((0, vue.unref)(defaultValue), {
  29736. lang: (0, vue.unref)(lang),
  29737. unit: "year",
  29738. unlinkPanels: props.unlinkPanels
  29739. })[0];
  29740. rightDate.value = leftDate.value.add(1, "year");
  29741. emit("pick", valueOnClear);
  29742. };
  29743. const parseUserInput = (value) => {
  29744. return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
  29745. };
  29746. function sortDates(minDate, maxDate) {
  29747. if (props.unlinkPanels && maxDate) rightDate.value = (minDate?.year() || 0) === maxDate.year() ? maxDate.add(1, unit$1) : maxDate;
  29748. else rightDate.value = leftDate.value.add(1, unit$1);
  29749. }
  29750. const monthRangeDisabled = useFormDisabled();
  29751. (0, vue.watch)(() => props.visible, (visible) => {
  29752. if (!visible && rangeState.value.selecting) {
  29753. parseValue(props.parsedValue);
  29754. onSelect(false);
  29755. }
  29756. });
  29757. emit("set-picker-option", ["isValidValue", isValidRange]);
  29758. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  29759. emit("set-picker-option", ["handleClear", handleClear]);
  29760. return (_ctx, _cache) => {
  29761. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([
  29762. (0, vue.unref)(ppNs).b(),
  29763. (0, vue.unref)(drpNs).b(),
  29764. (0, vue.unref)(ppNs).is("border", _ctx.border),
  29765. (0, vue.unref)(ppNs).is("disabled", (0, vue.unref)(monthRangeDisabled)),
  29766. { "has-sidebar": Boolean(_ctx.$slots.sidebar) || hasShortcuts.value }
  29767. ]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body-wrapper")) }, [
  29768. (0, vue.renderSlot)(_ctx.$slots, "sidebar", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar")) }),
  29769. hasShortcuts.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  29770. key: 0,
  29771. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar"))
  29772. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(shortcuts), (shortcut, key) => {
  29773. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29774. key,
  29775. type: "button",
  29776. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("shortcut")),
  29777. disabled: (0, vue.unref)(monthRangeDisabled),
  29778. onClick: ($event) => (0, vue.unref)(handleShortcutClick)(shortcut)
  29779. }, (0, vue.toDisplayString)(shortcut.text), 11, _hoisted_1$45);
  29780. }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true),
  29781. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("content"), (0, vue.unref)(drpNs).e("content")], "is-left"]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  29782. (0, vue.createElementVNode)("button", {
  29783. type: "button",
  29784. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "d-arrow-left"]),
  29785. disabled: (0, vue.unref)(monthRangeDisabled),
  29786. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(leftPrevYear) && (0, vue.unref)(leftPrevYear)(...args))
  29787. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29788. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  29789. _: 1
  29790. })])], 10, _hoisted_2$27),
  29791. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29792. key: 0,
  29793. type: "button",
  29794. disabled: !enableYearArrow.value || (0, vue.unref)(monthRangeDisabled),
  29795. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableYearArrow.value || (0, vue.unref)(monthRangeDisabled))], "d-arrow-right"]),
  29796. onClick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(leftNextYear) && (0, vue.unref)(leftNextYear)(...args))
  29797. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29798. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  29799. _: 1
  29800. })])], 10, _hoisted_3$12)) : (0, vue.createCommentVNode)("v-if", true),
  29801. (0, vue.createElementVNode)("div", null, (0, vue.toDisplayString)((0, vue.unref)(leftLabel)), 1)
  29802. ], 2), (0, vue.createVNode)(basic_month_table_default, {
  29803. "selection-mode": "range",
  29804. date: leftDate.value,
  29805. "min-date": (0, vue.unref)(minDate),
  29806. "max-date": (0, vue.unref)(maxDate),
  29807. "range-state": (0, vue.unref)(rangeState),
  29808. "disabled-date": (0, vue.unref)(disabledDate),
  29809. disabled: (0, vue.unref)(monthRangeDisabled),
  29810. "cell-class-name": (0, vue.unref)(cellClassName),
  29811. onChangerange: (0, vue.unref)(handleChangeRange),
  29812. onPick: handleRangePick,
  29813. onSelect: (0, vue.unref)(onSelect)
  29814. }, null, 8, [
  29815. "date",
  29816. "min-date",
  29817. "max-date",
  29818. "range-state",
  29819. "disabled-date",
  29820. "disabled",
  29821. "cell-class-name",
  29822. "onChangerange",
  29823. "onSelect"
  29824. ])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("content"), (0, vue.unref)(drpNs).e("content")], "is-right"]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  29825. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  29826. key: 0,
  29827. type: "button",
  29828. disabled: !enableYearArrow.value || (0, vue.unref)(monthRangeDisabled),
  29829. class: (0, vue.normalizeClass)([[(0, vue.unref)(ppNs).e("icon-btn"), (0, vue.unref)(ppNs).is("disabled", !enableYearArrow.value || (0, vue.unref)(monthRangeDisabled))], "d-arrow-left"]),
  29830. onClick: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(rightPrevYear) && (0, vue.unref)(rightPrevYear)(...args))
  29831. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29832. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  29833. _: 1
  29834. })])], 10, _hoisted_4$9)) : (0, vue.createCommentVNode)("v-if", true),
  29835. (0, vue.createElementVNode)("button", {
  29836. type: "button",
  29837. class: (0, vue.normalizeClass)([(0, vue.unref)(ppNs).e("icon-btn"), "d-arrow-right"]),
  29838. disabled: (0, vue.unref)(monthRangeDisabled),
  29839. onClick: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(rightNextYear) && (0, vue.unref)(rightNextYear)(...args))
  29840. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  29841. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  29842. _: 1
  29843. })])], 10, _hoisted_5$6),
  29844. (0, vue.createElementVNode)("div", null, (0, vue.toDisplayString)((0, vue.unref)(rightLabel)), 1)
  29845. ], 2), (0, vue.createVNode)(basic_month_table_default, {
  29846. "selection-mode": "range",
  29847. date: rightDate.value,
  29848. "min-date": (0, vue.unref)(minDate),
  29849. "max-date": (0, vue.unref)(maxDate),
  29850. "range-state": (0, vue.unref)(rangeState),
  29851. "disabled-date": (0, vue.unref)(disabledDate),
  29852. disabled: (0, vue.unref)(monthRangeDisabled),
  29853. "cell-class-name": (0, vue.unref)(cellClassName),
  29854. onChangerange: (0, vue.unref)(handleChangeRange),
  29855. onPick: handleRangePick,
  29856. onSelect: (0, vue.unref)(onSelect)
  29857. }, null, 8, [
  29858. "date",
  29859. "min-date",
  29860. "max-date",
  29861. "range-state",
  29862. "disabled-date",
  29863. "disabled",
  29864. "cell-class-name",
  29865. "onChangerange",
  29866. "onSelect"
  29867. ])], 2)], 2)
  29868. ], 2)], 2);
  29869. };
  29870. }
  29871. });
  29872. //#endregion
  29873. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-month-range.vue
  29874. var panel_month_range_default = panel_month_range_vue_vue_type_script_setup_true_lang_default;
  29875. //#endregion
  29876. //#region ../../packages/components/date-picker-panel/src/props/panel-year-range.ts
  29877. const panelYearRangeProps = buildProps({ ...panelRangeSharedProps });
  29878. const panelYearRangeEmits = [
  29879. "pick",
  29880. "set-picker-option",
  29881. "calendar-change"
  29882. ];
  29883. //#endregion
  29884. //#region ../../packages/components/date-picker-panel/src/composables/use-year-range-header.ts
  29885. const useYearRangeHeader = ({ unlinkPanels, leftDate, rightDate }) => {
  29886. const leftPrevYear = () => {
  29887. leftDate.value = leftDate.value.subtract(10, "year");
  29888. if (!unlinkPanels.value) rightDate.value = rightDate.value.subtract(10, "year");
  29889. };
  29890. const rightNextYear = () => {
  29891. if (!unlinkPanels.value) leftDate.value = leftDate.value.add(10, "year");
  29892. rightDate.value = rightDate.value.add(10, "year");
  29893. };
  29894. const leftNextYear = () => {
  29895. leftDate.value = leftDate.value.add(10, "year");
  29896. };
  29897. const rightPrevYear = () => {
  29898. rightDate.value = rightDate.value.subtract(10, "year");
  29899. };
  29900. return {
  29901. leftPrevYear,
  29902. rightNextYear,
  29903. leftNextYear,
  29904. rightPrevYear,
  29905. leftLabel: (0, vue.computed)(() => {
  29906. const leftStartDate = Math.floor(leftDate.value.year() / 10) * 10;
  29907. return `${leftStartDate}-${leftStartDate + 9}`;
  29908. }),
  29909. rightLabel: (0, vue.computed)(() => {
  29910. const rightStartDate = Math.floor(rightDate.value.year() / 10) * 10;
  29911. return `${rightStartDate}-${rightStartDate + 9}`;
  29912. }),
  29913. leftYear: (0, vue.computed)(() => {
  29914. return Math.floor(leftDate.value.year() / 10) * 10 + 9;
  29915. }),
  29916. rightYear: (0, vue.computed)(() => {
  29917. return Math.floor(rightDate.value.year() / 10) * 10;
  29918. })
  29919. };
  29920. };
  29921. //#endregion
  29922. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-year-range.vue?vue&type=script&setup=true&lang.ts
  29923. const _hoisted_1$44 = ["disabled", "onClick"];
  29924. const _hoisted_2$26 = ["disabled"];
  29925. const _hoisted_3$11 = ["disabled"];
  29926. const _hoisted_4$8 = ["disabled"];
  29927. const _hoisted_5$5 = ["disabled"];
  29928. const step = 10;
  29929. const unit = "year";
  29930. var panel_year_range_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  29931. name: "DatePickerYearRange",
  29932. __name: "panel-year-range",
  29933. props: panelYearRangeProps,
  29934. emits: panelYearRangeEmits,
  29935. setup(__props, { emit: __emit }) {
  29936. const props = __props;
  29937. const emit = __emit;
  29938. const { lang } = useLocale();
  29939. const leftDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value));
  29940. const rightDate = (0, vue.ref)((0, import_dayjs_min.default)().locale(lang.value).add(step, unit));
  29941. const isDefaultFormat = (0, vue.inject)(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, void 0);
  29942. const pickerBase = (0, vue.inject)(PICKER_BASE_INJECTION_KEY);
  29943. const { shortcuts, disabledDate, cellClassName } = pickerBase.props;
  29944. const format = (0, vue.toRef)(pickerBase.props, "format");
  29945. const defaultValue = (0, vue.toRef)(pickerBase.props, "defaultValue");
  29946. const { minDate, maxDate, rangeState, ppNs, drpNs, handleChangeRange, handleRangeConfirm, handleShortcutClick, onSelect, parseValue } = useRangePicker(props, {
  29947. defaultValue,
  29948. leftDate,
  29949. rightDate,
  29950. step,
  29951. unit,
  29952. sortDates
  29953. });
  29954. const { leftPrevYear, rightNextYear, leftNextYear, rightPrevYear, leftLabel, rightLabel, leftYear, rightYear } = useYearRangeHeader({
  29955. unlinkPanels: (0, vue.toRef)(props, "unlinkPanels"),
  29956. leftDate,
  29957. rightDate
  29958. });
  29959. const yearRangeDisabled = useFormDisabled();
  29960. const hasShortcuts = (0, vue.computed)(() => !!shortcuts.length);
  29961. const panelKls = (0, vue.computed)(() => [
  29962. ppNs.b(),
  29963. drpNs.b(),
  29964. ppNs.is("border", props.border),
  29965. ppNs.is("disabled", yearRangeDisabled.value),
  29966. { "has-sidebar": Boolean((0, vue.useSlots)().sidebar) || hasShortcuts.value }
  29967. ]);
  29968. const leftPanelKls = (0, vue.computed)(() => {
  29969. return {
  29970. content: [
  29971. ppNs.e("content"),
  29972. drpNs.e("content"),
  29973. "is-left"
  29974. ],
  29975. arrowLeftBtn: [ppNs.e("icon-btn"), "d-arrow-left"],
  29976. arrowRightBtn: [
  29977. ppNs.e("icon-btn"),
  29978. ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
  29979. "d-arrow-right"
  29980. ]
  29981. };
  29982. });
  29983. const rightPanelKls = (0, vue.computed)(() => {
  29984. return {
  29985. content: [
  29986. ppNs.e("content"),
  29987. drpNs.e("content"),
  29988. "is-right"
  29989. ],
  29990. arrowLeftBtn: [
  29991. ppNs.e("icon-btn"),
  29992. ppNs.is("disabled", !enableYearArrow.value || yearRangeDisabled.value),
  29993. "d-arrow-left"
  29994. ],
  29995. arrowRightBtn: [ppNs.e("icon-btn"), "d-arrow-right"]
  29996. };
  29997. });
  29998. const enableYearArrow = (0, vue.computed)(() => {
  29999. return props.unlinkPanels && rightYear.value > leftYear.value + 1;
  30000. });
  30001. const handleRangePick = (val, close = true) => {
  30002. const minDate_ = val.minDate;
  30003. const maxDate_ = val.maxDate;
  30004. if (maxDate.value === maxDate_ && minDate.value === minDate_) return;
  30005. emit("calendar-change", [minDate_.toDate(), maxDate_ && maxDate_.toDate()]);
  30006. maxDate.value = maxDate_;
  30007. minDate.value = minDate_;
  30008. if (!close) return;
  30009. handleRangeConfirm();
  30010. };
  30011. const parseUserInput = (value) => {
  30012. return correctlyParseUserInput(value, format.value, lang.value, isDefaultFormat);
  30013. };
  30014. const isValidValue = (date) => {
  30015. return isValidRange(date) && (disabledDate ? !disabledDate(date[0].toDate()) && !disabledDate(date[1].toDate()) : true);
  30016. };
  30017. const handleClear = () => {
  30018. let valueOnClear = null;
  30019. if (pickerBase?.emptyValues) valueOnClear = pickerBase.emptyValues.valueOnClear.value;
  30020. const defaultArr = getDefaultValue((0, vue.unref)(defaultValue), {
  30021. lang: (0, vue.unref)(lang),
  30022. step,
  30023. unit,
  30024. unlinkPanels: props.unlinkPanels
  30025. });
  30026. leftDate.value = defaultArr[0];
  30027. rightDate.value = defaultArr[1];
  30028. emit("pick", valueOnClear);
  30029. };
  30030. function sortDates(minDate, maxDate) {
  30031. if (props.unlinkPanels && maxDate) {
  30032. const minDateYear = minDate?.year() || 0;
  30033. const maxDateYear = maxDate.year();
  30034. rightDate.value = minDateYear + step > maxDateYear ? maxDate.add(step, unit) : maxDate;
  30035. } else rightDate.value = leftDate.value.add(step, unit);
  30036. }
  30037. (0, vue.watch)(() => props.visible, (visible) => {
  30038. if (!visible && rangeState.value.selecting) {
  30039. parseValue(props.parsedValue);
  30040. onSelect(false);
  30041. }
  30042. });
  30043. emit("set-picker-option", ["isValidValue", isValidValue]);
  30044. emit("set-picker-option", ["parseUserInput", parseUserInput]);
  30045. emit("set-picker-option", ["handleClear", handleClear]);
  30046. return (_ctx, _cache) => {
  30047. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(panelKls.value) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body-wrapper")) }, [
  30048. (0, vue.renderSlot)(_ctx.$slots, "sidebar", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar")) }),
  30049. hasShortcuts.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  30050. key: 0,
  30051. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("sidebar"))
  30052. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(shortcuts), (shortcut, key) => {
  30053. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  30054. key,
  30055. type: "button",
  30056. class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("shortcut")),
  30057. disabled: (0, vue.unref)(yearRangeDisabled),
  30058. onClick: ($event) => (0, vue.unref)(handleShortcutClick)(shortcut)
  30059. }, (0, vue.toDisplayString)(shortcut.text), 11, _hoisted_1$44);
  30060. }), 128))], 2)) : (0, vue.createCommentVNode)("v-if", true),
  30061. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ppNs).e("body")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(leftPanelKls.value.content) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  30062. (0, vue.createElementVNode)("button", {
  30063. type: "button",
  30064. class: (0, vue.normalizeClass)(leftPanelKls.value.arrowLeftBtn),
  30065. disabled: (0, vue.unref)(yearRangeDisabled),
  30066. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(leftPrevYear) && (0, vue.unref)(leftPrevYear)(...args))
  30067. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  30068. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  30069. _: 1
  30070. })])], 10, _hoisted_2$26),
  30071. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  30072. key: 0,
  30073. type: "button",
  30074. disabled: !enableYearArrow.value || (0, vue.unref)(yearRangeDisabled),
  30075. class: (0, vue.normalizeClass)(leftPanelKls.value.arrowRightBtn),
  30076. onClick: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(leftNextYear) && (0, vue.unref)(leftNextYear)(...args))
  30077. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  30078. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  30079. _: 1
  30080. })])], 10, _hoisted_3$11)) : (0, vue.createCommentVNode)("v-if", true),
  30081. (0, vue.createElementVNode)("div", null, (0, vue.toDisplayString)((0, vue.unref)(leftLabel)), 1)
  30082. ], 2), (0, vue.createVNode)(basic_year_table_default, {
  30083. "selection-mode": "range",
  30084. date: leftDate.value,
  30085. "min-date": (0, vue.unref)(minDate),
  30086. "max-date": (0, vue.unref)(maxDate),
  30087. "range-state": (0, vue.unref)(rangeState),
  30088. "disabled-date": (0, vue.unref)(disabledDate),
  30089. disabled: (0, vue.unref)(yearRangeDisabled),
  30090. "cell-class-name": (0, vue.unref)(cellClassName),
  30091. onChangerange: (0, vue.unref)(handleChangeRange),
  30092. onPick: handleRangePick,
  30093. onSelect: (0, vue.unref)(onSelect)
  30094. }, null, 8, [
  30095. "date",
  30096. "min-date",
  30097. "max-date",
  30098. "range-state",
  30099. "disabled-date",
  30100. "disabled",
  30101. "cell-class-name",
  30102. "onChangerange",
  30103. "onSelect"
  30104. ])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(rightPanelKls.value.content) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(drpNs).e("header")) }, [
  30105. _ctx.unlinkPanels ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  30106. key: 0,
  30107. type: "button",
  30108. disabled: !enableYearArrow.value || (0, vue.unref)(yearRangeDisabled),
  30109. class: (0, vue.normalizeClass)(rightPanelKls.value.arrowLeftBtn),
  30110. onClick: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(rightPrevYear) && (0, vue.unref)(rightPrevYear)(...args))
  30111. }, [(0, vue.renderSlot)(_ctx.$slots, "prev-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  30112. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_left_default))]),
  30113. _: 1
  30114. })])], 10, _hoisted_4$8)) : (0, vue.createCommentVNode)("v-if", true),
  30115. (0, vue.createElementVNode)("button", {
  30116. type: "button",
  30117. class: (0, vue.normalizeClass)(rightPanelKls.value.arrowRightBtn),
  30118. disabled: (0, vue.unref)(yearRangeDisabled),
  30119. onClick: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(rightNextYear) && (0, vue.unref)(rightNextYear)(...args))
  30120. }, [(0, vue.renderSlot)(_ctx.$slots, "next-year", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  30121. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(d_arrow_right_default))]),
  30122. _: 1
  30123. })])], 10, _hoisted_5$5),
  30124. (0, vue.createElementVNode)("div", null, (0, vue.toDisplayString)((0, vue.unref)(rightLabel)), 1)
  30125. ], 2), (0, vue.createVNode)(basic_year_table_default, {
  30126. "selection-mode": "range",
  30127. date: rightDate.value,
  30128. "min-date": (0, vue.unref)(minDate),
  30129. "max-date": (0, vue.unref)(maxDate),
  30130. "range-state": (0, vue.unref)(rangeState),
  30131. "disabled-date": (0, vue.unref)(disabledDate),
  30132. disabled: (0, vue.unref)(yearRangeDisabled),
  30133. "cell-class-name": (0, vue.unref)(cellClassName),
  30134. onChangerange: (0, vue.unref)(handleChangeRange),
  30135. onPick: handleRangePick,
  30136. onSelect: (0, vue.unref)(onSelect)
  30137. }, null, 8, [
  30138. "date",
  30139. "min-date",
  30140. "max-date",
  30141. "range-state",
  30142. "disabled-date",
  30143. "disabled",
  30144. "cell-class-name",
  30145. "onChangerange",
  30146. "onSelect"
  30147. ])], 2)], 2)
  30148. ], 2)], 2);
  30149. };
  30150. }
  30151. });
  30152. //#endregion
  30153. //#region ../../packages/components/date-picker-panel/src/date-picker-com/panel-year-range.vue
  30154. var panel_year_range_default = panel_year_range_vue_vue_type_script_setup_true_lang_default;
  30155. //#endregion
  30156. //#region ../../packages/components/date-picker-panel/src/panel-utils.ts
  30157. const getPanel = function(type) {
  30158. switch (type) {
  30159. case "daterange":
  30160. case "datetimerange": return panel_date_range_default;
  30161. case "monthrange": return panel_month_range_default;
  30162. case "yearrange": return panel_year_range_default;
  30163. default: return panel_date_pick_default;
  30164. }
  30165. };
  30166. //#endregion
  30167. //#region ../../packages/components/date-picker-panel/src/date-picker-panel.tsx
  30168. function _isSlot$7(s) {
  30169. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  30170. }
  30171. import_dayjs_min.default.extend(import_localeData.default);
  30172. import_dayjs_min.default.extend(import_advancedFormat.default);
  30173. import_dayjs_min.default.extend(import_customParseFormat.default);
  30174. import_dayjs_min.default.extend(import_weekOfYear.default);
  30175. import_dayjs_min.default.extend(import_weekYear.default);
  30176. import_dayjs_min.default.extend(import_dayOfYear.default);
  30177. import_dayjs_min.default.extend(import_isSameOrAfter.default);
  30178. import_dayjs_min.default.extend(import_isSameOrBefore.default);
  30179. var date_picker_panel_default = /* @__PURE__ */ (0, vue.defineComponent)({
  30180. name: "ElDatePickerPanel",
  30181. install: null,
  30182. inheritAttrs: false,
  30183. props: datePickerPanelProps,
  30184. emits: [
  30185. UPDATE_MODEL_EVENT,
  30186. "calendar-change",
  30187. "panel-change",
  30188. "visible-change",
  30189. "clear"
  30190. ],
  30191. setup(props, { slots, emit, attrs }) {
  30192. const ns = useNamespace("picker-panel");
  30193. if (isUndefined((0, vue.inject)(PICKER_BASE_INJECTION_KEY, void 0))) (0, vue.provide)(PICKER_BASE_INJECTION_KEY, { props: (0, vue.reactive)({ ...(0, vue.toRefs)(props) }) });
  30194. (0, vue.provide)(ROOT_PICKER_INJECTION_KEY, {
  30195. slots,
  30196. pickerNs: ns
  30197. });
  30198. const { parsedValue, onCalendarChange, onPanelChange, onSetPickerOption, onPick } = (0, vue.inject)(ROOT_COMMON_PICKER_INJECTION_KEY, () => useCommonPicker(props, emit), true);
  30199. return () => {
  30200. return (0, vue.createVNode)(getPanel(props.type), (0, vue.mergeProps)(omit(attrs, "onPick"), props, {
  30201. "parsedValue": parsedValue.value,
  30202. "onSet-picker-option": onSetPickerOption,
  30203. "onCalendar-change": onCalendarChange,
  30204. "onPanel-change": onPanelChange,
  30205. "onClear": () => emit("clear"),
  30206. "onPick": onPick
  30207. }), _isSlot$7(slots) ? slots : { default: () => [slots] });
  30208. };
  30209. }
  30210. });
  30211. //#endregion
  30212. //#region ../../packages/components/date-picker-panel/index.ts
  30213. const ElDatePickerPanel = withInstall(date_picker_panel_default);
  30214. //#endregion
  30215. //#region ../../packages/components/date-picker/src/props.ts
  30216. const datePickerProps = buildProps({
  30217. ...timePickerDefaultProps,
  30218. type: {
  30219. type: definePropType(String),
  30220. default: "date"
  30221. }
  30222. });
  30223. //#endregion
  30224. //#region ../../packages/components/date-picker/src/date-picker.tsx
  30225. function _isSlot$6(s) {
  30226. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  30227. }
  30228. var date_picker_default = /* @__PURE__ */ (0, vue.defineComponent)({
  30229. name: "ElDatePicker",
  30230. install: null,
  30231. props: datePickerProps,
  30232. emits: [UPDATE_MODEL_EVENT],
  30233. setup(props, { expose, emit, slots }) {
  30234. (0, vue.provide)(ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY, (0, vue.computed)(() => {
  30235. return !props.format;
  30236. }));
  30237. (0, vue.provide)(PICKER_POPPER_OPTIONS_INJECTION_KEY, (0, vue.reactive)((0, vue.toRef)(props, "popperOptions")));
  30238. const commonPicker = (0, vue.ref)();
  30239. expose({
  30240. focus: () => {
  30241. commonPicker.value?.focus();
  30242. },
  30243. blur: () => {
  30244. commonPicker.value?.blur();
  30245. },
  30246. handleOpen: () => {
  30247. commonPicker.value?.handleOpen();
  30248. },
  30249. handleClose: () => {
  30250. commonPicker.value?.handleClose();
  30251. }
  30252. });
  30253. const onModelValueUpdated = (val) => {
  30254. emit(UPDATE_MODEL_EVENT, val);
  30255. };
  30256. return () => {
  30257. const format = props.format ?? (DEFAULT_FORMATS_DATEPICKER[props.type] || DEFAULT_FORMATS_DATE);
  30258. return (0, vue.createVNode)(picker_default, (0, vue.mergeProps)(props, {
  30259. "format": format,
  30260. "type": props.type,
  30261. "ref": commonPicker,
  30262. "onUpdate:modelValue": onModelValueUpdated
  30263. }), {
  30264. default: (scopedProps) => (0, vue.createVNode)(ElDatePickerPanel, (0, vue.mergeProps)({
  30265. "disabled": props.disabled,
  30266. "editable": props.editable,
  30267. "border": false
  30268. }, scopedProps), _isSlot$6(slots) ? slots : { default: () => [slots] }),
  30269. "range-separator": slots["range-separator"]
  30270. });
  30271. };
  30272. }
  30273. });
  30274. //#endregion
  30275. //#region ../../packages/components/date-picker/index.ts
  30276. const ElDatePicker = withInstall(date_picker_default);
  30277. //#endregion
  30278. //#region ../../packages/components/descriptions/src/description.ts
  30279. /**
  30280. * @deprecated Removed after 3.0.0, Use `DescriptionProps` instead.
  30281. */
  30282. const descriptionProps = buildProps({
  30283. border: Boolean,
  30284. column: {
  30285. type: Number,
  30286. default: 3
  30287. },
  30288. direction: {
  30289. type: String,
  30290. values: ["horizontal", "vertical"],
  30291. default: "horizontal"
  30292. },
  30293. size: useSizeProp,
  30294. title: {
  30295. type: String,
  30296. default: ""
  30297. },
  30298. extra: {
  30299. type: String,
  30300. default: ""
  30301. },
  30302. labelWidth: { type: [String, Number] }
  30303. });
  30304. //#endregion
  30305. //#region ../../packages/components/descriptions/src/descriptions-row.ts
  30306. /**
  30307. * @deprecated Removed after 3.0.0, Use `DescriptionsRowProps` instead.
  30308. */
  30309. const descriptionsRowProps = buildProps({ row: {
  30310. type: definePropType(Array),
  30311. default: () => []
  30312. } });
  30313. //#endregion
  30314. //#region ../../packages/components/descriptions/src/token.ts
  30315. const descriptionsKey = Symbol("elDescriptions");
  30316. //#endregion
  30317. //#region ../../packages/components/descriptions/src/descriptions-cell.ts
  30318. var descriptions_cell_default = (0, vue.defineComponent)({
  30319. name: "ElDescriptionsCell",
  30320. props: {
  30321. cell: { type: Object },
  30322. tag: {
  30323. type: String,
  30324. default: "td"
  30325. },
  30326. type: { type: String }
  30327. },
  30328. setup() {
  30329. return { descriptions: (0, vue.inject)(descriptionsKey, {}) };
  30330. },
  30331. render() {
  30332. const item = getNormalizedProps(this.cell);
  30333. const directives = (this.cell?.dirs || []).map((dire) => {
  30334. const { dir, arg, modifiers, value } = dire;
  30335. return [
  30336. dir,
  30337. value,
  30338. arg,
  30339. modifiers
  30340. ];
  30341. });
  30342. const { border, direction } = this.descriptions;
  30343. const isVertical = direction === "vertical";
  30344. const renderLabel = () => this.cell?.children?.label?.() || item.label;
  30345. const renderContent = () => this.cell?.children?.default?.();
  30346. const span = item.span;
  30347. const rowspan = item.rowspan;
  30348. const align = item.align ? `is-${item.align}` : "";
  30349. const labelAlign = item.labelAlign ? `is-${item.labelAlign}` : align;
  30350. const className = item.className;
  30351. const labelClassName = item.labelClassName;
  30352. const style = {
  30353. width: addUnit(this.type === "label" ? item.labelWidth ?? this.descriptions.labelWidth ?? item.width : item.width),
  30354. minWidth: addUnit(item.minWidth)
  30355. };
  30356. const ns = useNamespace("descriptions");
  30357. switch (this.type) {
  30358. case "label": return (0, vue.withDirectives)((0, vue.h)(this.tag, {
  30359. style,
  30360. class: [
  30361. ns.e("cell"),
  30362. ns.e("label"),
  30363. ns.is("bordered-label", border),
  30364. ns.is("vertical-label", isVertical),
  30365. labelAlign,
  30366. labelClassName
  30367. ],
  30368. colSpan: isVertical ? span : 1,
  30369. rowspan: isVertical ? 1 : rowspan
  30370. }, renderLabel()), directives);
  30371. case "content": return (0, vue.withDirectives)((0, vue.h)(this.tag, {
  30372. style,
  30373. class: [
  30374. ns.e("cell"),
  30375. ns.e("content"),
  30376. ns.is("bordered-content", border),
  30377. ns.is("vertical-content", isVertical),
  30378. align,
  30379. className
  30380. ],
  30381. colSpan: isVertical ? span : span * 2 - 1,
  30382. rowspan: isVertical ? rowspan * 2 - 1 : rowspan
  30383. }, renderContent()), directives);
  30384. default: {
  30385. const label = renderLabel();
  30386. const labelStyle = {};
  30387. const width = addUnit(item.labelWidth ?? this.descriptions.labelWidth);
  30388. if (width) {
  30389. labelStyle.width = width;
  30390. labelStyle.display = "inline-block";
  30391. }
  30392. return (0, vue.withDirectives)((0, vue.h)("td", {
  30393. style,
  30394. class: [ns.e("cell"), align],
  30395. colSpan: span,
  30396. rowspan
  30397. }, [!isNil(label) ? (0, vue.h)("span", {
  30398. style: labelStyle,
  30399. class: [ns.e("label"), labelClassName]
  30400. }, label) : void 0, (0, vue.h)("span", { class: [ns.e("content"), className] }, renderContent())]), directives);
  30401. }
  30402. }
  30403. }
  30404. });
  30405. //#endregion
  30406. //#region ../../packages/components/descriptions/src/descriptions-row.vue?vue&type=script&setup=true&lang.ts
  30407. const _hoisted_1$43 = { key: 1 };
  30408. var descriptions_row_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  30409. name: "ElDescriptionsRow",
  30410. __name: "descriptions-row",
  30411. props: descriptionsRowProps,
  30412. setup(__props) {
  30413. const descriptions = (0, vue.inject)(descriptionsKey, {});
  30414. return (_ctx, _cache) => {
  30415. return (0, vue.unref)(descriptions).direction === "vertical" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.row, (cell, _index) => {
  30416. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(descriptions_cell_default), {
  30417. key: `tr1-${_index}`,
  30418. cell,
  30419. tag: "th",
  30420. type: "label"
  30421. }, null, 8, ["cell"]);
  30422. }), 128))]), (0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.row, (cell, _index) => {
  30423. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(descriptions_cell_default), {
  30424. key: `tr2-${_index}`,
  30425. cell,
  30426. tag: "td",
  30427. type: "content"
  30428. }, null, 8, ["cell"]);
  30429. }), 128))])], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("tr", _hoisted_1$43, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.row, (cell, _index) => {
  30430. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: `tr3-${_index}` }, [(0, vue.unref)(descriptions).border ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createVNode)((0, vue.unref)(descriptions_cell_default), {
  30431. cell,
  30432. tag: "td",
  30433. type: "label"
  30434. }, null, 8, ["cell"]), (0, vue.createVNode)((0, vue.unref)(descriptions_cell_default), {
  30435. cell,
  30436. tag: "td",
  30437. type: "content"
  30438. }, null, 8, ["cell"])], 64)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(descriptions_cell_default), {
  30439. key: 1,
  30440. cell,
  30441. tag: "td",
  30442. type: "both"
  30443. }, null, 8, ["cell"]))], 64);
  30444. }), 128))]));
  30445. };
  30446. }
  30447. });
  30448. //#endregion
  30449. //#region ../../packages/components/descriptions/src/descriptions-row.vue
  30450. var descriptions_row_default = descriptions_row_vue_vue_type_script_setup_true_lang_default;
  30451. //#endregion
  30452. //#region ../../packages/components/descriptions/src/constants.ts
  30453. const COMPONENT_NAME$10 = "ElDescriptionsItem";
  30454. //#endregion
  30455. //#region ../../packages/components/descriptions/src/description.vue?vue&type=script&setup=true&lang.ts
  30456. var description_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  30457. name: "ElDescriptions",
  30458. __name: "description",
  30459. props: descriptionProps,
  30460. setup(__props) {
  30461. const props = __props;
  30462. const ns = useNamespace("descriptions");
  30463. const descriptionsSize = useFormSize();
  30464. const slots = (0, vue.useSlots)();
  30465. (0, vue.provide)(descriptionsKey, props);
  30466. const descriptionKls = (0, vue.computed)(() => [ns.b(), ns.m(descriptionsSize.value)]);
  30467. const filledNode = (node, span, count, isLast = false) => {
  30468. if (!node.props) node.props = {};
  30469. if (span > count) node.props.span = count;
  30470. if (isLast) node.props.span = span;
  30471. return node;
  30472. };
  30473. const getRows = () => {
  30474. if (!slots.default) return [];
  30475. const children = flattedChildren(slots.default()).filter((node) => node?.type?.name === COMPONENT_NAME$10);
  30476. const rows = [];
  30477. let temp = [];
  30478. let count = props.column;
  30479. let totalSpan = 0;
  30480. const rowspanTemp = [];
  30481. children.forEach((node, index) => {
  30482. const span = node.props?.span || 1;
  30483. const rowspan = node.props?.rowspan || 1;
  30484. const rowNo = rows.length;
  30485. rowspanTemp[rowNo] ||= 0;
  30486. if (rowspan > 1) for (let i = 1; i < rowspan; i++) {
  30487. rowspanTemp[rowNo + i] ||= 0;
  30488. rowspanTemp[rowNo + i]++;
  30489. totalSpan++;
  30490. }
  30491. if (rowspanTemp[rowNo] > 0) {
  30492. count -= rowspanTemp[rowNo];
  30493. rowspanTemp[rowNo] = 0;
  30494. }
  30495. if (index < children.length - 1) totalSpan += span > count ? count : span;
  30496. if (index === children.length - 1) {
  30497. const lastSpan = props.column - totalSpan % props.column;
  30498. temp.push(filledNode(node, lastSpan, count, true));
  30499. rows.push(temp);
  30500. return;
  30501. }
  30502. if (span < count) {
  30503. count -= span;
  30504. temp.push(node);
  30505. } else {
  30506. temp.push(filledNode(node, span, count));
  30507. rows.push(temp);
  30508. count = props.column;
  30509. temp = [];
  30510. }
  30511. });
  30512. return rows;
  30513. };
  30514. return (_ctx, _cache) => {
  30515. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)(descriptionKls.value) }, [__props.title || __props.extra || _ctx.$slots.title || _ctx.$slots.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  30516. key: 0,
  30517. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("header"))
  30518. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")) }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("extra")) }, [(0, vue.renderSlot)(_ctx.$slots, "extra", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.extra), 1)])], 2)], 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("body")) }, [(0, vue.createElementVNode)("table", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("table"), (0, vue.unref)(ns).is("bordered", __props.border)]) }, [(0, vue.createElementVNode)("tbody", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(getRows(), (row, _index) => {
  30519. return (0, vue.openBlock)(), (0, vue.createBlock)(descriptions_row_default, {
  30520. key: _index,
  30521. row
  30522. }, null, 8, ["row"]);
  30523. }), 128))])], 2)], 2)], 2);
  30524. };
  30525. }
  30526. });
  30527. //#endregion
  30528. //#region ../../packages/components/descriptions/src/description.vue
  30529. var description_default = description_vue_vue_type_script_setup_true_lang_default;
  30530. //#endregion
  30531. //#region ../../packages/components/descriptions/src/description-item.ts
  30532. const descriptionItemProps = buildProps({
  30533. label: {
  30534. type: String,
  30535. default: ""
  30536. },
  30537. span: {
  30538. type: Number,
  30539. default: 1
  30540. },
  30541. rowspan: {
  30542. type: Number,
  30543. default: 1
  30544. },
  30545. width: {
  30546. type: [String, Number],
  30547. default: ""
  30548. },
  30549. minWidth: {
  30550. type: [String, Number],
  30551. default: ""
  30552. },
  30553. labelWidth: { type: [String, Number] },
  30554. align: {
  30555. type: String,
  30556. values: columnAlignment,
  30557. default: "left"
  30558. },
  30559. labelAlign: {
  30560. type: String,
  30561. values: columnAlignment
  30562. },
  30563. className: {
  30564. type: String,
  30565. default: ""
  30566. },
  30567. labelClassName: {
  30568. type: String,
  30569. default: ""
  30570. }
  30571. });
  30572. const DescriptionItem = (0, vue.defineComponent)({
  30573. name: COMPONENT_NAME$10,
  30574. props: descriptionItemProps
  30575. });
  30576. //#endregion
  30577. //#region ../../packages/components/descriptions/index.ts
  30578. const ElDescriptions = withInstall(description_default, { DescriptionsItem: DescriptionItem });
  30579. const ElDescriptionsItem = withNoopInstall(DescriptionItem);
  30580. //#endregion
  30581. //#region ../../packages/components/dialog/src/dialog-content.ts
  30582. /**
  30583. * @deprecated Removed after 3.0.0, Use `DialogContentProps` instead.
  30584. */
  30585. const dialogContentProps = buildProps({
  30586. center: Boolean,
  30587. alignCenter: {
  30588. type: Boolean,
  30589. default: void 0
  30590. },
  30591. closeIcon: { type: iconPropType },
  30592. draggable: {
  30593. type: Boolean,
  30594. default: void 0
  30595. },
  30596. overflow: {
  30597. type: Boolean,
  30598. default: void 0
  30599. },
  30600. fullscreen: Boolean,
  30601. headerClass: String,
  30602. bodyClass: String,
  30603. footerClass: String,
  30604. showClose: {
  30605. type: Boolean,
  30606. default: true
  30607. },
  30608. title: {
  30609. type: String,
  30610. default: ""
  30611. },
  30612. ariaLevel: {
  30613. type: String,
  30614. default: "2"
  30615. }
  30616. });
  30617. const dialogContentEmits = { close: () => true };
  30618. const dialogContentPropsDefaults = {
  30619. alignCenter: void 0,
  30620. draggable: void 0,
  30621. overflow: void 0,
  30622. showClose: true,
  30623. title: "",
  30624. ariaLevel: "2"
  30625. };
  30626. //#endregion
  30627. //#region ../../packages/components/dialog/src/dialog.ts
  30628. /**
  30629. * @deprecated Removed after 3.0.0, Use `DialogProps` instead.
  30630. */
  30631. const dialogProps = buildProps({
  30632. ...dialogContentProps,
  30633. appendToBody: Boolean,
  30634. appendTo: {
  30635. type: teleportProps.to.type,
  30636. default: "body"
  30637. },
  30638. beforeClose: { type: definePropType(Function) },
  30639. destroyOnClose: Boolean,
  30640. closeOnClickModal: {
  30641. type: Boolean,
  30642. default: true
  30643. },
  30644. closeOnPressEscape: {
  30645. type: Boolean,
  30646. default: true
  30647. },
  30648. lockScroll: {
  30649. type: Boolean,
  30650. default: true
  30651. },
  30652. modal: {
  30653. type: Boolean,
  30654. default: true
  30655. },
  30656. modalPenetrable: Boolean,
  30657. openDelay: {
  30658. type: Number,
  30659. default: 0
  30660. },
  30661. closeDelay: {
  30662. type: Number,
  30663. default: 0
  30664. },
  30665. top: { type: String },
  30666. modelValue: Boolean,
  30667. modalClass: String,
  30668. headerClass: String,
  30669. bodyClass: String,
  30670. footerClass: String,
  30671. width: { type: [String, Number] },
  30672. zIndex: { type: Number },
  30673. trapFocus: Boolean,
  30674. headerAriaLevel: {
  30675. type: String,
  30676. default: "2"
  30677. },
  30678. transition: {
  30679. type: definePropType([String, Object]),
  30680. default: void 0
  30681. }
  30682. });
  30683. const dialogEmits = {
  30684. open: () => true,
  30685. opened: () => true,
  30686. close: () => true,
  30687. closed: () => true,
  30688. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  30689. openAutoFocus: () => true,
  30690. closeAutoFocus: () => true
  30691. };
  30692. const dialogContextKey = Symbol("dialogContextKey");
  30693. const dialogPropsDefaults = {
  30694. ...dialogContentPropsDefaults,
  30695. appendTo: "body",
  30696. closeOnClickModal: true,
  30697. closeOnPressEscape: true,
  30698. lockScroll: true,
  30699. modal: true,
  30700. openDelay: 0,
  30701. closeDelay: 0,
  30702. headerAriaLevel: "2",
  30703. transition: void 0
  30704. };
  30705. //#endregion
  30706. //#region ../../packages/components/overlay/src/overlay.ts
  30707. const overlayProps = buildProps({
  30708. mask: {
  30709. type: Boolean,
  30710. default: true
  30711. },
  30712. customMaskEvent: Boolean,
  30713. overlayClass: { type: definePropType([
  30714. String,
  30715. Array,
  30716. Object
  30717. ]) },
  30718. zIndex: { type: definePropType([String, Number]) }
  30719. });
  30720. const overlayEmits = { click: (evt) => evt instanceof MouseEvent };
  30721. const BLOCK = "overlay";
  30722. var overlay_default = (0, vue.defineComponent)({
  30723. name: "ElOverlay",
  30724. props: overlayProps,
  30725. emits: overlayEmits,
  30726. setup(props, { slots, emit }) {
  30727. const ns = useNamespace(BLOCK);
  30728. const onMaskClick = (e) => {
  30729. emit("click", e);
  30730. };
  30731. const { onClick, onMousedown, onMouseup } = useSameTarget(props.customMaskEvent ? void 0 : onMaskClick);
  30732. return () => {
  30733. return props.mask ? (0, vue.createVNode)("div", {
  30734. class: [ns.b(), props.overlayClass],
  30735. style: { zIndex: props.zIndex },
  30736. onClick,
  30737. onMousedown,
  30738. onMouseup
  30739. }, [(0, vue.renderSlot)(slots, "default")], PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS, [
  30740. "onClick",
  30741. "onMouseup",
  30742. "onMousedown"
  30743. ]) : (0, vue.h)("div", {
  30744. class: props.overlayClass,
  30745. style: {
  30746. zIndex: props.zIndex,
  30747. position: "fixed",
  30748. top: "0px",
  30749. right: "0px",
  30750. bottom: "0px",
  30751. left: "0px"
  30752. }
  30753. }, [(0, vue.renderSlot)(slots, "default")]);
  30754. };
  30755. }
  30756. });
  30757. //#endregion
  30758. //#region ../../packages/components/overlay/index.ts
  30759. const ElOverlay = overlay_default;
  30760. //#endregion
  30761. //#region ../../packages/components/dialog/src/constants.ts
  30762. const dialogInjectionKey = Symbol("dialogInjectionKey");
  30763. const DEFAULT_DIALOG_TRANSITION = "dialog-fade";
  30764. //#endregion
  30765. //#region ../../packages/components/dialog/src/dialog-content.vue?vue&type=script&setup=true&lang.ts
  30766. const _hoisted_1$42 = ["aria-level"];
  30767. const _hoisted_2$25 = ["aria-label"];
  30768. const _hoisted_3$10 = ["id"];
  30769. var dialog_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  30770. name: "ElDialogContent",
  30771. __name: "dialog-content",
  30772. props: dialogContentProps,
  30773. emits: dialogContentEmits,
  30774. setup(__props, { expose: __expose }) {
  30775. const { t } = useLocale();
  30776. const { Close } = CloseComponents;
  30777. const props = __props;
  30778. const { dialogRef, headerRef, bodyId, ns, style } = (0, vue.inject)(dialogInjectionKey);
  30779. const { focusTrapRef } = (0, vue.inject)(FOCUS_TRAP_INJECTION_KEY);
  30780. const composedDialogRef = composeRefs(focusTrapRef, dialogRef);
  30781. const draggable = (0, vue.computed)(() => !!props.draggable);
  30782. const { resetPosition, updatePosition, isDragging } = useDraggable(dialogRef, headerRef, draggable, (0, vue.computed)(() => !!props.overflow));
  30783. const dialogKls = (0, vue.computed)(() => [
  30784. ns.b(),
  30785. ns.is("fullscreen", props.fullscreen),
  30786. ns.is("draggable", draggable.value),
  30787. ns.is("dragging", isDragging.value),
  30788. ns.is("align-center", !!props.alignCenter),
  30789. { [ns.m("center")]: props.center }
  30790. ]);
  30791. __expose({
  30792. resetPosition,
  30793. updatePosition
  30794. });
  30795. return (_ctx, _cache) => {
  30796. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  30797. ref: (0, vue.unref)(composedDialogRef),
  30798. class: (0, vue.normalizeClass)(dialogKls.value),
  30799. style: (0, vue.normalizeStyle)((0, vue.unref)(style)),
  30800. tabindex: "-1"
  30801. }, [
  30802. (0, vue.createElementVNode)("header", {
  30803. ref_key: "headerRef",
  30804. ref: headerRef,
  30805. class: (0, vue.normalizeClass)([
  30806. (0, vue.unref)(ns).e("header"),
  30807. __props.headerClass,
  30808. { "show-close": __props.showClose }
  30809. ])
  30810. }, [(0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createElementVNode)("span", {
  30811. role: "heading",
  30812. "aria-level": __props.ariaLevel,
  30813. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title"))
  30814. }, (0, vue.toDisplayString)(__props.title), 11, _hoisted_1$42)]), __props.showClose ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  30815. key: 0,
  30816. "aria-label": (0, vue.unref)(t)("el.dialog.close"),
  30817. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("headerbtn")),
  30818. type: "button",
  30819. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
  30820. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close")) }, {
  30821. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.closeIcon || (0, vue.unref)(Close))))]),
  30822. _: 1
  30823. }, 8, ["class"])], 10, _hoisted_2$25)) : (0, vue.createCommentVNode)("v-if", true)], 2),
  30824. (0, vue.createElementVNode)("div", {
  30825. id: (0, vue.unref)(bodyId),
  30826. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("body"), __props.bodyClass])
  30827. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 10, _hoisted_3$10),
  30828. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("footer", {
  30829. key: 0,
  30830. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("footer"), __props.footerClass])
  30831. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  30832. ], 6);
  30833. };
  30834. }
  30835. });
  30836. //#endregion
  30837. //#region ../../packages/components/dialog/src/dialog-content.vue
  30838. var dialog_content_default = dialog_content_vue_vue_type_script_setup_true_lang_default;
  30839. //#endregion
  30840. //#region ../../packages/components/dialog/src/use-dialog.ts
  30841. const COMPONENT_NAME$9 = "ElDialog";
  30842. const useDialog = (props, targetRef) => {
  30843. const emit = (0, vue.getCurrentInstance)().emit;
  30844. const { nextZIndex } = useZIndex();
  30845. let lastPosition = "";
  30846. const titleId = useId();
  30847. const bodyId = useId();
  30848. const visible = (0, vue.ref)(false);
  30849. const closed = (0, vue.ref)(false);
  30850. const rendered = (0, vue.ref)(false);
  30851. const zIndex = (0, vue.ref)(props.zIndex ?? nextZIndex());
  30852. const closing = (0, vue.ref)(false);
  30853. let openTimer = void 0;
  30854. let closeTimer = void 0;
  30855. const config = useGlobalConfig();
  30856. const namespace = (0, vue.computed)(() => config.value?.namespace ?? defaultNamespace);
  30857. const globalConfig = (0, vue.computed)(() => config.value?.dialog);
  30858. const style = (0, vue.computed)(() => {
  30859. const style = {};
  30860. const varPrefix = `--${namespace.value}-dialog`;
  30861. if (!props.fullscreen) {
  30862. if (props.top) style[`${varPrefix}-margin-top`] = props.top;
  30863. const width = addUnit(props.width);
  30864. if (width) style[`${varPrefix}-width`] = width;
  30865. }
  30866. return style;
  30867. });
  30868. const _draggable = (0, vue.computed)(() => (props.draggable ?? globalConfig.value?.draggable ?? false) && !props.fullscreen);
  30869. const _alignCenter = (0, vue.computed)(() => props.alignCenter ?? globalConfig.value?.alignCenter ?? false);
  30870. const _overflow = (0, vue.computed)(() => props.overflow ?? globalConfig.value?.overflow ?? false);
  30871. const overlayDialogStyle = (0, vue.computed)(() => {
  30872. if (_alignCenter.value) return { display: "flex" };
  30873. return {};
  30874. });
  30875. const transitionConfig = (0, vue.computed)(() => {
  30876. const transition = props.transition ?? globalConfig.value?.transition ?? DEFAULT_DIALOG_TRANSITION;
  30877. const baseConfig = {
  30878. name: transition,
  30879. onAfterEnter: afterEnter,
  30880. onBeforeLeave: beforeLeave,
  30881. onAfterLeave: afterLeave
  30882. };
  30883. if (isObject$1(transition)) {
  30884. const config = { ...transition };
  30885. const _mergeHook = (userHook, defaultHook) => {
  30886. return (el) => {
  30887. if (isArray$1(userHook)) userHook.forEach((fn) => {
  30888. if (isFunction$1(fn)) fn(el);
  30889. });
  30890. else if (isFunction$1(userHook)) userHook(el);
  30891. defaultHook();
  30892. };
  30893. };
  30894. config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter);
  30895. config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave);
  30896. config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave);
  30897. if (!config.name) {
  30898. config.name = DEFAULT_DIALOG_TRANSITION;
  30899. /* @__PURE__ */ debugWarn(COMPONENT_NAME$9, `transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`);
  30900. }
  30901. return config;
  30902. }
  30903. return baseConfig;
  30904. });
  30905. function afterEnter() {
  30906. emit("opened");
  30907. }
  30908. function afterLeave() {
  30909. emit("closed");
  30910. emit(UPDATE_MODEL_EVENT, false);
  30911. if (props.destroyOnClose) rendered.value = false;
  30912. closing.value = false;
  30913. }
  30914. function beforeLeave() {
  30915. closing.value = true;
  30916. emit("close");
  30917. }
  30918. function open() {
  30919. closeTimer?.();
  30920. openTimer?.();
  30921. if (props.openDelay && props.openDelay > 0) ({stop: openTimer} = useTimeoutFn(() => doOpen(), props.openDelay));
  30922. else doOpen();
  30923. }
  30924. function close() {
  30925. openTimer?.();
  30926. closeTimer?.();
  30927. if (props.closeDelay && props.closeDelay > 0) ({stop: closeTimer} = useTimeoutFn(() => doClose(), props.closeDelay));
  30928. else doClose();
  30929. }
  30930. function handleClose() {
  30931. function hide(shouldCancel) {
  30932. if (shouldCancel) return;
  30933. closed.value = true;
  30934. visible.value = false;
  30935. }
  30936. if (props.beforeClose) props.beforeClose(hide);
  30937. else close();
  30938. }
  30939. function onModalClick() {
  30940. if (props.closeOnClickModal) handleClose();
  30941. }
  30942. function doOpen() {
  30943. if (!isClient) return;
  30944. visible.value = true;
  30945. }
  30946. function doClose() {
  30947. visible.value = false;
  30948. }
  30949. function onOpenAutoFocus() {
  30950. emit("openAutoFocus");
  30951. }
  30952. function onCloseAutoFocus() {
  30953. emit("closeAutoFocus");
  30954. }
  30955. function onFocusoutPrevented(event) {
  30956. if (event.detail?.focusReason === "pointer") event.preventDefault();
  30957. }
  30958. if (props.lockScroll) useLockscreen(visible);
  30959. function onCloseRequested() {
  30960. if (props.closeOnPressEscape) handleClose();
  30961. }
  30962. (0, vue.watch)(() => props.zIndex, () => {
  30963. zIndex.value = props.zIndex ?? nextZIndex();
  30964. });
  30965. (0, vue.watch)(() => props.modelValue, (val) => {
  30966. if (val) {
  30967. closed.value = false;
  30968. closing.value = false;
  30969. open();
  30970. rendered.value = true;
  30971. zIndex.value = props.zIndex ?? nextZIndex();
  30972. (0, vue.nextTick)(() => {
  30973. emit("open");
  30974. if (targetRef.value) {
  30975. targetRef.value.parentElement.scrollTop = 0;
  30976. targetRef.value.parentElement.scrollLeft = 0;
  30977. targetRef.value.scrollTop = 0;
  30978. }
  30979. });
  30980. } else if (visible.value) close();
  30981. });
  30982. (0, vue.watch)(() => props.fullscreen, (val) => {
  30983. if (!targetRef.value) return;
  30984. if (val) {
  30985. lastPosition = targetRef.value.style.transform;
  30986. targetRef.value.style.transform = "";
  30987. } else targetRef.value.style.transform = lastPosition;
  30988. });
  30989. (0, vue.onMounted)(() => {
  30990. if (props.modelValue) {
  30991. visible.value = true;
  30992. rendered.value = true;
  30993. open();
  30994. }
  30995. });
  30996. return {
  30997. afterEnter,
  30998. afterLeave,
  30999. beforeLeave,
  31000. handleClose,
  31001. onModalClick,
  31002. close,
  31003. doClose,
  31004. onOpenAutoFocus,
  31005. onCloseAutoFocus,
  31006. onCloseRequested,
  31007. onFocusoutPrevented,
  31008. titleId,
  31009. bodyId,
  31010. closed,
  31011. style,
  31012. overlayDialogStyle,
  31013. rendered,
  31014. visible,
  31015. zIndex,
  31016. transitionConfig,
  31017. _draggable,
  31018. _alignCenter,
  31019. _overflow,
  31020. closing
  31021. };
  31022. };
  31023. //#endregion
  31024. //#region ../../packages/components/dialog/src/dialog.vue?vue&type=script&setup=true&lang.ts
  31025. const _hoisted_1$41 = [
  31026. "aria-label",
  31027. "aria-labelledby",
  31028. "aria-describedby"
  31029. ];
  31030. var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  31031. name: "ElDialog",
  31032. inheritAttrs: false,
  31033. __name: "dialog",
  31034. props: dialogProps,
  31035. emits: dialogEmits,
  31036. setup(__props, { expose: __expose }) {
  31037. const props = __props;
  31038. const slots = (0, vue.useSlots)();
  31039. useDeprecated({
  31040. scope: "el-dialog",
  31041. from: "the title slot",
  31042. replacement: "the header slot",
  31043. version: "3.0.0",
  31044. ref: "https://element-plus.org/en-US/component/dialog.html#slots"
  31045. }, (0, vue.computed)(() => !!slots.title));
  31046. const ns = useNamespace("dialog");
  31047. const dialogRef = (0, vue.ref)();
  31048. const headerRef = (0, vue.ref)();
  31049. const dialogContentRef = (0, vue.ref)();
  31050. const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, transitionConfig, zIndex, _draggable, _alignCenter, _overflow, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, closing } = useDialog(props, dialogRef);
  31051. (0, vue.provide)(dialogInjectionKey, {
  31052. dialogRef,
  31053. headerRef,
  31054. bodyId,
  31055. ns,
  31056. rendered,
  31057. style
  31058. });
  31059. const overlayEvent = useSameTarget(onModalClick);
  31060. const penetrable = (0, vue.computed)(() => props.modalPenetrable && !props.modal && !props.fullscreen);
  31061. const resetPosition = () => {
  31062. dialogContentRef.value?.resetPosition();
  31063. };
  31064. __expose({
  31065. visible,
  31066. dialogContentRef,
  31067. resetPosition,
  31068. handleClose
  31069. });
  31070. return (_ctx, _cache) => {
  31071. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTeleport), {
  31072. to: __props.appendTo,
  31073. disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
  31074. }, {
  31075. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(vue.Transition, (0, vue.mergeProps)((0, vue.unref)(transitionConfig), { persisted: "" }), {
  31076. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElOverlay), {
  31077. "custom-mask-event": "",
  31078. mask: __props.modal,
  31079. "overlay-class": [
  31080. __props.modalClass ?? "",
  31081. `${(0, vue.unref)(ns).namespace.value}-modal-dialog`,
  31082. (0, vue.unref)(ns).is("penetrable", penetrable.value)
  31083. ],
  31084. "z-index": (0, vue.unref)(zIndex)
  31085. }, {
  31086. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  31087. role: "dialog",
  31088. "aria-modal": "true",
  31089. "aria-label": __props.title || void 0,
  31090. "aria-labelledby": !__props.title ? (0, vue.unref)(titleId) : void 0,
  31091. "aria-describedby": (0, vue.unref)(bodyId),
  31092. class: (0, vue.normalizeClass)([`${(0, vue.unref)(ns).namespace.value}-overlay-dialog`, (0, vue.unref)(ns).is("closing", (0, vue.unref)(closing))]),
  31093. style: (0, vue.normalizeStyle)((0, vue.unref)(overlayDialogStyle)),
  31094. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(overlayEvent).onClick && (0, vue.unref)(overlayEvent).onClick(...args)),
  31095. onMousedown: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(overlayEvent).onMousedown && (0, vue.unref)(overlayEvent).onMousedown(...args)),
  31096. onMouseup: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(overlayEvent).onMouseup && (0, vue.unref)(overlayEvent).onMouseup(...args))
  31097. }, [(0, vue.createVNode)((0, vue.unref)(focus_trap_default), {
  31098. loop: "",
  31099. trapped: (0, vue.unref)(visible),
  31100. "focus-start-el": "container",
  31101. onFocusAfterTrapped: (0, vue.unref)(onOpenAutoFocus),
  31102. onFocusAfterReleased: (0, vue.unref)(onCloseAutoFocus),
  31103. onFocusoutPrevented: (0, vue.unref)(onFocusoutPrevented),
  31104. onReleaseRequested: (0, vue.unref)(onCloseRequested)
  31105. }, {
  31106. default: (0, vue.withCtx)(() => [(0, vue.unref)(rendered) ? ((0, vue.openBlock)(), (0, vue.createBlock)(dialog_content_default, (0, vue.mergeProps)({
  31107. key: 0,
  31108. ref_key: "dialogContentRef",
  31109. ref: dialogContentRef
  31110. }, _ctx.$attrs, {
  31111. center: __props.center,
  31112. "align-center": (0, vue.unref)(_alignCenter),
  31113. "close-icon": __props.closeIcon,
  31114. draggable: (0, vue.unref)(_draggable),
  31115. overflow: (0, vue.unref)(_overflow),
  31116. fullscreen: __props.fullscreen,
  31117. "header-class": __props.headerClass,
  31118. "body-class": __props.bodyClass,
  31119. "footer-class": __props.footerClass,
  31120. "show-close": __props.showClose,
  31121. title: __props.title,
  31122. "aria-level": __props.headerAriaLevel,
  31123. onClose: (0, vue.unref)(handleClose)
  31124. }), (0, vue.createSlots)({
  31125. header: (0, vue.withCtx)(() => [!_ctx.$slots.title ? (0, vue.renderSlot)(_ctx.$slots, "header", {
  31126. key: 0,
  31127. close: (0, vue.unref)(handleClose),
  31128. titleId: (0, vue.unref)(titleId),
  31129. titleClass: (0, vue.unref)(ns).e("title")
  31130. }) : (0, vue.renderSlot)(_ctx.$slots, "title", { key: 1 })]),
  31131. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  31132. _: 2
  31133. }, [_ctx.$slots.footer ? {
  31134. name: "footer",
  31135. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "footer")]),
  31136. key: "0"
  31137. } : void 0]), 1040, [
  31138. "center",
  31139. "align-center",
  31140. "close-icon",
  31141. "draggable",
  31142. "overflow",
  31143. "fullscreen",
  31144. "header-class",
  31145. "body-class",
  31146. "footer-class",
  31147. "show-close",
  31148. "title",
  31149. "aria-level",
  31150. "onClose"
  31151. ])) : (0, vue.createCommentVNode)("v-if", true)]),
  31152. _: 3
  31153. }, 8, [
  31154. "trapped",
  31155. "onFocusAfterTrapped",
  31156. "onFocusAfterReleased",
  31157. "onFocusoutPrevented",
  31158. "onReleaseRequested"
  31159. ])], 46, _hoisted_1$41)]),
  31160. _: 3
  31161. }, 8, [
  31162. "mask",
  31163. "overlay-class",
  31164. "z-index"
  31165. ]), [[vue.vShow, (0, vue.unref)(visible)]])]),
  31166. _: 3
  31167. }, 16)]),
  31168. _: 3
  31169. }, 8, ["to", "disabled"]);
  31170. };
  31171. }
  31172. });
  31173. //#endregion
  31174. //#region ../../packages/components/dialog/src/dialog.vue
  31175. var dialog_default = dialog_vue_vue_type_script_setup_true_lang_default;
  31176. //#endregion
  31177. //#region ../../packages/components/dialog/index.ts
  31178. const ElDialog = withInstall(dialog_default);
  31179. //#endregion
  31180. //#region ../../packages/components/divider/src/divider.ts
  31181. /**
  31182. * @deprecated Removed after 3.0.0, Use `DividerProps` instead.
  31183. */
  31184. const dividerProps = buildProps({
  31185. direction: {
  31186. type: String,
  31187. values: ["horizontal", "vertical"],
  31188. default: "horizontal"
  31189. },
  31190. contentPosition: {
  31191. type: String,
  31192. values: [
  31193. "left",
  31194. "center",
  31195. "right"
  31196. ],
  31197. default: "center"
  31198. },
  31199. borderStyle: {
  31200. type: definePropType(String),
  31201. default: "solid"
  31202. }
  31203. });
  31204. //#endregion
  31205. //#region ../../packages/components/divider/src/divider.vue?vue&type=script&setup=true&lang.ts
  31206. var divider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  31207. name: "ElDivider",
  31208. __name: "divider",
  31209. props: dividerProps,
  31210. setup(__props) {
  31211. const props = __props;
  31212. const ns = useNamespace("divider");
  31213. const dividerStyle = (0, vue.computed)(() => {
  31214. return ns.cssVar({ "border-style": props.borderStyle });
  31215. });
  31216. return (_ctx, _cache) => {
  31217. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  31218. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).m(__props.direction)]),
  31219. style: (0, vue.normalizeStyle)(dividerStyle.value),
  31220. role: "separator"
  31221. }, [_ctx.$slots.default && __props.direction !== "vertical" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  31222. key: 0,
  31223. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("text"), (0, vue.unref)(ns).is(__props.contentPosition)])
  31224. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true)], 6);
  31225. };
  31226. }
  31227. });
  31228. //#endregion
  31229. //#region ../../packages/components/divider/src/divider.vue
  31230. var divider_default = divider_vue_vue_type_script_setup_true_lang_default;
  31231. //#endregion
  31232. //#region ../../packages/components/divider/index.ts
  31233. const ElDivider = withInstall(divider_default);
  31234. //#endregion
  31235. //#region ../../packages/components/drawer/src/drawer.ts
  31236. /**
  31237. * @deprecated Removed after 3.0.0, Use `DrawerProps` instead.
  31238. */
  31239. const drawerProps = buildProps({
  31240. ...dialogProps,
  31241. direction: {
  31242. type: String,
  31243. default: "rtl",
  31244. values: [
  31245. "ltr",
  31246. "rtl",
  31247. "ttb",
  31248. "btt"
  31249. ]
  31250. },
  31251. resizable: Boolean,
  31252. size: {
  31253. type: [String, Number],
  31254. default: "30%"
  31255. },
  31256. withHeader: {
  31257. type: Boolean,
  31258. default: true
  31259. },
  31260. modalFade: {
  31261. type: Boolean,
  31262. default: true
  31263. },
  31264. headerAriaLevel: {
  31265. type: String,
  31266. default: "2"
  31267. }
  31268. });
  31269. const drawerEmits = {
  31270. ...dialogEmits,
  31271. "resize-start": (evt, size) => evt instanceof MouseEvent && typeof size === "number",
  31272. resize: (evt, size) => evt instanceof MouseEvent && typeof size === "number",
  31273. "resize-end": (evt, size) => evt instanceof MouseEvent && typeof size === "number"
  31274. };
  31275. //#endregion
  31276. //#region ../../packages/components/drawer/src/composables/useResizable.ts
  31277. function useResizable(props, target, emit) {
  31278. const { width, height } = useWindowSize();
  31279. const isHorizontal = (0, vue.computed)(() => ["ltr", "rtl"].includes(props.direction));
  31280. const sign = (0, vue.computed)(() => ["ltr", "ttb"].includes(props.direction) ? 1 : -1);
  31281. const windowSize = (0, vue.computed)(() => isHorizontal.value ? width.value : height.value);
  31282. const getSize = (0, vue.computed)(() => {
  31283. return clamp$2(startSize.value + sign.value * offset.value, 4, windowSize.value);
  31284. });
  31285. const startSize = (0, vue.ref)(0);
  31286. const offset = (0, vue.ref)(0);
  31287. const isResizing = (0, vue.ref)(false);
  31288. const hasStartedDragging = (0, vue.ref)(false);
  31289. let startPos = [];
  31290. let cleanups = [];
  31291. const getActualSize = () => {
  31292. const drawerEl = target.value?.closest("[aria-modal=\"true\"]");
  31293. if (drawerEl) return isHorizontal.value ? drawerEl.offsetWidth : drawerEl.offsetHeight;
  31294. return 100;
  31295. };
  31296. (0, vue.watch)(() => [props.size, props.resizable], () => {
  31297. hasStartedDragging.value = false;
  31298. startSize.value = 0;
  31299. offset.value = 0;
  31300. onMouseUp();
  31301. });
  31302. const onMousedown = (e) => {
  31303. if (!props.resizable) return;
  31304. if (!hasStartedDragging.value) {
  31305. startSize.value = getActualSize();
  31306. hasStartedDragging.value = true;
  31307. }
  31308. startPos = [e.pageX, e.pageY];
  31309. isResizing.value = true;
  31310. emit("resize-start", e, startSize.value);
  31311. cleanups.push(useEventListener(window, "mouseup", onMouseUp), useEventListener(window, "mousemove", onMouseMove));
  31312. };
  31313. const onMouseMove = (e) => {
  31314. const { pageX, pageY } = e;
  31315. const offsetX = pageX - startPos[0];
  31316. const offsetY = pageY - startPos[1];
  31317. offset.value = isHorizontal.value ? offsetX : offsetY;
  31318. emit("resize", e, getSize.value);
  31319. };
  31320. const onMouseUp = (e) => {
  31321. if (!isResizing.value) return;
  31322. startPos = [];
  31323. startSize.value = getSize.value;
  31324. offset.value = 0;
  31325. isResizing.value = false;
  31326. cleanups.forEach((cleanup) => cleanup?.());
  31327. cleanups = [];
  31328. if (e) emit("resize-end", e, startSize.value);
  31329. };
  31330. const cleanup = useEventListener(target, "mousedown", onMousedown);
  31331. (0, vue.onBeforeUnmount)(() => {
  31332. cleanup();
  31333. onMouseUp();
  31334. });
  31335. return {
  31336. size: (0, vue.computed)(() => {
  31337. return hasStartedDragging.value ? `${getSize.value}px` : addUnit(props.size);
  31338. }),
  31339. isResizing,
  31340. isHorizontal
  31341. };
  31342. }
  31343. //#endregion
  31344. //#region ../../packages/components/drawer/src/drawer.vue?vue&type=script&setup=true&lang.ts
  31345. const _hoisted_1$40 = [
  31346. "aria-label",
  31347. "aria-labelledby",
  31348. "aria-describedby"
  31349. ];
  31350. const _hoisted_2$24 = ["id", "aria-level"];
  31351. const _hoisted_3$9 = ["aria-label"];
  31352. const _hoisted_4$7 = ["id"];
  31353. var drawer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  31354. name: "ElDrawer",
  31355. inheritAttrs: false,
  31356. __name: "drawer",
  31357. props: drawerProps,
  31358. emits: drawerEmits,
  31359. setup(__props, { expose: __expose, emit: __emit }) {
  31360. const props = __props;
  31361. const emit = __emit;
  31362. const slots = (0, vue.useSlots)();
  31363. useDeprecated({
  31364. scope: "el-drawer",
  31365. from: "the title slot",
  31366. replacement: "the header slot",
  31367. version: "3.0.0",
  31368. ref: "https://element-plus.org/en-US/component/drawer.html#slots"
  31369. }, (0, vue.computed)(() => !!slots.title));
  31370. const drawerRef = (0, vue.ref)();
  31371. const focusStartRef = (0, vue.ref)();
  31372. const draggerRef = (0, vue.ref)();
  31373. const ns = useNamespace("drawer");
  31374. const { t } = useLocale();
  31375. const { afterEnter, afterLeave, beforeLeave, visible, rendered, titleId, bodyId, zIndex, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onFocusoutPrevented, onCloseRequested, handleClose } = useDialog(props, drawerRef);
  31376. const { isHorizontal, size, isResizing } = useResizable(props, draggerRef, emit);
  31377. const penetrable = (0, vue.computed)(() => props.modalPenetrable && !props.modal);
  31378. __expose({
  31379. handleClose,
  31380. afterEnter,
  31381. afterLeave
  31382. });
  31383. return (_ctx, _cache) => {
  31384. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTeleport), {
  31385. to: __props.appendTo,
  31386. disabled: __props.appendTo !== "body" ? false : !__props.appendToBody
  31387. }, {
  31388. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(vue.Transition, {
  31389. name: (0, vue.unref)(ns).b("fade"),
  31390. onAfterEnter: (0, vue.unref)(afterEnter),
  31391. onAfterLeave: (0, vue.unref)(afterLeave),
  31392. onBeforeLeave: (0, vue.unref)(beforeLeave),
  31393. persisted: ""
  31394. }, {
  31395. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElOverlay), {
  31396. mask: __props.modal,
  31397. "overlay-class": [
  31398. (0, vue.unref)(ns).is("drawer"),
  31399. __props.modalClass ?? "",
  31400. `${(0, vue.unref)(ns).namespace.value}-modal-drawer`,
  31401. (0, vue.unref)(ns).is("penetrable", penetrable.value)
  31402. ],
  31403. "z-index": (0, vue.unref)(zIndex),
  31404. onClick: (0, vue.unref)(onModalClick)
  31405. }, {
  31406. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(focus_trap_default), {
  31407. loop: "",
  31408. trapped: (0, vue.unref)(visible),
  31409. "focus-trap-el": drawerRef.value,
  31410. "focus-start-el": focusStartRef.value,
  31411. onFocusAfterTrapped: (0, vue.unref)(onOpenAutoFocus),
  31412. onFocusAfterReleased: (0, vue.unref)(onCloseAutoFocus),
  31413. onFocusoutPrevented: (0, vue.unref)(onFocusoutPrevented),
  31414. onReleaseRequested: (0, vue.unref)(onCloseRequested)
  31415. }, {
  31416. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", (0, vue.mergeProps)({
  31417. ref_key: "drawerRef",
  31418. ref: drawerRef,
  31419. "aria-modal": "true",
  31420. "aria-label": __props.title || void 0,
  31421. "aria-labelledby": !__props.title ? (0, vue.unref)(titleId) : void 0,
  31422. "aria-describedby": (0, vue.unref)(bodyId)
  31423. }, _ctx.$attrs, {
  31424. class: [
  31425. (0, vue.unref)(ns).b(),
  31426. __props.direction,
  31427. (0, vue.unref)(visible) && "open",
  31428. (0, vue.unref)(ns).is("dragging", (0, vue.unref)(isResizing))
  31429. ],
  31430. style: { [(0, vue.unref)(isHorizontal) ? "width" : "height"]: (0, vue.unref)(size) },
  31431. role: "dialog",
  31432. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["stop"]))
  31433. }), [
  31434. (0, vue.createElementVNode)("span", {
  31435. ref_key: "focusStartRef",
  31436. ref: focusStartRef,
  31437. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("sr-focus")),
  31438. tabindex: "-1"
  31439. }, null, 2),
  31440. __props.withHeader ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("header", {
  31441. key: 0,
  31442. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("header"), __props.headerClass])
  31443. }, [!_ctx.$slots.title ? (0, vue.renderSlot)(_ctx.$slots, "header", {
  31444. key: 0,
  31445. close: (0, vue.unref)(handleClose),
  31446. titleId: (0, vue.unref)(titleId),
  31447. titleClass: (0, vue.unref)(ns).e("title")
  31448. }, () => [(0, vue.createElementVNode)("span", {
  31449. id: (0, vue.unref)(titleId),
  31450. role: "heading",
  31451. "aria-level": __props.headerAriaLevel,
  31452. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title"))
  31453. }, (0, vue.toDisplayString)(__props.title), 11, _hoisted_2$24)]) : (0, vue.renderSlot)(_ctx.$slots, "title", { key: 1 }, () => [(0, vue.createCommentVNode)(" DEPRECATED SLOT ")]), __props.showClose ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  31454. key: 2,
  31455. "aria-label": (0, vue.unref)(t)("el.drawer.close"),
  31456. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close-btn")),
  31457. type: "button",
  31458. onClick: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleClose) && (0, vue.unref)(handleClose)(...args))
  31459. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close")) }, {
  31460. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  31461. _: 1
  31462. }, 8, ["class"])], 10, _hoisted_3$9)) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  31463. (0, vue.unref)(rendered) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  31464. key: 1,
  31465. id: (0, vue.unref)(bodyId),
  31466. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("body"), __props.bodyClass])
  31467. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 10, _hoisted_4$7)) : (0, vue.createCommentVNode)("v-if", true),
  31468. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  31469. key: 2,
  31470. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("footer"), __props.footerClass])
  31471. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  31472. __props.resizable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  31473. key: 3,
  31474. ref_key: "draggerRef",
  31475. ref: draggerRef,
  31476. style: (0, vue.normalizeStyle)({ zIndex: (0, vue.unref)(zIndex) }),
  31477. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("dragger"))
  31478. }, null, 6)) : (0, vue.createCommentVNode)("v-if", true)
  31479. ], 16, _hoisted_1$40)]),
  31480. _: 3
  31481. }, 8, [
  31482. "trapped",
  31483. "focus-trap-el",
  31484. "focus-start-el",
  31485. "onFocusAfterTrapped",
  31486. "onFocusAfterReleased",
  31487. "onFocusoutPrevented",
  31488. "onReleaseRequested"
  31489. ])]),
  31490. _: 3
  31491. }, 8, [
  31492. "mask",
  31493. "overlay-class",
  31494. "z-index",
  31495. "onClick"
  31496. ]), [[vue.vShow, (0, vue.unref)(visible)]])]),
  31497. _: 3
  31498. }, 8, [
  31499. "name",
  31500. "onAfterEnter",
  31501. "onAfterLeave",
  31502. "onBeforeLeave"
  31503. ])]),
  31504. _: 3
  31505. }, 8, ["to", "disabled"]);
  31506. };
  31507. }
  31508. });
  31509. //#endregion
  31510. //#region ../../packages/components/drawer/src/drawer.vue
  31511. var drawer_default = drawer_vue_vue_type_script_setup_true_lang_default;
  31512. //#endregion
  31513. //#region ../../packages/components/drawer/index.ts
  31514. const ElDrawer = withInstall(drawer_default);
  31515. //#endregion
  31516. //#region ../../packages/components/collection/src/collection.vue?vue&type=script&lang.ts
  31517. var collection_vue_vue_type_script_lang_default = (0, vue.defineComponent)({ inheritAttrs: false });
  31518. //#endregion
  31519. //#region ../../packages/components/collection/src/collection.vue
  31520. function _sfc_render$16(_ctx, _cache, $props, $setup, $data, $options) {
  31521. return (0, vue.renderSlot)(_ctx.$slots, "default");
  31522. }
  31523. var collection_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_vue_vue_type_script_lang_default, [["render", _sfc_render$16]]);
  31524. //#endregion
  31525. //#region ../../packages/components/collection/src/collection-item.vue?vue&type=script&lang.ts
  31526. var collection_item_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  31527. name: "ElCollectionItem",
  31528. inheritAttrs: false
  31529. });
  31530. //#endregion
  31531. //#region ../../packages/components/collection/src/collection-item.vue
  31532. function _sfc_render$15(_ctx, _cache, $props, $setup, $data, $options) {
  31533. return (0, vue.renderSlot)(_ctx.$slots, "default");
  31534. }
  31535. var collection_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(collection_item_vue_vue_type_script_lang_default, [["render", _sfc_render$15]]);
  31536. //#endregion
  31537. //#region ../../packages/components/collection/src/collection.ts
  31538. const COLLECTION_ITEM_SIGN = `data-el-collection-item`;
  31539. const createCollectionWithScope = (name) => {
  31540. const COLLECTION_NAME = `El${name}Collection`;
  31541. const COLLECTION_ITEM_NAME = `${COLLECTION_NAME}Item`;
  31542. const COLLECTION_INJECTION_KEY = Symbol(COLLECTION_NAME);
  31543. const COLLECTION_ITEM_INJECTION_KEY = Symbol(COLLECTION_ITEM_NAME);
  31544. return {
  31545. COLLECTION_INJECTION_KEY,
  31546. COLLECTION_ITEM_INJECTION_KEY,
  31547. ElCollection: Object.assign({}, collection_default, {
  31548. name: COLLECTION_NAME,
  31549. setup() {
  31550. const collectionRef = (0, vue.ref)();
  31551. const itemMap = /* @__PURE__ */ new Map();
  31552. const getItems = (() => {
  31553. const collectionEl = (0, vue.unref)(collectionRef);
  31554. if (!collectionEl) return [];
  31555. const orderedNodes = Array.from(collectionEl.querySelectorAll(`[${COLLECTION_ITEM_SIGN}]`));
  31556. return [...itemMap.values()].sort((a, b) => orderedNodes.indexOf(a.ref) - orderedNodes.indexOf(b.ref));
  31557. });
  31558. (0, vue.provide)(COLLECTION_INJECTION_KEY, {
  31559. itemMap,
  31560. getItems,
  31561. collectionRef
  31562. });
  31563. }
  31564. }),
  31565. ElCollectionItem: Object.assign({}, collection_item_default, {
  31566. name: COLLECTION_ITEM_NAME,
  31567. setup(_, { attrs }) {
  31568. const collectionItemRef = (0, vue.ref)();
  31569. const collectionInjection = (0, vue.inject)(COLLECTION_INJECTION_KEY, void 0);
  31570. (0, vue.provide)(COLLECTION_ITEM_INJECTION_KEY, { collectionItemRef });
  31571. (0, vue.onMounted)(() => {
  31572. const collectionItemEl = (0, vue.unref)(collectionItemRef);
  31573. if (collectionItemEl) collectionInjection.itemMap.set(collectionItemEl, {
  31574. ref: collectionItemEl,
  31575. ...attrs
  31576. });
  31577. });
  31578. (0, vue.onBeforeUnmount)(() => {
  31579. const collectionItemEl = (0, vue.unref)(collectionItemRef);
  31580. collectionInjection.itemMap.delete(collectionItemEl);
  31581. });
  31582. }
  31583. })
  31584. };
  31585. };
  31586. //#endregion
  31587. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.ts
  31588. const rovingFocusGroupProps = buildProps({
  31589. style: { type: definePropType([
  31590. String,
  31591. Array,
  31592. Object
  31593. ]) },
  31594. currentTabId: { type: definePropType(String) },
  31595. defaultCurrentTabId: String,
  31596. loop: Boolean,
  31597. dir: {
  31598. type: String,
  31599. values: ["ltr", "rtl"],
  31600. default: "ltr"
  31601. },
  31602. orientation: { type: definePropType(String) },
  31603. onBlur: Function,
  31604. onFocus: Function,
  31605. onMousedown: Function
  31606. });
  31607. const { ElCollection, ElCollectionItem, COLLECTION_INJECTION_KEY, COLLECTION_ITEM_INJECTION_KEY } = createCollectionWithScope("RovingFocusGroup");
  31608. //#endregion
  31609. //#region ../../packages/components/roving-focus-group/src/tokens.ts
  31610. const ROVING_FOCUS_GROUP_INJECTION_KEY = Symbol("elRovingFocusGroup");
  31611. const ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY = Symbol("elRovingFocusGroupItem");
  31612. //#endregion
  31613. //#region ../../packages/components/roving-focus-group/src/utils.ts
  31614. const MAP_KEY_TO_FOCUS_INTENT = {
  31615. ArrowLeft: "prev",
  31616. ArrowUp: "prev",
  31617. ArrowRight: "next",
  31618. ArrowDown: "next",
  31619. PageUp: "first",
  31620. Home: "first",
  31621. PageDown: "last",
  31622. End: "last"
  31623. };
  31624. const getDirectionAwareKey = (key, dir) => {
  31625. if (dir !== "rtl") return key;
  31626. switch (key) {
  31627. case EVENT_CODE.right: return EVENT_CODE.left;
  31628. case EVENT_CODE.left: return EVENT_CODE.right;
  31629. default: return key;
  31630. }
  31631. };
  31632. const getFocusIntent = (event, orientation, dir) => {
  31633. const key = getDirectionAwareKey(getEventCode(event), dir);
  31634. if (orientation === "vertical" && [EVENT_CODE.left, EVENT_CODE.right].includes(key)) return void 0;
  31635. if (orientation === "horizontal" && [EVENT_CODE.up, EVENT_CODE.down].includes(key)) return void 0;
  31636. return MAP_KEY_TO_FOCUS_INTENT[key];
  31637. };
  31638. const reorderArray = (array, atIdx) => {
  31639. return array.map((_, idx) => array[(idx + atIdx) % array.length]);
  31640. };
  31641. const focusFirst = (elements) => {
  31642. const { activeElement: prevActive } = document;
  31643. for (const element of elements) {
  31644. if (element === prevActive) return;
  31645. element.focus();
  31646. if (prevActive !== document.activeElement) return;
  31647. }
  31648. };
  31649. //#endregion
  31650. //#region ../../packages/components/roving-focus-group/src/roving-focus-group-impl.vue?vue&type=script&lang.ts
  31651. const CURRENT_TAB_ID_CHANGE_EVT = "currentTabIdChange";
  31652. const ENTRY_FOCUS_EVT = "rovingFocusGroup.entryFocus";
  31653. const EVT_OPTS = {
  31654. bubbles: false,
  31655. cancelable: true
  31656. };
  31657. var roving_focus_group_impl_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  31658. name: "ElRovingFocusGroupImpl",
  31659. inheritAttrs: false,
  31660. props: rovingFocusGroupProps,
  31661. emits: [CURRENT_TAB_ID_CHANGE_EVT, "entryFocus"],
  31662. setup(props, { emit }) {
  31663. const currentTabbedId = (0, vue.ref)((props.currentTabId || props.defaultCurrentTabId) ?? null);
  31664. const isBackingOut = (0, vue.ref)(false);
  31665. const isClickFocus = (0, vue.ref)(false);
  31666. const rovingFocusGroupRef = (0, vue.ref)();
  31667. const { getItems } = (0, vue.inject)(COLLECTION_INJECTION_KEY, void 0);
  31668. const rovingFocusGroupRootStyle = (0, vue.computed)(() => {
  31669. return [{ outline: "none" }, props.style];
  31670. });
  31671. const onItemFocus = (tabbedId) => {
  31672. emit(CURRENT_TAB_ID_CHANGE_EVT, tabbedId);
  31673. };
  31674. const onItemShiftTab = () => {
  31675. isBackingOut.value = true;
  31676. };
  31677. const onMousedown = composeEventHandlers((e) => {
  31678. props.onMousedown?.(e);
  31679. }, () => {
  31680. isClickFocus.value = true;
  31681. });
  31682. const onFocus = composeEventHandlers((e) => {
  31683. props.onFocus?.(e);
  31684. }, (e) => {
  31685. const isKeyboardFocus = !(0, vue.unref)(isClickFocus);
  31686. const { target, currentTarget } = e;
  31687. if (target === currentTarget && isKeyboardFocus && !(0, vue.unref)(isBackingOut)) {
  31688. const entryFocusEvt = new Event(ENTRY_FOCUS_EVT, EVT_OPTS);
  31689. currentTarget?.dispatchEvent(entryFocusEvt);
  31690. if (!entryFocusEvt.defaultPrevented) {
  31691. const items = getItems().filter((item) => item.focusable);
  31692. focusFirst([
  31693. items.find((item) => item.active),
  31694. items.find((item) => item.id === (0, vue.unref)(currentTabbedId)),
  31695. ...items
  31696. ].filter(Boolean).map((item) => item.ref));
  31697. }
  31698. }
  31699. isClickFocus.value = false;
  31700. });
  31701. const onBlur = composeEventHandlers((e) => {
  31702. props.onBlur?.(e);
  31703. }, () => {
  31704. isBackingOut.value = false;
  31705. });
  31706. const handleEntryFocus = (...args) => {
  31707. emit("entryFocus", ...args);
  31708. };
  31709. const onKeydown = (e) => {
  31710. const focusIntent = getFocusIntent(e);
  31711. if (focusIntent) {
  31712. e.preventDefault();
  31713. let elements = getItems().filter((item) => item.focusable).map((item) => item.ref);
  31714. switch (focusIntent) {
  31715. case "last":
  31716. elements.reverse();
  31717. break;
  31718. case "prev":
  31719. case "next": {
  31720. if (focusIntent === "prev") elements.reverse();
  31721. const currentIdx = elements.indexOf(e.currentTarget);
  31722. elements = props.loop ? reorderArray(elements, currentIdx + 1) : elements.slice(currentIdx + 1);
  31723. break;
  31724. }
  31725. default: break;
  31726. }
  31727. (0, vue.nextTick)(() => {
  31728. focusFirst(elements);
  31729. });
  31730. }
  31731. };
  31732. (0, vue.provide)(ROVING_FOCUS_GROUP_INJECTION_KEY, {
  31733. currentTabbedId: (0, vue.readonly)(currentTabbedId),
  31734. loop: (0, vue.toRef)(props, "loop"),
  31735. tabIndex: (0, vue.computed)(() => {
  31736. return (0, vue.unref)(isBackingOut) ? -1 : 0;
  31737. }),
  31738. rovingFocusGroupRef,
  31739. rovingFocusGroupRootStyle,
  31740. orientation: (0, vue.toRef)(props, "orientation"),
  31741. dir: (0, vue.toRef)(props, "dir"),
  31742. onItemFocus,
  31743. onItemShiftTab,
  31744. onBlur,
  31745. onFocus,
  31746. onMousedown,
  31747. onKeydown
  31748. });
  31749. (0, vue.watch)(() => props.currentTabId, (val) => {
  31750. currentTabbedId.value = val ?? null;
  31751. });
  31752. useEventListener(rovingFocusGroupRef, ENTRY_FOCUS_EVT, handleEntryFocus);
  31753. }
  31754. });
  31755. //#endregion
  31756. //#region ../../packages/components/roving-focus-group/src/roving-focus-group-impl.vue
  31757. function _sfc_render$14(_ctx, _cache, $props, $setup, $data, $options) {
  31758. return (0, vue.renderSlot)(_ctx.$slots, "default");
  31759. }
  31760. var roving_focus_group_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$14]]);
  31761. //#endregion
  31762. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.vue?vue&type=script&lang.ts
  31763. var roving_focus_group_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  31764. name: "ElRovingFocusGroup",
  31765. components: {
  31766. ElFocusGroupCollection: ElCollection,
  31767. ElRovingFocusGroupImpl: roving_focus_group_impl_default
  31768. }
  31769. });
  31770. //#endregion
  31771. //#region ../../packages/components/roving-focus-group/src/roving-focus-group.vue
  31772. function _sfc_render$13(_ctx, _cache, $props, $setup, $data, $options) {
  31773. const _component_el_roving_focus_group_impl = (0, vue.resolveComponent)("el-roving-focus-group-impl");
  31774. const _component_el_focus_group_collection = (0, vue.resolveComponent)("el-focus-group-collection");
  31775. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_focus_group_collection, null, {
  31776. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_roving_focus_group_impl, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(_ctx.$attrs)), {
  31777. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  31778. _: 3
  31779. }, 16)]),
  31780. _: 3
  31781. });
  31782. }
  31783. var roving_focus_group_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_group_vue_vue_type_script_lang_default, [["render", _sfc_render$13]]);
  31784. //#endregion
  31785. //#region ../../packages/components/roving-focus-group/src/roving-focus-item.vue?vue&type=script&lang.ts
  31786. var roving_focus_item_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  31787. components: { ElRovingFocusCollectionItem: ElCollectionItem },
  31788. props: {
  31789. focusable: {
  31790. type: Boolean,
  31791. default: true
  31792. },
  31793. active: Boolean
  31794. },
  31795. emits: [
  31796. "mousedown",
  31797. "focus",
  31798. "keydown"
  31799. ],
  31800. setup(props, { emit }) {
  31801. const { currentTabbedId, onItemFocus, onItemShiftTab, onKeydown } = (0, vue.inject)(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  31802. const id = useId();
  31803. const rovingFocusGroupItemRef = (0, vue.ref)();
  31804. const handleMousedown = composeEventHandlers((e) => {
  31805. emit("mousedown", e);
  31806. }, (e) => {
  31807. if (!props.focusable) e.preventDefault();
  31808. else onItemFocus((0, vue.unref)(id));
  31809. });
  31810. const handleFocus = composeEventHandlers((e) => {
  31811. emit("focus", e);
  31812. }, () => {
  31813. onItemFocus((0, vue.unref)(id));
  31814. });
  31815. const handleKeydown = composeEventHandlers((e) => {
  31816. emit("keydown", e);
  31817. }, (e) => {
  31818. const { shiftKey, target, currentTarget } = e;
  31819. if (getEventCode(e) === EVENT_CODE.tab && shiftKey) {
  31820. onItemShiftTab();
  31821. return;
  31822. }
  31823. if (target !== currentTarget) return;
  31824. onKeydown(e);
  31825. });
  31826. const isCurrentTab = (0, vue.computed)(() => currentTabbedId.value === (0, vue.unref)(id));
  31827. (0, vue.provide)(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, {
  31828. rovingFocusGroupItemRef,
  31829. tabIndex: (0, vue.computed)(() => (0, vue.unref)(isCurrentTab) ? 0 : -1),
  31830. handleMousedown,
  31831. handleFocus,
  31832. handleKeydown
  31833. });
  31834. return {
  31835. id,
  31836. handleKeydown,
  31837. handleFocus,
  31838. handleMousedown
  31839. };
  31840. }
  31841. });
  31842. //#endregion
  31843. //#region ../../packages/components/roving-focus-group/src/roving-focus-item.vue
  31844. function _sfc_render$12(_ctx, _cache, $props, $setup, $data, $options) {
  31845. const _component_el_roving_focus_collection_item = (0, vue.resolveComponent)("el-roving-focus-collection-item");
  31846. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_roving_focus_collection_item, {
  31847. id: _ctx.id,
  31848. focusable: _ctx.focusable,
  31849. active: _ctx.active
  31850. }, {
  31851. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  31852. _: 3
  31853. }, 8, [
  31854. "id",
  31855. "focusable",
  31856. "active"
  31857. ]);
  31858. }
  31859. var roving_focus_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(roving_focus_item_vue_vue_type_script_lang_default, [["render", _sfc_render$12]]);
  31860. //#endregion
  31861. //#region ../../packages/components/roving-focus-group/index.ts
  31862. var roving_focus_group_default = roving_focus_group_default$1;
  31863. //#endregion
  31864. //#region ../../packages/components/dropdown/src/dropdown.ts
  31865. const dropdownProps = buildProps({
  31866. trigger: {
  31867. ...useTooltipTriggerProps.trigger,
  31868. type: definePropType([String, Array])
  31869. },
  31870. triggerKeys: {
  31871. type: definePropType(Array),
  31872. default: () => [
  31873. EVENT_CODE.enter,
  31874. EVENT_CODE.numpadEnter,
  31875. EVENT_CODE.space,
  31876. EVENT_CODE.down
  31877. ]
  31878. },
  31879. virtualTriggering: useTooltipTriggerProps.virtualTriggering,
  31880. virtualRef: useTooltipTriggerProps.virtualRef,
  31881. effect: {
  31882. ...useTooltipContentProps.effect,
  31883. default: "light"
  31884. },
  31885. type: { type: definePropType(String) },
  31886. placement: {
  31887. type: definePropType(String),
  31888. default: "bottom"
  31889. },
  31890. popperOptions: {
  31891. type: definePropType(Object),
  31892. default: () => ({})
  31893. },
  31894. id: String,
  31895. size: {
  31896. type: String,
  31897. default: ""
  31898. },
  31899. splitButton: Boolean,
  31900. hideOnClick: {
  31901. type: Boolean,
  31902. default: true
  31903. },
  31904. loop: {
  31905. type: Boolean,
  31906. default: true
  31907. },
  31908. showArrow: {
  31909. type: Boolean,
  31910. default: true
  31911. },
  31912. showTimeout: {
  31913. type: Number,
  31914. default: 150
  31915. },
  31916. hideTimeout: {
  31917. type: Number,
  31918. default: 150
  31919. },
  31920. tabindex: {
  31921. type: definePropType([Number, String]),
  31922. default: 0
  31923. },
  31924. maxHeight: {
  31925. type: definePropType([Number, String]),
  31926. default: ""
  31927. },
  31928. popperClass: useTooltipContentProps.popperClass,
  31929. popperStyle: useTooltipContentProps.popperStyle,
  31930. disabled: Boolean,
  31931. role: {
  31932. type: String,
  31933. values: roleTypes,
  31934. default: "menu"
  31935. },
  31936. buttonProps: { type: definePropType(Object) },
  31937. teleported: useTooltipContentProps.teleported,
  31938. appendTo: useTooltipContentProps.appendTo,
  31939. persistent: {
  31940. type: Boolean,
  31941. default: true
  31942. }
  31943. });
  31944. const dropdownItemProps = buildProps({
  31945. command: {
  31946. type: [
  31947. Object,
  31948. String,
  31949. Number
  31950. ],
  31951. default: () => ({})
  31952. },
  31953. disabled: Boolean,
  31954. divided: Boolean,
  31955. textValue: String,
  31956. icon: { type: iconPropType }
  31957. });
  31958. const dropdownMenuProps = buildProps({ onKeydown: { type: definePropType(Function) } });
  31959. const FIRST_KEYS = [
  31960. EVENT_CODE.down,
  31961. EVENT_CODE.pageDown,
  31962. EVENT_CODE.home
  31963. ];
  31964. const LAST_KEYS = [
  31965. EVENT_CODE.up,
  31966. EVENT_CODE.pageUp,
  31967. EVENT_CODE.end
  31968. ];
  31969. const FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];
  31970. //#endregion
  31971. //#region ../../packages/components/dropdown/src/tokens.ts
  31972. const DROPDOWN_INJECTION_KEY = Symbol("elDropdown");
  31973. const DROPDOWN_INSTANCE_INJECTION_KEY = "elDropdown";
  31974. //#endregion
  31975. //#region ../../packages/components/dropdown/src/dropdown.vue?vue&type=script&lang.ts
  31976. const { ButtonGroup: ElButtonGroup$1 } = ElButton;
  31977. var dropdown_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  31978. name: "ElDropdown",
  31979. components: {
  31980. ElButton,
  31981. ElButtonGroup: ElButtonGroup$1,
  31982. ElScrollbar,
  31983. ElTooltip,
  31984. ElRovingFocusGroup: roving_focus_group_default,
  31985. ElOnlyChild: OnlyChild,
  31986. ElIcon,
  31987. ArrowDown: arrow_down_default
  31988. },
  31989. props: dropdownProps,
  31990. emits: [
  31991. "visible-change",
  31992. "click",
  31993. "command"
  31994. ],
  31995. setup(props, { emit }) {
  31996. const _instance = (0, vue.getCurrentInstance)();
  31997. const ns = useNamespace("dropdown");
  31998. const { t } = useLocale();
  31999. const triggeringElementRef = (0, vue.ref)();
  32000. const referenceElementRef = (0, vue.ref)();
  32001. const popperRef = (0, vue.ref)();
  32002. const contentRef = (0, vue.ref)();
  32003. const scrollbar = (0, vue.ref)(null);
  32004. const currentTabId = (0, vue.ref)(null);
  32005. const isUsingKeyboard = (0, vue.ref)(false);
  32006. const wrapStyle = (0, vue.computed)(() => ({ maxHeight: addUnit(props.maxHeight) }));
  32007. const dropdownTriggerKls = (0, vue.computed)(() => [ns.m(dropdownSize.value)]);
  32008. const trigger = (0, vue.computed)(() => castArray$1(props.trigger));
  32009. const defaultTriggerId = useId().value;
  32010. const triggerId = (0, vue.computed)(() => props.id || defaultTriggerId);
  32011. function handleClick() {
  32012. popperRef.value?.onClose(void 0, 0);
  32013. }
  32014. function handleClose() {
  32015. popperRef.value?.onClose();
  32016. }
  32017. function handleOpen() {
  32018. popperRef.value?.onOpen();
  32019. }
  32020. const dropdownSize = useFormSize();
  32021. function commandHandler(...args) {
  32022. emit("command", ...args);
  32023. }
  32024. function onItemEnter() {}
  32025. function onItemLeave() {
  32026. const contentEl = (0, vue.unref)(contentRef);
  32027. trigger.value.includes("hover") && contentEl?.focus({ preventScroll: true });
  32028. currentTabId.value = null;
  32029. }
  32030. function handleCurrentTabIdChange(id) {
  32031. currentTabId.value = id;
  32032. }
  32033. function handleBeforeShowTooltip() {
  32034. emit("visible-change", true);
  32035. }
  32036. function handleShowTooltip(event) {
  32037. isUsingKeyboard.value = event?.type === "keydown";
  32038. contentRef.value?.focus();
  32039. }
  32040. function handleBeforeHideTooltip() {
  32041. emit("visible-change", false);
  32042. }
  32043. (0, vue.provide)(DROPDOWN_INJECTION_KEY, {
  32044. contentRef,
  32045. role: (0, vue.computed)(() => props.role),
  32046. triggerId,
  32047. isUsingKeyboard,
  32048. onItemEnter,
  32049. onItemLeave,
  32050. handleClose
  32051. });
  32052. (0, vue.provide)(DROPDOWN_INSTANCE_INJECTION_KEY, {
  32053. instance: _instance,
  32054. dropdownSize,
  32055. handleClick,
  32056. commandHandler,
  32057. trigger: (0, vue.toRef)(props, "trigger"),
  32058. hideOnClick: (0, vue.toRef)(props, "hideOnClick")
  32059. });
  32060. const handlerMainButtonClick = (event) => {
  32061. emit("click", event);
  32062. };
  32063. return {
  32064. t,
  32065. ns,
  32066. scrollbar,
  32067. wrapStyle,
  32068. dropdownTriggerKls,
  32069. dropdownSize,
  32070. triggerId,
  32071. currentTabId,
  32072. handleCurrentTabIdChange,
  32073. handlerMainButtonClick,
  32074. handleClose,
  32075. handleOpen,
  32076. handleBeforeShowTooltip,
  32077. handleShowTooltip,
  32078. handleBeforeHideTooltip,
  32079. popperRef,
  32080. contentRef,
  32081. triggeringElementRef,
  32082. referenceElementRef
  32083. };
  32084. }
  32085. });
  32086. //#endregion
  32087. //#region ../../packages/components/dropdown/src/dropdown.vue
  32088. function _sfc_render$11(_ctx, _cache, $props, $setup, $data, $options) {
  32089. const _component_el_roving_focus_group = (0, vue.resolveComponent)("el-roving-focus-group");
  32090. const _component_el_scrollbar = (0, vue.resolveComponent)("el-scrollbar");
  32091. const _component_el_only_child = (0, vue.resolveComponent)("el-only-child");
  32092. const _component_el_tooltip = (0, vue.resolveComponent)("el-tooltip");
  32093. const _component_el_button = (0, vue.resolveComponent)("el-button");
  32094. const _component_arrow_down = (0, vue.resolveComponent)("arrow-down");
  32095. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  32096. const _component_el_button_group = (0, vue.resolveComponent)("el-button-group");
  32097. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([_ctx.ns.b(), _ctx.ns.is("disabled", _ctx.disabled)]) }, [(0, vue.createVNode)(_component_el_tooltip, {
  32098. ref: "popperRef",
  32099. role: _ctx.role,
  32100. effect: _ctx.effect,
  32101. "fallback-placements": ["bottom", "top"],
  32102. "popper-options": _ctx.popperOptions,
  32103. "gpu-acceleration": false,
  32104. placement: _ctx.placement,
  32105. "popper-class": [_ctx.ns.e("popper"), _ctx.popperClass],
  32106. "popper-style": _ctx.popperStyle,
  32107. trigger: _ctx.trigger,
  32108. "trigger-keys": _ctx.triggerKeys,
  32109. "trigger-target-el": _ctx.contentRef,
  32110. "show-arrow": _ctx.showArrow,
  32111. "show-after": _ctx.trigger === "hover" ? _ctx.showTimeout : 0,
  32112. "hide-after": _ctx.trigger === "hover" ? _ctx.hideTimeout : 0,
  32113. "virtual-ref": _ctx.virtualRef ?? _ctx.triggeringElementRef,
  32114. "virtual-triggering": _ctx.virtualTriggering || _ctx.splitButton,
  32115. disabled: _ctx.disabled,
  32116. transition: `${_ctx.ns.namespace.value}-zoom-in-top`,
  32117. teleported: _ctx.teleported,
  32118. "append-to": _ctx.appendTo,
  32119. pure: "",
  32120. "focus-on-target": "",
  32121. persistent: _ctx.persistent,
  32122. onBeforeShow: _ctx.handleBeforeShowTooltip,
  32123. onShow: _ctx.handleShowTooltip,
  32124. onBeforeHide: _ctx.handleBeforeHideTooltip
  32125. }, (0, vue.createSlots)({
  32126. content: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_scrollbar, {
  32127. ref: "scrollbar",
  32128. "wrap-style": _ctx.wrapStyle,
  32129. tag: "div",
  32130. "view-class": _ctx.ns.e("list")
  32131. }, {
  32132. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_roving_focus_group, {
  32133. loop: _ctx.loop,
  32134. "current-tab-id": _ctx.currentTabId,
  32135. orientation: "horizontal",
  32136. onCurrentTabIdChange: _ctx.handleCurrentTabIdChange
  32137. }, {
  32138. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "dropdown")]),
  32139. _: 3
  32140. }, 8, [
  32141. "loop",
  32142. "current-tab-id",
  32143. "onCurrentTabIdChange"
  32144. ])]),
  32145. _: 3
  32146. }, 8, ["wrap-style", "view-class"])]),
  32147. _: 2
  32148. }, [!_ctx.splitButton ? {
  32149. name: "default",
  32150. fn: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_only_child, {
  32151. id: _ctx.triggerId,
  32152. ref: "triggeringElementRef",
  32153. role: "button",
  32154. tabindex: _ctx.tabindex
  32155. }, {
  32156. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  32157. _: 3
  32158. }, 8, ["id", "tabindex"])]),
  32159. key: "0"
  32160. } : void 0]), 1032, [
  32161. "role",
  32162. "effect",
  32163. "popper-options",
  32164. "placement",
  32165. "popper-class",
  32166. "popper-style",
  32167. "trigger",
  32168. "trigger-keys",
  32169. "trigger-target-el",
  32170. "show-arrow",
  32171. "show-after",
  32172. "hide-after",
  32173. "virtual-ref",
  32174. "virtual-triggering",
  32175. "disabled",
  32176. "transition",
  32177. "teleported",
  32178. "append-to",
  32179. "persistent",
  32180. "onBeforeShow",
  32181. "onShow",
  32182. "onBeforeHide"
  32183. ]), _ctx.splitButton ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_button_group, { key: 0 }, {
  32184. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_button, (0, vue.mergeProps)({ ref: "referenceElementRef" }, _ctx.buttonProps, {
  32185. size: _ctx.dropdownSize,
  32186. type: _ctx.type,
  32187. disabled: _ctx.disabled,
  32188. tabindex: _ctx.tabindex,
  32189. onClick: _ctx.handlerMainButtonClick
  32190. }), {
  32191. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  32192. _: 3
  32193. }, 16, [
  32194. "size",
  32195. "type",
  32196. "disabled",
  32197. "tabindex",
  32198. "onClick"
  32199. ]), (0, vue.createVNode)(_component_el_button, (0, vue.mergeProps)({
  32200. id: _ctx.triggerId,
  32201. ref: "triggeringElementRef"
  32202. }, _ctx.buttonProps, {
  32203. role: "button",
  32204. size: _ctx.dropdownSize,
  32205. type: _ctx.type,
  32206. class: _ctx.ns.e("caret-button"),
  32207. disabled: _ctx.disabled,
  32208. tabindex: _ctx.tabindex,
  32209. "aria-label": _ctx.t("el.dropdown.toggleDropdown")
  32210. }), {
  32211. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_icon, { class: (0, vue.normalizeClass)(_ctx.ns.e("icon")) }, {
  32212. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_arrow_down)]),
  32213. _: 1
  32214. }, 8, ["class"])]),
  32215. _: 1
  32216. }, 16, [
  32217. "id",
  32218. "size",
  32219. "type",
  32220. "class",
  32221. "disabled",
  32222. "tabindex",
  32223. "aria-label"
  32224. ])]),
  32225. _: 3
  32226. })) : (0, vue.createCommentVNode)("v-if", true)], 2);
  32227. }
  32228. var dropdown_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_vue_vue_type_script_lang_default, [["render", _sfc_render$11]]);
  32229. //#endregion
  32230. //#region ../../packages/components/dropdown/src/dropdown-item-impl.vue?vue&type=script&lang.ts
  32231. var dropdown_item_impl_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  32232. name: "DropdownItemImpl",
  32233. components: { ElIcon },
  32234. props: dropdownItemProps,
  32235. emits: [
  32236. "pointermove",
  32237. "pointerleave",
  32238. "click",
  32239. "clickimpl"
  32240. ],
  32241. setup(_, { emit }) {
  32242. const ns = useNamespace("dropdown");
  32243. const { role: menuRole } = (0, vue.inject)(DROPDOWN_INJECTION_KEY, void 0);
  32244. const { collectionItemRef: rovingFocusCollectionItemRef } = (0, vue.inject)(COLLECTION_ITEM_INJECTION_KEY, void 0);
  32245. const { rovingFocusGroupItemRef, tabIndex, handleFocus, handleKeydown: handleItemKeydown, handleMousedown } = (0, vue.inject)(ROVING_FOCUS_GROUP_ITEM_INJECTION_KEY, void 0);
  32246. const itemRef = composeRefs(rovingFocusCollectionItemRef, rovingFocusGroupItemRef);
  32247. const role = (0, vue.computed)(() => {
  32248. if (menuRole.value === "menu") return "menuitem";
  32249. else if (menuRole.value === "navigation") return "link";
  32250. return "button";
  32251. });
  32252. const handleKeydown = composeEventHandlers((e) => {
  32253. const code = getEventCode(e);
  32254. if ([
  32255. EVENT_CODE.enter,
  32256. EVENT_CODE.numpadEnter,
  32257. EVENT_CODE.space
  32258. ].includes(code)) {
  32259. e.preventDefault();
  32260. e.stopImmediatePropagation();
  32261. emit("clickimpl", e);
  32262. return true;
  32263. }
  32264. }, handleItemKeydown);
  32265. return {
  32266. ns,
  32267. itemRef,
  32268. dataset: { [COLLECTION_ITEM_SIGN]: "" },
  32269. role,
  32270. tabIndex,
  32271. handleFocus,
  32272. handleKeydown,
  32273. handleMousedown
  32274. };
  32275. }
  32276. });
  32277. //#endregion
  32278. //#region ../../packages/components/dropdown/src/dropdown-item-impl.vue
  32279. const _hoisted_1$39 = [
  32280. "aria-disabled",
  32281. "tabindex",
  32282. "role"
  32283. ];
  32284. function _sfc_render$10(_ctx, _cache, $props, $setup, $data, $options) {
  32285. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  32286. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [_ctx.divided ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  32287. key: 0,
  32288. role: "separator",
  32289. class: (0, vue.normalizeClass)(_ctx.ns.bem("menu", "item", "divided"))
  32290. }, null, 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("li", (0, vue.mergeProps)({ ref: _ctx.itemRef }, {
  32291. ..._ctx.dataset,
  32292. ..._ctx.$attrs
  32293. }, {
  32294. "aria-disabled": _ctx.disabled,
  32295. class: [_ctx.ns.be("menu", "item"), _ctx.ns.is("disabled", _ctx.disabled)],
  32296. tabindex: _ctx.tabIndex,
  32297. role: _ctx.role,
  32298. onClick: _cache[0] || (_cache[0] = (e) => _ctx.$emit("clickimpl", e)),
  32299. onFocus: _cache[1] || (_cache[1] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  32300. onKeydown: _cache[2] || (_cache[2] = (0, vue.withModifiers)((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
  32301. onMousedown: _cache[3] || (_cache[3] = (...args) => _ctx.handleMousedown && _ctx.handleMousedown(...args)),
  32302. onPointermove: _cache[4] || (_cache[4] = (e) => _ctx.$emit("pointermove", e)),
  32303. onPointerleave: _cache[5] || (_cache[5] = (e) => _ctx.$emit("pointerleave", e))
  32304. }), [_ctx.icon || _ctx.$slots.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, { key: 0 }, {
  32305. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.icon)))])]),
  32306. _: 3
  32307. })) : (0, vue.createCommentVNode)("v-if", true), (0, vue.renderSlot)(_ctx.$slots, "default")], 16, _hoisted_1$39)], 64);
  32308. }
  32309. var dropdown_item_impl_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_impl_vue_vue_type_script_lang_default, [["render", _sfc_render$10]]);
  32310. //#endregion
  32311. //#region ../../packages/components/dropdown/src/useDropdown.ts
  32312. const useDropdown = () => {
  32313. const elDropdown = (0, vue.inject)(DROPDOWN_INSTANCE_INJECTION_KEY, {});
  32314. return {
  32315. elDropdown,
  32316. _elDropdownSize: (0, vue.computed)(() => elDropdown?.dropdownSize)
  32317. };
  32318. };
  32319. //#endregion
  32320. //#region ../../packages/components/dropdown/src/dropdown-item.vue?vue&type=script&lang.ts
  32321. var dropdown_item_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  32322. name: "ElDropdownItem",
  32323. components: {
  32324. ElRovingFocusItem: roving_focus_item_default,
  32325. ElDropdownItemImpl: dropdown_item_impl_default
  32326. },
  32327. inheritAttrs: false,
  32328. props: dropdownItemProps,
  32329. emits: [
  32330. "pointermove",
  32331. "pointerleave",
  32332. "click"
  32333. ],
  32334. setup(props, { emit, attrs }) {
  32335. const { elDropdown } = useDropdown();
  32336. const _instance = (0, vue.getCurrentInstance)();
  32337. const { onItemEnter, onItemLeave } = (0, vue.inject)(DROPDOWN_INJECTION_KEY, void 0);
  32338. const handlePointerMove = composeEventHandlers((e) => {
  32339. emit("pointermove", e);
  32340. return e.defaultPrevented;
  32341. }, whenMouse((e) => {
  32342. if (props.disabled) {
  32343. onItemLeave(e);
  32344. return;
  32345. }
  32346. const target = e.currentTarget;
  32347. /**
  32348. * This handles the following scenario:
  32349. * when the item contains a form element such as input element
  32350. * when the mouse is moving over the element itself which is contained by
  32351. * the item, the default focusing logic should be prevented so that
  32352. * it won't cause weird action.
  32353. */
  32354. if (target === document.activeElement || target.contains(document.activeElement)) return;
  32355. onItemEnter(e);
  32356. if (!e.defaultPrevented) target?.focus({ preventScroll: true });
  32357. }));
  32358. const handlePointerLeave = composeEventHandlers((e) => {
  32359. emit("pointerleave", e);
  32360. return e.defaultPrevented;
  32361. }, whenMouse(onItemLeave));
  32362. return {
  32363. handleClick: composeEventHandlers((e) => {
  32364. if (props.disabled) return;
  32365. emit("click", e);
  32366. return e.type !== "keydown" && e.defaultPrevented;
  32367. }, (e) => {
  32368. if (props.disabled) {
  32369. e.stopImmediatePropagation();
  32370. return;
  32371. }
  32372. if (elDropdown?.hideOnClick?.value) elDropdown.handleClick?.();
  32373. elDropdown.commandHandler?.(props.command, _instance, e);
  32374. }),
  32375. handlePointerMove,
  32376. handlePointerLeave,
  32377. propsAndAttrs: (0, vue.computed)(() => ({
  32378. ...props,
  32379. ...attrs
  32380. }))
  32381. };
  32382. }
  32383. });
  32384. //#endregion
  32385. //#region ../../packages/components/dropdown/src/dropdown-item.vue
  32386. function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
  32387. const _component_el_dropdown_item_impl = (0, vue.resolveComponent)("el-dropdown-item-impl");
  32388. const _component_el_roving_focus_item = (0, vue.resolveComponent)("el-roving-focus-item");
  32389. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_roving_focus_item, { focusable: !_ctx.disabled }, {
  32390. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_dropdown_item_impl, (0, vue.mergeProps)(_ctx.propsAndAttrs, {
  32391. onPointerleave: _ctx.handlePointerLeave,
  32392. onPointermove: _ctx.handlePointerMove,
  32393. onClickimpl: _ctx.handleClick
  32394. }), (0, vue.createSlots)({
  32395. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  32396. _: 2
  32397. }, [_ctx.$slots.icon ? {
  32398. name: "icon",
  32399. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "icon")]),
  32400. key: "0"
  32401. } : void 0]), 1040, [
  32402. "onPointerleave",
  32403. "onPointermove",
  32404. "onClickimpl"
  32405. ])]),
  32406. _: 3
  32407. }, 8, ["focusable"]);
  32408. }
  32409. var dropdown_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_item_vue_vue_type_script_lang_default, [["render", _sfc_render$9]]);
  32410. //#endregion
  32411. //#region ../../packages/components/dropdown/src/dropdown-menu.vue?vue&type=script&lang.ts
  32412. var dropdown_menu_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  32413. name: "ElDropdownMenu",
  32414. props: dropdownMenuProps,
  32415. setup(props) {
  32416. const ns = useNamespace("dropdown");
  32417. const { _elDropdownSize } = useDropdown();
  32418. const size = _elDropdownSize.value;
  32419. const { contentRef, role, triggerId, isUsingKeyboard, handleClose } = (0, vue.inject)(DROPDOWN_INJECTION_KEY, void 0);
  32420. const { rovingFocusGroupRef, rovingFocusGroupRootStyle, onBlur, onFocus, onKeydown, onMousedown } = (0, vue.inject)(ROVING_FOCUS_GROUP_INJECTION_KEY, void 0);
  32421. const { collectionRef: rovingFocusGroupCollectionRef } = (0, vue.inject)(COLLECTION_INJECTION_KEY, void 0);
  32422. const dropdownKls = (0, vue.computed)(() => {
  32423. return [ns.b("menu"), ns.bm("menu", size?.value)];
  32424. });
  32425. const dropdownListWrapperRef = composeRefs(contentRef, rovingFocusGroupRef, rovingFocusGroupCollectionRef);
  32426. const handleKeydown = composeEventHandlers((e) => {
  32427. props.onKeydown?.(e);
  32428. }, (e) => {
  32429. const { currentTarget, target } = e;
  32430. const code = getEventCode(e);
  32431. if (currentTarget.contains(target)) {}
  32432. if (EVENT_CODE.tab === code) return handleClose();
  32433. onKeydown(e);
  32434. });
  32435. function handleFocus(e) {
  32436. isUsingKeyboard.value && onFocus(e);
  32437. }
  32438. return {
  32439. size,
  32440. rovingFocusGroupRootStyle,
  32441. dropdownKls,
  32442. role,
  32443. triggerId,
  32444. dropdownListWrapperRef,
  32445. handleKeydown,
  32446. onBlur,
  32447. handleFocus,
  32448. onMousedown
  32449. };
  32450. }
  32451. });
  32452. //#endregion
  32453. //#region ../../packages/components/dropdown/src/dropdown-menu.vue
  32454. const _hoisted_1$38 = ["role", "aria-labelledby"];
  32455. function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
  32456. return (0, vue.openBlock)(), (0, vue.createElementBlock)("ul", {
  32457. ref: _ctx.dropdownListWrapperRef,
  32458. class: (0, vue.normalizeClass)(_ctx.dropdownKls),
  32459. style: (0, vue.normalizeStyle)(_ctx.rovingFocusGroupRootStyle),
  32460. tabindex: -1,
  32461. role: _ctx.role,
  32462. "aria-labelledby": _ctx.triggerId,
  32463. onFocusin: _cache[0] || (_cache[0] = (...args) => _ctx.handleFocus && _ctx.handleFocus(...args)),
  32464. onFocusout: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
  32465. onKeydown: _cache[2] || (_cache[2] = (0, vue.withModifiers)((...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args), ["self"])),
  32466. onMousedown: _cache[3] || (_cache[3] = (0, vue.withModifiers)((...args) => _ctx.onMousedown && _ctx.onMousedown(...args), ["self"]))
  32467. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 46, _hoisted_1$38);
  32468. }
  32469. var dropdown_menu_default = /* @__PURE__ */ _plugin_vue_export_helper_default(dropdown_menu_vue_vue_type_script_lang_default, [["render", _sfc_render$8]]);
  32470. //#endregion
  32471. //#region ../../packages/components/dropdown/index.ts
  32472. const ElDropdown = withInstall(dropdown_default, {
  32473. DropdownItem: dropdown_item_default,
  32474. DropdownMenu: dropdown_menu_default
  32475. });
  32476. const ElDropdownItem = withNoopInstall(dropdown_item_default);
  32477. const ElDropdownMenu = withNoopInstall(dropdown_menu_default);
  32478. //#endregion
  32479. //#region ../../packages/components/empty/src/empty.ts
  32480. /**
  32481. * @deprecated Removed after 3.0.0, Use `EmptyProps` instead.
  32482. */
  32483. const emptyProps = buildProps({
  32484. image: {
  32485. type: String,
  32486. default: ""
  32487. },
  32488. imageSize: Number,
  32489. description: {
  32490. type: String,
  32491. default: ""
  32492. }
  32493. });
  32494. //#endregion
  32495. //#region ../../packages/components/empty/src/img-empty.vue?vue&type=script&setup=true&lang.ts
  32496. const _hoisted_1$37 = {
  32497. viewBox: "0 0 79 86",
  32498. version: "1.1",
  32499. xmlns: "http://www.w3.org/2000/svg",
  32500. "xmlns:xlink": "http://www.w3.org/1999/xlink"
  32501. };
  32502. const _hoisted_2$23 = ["id"];
  32503. const _hoisted_3$8 = ["stop-color"];
  32504. const _hoisted_4$6 = ["stop-color"];
  32505. const _hoisted_5$4 = ["id"];
  32506. const _hoisted_6$1 = ["stop-color"];
  32507. const _hoisted_7 = ["stop-color"];
  32508. const _hoisted_8 = ["id"];
  32509. const _hoisted_9 = {
  32510. stroke: "none",
  32511. "stroke-width": "1",
  32512. fill: "none",
  32513. "fill-rule": "evenodd"
  32514. };
  32515. const _hoisted_10 = { transform: "translate(-1268.000000, -535.000000)" };
  32516. const _hoisted_11 = { transform: "translate(1268.000000, 535.000000)" };
  32517. const _hoisted_12 = ["fill"];
  32518. const _hoisted_13 = ["fill"];
  32519. const _hoisted_14 = { transform: "translate(34.500000, 31.500000) scale(-1, 1) rotate(-25.000000) translate(-34.500000, -31.500000) translate(7.000000, 10.000000)" };
  32520. const _hoisted_15 = ["fill"];
  32521. const _hoisted_16 = ["fill"];
  32522. const _hoisted_17 = ["fill"];
  32523. const _hoisted_18 = ["fill"];
  32524. const _hoisted_19 = ["fill"];
  32525. const _hoisted_20 = { transform: "translate(53.000000, 45.000000)" };
  32526. const _hoisted_21 = ["fill", "xlink:href"];
  32527. const _hoisted_22 = ["fill", "mask"];
  32528. const _hoisted_23 = ["fill"];
  32529. var img_empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  32530. name: "ImgEmpty",
  32531. __name: "img-empty",
  32532. setup(__props) {
  32533. const ns = useNamespace("empty");
  32534. const id = useId();
  32535. return (_ctx, _cache) => {
  32536. return (0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_1$37, [(0, vue.createElementVNode)("defs", null, [
  32537. (0, vue.createElementVNode)("linearGradient", {
  32538. id: `linearGradient-1-${(0, vue.unref)(id)}`,
  32539. x1: "38.8503086%",
  32540. y1: "0%",
  32541. x2: "61.1496914%",
  32542. y2: "100%"
  32543. }, [(0, vue.createElementVNode)("stop", {
  32544. "stop-color": `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-1")})`,
  32545. offset: "0%"
  32546. }, null, 8, _hoisted_3$8), (0, vue.createElementVNode)("stop", {
  32547. "stop-color": `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-4")})`,
  32548. offset: "100%"
  32549. }, null, 8, _hoisted_4$6)], 8, _hoisted_2$23),
  32550. (0, vue.createElementVNode)("linearGradient", {
  32551. id: `linearGradient-2-${(0, vue.unref)(id)}`,
  32552. x1: "0%",
  32553. y1: "9.5%",
  32554. x2: "100%",
  32555. y2: "90.5%"
  32556. }, [(0, vue.createElementVNode)("stop", {
  32557. "stop-color": `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-1")})`,
  32558. offset: "0%"
  32559. }, null, 8, _hoisted_6$1), (0, vue.createElementVNode)("stop", {
  32560. "stop-color": `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-6")})`,
  32561. offset: "100%"
  32562. }, null, 8, _hoisted_7)], 8, _hoisted_5$4),
  32563. (0, vue.createElementVNode)("rect", {
  32564. id: `path-3-${(0, vue.unref)(id)}`,
  32565. x: "0",
  32566. y: "0",
  32567. width: "17",
  32568. height: "36"
  32569. }, null, 8, _hoisted_8)
  32570. ]), (0, vue.createElementVNode)("g", _hoisted_9, [(0, vue.createElementVNode)("g", _hoisted_10, [(0, vue.createElementVNode)("g", _hoisted_11, [
  32571. (0, vue.createElementVNode)("path", {
  32572. 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",
  32573. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-3")})`
  32574. }, null, 8, _hoisted_12),
  32575. (0, vue.createElementVNode)("polygon", {
  32576. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-7")})`,
  32577. transform: "translate(27.500000, 51.500000) scale(1, -1) translate(-27.500000, -51.500000) ",
  32578. points: "13 58 53 58 42 45 2 45"
  32579. }, null, 8, _hoisted_13),
  32580. (0, vue.createElementVNode)("g", _hoisted_14, [
  32581. (0, vue.createElementVNode)("polygon", {
  32582. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-7")})`,
  32583. transform: "translate(11.500000, 5.000000) scale(1, -1) translate(-11.500000, -5.000000) ",
  32584. points: "2.84078316e-14 3 18 3 23 7 5 7"
  32585. }, null, 8, _hoisted_15),
  32586. (0, vue.createElementVNode)("polygon", {
  32587. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-5")})`,
  32588. points: "-3.69149156e-15 7 38 7 38 43 -3.69149156e-15 43"
  32589. }, null, 8, _hoisted_16),
  32590. (0, vue.createElementVNode)("rect", {
  32591. fill: `url(#linearGradient-1-${(0, vue.unref)(id)})`,
  32592. transform: "translate(46.500000, 25.000000) scale(-1, 1) translate(-46.500000, -25.000000) ",
  32593. x: "38",
  32594. y: "7",
  32595. width: "17",
  32596. height: "36"
  32597. }, null, 8, _hoisted_17),
  32598. (0, vue.createElementVNode)("polygon", {
  32599. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-2")})`,
  32600. transform: "translate(39.500000, 3.500000) scale(-1, 1) translate(-39.500000, -3.500000) ",
  32601. points: "24 7 41 7 55 -3.63806207e-12 38 -3.63806207e-12"
  32602. }, null, 8, _hoisted_18)
  32603. ]),
  32604. (0, vue.createElementVNode)("rect", {
  32605. fill: `url(#linearGradient-2-${(0, vue.unref)(id)})`,
  32606. x: "13",
  32607. y: "45",
  32608. width: "40",
  32609. height: "36"
  32610. }, null, 8, _hoisted_19),
  32611. (0, vue.createElementVNode)("g", _hoisted_20, [(0, vue.createElementVNode)("use", {
  32612. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-8")})`,
  32613. transform: "translate(8.500000, 18.000000) scale(-1, 1) translate(-8.500000, -18.000000) ",
  32614. "xlink:href": `#path-3-${(0, vue.unref)(id)}`
  32615. }, null, 8, _hoisted_21), (0, vue.createElementVNode)("polygon", {
  32616. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-9")})`,
  32617. mask: `url(#mask-4-${(0, vue.unref)(id)})`,
  32618. transform: "translate(12.000000, 9.000000) scale(-1, 1) translate(-12.000000, -9.000000) ",
  32619. points: "7 0 24 0 20 18 7 16.5"
  32620. }, null, 8, _hoisted_22)]),
  32621. (0, vue.createElementVNode)("polygon", {
  32622. fill: `var(${(0, vue.unref)(ns).cssVarBlockName("fill-color-2")})`,
  32623. transform: "translate(66.000000, 51.500000) scale(-1, 1) translate(-66.000000, -51.500000) ",
  32624. points: "62 45 79 45 70 58 53 58"
  32625. }, null, 8, _hoisted_23)
  32626. ])])])]);
  32627. };
  32628. }
  32629. });
  32630. //#endregion
  32631. //#region ../../packages/components/empty/src/img-empty.vue
  32632. var img_empty_default = img_empty_vue_vue_type_script_setup_true_lang_default;
  32633. //#endregion
  32634. //#region ../../packages/components/empty/src/empty.vue?vue&type=script&setup=true&lang.ts
  32635. const _hoisted_1$36 = ["src"];
  32636. const _hoisted_2$22 = { key: 1 };
  32637. var empty_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  32638. name: "ElEmpty",
  32639. __name: "empty",
  32640. props: emptyProps,
  32641. setup(__props) {
  32642. const props = __props;
  32643. const { t } = useLocale();
  32644. const ns = useNamespace("empty");
  32645. const emptyDescription = (0, vue.computed)(() => props.description || t("el.table.emptyText"));
  32646. const imageStyle = (0, vue.computed)(() => ({ width: addUnit(props.imageSize) }));
  32647. return (_ctx, _cache) => {
  32648. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [
  32649. (0, vue.createElementVNode)("div", {
  32650. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("image")),
  32651. style: (0, vue.normalizeStyle)(imageStyle.value)
  32652. }, [__props.image ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
  32653. key: 0,
  32654. src: __props.image,
  32655. ondragstart: "return false"
  32656. }, null, 8, _hoisted_1$36)) : (0, vue.renderSlot)(_ctx.$slots, "image", { key: 1 }, () => [(0, vue.createVNode)(img_empty_default)])], 6),
  32657. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("description")) }, [_ctx.$slots.description ? (0, vue.renderSlot)(_ctx.$slots, "description", { key: 0 }) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_2$22, (0, vue.toDisplayString)(emptyDescription.value), 1))], 2),
  32658. _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  32659. key: 0,
  32660. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("bottom"))
  32661. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  32662. ], 2);
  32663. };
  32664. }
  32665. });
  32666. //#endregion
  32667. //#region ../../packages/components/empty/src/empty.vue
  32668. var empty_default = empty_vue_vue_type_script_setup_true_lang_default;
  32669. //#endregion
  32670. //#region ../../packages/components/empty/index.ts
  32671. const ElEmpty = withInstall(empty_default);
  32672. //#endregion
  32673. //#region ../../packages/components/image/src/image.ts
  32674. /**
  32675. * @deprecated Removed after 3.0.0, Use `ImageProps` instead.
  32676. */
  32677. const imageProps = buildProps({
  32678. hideOnClickModal: Boolean,
  32679. src: {
  32680. type: String,
  32681. default: ""
  32682. },
  32683. fit: {
  32684. type: String,
  32685. values: [
  32686. "",
  32687. "contain",
  32688. "cover",
  32689. "fill",
  32690. "none",
  32691. "scale-down"
  32692. ],
  32693. default: ""
  32694. },
  32695. loading: {
  32696. type: String,
  32697. values: ["eager", "lazy"]
  32698. },
  32699. lazy: Boolean,
  32700. scrollContainer: { type: definePropType([String, Object]) },
  32701. previewSrcList: {
  32702. type: definePropType(Array),
  32703. default: () => mutable([])
  32704. },
  32705. previewTeleported: Boolean,
  32706. zIndex: { type: Number },
  32707. initialIndex: {
  32708. type: Number,
  32709. default: 0
  32710. },
  32711. infinite: {
  32712. type: Boolean,
  32713. default: true
  32714. },
  32715. closeOnPressEscape: {
  32716. type: Boolean,
  32717. default: true
  32718. },
  32719. zoomRate: {
  32720. type: Number,
  32721. default: 1.2
  32722. },
  32723. scale: {
  32724. type: Number,
  32725. default: 1
  32726. },
  32727. minScale: {
  32728. type: Number,
  32729. default: .2
  32730. },
  32731. maxScale: {
  32732. type: Number,
  32733. default: 7
  32734. },
  32735. showProgress: Boolean,
  32736. crossorigin: { type: definePropType(String) }
  32737. });
  32738. const imageEmits = {
  32739. load: (evt) => evt instanceof Event,
  32740. error: (evt) => evt instanceof Event,
  32741. switch: (val) => isNumber(val),
  32742. close: () => true,
  32743. show: () => true
  32744. };
  32745. //#endregion
  32746. //#region ../../packages/components/image-viewer/src/image-viewer.ts
  32747. /**
  32748. * @deprecated Removed after 3.0.0, Use `ImageViewerProps` instead.
  32749. */
  32750. const imageViewerProps = buildProps({
  32751. urlList: {
  32752. type: definePropType(Array),
  32753. default: () => mutable([])
  32754. },
  32755. zIndex: { type: Number },
  32756. initialIndex: {
  32757. type: Number,
  32758. default: 0
  32759. },
  32760. infinite: {
  32761. type: Boolean,
  32762. default: true
  32763. },
  32764. hideOnClickModal: Boolean,
  32765. teleported: Boolean,
  32766. closeOnPressEscape: {
  32767. type: Boolean,
  32768. default: true
  32769. },
  32770. zoomRate: {
  32771. type: Number,
  32772. default: 1.2
  32773. },
  32774. scale: {
  32775. type: Number,
  32776. default: 1
  32777. },
  32778. minScale: {
  32779. type: Number,
  32780. default: .2
  32781. },
  32782. maxScale: {
  32783. type: Number,
  32784. default: 7
  32785. },
  32786. showProgress: Boolean,
  32787. crossorigin: { type: definePropType(String) }
  32788. });
  32789. const imageViewerEmits = {
  32790. close: () => true,
  32791. error: (evt) => evt instanceof Event,
  32792. switch: (index) => isNumber(index),
  32793. rotate: (deg) => isNumber(deg)
  32794. };
  32795. //#endregion
  32796. //#region ../../packages/components/image-viewer/src/image-viewer.vue?vue&type=script&setup=true&lang.ts
  32797. const _hoisted_1$35 = ["src", "crossorigin"];
  32798. var image_viewer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  32799. name: "ElImageViewer",
  32800. __name: "image-viewer",
  32801. props: imageViewerProps,
  32802. emits: imageViewerEmits,
  32803. setup(__props, { expose: __expose, emit: __emit }) {
  32804. const modes = {
  32805. CONTAIN: {
  32806. name: "contain",
  32807. icon: (0, vue.markRaw)(full_screen_default)
  32808. },
  32809. ORIGINAL: {
  32810. name: "original",
  32811. icon: (0, vue.markRaw)(scale_to_original_default)
  32812. }
  32813. };
  32814. const props = __props;
  32815. const emit = __emit;
  32816. let stopWheelListener;
  32817. const { t } = useLocale();
  32818. const ns = useNamespace("image-viewer");
  32819. const { nextZIndex } = useZIndex();
  32820. const wrapper = (0, vue.ref)();
  32821. const imgRef = (0, vue.ref)();
  32822. const scopeEventListener = (0, vue.effectScope)();
  32823. const scaleClamped = (0, vue.computed)(() => {
  32824. const { scale, minScale, maxScale } = props;
  32825. return clamp$2(scale, minScale, maxScale);
  32826. });
  32827. const loading = (0, vue.ref)(true);
  32828. const loadError = (0, vue.ref)(false);
  32829. const visible = (0, vue.ref)(false);
  32830. const activeIndex = (0, vue.ref)(props.initialIndex);
  32831. const mode = (0, vue.shallowRef)(modes.CONTAIN);
  32832. const transform = (0, vue.ref)({
  32833. scale: scaleClamped.value,
  32834. deg: 0,
  32835. offsetX: 0,
  32836. offsetY: 0,
  32837. enableTransition: false
  32838. });
  32839. const zIndex = (0, vue.ref)(props.zIndex ?? nextZIndex());
  32840. useLockscreen(visible, { ns });
  32841. const isSingle = (0, vue.computed)(() => {
  32842. const { urlList } = props;
  32843. return urlList.length <= 1;
  32844. });
  32845. const isFirst = (0, vue.computed)(() => activeIndex.value === 0);
  32846. const isLast = (0, vue.computed)(() => activeIndex.value === props.urlList.length - 1);
  32847. const currentImg = (0, vue.computed)(() => props.urlList[activeIndex.value]);
  32848. const arrowPrevKls = (0, vue.computed)(() => [
  32849. ns.e("btn"),
  32850. ns.e("prev"),
  32851. ns.is("disabled", !props.infinite && isFirst.value)
  32852. ]);
  32853. const arrowNextKls = (0, vue.computed)(() => [
  32854. ns.e("btn"),
  32855. ns.e("next"),
  32856. ns.is("disabled", !props.infinite && isLast.value)
  32857. ]);
  32858. const imgStyle = (0, vue.computed)(() => {
  32859. const { scale, deg, offsetX, offsetY, enableTransition } = transform.value;
  32860. let translateX = offsetX / scale;
  32861. let translateY = offsetY / scale;
  32862. const radian = deg * Math.PI / 180;
  32863. const cosRadian = Math.cos(radian);
  32864. const sinRadian = Math.sin(radian);
  32865. translateX = translateX * cosRadian + translateY * sinRadian;
  32866. translateY = translateY * cosRadian - offsetX / scale * sinRadian;
  32867. const style = {
  32868. transform: `scale(${scale}) rotate(${deg}deg) translate(${translateX}px, ${translateY}px)`,
  32869. transition: enableTransition ? "transform .3s" : ""
  32870. };
  32871. if (mode.value.name === modes.CONTAIN.name) style.maxWidth = style.maxHeight = "100%";
  32872. return style;
  32873. });
  32874. const progress = (0, vue.computed)(() => `${activeIndex.value + 1} / ${props.urlList.length}`);
  32875. function hide() {
  32876. unregisterEventListener();
  32877. stopWheelListener?.();
  32878. visible.value = false;
  32879. emit("close");
  32880. }
  32881. function registerEventListener() {
  32882. const keydownHandler = throttle((e) => {
  32883. switch (getEventCode(e)) {
  32884. case EVENT_CODE.esc:
  32885. props.closeOnPressEscape && hide();
  32886. break;
  32887. case EVENT_CODE.space:
  32888. toggleMode();
  32889. break;
  32890. case EVENT_CODE.left:
  32891. prev();
  32892. break;
  32893. case EVENT_CODE.up:
  32894. handleActions("zoomIn");
  32895. break;
  32896. case EVENT_CODE.right:
  32897. next();
  32898. break;
  32899. case EVENT_CODE.down:
  32900. handleActions("zoomOut");
  32901. break;
  32902. }
  32903. });
  32904. const mousewheelHandler = throttle((e) => {
  32905. handleActions((e.deltaY || e.deltaX) < 0 ? "zoomIn" : "zoomOut", {
  32906. zoomRate: props.zoomRate,
  32907. enableTransition: false
  32908. });
  32909. });
  32910. scopeEventListener.run(() => {
  32911. useEventListener(document, "keydown", keydownHandler);
  32912. useEventListener(wrapper, "wheel", mousewheelHandler);
  32913. });
  32914. }
  32915. function unregisterEventListener() {
  32916. scopeEventListener.stop();
  32917. }
  32918. function handleImgLoad() {
  32919. loading.value = false;
  32920. }
  32921. function handleImgError(e) {
  32922. loadError.value = true;
  32923. loading.value = false;
  32924. emit("error", e);
  32925. e.target.alt = t("el.image.error");
  32926. }
  32927. function handleMouseDown(e) {
  32928. if (loading.value || e.button !== 0 || !wrapper.value) return;
  32929. transform.value.enableTransition = false;
  32930. const { offsetX, offsetY } = transform.value;
  32931. const startX = e.pageX;
  32932. const startY = e.pageY;
  32933. const dragHandler = throttle((ev) => {
  32934. transform.value = {
  32935. ...transform.value,
  32936. offsetX: offsetX + ev.pageX - startX,
  32937. offsetY: offsetY + ev.pageY - startY
  32938. };
  32939. });
  32940. const removeMousemove = useEventListener(document, "mousemove", dragHandler);
  32941. const removeMouseup = useEventListener(document, "mouseup", () => {
  32942. removeMousemove();
  32943. removeMouseup();
  32944. });
  32945. e.preventDefault();
  32946. }
  32947. function handleTouchStart(e) {
  32948. if (loading.value || !wrapper.value || e.touches.length !== 1) return;
  32949. transform.value.enableTransition = false;
  32950. const { offsetX, offsetY } = transform.value;
  32951. const { pageX: startX, pageY: startY } = e.touches[0];
  32952. const dragHandler = throttle((ev) => {
  32953. const targetTouch = ev.touches[0];
  32954. transform.value = {
  32955. ...transform.value,
  32956. offsetX: offsetX + targetTouch.pageX - startX,
  32957. offsetY: offsetY + targetTouch.pageY - startY
  32958. };
  32959. });
  32960. const removeTouchmove = useEventListener(document, "touchmove", dragHandler);
  32961. const removeTouchend = useEventListener(document, "touchend", () => {
  32962. removeTouchmove();
  32963. removeTouchend();
  32964. });
  32965. e.preventDefault();
  32966. }
  32967. function reset() {
  32968. transform.value = {
  32969. scale: scaleClamped.value,
  32970. deg: 0,
  32971. offsetX: 0,
  32972. offsetY: 0,
  32973. enableTransition: false
  32974. };
  32975. }
  32976. function toggleMode() {
  32977. if (loading.value || loadError.value) return;
  32978. const modeNames = keysOf(modes);
  32979. const modeValues = Object.values(modes);
  32980. const currentMode = mode.value.name;
  32981. mode.value = modes[modeNames[(modeValues.findIndex((i) => i.name === currentMode) + 1) % modeNames.length]];
  32982. reset();
  32983. }
  32984. function setActiveItem(index) {
  32985. loadError.value = false;
  32986. const len = props.urlList.length;
  32987. activeIndex.value = (index + len) % len;
  32988. }
  32989. function prev() {
  32990. if (isFirst.value && !props.infinite) return;
  32991. setActiveItem(activeIndex.value - 1);
  32992. }
  32993. function next() {
  32994. if (isLast.value && !props.infinite) return;
  32995. setActiveItem(activeIndex.value + 1);
  32996. }
  32997. function handleActions(action, options = {}) {
  32998. if (loading.value || loadError.value) return;
  32999. const { minScale, maxScale } = props;
  33000. const { zoomRate, rotateDeg, enableTransition } = {
  33001. zoomRate: props.zoomRate,
  33002. rotateDeg: 90,
  33003. enableTransition: true,
  33004. ...options
  33005. };
  33006. switch (action) {
  33007. case "zoomOut":
  33008. if (transform.value.scale > minScale) transform.value.scale = Number.parseFloat((transform.value.scale / zoomRate).toFixed(3));
  33009. break;
  33010. case "zoomIn":
  33011. if (transform.value.scale < maxScale) transform.value.scale = Number.parseFloat((transform.value.scale * zoomRate).toFixed(3));
  33012. break;
  33013. case "clockwise":
  33014. transform.value.deg += rotateDeg;
  33015. emit("rotate", transform.value.deg);
  33016. break;
  33017. case "anticlockwise":
  33018. transform.value.deg -= rotateDeg;
  33019. emit("rotate", transform.value.deg);
  33020. break;
  33021. }
  33022. transform.value.enableTransition = enableTransition;
  33023. }
  33024. function onFocusoutPrevented(event) {
  33025. if (event.detail?.focusReason === "pointer") event.preventDefault();
  33026. }
  33027. function onCloseRequested() {
  33028. if (props.closeOnPressEscape) hide();
  33029. }
  33030. function wheelHandler(e) {
  33031. if (!e.ctrlKey) return;
  33032. if (e.deltaY < 0) {
  33033. e.preventDefault();
  33034. return false;
  33035. } else if (e.deltaY > 0) {
  33036. e.preventDefault();
  33037. return false;
  33038. }
  33039. }
  33040. (0, vue.watch)(() => scaleClamped.value, (val) => {
  33041. transform.value.scale = val;
  33042. });
  33043. (0, vue.watch)(currentImg, () => {
  33044. (0, vue.nextTick)(() => {
  33045. if (!imgRef.value?.complete) loading.value = true;
  33046. });
  33047. });
  33048. (0, vue.watch)(activeIndex, (val) => {
  33049. reset();
  33050. emit("switch", val);
  33051. });
  33052. (0, vue.onMounted)(() => {
  33053. visible.value = true;
  33054. registerEventListener();
  33055. stopWheelListener = useEventListener("wheel", wheelHandler, { passive: false });
  33056. });
  33057. __expose({ setActiveItem });
  33058. return (_ctx, _cache) => {
  33059. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTeleport), {
  33060. to: "body",
  33061. disabled: !__props.teleported
  33062. }, {
  33063. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(vue.Transition, {
  33064. name: "viewer-fade",
  33065. appear: ""
  33066. }, {
  33067. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  33068. ref_key: "wrapper",
  33069. ref: wrapper,
  33070. tabindex: -1,
  33071. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("wrapper")),
  33072. style: (0, vue.normalizeStyle)({ zIndex: zIndex.value })
  33073. }, [(0, vue.createVNode)((0, vue.unref)(focus_trap_default), {
  33074. loop: "",
  33075. trapped: "",
  33076. "focus-trap-el": wrapper.value,
  33077. "focus-start-el": "container",
  33078. onFocusoutPrevented,
  33079. onReleaseRequested: onCloseRequested
  33080. }, {
  33081. default: (0, vue.withCtx)(() => [
  33082. (0, vue.createElementVNode)("div", {
  33083. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("mask")),
  33084. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) => __props.hideOnClickModal && hide(), ["self"]))
  33085. }, null, 2),
  33086. (0, vue.createCommentVNode)(" CLOSE "),
  33087. (0, vue.createElementVNode)("span", {
  33088. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("btn"), (0, vue.unref)(ns).e("close")]),
  33089. onClick: hide
  33090. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  33091. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  33092. _: 1
  33093. })], 2),
  33094. (0, vue.createCommentVNode)(" ARROW "),
  33095. !isSingle.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("span", {
  33096. class: (0, vue.normalizeClass)(arrowPrevKls.value),
  33097. onClick: prev
  33098. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  33099. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  33100. _: 1
  33101. })], 2), (0, vue.createElementVNode)("span", {
  33102. class: (0, vue.normalizeClass)(arrowNextKls.value),
  33103. onClick: next
  33104. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  33105. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  33106. _: 1
  33107. })], 2)], 64)) : (0, vue.createCommentVNode)("v-if", true),
  33108. _ctx.$slots.progress || __props.showProgress ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  33109. key: 1,
  33110. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("btn"), (0, vue.unref)(ns).e("progress")])
  33111. }, [(0, vue.renderSlot)(_ctx.$slots, "progress", {
  33112. activeIndex: activeIndex.value,
  33113. total: __props.urlList.length
  33114. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(progress.value), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  33115. (0, vue.createCommentVNode)(" ACTIONS "),
  33116. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("btn"), (0, vue.unref)(ns).e("actions")]) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("actions__inner")) }, [(0, vue.renderSlot)(_ctx.$slots, "toolbar", {
  33117. actions: handleActions,
  33118. prev,
  33119. next,
  33120. reset: toggleMode,
  33121. activeIndex: activeIndex.value,
  33122. setActiveItem
  33123. }, () => [
  33124. (0, vue.createVNode)((0, vue.unref)(ElIcon), { onClick: _cache[1] || (_cache[1] = ($event) => handleActions("zoomOut")) }, {
  33125. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(zoom_out_default))]),
  33126. _: 1
  33127. }),
  33128. (0, vue.createVNode)((0, vue.unref)(ElIcon), { onClick: _cache[2] || (_cache[2] = ($event) => handleActions("zoomIn")) }, {
  33129. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(zoom_in_default))]),
  33130. _: 1
  33131. }),
  33132. (0, vue.createElementVNode)("i", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("actions__divider")) }, null, 2),
  33133. (0, vue.createVNode)((0, vue.unref)(ElIcon), { onClick: toggleMode }, {
  33134. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(mode.value.icon)))]),
  33135. _: 1
  33136. }),
  33137. (0, vue.createElementVNode)("i", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("actions__divider")) }, null, 2),
  33138. (0, vue.createVNode)((0, vue.unref)(ElIcon), { onClick: _cache[3] || (_cache[3] = ($event) => handleActions("anticlockwise")) }, {
  33139. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(refresh_left_default))]),
  33140. _: 1
  33141. }),
  33142. (0, vue.createVNode)((0, vue.unref)(ElIcon), { onClick: _cache[4] || (_cache[4] = ($event) => handleActions("clockwise")) }, {
  33143. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(refresh_right_default))]),
  33144. _: 1
  33145. })
  33146. ])], 2)], 2),
  33147. (0, vue.createCommentVNode)(" CANVAS "),
  33148. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("canvas")) }, [loadError.value && _ctx.$slots["viewer-error"] ? (0, vue.renderSlot)(_ctx.$slots, "viewer-error", {
  33149. key: 0,
  33150. activeIndex: activeIndex.value,
  33151. src: currentImg.value
  33152. }) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
  33153. ref_key: "imgRef",
  33154. ref: imgRef,
  33155. key: currentImg.value,
  33156. src: currentImg.value,
  33157. style: (0, vue.normalizeStyle)(imgStyle.value),
  33158. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("img")),
  33159. crossorigin: __props.crossorigin,
  33160. onLoad: handleImgLoad,
  33161. onError: handleImgError,
  33162. onMousedown: handleMouseDown,
  33163. onTouchstart: handleTouchStart
  33164. }, null, 46, _hoisted_1$35))], 2),
  33165. (0, vue.renderSlot)(_ctx.$slots, "default")
  33166. ]),
  33167. _: 3
  33168. }, 8, ["focus-trap-el"])], 6)]),
  33169. _: 3
  33170. })]),
  33171. _: 3
  33172. }, 8, ["disabled"]);
  33173. };
  33174. }
  33175. });
  33176. //#endregion
  33177. //#region ../../packages/components/image-viewer/src/image-viewer.vue
  33178. var image_viewer_default = image_viewer_vue_vue_type_script_setup_true_lang_default;
  33179. //#endregion
  33180. //#region ../../packages/components/image-viewer/index.ts
  33181. const ElImageViewer = withInstall(image_viewer_default);
  33182. //#endregion
  33183. //#region ../../packages/components/image/src/image.vue?vue&type=script&setup=true&lang.ts
  33184. const _hoisted_1$34 = [
  33185. "src",
  33186. "loading",
  33187. "crossorigin"
  33188. ];
  33189. const _hoisted_2$21 = { key: 0 };
  33190. var image_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  33191. name: "ElImage",
  33192. inheritAttrs: false,
  33193. __name: "image",
  33194. props: imageProps,
  33195. emits: imageEmits,
  33196. setup(__props, { expose: __expose, emit: __emit }) {
  33197. const props = __props;
  33198. const emit = __emit;
  33199. const { t } = useLocale();
  33200. const ns = useNamespace("image");
  33201. const rawAttrs = (0, vue.useAttrs)();
  33202. const containerAttrs = (0, vue.computed)(() => {
  33203. return fromPairs(Object.entries(rawAttrs).filter(([key]) => /^(data-|on[A-Z])/i.test(key) || ["id", "style"].includes(key)));
  33204. });
  33205. const imgAttrs = useAttrs({
  33206. excludeListeners: true,
  33207. excludeKeys: (0, vue.computed)(() => {
  33208. return Object.keys(containerAttrs.value);
  33209. })
  33210. });
  33211. const imageSrc = (0, vue.ref)();
  33212. const hasLoadError = (0, vue.ref)(false);
  33213. const isLoading = (0, vue.ref)(true);
  33214. const showViewer = (0, vue.ref)(false);
  33215. const container = (0, vue.ref)();
  33216. const _scrollContainer = (0, vue.ref)();
  33217. const supportLoading = isClient && "loading" in HTMLImageElement.prototype;
  33218. let stopScrollListener;
  33219. const imageKls = (0, vue.computed)(() => [
  33220. ns.e("inner"),
  33221. preview.value && ns.e("preview"),
  33222. isLoading.value && ns.is("loading")
  33223. ]);
  33224. const imageStyle = (0, vue.computed)(() => {
  33225. const { fit } = props;
  33226. if (isClient && fit) return { objectFit: fit };
  33227. return {};
  33228. });
  33229. const preview = (0, vue.computed)(() => {
  33230. const { previewSrcList } = props;
  33231. return isArray$1(previewSrcList) && previewSrcList.length > 0;
  33232. });
  33233. const imageIndex = (0, vue.computed)(() => {
  33234. const { previewSrcList, initialIndex } = props;
  33235. let previewIndex = initialIndex;
  33236. if (initialIndex > previewSrcList.length - 1) previewIndex = 0;
  33237. return previewIndex;
  33238. });
  33239. const isManual = (0, vue.computed)(() => {
  33240. if (props.loading === "eager") return false;
  33241. return !supportLoading && props.loading === "lazy" || props.lazy;
  33242. });
  33243. const loadImage = () => {
  33244. if (!isClient) return;
  33245. isLoading.value = true;
  33246. hasLoadError.value = false;
  33247. imageSrc.value = props.src;
  33248. };
  33249. function handleLoad(event) {
  33250. isLoading.value = false;
  33251. hasLoadError.value = false;
  33252. emit("load", event);
  33253. }
  33254. function handleError(event) {
  33255. isLoading.value = false;
  33256. hasLoadError.value = true;
  33257. emit("error", event);
  33258. }
  33259. function handleLazyLoad(isIntersecting) {
  33260. if (isIntersecting) {
  33261. loadImage();
  33262. removeLazyLoadListener();
  33263. }
  33264. }
  33265. const lazyLoadHandler = useThrottleFn(handleLazyLoad, 200, true);
  33266. async function addLazyLoadListener() {
  33267. if (!isClient) return;
  33268. await (0, vue.nextTick)();
  33269. const { scrollContainer } = props;
  33270. if (isElement$1(scrollContainer)) _scrollContainer.value = scrollContainer;
  33271. else if (isString(scrollContainer) && scrollContainer !== "") _scrollContainer.value = document.querySelector(scrollContainer) ?? void 0;
  33272. else if (container.value) {
  33273. const scrollContainer = getScrollContainer(container.value);
  33274. _scrollContainer.value = isWindow(scrollContainer) ? void 0 : scrollContainer;
  33275. }
  33276. const { stop } = useIntersectionObserver(container, ([entry]) => {
  33277. lazyLoadHandler(entry.isIntersecting);
  33278. }, { root: _scrollContainer });
  33279. stopScrollListener = stop;
  33280. }
  33281. function removeLazyLoadListener() {
  33282. if (!isClient || !lazyLoadHandler) return;
  33283. stopScrollListener?.();
  33284. _scrollContainer.value = void 0;
  33285. stopScrollListener = void 0;
  33286. }
  33287. function clickHandler() {
  33288. if (!preview.value) return;
  33289. showViewer.value = true;
  33290. emit("show");
  33291. }
  33292. function closeViewer() {
  33293. showViewer.value = false;
  33294. emit("close");
  33295. }
  33296. function switchViewer(val) {
  33297. emit("switch", val);
  33298. }
  33299. (0, vue.watch)(() => props.src, () => {
  33300. if (isManual.value) {
  33301. isLoading.value = true;
  33302. hasLoadError.value = false;
  33303. removeLazyLoadListener();
  33304. addLazyLoadListener();
  33305. } else loadImage();
  33306. });
  33307. (0, vue.onMounted)(() => {
  33308. if (isManual.value) addLazyLoadListener();
  33309. else loadImage();
  33310. });
  33311. __expose({ showPreview: clickHandler });
  33312. return (_ctx, _cache) => {
  33313. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
  33314. ref_key: "container",
  33315. ref: container
  33316. }, containerAttrs.value, { class: [(0, vue.unref)(ns).b(), _ctx.$attrs.class] }), [hasLoadError.value ? (0, vue.renderSlot)(_ctx.$slots, "error", { key: 0 }, () => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("error")) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.image.error")), 3)]) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [imageSrc.value !== void 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", (0, vue.mergeProps)({ key: 0 }, (0, vue.unref)(imgAttrs), {
  33317. src: imageSrc.value,
  33318. loading: __props.loading,
  33319. style: imageStyle.value,
  33320. class: imageKls.value,
  33321. crossorigin: __props.crossorigin,
  33322. onClick: clickHandler,
  33323. onLoad: handleLoad,
  33324. onError: handleError
  33325. }), null, 16, _hoisted_1$34)) : (0, vue.createCommentVNode)("v-if", true), isLoading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  33326. key: 1,
  33327. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("wrapper"))
  33328. }, [(0, vue.renderSlot)(_ctx.$slots, "placeholder", {}, () => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("placeholder")) }, null, 2)])], 2)) : (0, vue.createCommentVNode)("v-if", true)], 64)), preview.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [showViewer.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElImageViewer), {
  33329. key: 0,
  33330. "z-index": __props.zIndex,
  33331. "initial-index": imageIndex.value,
  33332. infinite: __props.infinite,
  33333. "zoom-rate": __props.zoomRate,
  33334. "min-scale": __props.minScale,
  33335. "max-scale": __props.maxScale,
  33336. "show-progress": __props.showProgress,
  33337. "url-list": __props.previewSrcList,
  33338. scale: __props.scale,
  33339. crossorigin: __props.crossorigin,
  33340. "hide-on-click-modal": __props.hideOnClickModal,
  33341. teleported: __props.previewTeleported,
  33342. "close-on-press-escape": __props.closeOnPressEscape,
  33343. onClose: closeViewer,
  33344. onSwitch: switchViewer
  33345. }, (0, vue.createSlots)({
  33346. toolbar: (0, vue.withCtx)((toolbar) => [(0, vue.renderSlot)(_ctx.$slots, "toolbar", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(toolbar)))]),
  33347. default: (0, vue.withCtx)(() => [_ctx.$slots.viewer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$21, [(0, vue.renderSlot)(_ctx.$slots, "viewer")])) : (0, vue.createCommentVNode)("v-if", true)]),
  33348. _: 2
  33349. }, [_ctx.$slots.progress ? {
  33350. name: "progress",
  33351. fn: (0, vue.withCtx)((progress) => [(0, vue.renderSlot)(_ctx.$slots, "progress", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(progress)))]),
  33352. key: "0"
  33353. } : void 0, _ctx.$slots["viewer-error"] ? {
  33354. name: "viewer-error",
  33355. fn: (0, vue.withCtx)((viewerError) => [(0, vue.renderSlot)(_ctx.$slots, "viewer-error", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(viewerError)))]),
  33356. key: "1"
  33357. } : void 0]), 1032, [
  33358. "z-index",
  33359. "initial-index",
  33360. "infinite",
  33361. "zoom-rate",
  33362. "min-scale",
  33363. "max-scale",
  33364. "show-progress",
  33365. "url-list",
  33366. "scale",
  33367. "crossorigin",
  33368. "hide-on-click-modal",
  33369. "teleported",
  33370. "close-on-press-escape"
  33371. ])) : (0, vue.createCommentVNode)("v-if", true)], 64)) : (0, vue.createCommentVNode)("v-if", true)], 16);
  33372. };
  33373. }
  33374. });
  33375. //#endregion
  33376. //#region ../../packages/components/image/src/image.vue
  33377. var image_default = image_vue_vue_type_script_setup_true_lang_default;
  33378. //#endregion
  33379. //#region ../../packages/components/image/index.ts
  33380. const ElImage = withInstall(image_default);
  33381. //#endregion
  33382. //#region ../../packages/components/input-number/src/input-number.ts
  33383. /**
  33384. * @deprecated Removed after 3.0.0, Use `InputNumberProps` instead.
  33385. */
  33386. const inputNumberProps = buildProps({
  33387. id: {
  33388. type: String,
  33389. default: void 0
  33390. },
  33391. step: {
  33392. type: Number,
  33393. default: 1
  33394. },
  33395. stepStrictly: Boolean,
  33396. max: {
  33397. type: Number,
  33398. default: Number.MAX_SAFE_INTEGER
  33399. },
  33400. min: {
  33401. type: Number,
  33402. default: Number.MIN_SAFE_INTEGER
  33403. },
  33404. modelValue: { type: [Number, null] },
  33405. readonly: Boolean,
  33406. disabled: {
  33407. type: Boolean,
  33408. default: void 0
  33409. },
  33410. size: useSizeProp,
  33411. controls: {
  33412. type: Boolean,
  33413. default: true
  33414. },
  33415. controlsPosition: {
  33416. type: String,
  33417. default: "",
  33418. values: ["", "right"]
  33419. },
  33420. valueOnClear: {
  33421. type: definePropType([
  33422. String,
  33423. Number,
  33424. null
  33425. ]),
  33426. validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
  33427. default: null
  33428. },
  33429. name: String,
  33430. placeholder: String,
  33431. precision: {
  33432. type: Number,
  33433. validator: (val) => val >= 0 && val === Number.parseInt(`${val}`, 10)
  33434. },
  33435. validateEvent: {
  33436. type: Boolean,
  33437. default: true
  33438. },
  33439. ...useAriaProps(["ariaLabel"]),
  33440. inputmode: {
  33441. type: definePropType(String),
  33442. default: void 0
  33443. },
  33444. align: {
  33445. type: definePropType(String),
  33446. default: "center"
  33447. },
  33448. disabledScientific: Boolean
  33449. });
  33450. const inputNumberEmits = {
  33451. [CHANGE_EVENT]: (cur, prev) => prev !== cur,
  33452. blur: (e) => e instanceof FocusEvent,
  33453. focus: (e) => e instanceof FocusEvent,
  33454. [INPUT_EVENT]: (val) => isNumber(val) || isNil(val),
  33455. [UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
  33456. };
  33457. //#endregion
  33458. //#region ../../packages/components/input-number/src/input-number.vue?vue&type=script&setup=true&lang.ts
  33459. const _hoisted_1$33 = ["aria-label"];
  33460. const _hoisted_2$20 = ["aria-label"];
  33461. var input_number_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  33462. name: "ElInputNumber",
  33463. __name: "input-number",
  33464. props: inputNumberProps,
  33465. emits: inputNumberEmits,
  33466. setup(__props, { expose: __expose, emit: __emit }) {
  33467. const props = __props;
  33468. const emit = __emit;
  33469. const { t } = useLocale();
  33470. const ns = useNamespace("input-number");
  33471. const input = (0, vue.ref)();
  33472. const data = (0, vue.reactive)({
  33473. currentValue: props.modelValue,
  33474. userInput: null
  33475. });
  33476. const { formItem } = useFormItem();
  33477. const minDisabled = (0, vue.computed)(() => isNumber(props.modelValue) && props.modelValue <= props.min);
  33478. const maxDisabled = (0, vue.computed)(() => isNumber(props.modelValue) && props.modelValue >= props.max);
  33479. const numPrecision = (0, vue.computed)(() => {
  33480. const stepPrecision = getPrecision(props.step);
  33481. if (!isUndefined(props.precision)) {
  33482. if (stepPrecision > props.precision) /* @__PURE__ */ debugWarn("InputNumber", "precision should not be less than the decimal places of step");
  33483. return props.precision;
  33484. } else return Math.max(getPrecision(props.modelValue), stepPrecision);
  33485. });
  33486. const controlsAtRight = (0, vue.computed)(() => {
  33487. return props.controls && props.controlsPosition === "right";
  33488. });
  33489. const inputNumberSize = useFormSize();
  33490. const inputNumberDisabled = useFormDisabled();
  33491. const displayValue = (0, vue.computed)(() => {
  33492. if (data.userInput !== null) return data.userInput;
  33493. let currentValue = data.currentValue;
  33494. if (isNil(currentValue)) return "";
  33495. if (isNumber(currentValue)) {
  33496. if (Number.isNaN(currentValue)) return "";
  33497. if (!isUndefined(props.precision)) currentValue = currentValue.toFixed(props.precision);
  33498. }
  33499. return currentValue;
  33500. });
  33501. const toPrecision = (num, pre) => {
  33502. if (isUndefined(pre)) pre = numPrecision.value;
  33503. if (pre === 0) return Math.round(num);
  33504. let snum = String(num);
  33505. const pointPos = snum.indexOf(".");
  33506. if (pointPos === -1) return num;
  33507. if (!snum.replace(".", "").split("")[pointPos + pre]) return num;
  33508. const length = snum.length;
  33509. if (snum.charAt(length - 1) === "5") snum = `${snum.slice(0, Math.max(0, length - 1))}6`;
  33510. return Number.parseFloat(Number(snum).toFixed(pre));
  33511. };
  33512. const getPrecision = (value) => {
  33513. if (isNil(value)) return 0;
  33514. const valueString = value.toString();
  33515. const dotPosition = valueString.indexOf(".");
  33516. let precision = 0;
  33517. if (dotPosition !== -1) precision = valueString.length - dotPosition - 1;
  33518. return precision;
  33519. };
  33520. const ensurePrecision = (val, coefficient = 1) => {
  33521. if (!isNumber(val)) return data.currentValue;
  33522. if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {
  33523. /* @__PURE__ */ debugWarn("InputNumber", "The value has reached the maximum safe integer limit.");
  33524. return val;
  33525. } else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {
  33526. /* @__PURE__ */ debugWarn("InputNumber", "The value has reached the minimum safe integer limit.");
  33527. return val;
  33528. }
  33529. return toPrecision(val + props.step * coefficient);
  33530. };
  33531. const handleKeydown = (event) => {
  33532. const code = getEventCode(event);
  33533. const key = getEventKey(event);
  33534. if (props.disabledScientific && ["e", "E"].includes(key)) {
  33535. event.preventDefault();
  33536. return;
  33537. }
  33538. switch (code) {
  33539. case EVENT_CODE.up:
  33540. event.preventDefault();
  33541. increase();
  33542. break;
  33543. case EVENT_CODE.down:
  33544. event.preventDefault();
  33545. decrease();
  33546. break;
  33547. }
  33548. };
  33549. const increase = () => {
  33550. if (props.readonly || inputNumberDisabled.value || maxDisabled.value) return;
  33551. setCurrentValue(ensurePrecision(Number(displayValue.value) || 0));
  33552. emit(INPUT_EVENT, data.currentValue);
  33553. setCurrentValueToModelValue();
  33554. };
  33555. const decrease = () => {
  33556. if (props.readonly || inputNumberDisabled.value || minDisabled.value) return;
  33557. setCurrentValue(ensurePrecision(Number(displayValue.value) || 0, -1));
  33558. emit(INPUT_EVENT, data.currentValue);
  33559. setCurrentValueToModelValue();
  33560. };
  33561. const verifyValue = (value, update) => {
  33562. const { max, min, step, precision, stepStrictly, valueOnClear } = props;
  33563. if (max < min) throwError("InputNumber", "min should not be greater than max.");
  33564. let newVal = Number(value);
  33565. if (isNil(value) || Number.isNaN(newVal)) return null;
  33566. if (value === "") {
  33567. if (valueOnClear === null) return null;
  33568. newVal = isString(valueOnClear) ? {
  33569. min,
  33570. max
  33571. }[valueOnClear] : valueOnClear;
  33572. }
  33573. if (stepStrictly) {
  33574. newVal = toPrecision(Math.round(toPrecision(newVal / step)) * step, precision);
  33575. if (newVal !== value) update && emit(UPDATE_MODEL_EVENT, newVal);
  33576. }
  33577. if (!isUndefined(precision)) newVal = toPrecision(newVal, precision);
  33578. if (newVal > max || newVal < min) {
  33579. newVal = newVal > max ? max : min;
  33580. update && emit(UPDATE_MODEL_EVENT, newVal);
  33581. }
  33582. return newVal;
  33583. };
  33584. const setCurrentValue = (value, emitChange = true) => {
  33585. const oldVal = data.currentValue;
  33586. const newVal = verifyValue(value);
  33587. if (!emitChange) {
  33588. emit(UPDATE_MODEL_EVENT, newVal);
  33589. return;
  33590. }
  33591. data.userInput = null;
  33592. if (oldVal === newVal && value) return;
  33593. emit(UPDATE_MODEL_EVENT, newVal);
  33594. if (oldVal !== newVal) emit(CHANGE_EVENT, newVal, oldVal);
  33595. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  33596. data.currentValue = newVal;
  33597. };
  33598. const handleInput = (value) => {
  33599. data.userInput = value;
  33600. const newVal = value === "" ? null : Number(value);
  33601. emit(INPUT_EVENT, newVal);
  33602. setCurrentValue(newVal, false);
  33603. };
  33604. const handleInputChange = (value) => {
  33605. const newVal = value !== "" ? Number(value) : "";
  33606. if (isNumber(newVal) && !Number.isNaN(newVal) || value === "") setCurrentValue(newVal);
  33607. setCurrentValueToModelValue();
  33608. data.userInput = null;
  33609. };
  33610. const focus = () => {
  33611. input.value?.focus?.();
  33612. };
  33613. const blur = () => {
  33614. input.value?.blur?.();
  33615. };
  33616. const handleFocus = (event) => {
  33617. emit("focus", event);
  33618. };
  33619. const handleBlur = (event) => {
  33620. data.userInput = null;
  33621. if (data.currentValue === null && input.value?.input) input.value.input.value = "";
  33622. emit("blur", event);
  33623. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  33624. };
  33625. const setCurrentValueToModelValue = () => {
  33626. if (data.currentValue !== props.modelValue) data.currentValue = props.modelValue;
  33627. };
  33628. const handleWheel = (e) => {
  33629. if (document.activeElement === e.target) e.preventDefault();
  33630. };
  33631. (0, vue.watch)(() => props.modelValue, (value, oldValue) => {
  33632. const newValue = verifyValue(value, true);
  33633. if (data.userInput === null && newValue !== oldValue) data.currentValue = newValue;
  33634. }, { immediate: true });
  33635. (0, vue.watch)(() => props.precision, () => {
  33636. data.currentValue = verifyValue(props.modelValue);
  33637. });
  33638. (0, vue.onMounted)(() => {
  33639. const { min, max, modelValue } = props;
  33640. const innerInput = input.value?.input;
  33641. innerInput.setAttribute("role", "spinbutton");
  33642. if (Number.isFinite(max)) innerInput.setAttribute("aria-valuemax", String(max));
  33643. else innerInput.removeAttribute("aria-valuemax");
  33644. if (Number.isFinite(min)) innerInput.setAttribute("aria-valuemin", String(min));
  33645. else innerInput.removeAttribute("aria-valuemin");
  33646. innerInput.setAttribute("aria-valuenow", data.currentValue || data.currentValue === 0 ? String(data.currentValue) : "");
  33647. innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
  33648. if (!isNumber(modelValue) && modelValue != null) {
  33649. let val = Number(modelValue);
  33650. if (Number.isNaN(val)) val = null;
  33651. emit(UPDATE_MODEL_EVENT, val);
  33652. }
  33653. innerInput.addEventListener("wheel", handleWheel, { passive: false });
  33654. });
  33655. (0, vue.onUpdated)(() => {
  33656. (input.value?.input)?.setAttribute("aria-valuenow", `${data.currentValue ?? ""}`);
  33657. });
  33658. __expose({
  33659. focus,
  33660. blur
  33661. });
  33662. return (_ctx, _cache) => {
  33663. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  33664. class: (0, vue.normalizeClass)([
  33665. (0, vue.unref)(ns).b(),
  33666. (0, vue.unref)(ns).m((0, vue.unref)(inputNumberSize)),
  33667. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(inputNumberDisabled)),
  33668. (0, vue.unref)(ns).is("without-controls", !__props.controls),
  33669. (0, vue.unref)(ns).is("controls-right", controlsAtRight.value),
  33670. (0, vue.unref)(ns).is(__props.align, !!__props.align)
  33671. ]),
  33672. onDragstart: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["prevent"]))
  33673. }, [
  33674. __props.controls ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  33675. key: 0,
  33676. role: "button",
  33677. "aria-label": (0, vue.unref)(t)("el.inputNumber.decrease"),
  33678. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("decrease"), (0, vue.unref)(ns).is("disabled", minDisabled.value)]),
  33679. onKeydown: (0, vue.withKeys)(decrease, ["enter"])
  33680. }, [(0, vue.renderSlot)(_ctx.$slots, "decrease-icon", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  33681. default: (0, vue.withCtx)(() => [controlsAtRight.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(arrow_down_default), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(minus_default), { key: 1 }))]),
  33682. _: 1
  33683. })])], 42, _hoisted_1$33)), [[(0, vue.unref)(vRepeatClick), decrease]]) : (0, vue.createCommentVNode)("v-if", true),
  33684. __props.controls ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  33685. key: 1,
  33686. role: "button",
  33687. "aria-label": (0, vue.unref)(t)("el.inputNumber.increase"),
  33688. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("increase"), (0, vue.unref)(ns).is("disabled", maxDisabled.value)]),
  33689. onKeydown: (0, vue.withKeys)(increase, ["enter"])
  33690. }, [(0, vue.renderSlot)(_ctx.$slots, "increase-icon", {}, () => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  33691. default: (0, vue.withCtx)(() => [controlsAtRight.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(arrow_up_default), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(plus_default), { key: 1 }))]),
  33692. _: 1
  33693. })])], 42, _hoisted_2$20)), [[(0, vue.unref)(vRepeatClick), increase]]) : (0, vue.createCommentVNode)("v-if", true),
  33694. (0, vue.createVNode)((0, vue.unref)(ElInput), {
  33695. id: __props.id,
  33696. ref_key: "input",
  33697. ref: input,
  33698. type: "number",
  33699. step: __props.step,
  33700. "model-value": displayValue.value,
  33701. placeholder: __props.placeholder,
  33702. readonly: __props.readonly,
  33703. disabled: (0, vue.unref)(inputNumberDisabled),
  33704. size: (0, vue.unref)(inputNumberSize),
  33705. max: __props.max,
  33706. min: __props.min,
  33707. name: __props.name,
  33708. "aria-label": __props.ariaLabel,
  33709. "validate-event": false,
  33710. inputmode: __props.inputmode,
  33711. onKeydown: handleKeydown,
  33712. onBlur: handleBlur,
  33713. onFocus: handleFocus,
  33714. onInput: handleInput,
  33715. onChange: handleInputChange
  33716. }, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots.prefix ? {
  33717. name: "prefix",
  33718. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "prefix")]),
  33719. key: "0"
  33720. } : void 0, _ctx.$slots.suffix ? {
  33721. name: "suffix",
  33722. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "suffix")]),
  33723. key: "1"
  33724. } : void 0]), 1032, [
  33725. "id",
  33726. "step",
  33727. "model-value",
  33728. "placeholder",
  33729. "readonly",
  33730. "disabled",
  33731. "size",
  33732. "max",
  33733. "min",
  33734. "name",
  33735. "aria-label",
  33736. "inputmode"
  33737. ])
  33738. ], 34);
  33739. };
  33740. }
  33741. });
  33742. //#endregion
  33743. //#region ../../packages/components/input-number/src/input-number.vue
  33744. var input_number_default = input_number_vue_vue_type_script_setup_true_lang_default;
  33745. //#endregion
  33746. //#region ../../packages/components/input-number/index.ts
  33747. const ElInputNumber = withInstall(input_number_default);
  33748. //#endregion
  33749. //#region ../../packages/components/input-tag/src/input-tag.ts
  33750. /**
  33751. * @deprecated Removed after 3.0.0, Use `InputTagProps` instead.
  33752. */
  33753. const inputTagProps = buildProps({
  33754. modelValue: { type: definePropType(Array) },
  33755. max: Number,
  33756. tagType: {
  33757. ...tagProps.type,
  33758. default: "info"
  33759. },
  33760. tagEffect: tagProps.effect,
  33761. effect: {
  33762. type: definePropType(String),
  33763. default: "light"
  33764. },
  33765. trigger: {
  33766. type: definePropType(String),
  33767. default: EVENT_CODE.enter
  33768. },
  33769. draggable: Boolean,
  33770. delimiter: {
  33771. type: [String, RegExp],
  33772. default: ""
  33773. },
  33774. size: useSizeProp,
  33775. clearable: Boolean,
  33776. clearIcon: {
  33777. type: iconPropType,
  33778. default: circle_close_default
  33779. },
  33780. disabled: {
  33781. type: Boolean,
  33782. default: void 0
  33783. },
  33784. validateEvent: {
  33785. type: Boolean,
  33786. default: true
  33787. },
  33788. readonly: Boolean,
  33789. autofocus: Boolean,
  33790. id: {
  33791. type: String,
  33792. default: void 0
  33793. },
  33794. tabindex: {
  33795. type: [String, Number],
  33796. default: 0
  33797. },
  33798. maxlength: { type: [String, Number] },
  33799. minlength: { type: [String, Number] },
  33800. placeholder: String,
  33801. autocomplete: {
  33802. type: definePropType(String),
  33803. default: "off"
  33804. },
  33805. saveOnBlur: {
  33806. type: Boolean,
  33807. default: true
  33808. },
  33809. collapseTags: Boolean,
  33810. collapseTagsTooltip: Boolean,
  33811. maxCollapseTags: {
  33812. type: Number,
  33813. default: 1
  33814. },
  33815. ariaLabel: String
  33816. });
  33817. const inputTagEmits = {
  33818. [UPDATE_MODEL_EVENT]: (value) => isArray$1(value) || isUndefined(value),
  33819. [CHANGE_EVENT]: (value) => isArray$1(value) || isUndefined(value),
  33820. [INPUT_EVENT]: (value) => isString(value),
  33821. "add-tag": (value) => isString(value) || isArray$1(value),
  33822. "remove-tag": (value, index) => isString(value) && isNumber(index),
  33823. "drag-tag": (oldIndex, newIndex, value) => isNumber(oldIndex) && isNumber(newIndex) && isString(value),
  33824. focus: (evt) => evt instanceof FocusEvent,
  33825. blur: (evt) => evt instanceof FocusEvent,
  33826. clear: () => true
  33827. };
  33828. //#endregion
  33829. //#region ../../packages/components/input-tag/src/composables/use-drag-tag.ts
  33830. function useDragTag({ wrapperRef, handleDragged, afterDragged }) {
  33831. const ns = useNamespace("input-tag");
  33832. const dropIndicatorRef = (0, vue.shallowRef)();
  33833. const showDropIndicator = (0, vue.ref)(false);
  33834. let draggingIndex;
  33835. let draggingTag;
  33836. let dropIndex;
  33837. let dropType;
  33838. function getTagClassName(index) {
  33839. return `.${ns.e("inner")} .${ns.namespace.value}-tag:nth-child(${index + 1})`;
  33840. }
  33841. function handleDragStart(event, index) {
  33842. draggingIndex = index;
  33843. draggingTag = wrapperRef.value.querySelector(getTagClassName(index));
  33844. if (draggingTag) draggingTag.style.opacity = "0.5";
  33845. event.dataTransfer.effectAllowed = "move";
  33846. }
  33847. function handleDragOver(event, index) {
  33848. dropIndex = index;
  33849. event.preventDefault();
  33850. event.dataTransfer.dropEffect = "move";
  33851. if (isUndefined(draggingIndex) || draggingIndex === index) {
  33852. showDropIndicator.value = false;
  33853. return;
  33854. }
  33855. const dropPosition = wrapperRef.value.querySelector(getTagClassName(index)).getBoundingClientRect();
  33856. const dropPrev = !(draggingIndex + 1 === index);
  33857. const dropNext = !(draggingIndex - 1 === index);
  33858. const distance = event.clientX - dropPosition.left;
  33859. const prevPercent = dropPrev ? dropNext ? .5 : 1 : -1;
  33860. const nextPercent = dropNext ? dropPrev ? .5 : 0 : 1;
  33861. if (distance <= dropPosition.width * prevPercent) dropType = "before";
  33862. else if (distance > dropPosition.width * nextPercent) dropType = "after";
  33863. else dropType = void 0;
  33864. const innerEl = wrapperRef.value.querySelector(`.${ns.e("inner")}`);
  33865. const innerPosition = innerEl.getBoundingClientRect();
  33866. const gap = Number.parseFloat(getStyle(innerEl, "gap")) / 2;
  33867. const indicatorTop = dropPosition.top - innerPosition.top;
  33868. let indicatorLeft = -9999;
  33869. if (dropType === "before") indicatorLeft = Math.max(dropPosition.left - innerPosition.left - gap, Math.floor(-gap / 2));
  33870. else if (dropType === "after") {
  33871. const left = dropPosition.right - innerPosition.left;
  33872. indicatorLeft = left + (innerPosition.width === left ? Math.floor(gap / 2) : gap);
  33873. }
  33874. setStyle(dropIndicatorRef.value, {
  33875. top: `${indicatorTop}px`,
  33876. left: `${indicatorLeft}px`
  33877. });
  33878. showDropIndicator.value = !!dropType;
  33879. }
  33880. function handleDragEnd(event) {
  33881. event.preventDefault();
  33882. if (draggingTag) draggingTag.style.opacity = "";
  33883. if (dropType && !isUndefined(draggingIndex) && !isUndefined(dropIndex) && draggingIndex !== dropIndex) handleDragged(draggingIndex, dropIndex, dropType);
  33884. showDropIndicator.value = false;
  33885. draggingIndex = void 0;
  33886. draggingTag = null;
  33887. dropIndex = void 0;
  33888. dropType = void 0;
  33889. afterDragged?.();
  33890. }
  33891. return {
  33892. dropIndicatorRef,
  33893. showDropIndicator,
  33894. handleDragStart,
  33895. handleDragOver,
  33896. handleDragEnd
  33897. };
  33898. }
  33899. //#endregion
  33900. //#region ../../packages/components/input-tag/src/composables/use-hovering.ts
  33901. function useHovering() {
  33902. const hovering = (0, vue.ref)(false);
  33903. const handleMouseEnter = () => {
  33904. hovering.value = true;
  33905. };
  33906. const handleMouseLeave = () => {
  33907. hovering.value = false;
  33908. };
  33909. return {
  33910. hovering,
  33911. handleMouseEnter,
  33912. handleMouseLeave
  33913. };
  33914. }
  33915. //#endregion
  33916. //#region ../../packages/components/input-tag/src/composables/use-input-tag.ts
  33917. function useInputTag({ props, emit, formItem }) {
  33918. const disabled = useFormDisabled();
  33919. const size = useFormSize();
  33920. const inputRef = (0, vue.shallowRef)();
  33921. const inputValue = (0, vue.ref)();
  33922. const tagTooltipRef = (0, vue.ref)();
  33923. const tagSize = (0, vue.computed)(() => {
  33924. return ["small"].includes(size.value) ? "small" : "default";
  33925. });
  33926. const placeholder = (0, vue.computed)(() => {
  33927. return props.modelValue?.length ? void 0 : props.placeholder;
  33928. });
  33929. const closable = (0, vue.computed)(() => !(props.readonly || disabled.value));
  33930. const inputLimit = (0, vue.computed)(() => {
  33931. return isUndefined(props.max) ? false : (props.modelValue?.length ?? 0) >= props.max;
  33932. });
  33933. const showTagList = (0, vue.computed)(() => {
  33934. return props.collapseTags ? props.modelValue?.slice(0, props.maxCollapseTags) : props.modelValue;
  33935. });
  33936. const collapseTagList = (0, vue.computed)(() => {
  33937. return props.collapseTags ? props.modelValue?.slice(props.maxCollapseTags) : [];
  33938. });
  33939. const addTagsEmit = (value) => {
  33940. const list = [...props.modelValue ?? [], ...castArray$1(value)];
  33941. emit(UPDATE_MODEL_EVENT, list);
  33942. emit(CHANGE_EVENT, list);
  33943. emit("add-tag", value);
  33944. inputValue.value = void 0;
  33945. };
  33946. const getDelimitedTags = (input) => {
  33947. const parts = input.split(props.delimiter);
  33948. const tags = parts.length > 1 ? parts.map((val) => val.trim()).filter(Boolean) : [];
  33949. if (props.max) {
  33950. const maxInsert = props.max - (props.modelValue?.length ?? 0);
  33951. tags.splice(maxInsert);
  33952. }
  33953. return tags.length === 1 ? tags[0] : tags;
  33954. };
  33955. const handlePaste = (event) => {
  33956. const pasted = event.clipboardData?.getData("text");
  33957. if (props.readonly || inputLimit.value || !props.delimiter || !pasted) return;
  33958. const { selectionStart = 0, selectionEnd = 0, value } = event.target;
  33959. const nextValue = value.slice(0, selectionStart) + pasted + value.slice(selectionEnd);
  33960. const tags = getDelimitedTags(nextValue);
  33961. if (tags.length) {
  33962. addTagsEmit(tags);
  33963. emit(INPUT_EVENT, nextValue);
  33964. event.preventDefault();
  33965. }
  33966. };
  33967. const handleInput = (event) => {
  33968. if (inputLimit.value) {
  33969. inputValue.value = void 0;
  33970. return;
  33971. }
  33972. if (isComposing.value) return;
  33973. if (props.delimiter && inputValue.value) {
  33974. const tags = getDelimitedTags(inputValue.value);
  33975. if (tags.length) addTagsEmit(tags);
  33976. }
  33977. emit(INPUT_EVENT, event.target.value);
  33978. };
  33979. const handleKeydown = (event) => {
  33980. if (isComposing.value) return;
  33981. switch (getEventCode(event)) {
  33982. case props.trigger:
  33983. event.preventDefault();
  33984. event.stopPropagation();
  33985. handleAddTag();
  33986. break;
  33987. case EVENT_CODE.numpadEnter:
  33988. if (props.trigger === EVENT_CODE.enter) {
  33989. event.preventDefault();
  33990. event.stopPropagation();
  33991. handleAddTag();
  33992. }
  33993. break;
  33994. case EVENT_CODE.backspace:
  33995. if (!inputValue.value && props.modelValue?.length) {
  33996. event.preventDefault();
  33997. event.stopPropagation();
  33998. handleRemoveTag(props.modelValue.length - 1);
  33999. }
  34000. break;
  34001. }
  34002. };
  34003. const handleKeyup = (event) => {
  34004. if (isComposing.value || !isAndroid()) return;
  34005. switch (getEventCode(event)) {
  34006. case EVENT_CODE.space:
  34007. if (props.trigger === EVENT_CODE.space) {
  34008. event.preventDefault();
  34009. event.stopPropagation();
  34010. handleAddTag();
  34011. }
  34012. break;
  34013. }
  34014. };
  34015. const handleAddTag = () => {
  34016. const value = inputValue.value?.trim();
  34017. if (!value || inputLimit.value) return;
  34018. addTagsEmit(value);
  34019. };
  34020. const handleRemoveTag = (index) => {
  34021. const value = (props.modelValue ?? []).slice();
  34022. const [item] = value.splice(index, 1);
  34023. emit(UPDATE_MODEL_EVENT, value);
  34024. emit(CHANGE_EVENT, value);
  34025. emit("remove-tag", item, index);
  34026. };
  34027. const handleClear = () => {
  34028. inputValue.value = void 0;
  34029. emit(UPDATE_MODEL_EVENT, void 0);
  34030. emit(CHANGE_EVENT, void 0);
  34031. emit("clear");
  34032. };
  34033. const handleDragged = (draggingIndex, dropIndex, type) => {
  34034. const value = (props.modelValue ?? []).slice();
  34035. const [draggedItem] = value.splice(draggingIndex, 1);
  34036. const step = dropIndex > draggingIndex && type === "before" ? -1 : dropIndex < draggingIndex && type === "after" ? 1 : 0;
  34037. value.splice(dropIndex + step, 0, draggedItem);
  34038. emit(UPDATE_MODEL_EVENT, value);
  34039. emit(CHANGE_EVENT, value);
  34040. emit("drag-tag", draggingIndex, dropIndex + step, draggedItem);
  34041. };
  34042. const focus = () => {
  34043. inputRef.value?.focus();
  34044. };
  34045. const blur = () => {
  34046. inputRef.value?.blur();
  34047. };
  34048. const { wrapperRef, isFocused } = useFocusController(inputRef, {
  34049. disabled,
  34050. beforeBlur(event) {
  34051. return tagTooltipRef.value?.isFocusInsideContent(event);
  34052. },
  34053. afterBlur() {
  34054. if (props.saveOnBlur) handleAddTag();
  34055. else inputValue.value = void 0;
  34056. if (props.validateEvent) formItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  34057. }
  34058. });
  34059. const { isComposing, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd } = useComposition({ afterComposition: handleInput });
  34060. (0, vue.watch)(() => props.modelValue, () => {
  34061. if (props.validateEvent) formItem?.validate?.(CHANGE_EVENT).catch((err) => /* @__PURE__ */ debugWarn(err));
  34062. });
  34063. return {
  34064. inputRef,
  34065. wrapperRef,
  34066. tagTooltipRef,
  34067. isFocused,
  34068. isComposing,
  34069. inputValue,
  34070. size,
  34071. tagSize,
  34072. placeholder,
  34073. closable,
  34074. disabled,
  34075. inputLimit,
  34076. showTagList,
  34077. collapseTagList,
  34078. handleDragged,
  34079. handlePaste,
  34080. handleInput,
  34081. handleKeydown,
  34082. handleKeyup,
  34083. handleAddTag,
  34084. handleRemoveTag,
  34085. handleClear,
  34086. handleCompositionStart,
  34087. handleCompositionUpdate,
  34088. handleCompositionEnd,
  34089. focus,
  34090. blur
  34091. };
  34092. }
  34093. //#endregion
  34094. //#region ../../packages/components/input-tag/src/composables/use-input-tag-dom.ts
  34095. function useInputTagDom({ props, isFocused, hovering, disabled, inputValue, size, validateState, validateIcon, needStatusIcon }) {
  34096. const attrs = (0, vue.useAttrs)();
  34097. const slots = (0, vue.useSlots)();
  34098. const ns = useNamespace("input-tag");
  34099. const nsInput = useNamespace("input");
  34100. const collapseItemRef = (0, vue.ref)();
  34101. const innerRef = (0, vue.ref)();
  34102. const containerKls = (0, vue.computed)(() => [
  34103. ns.b(),
  34104. ns.is("focused", isFocused.value),
  34105. ns.is("hovering", hovering.value),
  34106. ns.is("disabled", disabled.value),
  34107. ns.m(size.value),
  34108. ns.e("wrapper"),
  34109. attrs.class
  34110. ]);
  34111. const containerStyle = (0, vue.computed)(() => [attrs.style]);
  34112. const innerKls = (0, vue.computed)(() => [
  34113. ns.e("inner"),
  34114. ns.is("draggable", props.draggable),
  34115. ns.is("left-space", !props.modelValue?.length && !slots.prefix),
  34116. ns.is("right-space", !props.modelValue?.length && !showSuffix.value)
  34117. ]);
  34118. const showClear = (0, vue.computed)(() => {
  34119. return props.clearable && !disabled.value && !props.readonly && (props.modelValue?.length || inputValue.value) && (isFocused.value || hovering.value);
  34120. });
  34121. const showSuffix = (0, vue.computed)(() => {
  34122. return slots.suffix || showClear.value || validateState.value && validateIcon.value && needStatusIcon.value;
  34123. });
  34124. const states = (0, vue.reactive)({
  34125. innerWidth: 0,
  34126. collapseItemWidth: 0
  34127. });
  34128. const getGapWidth = () => {
  34129. if (!innerRef.value) return 0;
  34130. const style = window.getComputedStyle(innerRef.value);
  34131. return Number.parseFloat(style.gap || "6px");
  34132. };
  34133. const resetInnerWidth = () => {
  34134. states.innerWidth = Number.parseFloat(window.getComputedStyle(innerRef.value).width);
  34135. };
  34136. const resetCollapseItemWidth = () => {
  34137. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  34138. };
  34139. const tagStyle = (0, vue.computed)(() => {
  34140. if (!props.collapseTags) return {};
  34141. const gapWidth = getGapWidth();
  34142. const inputSlotWidth = gapWidth + MINIMUM_INPUT_WIDTH;
  34143. const maxWidth = collapseItemRef.value && props.maxCollapseTags === 1 ? states.innerWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.innerWidth - inputSlotWidth;
  34144. return { maxWidth: `${Math.max(maxWidth, 0)}px` };
  34145. });
  34146. useResizeObserver(innerRef, resetInnerWidth);
  34147. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  34148. return {
  34149. ns,
  34150. nsInput,
  34151. containerKls,
  34152. containerStyle,
  34153. innerKls,
  34154. showClear,
  34155. showSuffix,
  34156. tagStyle,
  34157. collapseItemRef,
  34158. innerRef
  34159. };
  34160. }
  34161. //#endregion
  34162. //#region ../../packages/components/input-tag/src/input-tag.vue?vue&type=script&setup=true&lang.ts
  34163. const _hoisted_1$32 = [
  34164. "id",
  34165. "minlength",
  34166. "maxlength",
  34167. "disabled",
  34168. "readonly",
  34169. "autocomplete",
  34170. "tabindex",
  34171. "placeholder",
  34172. "autofocus",
  34173. "ariaLabel"
  34174. ];
  34175. const _hoisted_2$19 = ["textContent"];
  34176. var input_tag_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  34177. name: "ElInputTag",
  34178. inheritAttrs: false,
  34179. __name: "input-tag",
  34180. props: inputTagProps,
  34181. emits: inputTagEmits,
  34182. setup(__props, { expose: __expose, emit: __emit }) {
  34183. const props = __props;
  34184. const emit = __emit;
  34185. const attrs = useAttrs();
  34186. const slots = (0, vue.useSlots)();
  34187. const { form, formItem } = useFormItem();
  34188. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  34189. const needStatusIcon = (0, vue.computed)(() => form?.statusIcon ?? false);
  34190. const validateState = (0, vue.computed)(() => formItem?.validateState || "");
  34191. const validateIcon = (0, vue.computed)(() => {
  34192. return validateState.value && ValidateComponentsMap[validateState.value];
  34193. });
  34194. const { inputRef, wrapperRef, tagTooltipRef, isFocused, inputValue, size, tagSize, placeholder, closable, disabled, showTagList, collapseTagList, handleDragged, handlePaste, handleInput, handleKeydown, handleKeyup, handleRemoveTag, handleClear, handleCompositionStart, handleCompositionUpdate, handleCompositionEnd, focus, blur } = useInputTag({
  34195. props,
  34196. emit,
  34197. formItem
  34198. });
  34199. const { hovering, handleMouseEnter, handleMouseLeave } = useHovering();
  34200. const { calculatorRef, inputStyle } = useCalcInputWidth();
  34201. const { dropIndicatorRef, showDropIndicator, handleDragStart, handleDragOver, handleDragEnd } = useDragTag({
  34202. wrapperRef,
  34203. handleDragged,
  34204. afterDragged: focus
  34205. });
  34206. const { ns, nsInput, containerKls, containerStyle, innerKls, showClear, showSuffix, tagStyle, collapseItemRef, innerRef } = useInputTagDom({
  34207. props,
  34208. hovering,
  34209. isFocused,
  34210. inputValue,
  34211. disabled,
  34212. size,
  34213. validateState,
  34214. validateIcon,
  34215. needStatusIcon
  34216. });
  34217. __expose({
  34218. focus,
  34219. blur
  34220. });
  34221. return (_ctx, _cache) => {
  34222. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  34223. ref_key: "wrapperRef",
  34224. ref: wrapperRef,
  34225. class: (0, vue.normalizeClass)((0, vue.unref)(containerKls)),
  34226. style: (0, vue.normalizeStyle)((0, vue.unref)(containerStyle)),
  34227. onMouseenter: _cache[9] || (_cache[9] = (...args) => (0, vue.unref)(handleMouseEnter) && (0, vue.unref)(handleMouseEnter)(...args)),
  34228. onMouseleave: _cache[10] || (_cache[10] = (...args) => (0, vue.unref)(handleMouseLeave) && (0, vue.unref)(handleMouseLeave)(...args))
  34229. }, [
  34230. (0, vue.unref)(slots).prefix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  34231. key: 0,
  34232. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("prefix"))
  34233. }, [(0, vue.renderSlot)(_ctx.$slots, "prefix")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  34234. (0, vue.createElementVNode)("div", {
  34235. ref_key: "innerRef",
  34236. ref: innerRef,
  34237. class: (0, vue.normalizeClass)((0, vue.unref)(innerKls))
  34238. }, [
  34239. ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(showTagList), (item, index) => {
  34240. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTag), {
  34241. key: index,
  34242. size: (0, vue.unref)(tagSize),
  34243. closable: (0, vue.unref)(closable),
  34244. type: __props.tagType,
  34245. effect: __props.tagEffect,
  34246. draggable: (0, vue.unref)(closable) && __props.draggable,
  34247. style: (0, vue.normalizeStyle)((0, vue.unref)(tagStyle)),
  34248. "disable-transitions": "",
  34249. onClose: ($event) => (0, vue.unref)(handleRemoveTag)(index),
  34250. onDragstart: (event) => (0, vue.unref)(handleDragStart)(event, index),
  34251. onDragover: (event) => (0, vue.unref)(handleDragOver)(event, index),
  34252. onDragend: (0, vue.unref)(handleDragEnd),
  34253. onDrop: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  34254. }, {
  34255. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "tag", {
  34256. value: item,
  34257. index
  34258. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(item), 1)])]),
  34259. _: 2
  34260. }, 1032, [
  34261. "size",
  34262. "closable",
  34263. "type",
  34264. "effect",
  34265. "draggable",
  34266. "style",
  34267. "onClose",
  34268. "onDragstart",
  34269. "onDragover",
  34270. "onDragend"
  34271. ]);
  34272. }), 128)),
  34273. __props.collapseTags && __props.modelValue && __props.modelValue.length > __props.maxCollapseTags ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  34274. key: 0,
  34275. ref_key: "tagTooltipRef",
  34276. ref: tagTooltipRef,
  34277. disabled: !__props.collapseTagsTooltip,
  34278. "fallback-placements": [
  34279. "bottom",
  34280. "top",
  34281. "right",
  34282. "left"
  34283. ],
  34284. effect: __props.effect,
  34285. placement: "bottom"
  34286. }, {
  34287. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  34288. ref_key: "collapseItemRef",
  34289. ref: collapseItemRef,
  34290. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("collapse-tag"))
  34291. }, [(0, vue.createVNode)((0, vue.unref)(ElTag), {
  34292. closable: false,
  34293. size: (0, vue.unref)(tagSize),
  34294. type: __props.tagType,
  34295. effect: __props.tagEffect,
  34296. "disable-transitions": ""
  34297. }, {
  34298. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)(" + " + (0, vue.toDisplayString)(__props.modelValue.length - __props.maxCollapseTags), 1)]),
  34299. _: 1
  34300. }, 8, [
  34301. "size",
  34302. "type",
  34303. "effect"
  34304. ])], 2)]),
  34305. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input-tag-list")) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(collapseTagList), (item, index) => {
  34306. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTag), {
  34307. key: index,
  34308. size: (0, vue.unref)(tagSize),
  34309. closable: (0, vue.unref)(closable),
  34310. type: __props.tagType,
  34311. effect: __props.tagEffect,
  34312. "disable-transitions": "",
  34313. onClose: ($event) => (0, vue.unref)(handleRemoveTag)(index + __props.maxCollapseTags)
  34314. }, {
  34315. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "tag", {
  34316. value: item,
  34317. index: index + __props.maxCollapseTags
  34318. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(item), 1)])]),
  34319. _: 2
  34320. }, 1032, [
  34321. "size",
  34322. "closable",
  34323. "type",
  34324. "effect",
  34325. "onClose"
  34326. ]);
  34327. }), 128))], 2)]),
  34328. _: 3
  34329. }, 8, ["disabled", "effect"])) : (0, vue.createCommentVNode)("v-if", true),
  34330. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input-wrapper")) }, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", (0, vue.mergeProps)({
  34331. id: (0, vue.unref)(inputId),
  34332. ref_key: "inputRef",
  34333. ref: inputRef,
  34334. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => (0, vue.isRef)(inputValue) ? inputValue.value = $event : null)
  34335. }, (0, vue.unref)(attrs), {
  34336. type: "text",
  34337. minlength: __props.minlength,
  34338. maxlength: __props.maxlength,
  34339. disabled: (0, vue.unref)(disabled),
  34340. readonly: __props.readonly,
  34341. autocomplete: __props.autocomplete,
  34342. tabindex: __props.tabindex,
  34343. placeholder: (0, vue.unref)(placeholder),
  34344. autofocus: __props.autofocus,
  34345. ariaLabel: __props.ariaLabel,
  34346. class: (0, vue.unref)(ns).e("input"),
  34347. style: (0, vue.unref)(inputStyle),
  34348. onCompositionstart: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(handleCompositionStart) && (0, vue.unref)(handleCompositionStart)(...args)),
  34349. onCompositionupdate: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(handleCompositionUpdate) && (0, vue.unref)(handleCompositionUpdate)(...args)),
  34350. onCompositionend: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(handleCompositionEnd) && (0, vue.unref)(handleCompositionEnd)(...args)),
  34351. onPaste: _cache[5] || (_cache[5] = (...args) => (0, vue.unref)(handlePaste) && (0, vue.unref)(handlePaste)(...args)),
  34352. onInput: _cache[6] || (_cache[6] = (...args) => (0, vue.unref)(handleInput) && (0, vue.unref)(handleInput)(...args)),
  34353. onKeydown: _cache[7] || (_cache[7] = (...args) => (0, vue.unref)(handleKeydown) && (0, vue.unref)(handleKeydown)(...args)),
  34354. onKeyup: _cache[8] || (_cache[8] = (...args) => (0, vue.unref)(handleKeyup) && (0, vue.unref)(handleKeyup)(...args))
  34355. }), null, 16, _hoisted_1$32), [[vue.vModelText, (0, vue.unref)(inputValue)]]), (0, vue.createElementVNode)("span", {
  34356. ref_key: "calculatorRef",
  34357. ref: calculatorRef,
  34358. "aria-hidden": "true",
  34359. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input-calculator")),
  34360. textContent: (0, vue.toDisplayString)((0, vue.unref)(inputValue))
  34361. }, null, 10, _hoisted_2$19)], 2),
  34362. (0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  34363. ref_key: "dropIndicatorRef",
  34364. ref: dropIndicatorRef,
  34365. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("drop-indicator"))
  34366. }, null, 2), [[vue.vShow, (0, vue.unref)(showDropIndicator)]])
  34367. ], 2),
  34368. (0, vue.unref)(showSuffix) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  34369. key: 1,
  34370. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("suffix"))
  34371. }, [
  34372. (0, vue.renderSlot)(_ctx.$slots, "suffix"),
  34373. (0, vue.unref)(showClear) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  34374. key: 0,
  34375. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), (0, vue.unref)(ns).e("clear")]),
  34376. onMousedown: (0, vue.withModifiers)((0, vue.unref)(NOOP), ["prevent"]),
  34377. onClick: (0, vue.unref)(handleClear)
  34378. }, {
  34379. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.clearIcon)))]),
  34380. _: 1
  34381. }, 8, [
  34382. "class",
  34383. "onMousedown",
  34384. "onClick"
  34385. ])) : (0, vue.createCommentVNode)("v-if", true),
  34386. validateState.value && validateIcon.value && needStatusIcon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  34387. key: 1,
  34388. class: (0, vue.normalizeClass)([
  34389. (0, vue.unref)(nsInput).e("icon"),
  34390. (0, vue.unref)(nsInput).e("validateIcon"),
  34391. (0, vue.unref)(nsInput).is("loading", validateState.value === "validating")
  34392. ])
  34393. }, {
  34394. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(validateIcon.value)))]),
  34395. _: 1
  34396. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  34397. ], 2)) : (0, vue.createCommentVNode)("v-if", true)
  34398. ], 38);
  34399. };
  34400. }
  34401. });
  34402. //#endregion
  34403. //#region ../../packages/components/input-tag/src/input-tag.vue
  34404. var input_tag_default = input_tag_vue_vue_type_script_setup_true_lang_default;
  34405. //#endregion
  34406. //#region ../../packages/components/input-tag/index.ts
  34407. const ElInputTag = withInstall(input_tag_default);
  34408. //#endregion
  34409. //#region ../../packages/components/link/src/link.ts
  34410. /**
  34411. * @deprecated Removed after 3.0.0, Use `LinkProps` instead.
  34412. */
  34413. const linkProps = buildProps({
  34414. type: {
  34415. type: String,
  34416. values: [
  34417. "primary",
  34418. "success",
  34419. "warning",
  34420. "info",
  34421. "danger",
  34422. "default"
  34423. ],
  34424. default: void 0
  34425. },
  34426. underline: {
  34427. type: [Boolean, String],
  34428. values: [
  34429. true,
  34430. false,
  34431. "always",
  34432. "never",
  34433. "hover"
  34434. ],
  34435. default: void 0
  34436. },
  34437. disabled: Boolean,
  34438. href: {
  34439. type: String,
  34440. default: ""
  34441. },
  34442. target: {
  34443. type: String,
  34444. default: "_self"
  34445. },
  34446. icon: { type: iconPropType }
  34447. });
  34448. const linkEmits = { click: (evt) => evt instanceof MouseEvent };
  34449. //#endregion
  34450. //#region ../../packages/components/link/src/link.vue?vue&type=script&setup=true&lang.ts
  34451. const _hoisted_1$31 = ["href", "target"];
  34452. var link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  34453. name: "ElLink",
  34454. __name: "link",
  34455. props: linkProps,
  34456. emits: linkEmits,
  34457. setup(__props, { emit: __emit }) {
  34458. const props = __props;
  34459. const emit = __emit;
  34460. const globalConfig = useGlobalConfig("link");
  34461. useDeprecated({
  34462. scope: "el-link",
  34463. from: "The underline option (boolean)",
  34464. replacement: "'always' | 'hover' | 'never'",
  34465. version: "3.0.0",
  34466. ref: "https://element-plus.org/en-US/component/link.html#underline"
  34467. }, (0, vue.computed)(() => isBoolean(props.underline)));
  34468. const ns = useNamespace("link");
  34469. const linkKls = (0, vue.computed)(() => [
  34470. ns.b(),
  34471. ns.m(props.type ?? globalConfig.value?.type ?? "default"),
  34472. ns.is("disabled", props.disabled),
  34473. ns.is("underline", underline.value === "always"),
  34474. ns.is("hover-underline", underline.value === "hover" && !props.disabled)
  34475. ]);
  34476. const underline = (0, vue.computed)(() => {
  34477. if (isBoolean(props.underline)) return props.underline ? "hover" : "never";
  34478. else return props.underline ?? globalConfig.value?.underline ?? "hover";
  34479. });
  34480. function handleClick(event) {
  34481. if (!props.disabled) emit("click", event);
  34482. }
  34483. return (_ctx, _cache) => {
  34484. return (0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
  34485. class: (0, vue.normalizeClass)(linkKls.value),
  34486. href: __props.disabled || !__props.href ? void 0 : __props.href,
  34487. target: __props.disabled || !__props.href ? void 0 : __props.target,
  34488. onClick: handleClick
  34489. }, [
  34490. __props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  34491. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  34492. _: 1
  34493. })) : (0, vue.createCommentVNode)("v-if", true),
  34494. _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  34495. key: 1,
  34496. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner"))
  34497. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  34498. _ctx.$slots.icon ? (0, vue.renderSlot)(_ctx.$slots, "icon", { key: 2 }) : (0, vue.createCommentVNode)("v-if", true)
  34499. ], 10, _hoisted_1$31);
  34500. };
  34501. }
  34502. });
  34503. //#endregion
  34504. //#region ../../packages/components/link/src/link.vue
  34505. var link_default = link_vue_vue_type_script_setup_true_lang_default;
  34506. //#endregion
  34507. //#region ../../packages/components/link/index.ts
  34508. const ElLink = withInstall(link_default);
  34509. //#endregion
  34510. //#region ../../packages/components/menu/src/utils/submenu.ts
  34511. var SubMenu = class {
  34512. constructor(parent, domNode) {
  34513. this.parent = parent;
  34514. this.domNode = domNode;
  34515. this.subIndex = 0;
  34516. this.subIndex = 0;
  34517. this.init();
  34518. }
  34519. init() {
  34520. this.subMenuItems = this.domNode.querySelectorAll("li");
  34521. this.addListeners();
  34522. }
  34523. gotoSubIndex(idx) {
  34524. if (idx === this.subMenuItems.length) idx = 0;
  34525. else if (idx < 0) idx = this.subMenuItems.length - 1;
  34526. this.subMenuItems[idx].focus();
  34527. this.subIndex = idx;
  34528. }
  34529. addListeners() {
  34530. const parentNode = this.parent.domNode;
  34531. Array.prototype.forEach.call(this.subMenuItems, (el) => {
  34532. el.addEventListener("keydown", (event) => {
  34533. const code = getEventCode(event);
  34534. let prevDef = false;
  34535. switch (code) {
  34536. case EVENT_CODE.down:
  34537. this.gotoSubIndex(this.subIndex + 1);
  34538. prevDef = true;
  34539. break;
  34540. case EVENT_CODE.up:
  34541. this.gotoSubIndex(this.subIndex - 1);
  34542. prevDef = true;
  34543. break;
  34544. case EVENT_CODE.tab:
  34545. triggerEvent(parentNode, "mouseleave");
  34546. break;
  34547. case EVENT_CODE.enter:
  34548. case EVENT_CODE.numpadEnter:
  34549. case EVENT_CODE.space:
  34550. prevDef = true;
  34551. event.currentTarget.click();
  34552. break;
  34553. }
  34554. if (prevDef) {
  34555. event.preventDefault();
  34556. event.stopPropagation();
  34557. }
  34558. return false;
  34559. });
  34560. });
  34561. }
  34562. };
  34563. //#endregion
  34564. //#region ../../packages/components/menu/src/utils/menu-item.ts
  34565. var MenuItem = class {
  34566. constructor(domNode, namespace) {
  34567. this.domNode = domNode;
  34568. this.submenu = null;
  34569. this.submenu = null;
  34570. this.init(namespace);
  34571. }
  34572. init(namespace) {
  34573. this.domNode.setAttribute("tabindex", "0");
  34574. const menuChild = this.domNode.querySelector(`.${namespace}-menu`);
  34575. if (menuChild) this.submenu = new SubMenu(this, menuChild);
  34576. this.addListeners();
  34577. }
  34578. addListeners() {
  34579. this.domNode.addEventListener("keydown", (event) => {
  34580. const code = getEventCode(event);
  34581. let prevDef = false;
  34582. switch (code) {
  34583. case EVENT_CODE.down:
  34584. triggerEvent(event.currentTarget, "mouseenter");
  34585. this.submenu && this.submenu.gotoSubIndex(0);
  34586. prevDef = true;
  34587. break;
  34588. case EVENT_CODE.up:
  34589. triggerEvent(event.currentTarget, "mouseenter");
  34590. this.submenu && this.submenu.gotoSubIndex(this.submenu.subMenuItems.length - 1);
  34591. prevDef = true;
  34592. break;
  34593. case EVENT_CODE.tab:
  34594. triggerEvent(event.currentTarget, "mouseleave");
  34595. break;
  34596. case EVENT_CODE.enter:
  34597. case EVENT_CODE.numpadEnter:
  34598. case EVENT_CODE.space:
  34599. prevDef = true;
  34600. event.currentTarget.click();
  34601. break;
  34602. }
  34603. if (prevDef) event.preventDefault();
  34604. });
  34605. }
  34606. };
  34607. //#endregion
  34608. //#region ../../packages/components/menu/src/utils/menu-bar.ts
  34609. var Menu = class {
  34610. constructor(domNode, namespace) {
  34611. this.domNode = domNode;
  34612. this.init(namespace);
  34613. }
  34614. init(namespace) {
  34615. const menuChildren = this.domNode.childNodes;
  34616. Array.from(menuChildren).forEach((child) => {
  34617. if (child.nodeType === 1) new MenuItem(child, namespace);
  34618. });
  34619. }
  34620. };
  34621. //#endregion
  34622. //#region ../../packages/components/menu/src/menu-collapse-transition.vue?vue&type=script&setup=true&lang.ts
  34623. var menu_collapse_transition_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  34624. name: "ElMenuCollapseTransition",
  34625. __name: "menu-collapse-transition",
  34626. setup(__props) {
  34627. const ns = useNamespace("menu");
  34628. const listeners = {
  34629. onBeforeEnter: (el) => el.style.opacity = "0.2",
  34630. onEnter(el, done) {
  34631. addClass(el, `${ns.namespace.value}-opacity-transition`);
  34632. el.style.opacity = "1";
  34633. done();
  34634. },
  34635. onAfterEnter(el) {
  34636. removeClass(el, `${ns.namespace.value}-opacity-transition`);
  34637. el.style.opacity = "";
  34638. },
  34639. onBeforeLeave(el) {
  34640. if (!el.dataset) el.dataset = {};
  34641. if (hasClass(el, ns.m("collapse"))) {
  34642. removeClass(el, ns.m("collapse"));
  34643. el.dataset.oldOverflow = el.style.overflow;
  34644. el.dataset.scrollWidth = el.clientWidth.toString();
  34645. addClass(el, ns.m("collapse"));
  34646. } else {
  34647. addClass(el, ns.m("collapse"));
  34648. el.dataset.oldOverflow = el.style.overflow;
  34649. el.dataset.scrollWidth = el.clientWidth.toString();
  34650. removeClass(el, ns.m("collapse"));
  34651. }
  34652. el.style.width = `${el.scrollWidth}px`;
  34653. el.style.overflow = "hidden";
  34654. },
  34655. onLeave(el) {
  34656. addClass(el, "horizontal-collapse-transition");
  34657. el.style.width = `${el.dataset.scrollWidth}px`;
  34658. }
  34659. };
  34660. return (_ctx, _cache) => {
  34661. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, (0, vue.mergeProps)({ mode: "out-in" }, listeners), {
  34662. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  34663. _: 3
  34664. }, 16);
  34665. };
  34666. }
  34667. });
  34668. //#endregion
  34669. //#region ../../packages/components/menu/src/menu-collapse-transition.vue
  34670. var menu_collapse_transition_default = menu_collapse_transition_vue_vue_type_script_setup_true_lang_default;
  34671. //#endregion
  34672. //#region ../../packages/components/menu/src/use-menu.ts
  34673. function useMenu(instance, currentIndex) {
  34674. const indexPath = (0, vue.computed)(() => {
  34675. let parent = instance.parent;
  34676. const path = [currentIndex.value];
  34677. while (parent.type.name !== "ElMenu") {
  34678. if (parent.props.index) path.unshift(parent.props.index);
  34679. parent = parent.parent;
  34680. }
  34681. return path;
  34682. });
  34683. return {
  34684. parentMenu: (0, vue.computed)(() => {
  34685. let parent = instance.parent;
  34686. while (parent && !["ElMenu", "ElSubMenu"].includes(parent.type.name)) parent = parent.parent;
  34687. return parent;
  34688. }),
  34689. indexPath
  34690. };
  34691. }
  34692. //#endregion
  34693. //#region ../../packages/components/menu/src/use-menu-color.ts
  34694. function useMenuColor(props) {
  34695. return (0, vue.computed)(() => {
  34696. const color = props.backgroundColor;
  34697. return color ? new TinyColor(color).shade(20).toString() : "";
  34698. });
  34699. }
  34700. //#endregion
  34701. //#region ../../packages/components/menu/src/use-menu-css-var.ts
  34702. const useMenuCssVar = (props, level) => {
  34703. const ns = useNamespace("menu");
  34704. return (0, vue.computed)(() => ns.cssVarBlock({
  34705. "text-color": props.textColor || "",
  34706. "hover-text-color": props.textColor || "",
  34707. "bg-color": props.backgroundColor || "",
  34708. "hover-bg-color": useMenuColor(props).value || "",
  34709. "active-color": props.activeTextColor || "",
  34710. level: `${level}`
  34711. }));
  34712. };
  34713. //#endregion
  34714. //#region ../../packages/components/menu/src/tokens.ts
  34715. const MENU_INJECTION_KEY = "rootMenu";
  34716. const SUB_MENU_INJECTION_KEY = "subMenu:";
  34717. //#endregion
  34718. //#region ../../packages/components/menu/src/sub-menu.ts
  34719. const subMenuProps = buildProps({
  34720. index: {
  34721. type: String,
  34722. required: true
  34723. },
  34724. showTimeout: Number,
  34725. hideTimeout: Number,
  34726. popperClass: String,
  34727. popperStyle: { type: definePropType([String, Object]) },
  34728. disabled: Boolean,
  34729. teleported: {
  34730. type: Boolean,
  34731. default: void 0
  34732. },
  34733. popperOffset: Number,
  34734. expandCloseIcon: { type: iconPropType },
  34735. expandOpenIcon: { type: iconPropType },
  34736. collapseCloseIcon: { type: iconPropType },
  34737. collapseOpenIcon: { type: iconPropType }
  34738. });
  34739. const COMPONENT_NAME$8 = "ElSubMenu";
  34740. var sub_menu_default = (0, vue.defineComponent)({
  34741. name: COMPONENT_NAME$8,
  34742. props: subMenuProps,
  34743. setup(props, { slots, expose }) {
  34744. const instance = (0, vue.getCurrentInstance)();
  34745. const { indexPath, parentMenu } = useMenu(instance, (0, vue.computed)(() => props.index));
  34746. const nsMenu = useNamespace("menu");
  34747. const nsSubMenu = useNamespace("sub-menu");
  34748. const rootMenu = (0, vue.inject)(MENU_INJECTION_KEY);
  34749. if (!rootMenu) throwError(COMPONENT_NAME$8, "can not inject root menu");
  34750. const subMenu = (0, vue.inject)(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
  34751. if (!subMenu) throwError(COMPONENT_NAME$8, "can not inject sub menu");
  34752. const items = (0, vue.ref)({});
  34753. const subMenus = (0, vue.ref)({});
  34754. let timeout;
  34755. const mouseInChild = (0, vue.ref)(false);
  34756. const verticalTitleRef = (0, vue.ref)();
  34757. const vPopper = (0, vue.ref)();
  34758. const isFirstLevel = (0, vue.computed)(() => subMenu.level === 0);
  34759. const currentPlacement = (0, vue.computed)(() => mode.value === "horizontal" && isFirstLevel.value ? "bottom-start" : "right-start");
  34760. const subMenuTitleIcon = (0, vue.computed)(() => {
  34761. if (mode.value === "horizontal" && isFirstLevel.value || mode.value === "vertical" && !rootMenu.props.collapse) {
  34762. if (props.expandCloseIcon && props.expandOpenIcon) return opened.value ? props.expandOpenIcon : props.expandCloseIcon;
  34763. return arrow_down_default;
  34764. } else {
  34765. if (props.collapseCloseIcon && props.collapseOpenIcon) return opened.value ? props.collapseOpenIcon : props.collapseCloseIcon;
  34766. return arrow_right_default;
  34767. }
  34768. });
  34769. const appendToBody = (0, vue.computed)(() => {
  34770. const value = props.teleported;
  34771. return isUndefined(value) ? isFirstLevel.value : value;
  34772. });
  34773. const menuTransitionName = (0, vue.computed)(() => rootMenu.props.collapse ? `${nsMenu.namespace.value}-zoom-in-left` : `${nsMenu.namespace.value}-zoom-in-top`);
  34774. const fallbackPlacements = (0, vue.computed)(() => mode.value === "horizontal" && isFirstLevel.value ? [
  34775. "bottom-start",
  34776. "bottom-end",
  34777. "top-start",
  34778. "top-end",
  34779. "right-start",
  34780. "left-start"
  34781. ] : [
  34782. "right-start",
  34783. "right",
  34784. "right-end",
  34785. "left-start",
  34786. "bottom-start",
  34787. "bottom-end",
  34788. "top-start",
  34789. "top-end"
  34790. ]);
  34791. const opened = (0, vue.computed)(() => rootMenu.openedMenus.includes(props.index));
  34792. const active = (0, vue.computed)(() => [...Object.values(items.value), ...Object.values(subMenus.value)].some(({ active }) => active));
  34793. const mode = (0, vue.computed)(() => rootMenu.props.mode);
  34794. const persistent = (0, vue.computed)(() => rootMenu.props.persistent);
  34795. const item = (0, vue.reactive)({
  34796. index: props.index,
  34797. indexPath,
  34798. active
  34799. });
  34800. const ulStyle = useMenuCssVar(rootMenu.props, subMenu.level + 1);
  34801. const subMenuPopperOffset = (0, vue.computed)(() => props.popperOffset ?? rootMenu.props.popperOffset);
  34802. const subMenuPopperClass = (0, vue.computed)(() => props.popperClass ?? rootMenu.props.popperClass);
  34803. const subMenuPopperStyle = (0, vue.computed)(() => props.popperStyle ?? rootMenu.props.popperStyle);
  34804. const subMenuShowTimeout = (0, vue.computed)(() => props.showTimeout ?? rootMenu.props.showTimeout);
  34805. const subMenuHideTimeout = (0, vue.computed)(() => props.hideTimeout ?? rootMenu.props.hideTimeout);
  34806. const doDestroy = () => vPopper.value?.popperRef?.popperInstanceRef?.destroy();
  34807. const handleCollapseToggle = (value) => {
  34808. if (!value) doDestroy();
  34809. };
  34810. const handleClick = () => {
  34811. if (rootMenu.props.menuTrigger === "hover" && rootMenu.props.mode === "horizontal" || rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled) return;
  34812. rootMenu.handleSubMenuClick({
  34813. index: props.index,
  34814. indexPath: indexPath.value,
  34815. active: active.value
  34816. });
  34817. };
  34818. const handleMouseenter = (event, showTimeout = subMenuShowTimeout.value) => {
  34819. if (event.type === "focus") return;
  34820. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical" || props.disabled) {
  34821. subMenu.mouseInChild.value = true;
  34822. return;
  34823. }
  34824. subMenu.mouseInChild.value = true;
  34825. timeout?.();
  34826. ({stop: timeout} = useTimeoutFn(() => {
  34827. rootMenu.openMenu(props.index, indexPath.value);
  34828. }, showTimeout));
  34829. if (appendToBody.value) parentMenu.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter"));
  34830. if (event.type === "mouseenter" && event.target) (0, vue.nextTick)(() => {
  34831. focusElement(event.target, { preventScroll: true });
  34832. });
  34833. };
  34834. const handleMouseleave = (deepDispatch = false) => {
  34835. if (rootMenu.props.menuTrigger === "click" && rootMenu.props.mode === "horizontal" || !rootMenu.props.collapse && rootMenu.props.mode === "vertical") {
  34836. subMenu.mouseInChild.value = false;
  34837. return;
  34838. }
  34839. timeout?.();
  34840. subMenu.mouseInChild.value = false;
  34841. ({stop: timeout} = useTimeoutFn(() => !mouseInChild.value && rootMenu.closeMenu(props.index, indexPath.value), subMenuHideTimeout.value));
  34842. if (appendToBody.value && deepDispatch) subMenu.handleMouseleave?.(true);
  34843. };
  34844. (0, vue.watch)(() => rootMenu.props.collapse, (value) => handleCollapseToggle(Boolean(value)));
  34845. {
  34846. const addSubMenu = (item) => {
  34847. subMenus.value[item.index] = item;
  34848. };
  34849. const removeSubMenu = (item) => {
  34850. delete subMenus.value[item.index];
  34851. };
  34852. (0, vue.provide)(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
  34853. addSubMenu,
  34854. removeSubMenu,
  34855. handleMouseleave,
  34856. mouseInChild,
  34857. level: subMenu.level + 1
  34858. });
  34859. }
  34860. expose({ opened });
  34861. (0, vue.onMounted)(() => {
  34862. rootMenu.addSubMenu(item);
  34863. subMenu.addSubMenu(item);
  34864. });
  34865. (0, vue.onBeforeUnmount)(() => {
  34866. subMenu.removeSubMenu(item);
  34867. rootMenu.removeSubMenu(item);
  34868. });
  34869. return () => {
  34870. const titleTag = [slots.title?.(), (0, vue.h)(ElIcon, {
  34871. class: nsSubMenu.e("icon-arrow"),
  34872. style: { transform: opened.value ? props.expandCloseIcon && props.expandOpenIcon || props.collapseCloseIcon && props.collapseOpenIcon && rootMenu.props.collapse ? "none" : "rotateZ(180deg)" : "none" }
  34873. }, { default: () => isString(subMenuTitleIcon.value) ? (0, vue.h)(instance.appContext.components[subMenuTitleIcon.value]) : (0, vue.h)(subMenuTitleIcon.value) })];
  34874. const child = rootMenu.isMenuPopup ? (0, vue.h)(ElTooltip, {
  34875. ref: vPopper,
  34876. visible: opened.value,
  34877. effect: "light",
  34878. pure: true,
  34879. offset: subMenuPopperOffset.value,
  34880. showArrow: false,
  34881. persistent: persistent.value,
  34882. popperClass: subMenuPopperClass.value,
  34883. popperStyle: subMenuPopperStyle.value,
  34884. placement: currentPlacement.value,
  34885. teleported: appendToBody.value,
  34886. fallbackPlacements: fallbackPlacements.value,
  34887. transition: menuTransitionName.value,
  34888. gpuAcceleration: false
  34889. }, {
  34890. content: () => (0, vue.h)("div", {
  34891. class: [
  34892. nsMenu.m(mode.value),
  34893. nsMenu.m("popup-container"),
  34894. subMenuPopperClass.value
  34895. ],
  34896. onMouseenter: (evt) => handleMouseenter(evt, 100),
  34897. onMouseleave: () => handleMouseleave(true),
  34898. onFocus: (evt) => handleMouseenter(evt, 100)
  34899. }, [(0, vue.h)("ul", {
  34900. class: [
  34901. nsMenu.b(),
  34902. nsMenu.m("popup"),
  34903. nsMenu.m(`popup-${currentPlacement.value}`)
  34904. ],
  34905. style: ulStyle.value
  34906. }, [slots.default?.()])]),
  34907. default: () => (0, vue.h)("div", {
  34908. class: nsSubMenu.e("title"),
  34909. onClick: handleClick
  34910. }, titleTag)
  34911. }) : (0, vue.h)(vue.Fragment, {}, [(0, vue.h)("div", {
  34912. class: nsSubMenu.e("title"),
  34913. ref: verticalTitleRef,
  34914. onClick: handleClick
  34915. }, titleTag), (0, vue.h)(ElCollapseTransition, {}, { default: () => (0, vue.withDirectives)((0, vue.h)("ul", {
  34916. role: "menu",
  34917. class: [nsMenu.b(), nsMenu.m("inline")],
  34918. style: ulStyle.value
  34919. }, [slots.default?.()]), [[vue.vShow, opened.value]]) })]);
  34920. return (0, vue.h)("li", {
  34921. class: [
  34922. nsSubMenu.b(),
  34923. nsSubMenu.is("active", active.value),
  34924. nsSubMenu.is("opened", opened.value),
  34925. nsSubMenu.is("disabled", props.disabled)
  34926. ],
  34927. role: "menuitem",
  34928. ariaHaspopup: true,
  34929. ariaExpanded: opened.value,
  34930. onMouseenter: handleMouseenter,
  34931. onMouseleave: () => handleMouseleave(),
  34932. onFocus: handleMouseenter
  34933. }, [child]);
  34934. };
  34935. }
  34936. });
  34937. //#endregion
  34938. //#region ../../packages/components/menu/src/menu.ts
  34939. const menuProps = buildProps({
  34940. mode: {
  34941. type: String,
  34942. values: ["horizontal", "vertical"],
  34943. default: "vertical"
  34944. },
  34945. defaultActive: {
  34946. type: String,
  34947. default: ""
  34948. },
  34949. defaultOpeneds: {
  34950. type: definePropType(Array),
  34951. default: () => mutable([])
  34952. },
  34953. uniqueOpened: Boolean,
  34954. router: Boolean,
  34955. menuTrigger: {
  34956. type: String,
  34957. values: ["hover", "click"],
  34958. default: "hover"
  34959. },
  34960. collapse: Boolean,
  34961. backgroundColor: String,
  34962. textColor: String,
  34963. activeTextColor: String,
  34964. closeOnClickOutside: Boolean,
  34965. collapseTransition: {
  34966. type: Boolean,
  34967. default: true
  34968. },
  34969. ellipsis: {
  34970. type: Boolean,
  34971. default: true
  34972. },
  34973. popperOffset: {
  34974. type: Number,
  34975. default: 6
  34976. },
  34977. ellipsisIcon: {
  34978. type: iconPropType,
  34979. default: () => more_default
  34980. },
  34981. popperEffect: {
  34982. type: definePropType(String),
  34983. default: "dark"
  34984. },
  34985. popperClass: String,
  34986. popperStyle: { type: definePropType([String, Object]) },
  34987. showTimeout: {
  34988. type: Number,
  34989. default: 300
  34990. },
  34991. hideTimeout: {
  34992. type: Number,
  34993. default: 300
  34994. },
  34995. persistent: {
  34996. type: Boolean,
  34997. default: true
  34998. }
  34999. });
  35000. const checkIndexPath = (indexPath) => isArray$1(indexPath) && indexPath.every((path) => isString(path));
  35001. const menuEmits = {
  35002. close: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  35003. open: (index, indexPath) => isString(index) && checkIndexPath(indexPath),
  35004. select: (index, indexPath, item, routerResult) => isString(index) && checkIndexPath(indexPath) && isObject$1(item) && (isUndefined(routerResult) || routerResult instanceof Promise)
  35005. };
  35006. const DEFAULT_MORE_ITEM_WIDTH = 64;
  35007. var menu_default = (0, vue.defineComponent)({
  35008. name: "ElMenu",
  35009. props: menuProps,
  35010. emits: menuEmits,
  35011. setup(props, { emit, slots, expose }) {
  35012. const instance = (0, vue.getCurrentInstance)();
  35013. const router = instance.appContext.config.globalProperties.$router;
  35014. const menu = (0, vue.ref)();
  35015. const subMenu = (0, vue.ref)();
  35016. const nsMenu = useNamespace("menu");
  35017. const nsSubMenu = useNamespace("sub-menu");
  35018. let moreItemWidth = DEFAULT_MORE_ITEM_WIDTH;
  35019. const sliceIndex = (0, vue.ref)(-1);
  35020. const openedMenus = (0, vue.ref)(props.defaultOpeneds && !props.collapse ? props.defaultOpeneds.slice(0) : []);
  35021. const activeIndex = (0, vue.ref)(props.defaultActive);
  35022. const items = (0, vue.ref)({});
  35023. const subMenus = (0, vue.ref)({});
  35024. const isMenuPopup = (0, vue.computed)(() => props.mode === "horizontal" || props.mode === "vertical" && props.collapse);
  35025. const initMenu = () => {
  35026. const activeItem = activeIndex.value && items.value[activeIndex.value];
  35027. if (!activeItem || props.mode === "horizontal" || props.collapse) return;
  35028. activeItem.indexPath.forEach((index) => {
  35029. const subMenu = subMenus.value[index];
  35030. subMenu && openMenu(index, subMenu.indexPath);
  35031. });
  35032. };
  35033. const openMenu = (index, indexPath) => {
  35034. if (openedMenus.value.includes(index)) return;
  35035. if (props.uniqueOpened) openedMenus.value = openedMenus.value.filter((index) => indexPath.includes(index));
  35036. openedMenus.value.push(index);
  35037. emit("open", index, indexPath);
  35038. };
  35039. const close = (index) => {
  35040. const i = openedMenus.value.indexOf(index);
  35041. if (i !== -1) openedMenus.value.splice(i, 1);
  35042. };
  35043. const closeMenu = (index, indexPath) => {
  35044. close(index);
  35045. emit("close", index, indexPath);
  35046. };
  35047. const handleSubMenuClick = ({ index, indexPath }) => {
  35048. openedMenus.value.includes(index) ? closeMenu(index, indexPath) : openMenu(index, indexPath);
  35049. };
  35050. const handleMenuItemClick = (menuItem) => {
  35051. if (props.mode === "horizontal" || props.collapse) openedMenus.value = [];
  35052. const { index, indexPath } = menuItem;
  35053. if (isNil(index) || isNil(indexPath)) return;
  35054. if (props.router && router) {
  35055. const route = menuItem.route || index;
  35056. const routerResult = router.push(route).then((res) => {
  35057. if (!res) activeIndex.value = index;
  35058. return res;
  35059. });
  35060. emit("select", index, indexPath, {
  35061. index,
  35062. indexPath,
  35063. route
  35064. }, routerResult);
  35065. } else {
  35066. activeIndex.value = index;
  35067. emit("select", index, indexPath, {
  35068. index,
  35069. indexPath
  35070. });
  35071. }
  35072. };
  35073. const updateActiveIndex = (val) => {
  35074. const itemsInData = items.value;
  35075. activeIndex.value = (itemsInData[val] || activeIndex.value && itemsInData[activeIndex.value] || itemsInData[props.defaultActive])?.index ?? val;
  35076. };
  35077. const calcMenuItemWidth = (menuItem) => {
  35078. const computedStyle = getComputedStyle(menuItem);
  35079. const marginLeft = Number.parseInt(computedStyle.marginLeft, 10);
  35080. const marginRight = Number.parseInt(computedStyle.marginRight, 10);
  35081. return menuItem.offsetWidth + marginLeft + marginRight || 0;
  35082. };
  35083. const calcSliceIndex = () => {
  35084. if (!menu.value) return -1;
  35085. const items = Array.from(menu.value.childNodes).filter((item) => item.nodeName !== "#comment" && (item.nodeName !== "#text" || item.nodeValue));
  35086. const computedMenuStyle = getComputedStyle(menu.value);
  35087. const paddingLeft = Number.parseInt(computedMenuStyle.paddingLeft, 10);
  35088. const paddingRight = Number.parseInt(computedMenuStyle.paddingRight, 10);
  35089. const menuWidth = menu.value.clientWidth - paddingLeft - paddingRight;
  35090. let calcWidth = 0;
  35091. let sliceIndex = 0;
  35092. items.forEach((item, index) => {
  35093. calcWidth += calcMenuItemWidth(item);
  35094. if (calcWidth <= menuWidth - moreItemWidth) sliceIndex = index + 1;
  35095. });
  35096. return sliceIndex === items.length ? -1 : sliceIndex;
  35097. };
  35098. const getIndexPath = (index) => subMenus.value[index].indexPath;
  35099. const debounce = (fn, wait = 33.34) => {
  35100. let timer;
  35101. return () => {
  35102. timer && clearTimeout(timer);
  35103. timer = setTimeout(() => {
  35104. fn();
  35105. }, wait);
  35106. };
  35107. };
  35108. let isFirstTimeRender = true;
  35109. const handleResize = () => {
  35110. const el = unrefElement(subMenu);
  35111. if (el) moreItemWidth = calcMenuItemWidth(el) || DEFAULT_MORE_ITEM_WIDTH;
  35112. if (sliceIndex.value === calcSliceIndex()) return;
  35113. const callback = () => {
  35114. sliceIndex.value = -1;
  35115. (0, vue.nextTick)(() => {
  35116. sliceIndex.value = calcSliceIndex();
  35117. });
  35118. };
  35119. isFirstTimeRender ? callback() : debounce(callback)();
  35120. isFirstTimeRender = false;
  35121. };
  35122. (0, vue.watch)(() => props.defaultActive, (currentActive) => {
  35123. if (!items.value[currentActive]) activeIndex.value = "";
  35124. updateActiveIndex(currentActive);
  35125. });
  35126. (0, vue.watch)(() => props.collapse, (value) => {
  35127. if (value) openedMenus.value = [];
  35128. });
  35129. (0, vue.watch)(items.value, initMenu);
  35130. let resizeStopper;
  35131. (0, vue.watchEffect)(() => {
  35132. if (props.mode === "horizontal" && props.ellipsis) resizeStopper = useResizeObserver(menu, handleResize).stop;
  35133. else resizeStopper?.();
  35134. });
  35135. const mouseInChild = (0, vue.ref)(false);
  35136. {
  35137. const addSubMenu = (item) => {
  35138. subMenus.value[item.index] = item;
  35139. };
  35140. const removeSubMenu = (item) => {
  35141. delete subMenus.value[item.index];
  35142. };
  35143. const addMenuItem = (item) => {
  35144. items.value[item.index] = item;
  35145. };
  35146. const removeMenuItem = (item) => {
  35147. delete items.value[item.index];
  35148. };
  35149. (0, vue.provide)(MENU_INJECTION_KEY, (0, vue.reactive)({
  35150. props,
  35151. openedMenus,
  35152. items,
  35153. subMenus,
  35154. activeIndex,
  35155. isMenuPopup,
  35156. addMenuItem,
  35157. removeMenuItem,
  35158. addSubMenu,
  35159. removeSubMenu,
  35160. openMenu,
  35161. closeMenu,
  35162. handleMenuItemClick,
  35163. handleSubMenuClick
  35164. }));
  35165. (0, vue.provide)(`${SUB_MENU_INJECTION_KEY}${instance.uid}`, {
  35166. addSubMenu,
  35167. removeSubMenu,
  35168. mouseInChild,
  35169. level: 0
  35170. });
  35171. }
  35172. (0, vue.onMounted)(() => {
  35173. if (props.mode === "horizontal") new Menu(instance.vnode.el, nsMenu.namespace.value);
  35174. });
  35175. {
  35176. const open = (index) => {
  35177. const { indexPath } = subMenus.value[index];
  35178. indexPath.forEach((i) => openMenu(i, indexPath));
  35179. };
  35180. expose({
  35181. open,
  35182. close,
  35183. updateActiveIndex,
  35184. handleResize
  35185. });
  35186. }
  35187. const ulStyle = useMenuCssVar(props, 0);
  35188. return () => {
  35189. let slot = slots.default?.() ?? [];
  35190. const vShowMore = [];
  35191. if (props.mode === "horizontal" && menu.value) {
  35192. const originalSlot = flattedChildren(slot).filter((vnode) => {
  35193. return vnode?.shapeFlag !== 8;
  35194. });
  35195. const slotDefault = sliceIndex.value === -1 ? originalSlot : originalSlot.slice(0, sliceIndex.value);
  35196. const slotMore = sliceIndex.value === -1 ? [] : originalSlot.slice(sliceIndex.value);
  35197. if (slotMore?.length && props.ellipsis) {
  35198. slot = slotDefault;
  35199. vShowMore.push((0, vue.h)(sub_menu_default, {
  35200. ref: subMenu,
  35201. index: "sub-menu-more",
  35202. class: nsSubMenu.e("hide-arrow"),
  35203. popperOffset: props.popperOffset
  35204. }, {
  35205. title: () => (0, vue.h)(ElIcon, { class: nsSubMenu.e("icon-more") }, { default: () => (0, vue.h)(props.ellipsisIcon) }),
  35206. default: () => slotMore
  35207. }));
  35208. }
  35209. }
  35210. const directives = props.closeOnClickOutside ? [[ClickOutside, () => {
  35211. if (!openedMenus.value.length) return;
  35212. if (!mouseInChild.value) {
  35213. openedMenus.value.forEach((openedMenu) => emit("close", openedMenu, getIndexPath(openedMenu)));
  35214. openedMenus.value = [];
  35215. }
  35216. }]] : [];
  35217. const vMenu = (0, vue.withDirectives)((0, vue.h)("ul", {
  35218. key: String(props.collapse),
  35219. role: "menubar",
  35220. ref: menu,
  35221. style: ulStyle.value,
  35222. class: {
  35223. [nsMenu.b()]: true,
  35224. [nsMenu.m(props.mode)]: true,
  35225. [nsMenu.m("collapse")]: props.collapse
  35226. }
  35227. }, [...slot, ...vShowMore]), directives);
  35228. if (props.collapseTransition && props.mode === "vertical") return (0, vue.h)(menu_collapse_transition_default, () => vMenu);
  35229. return vMenu;
  35230. };
  35231. }
  35232. });
  35233. //#endregion
  35234. //#region ../../packages/components/menu/src/menu-item.ts
  35235. /**
  35236. * @deprecated Removed after 3.0.0, Use `MenuItemProps` instead.
  35237. */
  35238. const menuItemProps = buildProps({
  35239. index: {
  35240. type: definePropType([String, null]),
  35241. default: null
  35242. },
  35243. route: { type: definePropType([String, Object]) },
  35244. disabled: Boolean
  35245. });
  35246. const menuItemEmits = { click: (item) => isString(item.index) && isArray$1(item.indexPath) };
  35247. //#endregion
  35248. //#region ../../packages/components/menu/src/menu-item.vue?vue&type=script&setup=true&lang.ts
  35249. const COMPONENT_NAME$7 = "ElMenuItem";
  35250. var menu_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35251. name: COMPONENT_NAME$7,
  35252. __name: "menu-item",
  35253. props: menuItemProps,
  35254. emits: menuItemEmits,
  35255. setup(__props, { expose: __expose, emit: __emit }) {
  35256. const props = __props;
  35257. const emit = __emit;
  35258. isPropAbsent(props.index) && /* @__PURE__ */ debugWarn(COMPONENT_NAME$7, "Missing required prop: \"index\"");
  35259. const instance = (0, vue.getCurrentInstance)();
  35260. const rootMenu = (0, vue.inject)(MENU_INJECTION_KEY);
  35261. const nsMenu = useNamespace("menu");
  35262. const nsMenuItem = useNamespace("menu-item");
  35263. if (!rootMenu) throwError(COMPONENT_NAME$7, "can not inject root menu");
  35264. const { parentMenu, indexPath } = useMenu(instance, (0, vue.toRef)(props, "index"));
  35265. const subMenu = (0, vue.inject)(`${SUB_MENU_INJECTION_KEY}${parentMenu.value.uid}`);
  35266. if (!subMenu) throwError(COMPONENT_NAME$7, "can not inject sub menu");
  35267. const active = (0, vue.computed)(() => props.index === rootMenu.activeIndex);
  35268. const item = (0, vue.reactive)({
  35269. index: props.index,
  35270. indexPath,
  35271. active
  35272. });
  35273. const handleClick = () => {
  35274. if (!props.disabled) {
  35275. rootMenu.handleMenuItemClick({
  35276. index: props.index,
  35277. indexPath: indexPath.value,
  35278. route: props.route
  35279. });
  35280. emit("click", item);
  35281. }
  35282. };
  35283. (0, vue.onMounted)(() => {
  35284. subMenu.addSubMenu(item);
  35285. rootMenu.addMenuItem(item);
  35286. });
  35287. (0, vue.onBeforeUnmount)(() => {
  35288. subMenu.removeSubMenu(item);
  35289. rootMenu.removeMenuItem(item);
  35290. });
  35291. __expose({
  35292. parentMenu,
  35293. rootMenu,
  35294. active,
  35295. nsMenu,
  35296. nsMenuItem,
  35297. handleClick
  35298. });
  35299. return (_ctx, _cache) => {
  35300. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35301. class: (0, vue.normalizeClass)([
  35302. (0, vue.unref)(nsMenuItem).b(),
  35303. (0, vue.unref)(nsMenuItem).is("active", active.value),
  35304. (0, vue.unref)(nsMenuItem).is("disabled", __props.disabled)
  35305. ]),
  35306. role: "menuitem",
  35307. tabindex: "-1",
  35308. onClick: handleClick
  35309. }, [(0, vue.unref)(parentMenu).type.name === "ElMenu" && (0, vue.unref)(rootMenu).props.collapse && _ctx.$slots.title ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), {
  35310. key: 0,
  35311. effect: (0, vue.unref)(rootMenu).props.popperEffect,
  35312. placement: "right",
  35313. "fallback-placements": ["left"],
  35314. "popper-class": (0, vue.unref)(rootMenu).props.popperClass,
  35315. "popper-style": (0, vue.unref)(rootMenu).props.popperStyle,
  35316. persistent: (0, vue.unref)(rootMenu).props.persistent,
  35317. "focus-on-target": ""
  35318. }, {
  35319. content: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "title")]),
  35320. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(nsMenu).be("tooltip", "trigger")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)]),
  35321. _: 3
  35322. }, 8, [
  35323. "effect",
  35324. "popper-class",
  35325. "popper-style",
  35326. "persistent"
  35327. ])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.renderSlot)(_ctx.$slots, "title")], 64))], 2);
  35328. };
  35329. }
  35330. });
  35331. //#endregion
  35332. //#region ../../packages/components/menu/src/menu-item.vue
  35333. var menu_item_default = menu_item_vue_vue_type_script_setup_true_lang_default;
  35334. //#endregion
  35335. //#region ../../packages/components/menu/src/menu-item-group.ts
  35336. /**
  35337. * @deprecated Removed after 3.0.0, Use `MenuItemGroupProps` instead.
  35338. */
  35339. const menuItemGroupProps = { title: String };
  35340. //#endregion
  35341. //#region ../../packages/components/menu/src/menu-item-group.vue?vue&type=script&setup=true&lang.ts
  35342. var menu_item_group_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35343. name: "ElMenuItemGroup",
  35344. __name: "menu-item-group",
  35345. props: menuItemGroupProps,
  35346. setup(__props) {
  35347. const ns = useNamespace("menu-item-group");
  35348. return (_ctx, _cache) => {
  35349. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")) }, [!_ctx.$slots.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)], 64)) : (0, vue.renderSlot)(_ctx.$slots, "title", { key: 1 })], 2), (0, vue.createElementVNode)("ul", null, [(0, vue.renderSlot)(_ctx.$slots, "default")])], 2);
  35350. };
  35351. }
  35352. });
  35353. //#endregion
  35354. //#region ../../packages/components/menu/src/menu-item-group.vue
  35355. var menu_item_group_default = menu_item_group_vue_vue_type_script_setup_true_lang_default;
  35356. //#endregion
  35357. //#region ../../packages/components/menu/index.ts
  35358. const ElMenu = withInstall(menu_default, {
  35359. MenuItem: menu_item_default,
  35360. MenuItemGroup: menu_item_group_default,
  35361. SubMenu: sub_menu_default
  35362. });
  35363. const ElMenuItem = withNoopInstall(menu_item_default);
  35364. const ElMenuItemGroup = withNoopInstall(menu_item_group_default);
  35365. const ElSubMenu = withNoopInstall(sub_menu_default);
  35366. //#endregion
  35367. //#region ../../packages/components/page-header/src/page-header.ts
  35368. /**
  35369. * @deprecated Removed after 3.0.0, Use `PageHeaderProps` instead.
  35370. */
  35371. const pageHeaderProps = buildProps({
  35372. icon: {
  35373. type: iconPropType,
  35374. default: () => back_default
  35375. },
  35376. title: String,
  35377. content: {
  35378. type: String,
  35379. default: ""
  35380. }
  35381. });
  35382. const pageHeaderEmits = { back: () => true };
  35383. //#endregion
  35384. //#region ../../packages/components/page-header/src/page-header.vue?vue&type=script&setup=true&lang.ts
  35385. const _hoisted_1$30 = ["aria-label"];
  35386. var page_header_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35387. name: "ElPageHeader",
  35388. __name: "page-header",
  35389. props: pageHeaderProps,
  35390. emits: pageHeaderEmits,
  35391. setup(__props, { emit: __emit }) {
  35392. const emit = __emit;
  35393. const { t } = useLocale();
  35394. const ns = useNamespace("page-header");
  35395. function handleClick() {
  35396. emit("back");
  35397. }
  35398. return (_ctx, _cache) => {
  35399. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([
  35400. (0, vue.unref)(ns).b(),
  35401. (0, vue.unref)(ns).is("contentful", !!_ctx.$slots.default),
  35402. {
  35403. [(0, vue.unref)(ns).m("has-breadcrumb")]: !!_ctx.$slots.breadcrumb,
  35404. [(0, vue.unref)(ns).m("has-extra")]: !!_ctx.$slots.extra
  35405. }
  35406. ]) }, [
  35407. _ctx.$slots.breadcrumb ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  35408. key: 0,
  35409. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("breadcrumb"))
  35410. }, [(0, vue.renderSlot)(_ctx.$slots, "breadcrumb")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  35411. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("header")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("left")) }, [
  35412. (0, vue.createElementVNode)("div", {
  35413. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("back")),
  35414. role: "button",
  35415. tabindex: "0",
  35416. onClick: handleClick
  35417. }, [__props.icon || _ctx.$slots.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  35418. key: 0,
  35419. "aria-label": __props.title || (0, vue.unref)(t)("el.pageHeader.title"),
  35420. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon"))
  35421. }, [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [__props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  35422. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  35423. _: 1
  35424. })) : (0, vue.createCommentVNode)("v-if", true)])], 10, _hoisted_1$30)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")) }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title || (0, vue.unref)(t)("el.pageHeader.title")), 1)])], 2)], 2),
  35425. (0, vue.createVNode)((0, vue.unref)(ElDivider), { direction: "vertical" }),
  35426. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [(0, vue.renderSlot)(_ctx.$slots, "content", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.content), 1)])], 2)
  35427. ], 2), _ctx.$slots.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  35428. key: 0,
  35429. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("extra"))
  35430. }, [(0, vue.renderSlot)(_ctx.$slots, "extra")], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2),
  35431. _ctx.$slots.default ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  35432. key: 1,
  35433. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("main"))
  35434. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  35435. ], 2);
  35436. };
  35437. }
  35438. });
  35439. //#endregion
  35440. //#region ../../packages/components/page-header/src/page-header.vue
  35441. var page_header_default = page_header_vue_vue_type_script_setup_true_lang_default;
  35442. //#endregion
  35443. //#region ../../packages/components/page-header/index.ts
  35444. const ElPageHeader = withInstall(page_header_default);
  35445. //#endregion
  35446. //#region ../../packages/components/pagination/src/constants.ts
  35447. const elPaginationKey = Symbol("elPaginationKey");
  35448. //#endregion
  35449. //#region ../../packages/components/pagination/src/components/prev.ts
  35450. const paginationPrevProps = buildProps({
  35451. disabled: Boolean,
  35452. currentPage: {
  35453. type: Number,
  35454. default: 1
  35455. },
  35456. prevText: { type: String },
  35457. prevIcon: { type: iconPropType }
  35458. });
  35459. const paginationPrevEmits = { click: (evt) => evt instanceof MouseEvent };
  35460. //#endregion
  35461. //#region ../../packages/components/pagination/src/components/prev.vue?vue&type=script&setup=true&lang.ts
  35462. const _hoisted_1$29 = [
  35463. "disabled",
  35464. "aria-label",
  35465. "aria-disabled"
  35466. ];
  35467. const _hoisted_2$18 = { key: 0 };
  35468. var prev_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35469. name: "ElPaginationPrev",
  35470. __name: "prev",
  35471. props: paginationPrevProps,
  35472. emits: paginationPrevEmits,
  35473. setup(__props) {
  35474. const props = __props;
  35475. const { t } = useLocale();
  35476. const internalDisabled = (0, vue.computed)(() => props.disabled || props.currentPage <= 1);
  35477. return (_ctx, _cache) => {
  35478. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  35479. type: "button",
  35480. class: "btn-prev",
  35481. disabled: internalDisabled.value,
  35482. "aria-label": _ctx.prevText || (0, vue.unref)(t)("el.pagination.prev"),
  35483. "aria-disabled": internalDisabled.value,
  35484. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  35485. }, [_ctx.prevText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$18, (0, vue.toDisplayString)(_ctx.prevText), 1)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 1 }, {
  35486. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.prevIcon)))]),
  35487. _: 1
  35488. }))], 8, _hoisted_1$29);
  35489. };
  35490. }
  35491. });
  35492. //#endregion
  35493. //#region ../../packages/components/pagination/src/components/prev.vue
  35494. var prev_default = prev_vue_vue_type_script_setup_true_lang_default;
  35495. //#endregion
  35496. //#region ../../packages/components/pagination/src/components/next.ts
  35497. const paginationNextProps = buildProps({
  35498. disabled: Boolean,
  35499. currentPage: {
  35500. type: Number,
  35501. default: 1
  35502. },
  35503. pageCount: {
  35504. type: Number,
  35505. default: 50
  35506. },
  35507. nextText: { type: String },
  35508. nextIcon: { type: iconPropType }
  35509. });
  35510. //#endregion
  35511. //#region ../../packages/components/pagination/src/components/next.vue?vue&type=script&setup=true&lang.ts
  35512. const _hoisted_1$28 = [
  35513. "disabled",
  35514. "aria-label",
  35515. "aria-disabled"
  35516. ];
  35517. const _hoisted_2$17 = { key: 0 };
  35518. var next_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35519. name: "ElPaginationNext",
  35520. __name: "next",
  35521. props: paginationNextProps,
  35522. emits: ["click"],
  35523. setup(__props) {
  35524. const props = __props;
  35525. const { t } = useLocale();
  35526. const internalDisabled = (0, vue.computed)(() => props.disabled || props.currentPage === props.pageCount || props.pageCount === 0);
  35527. return (_ctx, _cache) => {
  35528. return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  35529. type: "button",
  35530. class: "btn-next",
  35531. disabled: internalDisabled.value,
  35532. "aria-label": _ctx.nextText || (0, vue.unref)(t)("el.pagination.next"),
  35533. "aria-disabled": internalDisabled.value,
  35534. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
  35535. }, [_ctx.nextText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$17, (0, vue.toDisplayString)(_ctx.nextText), 1)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 1 }, {
  35536. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.nextIcon)))]),
  35537. _: 1
  35538. }))], 8, _hoisted_1$28);
  35539. };
  35540. }
  35541. });
  35542. //#endregion
  35543. //#region ../../packages/components/pagination/src/components/next.vue
  35544. var next_default = next_vue_vue_type_script_setup_true_lang_default;
  35545. //#endregion
  35546. //#region ../../packages/components/pagination/src/usePagination.ts
  35547. const usePagination = () => (0, vue.inject)(elPaginationKey, {});
  35548. //#endregion
  35549. //#region ../../packages/components/pagination/src/components/sizes.ts
  35550. const paginationSizesProps = buildProps({
  35551. pageSize: {
  35552. type: Number,
  35553. required: true
  35554. },
  35555. pageSizes: {
  35556. type: definePropType(Array),
  35557. default: () => mutable([
  35558. 10,
  35559. 20,
  35560. 30,
  35561. 40,
  35562. 50,
  35563. 100
  35564. ])
  35565. },
  35566. popperClass: { type: String },
  35567. popperStyle: { type: definePropType([String, Object]) },
  35568. disabled: Boolean,
  35569. teleported: Boolean,
  35570. size: {
  35571. type: String,
  35572. values: componentSizes
  35573. },
  35574. appendSizeTo: String
  35575. });
  35576. //#endregion
  35577. //#region ../../packages/components/pagination/src/components/sizes.vue?vue&type=script&setup=true&lang.ts
  35578. var sizes_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35579. name: "ElPaginationSizes",
  35580. __name: "sizes",
  35581. props: paginationSizesProps,
  35582. emits: ["page-size-change"],
  35583. setup(__props, { emit: __emit }) {
  35584. const props = __props;
  35585. const emit = __emit;
  35586. const { t } = useLocale();
  35587. const ns = useNamespace("pagination");
  35588. const pagination = usePagination();
  35589. const innerPageSize = (0, vue.ref)(props.pageSize);
  35590. (0, vue.watch)(() => props.pageSizes, (newVal, oldVal) => {
  35591. if (isEqual$1(newVal, oldVal)) return;
  35592. if (isArray$1(newVal)) emit("page-size-change", newVal.includes(props.pageSize) ? props.pageSize : props.pageSizes[0]);
  35593. });
  35594. (0, vue.watch)(() => props.pageSize, (newVal) => {
  35595. innerPageSize.value = newVal;
  35596. });
  35597. const innerPageSizes = (0, vue.computed)(() => props.pageSizes);
  35598. function handleChange(val) {
  35599. if (val !== innerPageSize.value) {
  35600. innerPageSize.value = val;
  35601. pagination.handleSizeChange?.(Number(val));
  35602. }
  35603. }
  35604. return (_ctx, _cache) => {
  35605. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("sizes")) }, [(0, vue.createVNode)((0, vue.unref)(ElSelect), {
  35606. "model-value": innerPageSize.value,
  35607. disabled: _ctx.disabled,
  35608. "popper-class": _ctx.popperClass,
  35609. "popper-style": _ctx.popperStyle,
  35610. size: _ctx.size,
  35611. teleported: _ctx.teleported,
  35612. "validate-event": false,
  35613. "append-to": _ctx.appendSizeTo,
  35614. onChange: handleChange
  35615. }, {
  35616. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(innerPageSizes.value, (item) => {
  35617. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElOption), {
  35618. key: item,
  35619. value: item,
  35620. label: item + (0, vue.unref)(t)("el.pagination.pagesize")
  35621. }, null, 8, ["value", "label"]);
  35622. }), 128))]),
  35623. _: 1
  35624. }, 8, [
  35625. "model-value",
  35626. "disabled",
  35627. "popper-class",
  35628. "popper-style",
  35629. "size",
  35630. "teleported",
  35631. "append-to"
  35632. ])], 2);
  35633. };
  35634. }
  35635. });
  35636. //#endregion
  35637. //#region ../../packages/components/pagination/src/components/sizes.vue
  35638. var sizes_default = sizes_vue_vue_type_script_setup_true_lang_default;
  35639. //#endregion
  35640. //#region ../../packages/components/pagination/src/components/jumper.ts
  35641. const paginationJumperProps = buildProps({ size: {
  35642. type: String,
  35643. values: componentSizes
  35644. } });
  35645. //#endregion
  35646. //#region ../../packages/components/pagination/src/components/jumper.vue?vue&type=script&setup=true&lang.ts
  35647. const _hoisted_1$27 = ["disabled"];
  35648. var jumper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35649. name: "ElPaginationJumper",
  35650. __name: "jumper",
  35651. props: paginationJumperProps,
  35652. setup(__props) {
  35653. const { t } = useLocale();
  35654. const ns = useNamespace("pagination");
  35655. const { pageCount, disabled, currentPage, changeEvent } = usePagination();
  35656. const userInput = (0, vue.ref)();
  35657. const innerValue = (0, vue.computed)(() => userInput.value ?? currentPage?.value);
  35658. function handleInput(val) {
  35659. userInput.value = val ? +val : "";
  35660. }
  35661. function handleChange(val) {
  35662. val = Math.trunc(+val);
  35663. changeEvent?.(val);
  35664. userInput.value = void 0;
  35665. }
  35666. return (_ctx, _cache) => {
  35667. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  35668. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("jump")),
  35669. disabled: (0, vue.unref)(disabled)
  35670. }, [
  35671. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("goto")]) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.pagination.goto")), 3),
  35672. (0, vue.createVNode)((0, vue.unref)(ElInput), {
  35673. size: _ctx.size,
  35674. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("editor"), (0, vue.unref)(ns).is("in-pagination")]),
  35675. min: 1,
  35676. max: (0, vue.unref)(pageCount),
  35677. disabled: (0, vue.unref)(disabled),
  35678. "model-value": innerValue.value,
  35679. "validate-event": false,
  35680. "aria-label": (0, vue.unref)(t)("el.pagination.page"),
  35681. type: "number",
  35682. "onUpdate:modelValue": handleInput,
  35683. onChange: handleChange
  35684. }, null, 8, [
  35685. "size",
  35686. "class",
  35687. "max",
  35688. "disabled",
  35689. "model-value",
  35690. "aria-label"
  35691. ]),
  35692. (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("classifier")]) }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.pagination.pageClassifier")), 3)
  35693. ], 10, _hoisted_1$27);
  35694. };
  35695. }
  35696. });
  35697. //#endregion
  35698. //#region ../../packages/components/pagination/src/components/jumper.vue
  35699. var jumper_default = jumper_vue_vue_type_script_setup_true_lang_default;
  35700. //#endregion
  35701. //#region ../../packages/components/pagination/src/components/total.ts
  35702. const paginationTotalProps = buildProps({ total: {
  35703. type: Number,
  35704. default: 1e3
  35705. } });
  35706. //#endregion
  35707. //#region ../../packages/components/pagination/src/components/total.vue?vue&type=script&setup=true&lang.ts
  35708. const _hoisted_1$26 = ["disabled"];
  35709. var total_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35710. name: "ElPaginationTotal",
  35711. __name: "total",
  35712. props: paginationTotalProps,
  35713. setup(__props) {
  35714. const { t } = useLocale();
  35715. const ns = useNamespace("pagination");
  35716. const { disabled } = usePagination();
  35717. return (_ctx, _cache) => {
  35718. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  35719. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("total")),
  35720. disabled: (0, vue.unref)(disabled)
  35721. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.pagination.total", { total: _ctx.total })), 11, _hoisted_1$26);
  35722. };
  35723. }
  35724. });
  35725. //#endregion
  35726. //#region ../../packages/components/pagination/src/components/total.vue
  35727. var total_default = total_vue_vue_type_script_setup_true_lang_default;
  35728. //#endregion
  35729. //#region ../../packages/components/pagination/src/components/pager.ts
  35730. const paginationPagerProps = buildProps({
  35731. currentPage: {
  35732. type: Number,
  35733. default: 1
  35734. },
  35735. pageCount: {
  35736. type: Number,
  35737. required: true
  35738. },
  35739. pagerCount: {
  35740. type: Number,
  35741. default: 7
  35742. },
  35743. disabled: Boolean
  35744. });
  35745. //#endregion
  35746. //#region ../../packages/components/pagination/src/components/pager.vue?vue&type=script&setup=true&lang.ts
  35747. const _hoisted_1$25 = [
  35748. "aria-current",
  35749. "aria-label",
  35750. "tabindex"
  35751. ];
  35752. const _hoisted_2$16 = ["tabindex", "aria-label"];
  35753. const _hoisted_3$7 = [
  35754. "aria-current",
  35755. "aria-label",
  35756. "tabindex"
  35757. ];
  35758. const _hoisted_4$5 = ["tabindex", "aria-label"];
  35759. const _hoisted_5$3 = [
  35760. "aria-current",
  35761. "aria-label",
  35762. "tabindex"
  35763. ];
  35764. var pager_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  35765. name: "ElPaginationPager",
  35766. __name: "pager",
  35767. props: paginationPagerProps,
  35768. emits: [CHANGE_EVENT],
  35769. setup(__props, { emit: __emit }) {
  35770. const props = __props;
  35771. const emit = __emit;
  35772. const nsPager = useNamespace("pager");
  35773. const nsIcon = useNamespace("icon");
  35774. const { t } = useLocale();
  35775. const showPrevMore = (0, vue.ref)(false);
  35776. const showNextMore = (0, vue.ref)(false);
  35777. const quickPrevHover = (0, vue.ref)(false);
  35778. const quickNextHover = (0, vue.ref)(false);
  35779. const quickPrevFocus = (0, vue.ref)(false);
  35780. const quickNextFocus = (0, vue.ref)(false);
  35781. const pagers = (0, vue.computed)(() => {
  35782. const pagerCount = props.pagerCount;
  35783. const halfPagerCount = (pagerCount - 1) / 2;
  35784. const currentPage = Number(props.currentPage);
  35785. const pageCount = Number(props.pageCount);
  35786. let showPrevMore = false;
  35787. let showNextMore = false;
  35788. if (pageCount > pagerCount) {
  35789. if (currentPage > pagerCount - halfPagerCount) showPrevMore = true;
  35790. if (currentPage < pageCount - halfPagerCount) showNextMore = true;
  35791. }
  35792. const array = [];
  35793. if (showPrevMore && !showNextMore) {
  35794. const startPage = pageCount - (pagerCount - 2);
  35795. for (let i = startPage; i < pageCount; i++) array.push(i);
  35796. } else if (!showPrevMore && showNextMore) for (let i = 2; i < pagerCount; i++) array.push(i);
  35797. else if (showPrevMore && showNextMore) {
  35798. const offset = Math.floor(pagerCount / 2) - 1;
  35799. for (let i = currentPage - offset; i <= currentPage + offset; i++) array.push(i);
  35800. } else for (let i = 2; i < pageCount; i++) array.push(i);
  35801. return array;
  35802. });
  35803. const prevMoreKls = (0, vue.computed)(() => [
  35804. "more",
  35805. "btn-quickprev",
  35806. nsIcon.b(),
  35807. nsPager.is("disabled", props.disabled)
  35808. ]);
  35809. const nextMoreKls = (0, vue.computed)(() => [
  35810. "more",
  35811. "btn-quicknext",
  35812. nsIcon.b(),
  35813. nsPager.is("disabled", props.disabled)
  35814. ]);
  35815. const tabindex = (0, vue.computed)(() => props.disabled ? -1 : 0);
  35816. (0, vue.watch)(() => [
  35817. props.pageCount,
  35818. props.pagerCount,
  35819. props.currentPage
  35820. ], ([pageCount, pagerCount, currentPage]) => {
  35821. const halfPagerCount = (pagerCount - 1) / 2;
  35822. let showPrev = false;
  35823. let showNext = false;
  35824. if (pageCount > pagerCount) {
  35825. showPrev = currentPage > pagerCount - halfPagerCount;
  35826. showNext = currentPage < pageCount - halfPagerCount;
  35827. }
  35828. quickPrevHover.value &&= showPrev;
  35829. quickNextHover.value &&= showNext;
  35830. showPrevMore.value = showPrev;
  35831. showNextMore.value = showNext;
  35832. }, { immediate: true });
  35833. function onMouseEnter(forward = false) {
  35834. if (props.disabled) return;
  35835. if (forward) quickPrevHover.value = true;
  35836. else quickNextHover.value = true;
  35837. }
  35838. function onFocus(forward = false) {
  35839. if (forward) quickPrevFocus.value = true;
  35840. else quickNextFocus.value = true;
  35841. }
  35842. function onEnter(e) {
  35843. const target = e.target;
  35844. if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
  35845. const newPage = Number(target.textContent);
  35846. if (newPage !== props.currentPage) emit(CHANGE_EVENT, newPage);
  35847. } else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) onPagerClick(e);
  35848. }
  35849. function onPagerClick(event) {
  35850. const target = event.target;
  35851. if (target.tagName.toLowerCase() === "ul" || props.disabled) return;
  35852. let newPage = Number(target.textContent);
  35853. const pageCount = props.pageCount;
  35854. const currentPage = props.currentPage;
  35855. const pagerCountOffset = props.pagerCount - 2;
  35856. if (target.className.includes("more")) {
  35857. if (target.className.includes("quickprev")) newPage = currentPage - pagerCountOffset;
  35858. else if (target.className.includes("quicknext")) newPage = currentPage + pagerCountOffset;
  35859. }
  35860. if (!Number.isNaN(+newPage)) {
  35861. if (newPage < 1) newPage = 1;
  35862. if (newPage > pageCount) newPage = pageCount;
  35863. }
  35864. if (newPage !== currentPage) emit(CHANGE_EVENT, newPage);
  35865. }
  35866. return (_ctx, _cache) => {
  35867. return (0, vue.openBlock)(), (0, vue.createElementBlock)("ul", {
  35868. class: (0, vue.normalizeClass)((0, vue.unref)(nsPager).b()),
  35869. onClick: onPagerClick,
  35870. onKeyup: (0, vue.withKeys)(onEnter, ["enter"])
  35871. }, [
  35872. _ctx.pageCount > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35873. key: 0,
  35874. class: (0, vue.normalizeClass)([[(0, vue.unref)(nsPager).is("active", _ctx.currentPage === 1), (0, vue.unref)(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35875. "aria-current": _ctx.currentPage === 1,
  35876. "aria-label": (0, vue.unref)(t)("el.pagination.currentPage", { pager: 1 }),
  35877. tabindex: tabindex.value
  35878. }, " 1 ", 10, _hoisted_1$25)) : (0, vue.createCommentVNode)("v-if", true),
  35879. showPrevMore.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35880. key: 1,
  35881. class: (0, vue.normalizeClass)(prevMoreKls.value),
  35882. tabindex: tabindex.value,
  35883. "aria-label": (0, vue.unref)(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
  35884. onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
  35885. onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
  35886. onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
  35887. onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
  35888. }, [(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(d_arrow_left_default), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(more_filled_default), { key: 1 }))], 42, _hoisted_2$16)) : (0, vue.createCommentVNode)("v-if", true),
  35889. ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(pagers.value, (pager) => {
  35890. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35891. key: pager,
  35892. class: (0, vue.normalizeClass)([[(0, vue.unref)(nsPager).is("active", _ctx.currentPage === pager), (0, vue.unref)(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35893. "aria-current": _ctx.currentPage === pager,
  35894. "aria-label": (0, vue.unref)(t)("el.pagination.currentPage", { pager }),
  35895. tabindex: tabindex.value
  35896. }, (0, vue.toDisplayString)(pager), 11, _hoisted_3$7);
  35897. }), 128)),
  35898. showNextMore.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35899. key: 2,
  35900. class: (0, vue.normalizeClass)(nextMoreKls.value),
  35901. tabindex: tabindex.value,
  35902. "aria-label": (0, vue.unref)(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
  35903. onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
  35904. onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
  35905. onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
  35906. onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
  35907. }, [(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(d_arrow_right_default), { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(more_filled_default), { key: 1 }))], 42, _hoisted_4$5)) : (0, vue.createCommentVNode)("v-if", true),
  35908. _ctx.pageCount > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  35909. key: 3,
  35910. class: (0, vue.normalizeClass)([[(0, vue.unref)(nsPager).is("active", _ctx.currentPage === _ctx.pageCount), (0, vue.unref)(nsPager).is("disabled", _ctx.disabled)], "number"]),
  35911. "aria-current": _ctx.currentPage === _ctx.pageCount,
  35912. "aria-label": (0, vue.unref)(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
  35913. tabindex: tabindex.value
  35914. }, (0, vue.toDisplayString)(_ctx.pageCount), 11, _hoisted_5$3)) : (0, vue.createCommentVNode)("v-if", true)
  35915. ], 34);
  35916. };
  35917. }
  35918. });
  35919. //#endregion
  35920. //#region ../../packages/components/pagination/src/components/pager.vue
  35921. var pager_default = pager_vue_vue_type_script_setup_true_lang_default;
  35922. //#endregion
  35923. //#region ../../packages/components/pagination/src/pagination.ts
  35924. /**
  35925. * It it user's responsibility to guarantee that the value of props.total... is number
  35926. * (same as pageSize, defaultPageSize, currentPage, defaultCurrentPage, pageCount)
  35927. * Otherwise we can reasonable infer that the corresponding field is absent
  35928. */
  35929. const isAbsent = (v) => typeof v !== "number";
  35930. const paginationProps = buildProps({
  35931. pageSize: Number,
  35932. defaultPageSize: Number,
  35933. total: Number,
  35934. pageCount: Number,
  35935. pagerCount: {
  35936. type: Number,
  35937. validator: (value) => {
  35938. return isNumber(value) && Math.trunc(value) === value && value > 4 && value < 22 && value % 2 === 1;
  35939. },
  35940. default: 7
  35941. },
  35942. currentPage: Number,
  35943. defaultCurrentPage: Number,
  35944. layout: {
  35945. type: String,
  35946. default: [
  35947. "prev",
  35948. "pager",
  35949. "next",
  35950. "jumper",
  35951. "->",
  35952. "total"
  35953. ].join(", ")
  35954. },
  35955. pageSizes: {
  35956. type: definePropType(Array),
  35957. default: () => mutable([
  35958. 10,
  35959. 20,
  35960. 30,
  35961. 40,
  35962. 50,
  35963. 100
  35964. ])
  35965. },
  35966. popperClass: {
  35967. type: String,
  35968. default: ""
  35969. },
  35970. popperStyle: { type: definePropType([String, Object]) },
  35971. prevText: {
  35972. type: String,
  35973. default: ""
  35974. },
  35975. prevIcon: {
  35976. type: iconPropType,
  35977. default: () => arrow_left_default
  35978. },
  35979. nextText: {
  35980. type: String,
  35981. default: ""
  35982. },
  35983. nextIcon: {
  35984. type: iconPropType,
  35985. default: () => arrow_right_default
  35986. },
  35987. teleported: {
  35988. type: Boolean,
  35989. default: true
  35990. },
  35991. small: Boolean,
  35992. size: useSizeProp,
  35993. background: Boolean,
  35994. disabled: Boolean,
  35995. hideOnSinglePage: Boolean,
  35996. appendSizeTo: String
  35997. });
  35998. const paginationEmits = {
  35999. "update:current-page": (val) => isNumber(val),
  36000. "update:page-size": (val) => isNumber(val),
  36001. "size-change": (val) => isNumber(val),
  36002. change: (currentPage, pageSize) => isNumber(currentPage) && isNumber(pageSize),
  36003. "current-change": (val) => isNumber(val),
  36004. "prev-click": (val) => isNumber(val),
  36005. "next-click": (val) => isNumber(val)
  36006. };
  36007. const componentName = "ElPagination";
  36008. var pagination_default = (0, vue.defineComponent)({
  36009. name: componentName,
  36010. props: paginationProps,
  36011. emits: paginationEmits,
  36012. setup(props, { emit, slots }) {
  36013. const { t } = useLocale();
  36014. const ns = useNamespace("pagination");
  36015. const vnodeProps = (0, vue.getCurrentInstance)().vnode.props || {};
  36016. const _globalSize = useGlobalSize();
  36017. const _size = (0, vue.computed)(() => props.small ? "small" : props.size ?? _globalSize.value);
  36018. useDeprecated({
  36019. from: "small",
  36020. replacement: "size",
  36021. version: "3.0.0",
  36022. scope: "el-pagination",
  36023. ref: "https://element-plus.org/zh-CN/component/pagination.html"
  36024. }, (0, vue.computed)(() => !!props.small));
  36025. const hasCurrentPageListener = "onUpdate:currentPage" in vnodeProps || "onUpdate:current-page" in vnodeProps || "onCurrentChange" in vnodeProps;
  36026. const hasPageSizeListener = "onUpdate:pageSize" in vnodeProps || "onUpdate:page-size" in vnodeProps || "onSizeChange" in vnodeProps;
  36027. const assertValidUsage = (0, vue.computed)(() => {
  36028. if (isAbsent(props.total) && isAbsent(props.pageCount)) return false;
  36029. if (!isAbsent(props.currentPage) && !hasCurrentPageListener) return false;
  36030. if (props.layout.includes("sizes")) {
  36031. if (!isAbsent(props.pageCount)) {
  36032. if (!hasPageSizeListener) return false;
  36033. } else if (!isAbsent(props.total)) {
  36034. if (!isAbsent(props.pageSize)) {
  36035. if (!hasPageSizeListener) return false;
  36036. }
  36037. }
  36038. }
  36039. return true;
  36040. });
  36041. const innerPageSize = (0, vue.ref)(isAbsent(props.defaultPageSize) ? 10 : props.defaultPageSize);
  36042. const innerCurrentPage = (0, vue.ref)(isAbsent(props.defaultCurrentPage) ? 1 : props.defaultCurrentPage);
  36043. const pageSizeBridge = (0, vue.computed)({
  36044. get() {
  36045. return isAbsent(props.pageSize) ? innerPageSize.value : props.pageSize;
  36046. },
  36047. set(v) {
  36048. if (isAbsent(props.pageSize)) innerPageSize.value = v;
  36049. if (hasPageSizeListener) {
  36050. emit("update:page-size", v);
  36051. emit("size-change", v);
  36052. }
  36053. }
  36054. });
  36055. const pageCountBridge = (0, vue.computed)(() => {
  36056. let pageCount = 0;
  36057. if (!isAbsent(props.pageCount)) pageCount = props.pageCount;
  36058. else if (!isAbsent(props.total)) pageCount = Math.max(1, Math.ceil(props.total / pageSizeBridge.value));
  36059. return pageCount;
  36060. });
  36061. const currentPageBridge = (0, vue.computed)({
  36062. get() {
  36063. return isAbsent(props.currentPage) ? innerCurrentPage.value : props.currentPage;
  36064. },
  36065. set(v) {
  36066. let newCurrentPage = v;
  36067. if (v < 1) newCurrentPage = 1;
  36068. else if (v > pageCountBridge.value) newCurrentPage = pageCountBridge.value;
  36069. if (isAbsent(props.currentPage)) innerCurrentPage.value = newCurrentPage;
  36070. if (hasCurrentPageListener) {
  36071. emit("update:current-page", newCurrentPage);
  36072. emit("current-change", newCurrentPage);
  36073. }
  36074. }
  36075. });
  36076. (0, vue.watch)(pageCountBridge, (val) => {
  36077. if (currentPageBridge.value > val) currentPageBridge.value = val;
  36078. });
  36079. (0, vue.watch)([currentPageBridge, pageSizeBridge], (value) => {
  36080. emit(CHANGE_EVENT, ...value);
  36081. }, { flush: "post" });
  36082. function handleCurrentChange(val) {
  36083. currentPageBridge.value = val;
  36084. }
  36085. function handleSizeChange(val) {
  36086. pageSizeBridge.value = val;
  36087. const newPageCount = pageCountBridge.value;
  36088. if (currentPageBridge.value > newPageCount) currentPageBridge.value = newPageCount;
  36089. }
  36090. function prev() {
  36091. if (props.disabled) return;
  36092. currentPageBridge.value -= 1;
  36093. emit("prev-click", currentPageBridge.value);
  36094. }
  36095. function next() {
  36096. if (props.disabled) return;
  36097. currentPageBridge.value += 1;
  36098. emit("next-click", currentPageBridge.value);
  36099. }
  36100. function addClass(element, cls) {
  36101. if (element) {
  36102. if (!element.props) element.props = {};
  36103. element.props.class = [element.props.class, cls].join(" ");
  36104. }
  36105. }
  36106. (0, vue.provide)(elPaginationKey, {
  36107. pageCount: pageCountBridge,
  36108. disabled: (0, vue.computed)(() => props.disabled),
  36109. currentPage: currentPageBridge,
  36110. changeEvent: handleCurrentChange,
  36111. handleSizeChange
  36112. });
  36113. return () => {
  36114. if (!assertValidUsage.value) {
  36115. /* @__PURE__ */ debugWarn(componentName, t("el.pagination.deprecationWarning"));
  36116. return null;
  36117. }
  36118. if (!props.layout) return null;
  36119. if (props.hideOnSinglePage && pageCountBridge.value <= 1) return null;
  36120. const rootChildren = [];
  36121. const rightWrapperChildren = [];
  36122. const rightWrapperRoot = (0, vue.h)("div", { class: ns.e("rightwrapper") }, rightWrapperChildren);
  36123. const TEMPLATE_MAP = {
  36124. prev: (0, vue.h)(prev_default, {
  36125. disabled: props.disabled,
  36126. currentPage: currentPageBridge.value,
  36127. prevText: props.prevText,
  36128. prevIcon: props.prevIcon,
  36129. onClick: prev
  36130. }),
  36131. jumper: (0, vue.h)(jumper_default, { size: _size.value }),
  36132. pager: (0, vue.h)(pager_default, {
  36133. currentPage: currentPageBridge.value,
  36134. pageCount: pageCountBridge.value,
  36135. pagerCount: props.pagerCount,
  36136. onChange: handleCurrentChange,
  36137. disabled: props.disabled
  36138. }),
  36139. next: (0, vue.h)(next_default, {
  36140. disabled: props.disabled,
  36141. currentPage: currentPageBridge.value,
  36142. pageCount: pageCountBridge.value,
  36143. nextText: props.nextText,
  36144. nextIcon: props.nextIcon,
  36145. onClick: next
  36146. }),
  36147. sizes: (0, vue.h)(sizes_default, {
  36148. pageSize: pageSizeBridge.value,
  36149. pageSizes: props.pageSizes,
  36150. popperClass: props.popperClass,
  36151. popperStyle: props.popperStyle,
  36152. disabled: props.disabled,
  36153. teleported: props.teleported,
  36154. size: _size.value,
  36155. appendSizeTo: props.appendSizeTo
  36156. }),
  36157. slot: slots?.default?.() ?? null,
  36158. total: (0, vue.h)(total_default, { total: isAbsent(props.total) ? 0 : props.total })
  36159. };
  36160. const components = props.layout.split(",").map((item) => item.trim());
  36161. let haveRightWrapper = false;
  36162. components.forEach((c) => {
  36163. if (c === "->") {
  36164. haveRightWrapper = true;
  36165. return;
  36166. }
  36167. if (!haveRightWrapper) rootChildren.push(TEMPLATE_MAP[c]);
  36168. else rightWrapperChildren.push(TEMPLATE_MAP[c]);
  36169. });
  36170. addClass(rootChildren[0], ns.is("first"));
  36171. addClass(rootChildren[rootChildren.length - 1], ns.is("last"));
  36172. if (haveRightWrapper && rightWrapperChildren.length > 0) {
  36173. addClass(rightWrapperChildren[0], ns.is("first"));
  36174. addClass(rightWrapperChildren[rightWrapperChildren.length - 1], ns.is("last"));
  36175. rootChildren.push(rightWrapperRoot);
  36176. }
  36177. return (0, vue.h)("div", { class: [
  36178. ns.b(),
  36179. ns.is("background", props.background),
  36180. ns.m(_size.value)
  36181. ] }, rootChildren);
  36182. };
  36183. }
  36184. });
  36185. //#endregion
  36186. //#region ../../packages/components/pagination/index.ts
  36187. const ElPagination = withInstall(pagination_default);
  36188. //#endregion
  36189. //#region ../../packages/components/popconfirm/src/popconfirm.ts
  36190. /**
  36191. * @deprecated Removed after 3.0.0, Use `PopconfirmProps` instead.
  36192. */
  36193. const popconfirmProps = buildProps({
  36194. title: String,
  36195. confirmButtonText: String,
  36196. cancelButtonText: String,
  36197. confirmButtonType: {
  36198. type: String,
  36199. values: buttonTypes,
  36200. default: "primary"
  36201. },
  36202. cancelButtonType: {
  36203. type: String,
  36204. values: buttonTypes,
  36205. default: "text"
  36206. },
  36207. icon: {
  36208. type: iconPropType,
  36209. default: () => question_filled_default
  36210. },
  36211. iconColor: {
  36212. type: String,
  36213. default: "#f90"
  36214. },
  36215. hideIcon: Boolean,
  36216. hideAfter: {
  36217. type: Number,
  36218. default: 200
  36219. },
  36220. effect: {
  36221. ...useTooltipContentProps.effect,
  36222. default: "light"
  36223. },
  36224. teleported: useTooltipContentProps.teleported,
  36225. persistent: useTooltipContentProps.persistent,
  36226. width: {
  36227. type: [String, Number],
  36228. default: 150
  36229. },
  36230. virtualTriggering: useTooltipTriggerProps.virtualTriggering,
  36231. virtualRef: useTooltipTriggerProps.virtualRef
  36232. });
  36233. const popconfirmEmits = {
  36234. confirm: (e) => e instanceof MouseEvent,
  36235. cancel: (e) => e instanceof MouseEvent
  36236. };
  36237. //#endregion
  36238. //#region ../../packages/components/popconfirm/src/popconfirm.vue?vue&type=script&setup=true&lang.ts
  36239. var popconfirm_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  36240. name: "ElPopconfirm",
  36241. __name: "popconfirm",
  36242. props: popconfirmProps,
  36243. emits: popconfirmEmits,
  36244. setup(__props, { expose: __expose, emit: __emit }) {
  36245. const props = __props;
  36246. const emit = __emit;
  36247. const { t } = useLocale();
  36248. const ns = useNamespace("popconfirm");
  36249. const tooltipRef = (0, vue.ref)();
  36250. const rootRef = (0, vue.ref)();
  36251. const popperRef = (0, vue.computed)(() => {
  36252. return (0, vue.unref)(tooltipRef)?.popperRef;
  36253. });
  36254. const showPopper = () => {
  36255. rootRef.value?.focus?.();
  36256. };
  36257. const hidePopper = () => {
  36258. tooltipRef.value?.onClose?.();
  36259. };
  36260. const style = (0, vue.computed)(() => {
  36261. return { width: addUnit(props.width) };
  36262. });
  36263. const confirm = (e) => {
  36264. emit("confirm", e);
  36265. hidePopper();
  36266. };
  36267. const cancel = (e) => {
  36268. emit("cancel", e);
  36269. hidePopper();
  36270. };
  36271. const finalConfirmButtonText = (0, vue.computed)(() => props.confirmButtonText || t("el.popconfirm.confirmButtonText"));
  36272. const finalCancelButtonText = (0, vue.computed)(() => props.cancelButtonText || t("el.popconfirm.cancelButtonText"));
  36273. __expose({
  36274. popperRef,
  36275. hide: hidePopper
  36276. });
  36277. return (_ctx, _cache) => {
  36278. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), (0, vue.mergeProps)({
  36279. ref_key: "tooltipRef",
  36280. ref: tooltipRef,
  36281. trigger: "click",
  36282. effect: __props.effect
  36283. }, _ctx.$attrs, {
  36284. "virtual-triggering": __props.virtualTriggering,
  36285. "virtual-ref": __props.virtualRef,
  36286. "popper-class": `${(0, vue.unref)(ns).namespace.value}-popover`,
  36287. "popper-style": style.value,
  36288. teleported: __props.teleported,
  36289. "fallback-placements": [
  36290. "bottom",
  36291. "top",
  36292. "right",
  36293. "left"
  36294. ],
  36295. "hide-after": __props.hideAfter,
  36296. persistent: __props.persistent,
  36297. loop: "",
  36298. onShow: showPopper
  36299. }), {
  36300. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  36301. ref_key: "rootRef",
  36302. ref: rootRef,
  36303. tabindex: "-1",
  36304. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b())
  36305. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("main")) }, [!__props.hideIcon && __props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  36306. key: 0,
  36307. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon")),
  36308. style: (0, vue.normalizeStyle)({ color: __props.iconColor })
  36309. }, {
  36310. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  36311. _: 1
  36312. }, 8, ["class", "style"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)(__props.title), 1)], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("action")) }, [(0, vue.renderSlot)(_ctx.$slots, "actions", {
  36313. confirm,
  36314. cancel
  36315. }, () => [(0, vue.createVNode)((0, vue.unref)(ElButton), {
  36316. size: "small",
  36317. type: __props.cancelButtonType === "text" ? "" : __props.cancelButtonType,
  36318. text: __props.cancelButtonType === "text",
  36319. onClick: cancel
  36320. }, {
  36321. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(finalCancelButtonText.value), 1)]),
  36322. _: 1
  36323. }, 8, ["type", "text"]), (0, vue.createVNode)((0, vue.unref)(ElButton), {
  36324. size: "small",
  36325. type: __props.confirmButtonType === "text" ? "" : __props.confirmButtonType,
  36326. text: __props.confirmButtonType === "text",
  36327. onClick: confirm
  36328. }, {
  36329. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(finalConfirmButtonText.value), 1)]),
  36330. _: 1
  36331. }, 8, ["type", "text"])])], 2)], 2)]),
  36332. default: (0, vue.withCtx)(() => [_ctx.$slots.reference ? (0, vue.renderSlot)(_ctx.$slots, "reference", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true)]),
  36333. _: 3
  36334. }, 16, [
  36335. "effect",
  36336. "virtual-triggering",
  36337. "virtual-ref",
  36338. "popper-class",
  36339. "popper-style",
  36340. "teleported",
  36341. "hide-after",
  36342. "persistent"
  36343. ]);
  36344. };
  36345. }
  36346. });
  36347. //#endregion
  36348. //#region ../../packages/components/popconfirm/src/popconfirm.vue
  36349. var popconfirm_default = popconfirm_vue_vue_type_script_setup_true_lang_default;
  36350. //#endregion
  36351. //#region ../../packages/components/popconfirm/index.ts
  36352. const ElPopconfirm = withInstall(popconfirm_default);
  36353. //#endregion
  36354. //#region ../../packages/components/popover/src/popover.ts
  36355. /**
  36356. * @deprecated Removed after 3.0.0, Use `PopoverProps` instead.
  36357. */
  36358. const popoverProps = buildProps({
  36359. trigger: useTooltipTriggerProps.trigger,
  36360. triggerKeys: useTooltipTriggerProps.triggerKeys,
  36361. placement: dropdownProps.placement,
  36362. disabled: useTooltipTriggerProps.disabled,
  36363. visible: useTooltipContentProps.visible,
  36364. transition: useTooltipContentProps.transition,
  36365. popperOptions: dropdownProps.popperOptions,
  36366. tabindex: dropdownProps.tabindex,
  36367. content: useTooltipContentProps.content,
  36368. popperStyle: useTooltipContentProps.popperStyle,
  36369. popperClass: useTooltipContentProps.popperClass,
  36370. enterable: {
  36371. ...useTooltipContentProps.enterable,
  36372. default: true
  36373. },
  36374. effect: {
  36375. ...useTooltipContentProps.effect,
  36376. default: "light"
  36377. },
  36378. teleported: useTooltipContentProps.teleported,
  36379. appendTo: useTooltipContentProps.appendTo,
  36380. title: String,
  36381. width: {
  36382. type: [String, Number],
  36383. default: 150
  36384. },
  36385. offset: {
  36386. type: Number,
  36387. default: void 0
  36388. },
  36389. showAfter: {
  36390. type: Number,
  36391. default: 0
  36392. },
  36393. hideAfter: {
  36394. type: Number,
  36395. default: 200
  36396. },
  36397. autoClose: {
  36398. type: Number,
  36399. default: 0
  36400. },
  36401. showArrow: {
  36402. type: Boolean,
  36403. default: true
  36404. },
  36405. persistent: {
  36406. type: Boolean,
  36407. default: true
  36408. },
  36409. "onUpdate:visible": { type: Function }
  36410. });
  36411. const popoverEmits = {
  36412. "update:visible": (value) => isBoolean(value),
  36413. "before-enter": () => true,
  36414. "before-leave": () => true,
  36415. "after-enter": () => true,
  36416. "after-leave": () => true
  36417. };
  36418. /**
  36419. * @description default values for PopoverProps
  36420. */
  36421. const popoverPropsDefaults = {
  36422. trigger: "hover",
  36423. triggerKeys: () => [
  36424. EVENT_CODE.enter,
  36425. EVENT_CODE.numpadEnter,
  36426. EVENT_CODE.space
  36427. ],
  36428. placement: "bottom",
  36429. visible: null,
  36430. popperOptions: () => ({}),
  36431. tabindex: 0,
  36432. content: "",
  36433. popperStyle: void 0,
  36434. enterable: true,
  36435. effect: "light",
  36436. teleported: true,
  36437. width: 150,
  36438. offset: void 0,
  36439. showAfter: 0,
  36440. hideAfter: 200,
  36441. autoClose: 0,
  36442. showArrow: true,
  36443. persistent: true
  36444. };
  36445. //#endregion
  36446. //#region ../../packages/components/popover/src/popover.vue?vue&type=script&setup=true&lang.ts
  36447. const updateEventKeyRaw = `onUpdate:visible`;
  36448. var popover_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  36449. name: "ElPopover",
  36450. __name: "popover",
  36451. props: popoverProps,
  36452. emits: popoverEmits,
  36453. setup(__props, { expose: __expose, emit: __emit }) {
  36454. const props = __props;
  36455. const emit = __emit;
  36456. const onUpdateVisible = (0, vue.computed)(() => {
  36457. return props[updateEventKeyRaw];
  36458. });
  36459. const ns = useNamespace("popover");
  36460. const tooltipRef = (0, vue.ref)();
  36461. const popperRef = (0, vue.computed)(() => {
  36462. return (0, vue.unref)(tooltipRef)?.popperRef;
  36463. });
  36464. const style = (0, vue.computed)(() => {
  36465. return [{ width: addUnit(props.width) }, props.popperStyle];
  36466. });
  36467. const kls = (0, vue.computed)(() => {
  36468. return [
  36469. ns.b(),
  36470. props.popperClass,
  36471. { [ns.m("plain")]: !!props.content }
  36472. ];
  36473. });
  36474. const gpuAcceleration = (0, vue.computed)(() => {
  36475. return props.transition === `${ns.namespace.value}-fade-in-linear`;
  36476. });
  36477. const hide = () => {
  36478. tooltipRef.value?.hide();
  36479. };
  36480. const beforeEnter = () => {
  36481. emit("before-enter");
  36482. };
  36483. const beforeLeave = () => {
  36484. emit("before-leave");
  36485. };
  36486. const afterEnter = () => {
  36487. emit("after-enter");
  36488. };
  36489. const afterLeave = () => {
  36490. emit("update:visible", false);
  36491. emit("after-leave");
  36492. };
  36493. __expose({
  36494. popperRef,
  36495. hide
  36496. });
  36497. return (_ctx, _cache) => {
  36498. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElTooltip), (0, vue.mergeProps)({
  36499. ref_key: "tooltipRef",
  36500. ref: tooltipRef
  36501. }, _ctx.$attrs, {
  36502. trigger: __props.trigger,
  36503. "trigger-keys": __props.triggerKeys,
  36504. placement: __props.placement,
  36505. disabled: __props.disabled,
  36506. visible: __props.visible,
  36507. transition: __props.transition,
  36508. "popper-options": __props.popperOptions,
  36509. tabindex: __props.tabindex,
  36510. content: __props.content,
  36511. offset: __props.offset,
  36512. "show-after": __props.showAfter,
  36513. "hide-after": __props.hideAfter,
  36514. "auto-close": __props.autoClose,
  36515. "show-arrow": __props.showArrow,
  36516. "aria-label": __props.title,
  36517. effect: __props.effect,
  36518. enterable: __props.enterable,
  36519. "popper-class": kls.value,
  36520. "popper-style": style.value,
  36521. teleported: __props.teleported,
  36522. "append-to": __props.appendTo,
  36523. persistent: __props.persistent,
  36524. "gpu-acceleration": gpuAcceleration.value,
  36525. "onUpdate:visible": onUpdateVisible.value,
  36526. onBeforeShow: beforeEnter,
  36527. onBeforeHide: beforeLeave,
  36528. onShow: afterEnter,
  36529. onHide: afterLeave
  36530. }), {
  36531. content: (0, vue.withCtx)(() => [__props.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36532. key: 0,
  36533. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")),
  36534. role: "title"
  36535. }, (0, vue.toDisplayString)(__props.title), 3)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.renderSlot)(_ctx.$slots, "default", { hide }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.content), 1)])]),
  36536. default: (0, vue.withCtx)(() => [_ctx.$slots.reference ? (0, vue.renderSlot)(_ctx.$slots, "reference", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true)]),
  36537. _: 3
  36538. }, 16, [
  36539. "trigger",
  36540. "trigger-keys",
  36541. "placement",
  36542. "disabled",
  36543. "visible",
  36544. "transition",
  36545. "popper-options",
  36546. "tabindex",
  36547. "content",
  36548. "offset",
  36549. "show-after",
  36550. "hide-after",
  36551. "auto-close",
  36552. "show-arrow",
  36553. "aria-label",
  36554. "effect",
  36555. "enterable",
  36556. "popper-class",
  36557. "popper-style",
  36558. "teleported",
  36559. "append-to",
  36560. "persistent",
  36561. "gpu-acceleration",
  36562. "onUpdate:visible"
  36563. ]);
  36564. };
  36565. }
  36566. });
  36567. //#endregion
  36568. //#region ../../packages/components/popover/src/popover.vue
  36569. var popover_default = popover_vue_vue_type_script_setup_true_lang_default;
  36570. //#endregion
  36571. //#region ../../packages/components/popover/src/directive.ts
  36572. const attachEvents = (el, binding) => {
  36573. const popover = (binding.arg || binding.value)?.popperRef;
  36574. if (popover) popover.triggerRef = el;
  36575. };
  36576. var directive_default = {
  36577. mounted(el, binding) {
  36578. attachEvents(el, binding);
  36579. },
  36580. updated(el, binding) {
  36581. attachEvents(el, binding);
  36582. }
  36583. };
  36584. const VPopover = "popover";
  36585. //#endregion
  36586. //#region ../../packages/components/popover/index.ts
  36587. const ElPopoverDirective = withInstallDirective(directive_default, VPopover);
  36588. const ElPopover = withInstall(popover_default, { directive: ElPopoverDirective });
  36589. //#endregion
  36590. //#region ../../packages/components/progress/src/progress.ts
  36591. /**
  36592. * @deprecated Removed after 3.0.0, Use `ProgressProps` instead.
  36593. */
  36594. const progressProps = buildProps({
  36595. type: {
  36596. type: String,
  36597. default: "line",
  36598. values: [
  36599. "line",
  36600. "circle",
  36601. "dashboard"
  36602. ]
  36603. },
  36604. percentage: {
  36605. type: Number,
  36606. default: 0,
  36607. validator: (val) => val >= 0 && val <= 100
  36608. },
  36609. status: {
  36610. type: String,
  36611. default: "",
  36612. values: [
  36613. "",
  36614. "success",
  36615. "exception",
  36616. "warning"
  36617. ]
  36618. },
  36619. indeterminate: Boolean,
  36620. duration: {
  36621. type: Number,
  36622. default: 3
  36623. },
  36624. strokeWidth: {
  36625. type: Number,
  36626. default: 6
  36627. },
  36628. strokeLinecap: {
  36629. type: definePropType(String),
  36630. default: "round"
  36631. },
  36632. textInside: Boolean,
  36633. width: {
  36634. type: Number,
  36635. default: 126
  36636. },
  36637. showText: {
  36638. type: Boolean,
  36639. default: true
  36640. },
  36641. color: {
  36642. type: definePropType([
  36643. String,
  36644. Array,
  36645. Function
  36646. ]),
  36647. default: ""
  36648. },
  36649. striped: Boolean,
  36650. stripedFlow: Boolean,
  36651. format: {
  36652. type: definePropType(Function),
  36653. default: (percentage) => `${percentage}%`
  36654. }
  36655. });
  36656. //#endregion
  36657. //#region ../../packages/components/progress/src/progress.vue?vue&type=script&setup=true&lang.ts
  36658. const _hoisted_1$24 = ["aria-valuenow"];
  36659. const _hoisted_2$15 = { viewBox: "0 0 100 100" };
  36660. const _hoisted_3$6 = [
  36661. "d",
  36662. "stroke",
  36663. "stroke-linecap",
  36664. "stroke-width"
  36665. ];
  36666. const _hoisted_4$4 = [
  36667. "d",
  36668. "stroke",
  36669. "opacity",
  36670. "stroke-linecap",
  36671. "stroke-width"
  36672. ];
  36673. const _hoisted_5$2 = { key: 0 };
  36674. var progress_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  36675. name: "ElProgress",
  36676. __name: "progress",
  36677. props: progressProps,
  36678. setup(__props) {
  36679. const STATUS_COLOR_MAP = {
  36680. success: "#13ce66",
  36681. exception: "#ff4949",
  36682. warning: "#e6a23c",
  36683. default: "#20a0ff"
  36684. };
  36685. const props = __props;
  36686. const ns = useNamespace("progress");
  36687. const barStyle = (0, vue.computed)(() => {
  36688. const barStyle = {
  36689. width: `${props.percentage}%`,
  36690. animationDuration: `${props.duration}s`
  36691. };
  36692. const color = getCurrentColor(props.percentage);
  36693. if (color.includes("gradient")) barStyle.background = color;
  36694. else barStyle.backgroundColor = color;
  36695. return barStyle;
  36696. });
  36697. const relativeStrokeWidth = (0, vue.computed)(() => (props.strokeWidth / props.width * 100).toFixed(1));
  36698. const radius = (0, vue.computed)(() => {
  36699. if (["circle", "dashboard"].includes(props.type)) return Number.parseInt(`${50 - Number.parseFloat(relativeStrokeWidth.value) / 2}`, 10);
  36700. return 0;
  36701. });
  36702. const trackPath = (0, vue.computed)(() => {
  36703. const r = radius.value;
  36704. const isDashboard = props.type === "dashboard";
  36705. return `
  36706. M 50 50
  36707. m 0 ${isDashboard ? "" : "-"}${r}
  36708. a ${r} ${r} 0 1 1 0 ${isDashboard ? "-" : ""}${r * 2}
  36709. a ${r} ${r} 0 1 1 0 ${isDashboard ? "" : "-"}${r * 2}
  36710. `;
  36711. });
  36712. const perimeter = (0, vue.computed)(() => 2 * Math.PI * radius.value);
  36713. const rate = (0, vue.computed)(() => props.type === "dashboard" ? .75 : 1);
  36714. const strokeDashoffset = (0, vue.computed)(() => {
  36715. return `${-1 * perimeter.value * (1 - rate.value) / 2}px`;
  36716. });
  36717. const trailPathStyle = (0, vue.computed)(() => ({
  36718. strokeDasharray: `${perimeter.value * rate.value}px, ${perimeter.value}px`,
  36719. strokeDashoffset: strokeDashoffset.value
  36720. }));
  36721. const circlePathStyle = (0, vue.computed)(() => ({
  36722. strokeDasharray: `${perimeter.value * rate.value * (props.percentage / 100)}px, ${perimeter.value}px`,
  36723. strokeDashoffset: strokeDashoffset.value,
  36724. transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
  36725. }));
  36726. const stroke = (0, vue.computed)(() => {
  36727. let ret;
  36728. if (props.color) ret = getCurrentColor(props.percentage);
  36729. else ret = STATUS_COLOR_MAP[props.status] || STATUS_COLOR_MAP.default;
  36730. return ret;
  36731. });
  36732. const statusIcon = (0, vue.computed)(() => {
  36733. if (props.status === "warning") return warning_filled_default;
  36734. if (props.type === "line") return props.status === "success" ? circle_check_default : circle_close_default;
  36735. else return props.status === "success" ? check_default : close_default;
  36736. });
  36737. const progressTextSize = (0, vue.computed)(() => {
  36738. return props.type === "line" ? 12 + props.strokeWidth * .4 : props.width * .111111 + 2;
  36739. });
  36740. const content = (0, vue.computed)(() => props.format(props.percentage));
  36741. function getColors(color) {
  36742. const span = 100 / color.length;
  36743. return color.map((seriesColor, index) => {
  36744. if (isString(seriesColor)) return {
  36745. color: seriesColor,
  36746. percentage: (index + 1) * span
  36747. };
  36748. return seriesColor;
  36749. }).sort((a, b) => a.percentage - b.percentage);
  36750. }
  36751. const getCurrentColor = (percentage) => {
  36752. const { color } = props;
  36753. if (isFunction$1(color)) return color(percentage);
  36754. else if (isString(color)) return color;
  36755. else {
  36756. const colors = getColors(color);
  36757. for (const color of colors) if (color.percentage > percentage) return color.color;
  36758. return colors[colors.length - 1]?.color;
  36759. }
  36760. };
  36761. return (_ctx, _cache) => {
  36762. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36763. class: (0, vue.normalizeClass)([
  36764. (0, vue.unref)(ns).b(),
  36765. (0, vue.unref)(ns).m(__props.type),
  36766. (0, vue.unref)(ns).is(__props.status),
  36767. {
  36768. [(0, vue.unref)(ns).m("without-text")]: !__props.showText,
  36769. [(0, vue.unref)(ns).m("text-inside")]: __props.textInside
  36770. }
  36771. ]),
  36772. role: "progressbar",
  36773. "aria-valuenow": __props.percentage,
  36774. "aria-valuemin": "0",
  36775. "aria-valuemax": "100"
  36776. }, [__props.type === "line" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36777. key: 0,
  36778. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("bar"))
  36779. }, [(0, vue.createElementVNode)("div", {
  36780. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("bar", "outer")),
  36781. style: (0, vue.normalizeStyle)({ height: `${__props.strokeWidth}px` })
  36782. }, [(0, vue.createElementVNode)("div", {
  36783. class: (0, vue.normalizeClass)([
  36784. (0, vue.unref)(ns).be("bar", "inner"),
  36785. { [(0, vue.unref)(ns).bem("bar", "inner", "indeterminate")]: __props.indeterminate },
  36786. { [(0, vue.unref)(ns).bem("bar", "inner", "striped")]: __props.striped },
  36787. { [(0, vue.unref)(ns).bem("bar", "inner", "striped-flow")]: __props.stripedFlow }
  36788. ]),
  36789. style: (0, vue.normalizeStyle)(barStyle.value)
  36790. }, [(__props.showText || _ctx.$slots.default) && __props.textInside ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36791. key: 0,
  36792. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("bar", "innerText"))
  36793. }, [(0, vue.renderSlot)(_ctx.$slots, "default", { percentage: __props.percentage }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(content.value), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)], 6)], 6)], 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36794. key: 1,
  36795. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("circle")),
  36796. style: (0, vue.normalizeStyle)({
  36797. height: `${__props.width}px`,
  36798. width: `${__props.width}px`
  36799. })
  36800. }, [((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_2$15, [(0, vue.createElementVNode)("path", {
  36801. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("circle", "track")),
  36802. d: trackPath.value,
  36803. stroke: `var(${(0, vue.unref)(ns).cssVarName("fill-color-light")}, #e5e9f2)`,
  36804. "stroke-linecap": __props.strokeLinecap,
  36805. "stroke-width": relativeStrokeWidth.value,
  36806. fill: "none",
  36807. style: (0, vue.normalizeStyle)(trailPathStyle.value)
  36808. }, null, 14, _hoisted_3$6), (0, vue.createElementVNode)("path", {
  36809. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("circle", "path")),
  36810. d: trackPath.value,
  36811. stroke: stroke.value,
  36812. fill: "none",
  36813. opacity: __props.percentage ? 1 : 0,
  36814. "stroke-linecap": __props.strokeLinecap,
  36815. "stroke-width": relativeStrokeWidth.value,
  36816. style: (0, vue.normalizeStyle)(circlePathStyle.value)
  36817. }, null, 14, _hoisted_4$4)]))], 6)), (__props.showText || _ctx.$slots.default) && !__props.textInside ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  36818. key: 2,
  36819. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("text")),
  36820. style: (0, vue.normalizeStyle)({ fontSize: `${progressTextSize.value}px` })
  36821. }, [(0, vue.renderSlot)(_ctx.$slots, "default", { percentage: __props.percentage }, () => [!__props.status ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_5$2, (0, vue.toDisplayString)(content.value), 1)) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 1 }, {
  36822. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(statusIcon.value)))]),
  36823. _: 1
  36824. }))])], 6)) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_1$24);
  36825. };
  36826. }
  36827. });
  36828. //#endregion
  36829. //#region ../../packages/components/progress/src/progress.vue
  36830. var progress_default = progress_vue_vue_type_script_setup_true_lang_default;
  36831. //#endregion
  36832. //#region ../../packages/components/progress/index.ts
  36833. const ElProgress = withInstall(progress_default);
  36834. //#endregion
  36835. //#region ../../packages/components/rate/src/rate.ts
  36836. /**
  36837. * @deprecated Removed after 3.0.0, Use `RateProps` instead.
  36838. */
  36839. const rateProps = buildProps({
  36840. modelValue: {
  36841. type: Number,
  36842. default: 0
  36843. },
  36844. id: {
  36845. type: String,
  36846. default: void 0
  36847. },
  36848. lowThreshold: {
  36849. type: Number,
  36850. default: 2
  36851. },
  36852. highThreshold: {
  36853. type: Number,
  36854. default: 4
  36855. },
  36856. max: {
  36857. type: Number,
  36858. default: 5
  36859. },
  36860. colors: {
  36861. type: definePropType([Array, Object]),
  36862. default: () => mutable([
  36863. "",
  36864. "",
  36865. ""
  36866. ])
  36867. },
  36868. voidColor: {
  36869. type: String,
  36870. default: ""
  36871. },
  36872. disabledVoidColor: {
  36873. type: String,
  36874. default: ""
  36875. },
  36876. icons: {
  36877. type: definePropType([Array, Object]),
  36878. default: () => [
  36879. star_filled_default,
  36880. star_filled_default,
  36881. star_filled_default
  36882. ]
  36883. },
  36884. voidIcon: {
  36885. type: iconPropType,
  36886. default: () => star_default
  36887. },
  36888. disabledVoidIcon: {
  36889. type: iconPropType,
  36890. default: () => star_filled_default
  36891. },
  36892. disabled: {
  36893. type: Boolean,
  36894. default: void 0
  36895. },
  36896. allowHalf: Boolean,
  36897. showText: Boolean,
  36898. showScore: Boolean,
  36899. textColor: {
  36900. type: String,
  36901. default: ""
  36902. },
  36903. texts: {
  36904. type: definePropType(Array),
  36905. default: () => mutable([
  36906. "Extremely bad",
  36907. "Disappointed",
  36908. "Fair",
  36909. "Satisfied",
  36910. "Surprise"
  36911. ])
  36912. },
  36913. scoreTemplate: {
  36914. type: String,
  36915. default: "{value}"
  36916. },
  36917. size: useSizeProp,
  36918. clearable: Boolean,
  36919. ...useAriaProps(["ariaLabel"])
  36920. });
  36921. const rateEmits = {
  36922. [CHANGE_EVENT]: (value) => isNumber(value),
  36923. [UPDATE_MODEL_EVENT]: (value) => isNumber(value)
  36924. };
  36925. //#endregion
  36926. //#region ../../packages/components/rate/src/rate.vue?vue&type=script&setup=true&lang.ts
  36927. const _hoisted_1$23 = [
  36928. "id",
  36929. "aria-label",
  36930. "aria-labelledby",
  36931. "aria-valuenow",
  36932. "aria-valuetext",
  36933. "aria-valuemax",
  36934. "tabindex",
  36935. "aria-disabled"
  36936. ];
  36937. const _hoisted_2$14 = ["onMousemove", "onClick"];
  36938. var rate_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  36939. name: "ElRate",
  36940. __name: "rate",
  36941. props: rateProps,
  36942. emits: rateEmits,
  36943. setup(__props, { expose: __expose, emit: __emit }) {
  36944. function getValueFromMap(value, map) {
  36945. const isExcludedObject = (val) => isObject$1(val);
  36946. const matchedValue = map[Object.keys(map).map((key) => +key).filter((key) => {
  36947. const val = map[key];
  36948. return (isExcludedObject(val) ? val.excluded : false) ? value < key : value <= key;
  36949. }).sort((a, b) => a - b)[0]];
  36950. return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
  36951. }
  36952. const props = __props;
  36953. const emit = __emit;
  36954. const formItemContext = (0, vue.inject)(formItemContextKey, void 0);
  36955. const rateSize = useFormSize();
  36956. const ns = useNamespace("rate");
  36957. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext });
  36958. const currentValue = (0, vue.ref)(clamp$1(props.modelValue, 0, props.max));
  36959. const hoverIndex = (0, vue.ref)(-1);
  36960. const pointerAtLeftHalf = (0, vue.ref)(true);
  36961. const iconRefs = (0, vue.ref)([]);
  36962. const iconClientWidths = (0, vue.computed)(() => iconRefs.value.map((icon) => icon.$el.clientWidth));
  36963. const rateClasses = (0, vue.computed)(() => [ns.b(), ns.m(rateSize.value)]);
  36964. const rateDisabled = useFormDisabled();
  36965. const rateStyles = (0, vue.computed)(() => {
  36966. return ns.cssVarBlock({
  36967. "void-color": props.voidColor,
  36968. "disabled-void-color": props.disabledVoidColor,
  36969. "fill-color": activeColor.value
  36970. });
  36971. });
  36972. const text = (0, vue.computed)(() => {
  36973. let result = "";
  36974. if (props.showScore) result = props.scoreTemplate.replace(/\{\s*value\s*\}/, rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`);
  36975. else if (props.showText) result = props.texts[Math.ceil(currentValue.value) - 1];
  36976. return result;
  36977. });
  36978. const valueDecimal = (0, vue.computed)(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
  36979. const colorMap = (0, vue.computed)(() => isArray$1(props.colors) ? {
  36980. [props.lowThreshold]: props.colors[0],
  36981. [props.highThreshold]: {
  36982. value: props.colors[1],
  36983. excluded: true
  36984. },
  36985. [props.max]: props.colors[2]
  36986. } : props.colors);
  36987. const activeColor = (0, vue.computed)(() => {
  36988. const color = getValueFromMap(currentValue.value, colorMap.value);
  36989. return isObject$1(color) ? "" : color;
  36990. });
  36991. const decimalStyle = (0, vue.computed)(() => {
  36992. let width = "";
  36993. if (rateDisabled.value) width = `${valueDecimal.value}%`;
  36994. else if (props.allowHalf) width = "50%";
  36995. return {
  36996. color: activeColor.value,
  36997. width
  36998. };
  36999. });
  37000. const componentMap = (0, vue.computed)(() => {
  37001. let icons = isArray$1(props.icons) ? [...props.icons] : { ...props.icons };
  37002. icons = (0, vue.markRaw)(icons);
  37003. return isArray$1(icons) ? {
  37004. [props.lowThreshold]: icons[0],
  37005. [props.highThreshold]: {
  37006. value: icons[1],
  37007. excluded: true
  37008. },
  37009. [props.max]: icons[2]
  37010. } : icons;
  37011. });
  37012. const decimalIconComponent = (0, vue.computed)(() => getValueFromMap(props.modelValue, componentMap.value));
  37013. const voidComponent = (0, vue.computed)(() => rateDisabled.value ? isString(props.disabledVoidIcon) ? props.disabledVoidIcon : (0, vue.markRaw)(props.disabledVoidIcon) : isString(props.voidIcon) ? props.voidIcon : (0, vue.markRaw)(props.voidIcon));
  37014. const activeComponent = (0, vue.computed)(() => getValueFromMap(currentValue.value, componentMap.value));
  37015. function showDecimalIcon(item) {
  37016. const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
  37017. const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - .5 <= currentValue.value && item > currentValue.value;
  37018. return showWhenDisabled || showWhenAllowHalf;
  37019. }
  37020. function emitValue(value) {
  37021. if (props.clearable && value === props.modelValue) value = 0;
  37022. emit(UPDATE_MODEL_EVENT, value);
  37023. if (props.modelValue !== value) emit(CHANGE_EVENT, value);
  37024. }
  37025. function selectValue(value) {
  37026. if (rateDisabled.value) return;
  37027. if (props.allowHalf && pointerAtLeftHalf.value) emitValue(currentValue.value);
  37028. else emitValue(value);
  37029. }
  37030. function handleKey(e) {
  37031. if (rateDisabled.value) return;
  37032. const code = getEventCode(e);
  37033. const step = props.allowHalf ? .5 : 1;
  37034. let _currentValue = currentValue.value;
  37035. switch (code) {
  37036. case EVENT_CODE.up:
  37037. case EVENT_CODE.right:
  37038. _currentValue += step;
  37039. break;
  37040. case EVENT_CODE.left:
  37041. case EVENT_CODE.down:
  37042. _currentValue -= step;
  37043. break;
  37044. }
  37045. _currentValue = clamp$1(_currentValue, 0, props.max);
  37046. if (_currentValue === currentValue.value) return;
  37047. e.stopPropagation();
  37048. e.preventDefault();
  37049. emit(UPDATE_MODEL_EVENT, _currentValue);
  37050. emit(CHANGE_EVENT, _currentValue);
  37051. return _currentValue;
  37052. }
  37053. function setCurrentValue(value, event) {
  37054. if (rateDisabled.value) return;
  37055. if (props.allowHalf && event) {
  37056. pointerAtLeftHalf.value = event.offsetX * 2 <= iconClientWidths.value[value - 1];
  37057. currentValue.value = pointerAtLeftHalf.value ? value - .5 : value;
  37058. } else currentValue.value = value;
  37059. hoverIndex.value = value;
  37060. }
  37061. function resetCurrentValue() {
  37062. if (rateDisabled.value) return;
  37063. if (props.allowHalf) pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  37064. currentValue.value = clamp$1(props.modelValue, 0, props.max);
  37065. hoverIndex.value = -1;
  37066. }
  37067. (0, vue.watch)(() => props.modelValue, (val) => {
  37068. currentValue.value = clamp$1(val, 0, props.max);
  37069. pointerAtLeftHalf.value = props.modelValue !== Math.floor(props.modelValue);
  37070. });
  37071. if (!props.modelValue) emit(UPDATE_MODEL_EVENT, 0);
  37072. __expose({
  37073. setCurrentValue,
  37074. resetCurrentValue
  37075. });
  37076. return (_ctx, _cache) => {
  37077. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  37078. id: (0, vue.unref)(inputId),
  37079. class: (0, vue.normalizeClass)([rateClasses.value, (0, vue.unref)(ns).is("disabled", (0, vue.unref)(rateDisabled))]),
  37080. role: "slider",
  37081. "aria-label": !(0, vue.unref)(isLabeledByFormItem) ? __props.ariaLabel || "rating" : void 0,
  37082. "aria-labelledby": (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(formItemContext)?.labelId : void 0,
  37083. "aria-valuenow": currentValue.value,
  37084. "aria-valuetext": text.value || void 0,
  37085. "aria-valuemin": "0",
  37086. "aria-valuemax": __props.max,
  37087. style: (0, vue.normalizeStyle)(rateStyles.value),
  37088. tabindex: (0, vue.unref)(rateDisabled) ? void 0 : 0,
  37089. "aria-disabled": (0, vue.unref)(rateDisabled),
  37090. onKeydown: handleKey
  37091. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.max, (item, key) => {
  37092. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  37093. key,
  37094. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item")),
  37095. onMousemove: ($event) => setCurrentValue(item, $event),
  37096. onMouseleave: resetCurrentValue,
  37097. onClick: ($event) => selectValue(item)
  37098. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), {
  37099. ref_for: true,
  37100. ref_key: "iconRefs",
  37101. ref: iconRefs,
  37102. class: (0, vue.normalizeClass)([
  37103. (0, vue.unref)(ns).e("icon"),
  37104. { hover: hoverIndex.value === item },
  37105. (0, vue.unref)(ns).is("active", item <= currentValue.value),
  37106. (0, vue.unref)(ns).is("focus-visible", item === Math.ceil(currentValue.value || 1))
  37107. ])
  37108. }, {
  37109. default: (0, vue.withCtx)(() => [
  37110. (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(activeComponent.value), null, null, 512)), [[vue.vShow, !showDecimalIcon(item) && item <= currentValue.value]]),
  37111. (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(voidComponent.value), null, null, 512)), [[vue.vShow, !showDecimalIcon(item) && item > currentValue.value]]),
  37112. (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(voidComponent.value), { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).em("decimal", "box")]) }, null, 8, ["class"])), [[vue.vShow, showDecimalIcon(item)]]),
  37113. (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElIcon), {
  37114. style: (0, vue.normalizeStyle)(decimalStyle.value),
  37115. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), (0, vue.unref)(ns).e("decimal")])
  37116. }, {
  37117. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(decimalIconComponent.value)))]),
  37118. _: 1
  37119. }, 8, ["style", "class"]), [[vue.vShow, showDecimalIcon(item)]])
  37120. ]),
  37121. _: 2
  37122. }, 1032, ["class"])], 42, _hoisted_2$14);
  37123. }), 128)), __props.showText || __props.showScore ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  37124. key: 0,
  37125. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("text")),
  37126. style: (0, vue.normalizeStyle)({ color: __props.textColor })
  37127. }, (0, vue.toDisplayString)(text.value), 7)) : (0, vue.createCommentVNode)("v-if", true)], 46, _hoisted_1$23);
  37128. };
  37129. }
  37130. });
  37131. //#endregion
  37132. //#region ../../packages/components/rate/src/rate.vue
  37133. var rate_default = rate_vue_vue_type_script_setup_true_lang_default;
  37134. //#endregion
  37135. //#region ../../packages/components/rate/index.ts
  37136. const ElRate = withInstall(rate_default);
  37137. //#endregion
  37138. //#region ../../packages/components/result/src/result.ts
  37139. const IconMap = {
  37140. primary: "icon-primary",
  37141. success: "icon-success",
  37142. warning: "icon-warning",
  37143. error: "icon-error",
  37144. info: "icon-info"
  37145. };
  37146. const IconComponentMap = {
  37147. [IconMap.primary]: info_filled_default,
  37148. [IconMap.success]: circle_check_filled_default,
  37149. [IconMap.warning]: warning_filled_default,
  37150. [IconMap.error]: circle_close_filled_default,
  37151. [IconMap.info]: info_filled_default
  37152. };
  37153. /**
  37154. * @deprecated Removed after 3.0.0, Use `ResultProps` instead.
  37155. */
  37156. const resultProps = buildProps({
  37157. title: {
  37158. type: String,
  37159. default: ""
  37160. },
  37161. subTitle: {
  37162. type: String,
  37163. default: ""
  37164. },
  37165. icon: {
  37166. type: String,
  37167. values: [
  37168. "primary",
  37169. "success",
  37170. "warning",
  37171. "info",
  37172. "error"
  37173. ],
  37174. default: "info"
  37175. }
  37176. });
  37177. //#endregion
  37178. //#region ../../packages/components/result/src/result.vue?vue&type=script&setup=true&lang.ts
  37179. var result_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  37180. name: "ElResult",
  37181. __name: "result",
  37182. props: resultProps,
  37183. setup(__props) {
  37184. const props = __props;
  37185. const ns = useNamespace("result");
  37186. const resultIcon = (0, vue.computed)(() => {
  37187. const icon = props.icon;
  37188. const iconClass = icon && IconMap[icon] ? IconMap[icon] : "icon-info";
  37189. return {
  37190. class: iconClass,
  37191. component: IconComponentMap[iconClass] || IconComponentMap["icon-info"]
  37192. };
  37193. });
  37194. return (_ctx, _cache) => {
  37195. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [
  37196. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon")) }, [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [resultIcon.value.component ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(resultIcon.value.component), {
  37197. key: 0,
  37198. class: (0, vue.normalizeClass)(resultIcon.value.class)
  37199. }, null, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)])], 2),
  37200. __props.title || _ctx.$slots.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  37201. key: 0,
  37202. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title"))
  37203. }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createElementVNode)("p", null, (0, vue.toDisplayString)(__props.title), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  37204. __props.subTitle || _ctx.$slots["sub-title"] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  37205. key: 1,
  37206. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("subtitle"))
  37207. }, [(0, vue.renderSlot)(_ctx.$slots, "sub-title", {}, () => [(0, vue.createElementVNode)("p", null, (0, vue.toDisplayString)(__props.subTitle), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  37208. _ctx.$slots.extra ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  37209. key: 2,
  37210. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("extra"))
  37211. }, [(0, vue.renderSlot)(_ctx.$slots, "extra")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  37212. ], 2);
  37213. };
  37214. }
  37215. });
  37216. //#endregion
  37217. //#region ../../packages/components/result/src/result.vue
  37218. var result_default = result_vue_vue_type_script_setup_true_lang_default;
  37219. //#endregion
  37220. //#region ../../packages/components/result/index.ts
  37221. const ElResult = withInstall(result_default);
  37222. //#endregion
  37223. //#region ../../node_modules/.pnpm/memoize-one@6.0.0/node_modules/memoize-one/dist/memoize-one.esm.js
  37224. var safeIsNaN = Number.isNaN || function ponyfill(value) {
  37225. return typeof value === "number" && value !== value;
  37226. };
  37227. function isEqual(first, second) {
  37228. if (first === second) return true;
  37229. if (safeIsNaN(first) && safeIsNaN(second)) return true;
  37230. return false;
  37231. }
  37232. function areInputsEqual(newInputs, lastInputs) {
  37233. if (newInputs.length !== lastInputs.length) return false;
  37234. for (var i = 0; i < newInputs.length; i++) if (!isEqual(newInputs[i], lastInputs[i])) return false;
  37235. return true;
  37236. }
  37237. function memoizeOne(resultFn, isEqual) {
  37238. if (isEqual === void 0) isEqual = areInputsEqual;
  37239. var cache = null;
  37240. function memoized() {
  37241. var newArgs = [];
  37242. for (var _i = 0; _i < arguments.length; _i++) newArgs[_i] = arguments[_i];
  37243. if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) return cache.lastResult;
  37244. var lastResult = resultFn.apply(this, newArgs);
  37245. cache = {
  37246. lastResult,
  37247. lastArgs: newArgs,
  37248. lastThis: this
  37249. };
  37250. return lastResult;
  37251. }
  37252. memoized.clear = function clear() {
  37253. cache = null;
  37254. };
  37255. return memoized;
  37256. }
  37257. //#endregion
  37258. //#region ../../packages/components/virtual-list/src/hooks/use-cache.ts
  37259. const useCache = () => {
  37260. const props = (0, vue.getCurrentInstance)().proxy.$props;
  37261. return (0, vue.computed)(() => {
  37262. const _getItemStyleCache = (_, __, ___) => ({});
  37263. return props.perfMode ? memoize(_getItemStyleCache) : memoizeOne(_getItemStyleCache);
  37264. });
  37265. };
  37266. //#endregion
  37267. //#region ../../packages/components/virtual-list/src/defaults.ts
  37268. const DEFAULT_DYNAMIC_LIST_ITEM_SIZE = 50;
  37269. const ITEM_RENDER_EVT = "itemRendered";
  37270. const SCROLL_EVT = "scroll";
  37271. const FORWARD = "forward";
  37272. const BACKWARD = "backward";
  37273. const AUTO_ALIGNMENT = "auto";
  37274. const SMART_ALIGNMENT = "smart";
  37275. const START_ALIGNMENT = "start";
  37276. const CENTERED_ALIGNMENT = "center";
  37277. const END_ALIGNMENT = "end";
  37278. const HORIZONTAL = "horizontal";
  37279. const VERTICAL = "vertical";
  37280. const LTR = "ltr";
  37281. const RTL = "rtl";
  37282. const RTL_OFFSET_NAG = "negative";
  37283. const RTL_OFFSET_POS_ASC = "positive-ascending";
  37284. const RTL_OFFSET_POS_DESC = "positive-descending";
  37285. const ScrollbarSizeKey = {
  37286. [HORIZONTAL]: "height",
  37287. [VERTICAL]: "width"
  37288. };
  37289. const ScrollbarDirKey = {
  37290. [HORIZONTAL]: "left",
  37291. [VERTICAL]: "top"
  37292. };
  37293. const SCROLLBAR_MIN_SIZE = 20;
  37294. //#endregion
  37295. //#region ../../packages/components/virtual-list/src/hooks/use-wheel.ts
  37296. const useWheel = ({ atEndEdge, atStartEdge, layout }, onWheelDelta) => {
  37297. let frameHandle;
  37298. let offset = 0;
  37299. const hasReachedEdge = (offset) => {
  37300. return offset < 0 && atStartEdge.value || offset > 0 && atEndEdge.value;
  37301. };
  37302. const onWheel = (e) => {
  37303. cAF(frameHandle);
  37304. let { deltaX, deltaY } = e;
  37305. if (e.shiftKey && deltaY !== 0) {
  37306. deltaX = deltaY;
  37307. deltaY = 0;
  37308. }
  37309. const newOffset = layout.value === HORIZONTAL ? deltaX : deltaY;
  37310. if (hasReachedEdge(newOffset)) return;
  37311. offset += newOffset;
  37312. if (!isFirefox() && newOffset !== 0) e.preventDefault();
  37313. frameHandle = rAF(() => {
  37314. onWheelDelta(offset);
  37315. offset = 0;
  37316. });
  37317. };
  37318. return {
  37319. hasReachedEdge,
  37320. onWheel
  37321. };
  37322. };
  37323. //#endregion
  37324. //#region ../../packages/components/virtual-list/src/props.ts
  37325. const itemSize$1 = buildProp({
  37326. type: definePropType([Number, Function]),
  37327. required: true
  37328. });
  37329. const estimatedItemSize = buildProp({ type: Number });
  37330. const cache = buildProp({
  37331. type: Number,
  37332. default: 2
  37333. });
  37334. const direction = buildProp({
  37335. type: String,
  37336. values: ["ltr", "rtl"],
  37337. default: "ltr"
  37338. });
  37339. const initScrollOffset = buildProp({
  37340. type: Number,
  37341. default: 0
  37342. });
  37343. const total = buildProp({
  37344. type: Number,
  37345. required: true
  37346. });
  37347. const layout = buildProp({
  37348. type: String,
  37349. values: ["horizontal", "vertical"],
  37350. default: VERTICAL
  37351. });
  37352. const virtualizedProps = buildProps({
  37353. className: {
  37354. type: String,
  37355. default: ""
  37356. },
  37357. containerElement: {
  37358. type: definePropType([String, Object]),
  37359. default: "div"
  37360. },
  37361. data: {
  37362. type: definePropType(Array),
  37363. default: () => mutable([])
  37364. },
  37365. direction,
  37366. height: {
  37367. type: [String, Number],
  37368. required: true
  37369. },
  37370. innerElement: {
  37371. type: [String, Object],
  37372. default: "div"
  37373. },
  37374. innerProps: {
  37375. type: definePropType(Object),
  37376. default: () => ({})
  37377. },
  37378. style: { type: definePropType([
  37379. Object,
  37380. String,
  37381. Array
  37382. ]) },
  37383. useIsScrolling: Boolean,
  37384. width: {
  37385. type: [Number, String],
  37386. required: false
  37387. },
  37388. perfMode: {
  37389. type: Boolean,
  37390. default: true
  37391. },
  37392. scrollbarAlwaysOn: Boolean
  37393. });
  37394. const virtualizedListProps = buildProps({
  37395. cache,
  37396. estimatedItemSize,
  37397. layout,
  37398. initScrollOffset,
  37399. total,
  37400. itemSize: itemSize$1,
  37401. ...virtualizedProps
  37402. });
  37403. const scrollbarSize = {
  37404. type: Number,
  37405. default: 6
  37406. };
  37407. const startGap = {
  37408. type: Number,
  37409. default: 0
  37410. };
  37411. const endGap = {
  37412. type: Number,
  37413. default: 2
  37414. };
  37415. const virtualizedGridProps = buildProps({
  37416. columnCache: cache,
  37417. columnWidth: itemSize$1,
  37418. estimatedColumnWidth: estimatedItemSize,
  37419. estimatedRowHeight: estimatedItemSize,
  37420. initScrollLeft: initScrollOffset,
  37421. initScrollTop: initScrollOffset,
  37422. itemKey: {
  37423. type: definePropType(Function),
  37424. default: ({ columnIndex, rowIndex }) => `${rowIndex}:${columnIndex}`
  37425. },
  37426. rowCache: cache,
  37427. rowHeight: itemSize$1,
  37428. totalColumn: total,
  37429. totalRow: total,
  37430. hScrollbarSize: scrollbarSize,
  37431. vScrollbarSize: scrollbarSize,
  37432. scrollbarStartGap: startGap,
  37433. scrollbarEndGap: endGap,
  37434. role: String,
  37435. ...virtualizedProps
  37436. });
  37437. const virtualizedScrollbarProps = buildProps({
  37438. alwaysOn: Boolean,
  37439. class: String,
  37440. layout,
  37441. total,
  37442. ratio: {
  37443. type: Number,
  37444. required: true
  37445. },
  37446. clientSize: {
  37447. type: Number,
  37448. required: true
  37449. },
  37450. scrollFrom: {
  37451. type: Number,
  37452. required: true
  37453. },
  37454. scrollbarSize,
  37455. startGap,
  37456. endGap,
  37457. visible: Boolean
  37458. });
  37459. //#endregion
  37460. //#region ../../packages/components/virtual-list/src/utils.ts
  37461. const getScrollDir = (prev, cur) => prev < cur ? FORWARD : BACKWARD;
  37462. const isHorizontal = (dir) => dir === LTR || dir === RTL || dir === HORIZONTAL;
  37463. const isRTL = (dir) => dir === RTL;
  37464. let cachedRTLResult = null;
  37465. function getRTLOffsetType(recalculate = false) {
  37466. if (cachedRTLResult === null || recalculate) {
  37467. const outerDiv = document.createElement("div");
  37468. const outerStyle = outerDiv.style;
  37469. outerStyle.width = "50px";
  37470. outerStyle.height = "50px";
  37471. outerStyle.overflow = "scroll";
  37472. outerStyle.direction = "rtl";
  37473. const innerDiv = document.createElement("div");
  37474. const innerStyle = innerDiv.style;
  37475. innerStyle.width = "100px";
  37476. innerStyle.height = "100px";
  37477. outerDiv.appendChild(innerDiv);
  37478. document.body.appendChild(outerDiv);
  37479. if (outerDiv.scrollLeft > 0) cachedRTLResult = RTL_OFFSET_POS_DESC;
  37480. else {
  37481. outerDiv.scrollLeft = 1;
  37482. if (outerDiv.scrollLeft === 0) cachedRTLResult = RTL_OFFSET_NAG;
  37483. else cachedRTLResult = RTL_OFFSET_POS_ASC;
  37484. }
  37485. document.body.removeChild(outerDiv);
  37486. return cachedRTLResult;
  37487. }
  37488. return cachedRTLResult;
  37489. }
  37490. function renderThumbStyle$1({ move, size, bar }, layout) {
  37491. const style = {};
  37492. const translate = `translate${bar.axis}(${move}px)`;
  37493. style[bar.size] = size;
  37494. style.transform = translate;
  37495. if (layout === "horizontal") style.height = "100%";
  37496. else style.width = "100%";
  37497. return style;
  37498. }
  37499. //#endregion
  37500. //#region ../../packages/components/virtual-list/src/components/scrollbar.ts
  37501. const ScrollBar = (0, vue.defineComponent)({
  37502. name: "ElVirtualScrollBar",
  37503. props: virtualizedScrollbarProps,
  37504. emits: [
  37505. "scroll",
  37506. "start-move",
  37507. "stop-move"
  37508. ],
  37509. setup(props, { emit }) {
  37510. const GAP = (0, vue.computed)(() => props.startGap + props.endGap);
  37511. const nsVirtualScrollbar = useNamespace("virtual-scrollbar");
  37512. const nsScrollbar = useNamespace("scrollbar");
  37513. const trackRef = (0, vue.ref)();
  37514. const thumbRef = (0, vue.ref)();
  37515. let frameHandle = null;
  37516. let onselectstartStore = null;
  37517. const state = (0, vue.reactive)({
  37518. isDragging: false,
  37519. traveled: 0
  37520. });
  37521. const bar = (0, vue.computed)(() => BAR_MAP[props.layout]);
  37522. const trackSize = (0, vue.computed)(() => props.clientSize - (0, vue.unref)(GAP));
  37523. const trackStyle = (0, vue.computed)(() => ({
  37524. position: "absolute",
  37525. width: `${HORIZONTAL === props.layout ? trackSize.value : props.scrollbarSize}px`,
  37526. height: `${HORIZONTAL === props.layout ? props.scrollbarSize : trackSize.value}px`,
  37527. [ScrollbarDirKey[props.layout]]: "2px",
  37528. right: "2px",
  37529. bottom: "2px",
  37530. borderRadius: "4px"
  37531. }));
  37532. const thumbSize = (0, vue.computed)(() => {
  37533. const ratio = props.ratio;
  37534. if (ratio >= 100) return Number.POSITIVE_INFINITY;
  37535. if (ratio >= 50) return ratio * trackSize.value / 100;
  37536. const SCROLLBAR_MAX_SIZE = trackSize.value / 3;
  37537. return Math.floor(Math.min(Math.max(ratio * trackSize.value / 100, SCROLLBAR_MIN_SIZE), SCROLLBAR_MAX_SIZE));
  37538. });
  37539. const thumbStyle = (0, vue.computed)(() => {
  37540. if (!Number.isFinite(thumbSize.value)) return { display: "none" };
  37541. const thumb = `${thumbSize.value}px`;
  37542. return renderThumbStyle$1({
  37543. bar: bar.value,
  37544. size: thumb,
  37545. move: state.traveled
  37546. }, props.layout);
  37547. });
  37548. const totalSteps = (0, vue.computed)(() => Math.ceil(props.clientSize - thumbSize.value - (0, vue.unref)(GAP)));
  37549. const attachEvents = () => {
  37550. window.addEventListener("mousemove", onMouseMove);
  37551. window.addEventListener("mouseup", onMouseUp);
  37552. const thumbEl = (0, vue.unref)(thumbRef);
  37553. if (!thumbEl) return;
  37554. onselectstartStore = document.onselectstart;
  37555. document.onselectstart = () => false;
  37556. thumbEl.addEventListener("touchmove", onMouseMove, { passive: true });
  37557. thumbEl.addEventListener("touchend", onMouseUp);
  37558. };
  37559. const detachEvents = () => {
  37560. window.removeEventListener("mousemove", onMouseMove);
  37561. window.removeEventListener("mouseup", onMouseUp);
  37562. document.onselectstart = onselectstartStore;
  37563. onselectstartStore = null;
  37564. const thumbEl = (0, vue.unref)(thumbRef);
  37565. if (!thumbEl) return;
  37566. thumbEl.removeEventListener("touchmove", onMouseMove);
  37567. thumbEl.removeEventListener("touchend", onMouseUp);
  37568. };
  37569. const onThumbMouseDown = (e) => {
  37570. e.stopImmediatePropagation();
  37571. if (e.ctrlKey || [1, 2].includes(e.button)) return;
  37572. state.isDragging = true;
  37573. state[bar.value.axis] = e.currentTarget[bar.value.offset] - (e[bar.value.client] - e.currentTarget.getBoundingClientRect()[bar.value.direction]);
  37574. emit("start-move");
  37575. attachEvents();
  37576. };
  37577. const onMouseUp = () => {
  37578. state.isDragging = false;
  37579. state[bar.value.axis] = 0;
  37580. emit("stop-move");
  37581. detachEvents();
  37582. };
  37583. const onMouseMove = (e) => {
  37584. const { isDragging } = state;
  37585. if (!isDragging) return;
  37586. if (!thumbRef.value || !trackRef.value) return;
  37587. const prevPage = state[bar.value.axis];
  37588. if (!prevPage) return;
  37589. cAF(frameHandle);
  37590. /**
  37591. * +--------------+ +--------------+
  37592. * | - <--------- thumb.offsetTop | |
  37593. * | |+| <--+ | |
  37594. * | - | | |
  37595. * | Content | | | |
  37596. * | | | | |
  37597. * | | | | |
  37598. * | | | | -
  37599. * | | +--> | |+|
  37600. * | | | -
  37601. * +--------------+ +--------------+
  37602. */
  37603. const distance = (trackRef.value.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) * -1 - (thumbRef.value[bar.value.offset] - prevPage);
  37604. frameHandle = rAF(() => {
  37605. state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
  37606. emit("scroll", distance, totalSteps.value);
  37607. });
  37608. };
  37609. const clickTrackHandler = (e) => {
  37610. const distance = Math.abs(e.target.getBoundingClientRect()[bar.value.direction] - e[bar.value.client]) - thumbRef.value[bar.value.offset] / 2;
  37611. state.traveled = Math.max(0, Math.min(distance, totalSteps.value));
  37612. emit("scroll", distance, totalSteps.value);
  37613. };
  37614. (0, vue.watch)(() => props.scrollFrom, (v) => {
  37615. if (state.isDragging) return;
  37616. /**
  37617. * this is simply mapping the current scrollbar offset
  37618. *
  37619. * formula 1:
  37620. * v = scrollOffset / (estimatedTotalSize - clientSize)
  37621. * traveled = v * (clientSize - thumbSize - GAP) --> v * totalSteps
  37622. *
  37623. * formula 2:
  37624. * traveled = (v * clientSize) / (clientSize / totalSteps) --> (v * clientSize) * (totalSteps / clientSize) --> v * totalSteps
  37625. */
  37626. state.traveled = Math.ceil(v * totalSteps.value);
  37627. });
  37628. (0, vue.onBeforeUnmount)(() => {
  37629. detachEvents();
  37630. });
  37631. return () => {
  37632. return (0, vue.h)("div", {
  37633. role: "presentation",
  37634. ref: trackRef,
  37635. class: [
  37636. nsVirtualScrollbar.b(),
  37637. props.class,
  37638. (props.alwaysOn || state.isDragging) && "always-on"
  37639. ],
  37640. style: trackStyle.value,
  37641. onMousedown: (0, vue.withModifiers)(clickTrackHandler, ["stop", "prevent"]),
  37642. onTouchstartPrevent: onThumbMouseDown
  37643. }, (0, vue.h)("div", {
  37644. ref: thumbRef,
  37645. class: nsScrollbar.e("thumb"),
  37646. style: thumbStyle.value,
  37647. onMousedown: onThumbMouseDown
  37648. }, []));
  37649. };
  37650. }
  37651. });
  37652. //#endregion
  37653. //#region ../../packages/components/virtual-list/src/builders/build-list.ts
  37654. const createList = ({ name, getOffset, getItemSize, getItemOffset, getEstimatedTotalSize, getStartIndexForOffset, getStopIndexForStartIndex, initCache, clearCache, validateProps }) => {
  37655. return (0, vue.defineComponent)({
  37656. name: name ?? "ElVirtualList",
  37657. props: virtualizedListProps,
  37658. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  37659. setup(props, { emit, expose }) {
  37660. validateProps(props);
  37661. const instance = (0, vue.getCurrentInstance)();
  37662. const ns = useNamespace("vl");
  37663. const dynamicSizeCache = (0, vue.ref)(initCache(props, instance));
  37664. const getItemStyleCache = useCache();
  37665. const windowRef = (0, vue.ref)();
  37666. const innerRef = (0, vue.ref)();
  37667. const scrollbarRef = (0, vue.ref)();
  37668. const states = (0, vue.ref)({
  37669. isScrolling: false,
  37670. scrollDir: "forward",
  37671. scrollOffset: isNumber(props.initScrollOffset) ? props.initScrollOffset : 0,
  37672. updateRequested: false,
  37673. isScrollbarDragging: false,
  37674. scrollbarAlwaysOn: props.scrollbarAlwaysOn
  37675. });
  37676. const itemsToRender = (0, vue.computed)(() => {
  37677. const { total, cache } = props;
  37678. const { isScrolling, scrollDir, scrollOffset } = (0, vue.unref)(states);
  37679. if (total === 0) return [
  37680. 0,
  37681. 0,
  37682. 0,
  37683. 0
  37684. ];
  37685. const startIndex = getStartIndexForOffset(props, scrollOffset, (0, vue.unref)(dynamicSizeCache));
  37686. const stopIndex = getStopIndexForStartIndex(props, startIndex, scrollOffset, (0, vue.unref)(dynamicSizeCache));
  37687. const cacheBackward = !isScrolling || scrollDir === BACKWARD ? Math.max(1, cache) : 1;
  37688. const cacheForward = !isScrolling || scrollDir === FORWARD ? Math.max(1, cache) : 1;
  37689. return [
  37690. Math.max(0, startIndex - cacheBackward),
  37691. Math.max(0, Math.min(total - 1, stopIndex + cacheForward)),
  37692. startIndex,
  37693. stopIndex
  37694. ];
  37695. });
  37696. const estimatedTotalSize = (0, vue.computed)(() => getEstimatedTotalSize(props, (0, vue.unref)(dynamicSizeCache)));
  37697. const _isHorizontal = (0, vue.computed)(() => isHorizontal(props.layout));
  37698. const windowStyle = (0, vue.computed)(() => [
  37699. {
  37700. position: "relative",
  37701. [`overflow-${_isHorizontal.value ? "x" : "y"}`]: "scroll",
  37702. WebkitOverflowScrolling: "touch",
  37703. willChange: "transform"
  37704. },
  37705. {
  37706. direction: props.direction,
  37707. height: isNumber(props.height) ? `${props.height}px` : props.height,
  37708. width: isNumber(props.width) ? `${props.width}px` : props.width
  37709. },
  37710. props.style
  37711. ]);
  37712. const innerStyle = (0, vue.computed)(() => {
  37713. const size = (0, vue.unref)(estimatedTotalSize);
  37714. const horizontal = (0, vue.unref)(_isHorizontal);
  37715. return {
  37716. height: horizontal ? "100%" : `${size}px`,
  37717. pointerEvents: (0, vue.unref)(states).isScrolling ? "none" : void 0,
  37718. width: horizontal ? `${size}px` : "100%",
  37719. margin: 0,
  37720. boxSizing: "border-box"
  37721. };
  37722. });
  37723. const clientSize = (0, vue.computed)(() => _isHorizontal.value ? props.width : props.height);
  37724. const { onWheel } = useWheel({
  37725. atStartEdge: (0, vue.computed)(() => states.value.scrollOffset <= 0),
  37726. atEndEdge: (0, vue.computed)(() => states.value.scrollOffset >= estimatedTotalSize.value),
  37727. layout: (0, vue.computed)(() => props.layout)
  37728. }, (offset) => {
  37729. scrollbarRef.value.onMouseUp?.();
  37730. scrollTo(Math.min(states.value.scrollOffset + offset, estimatedTotalSize.value - clientSize.value));
  37731. });
  37732. useEventListener(windowRef, "wheel", onWheel, { passive: false });
  37733. const emitEvents = () => {
  37734. const { total } = props;
  37735. if (total > 0) {
  37736. const [cacheStart, cacheEnd, visibleStart, visibleEnd] = (0, vue.unref)(itemsToRender);
  37737. emit(ITEM_RENDER_EVT, cacheStart, cacheEnd, visibleStart, visibleEnd);
  37738. }
  37739. const { scrollDir, scrollOffset, updateRequested } = (0, vue.unref)(states);
  37740. emit(SCROLL_EVT, scrollDir, scrollOffset, updateRequested);
  37741. };
  37742. const scrollVertically = (e) => {
  37743. const { clientHeight, scrollHeight, scrollTop } = e.currentTarget;
  37744. const _states = (0, vue.unref)(states);
  37745. if (_states.scrollOffset === scrollTop) return;
  37746. const scrollOffset = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
  37747. states.value = {
  37748. ..._states,
  37749. isScrolling: true,
  37750. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  37751. scrollOffset,
  37752. updateRequested: false
  37753. };
  37754. (0, vue.nextTick)(resetIsScrolling);
  37755. };
  37756. const scrollHorizontally = (e) => {
  37757. const { clientWidth, scrollLeft, scrollWidth } = e.currentTarget;
  37758. const _states = (0, vue.unref)(states);
  37759. if (_states.scrollOffset === scrollLeft) return;
  37760. const { direction } = props;
  37761. let scrollOffset = scrollLeft;
  37762. if (direction === RTL) switch (getRTLOffsetType()) {
  37763. case RTL_OFFSET_NAG:
  37764. scrollOffset = -scrollLeft;
  37765. break;
  37766. case RTL_OFFSET_POS_DESC:
  37767. scrollOffset = scrollWidth - clientWidth - scrollLeft;
  37768. break;
  37769. }
  37770. scrollOffset = Math.max(0, Math.min(scrollOffset, scrollWidth - clientWidth));
  37771. states.value = {
  37772. ..._states,
  37773. isScrolling: true,
  37774. scrollDir: getScrollDir(_states.scrollOffset, scrollOffset),
  37775. scrollOffset,
  37776. updateRequested: false
  37777. };
  37778. (0, vue.nextTick)(resetIsScrolling);
  37779. };
  37780. const onScroll = (e) => {
  37781. (0, vue.unref)(_isHorizontal) ? scrollHorizontally(e) : scrollVertically(e);
  37782. emitEvents();
  37783. };
  37784. const onScrollbarScroll = (distanceToGo, totalSteps) => {
  37785. const offset = (estimatedTotalSize.value - clientSize.value) / totalSteps * distanceToGo;
  37786. scrollTo(Math.min(estimatedTotalSize.value - clientSize.value, offset));
  37787. };
  37788. const scrollTo = (offset) => {
  37789. offset = Math.max(offset, 0);
  37790. if (offset === (0, vue.unref)(states).scrollOffset) return;
  37791. states.value = {
  37792. ...(0, vue.unref)(states),
  37793. scrollOffset: offset,
  37794. scrollDir: getScrollDir((0, vue.unref)(states).scrollOffset, offset),
  37795. updateRequested: true
  37796. };
  37797. (0, vue.nextTick)(resetIsScrolling);
  37798. };
  37799. const scrollToItem = (idx, alignment = AUTO_ALIGNMENT) => {
  37800. const { scrollOffset } = (0, vue.unref)(states);
  37801. idx = Math.max(0, Math.min(idx, props.total - 1));
  37802. scrollTo(getOffset(props, idx, alignment, scrollOffset, (0, vue.unref)(dynamicSizeCache)));
  37803. };
  37804. const getItemStyle = (idx) => {
  37805. const { direction, itemSize, layout } = props;
  37806. const itemStyleCache = getItemStyleCache.value(clearCache && itemSize, clearCache && layout, clearCache && direction);
  37807. let style;
  37808. if (hasOwn(itemStyleCache, String(idx))) style = itemStyleCache[idx];
  37809. else {
  37810. const offset = getItemOffset(props, idx, (0, vue.unref)(dynamicSizeCache));
  37811. const size = getItemSize(props, idx, (0, vue.unref)(dynamicSizeCache));
  37812. const horizontal = (0, vue.unref)(_isHorizontal);
  37813. const isRtl = direction === RTL;
  37814. const offsetHorizontal = horizontal ? offset : 0;
  37815. itemStyleCache[idx] = style = {
  37816. position: "absolute",
  37817. left: isRtl ? void 0 : `${offsetHorizontal}px`,
  37818. right: isRtl ? `${offsetHorizontal}px` : void 0,
  37819. top: !horizontal ? `${offset}px` : 0,
  37820. height: !horizontal ? `${size}px` : "100%",
  37821. width: horizontal ? `${size}px` : "100%"
  37822. };
  37823. }
  37824. return style;
  37825. };
  37826. const resetIsScrolling = () => {
  37827. states.value.isScrolling = false;
  37828. (0, vue.nextTick)(() => {
  37829. getItemStyleCache.value(-1, null, null);
  37830. });
  37831. };
  37832. const resetScrollTop = () => {
  37833. const window = windowRef.value;
  37834. if (window) window.scrollTop = 0;
  37835. };
  37836. (0, vue.onMounted)(() => {
  37837. if (!isClient) return;
  37838. const { initScrollOffset } = props;
  37839. const windowElement = (0, vue.unref)(windowRef);
  37840. if (isNumber(initScrollOffset) && windowElement) if ((0, vue.unref)(_isHorizontal)) windowElement.scrollLeft = initScrollOffset;
  37841. else windowElement.scrollTop = initScrollOffset;
  37842. emitEvents();
  37843. });
  37844. (0, vue.onUpdated)(() => {
  37845. const { direction, layout } = props;
  37846. const { scrollOffset, updateRequested } = (0, vue.unref)(states);
  37847. const windowElement = (0, vue.unref)(windowRef);
  37848. if (updateRequested && windowElement) if (layout === HORIZONTAL) if (direction === RTL) switch (getRTLOffsetType()) {
  37849. case RTL_OFFSET_NAG:
  37850. windowElement.scrollLeft = -scrollOffset;
  37851. break;
  37852. case RTL_OFFSET_POS_ASC:
  37853. windowElement.scrollLeft = scrollOffset;
  37854. break;
  37855. default: {
  37856. const { clientWidth, scrollWidth } = windowElement;
  37857. windowElement.scrollLeft = scrollWidth - clientWidth - scrollOffset;
  37858. break;
  37859. }
  37860. }
  37861. else windowElement.scrollLeft = scrollOffset;
  37862. else windowElement.scrollTop = scrollOffset;
  37863. });
  37864. (0, vue.onActivated)(() => {
  37865. (0, vue.unref)(windowRef).scrollTop = (0, vue.unref)(states).scrollOffset;
  37866. });
  37867. const api = {
  37868. ns,
  37869. clientSize,
  37870. estimatedTotalSize,
  37871. windowStyle,
  37872. windowRef,
  37873. innerRef,
  37874. innerStyle,
  37875. itemsToRender,
  37876. scrollbarRef,
  37877. states,
  37878. getItemStyle,
  37879. onScroll,
  37880. onScrollbarScroll,
  37881. onWheel,
  37882. scrollTo,
  37883. scrollToItem,
  37884. resetScrollTop
  37885. };
  37886. expose({
  37887. windowRef,
  37888. innerRef,
  37889. getItemStyleCache,
  37890. scrollTo,
  37891. scrollToItem,
  37892. resetScrollTop,
  37893. states
  37894. });
  37895. return api;
  37896. },
  37897. render(ctx) {
  37898. const { $slots, className, clientSize, containerElement, data, getItemStyle, innerElement, itemsToRender, innerStyle, layout, total, onScroll, onScrollbarScroll, states, useIsScrolling, windowStyle, ns } = ctx;
  37899. const [start, end] = itemsToRender;
  37900. const Container = (0, vue.resolveDynamicComponent)(containerElement);
  37901. const Inner = (0, vue.resolveDynamicComponent)(innerElement);
  37902. const children = [];
  37903. if (total > 0) for (let i = start; i <= end; i++) children.push((0, vue.h)(vue.Fragment, { key: i }, $slots.default?.({
  37904. data,
  37905. index: i,
  37906. isScrolling: useIsScrolling ? states.isScrolling : void 0,
  37907. style: getItemStyle(i)
  37908. })));
  37909. const InnerNode = [(0, vue.h)(Inner, (0, vue.mergeProps)(ctx.innerProps, {
  37910. style: innerStyle,
  37911. ref: "innerRef"
  37912. }), !isString(Inner) ? { default: () => children } : children)];
  37913. const scrollbar = (0, vue.h)(ScrollBar, {
  37914. ref: "scrollbarRef",
  37915. clientSize,
  37916. layout,
  37917. onScroll: onScrollbarScroll,
  37918. ratio: clientSize * 100 / this.estimatedTotalSize,
  37919. scrollFrom: states.scrollOffset / (this.estimatedTotalSize - clientSize),
  37920. total,
  37921. alwaysOn: states.scrollbarAlwaysOn
  37922. });
  37923. const listContainer = (0, vue.h)(Container, {
  37924. class: [ns.e("window"), className],
  37925. style: windowStyle,
  37926. onScroll,
  37927. ref: "windowRef",
  37928. key: 0
  37929. }, !isString(Container) ? { default: () => [InnerNode] } : [InnerNode]);
  37930. return (0, vue.h)("div", {
  37931. key: 0,
  37932. class: [ns.e("wrapper"), states.scrollbarAlwaysOn ? "always-on" : ""]
  37933. }, [listContainer, scrollbar]);
  37934. }
  37935. });
  37936. };
  37937. //#endregion
  37938. //#region ../../packages/components/virtual-list/src/components/fixed-size-list.ts
  37939. const FixedSizeList = createList({
  37940. name: "ElFixedSizeList",
  37941. getItemOffset: ({ itemSize }, index) => index * itemSize,
  37942. getItemSize: ({ itemSize }) => itemSize,
  37943. getEstimatedTotalSize: ({ total, itemSize }) => itemSize * total,
  37944. getOffset: ({ height, total, itemSize, layout, width }, index, alignment, scrollOffset) => {
  37945. const size = isHorizontal(layout) ? width : height;
  37946. const lastItemOffset = Math.max(0, total * itemSize - size);
  37947. const maxOffset = Math.min(lastItemOffset, index * itemSize);
  37948. const minOffset = Math.max(0, (index + 1) * itemSize - size);
  37949. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  37950. else alignment = CENTERED_ALIGNMENT;
  37951. switch (alignment) {
  37952. case START_ALIGNMENT: return maxOffset;
  37953. case END_ALIGNMENT: return minOffset;
  37954. case CENTERED_ALIGNMENT: {
  37955. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  37956. if (middleOffset < Math.ceil(size / 2)) return 0;
  37957. else if (middleOffset > lastItemOffset + Math.floor(size / 2)) return lastItemOffset;
  37958. else return middleOffset;
  37959. }
  37960. case AUTO_ALIGNMENT:
  37961. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  37962. else if (scrollOffset < minOffset) return minOffset;
  37963. else return maxOffset;
  37964. }
  37965. },
  37966. getStartIndexForOffset: ({ total, itemSize }, offset) => Math.max(0, Math.min(total - 1, Math.floor(offset / itemSize))),
  37967. getStopIndexForStartIndex: ({ height, total, itemSize, layout, width }, startIndex, scrollOffset) => {
  37968. const offset = startIndex * itemSize;
  37969. const size = isHorizontal(layout) ? width : height;
  37970. const numVisibleItems = Math.ceil((size + scrollOffset - offset) / itemSize);
  37971. return Math.max(0, Math.min(total - 1, startIndex + numVisibleItems - 1));
  37972. },
  37973. initCache() {},
  37974. clearCache: true,
  37975. validateProps() {}
  37976. });
  37977. //#endregion
  37978. //#region ../../packages/components/virtual-list/src/components/dynamic-size-list.ts
  37979. const getItemFromCache$1 = (props, index, listCache) => {
  37980. const { itemSize } = props;
  37981. const { items, lastVisitedIndex } = listCache;
  37982. if (index > lastVisitedIndex) {
  37983. let offset = 0;
  37984. if (lastVisitedIndex >= 0) {
  37985. const item = items[lastVisitedIndex];
  37986. offset = item.offset + item.size;
  37987. }
  37988. for (let i = lastVisitedIndex + 1; i <= index; i++) {
  37989. const size = itemSize(i);
  37990. items[i] = {
  37991. offset,
  37992. size
  37993. };
  37994. offset += size;
  37995. }
  37996. listCache.lastVisitedIndex = index;
  37997. }
  37998. return items[index];
  37999. };
  38000. const findItem$1 = (props, listCache, offset) => {
  38001. const { items, lastVisitedIndex } = listCache;
  38002. if ((lastVisitedIndex > 0 ? items[lastVisitedIndex].offset : 0) >= offset) return bs$1(props, listCache, 0, lastVisitedIndex, offset);
  38003. return es$1(props, listCache, Math.max(0, lastVisitedIndex), offset);
  38004. };
  38005. const bs$1 = (props, listCache, low, high, offset) => {
  38006. while (low <= high) {
  38007. const mid = low + Math.floor((high - low) / 2);
  38008. const currentOffset = getItemFromCache$1(props, mid, listCache).offset;
  38009. if (currentOffset === offset) return mid;
  38010. else if (currentOffset < offset) low = mid + 1;
  38011. else if (currentOffset > offset) high = mid - 1;
  38012. }
  38013. return Math.max(0, low - 1);
  38014. };
  38015. const es$1 = (props, listCache, index, offset) => {
  38016. const { total } = props;
  38017. let exponent = 1;
  38018. while (index < total && getItemFromCache$1(props, index, listCache).offset < offset) {
  38019. index += exponent;
  38020. exponent *= 2;
  38021. }
  38022. return bs$1(props, listCache, Math.floor(index / 2), Math.min(index, total - 1), offset);
  38023. };
  38024. const getEstimatedTotalSize = ({ total }, { items, estimatedItemSize, lastVisitedIndex }) => {
  38025. let totalSizeOfMeasuredItems = 0;
  38026. if (lastVisitedIndex >= total) lastVisitedIndex = total - 1;
  38027. if (lastVisitedIndex >= 0) {
  38028. const item = items[lastVisitedIndex];
  38029. totalSizeOfMeasuredItems = item.offset + item.size;
  38030. }
  38031. const totalSizeOfUnmeasuredItems = (total - lastVisitedIndex - 1) * estimatedItemSize;
  38032. return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
  38033. };
  38034. const DynamicSizeList = createList({
  38035. name: "ElDynamicSizeList",
  38036. getItemOffset: (props, index, listCache) => getItemFromCache$1(props, index, listCache).offset,
  38037. getItemSize: (_, index, { items }) => items[index].size,
  38038. getEstimatedTotalSize,
  38039. getOffset: (props, index, alignment, scrollOffset, listCache) => {
  38040. const { height, layout, width } = props;
  38041. const size = isHorizontal(layout) ? width : height;
  38042. const item = getItemFromCache$1(props, index, listCache);
  38043. const estimatedTotalSize = getEstimatedTotalSize(props, listCache);
  38044. const maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, item.offset));
  38045. const minOffset = Math.max(0, item.offset - size + item.size);
  38046. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  38047. else alignment = CENTERED_ALIGNMENT;
  38048. switch (alignment) {
  38049. case START_ALIGNMENT: return maxOffset;
  38050. case END_ALIGNMENT: return minOffset;
  38051. case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2);
  38052. case AUTO_ALIGNMENT:
  38053. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  38054. else if (scrollOffset < minOffset) return minOffset;
  38055. else return maxOffset;
  38056. }
  38057. },
  38058. getStartIndexForOffset: (props, offset, listCache) => findItem$1(props, listCache, offset),
  38059. getStopIndexForStartIndex: (props, startIndex, scrollOffset, listCache) => {
  38060. const { height, total, layout, width } = props;
  38061. const size = isHorizontal(layout) ? width : height;
  38062. const item = getItemFromCache$1(props, startIndex, listCache);
  38063. const maxOffset = scrollOffset + size;
  38064. let offset = item.offset + item.size;
  38065. let stopIndex = startIndex;
  38066. while (stopIndex < total - 1 && offset < maxOffset) {
  38067. stopIndex++;
  38068. offset += getItemFromCache$1(props, stopIndex, listCache).size;
  38069. }
  38070. return stopIndex;
  38071. },
  38072. initCache({ estimatedItemSize = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }, instance) {
  38073. const cache = {
  38074. items: {},
  38075. estimatedItemSize,
  38076. lastVisitedIndex: -1
  38077. };
  38078. cache.clearCacheAfterIndex = (index, forceUpdate = true) => {
  38079. cache.lastVisitedIndex = Math.min(cache.lastVisitedIndex, index - 1);
  38080. instance.exposed?.getItemStyleCache(-1);
  38081. if (forceUpdate) instance.proxy?.$forceUpdate();
  38082. };
  38083. return cache;
  38084. },
  38085. clearCache: false,
  38086. validateProps: ({ itemSize }) => {}
  38087. });
  38088. //#endregion
  38089. //#region ../../packages/components/virtual-list/src/hooks/use-grid-wheel.ts
  38090. const useGridWheel = ({ atXEndEdge, atXStartEdge, atYEndEdge, atYStartEdge }, onWheelDelta) => {
  38091. let frameHandle = null;
  38092. let xOffset = 0;
  38093. let yOffset = 0;
  38094. const hasReachedEdge = (x, y) => {
  38095. const xEdgeReached = x < 0 && atXStartEdge.value || x > 0 && atXEndEdge.value;
  38096. const yEdgeReached = y < 0 && atYStartEdge.value || y > 0 && atYEndEdge.value;
  38097. return xEdgeReached || yEdgeReached;
  38098. };
  38099. const onWheel = (e) => {
  38100. cAF(frameHandle);
  38101. let x = e.deltaX;
  38102. let y = e.deltaY;
  38103. if (Math.abs(x) > Math.abs(y)) y = 0;
  38104. else x = 0;
  38105. if (e.shiftKey && y !== 0) {
  38106. x = y;
  38107. y = 0;
  38108. }
  38109. if (hasReachedEdge(x, y)) {
  38110. if (e.deltaX !== 0 && x === 0) e.preventDefault();
  38111. return;
  38112. }
  38113. xOffset += x;
  38114. yOffset += y;
  38115. e.preventDefault();
  38116. frameHandle = rAF(() => {
  38117. onWheelDelta(xOffset, yOffset);
  38118. xOffset = 0;
  38119. yOffset = 0;
  38120. });
  38121. };
  38122. return {
  38123. hasReachedEdge,
  38124. onWheel
  38125. };
  38126. };
  38127. //#endregion
  38128. //#region ../../packages/components/virtual-list/src/hooks/use-grid-touch.ts
  38129. const useGridTouch = (windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight) => {
  38130. const touchStartX = (0, vue.ref)(0);
  38131. const touchStartY = (0, vue.ref)(0);
  38132. let frameHandle;
  38133. let deltaX = 0;
  38134. let deltaY = 0;
  38135. const handleTouchStart = (event) => {
  38136. cAF(frameHandle);
  38137. touchStartX.value = event.touches[0].clientX;
  38138. touchStartY.value = event.touches[0].clientY;
  38139. deltaX = 0;
  38140. deltaY = 0;
  38141. };
  38142. const handleTouchMove = (event) => {
  38143. event.preventDefault();
  38144. cAF(frameHandle);
  38145. deltaX += touchStartX.value - event.touches[0].clientX;
  38146. deltaY += touchStartY.value - event.touches[0].clientY;
  38147. touchStartX.value = event.touches[0].clientX;
  38148. touchStartY.value = event.touches[0].clientY;
  38149. frameHandle = rAF(() => {
  38150. const maxScrollLeft = estimatedTotalWidth.value - (0, vue.unref)(parsedWidth);
  38151. const maxScrollTop = estimatedTotalHeight.value - (0, vue.unref)(parsedHeight);
  38152. scrollTo({
  38153. scrollLeft: Math.min(states.value.scrollLeft + deltaX, maxScrollLeft),
  38154. scrollTop: Math.min(states.value.scrollTop + deltaY, maxScrollTop)
  38155. });
  38156. deltaX = 0;
  38157. deltaY = 0;
  38158. });
  38159. };
  38160. useEventListener(windowRef, "touchstart", handleTouchStart, { passive: true });
  38161. useEventListener(windowRef, "touchmove", handleTouchMove, { passive: false });
  38162. return {
  38163. touchStartX,
  38164. touchStartY,
  38165. handleTouchStart,
  38166. handleTouchMove
  38167. };
  38168. };
  38169. //#endregion
  38170. //#region ../../packages/components/virtual-list/src/builders/build-grid.ts
  38171. const createGrid = ({ name, clearCache, getColumnPosition, getColumnStartIndexForOffset, getColumnStopIndexForStartIndex, getEstimatedTotalHeight, getEstimatedTotalWidth, getColumnOffset, getRowOffset, getRowPosition, getRowStartIndexForOffset, getRowStopIndexForStartIndex, initCache, injectToInstance, validateProps }) => {
  38172. return (0, vue.defineComponent)({
  38173. name: name ?? "ElVirtualList",
  38174. props: virtualizedGridProps,
  38175. emits: [ITEM_RENDER_EVT, SCROLL_EVT],
  38176. setup(props, { emit, expose, slots }) {
  38177. const ns = useNamespace("vl");
  38178. validateProps(props);
  38179. const instance = (0, vue.getCurrentInstance)();
  38180. const cache = (0, vue.ref)(initCache(props, instance));
  38181. injectToInstance?.(instance, cache);
  38182. const windowRef = (0, vue.ref)();
  38183. const hScrollbar = (0, vue.ref)();
  38184. const vScrollbar = (0, vue.ref)();
  38185. const innerRef = (0, vue.ref)();
  38186. const states = (0, vue.ref)({
  38187. isScrolling: false,
  38188. scrollLeft: isNumber(props.initScrollLeft) ? props.initScrollLeft : 0,
  38189. scrollTop: isNumber(props.initScrollTop) ? props.initScrollTop : 0,
  38190. updateRequested: false,
  38191. xAxisScrollDir: FORWARD,
  38192. yAxisScrollDir: FORWARD
  38193. });
  38194. const getItemStyleCache = useCache();
  38195. const parsedHeight = (0, vue.computed)(() => Number.parseInt(`${props.height}`, 10));
  38196. const parsedWidth = (0, vue.computed)(() => Number.parseInt(`${props.width}`, 10));
  38197. const columnsToRender = (0, vue.computed)(() => {
  38198. const { totalColumn, totalRow, columnCache } = props;
  38199. const { isScrolling, xAxisScrollDir, scrollLeft } = (0, vue.unref)(states);
  38200. if (totalColumn === 0 || totalRow === 0) return [
  38201. 0,
  38202. 0,
  38203. 0,
  38204. 0
  38205. ];
  38206. const startIndex = getColumnStartIndexForOffset(props, scrollLeft, (0, vue.unref)(cache));
  38207. const stopIndex = getColumnStopIndexForStartIndex(props, startIndex, scrollLeft, (0, vue.unref)(cache));
  38208. const cacheBackward = !isScrolling || xAxisScrollDir === BACKWARD ? Math.max(1, columnCache) : 1;
  38209. const cacheForward = !isScrolling || xAxisScrollDir === FORWARD ? Math.max(1, columnCache) : 1;
  38210. return [
  38211. Math.max(0, startIndex - cacheBackward),
  38212. Math.max(0, Math.min(totalColumn - 1, stopIndex + cacheForward)),
  38213. startIndex,
  38214. stopIndex
  38215. ];
  38216. });
  38217. const rowsToRender = (0, vue.computed)(() => {
  38218. const { totalColumn, totalRow, rowCache } = props;
  38219. const { isScrolling, yAxisScrollDir, scrollTop } = (0, vue.unref)(states);
  38220. if (totalColumn === 0 || totalRow === 0) return [
  38221. 0,
  38222. 0,
  38223. 0,
  38224. 0
  38225. ];
  38226. const startIndex = getRowStartIndexForOffset(props, scrollTop, (0, vue.unref)(cache));
  38227. const stopIndex = getRowStopIndexForStartIndex(props, startIndex, scrollTop, (0, vue.unref)(cache));
  38228. const cacheBackward = !isScrolling || yAxisScrollDir === BACKWARD ? Math.max(1, rowCache) : 1;
  38229. const cacheForward = !isScrolling || yAxisScrollDir === FORWARD ? Math.max(1, rowCache) : 1;
  38230. return [
  38231. Math.max(0, startIndex - cacheBackward),
  38232. Math.max(0, Math.min(totalRow - 1, stopIndex + cacheForward)),
  38233. startIndex,
  38234. stopIndex
  38235. ];
  38236. });
  38237. const estimatedTotalHeight = (0, vue.computed)(() => getEstimatedTotalHeight(props, (0, vue.unref)(cache)));
  38238. const estimatedTotalWidth = (0, vue.computed)(() => getEstimatedTotalWidth(props, (0, vue.unref)(cache)));
  38239. const windowStyle = (0, vue.computed)(() => [
  38240. {
  38241. position: "relative",
  38242. overflow: "hidden",
  38243. WebkitOverflowScrolling: "touch",
  38244. willChange: "transform"
  38245. },
  38246. {
  38247. direction: props.direction,
  38248. height: isNumber(props.height) ? `${props.height}px` : props.height,
  38249. width: isNumber(props.width) ? `${props.width}px` : props.width
  38250. },
  38251. props.style ?? {}
  38252. ]);
  38253. const innerStyle = (0, vue.computed)(() => {
  38254. const width = `${(0, vue.unref)(estimatedTotalWidth)}px`;
  38255. return {
  38256. height: `${(0, vue.unref)(estimatedTotalHeight)}px`,
  38257. pointerEvents: (0, vue.unref)(states).isScrolling ? "none" : void 0,
  38258. width,
  38259. margin: 0,
  38260. boxSizing: "border-box"
  38261. };
  38262. });
  38263. const emitEvents = () => {
  38264. const { totalColumn, totalRow } = props;
  38265. if (totalColumn > 0 && totalRow > 0) {
  38266. const [columnCacheStart, columnCacheEnd, columnVisibleStart, columnVisibleEnd] = (0, vue.unref)(columnsToRender);
  38267. const [rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd] = (0, vue.unref)(rowsToRender);
  38268. emit(ITEM_RENDER_EVT, {
  38269. columnCacheStart,
  38270. columnCacheEnd,
  38271. rowCacheStart,
  38272. rowCacheEnd,
  38273. columnVisibleStart,
  38274. columnVisibleEnd,
  38275. rowVisibleStart,
  38276. rowVisibleEnd
  38277. });
  38278. }
  38279. const { scrollLeft, scrollTop, updateRequested, xAxisScrollDir, yAxisScrollDir } = (0, vue.unref)(states);
  38280. emit(SCROLL_EVT, {
  38281. xAxisScrollDir,
  38282. scrollLeft,
  38283. yAxisScrollDir,
  38284. scrollTop,
  38285. updateRequested
  38286. });
  38287. };
  38288. const onScroll = (e) => {
  38289. const { clientHeight, clientWidth, scrollHeight, scrollLeft, scrollTop, scrollWidth } = e.currentTarget;
  38290. const _states = (0, vue.unref)(states);
  38291. if (_states.scrollTop === scrollTop && _states.scrollLeft === scrollLeft) return;
  38292. let _scrollLeft = scrollLeft;
  38293. if (isRTL(props.direction)) switch (getRTLOffsetType()) {
  38294. case RTL_OFFSET_NAG:
  38295. _scrollLeft = -scrollLeft;
  38296. break;
  38297. case RTL_OFFSET_POS_DESC:
  38298. _scrollLeft = scrollWidth - clientWidth - scrollLeft;
  38299. break;
  38300. }
  38301. states.value = {
  38302. ..._states,
  38303. isScrolling: true,
  38304. scrollLeft: _scrollLeft,
  38305. scrollTop: Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight)),
  38306. updateRequested: true,
  38307. xAxisScrollDir: getScrollDir(_states.scrollLeft, _scrollLeft),
  38308. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop)
  38309. };
  38310. (0, vue.nextTick)(() => resetIsScrolling());
  38311. onUpdated();
  38312. emitEvents();
  38313. };
  38314. const onVerticalScroll = (distance, totalSteps) => {
  38315. const height = (0, vue.unref)(parsedHeight);
  38316. const offset = (estimatedTotalHeight.value - height) / totalSteps * distance;
  38317. scrollTo({ scrollTop: Math.min(estimatedTotalHeight.value - height, offset) });
  38318. };
  38319. const onHorizontalScroll = (distance, totalSteps) => {
  38320. const width = (0, vue.unref)(parsedWidth);
  38321. const offset = (estimatedTotalWidth.value - width) / totalSteps * distance;
  38322. scrollTo({ scrollLeft: Math.min(estimatedTotalWidth.value - width, offset) });
  38323. };
  38324. const { onWheel } = useGridWheel({
  38325. atXStartEdge: (0, vue.computed)(() => states.value.scrollLeft <= 0),
  38326. atXEndEdge: (0, vue.computed)(() => states.value.scrollLeft >= estimatedTotalWidth.value - (0, vue.unref)(parsedWidth)),
  38327. atYStartEdge: (0, vue.computed)(() => states.value.scrollTop <= 0),
  38328. atYEndEdge: (0, vue.computed)(() => states.value.scrollTop >= estimatedTotalHeight.value - (0, vue.unref)(parsedHeight))
  38329. }, (x, y) => {
  38330. hScrollbar.value?.onMouseUp?.();
  38331. vScrollbar.value?.onMouseUp?.();
  38332. const width = (0, vue.unref)(parsedWidth);
  38333. const height = (0, vue.unref)(parsedHeight);
  38334. scrollTo({
  38335. scrollLeft: Math.min(states.value.scrollLeft + x, estimatedTotalWidth.value - width),
  38336. scrollTop: Math.min(states.value.scrollTop + y, estimatedTotalHeight.value - height)
  38337. });
  38338. });
  38339. useEventListener(windowRef, "wheel", onWheel, { passive: false });
  38340. const scrollTo = ({ scrollLeft = states.value.scrollLeft, scrollTop = states.value.scrollTop }) => {
  38341. scrollLeft = Math.max(scrollLeft, 0);
  38342. scrollTop = Math.max(scrollTop, 0);
  38343. const _states = (0, vue.unref)(states);
  38344. if (scrollTop === _states.scrollTop && scrollLeft === _states.scrollLeft) return;
  38345. states.value = {
  38346. ..._states,
  38347. xAxisScrollDir: getScrollDir(_states.scrollLeft, scrollLeft),
  38348. yAxisScrollDir: getScrollDir(_states.scrollTop, scrollTop),
  38349. scrollLeft,
  38350. scrollTop,
  38351. updateRequested: true
  38352. };
  38353. (0, vue.nextTick)(() => resetIsScrolling());
  38354. onUpdated();
  38355. emitEvents();
  38356. };
  38357. const { touchStartX, touchStartY, handleTouchStart, handleTouchMove } = useGridTouch(windowRef, states, scrollTo, estimatedTotalWidth, estimatedTotalHeight, parsedWidth, parsedHeight);
  38358. const scrollToItem = (rowIndex = 0, columnIdx = 0, alignment = AUTO_ALIGNMENT) => {
  38359. const _states = (0, vue.unref)(states);
  38360. columnIdx = Math.max(0, Math.min(columnIdx, props.totalColumn - 1));
  38361. rowIndex = Math.max(0, Math.min(rowIndex, props.totalRow - 1));
  38362. const scrollBarWidth = getScrollBarWidth(ns.namespace.value);
  38363. const _cache = (0, vue.unref)(cache);
  38364. const estimatedHeight = getEstimatedTotalHeight(props, _cache);
  38365. const estimatedWidth = getEstimatedTotalWidth(props, _cache);
  38366. scrollTo({
  38367. scrollLeft: getColumnOffset(props, columnIdx, alignment, _states.scrollLeft, _cache, estimatedWidth > props.width ? scrollBarWidth : 0),
  38368. scrollTop: getRowOffset(props, rowIndex, alignment, _states.scrollTop, _cache, estimatedHeight > props.height ? scrollBarWidth : 0)
  38369. });
  38370. };
  38371. const getItemStyle = (rowIndex, columnIndex) => {
  38372. const { columnWidth, direction, rowHeight } = props;
  38373. const itemStyleCache = getItemStyleCache.value(clearCache && columnWidth, clearCache && rowHeight, clearCache && direction);
  38374. const key = `${rowIndex},${columnIndex}`;
  38375. if (hasOwn(itemStyleCache, key)) return itemStyleCache[key];
  38376. else {
  38377. const [, left] = getColumnPosition(props, columnIndex, (0, vue.unref)(cache));
  38378. const _cache = (0, vue.unref)(cache);
  38379. const rtl = isRTL(direction);
  38380. const [height, top] = getRowPosition(props, rowIndex, _cache);
  38381. const [width] = getColumnPosition(props, columnIndex, _cache);
  38382. itemStyleCache[key] = {
  38383. position: "absolute",
  38384. left: rtl ? void 0 : `${left}px`,
  38385. right: rtl ? `${left}px` : void 0,
  38386. top: `${top}px`,
  38387. height: `${height}px`,
  38388. width: `${width}px`
  38389. };
  38390. return itemStyleCache[key];
  38391. }
  38392. };
  38393. const resetIsScrolling = () => {
  38394. states.value.isScrolling = false;
  38395. (0, vue.nextTick)(() => {
  38396. getItemStyleCache.value(-1, null, null);
  38397. });
  38398. };
  38399. (0, vue.onMounted)(() => {
  38400. if (!isClient) return;
  38401. const { initScrollLeft, initScrollTop } = props;
  38402. const windowElement = (0, vue.unref)(windowRef);
  38403. if (windowElement) {
  38404. if (isNumber(initScrollLeft)) windowElement.scrollLeft = initScrollLeft;
  38405. if (isNumber(initScrollTop)) windowElement.scrollTop = initScrollTop;
  38406. }
  38407. emitEvents();
  38408. });
  38409. const onUpdated = () => {
  38410. const { direction } = props;
  38411. const { scrollLeft, scrollTop, updateRequested } = (0, vue.unref)(states);
  38412. const windowElement = (0, vue.unref)(windowRef);
  38413. if (updateRequested && windowElement) {
  38414. if (direction === RTL) switch (getRTLOffsetType()) {
  38415. case RTL_OFFSET_NAG:
  38416. windowElement.scrollLeft = -scrollLeft;
  38417. break;
  38418. case RTL_OFFSET_POS_ASC:
  38419. windowElement.scrollLeft = scrollLeft;
  38420. break;
  38421. default: {
  38422. const { clientWidth, scrollWidth } = windowElement;
  38423. windowElement.scrollLeft = scrollWidth - clientWidth - scrollLeft;
  38424. break;
  38425. }
  38426. }
  38427. else windowElement.scrollLeft = Math.max(0, scrollLeft);
  38428. windowElement.scrollTop = Math.max(0, scrollTop);
  38429. }
  38430. };
  38431. const { resetAfterColumnIndex, resetAfterRowIndex, resetAfter } = instance.proxy;
  38432. expose({
  38433. windowRef,
  38434. innerRef,
  38435. getItemStyleCache,
  38436. touchStartX,
  38437. touchStartY,
  38438. handleTouchStart,
  38439. handleTouchMove,
  38440. scrollTo,
  38441. scrollToItem,
  38442. states,
  38443. resetAfterColumnIndex,
  38444. resetAfterRowIndex,
  38445. resetAfter
  38446. });
  38447. const renderScrollbars = () => {
  38448. const { scrollbarAlwaysOn, scrollbarStartGap, scrollbarEndGap, totalColumn, totalRow } = props;
  38449. const width = (0, vue.unref)(parsedWidth);
  38450. const height = (0, vue.unref)(parsedHeight);
  38451. const estimatedWidth = (0, vue.unref)(estimatedTotalWidth);
  38452. const estimatedHeight = (0, vue.unref)(estimatedTotalHeight);
  38453. const { scrollLeft, scrollTop } = (0, vue.unref)(states);
  38454. return {
  38455. horizontalScrollbar: (0, vue.h)(ScrollBar, {
  38456. ref: hScrollbar,
  38457. alwaysOn: scrollbarAlwaysOn,
  38458. startGap: scrollbarStartGap,
  38459. endGap: scrollbarEndGap,
  38460. class: ns.e("horizontal"),
  38461. clientSize: width,
  38462. layout: "horizontal",
  38463. onScroll: onHorizontalScroll,
  38464. ratio: width * 100 / estimatedWidth,
  38465. scrollFrom: scrollLeft / (estimatedWidth - width),
  38466. total: totalRow,
  38467. visible: true
  38468. }),
  38469. verticalScrollbar: (0, vue.h)(ScrollBar, {
  38470. ref: vScrollbar,
  38471. alwaysOn: scrollbarAlwaysOn,
  38472. startGap: scrollbarStartGap,
  38473. endGap: scrollbarEndGap,
  38474. class: ns.e("vertical"),
  38475. clientSize: height,
  38476. layout: "vertical",
  38477. onScroll: onVerticalScroll,
  38478. ratio: height * 100 / estimatedHeight,
  38479. scrollFrom: scrollTop / (estimatedHeight - height),
  38480. total: totalColumn,
  38481. visible: true
  38482. })
  38483. };
  38484. };
  38485. const renderItems = () => {
  38486. const [columnStart, columnEnd] = (0, vue.unref)(columnsToRender);
  38487. const [rowStart, rowEnd] = (0, vue.unref)(rowsToRender);
  38488. const { data, totalColumn, totalRow, useIsScrolling, itemKey } = props;
  38489. const children = [];
  38490. if (totalRow > 0 && totalColumn > 0) for (let row = rowStart; row <= rowEnd; row++) for (let column = columnStart; column <= columnEnd; column++) {
  38491. const key = itemKey({
  38492. columnIndex: column,
  38493. data,
  38494. rowIndex: row
  38495. });
  38496. children.push((0, vue.h)(vue.Fragment, { key }, slots.default?.({
  38497. columnIndex: column,
  38498. data,
  38499. isScrolling: useIsScrolling ? (0, vue.unref)(states).isScrolling : void 0,
  38500. style: getItemStyle(row, column),
  38501. rowIndex: row
  38502. })));
  38503. }
  38504. return children;
  38505. };
  38506. const renderInner = () => {
  38507. const Inner = (0, vue.resolveDynamicComponent)(props.innerElement);
  38508. const children = renderItems();
  38509. return [(0, vue.h)(Inner, (0, vue.mergeProps)(props.innerProps, {
  38510. style: (0, vue.unref)(innerStyle),
  38511. ref: innerRef
  38512. }), !isString(Inner) ? { default: () => children } : children)];
  38513. };
  38514. const renderWindow = () => {
  38515. const Container = (0, vue.resolveDynamicComponent)(props.containerElement);
  38516. const { horizontalScrollbar, verticalScrollbar } = renderScrollbars();
  38517. const Inner = renderInner();
  38518. return (0, vue.h)("div", {
  38519. key: 0,
  38520. class: ns.e("wrapper"),
  38521. role: props.role
  38522. }, [
  38523. (0, vue.h)(Container, {
  38524. class: props.className,
  38525. style: (0, vue.unref)(windowStyle),
  38526. onScroll,
  38527. ref: windowRef
  38528. }, !isString(Container) ? { default: () => Inner } : Inner),
  38529. horizontalScrollbar,
  38530. verticalScrollbar
  38531. ]);
  38532. };
  38533. return renderWindow;
  38534. }
  38535. });
  38536. };
  38537. //#endregion
  38538. //#region ../../packages/components/virtual-list/src/components/fixed-size-grid.ts
  38539. const FixedSizeGrid = createGrid({
  38540. name: "ElFixedSizeGrid",
  38541. getColumnPosition: ({ columnWidth }, index) => [columnWidth, index * columnWidth],
  38542. getRowPosition: ({ rowHeight }, index) => [rowHeight, index * rowHeight],
  38543. getEstimatedTotalHeight: ({ totalRow, rowHeight }) => rowHeight * totalRow,
  38544. getEstimatedTotalWidth: ({ totalColumn, columnWidth }) => columnWidth * totalColumn,
  38545. getColumnOffset: ({ totalColumn, columnWidth, width }, columnIndex, alignment, scrollLeft, _, scrollBarWidth) => {
  38546. width = Number(width);
  38547. const lastColumnOffset = Math.max(0, totalColumn * columnWidth - width);
  38548. const maxOffset = Math.min(lastColumnOffset, columnIndex * columnWidth);
  38549. const minOffset = Math.max(0, columnIndex * columnWidth - width + scrollBarWidth + columnWidth);
  38550. if (alignment === "smart") if (scrollLeft >= minOffset - width && scrollLeft <= maxOffset + width) alignment = AUTO_ALIGNMENT;
  38551. else alignment = CENTERED_ALIGNMENT;
  38552. switch (alignment) {
  38553. case START_ALIGNMENT: return maxOffset;
  38554. case END_ALIGNMENT: return minOffset;
  38555. case CENTERED_ALIGNMENT: {
  38556. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  38557. if (middleOffset < Math.ceil(width / 2)) return 0;
  38558. else if (middleOffset > lastColumnOffset + Math.floor(width / 2)) return lastColumnOffset;
  38559. else return middleOffset;
  38560. }
  38561. case AUTO_ALIGNMENT:
  38562. default: if (scrollLeft >= minOffset && scrollLeft <= maxOffset) return scrollLeft;
  38563. else if (minOffset > maxOffset) return minOffset;
  38564. else if (scrollLeft < minOffset) return minOffset;
  38565. else return maxOffset;
  38566. }
  38567. },
  38568. getRowOffset: ({ rowHeight, height, totalRow }, rowIndex, align, scrollTop, _, scrollBarWidth) => {
  38569. height = Number(height);
  38570. const lastRowOffset = Math.max(0, totalRow * rowHeight - height);
  38571. const maxOffset = Math.min(lastRowOffset, rowIndex * rowHeight);
  38572. const minOffset = Math.max(0, rowIndex * rowHeight - height + scrollBarWidth + rowHeight);
  38573. if (align === SMART_ALIGNMENT) if (scrollTop >= minOffset - height && scrollTop <= maxOffset + height) align = AUTO_ALIGNMENT;
  38574. else align = CENTERED_ALIGNMENT;
  38575. switch (align) {
  38576. case START_ALIGNMENT: return maxOffset;
  38577. case END_ALIGNMENT: return minOffset;
  38578. case CENTERED_ALIGNMENT: {
  38579. const middleOffset = Math.round(minOffset + (maxOffset - minOffset) / 2);
  38580. if (middleOffset < Math.ceil(height / 2)) return 0;
  38581. else if (middleOffset > lastRowOffset + Math.floor(height / 2)) return lastRowOffset;
  38582. else return middleOffset;
  38583. }
  38584. case AUTO_ALIGNMENT:
  38585. default: if (scrollTop >= minOffset && scrollTop <= maxOffset) return scrollTop;
  38586. else if (minOffset > maxOffset) return minOffset;
  38587. else if (scrollTop < minOffset) return minOffset;
  38588. else return maxOffset;
  38589. }
  38590. },
  38591. getColumnStartIndexForOffset: ({ columnWidth, totalColumn }, scrollLeft) => Math.max(0, Math.min(totalColumn - 1, Math.floor(scrollLeft / columnWidth))),
  38592. getColumnStopIndexForStartIndex: ({ columnWidth, totalColumn, width }, startIndex, scrollLeft) => {
  38593. const left = startIndex * columnWidth;
  38594. const visibleColumnsCount = Math.ceil((width + scrollLeft - left) / columnWidth);
  38595. return Math.max(0, Math.min(totalColumn - 1, startIndex + visibleColumnsCount - 1));
  38596. },
  38597. getRowStartIndexForOffset: ({ rowHeight, totalRow }, scrollTop) => Math.max(0, Math.min(totalRow - 1, Math.floor(scrollTop / rowHeight))),
  38598. getRowStopIndexForStartIndex: ({ rowHeight, totalRow, height }, startIndex, scrollTop) => {
  38599. const top = startIndex * rowHeight;
  38600. const numVisibleRows = Math.ceil((height + scrollTop - top) / rowHeight);
  38601. return Math.max(0, Math.min(totalRow - 1, startIndex + numVisibleRows - 1));
  38602. },
  38603. initCache: () => void 0,
  38604. clearCache: true,
  38605. validateProps: ({ columnWidth, rowHeight }) => {}
  38606. });
  38607. //#endregion
  38608. //#region ../../packages/components/virtual-list/src/components/dynamic-size-grid.ts
  38609. const { max, min, floor } = Math;
  38610. const ACCESS_SIZER_KEY_MAP = {
  38611. column: "columnWidth",
  38612. row: "rowHeight"
  38613. };
  38614. const ACCESS_LAST_VISITED_KEY_MAP = {
  38615. column: "lastVisitedColumnIndex",
  38616. row: "lastVisitedRowIndex"
  38617. };
  38618. const getItemFromCache = (props, index, gridCache, type) => {
  38619. const [cachedItems, sizer, lastVisited] = [
  38620. gridCache[type],
  38621. props[ACCESS_SIZER_KEY_MAP[type]],
  38622. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]
  38623. ];
  38624. if (index > lastVisited) {
  38625. let offset = 0;
  38626. if (lastVisited >= 0) {
  38627. const item = cachedItems[lastVisited];
  38628. offset = item.offset + item.size;
  38629. }
  38630. for (let i = lastVisited + 1; i <= index; i++) {
  38631. const size = sizer(i);
  38632. cachedItems[i] = {
  38633. offset,
  38634. size
  38635. };
  38636. offset += size;
  38637. }
  38638. gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]] = index;
  38639. }
  38640. return cachedItems[index];
  38641. };
  38642. const bs = (props, gridCache, low, high, offset, type) => {
  38643. while (low <= high) {
  38644. const mid = low + floor((high - low) / 2);
  38645. const currentOffset = getItemFromCache(props, mid, gridCache, type).offset;
  38646. if (currentOffset === offset) return mid;
  38647. else if (currentOffset < offset) low = mid + 1;
  38648. else high = mid - 1;
  38649. }
  38650. return max(0, low - 1);
  38651. };
  38652. const es = (props, gridCache, idx, offset, type) => {
  38653. const total = type === "column" ? props.totalColumn : props.totalRow;
  38654. let exponent = 1;
  38655. while (idx < total && getItemFromCache(props, idx, gridCache, type).offset < offset) {
  38656. idx += exponent;
  38657. exponent *= 2;
  38658. }
  38659. return bs(props, gridCache, floor(idx / 2), min(idx, total - 1), offset, type);
  38660. };
  38661. const findItem = (props, gridCache, offset, type) => {
  38662. const [cache, lastVisitedIndex] = [gridCache[type], gridCache[ACCESS_LAST_VISITED_KEY_MAP[type]]];
  38663. if ((lastVisitedIndex > 0 ? cache[lastVisitedIndex].offset : 0) >= offset) return bs(props, gridCache, 0, lastVisitedIndex, offset, type);
  38664. return es(props, gridCache, max(0, lastVisitedIndex), offset, type);
  38665. };
  38666. const getEstimatedTotalHeight = ({ totalRow }, { estimatedRowHeight, lastVisitedRowIndex, row }) => {
  38667. let sizeOfVisitedRows = 0;
  38668. if (lastVisitedRowIndex >= totalRow) lastVisitedRowIndex = totalRow - 1;
  38669. if (lastVisitedRowIndex >= 0) {
  38670. const item = row[lastVisitedRowIndex];
  38671. sizeOfVisitedRows = item.offset + item.size;
  38672. }
  38673. const sizeOfUnvisitedItems = (totalRow - lastVisitedRowIndex - 1) * estimatedRowHeight;
  38674. return sizeOfVisitedRows + sizeOfUnvisitedItems;
  38675. };
  38676. const getEstimatedTotalWidth = ({ totalColumn }, { column, estimatedColumnWidth, lastVisitedColumnIndex }) => {
  38677. let sizeOfVisitedColumns = 0;
  38678. if (lastVisitedColumnIndex > totalColumn) lastVisitedColumnIndex = totalColumn - 1;
  38679. if (lastVisitedColumnIndex >= 0) {
  38680. const item = column[lastVisitedColumnIndex];
  38681. sizeOfVisitedColumns = item.offset + item.size;
  38682. }
  38683. const sizeOfUnvisitedItems = (totalColumn - lastVisitedColumnIndex - 1) * estimatedColumnWidth;
  38684. return sizeOfVisitedColumns + sizeOfUnvisitedItems;
  38685. };
  38686. const ACCESS_ESTIMATED_SIZE_KEY_MAP = {
  38687. column: getEstimatedTotalWidth,
  38688. row: getEstimatedTotalHeight
  38689. };
  38690. const getOffset$1 = (props, index, alignment, scrollOffset, cache, type, scrollBarWidth) => {
  38691. const [size, estimatedSizeAssociates] = [type === "row" ? props.height : props.width, ACCESS_ESTIMATED_SIZE_KEY_MAP[type]];
  38692. const item = getItemFromCache(props, index, cache, type);
  38693. const maxOffset = max(0, min(estimatedSizeAssociates(props, cache) - size, item.offset));
  38694. const minOffset = max(0, item.offset - size + scrollBarWidth + item.size);
  38695. if (alignment === SMART_ALIGNMENT) if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) alignment = AUTO_ALIGNMENT;
  38696. else alignment = CENTERED_ALIGNMENT;
  38697. switch (alignment) {
  38698. case START_ALIGNMENT: return maxOffset;
  38699. case END_ALIGNMENT: return minOffset;
  38700. case CENTERED_ALIGNMENT: return Math.round(minOffset + (maxOffset - minOffset) / 2);
  38701. case AUTO_ALIGNMENT:
  38702. default: if (scrollOffset >= minOffset && scrollOffset <= maxOffset) return scrollOffset;
  38703. else if (minOffset > maxOffset) return minOffset;
  38704. else if (scrollOffset < minOffset) return minOffset;
  38705. else return maxOffset;
  38706. }
  38707. };
  38708. const DynamicSizeGrid = createGrid({
  38709. name: "ElDynamicSizeGrid",
  38710. getColumnPosition: (props, idx, cache) => {
  38711. const item = getItemFromCache(props, idx, cache, "column");
  38712. return [item.size, item.offset];
  38713. },
  38714. getRowPosition: (props, idx, cache) => {
  38715. const item = getItemFromCache(props, idx, cache, "row");
  38716. return [item.size, item.offset];
  38717. },
  38718. getColumnOffset: (props, columnIndex, alignment, scrollLeft, cache, scrollBarWidth) => getOffset$1(props, columnIndex, alignment, scrollLeft, cache, "column", scrollBarWidth),
  38719. getRowOffset: (props, rowIndex, alignment, scrollTop, cache, scrollBarWidth) => getOffset$1(props, rowIndex, alignment, scrollTop, cache, "row", scrollBarWidth),
  38720. getColumnStartIndexForOffset: (props, scrollLeft, cache) => findItem(props, cache, scrollLeft, "column"),
  38721. getColumnStopIndexForStartIndex: (props, startIndex, scrollLeft, cache) => {
  38722. const item = getItemFromCache(props, startIndex, cache, "column");
  38723. const maxOffset = scrollLeft + props.width;
  38724. let offset = item.offset + item.size;
  38725. let stopIndex = startIndex;
  38726. while (stopIndex < props.totalColumn - 1 && offset < maxOffset) {
  38727. stopIndex++;
  38728. offset += getItemFromCache(props, startIndex, cache, "column").size;
  38729. }
  38730. return stopIndex;
  38731. },
  38732. getEstimatedTotalHeight,
  38733. getEstimatedTotalWidth,
  38734. getRowStartIndexForOffset: (props, scrollTop, cache) => findItem(props, cache, scrollTop, "row"),
  38735. getRowStopIndexForStartIndex: (props, startIndex, scrollTop, cache) => {
  38736. const { totalRow, height } = props;
  38737. const item = getItemFromCache(props, startIndex, cache, "row");
  38738. const maxOffset = scrollTop + height;
  38739. let offset = item.size + item.offset;
  38740. let stopIndex = startIndex;
  38741. while (stopIndex < totalRow - 1 && offset < maxOffset) {
  38742. stopIndex++;
  38743. offset += getItemFromCache(props, stopIndex, cache, "row").size;
  38744. }
  38745. return stopIndex;
  38746. },
  38747. injectToInstance: (instance, cache) => {
  38748. const resetAfter = ({ columnIndex, rowIndex }, forceUpdate) => {
  38749. forceUpdate = isUndefined(forceUpdate) ? true : forceUpdate;
  38750. if (isNumber(columnIndex)) cache.value.lastVisitedColumnIndex = Math.min(cache.value.lastVisitedColumnIndex, columnIndex - 1);
  38751. if (isNumber(rowIndex)) cache.value.lastVisitedRowIndex = Math.min(cache.value.lastVisitedRowIndex, rowIndex - 1);
  38752. instance.exposed?.getItemStyleCache.value(-1, null, null);
  38753. if (forceUpdate) instance.proxy?.$forceUpdate();
  38754. };
  38755. const resetAfterColumnIndex = (columnIndex, forceUpdate) => {
  38756. resetAfter({ columnIndex }, forceUpdate);
  38757. };
  38758. const resetAfterRowIndex = (rowIndex, forceUpdate) => {
  38759. resetAfter({ rowIndex }, forceUpdate);
  38760. };
  38761. Object.assign(instance.proxy, {
  38762. resetAfterColumnIndex,
  38763. resetAfterRowIndex,
  38764. resetAfter
  38765. });
  38766. },
  38767. initCache: ({ estimatedColumnWidth = DEFAULT_DYNAMIC_LIST_ITEM_SIZE, estimatedRowHeight = DEFAULT_DYNAMIC_LIST_ITEM_SIZE }) => {
  38768. return {
  38769. column: {},
  38770. estimatedColumnWidth,
  38771. estimatedRowHeight,
  38772. lastVisitedColumnIndex: -1,
  38773. lastVisitedRowIndex: -1,
  38774. row: {}
  38775. };
  38776. },
  38777. clearCache: false,
  38778. validateProps: ({ columnWidth, rowHeight }) => {}
  38779. });
  38780. //#endregion
  38781. //#region ../../packages/components/select-v2/src/group-item.vue?vue&type=script&lang.ts
  38782. var group_item_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  38783. props: {
  38784. item: {
  38785. type: Object,
  38786. required: true
  38787. },
  38788. style: { type: Object },
  38789. height: Number
  38790. },
  38791. setup() {
  38792. return { ns: useNamespace("select") };
  38793. }
  38794. });
  38795. //#endregion
  38796. //#region ../../packages/components/select-v2/src/group-item.vue
  38797. function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
  38798. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  38799. class: (0, vue.normalizeClass)(_ctx.ns.be("group", "title")),
  38800. style: (0, vue.normalizeStyle)({
  38801. ..._ctx.style,
  38802. lineHeight: `${_ctx.height}px`
  38803. })
  38804. }, (0, vue.toDisplayString)(_ctx.item.label), 7);
  38805. }
  38806. var group_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(group_item_vue_vue_type_script_lang_default, [["render", _sfc_render$7]]);
  38807. //#endregion
  38808. //#region ../../packages/components/select-v2/src/useOption.ts
  38809. function useOption(props, { emit }) {
  38810. return {
  38811. hoverItem: () => {
  38812. if (!props.disabled) emit("hover", props.index);
  38813. },
  38814. selectOptionClick: () => {
  38815. if (!props.disabled) emit("select", props.item, props.index);
  38816. }
  38817. };
  38818. }
  38819. //#endregion
  38820. //#region ../../packages/components/select-v2/src/defaults.ts
  38821. const selectV2Props = buildProps({
  38822. allowCreate: Boolean,
  38823. autocomplete: {
  38824. type: definePropType(String),
  38825. default: "none"
  38826. },
  38827. automaticDropdown: Boolean,
  38828. clearable: Boolean,
  38829. clearIcon: {
  38830. type: iconPropType,
  38831. default: circle_close_default
  38832. },
  38833. effect: {
  38834. type: definePropType(String),
  38835. default: "light"
  38836. },
  38837. collapseTags: Boolean,
  38838. collapseTagsTooltip: Boolean,
  38839. tagTooltip: {
  38840. type: definePropType(Object),
  38841. default: () => ({})
  38842. },
  38843. maxCollapseTags: {
  38844. type: Number,
  38845. default: 1
  38846. },
  38847. defaultFirstOption: Boolean,
  38848. disabled: {
  38849. type: Boolean,
  38850. default: void 0
  38851. },
  38852. estimatedOptionHeight: {
  38853. type: Number,
  38854. default: void 0
  38855. },
  38856. filterable: Boolean,
  38857. filterMethod: { type: definePropType(Function) },
  38858. height: {
  38859. type: Number,
  38860. default: 274
  38861. },
  38862. itemHeight: {
  38863. type: Number,
  38864. default: 34
  38865. },
  38866. id: String,
  38867. loading: Boolean,
  38868. loadingText: String,
  38869. modelValue: {
  38870. type: definePropType([
  38871. Array,
  38872. String,
  38873. Number,
  38874. Boolean,
  38875. Object
  38876. ]),
  38877. default: void 0
  38878. },
  38879. multiple: Boolean,
  38880. multipleLimit: {
  38881. type: Number,
  38882. default: 0
  38883. },
  38884. name: String,
  38885. noDataText: String,
  38886. noMatchText: String,
  38887. remoteMethod: { type: definePropType(Function) },
  38888. reserveKeyword: {
  38889. type: Boolean,
  38890. default: true
  38891. },
  38892. options: {
  38893. type: definePropType(Array),
  38894. required: true
  38895. },
  38896. placeholder: { type: String },
  38897. teleported: useTooltipContentProps.teleported,
  38898. persistent: {
  38899. type: Boolean,
  38900. default: true
  38901. },
  38902. popperClass: useTooltipContentProps.popperClass,
  38903. popperStyle: useTooltipContentProps.popperStyle,
  38904. popperOptions: {
  38905. type: definePropType(Object),
  38906. default: () => ({})
  38907. },
  38908. remote: Boolean,
  38909. debounce: {
  38910. type: Number,
  38911. default: 300
  38912. },
  38913. size: useSizeProp,
  38914. props: {
  38915. type: definePropType(Object),
  38916. default: () => defaultProps$2
  38917. },
  38918. valueKey: {
  38919. type: String,
  38920. default: "value"
  38921. },
  38922. scrollbarAlwaysOn: Boolean,
  38923. validateEvent: {
  38924. type: Boolean,
  38925. default: true
  38926. },
  38927. offset: {
  38928. type: Number,
  38929. default: 12
  38930. },
  38931. remoteShowSuffix: Boolean,
  38932. showArrow: {
  38933. type: Boolean,
  38934. default: true
  38935. },
  38936. placement: {
  38937. type: definePropType(String),
  38938. values: Ee,
  38939. default: "bottom-start"
  38940. },
  38941. fallbackPlacements: {
  38942. type: definePropType(Array),
  38943. default: [
  38944. "bottom-start",
  38945. "top-start",
  38946. "right",
  38947. "left"
  38948. ]
  38949. },
  38950. tagType: {
  38951. ...tagProps.type,
  38952. default: "info"
  38953. },
  38954. tagEffect: {
  38955. ...tagProps.effect,
  38956. default: "light"
  38957. },
  38958. tabindex: {
  38959. type: [String, Number],
  38960. default: 0
  38961. },
  38962. appendTo: useTooltipContentProps.appendTo,
  38963. fitInputWidth: {
  38964. type: [Boolean, Number],
  38965. default: true,
  38966. validator(val) {
  38967. return isBoolean(val) || isNumber(val);
  38968. }
  38969. },
  38970. suffixIcon: {
  38971. type: iconPropType,
  38972. default: arrow_down_default
  38973. },
  38974. ...useEmptyValuesProps,
  38975. ...useAriaProps(["ariaLabel"])
  38976. });
  38977. const optionV2Props = buildProps({
  38978. data: Array,
  38979. disabled: Boolean,
  38980. hovering: Boolean,
  38981. item: {
  38982. type: definePropType(Object),
  38983. required: true
  38984. },
  38985. index: Number,
  38986. style: Object,
  38987. selected: Boolean,
  38988. created: Boolean
  38989. });
  38990. const selectV2Emits = {
  38991. [UPDATE_MODEL_EVENT]: (val) => true,
  38992. [CHANGE_EVENT]: (val) => true,
  38993. "remove-tag": (val) => true,
  38994. "visible-change": (visible) => true,
  38995. focus: (evt) => evt instanceof FocusEvent,
  38996. blur: (evt) => evt instanceof FocusEvent,
  38997. clear: () => true
  38998. };
  38999. const optionV2Emits = {
  39000. hover: (index) => isNumber(index),
  39001. select: (val, index) => true
  39002. };
  39003. //#endregion
  39004. //#region ../../packages/components/select-v2/src/token.ts
  39005. const selectV2InjectionKey = Symbol("ElSelectV2Injection");
  39006. //#endregion
  39007. //#region ../../packages/components/select-v2/src/option-item.vue?vue&type=script&lang.ts
  39008. var option_item_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  39009. props: optionV2Props,
  39010. emits: optionV2Emits,
  39011. setup(props, { emit }) {
  39012. const select = (0, vue.inject)(selectV2InjectionKey);
  39013. const ns = useNamespace("select");
  39014. const { hoverItem, selectOptionClick } = useOption(props, { emit });
  39015. const { getLabel } = useProps(select.props);
  39016. return {
  39017. ns,
  39018. contentId: select.contentId,
  39019. hoverItem,
  39020. selectOptionClick,
  39021. getLabel
  39022. };
  39023. }
  39024. });
  39025. //#endregion
  39026. //#region ../../packages/components/select-v2/src/option-item.vue
  39027. const _hoisted_1$22 = [
  39028. "id",
  39029. "aria-selected",
  39030. "aria-disabled"
  39031. ];
  39032. function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
  39033. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  39034. id: `${_ctx.contentId}-${_ctx.index}`,
  39035. role: "option",
  39036. "aria-selected": _ctx.selected,
  39037. "aria-disabled": _ctx.disabled || void 0,
  39038. style: (0, vue.normalizeStyle)(_ctx.style),
  39039. class: (0, vue.normalizeClass)([
  39040. _ctx.ns.be("dropdown", "item"),
  39041. _ctx.ns.is("selected", _ctx.selected),
  39042. _ctx.ns.is("disabled", _ctx.disabled),
  39043. _ctx.ns.is("created", _ctx.created),
  39044. _ctx.ns.is("hovering", _ctx.hovering)
  39045. ]),
  39046. onMousemove: _cache[0] || (_cache[0] = (...args) => _ctx.hoverItem && _ctx.hoverItem(...args)),
  39047. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)((...args) => _ctx.selectOptionClick && _ctx.selectOptionClick(...args), ["stop"]))
  39048. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {
  39049. item: _ctx.item,
  39050. index: _ctx.index,
  39051. disabled: _ctx.disabled
  39052. }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.getLabel(_ctx.item)), 1)])], 46, _hoisted_1$22);
  39053. }
  39054. var option_item_default = /* @__PURE__ */ _plugin_vue_export_helper_default(option_item_vue_vue_type_script_lang_default, [["render", _sfc_render$6]]);
  39055. //#endregion
  39056. //#region ../../packages/components/select-v2/src/select-dropdown.tsx
  39057. const props = {
  39058. loading: Boolean,
  39059. data: {
  39060. type: Array,
  39061. required: true
  39062. },
  39063. hoveringIndex: Number,
  39064. width: Number,
  39065. id: String,
  39066. ariaLabel: String
  39067. };
  39068. var select_dropdown_default = /* @__PURE__ */ (0, vue.defineComponent)({
  39069. name: "ElSelectDropdown",
  39070. props,
  39071. setup(props, { slots, expose }) {
  39072. const select = (0, vue.inject)(selectV2InjectionKey);
  39073. const ns = useNamespace("select");
  39074. const { getLabel, getValue, getDisabled } = useProps(select.props);
  39075. const cachedHeights = (0, vue.ref)([]);
  39076. const listRef = (0, vue.ref)();
  39077. const size = (0, vue.computed)(() => props.data.length);
  39078. (0, vue.watch)(() => size.value, () => {
  39079. select.tooltipRef.value?.updatePopper?.();
  39080. });
  39081. const isSized = (0, vue.computed)(() => isUndefined(select.props.estimatedOptionHeight));
  39082. const listProps = (0, vue.computed)(() => {
  39083. if (isSized.value) return { itemSize: select.props.itemHeight };
  39084. return {
  39085. estimatedSize: select.props.estimatedOptionHeight,
  39086. itemSize: (idx) => cachedHeights.value[idx]
  39087. };
  39088. });
  39089. const contains = (arr = [], target) => {
  39090. const { props: { valueKey } } = select;
  39091. if (!isObject$1(target)) return arr.includes(target);
  39092. return arr && arr.some((item) => {
  39093. return (0, vue.toRaw)(get(item, valueKey)) === get(target, valueKey);
  39094. });
  39095. };
  39096. const isEqual = (selected, target) => {
  39097. if (!isObject$1(target)) return selected === target;
  39098. else {
  39099. const { valueKey } = select.props;
  39100. return get(selected, valueKey) === get(target, valueKey);
  39101. }
  39102. };
  39103. const isItemSelected = (modelValue, target) => {
  39104. if (select.props.multiple) return contains(modelValue, getValue(target));
  39105. return isEqual(modelValue, getValue(target));
  39106. };
  39107. const isItemDisabled = (modelValue, selected) => {
  39108. const { disabled, multiple, multipleLimit } = select.props;
  39109. return disabled || !selected && (multiple ? multipleLimit > 0 && modelValue.length >= multipleLimit : false);
  39110. };
  39111. const isItemHovering = (target) => props.hoveringIndex === target;
  39112. const scrollToItem = (index) => {
  39113. const list = listRef.value;
  39114. if (list) list.scrollToItem(index);
  39115. };
  39116. const resetScrollTop = () => {
  39117. const list = listRef.value;
  39118. if (list) list.resetScrollTop();
  39119. };
  39120. expose({
  39121. listRef,
  39122. isSized,
  39123. isItemDisabled,
  39124. isItemHovering,
  39125. isItemSelected,
  39126. scrollToItem,
  39127. resetScrollTop
  39128. });
  39129. const Item = (itemProps) => {
  39130. const { index, data, style } = itemProps;
  39131. const sized = (0, vue.unref)(isSized);
  39132. const { itemSize, estimatedSize } = (0, vue.unref)(listProps);
  39133. const { modelValue } = select.props;
  39134. const { onSelect, onHover } = select;
  39135. const item = data[index];
  39136. if (item.type === "Group") return (0, vue.createVNode)(group_item_default, {
  39137. "item": item,
  39138. "style": style,
  39139. "height": sized ? itemSize : estimatedSize
  39140. }, null);
  39141. const isSelected = isItemSelected(modelValue, item);
  39142. const isDisabled = isItemDisabled(modelValue, isSelected);
  39143. const isHovering = isItemHovering(index);
  39144. return (0, vue.createVNode)(option_item_default, (0, vue.mergeProps)(itemProps, {
  39145. "selected": isSelected,
  39146. "disabled": getDisabled(item) || isDisabled,
  39147. "created": !!item.created,
  39148. "hovering": isHovering,
  39149. "item": item,
  39150. "onSelect": onSelect,
  39151. "onHover": onHover
  39152. }), { default: (props) => slots.default?.(props) || (0, vue.createVNode)("span", null, [getLabel(item)]) });
  39153. };
  39154. const { onKeyboardNavigate, onKeyboardSelect } = select;
  39155. const onForward = () => {
  39156. onKeyboardNavigate("forward");
  39157. };
  39158. const onBackward = () => {
  39159. onKeyboardNavigate("backward");
  39160. };
  39161. const onEscOrTab = () => {};
  39162. const onKeydown = (e) => {
  39163. const code = getEventCode(e);
  39164. const { tab, esc, down, up, enter, numpadEnter } = EVENT_CODE;
  39165. if ([
  39166. esc,
  39167. down,
  39168. up,
  39169. enter,
  39170. numpadEnter
  39171. ].includes(code)) {
  39172. e.preventDefault();
  39173. e.stopPropagation();
  39174. }
  39175. switch (code) {
  39176. case tab:
  39177. case esc:
  39178. onEscOrTab();
  39179. break;
  39180. case down:
  39181. onForward();
  39182. break;
  39183. case up:
  39184. onBackward();
  39185. break;
  39186. case enter:
  39187. case numpadEnter:
  39188. onKeyboardSelect();
  39189. break;
  39190. }
  39191. };
  39192. return () => {
  39193. const { data, width } = props;
  39194. const { height, multiple, scrollbarAlwaysOn } = select.props;
  39195. const isScrollbarAlwaysOn = (0, vue.computed)(() => {
  39196. return isIOS ? true : scrollbarAlwaysOn;
  39197. });
  39198. const List = (0, vue.unref)(isSized) ? FixedSizeList : DynamicSizeList;
  39199. return (0, vue.createVNode)("div", {
  39200. "class": [ns.b("dropdown"), ns.is("multiple", multiple)],
  39201. "style": { width: `${width}px` }
  39202. }, [
  39203. slots.header?.(),
  39204. slots.loading?.() || slots.empty?.() || (0, vue.createVNode)(List, (0, vue.mergeProps)({ "ref": listRef }, (0, vue.unref)(listProps), {
  39205. "className": ns.be("dropdown", "list"),
  39206. "scrollbarAlwaysOn": isScrollbarAlwaysOn.value,
  39207. "data": data,
  39208. "height": height,
  39209. "width": width,
  39210. "total": data.length,
  39211. "innerElement": "ul",
  39212. "innerProps": {
  39213. id: props.id,
  39214. role: "listbox",
  39215. "aria-label": props.ariaLabel,
  39216. "aria-orientation": "vertical"
  39217. },
  39218. "onKeydown": onKeydown
  39219. }), { default: (props) => (0, vue.createVNode)(Item, props, null) }),
  39220. slots.footer?.()
  39221. ]);
  39222. };
  39223. }
  39224. });
  39225. //#endregion
  39226. //#region ../../packages/components/select-v2/src/useAllowCreate.ts
  39227. function useAllowCreate(props, states) {
  39228. const { aliasProps, getLabel, getValue } = useProps(props);
  39229. const createOptionCount = (0, vue.ref)(0);
  39230. const cachedSelectedOption = (0, vue.ref)();
  39231. const enableAllowCreateMode = (0, vue.computed)(() => {
  39232. return props.allowCreate && props.filterable;
  39233. });
  39234. (0, vue.watch)(() => props.options, (options) => {
  39235. const optionLabelsSet = new Set(options.map((option) => getLabel(option)));
  39236. states.createdOptions = states.createdOptions.filter((createdOption) => !optionLabelsSet.has(getLabel(createdOption)));
  39237. });
  39238. function hasExistingOption(query) {
  39239. const hasOption = (option) => getLabel(option) === query;
  39240. return props.options && props.options.some(hasOption) || states.createdOptions.some(hasOption);
  39241. }
  39242. function selectNewOption(option) {
  39243. if (!enableAllowCreateMode.value) return;
  39244. if (props.multiple && option.created) createOptionCount.value++;
  39245. else cachedSelectedOption.value = option;
  39246. }
  39247. function createNewOption(query) {
  39248. if (enableAllowCreateMode.value) if (query && query.length > 0) {
  39249. if (hasExistingOption(query)) {
  39250. states.createdOptions = states.createdOptions.filter((createdOption) => getLabel(createdOption) !== states.previousQuery);
  39251. return;
  39252. }
  39253. const newOption = {
  39254. [aliasProps.value.value]: query,
  39255. [aliasProps.value.label]: query,
  39256. created: true,
  39257. [aliasProps.value.disabled]: false
  39258. };
  39259. if (states.createdOptions.length >= createOptionCount.value) states.createdOptions[createOptionCount.value] = newOption;
  39260. else states.createdOptions.push(newOption);
  39261. } else if (props.multiple) states.createdOptions.length = createOptionCount.value;
  39262. else {
  39263. const selectedOption = cachedSelectedOption.value;
  39264. states.createdOptions.length = 0;
  39265. if (selectedOption && selectedOption.created) states.createdOptions.push(selectedOption);
  39266. }
  39267. }
  39268. function removeNewOption(option) {
  39269. if (!enableAllowCreateMode.value || !option || !option.created || option.created && props.reserveKeyword && states.inputValue === getLabel(option)) return;
  39270. const idx = states.createdOptions.findIndex((it) => getValue(it) === getValue(option));
  39271. if (~idx) {
  39272. states.createdOptions.splice(idx, 1);
  39273. createOptionCount.value--;
  39274. }
  39275. }
  39276. function clearAllNewOption() {
  39277. if (enableAllowCreateMode.value) {
  39278. states.createdOptions.length = 0;
  39279. createOptionCount.value = 0;
  39280. }
  39281. }
  39282. return {
  39283. createNewOption,
  39284. removeNewOption,
  39285. selectNewOption,
  39286. clearAllNewOption
  39287. };
  39288. }
  39289. //#endregion
  39290. //#region ../../packages/components/select-v2/src/useSelect.ts
  39291. const useSelect$1 = (props, emit) => {
  39292. const { t } = useLocale();
  39293. const slots = (0, vue.useSlots)();
  39294. const nsSelect = useNamespace("select");
  39295. const nsInput = useNamespace("input");
  39296. const { form: elForm, formItem: elFormItem } = useFormItem();
  39297. const { inputId } = useFormItemInputId(props, { formItemContext: elFormItem });
  39298. const { aliasProps, getLabel, getValue, getDisabled, getOptions } = useProps(props);
  39299. const { valueOnClear, isEmptyValue } = useEmptyValues(props);
  39300. const states = (0, vue.reactive)({
  39301. inputValue: "",
  39302. cachedOptions: [],
  39303. createdOptions: [],
  39304. hoveringIndex: -1,
  39305. inputHovering: false,
  39306. selectionWidth: 0,
  39307. collapseItemWidth: 0,
  39308. previousQuery: null,
  39309. previousValue: void 0,
  39310. selectedLabel: "",
  39311. menuVisibleOnFocus: false,
  39312. isBeforeHide: false
  39313. });
  39314. const popperSize = (0, vue.ref)(-1);
  39315. const debouncing = (0, vue.ref)(false);
  39316. const selectRef = (0, vue.ref)();
  39317. const selectionRef = (0, vue.ref)();
  39318. const tooltipRef = (0, vue.ref)();
  39319. const tagTooltipRef = (0, vue.ref)();
  39320. const inputRef = (0, vue.ref)();
  39321. const prefixRef = (0, vue.ref)();
  39322. const suffixRef = (0, vue.ref)();
  39323. const menuRef = (0, vue.ref)();
  39324. const tagMenuRef = (0, vue.ref)();
  39325. const collapseItemRef = (0, vue.ref)();
  39326. const { isComposing, handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } = useComposition({ afterComposition: (e) => onInput(e) });
  39327. const selectDisabled = useFormDisabled();
  39328. const { wrapperRef, isFocused, handleBlur } = useFocusController(inputRef, {
  39329. disabled: selectDisabled,
  39330. afterFocus() {
  39331. if (props.automaticDropdown && !expanded.value) {
  39332. expanded.value = true;
  39333. states.menuVisibleOnFocus = true;
  39334. }
  39335. },
  39336. beforeBlur(event) {
  39337. return tooltipRef.value?.isFocusInsideContent(event) || tagTooltipRef.value?.isFocusInsideContent(event);
  39338. },
  39339. afterBlur() {
  39340. expanded.value = false;
  39341. states.menuVisibleOnFocus = false;
  39342. if (props.validateEvent) elFormItem?.validate?.("blur").catch((err) => /* @__PURE__ */ debugWarn(err));
  39343. }
  39344. });
  39345. const allOptions = (0, vue.computed)(() => filterOptions(""));
  39346. const hasOptions = (0, vue.computed)(() => {
  39347. if (props.loading) return false;
  39348. return props.options.length > 0 || states.createdOptions.length > 0;
  39349. });
  39350. const filteredOptions = (0, vue.ref)([]);
  39351. const expanded = (0, vue.ref)(false);
  39352. const needStatusIcon = (0, vue.computed)(() => elForm?.statusIcon ?? false);
  39353. const popupHeight = (0, vue.computed)(() => {
  39354. const totalHeight = filteredOptions.value.length * props.itemHeight;
  39355. return totalHeight > props.height ? props.height : totalHeight;
  39356. });
  39357. const hasModelValue = (0, vue.computed)(() => {
  39358. return props.multiple ? isArray$1(props.modelValue) && props.modelValue.length > 0 : !isEmptyValue(props.modelValue);
  39359. });
  39360. const showClearBtn = (0, vue.computed)(() => {
  39361. return props.clearable && !selectDisabled.value && hasModelValue.value && (isFocused.value || states.inputHovering);
  39362. });
  39363. const iconComponent = (0, vue.computed)(() => props.remote && props.filterable && !props.remoteShowSuffix ? "" : props.suffixIcon);
  39364. const iconReverse = (0, vue.computed)(() => iconComponent.value && nsSelect.is("reverse", expanded.value));
  39365. const validateState = (0, vue.computed)(() => elFormItem?.validateState || "");
  39366. const validateIcon = (0, vue.computed)(() => {
  39367. if (!validateState.value) return;
  39368. return ValidateComponentsMap[validateState.value];
  39369. });
  39370. const debounce = (0, vue.computed)(() => props.remote ? props.debounce : 0);
  39371. const isRemoteSearchEmpty = (0, vue.computed)(() => props.remote && !states.inputValue && !hasOptions.value);
  39372. const emptyText = (0, vue.computed)(() => {
  39373. if (props.loading) return props.loadingText || t("el.select.loading");
  39374. else {
  39375. if (props.filterable && states.inputValue && hasOptions.value && filteredOptions.value.length === 0) return props.noMatchText || t("el.select.noMatch");
  39376. if (!hasOptions.value) return props.noDataText || t("el.select.noData");
  39377. }
  39378. return null;
  39379. });
  39380. const isFilterMethodValid = (0, vue.computed)(() => props.filterable && isFunction$1(props.filterMethod));
  39381. const isRemoteMethodValid = (0, vue.computed)(() => props.filterable && props.remote && isFunction$1(props.remoteMethod));
  39382. const filterOptions = (query) => {
  39383. const regexp = new RegExp(escapeStringRegexp(query), "i");
  39384. const isValidOption = (o) => {
  39385. if (isFilterMethodValid.value || isRemoteMethodValid.value) return true;
  39386. return query ? regexp.test(getLabel(o) || "") : true;
  39387. };
  39388. if (props.loading) return [];
  39389. return [...states.createdOptions, ...props.options].reduce((all, item) => {
  39390. const options = getOptions(item);
  39391. if (isArray$1(options)) {
  39392. const filtered = options.filter(isValidOption);
  39393. if (filtered.length > 0) all.push({
  39394. label: getLabel(item),
  39395. type: "Group"
  39396. }, ...filtered);
  39397. } else if (props.remote || isValidOption(item)) all.push(item);
  39398. return all;
  39399. }, []);
  39400. };
  39401. const updateOptions = () => {
  39402. filteredOptions.value = filterOptions(states.inputValue);
  39403. };
  39404. const allOptionsValueMap = (0, vue.computed)(() => {
  39405. const valueMap = /* @__PURE__ */ new Map();
  39406. allOptions.value.forEach((option, index) => {
  39407. valueMap.set(getValueKey(getValue(option)), {
  39408. option,
  39409. index
  39410. });
  39411. });
  39412. return valueMap;
  39413. });
  39414. const filteredOptionsValueMap = (0, vue.computed)(() => {
  39415. const valueMap = /* @__PURE__ */ new Map();
  39416. filteredOptions.value.forEach((option, index) => {
  39417. valueMap.set(getValueKey(getValue(option)), {
  39418. option,
  39419. index
  39420. });
  39421. });
  39422. return valueMap;
  39423. });
  39424. const optionsAllDisabled = (0, vue.computed)(() => filteredOptions.value.every((option) => getDisabled(option)));
  39425. const selectSize = useFormSize();
  39426. const collapseTagSize = (0, vue.computed)(() => "small" === selectSize.value ? "small" : "default");
  39427. const calculatePopperSize = () => {
  39428. if (isNumber(props.fitInputWidth)) {
  39429. popperSize.value = props.fitInputWidth;
  39430. return;
  39431. }
  39432. const width = selectRef.value?.offsetWidth || 200;
  39433. if (!props.fitInputWidth && hasOptions.value) (0, vue.nextTick)(() => {
  39434. popperSize.value = Math.max(width, calculateLabelMaxWidth());
  39435. });
  39436. else popperSize.value = width;
  39437. };
  39438. const calculateLabelMaxWidth = () => {
  39439. const ctx = document.createElement("canvas").getContext("2d");
  39440. const selector = nsSelect.be("dropdown", "item");
  39441. const dropdownItemEl = (menuRef.value?.listRef?.innerRef || document).querySelector(`.${selector}`);
  39442. if (dropdownItemEl === null || ctx === null) return 0;
  39443. const style = getComputedStyle(dropdownItemEl);
  39444. const padding = Number.parseFloat(style.paddingLeft) + Number.parseFloat(style.paddingRight);
  39445. ctx.font = `bold ${style.font.replace(new RegExp(`\\b${style.fontWeight}\\b`), "")}`;
  39446. return filteredOptions.value.reduce((max, option) => {
  39447. const metrics = ctx.measureText(getLabel(option));
  39448. return Math.max(metrics.width, max);
  39449. }, 0) + padding;
  39450. };
  39451. const getGapWidth = () => {
  39452. if (!selectionRef.value) return 0;
  39453. const style = window.getComputedStyle(selectionRef.value);
  39454. return Number.parseFloat(style.gap || "6px");
  39455. };
  39456. const tagStyle = (0, vue.computed)(() => {
  39457. const gapWidth = getGapWidth();
  39458. const inputSlotWidth = props.filterable ? gapWidth + MINIMUM_INPUT_WIDTH : 0;
  39459. return { maxWidth: `${collapseItemRef.value && props.maxCollapseTags === 1 ? states.selectionWidth - states.collapseItemWidth - gapWidth - inputSlotWidth : states.selectionWidth - inputSlotWidth}px` };
  39460. });
  39461. const collapseTagStyle = (0, vue.computed)(() => {
  39462. return { maxWidth: `${states.selectionWidth}px` };
  39463. });
  39464. const shouldShowPlaceholder = (0, vue.computed)(() => {
  39465. if (isArray$1(props.modelValue)) return props.modelValue.length === 0 && !states.inputValue;
  39466. return props.filterable ? !states.inputValue : true;
  39467. });
  39468. const currentPlaceholder = (0, vue.computed)(() => {
  39469. const _placeholder = props.placeholder ?? t("el.select.placeholder");
  39470. return props.multiple || !hasModelValue.value ? _placeholder : states.selectedLabel;
  39471. });
  39472. const popperRef = (0, vue.computed)(() => tooltipRef.value?.popperRef?.contentRef);
  39473. const indexRef = (0, vue.computed)(() => {
  39474. if (props.multiple) {
  39475. const len = props.modelValue.length;
  39476. if (len > 0 && filteredOptionsValueMap.value.has(props.modelValue[len - 1])) {
  39477. const { index } = filteredOptionsValueMap.value.get(props.modelValue[len - 1]);
  39478. return index;
  39479. }
  39480. } else if (!isEmptyValue(props.modelValue) && filteredOptionsValueMap.value.has(props.modelValue)) {
  39481. const { index } = filteredOptionsValueMap.value.get(props.modelValue);
  39482. return index;
  39483. }
  39484. return -1;
  39485. });
  39486. const dropdownMenuVisible = (0, vue.computed)({
  39487. get() {
  39488. return expanded.value && (props.loading || !isRemoteSearchEmpty.value || props.remote && !!slots.empty) && (!debouncing.value || !isEmpty(states.previousQuery));
  39489. },
  39490. set(val) {
  39491. expanded.value = val;
  39492. }
  39493. });
  39494. const showTagList = (0, vue.computed)(() => {
  39495. if (!props.multiple) return [];
  39496. return props.collapseTags ? states.cachedOptions.slice(0, props.maxCollapseTags) : states.cachedOptions;
  39497. });
  39498. const collapseTagList = (0, vue.computed)(() => {
  39499. if (!props.multiple) return [];
  39500. return props.collapseTags ? states.cachedOptions.slice(props.maxCollapseTags) : [];
  39501. });
  39502. const { createNewOption, removeNewOption, selectNewOption, clearAllNewOption } = useAllowCreate(props, states);
  39503. const toggleMenu = (event) => {
  39504. if (selectDisabled.value || props.filterable && expanded.value && event && !suffixRef.value?.contains(event.target)) return;
  39505. if (states.menuVisibleOnFocus) states.menuVisibleOnFocus = false;
  39506. else expanded.value = !expanded.value;
  39507. };
  39508. const onInputChange = () => {
  39509. if (states.inputValue.length > 0 && !expanded.value) expanded.value = true;
  39510. createNewOption(states.inputValue);
  39511. (0, vue.nextTick)(() => {
  39512. handleQueryChange(states.inputValue);
  39513. });
  39514. };
  39515. const debouncedOnInputChange = useDebounceFn(() => {
  39516. onInputChange();
  39517. debouncing.value = false;
  39518. }, debounce);
  39519. const handleQueryChange = (val) => {
  39520. if (states.previousQuery === val || isComposing.value) return;
  39521. states.previousQuery = val;
  39522. if (props.filterable && isFunction$1(props.filterMethod)) props.filterMethod(val);
  39523. else if (props.filterable && props.remote && isFunction$1(props.remoteMethod)) props.remoteMethod(val);
  39524. if (props.defaultFirstOption && (props.filterable || props.remote) && filteredOptions.value.length) (0, vue.nextTick)(checkDefaultFirstOption);
  39525. else (0, vue.nextTick)(updateHoveringIndex);
  39526. };
  39527. /**
  39528. * find and highlight first option as default selected
  39529. * @remark
  39530. * - if the first option in dropdown list is user-created,
  39531. * it would be at the end of the optionsArray
  39532. * so find it and set hover.
  39533. * (NOTE: there must be only one user-created option in dropdown list with query)
  39534. * - if there's no user-created option in list, just find the first one as usual
  39535. * (NOTE: exclude options that are disabled or in disabled-group)
  39536. */
  39537. const checkDefaultFirstOption = () => {
  39538. const optionsInDropdown = filteredOptions.value.filter((n) => !n.disabled && n.type !== "Group");
  39539. const userCreatedOption = optionsInDropdown.find((n) => n.created);
  39540. const firstOriginOption = optionsInDropdown[0];
  39541. states.hoveringIndex = getValueIndex(filteredOptions.value, userCreatedOption || firstOriginOption);
  39542. };
  39543. const emitChange = (val) => {
  39544. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  39545. };
  39546. const update = (val) => {
  39547. emit(UPDATE_MODEL_EVENT, val);
  39548. emitChange(val);
  39549. states.previousValue = props.multiple ? String(val) : val;
  39550. (0, vue.nextTick)(() => {
  39551. if (props.multiple && isArray$1(props.modelValue)) {
  39552. const cachedOptions = states.cachedOptions.slice();
  39553. const selectedOptions = props.modelValue.map((value) => getOption(value, cachedOptions));
  39554. if (!isEqual$1(states.cachedOptions, selectedOptions)) states.cachedOptions = selectedOptions;
  39555. } else initStates(true);
  39556. });
  39557. };
  39558. const getValueIndex = (arr = [], value) => {
  39559. if (!isObject$1(value)) return arr.indexOf(value);
  39560. const valueKey = props.valueKey;
  39561. let index = -1;
  39562. arr.some((item, i) => {
  39563. if (get(item, valueKey) === get(value, valueKey)) {
  39564. index = i;
  39565. return true;
  39566. }
  39567. return false;
  39568. });
  39569. return index;
  39570. };
  39571. const getValueKey = (item) => {
  39572. return isObject$1(item) ? get(item, props.valueKey) : item;
  39573. };
  39574. const handleResize = () => {
  39575. calculatePopperSize();
  39576. };
  39577. const resetSelectionWidth = () => {
  39578. states.selectionWidth = Number.parseFloat(window.getComputedStyle(selectionRef.value).width);
  39579. };
  39580. const resetCollapseItemWidth = () => {
  39581. states.collapseItemWidth = collapseItemRef.value.getBoundingClientRect().width;
  39582. };
  39583. const updateTooltip = () => {
  39584. tooltipRef.value?.updatePopper?.();
  39585. };
  39586. const updateTagTooltip = () => {
  39587. tagTooltipRef.value?.updatePopper?.();
  39588. };
  39589. const onSelect = (option) => {
  39590. const optionValue = getValue(option);
  39591. if (props.multiple) {
  39592. let selectedOptions = props.modelValue.slice();
  39593. const index = getValueIndex(selectedOptions, optionValue);
  39594. if (index > -1) {
  39595. selectedOptions = [...selectedOptions.slice(0, index), ...selectedOptions.slice(index + 1)];
  39596. states.cachedOptions.splice(index, 1);
  39597. removeNewOption(option);
  39598. } else if (props.multipleLimit <= 0 || selectedOptions.length < props.multipleLimit) {
  39599. selectedOptions = [...selectedOptions, optionValue];
  39600. states.cachedOptions.push(option);
  39601. selectNewOption(option);
  39602. }
  39603. update(selectedOptions);
  39604. if (option.created) handleQueryChange("");
  39605. if (props.filterable && (option.created || !props.reserveKeyword)) states.inputValue = "";
  39606. } else {
  39607. states.selectedLabel = getLabel(option);
  39608. !isEqual$1(props.modelValue, optionValue) && update(optionValue);
  39609. expanded.value = false;
  39610. selectNewOption(option);
  39611. if (!option.created) clearAllNewOption();
  39612. }
  39613. focus();
  39614. };
  39615. const deleteTag = (event, option) => {
  39616. let selectedOptions = props.modelValue.slice();
  39617. const index = getValueIndex(selectedOptions, getValue(option));
  39618. if (index > -1 && !selectDisabled.value) {
  39619. selectedOptions = [...props.modelValue.slice(0, index), ...props.modelValue.slice(index + 1)];
  39620. states.cachedOptions.splice(index, 1);
  39621. update(selectedOptions);
  39622. emit("remove-tag", getValue(option));
  39623. removeNewOption(option);
  39624. }
  39625. event.stopPropagation();
  39626. focus();
  39627. };
  39628. const focus = () => {
  39629. inputRef.value?.focus();
  39630. };
  39631. const blur = () => {
  39632. if (expanded.value) {
  39633. expanded.value = false;
  39634. (0, vue.nextTick)(() => inputRef.value?.blur());
  39635. return;
  39636. }
  39637. inputRef.value?.blur();
  39638. };
  39639. const handleEsc = () => {
  39640. if (states.inputValue.length > 0) states.inputValue = "";
  39641. else expanded.value = false;
  39642. };
  39643. const getLastNotDisabledIndex = (value) => findLastIndex(value, (it) => !states.cachedOptions.some((option) => getValue(option) === it && getDisabled(option)));
  39644. const handleDel = (e) => {
  39645. const code = getEventCode(e);
  39646. if (!props.multiple) return;
  39647. if (code === EVENT_CODE.delete) return;
  39648. if (states.inputValue.length === 0) {
  39649. e.preventDefault();
  39650. const selected = props.modelValue.slice();
  39651. const lastNotDisabledIndex = getLastNotDisabledIndex(selected);
  39652. if (lastNotDisabledIndex < 0) return;
  39653. const removeTagValue = selected[lastNotDisabledIndex];
  39654. selected.splice(lastNotDisabledIndex, 1);
  39655. const option = states.cachedOptions[lastNotDisabledIndex];
  39656. states.cachedOptions.splice(lastNotDisabledIndex, 1);
  39657. removeNewOption(option);
  39658. update(selected);
  39659. emit("remove-tag", removeTagValue);
  39660. }
  39661. };
  39662. const handleClear = () => {
  39663. let emptyValue;
  39664. if (isArray$1(props.modelValue)) emptyValue = [];
  39665. else emptyValue = valueOnClear.value;
  39666. states.selectedLabel = "";
  39667. expanded.value = false;
  39668. update(emptyValue);
  39669. emit("clear");
  39670. clearAllNewOption();
  39671. focus();
  39672. };
  39673. const onKeyboardNavigate = (direction, hoveringIndex = void 0) => {
  39674. const options = filteredOptions.value;
  39675. if (!["forward", "backward"].includes(direction) || selectDisabled.value || options.length <= 0 || optionsAllDisabled.value || isComposing.value) return;
  39676. if (!expanded.value) return toggleMenu();
  39677. if (isUndefined(hoveringIndex)) hoveringIndex = states.hoveringIndex;
  39678. let newIndex = -1;
  39679. if (direction === "forward") {
  39680. newIndex = hoveringIndex + 1;
  39681. if (newIndex >= options.length) newIndex = 0;
  39682. } else if (direction === "backward") {
  39683. newIndex = hoveringIndex - 1;
  39684. if (newIndex < 0 || newIndex >= options.length) newIndex = options.length - 1;
  39685. }
  39686. const option = options[newIndex];
  39687. if (getDisabled(option) || option.type === "Group") return onKeyboardNavigate(direction, newIndex);
  39688. else {
  39689. states.hoveringIndex = newIndex;
  39690. scrollToItem(newIndex);
  39691. }
  39692. };
  39693. const onKeyboardSelect = () => {
  39694. if (!expanded.value) return toggleMenu();
  39695. else if (~states.hoveringIndex && filteredOptions.value[states.hoveringIndex]) onSelect(filteredOptions.value[states.hoveringIndex]);
  39696. };
  39697. const onHoverOption = (idx) => {
  39698. states.hoveringIndex = idx ?? -1;
  39699. };
  39700. const updateHoveringIndex = () => {
  39701. if (!props.multiple) states.hoveringIndex = filteredOptions.value.findIndex((item) => {
  39702. return getValueKey(getValue(item)) === getValueKey(props.modelValue);
  39703. });
  39704. else {
  39705. const length = props.modelValue.length;
  39706. if (length > 0) {
  39707. const lastValue = props.modelValue[length - 1];
  39708. states.hoveringIndex = filteredOptions.value.findIndex((item) => getValueKey(lastValue) === getValueKey(getValue(item)));
  39709. } else states.hoveringIndex = -1;
  39710. }
  39711. };
  39712. const onInput = (event) => {
  39713. states.inputValue = event.target.value;
  39714. if (props.remote) {
  39715. debouncing.value = true;
  39716. debouncedOnInputChange();
  39717. } else return onInputChange();
  39718. };
  39719. const handleClickOutside = (event) => {
  39720. expanded.value = false;
  39721. if (isFocused.value) handleBlur(new FocusEvent("blur", event));
  39722. };
  39723. const handleMenuEnter = () => {
  39724. states.isBeforeHide = false;
  39725. return (0, vue.nextTick)(() => {
  39726. if (~indexRef.value) scrollToItem(indexRef.value);
  39727. });
  39728. };
  39729. const scrollToItem = (index) => {
  39730. menuRef.value.scrollToItem(index);
  39731. };
  39732. const getOption = (value, cachedOptions) => {
  39733. const selectValue = getValueKey(value);
  39734. if (allOptionsValueMap.value.has(selectValue)) {
  39735. const { option } = allOptionsValueMap.value.get(selectValue);
  39736. return option;
  39737. }
  39738. if (cachedOptions && cachedOptions.length) {
  39739. const option = cachedOptions.find((option) => getValueKey(getValue(option)) === selectValue);
  39740. if (option) return option;
  39741. }
  39742. return {
  39743. [aliasProps.value.value]: value,
  39744. [aliasProps.value.label]: value
  39745. };
  39746. };
  39747. const getIndex = (option) => allOptionsValueMap.value.get(getValue(option))?.index ?? -1;
  39748. const initStates = (needUpdateSelectedLabel = false) => {
  39749. if (props.multiple) if (props.modelValue.length > 0) {
  39750. const cachedOptions = states.cachedOptions.slice();
  39751. states.cachedOptions.length = 0;
  39752. states.previousValue = props.modelValue.toString();
  39753. for (const value of props.modelValue) {
  39754. const option = getOption(value, cachedOptions);
  39755. states.cachedOptions.push(option);
  39756. }
  39757. } else {
  39758. states.cachedOptions = [];
  39759. states.previousValue = void 0;
  39760. }
  39761. else if (hasModelValue.value) {
  39762. states.previousValue = props.modelValue;
  39763. const options = filteredOptions.value;
  39764. const selectedItemIndex = options.findIndex((option) => getValueKey(getValue(option)) === getValueKey(props.modelValue));
  39765. if (~selectedItemIndex) states.selectedLabel = getLabel(options[selectedItemIndex]);
  39766. else if (!states.selectedLabel || needUpdateSelectedLabel) states.selectedLabel = getValueKey(props.modelValue);
  39767. } else {
  39768. states.selectedLabel = "";
  39769. states.previousValue = void 0;
  39770. }
  39771. clearAllNewOption();
  39772. calculatePopperSize();
  39773. };
  39774. (0, vue.watch)(() => props.fitInputWidth, () => {
  39775. calculatePopperSize();
  39776. });
  39777. (0, vue.watch)(expanded, (val) => {
  39778. if (val) {
  39779. if (!props.persistent) calculatePopperSize();
  39780. handleQueryChange("");
  39781. } else {
  39782. states.inputValue = "";
  39783. states.previousQuery = null;
  39784. states.isBeforeHide = true;
  39785. states.menuVisibleOnFocus = false;
  39786. createNewOption("");
  39787. }
  39788. });
  39789. (0, vue.watch)(() => props.modelValue, (val, oldVal) => {
  39790. if (!val || isArray$1(val) && val.length === 0 || props.multiple && !isEqual$1(val.toString(), states.previousValue) || !props.multiple && getValueKey(val) !== getValueKey(states.previousValue)) initStates(true);
  39791. if (!isEqual$1(val, oldVal) && props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  39792. }, { deep: true });
  39793. (0, vue.watch)(() => props.options, () => {
  39794. const input = inputRef.value;
  39795. if (!input || input && document.activeElement !== input) initStates();
  39796. }, {
  39797. deep: true,
  39798. flush: "post"
  39799. });
  39800. (0, vue.watch)(() => filteredOptions.value, () => {
  39801. calculatePopperSize();
  39802. return menuRef.value && (0, vue.nextTick)(menuRef.value.resetScrollTop);
  39803. });
  39804. (0, vue.watchEffect)(() => {
  39805. if (states.isBeforeHide) return;
  39806. updateOptions();
  39807. });
  39808. (0, vue.watchEffect)(() => {
  39809. const { valueKey, options } = props;
  39810. const duplicateValue = /* @__PURE__ */ new Map();
  39811. for (const item of options) {
  39812. const optionValue = getValue(item);
  39813. let v = optionValue;
  39814. if (isObject$1(v)) v = get(optionValue, valueKey);
  39815. if (duplicateValue.get(v)) {
  39816. /* @__PURE__ */ debugWarn("ElSelectV2", `The option values you provided seem to be duplicated, which may cause some problems, please check.`);
  39817. break;
  39818. } else duplicateValue.set(v, true);
  39819. }
  39820. });
  39821. (0, vue.onMounted)(() => {
  39822. initStates();
  39823. });
  39824. useResizeObserver(selectRef, handleResize);
  39825. useResizeObserver(selectionRef, resetSelectionWidth);
  39826. useResizeObserver(wrapperRef, updateTooltip);
  39827. useResizeObserver(tagMenuRef, updateTagTooltip);
  39828. useResizeObserver(collapseItemRef, resetCollapseItemWidth);
  39829. let stop;
  39830. (0, vue.watch)(() => dropdownMenuVisible.value, (newVal) => {
  39831. if (newVal) stop = useResizeObserver(menuRef, updateTooltip).stop;
  39832. else {
  39833. stop?.();
  39834. stop = void 0;
  39835. }
  39836. emit("visible-change", newVal);
  39837. });
  39838. return {
  39839. inputId,
  39840. collapseTagSize,
  39841. currentPlaceholder,
  39842. expanded,
  39843. emptyText,
  39844. popupHeight,
  39845. debounce,
  39846. allOptions,
  39847. allOptionsValueMap,
  39848. filteredOptions,
  39849. iconComponent,
  39850. iconReverse,
  39851. tagStyle,
  39852. collapseTagStyle,
  39853. popperSize,
  39854. dropdownMenuVisible,
  39855. hasModelValue,
  39856. shouldShowPlaceholder,
  39857. selectDisabled,
  39858. selectSize,
  39859. needStatusIcon,
  39860. showClearBtn,
  39861. states,
  39862. isFocused,
  39863. nsSelect,
  39864. nsInput,
  39865. inputRef,
  39866. menuRef,
  39867. tagMenuRef,
  39868. tooltipRef,
  39869. tagTooltipRef,
  39870. selectRef,
  39871. wrapperRef,
  39872. selectionRef,
  39873. prefixRef,
  39874. suffixRef,
  39875. collapseItemRef,
  39876. popperRef,
  39877. validateState,
  39878. validateIcon,
  39879. showTagList,
  39880. collapseTagList,
  39881. debouncedOnInputChange,
  39882. deleteTag,
  39883. getLabel,
  39884. getValue,
  39885. getDisabled,
  39886. getValueKey,
  39887. getIndex,
  39888. handleClear,
  39889. handleClickOutside,
  39890. handleDel,
  39891. handleEsc,
  39892. focus,
  39893. blur,
  39894. handleMenuEnter,
  39895. handleResize,
  39896. resetSelectionWidth,
  39897. updateTooltip,
  39898. updateTagTooltip,
  39899. updateOptions,
  39900. toggleMenu,
  39901. scrollTo: scrollToItem,
  39902. onInput,
  39903. onKeyboardNavigate,
  39904. onKeyboardSelect,
  39905. onSelect,
  39906. onHover: onHoverOption,
  39907. handleCompositionStart,
  39908. handleCompositionEnd,
  39909. handleCompositionUpdate
  39910. };
  39911. };
  39912. //#endregion
  39913. //#region ../../packages/components/select-v2/src/select.vue?vue&type=script&lang.ts
  39914. var select_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  39915. name: "ElSelectV2",
  39916. components: {
  39917. ElSelectMenu: select_dropdown_default,
  39918. ElTag,
  39919. ElTooltip,
  39920. ElIcon
  39921. },
  39922. directives: { ClickOutside },
  39923. props: selectV2Props,
  39924. emits: selectV2Emits,
  39925. setup(props, { emit }) {
  39926. const modelValue = (0, vue.computed)(() => {
  39927. const { modelValue: rawModelValue, multiple } = props;
  39928. const fallback = multiple ? [] : void 0;
  39929. if (isArray$1(rawModelValue)) return multiple ? rawModelValue : fallback;
  39930. return multiple ? fallback : rawModelValue;
  39931. });
  39932. const API = useSelect$1((0, vue.reactive)({
  39933. ...(0, vue.toRefs)(props),
  39934. modelValue
  39935. }), emit);
  39936. const { calculatorRef, inputStyle } = useCalcInputWidth();
  39937. const contentId = useId();
  39938. (0, vue.provide)(selectV2InjectionKey, {
  39939. props: (0, vue.reactive)({
  39940. ...(0, vue.toRefs)(props),
  39941. height: API.popupHeight,
  39942. modelValue
  39943. }),
  39944. expanded: API.expanded,
  39945. tooltipRef: API.tooltipRef,
  39946. contentId,
  39947. onSelect: API.onSelect,
  39948. onHover: API.onHover,
  39949. onKeyboardNavigate: API.onKeyboardNavigate,
  39950. onKeyboardSelect: API.onKeyboardSelect
  39951. });
  39952. const selectedLabel = (0, vue.computed)(() => {
  39953. if (!props.multiple) return API.states.selectedLabel;
  39954. return API.states.cachedOptions.map((i) => API.getLabel(i));
  39955. });
  39956. return {
  39957. ...API,
  39958. modelValue,
  39959. selectedLabel,
  39960. calculatorRef,
  39961. inputStyle,
  39962. contentId,
  39963. BORDER_HORIZONTAL_WIDTH
  39964. };
  39965. }
  39966. });
  39967. //#endregion
  39968. //#region ../../packages/components/select-v2/src/select.vue
  39969. const _hoisted_1$21 = [
  39970. "id",
  39971. "value",
  39972. "autocomplete",
  39973. "tabindex",
  39974. "aria-expanded",
  39975. "aria-label",
  39976. "disabled",
  39977. "aria-controls",
  39978. "aria-activedescendant",
  39979. "readonly",
  39980. "name"
  39981. ];
  39982. const _hoisted_2$13 = ["textContent"];
  39983. const _hoisted_3$5 = { key: 1 };
  39984. function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
  39985. const _component_el_tag = (0, vue.resolveComponent)("el-tag");
  39986. const _component_el_tooltip = (0, vue.resolveComponent)("el-tooltip");
  39987. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  39988. const _component_el_select_menu = (0, vue.resolveComponent)("el-select-menu");
  39989. const _directive_click_outside = (0, vue.resolveDirective)("click-outside");
  39990. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  39991. ref: "selectRef",
  39992. class: (0, vue.normalizeClass)([_ctx.nsSelect.b(), _ctx.nsSelect.m(_ctx.selectSize)]),
  39993. onMouseenter: _cache[15] || (_cache[15] = ($event) => _ctx.states.inputHovering = true),
  39994. onMouseleave: _cache[16] || (_cache[16] = ($event) => _ctx.states.inputHovering = false)
  39995. }, [(0, vue.createVNode)(_component_el_tooltip, {
  39996. ref: "tooltipRef",
  39997. visible: _ctx.dropdownMenuVisible,
  39998. teleported: _ctx.teleported,
  39999. "popper-class": [_ctx.nsSelect.e("popper"), _ctx.popperClass],
  40000. "popper-style": _ctx.popperStyle,
  40001. "gpu-acceleration": false,
  40002. "stop-popper-mouse-event": false,
  40003. "popper-options": _ctx.popperOptions,
  40004. "fallback-placements": _ctx.fallbackPlacements,
  40005. effect: _ctx.effect,
  40006. placement: _ctx.placement,
  40007. pure: "",
  40008. transition: `${_ctx.nsSelect.namespace.value}-zoom-in-top`,
  40009. trigger: "click",
  40010. persistent: _ctx.persistent,
  40011. "append-to": _ctx.appendTo,
  40012. "show-arrow": _ctx.showArrow,
  40013. offset: _ctx.offset,
  40014. onBeforeShow: _ctx.handleMenuEnter,
  40015. onHide: _cache[14] || (_cache[14] = ($event) => _ctx.states.isBeforeHide = false)
  40016. }, {
  40017. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  40018. ref: "wrapperRef",
  40019. class: (0, vue.normalizeClass)([
  40020. _ctx.nsSelect.e("wrapper"),
  40021. _ctx.nsSelect.is("focused", _ctx.isFocused),
  40022. _ctx.nsSelect.is("hovering", _ctx.states.inputHovering),
  40023. _ctx.nsSelect.is("filterable", _ctx.filterable),
  40024. _ctx.nsSelect.is("disabled", _ctx.selectDisabled)
  40025. ]),
  40026. onClick: _cache[11] || (_cache[11] = (0, vue.withModifiers)((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["prevent"]))
  40027. }, [
  40028. _ctx.$slots.prefix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  40029. key: 0,
  40030. ref: "prefixRef",
  40031. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("prefix"))
  40032. }, [(0, vue.renderSlot)(_ctx.$slots, "prefix")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  40033. (0, vue.createElementVNode)("div", {
  40034. ref: "selectionRef",
  40035. class: (0, vue.normalizeClass)([_ctx.nsSelect.e("selection"), _ctx.nsSelect.is("near", _ctx.multiple && !_ctx.$slots.prefix && !!_ctx.modelValue.length)])
  40036. }, [
  40037. _ctx.multiple ? (0, vue.renderSlot)(_ctx.$slots, "tag", {
  40038. key: 0,
  40039. data: _ctx.states.cachedOptions,
  40040. deleteTag: _ctx.deleteTag,
  40041. selectDisabled: _ctx.selectDisabled
  40042. }, () => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.showTagList, (item) => {
  40043. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  40044. key: _ctx.getValueKey(_ctx.getValue(item)),
  40045. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  40046. }, [(0, vue.createVNode)(_component_el_tag, {
  40047. closable: !_ctx.selectDisabled && !_ctx.getDisabled(item),
  40048. size: _ctx.collapseTagSize,
  40049. type: _ctx.tagType,
  40050. effect: _ctx.tagEffect,
  40051. "disable-transitions": "",
  40052. style: (0, vue.normalizeStyle)(_ctx.tagStyle),
  40053. onClose: ($event) => _ctx.deleteTag($event, item)
  40054. }, {
  40055. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, [(0, vue.renderSlot)(_ctx.$slots, "label", {
  40056. index: _ctx.getIndex(item),
  40057. label: _ctx.getLabel(item),
  40058. value: _ctx.getValue(item)
  40059. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.getLabel(item)), 1)])], 2)]),
  40060. _: 2
  40061. }, 1032, [
  40062. "closable",
  40063. "size",
  40064. "type",
  40065. "effect",
  40066. "style",
  40067. "onClose"
  40068. ])], 2);
  40069. }), 128)), _ctx.collapseTags && _ctx.states.cachedOptions.length > _ctx.maxCollapseTags ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tooltip, {
  40070. key: 0,
  40071. ref: "tagTooltipRef",
  40072. disabled: _ctx.dropdownMenuVisible || !_ctx.collapseTagsTooltip,
  40073. "fallback-placements": _ctx.tagTooltip?.fallbackPlacements ?? [
  40074. "bottom",
  40075. "top",
  40076. "right",
  40077. "left"
  40078. ],
  40079. effect: _ctx.tagTooltip?.effect ?? _ctx.effect,
  40080. placement: _ctx.tagTooltip?.placement ?? "bottom",
  40081. "popper-class": _ctx.tagTooltip?.popperClass ?? _ctx.popperClass,
  40082. "popper-style": _ctx.tagTooltip?.popperStyle ?? _ctx.popperStyle,
  40083. teleported: _ctx.tagTooltip?.teleported ?? _ctx.teleported,
  40084. "append-to": _ctx.tagTooltip?.appendTo ?? _ctx.appendTo,
  40085. "popper-options": _ctx.tagTooltip?.popperOptions ?? _ctx.popperOptions,
  40086. transition: _ctx.tagTooltip?.transition,
  40087. "show-after": _ctx.tagTooltip?.showAfter,
  40088. "hide-after": _ctx.tagTooltip?.hideAfter,
  40089. "auto-close": _ctx.tagTooltip?.autoClose,
  40090. offset: _ctx.tagTooltip?.offset
  40091. }, {
  40092. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  40093. ref: "collapseItemRef",
  40094. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  40095. }, [(0, vue.createVNode)(_component_el_tag, {
  40096. closable: false,
  40097. size: _ctx.collapseTagSize,
  40098. type: _ctx.tagType,
  40099. effect: _ctx.tagEffect,
  40100. style: (0, vue.normalizeStyle)(_ctx.collapseTagStyle),
  40101. "disable-transitions": ""
  40102. }, {
  40103. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, " + " + (0, vue.toDisplayString)(_ctx.states.cachedOptions.length - _ctx.maxCollapseTags), 3)]),
  40104. _: 1
  40105. }, 8, [
  40106. "size",
  40107. "type",
  40108. "effect",
  40109. "style"
  40110. ])], 2)]),
  40111. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  40112. ref: "tagMenuRef",
  40113. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selection"))
  40114. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.collapseTagList, (selected) => {
  40115. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  40116. key: _ctx.getValueKey(_ctx.getValue(selected)),
  40117. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("selected-item"))
  40118. }, [(0, vue.createVNode)(_component_el_tag, {
  40119. class: "in-tooltip",
  40120. closable: !_ctx.selectDisabled && !_ctx.getDisabled(selected),
  40121. size: _ctx.collapseTagSize,
  40122. type: _ctx.tagType,
  40123. effect: _ctx.tagEffect,
  40124. "disable-transitions": "",
  40125. onClose: ($event) => _ctx.deleteTag($event, selected)
  40126. }, {
  40127. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.nsSelect.e("tags-text")) }, [(0, vue.renderSlot)(_ctx.$slots, "label", {
  40128. index: _ctx.getIndex(selected),
  40129. label: _ctx.getLabel(selected),
  40130. value: _ctx.getValue(selected)
  40131. }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.getLabel(selected)), 1)])], 2)]),
  40132. _: 2
  40133. }, 1032, [
  40134. "closable",
  40135. "size",
  40136. "type",
  40137. "effect",
  40138. "onClose"
  40139. ])], 2);
  40140. }), 128))], 2)]),
  40141. _: 3
  40142. }, 8, [
  40143. "disabled",
  40144. "fallback-placements",
  40145. "effect",
  40146. "placement",
  40147. "popper-class",
  40148. "popper-style",
  40149. "teleported",
  40150. "append-to",
  40151. "popper-options",
  40152. "transition",
  40153. "show-after",
  40154. "hide-after",
  40155. "auto-close",
  40156. "offset"
  40157. ])) : (0, vue.createCommentVNode)("v-if", true)]) : (0, vue.createCommentVNode)("v-if", true),
  40158. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([
  40159. _ctx.nsSelect.e("selected-item"),
  40160. _ctx.nsSelect.e("input-wrapper"),
  40161. _ctx.nsSelect.is("hidden", !_ctx.filterable || _ctx.selectDisabled || !_ctx.states.inputValue && !_ctx.isFocused)
  40162. ]) }, [(0, vue.createElementVNode)("input", {
  40163. id: _ctx.inputId,
  40164. ref: "inputRef",
  40165. value: _ctx.states.inputValue,
  40166. style: (0, vue.normalizeStyle)(_ctx.inputStyle),
  40167. autocomplete: _ctx.autocomplete,
  40168. tabindex: _ctx.tabindex,
  40169. "aria-autocomplete": "none",
  40170. "aria-haspopup": "listbox",
  40171. autocapitalize: "off",
  40172. "aria-expanded": _ctx.expanded,
  40173. "aria-label": _ctx.ariaLabel,
  40174. class: (0, vue.normalizeClass)([_ctx.nsSelect.e("input"), _ctx.nsSelect.is(_ctx.selectSize)]),
  40175. disabled: _ctx.selectDisabled,
  40176. role: "combobox",
  40177. "aria-controls": _ctx.contentId,
  40178. "aria-activedescendant": _ctx.states.hoveringIndex >= 0 ? `${_ctx.contentId}-${_ctx.states.hoveringIndex}` : "",
  40179. readonly: !_ctx.filterable,
  40180. spellcheck: "false",
  40181. type: "text",
  40182. name: _ctx.name,
  40183. onInput: _cache[0] || (_cache[0] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
  40184. onChange: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["stop"])),
  40185. onCompositionstart: _cache[2] || (_cache[2] = (...args) => _ctx.handleCompositionStart && _ctx.handleCompositionStart(...args)),
  40186. onCompositionupdate: _cache[3] || (_cache[3] = (...args) => _ctx.handleCompositionUpdate && _ctx.handleCompositionUpdate(...args)),
  40187. onCompositionend: _cache[4] || (_cache[4] = (...args) => _ctx.handleCompositionEnd && _ctx.handleCompositionEnd(...args)),
  40188. onKeydown: [
  40189. _cache[5] || (_cache[5] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.onKeyboardNavigate("backward"), ["stop", "prevent"]), ["up"])),
  40190. _cache[6] || (_cache[6] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.onKeyboardNavigate("forward"), ["stop", "prevent"]), ["down"])),
  40191. _cache[7] || (_cache[7] = (0, vue.withKeys)((0, vue.withModifiers)((...args) => _ctx.onKeyboardSelect && _ctx.onKeyboardSelect(...args), ["stop", "prevent"]), ["enter"])),
  40192. _cache[8] || (_cache[8] = (0, vue.withKeys)((0, vue.withModifiers)((...args) => _ctx.handleEsc && _ctx.handleEsc(...args), ["stop", "prevent"]), ["esc"])),
  40193. _cache[9] || (_cache[9] = (0, vue.withKeys)((0, vue.withModifiers)((...args) => _ctx.handleDel && _ctx.handleDel(...args), ["stop"]), ["delete"]))
  40194. ],
  40195. onClick: _cache[10] || (_cache[10] = (0, vue.withModifiers)((...args) => _ctx.toggleMenu && _ctx.toggleMenu(...args), ["stop"]))
  40196. }, null, 46, _hoisted_1$21), _ctx.filterable ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  40197. key: 0,
  40198. ref: "calculatorRef",
  40199. "aria-hidden": "true",
  40200. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("input-calculator")),
  40201. textContent: (0, vue.toDisplayString)(_ctx.states.inputValue)
  40202. }, null, 10, _hoisted_2$13)) : (0, vue.createCommentVNode)("v-if", true)], 2),
  40203. _ctx.shouldShowPlaceholder ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  40204. key: 1,
  40205. class: (0, vue.normalizeClass)([
  40206. _ctx.nsSelect.e("selected-item"),
  40207. _ctx.nsSelect.e("placeholder"),
  40208. _ctx.nsSelect.is("transparent", !_ctx.hasModelValue || _ctx.expanded && !_ctx.states.inputValue)
  40209. ])
  40210. }, [_ctx.hasModelValue ? (0, vue.renderSlot)(_ctx.$slots, "label", {
  40211. key: 0,
  40212. index: _ctx.allOptionsValueMap.get(_ctx.modelValue)?.index ?? -1,
  40213. label: _ctx.currentPlaceholder,
  40214. value: _ctx.modelValue
  40215. }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.currentPlaceholder), 1)]) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$5, (0, vue.toDisplayString)(_ctx.currentPlaceholder), 1))], 2)) : (0, vue.createCommentVNode)("v-if", true)
  40216. ], 2),
  40217. (0, vue.createElementVNode)("div", {
  40218. ref: "suffixRef",
  40219. class: (0, vue.normalizeClass)(_ctx.nsSelect.e("suffix"))
  40220. }, [
  40221. _ctx.iconComponent ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  40222. key: 0,
  40223. class: (0, vue.normalizeClass)([
  40224. _ctx.nsSelect.e("caret"),
  40225. _ctx.nsInput.e("icon"),
  40226. _ctx.iconReverse
  40227. ])
  40228. }, {
  40229. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  40230. _: 1
  40231. }, 8, ["class"])), [[vue.vShow, !_ctx.showClearBtn]]) : (0, vue.createCommentVNode)("v-if", true),
  40232. _ctx.showClearBtn && _ctx.clearIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  40233. key: 1,
  40234. class: (0, vue.normalizeClass)([
  40235. _ctx.nsSelect.e("caret"),
  40236. _ctx.nsInput.e("icon"),
  40237. _ctx.nsSelect.e("clear")
  40238. ]),
  40239. onClick: (0, vue.withModifiers)(_ctx.handleClear, ["prevent", "stop"])
  40240. }, {
  40241. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.clearIcon)))]),
  40242. _: 1
  40243. }, 8, ["class", "onClick"])) : (0, vue.createCommentVNode)("v-if", true),
  40244. _ctx.validateState && _ctx.validateIcon && _ctx.needStatusIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  40245. key: 2,
  40246. class: (0, vue.normalizeClass)([
  40247. _ctx.nsInput.e("icon"),
  40248. _ctx.nsInput.e("validateIcon"),
  40249. _ctx.nsInput.is("loading", _ctx.validateState === "validating")
  40250. ])
  40251. }, {
  40252. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.validateIcon)))]),
  40253. _: 1
  40254. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  40255. ], 2)
  40256. ], 2)]),
  40257. content: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_select_menu, {
  40258. id: _ctx.contentId,
  40259. ref: "menuRef",
  40260. data: _ctx.filteredOptions,
  40261. width: _ctx.popperSize - _ctx.BORDER_HORIZONTAL_WIDTH,
  40262. "hovering-index": _ctx.states.hoveringIndex,
  40263. "scrollbar-always-on": _ctx.scrollbarAlwaysOn,
  40264. "aria-label": _ctx.ariaLabel
  40265. }, (0, vue.createSlots)({
  40266. default: (0, vue.withCtx)((scope) => [(0, vue.renderSlot)(_ctx.$slots, "default", (0, vue.normalizeProps)((0, vue.guardReactiveProps)(scope)))]),
  40267. _: 2
  40268. }, [
  40269. _ctx.$slots.header ? {
  40270. name: "header",
  40271. fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  40272. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "header")),
  40273. onClick: _cache[12] || (_cache[12] = (0, vue.withModifiers)(() => {}, ["stop"]))
  40274. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)]),
  40275. key: "0"
  40276. } : void 0,
  40277. _ctx.$slots.loading && _ctx.loading ? {
  40278. name: "loading",
  40279. fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "loading")) }, [(0, vue.renderSlot)(_ctx.$slots, "loading")], 2)]),
  40280. key: "1"
  40281. } : _ctx.loading || _ctx.filteredOptions.length === 0 ? {
  40282. name: "empty",
  40283. fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "empty")) }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.emptyText), 1)])], 2)]),
  40284. key: "2"
  40285. } : void 0,
  40286. _ctx.$slots.footer ? {
  40287. name: "footer",
  40288. fn: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  40289. class: (0, vue.normalizeClass)(_ctx.nsSelect.be("dropdown", "footer")),
  40290. onClick: _cache[13] || (_cache[13] = (0, vue.withModifiers)(() => {}, ["stop"]))
  40291. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)]),
  40292. key: "3"
  40293. } : void 0
  40294. ]), 1032, [
  40295. "id",
  40296. "data",
  40297. "width",
  40298. "hovering-index",
  40299. "scrollbar-always-on",
  40300. "aria-label"
  40301. ])]),
  40302. _: 3
  40303. }, 8, [
  40304. "visible",
  40305. "teleported",
  40306. "popper-class",
  40307. "popper-style",
  40308. "popper-options",
  40309. "fallback-placements",
  40310. "effect",
  40311. "placement",
  40312. "transition",
  40313. "persistent",
  40314. "append-to",
  40315. "show-arrow",
  40316. "offset",
  40317. "onBeforeShow"
  40318. ])], 34)), [[
  40319. _directive_click_outside,
  40320. _ctx.handleClickOutside,
  40321. _ctx.popperRef
  40322. ]]);
  40323. }
  40324. var select_default = /* @__PURE__ */ _plugin_vue_export_helper_default(select_vue_vue_type_script_lang_default, [["render", _sfc_render$5]]);
  40325. //#endregion
  40326. //#region ../../packages/components/select-v2/index.ts
  40327. const ElSelectV2 = withInstall(select_default);
  40328. //#endregion
  40329. //#region ../../packages/components/skeleton/src/skeleton.ts
  40330. /**
  40331. * @deprecated Removed after 3.0.0, Use `SkeletonProps` instead.
  40332. */
  40333. const skeletonProps = buildProps({
  40334. animated: Boolean,
  40335. count: {
  40336. type: Number,
  40337. default: 1
  40338. },
  40339. rows: {
  40340. type: Number,
  40341. default: 3
  40342. },
  40343. loading: {
  40344. type: Boolean,
  40345. default: true
  40346. },
  40347. throttle: { type: definePropType([Number, Object]) }
  40348. });
  40349. //#endregion
  40350. //#region ../../packages/components/skeleton/src/skeleton-item.ts
  40351. /**
  40352. * @deprecated Removed after 3.0.0, Use `SkeletonItemProps` instead.
  40353. */
  40354. const skeletonItemProps = buildProps({ variant: {
  40355. type: String,
  40356. values: [
  40357. "circle",
  40358. "rect",
  40359. "h1",
  40360. "h3",
  40361. "text",
  40362. "caption",
  40363. "p",
  40364. "image",
  40365. "button"
  40366. ],
  40367. default: "text"
  40368. } });
  40369. //#endregion
  40370. //#region ../../packages/components/skeleton/src/skeleton-item.vue?vue&type=script&setup=true&lang.ts
  40371. var skeleton_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  40372. name: "ElSkeletonItem",
  40373. __name: "skeleton-item",
  40374. props: skeletonItemProps,
  40375. setup(__props) {
  40376. const ns = useNamespace("skeleton");
  40377. return (_ctx, _cache) => {
  40378. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("item"), (0, vue.unref)(ns).e(__props.variant)]) }, [__props.variant === "image" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(picture_filled_default), { key: 0 })) : (0, vue.createCommentVNode)("v-if", true)], 2);
  40379. };
  40380. }
  40381. });
  40382. //#endregion
  40383. //#region ../../packages/components/skeleton/src/skeleton-item.vue
  40384. var skeleton_item_default = skeleton_item_vue_vue_type_script_setup_true_lang_default;
  40385. //#endregion
  40386. //#region ../../packages/components/skeleton/src/skeleton.vue?vue&type=script&setup=true&lang.ts
  40387. var skeleton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  40388. name: "ElSkeleton",
  40389. __name: "skeleton",
  40390. props: skeletonProps,
  40391. setup(__props, { expose: __expose }) {
  40392. const props = __props;
  40393. const ns = useNamespace("skeleton");
  40394. const uiLoading = useThrottleRender((0, vue.toRef)(props, "loading"), props.throttle);
  40395. __expose({ uiLoading });
  40396. return (_ctx, _cache) => {
  40397. return (0, vue.unref)(uiLoading) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
  40398. key: 0,
  40399. class: [(0, vue.unref)(ns).b(), (0, vue.unref)(ns).is("animated", __props.animated)]
  40400. }, _ctx.$attrs), [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.count, (i) => {
  40401. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: i }, [(0, vue.unref)(uiLoading) ? (0, vue.renderSlot)(_ctx.$slots, "template", { key: i }, () => [(0, vue.createVNode)(skeleton_item_default, {
  40402. class: (0, vue.normalizeClass)((0, vue.unref)(ns).is("first")),
  40403. variant: "p"
  40404. }, null, 8, ["class"]), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.rows, (item) => {
  40405. return (0, vue.openBlock)(), (0, vue.createBlock)(skeleton_item_default, {
  40406. key: item,
  40407. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("paragraph"), (0, vue.unref)(ns).is("last", item === __props.rows && __props.rows > 1)]),
  40408. variant: "p"
  40409. }, null, 8, ["class"]);
  40410. }), 128))]) : (0, vue.createCommentVNode)("v-if", true)], 64);
  40411. }), 128))], 16)) : (0, vue.renderSlot)(_ctx.$slots, "default", (0, vue.normalizeProps)((0, vue.mergeProps)({ key: 1 }, _ctx.$attrs)));
  40412. };
  40413. }
  40414. });
  40415. //#endregion
  40416. //#region ../../packages/components/skeleton/src/skeleton.vue
  40417. var skeleton_default = skeleton_vue_vue_type_script_setup_true_lang_default;
  40418. //#endregion
  40419. //#region ../../packages/components/skeleton/index.ts
  40420. const ElSkeleton = withInstall(skeleton_default, { SkeletonItem: skeleton_item_default });
  40421. const ElSkeletonItem = withNoopInstall(skeleton_item_default);
  40422. //#endregion
  40423. //#region ../../packages/components/slider/src/constants.ts
  40424. const sliderContextKey = Symbol("sliderContextKey");
  40425. //#endregion
  40426. //#region ../../packages/components/slider/src/slider.ts
  40427. const sliderProps = buildProps({
  40428. modelValue: {
  40429. type: definePropType([Number, Array]),
  40430. default: 0
  40431. },
  40432. id: {
  40433. type: String,
  40434. default: void 0
  40435. },
  40436. min: {
  40437. type: Number,
  40438. default: 0
  40439. },
  40440. max: {
  40441. type: Number,
  40442. default: 100
  40443. },
  40444. step: {
  40445. type: Number,
  40446. default: 1
  40447. },
  40448. showInput: Boolean,
  40449. showInputControls: {
  40450. type: Boolean,
  40451. default: true
  40452. },
  40453. size: useSizeProp,
  40454. inputSize: useSizeProp,
  40455. showStops: Boolean,
  40456. showTooltip: {
  40457. type: Boolean,
  40458. default: true
  40459. },
  40460. formatTooltip: {
  40461. type: definePropType(Function),
  40462. default: void 0
  40463. },
  40464. disabled: {
  40465. type: Boolean,
  40466. default: void 0
  40467. },
  40468. range: Boolean,
  40469. vertical: Boolean,
  40470. height: String,
  40471. rangeStartLabel: {
  40472. type: String,
  40473. default: void 0
  40474. },
  40475. rangeEndLabel: {
  40476. type: String,
  40477. default: void 0
  40478. },
  40479. formatValueText: {
  40480. type: definePropType(Function),
  40481. default: void 0
  40482. },
  40483. tooltipClass: {
  40484. type: String,
  40485. default: void 0
  40486. },
  40487. placement: {
  40488. type: String,
  40489. values: Ee,
  40490. default: "top"
  40491. },
  40492. marks: { type: definePropType(Object) },
  40493. validateEvent: {
  40494. type: Boolean,
  40495. default: true
  40496. },
  40497. persistent: {
  40498. type: Boolean,
  40499. default: true
  40500. },
  40501. ...useAriaProps(["ariaLabel"])
  40502. });
  40503. const isValidValue$1 = (value) => isNumber(value) || isArray$1(value) && value.every(isNumber);
  40504. const sliderEmits = {
  40505. [UPDATE_MODEL_EVENT]: isValidValue$1,
  40506. [INPUT_EVENT]: isValidValue$1,
  40507. [CHANGE_EVENT]: isValidValue$1
  40508. };
  40509. //#endregion
  40510. //#region ../../packages/components/slider/src/composables/use-lifecycle.ts
  40511. const useLifecycle = (props, initData, resetSize) => {
  40512. const sliderWrapper = (0, vue.ref)();
  40513. (0, vue.onMounted)(async () => {
  40514. if (props.range) {
  40515. if (isArray$1(props.modelValue)) {
  40516. initData.firstValue = Math.max(props.min, props.modelValue[0]);
  40517. initData.secondValue = Math.min(props.max, props.modelValue[1]);
  40518. } else {
  40519. initData.firstValue = props.min;
  40520. initData.secondValue = props.max;
  40521. }
  40522. initData.oldValue = [initData.firstValue, initData.secondValue];
  40523. } else {
  40524. if (!isNumber(props.modelValue) || Number.isNaN(props.modelValue)) initData.firstValue = props.min;
  40525. else initData.firstValue = Math.min(props.max, Math.max(props.min, props.modelValue));
  40526. initData.oldValue = initData.firstValue;
  40527. }
  40528. useEventListener(window, "resize", resetSize);
  40529. await (0, vue.nextTick)();
  40530. resetSize();
  40531. });
  40532. return { sliderWrapper };
  40533. };
  40534. //#endregion
  40535. //#region ../../packages/components/slider/src/composables/use-marks.ts
  40536. const useMarks = (props) => {
  40537. return (0, vue.computed)(() => {
  40538. if (!props.marks) return [];
  40539. return Object.keys(props.marks).map(Number.parseFloat).sort((a, b) => a - b).filter((point) => point <= props.max && point >= props.min).map((point) => ({
  40540. point,
  40541. position: (point - props.min) * 100 / (props.max - props.min),
  40542. mark: props.marks[point]
  40543. }));
  40544. });
  40545. };
  40546. //#endregion
  40547. //#region ../../packages/components/slider/src/composables/use-slide.ts
  40548. const useSlide = (props, initData, emit) => {
  40549. const { formItem: elFormItem } = useFormItem();
  40550. const slider = (0, vue.shallowRef)();
  40551. const firstButton = (0, vue.ref)();
  40552. const secondButton = (0, vue.ref)();
  40553. const buttonRefs = {
  40554. firstButton,
  40555. secondButton
  40556. };
  40557. const sliderDisabled = useFormDisabled();
  40558. const minValue = (0, vue.computed)(() => {
  40559. return Math.min(initData.firstValue, initData.secondValue);
  40560. });
  40561. const maxValue = (0, vue.computed)(() => {
  40562. return Math.max(initData.firstValue, initData.secondValue);
  40563. });
  40564. const barSize = (0, vue.computed)(() => {
  40565. return props.range ? `${100 * (maxValue.value - minValue.value) / (props.max - props.min)}%` : `${100 * (initData.firstValue - props.min) / (props.max - props.min)}%`;
  40566. });
  40567. const barStart = (0, vue.computed)(() => {
  40568. return props.range ? `${100 * (minValue.value - props.min) / (props.max - props.min)}%` : "0%";
  40569. });
  40570. const runwayStyle = (0, vue.computed)(() => {
  40571. return props.vertical ? { height: props.height } : {};
  40572. });
  40573. const barStyle = (0, vue.computed)(() => {
  40574. return props.vertical ? {
  40575. height: barSize.value,
  40576. bottom: barStart.value
  40577. } : {
  40578. width: barSize.value,
  40579. left: barStart.value
  40580. };
  40581. });
  40582. const resetSize = () => {
  40583. if (slider.value) initData.sliderSize = slider.value.getBoundingClientRect()[props.vertical ? "height" : "width"];
  40584. };
  40585. const getButtonRefByPercent = (percent) => {
  40586. const targetValue = props.min + percent * (props.max - props.min) / 100;
  40587. if (!props.range) return firstButton;
  40588. let buttonRefName;
  40589. if (Math.abs(minValue.value - targetValue) < Math.abs(maxValue.value - targetValue)) buttonRefName = initData.firstValue < initData.secondValue ? "firstButton" : "secondButton";
  40590. else buttonRefName = initData.firstValue > initData.secondValue ? "firstButton" : "secondButton";
  40591. return buttonRefs[buttonRefName];
  40592. };
  40593. const setPosition = (percent) => {
  40594. const buttonRef = getButtonRefByPercent(percent);
  40595. buttonRef.value.setPosition(percent);
  40596. return buttonRef;
  40597. };
  40598. const setFirstValue = (firstValue) => {
  40599. initData.firstValue = firstValue ?? props.min;
  40600. _emit(props.range ? [minValue.value, maxValue.value] : firstValue ?? props.min);
  40601. };
  40602. const setSecondValue = (secondValue) => {
  40603. initData.secondValue = secondValue;
  40604. if (props.range) _emit([minValue.value, maxValue.value]);
  40605. };
  40606. const _emit = (val) => {
  40607. emit(UPDATE_MODEL_EVENT, val);
  40608. emit(INPUT_EVENT, val);
  40609. };
  40610. const emitChange = async () => {
  40611. await (0, vue.nextTick)();
  40612. emit(CHANGE_EVENT, props.range ? [minValue.value, maxValue.value] : props.modelValue);
  40613. };
  40614. const handleSliderPointerEvent = (event) => {
  40615. if (sliderDisabled.value || initData.dragging) return;
  40616. resetSize();
  40617. let newPercent = 0;
  40618. if (props.vertical) {
  40619. const clientY = event.touches?.item(0)?.clientY ?? event.clientY;
  40620. newPercent = (slider.value.getBoundingClientRect().bottom - clientY) / initData.sliderSize * 100;
  40621. } else newPercent = ((event.touches?.item(0)?.clientX ?? event.clientX) - slider.value.getBoundingClientRect().left) / initData.sliderSize * 100;
  40622. if (newPercent < 0 || newPercent > 100) return;
  40623. return setPosition(newPercent);
  40624. };
  40625. const onSliderWrapperPrevent = (event) => {
  40626. if (buttonRefs["firstButton"].value?.dragging || buttonRefs["secondButton"].value?.dragging) event.preventDefault();
  40627. };
  40628. const onSliderDown = async (event) => {
  40629. const buttonRef = handleSliderPointerEvent(event);
  40630. if (buttonRef) {
  40631. await (0, vue.nextTick)();
  40632. buttonRef.value.onButtonDown(event);
  40633. }
  40634. };
  40635. const onSliderClick = (event) => {
  40636. if (handleSliderPointerEvent(event)) emitChange();
  40637. };
  40638. const onSliderMarkerDown = (position) => {
  40639. if (sliderDisabled.value || initData.dragging) return;
  40640. if (setPosition(position)) emitChange();
  40641. };
  40642. return {
  40643. elFormItem,
  40644. slider,
  40645. firstButton,
  40646. secondButton,
  40647. sliderDisabled,
  40648. minValue,
  40649. maxValue,
  40650. runwayStyle,
  40651. barStyle,
  40652. resetSize,
  40653. setPosition,
  40654. emitChange,
  40655. onSliderWrapperPrevent,
  40656. onSliderClick,
  40657. onSliderDown,
  40658. onSliderMarkerDown,
  40659. setFirstValue,
  40660. setSecondValue
  40661. };
  40662. };
  40663. //#endregion
  40664. //#region ../../packages/components/slider/src/composables/use-slider-button.ts
  40665. const useTooltip = (props, formatTooltip, showTooltip) => {
  40666. const tooltip = (0, vue.ref)();
  40667. const tooltipVisible = (0, vue.ref)(false);
  40668. const enableFormat = (0, vue.computed)(() => {
  40669. return formatTooltip.value instanceof Function;
  40670. });
  40671. return {
  40672. tooltip,
  40673. tooltipVisible,
  40674. formatValue: (0, vue.computed)(() => {
  40675. return enableFormat.value && formatTooltip.value(props.modelValue) || props.modelValue;
  40676. }),
  40677. displayTooltip: debounce(() => {
  40678. showTooltip.value && (tooltipVisible.value = true);
  40679. }, 50),
  40680. hideTooltip: debounce(() => {
  40681. showTooltip.value && (tooltipVisible.value = false);
  40682. }, 50)
  40683. };
  40684. };
  40685. const useSliderButton = (props, initData, emit) => {
  40686. const { disabled, min, max, step, showTooltip, persistent, precision, sliderSize, formatTooltip, emitChange, resetSize, updateDragging } = (0, vue.inject)(sliderContextKey);
  40687. const { tooltip, tooltipVisible, formatValue, displayTooltip, hideTooltip } = useTooltip(props, formatTooltip, showTooltip);
  40688. const button = (0, vue.ref)();
  40689. const currentPosition = (0, vue.computed)(() => {
  40690. return `${(props.modelValue - min.value) / (max.value - min.value) * 100}%`;
  40691. });
  40692. const wrapperStyle = (0, vue.computed)(() => {
  40693. return props.vertical ? { bottom: currentPosition.value } : { left: currentPosition.value };
  40694. });
  40695. const handleMouseEnter = () => {
  40696. initData.hovering = true;
  40697. displayTooltip();
  40698. };
  40699. const handleMouseLeave = () => {
  40700. initData.hovering = false;
  40701. if (!initData.dragging) hideTooltip();
  40702. };
  40703. const onButtonDown = (event) => {
  40704. if (disabled.value) return;
  40705. event.preventDefault();
  40706. onDragStart(event);
  40707. window.addEventListener("mousemove", onDragging);
  40708. window.addEventListener("touchmove", onDragging);
  40709. window.addEventListener("mouseup", onDragEnd);
  40710. window.addEventListener("touchend", onDragEnd);
  40711. window.addEventListener("contextmenu", onDragEnd);
  40712. button.value.focus();
  40713. };
  40714. const incrementPosition = (amount) => {
  40715. if (disabled.value) return;
  40716. initData.newPosition = Number.parseFloat(currentPosition.value) + amount / (max.value - min.value) * 100;
  40717. setPosition(initData.newPosition);
  40718. emitChange();
  40719. };
  40720. const onLeftKeyDown = () => {
  40721. incrementPosition(-step.value);
  40722. };
  40723. const onRightKeyDown = () => {
  40724. incrementPosition(step.value);
  40725. };
  40726. const onPageDownKeyDown = () => {
  40727. incrementPosition(-step.value * 4);
  40728. };
  40729. const onPageUpKeyDown = () => {
  40730. incrementPosition(step.value * 4);
  40731. };
  40732. const onHomeKeyDown = () => {
  40733. if (disabled.value) return;
  40734. setPosition(0);
  40735. emitChange();
  40736. };
  40737. const onEndKeyDown = () => {
  40738. if (disabled.value) return;
  40739. setPosition(100);
  40740. emitChange();
  40741. };
  40742. const onKeyDown = (event) => {
  40743. const code = getEventCode(event);
  40744. let isPreventDefault = true;
  40745. switch (code) {
  40746. case EVENT_CODE.left:
  40747. case EVENT_CODE.down:
  40748. onLeftKeyDown();
  40749. break;
  40750. case EVENT_CODE.right:
  40751. case EVENT_CODE.up:
  40752. onRightKeyDown();
  40753. break;
  40754. case EVENT_CODE.home:
  40755. onHomeKeyDown();
  40756. break;
  40757. case EVENT_CODE.end:
  40758. onEndKeyDown();
  40759. break;
  40760. case EVENT_CODE.pageDown:
  40761. onPageDownKeyDown();
  40762. break;
  40763. case EVENT_CODE.pageUp:
  40764. onPageUpKeyDown();
  40765. break;
  40766. default:
  40767. isPreventDefault = false;
  40768. break;
  40769. }
  40770. isPreventDefault && event.preventDefault();
  40771. };
  40772. const getClientXY = (event) => {
  40773. let clientX;
  40774. let clientY;
  40775. if (event.type.startsWith("touch")) {
  40776. clientY = event.touches[0].clientY;
  40777. clientX = event.touches[0].clientX;
  40778. } else {
  40779. clientY = event.clientY;
  40780. clientX = event.clientX;
  40781. }
  40782. return {
  40783. clientX,
  40784. clientY
  40785. };
  40786. };
  40787. const onDragStart = (event) => {
  40788. initData.dragging = true;
  40789. initData.isClick = true;
  40790. const { clientX, clientY } = getClientXY(event);
  40791. if (props.vertical) initData.startY = clientY;
  40792. else initData.startX = clientX;
  40793. initData.startPosition = Number.parseFloat(currentPosition.value);
  40794. initData.newPosition = initData.startPosition;
  40795. };
  40796. const onDragging = (event) => {
  40797. if (initData.dragging) {
  40798. initData.isClick = false;
  40799. displayTooltip();
  40800. resetSize();
  40801. let diff;
  40802. const { clientX, clientY } = getClientXY(event);
  40803. if (props.vertical) {
  40804. initData.currentY = clientY;
  40805. diff = (initData.startY - initData.currentY) / sliderSize.value * 100;
  40806. } else {
  40807. initData.currentX = clientX;
  40808. diff = (initData.currentX - initData.startX) / sliderSize.value * 100;
  40809. }
  40810. initData.newPosition = initData.startPosition + diff;
  40811. setPosition(initData.newPosition);
  40812. }
  40813. };
  40814. const onDragEnd = () => {
  40815. if (initData.dragging) {
  40816. setTimeout(() => {
  40817. initData.dragging = false;
  40818. if (!initData.hovering) hideTooltip();
  40819. if (!initData.isClick) setPosition(initData.newPosition);
  40820. emitChange();
  40821. }, 0);
  40822. window.removeEventListener("mousemove", onDragging);
  40823. window.removeEventListener("touchmove", onDragging);
  40824. window.removeEventListener("mouseup", onDragEnd);
  40825. window.removeEventListener("touchend", onDragEnd);
  40826. window.removeEventListener("contextmenu", onDragEnd);
  40827. }
  40828. };
  40829. const setPosition = async (newPosition) => {
  40830. if (newPosition === null || Number.isNaN(+newPosition)) return;
  40831. newPosition = clamp$1(newPosition, 0, 100);
  40832. const fullSteps = Math.floor((max.value - min.value) / step.value);
  40833. const fullRangePercentage = fullSteps * step.value / (max.value - min.value) * 100;
  40834. const threshold = fullRangePercentage + (100 - fullRangePercentage) / 2;
  40835. let value;
  40836. if (newPosition < fullRangePercentage) {
  40837. const valueBetween = fullRangePercentage / fullSteps;
  40838. const steps = Math.round(newPosition / valueBetween);
  40839. value = min.value + steps * step.value;
  40840. } else if (newPosition < threshold) value = min.value + fullSteps * step.value;
  40841. else value = max.value;
  40842. value = Number.parseFloat(value.toFixed(precision.value));
  40843. if (value !== props.modelValue) emit(UPDATE_MODEL_EVENT, value);
  40844. if (!initData.dragging && props.modelValue !== initData.oldValue) initData.oldValue = props.modelValue;
  40845. await (0, vue.nextTick)();
  40846. initData.dragging && displayTooltip();
  40847. tooltip.value.updatePopper();
  40848. };
  40849. (0, vue.watch)(() => initData.dragging, (val) => {
  40850. updateDragging(val);
  40851. });
  40852. useEventListener(button, "touchstart", onButtonDown, { passive: false });
  40853. return {
  40854. disabled,
  40855. button,
  40856. tooltip,
  40857. tooltipVisible,
  40858. showTooltip,
  40859. persistent,
  40860. wrapperStyle,
  40861. formatValue,
  40862. handleMouseEnter,
  40863. handleMouseLeave,
  40864. onButtonDown,
  40865. onKeyDown,
  40866. setPosition
  40867. };
  40868. };
  40869. //#endregion
  40870. //#region ../../packages/components/slider/src/composables/use-stops.ts
  40871. const useStops = (props, initData, minValue, maxValue) => {
  40872. const stops = (0, vue.computed)(() => {
  40873. if (!props.showStops || props.min > props.max) return [];
  40874. if (props.step === 0) {
  40875. /* @__PURE__ */ debugWarn("ElSlider", "step should not be 0.");
  40876. return [];
  40877. }
  40878. const stopCount = Math.ceil((props.max - props.min) / props.step);
  40879. const stepWidth = 100 * props.step / (props.max - props.min);
  40880. const result = Array.from({ length: stopCount - 1 }).map((_, index) => (index + 1) * stepWidth);
  40881. if (props.range) return result.filter((step) => {
  40882. return step < 100 * (minValue.value - props.min) / (props.max - props.min) || step > 100 * (maxValue.value - props.min) / (props.max - props.min);
  40883. });
  40884. else return result.filter((step) => step > 100 * (initData.firstValue - props.min) / (props.max - props.min));
  40885. });
  40886. const getStopStyle = (position) => {
  40887. return props.vertical ? { bottom: `${position}%` } : { left: `${position}%` };
  40888. };
  40889. return {
  40890. stops,
  40891. getStopStyle
  40892. };
  40893. };
  40894. //#endregion
  40895. //#region ../../packages/components/slider/src/composables/use-watch.ts
  40896. const useWatch = (props, initData, minValue, maxValue, emit, elFormItem) => {
  40897. const _emit = (val) => {
  40898. emit(UPDATE_MODEL_EVENT, val);
  40899. emit(INPUT_EVENT, val);
  40900. };
  40901. const valueChanged = () => {
  40902. if (props.range) return ![minValue.value, maxValue.value].every((item, index) => item === initData.oldValue[index]);
  40903. else return props.modelValue !== initData.oldValue;
  40904. };
  40905. const setValues = () => {
  40906. if (props.min > props.max) throwError("Slider", "min should not be greater than max.");
  40907. const val = props.modelValue;
  40908. if (props.range && isArray$1(val)) if (val[1] < props.min) _emit([props.min, props.min]);
  40909. else if (val[0] > props.max) _emit([props.max, props.max]);
  40910. else if (val[0] < props.min) _emit([props.min, val[1]]);
  40911. else if (val[1] > props.max) _emit([val[0], props.max]);
  40912. else {
  40913. initData.firstValue = val[0];
  40914. initData.secondValue = val[1];
  40915. if (valueChanged()) {
  40916. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  40917. initData.oldValue = val.slice();
  40918. }
  40919. }
  40920. else if (!props.range && isNumber(val) && !Number.isNaN(val)) if (val < props.min) _emit(props.min);
  40921. else if (val > props.max) _emit(props.max);
  40922. else {
  40923. initData.firstValue = val;
  40924. if (valueChanged()) {
  40925. if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  40926. initData.oldValue = val;
  40927. }
  40928. }
  40929. };
  40930. setValues();
  40931. (0, vue.watch)(() => initData.dragging, (val) => {
  40932. if (!val) setValues();
  40933. });
  40934. (0, vue.watch)(() => props.modelValue, (val, oldVal) => {
  40935. if (initData.dragging || isArray$1(val) && isArray$1(oldVal) && val.every((item, index) => item === oldVal[index]) && initData.firstValue === val[0] && initData.secondValue === val[1]) return;
  40936. setValues();
  40937. }, { deep: true });
  40938. (0, vue.watch)(() => [props.min, props.max], () => {
  40939. setValues();
  40940. });
  40941. };
  40942. //#endregion
  40943. //#region ../../packages/components/slider/src/button.ts
  40944. const sliderButtonProps = buildProps({
  40945. modelValue: {
  40946. type: Number,
  40947. default: 0
  40948. },
  40949. vertical: Boolean,
  40950. tooltipClass: String,
  40951. placement: {
  40952. type: String,
  40953. values: Ee,
  40954. default: "top"
  40955. }
  40956. });
  40957. const sliderButtonEmits = { [UPDATE_MODEL_EVENT]: (value) => isNumber(value) };
  40958. //#endregion
  40959. //#region ../../packages/components/slider/src/button.vue?vue&type=script&setup=true&lang.ts
  40960. const _hoisted_1$20 = ["tabindex"];
  40961. var button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  40962. name: "ElSliderButton",
  40963. __name: "button",
  40964. props: sliderButtonProps,
  40965. emits: sliderButtonEmits,
  40966. setup(__props, { expose: __expose, emit: __emit }) {
  40967. const props = __props;
  40968. const emit = __emit;
  40969. const ns = useNamespace("slider");
  40970. const initData = (0, vue.reactive)({
  40971. hovering: false,
  40972. dragging: false,
  40973. isClick: false,
  40974. startX: 0,
  40975. currentX: 0,
  40976. startY: 0,
  40977. currentY: 0,
  40978. startPosition: 0,
  40979. newPosition: 0,
  40980. oldValue: props.modelValue
  40981. });
  40982. const tooltipPersistent = (0, vue.computed)(() => !showTooltip.value ? false : persistent.value);
  40983. const { disabled, button, tooltip, showTooltip, persistent, tooltipVisible, wrapperStyle, formatValue, handleMouseEnter, handleMouseLeave, onButtonDown, onKeyDown, setPosition } = useSliderButton(props, initData, emit);
  40984. const { hovering, dragging } = (0, vue.toRefs)(initData);
  40985. __expose({
  40986. onButtonDown,
  40987. onKeyDown,
  40988. setPosition,
  40989. hovering,
  40990. dragging
  40991. });
  40992. return (_ctx, _cache) => {
  40993. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  40994. ref_key: "button",
  40995. ref: button,
  40996. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("button-wrapper"), {
  40997. hover: (0, vue.unref)(hovering),
  40998. dragging: (0, vue.unref)(dragging)
  40999. }]),
  41000. style: (0, vue.normalizeStyle)((0, vue.unref)(wrapperStyle)),
  41001. tabindex: (0, vue.unref)(disabled) ? void 0 : 0,
  41002. onMouseenter: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(handleMouseEnter) && (0, vue.unref)(handleMouseEnter)(...args)),
  41003. onMouseleave: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(handleMouseLeave) && (0, vue.unref)(handleMouseLeave)(...args)),
  41004. onMousedown: _cache[2] || (_cache[2] = (...args) => (0, vue.unref)(onButtonDown) && (0, vue.unref)(onButtonDown)(...args)),
  41005. onFocus: _cache[3] || (_cache[3] = (...args) => (0, vue.unref)(handleMouseEnter) && (0, vue.unref)(handleMouseEnter)(...args)),
  41006. onBlur: _cache[4] || (_cache[4] = (...args) => (0, vue.unref)(handleMouseLeave) && (0, vue.unref)(handleMouseLeave)(...args)),
  41007. onKeydown: _cache[5] || (_cache[5] = (...args) => (0, vue.unref)(onKeyDown) && (0, vue.unref)(onKeyDown)(...args))
  41008. }, [(0, vue.createVNode)((0, vue.unref)(ElTooltip), {
  41009. ref_key: "tooltip",
  41010. ref: tooltip,
  41011. visible: (0, vue.unref)(tooltipVisible),
  41012. placement: _ctx.placement,
  41013. "fallback-placements": [
  41014. "top",
  41015. "bottom",
  41016. "right",
  41017. "left"
  41018. ],
  41019. "stop-popper-mouse-event": false,
  41020. "popper-class": _ctx.tooltipClass,
  41021. disabled: !(0, vue.unref)(showTooltip),
  41022. persistent: tooltipPersistent.value
  41023. }, {
  41024. content: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(formatValue)), 1)]),
  41025. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("button"), {
  41026. hover: (0, vue.unref)(hovering),
  41027. dragging: (0, vue.unref)(dragging)
  41028. }]) }, null, 2)]),
  41029. _: 1
  41030. }, 8, [
  41031. "visible",
  41032. "placement",
  41033. "popper-class",
  41034. "disabled",
  41035. "persistent"
  41036. ])], 46, _hoisted_1$20);
  41037. };
  41038. }
  41039. });
  41040. //#endregion
  41041. //#region ../../packages/components/slider/src/button.vue
  41042. var button_default = button_vue_vue_type_script_setup_true_lang_default;
  41043. //#endregion
  41044. //#region ../../packages/components/slider/src/marker.ts
  41045. const sliderMarkerProps = buildProps({ mark: {
  41046. type: definePropType([String, Object]),
  41047. default: void 0
  41048. } });
  41049. var marker_default = (0, vue.defineComponent)({
  41050. name: "ElSliderMarker",
  41051. props: sliderMarkerProps,
  41052. setup(props) {
  41053. const ns = useNamespace("slider");
  41054. const label = (0, vue.computed)(() => {
  41055. return isString(props.mark) ? props.mark : props.mark.label;
  41056. });
  41057. const style = (0, vue.computed)(() => isString(props.mark) ? void 0 : props.mark.style);
  41058. return () => (0, vue.h)("div", {
  41059. class: ns.e("marks-text"),
  41060. style: style.value
  41061. }, label.value);
  41062. }
  41063. });
  41064. //#endregion
  41065. //#region ../../packages/components/slider/src/slider.vue?vue&type=script&setup=true&lang.ts
  41066. const _hoisted_1$19 = [
  41067. "id",
  41068. "role",
  41069. "aria-label",
  41070. "aria-labelledby"
  41071. ];
  41072. const _hoisted_2$12 = { key: 1 };
  41073. var slider_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  41074. name: "ElSlider",
  41075. __name: "slider",
  41076. props: sliderProps,
  41077. emits: sliderEmits,
  41078. setup(__props, { expose: __expose, emit: __emit }) {
  41079. const props = __props;
  41080. const emit = __emit;
  41081. const ns = useNamespace("slider");
  41082. const { t } = useLocale();
  41083. const initData = (0, vue.reactive)({
  41084. firstValue: 0,
  41085. secondValue: 0,
  41086. oldValue: 0,
  41087. dragging: false,
  41088. sliderSize: 1
  41089. });
  41090. const { elFormItem, slider, firstButton, secondButton, sliderDisabled, minValue, maxValue, runwayStyle, barStyle, resetSize, emitChange, onSliderWrapperPrevent, onSliderClick, onSliderDown, onSliderMarkerDown, setFirstValue, setSecondValue } = useSlide(props, initData, emit);
  41091. const { stops, getStopStyle } = useStops(props, initData, minValue, maxValue);
  41092. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: elFormItem });
  41093. const sliderWrapperSize = useFormSize();
  41094. const sliderInputSize = (0, vue.computed)(() => props.inputSize || sliderWrapperSize.value);
  41095. const groupLabel = (0, vue.computed)(() => {
  41096. return props.ariaLabel || t("el.slider.defaultLabel", {
  41097. min: props.min,
  41098. max: props.max
  41099. });
  41100. });
  41101. const firstButtonLabel = (0, vue.computed)(() => {
  41102. if (props.range) return props.rangeStartLabel || t("el.slider.defaultRangeStartLabel");
  41103. else return groupLabel.value;
  41104. });
  41105. const firstValueText = (0, vue.computed)(() => {
  41106. return props.formatValueText ? props.formatValueText(firstValue.value) : `${firstValue.value}`;
  41107. });
  41108. const secondButtonLabel = (0, vue.computed)(() => {
  41109. return props.rangeEndLabel || t("el.slider.defaultRangeEndLabel");
  41110. });
  41111. const secondValueText = (0, vue.computed)(() => {
  41112. return props.formatValueText ? props.formatValueText(secondValue.value) : `${secondValue.value}`;
  41113. });
  41114. const sliderKls = (0, vue.computed)(() => [
  41115. ns.b(),
  41116. ns.m(sliderWrapperSize.value),
  41117. ns.is("vertical", props.vertical),
  41118. { [ns.m("with-input")]: props.showInput }
  41119. ]);
  41120. const markList = useMarks(props);
  41121. useWatch(props, initData, minValue, maxValue, emit, elFormItem);
  41122. const precision = (0, vue.computed)(() => {
  41123. const precisions = [
  41124. props.min,
  41125. props.max,
  41126. props.step
  41127. ].map((item) => {
  41128. const decimal = `${item}`.split(".")[1];
  41129. return decimal ? decimal.length : 0;
  41130. });
  41131. return Math.max.apply(null, precisions);
  41132. });
  41133. const { sliderWrapper } = useLifecycle(props, initData, resetSize);
  41134. const { firstValue, secondValue, sliderSize } = (0, vue.toRefs)(initData);
  41135. const updateDragging = (val) => {
  41136. initData.dragging = val;
  41137. };
  41138. useEventListener(sliderWrapper, "touchstart", onSliderWrapperPrevent, { passive: false });
  41139. useEventListener(sliderWrapper, "touchmove", onSliderWrapperPrevent, { passive: false });
  41140. (0, vue.provide)(sliderContextKey, {
  41141. ...(0, vue.toRefs)(props),
  41142. sliderSize,
  41143. disabled: sliderDisabled,
  41144. precision,
  41145. emitChange,
  41146. resetSize,
  41147. updateDragging
  41148. });
  41149. __expose({ onSliderClick });
  41150. return (_ctx, _cache) => {
  41151. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41152. id: _ctx.range ? (0, vue.unref)(inputId) : void 0,
  41153. ref_key: "sliderWrapper",
  41154. ref: sliderWrapper,
  41155. class: (0, vue.normalizeClass)(sliderKls.value),
  41156. role: _ctx.range ? "group" : void 0,
  41157. "aria-label": _ctx.range && !(0, vue.unref)(isLabeledByFormItem) ? groupLabel.value : void 0,
  41158. "aria-labelledby": _ctx.range && (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(elFormItem)?.labelId : void 0
  41159. }, [(0, vue.createElementVNode)("div", {
  41160. ref_key: "slider",
  41161. ref: slider,
  41162. class: (0, vue.normalizeClass)([
  41163. (0, vue.unref)(ns).e("runway"),
  41164. { "show-input": _ctx.showInput && !_ctx.range },
  41165. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(sliderDisabled))
  41166. ]),
  41167. style: (0, vue.normalizeStyle)((0, vue.unref)(runwayStyle)),
  41168. onMousedown: _cache[0] || (_cache[0] = (...args) => (0, vue.unref)(onSliderDown) && (0, vue.unref)(onSliderDown)(...args)),
  41169. onTouchstartPassive: _cache[1] || (_cache[1] = (...args) => (0, vue.unref)(onSliderDown) && (0, vue.unref)(onSliderDown)(...args))
  41170. }, [
  41171. (0, vue.createElementVNode)("div", {
  41172. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("bar")),
  41173. style: (0, vue.normalizeStyle)((0, vue.unref)(barStyle))
  41174. }, null, 6),
  41175. (0, vue.createVNode)(button_default, {
  41176. id: !_ctx.range ? (0, vue.unref)(inputId) : void 0,
  41177. ref_key: "firstButton",
  41178. ref: firstButton,
  41179. "model-value": (0, vue.unref)(firstValue),
  41180. vertical: _ctx.vertical,
  41181. "tooltip-class": _ctx.tooltipClass,
  41182. placement: _ctx.placement,
  41183. role: "slider",
  41184. "aria-label": _ctx.range || !(0, vue.unref)(isLabeledByFormItem) ? firstButtonLabel.value : void 0,
  41185. "aria-labelledby": !_ctx.range && (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(elFormItem)?.labelId : void 0,
  41186. "aria-valuemin": _ctx.min,
  41187. "aria-valuemax": _ctx.range ? (0, vue.unref)(secondValue) : _ctx.max,
  41188. "aria-valuenow": (0, vue.unref)(firstValue),
  41189. "aria-valuetext": firstValueText.value,
  41190. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  41191. "aria-disabled": (0, vue.unref)(sliderDisabled),
  41192. "onUpdate:modelValue": (0, vue.unref)(setFirstValue)
  41193. }, null, 8, [
  41194. "id",
  41195. "model-value",
  41196. "vertical",
  41197. "tooltip-class",
  41198. "placement",
  41199. "aria-label",
  41200. "aria-labelledby",
  41201. "aria-valuemin",
  41202. "aria-valuemax",
  41203. "aria-valuenow",
  41204. "aria-valuetext",
  41205. "aria-orientation",
  41206. "aria-disabled",
  41207. "onUpdate:modelValue"
  41208. ]),
  41209. _ctx.range ? ((0, vue.openBlock)(), (0, vue.createBlock)(button_default, {
  41210. key: 0,
  41211. ref_key: "secondButton",
  41212. ref: secondButton,
  41213. "model-value": (0, vue.unref)(secondValue),
  41214. vertical: _ctx.vertical,
  41215. "tooltip-class": _ctx.tooltipClass,
  41216. placement: _ctx.placement,
  41217. role: "slider",
  41218. "aria-label": secondButtonLabel.value,
  41219. "aria-valuemin": (0, vue.unref)(firstValue),
  41220. "aria-valuemax": _ctx.max,
  41221. "aria-valuenow": (0, vue.unref)(secondValue),
  41222. "aria-valuetext": secondValueText.value,
  41223. "aria-orientation": _ctx.vertical ? "vertical" : "horizontal",
  41224. "aria-disabled": (0, vue.unref)(sliderDisabled),
  41225. "onUpdate:modelValue": (0, vue.unref)(setSecondValue)
  41226. }, null, 8, [
  41227. "model-value",
  41228. "vertical",
  41229. "tooltip-class",
  41230. "placement",
  41231. "aria-label",
  41232. "aria-valuemin",
  41233. "aria-valuemax",
  41234. "aria-valuenow",
  41235. "aria-valuetext",
  41236. "aria-orientation",
  41237. "aria-disabled",
  41238. "onUpdate:modelValue"
  41239. ])) : (0, vue.createCommentVNode)("v-if", true),
  41240. _ctx.showStops ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$12, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(stops), (item, key) => {
  41241. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41242. key,
  41243. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("stop")),
  41244. style: (0, vue.normalizeStyle)((0, vue.unref)(getStopStyle)(item))
  41245. }, null, 6);
  41246. }), 128))])) : (0, vue.createCommentVNode)("v-if", true),
  41247. (0, vue.unref)(markList).length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 2 }, [(0, vue.createElementVNode)("div", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(markList), (item, key) => {
  41248. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41249. key,
  41250. style: (0, vue.normalizeStyle)((0, vue.unref)(getStopStyle)(item.position)),
  41251. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("stop"), (0, vue.unref)(ns).e("marks-stop")])
  41252. }, null, 6);
  41253. }), 128))]), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("marks")) }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(markList), (item, key) => {
  41254. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(marker_default), {
  41255. key,
  41256. mark: item.mark,
  41257. style: (0, vue.normalizeStyle)((0, vue.unref)(getStopStyle)(item.position)),
  41258. onMousedown: (0, vue.withModifiers)(($event) => (0, vue.unref)(onSliderMarkerDown)(item.position), ["stop"])
  41259. }, null, 8, [
  41260. "mark",
  41261. "style",
  41262. "onMousedown"
  41263. ]);
  41264. }), 128))], 2)], 64)) : (0, vue.createCommentVNode)("v-if", true)
  41265. ], 38), _ctx.showInput && !_ctx.range ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElInputNumber), {
  41266. key: 0,
  41267. ref: "input",
  41268. "model-value": (0, vue.unref)(firstValue),
  41269. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input")),
  41270. step: _ctx.step,
  41271. disabled: (0, vue.unref)(sliderDisabled),
  41272. controls: _ctx.showInputControls,
  41273. min: _ctx.min,
  41274. max: _ctx.max,
  41275. precision: precision.value,
  41276. size: sliderInputSize.value,
  41277. "onUpdate:modelValue": (0, vue.unref)(setFirstValue),
  41278. onChange: (0, vue.unref)(emitChange)
  41279. }, null, 8, [
  41280. "model-value",
  41281. "class",
  41282. "step",
  41283. "disabled",
  41284. "controls",
  41285. "min",
  41286. "max",
  41287. "precision",
  41288. "size",
  41289. "onUpdate:modelValue",
  41290. "onChange"
  41291. ])) : (0, vue.createCommentVNode)("v-if", true)], 10, _hoisted_1$19);
  41292. };
  41293. }
  41294. });
  41295. //#endregion
  41296. //#region ../../packages/components/slider/src/slider.vue
  41297. var slider_default = slider_vue_vue_type_script_setup_true_lang_default;
  41298. //#endregion
  41299. //#region ../../packages/components/slider/index.ts
  41300. const ElSlider = withInstall(slider_default);
  41301. //#endregion
  41302. //#region ../../packages/components/space/src/item.ts
  41303. const spaceItemProps = buildProps({ prefixCls: { type: String } });
  41304. const SpaceItem = (0, vue.defineComponent)({
  41305. name: "ElSpaceItem",
  41306. props: spaceItemProps,
  41307. setup(props, { slots }) {
  41308. const ns = useNamespace("space");
  41309. const classes = (0, vue.computed)(() => `${props.prefixCls || ns.b()}__item`);
  41310. return () => (0, vue.h)("div", { class: classes.value }, (0, vue.renderSlot)(slots, "default"));
  41311. }
  41312. });
  41313. //#endregion
  41314. //#region ../../packages/components/space/src/use-space.ts
  41315. const SIZE_MAP = {
  41316. small: 8,
  41317. default: 12,
  41318. large: 16
  41319. };
  41320. function useSpace(props) {
  41321. const ns = useNamespace("space");
  41322. const classes = (0, vue.computed)(() => [
  41323. ns.b(),
  41324. ns.m(props.direction),
  41325. props.class
  41326. ]);
  41327. const horizontalSize = (0, vue.ref)(0);
  41328. const verticalSize = (0, vue.ref)(0);
  41329. const containerStyle = (0, vue.computed)(() => {
  41330. return [
  41331. props.wrap || props.fill ? { flexWrap: "wrap" } : {},
  41332. { alignItems: props.alignment },
  41333. {
  41334. rowGap: `${verticalSize.value}px`,
  41335. columnGap: `${horizontalSize.value}px`
  41336. },
  41337. props.style
  41338. ];
  41339. });
  41340. const itemStyle = (0, vue.computed)(() => {
  41341. return props.fill ? {
  41342. flexGrow: 1,
  41343. minWidth: `${props.fillRatio}%`
  41344. } : {};
  41345. });
  41346. (0, vue.watchEffect)(() => {
  41347. const { size = "small", wrap, direction: dir, fill } = props;
  41348. if (isArray$1(size)) {
  41349. const [h = 0, v = 0] = size;
  41350. horizontalSize.value = h;
  41351. verticalSize.value = v;
  41352. } else {
  41353. let val;
  41354. if (isNumber(size)) val = size;
  41355. else val = SIZE_MAP[size || "small"] || SIZE_MAP.small;
  41356. if ((wrap || fill) && dir === "horizontal") horizontalSize.value = verticalSize.value = val;
  41357. else if (dir === "horizontal") {
  41358. horizontalSize.value = val;
  41359. verticalSize.value = 0;
  41360. } else {
  41361. verticalSize.value = val;
  41362. horizontalSize.value = 0;
  41363. }
  41364. }
  41365. });
  41366. return {
  41367. classes,
  41368. containerStyle,
  41369. itemStyle
  41370. };
  41371. }
  41372. //#endregion
  41373. //#region ../../packages/components/space/src/space.ts
  41374. const spaceProps = buildProps({
  41375. direction: {
  41376. type: String,
  41377. values: ["horizontal", "vertical"],
  41378. default: "horizontal"
  41379. },
  41380. class: {
  41381. type: definePropType([
  41382. String,
  41383. Object,
  41384. Array
  41385. ]),
  41386. default: ""
  41387. },
  41388. style: {
  41389. type: definePropType([
  41390. String,
  41391. Array,
  41392. Object
  41393. ]),
  41394. default: ""
  41395. },
  41396. alignment: {
  41397. type: definePropType(String),
  41398. default: "center"
  41399. },
  41400. prefixCls: { type: String },
  41401. spacer: {
  41402. type: definePropType([
  41403. Object,
  41404. String,
  41405. Number,
  41406. Array
  41407. ]),
  41408. default: null,
  41409. validator: (val) => (0, vue.isVNode)(val) || isNumber(val) || isString(val)
  41410. },
  41411. wrap: Boolean,
  41412. fill: Boolean,
  41413. fillRatio: {
  41414. type: Number,
  41415. default: 100
  41416. },
  41417. size: {
  41418. type: [
  41419. String,
  41420. Array,
  41421. Number
  41422. ],
  41423. values: componentSizes,
  41424. validator: (val) => {
  41425. return isNumber(val) || isArray$1(val) && val.length === 2 && val.every(isNumber);
  41426. }
  41427. }
  41428. });
  41429. const Space = (0, vue.defineComponent)({
  41430. name: "ElSpace",
  41431. props: spaceProps,
  41432. setup(props, { slots }) {
  41433. const { classes, containerStyle, itemStyle } = useSpace(props);
  41434. function extractChildren(children, parentKey = "", extractedChildren = []) {
  41435. const { prefixCls } = props;
  41436. children.forEach((child, loopKey) => {
  41437. if (isFragment(child)) {
  41438. if (isArray$1(child.children)) child.children.forEach((nested, key) => {
  41439. if (isFragment(nested) && isArray$1(nested.children)) extractChildren(nested.children, `${parentKey + key}-`, extractedChildren);
  41440. else if ((0, vue.isVNode)(nested) && nested?.type === vue.Comment) extractedChildren.push(nested);
  41441. else extractedChildren.push((0, vue.createVNode)(SpaceItem, {
  41442. style: itemStyle.value,
  41443. prefixCls,
  41444. key: `nested-${parentKey + key}`
  41445. }, { default: () => [nested] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  41446. });
  41447. } else if (isValidElementNode(child)) extractedChildren.push((0, vue.createVNode)(SpaceItem, {
  41448. style: itemStyle.value,
  41449. prefixCls,
  41450. key: `LoopKey${parentKey + loopKey}`
  41451. }, { default: () => [child] }, PatchFlags.PROPS | PatchFlags.STYLE, ["style", "prefixCls"]));
  41452. });
  41453. return extractedChildren;
  41454. }
  41455. return () => {
  41456. const { spacer, direction } = props;
  41457. const children = (0, vue.renderSlot)(slots, "default", { key: 0 }, () => []);
  41458. if ((children.children ?? []).length === 0) return null;
  41459. if (isArray$1(children.children)) {
  41460. let extractedChildren = extractChildren(children.children);
  41461. if (spacer) {
  41462. const len = extractedChildren.length - 1;
  41463. extractedChildren = extractedChildren.reduce((acc, child, idx) => {
  41464. const children = [...acc, child];
  41465. if (idx !== len) children.push((0, vue.createVNode)("span", {
  41466. style: [itemStyle.value, direction === "vertical" ? "width: 100%" : null],
  41467. key: idx
  41468. }, [(0, vue.isVNode)(spacer) ? spacer : (0, vue.createTextVNode)(spacer, PatchFlags.TEXT)], PatchFlags.STYLE));
  41469. return children;
  41470. }, []);
  41471. }
  41472. return (0, vue.createVNode)("div", {
  41473. class: classes.value,
  41474. style: containerStyle.value
  41475. }, extractedChildren, PatchFlags.STYLE | PatchFlags.CLASS);
  41476. }
  41477. return children.children;
  41478. };
  41479. }
  41480. });
  41481. //#endregion
  41482. //#region ../../packages/components/space/index.ts
  41483. const ElSpace = withInstall(Space);
  41484. //#endregion
  41485. //#region ../../packages/components/statistic/src/statistic.ts
  41486. /**
  41487. * @deprecated Removed after 3.0.0, Use `StatisticProps` instead.
  41488. */
  41489. const statisticProps = buildProps({
  41490. decimalSeparator: {
  41491. type: String,
  41492. default: "."
  41493. },
  41494. groupSeparator: {
  41495. type: String,
  41496. default: ","
  41497. },
  41498. precision: {
  41499. type: Number,
  41500. default: 0
  41501. },
  41502. formatter: Function,
  41503. value: {
  41504. type: definePropType([Number, Object]),
  41505. default: 0
  41506. },
  41507. prefix: String,
  41508. suffix: String,
  41509. title: String,
  41510. valueStyle: { type: definePropType([
  41511. String,
  41512. Object,
  41513. Array
  41514. ]) }
  41515. });
  41516. //#endregion
  41517. //#region ../../packages/components/statistic/src/statistic.vue?vue&type=script&setup=true&lang.ts
  41518. var statistic_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  41519. name: "ElStatistic",
  41520. __name: "statistic",
  41521. props: statisticProps,
  41522. setup(__props, { expose: __expose }) {
  41523. const props = __props;
  41524. const ns = useNamespace("statistic");
  41525. const displayValue = (0, vue.computed)(() => {
  41526. const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
  41527. if (isFunction$1(formatter)) return formatter(value);
  41528. if (!isNumber(value) || Number.isNaN(value)) return value;
  41529. let [integer, decimal = ""] = String(value).split(".");
  41530. decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
  41531. integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
  41532. return [integer, decimal].join(decimal ? decimalSeparator : "");
  41533. });
  41534. __expose({ displayValue });
  41535. return (_ctx, _cache) => {
  41536. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [_ctx.$slots.title || __props.title ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41537. key: 0,
  41538. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("head"))
  41539. }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [
  41540. _ctx.$slots.prefix || __props.prefix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41541. key: 0,
  41542. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("prefix"))
  41543. }, [(0, vue.renderSlot)(_ctx.$slots, "prefix", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.prefix), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  41544. (0, vue.createElementVNode)("span", {
  41545. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("number")),
  41546. style: (0, vue.normalizeStyle)(__props.valueStyle)
  41547. }, (0, vue.toDisplayString)(displayValue.value), 7),
  41548. _ctx.$slots.suffix || __props.suffix ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41549. key: 1,
  41550. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("suffix"))
  41551. }, [(0, vue.renderSlot)(_ctx.$slots, "suffix", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.suffix), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true)
  41552. ], 2)], 2);
  41553. };
  41554. }
  41555. });
  41556. //#endregion
  41557. //#region ../../packages/components/statistic/src/statistic.vue
  41558. var statistic_default = statistic_vue_vue_type_script_setup_true_lang_default;
  41559. //#endregion
  41560. //#region ../../packages/components/statistic/index.ts
  41561. const ElStatistic = withInstall(statistic_default);
  41562. //#endregion
  41563. //#region ../../packages/components/countdown/src/countdown.ts
  41564. /**
  41565. * @deprecated Removed after 3.0.0, Use `CountdownProps` instead.
  41566. */
  41567. const countdownProps = buildProps({
  41568. format: {
  41569. type: String,
  41570. default: "HH:mm:ss"
  41571. },
  41572. prefix: String,
  41573. suffix: String,
  41574. title: String,
  41575. value: {
  41576. type: definePropType([Number, Object]),
  41577. default: 0
  41578. },
  41579. valueStyle: { type: definePropType([
  41580. String,
  41581. Object,
  41582. Array
  41583. ]) }
  41584. });
  41585. const countdownEmits = {
  41586. finish: () => true,
  41587. [CHANGE_EVENT]: (value) => isNumber(value)
  41588. };
  41589. //#endregion
  41590. //#region ../../packages/components/countdown/src/utils.ts
  41591. const timeUnits$1 = [
  41592. ["Y", 1e3 * 60 * 60 * 24 * 365],
  41593. ["M", 1e3 * 60 * 60 * 24 * 30],
  41594. ["D", 1e3 * 60 * 60 * 24],
  41595. ["H", 1e3 * 60 * 60],
  41596. ["m", 1e3 * 60],
  41597. ["s", 1e3],
  41598. ["S", 1]
  41599. ];
  41600. const getTime = (value) => {
  41601. return isNumber(value) ? new Date(value).getTime() : value.valueOf();
  41602. };
  41603. const formatTime$1 = (timestamp, format) => {
  41604. let timeLeft = timestamp;
  41605. return timeUnits$1.reduce((current, [name, unit]) => {
  41606. const replaceRegex = new RegExp(`${name}+(?![^\\[\\]]*\\])`, "g");
  41607. if (replaceRegex.test(current)) {
  41608. const value = Math.floor(timeLeft / unit);
  41609. timeLeft -= value * unit;
  41610. return current.replace(replaceRegex, (match) => String(value).padStart(match.length, "0"));
  41611. }
  41612. return current;
  41613. }, format).replace(/\[([^\]]*)]/g, "$1");
  41614. };
  41615. //#endregion
  41616. //#region ../../packages/components/countdown/src/countdown.vue?vue&type=script&setup=true&lang.ts
  41617. var countdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  41618. name: "ElCountdown",
  41619. __name: "countdown",
  41620. props: countdownProps,
  41621. emits: countdownEmits,
  41622. setup(__props, { expose: __expose, emit: __emit }) {
  41623. const props = __props;
  41624. const emit = __emit;
  41625. let timer;
  41626. const rawValue = (0, vue.ref)(0);
  41627. const displayValue = (0, vue.computed)(() => formatTime$1(rawValue.value, props.format));
  41628. const formatter = (val) => formatTime$1(val, props.format);
  41629. const stopTimer = () => {
  41630. if (timer) {
  41631. cAF(timer);
  41632. timer = void 0;
  41633. }
  41634. };
  41635. const startTimer = () => {
  41636. const timestamp = getTime(props.value);
  41637. const frameFunc = () => {
  41638. let diff = timestamp - Date.now();
  41639. emit(CHANGE_EVENT, diff);
  41640. if (diff <= 0) {
  41641. diff = 0;
  41642. stopTimer();
  41643. emit("finish");
  41644. } else timer = rAF(frameFunc);
  41645. rawValue.value = diff;
  41646. };
  41647. timer = rAF(frameFunc);
  41648. };
  41649. (0, vue.onMounted)(() => {
  41650. rawValue.value = getTime(props.value) - Date.now();
  41651. (0, vue.watch)(() => [props.value, props.format], () => {
  41652. stopTimer();
  41653. startTimer();
  41654. }, { immediate: true });
  41655. });
  41656. (0, vue.onBeforeUnmount)(() => {
  41657. stopTimer();
  41658. });
  41659. __expose({ displayValue });
  41660. return (_ctx, _cache) => {
  41661. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElStatistic), {
  41662. value: rawValue.value,
  41663. title: __props.title,
  41664. prefix: __props.prefix,
  41665. suffix: __props.suffix,
  41666. "value-style": __props.valueStyle,
  41667. formatter
  41668. }, (0, vue.createSlots)({ _: 2 }, [(0, vue.renderList)(_ctx.$slots, (_, name) => {
  41669. return {
  41670. name,
  41671. fn: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, name)])
  41672. };
  41673. })]), 1032, [
  41674. "value",
  41675. "title",
  41676. "prefix",
  41677. "suffix",
  41678. "value-style"
  41679. ]);
  41680. };
  41681. }
  41682. });
  41683. //#endregion
  41684. //#region ../../packages/components/countdown/src/countdown.vue
  41685. var countdown_default = countdown_vue_vue_type_script_setup_true_lang_default;
  41686. //#endregion
  41687. //#region ../../packages/components/countdown/index.ts
  41688. const ElCountdown = withInstall(countdown_default);
  41689. //#endregion
  41690. //#region ../../packages/components/steps/src/steps.ts
  41691. /**
  41692. * @deprecated Removed after 3.0.0, Use `StepsProps` instead.
  41693. */
  41694. const stepsProps = buildProps({
  41695. space: {
  41696. type: [Number, String],
  41697. default: ""
  41698. },
  41699. active: {
  41700. type: Number,
  41701. default: 0
  41702. },
  41703. direction: {
  41704. type: String,
  41705. default: "horizontal",
  41706. values: ["horizontal", "vertical"]
  41707. },
  41708. alignCenter: { type: Boolean },
  41709. simple: { type: Boolean },
  41710. finishStatus: {
  41711. type: String,
  41712. values: [
  41713. "wait",
  41714. "process",
  41715. "finish",
  41716. "error",
  41717. "success"
  41718. ],
  41719. default: "finish"
  41720. },
  41721. processStatus: {
  41722. type: String,
  41723. values: [
  41724. "wait",
  41725. "process",
  41726. "finish",
  41727. "error",
  41728. "success"
  41729. ],
  41730. default: "process"
  41731. }
  41732. });
  41733. const stepsEmits = { [CHANGE_EVENT]: (newVal, oldVal) => [newVal, oldVal].every(isNumber) };
  41734. //#endregion
  41735. //#region ../../packages/components/steps/src/tokens.ts
  41736. const STEPS_INJECTION_KEY = "ElSteps";
  41737. //#endregion
  41738. //#region ../../packages/components/steps/src/steps.vue?vue&type=script&setup=true&lang.ts
  41739. var steps_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  41740. name: "ElSteps",
  41741. __name: "steps",
  41742. props: stepsProps,
  41743. emits: stepsEmits,
  41744. setup(__props, { emit: __emit }) {
  41745. const props = __props;
  41746. const emit = __emit;
  41747. const ns = useNamespace("steps");
  41748. const { children: steps, addChild: addStep, removeChild: removeStep, ChildrenSorter: StepsSorter } = useOrderedChildren((0, vue.getCurrentInstance)(), "ElStep");
  41749. (0, vue.watch)(steps, () => {
  41750. steps.value.forEach((instance, index) => {
  41751. instance.setIndex(index);
  41752. });
  41753. });
  41754. (0, vue.provide)(STEPS_INJECTION_KEY, {
  41755. props,
  41756. steps,
  41757. addStep,
  41758. removeStep
  41759. });
  41760. (0, vue.watch)(() => props.active, (newVal, oldVal) => {
  41761. emit(CHANGE_EVENT, newVal, oldVal);
  41762. });
  41763. return (_ctx, _cache) => {
  41764. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).m(__props.simple ? "simple" : __props.direction)]) }, [(0, vue.renderSlot)(_ctx.$slots, "default"), (0, vue.createVNode)((0, vue.unref)(StepsSorter))], 2);
  41765. };
  41766. }
  41767. });
  41768. //#endregion
  41769. //#region ../../packages/components/steps/src/steps.vue
  41770. var steps_default$1 = steps_vue_vue_type_script_setup_true_lang_default;
  41771. //#endregion
  41772. //#region ../../packages/components/steps/src/item.ts
  41773. /**
  41774. * @deprecated Removed after 3.0.0, Use `StepProps` instead.
  41775. */
  41776. const stepProps = buildProps({
  41777. title: {
  41778. type: String,
  41779. default: ""
  41780. },
  41781. icon: { type: iconPropType },
  41782. description: {
  41783. type: String,
  41784. default: ""
  41785. },
  41786. status: {
  41787. type: String,
  41788. values: [
  41789. "",
  41790. "wait",
  41791. "process",
  41792. "finish",
  41793. "error",
  41794. "success"
  41795. ],
  41796. default: ""
  41797. }
  41798. });
  41799. //#endregion
  41800. //#region ../../packages/components/steps/src/item.vue?vue&type=script&setup=true&lang.ts
  41801. var item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  41802. name: "ElStep",
  41803. __name: "item",
  41804. props: stepProps,
  41805. setup(__props) {
  41806. const props = __props;
  41807. const ns = useNamespace("step");
  41808. const index = (0, vue.ref)(-1);
  41809. const lineStyle = (0, vue.ref)({});
  41810. const internalStatus = (0, vue.ref)("");
  41811. const parent = (0, vue.inject)(STEPS_INJECTION_KEY);
  41812. const currentInstance = (0, vue.getCurrentInstance)();
  41813. let stepDiff = 0;
  41814. let beforeActive = 0;
  41815. (0, vue.onMounted)(() => {
  41816. (0, vue.watch)([
  41817. () => parent.props.active,
  41818. () => parent.props.processStatus,
  41819. () => parent.props.finishStatus
  41820. ], ([active], [oldActive]) => {
  41821. beforeActive = oldActive || 0;
  41822. stepDiff = active - beforeActive;
  41823. updateStatus(active);
  41824. }, { immediate: true });
  41825. });
  41826. const currentStatus = (0, vue.computed)(() => {
  41827. return props.status || internalStatus.value;
  41828. });
  41829. const prevInternalStatus = (0, vue.computed)(() => {
  41830. const prevStep = parent.steps.value[index.value - 1];
  41831. return prevStep ? prevStep.internalStatus.value : "wait";
  41832. });
  41833. const isCenter = (0, vue.computed)(() => {
  41834. return parent.props.alignCenter;
  41835. });
  41836. const isVertical = (0, vue.computed)(() => {
  41837. return parent.props.direction === "vertical";
  41838. });
  41839. const isSimple = (0, vue.computed)(() => {
  41840. return parent.props.simple;
  41841. });
  41842. const stepsCount = (0, vue.computed)(() => {
  41843. return parent.steps.value.length;
  41844. });
  41845. const isLast = (0, vue.computed)(() => {
  41846. return parent.steps.value[stepsCount.value - 1]?.uid === currentInstance.uid;
  41847. });
  41848. const space = (0, vue.computed)(() => {
  41849. return isSimple.value ? "" : parent.props.space;
  41850. });
  41851. const containerKls = (0, vue.computed)(() => {
  41852. return [
  41853. ns.b(),
  41854. ns.is(isSimple.value ? "simple" : parent.props.direction),
  41855. ns.is("flex", isLast.value && !space.value && !isCenter.value),
  41856. ns.is("center", isCenter.value && !isVertical.value && !isSimple.value)
  41857. ];
  41858. });
  41859. const style = (0, vue.computed)(() => {
  41860. const style = { flexBasis: isNumber(space.value) ? `${space.value}px` : space.value ? space.value : `${100 / (stepsCount.value - (isCenter.value ? 0 : 1))}%` };
  41861. if (isVertical.value) return style;
  41862. if (isLast.value) style.maxWidth = `${100 / stepsCount.value}%`;
  41863. return style;
  41864. });
  41865. const setIndex = (val) => {
  41866. index.value = val;
  41867. };
  41868. const calcProgress = (status) => {
  41869. const isWait = status === "wait";
  41870. const style = { transitionDelay: `${Math.abs(stepDiff) === 1 ? 0 : stepDiff > 0 ? (index.value + 1 - beforeActive) * 150 : -(index.value + 1 - parent.props.active) * 150}ms` };
  41871. const step = status === parent.props.processStatus || isWait ? 0 : 100;
  41872. style.borderWidth = step && !isSimple.value ? "1px" : 0;
  41873. style[parent.props.direction === "vertical" ? "height" : "width"] = `${step}%`;
  41874. lineStyle.value = style;
  41875. };
  41876. const updateStatus = (activeIndex) => {
  41877. if (activeIndex > index.value) internalStatus.value = parent.props.finishStatus;
  41878. else if (activeIndex === index.value && prevInternalStatus.value !== "error") internalStatus.value = parent.props.processStatus;
  41879. else internalStatus.value = "wait";
  41880. const prevChild = parent.steps.value[index.value - 1];
  41881. if (prevChild) prevChild.calcProgress(internalStatus.value);
  41882. };
  41883. const stepItemState = {
  41884. uid: currentInstance.uid,
  41885. getVnode: () => currentInstance.vnode,
  41886. currentStatus,
  41887. internalStatus,
  41888. setIndex,
  41889. calcProgress
  41890. };
  41891. parent.addStep(stepItemState);
  41892. (0, vue.onBeforeUnmount)(() => {
  41893. parent.removeStep(stepItemState);
  41894. });
  41895. return (_ctx, _cache) => {
  41896. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41897. style: (0, vue.normalizeStyle)(style.value),
  41898. class: (0, vue.normalizeClass)(containerKls.value)
  41899. }, [
  41900. (0, vue.createCommentVNode)(" icon & line "),
  41901. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("head"), (0, vue.unref)(ns).is(currentStatus.value)]) }, [!isSimple.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41902. key: 0,
  41903. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("line"))
  41904. }, [(0, vue.createElementVNode)("i", {
  41905. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("line-inner")),
  41906. style: (0, vue.normalizeStyle)(lineStyle.value)
  41907. }, null, 6)], 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), (0, vue.unref)(ns).is(__props.icon || _ctx.$slots.icon ? "icon" : "text")]) }, [(0, vue.renderSlot)(_ctx.$slots, "icon", {}, () => [__props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  41908. key: 0,
  41909. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon-inner"))
  41910. }, {
  41911. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  41912. _: 1
  41913. }, 8, ["class"])) : currentStatus.value === "success" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  41914. key: 1,
  41915. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon-inner"), (0, vue.unref)(ns).is("status")])
  41916. }, {
  41917. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(check_default))]),
  41918. _: 1
  41919. }, 8, ["class"])) : currentStatus.value === "error" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  41920. key: 2,
  41921. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon-inner"), (0, vue.unref)(ns).is("status")])
  41922. }, {
  41923. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  41924. _: 1
  41925. }, 8, ["class"])) : !isSimple.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41926. key: 3,
  41927. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon-inner"))
  41928. }, (0, vue.toDisplayString)(index.value + 1), 3)) : (0, vue.createCommentVNode)("v-if", true)])], 2)], 2),
  41929. (0, vue.createCommentVNode)(" title & description "),
  41930. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("main")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("title"), (0, vue.unref)(ns).is(currentStatus.value)]) }, [(0, vue.renderSlot)(_ctx.$slots, "title", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 2), isSimple.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41931. key: 0,
  41932. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("arrow"))
  41933. }, null, 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  41934. key: 1,
  41935. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("description"), (0, vue.unref)(ns).is(currentStatus.value)])
  41936. }, [(0, vue.renderSlot)(_ctx.$slots, "description", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.description), 1)])], 2))], 2)
  41937. ], 6);
  41938. };
  41939. }
  41940. });
  41941. //#endregion
  41942. //#region ../../packages/components/steps/src/item.vue
  41943. var item_default = item_vue_vue_type_script_setup_true_lang_default;
  41944. //#endregion
  41945. //#region ../../packages/components/steps/index.ts
  41946. const ElSteps = withInstall(steps_default$1, { Step: item_default });
  41947. const ElStep = withNoopInstall(item_default);
  41948. //#endregion
  41949. //#region ../../packages/components/switch/src/switch.ts
  41950. /**
  41951. * @deprecated Removed after 3.0.0, Use `SwitchProps` instead.
  41952. */
  41953. const switchProps = buildProps({
  41954. modelValue: {
  41955. type: [
  41956. Boolean,
  41957. String,
  41958. Number
  41959. ],
  41960. default: false
  41961. },
  41962. disabled: {
  41963. type: Boolean,
  41964. default: void 0
  41965. },
  41966. loading: Boolean,
  41967. size: {
  41968. type: String,
  41969. validator: isValidComponentSize
  41970. },
  41971. width: {
  41972. type: [String, Number],
  41973. default: ""
  41974. },
  41975. inlinePrompt: Boolean,
  41976. inactiveActionIcon: { type: iconPropType },
  41977. activeActionIcon: { type: iconPropType },
  41978. activeIcon: { type: iconPropType },
  41979. inactiveIcon: { type: iconPropType },
  41980. activeText: {
  41981. type: String,
  41982. default: ""
  41983. },
  41984. inactiveText: {
  41985. type: String,
  41986. default: ""
  41987. },
  41988. activeValue: {
  41989. type: [
  41990. Boolean,
  41991. String,
  41992. Number
  41993. ],
  41994. default: true
  41995. },
  41996. inactiveValue: {
  41997. type: [
  41998. Boolean,
  41999. String,
  42000. Number
  42001. ],
  42002. default: false
  42003. },
  42004. name: {
  42005. type: String,
  42006. default: ""
  42007. },
  42008. validateEvent: {
  42009. type: Boolean,
  42010. default: true
  42011. },
  42012. beforeChange: { type: definePropType(Function) },
  42013. id: String,
  42014. tabindex: { type: [String, Number] },
  42015. ...useAriaProps(["ariaLabel"])
  42016. });
  42017. const switchEmits = {
  42018. [UPDATE_MODEL_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  42019. [CHANGE_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val),
  42020. [INPUT_EVENT]: (val) => isBoolean(val) || isString(val) || isNumber(val)
  42021. };
  42022. //#endregion
  42023. //#region ../../packages/components/switch/src/switch.vue?vue&type=script&setup=true&lang.ts
  42024. const _hoisted_1$18 = [
  42025. "id",
  42026. "aria-checked",
  42027. "aria-disabled",
  42028. "aria-label",
  42029. "name",
  42030. "true-value",
  42031. "false-value",
  42032. "disabled",
  42033. "tabindex"
  42034. ];
  42035. const _hoisted_2$11 = ["aria-hidden"];
  42036. const _hoisted_3$4 = { key: 1 };
  42037. const _hoisted_4$3 = { key: 1 };
  42038. const _hoisted_5$1 = ["aria-hidden"];
  42039. const COMPONENT_NAME$6 = "ElSwitch";
  42040. var switch_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  42041. name: COMPONENT_NAME$6,
  42042. __name: "switch",
  42043. props: switchProps,
  42044. emits: switchEmits,
  42045. setup(__props, { expose: __expose, emit: __emit }) {
  42046. const props = __props;
  42047. const emit = __emit;
  42048. const { formItem } = useFormItem();
  42049. const switchSize = useFormSize();
  42050. const ns = useNamespace("switch");
  42051. const { inputId } = useFormItemInputId(props, { formItemContext: formItem });
  42052. const switchDisabled = useFormDisabled((0, vue.computed)(() => {
  42053. if (props.loading) return true;
  42054. }));
  42055. const isControlled = (0, vue.ref)(props.modelValue !== false);
  42056. const input = (0, vue.shallowRef)();
  42057. const switchKls = (0, vue.computed)(() => [
  42058. ns.b(),
  42059. ns.m(switchSize.value),
  42060. ns.is("disabled", switchDisabled.value),
  42061. ns.is("checked", checked.value)
  42062. ]);
  42063. const labelLeftKls = (0, vue.computed)(() => [
  42064. ns.e("label"),
  42065. ns.em("label", "left"),
  42066. ns.is("active", !checked.value)
  42067. ]);
  42068. const labelRightKls = (0, vue.computed)(() => [
  42069. ns.e("label"),
  42070. ns.em("label", "right"),
  42071. ns.is("active", checked.value)
  42072. ]);
  42073. const coreStyle = (0, vue.computed)(() => ({ width: addUnit(props.width) }));
  42074. (0, vue.watch)(() => props.modelValue, () => {
  42075. isControlled.value = true;
  42076. });
  42077. const actualValue = (0, vue.computed)(() => {
  42078. return isControlled.value ? props.modelValue : false;
  42079. });
  42080. const checked = (0, vue.computed)(() => actualValue.value === props.activeValue);
  42081. if (![props.activeValue, props.inactiveValue].includes(actualValue.value)) {
  42082. emit(UPDATE_MODEL_EVENT, props.inactiveValue);
  42083. emit(CHANGE_EVENT, props.inactiveValue);
  42084. emit(INPUT_EVENT, props.inactiveValue);
  42085. }
  42086. (0, vue.watch)(checked, (val) => {
  42087. input.value.checked = val;
  42088. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  42089. });
  42090. const handleChange = () => {
  42091. const val = checked.value ? props.inactiveValue : props.activeValue;
  42092. emit(UPDATE_MODEL_EVENT, val);
  42093. emit(CHANGE_EVENT, val);
  42094. emit(INPUT_EVENT, val);
  42095. (0, vue.nextTick)(() => {
  42096. input.value.checked = checked.value;
  42097. });
  42098. };
  42099. const switchValue = () => {
  42100. if (switchDisabled.value) return;
  42101. const { beforeChange } = props;
  42102. if (!beforeChange) {
  42103. handleChange();
  42104. return;
  42105. }
  42106. const shouldChange = beforeChange();
  42107. if (![isPromise(shouldChange), isBoolean(shouldChange)].includes(true)) throwError(COMPONENT_NAME$6, "beforeChange must return type `Promise<boolean>` or `boolean`");
  42108. if (isPromise(shouldChange)) shouldChange.then((result) => {
  42109. if (result) handleChange();
  42110. }).catch((e) => {
  42111. /* @__PURE__ */ debugWarn(COMPONENT_NAME$6, `some error occurred: ${e}`);
  42112. });
  42113. else if (shouldChange) handleChange();
  42114. };
  42115. const focus = () => {
  42116. input.value?.focus?.();
  42117. };
  42118. (0, vue.onMounted)(() => {
  42119. input.value.checked = checked.value;
  42120. });
  42121. __expose({
  42122. focus,
  42123. checked
  42124. });
  42125. return (_ctx, _cache) => {
  42126. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  42127. class: (0, vue.normalizeClass)(switchKls.value),
  42128. onClick: (0, vue.withModifiers)(switchValue, ["prevent"])
  42129. }, [
  42130. (0, vue.createElementVNode)("input", {
  42131. id: (0, vue.unref)(inputId),
  42132. ref_key: "input",
  42133. ref: input,
  42134. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input")),
  42135. type: "checkbox",
  42136. role: "switch",
  42137. "aria-checked": checked.value,
  42138. "aria-disabled": (0, vue.unref)(switchDisabled),
  42139. "aria-label": __props.ariaLabel,
  42140. name: __props.name,
  42141. "true-value": __props.activeValue,
  42142. "false-value": __props.inactiveValue,
  42143. disabled: (0, vue.unref)(switchDisabled),
  42144. tabindex: __props.tabindex,
  42145. onChange: handleChange,
  42146. onKeydown: (0, vue.withKeys)(switchValue, ["enter"])
  42147. }, null, 42, _hoisted_1$18),
  42148. !__props.inlinePrompt && (__props.inactiveIcon || __props.inactiveText || _ctx.$slots.inactive) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  42149. key: 0,
  42150. class: (0, vue.normalizeClass)(labelLeftKls.value)
  42151. }, [(0, vue.renderSlot)(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42152. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.inactiveIcon)))]),
  42153. _: 1
  42154. })) : (0, vue.createCommentVNode)("v-if", true), !__props.inactiveIcon && __props.inactiveText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  42155. key: 1,
  42156. "aria-hidden": checked.value
  42157. }, (0, vue.toDisplayString)(__props.inactiveText), 9, _hoisted_2$11)) : (0, vue.createCommentVNode)("v-if", true)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  42158. (0, vue.createElementVNode)("span", {
  42159. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("core")),
  42160. style: (0, vue.normalizeStyle)(coreStyle.value)
  42161. }, [__props.inlinePrompt ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  42162. key: 0,
  42163. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner"))
  42164. }, [!checked.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  42165. key: 0,
  42166. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner-wrapper"))
  42167. }, [(0, vue.renderSlot)(_ctx.$slots, "inactive", {}, () => [__props.inactiveIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42168. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.inactiveIcon)))]),
  42169. _: 1
  42170. })) : (0, vue.createCommentVNode)("v-if", true), !__props.inactiveIcon && __props.inactiveText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_3$4, (0, vue.toDisplayString)(__props.inactiveText), 1)) : (0, vue.createCommentVNode)("v-if", true)])], 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  42171. key: 1,
  42172. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("inner-wrapper"))
  42173. }, [(0, vue.renderSlot)(_ctx.$slots, "active", {}, () => [__props.activeIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42174. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.activeIcon)))]),
  42175. _: 1
  42176. })) : (0, vue.createCommentVNode)("v-if", true), !__props.activeIcon && __props.activeText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_4$3, (0, vue.toDisplayString)(__props.activeText), 1)) : (0, vue.createCommentVNode)("v-if", true)])], 2))], 2)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("action")) }, [__props.loading ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  42177. key: 0,
  42178. class: (0, vue.normalizeClass)((0, vue.unref)(ns).is("loading"))
  42179. }, {
  42180. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(loading_default))]),
  42181. _: 1
  42182. }, 8, ["class"])) : checked.value ? (0, vue.renderSlot)(_ctx.$slots, "active-action", { key: 1 }, () => [__props.activeActionIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42183. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.activeActionIcon)))]),
  42184. _: 1
  42185. })) : (0, vue.createCommentVNode)("v-if", true)]) : !checked.value ? (0, vue.renderSlot)(_ctx.$slots, "inactive-action", { key: 2 }, () => [__props.inactiveActionIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42186. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.inactiveActionIcon)))]),
  42187. _: 1
  42188. })) : (0, vue.createCommentVNode)("v-if", true)]) : (0, vue.createCommentVNode)("v-if", true)], 2)], 6),
  42189. !__props.inlinePrompt && (__props.activeIcon || __props.activeText || _ctx.$slots.active) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  42190. key: 1,
  42191. class: (0, vue.normalizeClass)(labelRightKls.value)
  42192. }, [(0, vue.renderSlot)(_ctx.$slots, "active", {}, () => [__props.activeIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), { key: 0 }, {
  42193. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.activeIcon)))]),
  42194. _: 1
  42195. })) : (0, vue.createCommentVNode)("v-if", true), !__props.activeIcon && __props.activeText ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  42196. key: 1,
  42197. "aria-hidden": !checked.value
  42198. }, (0, vue.toDisplayString)(__props.activeText), 9, _hoisted_5$1)) : (0, vue.createCommentVNode)("v-if", true)])], 2)) : (0, vue.createCommentVNode)("v-if", true)
  42199. ], 2);
  42200. };
  42201. }
  42202. });
  42203. //#endregion
  42204. //#region ../../packages/components/switch/src/switch.vue
  42205. var switch_default = switch_vue_vue_type_script_setup_true_lang_default;
  42206. //#endregion
  42207. //#region ../../packages/components/switch/index.ts
  42208. const ElSwitch = withInstall(switch_default);
  42209. //#endregion
  42210. //#region ../../packages/components/table/src/util.ts
  42211. const getCell = function(event) {
  42212. return event.target?.closest("td");
  42213. };
  42214. const orderBy = function(array, sortKey, reverse, sortMethod, sortBy) {
  42215. if (!sortKey && !sortMethod && (!sortBy || isArray$1(sortBy) && !sortBy.length)) return array;
  42216. if (isString(reverse)) reverse = reverse === "descending" ? -1 : 1;
  42217. else reverse = reverse && reverse < 0 ? -1 : 1;
  42218. const getKey = sortMethod ? null : function(value, index) {
  42219. if (sortBy) return flatMap(castArray$1(sortBy), (by) => {
  42220. if (isString(by)) return get(value, by);
  42221. else return by(value, index, array);
  42222. });
  42223. if (sortKey !== "$key") {
  42224. if (isObject$1(value) && "$value" in value) value = value.$value;
  42225. }
  42226. return [isObject$1(value) ? sortKey ? get(value, sortKey) : null : value];
  42227. };
  42228. const compare = function(a, b) {
  42229. if (sortMethod) return sortMethod(a.value, b.value);
  42230. for (let i = 0, len = a.key?.length ?? 0; i < len; i++) {
  42231. if (a.key?.[i] < b.key?.[i]) return -1;
  42232. if (a.key?.[i] > b.key?.[i]) return 1;
  42233. }
  42234. return 0;
  42235. };
  42236. return array.map((value, index) => {
  42237. return {
  42238. value,
  42239. index,
  42240. key: getKey ? getKey(value, index) : null
  42241. };
  42242. }).sort((a, b) => {
  42243. let order = compare(a, b);
  42244. if (!order) order = a.index - b.index;
  42245. return order * +reverse;
  42246. }).map((item) => item.value);
  42247. };
  42248. const getColumnById = function(table, columnId) {
  42249. let column = null;
  42250. table.columns.forEach((item) => {
  42251. if (item.id === columnId) column = item;
  42252. });
  42253. return column;
  42254. };
  42255. const getColumnByKey = function(table, columnKey) {
  42256. let column = null;
  42257. for (let i = 0; i < table.columns.length; i++) {
  42258. const item = table.columns[i];
  42259. if (item.columnKey === columnKey) {
  42260. column = item;
  42261. break;
  42262. }
  42263. }
  42264. if (!column) throwError("ElTable", `No column matching with column-key: ${columnKey}`);
  42265. return column;
  42266. };
  42267. const getColumnByCell = function(table, cell, namespace) {
  42268. const matches = (cell.className || "").match(new RegExp(`${namespace}-table_[^\\s]+`, "gm"));
  42269. if (matches) return getColumnById(table, matches[0]);
  42270. return null;
  42271. };
  42272. const getRowIdentity = (row, rowKey) => {
  42273. if (!row) throw new Error("Row is required when get row identity");
  42274. if (isString(rowKey)) {
  42275. if (!rowKey.includes(".")) return `${row[rowKey]}`;
  42276. const key = rowKey.split(".");
  42277. let current = row;
  42278. for (const element of key) current = current[element];
  42279. return `${current}`;
  42280. } else if (isFunction$1(rowKey)) return rowKey.call(null, row);
  42281. return "";
  42282. };
  42283. const getKeysMap = function(array, rowKey, flatten = false, childrenKey = "children") {
  42284. const data = array || [];
  42285. const arrayMap = {};
  42286. data.forEach((row, index) => {
  42287. arrayMap[getRowIdentity(row, rowKey)] = {
  42288. row,
  42289. index
  42290. };
  42291. if (flatten) {
  42292. const children = row[childrenKey];
  42293. if (isArray$1(children)) Object.assign(arrayMap, getKeysMap(children, rowKey, true, childrenKey));
  42294. }
  42295. });
  42296. return arrayMap;
  42297. };
  42298. function mergeOptions(defaults, config) {
  42299. const options = {};
  42300. let key;
  42301. for (key in defaults) options[key] = defaults[key];
  42302. for (key in config) if (hasOwn(config, key)) {
  42303. const value = config[key];
  42304. if (!isUndefined(value)) options[key] = value;
  42305. }
  42306. return options;
  42307. }
  42308. function parseWidth(width) {
  42309. if (width === "") return width;
  42310. if (!isUndefined(width)) {
  42311. width = Number.parseInt(width, 10);
  42312. if (Number.isNaN(width)) width = "";
  42313. }
  42314. return width;
  42315. }
  42316. function parseMinWidth(minWidth) {
  42317. if (minWidth === "") return minWidth;
  42318. if (!isUndefined(minWidth)) {
  42319. minWidth = parseWidth(minWidth);
  42320. if (Number.isNaN(minWidth)) minWidth = 80;
  42321. }
  42322. return minWidth;
  42323. }
  42324. function parseHeight(height) {
  42325. if (isNumber(height)) return height;
  42326. if (isString(height)) if (/^\d+(?:px)?$/.test(height)) return Number.parseInt(height, 10);
  42327. else return height;
  42328. return null;
  42329. }
  42330. function compose(...funcs) {
  42331. if (funcs.length === 0) return (arg) => arg;
  42332. if (funcs.length === 1) return funcs[0];
  42333. return funcs.reduce((a, b) => (...args) => a(b(...args)));
  42334. }
  42335. function toggleRowStatus(statusArr, row, newVal, tableTreeProps, selectable, rowIndex, rowKey) {
  42336. let _rowIndex = rowIndex ?? 0;
  42337. let changed = false;
  42338. const getIndex = () => {
  42339. if (!rowKey) return statusArr.indexOf(row);
  42340. const id = getRowIdentity(row, rowKey);
  42341. return statusArr.findIndex((item) => getRowIdentity(item, rowKey) === id);
  42342. };
  42343. const index = getIndex();
  42344. const included = index !== -1;
  42345. const isRowSelectable = selectable?.call(null, row, _rowIndex);
  42346. const toggleStatus = (type) => {
  42347. if (type === "add") statusArr.push(row);
  42348. else statusArr.splice(index, 1);
  42349. changed = true;
  42350. };
  42351. const getChildrenCount = (row) => {
  42352. let count = 0;
  42353. const children = tableTreeProps?.children && row[tableTreeProps.children];
  42354. if (children && isArray$1(children)) {
  42355. count += children.length;
  42356. children.forEach((item) => {
  42357. count += getChildrenCount(item);
  42358. });
  42359. }
  42360. return count;
  42361. };
  42362. if (!selectable || isRowSelectable) if (isBoolean(newVal)) {
  42363. if (newVal && !included) toggleStatus("add");
  42364. else if (!newVal && included) toggleStatus("remove");
  42365. } else included ? toggleStatus("remove") : toggleStatus("add");
  42366. if (!tableTreeProps?.checkStrictly && tableTreeProps?.children && isArray$1(row[tableTreeProps.children])) row[tableTreeProps.children].forEach((item) => {
  42367. const childChanged = toggleRowStatus(statusArr, item, newVal ?? !included, tableTreeProps, selectable, _rowIndex + 1, rowKey);
  42368. _rowIndex += getChildrenCount(item) + 1;
  42369. if (childChanged) changed = childChanged;
  42370. });
  42371. return changed;
  42372. }
  42373. function walkTreeNode(root, cb, childrenKey = "children", lazyKey = "hasChildren", lazy = false) {
  42374. const isNil = (array) => !(isArray$1(array) && array.length);
  42375. function _walker(parent, children, level) {
  42376. cb(parent, children, level);
  42377. children.forEach((item) => {
  42378. if (item[lazyKey] && lazy) {
  42379. cb(item, null, level + 1);
  42380. return;
  42381. }
  42382. const children = item[childrenKey];
  42383. if (!isNil(children)) _walker(item, children, level + 1);
  42384. });
  42385. }
  42386. root.forEach((item) => {
  42387. if (item[lazyKey] && lazy) {
  42388. cb(item, null, 0);
  42389. return;
  42390. }
  42391. const children = item[childrenKey];
  42392. if (!isNil(children)) _walker(item, children, 0);
  42393. });
  42394. }
  42395. const getTableOverflowTooltipProps = (props, innerText, row, column) => {
  42396. const popperOptions = {
  42397. strategy: "fixed",
  42398. ...props.popperOptions
  42399. };
  42400. const tooltipFormatterContent = isFunction$1(column?.tooltipFormatter) ? column.tooltipFormatter({
  42401. row,
  42402. column,
  42403. cellValue: getProp(row, column.property).value
  42404. }) : void 0;
  42405. if ((0, vue.isVNode)(tooltipFormatterContent)) return {
  42406. slotContent: tooltipFormatterContent,
  42407. content: null,
  42408. ...props,
  42409. popperOptions
  42410. };
  42411. return {
  42412. slotContent: null,
  42413. content: tooltipFormatterContent ?? innerText,
  42414. ...props,
  42415. popperOptions
  42416. };
  42417. };
  42418. let removePopper = null;
  42419. function createTablePopper(props, popperContent, row, column, trigger, table) {
  42420. const tableOverflowTooltipProps = getTableOverflowTooltipProps(props, popperContent, row, column);
  42421. const mergedProps = {
  42422. ...tableOverflowTooltipProps,
  42423. slotContent: void 0
  42424. };
  42425. if (removePopper?.trigger === trigger) {
  42426. const comp = removePopper.vm?.component;
  42427. merge(comp?.props, mergedProps);
  42428. if (comp && tableOverflowTooltipProps.slotContent) comp.slots.content = () => [tableOverflowTooltipProps.slotContent];
  42429. return;
  42430. }
  42431. removePopper?.();
  42432. const parentNode = table?.refs.tableWrapper;
  42433. const ns = parentNode?.dataset.prefix;
  42434. const vm = (0, vue.createVNode)(ElTooltip, {
  42435. virtualTriggering: true,
  42436. virtualRef: trigger,
  42437. appendTo: parentNode,
  42438. placement: "top",
  42439. transition: "none",
  42440. offset: 0,
  42441. hideAfter: 0,
  42442. ...mergedProps
  42443. }, tableOverflowTooltipProps.slotContent ? { content: () => tableOverflowTooltipProps.slotContent } : void 0);
  42444. vm.appContext = {
  42445. ...table.appContext,
  42446. ...table
  42447. };
  42448. const container = document.createElement("div");
  42449. (0, vue.render)(vm, container);
  42450. vm.component.exposed.onOpen();
  42451. const scrollContainer = parentNode?.querySelector(`.${ns}-scrollbar__wrap`);
  42452. removePopper = () => {
  42453. if (vm.component?.exposed?.onClose) vm.component.exposed.onClose();
  42454. (0, vue.render)(null, container);
  42455. const currentRemovePopper = removePopper;
  42456. scrollContainer?.removeEventListener("scroll", currentRemovePopper);
  42457. currentRemovePopper.trigger = void 0;
  42458. currentRemovePopper.vm = void 0;
  42459. removePopper = null;
  42460. };
  42461. removePopper.trigger = trigger ?? void 0;
  42462. removePopper.vm = vm;
  42463. scrollContainer?.addEventListener("scroll", removePopper);
  42464. }
  42465. function getCurrentColumns(column) {
  42466. if (column.children) return flatMap(column.children, getCurrentColumns);
  42467. else return [column];
  42468. }
  42469. function getColSpan(colSpan, column) {
  42470. return colSpan + column.colSpan;
  42471. }
  42472. const isFixedColumn = (index, fixed, store, realColumns) => {
  42473. let start = 0;
  42474. let after = index;
  42475. const columns = store.states.columns.value;
  42476. if (realColumns) {
  42477. const curColumns = getCurrentColumns(realColumns[index]);
  42478. start = columns.slice(0, columns.indexOf(curColumns[0])).reduce(getColSpan, 0);
  42479. after = start + curColumns.reduce(getColSpan, 0) - 1;
  42480. } else start = index;
  42481. let fixedLayout;
  42482. switch (fixed) {
  42483. case "left":
  42484. if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left";
  42485. break;
  42486. case "right":
  42487. if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right";
  42488. break;
  42489. default: if (after < store.states.fixedLeafColumnsLength.value) fixedLayout = "left";
  42490. else if (start >= columns.length - store.states.rightFixedLeafColumnsLength.value) fixedLayout = "right";
  42491. }
  42492. return fixedLayout ? {
  42493. direction: fixedLayout,
  42494. start,
  42495. after
  42496. } : {};
  42497. };
  42498. const getFixedColumnsClass = (namespace, index, fixed, store, realColumns, offset = 0) => {
  42499. const classes = [];
  42500. const { direction, start, after } = isFixedColumn(index, fixed, store, realColumns);
  42501. if (direction) {
  42502. const isLeft = direction === "left";
  42503. classes.push(`${namespace}-fixed-column--${direction}`);
  42504. if (isLeft && after + offset === store.states.fixedLeafColumnsLength.value - 1) classes.push("is-last-column");
  42505. else if (!isLeft && start - offset === store.states.columns.value.length - store.states.rightFixedLeafColumnsLength.value) classes.push("is-first-column");
  42506. }
  42507. return classes;
  42508. };
  42509. function getOffset(offset, column) {
  42510. return offset + (isNull(column.realWidth) || Number.isNaN(column.realWidth) ? Number(column.width) : column.realWidth);
  42511. }
  42512. const getFixedColumnOffset = (index, fixed, store, realColumns) => {
  42513. const { direction, start = 0, after = 0 } = isFixedColumn(index, fixed, store, realColumns);
  42514. if (!direction) return;
  42515. const styles = {};
  42516. const isLeft = direction === "left";
  42517. const columns = store.states.columns.value;
  42518. if (isLeft) styles.left = columns.slice(0, start).reduce(getOffset, 0);
  42519. else styles.right = columns.slice(after + 1).reverse().reduce(getOffset, 0);
  42520. return styles;
  42521. };
  42522. const ensurePosition = (style, key) => {
  42523. if (!style) return;
  42524. if (!Number.isNaN(style[key])) style[key] = `${style[key]}px`;
  42525. };
  42526. function ensureValidVNode(vnodes) {
  42527. return vnodes.some((child) => {
  42528. if (!(0, vue.isVNode)(child)) return true;
  42529. if (child.type === vue.Comment) return false;
  42530. if (child.type === vue.Fragment && !ensureValidVNode(child.children)) return false;
  42531. return true;
  42532. }) ? vnodes : null;
  42533. }
  42534. //#endregion
  42535. //#region ../../packages/components/table/src/store/expand.ts
  42536. function useExpand(watcherData) {
  42537. const instance = (0, vue.getCurrentInstance)();
  42538. const defaultExpandAll = (0, vue.ref)(false);
  42539. const expandRows = (0, vue.ref)([]);
  42540. const canRowExpand = (row, index) => {
  42541. const expandableFn = instance.store.states.rowExpandable.value;
  42542. return expandableFn?.(row, index) ?? true;
  42543. };
  42544. const updateExpandRows = () => {
  42545. const data = watcherData.data.value || [];
  42546. const rowKey = watcherData.rowKey.value;
  42547. if (defaultExpandAll.value) expandRows.value = instance.store.states.rowExpandable.value ? data.filter(canRowExpand) : data.slice();
  42548. else if (rowKey) {
  42549. const expandRowsMap = getKeysMap(expandRows.value, rowKey);
  42550. expandRows.value = data.filter((row, index) => {
  42551. return !!expandRowsMap[getRowIdentity(row, rowKey)] && canRowExpand(row, index);
  42552. });
  42553. } else expandRows.value = [];
  42554. };
  42555. const toggleRowExpansion = (row, expanded) => {
  42556. const rowIndex = (watcherData.data.value || []).indexOf(row);
  42557. if (rowIndex > -1 && !canRowExpand(row, rowIndex)) return;
  42558. if (toggleRowStatus(expandRows.value, row, expanded, void 0, void 0, void 0, watcherData.rowKey.value)) instance.emit("expand-change", row, expandRows.value.slice());
  42559. };
  42560. const setExpandRowKeys = (rowKeys) => {
  42561. instance.store.assertRowKey();
  42562. const data = watcherData.data.value || [];
  42563. const rowKey = watcherData.rowKey.value;
  42564. const keysMap = getKeysMap(data, rowKey);
  42565. expandRows.value = rowKeys.reduce((prev, cur) => {
  42566. const info = keysMap[cur];
  42567. if (info && canRowExpand(info.row, info.index)) prev.push(info.row);
  42568. return prev;
  42569. }, []);
  42570. };
  42571. const isRowExpanded = (row) => {
  42572. const rowKey = watcherData.rowKey.value;
  42573. if (rowKey) return !!getKeysMap(expandRows.value, rowKey)[getRowIdentity(row, rowKey)];
  42574. return expandRows.value.includes(row);
  42575. };
  42576. return {
  42577. updateExpandRows,
  42578. toggleRowExpansion,
  42579. setExpandRowKeys,
  42580. isRowExpanded,
  42581. states: {
  42582. expandRows,
  42583. defaultExpandAll
  42584. }
  42585. };
  42586. }
  42587. //#endregion
  42588. //#region ../../packages/components/table/src/store/current.ts
  42589. function useCurrent(watcherData) {
  42590. const instance = (0, vue.getCurrentInstance)();
  42591. const _currentRowKey = (0, vue.ref)(null);
  42592. const currentRow = (0, vue.ref)(null);
  42593. const setCurrentRowKey = (key) => {
  42594. instance.store.assertRowKey();
  42595. _currentRowKey.value = key;
  42596. setCurrentRowByKey(key);
  42597. };
  42598. const restoreCurrentRowKey = () => {
  42599. _currentRowKey.value = null;
  42600. };
  42601. const setCurrentRowByKey = (key) => {
  42602. const { data, rowKey } = watcherData;
  42603. const oldCurrentRow = currentRow.value;
  42604. let _currentRow = null;
  42605. if (rowKey.value) _currentRow = ((0, vue.unref)(data) || []).find((item) => getRowIdentity(item, rowKey.value) === key) ?? null;
  42606. currentRow.value = _currentRow ?? null;
  42607. instance.emit("current-change", currentRow.value, oldCurrentRow);
  42608. };
  42609. const updateCurrentRow = (_currentRow) => {
  42610. const oldCurrentRow = currentRow.value;
  42611. if (_currentRow && _currentRow !== oldCurrentRow) {
  42612. currentRow.value = _currentRow;
  42613. instance.emit("current-change", currentRow.value, oldCurrentRow);
  42614. return;
  42615. }
  42616. if (!_currentRow && oldCurrentRow) {
  42617. currentRow.value = null;
  42618. instance.emit("current-change", null, oldCurrentRow);
  42619. }
  42620. };
  42621. const updateCurrentRowData = () => {
  42622. const rowKey = watcherData.rowKey.value;
  42623. const data = watcherData.data.value || [];
  42624. const oldCurrentRow = currentRow.value;
  42625. if (oldCurrentRow && !data.includes(oldCurrentRow)) if (rowKey) setCurrentRowByKey(getRowIdentity(oldCurrentRow, rowKey));
  42626. else {
  42627. currentRow.value = null;
  42628. instance.emit("current-change", null, oldCurrentRow);
  42629. }
  42630. else if (_currentRowKey.value) {
  42631. setCurrentRowByKey(_currentRowKey.value);
  42632. restoreCurrentRowKey();
  42633. }
  42634. };
  42635. return {
  42636. setCurrentRowKey,
  42637. restoreCurrentRowKey,
  42638. setCurrentRowByKey,
  42639. updateCurrentRow,
  42640. updateCurrentRowData,
  42641. states: {
  42642. _currentRowKey,
  42643. currentRow
  42644. }
  42645. };
  42646. }
  42647. //#endregion
  42648. //#region ../../packages/components/table/src/store/tree.ts
  42649. function useTree$2(watcherData) {
  42650. const expandRowKeys = (0, vue.ref)([]);
  42651. const treeData = (0, vue.ref)({});
  42652. const indent = (0, vue.ref)(16);
  42653. const lazy = (0, vue.ref)(false);
  42654. const lazyTreeNodeMap = (0, vue.ref)({});
  42655. const lazyColumnIdentifier = (0, vue.ref)("hasChildren");
  42656. const childrenColumnName = (0, vue.ref)("children");
  42657. const checkStrictly = (0, vue.ref)(false);
  42658. const instance = (0, vue.getCurrentInstance)();
  42659. const normalizedData = (0, vue.computed)(() => {
  42660. if (!watcherData.rowKey.value) return {};
  42661. return normalize(watcherData.data.value || []);
  42662. });
  42663. const normalizedLazyNode = (0, vue.computed)(() => {
  42664. const rowKey = watcherData.rowKey.value;
  42665. const keys = Object.keys(lazyTreeNodeMap.value);
  42666. const res = {};
  42667. if (!keys.length) return res;
  42668. keys.forEach((key) => {
  42669. if (lazyTreeNodeMap.value[key].length) {
  42670. const item = { children: [] };
  42671. lazyTreeNodeMap.value[key].forEach((row) => {
  42672. const currentRowKey = getRowIdentity(row, rowKey);
  42673. item.children.push(currentRowKey);
  42674. if (row[lazyColumnIdentifier.value] && !res[currentRowKey]) res[currentRowKey] = { children: [] };
  42675. });
  42676. res[key] = item;
  42677. }
  42678. });
  42679. return res;
  42680. });
  42681. const normalize = (data) => {
  42682. const rowKey = watcherData.rowKey.value;
  42683. const res = {};
  42684. walkTreeNode(data, (parent, children, level) => {
  42685. const parentId = getRowIdentity(parent, rowKey);
  42686. if (isArray$1(children)) res[parentId] = {
  42687. children: children.map((row) => getRowIdentity(row, rowKey)),
  42688. level
  42689. };
  42690. else if (lazy.value) res[parentId] = {
  42691. children: [],
  42692. lazy: true,
  42693. level
  42694. };
  42695. }, childrenColumnName.value, lazyColumnIdentifier.value, lazy.value);
  42696. return res;
  42697. };
  42698. const updateTreeData = (ifChangeExpandRowKeys = false, ifExpandAll) => {
  42699. ifExpandAll ||= instance.store?.states.defaultExpandAll.value;
  42700. const nested = normalizedData.value;
  42701. const normalizedLazyNode_ = normalizedLazyNode.value;
  42702. const keys = Object.keys(nested);
  42703. const newTreeData = {};
  42704. if (keys.length) {
  42705. const oldTreeData = (0, vue.unref)(treeData);
  42706. const rootLazyRowKeys = [];
  42707. const getExpanded = (oldValue, key) => {
  42708. if (ifChangeExpandRowKeys) if (expandRowKeys.value) return ifExpandAll || expandRowKeys.value.includes(key);
  42709. else return !!(ifExpandAll || oldValue?.expanded);
  42710. else {
  42711. const included = ifExpandAll || expandRowKeys.value && expandRowKeys.value.includes(key);
  42712. return !!(oldValue?.expanded || included);
  42713. }
  42714. };
  42715. keys.forEach((key) => {
  42716. const oldValue = oldTreeData[key];
  42717. const newValue = { ...nested[key] };
  42718. newValue.expanded = getExpanded(oldValue, key);
  42719. if (newValue.lazy) {
  42720. const { loaded = false, loading = false } = oldValue || {};
  42721. newValue.loaded = !!loaded;
  42722. newValue.loading = !!loading;
  42723. rootLazyRowKeys.push(key);
  42724. }
  42725. newTreeData[key] = newValue;
  42726. });
  42727. const lazyKeys = Object.keys(normalizedLazyNode_);
  42728. if (lazy.value && lazyKeys.length && rootLazyRowKeys.length) lazyKeys.forEach((key) => {
  42729. const oldValue = oldTreeData[key];
  42730. const lazyNodeChildren = normalizedLazyNode_[key].children;
  42731. if (rootLazyRowKeys.includes(key)) {
  42732. if (newTreeData[key].children?.length !== 0) throw new Error("[ElTable]children must be an empty array.");
  42733. newTreeData[key].children = lazyNodeChildren;
  42734. } else {
  42735. const { loaded = false, loading = false } = oldValue || {};
  42736. newTreeData[key] = {
  42737. lazy: true,
  42738. loaded: !!loaded,
  42739. loading: !!loading,
  42740. expanded: getExpanded(oldValue, key),
  42741. children: lazyNodeChildren,
  42742. level: void 0
  42743. };
  42744. }
  42745. });
  42746. }
  42747. treeData.value = newTreeData;
  42748. instance.store?.updateTableScrollY();
  42749. };
  42750. (0, vue.watch)(() => expandRowKeys.value, () => {
  42751. updateTreeData(true);
  42752. });
  42753. (0, vue.watch)(() => normalizedData.value, () => {
  42754. updateTreeData();
  42755. });
  42756. (0, vue.watch)(() => normalizedLazyNode.value, () => {
  42757. updateTreeData();
  42758. });
  42759. const updateTreeExpandKeys = (value) => {
  42760. expandRowKeys.value = value;
  42761. updateTreeData();
  42762. };
  42763. const isUseLazy = (data) => {
  42764. return lazy.value && data && "loaded" in data && !data.loaded;
  42765. };
  42766. const toggleTreeExpansion = (row, expanded) => {
  42767. instance.store.assertRowKey();
  42768. const rowKey = watcherData.rowKey.value;
  42769. const id = getRowIdentity(row, rowKey);
  42770. const data = id && treeData.value[id];
  42771. if (id && data && "expanded" in data) {
  42772. const oldExpanded = data.expanded;
  42773. expanded = isUndefined(expanded) ? !data.expanded : expanded;
  42774. treeData.value[id].expanded = expanded;
  42775. if (oldExpanded !== expanded) instance.emit("expand-change", row, expanded);
  42776. expanded && isUseLazy(data) && loadData(row, id, data);
  42777. instance.store.updateTableScrollY();
  42778. }
  42779. };
  42780. const loadOrToggle = (row) => {
  42781. instance.store.assertRowKey();
  42782. const rowKey = watcherData.rowKey.value;
  42783. const id = getRowIdentity(row, rowKey);
  42784. const data = treeData.value[id];
  42785. if (isUseLazy(data)) loadData(row, id, data);
  42786. else toggleTreeExpansion(row, void 0);
  42787. };
  42788. const loadData = (row, key, treeNode) => {
  42789. const { load } = instance.props;
  42790. if (load && !treeData.value[key].loaded) {
  42791. treeData.value[key].loading = true;
  42792. load(row, treeNode, (data) => {
  42793. if (!isArray$1(data)) throw new TypeError("[ElTable] data must be an array");
  42794. treeData.value[key].loading = false;
  42795. treeData.value[key].loaded = true;
  42796. treeData.value[key].expanded = true;
  42797. if (data.length) lazyTreeNodeMap.value[key] = data;
  42798. instance.emit("expand-change", row, true);
  42799. });
  42800. }
  42801. };
  42802. const updateKeyChildren = (key, data) => {
  42803. const { lazy, rowKey } = instance.props;
  42804. if (!lazy) return;
  42805. if (!rowKey) throw new Error("[Table] rowKey is required in updateKeyChild");
  42806. if (lazyTreeNodeMap.value[key]) lazyTreeNodeMap.value[key] = data;
  42807. };
  42808. return {
  42809. loadData,
  42810. loadOrToggle,
  42811. toggleTreeExpansion,
  42812. updateTreeExpandKeys,
  42813. updateTreeData,
  42814. updateKeyChildren,
  42815. normalize,
  42816. states: {
  42817. expandRowKeys,
  42818. treeData,
  42819. indent,
  42820. lazy,
  42821. lazyTreeNodeMap,
  42822. lazyColumnIdentifier,
  42823. childrenColumnName,
  42824. checkStrictly
  42825. }
  42826. };
  42827. }
  42828. //#endregion
  42829. //#region ../../packages/components/table/src/store/watcher.ts
  42830. const sortData = (data, states) => {
  42831. const sortingColumn = states.sortingColumn;
  42832. if (!sortingColumn || isString(sortingColumn.sortable)) return data;
  42833. return orderBy(data, states.sortProp, states.sortOrder, sortingColumn.sortMethod, sortingColumn.sortBy);
  42834. };
  42835. const doFlattenColumns = (columns) => {
  42836. const result = [];
  42837. columns.forEach((column) => {
  42838. if (column.children && column.children.length > 0) result.push.apply(result, doFlattenColumns(column.children));
  42839. else result.push(column);
  42840. });
  42841. return result;
  42842. };
  42843. function useWatcher$1() {
  42844. const instance = (0, vue.getCurrentInstance)();
  42845. const { size: tableSize } = (0, vue.toRefs)(instance.proxy?.$props);
  42846. const rowKey = (0, vue.ref)(null);
  42847. const data = (0, vue.ref)([]);
  42848. const _data = (0, vue.ref)([]);
  42849. const isComplex = (0, vue.ref)(false);
  42850. const _columns = (0, vue.ref)([]);
  42851. const originColumns = (0, vue.ref)([]);
  42852. const columns = (0, vue.ref)([]);
  42853. const fixedColumns = (0, vue.ref)([]);
  42854. const rightFixedColumns = (0, vue.ref)([]);
  42855. const leafColumns = (0, vue.ref)([]);
  42856. const fixedLeafColumns = (0, vue.ref)([]);
  42857. const rightFixedLeafColumns = (0, vue.ref)([]);
  42858. const updateOrderFns = [];
  42859. const leafColumnsLength = (0, vue.ref)(0);
  42860. const fixedLeafColumnsLength = (0, vue.ref)(0);
  42861. const rightFixedLeafColumnsLength = (0, vue.ref)(0);
  42862. const isAllSelected = (0, vue.ref)(false);
  42863. const selection = (0, vue.ref)([]);
  42864. const reserveSelection = (0, vue.ref)(false);
  42865. const selectOnIndeterminate = (0, vue.ref)(false);
  42866. const selectable = (0, vue.ref)(null);
  42867. const rowExpandable = (0, vue.ref)(null);
  42868. const filters = (0, vue.ref)({});
  42869. const filteredData = (0, vue.ref)(null);
  42870. const sortingColumn = (0, vue.ref)(null);
  42871. const sortProp = (0, vue.ref)(null);
  42872. const sortOrder = (0, vue.ref)(null);
  42873. const hoverRow = (0, vue.ref)(null);
  42874. const selectedMap = (0, vue.computed)(() => {
  42875. return rowKey.value ? getKeysMap(selection.value, rowKey.value) : void 0;
  42876. });
  42877. (0, vue.watch)(data, () => {
  42878. if (instance.state) {
  42879. scheduleLayout(false);
  42880. if (instance.props.tableLayout === "auto") instance.refs.tableHeaderRef?.updateFixedColumnStyle();
  42881. }
  42882. }, { deep: true });
  42883. const assertRowKey = () => {
  42884. if (!rowKey.value) throw new Error("[ElTable] prop row-key is required");
  42885. };
  42886. const updateChildFixed = (column) => {
  42887. column.children?.forEach((childColumn) => {
  42888. childColumn.fixed = column.fixed;
  42889. updateChildFixed(childColumn);
  42890. });
  42891. };
  42892. const updateColumns = () => {
  42893. _columns.value.forEach((column) => {
  42894. updateChildFixed(column);
  42895. });
  42896. fixedColumns.value = _columns.value.filter((column) => [true, "left"].includes(column.fixed));
  42897. const selectColumn = _columns.value.find((column) => column.type === "selection");
  42898. let selectColFixLeft;
  42899. if (selectColumn && selectColumn.fixed !== "right" && !fixedColumns.value.includes(selectColumn)) {
  42900. if (_columns.value.indexOf(selectColumn) === 0 && fixedColumns.value.length) {
  42901. fixedColumns.value.unshift(selectColumn);
  42902. selectColFixLeft = true;
  42903. }
  42904. }
  42905. rightFixedColumns.value = _columns.value.filter((column) => column.fixed === "right");
  42906. const notFixedColumns = _columns.value.filter((column) => (selectColFixLeft ? column.type !== "selection" : true) && !column.fixed);
  42907. originColumns.value = Array.from(fixedColumns.value).concat(notFixedColumns).concat(rightFixedColumns.value);
  42908. const leafColumns = doFlattenColumns(notFixedColumns);
  42909. const fixedLeafColumns = doFlattenColumns(fixedColumns.value);
  42910. const rightFixedLeafColumns = doFlattenColumns(rightFixedColumns.value);
  42911. leafColumnsLength.value = leafColumns.length;
  42912. fixedLeafColumnsLength.value = fixedLeafColumns.length;
  42913. rightFixedLeafColumnsLength.value = rightFixedLeafColumns.length;
  42914. columns.value = Array.from(fixedLeafColumns).concat(leafColumns).concat(rightFixedLeafColumns);
  42915. isComplex.value = fixedColumns.value.length > 0 || rightFixedColumns.value.length > 0;
  42916. };
  42917. const scheduleLayout = (needUpdateColumns, immediate = false) => {
  42918. if (needUpdateColumns) updateColumns();
  42919. if (immediate) instance.state.doLayout();
  42920. else instance.state.debouncedUpdateLayout();
  42921. };
  42922. const isSelected = (row) => {
  42923. if (selectedMap.value) return !!selectedMap.value[getRowIdentity(row, rowKey.value)];
  42924. else return selection.value.includes(row);
  42925. };
  42926. const clearSelection = () => {
  42927. isAllSelected.value = false;
  42928. const oldSelection = selection.value;
  42929. selection.value = [];
  42930. if (oldSelection.length) instance.emit("selection-change", []);
  42931. };
  42932. const cleanSelection = () => {
  42933. let deleted;
  42934. if (rowKey.value) {
  42935. deleted = [];
  42936. const childrenKey = instance?.store?.states?.childrenColumnName.value;
  42937. const dataMap = getKeysMap(data.value, rowKey.value, true, childrenKey);
  42938. for (const key in selectedMap.value) if (hasOwn(selectedMap.value, key) && !dataMap[key]) deleted.push(selectedMap.value[key].row);
  42939. } else deleted = selection.value.filter((item) => !data.value.includes(item));
  42940. if (deleted.length) {
  42941. const newSelection = selection.value.filter((item) => !deleted.includes(item));
  42942. selection.value = newSelection;
  42943. instance.emit("selection-change", newSelection.slice());
  42944. }
  42945. };
  42946. const getSelectionRows = () => {
  42947. return (selection.value || []).slice();
  42948. };
  42949. const toggleRowSelection = (row, selected, emitChange = true, ignoreSelectable = false) => {
  42950. const treeProps = {
  42951. children: instance?.store?.states?.childrenColumnName.value,
  42952. checkStrictly: instance?.store?.states?.checkStrictly.value
  42953. };
  42954. if (toggleRowStatus(selection.value, row, selected, treeProps, ignoreSelectable ? void 0 : selectable.value, data.value.indexOf(row), rowKey.value)) {
  42955. const newSelection = (selection.value || []).slice();
  42956. if (emitChange) instance.emit("select", newSelection, row);
  42957. instance.emit("selection-change", newSelection);
  42958. }
  42959. };
  42960. const _toggleAllSelection = () => {
  42961. const value = selectOnIndeterminate.value ? !isAllSelected.value : !(isAllSelected.value || selection.value.length);
  42962. isAllSelected.value = value;
  42963. let selectionChanged = false;
  42964. let childrenCount = 0;
  42965. const rowKey = instance?.store?.states?.rowKey.value;
  42966. const { childrenColumnName } = instance.store.states;
  42967. const treeProps = {
  42968. children: childrenColumnName.value,
  42969. checkStrictly: false
  42970. };
  42971. data.value.forEach((row, index) => {
  42972. const rowIndex = index + childrenCount;
  42973. if (toggleRowStatus(selection.value, row, value, treeProps, selectable.value, rowIndex, rowKey)) selectionChanged = true;
  42974. childrenCount += getChildrenCount(getRowIdentity(row, rowKey));
  42975. });
  42976. if (selectionChanged) instance.emit("selection-change", selection.value ? selection.value.slice() : []);
  42977. instance.emit("select-all", (selection.value || []).slice());
  42978. };
  42979. const updateAllSelected = () => {
  42980. if (data.value?.length === 0) {
  42981. isAllSelected.value = false;
  42982. return;
  42983. }
  42984. const { childrenColumnName } = instance.store.states;
  42985. let rowIndex = 0;
  42986. let selectedCount = 0;
  42987. const checkSelectedStatus = (data) => {
  42988. for (const row of data) {
  42989. const isRowSelectable = selectable.value && selectable.value.call(null, row, rowIndex);
  42990. if (!isSelected(row)) {
  42991. if (!selectable.value || isRowSelectable) return false;
  42992. } else selectedCount++;
  42993. rowIndex++;
  42994. if (row[childrenColumnName.value]?.length && !checkSelectedStatus(row[childrenColumnName.value])) return false;
  42995. }
  42996. return true;
  42997. };
  42998. const isAllSelected_ = checkSelectedStatus(data.value || []);
  42999. isAllSelected.value = selectedCount === 0 ? false : isAllSelected_;
  43000. };
  43001. const getChildrenCount = (rowKey) => {
  43002. if (!instance || !instance.store) return 0;
  43003. const { treeData } = instance.store.states;
  43004. let count = 0;
  43005. const children = treeData.value[rowKey]?.children;
  43006. if (children) {
  43007. count += children.length;
  43008. children.forEach((childKey) => {
  43009. count += getChildrenCount(childKey);
  43010. });
  43011. }
  43012. return count;
  43013. };
  43014. const updateFilters = (column, values) => {
  43015. const filters_ = {};
  43016. castArray$1(column).forEach((col) => {
  43017. filters.value[col.id] = values;
  43018. filters_[col.columnKey || col.id] = values;
  43019. });
  43020. return filters_;
  43021. };
  43022. const updateSort = (column, prop, order) => {
  43023. if (sortingColumn.value && sortingColumn.value !== column) sortingColumn.value.order = null;
  43024. sortingColumn.value = column;
  43025. sortProp.value = prop;
  43026. sortOrder.value = order;
  43027. };
  43028. const execFilter = () => {
  43029. let sourceData = (0, vue.unref)(_data);
  43030. Object.keys(filters.value).forEach((columnId) => {
  43031. const values = filters.value[columnId];
  43032. if (!values || values.length === 0) return;
  43033. const column = getColumnById({ columns: columns.value }, columnId);
  43034. if (column && column.filterMethod) sourceData = sourceData.filter((row) => {
  43035. return values.some((value) => column.filterMethod.call(null, value, row, column));
  43036. });
  43037. });
  43038. filteredData.value = sourceData;
  43039. };
  43040. const execSort = () => {
  43041. data.value = sortData(filteredData.value ?? [], {
  43042. sortingColumn: sortingColumn.value,
  43043. sortProp: sortProp.value,
  43044. sortOrder: sortOrder.value
  43045. });
  43046. };
  43047. const execQuery = (ignore = void 0) => {
  43048. if (!ignore?.filter) execFilter();
  43049. execSort();
  43050. };
  43051. const clearFilter = (columnKeys) => {
  43052. const { tableHeaderRef } = instance.refs;
  43053. if (!tableHeaderRef) return;
  43054. const panels = Object.assign({}, tableHeaderRef.filterPanels);
  43055. const keys = Object.keys(panels);
  43056. if (!keys.length) return;
  43057. if (isString(columnKeys)) columnKeys = [columnKeys];
  43058. if (isArray$1(columnKeys)) {
  43059. const columns_ = columnKeys.map((key) => getColumnByKey({ columns: columns.value }, key));
  43060. keys.forEach((key) => {
  43061. const column = columns_.find((col) => col.id === key);
  43062. if (column) column.filteredValue = [];
  43063. });
  43064. instance.store.commit("filterChange", {
  43065. column: columns_,
  43066. values: [],
  43067. silent: true,
  43068. multi: true
  43069. });
  43070. } else {
  43071. keys.forEach((key) => {
  43072. const column = columns.value.find((col) => col.id === key);
  43073. if (column) column.filteredValue = [];
  43074. });
  43075. filters.value = {};
  43076. instance.store.commit("filterChange", {
  43077. column: {},
  43078. values: [],
  43079. silent: true
  43080. });
  43081. }
  43082. };
  43083. const clearSort = () => {
  43084. if (!sortingColumn.value) return;
  43085. updateSort(null, null, null);
  43086. instance.store.commit("changeSortCondition", { silent: true });
  43087. };
  43088. const { setExpandRowKeys, toggleRowExpansion, updateExpandRows, states: expandStates, isRowExpanded } = useExpand({
  43089. data,
  43090. rowKey
  43091. });
  43092. const { updateTreeExpandKeys, toggleTreeExpansion, updateTreeData, updateKeyChildren, loadOrToggle, states: treeStates } = useTree$2({
  43093. data,
  43094. rowKey
  43095. });
  43096. const { updateCurrentRowData, updateCurrentRow, setCurrentRowKey, states: currentData } = useCurrent({
  43097. data,
  43098. rowKey
  43099. });
  43100. const setExpandRowKeysAdapter = (val) => {
  43101. setExpandRowKeys(val);
  43102. updateTreeExpandKeys(val);
  43103. };
  43104. const toggleRowExpansionAdapter = (row, expanded) => {
  43105. if (columns.value.some(({ type }) => type === "expand")) toggleRowExpansion(row, expanded);
  43106. else toggleTreeExpansion(row, expanded);
  43107. };
  43108. return {
  43109. assertRowKey,
  43110. updateColumns,
  43111. scheduleLayout,
  43112. isSelected,
  43113. clearSelection,
  43114. cleanSelection,
  43115. getSelectionRows,
  43116. toggleRowSelection,
  43117. _toggleAllSelection,
  43118. toggleAllSelection: null,
  43119. updateAllSelected,
  43120. updateFilters,
  43121. updateCurrentRow,
  43122. updateSort,
  43123. execFilter,
  43124. execSort,
  43125. execQuery,
  43126. clearFilter,
  43127. clearSort,
  43128. toggleRowExpansion,
  43129. setExpandRowKeysAdapter,
  43130. setCurrentRowKey,
  43131. toggleRowExpansionAdapter,
  43132. isRowExpanded,
  43133. updateExpandRows,
  43134. updateCurrentRowData,
  43135. loadOrToggle,
  43136. updateTreeData,
  43137. updateKeyChildren,
  43138. states: {
  43139. tableSize,
  43140. rowKey,
  43141. data,
  43142. _data,
  43143. isComplex,
  43144. _columns,
  43145. originColumns,
  43146. columns,
  43147. fixedColumns,
  43148. rightFixedColumns,
  43149. leafColumns,
  43150. fixedLeafColumns,
  43151. rightFixedLeafColumns,
  43152. updateOrderFns,
  43153. leafColumnsLength,
  43154. fixedLeafColumnsLength,
  43155. rightFixedLeafColumnsLength,
  43156. isAllSelected,
  43157. selection,
  43158. reserveSelection,
  43159. selectOnIndeterminate,
  43160. selectable,
  43161. rowExpandable,
  43162. filters,
  43163. filteredData,
  43164. sortingColumn,
  43165. sortProp,
  43166. sortOrder,
  43167. hoverRow,
  43168. ...expandStates,
  43169. ...treeStates,
  43170. ...currentData
  43171. }
  43172. };
  43173. }
  43174. //#endregion
  43175. //#region ../../packages/components/table/src/store/index.ts
  43176. function replaceColumn(array, column) {
  43177. return array.map((item) => {
  43178. if (item.id === column.id) return column;
  43179. else if (item.children?.length) item.children = replaceColumn(item.children, column);
  43180. return item;
  43181. });
  43182. }
  43183. function sortColumn(array) {
  43184. array.forEach((item) => {
  43185. item.no = item.getColumnIndex?.();
  43186. if (item.children?.length) sortColumn(item.children);
  43187. });
  43188. array.sort((cur, pre) => cur.no - pre.no);
  43189. }
  43190. function useStore() {
  43191. const instance = (0, vue.getCurrentInstance)();
  43192. const watcher = useWatcher$1();
  43193. const ns = useNamespace("table");
  43194. const { t } = useLocale();
  43195. const mutations = {
  43196. setData(states, data) {
  43197. const dataInstanceChanged = (0, vue.unref)(states._data) !== data;
  43198. states.data.value = data;
  43199. states._data.value = data;
  43200. instance.store.execQuery();
  43201. instance.store.updateCurrentRowData();
  43202. instance.store.updateExpandRows();
  43203. instance.store.updateTreeData(instance.store.states.defaultExpandAll.value);
  43204. if ((0, vue.unref)(states.reserveSelection)) instance.store.assertRowKey();
  43205. else if (dataInstanceChanged) instance.store.clearSelection();
  43206. else instance.store.cleanSelection();
  43207. instance.store.updateAllSelected();
  43208. if (instance.$ready) instance.store.scheduleLayout();
  43209. },
  43210. insertColumn(states, column, parent, updateColumnOrder) {
  43211. const array = (0, vue.unref)(states._columns);
  43212. let newColumns = [];
  43213. if (!parent) {
  43214. array.push(column);
  43215. newColumns = array;
  43216. } else {
  43217. if (parent && !parent.children) parent.children = [];
  43218. parent.children?.push(column);
  43219. newColumns = replaceColumn(array, parent);
  43220. }
  43221. sortColumn(newColumns);
  43222. states._columns.value = newColumns;
  43223. states.updateOrderFns.push(updateColumnOrder);
  43224. if (column.type === "selection") {
  43225. states.selectable.value = column.selectable;
  43226. states.reserveSelection.value = column.reserveSelection;
  43227. }
  43228. if (instance.$ready) {
  43229. instance.store.updateColumns();
  43230. instance.store.scheduleLayout();
  43231. }
  43232. },
  43233. updateColumnOrder(states, column) {
  43234. if (column.getColumnIndex?.() === column.no) return;
  43235. sortColumn(states._columns.value);
  43236. if (instance.$ready) instance.store.updateColumns();
  43237. },
  43238. removeColumn(states, column, parent, updateColumnOrder) {
  43239. const array = (0, vue.unref)(states._columns) || [];
  43240. if (parent) {
  43241. parent.children?.splice(parent.children.findIndex((item) => item.id === column.id), 1);
  43242. (0, vue.nextTick)(() => {
  43243. if (parent.children?.length === 0) delete parent.children;
  43244. });
  43245. states._columns.value = replaceColumn(array, parent);
  43246. } else {
  43247. const index = array.indexOf(column);
  43248. if (index > -1) {
  43249. array.splice(index, 1);
  43250. states._columns.value = array;
  43251. }
  43252. }
  43253. const updateFnIndex = states.updateOrderFns.indexOf(updateColumnOrder);
  43254. updateFnIndex > -1 && states.updateOrderFns.splice(updateFnIndex, 1);
  43255. if (instance.$ready) {
  43256. instance.store.updateColumns();
  43257. instance.store.scheduleLayout();
  43258. }
  43259. },
  43260. sort(states, options) {
  43261. const { prop, order, init } = options;
  43262. if (prop) {
  43263. const column = (0, vue.unref)(states.columns).find((column) => column.property === prop);
  43264. if (column) {
  43265. column.order = order;
  43266. instance.store.updateSort(column, prop, order);
  43267. instance.store.commit("changeSortCondition", { init });
  43268. }
  43269. }
  43270. },
  43271. changeSortCondition(states, options) {
  43272. const { sortingColumn, sortProp, sortOrder } = states;
  43273. const columnValue = (0, vue.unref)(sortingColumn), propValue = (0, vue.unref)(sortProp), orderValue = (0, vue.unref)(sortOrder);
  43274. if (isNull(orderValue)) {
  43275. states.sortingColumn.value = null;
  43276. states.sortProp.value = null;
  43277. }
  43278. instance.store.execQuery({ filter: true });
  43279. if (!options || !(options.silent || options.init)) instance.emit("sort-change", {
  43280. column: columnValue,
  43281. prop: propValue,
  43282. order: orderValue
  43283. });
  43284. instance.store.updateTableScrollY();
  43285. },
  43286. filterChange(_states, options) {
  43287. const { column, values, silent } = options;
  43288. const newFilters = instance.store.updateFilters(column, values);
  43289. instance.store.execQuery();
  43290. if (!silent) instance.emit("filter-change", newFilters);
  43291. instance.store.updateTableScrollY();
  43292. },
  43293. toggleAllSelection() {
  43294. instance.store.toggleAllSelection?.();
  43295. },
  43296. rowSelectedChanged(_states, row) {
  43297. instance.store.toggleRowSelection(row);
  43298. instance.store.updateAllSelected();
  43299. },
  43300. setHoverRow(states, row) {
  43301. states.hoverRow.value = row;
  43302. },
  43303. setCurrentRow(_states, row) {
  43304. instance.store.updateCurrentRow(row);
  43305. }
  43306. };
  43307. const commit = function(name, ...args) {
  43308. const mutations = instance.store.mutations;
  43309. if (mutations[name]) mutations[name].apply(instance, [instance.store.states, ...args]);
  43310. else throw new Error(`Action not found: ${name}`);
  43311. };
  43312. const updateTableScrollY = function() {
  43313. (0, vue.nextTick)(() => instance.layout.updateScrollY.apply(instance.layout));
  43314. };
  43315. return {
  43316. ns,
  43317. t,
  43318. ...watcher,
  43319. mutations,
  43320. commit,
  43321. updateTableScrollY
  43322. };
  43323. }
  43324. //#endregion
  43325. //#region ../../packages/components/table/src/store/helper.ts
  43326. const InitialStateMap = {
  43327. rowKey: "rowKey",
  43328. defaultExpandAll: "defaultExpandAll",
  43329. rowExpandable: "rowExpandable",
  43330. selectOnIndeterminate: "selectOnIndeterminate",
  43331. indent: "indent",
  43332. lazy: "lazy",
  43333. ["treeProps.hasChildren"]: {
  43334. key: "lazyColumnIdentifier",
  43335. default: "hasChildren"
  43336. },
  43337. ["treeProps.children"]: {
  43338. key: "childrenColumnName",
  43339. default: "children"
  43340. },
  43341. ["treeProps.checkStrictly"]: {
  43342. key: "checkStrictly",
  43343. default: false
  43344. }
  43345. };
  43346. function createStore(table, props) {
  43347. if (!table) throw new Error("Table is required.");
  43348. const store = useStore();
  43349. store.toggleAllSelection = debounce(store._toggleAllSelection, 10);
  43350. Object.keys(InitialStateMap).forEach((key) => {
  43351. handleValue(getArrKeysValue(props, key), key, store);
  43352. });
  43353. proxyTableProps(store, props);
  43354. return store;
  43355. }
  43356. function proxyTableProps(store, props) {
  43357. Object.keys(InitialStateMap).forEach((key) => {
  43358. (0, vue.watch)(() => getArrKeysValue(props, key), (value) => {
  43359. handleValue(value, key, store);
  43360. });
  43361. });
  43362. }
  43363. function handleValue(value, propsKey, store) {
  43364. let newVal = value;
  43365. let storeKey = InitialStateMap[propsKey];
  43366. if (isObject$1(storeKey)) {
  43367. newVal = newVal || storeKey.default;
  43368. storeKey = storeKey.key;
  43369. }
  43370. store.states[storeKey].value = newVal;
  43371. }
  43372. function getArrKeysValue(props, key) {
  43373. if (key.includes(".")) {
  43374. const keyList = key.split(".");
  43375. let value = props;
  43376. keyList.forEach((k) => {
  43377. value = value[k];
  43378. });
  43379. return value;
  43380. } else return props[key];
  43381. }
  43382. //#endregion
  43383. //#region ../../packages/components/table/src/table-layout.ts
  43384. var TableLayout = class {
  43385. constructor(options) {
  43386. this.observers = [];
  43387. this.table = null;
  43388. this.store = null;
  43389. this.columns = [];
  43390. this.fit = true;
  43391. this.showHeader = true;
  43392. this.height = (0, vue.ref)(null);
  43393. this.scrollX = (0, vue.ref)(false);
  43394. this.scrollY = (0, vue.ref)(false);
  43395. this.bodyWidth = (0, vue.ref)(null);
  43396. this.fixedWidth = (0, vue.ref)(null);
  43397. this.rightFixedWidth = (0, vue.ref)(null);
  43398. this.gutterWidth = 0;
  43399. for (const name in options) if (hasOwn(options, name)) if ((0, vue.isRef)(this[name])) this[name].value = options[name];
  43400. else this[name] = options[name];
  43401. if (!this.table) throw new Error("Table is required for Table Layout");
  43402. if (!this.store) throw new Error("Store is required for Table Layout");
  43403. }
  43404. updateScrollY() {
  43405. const height = this.height.value;
  43406. /**
  43407. * When the height is not initialized, it is null.
  43408. * After the table is initialized, when the height is not configured, the height is 0.
  43409. */
  43410. if (isNull(height)) return false;
  43411. const scrollBarRef = this.table.refs.scrollBarRef;
  43412. if (this.table.vnode.el && scrollBarRef?.wrapRef) {
  43413. let scrollY = true;
  43414. const prevScrollY = this.scrollY.value;
  43415. scrollY = scrollBarRef.wrapRef.scrollHeight > scrollBarRef.wrapRef.clientHeight;
  43416. this.scrollY.value = scrollY;
  43417. return prevScrollY !== scrollY;
  43418. }
  43419. return false;
  43420. }
  43421. setHeight(value, prop = "height") {
  43422. if (!isClient) return;
  43423. const el = this.table.vnode.el;
  43424. value = parseHeight(value);
  43425. this.height.value = Number(value);
  43426. if (!el && (value || value === 0)) {
  43427. (0, vue.nextTick)(() => this.setHeight(value, prop));
  43428. return;
  43429. }
  43430. if (el && isNumber(value)) {
  43431. el.style[prop] = `${value}px`;
  43432. this.updateElsHeight();
  43433. } else if (el && isString(value)) {
  43434. el.style[prop] = value;
  43435. this.updateElsHeight();
  43436. }
  43437. }
  43438. setMaxHeight(value) {
  43439. this.setHeight(value, "max-height");
  43440. }
  43441. getFlattenColumns() {
  43442. const flattenColumns = [];
  43443. this.table.store.states.columns.value.forEach((column) => {
  43444. if (column.isColumnGroup) flattenColumns.push.apply(flattenColumns, column.columns);
  43445. else flattenColumns.push(column);
  43446. });
  43447. return flattenColumns;
  43448. }
  43449. updateElsHeight() {
  43450. this.updateScrollY();
  43451. this.notifyObservers("scrollable");
  43452. }
  43453. headerDisplayNone(elm) {
  43454. if (!elm) return true;
  43455. let headerChild = elm;
  43456. while (headerChild.tagName !== "DIV") {
  43457. if (getComputedStyle(headerChild).display === "none") return true;
  43458. headerChild = headerChild.parentElement;
  43459. }
  43460. return false;
  43461. }
  43462. updateColumnsWidth() {
  43463. if (!isClient) return;
  43464. const fit = this.fit;
  43465. const bodyWidth = this.table.vnode.el?.clientWidth;
  43466. let bodyMinWidth = 0;
  43467. const flattenColumns = this.getFlattenColumns();
  43468. const flexColumns = flattenColumns.filter((column) => !isNumber(column.width));
  43469. flattenColumns.forEach((column) => {
  43470. if (isNumber(column.width) && column.realWidth) column.realWidth = null;
  43471. });
  43472. if (flexColumns.length > 0 && fit) {
  43473. flattenColumns.forEach((column) => {
  43474. bodyMinWidth += Number(column.width || column.minWidth || 80);
  43475. });
  43476. if (bodyMinWidth <= bodyWidth) {
  43477. this.scrollX.value = false;
  43478. const totalFlexWidth = bodyWidth - bodyMinWidth;
  43479. if (flexColumns.length === 1) flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth;
  43480. else {
  43481. const flexWidthPerPixel = totalFlexWidth / flexColumns.reduce((prev, column) => prev + Number(column.minWidth || 80), 0);
  43482. let noneFirstWidth = 0;
  43483. flexColumns.forEach((column, index) => {
  43484. if (index === 0) return;
  43485. const flexWidth = Math.floor(Number(column.minWidth || 80) * flexWidthPerPixel);
  43486. noneFirstWidth += flexWidth;
  43487. column.realWidth = Number(column.minWidth || 80) + flexWidth;
  43488. });
  43489. flexColumns[0].realWidth = Number(flexColumns[0].minWidth || 80) + totalFlexWidth - noneFirstWidth;
  43490. }
  43491. } else {
  43492. this.scrollX.value = true;
  43493. flexColumns.forEach((column) => {
  43494. column.realWidth = Number(column.minWidth);
  43495. });
  43496. }
  43497. this.bodyWidth.value = Math.max(bodyMinWidth, bodyWidth);
  43498. this.table.state.resizeState.value.width = this.bodyWidth.value;
  43499. } else {
  43500. flattenColumns.forEach((column) => {
  43501. if (!column.width && !column.minWidth) column.realWidth = 80;
  43502. else column.realWidth = Number(column.width || column.minWidth);
  43503. bodyMinWidth += column.realWidth;
  43504. });
  43505. this.scrollX.value = bodyMinWidth > bodyWidth;
  43506. this.bodyWidth.value = bodyMinWidth;
  43507. }
  43508. const fixedColumns = this.store.states.fixedColumns.value;
  43509. if (fixedColumns.length > 0) {
  43510. let fixedWidth = 0;
  43511. fixedColumns.forEach((column) => {
  43512. fixedWidth += Number(column.realWidth || column.width);
  43513. });
  43514. this.fixedWidth.value = fixedWidth;
  43515. }
  43516. const rightFixedColumns = this.store.states.rightFixedColumns.value;
  43517. if (rightFixedColumns.length > 0) {
  43518. let rightFixedWidth = 0;
  43519. rightFixedColumns.forEach((column) => {
  43520. rightFixedWidth += Number(column.realWidth || column.width);
  43521. });
  43522. this.rightFixedWidth.value = rightFixedWidth;
  43523. }
  43524. this.notifyObservers("columns");
  43525. }
  43526. addObserver(observer) {
  43527. this.observers.push(observer);
  43528. }
  43529. removeObserver(observer) {
  43530. const index = this.observers.indexOf(observer);
  43531. if (index !== -1) this.observers.splice(index, 1);
  43532. }
  43533. notifyObservers(event) {
  43534. this.observers.forEach((observer) => {
  43535. switch (event) {
  43536. case "columns":
  43537. observer.state?.onColumnsChange(this);
  43538. break;
  43539. case "scrollable":
  43540. observer.state?.onScrollableChange(this);
  43541. break;
  43542. default: throw new Error(`Table Layout don't have event ${event}.`);
  43543. }
  43544. });
  43545. }
  43546. };
  43547. //#endregion
  43548. //#region ../../packages/components/table/src/filter-panel.vue?vue&type=script&lang.ts
  43549. var filter_panel_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  43550. name: "ElTableFilterPanel",
  43551. components: {
  43552. ElCheckbox,
  43553. ElCheckboxGroup,
  43554. ElScrollbar,
  43555. ElTooltip,
  43556. ElIcon,
  43557. ArrowDown: arrow_down_default,
  43558. ArrowUp: arrow_up_default
  43559. },
  43560. props: {
  43561. placement: {
  43562. type: String,
  43563. default: "bottom-start"
  43564. },
  43565. store: { type: Object },
  43566. column: { type: Object },
  43567. upDataColumn: { type: Function },
  43568. appendTo: useTooltipContentProps.appendTo
  43569. },
  43570. setup(props) {
  43571. const instance = (0, vue.getCurrentInstance)();
  43572. const { t } = useLocale();
  43573. const ns = useNamespace("table-filter");
  43574. const parent = instance?.parent;
  43575. if (props.column && !parent.filterPanels.value[props.column.id]) parent.filterPanels.value[props.column.id] = instance;
  43576. const tooltipRef = (0, vue.ref)(null);
  43577. const rootRef = (0, vue.ref)(null);
  43578. const checkedIndex = (0, vue.ref)(0);
  43579. const filters = (0, vue.computed)(() => {
  43580. return props.column && props.column.filters;
  43581. });
  43582. const filterClassName = (0, vue.computed)(() => {
  43583. if (props.column && props.column.filterClassName) return `${ns.b()} ${props.column.filterClassName}`;
  43584. return ns.b();
  43585. });
  43586. const filterValue = (0, vue.computed)({
  43587. get: () => (props.column?.filteredValue || [])[0],
  43588. set: (value) => {
  43589. if (filteredValue.value) if (!isPropAbsent(value)) filteredValue.value.splice(0, 1, value);
  43590. else filteredValue.value.splice(0, 1);
  43591. }
  43592. });
  43593. const filteredValue = (0, vue.computed)({
  43594. get() {
  43595. if (props.column) return props.column.filteredValue || [];
  43596. return [];
  43597. },
  43598. set(value) {
  43599. if (props.column) props.upDataColumn?.("filteredValue", value);
  43600. }
  43601. });
  43602. const multiple = (0, vue.computed)(() => {
  43603. if (props.column) return props.column.filterMultiple;
  43604. return true;
  43605. });
  43606. const isActive = (filter) => {
  43607. return filter.value === filterValue.value;
  43608. };
  43609. const hidden = () => {
  43610. tooltipRef.value?.onClose();
  43611. };
  43612. const handleConfirm = () => {
  43613. confirmFilter(filteredValue.value);
  43614. hidden();
  43615. };
  43616. const handleReset = () => {
  43617. filteredValue.value = [];
  43618. confirmFilter(filteredValue.value);
  43619. hidden();
  43620. };
  43621. const handleSelect = (_filterValue, index) => {
  43622. filterValue.value = _filterValue;
  43623. checkedIndex.value = index;
  43624. if (!isPropAbsent(_filterValue)) confirmFilter(filteredValue.value);
  43625. else confirmFilter([]);
  43626. hidden();
  43627. };
  43628. const confirmFilter = (filteredValue) => {
  43629. props.store?.commit("filterChange", {
  43630. column: props.column,
  43631. values: filteredValue
  43632. });
  43633. props.store?.updateAllSelected();
  43634. };
  43635. const handleShowTooltip = () => {
  43636. rootRef.value?.focus();
  43637. !multiple.value && initCheckedIndex();
  43638. if (props.column) props.upDataColumn?.("filterOpened", true);
  43639. };
  43640. const handleHideTooltip = () => {
  43641. if (props.column) props.upDataColumn?.("filterOpened", false);
  43642. };
  43643. const initCheckedIndex = () => {
  43644. if (isPropAbsent(filterValue)) {
  43645. checkedIndex.value = 0;
  43646. return;
  43647. }
  43648. const idx = (filters.value || []).findIndex((item) => {
  43649. return item.value === filterValue.value;
  43650. });
  43651. checkedIndex.value = idx >= 0 ? idx + 1 : 0;
  43652. };
  43653. const handleKeydown = (event) => {
  43654. const code = getEventCode(event);
  43655. const len = (filters.value ? filters.value.length : 0) + 1;
  43656. let index = checkedIndex.value;
  43657. let isPreventDefault = true;
  43658. switch (code) {
  43659. case EVENT_CODE.down:
  43660. case EVENT_CODE.right:
  43661. index = (index + 1) % len;
  43662. break;
  43663. case EVENT_CODE.up:
  43664. case EVENT_CODE.left:
  43665. index = (index - 1 + len) % len;
  43666. break;
  43667. case EVENT_CODE.tab:
  43668. hidden();
  43669. isPreventDefault = false;
  43670. break;
  43671. case EVENT_CODE.enter:
  43672. case EVENT_CODE.space:
  43673. if (index === 0) handleSelect(null, 0);
  43674. else {
  43675. const item = (filters.value || [])[index - 1];
  43676. item.value && handleSelect(item.value, index);
  43677. }
  43678. break;
  43679. default:
  43680. isPreventDefault = false;
  43681. break;
  43682. }
  43683. isPreventDefault && event.preventDefault();
  43684. checkedIndex.value = index;
  43685. rootRef.value?.querySelector(`.${ns.e("list-item")}:nth-child(${index + 1})`)?.focus();
  43686. };
  43687. return {
  43688. multiple,
  43689. filterClassName,
  43690. filteredValue,
  43691. filterValue,
  43692. filters,
  43693. handleConfirm,
  43694. handleReset,
  43695. handleSelect,
  43696. isPropAbsent,
  43697. isActive,
  43698. t,
  43699. ns,
  43700. tooltipRef,
  43701. rootRef,
  43702. checkedIndex,
  43703. handleShowTooltip,
  43704. handleHideTooltip,
  43705. handleKeydown
  43706. };
  43707. }
  43708. });
  43709. //#endregion
  43710. //#region ../../packages/components/table/src/filter-panel.vue
  43711. const _hoisted_1$17 = ["disabled"];
  43712. const _hoisted_2$10 = ["tabindex", "aria-checked"];
  43713. const _hoisted_3$3 = [
  43714. "tabindex",
  43715. "aria-checked",
  43716. "onClick"
  43717. ];
  43718. const _hoisted_4$2 = ["aria-label"];
  43719. function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
  43720. const _component_el_checkbox = (0, vue.resolveComponent)("el-checkbox");
  43721. const _component_el_checkbox_group = (0, vue.resolveComponent)("el-checkbox-group");
  43722. const _component_el_scrollbar = (0, vue.resolveComponent)("el-scrollbar");
  43723. const _component_arrow_up = (0, vue.resolveComponent)("arrow-up");
  43724. const _component_arrow_down = (0, vue.resolveComponent)("arrow-down");
  43725. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  43726. const _component_el_tooltip = (0, vue.resolveComponent)("el-tooltip");
  43727. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tooltip, {
  43728. ref: "tooltipRef",
  43729. offset: 0,
  43730. placement: _ctx.placement,
  43731. "show-arrow": false,
  43732. trigger: "click",
  43733. role: "dialog",
  43734. teleported: "",
  43735. effect: "light",
  43736. pure: "",
  43737. loop: "",
  43738. "popper-class": _ctx.filterClassName,
  43739. persistent: "",
  43740. "append-to": _ctx.appendTo,
  43741. onShow: _ctx.handleShowTooltip,
  43742. onHide: _ctx.handleHideTooltip
  43743. }, {
  43744. content: (0, vue.withCtx)(() => [_ctx.multiple ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  43745. key: 0,
  43746. ref: "rootRef",
  43747. tabindex: "-1",
  43748. class: (0, vue.normalizeClass)(_ctx.ns.e("multiple"))
  43749. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("content")) }, [(0, vue.createVNode)(_component_el_scrollbar, { "wrap-class": _ctx.ns.e("wrap") }, {
  43750. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_el_checkbox_group, {
  43751. modelValue: _ctx.filteredValue,
  43752. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.filteredValue = $event),
  43753. class: (0, vue.normalizeClass)(_ctx.ns.e("checkbox-group"))
  43754. }, {
  43755. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.filters, (filter) => {
  43756. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_checkbox, {
  43757. key: filter.value,
  43758. value: filter.value
  43759. }, {
  43760. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(filter.text), 1)]),
  43761. _: 2
  43762. }, 1032, ["value"]);
  43763. }), 128))]),
  43764. _: 1
  43765. }, 8, ["modelValue", "class"])]),
  43766. _: 1
  43767. }, 8, ["wrap-class"])], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("bottom")) }, [(0, vue.createElementVNode)("button", {
  43768. class: (0, vue.normalizeClass)(_ctx.ns.is("disabled", _ctx.filteredValue.length === 0)),
  43769. disabled: _ctx.filteredValue.length === 0,
  43770. type: "button",
  43771. onClick: _cache[1] || (_cache[1] = (...args) => _ctx.handleConfirm && _ctx.handleConfirm(...args))
  43772. }, (0, vue.toDisplayString)(_ctx.t("el.table.confirmFilter")), 11, _hoisted_1$17), (0, vue.createElementVNode)("button", {
  43773. type: "button",
  43774. onClick: _cache[2] || (_cache[2] = (...args) => _ctx.handleReset && _ctx.handleReset(...args))
  43775. }, (0, vue.toDisplayString)(_ctx.t("el.table.resetFilter")), 1)], 2)], 2)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", {
  43776. key: 1,
  43777. ref: "rootRef",
  43778. tabindex: "-1",
  43779. role: "radiogroup",
  43780. class: (0, vue.normalizeClass)(_ctx.ns.e("list")),
  43781. onKeydown: _cache[4] || (_cache[4] = (...args) => _ctx.handleKeydown && _ctx.handleKeydown(...args))
  43782. }, [(0, vue.createElementVNode)("li", {
  43783. role: "radio",
  43784. class: (0, vue.normalizeClass)([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isPropAbsent(_ctx.filterValue))]),
  43785. tabindex: _ctx.checkedIndex === 0 ? 0 : -1,
  43786. "aria-checked": _ctx.isPropAbsent(_ctx.filterValue),
  43787. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleSelect(null, 0))
  43788. }, (0, vue.toDisplayString)(_ctx.t("el.table.clearFilter")), 11, _hoisted_2$10), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.filters, (filter, idx) => {
  43789. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  43790. key: filter.value,
  43791. role: "radio",
  43792. class: (0, vue.normalizeClass)([_ctx.ns.e("list-item"), _ctx.ns.is("active", _ctx.isActive(filter))]),
  43793. tabindex: _ctx.checkedIndex === idx + 1 ? 0 : -1,
  43794. "aria-checked": _ctx.isActive(filter),
  43795. onClick: ($event) => _ctx.handleSelect(filter.value, idx + 1)
  43796. }, (0, vue.toDisplayString)(filter.text), 11, _hoisted_3$3);
  43797. }), 128))], 34))]),
  43798. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("button", {
  43799. type: "button",
  43800. class: (0, vue.normalizeClass)(`${_ctx.ns.namespace.value}-table__column-filter-trigger`),
  43801. "aria-label": _ctx.t("el.table.filterLabel", { column: _ctx.column?.label || "" })
  43802. }, [(0, vue.createVNode)(_component_el_icon, null, {
  43803. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "filter-icon", {}, () => [_ctx.column?.filterOpened ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_arrow_up, { key: 0 })) : ((0, vue.openBlock)(), (0, vue.createBlock)(_component_arrow_down, { key: 1 }))])]),
  43804. _: 3
  43805. })], 10, _hoisted_4$2)]),
  43806. _: 3
  43807. }, 8, [
  43808. "placement",
  43809. "popper-class",
  43810. "append-to",
  43811. "onShow",
  43812. "onHide"
  43813. ]);
  43814. }
  43815. var filter_panel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(filter_panel_vue_vue_type_script_lang_default, [["render", _sfc_render$4]]);
  43816. //#endregion
  43817. //#region ../../packages/components/table/src/layout-observer.ts
  43818. function useLayoutObserver(root) {
  43819. const instance = (0, vue.getCurrentInstance)();
  43820. (0, vue.onBeforeMount)(() => {
  43821. tableLayout.value.addObserver(instance);
  43822. });
  43823. (0, vue.onMounted)(() => {
  43824. onColumnsChange(tableLayout.value);
  43825. onScrollableChange(tableLayout.value);
  43826. });
  43827. (0, vue.onUpdated)(() => {
  43828. onColumnsChange(tableLayout.value);
  43829. onScrollableChange(tableLayout.value);
  43830. });
  43831. (0, vue.onUnmounted)(() => {
  43832. tableLayout.value.removeObserver(instance);
  43833. });
  43834. const tableLayout = (0, vue.computed)(() => {
  43835. const layout = root.layout;
  43836. if (!layout) throw new Error("Can not find table layout.");
  43837. return layout;
  43838. });
  43839. const onColumnsChange = (layout) => {
  43840. const cols = root.vnode.el?.querySelectorAll("colgroup > col") || [];
  43841. if (!cols.length) return;
  43842. const flattenColumns = layout.getFlattenColumns();
  43843. const columnsMap = {};
  43844. flattenColumns.forEach((column) => {
  43845. columnsMap[column.id] = column;
  43846. });
  43847. for (let i = 0, j = cols.length; i < j; i++) {
  43848. const col = cols[i];
  43849. const column = columnsMap[col.getAttribute("name")];
  43850. if (column) col.setAttribute("width", column.realWidth || column.width);
  43851. }
  43852. };
  43853. const onScrollableChange = (layout) => {
  43854. const cols = root.vnode.el?.querySelectorAll("colgroup > col[name=gutter]") || [];
  43855. for (let i = 0, j = cols.length; i < j; i++) cols[i].setAttribute("width", layout.scrollY.value ? layout.gutterWidth : "0");
  43856. const ths = root.vnode.el?.querySelectorAll("th.gutter") || [];
  43857. for (let i = 0, j = ths.length; i < j; i++) {
  43858. const th = ths[i];
  43859. th.style.width = layout.scrollY.value ? `${layout.gutterWidth}px` : "0";
  43860. th.style.display = layout.scrollY.value ? "" : "none";
  43861. }
  43862. };
  43863. return {
  43864. tableLayout: tableLayout.value,
  43865. onColumnsChange,
  43866. onScrollableChange
  43867. };
  43868. }
  43869. //#endregion
  43870. //#region ../../packages/components/table/src/tokens.ts
  43871. const TABLE_INJECTION_KEY = Symbol("ElTable");
  43872. //#endregion
  43873. //#region ../../packages/components/table/src/table-header/event-helper.ts
  43874. function useEvent(props, emit) {
  43875. const instance = (0, vue.getCurrentInstance)();
  43876. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  43877. const handleFilterClick = (event) => {
  43878. event.stopPropagation();
  43879. };
  43880. const handleHeaderClick = (event, column) => {
  43881. if (!column.filters && column.sortable) handleSortClick(event, column, false);
  43882. else if (column.filterable && !column.sortable) handleFilterClick(event);
  43883. parent?.emit("header-click", column, event);
  43884. };
  43885. const handleHeaderContextMenu = (event, column) => {
  43886. parent?.emit("header-contextmenu", column, event);
  43887. };
  43888. const draggingColumn = (0, vue.ref)(null);
  43889. const dragging = (0, vue.ref)(false);
  43890. const dragState = (0, vue.ref)();
  43891. const handleMouseDown = (event, column) => {
  43892. if (!isClient) return;
  43893. if (column.children && column.children.length > 0) return;
  43894. /* istanbul ignore if */
  43895. if (draggingColumn.value && props.border && draggingColumn.value.id === column.id) {
  43896. dragging.value = true;
  43897. const table = parent;
  43898. emit("set-drag-visible", true);
  43899. const tableLeft = (table?.vnode.el)?.getBoundingClientRect().left;
  43900. const columnEl = instance?.vnode?.el?.querySelector(`th.${column.id}`);
  43901. const columnRect = columnEl.getBoundingClientRect();
  43902. const minLeft = columnRect.left - tableLeft + 30;
  43903. addClass(columnEl, "noclick");
  43904. dragState.value = {
  43905. startMouseLeft: event.clientX,
  43906. startLeft: columnRect.right - tableLeft,
  43907. startColumnLeft: columnRect.left - tableLeft,
  43908. tableLeft
  43909. };
  43910. const resizeProxy = table?.refs.resizeProxy;
  43911. resizeProxy.style.left = `${dragState.value.startLeft}px`;
  43912. document.onselectstart = function() {
  43913. return false;
  43914. };
  43915. document.ondragstart = function() {
  43916. return false;
  43917. };
  43918. const handleMouseMove = (event) => {
  43919. const deltaLeft = event.clientX - dragState.value.startMouseLeft;
  43920. const proxyLeft = dragState.value.startLeft + deltaLeft;
  43921. resizeProxy.style.left = `${Math.max(minLeft, proxyLeft)}px`;
  43922. };
  43923. const handleMouseUp = () => {
  43924. if (dragging.value) {
  43925. const { startColumnLeft, startLeft } = dragState.value;
  43926. column.width = column.realWidth = Number.parseInt(resizeProxy.style.left, 10) - startColumnLeft;
  43927. table?.emit("header-dragend", column.width, startLeft - startColumnLeft, column, event);
  43928. requestAnimationFrame(() => {
  43929. props.store.scheduleLayout(false, true);
  43930. });
  43931. document.body.style.cursor = "";
  43932. dragging.value = false;
  43933. draggingColumn.value = null;
  43934. dragState.value = void 0;
  43935. emit("set-drag-visible", false);
  43936. }
  43937. document.removeEventListener("mousemove", handleMouseMove);
  43938. document.removeEventListener("mouseup", handleMouseUp);
  43939. document.onselectstart = null;
  43940. document.ondragstart = null;
  43941. setTimeout(() => {
  43942. removeClass(columnEl, "noclick");
  43943. }, 0);
  43944. };
  43945. document.addEventListener("mousemove", handleMouseMove);
  43946. document.addEventListener("mouseup", handleMouseUp);
  43947. }
  43948. };
  43949. const handleMouseMove = (event, column) => {
  43950. if (!props.border || column.children && column.children.length > 0) return;
  43951. const el = event.target;
  43952. const target = isElement$1(el) ? el.closest("th") : null;
  43953. if (!target) return;
  43954. const isSortable = hasClass(target, "is-sortable");
  43955. if (isSortable) {
  43956. const cursor = dragging.value ? "col-resize" : "";
  43957. target.style.cursor = cursor;
  43958. const caret = target.querySelector(".caret-wrapper");
  43959. if (caret) caret.style.cursor = cursor;
  43960. }
  43961. if (!column.resizable || dragging.value) {
  43962. draggingColumn.value = null;
  43963. return;
  43964. }
  43965. const rect = target.getBoundingClientRect();
  43966. const isLastTh = target.parentNode?.lastElementChild === target;
  43967. const allowDrag = props.allowDragLastColumn || !isLastTh;
  43968. const isResizeHandleActive = rect.width > 12 && rect.right - event.clientX < 8 && allowDrag;
  43969. const cursor = isResizeHandleActive ? "col-resize" : "";
  43970. document.body.style.cursor = cursor;
  43971. draggingColumn.value = isResizeHandleActive ? column : null;
  43972. if (isSortable) target.style.cursor = cursor;
  43973. };
  43974. const handleMouseOut = () => {
  43975. if (!isClient || dragging.value) return;
  43976. document.body.style.cursor = "";
  43977. };
  43978. const toggleOrder = ({ order, sortOrders }) => {
  43979. if (order === "") return sortOrders[0];
  43980. const index = sortOrders.indexOf(order || null);
  43981. return sortOrders[index > sortOrders.length - 2 ? 0 : index + 1];
  43982. };
  43983. const handleSortClick = (event, column, givenOrder) => {
  43984. event.stopPropagation();
  43985. const order = column.order === givenOrder ? null : givenOrder || toggleOrder(column);
  43986. const target = event.target?.closest("th");
  43987. if (target) {
  43988. if (hasClass(target, "noclick")) {
  43989. removeClass(target, "noclick");
  43990. return;
  43991. }
  43992. }
  43993. if (!column.sortable) return;
  43994. const clickTarget = event.currentTarget;
  43995. if (["ascending", "descending"].some((str) => hasClass(clickTarget, str) && !column.sortOrders.includes(str))) return;
  43996. const states = props.store.states;
  43997. let sortProp = states.sortProp.value;
  43998. let sortOrder;
  43999. const sortingColumn = states.sortingColumn.value;
  44000. if (sortingColumn !== column || sortingColumn === column && isNull(sortingColumn.order)) {
  44001. if (sortingColumn) sortingColumn.order = null;
  44002. states.sortingColumn.value = column;
  44003. sortProp = column.property;
  44004. }
  44005. if (!order) sortOrder = column.order = null;
  44006. else sortOrder = column.order = order;
  44007. states.sortProp.value = sortProp;
  44008. states.sortOrder.value = sortOrder;
  44009. parent?.store.commit("changeSortCondition");
  44010. };
  44011. return {
  44012. handleHeaderClick,
  44013. handleHeaderContextMenu,
  44014. handleMouseDown,
  44015. handleMouseMove,
  44016. handleMouseOut,
  44017. handleSortClick,
  44018. handleFilterClick
  44019. };
  44020. }
  44021. //#endregion
  44022. //#region ../../packages/components/table/src/table-header/style.helper.ts
  44023. function useStyle$2(props) {
  44024. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44025. const ns = useNamespace("table");
  44026. const getHeaderRowStyle = (rowIndex) => {
  44027. const headerRowStyle = parent?.props.headerRowStyle;
  44028. if (isFunction$1(headerRowStyle)) return headerRowStyle.call(null, { rowIndex });
  44029. return headerRowStyle;
  44030. };
  44031. const getHeaderRowClass = (rowIndex) => {
  44032. const classes = [];
  44033. const headerRowClassName = parent?.props.headerRowClassName;
  44034. if (isString(headerRowClassName)) classes.push(headerRowClassName);
  44035. else if (isFunction$1(headerRowClassName)) classes.push(headerRowClassName.call(null, { rowIndex }));
  44036. return classes.join(" ");
  44037. };
  44038. const getHeaderCellStyle = (rowIndex, columnIndex, row, column) => {
  44039. let headerCellStyles = parent?.props.headerCellStyle ?? {};
  44040. if (isFunction$1(headerCellStyles)) headerCellStyles = headerCellStyles.call(null, {
  44041. rowIndex,
  44042. columnIndex,
  44043. row,
  44044. column
  44045. });
  44046. const fixedStyle = getFixedColumnOffset(columnIndex, column.fixed, props.store, row);
  44047. ensurePosition(fixedStyle, "left");
  44048. ensurePosition(fixedStyle, "right");
  44049. return Object.assign({}, headerCellStyles, fixedStyle);
  44050. };
  44051. const getHeaderCellClass = (rowIndex, columnIndex, row, column) => {
  44052. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, column.fixed, props.store, row);
  44053. const classes = [
  44054. column.id,
  44055. column.order,
  44056. column.headerAlign,
  44057. column.className,
  44058. column.labelClassName,
  44059. ...fixedClasses
  44060. ];
  44061. if (!column.children) classes.push("is-leaf");
  44062. if (column.sortable) classes.push("is-sortable");
  44063. const headerCellClassName = parent?.props.headerCellClassName;
  44064. if (isString(headerCellClassName)) classes.push(headerCellClassName);
  44065. else if (isFunction$1(headerCellClassName)) classes.push(headerCellClassName.call(null, {
  44066. rowIndex,
  44067. columnIndex,
  44068. row,
  44069. column
  44070. }));
  44071. classes.push(ns.e("cell"));
  44072. return classes.filter((className) => Boolean(className)).join(" ");
  44073. };
  44074. return {
  44075. getHeaderRowStyle,
  44076. getHeaderRowClass,
  44077. getHeaderCellStyle,
  44078. getHeaderCellClass
  44079. };
  44080. }
  44081. //#endregion
  44082. //#region ../../packages/components/table/src/table-header/utils-helper.ts
  44083. const getAllColumns = (columns) => {
  44084. const result = [];
  44085. columns.forEach((column) => {
  44086. if (column.children) {
  44087. result.push(column);
  44088. result.push.apply(result, getAllColumns(column.children));
  44089. } else result.push(column);
  44090. });
  44091. return result;
  44092. };
  44093. const convertToRows = (originColumns) => {
  44094. let maxLevel = 1;
  44095. const traverse = (column, parent) => {
  44096. if (parent) {
  44097. column.level = parent.level + 1;
  44098. if (maxLevel < column.level) maxLevel = column.level;
  44099. }
  44100. if (column.children) {
  44101. let colSpan = 0;
  44102. column.children.forEach((subColumn) => {
  44103. traverse(subColumn, column);
  44104. colSpan += subColumn.colSpan;
  44105. });
  44106. column.colSpan = colSpan;
  44107. } else column.colSpan = 1;
  44108. };
  44109. originColumns.forEach((column) => {
  44110. column.level = 1;
  44111. traverse(column, void 0);
  44112. });
  44113. const rows = [];
  44114. for (let i = 0; i < maxLevel; i++) rows.push([]);
  44115. getAllColumns(originColumns).forEach((column) => {
  44116. if (!column.children) column.rowSpan = maxLevel - column.level + 1;
  44117. else {
  44118. column.rowSpan = 1;
  44119. column.children.forEach((col) => col.isSubColumn = true);
  44120. }
  44121. rows[column.level - 1].push(column);
  44122. });
  44123. return rows;
  44124. };
  44125. function useUtils$1(props) {
  44126. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44127. const columnRows = (0, vue.computed)(() => {
  44128. return convertToRows(props.store.states.originColumns.value);
  44129. });
  44130. const isGroup = (0, vue.computed)(() => {
  44131. const result = columnRows.value.length > 1;
  44132. if (result && parent) parent.state.isGroup.value = true;
  44133. return result;
  44134. });
  44135. const toggleAllSelection = (event) => {
  44136. event.stopPropagation();
  44137. parent?.store.commit("toggleAllSelection");
  44138. };
  44139. return {
  44140. isGroup,
  44141. toggleAllSelection,
  44142. columnRows
  44143. };
  44144. }
  44145. //#endregion
  44146. //#region ../../packages/components/table/src/table-header/index.ts
  44147. var table_header_default = (0, vue.defineComponent)({
  44148. name: "ElTableHeader",
  44149. components: { ElCheckbox },
  44150. props: {
  44151. fixed: {
  44152. type: String,
  44153. default: ""
  44154. },
  44155. store: {
  44156. required: true,
  44157. type: Object
  44158. },
  44159. border: Boolean,
  44160. defaultSort: {
  44161. type: Object,
  44162. default: () => {
  44163. return {
  44164. prop: "",
  44165. order: ""
  44166. };
  44167. }
  44168. },
  44169. appendFilterPanelTo: { type: String },
  44170. allowDragLastColumn: { type: Boolean }
  44171. },
  44172. setup(props, { emit }) {
  44173. const instance = (0, vue.getCurrentInstance)();
  44174. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44175. const ns = useNamespace("table");
  44176. const filterPanels = (0, vue.ref)({});
  44177. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  44178. const isTableLayoutAuto = parent?.props.tableLayout === "auto";
  44179. const saveIndexSelection = (0, vue.reactive)(/* @__PURE__ */ new Map());
  44180. const theadRef = (0, vue.ref)();
  44181. let delayId;
  44182. const updateFixedColumnStyle = () => {
  44183. delayId = setTimeout(() => {
  44184. if (saveIndexSelection.size > 0) {
  44185. saveIndexSelection.forEach((column, key) => {
  44186. const el = theadRef.value.querySelector(`.${key.replace(/\s/g, ".")}`);
  44187. if (el) column.width = el.getBoundingClientRect().width || column.width;
  44188. });
  44189. saveIndexSelection.clear();
  44190. }
  44191. });
  44192. };
  44193. (0, vue.watch)(saveIndexSelection, updateFixedColumnStyle);
  44194. (0, vue.onBeforeUnmount)(() => {
  44195. if (delayId) {
  44196. clearTimeout(delayId);
  44197. delayId = void 0;
  44198. }
  44199. });
  44200. (0, vue.onMounted)(async () => {
  44201. await (0, vue.nextTick)();
  44202. await (0, vue.nextTick)();
  44203. const { prop, order } = props.defaultSort;
  44204. parent?.store.commit("sort", {
  44205. prop,
  44206. order,
  44207. init: true
  44208. });
  44209. updateFixedColumnStyle();
  44210. });
  44211. const { handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleMouseOut, handleSortClick, handleFilterClick } = useEvent(props, emit);
  44212. const { getHeaderRowStyle, getHeaderRowClass, getHeaderCellStyle, getHeaderCellClass } = useStyle$2(props);
  44213. const { isGroup, toggleAllSelection, columnRows } = useUtils$1(props);
  44214. const { t } = useLocale();
  44215. instance.state = {
  44216. onColumnsChange,
  44217. onScrollableChange
  44218. };
  44219. instance.filterPanels = filterPanels;
  44220. return {
  44221. ns,
  44222. t,
  44223. filterPanels,
  44224. onColumnsChange,
  44225. onScrollableChange,
  44226. columnRows,
  44227. getHeaderRowClass,
  44228. getHeaderRowStyle,
  44229. getHeaderCellClass,
  44230. getHeaderCellStyle,
  44231. handleHeaderClick,
  44232. handleHeaderContextMenu,
  44233. handleMouseDown,
  44234. handleMouseMove,
  44235. handleMouseOut,
  44236. handleSortClick,
  44237. handleFilterClick,
  44238. isGroup,
  44239. toggleAllSelection,
  44240. saveIndexSelection,
  44241. isTableLayoutAuto,
  44242. theadRef,
  44243. updateFixedColumnStyle
  44244. };
  44245. },
  44246. render() {
  44247. const { ns, t, isGroup, columnRows, getHeaderCellStyle, getHeaderCellClass, getHeaderRowClass, getHeaderRowStyle, handleHeaderClick, handleHeaderContextMenu, handleMouseDown, handleMouseMove, handleSortClick, handleMouseOut, store, $parent, saveIndexSelection, isTableLayoutAuto } = this;
  44248. let rowSpan = 1;
  44249. return (0, vue.h)("thead", {
  44250. ref: "theadRef",
  44251. class: ns.is("group", isGroup)
  44252. }, columnRows.map((subColumns, rowIndex) => (0, vue.h)("tr", {
  44253. class: getHeaderRowClass(rowIndex),
  44254. key: rowIndex,
  44255. style: getHeaderRowStyle(rowIndex)
  44256. }, subColumns.map((column, cellIndex) => {
  44257. if (column.rowSpan > rowSpan) rowSpan = column.rowSpan;
  44258. const _class = getHeaderCellClass(rowIndex, cellIndex, subColumns, column);
  44259. if (isTableLayoutAuto && column.fixed) saveIndexSelection.set(_class, column);
  44260. return (0, vue.h)("th", {
  44261. class: _class,
  44262. colspan: column.colSpan,
  44263. key: `${column.id}-thead`,
  44264. rowspan: column.rowSpan,
  44265. scope: column.colSpan > 1 ? "colgroup" : "col",
  44266. ariaSort: column.sortable ? column.order : void 0,
  44267. style: getHeaderCellStyle(rowIndex, cellIndex, subColumns, column),
  44268. onClick: ($event) => {
  44269. if ($event.currentTarget?.classList.contains("noclick")) return;
  44270. handleHeaderClick($event, column);
  44271. },
  44272. onContextmenu: ($event) => handleHeaderContextMenu($event, column),
  44273. onMousedown: ($event) => handleMouseDown($event, column),
  44274. onMousemove: ($event) => handleMouseMove($event, column),
  44275. onMouseout: handleMouseOut
  44276. }, [(0, vue.h)("div", { class: ["cell", column.filteredValue && column.filteredValue.length > 0 ? "highlight" : ""] }, [
  44277. column.renderHeader ? column.renderHeader({
  44278. column,
  44279. $index: cellIndex,
  44280. store,
  44281. _self: $parent
  44282. }) : column.label,
  44283. column.sortable && (0, vue.h)("button", {
  44284. type: "button",
  44285. class: "caret-wrapper",
  44286. "aria-label": t("el.table.sortLabel", { column: column.label || "" }),
  44287. onClick: ($event) => handleSortClick($event, column)
  44288. }, [(0, vue.h)("i", {
  44289. onClick: ($event) => handleSortClick($event, column, "ascending"),
  44290. class: "sort-caret ascending"
  44291. }), (0, vue.h)("i", {
  44292. onClick: ($event) => handleSortClick($event, column, "descending"),
  44293. class: "sort-caret descending"
  44294. })]),
  44295. column.filterable && (0, vue.h)(filter_panel_default, {
  44296. store,
  44297. placement: column.filterPlacement || "bottom-start",
  44298. appendTo: $parent?.appendFilterPanelTo,
  44299. column,
  44300. upDataColumn: (key, value) => {
  44301. column[key] = value;
  44302. }
  44303. }, { "filter-icon": () => column.renderFilterIcon ? column.renderFilterIcon({ filterOpened: column.filterOpened }) : null })
  44304. ])]);
  44305. }))));
  44306. }
  44307. });
  44308. //#endregion
  44309. //#region ../../packages/components/table/src/table-body/events-helper.ts
  44310. function isGreaterThan(a, b, epsilon = .03) {
  44311. return a - b > epsilon;
  44312. }
  44313. function useEvents(props) {
  44314. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44315. const tooltipContent = (0, vue.ref)("");
  44316. const tooltipTrigger = (0, vue.ref)((0, vue.h)("div"));
  44317. const handleEvent = (event, row, name) => {
  44318. const table = parent;
  44319. const cell = getCell(event);
  44320. let column = null;
  44321. const namespace = table?.vnode.el?.dataset.prefix;
  44322. if (cell) {
  44323. column = getColumnByCell({ columns: props.store?.states.columns.value ?? [] }, cell, namespace);
  44324. if (column) table?.emit(`cell-${name}`, row, column, cell, event);
  44325. }
  44326. table?.emit(`row-${name}`, row, column, event);
  44327. };
  44328. const handleDoubleClick = (event, row) => {
  44329. handleEvent(event, row, "dblclick");
  44330. };
  44331. const handleClick = (event, row) => {
  44332. props.store?.commit("setCurrentRow", row);
  44333. handleEvent(event, row, "click");
  44334. };
  44335. const handleContextMenu = (event, row) => {
  44336. handleEvent(event, row, "contextmenu");
  44337. };
  44338. const handleMouseEnter = debounce((index) => {
  44339. props.store?.commit("setHoverRow", index);
  44340. }, 30);
  44341. const handleMouseLeave = debounce(() => {
  44342. props.store?.commit("setHoverRow", null);
  44343. }, 30);
  44344. const getPadding = (el) => {
  44345. const style = window.getComputedStyle(el, null);
  44346. return {
  44347. left: Number.parseInt(style.paddingLeft, 10) || 0,
  44348. right: Number.parseInt(style.paddingRight, 10) || 0,
  44349. top: Number.parseInt(style.paddingTop, 10) || 0,
  44350. bottom: Number.parseInt(style.paddingBottom, 10) || 0
  44351. };
  44352. };
  44353. const toggleRowClassByCell = (rowSpan, event, toggle) => {
  44354. let node = (event?.target)?.parentNode;
  44355. while (rowSpan > 1) {
  44356. node = node?.nextSibling;
  44357. if (!node || node.nodeName !== "TR") break;
  44358. toggle(node, "hover-row hover-fixed-row");
  44359. rowSpan--;
  44360. }
  44361. };
  44362. const handleCellMouseEnter = (event, row, tooltipOptions) => {
  44363. if (!parent) return;
  44364. const table = parent;
  44365. const cell = getCell(event);
  44366. const namespace = table?.vnode.el?.dataset.prefix;
  44367. let column = null;
  44368. if (cell) {
  44369. column = getColumnByCell({ columns: props.store?.states.columns.value ?? [] }, cell, namespace);
  44370. if (!column) return;
  44371. if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, addClass);
  44372. const hoverState = table.hoverState = {
  44373. cell,
  44374. column,
  44375. row
  44376. };
  44377. table?.emit("cell-mouse-enter", hoverState.row, hoverState.column, hoverState.cell, event);
  44378. }
  44379. if (!tooltipOptions) {
  44380. if (removePopper?.trigger === cell) removePopper?.();
  44381. return;
  44382. }
  44383. const cellChild = event.target.querySelector(".cell");
  44384. if (!(hasClass(cellChild, `${namespace}-tooltip`) && cellChild.childNodes.length && cellChild.textContent?.trim())) return;
  44385. const range = document.createRange();
  44386. range.setStart(cellChild, 0);
  44387. range.setEnd(cellChild, cellChild.childNodes.length);
  44388. /** detail: https://github.com/element-plus/element-plus/issues/10790
  44389. * What went wrong?
  44390. * UI > Browser > Zoom, In Blink/WebKit, getBoundingClientRect() sometimes returns inexact values, probably due to lost precision during internal calculations. In the example above:
  44391. * - Expected: 188
  44392. * - Actual: 188.00000762939453
  44393. */
  44394. const { width: rangeWidth, height: rangeHeight } = range.getBoundingClientRect();
  44395. const { width: cellChildWidth, height: cellChildHeight } = cellChild.getBoundingClientRect();
  44396. const { top, left, right, bottom } = getPadding(cellChild);
  44397. const horizontalPadding = left + right;
  44398. const verticalPadding = top + bottom;
  44399. if (isGreaterThan(rangeWidth + horizontalPadding, cellChildWidth) || isGreaterThan(rangeHeight + verticalPadding, cellChildHeight) || isGreaterThan(cellChild.scrollWidth, cellChildWidth)) createTablePopper(tooltipOptions, (cell?.innerText || cell?.textContent) ?? "", row, column, cell, table);
  44400. else if (removePopper?.trigger === cell) removePopper?.();
  44401. };
  44402. const handleCellMouseLeave = (event) => {
  44403. const cell = getCell(event);
  44404. if (!cell) return;
  44405. if (cell.rowSpan > 1) toggleRowClassByCell(cell.rowSpan, event, removeClass);
  44406. const oldHoverState = parent?.hoverState;
  44407. parent?.emit("cell-mouse-leave", oldHoverState?.row, oldHoverState?.column, oldHoverState?.cell, event);
  44408. };
  44409. return {
  44410. handleDoubleClick,
  44411. handleClick,
  44412. handleContextMenu,
  44413. handleMouseEnter,
  44414. handleMouseLeave,
  44415. handleCellMouseEnter,
  44416. handleCellMouseLeave,
  44417. tooltipContent,
  44418. tooltipTrigger
  44419. };
  44420. }
  44421. //#endregion
  44422. //#region ../../packages/components/table/src/table-body/styles-helper.ts
  44423. function useStyles$1(props) {
  44424. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44425. const ns = useNamespace("table");
  44426. const getRowStyle = (row, rowIndex) => {
  44427. const rowStyle = parent?.props.rowStyle;
  44428. if (isFunction$1(rowStyle)) return rowStyle.call(null, {
  44429. row,
  44430. rowIndex
  44431. });
  44432. return rowStyle || null;
  44433. };
  44434. const getRowClass = (row, rowIndex, displayIndex) => {
  44435. const classes = [ns.e("row")];
  44436. if (parent?.props.highlightCurrentRow && row === props.store?.states.currentRow.value) classes.push("current-row");
  44437. if (props.stripe && displayIndex % 2 === 1) classes.push(ns.em("row", "striped"));
  44438. const rowClassName = parent?.props.rowClassName;
  44439. if (isString(rowClassName)) classes.push(rowClassName);
  44440. else if (isFunction$1(rowClassName)) classes.push(rowClassName.call(null, {
  44441. row,
  44442. rowIndex
  44443. }));
  44444. return classes;
  44445. };
  44446. const getCellStyle = (rowIndex, columnIndex, row, column) => {
  44447. const cellStyle = parent?.props.cellStyle;
  44448. let cellStyles = cellStyle ?? {};
  44449. if (isFunction$1(cellStyle)) cellStyles = cellStyle.call(null, {
  44450. rowIndex,
  44451. columnIndex,
  44452. row,
  44453. column
  44454. });
  44455. const fixedStyle = getFixedColumnOffset(columnIndex, props?.fixed, props.store);
  44456. ensurePosition(fixedStyle, "left");
  44457. ensurePosition(fixedStyle, "right");
  44458. return Object.assign({}, cellStyles, fixedStyle);
  44459. };
  44460. const getCellClass = (rowIndex, columnIndex, row, column, offset) => {
  44461. const fixedClasses = getFixedColumnsClass(ns.b(), columnIndex, props?.fixed, props.store, void 0, offset);
  44462. const classes = [
  44463. column.id,
  44464. column.align,
  44465. column.className,
  44466. ...fixedClasses
  44467. ];
  44468. const cellClassName = parent?.props.cellClassName;
  44469. if (isString(cellClassName)) classes.push(cellClassName);
  44470. else if (isFunction$1(cellClassName)) classes.push(cellClassName.call(null, {
  44471. rowIndex,
  44472. columnIndex,
  44473. row,
  44474. column
  44475. }));
  44476. classes.push(ns.e("cell"));
  44477. return classes.filter((className) => Boolean(className)).join(" ");
  44478. };
  44479. const getSpan = (row, column, rowIndex, columnIndex) => {
  44480. let rowspan = 1;
  44481. let colspan = 1;
  44482. const fn = parent?.props.spanMethod;
  44483. if (isFunction$1(fn)) {
  44484. const result = fn({
  44485. row,
  44486. column,
  44487. rowIndex,
  44488. columnIndex
  44489. });
  44490. if (isArray$1(result)) {
  44491. rowspan = result[0];
  44492. colspan = result[1];
  44493. } else if (isObject$1(result)) {
  44494. rowspan = result.rowspan;
  44495. colspan = result.colspan;
  44496. }
  44497. }
  44498. return {
  44499. rowspan,
  44500. colspan
  44501. };
  44502. };
  44503. const getColspanRealWidth = (columns, colspan, index) => {
  44504. if (colspan < 1) return columns[index].realWidth;
  44505. const widthArr = columns.map(({ realWidth, width }) => realWidth || width).slice(index, index + colspan);
  44506. return Number(widthArr.reduce((acc, width) => Number(acc) + Number(width), -1));
  44507. };
  44508. return {
  44509. getRowStyle,
  44510. getRowClass,
  44511. getCellStyle,
  44512. getCellClass,
  44513. getSpan,
  44514. getColspanRealWidth
  44515. };
  44516. }
  44517. //#endregion
  44518. //#region ../../packages/components/table/src/table-body/td-wrapper.vue?vue&type=script&setup=true&lang.ts
  44519. const _hoisted_1$16 = ["colspan", "rowspan"];
  44520. var td_wrapper_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  44521. name: "TableTdWrapper",
  44522. __name: "td-wrapper",
  44523. props: {
  44524. colspan: {
  44525. type: Number,
  44526. default: 1
  44527. },
  44528. rowspan: {
  44529. type: Number,
  44530. default: 1
  44531. }
  44532. },
  44533. setup(__props) {
  44534. return (_ctx, _cache) => {
  44535. return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
  44536. colspan: __props.colspan,
  44537. rowspan: __props.rowspan
  44538. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 8, _hoisted_1$16);
  44539. };
  44540. }
  44541. });
  44542. //#endregion
  44543. //#region ../../packages/components/table/src/table-body/td-wrapper.vue
  44544. var td_wrapper_default = td_wrapper_vue_vue_type_script_setup_true_lang_default;
  44545. //#endregion
  44546. //#region ../../packages/components/table/src/table-body/render-helper.ts
  44547. function useRender$1(props) {
  44548. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44549. const ns = useNamespace("table");
  44550. const { handleDoubleClick, handleClick, handleContextMenu, handleMouseEnter, handleMouseLeave, handleCellMouseEnter, handleCellMouseLeave, tooltipContent, tooltipTrigger } = useEvents(props);
  44551. const { getRowStyle, getRowClass, getCellStyle, getCellClass, getSpan, getColspanRealWidth } = useStyles$1(props);
  44552. let displayIndex = -1;
  44553. const firstDefaultColumnIndex = (0, vue.computed)(() => {
  44554. return props.store?.states.columns.value.findIndex(({ type }) => type === "default");
  44555. });
  44556. const getKeyOfRow = (row, index) => {
  44557. const rowKey = (parent?.props)?.rowKey;
  44558. if (rowKey) return getRowIdentity(row, rowKey);
  44559. return index;
  44560. };
  44561. const rowRender = (row, $index, treeRowData, expanded = false) => {
  44562. const { tooltipEffect, tooltipOptions, store } = props;
  44563. const { indent, columns } = store.states;
  44564. const rowClasses = [];
  44565. let display = true;
  44566. if (treeRowData) {
  44567. rowClasses.push(ns.em("row", `level-${treeRowData.level}`));
  44568. display = !!treeRowData.display;
  44569. }
  44570. if ($index === 0) displayIndex = -1;
  44571. if (props.stripe && display) displayIndex++;
  44572. rowClasses.push(...getRowClass(row, $index, displayIndex));
  44573. return (0, vue.h)("tr", {
  44574. style: [display ? null : { display: "none" }, getRowStyle(row, $index)],
  44575. class: rowClasses,
  44576. key: getKeyOfRow(row, $index),
  44577. onDblclick: ($event) => handleDoubleClick($event, row),
  44578. onClick: ($event) => handleClick($event, row),
  44579. onContextmenu: ($event) => handleContextMenu($event, row),
  44580. onMouseenter: () => handleMouseEnter($index),
  44581. onMouseleave: handleMouseLeave
  44582. }, columns.value.map((column, cellIndex) => {
  44583. const { rowspan, colspan } = getSpan(row, column, $index, cellIndex);
  44584. if (!rowspan || !colspan) return null;
  44585. const columnData = Object.assign({}, column);
  44586. columnData.realWidth = getColspanRealWidth(columns.value, colspan, cellIndex);
  44587. const data = {
  44588. store,
  44589. _self: props.context || parent,
  44590. column: columnData,
  44591. row,
  44592. $index,
  44593. cellIndex,
  44594. expanded
  44595. };
  44596. if (cellIndex === firstDefaultColumnIndex.value && treeRowData) {
  44597. data.treeNode = {
  44598. indent: treeRowData.level && treeRowData.level * indent.value,
  44599. level: treeRowData.level
  44600. };
  44601. if (isBoolean(treeRowData.expanded)) {
  44602. data.treeNode.expanded = treeRowData.expanded;
  44603. if ("loading" in treeRowData) data.treeNode.loading = treeRowData.loading;
  44604. if ("noLazyChildren" in treeRowData) data.treeNode.noLazyChildren = treeRowData.noLazyChildren;
  44605. }
  44606. }
  44607. const baseKey = `${getKeyOfRow(row, $index)},${cellIndex}`;
  44608. const patchKey = columnData.columnKey || columnData.rawColumnKey || "";
  44609. const mergedTooltipOptions = column.showOverflowTooltip && merge({ effect: tooltipEffect }, tooltipOptions, column.showOverflowTooltip);
  44610. return (0, vue.h)(td_wrapper_default, {
  44611. style: getCellStyle($index, cellIndex, row, column),
  44612. class: getCellClass($index, cellIndex, row, column, colspan - 1),
  44613. key: `${patchKey}${baseKey}`,
  44614. rowspan,
  44615. colspan,
  44616. onMouseenter: ($event) => handleCellMouseEnter($event, row, mergedTooltipOptions),
  44617. onMouseleave: handleCellMouseLeave
  44618. }, { default: () => cellChildren(cellIndex, column, data) });
  44619. }));
  44620. };
  44621. const cellChildren = (_cellIndex, column, data) => {
  44622. return column.renderCell(data);
  44623. };
  44624. const wrappedRowRender = (row, $index) => {
  44625. const store = props.store;
  44626. const { isRowExpanded, assertRowKey } = store;
  44627. const { treeData, lazyTreeNodeMap, childrenColumnName, rowKey } = store.states;
  44628. const columns = store.states.columns.value;
  44629. if (columns.some(({ type }) => type === "expand")) {
  44630. const expanded = isRowExpanded(row);
  44631. const tr = rowRender(row, $index, void 0, expanded);
  44632. const renderExpanded = parent?.renderExpanded;
  44633. if (!renderExpanded) {
  44634. console.error("[Element Error]renderExpanded is required.");
  44635. return tr;
  44636. }
  44637. const rows = [[tr]];
  44638. if (parent.props.preserveExpandedContent || expanded) rows[0].push((0, vue.h)("tr", {
  44639. key: `expanded-row__${tr.key}`,
  44640. style: { display: expanded ? "" : "none" }
  44641. }, [(0, vue.h)("td", {
  44642. colspan: columns.length,
  44643. class: `${ns.e("cell")} ${ns.e("expanded-cell")}`
  44644. }, [renderExpanded({
  44645. row,
  44646. $index,
  44647. store,
  44648. expanded
  44649. })])]));
  44650. return rows;
  44651. } else if (Object.keys(treeData.value).length) {
  44652. assertRowKey();
  44653. const key = getRowIdentity(row, rowKey.value);
  44654. let cur = treeData.value[key];
  44655. let treeRowData = null;
  44656. if (cur) {
  44657. treeRowData = {
  44658. expanded: cur.expanded,
  44659. level: cur.level,
  44660. display: true,
  44661. noLazyChildren: void 0,
  44662. loading: void 0
  44663. };
  44664. if (isBoolean(cur.lazy)) {
  44665. if (treeRowData && isBoolean(cur.loaded) && cur.loaded) treeRowData.noLazyChildren = !(cur.children && cur.children.length);
  44666. treeRowData.loading = cur.loading;
  44667. }
  44668. }
  44669. const tmp = [rowRender(row, $index, treeRowData ?? void 0)];
  44670. if (cur) {
  44671. let i = 0;
  44672. const traverse = (children, parent) => {
  44673. if (!(children && children.length && parent)) return;
  44674. children.forEach((node) => {
  44675. const innerTreeRowData = {
  44676. display: parent.display && parent.expanded,
  44677. level: parent.level + 1,
  44678. expanded: false,
  44679. noLazyChildren: false,
  44680. loading: false
  44681. };
  44682. const childKey = getRowIdentity(node, rowKey.value);
  44683. if (isPropAbsent(childKey)) throw new Error("For nested data item, row-key is required.");
  44684. cur = { ...treeData.value[childKey] };
  44685. if (cur) {
  44686. innerTreeRowData.expanded = cur.expanded;
  44687. cur.level = cur.level || innerTreeRowData.level;
  44688. cur.display = !!(cur.expanded && innerTreeRowData.display);
  44689. if (isBoolean(cur.lazy)) {
  44690. if (isBoolean(cur.loaded) && cur.loaded) innerTreeRowData.noLazyChildren = !(cur.children && cur.children.length);
  44691. innerTreeRowData.loading = cur.loading;
  44692. }
  44693. }
  44694. i++;
  44695. tmp.push(rowRender(node, $index + i, innerTreeRowData));
  44696. if (cur) traverse(lazyTreeNodeMap.value[childKey] || node[childrenColumnName.value], cur);
  44697. });
  44698. };
  44699. cur.display = true;
  44700. traverse(lazyTreeNodeMap.value[key] || row[childrenColumnName.value], cur);
  44701. }
  44702. return tmp;
  44703. } else return rowRender(row, $index, void 0);
  44704. };
  44705. return {
  44706. wrappedRowRender,
  44707. tooltipContent,
  44708. tooltipTrigger
  44709. };
  44710. }
  44711. //#endregion
  44712. //#region ../../packages/components/table/src/table-body/defaults.ts
  44713. const defaultProps$1 = {
  44714. store: {
  44715. required: true,
  44716. type: Object
  44717. },
  44718. stripe: Boolean,
  44719. tooltipEffect: String,
  44720. tooltipOptions: { type: Object },
  44721. context: {
  44722. default: () => ({}),
  44723. type: Object
  44724. },
  44725. rowClassName: [String, Function],
  44726. rowStyle: [Object, Function],
  44727. fixed: {
  44728. type: String,
  44729. default: ""
  44730. },
  44731. highlight: Boolean
  44732. };
  44733. //#endregion
  44734. //#region ../../packages/components/table/src/table-body/index.ts
  44735. var table_body_default = (0, vue.defineComponent)({
  44736. name: "ElTableBody",
  44737. props: defaultProps$1,
  44738. setup(props) {
  44739. const instance = (0, vue.getCurrentInstance)();
  44740. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44741. const ns = useNamespace("table");
  44742. const { wrappedRowRender, tooltipContent, tooltipTrigger } = useRender$1(props);
  44743. const { onColumnsChange, onScrollableChange } = useLayoutObserver(parent);
  44744. const hoveredCellList = [];
  44745. (0, vue.watch)(props.store?.states.hoverRow, (newVal, oldVal) => {
  44746. const el = instance?.vnode.el;
  44747. const rows = Array.from(el?.children || []).filter((e) => e?.classList.contains(`${ns.e("row")}`));
  44748. let rowNum = newVal;
  44749. const childNodes = rows[rowNum]?.childNodes;
  44750. if (childNodes?.length) {
  44751. let control = 0;
  44752. Array.from(childNodes).reduce((acc, item, index) => {
  44753. if (childNodes[index]?.colSpan > 1) control = childNodes[index]?.colSpan;
  44754. if (item.nodeName !== "TD" && control === 0) acc.push(index);
  44755. control > 0 && control--;
  44756. return acc;
  44757. }, []).forEach((rowIndex) => {
  44758. rowNum = newVal;
  44759. while (rowNum > 0) {
  44760. const preChildNodes = rows[rowNum - 1]?.childNodes;
  44761. if (preChildNodes[rowIndex] && preChildNodes[rowIndex].nodeName === "TD" && preChildNodes[rowIndex].rowSpan > 1) {
  44762. addClass(preChildNodes[rowIndex], "hover-cell");
  44763. hoveredCellList.push(preChildNodes[rowIndex]);
  44764. break;
  44765. }
  44766. rowNum--;
  44767. }
  44768. });
  44769. } else {
  44770. hoveredCellList.forEach((item) => removeClass(item, "hover-cell"));
  44771. hoveredCellList.length = 0;
  44772. }
  44773. if (!props.store?.states.isComplex.value || !isClient) return;
  44774. rAF(() => {
  44775. const oldRow = rows[oldVal];
  44776. const newRow = rows[newVal];
  44777. if (oldRow && !oldRow.classList.contains("hover-fixed-row")) removeClass(oldRow, "hover-row");
  44778. if (newRow) addClass(newRow, "hover-row");
  44779. });
  44780. });
  44781. (0, vue.onUnmounted)(() => {
  44782. removePopper?.();
  44783. });
  44784. return {
  44785. ns,
  44786. onColumnsChange,
  44787. onScrollableChange,
  44788. wrappedRowRender,
  44789. tooltipContent,
  44790. tooltipTrigger
  44791. };
  44792. },
  44793. render() {
  44794. const { wrappedRowRender, store } = this;
  44795. return (0, vue.h)("tbody", { tabIndex: -1 }, [(store?.states.data.value || []).reduce((acc, row) => {
  44796. return acc.concat(wrappedRowRender(row, acc.length));
  44797. }, [])]);
  44798. }
  44799. });
  44800. //#endregion
  44801. //#region ../../packages/components/table/src/table-footer/mapState-helper.ts
  44802. function useMapState() {
  44803. const store = (0, vue.inject)(TABLE_INJECTION_KEY)?.store;
  44804. return {
  44805. leftFixedLeafCount: (0, vue.computed)(() => {
  44806. return store?.states.fixedLeafColumnsLength.value ?? 0;
  44807. }),
  44808. rightFixedLeafCount: (0, vue.computed)(() => {
  44809. return store?.states.rightFixedColumns.value.length ?? 0;
  44810. }),
  44811. columnsCount: (0, vue.computed)(() => {
  44812. return store?.states.columns.value.length ?? 0;
  44813. }),
  44814. leftFixedCount: (0, vue.computed)(() => {
  44815. return store?.states.fixedColumns.value.length ?? 0;
  44816. }),
  44817. rightFixedCount: (0, vue.computed)(() => {
  44818. return store?.states.rightFixedColumns.value.length ?? 0;
  44819. }),
  44820. columns: (0, vue.computed)(() => store?.states.columns.value ?? [])
  44821. };
  44822. }
  44823. //#endregion
  44824. //#region ../../packages/components/table/src/table-footer/style-helper.ts
  44825. function useStyle$1(props) {
  44826. const { columns } = useMapState();
  44827. const ns = useNamespace("table");
  44828. const getCellClasses = (columns, cellIndex) => {
  44829. const column = columns[cellIndex];
  44830. const classes = [
  44831. ns.e("cell"),
  44832. column.id,
  44833. column.align,
  44834. column.labelClassName,
  44835. ...getFixedColumnsClass(ns.b(), cellIndex, column.fixed, props.store)
  44836. ];
  44837. if (column.className) classes.push(column.className);
  44838. if (!column.children) classes.push(ns.is("leaf"));
  44839. return classes;
  44840. };
  44841. const getCellStyles = (column, cellIndex) => {
  44842. const fixedStyle = getFixedColumnOffset(cellIndex, column.fixed, props.store);
  44843. ensurePosition(fixedStyle, "left");
  44844. ensurePosition(fixedStyle, "right");
  44845. return fixedStyle;
  44846. };
  44847. return {
  44848. getCellClasses,
  44849. getCellStyles,
  44850. columns
  44851. };
  44852. }
  44853. //#endregion
  44854. //#region ../../packages/components/table/src/table-footer/index.ts
  44855. var table_footer_default = (0, vue.defineComponent)({
  44856. name: "ElTableFooter",
  44857. props: {
  44858. fixed: {
  44859. type: String,
  44860. default: ""
  44861. },
  44862. store: {
  44863. required: true,
  44864. type: Object
  44865. },
  44866. summaryMethod: Function,
  44867. sumText: String,
  44868. border: Boolean,
  44869. defaultSort: {
  44870. type: Object,
  44871. default: () => {
  44872. return {
  44873. prop: "",
  44874. order: ""
  44875. };
  44876. }
  44877. }
  44878. },
  44879. setup(props) {
  44880. const parent = (0, vue.inject)(TABLE_INJECTION_KEY);
  44881. const ns = useNamespace("table");
  44882. const { getCellClasses, getCellStyles, columns } = useStyle$1(props);
  44883. const { onScrollableChange, onColumnsChange } = useLayoutObserver(parent);
  44884. return {
  44885. ns,
  44886. onScrollableChange,
  44887. onColumnsChange,
  44888. getCellClasses,
  44889. getCellStyles,
  44890. columns
  44891. };
  44892. },
  44893. render() {
  44894. const { columns, getCellStyles, getCellClasses, summaryMethod, sumText } = this;
  44895. const data = this.store.states.data.value;
  44896. let sums = [];
  44897. if (summaryMethod) sums = summaryMethod({
  44898. columns,
  44899. data
  44900. });
  44901. else columns.forEach((column, index) => {
  44902. if (index === 0) {
  44903. sums[index] = sumText;
  44904. return;
  44905. }
  44906. const values = data.map((item) => Number(item[column.property]));
  44907. const precisions = [];
  44908. let notNumber = true;
  44909. values.forEach((value) => {
  44910. if (!Number.isNaN(+value)) {
  44911. notNumber = false;
  44912. const decimal = `${value}`.split(".")[1];
  44913. precisions.push(decimal ? decimal.length : 0);
  44914. }
  44915. });
  44916. const precision = Math.max.apply(null, precisions);
  44917. if (!notNumber) sums[index] = values.reduce((prev, curr) => {
  44918. const value = Number(curr);
  44919. if (!Number.isNaN(+value)) return Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));
  44920. else return prev;
  44921. }, 0);
  44922. else sums[index] = "";
  44923. });
  44924. return (0, vue.h)((0, vue.h)("tfoot", [(0, vue.h)("tr", {}, [...columns.map((column, cellIndex) => (0, vue.h)("td", {
  44925. key: cellIndex,
  44926. colspan: column.colSpan,
  44927. rowspan: column.rowSpan,
  44928. class: getCellClasses(columns, cellIndex),
  44929. style: getCellStyles(column, cellIndex)
  44930. }, [(0, vue.h)("div", { class: ["cell", column.labelClassName] }, [sums[cellIndex]])]))])]));
  44931. }
  44932. });
  44933. //#endregion
  44934. //#region ../../packages/components/table/src/table/utils-helper.ts
  44935. function useUtils(store) {
  44936. const setCurrentRow = (row) => {
  44937. store.commit("setCurrentRow", row);
  44938. };
  44939. const getSelectionRows = () => {
  44940. return store.getSelectionRows();
  44941. };
  44942. const toggleRowSelection = (row, selected, ignoreSelectable = true) => {
  44943. store.toggleRowSelection(row, selected, false, ignoreSelectable);
  44944. store.updateAllSelected();
  44945. };
  44946. const clearSelection = () => {
  44947. store.clearSelection();
  44948. };
  44949. const clearFilter = (columnKeys) => {
  44950. store.clearFilter(columnKeys);
  44951. };
  44952. const toggleAllSelection = () => {
  44953. store.commit("toggleAllSelection");
  44954. };
  44955. const toggleRowExpansion = (row, expanded) => {
  44956. store.toggleRowExpansionAdapter(row, expanded);
  44957. };
  44958. const clearSort = () => {
  44959. store.clearSort();
  44960. };
  44961. const sort = (prop, order) => {
  44962. store.commit("sort", {
  44963. prop,
  44964. order
  44965. });
  44966. };
  44967. const updateKeyChildren = (key, data) => {
  44968. store.updateKeyChildren(key, data);
  44969. };
  44970. return {
  44971. setCurrentRow,
  44972. getSelectionRows,
  44973. toggleRowSelection,
  44974. clearSelection,
  44975. clearFilter,
  44976. toggleAllSelection,
  44977. toggleRowExpansion,
  44978. clearSort,
  44979. sort,
  44980. updateKeyChildren
  44981. };
  44982. }
  44983. //#endregion
  44984. //#region ../../packages/components/table/src/table/style-helper.ts
  44985. function useStyle(props, layout, store, table) {
  44986. const isHidden = (0, vue.ref)(false);
  44987. const renderExpanded = (0, vue.ref)(null);
  44988. const resizeProxyVisible = (0, vue.ref)(false);
  44989. const setDragVisible = (visible) => {
  44990. resizeProxyVisible.value = visible;
  44991. };
  44992. const resizeState = (0, vue.ref)({
  44993. width: null,
  44994. height: null,
  44995. headerHeight: null
  44996. });
  44997. const isGroup = (0, vue.ref)(false);
  44998. const scrollbarViewStyle = {
  44999. display: "inline-block",
  45000. verticalAlign: "middle"
  45001. };
  45002. const tableWidth = (0, vue.ref)();
  45003. const tableScrollHeight = (0, vue.ref)(0);
  45004. const bodyScrollHeight = (0, vue.ref)(0);
  45005. const headerScrollHeight = (0, vue.ref)(0);
  45006. const footerScrollHeight = (0, vue.ref)(0);
  45007. const appendScrollHeight = (0, vue.ref)(0);
  45008. (0, vue.watch)(() => props.height, (value) => {
  45009. layout.setHeight(value ?? null);
  45010. }, { immediate: true });
  45011. (0, vue.watch)(() => props.maxHeight, (value) => {
  45012. layout.setMaxHeight(value ?? null);
  45013. }, { immediate: true });
  45014. (0, vue.watch)(() => [props.currentRowKey, store.states.rowKey], ([currentRowKey, rowKey]) => {
  45015. if (!(0, vue.unref)(rowKey) || !(0, vue.unref)(currentRowKey)) return;
  45016. store.setCurrentRowKey(`${currentRowKey}`);
  45017. }, { immediate: true });
  45018. (0, vue.watch)(() => props.data, (data) => {
  45019. table.store.commit("setData", data);
  45020. }, {
  45021. immediate: true,
  45022. deep: true
  45023. });
  45024. (0, vue.watchEffect)(() => {
  45025. if (props.expandRowKeys) store.setExpandRowKeysAdapter(props.expandRowKeys);
  45026. });
  45027. const handleMouseLeave = () => {
  45028. table.store.commit("setHoverRow", null);
  45029. if (table.hoverState) table.hoverState = null;
  45030. };
  45031. const handleHeaderFooterMousewheel = (_event, data) => {
  45032. const { pixelX, pixelY } = data;
  45033. if (Math.abs(pixelX) >= Math.abs(pixelY)) table.refs.bodyWrapper.scrollLeft += data.pixelX / 5;
  45034. };
  45035. const shouldUpdateHeight = (0, vue.computed)(() => {
  45036. return props.height || props.maxHeight || store.states.fixedColumns.value.length > 0 || store.states.rightFixedColumns.value.length > 0;
  45037. });
  45038. const tableBodyStyles = (0, vue.computed)(() => {
  45039. return { width: layout.bodyWidth.value ? `${layout.bodyWidth.value}px` : "" };
  45040. });
  45041. const doLayout = () => {
  45042. if (shouldUpdateHeight.value) layout.updateElsHeight();
  45043. layout.updateColumnsWidth();
  45044. if (typeof window === "undefined") return;
  45045. requestAnimationFrame(syncPosition);
  45046. };
  45047. (0, vue.onMounted)(async () => {
  45048. await (0, vue.nextTick)();
  45049. store.updateColumns();
  45050. bindEvents();
  45051. requestAnimationFrame(doLayout);
  45052. const el = table.vnode.el;
  45053. const tableHeader = table.refs.headerWrapper;
  45054. if (props.flexible && el && el.parentElement) el.parentElement.style.minWidth = "0";
  45055. resizeState.value = {
  45056. width: tableWidth.value = el.offsetWidth,
  45057. height: el.offsetHeight,
  45058. headerHeight: props.showHeader && tableHeader ? tableHeader.offsetHeight : null
  45059. };
  45060. store.states.columns.value.forEach((column) => {
  45061. if (column.filteredValue && column.filteredValue.length) table.store.commit("filterChange", {
  45062. column,
  45063. values: column.filteredValue,
  45064. silent: true
  45065. });
  45066. });
  45067. table.$ready = true;
  45068. });
  45069. const setScrollClassByEl = (el, className) => {
  45070. if (!el) return;
  45071. const classList = Array.from(el.classList).filter((item) => !item.startsWith("is-scrolling-"));
  45072. classList.push(layout.scrollX.value ? className : "is-scrolling-none");
  45073. el.className = classList.join(" ");
  45074. };
  45075. const setScrollClass = (className) => {
  45076. const { tableWrapper } = table.refs;
  45077. setScrollClassByEl(tableWrapper, className);
  45078. };
  45079. const hasScrollClass = (className) => {
  45080. const { tableWrapper } = table.refs;
  45081. return !!(tableWrapper && tableWrapper.classList.contains(className));
  45082. };
  45083. const syncPosition = function() {
  45084. if (!table.refs.scrollBarRef) return;
  45085. if (!layout.scrollX.value) {
  45086. const scrollingNoneClass = "is-scrolling-none";
  45087. if (!hasScrollClass(scrollingNoneClass)) setScrollClass(scrollingNoneClass);
  45088. return;
  45089. }
  45090. const scrollContainer = table.refs.scrollBarRef.wrapRef;
  45091. if (!scrollContainer) return;
  45092. const { scrollLeft, offsetWidth, scrollWidth } = scrollContainer;
  45093. const { headerWrapper, footerWrapper } = table.refs;
  45094. if (headerWrapper) headerWrapper.scrollLeft = scrollLeft;
  45095. if (footerWrapper) footerWrapper.scrollLeft = scrollLeft;
  45096. if (scrollLeft >= scrollWidth - offsetWidth - 1) setScrollClass("is-scrolling-right");
  45097. else if (scrollLeft === 0) setScrollClass("is-scrolling-left");
  45098. else setScrollClass("is-scrolling-middle");
  45099. };
  45100. const bindEvents = () => {
  45101. if (!table.refs.scrollBarRef) return;
  45102. if (table.refs.scrollBarRef.wrapRef) useEventListener(table.refs.scrollBarRef.wrapRef, "scroll", syncPosition, { passive: true });
  45103. if (props.fit) useResizeObserver(table.vnode.el, resizeListener);
  45104. else useEventListener(window, "resize", resizeListener);
  45105. useResizeObserver(table.refs.tableInnerWrapper, () => {
  45106. resizeListener();
  45107. table.refs?.scrollBarRef?.update();
  45108. });
  45109. };
  45110. const resizeListener = () => {
  45111. const el = table.vnode.el;
  45112. if (!table.$ready || !el) return;
  45113. let shouldUpdateLayout = false;
  45114. const { width: oldWidth, height: oldHeight, headerHeight: oldHeaderHeight } = resizeState.value;
  45115. const width = tableWidth.value = el.offsetWidth;
  45116. if (oldWidth !== width) shouldUpdateLayout = true;
  45117. const height = el.offsetHeight;
  45118. if ((props.height || shouldUpdateHeight.value) && oldHeight !== height) shouldUpdateLayout = true;
  45119. const tableHeader = props.tableLayout === "fixed" ? table.refs.headerWrapper : table.refs.tableHeaderRef?.$el;
  45120. if (props.showHeader && tableHeader?.offsetHeight !== oldHeaderHeight) shouldUpdateLayout = true;
  45121. tableScrollHeight.value = table.refs.tableWrapper?.scrollHeight || 0;
  45122. headerScrollHeight.value = tableHeader?.scrollHeight || 0;
  45123. footerScrollHeight.value = table.refs.footerWrapper?.offsetHeight || 0;
  45124. appendScrollHeight.value = table.refs.appendWrapper?.offsetHeight || 0;
  45125. bodyScrollHeight.value = tableScrollHeight.value - headerScrollHeight.value - footerScrollHeight.value - appendScrollHeight.value;
  45126. if (shouldUpdateLayout) {
  45127. resizeState.value = {
  45128. width,
  45129. height,
  45130. headerHeight: props.showHeader && tableHeader?.offsetHeight || 0
  45131. };
  45132. doLayout();
  45133. }
  45134. };
  45135. const tableSize = useFormSize();
  45136. const bodyWidth = (0, vue.computed)(() => {
  45137. const { bodyWidth: bodyWidth_, scrollY, gutterWidth } = layout;
  45138. return bodyWidth_.value ? `${bodyWidth_.value - (scrollY.value ? gutterWidth : 0)}px` : "";
  45139. });
  45140. const tableLayout = (0, vue.computed)(() => {
  45141. if (props.maxHeight) return "fixed";
  45142. return props.tableLayout;
  45143. });
  45144. return {
  45145. isHidden,
  45146. renderExpanded,
  45147. setDragVisible,
  45148. isGroup,
  45149. handleMouseLeave,
  45150. handleHeaderFooterMousewheel,
  45151. tableSize,
  45152. emptyBlockStyle: (0, vue.computed)(() => {
  45153. if (props.data && props.data.length) return;
  45154. let height = "100%";
  45155. if (props.height && bodyScrollHeight.value) height = `${bodyScrollHeight.value}px`;
  45156. const width = tableWidth.value;
  45157. return {
  45158. width: width ? `${width}px` : "",
  45159. height
  45160. };
  45161. }),
  45162. resizeProxyVisible,
  45163. bodyWidth,
  45164. resizeState,
  45165. doLayout,
  45166. tableBodyStyles,
  45167. tableLayout,
  45168. scrollbarViewStyle,
  45169. scrollbarStyle: (0, vue.computed)(() => {
  45170. if (props.height) return { height: "100%" };
  45171. if (props.maxHeight) if (!Number.isNaN(Number(props.maxHeight))) return { maxHeight: `${+props.maxHeight - headerScrollHeight.value - footerScrollHeight.value}px` };
  45172. else return { maxHeight: `calc(${props.maxHeight} - ${headerScrollHeight.value + footerScrollHeight.value}px)` };
  45173. return {};
  45174. })
  45175. };
  45176. }
  45177. //#endregion
  45178. //#region ../../packages/components/table/src/table/key-render-helper.ts
  45179. function useKeyRender(table) {
  45180. let observer;
  45181. const initWatchDom = () => {
  45182. const columnsWrapper = table.vnode.el.querySelector(".hidden-columns");
  45183. const config = {
  45184. childList: true,
  45185. subtree: true
  45186. };
  45187. const updateOrderFns = table.store.states.updateOrderFns;
  45188. observer = new MutationObserver(() => {
  45189. updateOrderFns.forEach((fn) => fn());
  45190. });
  45191. observer.observe(columnsWrapper, config);
  45192. };
  45193. (0, vue.onMounted)(() => {
  45194. initWatchDom();
  45195. });
  45196. (0, vue.onUnmounted)(() => {
  45197. observer?.disconnect();
  45198. });
  45199. }
  45200. //#endregion
  45201. //#region ../../packages/components/table/src/table/defaults.ts
  45202. var defaults_default$2 = {
  45203. data: {
  45204. type: Array,
  45205. default: () => []
  45206. },
  45207. size: useSizeProp,
  45208. width: [String, Number],
  45209. height: [String, Number],
  45210. maxHeight: [String, Number],
  45211. fit: {
  45212. type: Boolean,
  45213. default: true
  45214. },
  45215. stripe: Boolean,
  45216. border: Boolean,
  45217. rowKey: [String, Function],
  45218. showHeader: {
  45219. type: Boolean,
  45220. default: true
  45221. },
  45222. showSummary: Boolean,
  45223. sumText: String,
  45224. summaryMethod: Function,
  45225. rowClassName: [String, Function],
  45226. rowStyle: [Object, Function],
  45227. cellClassName: [String, Function],
  45228. cellStyle: [Object, Function],
  45229. headerRowClassName: [String, Function],
  45230. headerRowStyle: [Object, Function],
  45231. headerCellClassName: [String, Function],
  45232. headerCellStyle: [Object, Function],
  45233. highlightCurrentRow: Boolean,
  45234. currentRowKey: [String, Number],
  45235. emptyText: String,
  45236. expandRowKeys: Array,
  45237. defaultExpandAll: Boolean,
  45238. rowExpandable: { type: Function },
  45239. defaultSort: Object,
  45240. tooltipEffect: String,
  45241. tooltipOptions: Object,
  45242. spanMethod: Function,
  45243. selectOnIndeterminate: {
  45244. type: Boolean,
  45245. default: true
  45246. },
  45247. indent: {
  45248. type: Number,
  45249. default: 16
  45250. },
  45251. treeProps: {
  45252. type: Object,
  45253. default: () => {
  45254. return {
  45255. hasChildren: "hasChildren",
  45256. children: "children",
  45257. checkStrictly: false
  45258. };
  45259. }
  45260. },
  45261. lazy: Boolean,
  45262. load: Function,
  45263. style: {
  45264. type: [
  45265. String,
  45266. Object,
  45267. Array
  45268. ],
  45269. default: () => ({})
  45270. },
  45271. className: {
  45272. type: String,
  45273. default: ""
  45274. },
  45275. tableLayout: {
  45276. type: String,
  45277. default: "fixed"
  45278. },
  45279. scrollbarAlwaysOn: Boolean,
  45280. flexible: Boolean,
  45281. showOverflowTooltip: {
  45282. type: [Boolean, Object],
  45283. default: void 0
  45284. },
  45285. tooltipFormatter: Function,
  45286. appendFilterPanelTo: String,
  45287. scrollbarTabindex: {
  45288. type: [Number, String],
  45289. default: void 0
  45290. },
  45291. allowDragLastColumn: {
  45292. type: Boolean,
  45293. default: true
  45294. },
  45295. preserveExpandedContent: Boolean,
  45296. nativeScrollbar: Boolean
  45297. };
  45298. //#endregion
  45299. //#region ../../packages/components/table/src/h-helper.ts
  45300. function hColgroup(props) {
  45301. const isAuto = props.tableLayout === "auto";
  45302. let columns = props.columns || [];
  45303. if (isAuto) {
  45304. if (columns.every(({ width }) => isUndefined(width))) columns = [];
  45305. }
  45306. const getPropsData = (column) => {
  45307. const propsData = {
  45308. key: `${props.tableLayout}_${column.id}`,
  45309. style: {},
  45310. name: void 0
  45311. };
  45312. if (isAuto) propsData.style = { width: `${column.width}px` };
  45313. else propsData.name = column.id;
  45314. return propsData;
  45315. };
  45316. return (0, vue.h)("colgroup", {}, columns.map((column) => (0, vue.h)("col", getPropsData(column))));
  45317. }
  45318. hColgroup.props = ["columns", "tableLayout"];
  45319. //#endregion
  45320. //#region ../../packages/components/table/src/composables/use-scrollbar.ts
  45321. const useScrollbar$1 = () => {
  45322. const scrollBarRef = (0, vue.ref)();
  45323. const scrollTo = (options, yCoord) => {
  45324. const scrollbar = scrollBarRef.value;
  45325. if (scrollbar) scrollbar.scrollTo(options, yCoord);
  45326. };
  45327. const setScrollPosition = (position, offset) => {
  45328. const scrollbar = scrollBarRef.value;
  45329. if (scrollbar && isNumber(offset) && ["Top", "Left"].includes(position)) scrollbar[`setScroll${position}`](offset);
  45330. };
  45331. const setScrollTop = (top) => setScrollPosition("Top", top);
  45332. const setScrollLeft = (left) => setScrollPosition("Left", left);
  45333. return {
  45334. scrollBarRef,
  45335. scrollTo,
  45336. setScrollTop,
  45337. setScrollLeft
  45338. };
  45339. };
  45340. //#endregion
  45341. //#region ../../packages/components/table/src/table.vue?vue&type=script&lang.ts
  45342. let tableIdSeed = 1;
  45343. var table_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  45344. name: "ElTable",
  45345. directives: { Mousewheel },
  45346. components: {
  45347. TableHeader: table_header_default,
  45348. TableBody: table_body_default,
  45349. TableFooter: table_footer_default,
  45350. ElScrollbar,
  45351. hColgroup
  45352. },
  45353. props: defaults_default$2,
  45354. emits: [
  45355. "select",
  45356. "select-all",
  45357. "selection-change",
  45358. "cell-mouse-enter",
  45359. "cell-mouse-leave",
  45360. "cell-contextmenu",
  45361. "cell-click",
  45362. "cell-dblclick",
  45363. "row-click",
  45364. "row-contextmenu",
  45365. "row-dblclick",
  45366. "header-click",
  45367. "header-contextmenu",
  45368. "sort-change",
  45369. "filter-change",
  45370. "current-change",
  45371. "header-dragend",
  45372. "expand-change",
  45373. "scroll"
  45374. ],
  45375. setup(props) {
  45376. const { t } = useLocale();
  45377. const ns = useNamespace("table");
  45378. const globalConfig = useGlobalConfig("table");
  45379. const table = (0, vue.getCurrentInstance)();
  45380. (0, vue.provide)(TABLE_INJECTION_KEY, table);
  45381. const store = createStore(table, props);
  45382. table.store = store;
  45383. const layout = new TableLayout({
  45384. store: table.store,
  45385. table,
  45386. fit: props.fit,
  45387. showHeader: props.showHeader
  45388. });
  45389. table.layout = layout;
  45390. const isEmpty = (0, vue.computed)(() => (store.states.data.value || []).length === 0);
  45391. /**
  45392. * open functions
  45393. */
  45394. const { setCurrentRow, getSelectionRows, toggleRowSelection, clearSelection, clearFilter, toggleAllSelection, toggleRowExpansion, clearSort, sort, updateKeyChildren } = useUtils(store);
  45395. const { isHidden, renderExpanded, setDragVisible, isGroup, handleMouseLeave, handleHeaderFooterMousewheel, tableSize, emptyBlockStyle, resizeProxyVisible, bodyWidth, resizeState, doLayout, tableBodyStyles, tableLayout, scrollbarViewStyle, scrollbarStyle } = useStyle(props, layout, store, table);
  45396. const { scrollBarRef, scrollTo, setScrollLeft, setScrollTop } = useScrollbar$1();
  45397. const debouncedUpdateLayout = debounce(doLayout, 50);
  45398. const tableId = `${ns.namespace.value}-table_${tableIdSeed++}`;
  45399. table.tableId = tableId;
  45400. table.state = {
  45401. isGroup,
  45402. resizeState,
  45403. doLayout,
  45404. debouncedUpdateLayout
  45405. };
  45406. const computedSumText = (0, vue.computed)(() => props.sumText ?? t("el.table.sumText"));
  45407. const computedEmptyText = (0, vue.computed)(() => {
  45408. return props.emptyText ?? t("el.table.emptyText");
  45409. });
  45410. const computedTooltipEffect = (0, vue.computed)(() => props.tooltipEffect ?? globalConfig.value?.tooltipEffect);
  45411. const computedTooltipOptions = (0, vue.computed)(() => props.tooltipOptions ?? globalConfig.value?.tooltipOptions);
  45412. const columns = (0, vue.computed)(() => {
  45413. return convertToRows(store.states.originColumns.value)[0];
  45414. });
  45415. useKeyRender(table);
  45416. (0, vue.onBeforeUnmount)(() => {
  45417. debouncedUpdateLayout.cancel();
  45418. });
  45419. return {
  45420. ns,
  45421. layout,
  45422. store,
  45423. columns,
  45424. handleHeaderFooterMousewheel,
  45425. handleMouseLeave,
  45426. tableId,
  45427. tableSize,
  45428. isHidden,
  45429. isEmpty,
  45430. renderExpanded,
  45431. resizeProxyVisible,
  45432. resizeState,
  45433. isGroup,
  45434. bodyWidth,
  45435. tableBodyStyles,
  45436. emptyBlockStyle,
  45437. debouncedUpdateLayout,
  45438. setCurrentRow,
  45439. getSelectionRows,
  45440. toggleRowSelection,
  45441. clearSelection,
  45442. clearFilter,
  45443. toggleAllSelection,
  45444. toggleRowExpansion,
  45445. clearSort,
  45446. doLayout,
  45447. sort,
  45448. updateKeyChildren,
  45449. t,
  45450. setDragVisible,
  45451. context: table,
  45452. computedSumText,
  45453. computedEmptyText,
  45454. computedTooltipEffect,
  45455. computedTooltipOptions,
  45456. tableLayout,
  45457. scrollbarViewStyle,
  45458. scrollbarStyle,
  45459. scrollBarRef,
  45460. scrollTo,
  45461. setScrollLeft,
  45462. setScrollTop,
  45463. allowDragLastColumn: props.allowDragLastColumn
  45464. };
  45465. }
  45466. });
  45467. //#endregion
  45468. //#region ../../packages/components/table/src/table.vue
  45469. const _hoisted_1$15 = ["data-prefix"];
  45470. const _hoisted_2$9 = {
  45471. ref: "hiddenColumns",
  45472. class: "hidden-columns"
  45473. };
  45474. function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
  45475. const _component_hColgroup = (0, vue.resolveComponent)("hColgroup");
  45476. const _component_table_header = (0, vue.resolveComponent)("table-header");
  45477. const _component_table_body = (0, vue.resolveComponent)("table-body");
  45478. const _component_table_footer = (0, vue.resolveComponent)("table-footer");
  45479. const _component_el_scrollbar = (0, vue.resolveComponent)("el-scrollbar");
  45480. const _directive_mousewheel = (0, vue.resolveDirective)("mousewheel");
  45481. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45482. ref: "tableWrapper",
  45483. class: (0, vue.normalizeClass)([
  45484. {
  45485. [_ctx.ns.m("fit")]: _ctx.fit,
  45486. [_ctx.ns.m("striped")]: _ctx.stripe,
  45487. [_ctx.ns.m("border")]: _ctx.border || _ctx.isGroup,
  45488. [_ctx.ns.m("hidden")]: _ctx.isHidden,
  45489. [_ctx.ns.m("group")]: _ctx.isGroup,
  45490. [_ctx.ns.m("fluid-height")]: _ctx.maxHeight,
  45491. [_ctx.ns.m("scrollable-x")]: _ctx.layout.scrollX.value,
  45492. [_ctx.ns.m("scrollable-y")]: _ctx.layout.scrollY.value,
  45493. [_ctx.ns.m("enable-row-hover")]: !_ctx.store.states.isComplex.value,
  45494. [_ctx.ns.m("enable-row-transition")]: (_ctx.store.states.data.value || []).length !== 0 && (_ctx.store.states.data.value || []).length < 100,
  45495. "has-footer": _ctx.showSummary
  45496. },
  45497. _ctx.ns.m(_ctx.tableSize),
  45498. _ctx.className,
  45499. _ctx.ns.b(),
  45500. _ctx.ns.m(`layout-${_ctx.tableLayout}`)
  45501. ]),
  45502. style: (0, vue.normalizeStyle)(_ctx.style),
  45503. "data-prefix": _ctx.ns.namespace.value,
  45504. onMouseleave: _cache[1] || (_cache[1] = (...args) => _ctx.handleMouseLeave && _ctx.handleMouseLeave(...args))
  45505. }, [(0, vue.createElementVNode)("div", {
  45506. ref: "tableInnerWrapper",
  45507. class: (0, vue.normalizeClass)(_ctx.ns.e("inner-wrapper"))
  45508. }, [
  45509. (0, vue.createElementVNode)("div", _hoisted_2$9, [(0, vue.renderSlot)(_ctx.$slots, "default")], 512),
  45510. _ctx.showHeader && _ctx.tableLayout === "fixed" ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45511. key: 0,
  45512. ref: "headerWrapper",
  45513. class: (0, vue.normalizeClass)(_ctx.ns.e("header-wrapper"))
  45514. }, [(0, vue.createElementVNode)("table", {
  45515. ref: "tableHeader",
  45516. class: (0, vue.normalizeClass)(_ctx.ns.e("header")),
  45517. style: (0, vue.normalizeStyle)(_ctx.tableBodyStyles),
  45518. border: "0",
  45519. cellpadding: "0",
  45520. cellspacing: "0"
  45521. }, [(0, vue.createVNode)(_component_hColgroup, {
  45522. columns: _ctx.store.states.columns.value,
  45523. "table-layout": _ctx.tableLayout
  45524. }, null, 8, ["columns", "table-layout"]), (0, vue.createVNode)(_component_table_header, {
  45525. ref: "tableHeaderRef",
  45526. border: _ctx.border,
  45527. "default-sort": _ctx.defaultSort,
  45528. store: _ctx.store,
  45529. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  45530. "allow-drag-last-column": _ctx.allowDragLastColumn,
  45531. onSetDragVisible: _ctx.setDragVisible
  45532. }, null, 8, [
  45533. "border",
  45534. "default-sort",
  45535. "store",
  45536. "append-filter-panel-to",
  45537. "allow-drag-last-column",
  45538. "onSetDragVisible"
  45539. ])], 6)], 2)), [[_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : (0, vue.createCommentVNode)("v-if", true),
  45540. (0, vue.createElementVNode)("div", {
  45541. ref: "bodyWrapper",
  45542. class: (0, vue.normalizeClass)(_ctx.ns.e("body-wrapper"))
  45543. }, [(0, vue.createVNode)(_component_el_scrollbar, {
  45544. ref: "scrollBarRef",
  45545. "view-style": _ctx.scrollbarViewStyle,
  45546. "wrap-style": _ctx.scrollbarStyle,
  45547. always: _ctx.scrollbarAlwaysOn,
  45548. tabindex: _ctx.scrollbarTabindex,
  45549. native: _ctx.nativeScrollbar,
  45550. onScroll: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("scroll", $event))
  45551. }, {
  45552. default: (0, vue.withCtx)(() => [
  45553. (0, vue.createElementVNode)("table", {
  45554. ref: "tableBody",
  45555. class: (0, vue.normalizeClass)(_ctx.ns.e("body")),
  45556. cellspacing: "0",
  45557. cellpadding: "0",
  45558. border: "0",
  45559. style: (0, vue.normalizeStyle)({
  45560. width: _ctx.bodyWidth,
  45561. tableLayout: _ctx.tableLayout
  45562. })
  45563. }, [
  45564. (0, vue.createVNode)(_component_hColgroup, {
  45565. columns: _ctx.store.states.columns.value,
  45566. "table-layout": _ctx.tableLayout
  45567. }, null, 8, ["columns", "table-layout"]),
  45568. _ctx.showHeader && _ctx.tableLayout === "auto" ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_table_header, {
  45569. key: 0,
  45570. ref: "tableHeaderRef",
  45571. class: (0, vue.normalizeClass)(_ctx.ns.e("body-header")),
  45572. border: _ctx.border,
  45573. "default-sort": _ctx.defaultSort,
  45574. store: _ctx.store,
  45575. "append-filter-panel-to": _ctx.appendFilterPanelTo,
  45576. onSetDragVisible: _ctx.setDragVisible
  45577. }, null, 8, [
  45578. "class",
  45579. "border",
  45580. "default-sort",
  45581. "store",
  45582. "append-filter-panel-to",
  45583. "onSetDragVisible"
  45584. ])) : (0, vue.createCommentVNode)("v-if", true),
  45585. (0, vue.createVNode)(_component_table_body, {
  45586. context: _ctx.context,
  45587. highlight: _ctx.highlightCurrentRow,
  45588. "row-class-name": _ctx.rowClassName,
  45589. "tooltip-effect": _ctx.computedTooltipEffect,
  45590. "tooltip-options": _ctx.computedTooltipOptions,
  45591. "row-style": _ctx.rowStyle,
  45592. store: _ctx.store,
  45593. stripe: _ctx.stripe
  45594. }, null, 8, [
  45595. "context",
  45596. "highlight",
  45597. "row-class-name",
  45598. "tooltip-effect",
  45599. "tooltip-options",
  45600. "row-style",
  45601. "store",
  45602. "stripe"
  45603. ]),
  45604. _ctx.showSummary && _ctx.tableLayout === "auto" ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_table_footer, {
  45605. key: 1,
  45606. class: (0, vue.normalizeClass)(_ctx.ns.e("body-footer")),
  45607. border: _ctx.border,
  45608. "default-sort": _ctx.defaultSort,
  45609. store: _ctx.store,
  45610. "sum-text": _ctx.computedSumText,
  45611. "summary-method": _ctx.summaryMethod
  45612. }, null, 8, [
  45613. "class",
  45614. "border",
  45615. "default-sort",
  45616. "store",
  45617. "sum-text",
  45618. "summary-method"
  45619. ])) : (0, vue.createCommentVNode)("v-if", true)
  45620. ], 6),
  45621. _ctx.isEmpty ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45622. key: 0,
  45623. ref: "emptyBlock",
  45624. style: (0, vue.normalizeStyle)(_ctx.emptyBlockStyle),
  45625. class: (0, vue.normalizeClass)(_ctx.ns.e("empty-block"))
  45626. }, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.ns.e("empty-text")) }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.computedEmptyText), 1)])], 2)], 6)) : (0, vue.createCommentVNode)("v-if", true),
  45627. _ctx.$slots.append ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45628. key: 1,
  45629. ref: "appendWrapper",
  45630. class: (0, vue.normalizeClass)(_ctx.ns.e("append-wrapper"))
  45631. }, [(0, vue.renderSlot)(_ctx.$slots, "append")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  45632. ]),
  45633. _: 3
  45634. }, 8, [
  45635. "view-style",
  45636. "wrap-style",
  45637. "always",
  45638. "tabindex",
  45639. "native"
  45640. ])], 2),
  45641. _ctx.showSummary && _ctx.tableLayout === "fixed" ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45642. key: 1,
  45643. ref: "footerWrapper",
  45644. class: (0, vue.normalizeClass)(_ctx.ns.e("footer-wrapper"))
  45645. }, [(0, vue.createElementVNode)("table", {
  45646. class: (0, vue.normalizeClass)(_ctx.ns.e("footer")),
  45647. cellspacing: "0",
  45648. cellpadding: "0",
  45649. border: "0",
  45650. style: (0, vue.normalizeStyle)(_ctx.tableBodyStyles)
  45651. }, [(0, vue.createVNode)(_component_hColgroup, {
  45652. columns: _ctx.store.states.columns.value,
  45653. "table-layout": _ctx.tableLayout
  45654. }, null, 8, ["columns", "table-layout"]), (0, vue.createVNode)(_component_table_footer, {
  45655. border: _ctx.border,
  45656. "default-sort": _ctx.defaultSort,
  45657. store: _ctx.store,
  45658. "sum-text": _ctx.computedSumText,
  45659. "summary-method": _ctx.summaryMethod
  45660. }, null, 8, [
  45661. "border",
  45662. "default-sort",
  45663. "store",
  45664. "sum-text",
  45665. "summary-method"
  45666. ])], 6)], 2)), [[vue.vShow, !_ctx.isEmpty], [_directive_mousewheel, _ctx.handleHeaderFooterMousewheel]]) : (0, vue.createCommentVNode)("v-if", true),
  45667. _ctx.border || _ctx.isGroup ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  45668. key: 2,
  45669. class: (0, vue.normalizeClass)(_ctx.ns.e("border-left-patch"))
  45670. }, null, 2)) : (0, vue.createCommentVNode)("v-if", true)
  45671. ], 2), (0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  45672. ref: "resizeProxy",
  45673. class: (0, vue.normalizeClass)(_ctx.ns.e("column-resize-proxy"))
  45674. }, null, 2), [[vue.vShow, _ctx.resizeProxyVisible]])], 46, _hoisted_1$15);
  45675. }
  45676. var table_default = /* @__PURE__ */ _plugin_vue_export_helper_default(table_vue_vue_type_script_lang_default, [["render", _sfc_render$3]]);
  45677. //#endregion
  45678. //#region ../../packages/components/table/src/config.ts
  45679. const defaultClassNames = {
  45680. selection: "table-column--selection",
  45681. expand: "table__expand-column"
  45682. };
  45683. const cellStarts = {
  45684. default: { order: "" },
  45685. selection: {
  45686. width: 48,
  45687. minWidth: 48,
  45688. realWidth: 48,
  45689. order: ""
  45690. },
  45691. expand: {
  45692. width: 48,
  45693. minWidth: 48,
  45694. realWidth: 48,
  45695. order: ""
  45696. },
  45697. index: {
  45698. width: 48,
  45699. minWidth: 48,
  45700. realWidth: 48,
  45701. order: ""
  45702. }
  45703. };
  45704. const getDefaultClassName = (type) => {
  45705. return defaultClassNames[type] || "";
  45706. };
  45707. const cellForced = {
  45708. selection: {
  45709. renderHeader({ store }) {
  45710. function isDisabled() {
  45711. return store.states.data.value && store.states.data.value.length === 0;
  45712. }
  45713. return (0, vue.h)(ElCheckbox, {
  45714. disabled: isDisabled(),
  45715. size: store.states.tableSize.value,
  45716. indeterminate: store.states.selection.value.length > 0 && !store.states.isAllSelected.value,
  45717. "onUpdate:modelValue": store.toggleAllSelection ?? void 0,
  45718. modelValue: store.states.isAllSelected.value,
  45719. ariaLabel: store.t("el.table.selectAllLabel")
  45720. });
  45721. },
  45722. renderCell({ row, column, store, $index }) {
  45723. return (0, vue.h)(ElCheckbox, {
  45724. disabled: column.selectable ? !column.selectable.call(null, row, $index) : false,
  45725. size: store.states.tableSize.value,
  45726. onChange: () => {
  45727. store.commit("rowSelectedChanged", row);
  45728. },
  45729. onClick: (event) => event.stopPropagation(),
  45730. modelValue: store.isSelected(row),
  45731. ariaLabel: store.t("el.table.selectRowLabel")
  45732. });
  45733. },
  45734. sortable: false,
  45735. resizable: false
  45736. },
  45737. index: {
  45738. renderHeader({ column }) {
  45739. return column.label || "#";
  45740. },
  45741. renderCell({ column, $index }) {
  45742. let i = $index + 1;
  45743. const index = column.index;
  45744. if (isNumber(index)) i = $index + index;
  45745. else if (isFunction$1(index)) i = index($index);
  45746. return (0, vue.h)("div", {}, [i]);
  45747. },
  45748. sortable: false
  45749. },
  45750. expand: {
  45751. renderHeader({ column }) {
  45752. return column.label || "";
  45753. },
  45754. renderCell({ column, row, store, expanded, $index }) {
  45755. const { ns } = store;
  45756. const classes = [ns.e("expand-icon")];
  45757. if (!column.renderExpand && expanded) classes.push(ns.em("expand-icon", "expanded"));
  45758. const callback = function(e) {
  45759. e.stopPropagation();
  45760. store.toggleRowExpansion(row);
  45761. };
  45762. const isRowExpandable = store.states.rowExpandable.value?.(row, $index) ?? true;
  45763. if (!isRowExpandable) classes.push(ns.is("disabled"));
  45764. return (0, vue.h)("button", {
  45765. type: "button",
  45766. disabled: !isRowExpandable,
  45767. "aria-label": store.t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  45768. "aria-expanded": expanded,
  45769. class: classes,
  45770. onClick: callback
  45771. }, { default: () => {
  45772. if (column.renderExpand) return [column.renderExpand({
  45773. expanded,
  45774. expandable: isRowExpandable
  45775. })];
  45776. return [(0, vue.h)(ElIcon, null, { default: () => {
  45777. return [(0, vue.h)(arrow_right_default)];
  45778. } })];
  45779. } });
  45780. },
  45781. sortable: false,
  45782. resizable: false
  45783. }
  45784. };
  45785. function defaultRenderCell({ row, column, $index }) {
  45786. const property = column.property;
  45787. const value = property && getProp(row, property).value;
  45788. if (column && column.formatter) return column.formatter(row, column, value, $index);
  45789. return value?.toString?.() || "";
  45790. }
  45791. function treeCellPrefix({ row, treeNode, store }, createPlaceholder = false) {
  45792. const { ns } = store;
  45793. if (!treeNode) {
  45794. if (createPlaceholder) return [(0, vue.h)("span", { class: ns.e("placeholder") })];
  45795. return null;
  45796. }
  45797. const ele = [];
  45798. const callback = function(e) {
  45799. e.stopPropagation();
  45800. if (treeNode.loading) return;
  45801. store.loadOrToggle(row);
  45802. };
  45803. if (treeNode.indent) ele.push((0, vue.h)("span", {
  45804. class: ns.e("indent"),
  45805. style: { "padding-left": `${treeNode.indent}px` }
  45806. }));
  45807. if (isBoolean(treeNode.expanded) && !treeNode.noLazyChildren) {
  45808. const expandClasses = [ns.e("expand-icon"), treeNode.expanded ? ns.em("expand-icon", "expanded") : ""];
  45809. let icon = arrow_right_default;
  45810. if (treeNode.loading) icon = loading_default;
  45811. ele.push((0, vue.h)("button", {
  45812. type: "button",
  45813. "aria-label": store.t(treeNode.expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  45814. "aria-expanded": treeNode.expanded,
  45815. class: expandClasses,
  45816. onClick: callback
  45817. }, { default: () => {
  45818. return [(0, vue.h)(ElIcon, { class: ns.is("loading", treeNode.loading) }, { default: () => [(0, vue.h)(icon)] })];
  45819. } }));
  45820. } else ele.push((0, vue.h)("span", { class: ns.e("placeholder") }));
  45821. return ele;
  45822. }
  45823. //#endregion
  45824. //#region ../../packages/components/table/src/table-column/watcher-helper.ts
  45825. function getAllAliases(props, aliases) {
  45826. return props.reduce((prev, cur) => {
  45827. prev[cur] = cur;
  45828. return prev;
  45829. }, aliases);
  45830. }
  45831. function useWatcher(owner, props_) {
  45832. const instance = (0, vue.getCurrentInstance)();
  45833. const registerComplexWatchers = () => {
  45834. const props = ["fixed"];
  45835. const aliases = {
  45836. realWidth: "width",
  45837. realMinWidth: "minWidth"
  45838. };
  45839. const allAliases = getAllAliases(props, aliases);
  45840. Object.keys(allAliases).forEach((key) => {
  45841. const columnKey = aliases[key];
  45842. if (hasOwn(props_, columnKey)) (0, vue.watch)(() => props_[columnKey], (newVal) => {
  45843. let value = newVal;
  45844. if (columnKey === "width" && key === "realWidth") value = parseWidth(newVal);
  45845. if (columnKey === "minWidth" && key === "realMinWidth") value = parseMinWidth(newVal);
  45846. instance.columnConfig.value[columnKey] = value;
  45847. instance.columnConfig.value[key] = value;
  45848. const updateColumns = columnKey === "fixed";
  45849. owner.value.store.scheduleLayout(updateColumns);
  45850. });
  45851. });
  45852. };
  45853. const registerNormalWatchers = () => {
  45854. const props = [
  45855. "label",
  45856. "filters",
  45857. "filterMultiple",
  45858. "filteredValue",
  45859. "sortable",
  45860. "index",
  45861. "formatter",
  45862. "className",
  45863. "labelClassName",
  45864. "filterClassName",
  45865. "showOverflowTooltip",
  45866. "tooltipFormatter",
  45867. "resizable"
  45868. ];
  45869. const parentProps = ["showOverflowTooltip"];
  45870. const aliases = {
  45871. property: "prop",
  45872. align: "realAlign",
  45873. headerAlign: "realHeaderAlign"
  45874. };
  45875. const allAliases = getAllAliases(props, aliases);
  45876. Object.keys(allAliases).forEach((key) => {
  45877. const columnKey = aliases[key];
  45878. if (hasOwn(props_, columnKey)) (0, vue.watch)(() => props_[columnKey], (newVal) => {
  45879. instance.columnConfig.value[key] = newVal;
  45880. if (key === "filters" || key === "filterMethod") instance.columnConfig.value["filterable"] = !!(instance.columnConfig.value["filters"] || instance.columnConfig.value["filterMethod"]);
  45881. });
  45882. });
  45883. parentProps.forEach((key) => {
  45884. if (hasOwn(owner.value.props, key)) (0, vue.watch)(() => owner.value.props[key], (newVal) => {
  45885. if (instance.columnConfig.value.type === "selection") return;
  45886. if (!isUndefined(props_[key])) return;
  45887. instance.columnConfig.value[key] = newVal;
  45888. });
  45889. });
  45890. const globalConfig = useGlobalConfig("table");
  45891. if (globalConfig.value && hasOwn(globalConfig.value, "showOverflowTooltip")) (0, vue.watch)(() => globalConfig.value?.showOverflowTooltip, (newVal) => {
  45892. if (instance.columnConfig.value.type === "selection") return;
  45893. if (!isUndefined(props_.showOverflowTooltip) || !isUndefined(owner.value.props.showOverflowTooltip)) return;
  45894. instance.columnConfig.value.showOverflowTooltip = newVal;
  45895. });
  45896. };
  45897. return {
  45898. registerComplexWatchers,
  45899. registerNormalWatchers
  45900. };
  45901. }
  45902. //#endregion
  45903. //#region ../../packages/components/table/src/table-column/render-helper.ts
  45904. function useRender(props, slots, owner) {
  45905. const instance = (0, vue.getCurrentInstance)();
  45906. const columnId = (0, vue.ref)("");
  45907. const isSubColumn = (0, vue.ref)(false);
  45908. const realAlign = (0, vue.ref)();
  45909. const realHeaderAlign = (0, vue.ref)();
  45910. const ns = useNamespace("table");
  45911. (0, vue.watchEffect)(() => {
  45912. realAlign.value = props.align ? `is-${props.align}` : null;
  45913. realAlign.value;
  45914. });
  45915. (0, vue.watchEffect)(() => {
  45916. realHeaderAlign.value = props.headerAlign ? `is-${props.headerAlign}` : realAlign.value;
  45917. realHeaderAlign.value;
  45918. });
  45919. const columnOrTableParent = (0, vue.computed)(() => {
  45920. let parent = instance.vnode.vParent || instance.parent;
  45921. while (parent && !parent.tableId && !parent.columnId) parent = parent.vnode.vParent || parent.parent;
  45922. return parent;
  45923. });
  45924. const hasTreeColumn = (0, vue.computed)(() => {
  45925. const { store } = instance.parent;
  45926. if (!store) return false;
  45927. const { treeData } = store.states;
  45928. const treeDataValue = treeData.value;
  45929. return treeDataValue && Object.keys(treeDataValue).length > 0;
  45930. });
  45931. const realWidth = (0, vue.ref)(parseWidth(props.width));
  45932. const realMinWidth = (0, vue.ref)(parseMinWidth(props.minWidth));
  45933. const setColumnWidth = (column) => {
  45934. if (realWidth.value) column.width = realWidth.value;
  45935. if (realMinWidth.value) column.minWidth = realMinWidth.value;
  45936. if (!realWidth.value && realMinWidth.value) column.width = void 0;
  45937. if (!column.minWidth) column.minWidth = 80;
  45938. column.realWidth = Number(isUndefined(column.width) ? column.minWidth : column.width);
  45939. return column;
  45940. };
  45941. const setColumnForcedProps = (column) => {
  45942. const type = column.type;
  45943. const source = cellForced[type] || {};
  45944. Object.keys(source).forEach((prop) => {
  45945. const value = source[prop];
  45946. if (prop !== "className" && !isUndefined(value)) column[prop] = value;
  45947. });
  45948. const className = getDefaultClassName(type);
  45949. if (className) {
  45950. const forceClass = `${(0, vue.unref)(ns.namespace)}-${className}`;
  45951. column.className = column.className ? `${column.className} ${forceClass}` : forceClass;
  45952. }
  45953. return column;
  45954. };
  45955. const checkSubColumn = (children) => {
  45956. if (isArray$1(children)) children.forEach((child) => check(child));
  45957. else check(children);
  45958. function check(item) {
  45959. if (item?.type?.name === "ElTableColumn") item.vParent = instance;
  45960. }
  45961. };
  45962. const setColumnRenders = (column) => {
  45963. if (props.renderHeader) /* @__PURE__ */ debugWarn("TableColumn", "Comparing to render-header, scoped-slot header is easier to use. We recommend users to use scoped-slot header.");
  45964. else if (column.type !== "selection") column.renderHeader = (scope) => {
  45965. instance.columnConfig.value["label"];
  45966. if (slots.header) {
  45967. const slotResult = slots.header(scope);
  45968. if (ensureValidVNode(slotResult)) return (0, vue.h)(vue.Fragment, slotResult);
  45969. }
  45970. return (0, vue.createTextVNode)(column.label);
  45971. };
  45972. if (slots["filter-icon"]) column.renderFilterIcon = (scope) => {
  45973. return (0, vue.renderSlot)(slots, "filter-icon", scope);
  45974. };
  45975. if (slots.expand) column.renderExpand = (scope) => {
  45976. return (0, vue.renderSlot)(slots, "expand", scope);
  45977. };
  45978. let originRenderCell = column.renderCell;
  45979. if (column.type === "expand") {
  45980. column.renderCell = (data) => (0, vue.h)("div", { class: "cell" }, [originRenderCell(data)]);
  45981. owner.value.renderExpanded = (row) => {
  45982. return slots.default ? slots.default(row) : slots.default;
  45983. };
  45984. } else {
  45985. originRenderCell = originRenderCell || defaultRenderCell;
  45986. column.renderCell = (data) => {
  45987. let children = null;
  45988. if (slots.default) {
  45989. const vnodes = slots.default(data);
  45990. children = vnodes.some((v) => v.type !== vue.Comment) ? vnodes : originRenderCell(data);
  45991. } else children = originRenderCell(data);
  45992. const { columns } = owner.value.store.states;
  45993. const firstUserColumnIndex = columns.value.findIndex((item) => item.type === "default");
  45994. const prefix = treeCellPrefix(data, hasTreeColumn.value && data.cellIndex === firstUserColumnIndex);
  45995. const props = {
  45996. class: "cell",
  45997. style: {}
  45998. };
  45999. if (column.showOverflowTooltip) {
  46000. props.class = `${props.class} ${(0, vue.unref)(ns.namespace)}-tooltip`;
  46001. props.style = { width: `${(data.column.realWidth || Number(data.column.width)) - 1}px` };
  46002. }
  46003. checkSubColumn(children);
  46004. return (0, vue.h)("div", props, [prefix, children]);
  46005. };
  46006. }
  46007. return column;
  46008. };
  46009. const getPropsData = (...propsKey) => {
  46010. return propsKey.reduce((prev, cur) => {
  46011. if (isArray$1(cur)) cur.forEach((key) => {
  46012. prev[key] = props[key];
  46013. });
  46014. return prev;
  46015. }, {});
  46016. };
  46017. const getColumnElIndex = (children, child) => {
  46018. return Array.prototype.indexOf.call(children, child);
  46019. };
  46020. const updateColumnOrder = () => {
  46021. owner.value.store.commit("updateColumnOrder", instance.columnConfig.value);
  46022. };
  46023. return {
  46024. columnId,
  46025. realAlign,
  46026. isSubColumn,
  46027. realHeaderAlign,
  46028. columnOrTableParent,
  46029. setColumnWidth,
  46030. setColumnForcedProps,
  46031. setColumnRenders,
  46032. getPropsData,
  46033. getColumnElIndex,
  46034. updateColumnOrder
  46035. };
  46036. }
  46037. //#endregion
  46038. //#region ../../packages/components/table/src/table-column/defaults.ts
  46039. var defaults_default$1 = {
  46040. type: {
  46041. type: String,
  46042. default: "default"
  46043. },
  46044. label: String,
  46045. className: String,
  46046. labelClassName: String,
  46047. property: String,
  46048. prop: String,
  46049. width: {
  46050. type: [String, Number],
  46051. default: ""
  46052. },
  46053. minWidth: {
  46054. type: [String, Number],
  46055. default: ""
  46056. },
  46057. renderHeader: Function,
  46058. sortable: {
  46059. type: [Boolean, String],
  46060. default: false
  46061. },
  46062. sortMethod: Function,
  46063. sortBy: [
  46064. String,
  46065. Function,
  46066. Array
  46067. ],
  46068. resizable: {
  46069. type: Boolean,
  46070. default: true
  46071. },
  46072. columnKey: String,
  46073. align: String,
  46074. headerAlign: String,
  46075. showOverflowTooltip: {
  46076. type: [Boolean, Object],
  46077. default: void 0
  46078. },
  46079. tooltipFormatter: Function,
  46080. fixed: [Boolean, String],
  46081. formatter: Function,
  46082. selectable: Function,
  46083. reserveSelection: Boolean,
  46084. filterMethod: Function,
  46085. filteredValue: Array,
  46086. filters: Array,
  46087. filterPlacement: String,
  46088. filterMultiple: {
  46089. type: Boolean,
  46090. default: true
  46091. },
  46092. filterClassName: String,
  46093. index: [Number, Function],
  46094. sortOrders: {
  46095. type: Array,
  46096. default: () => {
  46097. return [
  46098. "ascending",
  46099. "descending",
  46100. null
  46101. ];
  46102. },
  46103. validator: (val) => {
  46104. return val.every((order) => [
  46105. "ascending",
  46106. "descending",
  46107. null
  46108. ].includes(order));
  46109. }
  46110. }
  46111. };
  46112. //#endregion
  46113. //#region ../../packages/components/table/src/table-column/index.ts
  46114. let columnIdSeed = 1;
  46115. var table_column_default = (0, vue.defineComponent)({
  46116. name: "ElTableColumn",
  46117. components: { ElCheckbox },
  46118. props: defaults_default$1,
  46119. setup(props, { slots }) {
  46120. const instance = (0, vue.getCurrentInstance)();
  46121. const globalConfig = useGlobalConfig("table");
  46122. const columnConfig = (0, vue.ref)({});
  46123. const owner = (0, vue.computed)(() => {
  46124. let parent = instance.parent;
  46125. while (parent && !parent.tableId) parent = parent.parent;
  46126. return parent;
  46127. });
  46128. const { registerNormalWatchers, registerComplexWatchers } = useWatcher(owner, props);
  46129. const { columnId, isSubColumn, realHeaderAlign, columnOrTableParent, setColumnWidth, setColumnForcedProps, setColumnRenders, getPropsData, getColumnElIndex, realAlign, updateColumnOrder } = useRender(props, slots, owner);
  46130. const parent = columnOrTableParent.value;
  46131. columnId.value = `${"tableId" in parent && parent.tableId || "columnId" in parent && parent.columnId}_column_${columnIdSeed++}`;
  46132. (0, vue.onBeforeMount)(() => {
  46133. isSubColumn.value = owner.value !== parent;
  46134. const type = props.type || "default";
  46135. const sortable = props.sortable === "" ? true : props.sortable;
  46136. const showOverflowTooltip = type === "selection" ? false : isUndefined(props.showOverflowTooltip) ? parent.props.showOverflowTooltip ?? globalConfig.value?.showOverflowTooltip : props.showOverflowTooltip;
  46137. const tooltipFormatter = isUndefined(props.tooltipFormatter) ? parent.props.tooltipFormatter ?? globalConfig.value?.tooltipFormatter : props.tooltipFormatter;
  46138. const defaults = {
  46139. ...cellStarts[type],
  46140. id: columnId.value,
  46141. type,
  46142. property: props.prop || props.property,
  46143. align: realAlign,
  46144. headerAlign: realHeaderAlign,
  46145. showOverflowTooltip,
  46146. tooltipFormatter,
  46147. filterable: props.filters || props.filterMethod,
  46148. filteredValue: [],
  46149. filterPlacement: "",
  46150. filterClassName: "",
  46151. isColumnGroup: false,
  46152. isSubColumn: false,
  46153. filterOpened: false,
  46154. sortable,
  46155. index: props.index,
  46156. rawColumnKey: instance.vnode.key
  46157. };
  46158. let column = getPropsData([
  46159. "columnKey",
  46160. "label",
  46161. "className",
  46162. "labelClassName",
  46163. "type",
  46164. "renderHeader",
  46165. "formatter",
  46166. "fixed",
  46167. "resizable"
  46168. ], [
  46169. "sortMethod",
  46170. "sortBy",
  46171. "sortOrders"
  46172. ], ["selectable", "reserveSelection"], [
  46173. "filterMethod",
  46174. "filters",
  46175. "filterMultiple",
  46176. "filterOpened",
  46177. "filteredValue",
  46178. "filterPlacement",
  46179. "filterClassName"
  46180. ]);
  46181. column = mergeOptions(defaults, column);
  46182. column = compose(setColumnRenders, setColumnWidth, setColumnForcedProps)(column);
  46183. columnConfig.value = column;
  46184. registerNormalWatchers();
  46185. registerComplexWatchers();
  46186. });
  46187. (0, vue.onMounted)(() => {
  46188. const parent = columnOrTableParent.value;
  46189. const children = isSubColumn.value ? parent.vnode.el?.children : parent.refs.hiddenColumns?.children;
  46190. const getColumnIndex = () => getColumnElIndex(children || [], instance.vnode.el);
  46191. columnConfig.value.getColumnIndex = getColumnIndex;
  46192. getColumnIndex() > -1 && owner.value.store.commit("insertColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null, updateColumnOrder);
  46193. });
  46194. (0, vue.onBeforeUnmount)(() => {
  46195. const getColumnIndex = columnConfig.value.getColumnIndex;
  46196. (getColumnIndex ? getColumnIndex() : -1) > -1 && owner.value.store.commit("removeColumn", columnConfig.value, isSubColumn.value ? "columnConfig" in parent && parent.columnConfig.value : null, updateColumnOrder);
  46197. });
  46198. instance.columnId = columnId.value;
  46199. instance.columnConfig = columnConfig;
  46200. },
  46201. render() {
  46202. try {
  46203. const renderDefault = this.$slots.default?.({
  46204. row: {},
  46205. column: {},
  46206. $index: -1
  46207. });
  46208. const children = [];
  46209. if (isArray$1(renderDefault)) {
  46210. for (const childNode of renderDefault) if (childNode.type?.name === "ElTableColumn" || childNode.shapeFlag & 2) children.push(childNode);
  46211. else if (childNode.type === vue.Fragment && isArray$1(childNode.children)) childNode.children.forEach((vnode) => {
  46212. if (vnode?.patchFlag !== 1024 && !isString(vnode?.children)) children.push(vnode);
  46213. });
  46214. }
  46215. return (0, vue.h)("div", children);
  46216. } catch {
  46217. return (0, vue.h)("div", []);
  46218. }
  46219. }
  46220. });
  46221. //#endregion
  46222. //#region ../../packages/components/table/src/tableColumn.ts
  46223. var tableColumn_default = table_column_default;
  46224. //#endregion
  46225. //#region ../../packages/components/table/index.ts
  46226. const ElTable = withInstall(table_default, { TableColumn: tableColumn_default });
  46227. const ElTableColumn = withNoopInstall(tableColumn_default);
  46228. //#endregion
  46229. //#region ../../packages/components/table-v2/src/constants.ts
  46230. let SortOrder = /* @__PURE__ */ function(SortOrder) {
  46231. SortOrder["ASC"] = "asc";
  46232. SortOrder["DESC"] = "desc";
  46233. return SortOrder;
  46234. }({});
  46235. let Alignment = /* @__PURE__ */ function(Alignment) {
  46236. Alignment["LEFT"] = "left";
  46237. Alignment["CENTER"] = "center";
  46238. Alignment["RIGHT"] = "right";
  46239. return Alignment;
  46240. }({});
  46241. let FixedDir = /* @__PURE__ */ function(FixedDir) {
  46242. FixedDir["LEFT"] = "left";
  46243. FixedDir["RIGHT"] = "right";
  46244. return FixedDir;
  46245. }({});
  46246. const oppositeOrderMap = {
  46247. [SortOrder.ASC]: SortOrder.DESC,
  46248. [SortOrder.DESC]: SortOrder.ASC
  46249. };
  46250. const sortOrders = [SortOrder.ASC, SortOrder.DESC];
  46251. //#endregion
  46252. //#region ../../packages/components/table-v2/src/private.ts
  46253. const placeholderSign = Symbol("placeholder");
  46254. //#endregion
  46255. //#region ../../packages/components/table-v2/src/composables/utils.ts
  46256. const calcColumnStyle = (column, fixedColumn, fixed) => {
  46257. const flex = {
  46258. flexGrow: 0,
  46259. flexShrink: 0,
  46260. ...fixed ? {} : {
  46261. flexGrow: column.flexGrow ?? 0,
  46262. flexShrink: column.flexShrink ?? 1
  46263. }
  46264. };
  46265. const style = {
  46266. ...column.style ?? {},
  46267. ...flex,
  46268. flexBasis: "auto",
  46269. width: column.width
  46270. };
  46271. if (!fixedColumn) {
  46272. if (column.maxWidth) style.maxWidth = column.maxWidth;
  46273. if (column.minWidth) style.minWidth = column.minWidth;
  46274. }
  46275. return style;
  46276. };
  46277. //#endregion
  46278. //#region ../../packages/components/table-v2/src/composables/use-columns.ts
  46279. function useColumns(props, columns, fixed) {
  46280. const _columns = (0, vue.computed)(() => (0, vue.unref)(columns).map((column, index) => ({
  46281. ...column,
  46282. key: column.key ?? column.dataKey ?? index
  46283. })));
  46284. const visibleColumns = (0, vue.computed)(() => {
  46285. return (0, vue.unref)(_columns).filter((column) => !column.hidden);
  46286. });
  46287. const fixedColumnsOnLeft = (0, vue.computed)(() => (0, vue.unref)(visibleColumns).filter((column) => column.fixed === "left" || column.fixed === true));
  46288. const fixedColumnsOnRight = (0, vue.computed)(() => (0, vue.unref)(visibleColumns).filter((column) => column.fixed === "right"));
  46289. const normalColumns = (0, vue.computed)(() => (0, vue.unref)(visibleColumns).filter((column) => !column.fixed));
  46290. const mainColumns = (0, vue.computed)(() => {
  46291. const ret = [];
  46292. (0, vue.unref)(fixedColumnsOnLeft).forEach((column) => {
  46293. ret.push({
  46294. ...column,
  46295. placeholderSign
  46296. });
  46297. });
  46298. (0, vue.unref)(normalColumns).forEach((column) => {
  46299. ret.push(column);
  46300. });
  46301. (0, vue.unref)(fixedColumnsOnRight).forEach((column) => {
  46302. ret.push({
  46303. ...column,
  46304. placeholderSign
  46305. });
  46306. });
  46307. return ret;
  46308. });
  46309. const hasFixedColumns = (0, vue.computed)(() => {
  46310. return (0, vue.unref)(fixedColumnsOnLeft).length || (0, vue.unref)(fixedColumnsOnRight).length;
  46311. });
  46312. const columnsStyles = (0, vue.computed)(() => {
  46313. return (0, vue.unref)(_columns).reduce((style, column) => {
  46314. style[column.key] = calcColumnStyle(column, (0, vue.unref)(fixed), props.fixed);
  46315. return style;
  46316. }, {});
  46317. });
  46318. const columnsTotalWidth = (0, vue.computed)(() => {
  46319. return (0, vue.unref)(visibleColumns).reduce((width, column) => width + column.width, 0);
  46320. });
  46321. const getColumn = (key) => {
  46322. return (0, vue.unref)(_columns).find((column) => column.key === key);
  46323. };
  46324. const getColumnStyle = (key) => {
  46325. return (0, vue.unref)(columnsStyles)[key];
  46326. };
  46327. const updateColumnWidth = (column, width) => {
  46328. column.width = width;
  46329. };
  46330. function onColumnSorted(e) {
  46331. const { key } = e.currentTarget.dataset;
  46332. if (!key) return;
  46333. const { sortState, sortBy } = props;
  46334. let order = SortOrder.ASC;
  46335. if (isObject$1(sortState)) order = oppositeOrderMap[sortState[key]];
  46336. else order = oppositeOrderMap[sortBy.order];
  46337. props.onColumnSort?.({
  46338. column: getColumn(key),
  46339. key,
  46340. order
  46341. });
  46342. }
  46343. return {
  46344. columns: _columns,
  46345. columnsStyles,
  46346. columnsTotalWidth,
  46347. fixedColumnsOnLeft,
  46348. fixedColumnsOnRight,
  46349. hasFixedColumns,
  46350. mainColumns,
  46351. normalColumns,
  46352. visibleColumns,
  46353. getColumn,
  46354. getColumnStyle,
  46355. updateColumnWidth,
  46356. onColumnSorted
  46357. };
  46358. }
  46359. //#endregion
  46360. //#region ../../packages/components/table-v2/src/composables/use-scrollbar.ts
  46361. const useScrollbar = (props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached }) => {
  46362. const scrollPos = (0, vue.ref)({
  46363. scrollLeft: 0,
  46364. scrollTop: 0
  46365. });
  46366. function doScroll(params) {
  46367. const { scrollTop } = params;
  46368. mainTableRef.value?.scrollTo(params);
  46369. leftTableRef.value?.scrollToTop(scrollTop);
  46370. rightTableRef.value?.scrollToTop(scrollTop);
  46371. }
  46372. function scrollTo(params) {
  46373. scrollPos.value = params;
  46374. doScroll(params);
  46375. }
  46376. function scrollToTop(scrollTop) {
  46377. scrollPos.value.scrollTop = scrollTop;
  46378. doScroll((0, vue.unref)(scrollPos));
  46379. }
  46380. function scrollToLeft(scrollLeft) {
  46381. scrollPos.value.scrollLeft = scrollLeft;
  46382. mainTableRef.value?.scrollTo?.((0, vue.unref)(scrollPos));
  46383. }
  46384. function onScroll(params) {
  46385. scrollTo(params);
  46386. props.onScroll?.(params);
  46387. }
  46388. function onVerticalScroll({ scrollTop }) {
  46389. const { scrollTop: currentScrollTop } = (0, vue.unref)(scrollPos);
  46390. if (scrollTop !== currentScrollTop) scrollToTop(scrollTop);
  46391. }
  46392. function scrollToRow(row, strategy = "auto") {
  46393. mainTableRef.value?.scrollToRow(row, strategy);
  46394. }
  46395. (0, vue.watch)(() => (0, vue.unref)(scrollPos).scrollTop, (cur, prev) => {
  46396. if (cur > prev) onMaybeEndReached();
  46397. });
  46398. return {
  46399. scrollPos,
  46400. scrollTo,
  46401. scrollToLeft,
  46402. scrollToTop,
  46403. scrollToRow,
  46404. onScroll,
  46405. onVerticalScroll
  46406. };
  46407. };
  46408. //#endregion
  46409. //#region ../../packages/components/table-v2/src/composables/use-row.ts
  46410. const useRow = (props, { mainTableRef, leftTableRef, rightTableRef, tableInstance, ns, isScrolling }) => {
  46411. const vm = (0, vue.getCurrentInstance)();
  46412. const { emit } = vm;
  46413. const isResetting = (0, vue.shallowRef)(false);
  46414. const expandedRowKeys = (0, vue.ref)(props.defaultExpandedRowKeys || []);
  46415. const lastRenderedRowIndex = (0, vue.ref)(-1);
  46416. const resetIndex = (0, vue.shallowRef)(null);
  46417. const rowHeights = (0, vue.ref)({});
  46418. const pendingRowHeights = (0, vue.ref)({});
  46419. const leftTableHeights = (0, vue.shallowRef)({});
  46420. const mainTableHeights = (0, vue.shallowRef)({});
  46421. const rightTableHeights = (0, vue.shallowRef)({});
  46422. const isDynamic = (0, vue.computed)(() => isNumber(props.estimatedRowHeight));
  46423. function onRowsRendered(params) {
  46424. props.onRowsRendered?.(params);
  46425. if (params.rowCacheEnd > (0, vue.unref)(lastRenderedRowIndex)) lastRenderedRowIndex.value = params.rowCacheEnd;
  46426. }
  46427. function onRowHovered({ hovered, rowKey }) {
  46428. if (isScrolling.value) return;
  46429. tableInstance.vnode.el.querySelectorAll(`[rowkey="${String(rowKey)}"]`).forEach((row) => {
  46430. if (hovered) row.classList.add(ns.is("hovered"));
  46431. else row.classList.remove(ns.is("hovered"));
  46432. });
  46433. }
  46434. function onRowExpanded({ expanded, rowData, rowIndex, rowKey }) {
  46435. const _expandedRowKeys = [...(0, vue.unref)(expandedRowKeys)];
  46436. const currentKeyIndex = _expandedRowKeys.indexOf(rowKey);
  46437. if (expanded) {
  46438. if (currentKeyIndex === -1) _expandedRowKeys.push(rowKey);
  46439. } else if (currentKeyIndex > -1) _expandedRowKeys.splice(currentKeyIndex, 1);
  46440. expandedRowKeys.value = _expandedRowKeys;
  46441. emit("update:expandedRowKeys", _expandedRowKeys);
  46442. props.onRowExpand?.({
  46443. expanded,
  46444. rowData,
  46445. rowIndex,
  46446. rowKey
  46447. });
  46448. props.onExpandedRowsChange?.(_expandedRowKeys);
  46449. if (tableInstance.vnode.el.querySelector(`.${ns.is("hovered")}[rowkey="${String(rowKey)}"]`)) (0, vue.nextTick)(() => onRowHovered({
  46450. hovered: true,
  46451. rowKey
  46452. }));
  46453. }
  46454. const flushingRowHeights = debounce(() => {
  46455. isResetting.value = true;
  46456. rowHeights.value = {
  46457. ...(0, vue.unref)(rowHeights),
  46458. ...(0, vue.unref)(pendingRowHeights)
  46459. };
  46460. resetAfterIndex((0, vue.unref)(resetIndex), false);
  46461. pendingRowHeights.value = {};
  46462. resetIndex.value = null;
  46463. mainTableRef.value?.forceUpdate();
  46464. leftTableRef.value?.forceUpdate();
  46465. rightTableRef.value?.forceUpdate();
  46466. vm.proxy?.$forceUpdate();
  46467. isResetting.value = false;
  46468. }, 0);
  46469. function resetAfterIndex(index, forceUpdate = false) {
  46470. if (!(0, vue.unref)(isDynamic)) return;
  46471. [
  46472. mainTableRef,
  46473. leftTableRef,
  46474. rightTableRef
  46475. ].forEach((tableRef) => {
  46476. const table = (0, vue.unref)(tableRef);
  46477. if (table) table.resetAfterRowIndex(index, forceUpdate);
  46478. });
  46479. }
  46480. function resetHeights(rowKey, height, rowIdx) {
  46481. const resetIdx = (0, vue.unref)(resetIndex);
  46482. if (resetIdx === null) resetIndex.value = rowIdx;
  46483. else if (resetIdx > rowIdx) resetIndex.value = rowIdx;
  46484. pendingRowHeights.value[rowKey] = height;
  46485. }
  46486. function onRowHeightChange({ rowKey, height, rowIndex }, fixedDir) {
  46487. if (!fixedDir) mainTableHeights.value[rowKey] = height;
  46488. else if (fixedDir === FixedDir.RIGHT) rightTableHeights.value[rowKey] = height;
  46489. else leftTableHeights.value[rowKey] = height;
  46490. const maximumHeight = Math.max(...[
  46491. leftTableHeights,
  46492. rightTableHeights,
  46493. mainTableHeights
  46494. ].map((records) => records.value[rowKey] || 0));
  46495. if ((0, vue.unref)(rowHeights)[rowKey] !== maximumHeight) {
  46496. resetHeights(rowKey, maximumHeight, rowIndex);
  46497. flushingRowHeights();
  46498. }
  46499. }
  46500. return {
  46501. expandedRowKeys,
  46502. lastRenderedRowIndex,
  46503. isDynamic,
  46504. isResetting,
  46505. rowHeights,
  46506. resetAfterIndex,
  46507. onRowExpanded,
  46508. onRowHovered,
  46509. onRowsRendered,
  46510. onRowHeightChange
  46511. };
  46512. };
  46513. //#endregion
  46514. //#region ../../packages/components/table-v2/src/composables/use-data.ts
  46515. const useData = (props, { expandedRowKeys, lastRenderedRowIndex, resetAfterIndex }) => {
  46516. const depthMap = (0, vue.ref)({});
  46517. const flattenedData = (0, vue.computed)(() => {
  46518. const depths = {};
  46519. const { data, rowKey } = props;
  46520. const _expandedRowKeys = (0, vue.unref)(expandedRowKeys);
  46521. if (!_expandedRowKeys || !_expandedRowKeys.length) return data;
  46522. const array = [];
  46523. const keysSet = /* @__PURE__ */ new Set();
  46524. _expandedRowKeys.forEach((x) => keysSet.add(x));
  46525. let copy = data.slice();
  46526. copy.forEach((x) => depths[x[rowKey]] = 0);
  46527. while (copy.length > 0) {
  46528. const item = copy.shift();
  46529. array.push(item);
  46530. if (keysSet.has(item[rowKey]) && isArray$1(item.children) && item.children.length > 0) {
  46531. copy = [...item.children, ...copy];
  46532. item.children.forEach((child) => depths[child[rowKey]] = depths[item[rowKey]] + 1);
  46533. }
  46534. }
  46535. depthMap.value = depths;
  46536. return array;
  46537. });
  46538. const data = (0, vue.computed)(() => {
  46539. const { data, expandColumnKey } = props;
  46540. return expandColumnKey ? (0, vue.unref)(flattenedData) : data;
  46541. });
  46542. (0, vue.watch)(data, (val, prev) => {
  46543. if (val !== prev) {
  46544. lastRenderedRowIndex.value = -1;
  46545. resetAfterIndex(0, true);
  46546. }
  46547. });
  46548. return {
  46549. data,
  46550. depthMap
  46551. };
  46552. };
  46553. //#endregion
  46554. //#region ../../packages/components/table-v2/src/utils.ts
  46555. const sumReducer = (sum, num) => sum + num;
  46556. const sum = (listLike) => {
  46557. return isArray$1(listLike) ? listLike.reduce(sumReducer, 0) : listLike;
  46558. };
  46559. const tryCall = (fLike, params, defaultRet = {}) => {
  46560. return isFunction$1(fLike) ? fLike(params) : fLike ?? defaultRet;
  46561. };
  46562. const enforceUnit = (style) => {
  46563. [
  46564. "width",
  46565. "maxWidth",
  46566. "minWidth",
  46567. "height"
  46568. ].forEach((key) => {
  46569. style[key] = addUnit(style[key]);
  46570. });
  46571. return style;
  46572. };
  46573. const componentToSlot = (ComponentLike) => (0, vue.isVNode)(ComponentLike) ? (props) => (0, vue.h)(ComponentLike, props) : ComponentLike;
  46574. //#endregion
  46575. //#region ../../packages/components/table-v2/src/composables/use-styles.ts
  46576. const useStyles = (props, { columnsTotalWidth, rowsHeight, fixedColumnsOnLeft, fixedColumnsOnRight }) => {
  46577. const bodyWidth = (0, vue.computed)(() => {
  46578. const { fixed, width, vScrollbarSize } = props;
  46579. const ret = width - vScrollbarSize;
  46580. return fixed ? Math.max(Math.round((0, vue.unref)(columnsTotalWidth)), ret) : ret;
  46581. });
  46582. const mainTableHeight = (0, vue.computed)(() => {
  46583. const { height = 0, maxHeight = 0, footerHeight, hScrollbarSize } = props;
  46584. if (maxHeight > 0) {
  46585. const _fixedRowsHeight = (0, vue.unref)(fixedRowsHeight);
  46586. const _rowsHeight = (0, vue.unref)(rowsHeight);
  46587. const total = (0, vue.unref)(headerHeight) + _fixedRowsHeight + _rowsHeight + hScrollbarSize;
  46588. return Math.min(total, maxHeight - footerHeight);
  46589. }
  46590. return height - footerHeight;
  46591. });
  46592. const fixedTableHeight = (0, vue.computed)(() => {
  46593. const { maxHeight } = props;
  46594. const tableHeight = (0, vue.unref)(mainTableHeight);
  46595. if (isNumber(maxHeight) && maxHeight > 0) return tableHeight;
  46596. const totalHeight = (0, vue.unref)(rowsHeight) + (0, vue.unref)(headerHeight) + (0, vue.unref)(fixedRowsHeight);
  46597. return Math.min(tableHeight, totalHeight);
  46598. });
  46599. const mapColumn = (column) => column.width;
  46600. const leftTableWidth = (0, vue.computed)(() => sum((0, vue.unref)(fixedColumnsOnLeft).map(mapColumn)));
  46601. const rightTableWidth = (0, vue.computed)(() => sum((0, vue.unref)(fixedColumnsOnRight).map(mapColumn)));
  46602. const headerHeight = (0, vue.computed)(() => sum(props.headerHeight));
  46603. const fixedRowsHeight = (0, vue.computed)(() => {
  46604. return (props.fixedData?.length || 0) * props.rowHeight;
  46605. });
  46606. const windowHeight = (0, vue.computed)(() => {
  46607. return (0, vue.unref)(mainTableHeight) - (0, vue.unref)(headerHeight) - (0, vue.unref)(fixedRowsHeight);
  46608. });
  46609. const rootStyle = (0, vue.computed)(() => {
  46610. const { style = {}, height, width } = props;
  46611. return enforceUnit({
  46612. ...style,
  46613. height,
  46614. width
  46615. });
  46616. });
  46617. return {
  46618. bodyWidth,
  46619. fixedTableHeight,
  46620. mainTableHeight,
  46621. leftTableWidth,
  46622. rightTableWidth,
  46623. windowHeight,
  46624. footerHeight: (0, vue.computed)(() => enforceUnit({ height: props.footerHeight })),
  46625. emptyStyle: (0, vue.computed)(() => ({
  46626. top: addUnit((0, vue.unref)(headerHeight)),
  46627. bottom: addUnit(props.footerHeight),
  46628. width: addUnit(props.width)
  46629. })),
  46630. rootStyle,
  46631. headerHeight
  46632. };
  46633. };
  46634. //#endregion
  46635. //#region ../../packages/components/table-v2/src/composables/use-auto-resize.ts
  46636. const useAutoResize = (props) => {
  46637. const sizer = (0, vue.ref)();
  46638. const width$ = (0, vue.ref)(0);
  46639. const height$ = (0, vue.ref)(0);
  46640. let resizerStopper;
  46641. (0, vue.onMounted)(() => {
  46642. resizerStopper = useResizeObserver(sizer, ([entry]) => {
  46643. const { width, height } = entry.contentRect;
  46644. const { paddingLeft, paddingRight, paddingTop, paddingBottom } = getComputedStyle(entry.target);
  46645. const left = Number.parseInt(paddingLeft) || 0;
  46646. const right = Number.parseInt(paddingRight) || 0;
  46647. const top = Number.parseInt(paddingTop) || 0;
  46648. const bottom = Number.parseInt(paddingBottom) || 0;
  46649. width$.value = width - left - right;
  46650. height$.value = height - top - bottom;
  46651. }).stop;
  46652. });
  46653. (0, vue.onBeforeUnmount)(() => {
  46654. resizerStopper?.();
  46655. });
  46656. (0, vue.watch)([width$, height$], ([width, height]) => {
  46657. props.onResize?.({
  46658. width,
  46659. height
  46660. });
  46661. });
  46662. return {
  46663. sizer,
  46664. width: width$,
  46665. height: height$
  46666. };
  46667. };
  46668. //#endregion
  46669. //#region ../../packages/components/table-v2/src/use-table.ts
  46670. function useTable(props) {
  46671. const mainTableRef = (0, vue.ref)();
  46672. const leftTableRef = (0, vue.ref)();
  46673. const rightTableRef = (0, vue.ref)();
  46674. const { columns, columnsStyles, columnsTotalWidth, fixedColumnsOnLeft, fixedColumnsOnRight, hasFixedColumns, mainColumns, onColumnSorted } = useColumns(props, (0, vue.toRef)(props, "columns"), (0, vue.toRef)(props, "fixed"));
  46675. const { scrollTo, scrollToLeft, scrollToTop, scrollToRow, onScroll, onVerticalScroll, scrollPos } = useScrollbar(props, {
  46676. mainTableRef,
  46677. leftTableRef,
  46678. rightTableRef,
  46679. onMaybeEndReached
  46680. });
  46681. const ns = useNamespace("table-v2");
  46682. const instance = (0, vue.getCurrentInstance)();
  46683. const isScrolling = (0, vue.shallowRef)(false);
  46684. const { expandedRowKeys, lastRenderedRowIndex, isDynamic, isResetting, rowHeights, resetAfterIndex, onRowExpanded, onRowHeightChange, onRowHovered, onRowsRendered } = useRow(props, {
  46685. mainTableRef,
  46686. leftTableRef,
  46687. rightTableRef,
  46688. tableInstance: instance,
  46689. ns,
  46690. isScrolling
  46691. });
  46692. const { data, depthMap } = useData(props, {
  46693. expandedRowKeys,
  46694. lastRenderedRowIndex,
  46695. resetAfterIndex
  46696. });
  46697. const rowsHeight = (0, vue.computed)(() => {
  46698. const { estimatedRowHeight, rowHeight } = props;
  46699. const _data = (0, vue.unref)(data);
  46700. if (isNumber(estimatedRowHeight)) return Object.values((0, vue.unref)(rowHeights)).reduce((acc, curr) => acc + curr, 0);
  46701. return _data.length * rowHeight;
  46702. });
  46703. const { bodyWidth, fixedTableHeight, mainTableHeight, leftTableWidth, rightTableWidth, windowHeight, footerHeight, emptyStyle, rootStyle, headerHeight } = useStyles(props, {
  46704. columnsTotalWidth,
  46705. fixedColumnsOnLeft,
  46706. fixedColumnsOnRight,
  46707. rowsHeight
  46708. });
  46709. const containerRef = (0, vue.ref)();
  46710. const showEmpty = (0, vue.computed)(() => {
  46711. const noData = (0, vue.unref)(data).length === 0;
  46712. return isArray$1(props.fixedData) ? props.fixedData.length === 0 && noData : noData;
  46713. });
  46714. function getRowHeight(rowIndex) {
  46715. const { estimatedRowHeight, rowHeight, rowKey } = props;
  46716. if (!estimatedRowHeight) return rowHeight;
  46717. return (0, vue.unref)(rowHeights)[(0, vue.unref)(data)[rowIndex][rowKey]] || estimatedRowHeight;
  46718. }
  46719. const isEndReached = (0, vue.ref)(false);
  46720. function onMaybeEndReached() {
  46721. const { onEndReached } = props;
  46722. if (!onEndReached) return;
  46723. const { scrollTop } = (0, vue.unref)(scrollPos);
  46724. const _totalHeight = (0, vue.unref)(rowsHeight);
  46725. const remainDistance = _totalHeight - (scrollTop + (0, vue.unref)(windowHeight)) + props.hScrollbarSize;
  46726. if (!isEndReached.value && (0, vue.unref)(lastRenderedRowIndex) >= 0 && _totalHeight <= scrollTop + (0, vue.unref)(mainTableHeight) - (0, vue.unref)(headerHeight)) {
  46727. isEndReached.value = true;
  46728. onEndReached(remainDistance);
  46729. } else isEndReached.value = false;
  46730. }
  46731. (0, vue.watch)(() => (0, vue.unref)(rowsHeight), () => isEndReached.value = false);
  46732. (0, vue.watch)(() => props.expandedRowKeys, (val) => expandedRowKeys.value = val, { deep: true });
  46733. return {
  46734. columns,
  46735. containerRef,
  46736. mainTableRef,
  46737. leftTableRef,
  46738. rightTableRef,
  46739. isDynamic,
  46740. isResetting,
  46741. isScrolling,
  46742. hasFixedColumns,
  46743. columnsStyles,
  46744. columnsTotalWidth,
  46745. data,
  46746. expandedRowKeys,
  46747. depthMap,
  46748. fixedColumnsOnLeft,
  46749. fixedColumnsOnRight,
  46750. mainColumns,
  46751. bodyWidth,
  46752. emptyStyle,
  46753. rootStyle,
  46754. footerHeight,
  46755. mainTableHeight,
  46756. fixedTableHeight,
  46757. leftTableWidth,
  46758. rightTableWidth,
  46759. showEmpty,
  46760. getRowHeight,
  46761. onColumnSorted,
  46762. onRowHovered,
  46763. onRowExpanded,
  46764. onRowsRendered,
  46765. onRowHeightChange,
  46766. scrollTo,
  46767. scrollToLeft,
  46768. scrollToTop,
  46769. scrollToRow,
  46770. onScroll,
  46771. onVerticalScroll
  46772. };
  46773. }
  46774. //#endregion
  46775. //#region ../../packages/components/table-v2/src/tokens.ts
  46776. const TableV2InjectionKey = Symbol("tableV2");
  46777. const TABLE_V2_GRID_INJECTION_KEY = "tableV2GridScrollLeft";
  46778. //#endregion
  46779. //#region ../../packages/components/table-v2/src/common.ts
  46780. /**
  46781. * @Note even though we can use `string[] | string` as the type but for
  46782. * convenience here we only use `string` as the acceptable value here.
  46783. */
  46784. const classType = String;
  46785. const columns = {
  46786. type: definePropType(Array),
  46787. required: true
  46788. };
  46789. const column = { type: definePropType(Object) };
  46790. const fixedDataType = { type: definePropType(Array) };
  46791. const dataType = {
  46792. ...fixedDataType,
  46793. required: true
  46794. };
  46795. const expandColumnKey = String;
  46796. const expandKeys = {
  46797. type: definePropType(Array),
  46798. default: () => mutable([])
  46799. };
  46800. const requiredNumber = {
  46801. type: Number,
  46802. required: true
  46803. };
  46804. const rowKey = {
  46805. type: definePropType([
  46806. String,
  46807. Number,
  46808. Symbol
  46809. ]),
  46810. default: "id"
  46811. };
  46812. /**
  46813. * @note even though we can use `StyleValue` but that would be difficult for us to mapping them,
  46814. * so we only use `CSSProperties` as the acceptable value here.
  46815. */
  46816. const styleType = { type: definePropType(Object) };
  46817. //#endregion
  46818. //#region ../../packages/components/table-v2/src/row.ts
  46819. const tableV2RowProps = buildProps({
  46820. class: String,
  46821. columns,
  46822. columnsStyles: {
  46823. type: definePropType(Object),
  46824. required: true
  46825. },
  46826. depth: Number,
  46827. expandColumnKey,
  46828. estimatedRowHeight: {
  46829. ...virtualizedGridProps.estimatedRowHeight,
  46830. default: void 0
  46831. },
  46832. isScrolling: Boolean,
  46833. onRowExpand: { type: definePropType(Function) },
  46834. onRowHover: { type: definePropType(Function) },
  46835. onRowHeightChange: { type: definePropType(Function) },
  46836. rowData: {
  46837. type: definePropType(Object),
  46838. required: true
  46839. },
  46840. rowEventHandlers: { type: definePropType(Object) },
  46841. rowIndex: {
  46842. type: Number,
  46843. required: true
  46844. },
  46845. rowKey,
  46846. style: { type: definePropType(Object) }
  46847. });
  46848. //#endregion
  46849. //#region ../../packages/components/table-v2/src/header.ts
  46850. const requiredNumberType = {
  46851. type: Number,
  46852. required: true
  46853. };
  46854. const tableV2HeaderProps = buildProps({
  46855. class: String,
  46856. columns,
  46857. fixedHeaderData: { type: definePropType(Array) },
  46858. headerData: {
  46859. type: definePropType(Array),
  46860. required: true
  46861. },
  46862. headerHeight: {
  46863. type: definePropType([Number, Array]),
  46864. default: 50
  46865. },
  46866. rowWidth: requiredNumberType,
  46867. rowHeight: {
  46868. type: Number,
  46869. default: 50
  46870. },
  46871. height: requiredNumberType,
  46872. width: requiredNumberType
  46873. });
  46874. //#endregion
  46875. //#region ../../packages/components/table-v2/src/grid.ts
  46876. const tableV2GridProps = buildProps({
  46877. columns,
  46878. data: dataType,
  46879. fixedData: fixedDataType,
  46880. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  46881. width: requiredNumber,
  46882. height: requiredNumber,
  46883. headerWidth: requiredNumber,
  46884. headerHeight: tableV2HeaderProps.headerHeight,
  46885. bodyWidth: requiredNumber,
  46886. rowHeight: requiredNumber,
  46887. cache: virtualizedListProps.cache,
  46888. useIsScrolling: Boolean,
  46889. scrollbarAlwaysOn: virtualizedGridProps.scrollbarAlwaysOn,
  46890. scrollbarStartGap: virtualizedGridProps.scrollbarStartGap,
  46891. scrollbarEndGap: virtualizedGridProps.scrollbarEndGap,
  46892. class: classType,
  46893. style: styleType,
  46894. containerStyle: styleType,
  46895. getRowHeight: {
  46896. type: definePropType(Function),
  46897. required: true
  46898. },
  46899. rowKey: tableV2RowProps.rowKey,
  46900. onRowsRendered: { type: definePropType(Function) },
  46901. onScroll: { type: definePropType(Function) }
  46902. });
  46903. //#endregion
  46904. //#region ../../packages/components/table-v2/src/table.ts
  46905. const tableV2Props = buildProps({
  46906. cache: tableV2GridProps.cache,
  46907. estimatedRowHeight: tableV2RowProps.estimatedRowHeight,
  46908. rowKey,
  46909. headerClass: { type: definePropType([String, Function]) },
  46910. headerProps: { type: definePropType([Object, Function]) },
  46911. headerCellProps: { type: definePropType([Object, Function]) },
  46912. headerHeight: tableV2HeaderProps.headerHeight,
  46913. footerHeight: {
  46914. type: Number,
  46915. default: 0
  46916. },
  46917. rowClass: { type: definePropType([String, Function]) },
  46918. rowProps: { type: definePropType([Object, Function]) },
  46919. rowHeight: {
  46920. type: Number,
  46921. default: 50
  46922. },
  46923. cellProps: { type: definePropType([Object, Function]) },
  46924. columns,
  46925. data: dataType,
  46926. dataGetter: { type: definePropType(Function) },
  46927. fixedData: fixedDataType,
  46928. expandColumnKey: tableV2RowProps.expandColumnKey,
  46929. expandedRowKeys: expandKeys,
  46930. defaultExpandedRowKeys: expandKeys,
  46931. class: classType,
  46932. fixed: Boolean,
  46933. style: { type: definePropType(Object) },
  46934. width: requiredNumber,
  46935. height: requiredNumber,
  46936. maxHeight: Number,
  46937. useIsScrolling: Boolean,
  46938. indentSize: {
  46939. type: Number,
  46940. default: 12
  46941. },
  46942. iconSize: {
  46943. type: Number,
  46944. default: 12
  46945. },
  46946. hScrollbarSize: virtualizedGridProps.hScrollbarSize,
  46947. vScrollbarSize: virtualizedGridProps.vScrollbarSize,
  46948. scrollbarAlwaysOn: virtualizedScrollbarProps.alwaysOn,
  46949. sortBy: {
  46950. type: definePropType(Object),
  46951. default: () => ({})
  46952. },
  46953. sortState: {
  46954. type: definePropType(Object),
  46955. default: void 0
  46956. },
  46957. onColumnSort: { type: definePropType(Function) },
  46958. onExpandedRowsChange: { type: definePropType(Function) },
  46959. onEndReached: { type: definePropType(Function) },
  46960. onRowExpand: tableV2RowProps.onRowExpand,
  46961. onScroll: tableV2GridProps.onScroll,
  46962. onRowsRendered: tableV2GridProps.onRowsRendered,
  46963. rowEventHandlers: tableV2RowProps.rowEventHandlers
  46964. });
  46965. //#endregion
  46966. //#region ../../packages/components/table-v2/src/components/cell.tsx
  46967. const TableV2Cell = (props, { slots }) => {
  46968. const { cellData, style } = props;
  46969. const displayText = cellData?.toString?.() || "";
  46970. const defaultSlot = (0, vue.renderSlot)(slots, "default", props, () => [displayText]);
  46971. return (0, vue.createVNode)("div", {
  46972. "class": props.class,
  46973. "title": displayText,
  46974. "style": style
  46975. }, [defaultSlot]);
  46976. };
  46977. TableV2Cell.displayName = "ElTableV2Cell";
  46978. TableV2Cell.inheritAttrs = false;
  46979. //#endregion
  46980. //#region ../../packages/components/table-v2/src/components/header-cell.tsx
  46981. const HeaderCell = (props, { slots }) => (0, vue.renderSlot)(slots, "default", props, () => [(0, vue.createVNode)("div", {
  46982. "class": props.class,
  46983. "title": props.column?.title
  46984. }, [props.column?.title])]);
  46985. HeaderCell.displayName = "ElTableV2HeaderCell";
  46986. HeaderCell.inheritAttrs = false;
  46987. //#endregion
  46988. //#region ../../packages/components/table-v2/src/header-row.ts
  46989. const tableV2HeaderRowProps = buildProps({
  46990. class: String,
  46991. columns,
  46992. columnsStyles: {
  46993. type: definePropType(Object),
  46994. required: true
  46995. },
  46996. headerIndex: Number,
  46997. style: { type: definePropType(Object) }
  46998. });
  46999. //#endregion
  47000. //#region ../../packages/components/table-v2/src/components/header-row.tsx
  47001. const TableV2HeaderRow = /* @__PURE__ */ (0, vue.defineComponent)({
  47002. name: "ElTableV2HeaderRow",
  47003. props: tableV2HeaderRowProps,
  47004. setup(props, { slots }) {
  47005. return () => {
  47006. const { columns, columnsStyles, headerIndex, style } = props;
  47007. let Cells = columns.map((column, columnIndex) => {
  47008. return slots.cell({
  47009. columns,
  47010. column,
  47011. columnIndex,
  47012. headerIndex,
  47013. style: columnsStyles[column.key]
  47014. });
  47015. });
  47016. if (slots.header) Cells = slots.header({
  47017. cells: Cells.map((node) => {
  47018. if (isArray$1(node) && node.length === 1) return node[0];
  47019. return node;
  47020. }),
  47021. columns,
  47022. headerIndex
  47023. });
  47024. return (0, vue.createVNode)("div", {
  47025. "class": props.class,
  47026. "style": style,
  47027. "role": "row"
  47028. }, [Cells]);
  47029. };
  47030. }
  47031. });
  47032. //#endregion
  47033. //#region ../../packages/components/table-v2/src/components/header.tsx
  47034. const TableV2Header = /* @__PURE__ */ (0, vue.defineComponent)({
  47035. name: "ElTableV2Header",
  47036. props: tableV2HeaderProps,
  47037. setup(props, { slots, expose }) {
  47038. const ns = useNamespace("table-v2");
  47039. const scrollLeftInfo = (0, vue.inject)(TABLE_V2_GRID_INJECTION_KEY);
  47040. const headerRef = (0, vue.ref)();
  47041. const headerStyle = (0, vue.computed)(() => enforceUnit({
  47042. width: props.width,
  47043. height: props.height
  47044. }));
  47045. const rowStyle = (0, vue.computed)(() => enforceUnit({
  47046. width: props.rowWidth,
  47047. height: props.height
  47048. }));
  47049. const headerHeights = (0, vue.computed)(() => castArray$1((0, vue.unref)(props.headerHeight)));
  47050. const scrollToLeft = (left) => {
  47051. const headerEl = (0, vue.unref)(headerRef);
  47052. (0, vue.nextTick)(() => {
  47053. headerEl?.scroll && headerEl.scroll({ left });
  47054. });
  47055. };
  47056. const renderFixedRows = () => {
  47057. const fixedRowClassName = ns.e("fixed-header-row");
  47058. const { columns, fixedHeaderData, rowHeight } = props;
  47059. return fixedHeaderData?.map((fixedRowData, fixedRowIndex) => {
  47060. const style = enforceUnit({
  47061. height: rowHeight,
  47062. width: "100%"
  47063. });
  47064. return slots.fixed?.({
  47065. class: fixedRowClassName,
  47066. columns,
  47067. rowData: fixedRowData,
  47068. rowIndex: -(fixedRowIndex + 1),
  47069. style
  47070. });
  47071. });
  47072. };
  47073. const renderDynamicRows = () => {
  47074. const dynamicRowClassName = ns.e("dynamic-header-row");
  47075. const { columns } = props;
  47076. return (0, vue.unref)(headerHeights).map((rowHeight, rowIndex) => {
  47077. const style = enforceUnit({
  47078. width: "100%",
  47079. height: rowHeight
  47080. });
  47081. return slots.dynamic?.({
  47082. class: dynamicRowClassName,
  47083. columns,
  47084. headerIndex: rowIndex,
  47085. style
  47086. });
  47087. });
  47088. };
  47089. (0, vue.onUpdated)(() => {
  47090. if (scrollLeftInfo?.value) scrollToLeft(scrollLeftInfo.value);
  47091. });
  47092. expose({ scrollToLeft });
  47093. return () => {
  47094. if (props.height <= 0) return;
  47095. return (0, vue.createVNode)("div", {
  47096. "ref": headerRef,
  47097. "class": props.class,
  47098. "style": (0, vue.unref)(headerStyle),
  47099. "role": "rowgroup"
  47100. }, [(0, vue.createVNode)("div", {
  47101. "style": (0, vue.unref)(rowStyle),
  47102. "class": ns.e("header")
  47103. }, [renderDynamicRows(), renderFixedRows()])]);
  47104. };
  47105. }
  47106. });
  47107. //#endregion
  47108. //#region ../../packages/components/table-v2/src/components/row.tsx
  47109. const useTableRow = (props) => {
  47110. const { isScrolling } = (0, vue.inject)(TableV2InjectionKey);
  47111. const measured = (0, vue.ref)(false);
  47112. const rowRef = (0, vue.ref)();
  47113. const measurable = (0, vue.computed)(() => {
  47114. return isNumber(props.estimatedRowHeight) && props.rowIndex >= 0;
  47115. });
  47116. const doMeasure = (isInit = false) => {
  47117. const $rowRef = (0, vue.unref)(rowRef);
  47118. if (!$rowRef) return;
  47119. const { columns, onRowHeightChange, rowKey, rowIndex, style } = props;
  47120. const { height } = $rowRef.getBoundingClientRect();
  47121. measured.value = true;
  47122. (0, vue.nextTick)(() => {
  47123. if (isInit || height !== Number.parseInt(style.height)) {
  47124. const firstColumn = columns[0];
  47125. const isPlaceholder = firstColumn?.placeholderSign === placeholderSign;
  47126. onRowHeightChange?.({
  47127. rowKey,
  47128. height,
  47129. rowIndex
  47130. }, firstColumn && !isPlaceholder && firstColumn.fixed);
  47131. }
  47132. });
  47133. };
  47134. const eventHandlers = (0, vue.computed)(() => {
  47135. const { rowData, rowIndex, rowKey, onRowHover } = props;
  47136. const handlers = props.rowEventHandlers || {};
  47137. const eventHandlers = {};
  47138. Object.entries(handlers).forEach(([eventName, handler]) => {
  47139. if (isFunction$1(handler)) eventHandlers[eventName] = (event) => {
  47140. handler({
  47141. event,
  47142. rowData,
  47143. rowIndex,
  47144. rowKey
  47145. });
  47146. };
  47147. });
  47148. if (onRowHover) [{
  47149. name: "onMouseleave",
  47150. hovered: false
  47151. }, {
  47152. name: "onMouseenter",
  47153. hovered: true
  47154. }].forEach(({ name, hovered }) => {
  47155. const existedHandler = eventHandlers[name];
  47156. eventHandlers[name] = (event) => {
  47157. onRowHover({
  47158. event,
  47159. hovered,
  47160. rowData,
  47161. rowIndex,
  47162. rowKey
  47163. });
  47164. existedHandler?.(event);
  47165. };
  47166. });
  47167. return eventHandlers;
  47168. });
  47169. const onExpand = (expanded) => {
  47170. const { onRowExpand, rowData, rowIndex, rowKey } = props;
  47171. onRowExpand?.({
  47172. expanded,
  47173. rowData,
  47174. rowIndex,
  47175. rowKey
  47176. });
  47177. };
  47178. (0, vue.onMounted)(() => {
  47179. if ((0, vue.unref)(measurable)) doMeasure(true);
  47180. });
  47181. return {
  47182. isScrolling,
  47183. measurable,
  47184. measured,
  47185. rowRef,
  47186. eventHandlers,
  47187. onExpand
  47188. };
  47189. };
  47190. const TableV2Row = /* @__PURE__ */ (0, vue.defineComponent)({
  47191. name: "ElTableV2TableRow",
  47192. props: tableV2RowProps,
  47193. setup(props, { expose, slots, attrs }) {
  47194. const { eventHandlers, isScrolling, measurable, measured, rowRef, onExpand } = useTableRow(props);
  47195. expose({ onExpand });
  47196. return () => {
  47197. const { columns, columnsStyles, expandColumnKey, depth, rowData, rowIndex, style } = props;
  47198. let ColumnCells = columns.map((column, columnIndex) => {
  47199. const expandable = isArray$1(rowData.children) && rowData.children.length > 0 && column.key === expandColumnKey;
  47200. return slots.cell({
  47201. column,
  47202. columns,
  47203. columnIndex,
  47204. depth,
  47205. style: columnsStyles[column.key],
  47206. rowData,
  47207. rowIndex,
  47208. isScrolling: (0, vue.unref)(isScrolling),
  47209. expandIconProps: expandable ? {
  47210. rowData,
  47211. rowIndex,
  47212. onExpand
  47213. } : void 0
  47214. });
  47215. });
  47216. if (slots.row) ColumnCells = slots.row({
  47217. cells: ColumnCells.map((node) => {
  47218. if (isArray$1(node) && node.length === 1) return node[0];
  47219. return node;
  47220. }),
  47221. style,
  47222. columns,
  47223. depth,
  47224. rowData,
  47225. rowIndex,
  47226. isScrolling: (0, vue.unref)(isScrolling)
  47227. });
  47228. if ((0, vue.unref)(measurable)) {
  47229. const { height, ...exceptHeightStyle } = style || {};
  47230. const _measured = (0, vue.unref)(measured);
  47231. return (0, vue.createVNode)("div", (0, vue.mergeProps)({
  47232. "ref": rowRef,
  47233. "class": props.class,
  47234. "style": _measured ? style : exceptHeightStyle,
  47235. "role": "row"
  47236. }, attrs, (0, vue.unref)(eventHandlers)), [ColumnCells]);
  47237. }
  47238. return (0, vue.createVNode)("div", (0, vue.mergeProps)(attrs, {
  47239. "ref": rowRef,
  47240. "class": props.class,
  47241. "style": style,
  47242. "role": "row"
  47243. }, (0, vue.unref)(eventHandlers)), [ColumnCells]);
  47244. };
  47245. }
  47246. });
  47247. //#endregion
  47248. //#region ../../packages/components/table-v2/src/components/sort-icon.tsx
  47249. const SortIcon = (props) => {
  47250. const { sortOrder } = props;
  47251. return (0, vue.createVNode)("button", {
  47252. "type": "button",
  47253. "aria-label": props.ariaLabel,
  47254. "class": props.class
  47255. }, [(0, vue.createVNode)(ElIcon, { "size": 14 }, { default: () => [sortOrder === SortOrder.ASC ? (0, vue.createVNode)(sort_up_default, null, null) : (0, vue.createVNode)(sort_down_default, null, null)] })]);
  47256. };
  47257. //#endregion
  47258. //#region ../../packages/components/table-v2/src/components/expand-icon.tsx
  47259. const ExpandIcon = (props) => {
  47260. const { expanded, expandable, onExpand, style, size, ariaLabel } = props;
  47261. return (0, vue.createVNode)("button", (0, vue.mergeProps)({
  47262. onClick: expandable ? () => onExpand(!expanded) : void 0,
  47263. ariaLabel,
  47264. ariaExpanded: expanded,
  47265. class: props.class
  47266. }, { "type": "button" }), [(0, vue.createVNode)(ElIcon, {
  47267. "size": size,
  47268. "style": style
  47269. }, { default: () => [(0, vue.createVNode)(arrow_right_default, null, null)] })]);
  47270. };
  47271. ExpandIcon.inheritAttrs = false;
  47272. //#endregion
  47273. //#region ../../packages/components/table-v2/src/table-grid.tsx
  47274. const COMPONENT_NAME$5 = "ElTableV2Grid";
  47275. const useTableGrid = (props) => {
  47276. const headerRef = (0, vue.ref)();
  47277. const bodyRef = (0, vue.ref)();
  47278. const scrollLeft = (0, vue.ref)(0);
  47279. const totalHeight = (0, vue.computed)(() => {
  47280. const { data, rowHeight, estimatedRowHeight } = props;
  47281. if (estimatedRowHeight) return;
  47282. return data.length * rowHeight;
  47283. });
  47284. const fixedRowHeight = (0, vue.computed)(() => {
  47285. const { fixedData, rowHeight } = props;
  47286. return (fixedData?.length || 0) * rowHeight;
  47287. });
  47288. const headerHeight = (0, vue.computed)(() => sum(props.headerHeight));
  47289. const gridHeight = (0, vue.computed)(() => {
  47290. const { height } = props;
  47291. return Math.max(0, height - (0, vue.unref)(headerHeight) - (0, vue.unref)(fixedRowHeight));
  47292. });
  47293. const hasHeader = (0, vue.computed)(() => {
  47294. return (0, vue.unref)(headerHeight) + (0, vue.unref)(fixedRowHeight) > 0;
  47295. });
  47296. const itemKey = ({ data, rowIndex }) => data[rowIndex][props.rowKey];
  47297. function onItemRendered({ rowCacheStart, rowCacheEnd, rowVisibleStart, rowVisibleEnd }) {
  47298. props.onRowsRendered?.({
  47299. rowCacheStart,
  47300. rowCacheEnd,
  47301. rowVisibleStart,
  47302. rowVisibleEnd
  47303. });
  47304. }
  47305. function resetAfterRowIndex(index, forceUpdate) {
  47306. bodyRef.value?.resetAfterRowIndex(index, forceUpdate);
  47307. }
  47308. function scrollTo(leftOrOptions, top) {
  47309. const header$ = (0, vue.unref)(headerRef);
  47310. const body$ = (0, vue.unref)(bodyRef);
  47311. if (isObject$1(leftOrOptions)) {
  47312. header$?.scrollToLeft(leftOrOptions.scrollLeft);
  47313. scrollLeft.value = leftOrOptions.scrollLeft;
  47314. body$?.scrollTo(leftOrOptions);
  47315. } else {
  47316. header$?.scrollToLeft(leftOrOptions);
  47317. scrollLeft.value = leftOrOptions;
  47318. body$?.scrollTo({
  47319. scrollLeft: leftOrOptions,
  47320. scrollTop: top
  47321. });
  47322. }
  47323. }
  47324. function scrollToTop(scrollTop) {
  47325. (0, vue.unref)(bodyRef)?.scrollTo({ scrollTop });
  47326. }
  47327. function scrollToRow(row, strategy) {
  47328. const body = (0, vue.unref)(bodyRef);
  47329. if (!body) return;
  47330. const prevScrollLeft = scrollLeft.value;
  47331. body.scrollToItem(row, 0, strategy);
  47332. if (prevScrollLeft) scrollTo({ scrollLeft: prevScrollLeft });
  47333. }
  47334. function forceUpdate() {
  47335. (0, vue.unref)(bodyRef)?.$forceUpdate();
  47336. (0, vue.unref)(headerRef)?.$forceUpdate();
  47337. }
  47338. (0, vue.watch)(() => props.bodyWidth, () => {
  47339. if (isNumber(props.estimatedRowHeight)) bodyRef.value?.resetAfter({ columnIndex: 0 }, false);
  47340. });
  47341. return {
  47342. bodyRef,
  47343. forceUpdate,
  47344. fixedRowHeight,
  47345. gridHeight,
  47346. hasHeader,
  47347. headerHeight,
  47348. headerRef,
  47349. totalHeight,
  47350. itemKey,
  47351. onItemRendered,
  47352. resetAfterRowIndex,
  47353. scrollTo,
  47354. scrollToTop,
  47355. scrollToRow,
  47356. scrollLeft
  47357. };
  47358. };
  47359. const TableGrid = /* @__PURE__ */ (0, vue.defineComponent)({
  47360. name: COMPONENT_NAME$5,
  47361. props: tableV2GridProps,
  47362. setup(props, { slots, expose }) {
  47363. const { ns } = (0, vue.inject)(TableV2InjectionKey);
  47364. const { bodyRef, fixedRowHeight, gridHeight, hasHeader, headerRef, headerHeight, totalHeight, forceUpdate, itemKey, onItemRendered, resetAfterRowIndex, scrollTo, scrollToTop, scrollToRow, scrollLeft } = useTableGrid(props);
  47365. (0, vue.provide)(TABLE_V2_GRID_INJECTION_KEY, scrollLeft);
  47366. (0, vue.onActivated)(async () => {
  47367. await (0, vue.nextTick)();
  47368. const scrollTop = bodyRef.value?.states.scrollTop;
  47369. scrollTop && scrollToTop(Math.round(scrollTop) + 1);
  47370. });
  47371. expose({
  47372. forceUpdate,
  47373. totalHeight,
  47374. scrollTo,
  47375. scrollToTop,
  47376. scrollToRow,
  47377. resetAfterRowIndex
  47378. });
  47379. const getColumnWidth = () => props.bodyWidth;
  47380. return () => {
  47381. const { cache, columns, data, fixedData, useIsScrolling, scrollbarAlwaysOn, scrollbarEndGap, scrollbarStartGap, style, rowHeight, bodyWidth, estimatedRowHeight, headerWidth, height, width, getRowHeight, onScroll } = props;
  47382. const isDynamicRowEnabled = isNumber(estimatedRowHeight);
  47383. const Grid = isDynamicRowEnabled ? DynamicSizeGrid : FixedSizeGrid;
  47384. const _headerHeight = (0, vue.unref)(headerHeight);
  47385. return (0, vue.createVNode)("div", {
  47386. "role": "table",
  47387. "class": [ns.e("table"), props.class],
  47388. "style": style
  47389. }, [(0, vue.createVNode)(Grid, {
  47390. "ref": bodyRef,
  47391. "data": data,
  47392. "useIsScrolling": useIsScrolling,
  47393. "itemKey": itemKey,
  47394. "columnCache": 0,
  47395. "columnWidth": isDynamicRowEnabled ? getColumnWidth : bodyWidth,
  47396. "totalColumn": 1,
  47397. "totalRow": data.length,
  47398. "rowCache": cache,
  47399. "rowHeight": isDynamicRowEnabled ? getRowHeight : rowHeight,
  47400. "width": width,
  47401. "height": (0, vue.unref)(gridHeight),
  47402. "class": ns.e("body"),
  47403. "role": "rowgroup",
  47404. "scrollbarStartGap": scrollbarStartGap,
  47405. "scrollbarEndGap": scrollbarEndGap,
  47406. "scrollbarAlwaysOn": scrollbarAlwaysOn,
  47407. "onScroll": onScroll,
  47408. "onItemRendered": onItemRendered,
  47409. "perfMode": false
  47410. }, { default: (params) => {
  47411. const rowData = data[params.rowIndex];
  47412. return slots.row?.({
  47413. ...params,
  47414. columns,
  47415. rowData
  47416. });
  47417. } }), (0, vue.unref)(hasHeader) && (0, vue.createVNode)(TableV2Header, {
  47418. "ref": headerRef,
  47419. "class": ns.e("header-wrapper"),
  47420. "columns": columns,
  47421. "headerData": data,
  47422. "headerHeight": props.headerHeight,
  47423. "fixedHeaderData": fixedData,
  47424. "rowWidth": headerWidth,
  47425. "rowHeight": rowHeight,
  47426. "width": width,
  47427. "height": Math.min(_headerHeight + (0, vue.unref)(fixedRowHeight), height)
  47428. }, {
  47429. dynamic: slots.header,
  47430. fixed: slots.row
  47431. })]);
  47432. };
  47433. }
  47434. });
  47435. //#endregion
  47436. //#region ../../packages/components/table-v2/src/renderers/main-table.tsx
  47437. function _isSlot$5(s) {
  47438. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47439. }
  47440. const MainTable = (props, { slots }) => {
  47441. const { mainTableRef, ...rest } = props;
  47442. return (0, vue.createVNode)(TableGrid, (0, vue.mergeProps)({ "ref": mainTableRef }, rest), _isSlot$5(slots) ? slots : { default: () => [slots] });
  47443. };
  47444. //#endregion
  47445. //#region ../../packages/components/table-v2/src/renderers/left-table.tsx
  47446. function _isSlot$4(s) {
  47447. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47448. }
  47449. const LeftTable = (props, { slots }) => {
  47450. if (!props.columns.length) return;
  47451. const { leftTableRef, ...rest } = props;
  47452. return (0, vue.createVNode)(TableGrid, (0, vue.mergeProps)({ "ref": leftTableRef }, rest), _isSlot$4(slots) ? slots : { default: () => [slots] });
  47453. };
  47454. //#endregion
  47455. //#region ../../packages/components/table-v2/src/renderers/right-table.tsx
  47456. function _isSlot$3(s) {
  47457. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47458. }
  47459. const RightTable = (props, { slots }) => {
  47460. if (!props.columns.length) return;
  47461. const { rightTableRef, ...rest } = props;
  47462. return (0, vue.createVNode)(TableGrid, (0, vue.mergeProps)({ "ref": rightTableRef }, rest), _isSlot$3(slots) ? slots : { default: () => [slots] });
  47463. };
  47464. //#endregion
  47465. //#region ../../packages/components/table-v2/src/renderers/row.tsx
  47466. function _isSlot$2(s) {
  47467. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47468. }
  47469. const RowRenderer = (props, { slots }) => {
  47470. const { columns, columnsStyles, depthMap, expandColumnKey, expandedRowKeys, estimatedRowHeight, hasFixedColumns, rowData, rowIndex, style, isScrolling, rowProps, rowClass, rowKey, rowEventHandlers, ns, onRowHovered, onRowExpanded } = props;
  47471. const rowKls = tryCall(rowClass, {
  47472. columns,
  47473. rowData,
  47474. rowIndex
  47475. }, "");
  47476. const additionalProps = tryCall(rowProps, {
  47477. columns,
  47478. rowData,
  47479. rowIndex
  47480. });
  47481. const _rowKey = rowData[rowKey];
  47482. const depth = depthMap[_rowKey] || 0;
  47483. const canExpand = Boolean(expandColumnKey);
  47484. const isFixedRow = rowIndex < 0;
  47485. const kls = [
  47486. ns.e("row"),
  47487. rowKls,
  47488. ns.is("expanded", canExpand && expandedRowKeys.includes(_rowKey)),
  47489. ns.is("fixed", !depth && isFixedRow),
  47490. ns.is("customized", Boolean(slots.row)),
  47491. { [ns.e(`row-depth-${depth}`)]: canExpand && rowIndex >= 0 }
  47492. ];
  47493. const onRowHover = hasFixedColumns ? onRowHovered : void 0;
  47494. const _rowProps = {
  47495. ...additionalProps,
  47496. columns,
  47497. columnsStyles,
  47498. class: kls,
  47499. depth,
  47500. expandColumnKey,
  47501. estimatedRowHeight: isFixedRow ? void 0 : estimatedRowHeight,
  47502. isScrolling,
  47503. rowIndex,
  47504. rowData,
  47505. rowKey: _rowKey,
  47506. rowEventHandlers,
  47507. style
  47508. };
  47509. const handlerMouseEnter = (e) => {
  47510. onRowHover?.({
  47511. hovered: true,
  47512. rowKey: _rowKey,
  47513. event: e,
  47514. rowData,
  47515. rowIndex
  47516. });
  47517. };
  47518. const handlerMouseLeave = (e) => {
  47519. onRowHover?.({
  47520. hovered: false,
  47521. rowKey: _rowKey,
  47522. event: e,
  47523. rowData,
  47524. rowIndex
  47525. });
  47526. };
  47527. return (0, vue.createVNode)(TableV2Row, (0, vue.mergeProps)(_rowProps, {
  47528. "onRowExpand": onRowExpanded,
  47529. "onMouseenter": handlerMouseEnter,
  47530. "onMouseleave": handlerMouseLeave,
  47531. "rowkey": _rowKey
  47532. }), _isSlot$2(slots) ? slots : { default: () => [slots] });
  47533. };
  47534. //#endregion
  47535. //#region ../../packages/components/table-v2/src/renderers/cell.tsx
  47536. const CellRenderer = ({ columns, column, columnIndex, depth, expandIconProps, isScrolling, rowData, rowIndex, style, expandedRowKeys, ns, t, cellProps: _cellProps, expandColumnKey, indentSize, iconSize, rowKey }, { slots }) => {
  47537. const cellStyle = enforceUnit(style);
  47538. if (column.placeholderSign === placeholderSign) return (0, vue.createVNode)("div", {
  47539. "class": ns.em("row-cell", "placeholder"),
  47540. "style": cellStyle
  47541. }, null);
  47542. const { cellRenderer, dataKey, dataGetter } = column;
  47543. const cellData = isFunction$1(dataGetter) ? dataGetter({
  47544. columns,
  47545. column,
  47546. columnIndex,
  47547. rowData,
  47548. rowIndex
  47549. }) : get(rowData, dataKey ?? "");
  47550. const extraCellProps = tryCall(_cellProps, {
  47551. cellData,
  47552. columns,
  47553. column,
  47554. columnIndex,
  47555. rowIndex,
  47556. rowData
  47557. });
  47558. const cellProps = {
  47559. class: ns.e("cell-text"),
  47560. columns,
  47561. column,
  47562. columnIndex,
  47563. cellData,
  47564. isScrolling,
  47565. rowData,
  47566. rowIndex
  47567. };
  47568. const columnCellRenderer = componentToSlot(cellRenderer);
  47569. const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : (0, vue.renderSlot)(slots, "default", cellProps, () => [(0, vue.createVNode)(TableV2Cell, cellProps, null)]);
  47570. const kls = [
  47571. ns.e("row-cell"),
  47572. column.class,
  47573. column.align === Alignment.CENTER && ns.is("align-center"),
  47574. column.align === Alignment.RIGHT && ns.is("align-right")
  47575. ];
  47576. const expandable = rowIndex >= 0 && expandColumnKey && column.key === expandColumnKey;
  47577. const expanded = rowIndex >= 0 && expandedRowKeys.includes(rowData[rowKey]);
  47578. let IconOrPlaceholder;
  47579. const iconStyle = `margin-inline-start: ${depth * indentSize}px;`;
  47580. if (expandable) if (isObject$1(expandIconProps)) IconOrPlaceholder = (0, vue.createVNode)(ExpandIcon, (0, vue.mergeProps)(expandIconProps, {
  47581. "class": [ns.e("expand-icon"), ns.is("expanded", expanded)],
  47582. "size": iconSize,
  47583. "expanded": expanded,
  47584. "ariaLabel": t(expanded ? "el.table.collapseRowLabel" : "el.table.expandRowLabel"),
  47585. "style": iconStyle,
  47586. "expandable": true
  47587. }), null);
  47588. else IconOrPlaceholder = (0, vue.createVNode)("div", { "style": [iconStyle, `width: ${iconSize}px; height: ${iconSize}px;`].join(" ") }, null);
  47589. return (0, vue.createVNode)("div", (0, vue.mergeProps)({
  47590. "class": kls,
  47591. "style": cellStyle
  47592. }, extraCellProps, { "role": "cell" }), [IconOrPlaceholder, Cell]);
  47593. };
  47594. CellRenderer.inheritAttrs = false;
  47595. //#endregion
  47596. //#region ../../packages/components/table-v2/src/renderers/header.tsx
  47597. function _isSlot$1(s) {
  47598. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47599. }
  47600. const HeaderRenderer = ({ columns, columnsStyles, headerIndex, style, headerClass, headerProps, ns }, { slots }) => {
  47601. const param = {
  47602. columns,
  47603. headerIndex
  47604. };
  47605. const kls = [
  47606. ns.e("header-row"),
  47607. tryCall(headerClass, param, ""),
  47608. ns.is("customized", Boolean(slots.header))
  47609. ];
  47610. return (0, vue.createVNode)(TableV2HeaderRow, {
  47611. ...tryCall(headerProps, param),
  47612. columnsStyles,
  47613. class: kls,
  47614. columns,
  47615. headerIndex,
  47616. style
  47617. }, _isSlot$1(slots) ? slots : { default: () => [slots] });
  47618. };
  47619. //#endregion
  47620. //#region ../../packages/components/table-v2/src/renderers/header-cell.tsx
  47621. const HeaderCellRenderer = (props, { slots }) => {
  47622. const { column, ns, t, style, onColumnSorted } = props;
  47623. const cellStyle = enforceUnit(style);
  47624. if (column.placeholderSign === placeholderSign) return (0, vue.createVNode)("div", {
  47625. "class": ns.em("header-row-cell", "placeholder"),
  47626. "style": cellStyle
  47627. }, null);
  47628. const { headerCellRenderer, headerClass, sortable } = column;
  47629. /**
  47630. * render Cell children
  47631. */
  47632. const cellProps = {
  47633. ...props,
  47634. class: ns.e("header-cell-text")
  47635. };
  47636. const columnCellRenderer = componentToSlot(headerCellRenderer);
  47637. const Cell = columnCellRenderer ? columnCellRenderer(cellProps) : (0, vue.renderSlot)(slots, "default", cellProps, () => [(0, vue.createVNode)(HeaderCell, cellProps, null)]);
  47638. /**
  47639. * Render cell container and sort indicator
  47640. */
  47641. const { sortBy, sortState, headerCellProps } = props;
  47642. let sorting, sortOrder, ariaSort;
  47643. if (sortState) {
  47644. const order = sortState[column.key];
  47645. sorting = Boolean(oppositeOrderMap[order]);
  47646. sortOrder = sorting ? order : SortOrder.ASC;
  47647. } else {
  47648. sorting = column.key === sortBy.key;
  47649. sortOrder = sorting ? sortBy.order : SortOrder.ASC;
  47650. }
  47651. if (sortOrder === SortOrder.ASC) ariaSort = "ascending";
  47652. else if (sortOrder === SortOrder.DESC) ariaSort = "descending";
  47653. else ariaSort = void 0;
  47654. const cellKls = [
  47655. ns.e("header-cell"),
  47656. tryCall(headerClass, props, ""),
  47657. column.align === Alignment.CENTER && ns.is("align-center"),
  47658. column.align === Alignment.RIGHT && ns.is("align-right"),
  47659. sortable && ns.is("sortable")
  47660. ];
  47661. return (0, vue.createVNode)("div", (0, vue.mergeProps)({
  47662. ...tryCall(headerCellProps, props),
  47663. onClick: column.sortable ? onColumnSorted : void 0,
  47664. ariaSort: sortable ? ariaSort : void 0,
  47665. class: cellKls,
  47666. style: cellStyle,
  47667. ["data-key"]: column.key
  47668. }, { "role": "columnheader" }), [Cell, sortable && (0, vue.createVNode)(SortIcon, {
  47669. "class": [ns.e("sort-icon"), sorting && ns.is("sorting")],
  47670. "sortOrder": sortOrder,
  47671. "ariaLabel": t("el.table.sortLabel", { column: column.title || "" })
  47672. }, null)]);
  47673. };
  47674. //#endregion
  47675. //#region ../../packages/components/table-v2/src/renderers/footer.tsx
  47676. const Footer$1 = (props, { slots }) => {
  47677. return (0, vue.createVNode)("div", {
  47678. "class": props.class,
  47679. "style": props.style
  47680. }, [slots.default?.()]);
  47681. };
  47682. Footer$1.displayName = "ElTableV2Footer";
  47683. //#endregion
  47684. //#region ../../packages/components/table-v2/src/renderers/empty.tsx
  47685. const Footer = (props, { slots }) => {
  47686. const defaultSlot = (0, vue.renderSlot)(slots, "default", {}, () => [(0, vue.createVNode)(ElEmpty, null, null)]);
  47687. return (0, vue.createVNode)("div", {
  47688. "class": props.class,
  47689. "style": props.style
  47690. }, [defaultSlot]);
  47691. };
  47692. Footer.displayName = "ElTableV2Empty";
  47693. //#endregion
  47694. //#region ../../packages/components/table-v2/src/renderers/overlay.tsx
  47695. const Overlay = (props, { slots }) => {
  47696. return (0, vue.createVNode)("div", {
  47697. "class": props.class,
  47698. "style": props.style
  47699. }, [slots.default?.()]);
  47700. };
  47701. Overlay.displayName = "ElTableV2Overlay";
  47702. //#endregion
  47703. //#region ../../packages/components/table-v2/src/table-v2.tsx
  47704. function _isSlot(s) {
  47705. return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
  47706. }
  47707. const TableV2 = /* @__PURE__ */ (0, vue.defineComponent)({
  47708. name: "ElTableV2",
  47709. props: tableV2Props,
  47710. setup(props, { slots, expose }) {
  47711. const ns = useNamespace("table-v2");
  47712. const { t } = useLocale();
  47713. const { columnsStyles, fixedColumnsOnLeft, fixedColumnsOnRight, mainColumns, mainTableHeight, fixedTableHeight, leftTableWidth, rightTableWidth, data, depthMap, expandedRowKeys, hasFixedColumns, mainTableRef, leftTableRef, rightTableRef, isDynamic, isResetting, isScrolling, bodyWidth, emptyStyle, rootStyle, footerHeight, showEmpty, scrollTo, scrollToLeft, scrollToTop, scrollToRow, getRowHeight, onColumnSorted, onRowHeightChange, onRowHovered, onRowExpanded, onRowsRendered, onScroll, onVerticalScroll } = useTable(props);
  47714. expose({
  47715. scrollTo,
  47716. scrollToLeft,
  47717. scrollToTop,
  47718. scrollToRow
  47719. });
  47720. (0, vue.provide)(TableV2InjectionKey, {
  47721. ns,
  47722. isResetting,
  47723. isScrolling
  47724. });
  47725. return () => {
  47726. const { cache, cellProps, estimatedRowHeight, expandColumnKey, fixedData, headerHeight, headerClass, headerProps, headerCellProps, sortBy, sortState, rowHeight, rowClass, rowEventHandlers, rowKey, rowProps, scrollbarAlwaysOn, indentSize, iconSize, useIsScrolling, vScrollbarSize, width } = props;
  47727. const _data = (0, vue.unref)(data);
  47728. const mainTableProps = {
  47729. cache,
  47730. class: ns.e("main"),
  47731. columns: (0, vue.unref)(mainColumns),
  47732. data: _data,
  47733. fixedData,
  47734. estimatedRowHeight,
  47735. bodyWidth: (0, vue.unref)(bodyWidth),
  47736. headerHeight,
  47737. headerWidth: (0, vue.unref)(bodyWidth),
  47738. height: (0, vue.unref)(mainTableHeight),
  47739. mainTableRef,
  47740. rowKey,
  47741. rowHeight,
  47742. scrollbarAlwaysOn,
  47743. scrollbarStartGap: 2,
  47744. scrollbarEndGap: vScrollbarSize,
  47745. useIsScrolling,
  47746. width,
  47747. getRowHeight,
  47748. onRowsRendered,
  47749. onScroll
  47750. };
  47751. const leftColumnsWidth = (0, vue.unref)(leftTableWidth);
  47752. const _fixedTableHeight = (0, vue.unref)(fixedTableHeight);
  47753. const leftTableProps = {
  47754. cache,
  47755. class: ns.e("left"),
  47756. columns: (0, vue.unref)(fixedColumnsOnLeft),
  47757. data: _data,
  47758. fixedData,
  47759. estimatedRowHeight,
  47760. leftTableRef,
  47761. rowHeight,
  47762. bodyWidth: leftColumnsWidth,
  47763. headerWidth: leftColumnsWidth,
  47764. headerHeight,
  47765. height: _fixedTableHeight,
  47766. rowKey,
  47767. scrollbarAlwaysOn,
  47768. scrollbarStartGap: 2,
  47769. scrollbarEndGap: vScrollbarSize,
  47770. useIsScrolling,
  47771. width: leftColumnsWidth,
  47772. getRowHeight,
  47773. onScroll: onVerticalScroll
  47774. };
  47775. const rightColumnsWidth = (0, vue.unref)(rightTableWidth);
  47776. const rightTableProps = {
  47777. cache,
  47778. class: ns.e("right"),
  47779. columns: (0, vue.unref)(fixedColumnsOnRight),
  47780. data: _data,
  47781. fixedData,
  47782. estimatedRowHeight,
  47783. rightTableRef,
  47784. rowHeight,
  47785. bodyWidth: rightColumnsWidth,
  47786. headerWidth: rightColumnsWidth,
  47787. headerHeight,
  47788. height: _fixedTableHeight,
  47789. rowKey,
  47790. scrollbarAlwaysOn,
  47791. scrollbarStartGap: 2,
  47792. scrollbarEndGap: vScrollbarSize,
  47793. width: rightColumnsWidth,
  47794. style: `${ns.cssVarName("table-scrollbar-size")}: ${vScrollbarSize}px`,
  47795. useIsScrolling,
  47796. getRowHeight,
  47797. onScroll: onVerticalScroll
  47798. };
  47799. const _columnsStyles = (0, vue.unref)(columnsStyles);
  47800. const tableRowProps = {
  47801. ns,
  47802. depthMap: (0, vue.unref)(depthMap),
  47803. columnsStyles: _columnsStyles,
  47804. expandColumnKey,
  47805. expandedRowKeys: (0, vue.unref)(expandedRowKeys),
  47806. estimatedRowHeight,
  47807. hasFixedColumns: (0, vue.unref)(hasFixedColumns),
  47808. rowProps,
  47809. rowClass,
  47810. rowKey,
  47811. rowEventHandlers,
  47812. onRowHovered,
  47813. onRowExpanded,
  47814. onRowHeightChange
  47815. };
  47816. const tableCellProps = {
  47817. cellProps,
  47818. expandColumnKey,
  47819. indentSize,
  47820. iconSize,
  47821. rowKey,
  47822. expandedRowKeys: (0, vue.unref)(expandedRowKeys),
  47823. ns,
  47824. t
  47825. };
  47826. const tableHeaderProps = {
  47827. ns,
  47828. headerClass,
  47829. headerProps,
  47830. columnsStyles: _columnsStyles
  47831. };
  47832. const tableHeaderCellProps = {
  47833. ns,
  47834. t,
  47835. sortBy,
  47836. sortState,
  47837. headerCellProps,
  47838. onColumnSorted
  47839. };
  47840. const tableSlots = {
  47841. row: (props) => (0, vue.createVNode)(RowRenderer, (0, vue.mergeProps)(props, tableRowProps), {
  47842. row: slots.row,
  47843. cell: (props) => {
  47844. let _slot;
  47845. return slots.cell ? (0, vue.createVNode)(CellRenderer, (0, vue.mergeProps)(props, tableCellProps, { "style": _columnsStyles[props.column.key] }), _isSlot(_slot = slots.cell(props)) ? _slot : { default: () => [_slot] }) : (0, vue.createVNode)(CellRenderer, (0, vue.mergeProps)(props, tableCellProps, { "style": _columnsStyles[props.column.key] }), null);
  47846. }
  47847. }),
  47848. header: (props) => (0, vue.createVNode)(HeaderRenderer, (0, vue.mergeProps)(props, tableHeaderProps), {
  47849. header: slots.header,
  47850. cell: (props) => {
  47851. let _slot2;
  47852. return slots["header-cell"] ? (0, vue.createVNode)(HeaderCellRenderer, (0, vue.mergeProps)(props, tableHeaderCellProps, { "style": _columnsStyles[props.column.key] }), _isSlot(_slot2 = slots["header-cell"](props)) ? _slot2 : { default: () => [_slot2] }) : (0, vue.createVNode)(HeaderCellRenderer, (0, vue.mergeProps)(props, tableHeaderCellProps, { "style": _columnsStyles[props.column.key] }), null);
  47853. }
  47854. })
  47855. };
  47856. const rootKls = [
  47857. props.class,
  47858. ns.b(),
  47859. ns.e("root"),
  47860. ns.is("dynamic", (0, vue.unref)(isDynamic))
  47861. ];
  47862. const footerProps = {
  47863. class: ns.e("footer"),
  47864. style: (0, vue.unref)(footerHeight)
  47865. };
  47866. return (0, vue.createVNode)("div", {
  47867. "class": rootKls,
  47868. "style": (0, vue.unref)(rootStyle)
  47869. }, [
  47870. (0, vue.createVNode)(MainTable, mainTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47871. (0, vue.createVNode)(LeftTable, leftTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47872. (0, vue.createVNode)(RightTable, rightTableProps, _isSlot(tableSlots) ? tableSlots : { default: () => [tableSlots] }),
  47873. slots.footer && (0, vue.createVNode)(Footer$1, footerProps, { default: slots.footer }),
  47874. (0, vue.unref)(showEmpty) && (0, vue.createVNode)(Footer, {
  47875. "class": ns.e("empty"),
  47876. "style": (0, vue.unref)(emptyStyle)
  47877. }, { default: slots.empty }),
  47878. slots.overlay && (0, vue.createVNode)(Overlay, { "class": ns.e("overlay") }, { default: slots.overlay })
  47879. ]);
  47880. };
  47881. }
  47882. });
  47883. //#endregion
  47884. //#region ../../packages/components/table-v2/src/auto-resizer.ts
  47885. const autoResizerProps = buildProps({
  47886. disableWidth: Boolean,
  47887. disableHeight: Boolean,
  47888. onResize: { type: definePropType(Function) }
  47889. });
  47890. //#endregion
  47891. //#region ../../packages/components/table-v2/src/components/auto-resizer.tsx
  47892. const AutoResizer = /* @__PURE__ */ (0, vue.defineComponent)({
  47893. name: "ElAutoResizer",
  47894. props: autoResizerProps,
  47895. setup(props, { slots }) {
  47896. const ns = useNamespace("auto-resizer");
  47897. const { height, width, sizer } = useAutoResize(props);
  47898. const style = {
  47899. width: "100%",
  47900. height: "100%"
  47901. };
  47902. return () => {
  47903. return (0, vue.createVNode)("div", {
  47904. "ref": sizer,
  47905. "class": ns.b(),
  47906. "style": style
  47907. }, [slots.default?.({
  47908. height: height.value,
  47909. width: width.value
  47910. })]);
  47911. };
  47912. }
  47913. });
  47914. //#endregion
  47915. //#region ../../packages/components/table-v2/index.ts
  47916. const ElTableV2 = withInstall(TableV2);
  47917. const ElAutoResizer = withInstall(AutoResizer);
  47918. //#endregion
  47919. //#region ../../packages/components/tabs/src/constants.ts
  47920. const tabsRootContextKey = Symbol("tabsRootContextKey");
  47921. //#endregion
  47922. //#region ../../packages/components/tabs/src/tab-bar.ts
  47923. /**
  47924. * @deprecated Removed after 3.0.0, Use `TabBarProps` instead.
  47925. */
  47926. const tabBarProps = buildProps({
  47927. tabs: {
  47928. type: definePropType(Array),
  47929. default: () => mutable([])
  47930. },
  47931. tabRefs: {
  47932. type: definePropType(Object),
  47933. default: () => mutable({})
  47934. }
  47935. });
  47936. //#endregion
  47937. //#region ../../packages/components/tabs/src/tab-bar.vue?vue&type=script&setup=true&lang.ts
  47938. const COMPONENT_NAME$4 = "ElTabBar";
  47939. var tab_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  47940. name: COMPONENT_NAME$4,
  47941. __name: "tab-bar",
  47942. props: tabBarProps,
  47943. setup(__props, { expose: __expose }) {
  47944. const props = __props;
  47945. const rootTabs = (0, vue.inject)(tabsRootContextKey);
  47946. if (!rootTabs) throwError(COMPONENT_NAME$4, "<el-tabs><el-tab-bar /></el-tabs>");
  47947. const ns = useNamespace("tabs");
  47948. const barRef = (0, vue.ref)();
  47949. const barStyle = (0, vue.ref)();
  47950. /**
  47951. * when defaultValue is not set, the bar is always shown.
  47952. *
  47953. * when defaultValue is set, the bar will be hidden until style is calculated
  47954. * to avoid the bar showing in the wrong position on initial render.
  47955. */
  47956. const renderActiveBar = (0, vue.computed)(() => isUndefined(rootTabs.props.defaultValue) || Boolean(barStyle.value?.transform));
  47957. const getBarStyle = () => {
  47958. let offset = 0;
  47959. let tabSize = 0;
  47960. const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
  47961. const sizeDir = sizeName === "width" ? "x" : "y";
  47962. const position = sizeDir === "x" ? "left" : "top";
  47963. props.tabs.every((tab) => {
  47964. if (isUndefined(tab.paneName)) return false;
  47965. const $el = props.tabRefs[tab.paneName];
  47966. if (!$el) return false;
  47967. if (!tab.active) return true;
  47968. offset = $el[`offset${capitalize(position)}`];
  47969. tabSize = $el[`client${capitalize(sizeName)}`];
  47970. const tabStyles = window.getComputedStyle($el);
  47971. if (sizeName === "width") {
  47972. tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
  47973. offset += Number.parseFloat(tabStyles.paddingLeft);
  47974. }
  47975. return false;
  47976. });
  47977. return {
  47978. [sizeName]: `${tabSize}px`,
  47979. transform: `translate${capitalize(sizeDir)}(${offset}px)`
  47980. };
  47981. };
  47982. const update = () => barStyle.value = getBarStyle();
  47983. const tabObservers = [];
  47984. const observerTabs = () => {
  47985. tabObservers.forEach((observer) => observer.stop());
  47986. tabObservers.length = 0;
  47987. Object.values(props.tabRefs).forEach((tab) => {
  47988. tabObservers.push(useResizeObserver(tab, update));
  47989. });
  47990. };
  47991. (0, vue.watch)(() => props.tabs, async () => {
  47992. await (0, vue.nextTick)();
  47993. update();
  47994. observerTabs();
  47995. }, { immediate: true });
  47996. const barObserver = useResizeObserver(barRef, () => update());
  47997. (0, vue.onBeforeUnmount)(() => {
  47998. tabObservers.forEach((observer) => observer.stop());
  47999. tabObservers.length = 0;
  48000. barObserver.stop();
  48001. });
  48002. __expose({
  48003. ref: barRef,
  48004. update
  48005. });
  48006. return (_ctx, _cache) => {
  48007. return renderActiveBar.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48008. key: 0,
  48009. ref_key: "barRef",
  48010. ref: barRef,
  48011. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("active-bar"), (0, vue.unref)(ns).is((0, vue.unref)(rootTabs).props.tabPosition)]),
  48012. style: (0, vue.normalizeStyle)(barStyle.value)
  48013. }, null, 6)) : (0, vue.createCommentVNode)("v-if", true);
  48014. };
  48015. }
  48016. });
  48017. //#endregion
  48018. //#region ../../packages/components/tabs/src/tab-bar.vue
  48019. var tab_bar_default = tab_bar_vue_vue_type_script_setup_true_lang_default;
  48020. //#endregion
  48021. //#region ../../packages/components/tabs/src/tab-nav.tsx
  48022. const tabNavProps = buildProps({
  48023. panes: {
  48024. type: definePropType(Array),
  48025. default: () => mutable([])
  48026. },
  48027. currentName: {
  48028. type: [String, Number],
  48029. default: ""
  48030. },
  48031. editable: Boolean,
  48032. type: {
  48033. type: String,
  48034. values: [
  48035. "card",
  48036. "border-card",
  48037. ""
  48038. ],
  48039. default: ""
  48040. },
  48041. stretch: Boolean,
  48042. tabindex: {
  48043. type: [String, Number],
  48044. default: void 0
  48045. }
  48046. });
  48047. const tabNavEmits = {
  48048. tabClick: (tab, tabName, ev) => ev instanceof Event,
  48049. tabRemove: (tab, ev) => ev instanceof Event
  48050. };
  48051. const COMPONENT_NAME$3 = "ElTabNav";
  48052. const TabNav = /* @__PURE__ */ (0, vue.defineComponent)({
  48053. name: COMPONENT_NAME$3,
  48054. props: tabNavProps,
  48055. emits: tabNavEmits,
  48056. setup(props, { expose, emit }) {
  48057. const rootTabs = (0, vue.inject)(tabsRootContextKey);
  48058. if (!rootTabs) throwError(COMPONENT_NAME$3, `<el-tabs><tab-nav /></el-tabs>`);
  48059. const ns = useNamespace("tabs");
  48060. const visibility = useDocumentVisibility();
  48061. const focused = useWindowFocus();
  48062. const navScroll$ = (0, vue.ref)();
  48063. const nav$ = (0, vue.ref)();
  48064. const el$ = (0, vue.ref)();
  48065. const tabRefsMap = (0, vue.ref)({});
  48066. const tabBarRef = (0, vue.ref)();
  48067. const scrollable = (0, vue.ref)(false);
  48068. const navOffset = (0, vue.ref)(0);
  48069. const isFocus = (0, vue.ref)(false);
  48070. const focusable = (0, vue.ref)(true);
  48071. const tracker = (0, vue.shallowRef)();
  48072. const isHorizontal = (0, vue.computed)(() => ["top", "bottom"].includes(rootTabs.props.tabPosition));
  48073. const sizeName = (0, vue.computed)(() => isHorizontal.value ? "width" : "height");
  48074. const navStyle = (0, vue.computed)(() => {
  48075. return { transform: `translate${sizeName.value === "width" ? "X" : "Y"}(-${navOffset.value}px)` };
  48076. });
  48077. const { width: navContainerWidth, height: navContainerHeight } = useElementSize(navScroll$);
  48078. const { width: navWidth, height: navHeight } = useElementSize(nav$, {
  48079. width: 0,
  48080. height: 0
  48081. }, { box: "border-box" });
  48082. const navContainerSize = (0, vue.computed)(() => isHorizontal.value ? navContainerWidth.value : navContainerHeight.value);
  48083. const navSize = (0, vue.computed)(() => isHorizontal.value ? navWidth.value : navHeight.value);
  48084. const { onWheel } = useWheel({
  48085. atStartEdge: (0, vue.computed)(() => navOffset.value <= 0),
  48086. atEndEdge: (0, vue.computed)(() => navSize.value - navOffset.value <= navContainerSize.value),
  48087. layout: (0, vue.computed)(() => isHorizontal.value ? "horizontal" : "vertical")
  48088. }, (offset) => {
  48089. navOffset.value = clamp$1(navOffset.value + offset, 0, navSize.value - navContainerSize.value);
  48090. });
  48091. const scrollPrev = () => {
  48092. if (!navScroll$.value) return;
  48093. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48094. const currentOffset = navOffset.value;
  48095. if (!currentOffset) return;
  48096. navOffset.value = currentOffset > containerSize ? currentOffset - containerSize : 0;
  48097. };
  48098. const scrollNext = () => {
  48099. if (!navScroll$.value || !nav$.value) return;
  48100. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  48101. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48102. const currentOffset = navOffset.value;
  48103. if (navSize - currentOffset <= containerSize) return;
  48104. navOffset.value = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize;
  48105. };
  48106. const scrollToActiveTab = async () => {
  48107. const nav = nav$.value;
  48108. if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return;
  48109. await (0, vue.nextTick)();
  48110. const activeTab = tabRefsMap.value[props.currentName];
  48111. if (!activeTab) return;
  48112. const navScroll = navScroll$.value;
  48113. const activeTabBounding = activeTab.getBoundingClientRect();
  48114. const navScrollBounding = navScroll.getBoundingClientRect();
  48115. const maxOffset = isHorizontal.value ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height;
  48116. const currentOffset = navOffset.value;
  48117. let newOffset = currentOffset;
  48118. if (isHorizontal.value) {
  48119. if (activeTabBounding.left < navScrollBounding.left) newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left);
  48120. if (activeTabBounding.right > navScrollBounding.right) newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right;
  48121. } else {
  48122. if (activeTabBounding.top < navScrollBounding.top) newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top);
  48123. if (activeTabBounding.bottom > navScrollBounding.bottom) newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom);
  48124. }
  48125. newOffset = Math.max(newOffset, 0);
  48126. navOffset.value = Math.min(newOffset, maxOffset);
  48127. };
  48128. const update = () => {
  48129. if (!nav$.value || !navScroll$.value) return;
  48130. props.stretch && tabBarRef.value?.update();
  48131. const navSize = nav$.value[`offset${capitalize(sizeName.value)}`];
  48132. const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`];
  48133. const currentOffset = navOffset.value;
  48134. if (containerSize < navSize) {
  48135. scrollable.value = scrollable.value || {};
  48136. scrollable.value.prev = currentOffset;
  48137. scrollable.value.next = currentOffset + containerSize < navSize;
  48138. if (navSize - currentOffset < containerSize) navOffset.value = navSize - containerSize;
  48139. } else {
  48140. scrollable.value = false;
  48141. if (currentOffset > 0) navOffset.value = 0;
  48142. }
  48143. };
  48144. const changeTab = (event) => {
  48145. const code = getEventCode(event);
  48146. let step = 0;
  48147. switch (code) {
  48148. case EVENT_CODE.left:
  48149. case EVENT_CODE.up:
  48150. step = -1;
  48151. break;
  48152. case EVENT_CODE.right:
  48153. case EVENT_CODE.down:
  48154. step = 1;
  48155. break;
  48156. default: return;
  48157. }
  48158. const tabList = Array.from(event.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)"));
  48159. let nextIndex = tabList.indexOf(event.target) + step;
  48160. if (nextIndex < 0) nextIndex = tabList.length - 1;
  48161. else if (nextIndex >= tabList.length) nextIndex = 0;
  48162. tabList[nextIndex].focus({ preventScroll: true });
  48163. tabList[nextIndex].click();
  48164. setFocus();
  48165. };
  48166. const setFocus = () => {
  48167. if (focusable.value) isFocus.value = true;
  48168. };
  48169. const removeFocus = () => isFocus.value = false;
  48170. const setRefs = (el, key) => {
  48171. tabRefsMap.value[key] = el;
  48172. };
  48173. const focusActiveTab = async () => {
  48174. await (0, vue.nextTick)();
  48175. tabRefsMap.value[props.currentName]?.focus({ preventScroll: true });
  48176. };
  48177. (0, vue.watch)(visibility, (visibility) => {
  48178. if (visibility === "hidden") focusable.value = false;
  48179. else if (visibility === "visible") setTimeout(() => focusable.value = true, 50);
  48180. });
  48181. (0, vue.watch)(focused, (focused) => {
  48182. if (focused) setTimeout(() => focusable.value = true, 50);
  48183. else focusable.value = false;
  48184. });
  48185. useResizeObserver(el$, () => {
  48186. rAF(update);
  48187. });
  48188. (0, vue.onMounted)(() => setTimeout(() => scrollToActiveTab(), 0));
  48189. (0, vue.onUpdated)(() => update());
  48190. expose({
  48191. scrollToActiveTab,
  48192. removeFocus,
  48193. focusActiveTab,
  48194. tabListRef: nav$,
  48195. tabBarRef,
  48196. scheduleRender: () => (0, vue.triggerRef)(tracker)
  48197. });
  48198. return () => {
  48199. const scrollBtn = scrollable.value ? [(0, vue.createVNode)("span", {
  48200. "class": [ns.e("nav-prev"), ns.is("disabled", !scrollable.value.prev)],
  48201. "onClick": scrollPrev
  48202. }, [(0, vue.createVNode)(ElIcon, null, { default: () => [(0, vue.createVNode)(arrow_left_default, null, null)] })]), (0, vue.createVNode)("span", {
  48203. "class": [ns.e("nav-next"), ns.is("disabled", !scrollable.value.next)],
  48204. "onClick": scrollNext
  48205. }, [(0, vue.createVNode)(ElIcon, null, { default: () => [(0, vue.createVNode)(arrow_right_default, null, null)] })])] : null;
  48206. const tabs = props.panes.map((pane, index) => {
  48207. const uid = pane.uid;
  48208. const disabled = pane.props.disabled;
  48209. const tabName = pane.props.name ?? pane.index ?? `${index}`;
  48210. const closable = !disabled && (pane.isClosable || pane.props.closable !== false && props.editable);
  48211. pane.index = `${index}`;
  48212. const btnClose = closable ? (0, vue.createVNode)(ElIcon, {
  48213. "class": "is-icon-close",
  48214. "onClick": (ev) => emit("tabRemove", pane, ev)
  48215. }, { default: () => [(0, vue.createVNode)(close_default, null, null)] }) : null;
  48216. const tabLabelContent = pane.slots.label?.() || pane.props.label;
  48217. const tabindex = !disabled && pane.active ? props.tabindex ?? rootTabs.props.tabindex : -1;
  48218. return (0, vue.createVNode)("div", {
  48219. "ref": (el) => setRefs(el, tabName),
  48220. "class": [
  48221. ns.e("item"),
  48222. ns.is(rootTabs.props.tabPosition),
  48223. ns.is("active", pane.active),
  48224. ns.is("disabled", disabled),
  48225. ns.is("closable", closable),
  48226. ns.is("focus", isFocus.value)
  48227. ],
  48228. "id": `tab-${tabName}`,
  48229. "key": `tab-${uid}`,
  48230. "aria-controls": `pane-${tabName}`,
  48231. "role": "tab",
  48232. "aria-selected": pane.active,
  48233. "tabindex": tabindex,
  48234. "onFocus": () => setFocus(),
  48235. "onBlur": () => removeFocus(),
  48236. "onClick": (ev) => {
  48237. removeFocus();
  48238. emit("tabClick", pane, tabName, ev);
  48239. },
  48240. "onKeydown": (ev) => {
  48241. const code = getEventCode(ev);
  48242. if (closable && (code === EVENT_CODE.delete || code === EVENT_CODE.backspace)) emit("tabRemove", pane, ev);
  48243. }
  48244. }, [...[tabLabelContent, btnClose]]);
  48245. });
  48246. tracker.value;
  48247. return (0, vue.createVNode)("div", {
  48248. "ref": el$,
  48249. "class": [
  48250. ns.e("nav-wrap"),
  48251. ns.is("scrollable", !!scrollable.value),
  48252. ns.is(rootTabs.props.tabPosition)
  48253. ]
  48254. }, [scrollBtn, (0, vue.createVNode)("div", {
  48255. "class": ns.e("nav-scroll"),
  48256. "ref": navScroll$
  48257. }, [props.panes.length > 0 ? (0, vue.createVNode)("div", {
  48258. "class": [
  48259. ns.e("nav"),
  48260. ns.is(rootTabs.props.tabPosition),
  48261. ns.is("stretch", props.stretch && ["top", "bottom"].includes(rootTabs.props.tabPosition))
  48262. ],
  48263. "ref": nav$,
  48264. "style": navStyle.value,
  48265. "role": "tablist",
  48266. "onKeydown": changeTab,
  48267. "onWheel": onWheel
  48268. }, [...[!props.type ? (0, vue.createVNode)(tab_bar_default, {
  48269. "ref": tabBarRef,
  48270. "tabs": [...props.panes],
  48271. "tabRefs": tabRefsMap.value
  48272. }, null) : null, tabs]]) : null])]);
  48273. };
  48274. }
  48275. });
  48276. //#endregion
  48277. //#region ../../packages/components/tabs/src/tabs.tsx
  48278. const tabsProps = buildProps({
  48279. type: {
  48280. type: String,
  48281. values: [
  48282. "card",
  48283. "border-card",
  48284. ""
  48285. ],
  48286. default: ""
  48287. },
  48288. closable: Boolean,
  48289. addable: Boolean,
  48290. modelValue: { type: [String, Number] },
  48291. defaultValue: { type: [String, Number] },
  48292. editable: Boolean,
  48293. tabPosition: {
  48294. type: String,
  48295. values: [
  48296. "top",
  48297. "right",
  48298. "bottom",
  48299. "left"
  48300. ],
  48301. default: "top"
  48302. },
  48303. beforeLeave: {
  48304. type: definePropType(Function),
  48305. default: () => true
  48306. },
  48307. stretch: Boolean,
  48308. tabindex: {
  48309. type: [String, Number],
  48310. default: 0
  48311. }
  48312. });
  48313. const isPaneName = (value) => isString(value) || isNumber(value);
  48314. const tabsEmits = {
  48315. [UPDATE_MODEL_EVENT]: (name) => isPaneName(name),
  48316. tabClick: (pane, ev) => ev instanceof Event,
  48317. tabChange: (name) => isPaneName(name),
  48318. edit: (paneName, action) => ["remove", "add"].includes(action),
  48319. tabRemove: (name) => isPaneName(name),
  48320. tabAdd: () => true
  48321. };
  48322. const Tabs = /* @__PURE__ */ (0, vue.defineComponent)({
  48323. name: "ElTabs",
  48324. props: tabsProps,
  48325. emits: tabsEmits,
  48326. setup(props, { emit, slots, expose }) {
  48327. const ns = useNamespace("tabs");
  48328. const isVertical = (0, vue.computed)(() => ["left", "right"].includes(props.tabPosition));
  48329. const { children: panes, addChild: registerPane, removeChild: unregisterPane, ChildrenSorter: PanesSorter } = useOrderedChildren((0, vue.getCurrentInstance)(), "ElTabPane");
  48330. const nav$ = (0, vue.ref)();
  48331. const currentName = (0, vue.ref)((isUndefined(props.modelValue) ? props.defaultValue : props.modelValue) ?? "0");
  48332. const setCurrentName = async (value, trigger = false) => {
  48333. if (currentName.value === value || isUndefined(value)) return;
  48334. try {
  48335. let canLeave;
  48336. if (props.beforeLeave) {
  48337. const result = props.beforeLeave(value, currentName.value);
  48338. canLeave = result instanceof Promise ? await result : result;
  48339. } else canLeave = true;
  48340. if (canLeave !== false) {
  48341. const isFocusInsidePane = panes.value.find((item) => item.paneName === currentName.value)?.isFocusInsidePane();
  48342. currentName.value = value;
  48343. if (trigger) {
  48344. emit(UPDATE_MODEL_EVENT, value);
  48345. emit("tabChange", value);
  48346. }
  48347. nav$.value?.removeFocus?.();
  48348. if (isFocusInsidePane) nav$.value?.focusActiveTab();
  48349. }
  48350. } catch {}
  48351. };
  48352. const handleTabClick = (tab, tabName, event) => {
  48353. if (tab.props.disabled) return;
  48354. emit("tabClick", tab, event);
  48355. setCurrentName(tabName, true);
  48356. };
  48357. const handleTabRemove = (pane, ev) => {
  48358. if (pane.props.disabled || isUndefined(pane.props.name)) return;
  48359. ev.stopPropagation();
  48360. emit("edit", pane.props.name, "remove");
  48361. emit("tabRemove", pane.props.name);
  48362. };
  48363. const handleTabAdd = () => {
  48364. emit("edit", void 0, "add");
  48365. emit("tabAdd");
  48366. };
  48367. const handleKeydown = (event) => {
  48368. const code = getEventCode(event);
  48369. if ([EVENT_CODE.enter, EVENT_CODE.numpadEnter].includes(code)) handleTabAdd();
  48370. };
  48371. const swapChildren = (vnode) => {
  48372. const actualFirstChild = vnode.el.firstChild;
  48373. const firstChild = ["bottom", "right"].includes(props.tabPosition) ? vnode.children[0].el : vnode.children[1].el;
  48374. if (actualFirstChild !== firstChild) actualFirstChild.before(firstChild);
  48375. };
  48376. (0, vue.watch)(() => props.modelValue, (modelValue) => setCurrentName(modelValue));
  48377. (0, vue.watch)(currentName, async () => {
  48378. await (0, vue.nextTick)();
  48379. nav$.value?.scrollToActiveTab();
  48380. });
  48381. (0, vue.provide)(tabsRootContextKey, {
  48382. props,
  48383. currentName,
  48384. registerPane,
  48385. unregisterPane,
  48386. nav$
  48387. });
  48388. expose({
  48389. currentName,
  48390. get tabNavRef() {
  48391. return omit(nav$.value, ["scheduleRender"]);
  48392. }
  48393. });
  48394. return () => {
  48395. const addSlot = slots["add-icon"];
  48396. const newButton = props.editable || props.addable ? (0, vue.createVNode)("div", {
  48397. "class": [ns.e("new-tab"), isVertical.value && ns.e("new-tab-vertical")],
  48398. "tabindex": props.tabindex,
  48399. "onClick": handleTabAdd,
  48400. "onKeydown": handleKeydown
  48401. }, [addSlot ? (0, vue.renderSlot)(slots, "add-icon") : (0, vue.createVNode)(ElIcon, { "class": ns.is("icon-plus") }, { default: () => [(0, vue.createVNode)(plus_default, null, null)] })]) : null;
  48402. const tabNav = () => (0, vue.createVNode)(TabNav, {
  48403. "ref": nav$,
  48404. "currentName": currentName.value,
  48405. "editable": props.editable,
  48406. "type": props.type,
  48407. "panes": panes.value,
  48408. "stretch": props.stretch,
  48409. "onTabClick": handleTabClick,
  48410. "onTabRemove": handleTabRemove
  48411. }, null);
  48412. const header = (0, vue.createVNode)("div", { "class": [
  48413. ns.e("header"),
  48414. isVertical.value && ns.e("header-vertical"),
  48415. ns.is(props.tabPosition)
  48416. ] }, [(0, vue.createVNode)(PanesSorter, null, {
  48417. default: tabNav,
  48418. $stable: true
  48419. }), newButton]);
  48420. const panels = (0, vue.createVNode)("div", { "class": ns.e("content") }, [(0, vue.renderSlot)(slots, "default")]);
  48421. return (0, vue.createVNode)("div", {
  48422. "class": [
  48423. ns.b(),
  48424. ns.m(props.tabPosition),
  48425. {
  48426. [ns.m("card")]: props.type === "card",
  48427. [ns.m("border-card")]: props.type === "border-card"
  48428. }
  48429. ],
  48430. "onVnodeMounted": swapChildren,
  48431. "onVnodeUpdated": swapChildren
  48432. }, [panels, header]);
  48433. };
  48434. }
  48435. });
  48436. //#endregion
  48437. //#region ../../packages/components/tabs/src/tab-pane.ts
  48438. /**
  48439. * @deprecated Removed after 3.0.0, Use `TabPaneProps` instead.
  48440. */
  48441. const tabPaneProps = buildProps({
  48442. label: {
  48443. type: String,
  48444. default: ""
  48445. },
  48446. name: { type: [String, Number] },
  48447. closable: {
  48448. type: Boolean,
  48449. default: void 0
  48450. },
  48451. disabled: Boolean,
  48452. lazy: Boolean
  48453. });
  48454. //#endregion
  48455. //#region ../../packages/components/tabs/src/tab-pane.vue?vue&type=script&setup=true&lang.ts
  48456. const _hoisted_1$14 = [
  48457. "id",
  48458. "aria-hidden",
  48459. "aria-labelledby"
  48460. ];
  48461. const COMPONENT_NAME$2 = "ElTabPane";
  48462. var tab_pane_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  48463. name: COMPONENT_NAME$2,
  48464. __name: "tab-pane",
  48465. props: tabPaneProps,
  48466. setup(__props) {
  48467. const props = __props;
  48468. const instance = (0, vue.getCurrentInstance)();
  48469. const slots = (0, vue.useSlots)();
  48470. const tabsRoot = (0, vue.inject)(tabsRootContextKey);
  48471. if (!tabsRoot) throwError(COMPONENT_NAME$2, "usage: <el-tabs><el-tab-pane /></el-tabs/>");
  48472. const ns = useNamespace("tab-pane");
  48473. const paneRef = (0, vue.ref)();
  48474. const index = (0, vue.ref)();
  48475. const isClosable = (0, vue.computed)(() => props.closable ?? tabsRoot.props.closable);
  48476. const active = (0, vue.computed)(() => tabsRoot.currentName.value === (props.name ?? index.value));
  48477. const loaded = (0, vue.ref)(active.value);
  48478. const paneName = (0, vue.computed)(() => props.name ?? index.value);
  48479. const shouldBeRender = (0, vue.computed)(() => !props.lazy || loaded.value || active.value);
  48480. const isFocusInsidePane = () => {
  48481. return paneRef.value?.contains(document.activeElement);
  48482. };
  48483. (0, vue.watch)(active, (val) => {
  48484. if (val) loaded.value = true;
  48485. });
  48486. const pane = (0, vue.reactive)({
  48487. uid: instance.uid,
  48488. getVnode: () => instance.vnode,
  48489. slots,
  48490. props,
  48491. paneName,
  48492. active,
  48493. index,
  48494. isClosable,
  48495. isFocusInsidePane
  48496. });
  48497. tabsRoot.registerPane(pane);
  48498. (0, vue.onBeforeUnmount)(() => {
  48499. tabsRoot.unregisterPane(pane);
  48500. });
  48501. (0, vue.onBeforeUpdate)(() => {
  48502. if (slots.label) tabsRoot.nav$.value?.scheduleRender();
  48503. });
  48504. return (_ctx, _cache) => {
  48505. return shouldBeRender.value ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48506. key: 0,
  48507. id: `pane-${paneName.value}`,
  48508. ref_key: "paneRef",
  48509. ref: paneRef,
  48510. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()),
  48511. role: "tabpanel",
  48512. "aria-hidden": !active.value,
  48513. "aria-labelledby": `tab-${paneName.value}`
  48514. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 10, _hoisted_1$14)), [[vue.vShow, active.value]]) : (0, vue.createCommentVNode)("v-if", true);
  48515. };
  48516. }
  48517. });
  48518. //#endregion
  48519. //#region ../../packages/components/tabs/src/tab-pane.vue
  48520. var tab_pane_default = tab_pane_vue_vue_type_script_setup_true_lang_default;
  48521. //#endregion
  48522. //#region ../../packages/components/tabs/index.ts
  48523. const ElTabs = withInstall(Tabs, { TabPane: tab_pane_default });
  48524. const ElTabPane = withNoopInstall(tab_pane_default);
  48525. //#endregion
  48526. //#region ../../packages/components/text/src/text.ts
  48527. /**
  48528. * @deprecated Removed after 3.0.0, Use `TextProps` instead.
  48529. */
  48530. const textProps = buildProps({
  48531. type: {
  48532. type: String,
  48533. values: [
  48534. "primary",
  48535. "success",
  48536. "info",
  48537. "warning",
  48538. "danger",
  48539. ""
  48540. ],
  48541. default: ""
  48542. },
  48543. size: {
  48544. type: String,
  48545. values: componentSizes,
  48546. default: ""
  48547. },
  48548. truncated: Boolean,
  48549. lineClamp: { type: [String, Number] },
  48550. tag: {
  48551. type: String,
  48552. default: "span"
  48553. }
  48554. });
  48555. //#endregion
  48556. //#region ../../packages/components/text/src/text.vue?vue&type=script&setup=true&lang.ts
  48557. var text_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  48558. name: "ElText",
  48559. __name: "text",
  48560. props: textProps,
  48561. setup(__props) {
  48562. const props = __props;
  48563. const textRef = (0, vue.ref)();
  48564. const textSize = useFormSize();
  48565. const ns = useNamespace("text");
  48566. const textKls = (0, vue.computed)(() => [
  48567. ns.b(),
  48568. ns.m(props.type),
  48569. ns.m(textSize.value),
  48570. ns.is("truncated", props.truncated),
  48571. ns.is("line-clamp", !isUndefined(props.lineClamp))
  48572. ]);
  48573. const bindTitle = () => {
  48574. if ((0, vue.useAttrs)().title) return;
  48575. let shouldAddTitle = false;
  48576. const text = textRef.value?.textContent || "";
  48577. if (props.truncated) {
  48578. const width = textRef.value?.offsetWidth;
  48579. const scrollWidth = textRef.value?.scrollWidth;
  48580. if (width && scrollWidth && scrollWidth > width) shouldAddTitle = true;
  48581. } else if (!isUndefined(props.lineClamp)) {
  48582. const height = textRef.value?.offsetHeight;
  48583. const scrollHeight = textRef.value?.scrollHeight;
  48584. if (height && scrollHeight && scrollHeight > height) shouldAddTitle = true;
  48585. }
  48586. if (shouldAddTitle) textRef.value?.setAttribute("title", text);
  48587. else textRef.value?.removeAttribute("title");
  48588. };
  48589. (0, vue.onMounted)(bindTitle);
  48590. (0, vue.onUpdated)(bindTitle);
  48591. return (_ctx, _cache) => {
  48592. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.tag), {
  48593. ref_key: "textRef",
  48594. ref: textRef,
  48595. class: (0, vue.normalizeClass)(textKls.value),
  48596. style: (0, vue.normalizeStyle)({ "-webkit-line-clamp": __props.lineClamp })
  48597. }, {
  48598. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  48599. _: 3
  48600. }, 8, ["class", "style"]);
  48601. };
  48602. }
  48603. });
  48604. //#endregion
  48605. //#region ../../packages/components/text/src/text.vue
  48606. var text_default = text_vue_vue_type_script_setup_true_lang_default;
  48607. //#endregion
  48608. //#region ../../packages/components/text/index.ts
  48609. const ElText = withInstall(text_default);
  48610. //#endregion
  48611. //#region ../../packages/components/time-select/src/time-select.ts
  48612. const DEFAULT_STEP = "00:30";
  48613. /**
  48614. * @deprecated Removed after 3.0.0, Use `TimeSelectProps` instead.
  48615. */
  48616. const timeSelectProps = buildProps({
  48617. format: {
  48618. type: String,
  48619. default: "HH:mm"
  48620. },
  48621. modelValue: { type: definePropType(String) },
  48622. disabled: {
  48623. type: Boolean,
  48624. default: void 0
  48625. },
  48626. editable: {
  48627. type: Boolean,
  48628. default: true
  48629. },
  48630. effect: {
  48631. type: definePropType(String),
  48632. default: "light"
  48633. },
  48634. clearable: {
  48635. type: Boolean,
  48636. default: true
  48637. },
  48638. size: useSizeProp,
  48639. placeholder: String,
  48640. start: {
  48641. type: String,
  48642. default: "09:00"
  48643. },
  48644. end: {
  48645. type: String,
  48646. default: "18:00"
  48647. },
  48648. step: {
  48649. type: String,
  48650. default: DEFAULT_STEP
  48651. },
  48652. minTime: { type: definePropType(String) },
  48653. maxTime: { type: definePropType(String) },
  48654. includeEndTime: Boolean,
  48655. name: String,
  48656. prefixIcon: {
  48657. type: definePropType([String, Object]),
  48658. default: () => clock_default
  48659. },
  48660. clearIcon: {
  48661. type: definePropType([String, Object]),
  48662. default: () => circle_close_default
  48663. },
  48664. popperClass: {
  48665. type: String,
  48666. default: ""
  48667. },
  48668. popperStyle: { type: definePropType([String, Object]) },
  48669. ...useEmptyValuesProps
  48670. });
  48671. //#endregion
  48672. //#region ../../packages/components/time-select/src/utils.ts
  48673. const parseTime = (time) => {
  48674. const values = (time || "").split(":");
  48675. if (values.length >= 2) {
  48676. let hours = Number.parseInt(values[0], 10);
  48677. const minutes = Number.parseInt(values[1], 10);
  48678. const timeUpper = time.toUpperCase();
  48679. if (timeUpper.includes("AM") && hours === 12) hours = 0;
  48680. else if (timeUpper.includes("PM") && hours !== 12) hours += 12;
  48681. return {
  48682. hours,
  48683. minutes
  48684. };
  48685. }
  48686. return null;
  48687. };
  48688. const compareTime = (time1, time2) => {
  48689. const value1 = parseTime(time1);
  48690. if (!value1) return -1;
  48691. const value2 = parseTime(time2);
  48692. if (!value2) return -1;
  48693. const minutes1 = value1.minutes + value1.hours * 60;
  48694. const minutes2 = value2.minutes + value2.hours * 60;
  48695. if (minutes1 === minutes2) return 0;
  48696. return minutes1 > minutes2 ? 1 : -1;
  48697. };
  48698. const padTime = (time) => {
  48699. return `${time}`.padStart(2, "0");
  48700. };
  48701. const formatTime = (time) => {
  48702. return `${padTime(time.hours)}:${padTime(time.minutes)}`;
  48703. };
  48704. const nextTime = (time, step) => {
  48705. const timeValue = parseTime(time);
  48706. if (!timeValue) return "";
  48707. const stepValue = parseTime(step);
  48708. if (!stepValue) return "";
  48709. const next = {
  48710. hours: timeValue.hours,
  48711. minutes: timeValue.minutes
  48712. };
  48713. next.minutes += stepValue.minutes;
  48714. next.hours += stepValue.hours;
  48715. next.hours += Math.floor(next.minutes / 60);
  48716. next.minutes = next.minutes % 60;
  48717. return formatTime(next);
  48718. };
  48719. //#endregion
  48720. //#region ../../packages/components/time-select/src/time-select.vue?vue&type=script&setup=true&lang.ts
  48721. var time_select_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  48722. name: "ElTimeSelect",
  48723. __name: "time-select",
  48724. props: timeSelectProps,
  48725. emits: [
  48726. CHANGE_EVENT,
  48727. "blur",
  48728. "focus",
  48729. "clear",
  48730. UPDATE_MODEL_EVENT
  48731. ],
  48732. setup(__props, { expose: __expose }) {
  48733. import_dayjs_min.default.extend(import_customParseFormat.default);
  48734. const { Option: ElOption } = ElSelect;
  48735. const props = __props;
  48736. const nsInput = useNamespace("input");
  48737. const select = (0, vue.ref)();
  48738. const _disabled = useFormDisabled();
  48739. const { lang } = useLocale();
  48740. const value = (0, vue.computed)(() => props.modelValue);
  48741. const start = (0, vue.computed)(() => {
  48742. const time = parseTime(props.start);
  48743. return time ? formatTime(time) : null;
  48744. });
  48745. const end = (0, vue.computed)(() => {
  48746. const time = parseTime(props.end);
  48747. return time ? formatTime(time) : null;
  48748. });
  48749. const minTime = (0, vue.computed)(() => {
  48750. const time = parseTime(props.minTime || "");
  48751. return time ? formatTime(time) : null;
  48752. });
  48753. const maxTime = (0, vue.computed)(() => {
  48754. const time = parseTime(props.maxTime || "");
  48755. return time ? formatTime(time) : null;
  48756. });
  48757. const step = (0, vue.computed)(() => {
  48758. const time = parseTime(props.step);
  48759. const isInvalidStep = !time || time.hours < 0 || time.minutes < 0 || Number.isNaN(time.hours) || Number.isNaN(time.minutes) || time.hours === 0 && time.minutes === 0;
  48760. if (isInvalidStep) /* @__PURE__ */ debugWarn("ElTimeSelect", `invalid step, fallback to default step (${DEFAULT_STEP}).`);
  48761. return !isInvalidStep ? formatTime(time) : DEFAULT_STEP;
  48762. });
  48763. const items = (0, vue.computed)(() => {
  48764. const result = [];
  48765. const push = (formattedValue, rawValue) => {
  48766. result.push({
  48767. value: formattedValue,
  48768. rawValue,
  48769. disabled: compareTime(rawValue, minTime.value || "-1:-1") <= 0 || compareTime(rawValue, maxTime.value || "100:100") >= 0
  48770. });
  48771. };
  48772. if (props.start && props.end && props.step) {
  48773. let current = start.value;
  48774. let currentTime;
  48775. while (current && end.value && compareTime(current, end.value) <= 0) {
  48776. currentTime = (0, import_dayjs_min.default)(current, "HH:mm").locale(lang.value).format(props.format);
  48777. push(currentTime, current);
  48778. current = nextTime(current, step.value);
  48779. }
  48780. if (props.includeEndTime && end.value && result[result.length - 1]?.rawValue !== end.value) push((0, import_dayjs_min.default)(end.value, "HH:mm").locale(lang.value).format(props.format), end.value);
  48781. }
  48782. return result;
  48783. });
  48784. const blur = () => {
  48785. select.value?.blur?.();
  48786. };
  48787. const focus = () => {
  48788. select.value?.focus?.();
  48789. };
  48790. __expose({
  48791. blur,
  48792. focus
  48793. });
  48794. return (_ctx, _cache) => {
  48795. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElSelect), {
  48796. ref_key: "select",
  48797. ref: select,
  48798. name: __props.name,
  48799. "model-value": value.value,
  48800. disabled: (0, vue.unref)(_disabled),
  48801. clearable: __props.clearable,
  48802. "clear-icon": __props.clearIcon,
  48803. size: __props.size,
  48804. effect: __props.effect,
  48805. placeholder: __props.placeholder,
  48806. "default-first-option": "",
  48807. filterable: __props.editable,
  48808. "empty-values": __props.emptyValues,
  48809. "value-on-clear": __props.valueOnClear,
  48810. "popper-class": __props.popperClass,
  48811. "popper-style": __props.popperStyle,
  48812. "onUpdate:modelValue": _cache[0] || (_cache[0] = (event) => _ctx.$emit((0, vue.unref)(UPDATE_MODEL_EVENT), event)),
  48813. onChange: _cache[1] || (_cache[1] = (event) => _ctx.$emit((0, vue.unref)(CHANGE_EVENT), event)),
  48814. onBlur: _cache[2] || (_cache[2] = (event) => _ctx.$emit("blur", event)),
  48815. onFocus: _cache[3] || (_cache[3] = (event) => _ctx.$emit("focus", event)),
  48816. onClear: _cache[4] || (_cache[4] = () => _ctx.$emit("clear"))
  48817. }, {
  48818. prefix: (0, vue.withCtx)(() => [__props.prefixIcon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  48819. key: 0,
  48820. class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("prefix-icon"))
  48821. }, {
  48822. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.prefixIcon)))]),
  48823. _: 1
  48824. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)]),
  48825. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(items.value, (item) => {
  48826. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElOption), {
  48827. key: item.value,
  48828. label: item.value,
  48829. value: item.value,
  48830. disabled: item.disabled
  48831. }, null, 8, [
  48832. "label",
  48833. "value",
  48834. "disabled"
  48835. ]);
  48836. }), 128))]),
  48837. _: 1
  48838. }, 8, [
  48839. "name",
  48840. "model-value",
  48841. "disabled",
  48842. "clearable",
  48843. "clear-icon",
  48844. "size",
  48845. "effect",
  48846. "placeholder",
  48847. "filterable",
  48848. "empty-values",
  48849. "value-on-clear",
  48850. "popper-class",
  48851. "popper-style"
  48852. ]);
  48853. };
  48854. }
  48855. });
  48856. //#endregion
  48857. //#region ../../packages/components/time-select/src/time-select.vue
  48858. var time_select_default = time_select_vue_vue_type_script_setup_true_lang_default;
  48859. //#endregion
  48860. //#region ../../packages/components/time-select/index.ts
  48861. const ElTimeSelect = withInstall(time_select_default);
  48862. //#endregion
  48863. //#region ../../packages/components/timeline/src/tokens.ts
  48864. const TIMELINE_INJECTION_KEY = "timeline";
  48865. //#endregion
  48866. //#region ../../packages/components/timeline/src/timeline.ts
  48867. const timelineProps = buildProps({
  48868. mode: {
  48869. type: String,
  48870. values: [
  48871. "start",
  48872. "alternate",
  48873. "alternate-reverse",
  48874. "end"
  48875. ],
  48876. default: "start"
  48877. },
  48878. reverse: Boolean
  48879. });
  48880. const Timeline = (0, vue.defineComponent)({
  48881. name: "ElTimeline",
  48882. props: timelineProps,
  48883. setup(props, { slots }) {
  48884. const ns = useNamespace("timeline");
  48885. (0, vue.provide)(TIMELINE_INJECTION_KEY, {
  48886. props,
  48887. slots
  48888. });
  48889. const timelineKls = (0, vue.computed)(() => [ns.b(), ns.is(props.mode)]);
  48890. return () => {
  48891. const children = flattedChildren(slots.default?.() ?? []);
  48892. return (0, vue.h)("ul", { class: timelineKls.value }, props.reverse ? children.reverse() : children);
  48893. };
  48894. }
  48895. });
  48896. //#endregion
  48897. //#region ../../packages/components/timeline/src/timeline-item.ts
  48898. /**
  48899. * @deprecated Removed after 3.0.0, Use `TimelineItemProps` instead.
  48900. */
  48901. const timelineItemProps = buildProps({
  48902. timestamp: {
  48903. type: String,
  48904. default: ""
  48905. },
  48906. hideTimestamp: Boolean,
  48907. center: Boolean,
  48908. placement: {
  48909. type: String,
  48910. values: ["top", "bottom"],
  48911. default: "bottom"
  48912. },
  48913. type: {
  48914. type: String,
  48915. values: [
  48916. "primary",
  48917. "success",
  48918. "warning",
  48919. "danger",
  48920. "info"
  48921. ],
  48922. default: ""
  48923. },
  48924. color: {
  48925. type: String,
  48926. default: ""
  48927. },
  48928. size: {
  48929. type: String,
  48930. values: ["normal", "large"],
  48931. default: "normal"
  48932. },
  48933. icon: { type: iconPropType },
  48934. hollow: Boolean
  48935. });
  48936. //#endregion
  48937. //#region ../../packages/components/timeline/src/timeline-item.vue?vue&type=script&setup=true&lang.ts
  48938. var timeline_item_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  48939. name: "ElTimelineItem",
  48940. __name: "timeline-item",
  48941. props: timelineItemProps,
  48942. setup(__props) {
  48943. const props = __props;
  48944. const { props: timelineProps } = (0, vue.inject)(TIMELINE_INJECTION_KEY);
  48945. const ns = useNamespace("timeline-item");
  48946. const defaultNodeKls = (0, vue.computed)(() => [
  48947. ns.e("node"),
  48948. ns.em("node", props.size || ""),
  48949. ns.em("node", props.type || ""),
  48950. ns.is("hollow", props.hollow)
  48951. ]);
  48952. const timelineItemKls = (0, vue.computed)(() => [
  48953. ns.b(),
  48954. { [ns.e("center")]: props.center },
  48955. ns.is(timelineProps.mode)
  48956. ]);
  48957. return (_ctx, _cache) => {
  48958. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", { class: (0, vue.normalizeClass)(timelineItemKls.value) }, [
  48959. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("tail")) }, null, 2),
  48960. !_ctx.$slots.dot ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48961. key: 0,
  48962. class: (0, vue.normalizeClass)(defaultNodeKls.value),
  48963. style: (0, vue.normalizeStyle)({ backgroundColor: __props.color })
  48964. }, [__props.icon ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  48965. key: 0,
  48966. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("icon"))
  48967. }, {
  48968. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.icon)))]),
  48969. _: 1
  48970. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)], 6)) : (0, vue.createCommentVNode)("v-if", true),
  48971. _ctx.$slots.dot ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48972. key: 1,
  48973. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("dot"))
  48974. }, [(0, vue.renderSlot)(_ctx.$slots, "dot")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  48975. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("wrapper")) }, [
  48976. !__props.hideTimestamp && __props.placement === "top" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48977. key: 0,
  48978. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("timestamp"), (0, vue.unref)(ns).is("top")])
  48979. }, (0, vue.toDisplayString)(__props.timestamp), 3)) : (0, vue.createCommentVNode)("v-if", true),
  48980. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2),
  48981. !__props.hideTimestamp && __props.placement === "bottom" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  48982. key: 1,
  48983. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("timestamp"), (0, vue.unref)(ns).is("bottom")])
  48984. }, (0, vue.toDisplayString)(__props.timestamp), 3)) : (0, vue.createCommentVNode)("v-if", true)
  48985. ], 2)
  48986. ], 2);
  48987. };
  48988. }
  48989. });
  48990. //#endregion
  48991. //#region ../../packages/components/timeline/src/timeline-item.vue
  48992. var timeline_item_default = timeline_item_vue_vue_type_script_setup_true_lang_default;
  48993. //#endregion
  48994. //#region ../../packages/components/timeline/index.ts
  48995. const ElTimeline = withInstall(Timeline, { TimelineItem: timeline_item_default });
  48996. const ElTimelineItem = withNoopInstall(timeline_item_default);
  48997. //#endregion
  48998. //#region ../../packages/components/transfer/src/transfer.ts
  48999. const LEFT_CHECK_CHANGE_EVENT = "left-check-change";
  49000. const RIGHT_CHECK_CHANGE_EVENT = "right-check-change";
  49001. /**
  49002. * @deprecated Removed after 3.0.0, Use `TransferProps` instead.
  49003. */
  49004. const transferProps = buildProps({
  49005. data: {
  49006. type: definePropType(Array),
  49007. default: () => []
  49008. },
  49009. titles: {
  49010. type: definePropType(Array),
  49011. default: () => []
  49012. },
  49013. buttonTexts: {
  49014. type: definePropType(Array),
  49015. default: () => []
  49016. },
  49017. filterPlaceholder: String,
  49018. filterMethod: { type: definePropType(Function) },
  49019. leftDefaultChecked: {
  49020. type: definePropType(Array),
  49021. default: () => []
  49022. },
  49023. rightDefaultChecked: {
  49024. type: definePropType(Array),
  49025. default: () => []
  49026. },
  49027. renderContent: { type: definePropType(Function) },
  49028. modelValue: {
  49029. type: definePropType(Array),
  49030. default: () => []
  49031. },
  49032. format: {
  49033. type: definePropType(Object),
  49034. default: () => ({})
  49035. },
  49036. filterable: Boolean,
  49037. props: {
  49038. type: definePropType(Object),
  49039. default: () => mutable({
  49040. label: "label",
  49041. key: "key",
  49042. disabled: "disabled"
  49043. })
  49044. },
  49045. targetOrder: {
  49046. type: String,
  49047. values: [
  49048. "original",
  49049. "push",
  49050. "unshift"
  49051. ],
  49052. default: "original"
  49053. },
  49054. validateEvent: {
  49055. type: Boolean,
  49056. default: true
  49057. }
  49058. });
  49059. const transferCheckedChangeFn = (value, movedKeys) => [value, movedKeys].every(isArray$1) || isArray$1(value) && isNil(movedKeys);
  49060. const transferEmits = {
  49061. [CHANGE_EVENT]: (value, direction, movedKeys) => [value, movedKeys].every(isArray$1) && ["left", "right"].includes(direction),
  49062. [UPDATE_MODEL_EVENT]: (value) => isArray$1(value),
  49063. [LEFT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn,
  49064. [RIGHT_CHECK_CHANGE_EVENT]: transferCheckedChangeFn
  49065. };
  49066. //#endregion
  49067. //#region ../../packages/components/transfer/src/transfer-panel.ts
  49068. const CHECKED_CHANGE_EVENT = "checked-change";
  49069. /**
  49070. * @deprecated Removed after 3.0.0, Use `TransferPanelProps` instead.
  49071. */
  49072. const transferPanelProps = buildProps({
  49073. data: transferProps.data,
  49074. optionRender: { type: definePropType(Function) },
  49075. placeholder: String,
  49076. title: String,
  49077. filterable: Boolean,
  49078. format: transferProps.format,
  49079. filterMethod: transferProps.filterMethod,
  49080. defaultChecked: transferProps.leftDefaultChecked,
  49081. props: transferProps.props
  49082. });
  49083. const transferPanelEmits = { [CHECKED_CHANGE_EVENT]: transferCheckedChangeFn };
  49084. //#endregion
  49085. //#region ../../packages/components/transfer/src/composables/use-props-alias.ts
  49086. const usePropsAlias = (props) => {
  49087. const initProps = {
  49088. label: "label",
  49089. key: "key",
  49090. disabled: "disabled"
  49091. };
  49092. return (0, vue.computed)(() => ({
  49093. ...initProps,
  49094. ...props.props
  49095. }));
  49096. };
  49097. //#endregion
  49098. //#region ../../packages/components/transfer/src/composables/use-check.ts
  49099. const useCheck$1 = (props, panelState, emit) => {
  49100. const propsAlias = usePropsAlias(props);
  49101. const filteredData = (0, vue.computed)(() => {
  49102. return props.data.filter((item) => {
  49103. if (isFunction$1(props.filterMethod)) return props.filterMethod(panelState.query, item);
  49104. else return String(item[propsAlias.value.label] || item[propsAlias.value.key]).toLowerCase().includes(panelState.query.toLowerCase());
  49105. });
  49106. });
  49107. const checkableData = (0, vue.computed)(() => filteredData.value.filter((item) => !item[propsAlias.value.disabled]));
  49108. const checkedSummary = (0, vue.computed)(() => {
  49109. const checkedLength = panelState.checked.length;
  49110. const dataLength = props.data.length;
  49111. const { noChecked, hasChecked } = props.format;
  49112. if (noChecked && hasChecked) return checkedLength > 0 ? hasChecked.replace(/\${checked}/g, checkedLength.toString()).replace(/\${total}/g, dataLength.toString()) : noChecked.replace(/\${total}/g, dataLength.toString());
  49113. else return `${checkedLength}/${dataLength}`;
  49114. });
  49115. const isIndeterminate = (0, vue.computed)(() => {
  49116. const checkedLength = panelState.checked.length;
  49117. return checkedLength > 0 && checkedLength < checkableData.value.length;
  49118. });
  49119. const updateAllChecked = () => {
  49120. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  49121. panelState.allChecked = checkableDataKeys.length > 0 && checkableDataKeys.every((item) => panelState.checked.includes(item));
  49122. };
  49123. const handleAllCheckedChange = (value) => {
  49124. panelState.checked = value ? checkableData.value.map((item) => item[propsAlias.value.key]) : [];
  49125. };
  49126. (0, vue.watch)(() => panelState.checked, (val, oldVal) => {
  49127. updateAllChecked();
  49128. if (panelState.checkChangeByUser) emit(CHECKED_CHANGE_EVENT, val, val.concat(oldVal).filter((v) => !val.includes(v) || !oldVal.includes(v)));
  49129. else {
  49130. emit(CHECKED_CHANGE_EVENT, val);
  49131. panelState.checkChangeByUser = true;
  49132. }
  49133. });
  49134. (0, vue.watch)(checkableData, () => {
  49135. updateAllChecked();
  49136. });
  49137. (0, vue.watch)(() => props.data, () => {
  49138. const checked = [];
  49139. const filteredDataKeys = filteredData.value.map((item) => item[propsAlias.value.key]);
  49140. panelState.checked.forEach((item) => {
  49141. if (filteredDataKeys.includes(item)) checked.push(item);
  49142. });
  49143. panelState.checkChangeByUser = false;
  49144. panelState.checked = checked;
  49145. });
  49146. (0, vue.watch)(() => props.defaultChecked, (val, oldVal) => {
  49147. if (oldVal && val.length === oldVal.length && val.every((item) => oldVal.includes(item))) return;
  49148. const checked = [];
  49149. const checkableDataKeys = checkableData.value.map((item) => item[propsAlias.value.key]);
  49150. val.forEach((item) => {
  49151. if (checkableDataKeys.includes(item)) checked.push(item);
  49152. });
  49153. panelState.checkChangeByUser = false;
  49154. panelState.checked = checked;
  49155. }, { immediate: true });
  49156. return {
  49157. filteredData,
  49158. checkableData,
  49159. checkedSummary,
  49160. isIndeterminate,
  49161. updateAllChecked,
  49162. handleAllCheckedChange
  49163. };
  49164. };
  49165. //#endregion
  49166. //#region ../../packages/components/transfer/src/composables/use-checked-change.ts
  49167. const useCheckedChange = (checkedState, emit) => {
  49168. const onSourceCheckedChange = (val, movedKeys) => {
  49169. checkedState.leftChecked = val;
  49170. if (!movedKeys) return;
  49171. emit(LEFT_CHECK_CHANGE_EVENT, val, movedKeys);
  49172. };
  49173. const onTargetCheckedChange = (val, movedKeys) => {
  49174. checkedState.rightChecked = val;
  49175. if (!movedKeys) return;
  49176. emit(RIGHT_CHECK_CHANGE_EVENT, val, movedKeys);
  49177. };
  49178. return {
  49179. onSourceCheckedChange,
  49180. onTargetCheckedChange
  49181. };
  49182. };
  49183. //#endregion
  49184. //#region ../../packages/components/transfer/src/composables/use-computed-data.ts
  49185. const useComputedData = (props) => {
  49186. const propsAlias = usePropsAlias(props);
  49187. const dataObj = (0, vue.computed)(() => props.data.reduce((o, cur) => (o[cur[propsAlias.value.key]] = cur) && o, {}));
  49188. return {
  49189. sourceData: (0, vue.computed)(() => props.data.filter((item) => !props.modelValue.includes(item[propsAlias.value.key]))),
  49190. targetData: (0, vue.computed)(() => {
  49191. if (props.targetOrder === "original") return props.data.filter((item) => props.modelValue.includes(item[propsAlias.value.key]));
  49192. else return props.modelValue.reduce((arr, cur) => {
  49193. const val = dataObj.value[cur];
  49194. if (val) arr.push(val);
  49195. return arr;
  49196. }, []);
  49197. })
  49198. };
  49199. };
  49200. //#endregion
  49201. //#region ../../packages/components/transfer/src/composables/use-move.ts
  49202. const useMove = (props, checkedState, emit) => {
  49203. const propsAlias = usePropsAlias(props);
  49204. const _emit = (value, direction, movedKeys) => {
  49205. emit(UPDATE_MODEL_EVENT, value);
  49206. emit(CHANGE_EVENT, value, direction, movedKeys);
  49207. };
  49208. const addToLeft = () => {
  49209. const currentValue = props.modelValue.slice();
  49210. checkedState.rightChecked.forEach((item) => {
  49211. const index = currentValue.indexOf(item);
  49212. if (index > -1) currentValue.splice(index, 1);
  49213. });
  49214. _emit(currentValue, "left", checkedState.rightChecked);
  49215. };
  49216. const addToRight = () => {
  49217. let currentValue = props.modelValue.slice();
  49218. const itemsToBeMoved = props.data.filter((item) => {
  49219. const itemKey = item[propsAlias.value.key];
  49220. return checkedState.leftChecked.includes(itemKey) && !props.modelValue.includes(itemKey);
  49221. }).map((item) => item[propsAlias.value.key]);
  49222. currentValue = props.targetOrder === "unshift" ? itemsToBeMoved.concat(currentValue) : currentValue.concat(itemsToBeMoved);
  49223. if (props.targetOrder === "original") currentValue = props.data.filter((item) => currentValue.includes(item[propsAlias.value.key])).map((item) => item[propsAlias.value.key]);
  49224. _emit(currentValue, "right", checkedState.leftChecked);
  49225. };
  49226. return {
  49227. addToLeft,
  49228. addToRight
  49229. };
  49230. };
  49231. //#endregion
  49232. //#region ../../packages/components/transfer/src/transfer-panel.vue?vue&type=script&setup=true&lang.ts
  49233. var transfer_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  49234. name: "ElTransferPanel",
  49235. __name: "transfer-panel",
  49236. props: transferPanelProps,
  49237. emits: transferPanelEmits,
  49238. setup(__props, { expose: __expose, emit: __emit }) {
  49239. const props = __props;
  49240. const emit = __emit;
  49241. const slots = (0, vue.useSlots)();
  49242. const OptionContent = ({ option }) => option;
  49243. const { t } = useLocale();
  49244. const ns = useNamespace("transfer");
  49245. const panelState = (0, vue.reactive)({
  49246. checked: [],
  49247. allChecked: false,
  49248. query: "",
  49249. checkChangeByUser: true
  49250. });
  49251. const propsAlias = usePropsAlias(props);
  49252. const { filteredData, checkedSummary, isIndeterminate, handleAllCheckedChange } = useCheck$1(props, panelState, emit);
  49253. const hasNoMatch = (0, vue.computed)(() => !isEmpty(panelState.query) && isEmpty(filteredData.value));
  49254. const hasFooter = (0, vue.computed)(() => !isEmpty(slots.default()[0].children));
  49255. const { checked, allChecked, query } = (0, vue.toRefs)(panelState);
  49256. __expose({ query });
  49257. return (_ctx, _cache) => {
  49258. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("panel")) }, [
  49259. (0, vue.createElementVNode)("p", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "header")) }, [(0, vue.createVNode)((0, vue.unref)(ElCheckbox), {
  49260. modelValue: (0, vue.unref)(allChecked),
  49261. "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => (0, vue.isRef)(allChecked) ? allChecked.value = $event : null),
  49262. indeterminate: (0, vue.unref)(isIndeterminate),
  49263. "validate-event": false,
  49264. onChange: (0, vue.unref)(handleAllCheckedChange)
  49265. }, {
  49266. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "header-title")) }, (0, vue.toDisplayString)(__props.title), 3), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "header-count")) }, (0, vue.toDisplayString)((0, vue.unref)(checkedSummary)), 3)]),
  49267. _: 1
  49268. }, 8, [
  49269. "modelValue",
  49270. "indeterminate",
  49271. "onChange"
  49272. ])], 2),
  49273. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).be("panel", "body"), (0, vue.unref)(ns).is("with-footer", hasFooter.value)]) }, [
  49274. __props.filterable ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElInput), {
  49275. key: 0,
  49276. modelValue: (0, vue.unref)(query),
  49277. "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => (0, vue.isRef)(query) ? query.value = $event : null),
  49278. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "filter")),
  49279. size: "default",
  49280. placeholder: __props.placeholder,
  49281. "prefix-icon": (0, vue.unref)(search_default),
  49282. clearable: "",
  49283. "validate-event": false
  49284. }, null, 8, [
  49285. "modelValue",
  49286. "class",
  49287. "placeholder",
  49288. "prefix-icon"
  49289. ])) : (0, vue.createCommentVNode)("v-if", true),
  49290. (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElCheckboxGroup), {
  49291. modelValue: (0, vue.unref)(checked),
  49292. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => (0, vue.isRef)(checked) ? checked.value = $event : null),
  49293. "validate-event": false,
  49294. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).is("filterable", __props.filterable), (0, vue.unref)(ns).be("panel", "list")])
  49295. }, {
  49296. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)((0, vue.unref)(filteredData), (item) => {
  49297. return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElCheckbox), {
  49298. key: item[(0, vue.unref)(propsAlias).key],
  49299. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "item")),
  49300. value: item[(0, vue.unref)(propsAlias).key],
  49301. disabled: item[(0, vue.unref)(propsAlias).disabled],
  49302. "validate-event": false
  49303. }, {
  49304. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(OptionContent, { option: __props.optionRender?.(item) }, null, 8, ["option"])]),
  49305. _: 2
  49306. }, 1032, [
  49307. "class",
  49308. "value",
  49309. "disabled"
  49310. ]);
  49311. }), 128))]),
  49312. _: 1
  49313. }, 8, ["modelValue", "class"]), [[vue.vShow, !hasNoMatch.value && !(0, vue.unref)(isEmpty)(__props.data)]]),
  49314. (0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "empty")) }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(hasNoMatch.value ? (0, vue.unref)(t)("el.transfer.noMatch") : (0, vue.unref)(t)("el.transfer.noData")), 1)])], 2), [[vue.vShow, hasNoMatch.value || (0, vue.unref)(isEmpty)(__props.data)]])
  49315. ], 2),
  49316. hasFooter.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", {
  49317. key: 0,
  49318. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("panel", "footer"))
  49319. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  49320. ], 2);
  49321. };
  49322. }
  49323. });
  49324. //#endregion
  49325. //#region ../../packages/components/transfer/src/transfer-panel.vue
  49326. var transfer_panel_default = transfer_panel_vue_vue_type_script_setup_true_lang_default;
  49327. //#endregion
  49328. //#region ../../packages/components/transfer/src/transfer.vue?vue&type=script&setup=true&lang.ts
  49329. const _hoisted_1$13 = { key: 0 };
  49330. const _hoisted_2$8 = { key: 0 };
  49331. var transfer_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  49332. name: "ElTransfer",
  49333. __name: "transfer",
  49334. props: transferProps,
  49335. emits: transferEmits,
  49336. setup(__props, { expose: __expose, emit: __emit }) {
  49337. const props = __props;
  49338. const emit = __emit;
  49339. const slots = (0, vue.useSlots)();
  49340. const { t } = useLocale();
  49341. const ns = useNamespace("transfer");
  49342. const { formItem } = useFormItem();
  49343. const checkedState = (0, vue.reactive)({
  49344. leftChecked: [],
  49345. rightChecked: []
  49346. });
  49347. const propsAlias = usePropsAlias(props);
  49348. const { sourceData, targetData } = useComputedData(props);
  49349. const { onSourceCheckedChange, onTargetCheckedChange } = useCheckedChange(checkedState, emit);
  49350. const { addToLeft, addToRight } = useMove(props, checkedState, emit);
  49351. const leftPanel = (0, vue.ref)();
  49352. const rightPanel = (0, vue.ref)();
  49353. const clearQuery = (which) => {
  49354. switch (which) {
  49355. case "left":
  49356. leftPanel.value.query = "";
  49357. break;
  49358. case "right":
  49359. rightPanel.value.query = "";
  49360. break;
  49361. }
  49362. };
  49363. const hasButtonTexts = (0, vue.computed)(() => props.buttonTexts.length === 2);
  49364. const leftPanelTitle = (0, vue.computed)(() => props.titles[0] || t("el.transfer.titles.0"));
  49365. const rightPanelTitle = (0, vue.computed)(() => props.titles[1] || t("el.transfer.titles.1"));
  49366. const panelFilterPlaceholder = (0, vue.computed)(() => props.filterPlaceholder || t("el.transfer.filterPlaceholder"));
  49367. (0, vue.watch)(() => props.modelValue, () => {
  49368. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  49369. });
  49370. const optionRender = (0, vue.computed)(() => (option) => {
  49371. if (props.renderContent) return props.renderContent(vue.h, option);
  49372. const defaultSlotVNodes = (slots.default?.({ option }) || []).filter((node) => node.type !== vue.Comment);
  49373. if (defaultSlotVNodes.length) return defaultSlotVNodes;
  49374. return (0, vue.h)("span", option[propsAlias.value.label] || option[propsAlias.value.key]);
  49375. });
  49376. __expose({
  49377. clearQuery,
  49378. leftPanel,
  49379. rightPanel
  49380. });
  49381. return (_ctx, _cache) => {
  49382. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b()) }, [
  49383. (0, vue.createVNode)(transfer_panel_default, {
  49384. ref_key: "leftPanel",
  49385. ref: leftPanel,
  49386. data: (0, vue.unref)(sourceData),
  49387. "option-render": optionRender.value,
  49388. placeholder: panelFilterPlaceholder.value,
  49389. title: leftPanelTitle.value,
  49390. filterable: __props.filterable,
  49391. format: __props.format,
  49392. "filter-method": __props.filterMethod,
  49393. "default-checked": __props.leftDefaultChecked,
  49394. props: props.props,
  49395. onCheckedChange: (0, vue.unref)(onSourceCheckedChange)
  49396. }, {
  49397. empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "left-empty")]),
  49398. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "left-footer")]),
  49399. _: 3
  49400. }, 8, [
  49401. "data",
  49402. "option-render",
  49403. "placeholder",
  49404. "title",
  49405. "filterable",
  49406. "format",
  49407. "filter-method",
  49408. "default-checked",
  49409. "props",
  49410. "onCheckedChange"
  49411. ]),
  49412. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("buttons")) }, [(0, vue.createVNode)((0, vue.unref)(ElButton), {
  49413. type: "primary",
  49414. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("button"), (0, vue.unref)(ns).is("with-texts", hasButtonTexts.value)]),
  49415. disabled: (0, vue.unref)(isEmpty)(checkedState.rightChecked),
  49416. onClick: (0, vue.unref)(addToLeft)
  49417. }, {
  49418. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  49419. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_left_default))]),
  49420. _: 1
  49421. }), !(0, vue.unref)(isUndefined)(__props.buttonTexts[0]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_1$13, (0, vue.toDisplayString)(__props.buttonTexts[0]), 1)) : (0, vue.createCommentVNode)("v-if", true)]),
  49422. _: 1
  49423. }, 8, [
  49424. "class",
  49425. "disabled",
  49426. "onClick"
  49427. ]), (0, vue.createVNode)((0, vue.unref)(ElButton), {
  49428. type: "primary",
  49429. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("button"), (0, vue.unref)(ns).is("with-texts", hasButtonTexts.value)]),
  49430. disabled: (0, vue.unref)(isEmpty)(checkedState.leftChecked),
  49431. onClick: (0, vue.unref)(addToRight)
  49432. }, {
  49433. default: (0, vue.withCtx)(() => [!(0, vue.unref)(isUndefined)(__props.buttonTexts[1]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$8, (0, vue.toDisplayString)(__props.buttonTexts[1]), 1)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createVNode)((0, vue.unref)(ElIcon), null, {
  49434. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(arrow_right_default))]),
  49435. _: 1
  49436. })]),
  49437. _: 1
  49438. }, 8, [
  49439. "class",
  49440. "disabled",
  49441. "onClick"
  49442. ])], 2),
  49443. (0, vue.createVNode)(transfer_panel_default, {
  49444. ref_key: "rightPanel",
  49445. ref: rightPanel,
  49446. data: (0, vue.unref)(targetData),
  49447. "option-render": optionRender.value,
  49448. placeholder: panelFilterPlaceholder.value,
  49449. filterable: __props.filterable,
  49450. format: __props.format,
  49451. "filter-method": __props.filterMethod,
  49452. title: rightPanelTitle.value,
  49453. "default-checked": __props.rightDefaultChecked,
  49454. props: props.props,
  49455. onCheckedChange: (0, vue.unref)(onTargetCheckedChange)
  49456. }, {
  49457. empty: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "right-empty")]),
  49458. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "right-footer")]),
  49459. _: 3
  49460. }, 8, [
  49461. "data",
  49462. "option-render",
  49463. "placeholder",
  49464. "filterable",
  49465. "format",
  49466. "filter-method",
  49467. "title",
  49468. "default-checked",
  49469. "props",
  49470. "onCheckedChange"
  49471. ])
  49472. ], 2);
  49473. };
  49474. }
  49475. });
  49476. //#endregion
  49477. //#region ../../packages/components/transfer/src/transfer.vue
  49478. var transfer_default = transfer_vue_vue_type_script_setup_true_lang_default;
  49479. //#endregion
  49480. //#region ../../packages/components/transfer/index.ts
  49481. const ElTransfer = withInstall(transfer_default);
  49482. //#endregion
  49483. //#region ../../packages/components/tree/src/model/util.ts
  49484. const NODE_KEY = "$treeNodeId";
  49485. const markNodeData = function(node, data) {
  49486. if (!data || data[NODE_KEY]) return;
  49487. Object.defineProperty(data, NODE_KEY, {
  49488. value: node.id,
  49489. enumerable: false,
  49490. configurable: false,
  49491. writable: false
  49492. });
  49493. };
  49494. const getNodeKey = (key, data) => data?.[key || NODE_KEY];
  49495. const handleCurrentChange = (store, emit, setCurrent) => {
  49496. const preCurrentNode = store.value.currentNode;
  49497. setCurrent();
  49498. const currentNode = store.value.currentNode;
  49499. if (preCurrentNode === currentNode) return;
  49500. emit("current-change", currentNode ? currentNode.data : null, currentNode);
  49501. };
  49502. //#endregion
  49503. //#region ../../packages/components/tree/src/model/node.ts
  49504. const getChildState = (node) => {
  49505. let all = true;
  49506. let none = true;
  49507. let allWithoutDisable = true;
  49508. let isEffectivelyChecked = true;
  49509. for (let i = 0, j = node.length; i < j; i++) {
  49510. const n = node[i];
  49511. if (n.checked !== true || n.indeterminate) {
  49512. all = false;
  49513. if (!n.disabled) allWithoutDisable = false;
  49514. }
  49515. if (n.checked !== false || n.indeterminate) none = false;
  49516. if (!n.isEffectivelyChecked) isEffectivelyChecked = false;
  49517. }
  49518. return {
  49519. all,
  49520. none,
  49521. allWithoutDisable,
  49522. half: !all && !none,
  49523. isEffectivelyChecked
  49524. };
  49525. };
  49526. const reInitChecked = function(node) {
  49527. if (node.childNodes.length === 0 || node.loading) {
  49528. node.isEffectivelyChecked = node.disabled || node.checked;
  49529. return;
  49530. }
  49531. const { all, none, half, isEffectivelyChecked } = getChildState(node.childNodes);
  49532. node.isEffectivelyChecked = isEffectivelyChecked;
  49533. if (all) {
  49534. node.checked = true;
  49535. node.indeterminate = false;
  49536. } else if (half) {
  49537. node.checked = false;
  49538. node.indeterminate = true;
  49539. } else if (none) {
  49540. node.checked = false;
  49541. node.indeterminate = false;
  49542. }
  49543. const parent = node.parent;
  49544. if (!parent || parent.level === 0) return;
  49545. if (!node.store.checkStrictly) reInitChecked(parent);
  49546. };
  49547. const getPropertyFromData = function(node, prop) {
  49548. const props = node.store.props;
  49549. const data = node.data || {};
  49550. const config = props[prop];
  49551. if (isFunction$1(config)) return config(data, node);
  49552. else if (isString(config)) return data[config];
  49553. else if (isUndefined(config)) {
  49554. const dataProp = data[prop];
  49555. return isUndefined(dataProp) ? "" : dataProp;
  49556. }
  49557. };
  49558. const setCanFocus = function(childNodes, focus) {
  49559. childNodes.forEach((item) => {
  49560. item.canFocus = focus;
  49561. setCanFocus(item.childNodes, focus);
  49562. });
  49563. };
  49564. let nodeIdSeed = 0;
  49565. var Node$1 = class Node$1 {
  49566. constructor(options) {
  49567. this.isLeafByUser = void 0;
  49568. this.isLeaf = void 0;
  49569. this.isEffectivelyChecked = false;
  49570. this.id = nodeIdSeed++;
  49571. this.text = null;
  49572. this.checked = false;
  49573. this.indeterminate = false;
  49574. this.data = null;
  49575. this.expanded = false;
  49576. this.parent = null;
  49577. this.visible = true;
  49578. this.isCurrent = false;
  49579. this.canFocus = false;
  49580. for (const name in options) if (hasOwn(options, name)) this[name] = options[name];
  49581. this.level = 0;
  49582. this.loaded = false;
  49583. this.childNodes = [];
  49584. this.loading = false;
  49585. if (this.parent) this.level = this.parent.level + 1;
  49586. }
  49587. initialize() {
  49588. const store = this.store;
  49589. if (!store) throw new Error("[Node]store is required!");
  49590. store.registerNode(this);
  49591. const props = store.props;
  49592. if (props && typeof props.isLeaf !== "undefined") {
  49593. const isLeaf = getPropertyFromData(this, "isLeaf");
  49594. if (isBoolean(isLeaf)) this.isLeafByUser = isLeaf;
  49595. }
  49596. if (store.lazy !== true && this.data) {
  49597. this.setData(this.data);
  49598. if (store.defaultExpandAll) {
  49599. this.expanded = true;
  49600. this.canFocus = true;
  49601. }
  49602. } else if (this.level > 0 && store.lazy && store.defaultExpandAll && !this.isLeafByUser) this.expand();
  49603. if (!isArray$1(this.data)) markNodeData(this, this.data);
  49604. if (!this.data) return;
  49605. const defaultExpandedKeys = store.defaultExpandedKeys;
  49606. const key = store.key;
  49607. if (key && !isNil(this.key) && defaultExpandedKeys && defaultExpandedKeys.includes(this.key)) this.expand(null, store.autoExpandParent);
  49608. if (key && store.currentNodeKey !== void 0 && this.key === store.currentNodeKey) {
  49609. store.currentNode && (store.currentNode.isCurrent = false);
  49610. store.currentNode = this;
  49611. store.currentNode.isCurrent = true;
  49612. }
  49613. if (store.lazy) store._initDefaultCheckedNode(this);
  49614. this.updateLeafState();
  49615. if (this.level === 1 || this.parent?.expanded === true) this.canFocus = true;
  49616. }
  49617. setData(data) {
  49618. if (!isArray$1(data)) markNodeData(this, data);
  49619. this.data = data;
  49620. this.childNodes = [];
  49621. let children;
  49622. if (this.level === 0 && isArray$1(this.data)) children = this.data;
  49623. else children = getPropertyFromData(this, "children") || [];
  49624. for (let i = 0, j = children.length; i < j; i++) this.insertChild({ data: children[i] });
  49625. }
  49626. get label() {
  49627. return getPropertyFromData(this, "label");
  49628. }
  49629. get key() {
  49630. const nodeKey = this.store.key;
  49631. if (this.data) return this.data[nodeKey];
  49632. return null;
  49633. }
  49634. get disabled() {
  49635. return getPropertyFromData(this, "disabled");
  49636. }
  49637. get nextSibling() {
  49638. const parent = this.parent;
  49639. if (parent) {
  49640. const index = parent.childNodes.indexOf(this);
  49641. if (index > -1) return parent.childNodes[index + 1];
  49642. }
  49643. return null;
  49644. }
  49645. get previousSibling() {
  49646. const parent = this.parent;
  49647. if (parent) {
  49648. const index = parent.childNodes.indexOf(this);
  49649. if (index > -1) return index > 0 ? parent.childNodes[index - 1] : null;
  49650. }
  49651. return null;
  49652. }
  49653. contains(target, deep = true) {
  49654. return (this.childNodes || []).some((child) => child === target || deep && child.contains(target));
  49655. }
  49656. remove() {
  49657. const parent = this.parent;
  49658. if (parent) parent.removeChild(this);
  49659. }
  49660. insertChild(child, index, batch) {
  49661. if (!child) throw new Error("InsertChild error: child is required.");
  49662. if (!(child instanceof Node$1)) {
  49663. if (!batch) {
  49664. const children = this.getChildren(true);
  49665. if (!children?.includes(child.data)) if (isUndefined(index) || index < 0) children?.push(child.data);
  49666. else children?.splice(index, 0, child.data);
  49667. }
  49668. Object.assign(child, {
  49669. parent: this,
  49670. store: this.store
  49671. });
  49672. child = (0, vue.reactive)(new Node$1(child));
  49673. if (child instanceof Node$1) child.initialize();
  49674. }
  49675. child.level = this.level + 1;
  49676. if (isUndefined(index) || index < 0) this.childNodes.push(child);
  49677. else this.childNodes.splice(index, 0, child);
  49678. this.updateLeafState();
  49679. }
  49680. insertBefore(child, ref) {
  49681. let index;
  49682. if (ref) index = this.childNodes.indexOf(ref);
  49683. this.insertChild(child, index);
  49684. }
  49685. insertAfter(child, ref) {
  49686. let index;
  49687. if (ref) {
  49688. index = this.childNodes.indexOf(ref);
  49689. if (index !== -1) index += 1;
  49690. }
  49691. this.insertChild(child, index);
  49692. }
  49693. removeChild(child) {
  49694. const children = this.getChildren() || [];
  49695. const dataIndex = children.indexOf(child.data);
  49696. if (dataIndex > -1) children.splice(dataIndex, 1);
  49697. const index = this.childNodes.indexOf(child);
  49698. if (index > -1) {
  49699. this.store && this.store.deregisterNode(child);
  49700. child.parent = null;
  49701. this.childNodes.splice(index, 1);
  49702. }
  49703. this.updateLeafState();
  49704. }
  49705. removeChildByData(data) {
  49706. const targetNode = this.childNodes.find((child) => child.data === data);
  49707. if (targetNode) this.removeChild(targetNode);
  49708. }
  49709. expand(callback, expandParent) {
  49710. const done = () => {
  49711. if (expandParent) {
  49712. let parent = this.parent;
  49713. while (parent && parent.level > 0) {
  49714. parent.expanded = true;
  49715. parent = parent.parent;
  49716. }
  49717. }
  49718. this.expanded = true;
  49719. if (callback) callback();
  49720. setCanFocus(this.childNodes, true);
  49721. };
  49722. if (this.shouldLoadData()) this.loadData((data) => {
  49723. if (isArray$1(data)) {
  49724. if (this.checked) this.setChecked(true, true);
  49725. else if (!this.store.checkStrictly) reInitChecked(this);
  49726. done();
  49727. }
  49728. });
  49729. else done();
  49730. }
  49731. doCreateChildren(array, defaultProps = {}) {
  49732. array.forEach((item) => {
  49733. this.insertChild(Object.assign({ data: item }, defaultProps), void 0, true);
  49734. });
  49735. }
  49736. collapse() {
  49737. this.expanded = false;
  49738. setCanFocus(this.childNodes, false);
  49739. }
  49740. shouldLoadData() {
  49741. return Boolean(this.store.lazy === true && this.store.load && !this.loaded);
  49742. }
  49743. updateLeafState() {
  49744. if (this.store.lazy === true && this.loaded !== true && typeof this.isLeafByUser !== "undefined") {
  49745. this.isLeaf = this.isLeafByUser;
  49746. this.isEffectivelyChecked = this.isLeaf && this.disabled;
  49747. return;
  49748. }
  49749. const childNodes = this.childNodes;
  49750. if (!this.store.lazy || this.store.lazy === true && this.loaded === true) {
  49751. this.isLeaf = !childNodes || childNodes.length === 0;
  49752. this.isEffectivelyChecked = this.isLeaf && this.disabled;
  49753. return;
  49754. }
  49755. this.isLeaf = false;
  49756. }
  49757. setChecked(value, deep, recursion, passValue) {
  49758. this.indeterminate = value === "half";
  49759. this.checked = value === true;
  49760. this.isEffectivelyChecked = !this.childNodes.length && (this.disabled || this.checked);
  49761. if (this.store.checkStrictly) return;
  49762. if (!(this.shouldLoadData() && !this.store.checkDescendants)) {
  49763. const handleDescendants = () => {
  49764. if (deep) {
  49765. const childNodes = this.childNodes;
  49766. for (let i = 0, j = childNodes.length; i < j; i++) {
  49767. const child = childNodes[i];
  49768. passValue = passValue || value !== false;
  49769. const isCheck = child.disabled && child.isLeaf ? child.checked : passValue;
  49770. child.setChecked(isCheck, deep, true, passValue);
  49771. }
  49772. const { half, all, isEffectivelyChecked } = getChildState(childNodes);
  49773. if (!all) {
  49774. this.checked = all;
  49775. this.indeterminate = half;
  49776. }
  49777. this.isEffectivelyChecked = !this.childNodes.length ? this.disabled || this.checked : isEffectivelyChecked;
  49778. }
  49779. };
  49780. if (this.shouldLoadData()) {
  49781. this.loadData(() => {
  49782. handleDescendants();
  49783. reInitChecked(this);
  49784. }, { checked: value !== false });
  49785. return;
  49786. } else handleDescendants();
  49787. }
  49788. const parent = this.parent;
  49789. if (!parent || parent.level === 0) return;
  49790. if (!recursion) reInitChecked(parent);
  49791. }
  49792. getChildren(forceInit = false) {
  49793. if (this.level === 0) return this.data;
  49794. const data = this.data;
  49795. if (!data) return null;
  49796. const props = this.store.props;
  49797. let children = "children";
  49798. if (props) children = props.children || "children";
  49799. if (isUndefined(data[children])) data[children] = null;
  49800. if (forceInit && !data[children]) data[children] = [];
  49801. return data[children];
  49802. }
  49803. updateChildren() {
  49804. const newData = this.getChildren() || [];
  49805. const oldData = this.childNodes.map((node) => node.data);
  49806. const newDataMap = {};
  49807. const newNodes = [];
  49808. newData.forEach((item, index) => {
  49809. const key = item[NODE_KEY];
  49810. if (!!key && oldData.some((data) => data?.[NODE_KEY] === key)) newDataMap[key] = {
  49811. index,
  49812. data: item
  49813. };
  49814. else newNodes.push({
  49815. index,
  49816. data: item
  49817. });
  49818. });
  49819. if (!this.store.lazy) oldData.forEach((item) => {
  49820. if (!newDataMap[item?.[NODE_KEY]]) this.removeChildByData(item);
  49821. });
  49822. newNodes.forEach(({ index, data }) => {
  49823. this.insertChild({ data }, index);
  49824. });
  49825. this.updateLeafState();
  49826. }
  49827. loadData(callback, defaultProps = {}) {
  49828. if (this.store.lazy === true && this.store.load && !this.loaded && (!this.loading || Object.keys(defaultProps).length)) {
  49829. this.loading = true;
  49830. const resolve = (children) => {
  49831. this.childNodes = [];
  49832. this.doCreateChildren(children, defaultProps);
  49833. this.loaded = true;
  49834. this.loading = false;
  49835. this.updateLeafState();
  49836. if (callback) callback.call(this, children);
  49837. };
  49838. const reject = () => {
  49839. this.loading = false;
  49840. };
  49841. this.store.load(this, resolve, reject);
  49842. } else if (callback) callback.call(this);
  49843. }
  49844. eachNode(callback) {
  49845. const arr = [this];
  49846. while (arr.length) {
  49847. const node = arr.shift();
  49848. arr.unshift(...node.childNodes);
  49849. callback(node);
  49850. }
  49851. }
  49852. reInitChecked() {
  49853. if (this.store.checkStrictly) return;
  49854. reInitChecked(this);
  49855. }
  49856. };
  49857. //#endregion
  49858. //#region ../../packages/components/tree/src/model/tree-store.ts
  49859. var TreeStore = class {
  49860. constructor(options) {
  49861. this.lazy = false;
  49862. this.checkStrictly = false;
  49863. this.autoExpandParent = false;
  49864. this.defaultExpandAll = false;
  49865. this.checkDescendants = false;
  49866. this.currentNode = null;
  49867. this.currentNodeKey = null;
  49868. for (const option in options) if (hasOwn(options, option)) this[option] = options[option];
  49869. this.nodesMap = {};
  49870. }
  49871. initialize() {
  49872. this.root = new Node$1({
  49873. data: this.data,
  49874. store: this
  49875. });
  49876. this.root.initialize();
  49877. if (this.lazy && this.load) {
  49878. const loadFn = this.load;
  49879. loadFn(this.root, (data) => {
  49880. this.root.doCreateChildren(data);
  49881. this._initDefaultCheckedNodes();
  49882. }, NOOP);
  49883. } else this._initDefaultCheckedNodes();
  49884. }
  49885. filter(value) {
  49886. const filterNodeMethod = this.filterNodeMethod;
  49887. const lazy = this.lazy;
  49888. const traverse = async function(node) {
  49889. const childNodes = node.root ? node.root.childNodes : node.childNodes;
  49890. for (const [index, child] of childNodes.entries()) {
  49891. child.visible = !!filterNodeMethod?.call(child, value, child.data, child);
  49892. if (index % 80 === 0 && index > 0) await (0, vue.nextTick)();
  49893. await traverse(child);
  49894. }
  49895. if (!node.visible && childNodes.length) {
  49896. let allHidden = true;
  49897. allHidden = !childNodes.some((child) => child.visible);
  49898. if (node.root) node.root.visible = allHidden === false;
  49899. else node.visible = allHidden === false;
  49900. }
  49901. if (!value) return;
  49902. if (node.visible && !node.isLeaf) {
  49903. if (!lazy || node.loaded) node.expand();
  49904. }
  49905. };
  49906. traverse(this);
  49907. }
  49908. setData(newVal) {
  49909. if (newVal !== this.root.data) {
  49910. this.nodesMap = {};
  49911. this.root.setData(newVal);
  49912. this._initDefaultCheckedNodes();
  49913. this.setCurrentNodeKey(this.currentNodeKey);
  49914. } else this.root.updateChildren();
  49915. }
  49916. getNode(data) {
  49917. if (data instanceof Node$1) return data;
  49918. const key = isObject$1(data) ? getNodeKey(this.key, data) : data;
  49919. return this.nodesMap[key] || null;
  49920. }
  49921. insertBefore(data, refData) {
  49922. const refNode = this.getNode(refData);
  49923. refNode.parent?.insertBefore({ data }, refNode);
  49924. }
  49925. insertAfter(data, refData) {
  49926. const refNode = this.getNode(refData);
  49927. refNode.parent?.insertAfter({ data }, refNode);
  49928. }
  49929. remove(data) {
  49930. const node = this.getNode(data);
  49931. if (node && node.parent) {
  49932. if (node === this.currentNode) this.currentNode = null;
  49933. node.parent.removeChild(node);
  49934. }
  49935. }
  49936. append(data, parentData) {
  49937. const parentNode = !isPropAbsent(parentData) ? this.getNode(parentData) : this.root;
  49938. if (parentNode) parentNode.insertChild({ data });
  49939. }
  49940. _initDefaultCheckedNodes() {
  49941. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49942. const nodesMap = this.nodesMap;
  49943. defaultCheckedKeys.forEach((checkedKey) => {
  49944. const node = nodesMap[checkedKey];
  49945. if (node) node.setChecked(true, !this.checkStrictly);
  49946. });
  49947. }
  49948. _initDefaultCheckedNode(node) {
  49949. const defaultCheckedKeys = this.defaultCheckedKeys || [];
  49950. if (!isNil(node.key) && defaultCheckedKeys.includes(node.key)) node.setChecked(true, !this.checkStrictly);
  49951. }
  49952. setDefaultCheckedKey(newVal) {
  49953. if (newVal !== this.defaultCheckedKeys) {
  49954. this.defaultCheckedKeys = newVal;
  49955. this._initDefaultCheckedNodes();
  49956. }
  49957. }
  49958. registerNode(node) {
  49959. const key = this.key;
  49960. if (!node || !node.data) return;
  49961. if (!key) this.nodesMap[node.id] = node;
  49962. else {
  49963. const nodeKey = node.key;
  49964. if (!isNil(nodeKey)) this.nodesMap[nodeKey] = node;
  49965. }
  49966. }
  49967. deregisterNode(node) {
  49968. if (!this.key || !node || !node.data) return;
  49969. node.childNodes.forEach((child) => {
  49970. this.deregisterNode(child);
  49971. });
  49972. delete this.nodesMap[node.key];
  49973. }
  49974. getCheckedNodes(leafOnly = false, includeHalfChecked = false) {
  49975. const checkedNodes = [];
  49976. const traverse = function(node) {
  49977. (node.root ? node.root.childNodes : node.childNodes).forEach((child) => {
  49978. if ((child.checked || includeHalfChecked && child.indeterminate) && (!leafOnly || leafOnly && child.isLeaf)) checkedNodes.push(child.data);
  49979. traverse(child);
  49980. });
  49981. };
  49982. traverse(this);
  49983. return checkedNodes;
  49984. }
  49985. getCheckedKeys(leafOnly = false) {
  49986. return this.getCheckedNodes(leafOnly).map((data) => (data || {})[this.key]);
  49987. }
  49988. getHalfCheckedNodes() {
  49989. const nodes = [];
  49990. const traverse = function(node) {
  49991. (node.root ? node.root.childNodes : node.childNodes).forEach((child) => {
  49992. if (child.indeterminate) nodes.push(child.data);
  49993. traverse(child);
  49994. });
  49995. };
  49996. traverse(this);
  49997. return nodes;
  49998. }
  49999. getHalfCheckedKeys() {
  50000. return this.getHalfCheckedNodes().map((data) => (data || {})[this.key]);
  50001. }
  50002. _getAllNodes() {
  50003. const allNodes = [];
  50004. const nodesMap = this.nodesMap;
  50005. for (const nodeKey in nodesMap) if (hasOwn(nodesMap, nodeKey)) allNodes.push(nodesMap[nodeKey]);
  50006. return allNodes;
  50007. }
  50008. updateChildren(key, data) {
  50009. const node = this.nodesMap[key];
  50010. if (!node) return;
  50011. const childNodes = node.childNodes;
  50012. for (let i = childNodes.length - 1; i >= 0; i--) {
  50013. const child = childNodes[i];
  50014. this.remove(child.data);
  50015. }
  50016. for (let i = 0, j = data.length; i < j; i++) {
  50017. const child = data[i];
  50018. this.append(child, node.data);
  50019. }
  50020. }
  50021. _setCheckedKeys(key, leafOnly = false, checkedKeys) {
  50022. const allNodes = this._getAllNodes().sort((a, b) => a.level - b.level);
  50023. const cache = Object.create(null);
  50024. const keys = Object.keys(checkedKeys);
  50025. allNodes.forEach((node) => node.setChecked(false, false));
  50026. const cacheCheckedChild = (node) => {
  50027. node.childNodes.forEach((child) => {
  50028. cache[child.data[key]] = true;
  50029. if (child.childNodes?.length) cacheCheckedChild(child);
  50030. });
  50031. };
  50032. for (let i = 0, j = allNodes.length; i < j; i++) {
  50033. const node = allNodes[i];
  50034. const nodeKey = node.data[key].toString();
  50035. if (!keys.includes(nodeKey)) {
  50036. if (node.checked && !cache[nodeKey]) node.setChecked(false, false);
  50037. continue;
  50038. }
  50039. if (node.childNodes.length) cacheCheckedChild(node);
  50040. if (node.isLeaf || this.checkStrictly) {
  50041. node.setChecked(true, false);
  50042. continue;
  50043. }
  50044. node.setChecked(true, true);
  50045. if (leafOnly) {
  50046. node.setChecked(false, false, true);
  50047. const traverse = function(node) {
  50048. node.childNodes.forEach((child) => {
  50049. if (!child.isLeaf) child.setChecked(false, false, true);
  50050. traverse(child);
  50051. });
  50052. node.reInitChecked();
  50053. };
  50054. traverse(node);
  50055. }
  50056. }
  50057. }
  50058. setCheckedNodes(array, leafOnly = false) {
  50059. const key = this.key;
  50060. const checkedKeys = {};
  50061. array.forEach((item) => {
  50062. checkedKeys[(item || {})[key]] = true;
  50063. });
  50064. this._setCheckedKeys(key, leafOnly, checkedKeys);
  50065. }
  50066. setCheckedKeys(keys, leafOnly = false) {
  50067. this.defaultCheckedKeys = keys;
  50068. const key = this.key;
  50069. const checkedKeys = {};
  50070. keys.forEach((key) => {
  50071. checkedKeys[key] = true;
  50072. });
  50073. this._setCheckedKeys(key, leafOnly, checkedKeys);
  50074. }
  50075. setDefaultExpandedKeys(keys) {
  50076. keys = keys || [];
  50077. this.defaultExpandedKeys = keys;
  50078. keys.forEach((key) => {
  50079. const node = this.getNode(key);
  50080. if (node) node.expand(null, this.autoExpandParent);
  50081. });
  50082. }
  50083. setChecked(data, checked, deep) {
  50084. const node = this.getNode(data);
  50085. if (node) node.setChecked(!!checked, deep);
  50086. }
  50087. getCurrentNode() {
  50088. return this.currentNode;
  50089. }
  50090. setCurrentNode(currentNode) {
  50091. const prevCurrentNode = this.currentNode;
  50092. if (prevCurrentNode) prevCurrentNode.isCurrent = false;
  50093. this.currentNode = currentNode;
  50094. this.currentNode.isCurrent = true;
  50095. }
  50096. setUserCurrentNode(node, shouldAutoExpandParent = true) {
  50097. const key = node[this.key];
  50098. const currNode = this.nodesMap[key];
  50099. this.setCurrentNode(currNode);
  50100. if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) this.currentNode.parent?.expand(null, true);
  50101. }
  50102. setCurrentNodeKey(key, shouldAutoExpandParent = true) {
  50103. this.currentNodeKey = key;
  50104. if (isPropAbsent(key)) {
  50105. this.currentNode && (this.currentNode.isCurrent = false);
  50106. this.currentNode = null;
  50107. return;
  50108. }
  50109. const node = this.getNode(key);
  50110. if (node) {
  50111. this.setCurrentNode(node);
  50112. if (shouldAutoExpandParent && this.currentNode && this.currentNode.level > 1) this.currentNode.parent?.expand(null, true);
  50113. }
  50114. }
  50115. };
  50116. //#endregion
  50117. //#region ../../packages/components/tree/src/tokens.ts
  50118. const ROOT_TREE_INJECTION_KEY = "RootTree";
  50119. const NODE_INSTANCE_INJECTION_KEY = "NodeInstance";
  50120. const TREE_NODE_MAP_INJECTION_KEY = "TreeNodeMap";
  50121. //#endregion
  50122. //#region ../../packages/components/tree/src/tree-node-content.vue?vue&type=script&lang.ts
  50123. var tree_node_content_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  50124. name: "ElTreeNodeContent",
  50125. props: {
  50126. node: {
  50127. type: Object,
  50128. required: true
  50129. },
  50130. renderContent: Function
  50131. },
  50132. setup(props) {
  50133. const ns = useNamespace("tree");
  50134. const nodeInstance = (0, vue.inject)(NODE_INSTANCE_INJECTION_KEY);
  50135. const tree = (0, vue.inject)(ROOT_TREE_INJECTION_KEY);
  50136. return () => {
  50137. const node = props.node;
  50138. const { data, store } = node;
  50139. return props.renderContent ? props.renderContent(vue.h, {
  50140. _self: nodeInstance,
  50141. node,
  50142. data,
  50143. store
  50144. }) : (0, vue.renderSlot)(tree.ctx.slots, "default", {
  50145. node,
  50146. data
  50147. }, () => [(0, vue.h)(ElText, {
  50148. tag: "span",
  50149. truncated: true,
  50150. class: ns.be("node", "label")
  50151. }, () => [node.label])]);
  50152. };
  50153. }
  50154. });
  50155. //#endregion
  50156. //#region ../../packages/components/tree/src/tree-node-content.vue
  50157. var tree_node_content_default$1 = tree_node_content_vue_vue_type_script_lang_default;
  50158. //#endregion
  50159. //#region ../../packages/components/tree/src/model/useNodeExpandEventBroadcast.ts
  50160. function useNodeExpandEventBroadcast(props) {
  50161. const parentNodeMap = (0, vue.inject)(TREE_NODE_MAP_INJECTION_KEY, null);
  50162. let currentNodeMap = {
  50163. treeNodeExpand: (node) => {
  50164. if (props.node !== node) props.node?.collapse();
  50165. },
  50166. children: /* @__PURE__ */ new Set()
  50167. };
  50168. if (parentNodeMap) parentNodeMap.children.add(currentNodeMap);
  50169. (0, vue.onBeforeUnmount)(() => {
  50170. if (parentNodeMap) parentNodeMap.children.delete(currentNodeMap);
  50171. currentNodeMap = null;
  50172. });
  50173. (0, vue.provide)(TREE_NODE_MAP_INJECTION_KEY, currentNodeMap);
  50174. return { broadcastExpanded: (node) => {
  50175. if (!props.accordion) return;
  50176. for (const childNode of currentNodeMap.children) childNode.treeNodeExpand(node);
  50177. } };
  50178. }
  50179. //#endregion
  50180. //#region ../../packages/components/tree/src/model/useDragNode.ts
  50181. const dragEventsKey = Symbol("dragEvents");
  50182. function useDragNodeHandler({ props, ctx, el$, dropIndicator$, store }) {
  50183. const ns = useNamespace("tree");
  50184. const dragState = (0, vue.ref)({
  50185. showDropIndicator: false,
  50186. draggingNode: null,
  50187. dropNode: null,
  50188. allowDrop: true,
  50189. dropType: null
  50190. });
  50191. const treeNodeDragStart = ({ event, treeNode }) => {
  50192. if (!event.dataTransfer) return;
  50193. if (isFunction$1(props.allowDrag) && !props.allowDrag(treeNode.node)) {
  50194. event.preventDefault();
  50195. return false;
  50196. }
  50197. event.dataTransfer.effectAllowed = "move";
  50198. try {
  50199. event.dataTransfer.setData("text/plain", "");
  50200. } catch {}
  50201. dragState.value.draggingNode = treeNode;
  50202. ctx.emit("node-drag-start", treeNode.node, event);
  50203. };
  50204. const treeNodeDragOver = ({ event, treeNode }) => {
  50205. if (!event.dataTransfer) return;
  50206. const dropNode = treeNode;
  50207. const oldDropNode = dragState.value.dropNode;
  50208. if (oldDropNode && oldDropNode.node.id !== dropNode.node.id) removeClass(oldDropNode.$el, ns.is("drop-inner"));
  50209. const draggingNode = dragState.value.draggingNode;
  50210. if (!draggingNode || !dropNode) return;
  50211. let dropPrev = true;
  50212. let dropInner = true;
  50213. let dropNext = true;
  50214. let userAllowDropInner = true;
  50215. if (isFunction$1(props.allowDrop)) {
  50216. dropPrev = props.allowDrop(draggingNode.node, dropNode.node, "prev");
  50217. userAllowDropInner = dropInner = props.allowDrop(draggingNode.node, dropNode.node, "inner");
  50218. dropNext = props.allowDrop(draggingNode.node, dropNode.node, "next");
  50219. }
  50220. event.dataTransfer.dropEffect = dropInner || dropPrev || dropNext ? "move" : "none";
  50221. if ((dropPrev || dropInner || dropNext) && oldDropNode?.node.id !== dropNode.node.id) {
  50222. if (oldDropNode) ctx.emit("node-drag-leave", draggingNode.node, oldDropNode.node, event);
  50223. ctx.emit("node-drag-enter", draggingNode.node, dropNode.node, event);
  50224. }
  50225. if (dropPrev || dropInner || dropNext) dragState.value.dropNode = dropNode;
  50226. else dragState.value.dropNode = null;
  50227. if (dropNode.node.nextSibling === draggingNode.node) dropNext = false;
  50228. if (dropNode.node.previousSibling === draggingNode.node) dropPrev = false;
  50229. if (dropNode.node.contains(draggingNode.node, false)) dropInner = false;
  50230. if (draggingNode.node === dropNode.node || draggingNode.node.contains(dropNode.node)) {
  50231. dropPrev = false;
  50232. dropInner = false;
  50233. dropNext = false;
  50234. }
  50235. const dropEl = dropNode.$el;
  50236. const targetPosition = dropEl.querySelector(`.${ns.be("node", "content")}`).getBoundingClientRect();
  50237. const treePosition = el$.value.getBoundingClientRect();
  50238. const treeScrollTop = el$.value.scrollTop;
  50239. let dropType;
  50240. const prevPercent = dropPrev ? dropInner ? .25 : dropNext ? .45 : 1 : Number.NEGATIVE_INFINITY;
  50241. const nextPercent = dropNext ? dropInner ? .75 : dropPrev ? .55 : 0 : Number.POSITIVE_INFINITY;
  50242. let indicatorTop = -9999;
  50243. const distance = event.clientY - targetPosition.top;
  50244. if (distance < targetPosition.height * prevPercent) dropType = "before";
  50245. else if (distance > targetPosition.height * nextPercent) dropType = "after";
  50246. else if (dropInner) dropType = "inner";
  50247. else dropType = "none";
  50248. const iconPosition = dropEl.querySelector(`.${ns.be("node", "expand-icon")}`).getBoundingClientRect();
  50249. const dropIndicator = dropIndicator$.value;
  50250. if (dropType === "before") indicatorTop = iconPosition.top - treePosition.top + treeScrollTop;
  50251. else if (dropType === "after") indicatorTop = iconPosition.bottom - treePosition.top + treeScrollTop;
  50252. dropIndicator.style.top = `${indicatorTop}px`;
  50253. dropIndicator.style.left = `${iconPosition.right - treePosition.left}px`;
  50254. if (dropType === "inner") addClass(dropEl, ns.is("drop-inner"));
  50255. else removeClass(dropEl, ns.is("drop-inner"));
  50256. dragState.value.showDropIndicator = dropType === "before" || dropType === "after";
  50257. dragState.value.allowDrop = dragState.value.showDropIndicator || userAllowDropInner;
  50258. dragState.value.dropType = dropType;
  50259. ctx.emit("node-drag-over", draggingNode.node, dropNode.node, event);
  50260. };
  50261. const treeNodeDragEnd = (event) => {
  50262. const { draggingNode, dropType, dropNode } = dragState.value;
  50263. event.preventDefault();
  50264. if (event.dataTransfer) event.dataTransfer.dropEffect = "move";
  50265. if (draggingNode?.node.data && dropNode) {
  50266. const draggingNodeCopy = { data: draggingNode.node.data };
  50267. if (dropType !== "none") draggingNode.node.remove();
  50268. if (dropType === "before") dropNode.node.parent?.insertBefore(draggingNodeCopy, dropNode.node);
  50269. else if (dropType === "after") dropNode.node.parent?.insertAfter(draggingNodeCopy, dropNode.node);
  50270. else if (dropType === "inner") dropNode.node.insertChild(draggingNodeCopy);
  50271. if (dropType !== "none") {
  50272. store.value.registerNode(draggingNodeCopy);
  50273. if (store.value.key) draggingNode.node.eachNode((node) => {
  50274. store.value.nodesMap[node.data[store.value.key]]?.setChecked(node.checked, !store.value.checkStrictly);
  50275. });
  50276. }
  50277. removeClass(dropNode.$el, ns.is("drop-inner"));
  50278. ctx.emit("node-drag-end", draggingNode.node, dropNode.node, dropType, event);
  50279. if (dropType !== "none") ctx.emit("node-drop", draggingNode.node, dropNode.node, dropType, event);
  50280. }
  50281. if (draggingNode && !dropNode) ctx.emit("node-drag-end", draggingNode.node, null, dropType, event);
  50282. dragState.value.showDropIndicator = false;
  50283. dragState.value.draggingNode = null;
  50284. dragState.value.dropNode = null;
  50285. dragState.value.allowDrop = true;
  50286. };
  50287. (0, vue.provide)(dragEventsKey, {
  50288. treeNodeDragStart,
  50289. treeNodeDragOver,
  50290. treeNodeDragEnd
  50291. });
  50292. return { dragState };
  50293. }
  50294. //#endregion
  50295. //#region ../../packages/components/tree/src/tree-node.vue?vue&type=script&lang.ts
  50296. var tree_node_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  50297. name: "ElTreeNode",
  50298. components: {
  50299. ElCollapseTransition,
  50300. ElCheckbox,
  50301. NodeContent: tree_node_content_default$1,
  50302. ElIcon,
  50303. Loading: loading_default
  50304. },
  50305. props: {
  50306. node: {
  50307. type: Node$1,
  50308. default: () => ({})
  50309. },
  50310. props: {
  50311. type: Object,
  50312. default: () => ({})
  50313. },
  50314. accordion: Boolean,
  50315. renderContent: Function,
  50316. renderAfterExpand: Boolean,
  50317. showCheckbox: Boolean
  50318. },
  50319. emits: ["node-expand"],
  50320. setup(props, ctx) {
  50321. const ns = useNamespace("tree");
  50322. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  50323. const tree = (0, vue.inject)(ROOT_TREE_INJECTION_KEY);
  50324. const expanded = (0, vue.ref)(false);
  50325. const childNodeRendered = (0, vue.ref)(false);
  50326. const oldChecked = (0, vue.ref)();
  50327. const oldIndeterminate = (0, vue.ref)();
  50328. const node$ = (0, vue.ref)();
  50329. const dragEvents = (0, vue.inject)(dragEventsKey);
  50330. const instance = (0, vue.getCurrentInstance)();
  50331. (0, vue.provide)(NODE_INSTANCE_INJECTION_KEY, instance);
  50332. if (!tree) /* @__PURE__ */ debugWarn("Tree", "Can not find node's tree.");
  50333. if (props.node.expanded) {
  50334. expanded.value = true;
  50335. childNodeRendered.value = true;
  50336. }
  50337. const childrenKey = tree.props.props["children"] || "children";
  50338. (0, vue.watch)(() => {
  50339. const children = props.node.data?.[childrenKey];
  50340. return children && [...children];
  50341. }, () => {
  50342. props.node.updateChildren();
  50343. });
  50344. (0, vue.watch)(() => props.node.indeterminate, (val) => {
  50345. handleSelectChange(props.node.checked, val);
  50346. });
  50347. (0, vue.watch)(() => props.node.checked, (val) => {
  50348. handleSelectChange(val, props.node.indeterminate);
  50349. });
  50350. (0, vue.watch)(() => props.node.childNodes.length, () => props.node.reInitChecked());
  50351. (0, vue.watch)(() => props.node.expanded, (val) => {
  50352. (0, vue.nextTick)(() => expanded.value = val);
  50353. if (val) childNodeRendered.value = true;
  50354. });
  50355. const getNodeKey$2 = (node) => {
  50356. return tree.props.nodeKey ? getNodeKey(tree.props.nodeKey, node.data) : node.id;
  50357. };
  50358. const getNodeClass = (node) => {
  50359. const nodeClassFunc = props.props.class;
  50360. if (!nodeClassFunc) return {};
  50361. let className;
  50362. if (isFunction$1(nodeClassFunc)) {
  50363. const { data } = node;
  50364. className = nodeClassFunc(data, node);
  50365. } else className = nodeClassFunc;
  50366. if (isString(className)) return { [className]: true };
  50367. else return className;
  50368. };
  50369. const handleSelectChange = (checked, indeterminate) => {
  50370. if (oldChecked.value !== checked || oldIndeterminate.value !== indeterminate) tree.ctx.emit("check-change", props.node.data, checked, indeterminate);
  50371. oldChecked.value = checked;
  50372. oldIndeterminate.value = indeterminate;
  50373. };
  50374. const handleClick = (e) => {
  50375. handleCurrentChange(tree.store, tree.ctx.emit, () => {
  50376. if (tree?.props?.nodeKey) {
  50377. const curNodeKey = getNodeKey$2(props.node);
  50378. tree.store.value.setCurrentNodeKey(curNodeKey);
  50379. } else tree.store.value.setCurrentNode(props.node);
  50380. });
  50381. tree.currentNode.value = props.node;
  50382. if (tree.props.expandOnClickNode) handleExpandIconClick();
  50383. if ((tree.props.checkOnClickNode || props.node.isLeaf && tree.props.checkOnClickLeaf && props.showCheckbox) && !props.node.disabled) handleCheckChange(!props.node.checked);
  50384. tree.ctx.emit("node-click", props.node.data, props.node, instance, e);
  50385. };
  50386. const handleContextMenu = (event) => {
  50387. if (tree.instance.vnode.props?.["onNodeContextmenu"]) {
  50388. event.stopPropagation();
  50389. event.preventDefault();
  50390. }
  50391. tree.ctx.emit("node-contextmenu", event, props.node.data, props.node, instance);
  50392. };
  50393. const handleExpandIconClick = () => {
  50394. if (props.node.isLeaf) return;
  50395. if (expanded.value) {
  50396. tree.ctx.emit("node-collapse", props.node.data, props.node, instance);
  50397. props.node.collapse();
  50398. } else props.node.expand(() => {
  50399. ctx.emit("node-expand", props.node.data, props.node, instance);
  50400. });
  50401. };
  50402. const handleCheckChange = (value) => {
  50403. const checkStrictly = tree?.props.checkStrictly;
  50404. const childNodes = props.node.childNodes;
  50405. if (!checkStrictly && childNodes.length) value = childNodes.some((node) => !node.isEffectivelyChecked);
  50406. props.node.setChecked(value, !checkStrictly);
  50407. (0, vue.nextTick)(() => {
  50408. const store = tree.store.value;
  50409. tree.ctx.emit("check", props.node.data, {
  50410. checkedNodes: store.getCheckedNodes(),
  50411. checkedKeys: store.getCheckedKeys(),
  50412. halfCheckedNodes: store.getHalfCheckedNodes(),
  50413. halfCheckedKeys: store.getHalfCheckedKeys()
  50414. });
  50415. });
  50416. };
  50417. const handleChildNodeExpand = (nodeData, node, instance) => {
  50418. broadcastExpanded(node);
  50419. tree.ctx.emit("node-expand", nodeData, node, instance);
  50420. };
  50421. const handleDragStart = (event) => {
  50422. if (!tree.props.draggable) return;
  50423. dragEvents.treeNodeDragStart({
  50424. event,
  50425. treeNode: props
  50426. });
  50427. };
  50428. const handleDragOver = (event) => {
  50429. event.preventDefault();
  50430. if (!tree.props.draggable) return;
  50431. dragEvents.treeNodeDragOver({
  50432. event,
  50433. treeNode: {
  50434. $el: node$.value,
  50435. node: props.node
  50436. }
  50437. });
  50438. };
  50439. const handleDrop = (event) => {
  50440. event.preventDefault();
  50441. };
  50442. const handleDragEnd = (event) => {
  50443. if (!tree.props.draggable) return;
  50444. dragEvents.treeNodeDragEnd(event);
  50445. };
  50446. return {
  50447. ns,
  50448. node$,
  50449. tree,
  50450. expanded,
  50451. childNodeRendered,
  50452. oldChecked,
  50453. oldIndeterminate,
  50454. getNodeKey: getNodeKey$2,
  50455. getNodeClass,
  50456. handleSelectChange,
  50457. handleClick,
  50458. handleContextMenu,
  50459. handleExpandIconClick,
  50460. handleCheckChange,
  50461. handleChildNodeExpand,
  50462. handleDragStart,
  50463. handleDragOver,
  50464. handleDrop,
  50465. handleDragEnd,
  50466. CaretRight: caret_right_default
  50467. };
  50468. }
  50469. });
  50470. //#endregion
  50471. //#region ../../packages/components/tree/src/tree-node.vue
  50472. const _hoisted_1$12 = [
  50473. "aria-expanded",
  50474. "aria-disabled",
  50475. "aria-checked",
  50476. "draggable",
  50477. "data-key"
  50478. ];
  50479. const _hoisted_2$7 = ["aria-expanded"];
  50480. function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
  50481. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  50482. const _component_el_checkbox = (0, vue.resolveComponent)("el-checkbox");
  50483. const _component_loading = (0, vue.resolveComponent)("loading");
  50484. const _component_node_content = (0, vue.resolveComponent)("node-content");
  50485. const _component_el_tree_node = (0, vue.resolveComponent)("el-tree-node");
  50486. const _component_el_collapse_transition = (0, vue.resolveComponent)("el-collapse-transition");
  50487. return (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  50488. ref: "node$",
  50489. class: (0, vue.normalizeClass)([
  50490. _ctx.ns.b("node"),
  50491. _ctx.ns.is("expanded", _ctx.expanded),
  50492. _ctx.ns.is("current", _ctx.node.isCurrent),
  50493. _ctx.ns.is("hidden", !_ctx.node.visible),
  50494. _ctx.ns.is("focusable", !_ctx.node.disabled),
  50495. _ctx.ns.is("checked", !_ctx.node.disabled && _ctx.node.checked),
  50496. _ctx.getNodeClass(_ctx.node)
  50497. ]),
  50498. role: "treeitem",
  50499. tabindex: "-1",
  50500. "aria-expanded": _ctx.expanded,
  50501. "aria-disabled": _ctx.node.disabled,
  50502. "aria-checked": _ctx.node.checked,
  50503. draggable: _ctx.tree.props.draggable,
  50504. "data-key": _ctx.getNodeKey(_ctx.node),
  50505. onClick: _cache[2] || (_cache[2] = (0, vue.withModifiers)((...args) => _ctx.handleClick && _ctx.handleClick(...args), ["stop"])),
  50506. onContextmenu: _cache[3] || (_cache[3] = (...args) => _ctx.handleContextMenu && _ctx.handleContextMenu(...args)),
  50507. onDragstart: _cache[4] || (_cache[4] = (0, vue.withModifiers)((...args) => _ctx.handleDragStart && _ctx.handleDragStart(...args), ["stop"])),
  50508. onDragover: _cache[5] || (_cache[5] = (0, vue.withModifiers)((...args) => _ctx.handleDragOver && _ctx.handleDragOver(...args), ["stop"])),
  50509. onDragend: _cache[6] || (_cache[6] = (0, vue.withModifiers)((...args) => _ctx.handleDragEnd && _ctx.handleDragEnd(...args), ["stop"])),
  50510. onDrop: _cache[7] || (_cache[7] = (0, vue.withModifiers)((...args) => _ctx.handleDrop && _ctx.handleDrop(...args), ["stop"]))
  50511. }, [(0, vue.createElementVNode)("div", {
  50512. class: (0, vue.normalizeClass)(_ctx.ns.be("node", "content")),
  50513. style: (0, vue.normalizeStyle)({ paddingLeft: (_ctx.node.level - 1) * _ctx.tree.props.indent + "px" })
  50514. }, [
  50515. _ctx.tree.props.icon || _ctx.CaretRight ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  50516. key: 0,
  50517. class: (0, vue.normalizeClass)([
  50518. _ctx.ns.be("node", "expand-icon"),
  50519. _ctx.ns.is("leaf", _ctx.node.isLeaf),
  50520. { expanded: !_ctx.node.isLeaf && _ctx.expanded }
  50521. ]),
  50522. onClick: (0, vue.withModifiers)(_ctx.handleExpandIconClick, ["stop"])
  50523. }, {
  50524. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.tree.props.icon || _ctx.CaretRight)))]),
  50525. _: 1
  50526. }, 8, ["class", "onClick"])) : (0, vue.createCommentVNode)("v-if", true),
  50527. _ctx.showCheckbox ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_checkbox, {
  50528. key: 1,
  50529. "model-value": _ctx.node.checked,
  50530. indeterminate: _ctx.node.indeterminate,
  50531. disabled: !!_ctx.node.disabled,
  50532. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"])),
  50533. onChange: _ctx.handleCheckChange
  50534. }, null, 8, [
  50535. "model-value",
  50536. "indeterminate",
  50537. "disabled",
  50538. "onChange"
  50539. ])) : (0, vue.createCommentVNode)("v-if", true),
  50540. _ctx.node.loading ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  50541. key: 2,
  50542. class: (0, vue.normalizeClass)([_ctx.ns.be("node", "loading-icon"), _ctx.ns.is("loading")])
  50543. }, {
  50544. default: (0, vue.withCtx)(() => [(0, vue.createVNode)(_component_loading)]),
  50545. _: 1
  50546. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true),
  50547. (0, vue.createVNode)(_component_node_content, {
  50548. node: _ctx.node,
  50549. "render-content": _ctx.renderContent
  50550. }, null, 8, ["node", "render-content"])
  50551. ], 6), (0, vue.createVNode)(_component_el_collapse_transition, null, {
  50552. default: (0, vue.withCtx)(() => [!_ctx.renderAfterExpand || _ctx.childNodeRendered ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  50553. key: 0,
  50554. class: (0, vue.normalizeClass)(_ctx.ns.be("node", "children")),
  50555. role: "group",
  50556. "aria-expanded": _ctx.expanded,
  50557. onClick: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["stop"]))
  50558. }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.node.childNodes, (child) => {
  50559. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tree_node, {
  50560. key: _ctx.getNodeKey(child),
  50561. "render-content": _ctx.renderContent,
  50562. "render-after-expand": _ctx.renderAfterExpand,
  50563. "show-checkbox": _ctx.showCheckbox,
  50564. node: child,
  50565. accordion: _ctx.accordion,
  50566. props: _ctx.props,
  50567. onNodeExpand: _ctx.handleChildNodeExpand
  50568. }, null, 8, [
  50569. "render-content",
  50570. "render-after-expand",
  50571. "show-checkbox",
  50572. "node",
  50573. "accordion",
  50574. "props",
  50575. "onNodeExpand"
  50576. ]);
  50577. }), 128))], 10, _hoisted_2$7)), [[vue.vShow, _ctx.expanded]]) : (0, vue.createCommentVNode)("v-if", true)]),
  50578. _: 1
  50579. })], 42, _hoisted_1$12)), [[vue.vShow, _ctx.node.visible]]);
  50580. }
  50581. var tree_node_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_node_vue_vue_type_script_lang_default, [["render", _sfc_render$2]]);
  50582. //#endregion
  50583. //#region ../../packages/components/tree/src/model/useKeydown.ts
  50584. function useKeydown({ el$ }, store) {
  50585. const ns = useNamespace("tree");
  50586. (0, vue.onMounted)(() => {
  50587. initTabIndex();
  50588. });
  50589. (0, vue.onUpdated)(() => {
  50590. el$.value?.querySelectorAll("input[type=checkbox]").forEach((checkbox) => {
  50591. checkbox.setAttribute("tabindex", "-1");
  50592. });
  50593. });
  50594. function canNodeFocus(treeItems, nextIndex) {
  50595. const currentNode = store.value.getNode(treeItems[nextIndex].dataset.key);
  50596. return currentNode.canFocus && currentNode.visible && (currentNode.parent?.expanded || currentNode.parent?.level === 0);
  50597. }
  50598. const handleKeydown = (ev) => {
  50599. const currentItem = ev.target;
  50600. if (!currentItem.className.includes(ns.b("node"))) return;
  50601. const code = getEventCode(ev);
  50602. const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  50603. const currentIndex = treeItems.indexOf(currentItem);
  50604. let nextIndex;
  50605. if ([EVENT_CODE.up, EVENT_CODE.down].includes(code)) {
  50606. ev.preventDefault();
  50607. if (code === EVENT_CODE.up) {
  50608. nextIndex = currentIndex === -1 ? 0 : currentIndex !== 0 ? currentIndex - 1 : treeItems.length - 1;
  50609. const startIndex = nextIndex;
  50610. while (true) {
  50611. if (canNodeFocus(treeItems, nextIndex)) break;
  50612. nextIndex--;
  50613. if (nextIndex === startIndex) {
  50614. nextIndex = -1;
  50615. break;
  50616. }
  50617. if (nextIndex < 0) nextIndex = treeItems.length - 1;
  50618. }
  50619. } else {
  50620. nextIndex = currentIndex === -1 ? 0 : currentIndex < treeItems.length - 1 ? currentIndex + 1 : 0;
  50621. const startIndex = nextIndex;
  50622. while (true) {
  50623. if (canNodeFocus(treeItems, nextIndex)) break;
  50624. nextIndex++;
  50625. if (nextIndex === startIndex) {
  50626. nextIndex = -1;
  50627. break;
  50628. }
  50629. if (nextIndex >= treeItems.length) nextIndex = 0;
  50630. }
  50631. }
  50632. nextIndex !== -1 && treeItems[nextIndex].focus();
  50633. }
  50634. if ([EVENT_CODE.left, EVENT_CODE.right].includes(code)) {
  50635. ev.preventDefault();
  50636. currentItem.click();
  50637. }
  50638. const hasInput = currentItem.querySelector("[type=\"checkbox\"]");
  50639. if ([
  50640. EVENT_CODE.enter,
  50641. EVENT_CODE.numpadEnter,
  50642. EVENT_CODE.space
  50643. ].includes(code) && hasInput) {
  50644. ev.preventDefault();
  50645. hasInput.click();
  50646. }
  50647. };
  50648. useEventListener(el$, "keydown", handleKeydown);
  50649. const initTabIndex = () => {
  50650. if (!el$.value) return;
  50651. const treeItems = Array.from(el$.value.querySelectorAll(`.${ns.is("focusable")}[role=treeitem]`));
  50652. Array.from(el$.value.querySelectorAll("input[type=checkbox]")).forEach((checkbox) => {
  50653. checkbox.setAttribute("tabindex", "-1");
  50654. });
  50655. const checkedItem = el$.value.querySelectorAll(`.${ns.is("checked")}[role=treeitem]`);
  50656. if (checkedItem.length) {
  50657. checkedItem[0].setAttribute("tabindex", "0");
  50658. return;
  50659. }
  50660. treeItems[0]?.setAttribute("tabindex", "0");
  50661. };
  50662. }
  50663. //#endregion
  50664. //#region ../../packages/components/tree/src/tree.ts
  50665. const treeProps = buildProps({
  50666. data: {
  50667. type: definePropType(Array),
  50668. default: () => []
  50669. },
  50670. emptyText: { type: String },
  50671. renderAfterExpand: {
  50672. type: Boolean,
  50673. default: true
  50674. },
  50675. nodeKey: String,
  50676. checkStrictly: Boolean,
  50677. defaultExpandAll: Boolean,
  50678. expandOnClickNode: {
  50679. type: Boolean,
  50680. default: true
  50681. },
  50682. checkOnClickNode: Boolean,
  50683. checkOnClickLeaf: {
  50684. type: Boolean,
  50685. default: true
  50686. },
  50687. checkDescendants: Boolean,
  50688. autoExpandParent: {
  50689. type: Boolean,
  50690. default: true
  50691. },
  50692. defaultCheckedKeys: { type: Array },
  50693. defaultExpandedKeys: { type: Array },
  50694. currentNodeKey: { type: [String, Number] },
  50695. renderContent: { type: definePropType(Function) },
  50696. showCheckbox: Boolean,
  50697. draggable: Boolean,
  50698. allowDrag: { type: definePropType(Function) },
  50699. allowDrop: { type: definePropType(Function) },
  50700. props: {
  50701. type: Object,
  50702. default: () => ({
  50703. children: "children",
  50704. label: "label",
  50705. disabled: "disabled"
  50706. })
  50707. },
  50708. lazy: Boolean,
  50709. highlightCurrent: Boolean,
  50710. load: { type: Function },
  50711. filterNodeMethod: { type: Function },
  50712. accordion: Boolean,
  50713. indent: {
  50714. type: Number,
  50715. default: 18
  50716. },
  50717. icon: { type: iconPropType }
  50718. });
  50719. const treeEmits = {
  50720. "check-change": (data, checked, indeterminate) => data && isBoolean(checked) && isBoolean(indeterminate),
  50721. "current-change": (data, node) => true,
  50722. "node-click": (data, node, nodeInstance, evt) => data && node && evt instanceof Event,
  50723. "node-contextmenu": (evt, data, node, nodeInstance) => evt instanceof Event && data && node,
  50724. "node-collapse": (data, node, nodeInstance) => data && node,
  50725. "node-expand": (data, node, nodeInstance) => data && node,
  50726. check: (data, checkedInfo) => data && checkedInfo,
  50727. "node-drag-start": (node, evt) => node && evt,
  50728. "node-drag-end": (draggingNode, dropNode, dropType, evt) => draggingNode && evt,
  50729. "node-drop": (draggingNode, dropNode, dropType, evt) => draggingNode && dropNode && evt,
  50730. "node-drag-leave": (draggingNode, oldDropNode, evt) => draggingNode && oldDropNode && evt,
  50731. "node-drag-enter": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt,
  50732. "node-drag-over": (draggingNode, dropNode, evt) => draggingNode && dropNode && evt
  50733. };
  50734. //#endregion
  50735. //#region ../../packages/components/tree/src/tree.vue?vue&type=script&lang.ts
  50736. var tree_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  50737. name: "ElTree",
  50738. components: { ElTreeNode: tree_node_default$1 },
  50739. props: treeProps,
  50740. emits: treeEmits,
  50741. setup(props, ctx) {
  50742. const { t } = useLocale();
  50743. const ns = useNamespace("tree");
  50744. const store = (0, vue.ref)(new TreeStore({
  50745. key: props.nodeKey,
  50746. data: props.data,
  50747. lazy: props.lazy,
  50748. props: props.props,
  50749. load: props.load,
  50750. currentNodeKey: props.currentNodeKey,
  50751. checkStrictly: props.checkStrictly,
  50752. checkDescendants: props.checkDescendants,
  50753. defaultCheckedKeys: props.defaultCheckedKeys,
  50754. defaultExpandedKeys: props.defaultExpandedKeys,
  50755. autoExpandParent: props.autoExpandParent,
  50756. defaultExpandAll: props.defaultExpandAll,
  50757. filterNodeMethod: props.filterNodeMethod
  50758. }));
  50759. store.value.initialize();
  50760. const root = (0, vue.ref)(store.value.root);
  50761. const currentNode = (0, vue.ref)(null);
  50762. const el$ = (0, vue.ref)(null);
  50763. const dropIndicator$ = (0, vue.ref)(null);
  50764. const { broadcastExpanded } = useNodeExpandEventBroadcast(props);
  50765. const { dragState } = useDragNodeHandler({
  50766. props,
  50767. ctx,
  50768. el$,
  50769. dropIndicator$,
  50770. store
  50771. });
  50772. useKeydown({ el$ }, store);
  50773. const instance = (0, vue.getCurrentInstance)();
  50774. const isSelectTree = (0, vue.computed)(() => {
  50775. let parent = instance?.parent;
  50776. while (parent) {
  50777. if (parent.type.name === "ElTreeSelect") return true;
  50778. parent = parent.parent;
  50779. }
  50780. return false;
  50781. });
  50782. const isEmpty = (0, vue.computed)(() => {
  50783. const { childNodes } = root.value;
  50784. return (!childNodes || childNodes.length === 0 || childNodes.every(({ visible }) => !visible)) && !isSelectTree.value;
  50785. });
  50786. (0, vue.watch)(() => props.currentNodeKey, (newVal) => {
  50787. store.value.setCurrentNodeKey(newVal ?? null);
  50788. });
  50789. (0, vue.watch)(() => props.defaultCheckedKeys, (newVal, oldVal) => {
  50790. if (isEqual$1(newVal, oldVal)) return;
  50791. store.value.setDefaultCheckedKey(newVal ?? []);
  50792. });
  50793. (0, vue.watch)(() => props.defaultExpandedKeys, (newVal) => {
  50794. store.value.setDefaultExpandedKeys(newVal ?? []);
  50795. });
  50796. (0, vue.watch)(() => props.data, (newVal) => {
  50797. store.value.setData(newVal);
  50798. }, { deep: true });
  50799. (0, vue.watch)(() => props.checkStrictly, (newVal) => {
  50800. store.value.checkStrictly = newVal;
  50801. });
  50802. const filter = (value) => {
  50803. if (!props.filterNodeMethod) throw new Error("[Tree] filterNodeMethod is required when filter");
  50804. store.value.filter(value);
  50805. };
  50806. const getNodeKey$1 = (node) => {
  50807. return props.nodeKey ? getNodeKey(props.nodeKey, node.data) : node.id;
  50808. };
  50809. const requireNodeKey = (methodName) => {
  50810. if (!props.nodeKey) throw new Error(`[Tree] nodeKey is required in ${methodName}`);
  50811. };
  50812. const getNodePath = (data) => {
  50813. requireNodeKey("getNodePath");
  50814. const node = store.value.getNode(data);
  50815. if (!node) return [];
  50816. const path = [node.data];
  50817. let parent = node.parent;
  50818. while (parent && parent !== root.value) {
  50819. path.push(parent.data);
  50820. parent = parent.parent;
  50821. }
  50822. return path.reverse();
  50823. };
  50824. const getCheckedNodes = (leafOnly, includeHalfChecked) => {
  50825. return store.value.getCheckedNodes(leafOnly, includeHalfChecked);
  50826. };
  50827. const getCheckedKeys = (leafOnly) => {
  50828. return store.value.getCheckedKeys(leafOnly);
  50829. };
  50830. const getCurrentNode = () => {
  50831. const currentNode = store.value.getCurrentNode();
  50832. return currentNode ? currentNode.data : null;
  50833. };
  50834. const getCurrentKey = () => {
  50835. requireNodeKey("getCurrentKey");
  50836. const currentNode = getCurrentNode();
  50837. return currentNode ? currentNode[props.nodeKey] : null;
  50838. };
  50839. const setCheckedNodes = (nodes, leafOnly) => {
  50840. requireNodeKey("setCheckedNodes");
  50841. store.value.setCheckedNodes(nodes, leafOnly);
  50842. };
  50843. const setCheckedKeys = (keys, leafOnly) => {
  50844. requireNodeKey("setCheckedKeys");
  50845. store.value.setCheckedKeys(keys, leafOnly);
  50846. };
  50847. const setChecked = (data, checked, deep) => {
  50848. store.value.setChecked(data, checked, deep);
  50849. };
  50850. const getHalfCheckedNodes = () => {
  50851. return store.value.getHalfCheckedNodes();
  50852. };
  50853. const getHalfCheckedKeys = () => {
  50854. return store.value.getHalfCheckedKeys();
  50855. };
  50856. const setCurrentNode = (node, shouldAutoExpandParent = true) => {
  50857. requireNodeKey("setCurrentNode");
  50858. handleCurrentChange(store, ctx.emit, () => {
  50859. broadcastExpanded(node);
  50860. store.value.setUserCurrentNode(node, shouldAutoExpandParent);
  50861. });
  50862. };
  50863. const setCurrentKey = (key = null, shouldAutoExpandParent = true) => {
  50864. requireNodeKey("setCurrentKey");
  50865. handleCurrentChange(store, ctx.emit, () => {
  50866. broadcastExpanded();
  50867. store.value.setCurrentNodeKey(key, shouldAutoExpandParent);
  50868. });
  50869. };
  50870. const getNode = (data) => {
  50871. return store.value.getNode(data);
  50872. };
  50873. const remove = (data) => {
  50874. store.value.remove(data);
  50875. };
  50876. const append = (data, parentNode) => {
  50877. store.value.append(data, parentNode);
  50878. };
  50879. const insertBefore = (data, refNode) => {
  50880. store.value.insertBefore(data, refNode);
  50881. };
  50882. const insertAfter = (data, refNode) => {
  50883. store.value.insertAfter(data, refNode);
  50884. };
  50885. const handleNodeExpand = (nodeData, node, instance) => {
  50886. broadcastExpanded(node);
  50887. ctx.emit("node-expand", nodeData, node, instance);
  50888. };
  50889. const updateKeyChildren = (key, data) => {
  50890. requireNodeKey("updateKeyChildren");
  50891. store.value.updateChildren(key, data);
  50892. };
  50893. (0, vue.provide)(ROOT_TREE_INJECTION_KEY, {
  50894. ctx,
  50895. props,
  50896. store,
  50897. root,
  50898. currentNode,
  50899. instance
  50900. });
  50901. (0, vue.provide)(formItemContextKey, void 0);
  50902. return {
  50903. ns,
  50904. store,
  50905. root,
  50906. currentNode,
  50907. dragState,
  50908. el$,
  50909. dropIndicator$,
  50910. isEmpty,
  50911. filter,
  50912. getNodeKey: getNodeKey$1,
  50913. getNodePath,
  50914. getCheckedNodes,
  50915. getCheckedKeys,
  50916. getCurrentNode,
  50917. getCurrentKey,
  50918. setCheckedNodes,
  50919. setCheckedKeys,
  50920. setChecked,
  50921. getHalfCheckedNodes,
  50922. getHalfCheckedKeys,
  50923. setCurrentNode,
  50924. setCurrentKey,
  50925. t,
  50926. getNode,
  50927. remove,
  50928. append,
  50929. insertBefore,
  50930. insertAfter,
  50931. handleNodeExpand,
  50932. updateKeyChildren
  50933. };
  50934. }
  50935. });
  50936. //#endregion
  50937. //#region ../../packages/components/tree/src/tree.vue
  50938. function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
  50939. const _component_el_tree_node = (0, vue.resolveComponent)("el-tree-node");
  50940. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  50941. ref: "el$",
  50942. class: (0, vue.normalizeClass)([
  50943. _ctx.ns.b(),
  50944. _ctx.ns.is("dragging", !!_ctx.dragState.draggingNode),
  50945. _ctx.ns.is("drop-not-allow", !_ctx.dragState.allowDrop),
  50946. _ctx.ns.is("drop-inner", _ctx.dragState.dropType === "inner"),
  50947. { [_ctx.ns.m("highlight-current")]: _ctx.highlightCurrent }
  50948. ]),
  50949. role: "tree"
  50950. }, [
  50951. ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(_ctx.root.childNodes, (child) => {
  50952. return (0, vue.openBlock)(), (0, vue.createBlock)(_component_el_tree_node, {
  50953. key: _ctx.getNodeKey(child),
  50954. node: child,
  50955. props: _ctx.props,
  50956. accordion: _ctx.accordion,
  50957. "render-after-expand": _ctx.renderAfterExpand,
  50958. "show-checkbox": _ctx.showCheckbox,
  50959. "render-content": _ctx.renderContent,
  50960. onNodeExpand: _ctx.handleNodeExpand
  50961. }, null, 8, [
  50962. "node",
  50963. "props",
  50964. "accordion",
  50965. "render-after-expand",
  50966. "show-checkbox",
  50967. "render-content",
  50968. "onNodeExpand"
  50969. ]);
  50970. }), 128)),
  50971. _ctx.isEmpty ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  50972. key: 0,
  50973. class: (0, vue.normalizeClass)(_ctx.ns.e("empty-block"))
  50974. }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(_ctx.ns.e("empty-text")) }, (0, vue.toDisplayString)(_ctx.emptyText ?? _ctx.t("el.tree.emptyText")), 3)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  50975. (0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  50976. ref: "dropIndicator$",
  50977. class: (0, vue.normalizeClass)(_ctx.ns.e("drop-indicator"))
  50978. }, null, 2), [[vue.vShow, _ctx.dragState.showDropIndicator]])
  50979. ], 2);
  50980. }
  50981. var tree_default$1 = /* @__PURE__ */ _plugin_vue_export_helper_default(tree_vue_vue_type_script_lang_default, [["render", _sfc_render$1]]);
  50982. //#endregion
  50983. //#region ../../packages/components/tree/index.ts
  50984. const ElTree = withInstall(tree_default$1);
  50985. //#endregion
  50986. //#region ../../packages/components/tree-select/src/select.ts
  50987. const useSelect = (props, { attrs, emit }, { select, tree, key }) => {
  50988. const ns = useNamespace("tree-select");
  50989. (0, vue.watch)(() => props.data, () => {
  50990. if (props.filterable) (0, vue.nextTick)(() => {
  50991. tree.value?.filter(select.value?.states.inputValue);
  50992. });
  50993. }, { flush: "post" });
  50994. const focusLastNode = (listNode) => {
  50995. const lastNode = listNode.at(-1);
  50996. if (lastNode.expanded && lastNode.childNodes.at(-1)) focusLastNode([lastNode.childNodes.at(-1)]);
  50997. else {
  50998. (tree.value.el$?.querySelector(`[data-key="${listNode.at(-1).key}"]`))?.focus({ preventScroll: true });
  50999. return;
  51000. }
  51001. };
  51002. (0, vue.onMounted)(() => {
  51003. useEventListener(() => select.value?.$el, "keydown", async (evt) => {
  51004. const code = getEventCode(evt);
  51005. const { dropdownMenuVisible } = select.value;
  51006. if ([EVENT_CODE.down, EVENT_CODE.up].includes(code) && dropdownMenuVisible) {
  51007. await (0, vue.nextTick)();
  51008. setTimeout(() => {
  51009. if (EVENT_CODE.up === code) {
  51010. const listNode = tree.value.store.root.childNodes;
  51011. focusLastNode(listNode);
  51012. return;
  51013. }
  51014. select.value.optionsArray[select.value.states.hoveringIndex].$el?.parentNode?.parentNode?.focus({ preventScroll: true });
  51015. });
  51016. }
  51017. }, { capture: true });
  51018. });
  51019. return {
  51020. ...pick((0, vue.toRefs)(props), Object.keys(ElSelect.props)),
  51021. ...attrs,
  51022. class: (0, vue.computed)(() => attrs.class),
  51023. style: (0, vue.computed)(() => attrs.style),
  51024. "onUpdate:modelValue": (value) => emit(UPDATE_MODEL_EVENT, value),
  51025. valueKey: key,
  51026. popperClass: (0, vue.computed)(() => {
  51027. const classes = [ns.e("popper")];
  51028. if (props.popperClass) classes.push(props.popperClass);
  51029. return classes.join(" ");
  51030. }),
  51031. filterMethod: (keyword = "") => {
  51032. if (props.filterMethod) props.filterMethod(keyword);
  51033. else if (props.remoteMethod) props.remoteMethod(keyword);
  51034. else tree.value?.filter(keyword);
  51035. }
  51036. };
  51037. };
  51038. //#endregion
  51039. //#region ../../packages/components/tree-select/src/tree-select-option.ts
  51040. const component = (0, vue.defineComponent)({
  51041. extends: ElOption,
  51042. setup(props, ctx) {
  51043. const result = ElOption.setup(props, ctx);
  51044. delete result.selectOptionClick;
  51045. const vm = (0, vue.getCurrentInstance)().proxy;
  51046. (0, vue.nextTick)(() => {
  51047. if (!result.select.states.cachedOptions.get(vm.value)) result.select.onOptionCreate(vm);
  51048. });
  51049. (0, vue.watch)(() => ctx.attrs.visible, (val) => {
  51050. (0, vue.nextTick)(() => {
  51051. result.states.visible = val;
  51052. });
  51053. }, { immediate: true });
  51054. return result;
  51055. },
  51056. methods: { selectOptionClick() {
  51057. this.$el.parentElement.click();
  51058. } }
  51059. });
  51060. //#endregion
  51061. //#region ../../packages/components/tree-select/src/utils.ts
  51062. function isValidValue(val) {
  51063. return val || val === 0;
  51064. }
  51065. function isValidArray(val) {
  51066. return isArray$1(val) && val.length;
  51067. }
  51068. function toValidArray(val) {
  51069. return isArray$1(val) ? val : isValidValue(val) ? [val] : [];
  51070. }
  51071. function treeFind(treeData, findCallback, getChildren, resultCallback, parent) {
  51072. for (let i = 0; i < treeData.length; i++) {
  51073. const data = treeData[i];
  51074. if (findCallback(data, i, treeData, parent)) return resultCallback ? resultCallback(data, i, treeData, parent) : data;
  51075. else {
  51076. const children = getChildren(data);
  51077. if (isValidArray(children)) {
  51078. const find = treeFind(children, findCallback, getChildren, resultCallback, data);
  51079. if (find) return find;
  51080. }
  51081. }
  51082. }
  51083. }
  51084. function treeEach(treeData, callback, getChildren, parent) {
  51085. for (let i = 0; i < treeData.length; i++) {
  51086. const data = treeData[i];
  51087. callback(data, i, treeData, parent);
  51088. const children = getChildren(data);
  51089. if (isValidArray(children)) treeEach(children, callback, getChildren, data);
  51090. }
  51091. }
  51092. //#endregion
  51093. //#region ../../packages/components/tree-select/src/tree.ts
  51094. const useTree$1 = (props, { attrs, slots, emit }, { select, tree, key }) => {
  51095. (0, vue.watch)([() => props.modelValue, tree], () => {
  51096. if (props.showCheckbox) (0, vue.nextTick)(() => {
  51097. const treeInstance = tree.value;
  51098. if (treeInstance && !isEqual$1(treeInstance.getCheckedKeys(), toValidArray(props.modelValue))) treeInstance.setCheckedKeys(toValidArray(props.modelValue));
  51099. });
  51100. }, {
  51101. immediate: true,
  51102. deep: true
  51103. });
  51104. const propsMap = (0, vue.computed)(() => ({
  51105. value: key.value,
  51106. label: "label",
  51107. children: "children",
  51108. disabled: "disabled",
  51109. isLeaf: "isLeaf",
  51110. ...props.props
  51111. }));
  51112. const getNodeValByProp = (prop, data) => {
  51113. const propVal = propsMap.value[prop];
  51114. if (isFunction$1(propVal)) return propVal(data, tree.value?.getNode(getNodeValByProp("value", data)));
  51115. else return data[propVal];
  51116. };
  51117. const defaultExpandedParentKeys = toValidArray(props.modelValue).map((value) => {
  51118. return treeFind(props.data || [], (data) => getNodeValByProp("value", data) === value, (data) => getNodeValByProp("children", data), (data, index, array, parent) => parent && getNodeValByProp("value", parent));
  51119. }).filter((item) => isValidValue(item));
  51120. const cacheOptions = (0, vue.computed)(() => {
  51121. if (!props.renderAfterExpand && !props.lazy) return [];
  51122. const options = [];
  51123. treeEach(props.data.concat(props.cacheData), (node) => {
  51124. const value = getNodeValByProp("value", node);
  51125. options.push({
  51126. value,
  51127. currentLabel: getNodeValByProp("label", node),
  51128. isDisabled: getNodeValByProp("disabled", node)
  51129. });
  51130. }, (data) => getNodeValByProp("children", data));
  51131. return options;
  51132. });
  51133. const getChildCheckedKeys = () => {
  51134. return tree.value?.getCheckedKeys().filter((checkedKey) => {
  51135. const node = tree.value?.getNode(checkedKey);
  51136. return !isNil(node) && isEmpty(node.childNodes);
  51137. });
  51138. };
  51139. const emitChange = (val) => {
  51140. if (!isEqual$1(props.modelValue, val)) emit(CHANGE_EVENT, val);
  51141. };
  51142. function update(val) {
  51143. emit(UPDATE_MODEL_EVENT, val);
  51144. emitChange(val);
  51145. }
  51146. return {
  51147. ...pick((0, vue.toRefs)(props), Object.keys(ElTree.props)),
  51148. ...attrs,
  51149. nodeKey: key,
  51150. expandOnClickNode: (0, vue.computed)(() => {
  51151. return !props.checkStrictly && props.expandOnClickNode;
  51152. }),
  51153. defaultExpandedKeys: (0, vue.computed)(() => {
  51154. return props.defaultExpandedKeys ? props.defaultExpandedKeys.concat(defaultExpandedParentKeys) : defaultExpandedParentKeys;
  51155. }),
  51156. renderContent: (h, { node, data, store }) => {
  51157. return h(component, {
  51158. value: getNodeValByProp("value", data),
  51159. label: getNodeValByProp("label", data),
  51160. disabled: getNodeValByProp("disabled", data),
  51161. visible: node.visible
  51162. }, props.renderContent ? () => props.renderContent(h, {
  51163. node,
  51164. data,
  51165. store
  51166. }) : slots.default ? () => slots.default({
  51167. node,
  51168. data,
  51169. store
  51170. }) : void 0);
  51171. },
  51172. filterNodeMethod: (value, data, node) => {
  51173. if (props.filterNodeMethod) return props.filterNodeMethod(value, data, node);
  51174. if (!value) return true;
  51175. return new RegExp(escapeStringRegexp(value), "i").test(getNodeValByProp("label", data) || "");
  51176. },
  51177. onNodeClick: (data, node, e) => {
  51178. attrs.onNodeClick?.(data, node, e);
  51179. if (props.showCheckbox && props.checkOnClickNode) return;
  51180. if (!props.showCheckbox && (props.checkStrictly || node.isLeaf)) {
  51181. if (!getNodeValByProp("disabled", data)) {
  51182. const option = select.value?.states.options.get(getNodeValByProp("value", data));
  51183. select.value?.handleOptionSelect(option);
  51184. }
  51185. } else if (props.expandOnClickNode) e.proxy.handleExpandIconClick();
  51186. },
  51187. onCheck: (data, params) => {
  51188. if (!props.showCheckbox) return;
  51189. const dataValue = getNodeValByProp("value", data);
  51190. const dataMap = {};
  51191. treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes);
  51192. const uncachedCheckedKeys = params.checkedKeys;
  51193. const cachedKeys = props.multiple ? toValidArray(props.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item)) : [];
  51194. const checkedKeys = cachedKeys.concat(uncachedCheckedKeys);
  51195. if (props.checkStrictly) update(props.multiple ? checkedKeys : checkedKeys.includes(dataValue) ? dataValue : void 0);
  51196. else if (props.multiple) {
  51197. const childKeys = getChildCheckedKeys();
  51198. update(cachedKeys.concat(childKeys));
  51199. } else {
  51200. const firstLeaf = treeFind([data], (data) => !isValidArray(getNodeValByProp("children", data)) && !getNodeValByProp("disabled", data), (data) => getNodeValByProp("children", data));
  51201. const firstLeafKey = firstLeaf ? getNodeValByProp("value", firstLeaf) : void 0;
  51202. const hasCheckedChild = isValidValue(props.modelValue) && !!treeFind([data], (data) => getNodeValByProp("value", data) === props.modelValue, (data) => getNodeValByProp("children", data));
  51203. update(firstLeafKey === props.modelValue || hasCheckedChild ? void 0 : firstLeafKey);
  51204. }
  51205. (0, vue.nextTick)(() => {
  51206. const checkedKeys = toValidArray(props.modelValue);
  51207. tree.value.setCheckedKeys(checkedKeys);
  51208. attrs.onCheck?.(data, {
  51209. checkedKeys: tree.value.getCheckedKeys(),
  51210. checkedNodes: tree.value.getCheckedNodes(),
  51211. halfCheckedKeys: tree.value.getHalfCheckedKeys(),
  51212. halfCheckedNodes: tree.value.getHalfCheckedNodes()
  51213. });
  51214. });
  51215. select.value?.focus();
  51216. },
  51217. onNodeExpand: (data, node, e) => {
  51218. attrs.onNodeExpand?.(data, node, e);
  51219. (0, vue.nextTick)(() => {
  51220. if (!props.checkStrictly && props.lazy && props.multiple && node.checked) {
  51221. const dataMap = {};
  51222. const uncachedCheckedKeys = tree.value.getCheckedKeys();
  51223. treeEach([tree.value.store.root], (node) => dataMap[node.key] = node, (node) => node.childNodes);
  51224. const cachedKeys = toValidArray(props.modelValue).filter((item) => !(item in dataMap) && !uncachedCheckedKeys.includes(item));
  51225. const childKeys = getChildCheckedKeys();
  51226. update(cachedKeys.concat(childKeys));
  51227. }
  51228. });
  51229. },
  51230. cacheOptions
  51231. };
  51232. };
  51233. //#endregion
  51234. //#region ../../packages/components/tree-select/src/cache-options.ts
  51235. var cache_options_default = (0, vue.defineComponent)({
  51236. props: { data: {
  51237. type: Array,
  51238. default: () => []
  51239. } },
  51240. setup(props) {
  51241. const select = (0, vue.inject)(selectKey);
  51242. (0, vue.watch)(() => props.data, () => {
  51243. props.data.forEach((item) => {
  51244. if (!select.states.cachedOptions.has(item.value)) select.states.cachedOptions.set(item.value, item);
  51245. });
  51246. const inputs = select.selectRef?.querySelectorAll("input") || [];
  51247. if (isClient && !Array.from(inputs).includes(document.activeElement)) select.setSelected();
  51248. }, {
  51249. flush: "post",
  51250. immediate: true
  51251. });
  51252. return () => void 0;
  51253. }
  51254. });
  51255. //#endregion
  51256. //#region ../../packages/components/tree-select/src/tree-select.vue?vue&type=script&lang.ts
  51257. var tree_select_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  51258. name: "ElTreeSelect",
  51259. inheritAttrs: false,
  51260. props: {
  51261. ...selectProps,
  51262. ...treeProps,
  51263. cacheData: {
  51264. type: Array,
  51265. default: () => []
  51266. }
  51267. },
  51268. setup(props, context) {
  51269. const { slots, expose, emit, attrs } = context;
  51270. const childAttrs = {
  51271. ...attrs,
  51272. onChange: void 0
  51273. };
  51274. const select = (0, vue.ref)();
  51275. const tree = (0, vue.ref)();
  51276. const key = (0, vue.computed)(() => props.nodeKey || props.valueKey || "value");
  51277. const selectProps = useSelect(props, {
  51278. attrs,
  51279. emit
  51280. }, {
  51281. select,
  51282. tree,
  51283. key
  51284. });
  51285. const { cacheOptions, ...treeProps } = useTree$1(props, {
  51286. attrs: childAttrs,
  51287. slots,
  51288. emit
  51289. }, {
  51290. select,
  51291. tree,
  51292. key
  51293. });
  51294. const methods = (0, vue.reactive)({});
  51295. expose(methods);
  51296. (0, vue.onMounted)(() => {
  51297. Object.assign(methods, {
  51298. ...pick(tree.value, [
  51299. "filter",
  51300. "updateKeyChildren",
  51301. "getCheckedNodes",
  51302. "setCheckedNodes",
  51303. "getCheckedKeys",
  51304. "setCheckedKeys",
  51305. "setChecked",
  51306. "getHalfCheckedNodes",
  51307. "getHalfCheckedKeys",
  51308. "getCurrentKey",
  51309. "getCurrentNode",
  51310. "setCurrentKey",
  51311. "setCurrentNode",
  51312. "getNode",
  51313. "remove",
  51314. "append",
  51315. "insertBefore",
  51316. "insertAfter"
  51317. ]),
  51318. ...pick(select.value, [
  51319. "focus",
  51320. "blur",
  51321. "selectedLabel"
  51322. ]),
  51323. treeRef: tree.value,
  51324. selectRef: select.value
  51325. });
  51326. });
  51327. return () => (0, vue.h)(
  51328. ElSelect,
  51329. /**
  51330. * 1. The `props` is processed into `Refs`, but `v-bind` and
  51331. * render function props cannot read `Refs`, so use `reactive`
  51332. * unwrap the `Refs` and keep reactive.
  51333. * 2. The keyword `ref` requires `Ref`, but `reactive` broke it,
  51334. * so use function.
  51335. */
  51336. (0, vue.reactive)({
  51337. ...selectProps,
  51338. ref: (ref) => select.value = ref
  51339. }),
  51340. {
  51341. ...slots,
  51342. default: () => [(0, vue.h)(cache_options_default, { data: cacheOptions.value }), (0, vue.h)(ElTree, (0, vue.reactive)({
  51343. ...treeProps,
  51344. ref: (ref) => tree.value = ref
  51345. }))]
  51346. }
  51347. );
  51348. }
  51349. });
  51350. //#endregion
  51351. //#region ../../packages/components/tree-select/src/tree-select.vue
  51352. var tree_select_default = tree_select_vue_vue_type_script_lang_default;
  51353. //#endregion
  51354. //#region ../../packages/components/tree-select/index.ts
  51355. const ElTreeSelect = withInstall(tree_select_default);
  51356. //#endregion
  51357. //#region ../../packages/components/tree-v2/src/virtual-tree.ts
  51358. const ROOT_TREE_INJECTION_KEY$1 = Symbol();
  51359. const EMPTY_NODE = {
  51360. key: -1,
  51361. level: -1,
  51362. data: {}
  51363. };
  51364. let TreeOptionsEnum = /* @__PURE__ */ function(TreeOptionsEnum) {
  51365. TreeOptionsEnum["KEY"] = "id";
  51366. TreeOptionsEnum["LABEL"] = "label";
  51367. TreeOptionsEnum["CHILDREN"] = "children";
  51368. TreeOptionsEnum["DISABLED"] = "disabled";
  51369. TreeOptionsEnum["CLASS"] = "";
  51370. return TreeOptionsEnum;
  51371. }({});
  51372. let SetOperationEnum = /* @__PURE__ */ function(SetOperationEnum) {
  51373. SetOperationEnum["ADD"] = "add";
  51374. SetOperationEnum["DELETE"] = "delete";
  51375. return SetOperationEnum;
  51376. }({});
  51377. const itemSize = {
  51378. type: Number,
  51379. default: 26
  51380. };
  51381. /**
  51382. * @deprecated Removed after 3.0.0, Use `TreeProps` instead.
  51383. */
  51384. const treeProps$1 = buildProps({
  51385. data: {
  51386. type: definePropType(Array),
  51387. default: () => mutable([])
  51388. },
  51389. emptyText: { type: String },
  51390. height: {
  51391. type: Number,
  51392. default: 200
  51393. },
  51394. props: {
  51395. type: definePropType(Object),
  51396. default: () => mutable({
  51397. children: TreeOptionsEnum.CHILDREN,
  51398. label: TreeOptionsEnum.LABEL,
  51399. disabled: TreeOptionsEnum.DISABLED,
  51400. value: TreeOptionsEnum.KEY,
  51401. class: TreeOptionsEnum.CLASS
  51402. })
  51403. },
  51404. highlightCurrent: Boolean,
  51405. showCheckbox: Boolean,
  51406. defaultCheckedKeys: {
  51407. type: definePropType(Array),
  51408. default: () => mutable([])
  51409. },
  51410. checkStrictly: Boolean,
  51411. defaultExpandedKeys: {
  51412. type: definePropType(Array),
  51413. default: () => mutable([])
  51414. },
  51415. indent: {
  51416. type: Number,
  51417. default: 16
  51418. },
  51419. itemSize,
  51420. icon: { type: iconPropType },
  51421. expandOnClickNode: {
  51422. type: Boolean,
  51423. default: true
  51424. },
  51425. checkOnClickNode: Boolean,
  51426. checkOnClickLeaf: {
  51427. type: Boolean,
  51428. default: true
  51429. },
  51430. currentNodeKey: { type: definePropType([String, Number]) },
  51431. accordion: Boolean,
  51432. filterMethod: { type: definePropType(Function) },
  51433. perfMode: {
  51434. type: Boolean,
  51435. default: true
  51436. },
  51437. scrollbarAlwaysOn: Boolean
  51438. });
  51439. /**
  51440. * @deprecated Removed after 3.0.0, Use `TreeNodeProps` instead.
  51441. */
  51442. const treeNodeProps = buildProps({
  51443. node: {
  51444. type: definePropType(Object),
  51445. default: () => mutable(EMPTY_NODE)
  51446. },
  51447. expanded: Boolean,
  51448. checked: Boolean,
  51449. indeterminate: Boolean,
  51450. showCheckbox: Boolean,
  51451. disabled: Boolean,
  51452. current: Boolean,
  51453. hiddenExpandIcon: Boolean,
  51454. itemSize
  51455. });
  51456. const treeNodeContentProps = buildProps({ node: {
  51457. type: definePropType(Object),
  51458. required: true
  51459. } });
  51460. const NODE_CLICK = "node-click";
  51461. const NODE_DROP = "node-drop";
  51462. const NODE_EXPAND = "node-expand";
  51463. const NODE_COLLAPSE = "node-collapse";
  51464. const CURRENT_CHANGE = "current-change";
  51465. const NODE_CHECK = "check";
  51466. const NODE_CHECK_CHANGE = "check-change";
  51467. const NODE_CONTEXTMENU = "node-contextmenu";
  51468. const treeEmits$1 = {
  51469. [NODE_CLICK]: (data, node, e) => data && node && e,
  51470. [NODE_DROP]: (data, node, e) => data && node && e,
  51471. [NODE_EXPAND]: (data, node) => data && node,
  51472. [NODE_COLLAPSE]: (data, node) => data && node,
  51473. [CURRENT_CHANGE]: (data, node) => data && node,
  51474. [NODE_CHECK]: (data, checkedInfo) => data && checkedInfo,
  51475. [NODE_CHECK_CHANGE]: (data, checked) => data && isBoolean(checked),
  51476. [NODE_CONTEXTMENU]: (evt, data, node) => evt && data && node
  51477. };
  51478. const treeNodeEmits = {
  51479. click: (node, e) => !!(node && e),
  51480. drop: (node, e) => !!(node && e),
  51481. toggle: (node) => !!node,
  51482. check: (node, checked) => node && isBoolean(checked)
  51483. };
  51484. //#endregion
  51485. //#region ../../packages/components/tree-v2/src/composables/useCheck.ts
  51486. function useCheck(props, tree) {
  51487. const checkedKeys = (0, vue.ref)(/* @__PURE__ */ new Set());
  51488. const indeterminateKeys = (0, vue.ref)(/* @__PURE__ */ new Set());
  51489. const { emit } = (0, vue.getCurrentInstance)();
  51490. (0, vue.watch)([() => tree.value, () => props.defaultCheckedKeys], () => {
  51491. return (0, vue.nextTick)(() => {
  51492. _setCheckedKeys(props.defaultCheckedKeys);
  51493. });
  51494. }, { immediate: true });
  51495. const updateCheckedKeys = () => {
  51496. if (!tree.value || !props.showCheckbox || props.checkStrictly) return;
  51497. const { levelTreeNodeMap, maxLevel } = tree.value;
  51498. const checkedKeySet = checkedKeys.value;
  51499. const indeterminateKeySet = /* @__PURE__ */ new Set();
  51500. for (let level = maxLevel; level >= 1; --level) {
  51501. const nodes = levelTreeNodeMap.get(level);
  51502. if (!nodes) continue;
  51503. nodes.forEach((node) => {
  51504. const children = node.children;
  51505. let isEffectivelyChecked = !node.isLeaf || node.disabled || checkedKeySet.has(node.key);
  51506. if (children) {
  51507. let allChecked = true;
  51508. let hasChecked = false;
  51509. for (const childNode of children) {
  51510. const key = childNode.key;
  51511. if (!childNode.isEffectivelyChecked) isEffectivelyChecked = false;
  51512. if (checkedKeySet.has(key)) hasChecked = true;
  51513. else if (indeterminateKeySet.has(key)) {
  51514. allChecked = false;
  51515. hasChecked = true;
  51516. break;
  51517. } else allChecked = false;
  51518. }
  51519. if (allChecked) checkedKeySet.add(node.key);
  51520. else if (hasChecked) {
  51521. indeterminateKeySet.add(node.key);
  51522. checkedKeySet.delete(node.key);
  51523. } else {
  51524. checkedKeySet.delete(node.key);
  51525. indeterminateKeySet.delete(node.key);
  51526. }
  51527. }
  51528. node.isEffectivelyChecked = isEffectivelyChecked;
  51529. });
  51530. }
  51531. indeterminateKeys.value = indeterminateKeySet;
  51532. };
  51533. const isChecked = (node) => checkedKeys.value.has(node.key);
  51534. const isIndeterminate = (node) => indeterminateKeys.value.has(node.key);
  51535. const toggleCheckbox = (node, isChecked, nodeClick = true, immediateUpdate = true) => {
  51536. const checkedKeySet = checkedKeys.value;
  51537. const children = node.children;
  51538. if (!props.checkStrictly && nodeClick && children?.length) isChecked = children.some((node) => !node.isEffectivelyChecked);
  51539. const toggle = (node, checked) => {
  51540. checkedKeySet[checked ? SetOperationEnum.ADD : SetOperationEnum.DELETE](node.key);
  51541. const children = node.children;
  51542. if (!props.checkStrictly && children) children.forEach((childNode) => {
  51543. if (!childNode.disabled || childNode.children) toggle(childNode, checked);
  51544. });
  51545. };
  51546. toggle(node, isChecked);
  51547. if (immediateUpdate) updateCheckedKeys();
  51548. if (nodeClick) afterNodeCheck(node, isChecked);
  51549. };
  51550. const afterNodeCheck = (node, checked) => {
  51551. const { checkedNodes, checkedKeys } = getChecked();
  51552. const { halfCheckedNodes, halfCheckedKeys } = getHalfChecked();
  51553. emit(NODE_CHECK, node.data, {
  51554. checkedKeys,
  51555. checkedNodes,
  51556. halfCheckedKeys,
  51557. halfCheckedNodes
  51558. });
  51559. emit(NODE_CHECK_CHANGE, node.data, checked);
  51560. };
  51561. function getCheckedKeys(leafOnly = false) {
  51562. return getChecked(leafOnly).checkedKeys;
  51563. }
  51564. function getCheckedNodes(leafOnly = false) {
  51565. return getChecked(leafOnly).checkedNodes;
  51566. }
  51567. function getHalfCheckedKeys() {
  51568. return getHalfChecked().halfCheckedKeys;
  51569. }
  51570. function getHalfCheckedNodes() {
  51571. return getHalfChecked().halfCheckedNodes;
  51572. }
  51573. function getChecked(leafOnly = false) {
  51574. const checkedNodes = [];
  51575. const keys = [];
  51576. if (tree?.value && props.showCheckbox) {
  51577. const { treeNodeMap } = tree.value;
  51578. checkedKeys.value.forEach((key) => {
  51579. const node = treeNodeMap.get(key);
  51580. if (node && (!leafOnly || leafOnly && node.isLeaf)) {
  51581. keys.push(key);
  51582. checkedNodes.push(node.data);
  51583. }
  51584. });
  51585. }
  51586. return {
  51587. checkedKeys: keys,
  51588. checkedNodes
  51589. };
  51590. }
  51591. function getHalfChecked() {
  51592. const halfCheckedNodes = [];
  51593. const halfCheckedKeys = [];
  51594. if (tree?.value && props.showCheckbox) {
  51595. const { treeNodeMap } = tree.value;
  51596. indeterminateKeys.value.forEach((key) => {
  51597. const node = treeNodeMap.get(key);
  51598. if (node) {
  51599. halfCheckedKeys.push(key);
  51600. halfCheckedNodes.push(node.data);
  51601. }
  51602. });
  51603. }
  51604. return {
  51605. halfCheckedNodes,
  51606. halfCheckedKeys
  51607. };
  51608. }
  51609. function setCheckedKeys(keys) {
  51610. checkedKeys.value.clear();
  51611. indeterminateKeys.value.clear();
  51612. (0, vue.nextTick)(() => {
  51613. _setCheckedKeys(keys);
  51614. });
  51615. }
  51616. function setChecked(key, isChecked) {
  51617. if (tree?.value && props.showCheckbox) {
  51618. const node = tree.value.treeNodeMap.get(key);
  51619. if (node) toggleCheckbox(node, isChecked, false);
  51620. }
  51621. }
  51622. function _setCheckedKeys(keys) {
  51623. if (tree?.value) {
  51624. const { treeNodeMap } = tree.value;
  51625. if (props.showCheckbox && treeNodeMap && keys?.length > 0) {
  51626. for (const key of keys) {
  51627. const node = treeNodeMap.get(key);
  51628. if (node && !isChecked(node)) toggleCheckbox(node, true, false, false);
  51629. }
  51630. updateCheckedKeys();
  51631. }
  51632. }
  51633. }
  51634. return {
  51635. updateCheckedKeys,
  51636. toggleCheckbox,
  51637. isChecked,
  51638. isIndeterminate,
  51639. getCheckedKeys,
  51640. getCheckedNodes,
  51641. getHalfCheckedKeys,
  51642. getHalfCheckedNodes,
  51643. setChecked,
  51644. setCheckedKeys
  51645. };
  51646. }
  51647. //#endregion
  51648. //#region ../../packages/components/tree-v2/src/composables/useFilter.ts
  51649. function useFilter(props, tree) {
  51650. const hiddenNodeKeySet = (0, vue.ref)(/* @__PURE__ */ new Set([]));
  51651. const hiddenExpandIconKeySet = (0, vue.ref)(/* @__PURE__ */ new Set([]));
  51652. const filterable = (0, vue.computed)(() => {
  51653. return isFunction$1(props.filterMethod);
  51654. });
  51655. function doFilter(query) {
  51656. if (!filterable.value) return;
  51657. const expandKeySet = /* @__PURE__ */ new Set();
  51658. const hiddenExpandIconKeys = hiddenExpandIconKeySet.value;
  51659. const hiddenKeys = hiddenNodeKeySet.value;
  51660. const family = [];
  51661. const nodes = tree.value?.treeNodes || [];
  51662. const filter = props.filterMethod;
  51663. hiddenKeys.clear();
  51664. function traverse(nodes) {
  51665. nodes.forEach((node) => {
  51666. family.push(node);
  51667. if (filter?.(query, node.data, node)) family.forEach((member) => {
  51668. expandKeySet.add(member.key);
  51669. member.expanded = true;
  51670. });
  51671. else {
  51672. node.expanded = false;
  51673. if (node.isLeaf) hiddenKeys.add(node.key);
  51674. }
  51675. const children = node.children;
  51676. if (children) traverse(children);
  51677. if (!node.isLeaf) {
  51678. if (!expandKeySet.has(node.key)) hiddenKeys.add(node.key);
  51679. else if (children) {
  51680. let allHidden = true;
  51681. for (const childNode of children) if (!hiddenKeys.has(childNode.key)) {
  51682. allHidden = false;
  51683. break;
  51684. }
  51685. if (allHidden) hiddenExpandIconKeys.add(node.key);
  51686. else hiddenExpandIconKeys.delete(node.key);
  51687. }
  51688. }
  51689. family.pop();
  51690. });
  51691. }
  51692. traverse(nodes);
  51693. return expandKeySet;
  51694. }
  51695. function isForceHiddenExpandIcon(node) {
  51696. return hiddenExpandIconKeySet.value.has(node.key);
  51697. }
  51698. return {
  51699. hiddenExpandIconKeySet,
  51700. hiddenNodeKeySet,
  51701. doFilter,
  51702. isForceHiddenExpandIcon
  51703. };
  51704. }
  51705. //#endregion
  51706. //#region ../../packages/components/tree-v2/src/composables/useTree.ts
  51707. function useTree(props, emit) {
  51708. const expandedKeySet = (0, vue.ref)(/* @__PURE__ */ new Set());
  51709. const currentKey = (0, vue.ref)();
  51710. const tree = (0, vue.shallowRef)();
  51711. const listRef = (0, vue.ref)();
  51712. const { isIndeterminate, isChecked, toggleCheckbox, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys } = useCheck(props, tree);
  51713. const { doFilter, hiddenNodeKeySet, isForceHiddenExpandIcon } = useFilter(props, tree);
  51714. const valueKey = (0, vue.computed)(() => {
  51715. return props.props?.value || TreeOptionsEnum.KEY;
  51716. });
  51717. const childrenKey = (0, vue.computed)(() => {
  51718. return props.props?.children || TreeOptionsEnum.CHILDREN;
  51719. });
  51720. const disabledKey = (0, vue.computed)(() => {
  51721. return props.props?.disabled || TreeOptionsEnum.DISABLED;
  51722. });
  51723. const labelKey = (0, vue.computed)(() => {
  51724. return props.props?.label || TreeOptionsEnum.LABEL;
  51725. });
  51726. const flattenTree = (0, vue.computed)(() => {
  51727. const expandedKeys = expandedKeySet.value;
  51728. const hiddenKeys = hiddenNodeKeySet.value;
  51729. const flattenNodes = [];
  51730. const nodes = tree.value?.treeNodes || [];
  51731. const stack = [];
  51732. for (let i = nodes.length - 1; i >= 0; --i) stack.push(nodes[i]);
  51733. while (stack.length) {
  51734. const node = stack.pop();
  51735. if (hiddenKeys.has(node.key)) continue;
  51736. flattenNodes.push(node);
  51737. if (node.children && expandedKeys.has(node.key)) for (let i = node.children.length - 1; i >= 0; --i) stack.push(node.children[i]);
  51738. }
  51739. return flattenNodes;
  51740. });
  51741. const isNotEmpty = (0, vue.computed)(() => {
  51742. return flattenTree.value.length > 0;
  51743. });
  51744. function createTree(data) {
  51745. const treeNodeMap = /* @__PURE__ */ new Map();
  51746. const levelTreeNodeMap = /* @__PURE__ */ new Map();
  51747. let maxLevel = 1;
  51748. function traverse(nodes, level = 1, parent = void 0) {
  51749. const siblings = [];
  51750. for (const rawNode of nodes) {
  51751. const value = getKey(rawNode);
  51752. const node = {
  51753. level,
  51754. key: value,
  51755. data: rawNode
  51756. };
  51757. node.label = getLabel(rawNode);
  51758. node.parent = parent;
  51759. const children = getChildren(rawNode);
  51760. node.disabled = getDisabled(rawNode);
  51761. node.isLeaf = !children || children.length === 0;
  51762. node.expanded = expandedKeySet.value.has(value);
  51763. if (children && children.length) node.children = traverse(children, level + 1, node);
  51764. siblings.push(node);
  51765. treeNodeMap.set(value, node);
  51766. if (!levelTreeNodeMap.has(level)) levelTreeNodeMap.set(level, []);
  51767. levelTreeNodeMap.get(level)?.push(node);
  51768. }
  51769. if (level > maxLevel) maxLevel = level;
  51770. return siblings;
  51771. }
  51772. const treeNodes = traverse(data);
  51773. return {
  51774. treeNodeMap,
  51775. levelTreeNodeMap,
  51776. maxLevel,
  51777. treeNodes
  51778. };
  51779. }
  51780. function filter(query) {
  51781. const keys = doFilter(query);
  51782. if (keys) expandedKeySet.value = keys;
  51783. }
  51784. function getChildren(node) {
  51785. return node[childrenKey.value];
  51786. }
  51787. function getKey(node) {
  51788. if (!node) return "";
  51789. return node[valueKey.value];
  51790. }
  51791. function getDisabled(node) {
  51792. return node[disabledKey.value];
  51793. }
  51794. function getLabel(node) {
  51795. return node[labelKey.value];
  51796. }
  51797. function toggleExpand(node) {
  51798. if (expandedKeySet.value.has(node.key)) collapseNode(node);
  51799. else expandNode(node);
  51800. }
  51801. function setExpandedKeys(keys) {
  51802. const expandedKeys = /* @__PURE__ */ new Set();
  51803. const nodeMap = tree.value.treeNodeMap;
  51804. expandedKeySet.value.forEach((key) => {
  51805. const node = nodeMap.get(key);
  51806. expandedKeySet.value.delete(node.key);
  51807. node.expanded = false;
  51808. });
  51809. keys.forEach((k) => {
  51810. let node = nodeMap.get(k);
  51811. while (node && !expandedKeys.has(node.key)) {
  51812. expandedKeys.add(node.key);
  51813. node.expanded = true;
  51814. node = node.parent;
  51815. }
  51816. });
  51817. expandedKeySet.value = expandedKeys;
  51818. }
  51819. function handleNodeClick(node, e) {
  51820. emit(NODE_CLICK, node.data, node, e);
  51821. handleCurrentChange(node);
  51822. if (props.expandOnClickNode) toggleExpand(node);
  51823. if (props.showCheckbox && (props.checkOnClickNode || node.isLeaf && props.checkOnClickLeaf) && !node.disabled) toggleCheckbox(node, !isChecked(node), true);
  51824. }
  51825. function handleNodeDrop(node, e) {
  51826. emit(NODE_DROP, node.data, node, e);
  51827. }
  51828. function handleCurrentChange(node) {
  51829. if (!isCurrent(node)) {
  51830. currentKey.value = node.key;
  51831. emit(CURRENT_CHANGE, node.data, node);
  51832. }
  51833. }
  51834. function handleNodeCheck(node, checked) {
  51835. toggleCheckbox(node, checked);
  51836. }
  51837. function expandNode(node) {
  51838. const keySet = expandedKeySet.value;
  51839. if (tree.value && props.accordion) {
  51840. const { treeNodeMap } = tree.value;
  51841. keySet.forEach((key) => {
  51842. const treeNode = treeNodeMap.get(key);
  51843. if (node && node.level === treeNode?.level) {
  51844. keySet.delete(key);
  51845. treeNode.expanded = false;
  51846. }
  51847. });
  51848. }
  51849. keySet.add(node.key);
  51850. const _node = getNode(node.key);
  51851. if (_node) {
  51852. _node.expanded = true;
  51853. emit(NODE_EXPAND, _node.data, _node);
  51854. }
  51855. }
  51856. function collapseNode(node) {
  51857. expandedKeySet.value.delete(node.key);
  51858. const _node = getNode(node.key);
  51859. if (_node) {
  51860. _node.expanded = false;
  51861. emit(NODE_COLLAPSE, _node.data, _node);
  51862. }
  51863. }
  51864. function isDisabled(node) {
  51865. return !!node.disabled;
  51866. }
  51867. function isCurrent(node) {
  51868. const current = currentKey.value;
  51869. return current !== void 0 && current === node.key;
  51870. }
  51871. function getCurrentNode() {
  51872. if (!currentKey.value) return void 0;
  51873. return tree.value?.treeNodeMap.get(currentKey.value)?.data;
  51874. }
  51875. function getCurrentKey() {
  51876. return currentKey.value;
  51877. }
  51878. function setCurrentKey(key) {
  51879. currentKey.value = key;
  51880. }
  51881. function setData(data) {
  51882. tree.value = createTree(data);
  51883. }
  51884. function getNode(data) {
  51885. const key = isObject$1(data) ? getKey(data) : data;
  51886. return tree.value?.treeNodeMap.get(key);
  51887. }
  51888. function scrollToNode(key, strategy = "auto") {
  51889. const node = getNode(key);
  51890. if (node && listRef.value) listRef.value.scrollToItem(flattenTree.value.indexOf(node), strategy);
  51891. }
  51892. function scrollTo(offset) {
  51893. listRef.value?.scrollTo(offset);
  51894. }
  51895. (0, vue.watch)(() => props.currentNodeKey, (key) => {
  51896. currentKey.value = key;
  51897. }, { immediate: true });
  51898. (0, vue.watch)(() => props.defaultExpandedKeys, (key) => {
  51899. expandedKeySet.value = new Set(key);
  51900. }, { immediate: true });
  51901. (0, vue.watch)(() => props.data, (data) => {
  51902. setData(data);
  51903. }, { immediate: true });
  51904. return {
  51905. tree,
  51906. flattenTree,
  51907. isNotEmpty,
  51908. listRef,
  51909. getKey,
  51910. getChildren,
  51911. toggleExpand,
  51912. toggleCheckbox,
  51913. isChecked,
  51914. isIndeterminate,
  51915. isDisabled,
  51916. isCurrent,
  51917. isForceHiddenExpandIcon,
  51918. handleNodeClick,
  51919. handleNodeDrop,
  51920. handleNodeCheck,
  51921. getCurrentNode,
  51922. getCurrentKey,
  51923. setCurrentKey,
  51924. getCheckedKeys,
  51925. getCheckedNodes,
  51926. getHalfCheckedKeys,
  51927. getHalfCheckedNodes,
  51928. setChecked,
  51929. setCheckedKeys,
  51930. filter,
  51931. setData,
  51932. getNode,
  51933. expandNode,
  51934. collapseNode,
  51935. setExpandedKeys,
  51936. scrollToNode,
  51937. scrollTo
  51938. };
  51939. }
  51940. //#endregion
  51941. //#region ../../packages/components/tree-v2/src/tree-node-content.ts
  51942. var tree_node_content_default = (0, vue.defineComponent)({
  51943. name: "ElTreeNodeContent",
  51944. props: treeNodeContentProps,
  51945. setup(props) {
  51946. const tree = (0, vue.inject)(ROOT_TREE_INJECTION_KEY$1);
  51947. const ns = useNamespace("tree");
  51948. return () => {
  51949. const node = props.node;
  51950. const { data } = node;
  51951. return tree?.ctx.slots.default ? tree.ctx.slots.default({
  51952. node,
  51953. data
  51954. }) : (0, vue.h)(ElText, {
  51955. tag: "span",
  51956. truncated: true,
  51957. class: ns.be("node", "label")
  51958. }, () => [node?.label]);
  51959. };
  51960. }
  51961. });
  51962. //#endregion
  51963. //#region ../../packages/components/tree-v2/src/tree-node.vue?vue&type=script&setup=true&lang.ts
  51964. const _hoisted_1$11 = [
  51965. "aria-expanded",
  51966. "aria-disabled",
  51967. "aria-checked",
  51968. "data-key"
  51969. ];
  51970. var tree_node_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  51971. name: "ElTreeNode",
  51972. __name: "tree-node",
  51973. props: treeNodeProps,
  51974. emits: treeNodeEmits,
  51975. setup(__props, { emit: __emit }) {
  51976. const props = __props;
  51977. const emit = __emit;
  51978. const tree = (0, vue.inject)(ROOT_TREE_INJECTION_KEY$1);
  51979. const ns = useNamespace("tree");
  51980. const indent = (0, vue.computed)(() => tree?.props.indent ?? 16);
  51981. const icon = (0, vue.computed)(() => tree?.props.icon ?? caret_right_default);
  51982. const getNodeClass = (node) => {
  51983. const nodeClassFunc = tree?.props.props?.class;
  51984. if (!nodeClassFunc) return {};
  51985. let className;
  51986. if (isFunction$1(nodeClassFunc)) {
  51987. const { data } = node;
  51988. className = nodeClassFunc(data, node);
  51989. } else className = nodeClassFunc;
  51990. return isString(className) ? { [className]: true } : className;
  51991. };
  51992. const handleClick = (e) => {
  51993. emit("click", props.node, e);
  51994. };
  51995. const handleDrop = (e) => {
  51996. emit("drop", props.node, e);
  51997. };
  51998. const handleExpandIconClick = () => {
  51999. emit("toggle", props.node);
  52000. };
  52001. const handleCheckChange = (value) => {
  52002. emit("check", props.node, value);
  52003. };
  52004. const handleContextMenu = (event) => {
  52005. if (tree?.instance?.vnode?.props?.["onNodeContextmenu"]) {
  52006. event.stopPropagation();
  52007. event.preventDefault();
  52008. }
  52009. tree?.ctx.emit(NODE_CONTEXTMENU, event, props.node?.data, props.node);
  52010. };
  52011. return (_ctx, _cache) => {
  52012. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52013. ref: "node$",
  52014. class: (0, vue.normalizeClass)([
  52015. (0, vue.unref)(ns).b("node"),
  52016. (0, vue.unref)(ns).is("expanded", __props.expanded),
  52017. (0, vue.unref)(ns).is("current", __props.current),
  52018. (0, vue.unref)(ns).is("focusable", !__props.disabled),
  52019. (0, vue.unref)(ns).is("checked", !__props.disabled && __props.checked),
  52020. getNodeClass(__props.node)
  52021. ]),
  52022. role: "treeitem",
  52023. tabindex: "-1",
  52024. "aria-expanded": __props.expanded,
  52025. "aria-disabled": __props.disabled,
  52026. "aria-checked": __props.checked,
  52027. "data-key": __props.node?.key,
  52028. onClick: (0, vue.withModifiers)(handleClick, ["stop"]),
  52029. onContextmenu: handleContextMenu,
  52030. onDragover: _cache[1] || (_cache[1] = (0, vue.withModifiers)(() => {}, ["prevent"])),
  52031. onDragenter: _cache[2] || (_cache[2] = (0, vue.withModifiers)(() => {}, ["prevent"])),
  52032. onDrop: (0, vue.withModifiers)(handleDrop, ["stop"])
  52033. }, [(0, vue.createElementVNode)("div", {
  52034. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("node", "content")),
  52035. style: (0, vue.normalizeStyle)({
  52036. paddingLeft: `${(__props.node.level - 1) * indent.value}px`,
  52037. height: __props.itemSize + "px"
  52038. })
  52039. }, [
  52040. icon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  52041. key: 0,
  52042. class: (0, vue.normalizeClass)([
  52043. (0, vue.unref)(ns).is("leaf", !!__props.node?.isLeaf),
  52044. (0, vue.unref)(ns).is("hidden", __props.hiddenExpandIcon),
  52045. { expanded: !__props.node?.isLeaf && __props.expanded },
  52046. (0, vue.unref)(ns).be("node", "expand-icon")
  52047. ]),
  52048. onClick: (0, vue.withModifiers)(handleExpandIconClick, ["stop"])
  52049. }, {
  52050. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(icon.value)))]),
  52051. _: 1
  52052. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true),
  52053. __props.showCheckbox ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElCheckbox), {
  52054. key: 1,
  52055. "model-value": __props.checked,
  52056. indeterminate: __props.indeterminate,
  52057. disabled: __props.disabled,
  52058. onChange: handleCheckChange,
  52059. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  52060. }, null, 8, [
  52061. "model-value",
  52062. "indeterminate",
  52063. "disabled"
  52064. ])) : (0, vue.createCommentVNode)("v-if", true),
  52065. (0, vue.createVNode)((0, vue.unref)(tree_node_content_default), { node: {
  52066. ...__props.node,
  52067. expanded: __props.expanded
  52068. } }, null, 8, ["node"])
  52069. ], 6)], 42, _hoisted_1$11);
  52070. };
  52071. }
  52072. });
  52073. //#endregion
  52074. //#region ../../packages/components/tree-v2/src/tree-node.vue
  52075. var tree_node_default = tree_node_vue_vue_type_script_setup_true_lang_default;
  52076. //#endregion
  52077. //#region ../../packages/components/tree-v2/src/tree.vue?vue&type=script&setup=true&lang.ts
  52078. var tree_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  52079. name: "ElTreeV2",
  52080. __name: "tree",
  52081. props: treeProps$1,
  52082. emits: treeEmits$1,
  52083. setup(__props, { expose: __expose, emit: __emit }) {
  52084. const props = __props;
  52085. const emit = __emit;
  52086. const slots = (0, vue.useSlots)();
  52087. const treeNodeSize = (0, vue.computed)(() => props.itemSize);
  52088. (0, vue.provide)(ROOT_TREE_INJECTION_KEY$1, {
  52089. ctx: {
  52090. emit,
  52091. slots
  52092. },
  52093. props,
  52094. instance: (0, vue.getCurrentInstance)()
  52095. });
  52096. (0, vue.provide)(formItemContextKey, void 0);
  52097. const { t } = useLocale();
  52098. const ns = useNamespace("tree");
  52099. const { flattenTree, isNotEmpty, listRef, toggleExpand, isIndeterminate, isChecked, isDisabled, isCurrent, isForceHiddenExpandIcon, handleNodeClick, handleNodeDrop, handleNodeCheck, toggleCheckbox, getCurrentNode, getCurrentKey, setCurrentKey, getCheckedKeys, getCheckedNodes, getHalfCheckedKeys, getHalfCheckedNodes, setChecked, setCheckedKeys, filter, setData, getNode, expandNode, collapseNode, setExpandedKeys, scrollToNode, scrollTo } = useTree(props, emit);
  52100. __expose({
  52101. toggleCheckbox,
  52102. getCurrentNode,
  52103. getCurrentKey,
  52104. setCurrentKey,
  52105. getCheckedKeys,
  52106. getCheckedNodes,
  52107. getHalfCheckedKeys,
  52108. getHalfCheckedNodes,
  52109. setChecked,
  52110. setCheckedKeys,
  52111. filter,
  52112. setData,
  52113. getNode,
  52114. expandNode,
  52115. collapseNode,
  52116. setExpandedKeys,
  52117. scrollToNode,
  52118. scrollTo
  52119. });
  52120. return (_ctx, _cache) => {
  52121. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52122. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), { [(0, vue.unref)(ns).m("highlight-current")]: __props.highlightCurrent }]),
  52123. role: "tree"
  52124. }, [(0, vue.unref)(isNotEmpty) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(FixedSizeList), {
  52125. key: 0,
  52126. ref_key: "listRef",
  52127. ref: listRef,
  52128. "class-name": (0, vue.unref)(ns).b("virtual-list"),
  52129. data: (0, vue.unref)(flattenTree),
  52130. total: (0, vue.unref)(flattenTree).length,
  52131. height: __props.height,
  52132. "item-size": treeNodeSize.value,
  52133. "perf-mode": __props.perfMode,
  52134. "scrollbar-always-on": __props.scrollbarAlwaysOn
  52135. }, {
  52136. default: (0, vue.withCtx)(({ data, index, style }) => [((0, vue.openBlock)(), (0, vue.createBlock)(tree_node_default, {
  52137. key: data[index].key,
  52138. style: (0, vue.normalizeStyle)(style),
  52139. node: data[index],
  52140. expanded: data[index].expanded,
  52141. "show-checkbox": __props.showCheckbox,
  52142. checked: (0, vue.unref)(isChecked)(data[index]),
  52143. indeterminate: (0, vue.unref)(isIndeterminate)(data[index]),
  52144. "item-size": treeNodeSize.value,
  52145. disabled: (0, vue.unref)(isDisabled)(data[index]),
  52146. current: (0, vue.unref)(isCurrent)(data[index]),
  52147. "hidden-expand-icon": (0, vue.unref)(isForceHiddenExpandIcon)(data[index]),
  52148. onClick: (0, vue.unref)(handleNodeClick),
  52149. onToggle: (0, vue.unref)(toggleExpand),
  52150. onCheck: (0, vue.unref)(handleNodeCheck),
  52151. onDrop: (0, vue.unref)(handleNodeDrop)
  52152. }, null, 8, [
  52153. "style",
  52154. "node",
  52155. "expanded",
  52156. "show-checkbox",
  52157. "checked",
  52158. "indeterminate",
  52159. "item-size",
  52160. "disabled",
  52161. "current",
  52162. "hidden-expand-icon",
  52163. "onClick",
  52164. "onToggle",
  52165. "onCheck",
  52166. "onDrop"
  52167. ]))]),
  52168. _: 1
  52169. }, 8, [
  52170. "class-name",
  52171. "data",
  52172. "total",
  52173. "height",
  52174. "item-size",
  52175. "perf-mode",
  52176. "scrollbar-always-on"
  52177. ])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52178. key: 1,
  52179. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("empty-block"))
  52180. }, [(0, vue.renderSlot)(_ctx.$slots, "empty", {}, () => [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("empty-text")) }, (0, vue.toDisplayString)(__props.emptyText ?? (0, vue.unref)(t)("el.tree.emptyText")), 3)])], 2))], 2);
  52181. };
  52182. }
  52183. });
  52184. //#endregion
  52185. //#region ../../packages/components/tree-v2/src/tree.vue
  52186. var tree_default = tree_vue_vue_type_script_setup_true_lang_default;
  52187. //#endregion
  52188. //#region ../../packages/components/tree-v2/index.ts
  52189. const ElTreeV2 = withInstall(tree_default);
  52190. //#endregion
  52191. //#region ../../packages/components/upload/src/ajax.ts
  52192. const SCOPE$3 = "ElUpload";
  52193. var UploadAjaxError = class extends Error {
  52194. constructor(message, status, method, url) {
  52195. super(message);
  52196. this.name = "UploadAjaxError";
  52197. this.status = status;
  52198. this.method = method;
  52199. this.url = url;
  52200. }
  52201. };
  52202. function getError(action, option, xhr) {
  52203. let msg;
  52204. if (xhr.response) msg = `${xhr.response.error || xhr.response}`;
  52205. else if (xhr.responseText) msg = `${xhr.responseText}`;
  52206. else msg = `fail to ${option.method} ${action} ${xhr.status}`;
  52207. return new UploadAjaxError(msg, xhr.status, option.method, action);
  52208. }
  52209. function getBody(xhr) {
  52210. const text = xhr.responseText || xhr.response;
  52211. if (!text) return text;
  52212. try {
  52213. return JSON.parse(text);
  52214. } catch {
  52215. return text;
  52216. }
  52217. }
  52218. const ajaxUpload = (option) => {
  52219. if (typeof XMLHttpRequest === "undefined") throwError(SCOPE$3, "XMLHttpRequest is undefined");
  52220. const xhr = new XMLHttpRequest();
  52221. const action = option.action;
  52222. if (xhr.upload) xhr.upload.addEventListener("progress", (evt) => {
  52223. const progressEvt = evt;
  52224. progressEvt.percent = evt.total > 0 ? evt.loaded / evt.total * 100 : 0;
  52225. option.onProgress(progressEvt);
  52226. });
  52227. const formData = new FormData();
  52228. if (option.data) for (const [key, value] of Object.entries(option.data)) if (isArray$1(value)) if (value.length === 2 && value[0] instanceof Blob && isString(value[1])) formData.append(key, value[0], value[1]);
  52229. else value.forEach((item) => {
  52230. formData.append(key, item);
  52231. });
  52232. else formData.append(key, value);
  52233. formData.append(option.filename, option.file, option.file.name);
  52234. xhr.addEventListener("error", () => {
  52235. option.onError(getError(action, option, xhr));
  52236. });
  52237. xhr.addEventListener("load", () => {
  52238. if (xhr.status < 200 || xhr.status >= 300) return option.onError(getError(action, option, xhr));
  52239. option.onSuccess(getBody(xhr));
  52240. });
  52241. xhr.open(option.method, action, true);
  52242. if (option.withCredentials && "withCredentials" in xhr) xhr.withCredentials = true;
  52243. const headers = option.headers || {};
  52244. if (headers instanceof Headers) headers.forEach((value, key) => xhr.setRequestHeader(key, value));
  52245. else for (const [key, value] of Object.entries(headers)) {
  52246. if (isNil(value)) continue;
  52247. xhr.setRequestHeader(key, String(value));
  52248. }
  52249. xhr.send(formData);
  52250. return xhr;
  52251. };
  52252. //#endregion
  52253. //#region ../../packages/components/upload/src/upload.ts
  52254. /**
  52255. * @deprecated Removed after 3.0.0, Use `UploadProps` instead.
  52256. */
  52257. const uploadListTypes = [
  52258. "text",
  52259. "picture",
  52260. "picture-card"
  52261. ];
  52262. let fileId = 1;
  52263. const genFileId = () => Date.now() + fileId++;
  52264. /**
  52265. * @deprecated Removed after 3.0.0, Use `UploadBaseProps` instead.
  52266. */
  52267. const uploadBaseProps = buildProps({
  52268. action: {
  52269. type: String,
  52270. default: "#"
  52271. },
  52272. headers: { type: definePropType(Object) },
  52273. method: {
  52274. type: String,
  52275. default: "post"
  52276. },
  52277. data: {
  52278. type: definePropType([
  52279. Object,
  52280. Function,
  52281. Promise
  52282. ]),
  52283. default: () => mutable({})
  52284. },
  52285. multiple: Boolean,
  52286. name: {
  52287. type: String,
  52288. default: "file"
  52289. },
  52290. drag: Boolean,
  52291. withCredentials: Boolean,
  52292. showFileList: {
  52293. type: Boolean,
  52294. default: true
  52295. },
  52296. accept: {
  52297. type: String,
  52298. default: ""
  52299. },
  52300. fileList: {
  52301. type: definePropType(Array),
  52302. default: () => mutable([])
  52303. },
  52304. autoUpload: {
  52305. type: Boolean,
  52306. default: true
  52307. },
  52308. listType: {
  52309. type: String,
  52310. values: uploadListTypes,
  52311. default: "text"
  52312. },
  52313. httpRequest: {
  52314. type: definePropType(Function),
  52315. default: ajaxUpload
  52316. },
  52317. disabled: {
  52318. type: Boolean,
  52319. default: void 0
  52320. },
  52321. limit: Number,
  52322. directory: Boolean
  52323. });
  52324. /**
  52325. * @deprecated Removed after 3.0.0, Use `UploadProps` instead.
  52326. */
  52327. const uploadProps = buildProps({
  52328. ...uploadBaseProps,
  52329. beforeUpload: {
  52330. type: definePropType(Function),
  52331. default: NOOP
  52332. },
  52333. beforeRemove: { type: definePropType(Function) },
  52334. onRemove: {
  52335. type: definePropType(Function),
  52336. default: NOOP
  52337. },
  52338. onChange: {
  52339. type: definePropType(Function),
  52340. default: NOOP
  52341. },
  52342. onPreview: {
  52343. type: definePropType(Function),
  52344. default: NOOP
  52345. },
  52346. onSuccess: {
  52347. type: definePropType(Function),
  52348. default: NOOP
  52349. },
  52350. onProgress: {
  52351. type: definePropType(Function),
  52352. default: NOOP
  52353. },
  52354. onError: {
  52355. type: definePropType(Function),
  52356. default: NOOP
  52357. },
  52358. onExceed: {
  52359. type: definePropType(Function),
  52360. default: NOOP
  52361. },
  52362. crossorigin: { type: definePropType(String) }
  52363. });
  52364. const uploadBasePropsDefaults = {
  52365. action: "#",
  52366. method: "post",
  52367. data: () => mutable({}),
  52368. name: "file",
  52369. showFileList: true,
  52370. accept: "",
  52371. fileList: () => mutable([]),
  52372. autoUpload: true,
  52373. listType: "text",
  52374. httpRequest: ajaxUpload,
  52375. disabled: void 0
  52376. };
  52377. const uploadPropsDefaults = {
  52378. ...uploadBasePropsDefaults,
  52379. beforeUpload: NOOP,
  52380. onRemove: NOOP,
  52381. onChange: NOOP,
  52382. onPreview: NOOP,
  52383. onSuccess: NOOP,
  52384. onProgress: NOOP,
  52385. onError: NOOP,
  52386. onExceed: NOOP
  52387. };
  52388. //#endregion
  52389. //#region ../../packages/components/upload/src/constants.ts
  52390. const uploadContextKey = Symbol("uploadContextKey");
  52391. //#endregion
  52392. //#region ../../packages/components/upload/src/upload-list.ts
  52393. /**
  52394. * @deprecated Removed after 3.0.0, Use `UploadListProps` instead.
  52395. */
  52396. const uploadListProps = buildProps({
  52397. files: {
  52398. type: definePropType(Array),
  52399. default: () => mutable([])
  52400. },
  52401. disabled: {
  52402. type: Boolean,
  52403. default: void 0
  52404. },
  52405. handlePreview: {
  52406. type: definePropType(Function),
  52407. default: NOOP
  52408. },
  52409. listType: {
  52410. type: String,
  52411. values: uploadListTypes,
  52412. default: "text"
  52413. },
  52414. crossorigin: { type: definePropType(String) }
  52415. });
  52416. const uploadListEmits = { remove: (file) => !!file };
  52417. //#endregion
  52418. //#region ../../packages/components/upload/src/upload-list.vue?vue&type=script&setup=true&lang.ts
  52419. const _hoisted_1$10 = [
  52420. "tabindex",
  52421. "aria-disabled",
  52422. "onKeydown"
  52423. ];
  52424. const _hoisted_2$6 = ["src", "crossorigin"];
  52425. const _hoisted_3$2 = ["onClick"];
  52426. const _hoisted_4$1 = ["title"];
  52427. const _hoisted_5 = ["onClick"];
  52428. const _hoisted_6 = ["onClick"];
  52429. var upload_list_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  52430. name: "ElUploadList",
  52431. __name: "upload-list",
  52432. props: uploadListProps,
  52433. emits: uploadListEmits,
  52434. setup(__props, { emit: __emit }) {
  52435. const props = __props;
  52436. const emit = __emit;
  52437. const { t } = useLocale();
  52438. const nsUpload = useNamespace("upload");
  52439. const nsIcon = useNamespace("icon");
  52440. const nsList = useNamespace("list");
  52441. const disabled = useFormDisabled();
  52442. const focusing = (0, vue.ref)(false);
  52443. const containerKls = (0, vue.computed)(() => [
  52444. nsUpload.b("list"),
  52445. nsUpload.bm("list", props.listType),
  52446. nsUpload.is("disabled", disabled.value)
  52447. ]);
  52448. const handleRemove = (file) => {
  52449. emit("remove", file);
  52450. };
  52451. return (_ctx, _cache) => {
  52452. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.TransitionGroup, {
  52453. tag: "ul",
  52454. class: (0, vue.normalizeClass)(containerKls.value),
  52455. name: (0, vue.unref)(nsList).b()
  52456. }, {
  52457. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.files, (file, index) => {
  52458. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  52459. key: file.uid || file.name,
  52460. class: (0, vue.normalizeClass)([
  52461. (0, vue.unref)(nsUpload).be("list", "item"),
  52462. (0, vue.unref)(nsUpload).is(file.status),
  52463. { focusing: focusing.value }
  52464. ]),
  52465. tabindex: (0, vue.unref)(disabled) ? void 0 : 0,
  52466. "aria-disabled": (0, vue.unref)(disabled),
  52467. role: "button",
  52468. onKeydown: (0, vue.withKeys)(($event) => !(0, vue.unref)(disabled) && handleRemove(file), ["delete"]),
  52469. onFocus: _cache[0] || (_cache[0] = ($event) => focusing.value = true),
  52470. onBlur: _cache[1] || (_cache[1] = ($event) => focusing.value = false),
  52471. onClick: _cache[2] || (_cache[2] = ($event) => focusing.value = false)
  52472. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {
  52473. file,
  52474. index
  52475. }, () => [
  52476. __props.listType === "picture" || file.status !== "uploading" && __props.listType === "picture-card" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("img", {
  52477. key: 0,
  52478. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-thumbnail")),
  52479. src: file.url,
  52480. crossorigin: __props.crossorigin,
  52481. alt: ""
  52482. }, null, 10, _hoisted_2$6)) : (0, vue.createCommentVNode)("v-if", true),
  52483. file.status === "uploading" || __props.listType !== "picture-card" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52484. key: 1,
  52485. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-info"))
  52486. }, [(0, vue.createElementVNode)("a", {
  52487. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-name")),
  52488. onClick: (0, vue.withModifiers)(($event) => __props.handlePreview(file), ["prevent"])
  52489. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(nsIcon).m("document")) }, {
  52490. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(document_default))]),
  52491. _: 1
  52492. }, 8, ["class"]), (0, vue.createElementVNode)("span", {
  52493. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-file-name")),
  52494. title: file.name
  52495. }, (0, vue.toDisplayString)(file.name), 11, _hoisted_4$1)], 10, _hoisted_3$2), file.status === "uploading" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElProgress), {
  52496. key: 0,
  52497. type: __props.listType === "picture-card" ? "circle" : "line",
  52498. "stroke-width": __props.listType === "picture-card" ? 6 : 2,
  52499. percentage: Number(file.percentage),
  52500. style: (0, vue.normalizeStyle)(__props.listType === "picture-card" ? "" : "margin-top: 0.5rem")
  52501. }, null, 8, [
  52502. "type",
  52503. "stroke-width",
  52504. "percentage",
  52505. "style"
  52506. ])) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  52507. (0, vue.createElementVNode)("label", { class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-status-label")) }, [__props.listType === "text" ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  52508. key: 0,
  52509. class: (0, vue.normalizeClass)([(0, vue.unref)(nsIcon).m("upload-success"), (0, vue.unref)(nsIcon).m("circle-check")])
  52510. }, {
  52511. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(circle_check_default))]),
  52512. _: 1
  52513. }, 8, ["class"])) : ["picture-card", "picture"].includes(__props.listType) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  52514. key: 1,
  52515. class: (0, vue.normalizeClass)([(0, vue.unref)(nsIcon).m("upload-success"), (0, vue.unref)(nsIcon).m("check")])
  52516. }, {
  52517. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(check_default))]),
  52518. _: 1
  52519. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)], 2),
  52520. !(0, vue.unref)(disabled) ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  52521. key: 2,
  52522. class: (0, vue.normalizeClass)((0, vue.unref)(nsIcon).m("close")),
  52523. "aria-label": (0, vue.unref)(t)("el.upload.delete"),
  52524. role: "button",
  52525. tabindex: "0",
  52526. onClick: ($event) => handleRemove(file),
  52527. onKeydown: (0, vue.withKeys)((0, vue.withModifiers)(($event) => handleRemove(file), ["prevent"]), ["enter", "space"])
  52528. }, {
  52529. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(close_default))]),
  52530. _: 1
  52531. }, 8, [
  52532. "class",
  52533. "aria-label",
  52534. "onClick",
  52535. "onKeydown"
  52536. ])) : (0, vue.createCommentVNode)("v-if", true),
  52537. !(0, vue.unref)(disabled) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("i", {
  52538. key: 3,
  52539. class: (0, vue.normalizeClass)((0, vue.unref)(nsIcon).m("close-tip"))
  52540. }, (0, vue.toDisplayString)((0, vue.unref)(t)("el.upload.deleteTip")), 3)) : (0, vue.createCommentVNode)("v-if", true),
  52541. __props.listType === "picture-card" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  52542. key: 4,
  52543. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-actions"))
  52544. }, [(0, vue.createElementVNode)("span", {
  52545. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-preview")),
  52546. onClick: ($event) => __props.handlePreview(file)
  52547. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(nsIcon).m("zoom-in")) }, {
  52548. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(zoom_in_default))]),
  52549. _: 1
  52550. }, 8, ["class"])], 10, _hoisted_5), !(0, vue.unref)(disabled) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  52551. key: 0,
  52552. class: (0, vue.normalizeClass)((0, vue.unref)(nsUpload).be("list", "item-delete")),
  52553. onClick: ($event) => handleRemove(file)
  52554. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(nsIcon).m("delete")) }, {
  52555. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(delete_default))]),
  52556. _: 1
  52557. }, 8, ["class"])], 10, _hoisted_6)) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true)
  52558. ])], 42, _hoisted_1$10);
  52559. }), 128)), (0, vue.renderSlot)(_ctx.$slots, "append")]),
  52560. _: 3
  52561. }, 8, ["class", "name"]);
  52562. };
  52563. }
  52564. });
  52565. //#endregion
  52566. //#region ../../packages/components/upload/src/upload-list.vue
  52567. var upload_list_default = upload_list_vue_vue_type_script_setup_true_lang_default;
  52568. //#endregion
  52569. //#region ../../packages/components/upload/src/upload-content.ts
  52570. /**
  52571. * @deprecated Removed after 3.0.0, Use `UploadContentProps` instead.
  52572. */
  52573. const uploadContentProps = buildProps({
  52574. ...uploadBaseProps,
  52575. beforeUpload: {
  52576. type: definePropType(Function),
  52577. default: NOOP
  52578. },
  52579. onRemove: {
  52580. type: definePropType(Function),
  52581. default: NOOP
  52582. },
  52583. onStart: {
  52584. type: definePropType(Function),
  52585. default: NOOP
  52586. },
  52587. onSuccess: {
  52588. type: definePropType(Function),
  52589. default: NOOP
  52590. },
  52591. onProgress: {
  52592. type: definePropType(Function),
  52593. default: NOOP
  52594. },
  52595. onError: {
  52596. type: definePropType(Function),
  52597. default: NOOP
  52598. },
  52599. onExceed: {
  52600. type: definePropType(Function),
  52601. default: NOOP
  52602. }
  52603. });
  52604. const uploadContentPropsDefaults = {
  52605. ...uploadBasePropsDefaults,
  52606. beforeUpload: NOOP,
  52607. onRemove: NOOP,
  52608. onStart: NOOP,
  52609. onSuccess: NOOP,
  52610. onProgress: NOOP,
  52611. onError: NOOP,
  52612. onExceed: NOOP
  52613. };
  52614. //#endregion
  52615. //#region ../../packages/components/upload/src/upload-dragger.ts
  52616. /**
  52617. * @deprecated Removed after 3.0.0, Use `UploadDraggerProps` instead.
  52618. */
  52619. const uploadDraggerProps = buildProps({
  52620. disabled: {
  52621. type: Boolean,
  52622. default: void 0
  52623. },
  52624. directory: Boolean
  52625. });
  52626. const uploadDraggerEmits = { file: (file) => isArray$1(file) };
  52627. //#endregion
  52628. //#region ../../packages/components/upload/src/upload-dragger.vue?vue&type=script&setup=true&lang.ts
  52629. const COMPONENT_NAME$1 = "ElUploadDrag";
  52630. var upload_dragger_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  52631. name: COMPONENT_NAME$1,
  52632. __name: "upload-dragger",
  52633. props: uploadDraggerProps,
  52634. emits: uploadDraggerEmits,
  52635. setup(__props, { emit: __emit }) {
  52636. const props = __props;
  52637. const emit = __emit;
  52638. if (!(0, vue.inject)(uploadContextKey)) throwError(COMPONENT_NAME$1, "usage: <el-upload><el-upload-dragger /></el-upload>");
  52639. const ns = useNamespace("upload");
  52640. const dragover = (0, vue.ref)(false);
  52641. const disabled = useFormDisabled();
  52642. const getFile = (entry) => {
  52643. return new Promise((resolve, reject) => entry.file(resolve, reject));
  52644. };
  52645. const getAllFiles = async (entry) => {
  52646. try {
  52647. if (entry.isFile) {
  52648. const file = await getFile(entry);
  52649. file.isDirectory = false;
  52650. return [file];
  52651. }
  52652. if (entry.isDirectory) {
  52653. const dirReader = entry.createReader();
  52654. const getEntries = () => {
  52655. return new Promise((resolve, reject) => dirReader.readEntries(resolve, reject));
  52656. };
  52657. const entries = [];
  52658. let readEntries = await getEntries();
  52659. /**
  52660. * In Chromium-based browsers, readEntries() will only return the first 100 FileSystemEntry instances.
  52661. * https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries#:~:text=In%20Chromium%2Dbased%20browsers%2C%20readEntries()%20will%20only%20return%20the%20first%20100%20FileSystemEntry%20instances.%20In%20order%20to%20obtain%20all%20of%20the%20instances%2C%20readEntries()%20must%20be%20called%20multiple%20times.
  52662. */
  52663. while (readEntries.length > 0) {
  52664. entries.push(...readEntries);
  52665. readEntries = await getEntries();
  52666. }
  52667. const filePromises = entries.map((entry) => getAllFiles(entry).catch(() => []));
  52668. return flatten(await Promise.all(filePromises));
  52669. }
  52670. } catch {
  52671. return [];
  52672. }
  52673. return [];
  52674. };
  52675. const onDrop = async (e) => {
  52676. if (disabled.value) return;
  52677. dragover.value = false;
  52678. e.stopPropagation();
  52679. const files = Array.from(e.dataTransfer.files);
  52680. const items = e.dataTransfer.items || [];
  52681. if (props.directory) {
  52682. const entries = Array.from(items).map((item) => item?.webkitGetAsEntry?.()).filter((entry) => entry);
  52683. emit("file", flatten(await Promise.all(entries.map(getAllFiles))));
  52684. return;
  52685. }
  52686. files.forEach((file, index) => {
  52687. const entry = items[index]?.webkitGetAsEntry?.();
  52688. if (entry) file.isDirectory = entry.isDirectory;
  52689. });
  52690. emit("file", files);
  52691. };
  52692. const onDragover = () => {
  52693. if (!disabled.value) dragover.value = true;
  52694. };
  52695. const onDragleave = (e) => {
  52696. if (!e.currentTarget.contains(e.relatedTarget)) dragover.value = false;
  52697. };
  52698. return (_ctx, _cache) => {
  52699. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52700. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("dragger"), (0, vue.unref)(ns).is("dragover", dragover.value)]),
  52701. onDrop: (0, vue.withModifiers)(onDrop, ["prevent"]),
  52702. onDragover: (0, vue.withModifiers)(onDragover, ["prevent"]),
  52703. onDragleave: (0, vue.withModifiers)(onDragleave, ["prevent"])
  52704. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 34);
  52705. };
  52706. }
  52707. });
  52708. //#endregion
  52709. //#region ../../packages/components/upload/src/upload-dragger.vue
  52710. var upload_dragger_default = upload_dragger_vue_vue_type_script_setup_true_lang_default;
  52711. //#endregion
  52712. //#region ../../packages/components/upload/src/upload-content.vue?vue&type=script&setup=true&lang.ts
  52713. const _hoisted_1$9 = [
  52714. "tabindex",
  52715. "aria-disabled",
  52716. "onKeydown"
  52717. ];
  52718. const _hoisted_2$5 = [
  52719. "name",
  52720. "disabled",
  52721. "multiple",
  52722. "accept",
  52723. "webkitdirectory"
  52724. ];
  52725. var upload_content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  52726. name: "ElUploadContent",
  52727. inheritAttrs: false,
  52728. __name: "upload-content",
  52729. props: uploadContentProps,
  52730. setup(__props, { expose: __expose }) {
  52731. const props = __props;
  52732. const ns = useNamespace("upload");
  52733. const disabled = useFormDisabled();
  52734. const requests = (0, vue.shallowRef)({});
  52735. const inputRef = (0, vue.shallowRef)();
  52736. const uploadFiles = (files) => {
  52737. if (files.length === 0) return;
  52738. const { autoUpload, limit, fileList, multiple, onStart, onExceed } = props;
  52739. if (limit && fileList.length + files.length > limit) {
  52740. onExceed(files, fileList);
  52741. return;
  52742. }
  52743. if (!multiple) files = files.slice(0, 1);
  52744. for (const file of files) {
  52745. const rawFile = file;
  52746. rawFile.uid = genFileId();
  52747. onStart(rawFile);
  52748. if (autoUpload) upload(rawFile);
  52749. }
  52750. };
  52751. const upload = async (rawFile) => {
  52752. inputRef.value.value = "";
  52753. if (!props.beforeUpload) return doUpload(rawFile);
  52754. let hookResult;
  52755. let beforeData = {};
  52756. try {
  52757. const originData = props.data;
  52758. const beforeUploadPromise = props.beforeUpload(rawFile);
  52759. beforeData = isPlainObject$1(props.data) ? cloneDeep(props.data) : props.data;
  52760. hookResult = await beforeUploadPromise;
  52761. if (isPlainObject$1(props.data) && isEqual$1(originData, beforeData)) beforeData = cloneDeep(props.data);
  52762. } catch {
  52763. hookResult = false;
  52764. }
  52765. if (hookResult === false) {
  52766. props.onRemove(rawFile);
  52767. return;
  52768. }
  52769. let file = rawFile;
  52770. if (hookResult instanceof Blob) if (hookResult instanceof File) file = hookResult;
  52771. else file = new File([hookResult], rawFile.name, { type: rawFile.type });
  52772. doUpload(Object.assign(file, { uid: rawFile.uid }), beforeData);
  52773. };
  52774. const resolveData = async (data, rawFile) => {
  52775. if (isFunction$1(data)) return data(rawFile);
  52776. return data;
  52777. };
  52778. const doUpload = async (rawFile, beforeData) => {
  52779. const { headers, data, method, withCredentials, name: filename, action, onProgress, onSuccess, onError, httpRequest } = props;
  52780. try {
  52781. beforeData = await resolveData(beforeData ?? data, rawFile);
  52782. } catch {
  52783. props.onRemove(rawFile);
  52784. return;
  52785. }
  52786. const { uid } = rawFile;
  52787. const options = {
  52788. headers: headers || {},
  52789. withCredentials,
  52790. file: rawFile,
  52791. data: beforeData,
  52792. method,
  52793. filename,
  52794. action,
  52795. onProgress: (evt) => {
  52796. onProgress(evt, rawFile);
  52797. },
  52798. onSuccess: (res) => {
  52799. onSuccess(res, rawFile);
  52800. delete requests.value[uid];
  52801. },
  52802. onError: (err) => {
  52803. onError(err, rawFile);
  52804. delete requests.value[uid];
  52805. }
  52806. };
  52807. const request = httpRequest(options);
  52808. requests.value[uid] = request;
  52809. if (request instanceof Promise) request.then(options.onSuccess, options.onError);
  52810. };
  52811. const handleChange = (e) => {
  52812. const files = e.target.files;
  52813. if (!files) return;
  52814. uploadFiles(Array.from(files));
  52815. };
  52816. const handleClick = () => {
  52817. if (!disabled.value) {
  52818. inputRef.value.value = "";
  52819. inputRef.value.click();
  52820. }
  52821. };
  52822. const handleKeydown = () => {
  52823. handleClick();
  52824. };
  52825. const abort = (file) => {
  52826. entriesOf(requests.value).filter(file ? ([uid]) => String(file.uid) === uid : () => true).forEach(([uid, req]) => {
  52827. if (req instanceof XMLHttpRequest) req.abort();
  52828. delete requests.value[uid];
  52829. });
  52830. };
  52831. __expose({
  52832. abort,
  52833. upload
  52834. });
  52835. return (_ctx, _cache) => {
  52836. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  52837. class: (0, vue.normalizeClass)([
  52838. (0, vue.unref)(ns).b(),
  52839. (0, vue.unref)(ns).m(__props.listType),
  52840. (0, vue.unref)(ns).is("drag", __props.drag),
  52841. (0, vue.unref)(ns).is("disabled", (0, vue.unref)(disabled))
  52842. ]),
  52843. tabindex: (0, vue.unref)(disabled) ? void 0 : 0,
  52844. "aria-disabled": (0, vue.unref)(disabled),
  52845. role: "button",
  52846. onClick: handleClick,
  52847. onKeydown: (0, vue.withKeys)((0, vue.withModifiers)(handleKeydown, ["self"]), ["enter", "space"])
  52848. }, [__props.drag ? ((0, vue.openBlock)(), (0, vue.createBlock)(upload_dragger_default, {
  52849. key: 0,
  52850. disabled: (0, vue.unref)(disabled),
  52851. directory: __props.directory,
  52852. onFile: uploadFiles
  52853. }, {
  52854. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  52855. _: 3
  52856. }, 8, ["disabled", "directory"])) : (0, vue.renderSlot)(_ctx.$slots, "default", { key: 1 }), (0, vue.createElementVNode)("input", {
  52857. ref_key: "inputRef",
  52858. ref: inputRef,
  52859. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("input")),
  52860. name: __props.name,
  52861. disabled: (0, vue.unref)(disabled),
  52862. multiple: __props.multiple,
  52863. accept: __props.accept,
  52864. webkitdirectory: __props.directory || void 0,
  52865. type: "file",
  52866. onChange: handleChange,
  52867. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"]))
  52868. }, null, 42, _hoisted_2$5)], 42, _hoisted_1$9);
  52869. };
  52870. }
  52871. });
  52872. //#endregion
  52873. //#region ../../packages/components/upload/src/upload-content.vue
  52874. var upload_content_default = upload_content_vue_vue_type_script_setup_true_lang_default;
  52875. //#endregion
  52876. //#region ../../packages/components/upload/src/use-handlers.ts
  52877. const SCOPE$2 = "ElUpload";
  52878. const revokeFileObjectURL = (file) => {
  52879. if (file.url?.startsWith("blob:")) URL.revokeObjectURL(file.url);
  52880. };
  52881. const useHandlers = (props, uploadRef) => {
  52882. const uploadFiles = useVModel(props, "fileList", void 0, { passive: true });
  52883. const getFile = (rawFile) => uploadFiles.value.find((file) => file.uid === rawFile.uid);
  52884. function abort(file) {
  52885. uploadRef.value?.abort(file);
  52886. }
  52887. function clearFiles(states = [
  52888. "ready",
  52889. "uploading",
  52890. "success",
  52891. "fail"
  52892. ]) {
  52893. uploadFiles.value = uploadFiles.value.filter((row) => !states.includes(row.status));
  52894. }
  52895. function removeFile(file) {
  52896. uploadFiles.value = uploadFiles.value.filter((uploadFile) => uploadFile.uid !== file.uid);
  52897. }
  52898. const emitChange = (file) => {
  52899. (0, vue.nextTick)(() => props.onChange(file, uploadFiles.value));
  52900. };
  52901. const handleError = (err, rawFile) => {
  52902. const file = getFile(rawFile);
  52903. if (!file) return;
  52904. console.error(err);
  52905. file.status = "fail";
  52906. removeFile(file);
  52907. props.onError(err, file, uploadFiles.value);
  52908. emitChange(file);
  52909. };
  52910. const handleProgress = (evt, rawFile) => {
  52911. const file = getFile(rawFile);
  52912. if (!file) return;
  52913. props.onProgress(evt, file, uploadFiles.value);
  52914. file.status = "uploading";
  52915. file.percentage = Math.round(evt.percent);
  52916. };
  52917. const handleSuccess = (response, rawFile) => {
  52918. const file = getFile(rawFile);
  52919. if (!file) return;
  52920. file.status = "success";
  52921. file.response = response;
  52922. props.onSuccess(response, file, uploadFiles.value);
  52923. emitChange(file);
  52924. };
  52925. const handleStart = (file) => {
  52926. if (isNil(file.uid)) file.uid = genFileId();
  52927. const uploadFile = {
  52928. name: file.name,
  52929. percentage: 0,
  52930. status: "ready",
  52931. size: file.size,
  52932. raw: file,
  52933. uid: file.uid
  52934. };
  52935. if (props.listType === "picture-card" || props.listType === "picture") try {
  52936. uploadFile.url = URL.createObjectURL(file);
  52937. } catch (err) {
  52938. /* @__PURE__ */ debugWarn(SCOPE$2, err.message);
  52939. props.onError(err, uploadFile, uploadFiles.value);
  52940. }
  52941. uploadFiles.value = [...uploadFiles.value, uploadFile];
  52942. emitChange(uploadFile);
  52943. };
  52944. const handleRemove = async (file) => {
  52945. const uploadFile = file instanceof File ? getFile(file) : file;
  52946. if (!uploadFile) throwError(SCOPE$2, "file to be removed not found");
  52947. const doRemove = (file) => {
  52948. abort(file);
  52949. removeFile(file);
  52950. props.onRemove(file, uploadFiles.value);
  52951. revokeFileObjectURL(file);
  52952. };
  52953. if (props.beforeRemove) {
  52954. if (await props.beforeRemove(uploadFile, uploadFiles.value) !== false) doRemove(uploadFile);
  52955. } else doRemove(uploadFile);
  52956. };
  52957. function submit() {
  52958. uploadFiles.value.filter(({ status }) => status === "ready").forEach(({ raw }) => raw && uploadRef.value?.upload(raw));
  52959. }
  52960. (0, vue.watch)(() => props.listType, (val) => {
  52961. if (val !== "picture-card" && val !== "picture") return;
  52962. uploadFiles.value = uploadFiles.value.map((file) => {
  52963. const { raw, url } = file;
  52964. if (!url && raw) try {
  52965. file.url = URL.createObjectURL(raw);
  52966. } catch (err) {
  52967. props.onError(err, file, uploadFiles.value);
  52968. }
  52969. return file;
  52970. });
  52971. });
  52972. (0, vue.watch)(uploadFiles, (files) => {
  52973. for (const file of files) {
  52974. file.uid ||= genFileId();
  52975. file.status ||= "success";
  52976. }
  52977. }, {
  52978. immediate: true,
  52979. deep: true
  52980. });
  52981. return {
  52982. uploadFiles,
  52983. abort,
  52984. clearFiles,
  52985. handleError,
  52986. handleProgress,
  52987. handleStart,
  52988. handleSuccess,
  52989. handleRemove,
  52990. submit,
  52991. revokeFileObjectURL
  52992. };
  52993. };
  52994. //#endregion
  52995. //#region ../../packages/components/upload/src/upload.vue?vue&type=script&setup=true&lang.ts
  52996. var upload_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  52997. name: "ElUpload",
  52998. __name: "upload",
  52999. props: uploadProps,
  53000. setup(__props, { expose: __expose }) {
  53001. const props = __props;
  53002. const disabled = useFormDisabled();
  53003. const uploadRef = (0, vue.shallowRef)();
  53004. const { abort, submit, clearFiles, uploadFiles, handleStart, handleError, handleRemove, handleSuccess, handleProgress, revokeFileObjectURL } = useHandlers(props, uploadRef);
  53005. const isPictureCard = (0, vue.computed)(() => props.listType === "picture-card");
  53006. const uploadContentProps = (0, vue.computed)(() => ({
  53007. ...props,
  53008. fileList: uploadFiles.value,
  53009. onStart: handleStart,
  53010. onProgress: handleProgress,
  53011. onSuccess: handleSuccess,
  53012. onError: handleError,
  53013. onRemove: handleRemove
  53014. }));
  53015. (0, vue.onBeforeUnmount)(() => {
  53016. uploadFiles.value.forEach(revokeFileObjectURL);
  53017. });
  53018. (0, vue.provide)(uploadContextKey, { accept: (0, vue.toRef)(props, "accept") });
  53019. __expose({
  53020. abort,
  53021. submit,
  53022. clearFiles,
  53023. handleStart,
  53024. handleRemove
  53025. });
  53026. return (_ctx, _cache) => {
  53027. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", null, [
  53028. isPictureCard.value && __props.showFileList ? ((0, vue.openBlock)(), (0, vue.createBlock)(upload_list_default, {
  53029. key: 0,
  53030. disabled: (0, vue.unref)(disabled),
  53031. "list-type": __props.listType,
  53032. files: (0, vue.unref)(uploadFiles),
  53033. crossorigin: __props.crossorigin,
  53034. "handle-preview": __props.onPreview,
  53035. onRemove: (0, vue.unref)(handleRemove)
  53036. }, (0, vue.createSlots)({
  53037. append: (0, vue.withCtx)(() => [(0, vue.createVNode)(upload_content_default, (0, vue.mergeProps)({
  53038. ref_key: "uploadRef",
  53039. ref: uploadRef
  53040. }, uploadContentProps.value), {
  53041. default: (0, vue.withCtx)(() => [_ctx.$slots.trigger ? (0, vue.renderSlot)(_ctx.$slots, "trigger", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? (0, vue.renderSlot)(_ctx.$slots, "default", { key: 1 }) : (0, vue.createCommentVNode)("v-if", true)]),
  53042. _: 3
  53043. }, 16)]),
  53044. _: 2
  53045. }, [_ctx.$slots.file ? {
  53046. name: "default",
  53047. fn: (0, vue.withCtx)(({ file, index }) => [(0, vue.renderSlot)(_ctx.$slots, "file", {
  53048. file,
  53049. index
  53050. })]),
  53051. key: "0"
  53052. } : void 0]), 1032, [
  53053. "disabled",
  53054. "list-type",
  53055. "files",
  53056. "crossorigin",
  53057. "handle-preview",
  53058. "onRemove"
  53059. ])) : (0, vue.createCommentVNode)("v-if", true),
  53060. !isPictureCard.value || isPictureCard.value && !__props.showFileList ? ((0, vue.openBlock)(), (0, vue.createBlock)(upload_content_default, (0, vue.mergeProps)({
  53061. key: 1,
  53062. ref_key: "uploadRef",
  53063. ref: uploadRef
  53064. }, uploadContentProps.value), {
  53065. default: (0, vue.withCtx)(() => [_ctx.$slots.trigger ? (0, vue.renderSlot)(_ctx.$slots, "trigger", { key: 0 }) : (0, vue.createCommentVNode)("v-if", true), !_ctx.$slots.trigger && _ctx.$slots.default ? (0, vue.renderSlot)(_ctx.$slots, "default", { key: 1 }) : (0, vue.createCommentVNode)("v-if", true)]),
  53066. _: 3
  53067. }, 16)) : (0, vue.createCommentVNode)("v-if", true),
  53068. _ctx.$slots.trigger ? (0, vue.renderSlot)(_ctx.$slots, "default", { key: 2 }) : (0, vue.createCommentVNode)("v-if", true),
  53069. (0, vue.renderSlot)(_ctx.$slots, "tip"),
  53070. !isPictureCard.value && __props.showFileList ? ((0, vue.openBlock)(), (0, vue.createBlock)(upload_list_default, {
  53071. key: 3,
  53072. disabled: (0, vue.unref)(disabled),
  53073. "list-type": __props.listType,
  53074. files: (0, vue.unref)(uploadFiles),
  53075. crossorigin: __props.crossorigin,
  53076. "handle-preview": __props.onPreview,
  53077. onRemove: (0, vue.unref)(handleRemove)
  53078. }, (0, vue.createSlots)({ _: 2 }, [_ctx.$slots.file ? {
  53079. name: "default",
  53080. fn: (0, vue.withCtx)(({ file, index }) => [(0, vue.renderSlot)(_ctx.$slots, "file", {
  53081. file,
  53082. index
  53083. })]),
  53084. key: "0"
  53085. } : void 0]), 1032, [
  53086. "disabled",
  53087. "list-type",
  53088. "files",
  53089. "crossorigin",
  53090. "handle-preview",
  53091. "onRemove"
  53092. ])) : (0, vue.createCommentVNode)("v-if", true)
  53093. ]);
  53094. };
  53095. }
  53096. });
  53097. //#endregion
  53098. //#region ../../packages/components/upload/src/upload.vue
  53099. var upload_default = upload_vue_vue_type_script_setup_true_lang_default;
  53100. //#endregion
  53101. //#region ../../packages/components/upload/index.ts
  53102. const ElUpload = withInstall(upload_default);
  53103. //#endregion
  53104. //#region ../../packages/components/watermark/src/watermark.ts
  53105. /**
  53106. * @deprecated Removed after 3.0.0, Use `WatermarkProps` instead.
  53107. */
  53108. const watermarkProps = buildProps({
  53109. zIndex: {
  53110. type: Number,
  53111. default: 9
  53112. },
  53113. rotate: {
  53114. type: Number,
  53115. default: -22
  53116. },
  53117. width: Number,
  53118. height: Number,
  53119. image: String,
  53120. content: {
  53121. type: definePropType([String, Array]),
  53122. default: "Element Plus"
  53123. },
  53124. font: { type: definePropType(Object) },
  53125. gap: {
  53126. type: definePropType(Array),
  53127. default: () => [100, 100]
  53128. },
  53129. offset: { type: definePropType(Array) }
  53130. });
  53131. //#endregion
  53132. //#region ../../packages/components/watermark/src/utils.ts
  53133. /** converting camel-cased strings to be lowercase and link it with Separator */
  53134. function toLowercaseSeparator(key) {
  53135. return key.replace(/([A-Z])/g, "-$1").toLowerCase();
  53136. }
  53137. function getStyleStr(style) {
  53138. return Object.keys(style).map((key) => `${toLowercaseSeparator(key)}: ${style[key]};`).join(" ");
  53139. }
  53140. /** Returns the ratio of the device's physical pixel resolution to the css pixel resolution */
  53141. function getPixelRatio() {
  53142. return window.devicePixelRatio || 1;
  53143. }
  53144. /** Whether to re-render the watermark */
  53145. const reRendering = (mutation, watermarkElement) => {
  53146. let flag = false;
  53147. if (mutation.removedNodes.length && watermarkElement) flag = Array.from(mutation.removedNodes).includes(watermarkElement);
  53148. if (mutation.type === "attributes" && mutation.target === watermarkElement) flag = true;
  53149. return flag;
  53150. };
  53151. //#endregion
  53152. //#region ../../packages/components/watermark/src/useClips.ts
  53153. const TEXT_ALIGN_RATIO_MAP = {
  53154. left: [0, .5],
  53155. start: [0, .5],
  53156. center: [.5, 0],
  53157. right: [1, -.5],
  53158. end: [1, -.5]
  53159. };
  53160. function prepareCanvas(width, height, ratio = 1) {
  53161. const canvas = document.createElement("canvas");
  53162. const ctx = canvas.getContext("2d");
  53163. const realWidth = width * ratio;
  53164. const realHeight = height * ratio;
  53165. canvas.setAttribute("width", `${realWidth}px`);
  53166. canvas.setAttribute("height", `${realHeight}px`);
  53167. ctx.save();
  53168. return [
  53169. ctx,
  53170. canvas,
  53171. realWidth,
  53172. realHeight
  53173. ];
  53174. }
  53175. /**
  53176. * Get the clips of text content.
  53177. * This is a lazy hook function since SSR no need this
  53178. */
  53179. function useClips() {
  53180. function getClips(content, rotate, ratio, width, height, font, gapX, gapY, space) {
  53181. const [ctx, canvas, contentWidth, contentHeight] = prepareCanvas(width, height, ratio);
  53182. let baselineOffset = 0;
  53183. if (content instanceof HTMLImageElement) ctx.drawImage(content, 0, 0, contentWidth, contentHeight);
  53184. else {
  53185. const { color, fontSize, fontStyle, fontWeight, fontFamily, textAlign, textBaseline } = font;
  53186. const mergedFontSize = Number(fontSize) * ratio;
  53187. ctx.font = `${fontStyle} normal ${fontWeight} ${mergedFontSize}px/${height}px ${fontFamily}`;
  53188. ctx.fillStyle = color;
  53189. ctx.textAlign = textAlign;
  53190. ctx.textBaseline = textBaseline;
  53191. const contents = isArray$1(content) ? content : [content];
  53192. if (textBaseline !== "top" && contents[0]) {
  53193. const argumentMetrics = ctx.measureText(contents[0]);
  53194. ctx.textBaseline = "top";
  53195. const topMetrics = ctx.measureText(contents[0]);
  53196. baselineOffset = argumentMetrics.actualBoundingBoxAscent - topMetrics.actualBoundingBoxAscent;
  53197. }
  53198. contents?.forEach((item, index) => {
  53199. const [alignRatio, spaceRatio] = TEXT_ALIGN_RATIO_MAP[textAlign];
  53200. ctx.fillText(item ?? "", contentWidth * alignRatio + space * spaceRatio, index * (mergedFontSize + font.fontGap * ratio));
  53201. });
  53202. }
  53203. const angle = Math.PI / 180 * Number(rotate);
  53204. const maxSize = Math.max(width, height);
  53205. const [rCtx, rCanvas, realMaxSize] = prepareCanvas(maxSize, maxSize, ratio);
  53206. rCtx.translate(realMaxSize / 2, realMaxSize / 2);
  53207. rCtx.rotate(angle);
  53208. if (contentWidth > 0 && contentHeight > 0) rCtx.drawImage(canvas, -contentWidth / 2, -contentHeight / 2);
  53209. function getRotatePos(x, y) {
  53210. return [x * Math.cos(angle) - y * Math.sin(angle), x * Math.sin(angle) + y * Math.cos(angle)];
  53211. }
  53212. let left = 0;
  53213. let right = 0;
  53214. let top = 0;
  53215. let bottom = 0;
  53216. const halfWidth = contentWidth / 2;
  53217. const halfHeight = contentHeight / 2;
  53218. [
  53219. [0 - halfWidth, 0 - halfHeight],
  53220. [0 + halfWidth, 0 - halfHeight],
  53221. [0 + halfWidth, 0 + halfHeight],
  53222. [0 - halfWidth, 0 + halfHeight]
  53223. ].forEach(([x, y]) => {
  53224. const [targetX, targetY] = getRotatePos(x, y);
  53225. left = Math.min(left, targetX);
  53226. right = Math.max(right, targetX);
  53227. top = Math.min(top, targetY);
  53228. bottom = Math.max(bottom, targetY);
  53229. });
  53230. const cutLeft = left + realMaxSize / 2;
  53231. const cutTop = top + realMaxSize / 2;
  53232. const cutWidth = right - left;
  53233. const cutHeight = bottom - top;
  53234. const realGapX = gapX * ratio;
  53235. const realGapY = gapY * ratio;
  53236. const filledWidth = (cutWidth + realGapX) * 2;
  53237. const filledHeight = cutHeight + realGapY;
  53238. const [fCtx, fCanvas] = prepareCanvas(filledWidth, filledHeight);
  53239. function drawImg(targetX = 0, targetY = 0) {
  53240. fCtx.drawImage(rCanvas, cutLeft, cutTop, cutWidth, cutHeight, targetX, targetY + baselineOffset, cutWidth, cutHeight);
  53241. }
  53242. drawImg();
  53243. drawImg(cutWidth + realGapX, -cutHeight / 2 - realGapY / 2);
  53244. drawImg(cutWidth + realGapX, +cutHeight / 2 + realGapY / 2);
  53245. return [
  53246. fCanvas.toDataURL(),
  53247. filledWidth / ratio,
  53248. filledHeight / ratio
  53249. ];
  53250. }
  53251. return getClips;
  53252. }
  53253. //#endregion
  53254. //#region ../../packages/components/watermark/src/watermark.vue?vue&type=script&setup=true&lang.ts
  53255. var watermark_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  53256. name: "ElWatermark",
  53257. __name: "watermark",
  53258. props: watermarkProps,
  53259. setup(__props) {
  53260. const style = { position: "relative" };
  53261. const props = __props;
  53262. const fontGap = (0, vue.computed)(() => props.font?.fontGap ?? 3);
  53263. const color = (0, vue.computed)(() => props.font?.color ?? "rgba(0,0,0,.15)");
  53264. const fontSize = (0, vue.computed)(() => props.font?.fontSize ?? 16);
  53265. const fontWeight = (0, vue.computed)(() => props.font?.fontWeight ?? "normal");
  53266. const fontStyle = (0, vue.computed)(() => props.font?.fontStyle ?? "normal");
  53267. const fontFamily = (0, vue.computed)(() => props.font?.fontFamily ?? "sans-serif");
  53268. const textAlign = (0, vue.computed)(() => props.font?.textAlign ?? "center");
  53269. const textBaseline = (0, vue.computed)(() => props.font?.textBaseline ?? "hanging");
  53270. const gapX = (0, vue.computed)(() => props.gap[0]);
  53271. const gapY = (0, vue.computed)(() => props.gap[1]);
  53272. const gapXCenter = (0, vue.computed)(() => gapX.value / 2);
  53273. const gapYCenter = (0, vue.computed)(() => gapY.value / 2);
  53274. const offsetLeft = (0, vue.computed)(() => props.offset?.[0] ?? gapXCenter.value);
  53275. const offsetTop = (0, vue.computed)(() => props.offset?.[1] ?? gapYCenter.value);
  53276. const getMarkStyle = () => {
  53277. const markStyle = {
  53278. zIndex: props.zIndex,
  53279. position: "absolute",
  53280. left: 0,
  53281. top: 0,
  53282. width: "100%",
  53283. height: "100%",
  53284. pointerEvents: "none",
  53285. backgroundRepeat: "repeat"
  53286. };
  53287. /** Calculate the style of the offset */
  53288. let positionLeft = offsetLeft.value - gapXCenter.value;
  53289. let positionTop = offsetTop.value - gapYCenter.value;
  53290. if (positionLeft > 0) {
  53291. markStyle.left = `${positionLeft}px`;
  53292. markStyle.width = `calc(100% - ${positionLeft}px)`;
  53293. positionLeft = 0;
  53294. }
  53295. if (positionTop > 0) {
  53296. markStyle.top = `${positionTop}px`;
  53297. markStyle.height = `calc(100% - ${positionTop}px)`;
  53298. positionTop = 0;
  53299. }
  53300. markStyle.backgroundPosition = `${positionLeft}px ${positionTop}px`;
  53301. return markStyle;
  53302. };
  53303. const containerRef = (0, vue.shallowRef)(null);
  53304. const watermarkRef = (0, vue.shallowRef)();
  53305. const stopObservation = (0, vue.ref)(false);
  53306. const destroyWatermark = () => {
  53307. if (watermarkRef.value) {
  53308. watermarkRef.value.remove();
  53309. watermarkRef.value = void 0;
  53310. }
  53311. };
  53312. const appendWatermark = (base64Url, markWidth) => {
  53313. if (containerRef.value && watermarkRef.value) {
  53314. stopObservation.value = true;
  53315. watermarkRef.value.setAttribute("style", getStyleStr({
  53316. ...getMarkStyle(),
  53317. backgroundImage: `url('${base64Url}')`,
  53318. backgroundSize: `${Math.floor(markWidth)}px`
  53319. }));
  53320. containerRef.value?.append(watermarkRef.value);
  53321. setTimeout(() => {
  53322. stopObservation.value = false;
  53323. });
  53324. }
  53325. };
  53326. /**
  53327. * Get the width and height of the watermark. The default values are as follows
  53328. * Image: [120, 64]; Content: It's calculated by content;
  53329. */
  53330. const getMarkSize = (ctx) => {
  53331. let defaultWidth = 120;
  53332. let defaultHeight = 64;
  53333. let space = 0;
  53334. const { image, content, width, height, rotate } = props;
  53335. if (!image && ctx.measureText) {
  53336. ctx.font = `${Number(fontSize.value)}px ${fontFamily.value}`;
  53337. const contents = isArray$1(content) ? content : [content];
  53338. let maxWidth = 0;
  53339. let maxHeight = 0;
  53340. contents.forEach((item) => {
  53341. const { width, fontBoundingBoxAscent, fontBoundingBoxDescent, actualBoundingBoxAscent, actualBoundingBoxDescent } = ctx.measureText(item);
  53342. const height = isUndefined(fontBoundingBoxAscent) ? actualBoundingBoxAscent + actualBoundingBoxDescent : fontBoundingBoxAscent + fontBoundingBoxDescent;
  53343. if (width > maxWidth) maxWidth = Math.ceil(width);
  53344. if (height > maxHeight) maxHeight = Math.ceil(height);
  53345. });
  53346. defaultWidth = maxWidth;
  53347. defaultHeight = maxHeight * contents.length + (contents.length - 1) * fontGap.value;
  53348. const angle = Math.PI / 180 * Number(rotate);
  53349. space = Math.ceil(Math.abs(Math.sin(angle) * defaultHeight) / 2);
  53350. defaultWidth += space;
  53351. }
  53352. return [
  53353. width ?? defaultWidth,
  53354. height ?? defaultHeight,
  53355. space
  53356. ];
  53357. };
  53358. const getClips = useClips();
  53359. const renderWatermark = () => {
  53360. const ctx = document.createElement("canvas").getContext("2d");
  53361. const image = props.image;
  53362. const content = props.content;
  53363. const rotate = props.rotate;
  53364. if (ctx) {
  53365. if (!watermarkRef.value) watermarkRef.value = document.createElement("div");
  53366. const ratio = getPixelRatio();
  53367. const [markWidth, markHeight, space] = getMarkSize(ctx);
  53368. const drawCanvas = (drawContent) => {
  53369. const [textClips, clipWidth] = getClips(drawContent || "", rotate, ratio, markWidth, markHeight, {
  53370. color: color.value,
  53371. fontSize: fontSize.value,
  53372. fontStyle: fontStyle.value,
  53373. fontWeight: fontWeight.value,
  53374. fontFamily: fontFamily.value,
  53375. fontGap: fontGap.value,
  53376. textAlign: textAlign.value,
  53377. textBaseline: textBaseline.value
  53378. }, gapX.value, gapY.value, space);
  53379. appendWatermark(textClips, clipWidth);
  53380. };
  53381. if (image) {
  53382. const img = new Image();
  53383. img.onload = () => {
  53384. drawCanvas(img);
  53385. };
  53386. img.onerror = () => {
  53387. drawCanvas(content);
  53388. };
  53389. img.crossOrigin = "anonymous";
  53390. img.referrerPolicy = "no-referrer";
  53391. img.src = image;
  53392. } else drawCanvas(content);
  53393. }
  53394. };
  53395. (0, vue.onMounted)(() => {
  53396. renderWatermark();
  53397. });
  53398. (0, vue.watch)(() => props, () => {
  53399. renderWatermark();
  53400. }, {
  53401. deep: true,
  53402. flush: "post"
  53403. });
  53404. (0, vue.onBeforeUnmount)(() => {
  53405. destroyWatermark();
  53406. });
  53407. const onMutate = (mutations) => {
  53408. if (stopObservation.value) return;
  53409. mutations.forEach((mutation) => {
  53410. if (reRendering(mutation, watermarkRef.value)) {
  53411. destroyWatermark();
  53412. renderWatermark();
  53413. }
  53414. });
  53415. };
  53416. useMutationObserver(containerRef, onMutate, {
  53417. attributes: true,
  53418. subtree: true,
  53419. childList: true
  53420. });
  53421. return (_ctx, _cache) => {
  53422. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  53423. ref_key: "containerRef",
  53424. ref: containerRef,
  53425. style: (0, vue.normalizeStyle)([style])
  53426. }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 4);
  53427. };
  53428. }
  53429. });
  53430. //#endregion
  53431. //#region ../../packages/components/watermark/src/watermark.vue
  53432. var watermark_default = watermark_vue_vue_type_script_setup_true_lang_default;
  53433. //#endregion
  53434. //#region ../../packages/components/watermark/index.ts
  53435. const ElWatermark = withInstall(watermark_default);
  53436. //#endregion
  53437. //#region ../../packages/components/tour/src/content.ts
  53438. const tourStrategies = ["absolute", "fixed"];
  53439. const tourPlacements = [
  53440. "top-start",
  53441. "top-end",
  53442. "top",
  53443. "bottom-start",
  53444. "bottom-end",
  53445. "bottom",
  53446. "left-start",
  53447. "left-end",
  53448. "left",
  53449. "right-start",
  53450. "right-end",
  53451. "right"
  53452. ];
  53453. /**
  53454. * @deprecated Removed after 3.0.0, Use `TourContentProps` instead.
  53455. */
  53456. const tourContentProps = buildProps({
  53457. placement: {
  53458. type: definePropType(String),
  53459. values: tourPlacements,
  53460. default: "bottom"
  53461. },
  53462. reference: {
  53463. type: definePropType(Object),
  53464. default: null
  53465. },
  53466. strategy: {
  53467. type: definePropType(String),
  53468. values: tourStrategies,
  53469. default: "absolute"
  53470. },
  53471. offset: {
  53472. type: Number,
  53473. default: 10
  53474. },
  53475. showArrow: Boolean,
  53476. zIndex: {
  53477. type: Number,
  53478. default: 2001
  53479. }
  53480. });
  53481. const tourContentEmits = { close: () => true };
  53482. //#endregion
  53483. //#region ../../packages/components/tour/src/tour.ts
  53484. /**
  53485. * @deprecated Removed after 3.0.0, Use `TourProps` instead.
  53486. */
  53487. const tourProps = buildProps({
  53488. modelValue: Boolean,
  53489. current: {
  53490. type: Number,
  53491. default: 0
  53492. },
  53493. showArrow: {
  53494. type: Boolean,
  53495. default: true
  53496. },
  53497. showClose: {
  53498. type: Boolean,
  53499. default: true
  53500. },
  53501. closeIcon: { type: iconPropType },
  53502. placement: tourContentProps.placement,
  53503. contentStyle: { type: definePropType([Object]) },
  53504. mask: {
  53505. type: definePropType([Boolean, Object]),
  53506. default: true
  53507. },
  53508. gap: {
  53509. type: definePropType(Object),
  53510. default: () => ({
  53511. offset: 6,
  53512. radius: 2
  53513. })
  53514. },
  53515. zIndex: { type: Number },
  53516. scrollIntoViewOptions: {
  53517. type: definePropType([Boolean, Object]),
  53518. default: () => ({ block: "center" })
  53519. },
  53520. type: { type: definePropType(String) },
  53521. appendTo: {
  53522. type: teleportProps.to.type,
  53523. default: "body"
  53524. },
  53525. closeOnPressEscape: {
  53526. type: Boolean,
  53527. default: true
  53528. },
  53529. targetAreaClickable: {
  53530. type: Boolean,
  53531. default: true
  53532. }
  53533. });
  53534. const tourEmits = {
  53535. [UPDATE_MODEL_EVENT]: (value) => isBoolean(value),
  53536. ["update:current"]: (current) => isNumber(current),
  53537. close: (current) => isNumber(current),
  53538. finish: () => true,
  53539. change: (current) => isNumber(current)
  53540. };
  53541. //#endregion
  53542. //#region ../../packages/components/tour/src/mask.ts
  53543. /**
  53544. * @deprecated Removed after 3.0.0, Use `MaskProps` instead.
  53545. */
  53546. const maskProps = buildProps({
  53547. zIndex: {
  53548. type: Number,
  53549. default: 1001
  53550. },
  53551. visible: Boolean,
  53552. fill: {
  53553. type: String,
  53554. default: "rgba(0,0,0,0.5)"
  53555. },
  53556. pos: { type: definePropType(Object) },
  53557. targetAreaClickable: {
  53558. type: Boolean,
  53559. default: true
  53560. }
  53561. });
  53562. //#endregion
  53563. //#region ../../packages/components/tour/src/helper.ts
  53564. const useTarget = (target, open, gap, mergedMask, scrollIntoViewOptions) => {
  53565. const posInfo = (0, vue.ref)(null);
  53566. const getTargetEl = () => {
  53567. let targetEl;
  53568. if (isString(target.value)) targetEl = document.querySelector(target.value);
  53569. else if (isFunction$1(target.value)) targetEl = target.value();
  53570. else targetEl = target.value;
  53571. return targetEl;
  53572. };
  53573. const updatePosInfo = () => {
  53574. const targetEl = getTargetEl();
  53575. if (!targetEl || !open.value) {
  53576. posInfo.value = null;
  53577. return;
  53578. }
  53579. if (!isInViewPort(targetEl)) targetEl.scrollIntoView(scrollIntoViewOptions.value);
  53580. const { left, top, width, height } = targetEl.getBoundingClientRect();
  53581. posInfo.value = {
  53582. left,
  53583. top,
  53584. width,
  53585. height,
  53586. radius: 0
  53587. };
  53588. };
  53589. (0, vue.onMounted)(() => {
  53590. (0, vue.watch)([open, target], () => {
  53591. updatePosInfo();
  53592. }, { immediate: true });
  53593. window.addEventListener("resize", updatePosInfo);
  53594. });
  53595. (0, vue.onBeforeUnmount)(() => {
  53596. window.removeEventListener("resize", updatePosInfo);
  53597. });
  53598. const getGapOffset = (index) => (isArray$1(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ?? 6;
  53599. const mergedPosInfo = (0, vue.computed)(() => {
  53600. if (!posInfo.value) return posInfo.value;
  53601. const gapOffsetX = getGapOffset(0);
  53602. const gapOffsetY = getGapOffset(1);
  53603. const gapRadius = gap.value?.radius || 2;
  53604. return {
  53605. left: posInfo.value.left - gapOffsetX,
  53606. top: posInfo.value.top - gapOffsetY,
  53607. width: posInfo.value.width + gapOffsetX * 2,
  53608. height: posInfo.value.height + gapOffsetY * 2,
  53609. radius: gapRadius
  53610. };
  53611. });
  53612. return {
  53613. mergedPosInfo,
  53614. triggerTarget: (0, vue.computed)(() => {
  53615. const targetEl = getTargetEl();
  53616. if (!mergedMask.value || !targetEl || !window.DOMRect) return targetEl || void 0;
  53617. return { getBoundingClientRect() {
  53618. return window.DOMRect.fromRect({
  53619. width: mergedPosInfo.value?.width || 0,
  53620. height: mergedPosInfo.value?.height || 0,
  53621. x: mergedPosInfo.value?.left || 0,
  53622. y: mergedPosInfo.value?.top || 0
  53623. });
  53624. } };
  53625. })
  53626. };
  53627. };
  53628. const tourKey = Symbol("ElTour");
  53629. function isInViewPort(element) {
  53630. const viewWidth = window.innerWidth || document.documentElement.clientWidth;
  53631. const viewHeight = window.innerHeight || document.documentElement.clientHeight;
  53632. const { top, right, bottom, left } = element.getBoundingClientRect();
  53633. return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight;
  53634. }
  53635. const useFloating$1 = (referenceRef, contentRef, arrowRef, placement, strategy, offset$2, zIndex, showArrow) => {
  53636. const x = (0, vue.ref)();
  53637. const y = (0, vue.ref)();
  53638. const middlewareData = (0, vue.ref)({});
  53639. const states = {
  53640. x,
  53641. y,
  53642. placement,
  53643. strategy,
  53644. middlewareData
  53645. };
  53646. const middleware = (0, vue.computed)(() => {
  53647. const _middleware = [
  53648. offset((0, vue.unref)(offset$2)),
  53649. flip(),
  53650. shift(),
  53651. overflowMiddleware()
  53652. ];
  53653. if ((0, vue.unref)(showArrow) && (0, vue.unref)(arrowRef)) _middleware.push(arrow({ element: (0, vue.unref)(arrowRef) }));
  53654. return _middleware;
  53655. });
  53656. const update = async () => {
  53657. if (!isClient) return;
  53658. const referenceEl = (0, vue.unref)(referenceRef);
  53659. const contentEl = (0, vue.unref)(contentRef);
  53660. if (!referenceEl || !contentEl) return;
  53661. const data = await computePosition(referenceEl, contentEl, {
  53662. placement: (0, vue.unref)(placement),
  53663. strategy: (0, vue.unref)(strategy),
  53664. middleware: (0, vue.unref)(middleware)
  53665. });
  53666. keysOf(states).forEach((key) => {
  53667. states[key].value = data[key];
  53668. });
  53669. };
  53670. const contentStyle = (0, vue.computed)(() => {
  53671. if (!(0, vue.unref)(referenceRef)) return {
  53672. position: "fixed",
  53673. top: "50%",
  53674. left: "50%",
  53675. transform: "translate3d(-50%, -50%, 0)",
  53676. maxWidth: "100vw",
  53677. zIndex: (0, vue.unref)(zIndex)
  53678. };
  53679. const { overflow } = (0, vue.unref)(middlewareData);
  53680. return {
  53681. position: (0, vue.unref)(strategy),
  53682. zIndex: (0, vue.unref)(zIndex),
  53683. top: (0, vue.unref)(y) != null ? `${(0, vue.unref)(y)}px` : "",
  53684. left: (0, vue.unref)(x) != null ? `${(0, vue.unref)(x)}px` : "",
  53685. maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : ""
  53686. };
  53687. });
  53688. const arrowStyle = (0, vue.computed)(() => {
  53689. if (!(0, vue.unref)(showArrow)) return {};
  53690. const { arrow } = (0, vue.unref)(middlewareData);
  53691. return {
  53692. left: arrow?.x != null ? `${arrow?.x}px` : "",
  53693. top: arrow?.y != null ? `${arrow?.y}px` : ""
  53694. };
  53695. });
  53696. let cleanup;
  53697. (0, vue.onMounted)(() => {
  53698. const referenceEl = (0, vue.unref)(referenceRef);
  53699. const contentEl = (0, vue.unref)(contentRef);
  53700. if (referenceEl && contentEl) cleanup = autoUpdate(referenceEl, contentEl, update);
  53701. (0, vue.watchEffect)(() => {
  53702. update();
  53703. });
  53704. });
  53705. (0, vue.onBeforeUnmount)(() => {
  53706. cleanup && cleanup();
  53707. });
  53708. return {
  53709. update,
  53710. contentStyle,
  53711. arrowStyle
  53712. };
  53713. };
  53714. const overflowMiddleware = () => {
  53715. return {
  53716. name: "overflow",
  53717. async fn(state) {
  53718. const overflow = await detectOverflow(state);
  53719. let overWidth = 0;
  53720. if (overflow.left > 0) overWidth = overflow.left;
  53721. if (overflow.right > 0) overWidth = overflow.right;
  53722. return { data: { maxWidth: state.rects.floating.width - overWidth } };
  53723. }
  53724. };
  53725. };
  53726. //#endregion
  53727. //#region ../../packages/components/tour/src/mask.vue?vue&type=script&setup=true&lang.ts
  53728. const _hoisted_1$8 = { style: {
  53729. width: "100%",
  53730. height: "100%"
  53731. } };
  53732. const _hoisted_2$4 = ["d"];
  53733. var mask_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  53734. name: "ElTourMask",
  53735. inheritAttrs: false,
  53736. __name: "mask",
  53737. props: maskProps,
  53738. setup(__props) {
  53739. const props = __props;
  53740. const { ns } = (0, vue.inject)(tourKey);
  53741. const radius = (0, vue.computed)(() => props.pos?.radius ?? 2);
  53742. const roundInfo = (0, vue.computed)(() => {
  53743. const v = radius.value;
  53744. const baseInfo = `a${v},${v} 0 0 1`;
  53745. return {
  53746. topRight: `${baseInfo} ${v},${v}`,
  53747. bottomRight: `${baseInfo} ${-v},${v}`,
  53748. bottomLeft: `${baseInfo} ${-v},${-v}`,
  53749. topLeft: `${baseInfo} ${v},${-v}`
  53750. };
  53751. });
  53752. const { width: windowWidth, height: windowHeight } = useWindowSize();
  53753. const path = (0, vue.computed)(() => {
  53754. const width = windowWidth.value;
  53755. const height = windowHeight.value;
  53756. const info = roundInfo.value;
  53757. const _path = `M${width},0 L0,0 L0,${height} L${width},${height} L${width},0 Z`;
  53758. const _radius = radius.value;
  53759. return props.pos ? `${_path} M${props.pos.left + _radius},${props.pos.top} h${props.pos.width - _radius * 2} ${info.topRight} v${props.pos.height - _radius * 2} ${info.bottomRight} h${-props.pos.width + _radius * 2} ${info.bottomLeft} v${-props.pos.height + _radius * 2} ${info.topLeft} z` : _path;
  53760. });
  53761. const maskStyle = (0, vue.computed)(() => ({
  53762. position: "fixed",
  53763. left: 0,
  53764. right: 0,
  53765. top: 0,
  53766. bottom: 0,
  53767. zIndex: props.zIndex,
  53768. pointerEvents: props.pos && props.targetAreaClickable ? "none" : "auto"
  53769. }));
  53770. const pathStyle = (0, vue.computed)(() => ({
  53771. fill: props.fill,
  53772. pointerEvents: "auto",
  53773. cursor: "auto"
  53774. }));
  53775. useLockscreen((0, vue.toRef)(props, "visible"), { ns });
  53776. return (_ctx, _cache) => {
  53777. return __props.visible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", (0, vue.mergeProps)({
  53778. key: 0,
  53779. class: (0, vue.unref)(ns).e("mask"),
  53780. style: maskStyle.value
  53781. }, _ctx.$attrs), [((0, vue.openBlock)(), (0, vue.createElementBlock)("svg", _hoisted_1$8, [(0, vue.createElementVNode)("path", {
  53782. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("hollow")),
  53783. style: (0, vue.normalizeStyle)(pathStyle.value),
  53784. d: path.value
  53785. }, null, 14, _hoisted_2$4)]))], 16)) : (0, vue.createCommentVNode)("v-if", true);
  53786. };
  53787. }
  53788. });
  53789. //#endregion
  53790. //#region ../../packages/components/tour/src/mask.vue
  53791. var mask_default = mask_vue_vue_type_script_setup_true_lang_default;
  53792. //#endregion
  53793. //#region ../../packages/components/tour/src/content.vue?vue&type=script&setup=true&lang.ts
  53794. const _hoisted_1$7 = ["data-side"];
  53795. var content_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  53796. name: "ElTourContent",
  53797. __name: "content",
  53798. props: tourContentProps,
  53799. emits: tourContentEmits,
  53800. setup(__props, { emit: __emit }) {
  53801. const props = __props;
  53802. const emit = __emit;
  53803. const placement = (0, vue.ref)(props.placement);
  53804. const strategy = (0, vue.ref)(props.strategy);
  53805. const contentRef = (0, vue.ref)(null);
  53806. const arrowRef = (0, vue.ref)(null);
  53807. (0, vue.watch)(() => props.placement, () => {
  53808. placement.value = props.placement;
  53809. });
  53810. const { contentStyle, arrowStyle } = useFloating$1((0, vue.toRef)(props, "reference"), contentRef, arrowRef, placement, strategy, (0, vue.toRef)(props, "offset"), (0, vue.toRef)(props, "zIndex"), (0, vue.toRef)(props, "showArrow"));
  53811. const side = (0, vue.computed)(() => {
  53812. return placement.value.split("-")[0];
  53813. });
  53814. const { ns } = (0, vue.inject)(tourKey);
  53815. const onCloseRequested = () => {
  53816. emit("close");
  53817. };
  53818. const onFocusoutPrevented = (event) => {
  53819. if (event.detail.focusReason === "pointer") event.preventDefault();
  53820. };
  53821. return (_ctx, _cache) => {
  53822. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  53823. ref_key: "contentRef",
  53824. ref: contentRef,
  53825. style: (0, vue.normalizeStyle)((0, vue.unref)(contentStyle)),
  53826. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")),
  53827. "data-side": side.value,
  53828. tabindex: "-1"
  53829. }, [(0, vue.createVNode)((0, vue.unref)(focus_trap_default), {
  53830. loop: "",
  53831. trapped: "",
  53832. "focus-start-el": "container",
  53833. "focus-trap-el": contentRef.value || void 0,
  53834. onReleaseRequested: onCloseRequested,
  53835. onFocusoutPrevented
  53836. }, {
  53837. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  53838. _: 3
  53839. }, 8, ["focus-trap-el"]), __props.showArrow ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  53840. key: 0,
  53841. ref_key: "arrowRef",
  53842. ref: arrowRef,
  53843. style: (0, vue.normalizeStyle)((0, vue.unref)(arrowStyle)),
  53844. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("arrow"))
  53845. }, null, 6)) : (0, vue.createCommentVNode)("v-if", true)], 14, _hoisted_1$7);
  53846. };
  53847. }
  53848. });
  53849. //#endregion
  53850. //#region ../../packages/components/tour/src/content.vue
  53851. var content_default$1 = content_vue_vue_type_script_setup_true_lang_default;
  53852. //#endregion
  53853. //#region ../../packages/components/tour/src/steps.ts
  53854. var steps_default = (0, vue.defineComponent)({
  53855. name: "ElTourSteps",
  53856. props: { current: {
  53857. type: Number,
  53858. default: 0
  53859. } },
  53860. emits: ["update-total"],
  53861. setup(props, { slots, emit }) {
  53862. let cacheTotal = 0;
  53863. return () => {
  53864. const children = slots.default?.();
  53865. const result = [];
  53866. let total = 0;
  53867. function filterSteps(children) {
  53868. if (!isArray$1(children)) return;
  53869. children.forEach((item) => {
  53870. if ((item?.type || {})?.name === "ElTourStep") {
  53871. result.push(item);
  53872. total += 1;
  53873. }
  53874. });
  53875. }
  53876. if (children.length) filterSteps(flattedChildren(children[0]?.children));
  53877. if (cacheTotal !== total) {
  53878. cacheTotal = total;
  53879. emit("update-total", total);
  53880. }
  53881. if (result.length) return result[props.current];
  53882. return null;
  53883. };
  53884. }
  53885. });
  53886. //#endregion
  53887. //#region ../../packages/components/tour/src/tour.vue?vue&type=script&setup=true&lang.ts
  53888. var tour_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  53889. name: "ElTour",
  53890. inheritAttrs: false,
  53891. __name: "tour",
  53892. props: tourProps,
  53893. emits: tourEmits,
  53894. setup(__props, { emit: __emit }) {
  53895. const props = __props;
  53896. const emit = __emit;
  53897. const ns = useNamespace("tour");
  53898. const total = (0, vue.ref)(0);
  53899. const currentStep = (0, vue.ref)();
  53900. const current = useVModel(props, "current", emit, { passive: true });
  53901. const currentTarget = (0, vue.computed)(() => currentStep.value?.target);
  53902. const kls = (0, vue.computed)(() => [ns.b(), mergedType.value === "primary" ? ns.m("primary") : ""]);
  53903. const mergedPlacement = (0, vue.computed)(() => currentStep.value?.placement || props.placement);
  53904. const mergedContentStyle = (0, vue.computed)(() => currentStep.value?.contentStyle ?? props.contentStyle);
  53905. const mergedMask = (0, vue.computed)(() => currentStep.value?.mask ?? props.mask);
  53906. const mergedShowMask = (0, vue.computed)(() => !!mergedMask.value && props.modelValue);
  53907. const mergedMaskStyle = (0, vue.computed)(() => isBoolean(mergedMask.value) ? void 0 : mergedMask.value);
  53908. const mergedShowArrow = (0, vue.computed)(() => !!currentTarget.value && (currentStep.value?.showArrow ?? props.showArrow));
  53909. const mergedScrollIntoViewOptions = (0, vue.computed)(() => currentStep.value?.scrollIntoViewOptions ?? props.scrollIntoViewOptions);
  53910. const mergedType = (0, vue.computed)(() => currentStep.value?.type ?? props.type);
  53911. const { nextZIndex } = useZIndex();
  53912. const nowZIndex = nextZIndex();
  53913. const mergedZIndex = (0, vue.computed)(() => props.zIndex ?? nowZIndex);
  53914. const { mergedPosInfo: pos, triggerTarget } = useTarget(currentTarget, (0, vue.toRef)(props, "modelValue"), (0, vue.toRef)(props, "gap"), mergedMask, mergedScrollIntoViewOptions);
  53915. (0, vue.watch)(() => props.modelValue, (val) => {
  53916. if (!val) current.value = 0;
  53917. });
  53918. const onEscClose = () => {
  53919. if (props.closeOnPressEscape) {
  53920. emit(UPDATE_MODEL_EVENT, false);
  53921. emit("close", current.value);
  53922. }
  53923. };
  53924. const onUpdateTotal = (val) => {
  53925. total.value = val;
  53926. };
  53927. const slots = (0, vue.useSlots)();
  53928. (0, vue.provide)(tourKey, {
  53929. currentStep,
  53930. current,
  53931. total,
  53932. showClose: (0, vue.toRef)(props, "showClose"),
  53933. closeIcon: (0, vue.toRef)(props, "closeIcon"),
  53934. mergedType,
  53935. ns,
  53936. slots,
  53937. updateModelValue(modelValue) {
  53938. emit(UPDATE_MODEL_EVENT, modelValue);
  53939. },
  53940. onClose() {
  53941. emit("close", current.value);
  53942. },
  53943. onFinish() {
  53944. emit("finish");
  53945. },
  53946. onChange() {
  53947. emit(CHANGE_EVENT, current.value);
  53948. }
  53949. });
  53950. return (_ctx, _cache) => {
  53951. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [
  53952. (0, vue.createVNode)((0, vue.unref)(ElTeleport), { to: __props.appendTo }, {
  53953. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", (0, vue.mergeProps)({ class: kls.value }, _ctx.$attrs), [(0, vue.createVNode)(mask_default, {
  53954. visible: mergedShowMask.value,
  53955. fill: mergedMaskStyle.value?.color,
  53956. style: (0, vue.normalizeStyle)(mergedMaskStyle.value?.style),
  53957. pos: (0, vue.unref)(pos),
  53958. "z-index": mergedZIndex.value,
  53959. "target-area-clickable": __props.targetAreaClickable
  53960. }, null, 8, [
  53961. "visible",
  53962. "fill",
  53963. "style",
  53964. "pos",
  53965. "z-index",
  53966. "target-area-clickable"
  53967. ]), __props.modelValue ? ((0, vue.openBlock)(), (0, vue.createBlock)(content_default$1, {
  53968. key: (0, vue.unref)(current),
  53969. reference: (0, vue.unref)(triggerTarget),
  53970. placement: mergedPlacement.value,
  53971. "show-arrow": mergedShowArrow.value,
  53972. "z-index": mergedZIndex.value,
  53973. style: (0, vue.normalizeStyle)(mergedContentStyle.value),
  53974. onClose: onEscClose
  53975. }, {
  53976. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(steps_default), {
  53977. current: (0, vue.unref)(current),
  53978. onUpdateTotal
  53979. }, {
  53980. default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default")]),
  53981. _: 3
  53982. }, 8, ["current"])]),
  53983. _: 3
  53984. }, 8, [
  53985. "reference",
  53986. "placement",
  53987. "show-arrow",
  53988. "z-index",
  53989. "style"
  53990. ])) : (0, vue.createCommentVNode)("v-if", true)], 16)]),
  53991. _: 3
  53992. }, 8, ["to"]),
  53993. (0, vue.createCommentVNode)(" just for IDE "),
  53994. (0, vue.createCommentVNode)("v-if", true)
  53995. ], 64);
  53996. };
  53997. }
  53998. });
  53999. //#endregion
  54000. //#region ../../packages/components/tour/src/tour.vue
  54001. var tour_default = tour_vue_vue_type_script_setup_true_lang_default;
  54002. //#endregion
  54003. //#region ../../packages/components/tour/src/step.ts
  54004. /**
  54005. * @deprecated Removed after 3.0.0, Use `TourStepProps` instead.
  54006. */
  54007. const tourStepProps = buildProps({
  54008. target: { type: definePropType([
  54009. String,
  54010. Object,
  54011. Function
  54012. ]) },
  54013. title: String,
  54014. description: String,
  54015. showClose: {
  54016. type: Boolean,
  54017. default: void 0
  54018. },
  54019. closeIcon: { type: iconPropType },
  54020. showArrow: {
  54021. type: Boolean,
  54022. default: void 0
  54023. },
  54024. placement: tourContentProps.placement,
  54025. mask: {
  54026. type: definePropType([Boolean, Object]),
  54027. default: void 0
  54028. },
  54029. contentStyle: { type: definePropType([Object]) },
  54030. prevButtonProps: { type: definePropType(Object) },
  54031. nextButtonProps: { type: definePropType(Object) },
  54032. scrollIntoViewOptions: {
  54033. type: definePropType([Boolean, Object]),
  54034. default: void 0
  54035. },
  54036. type: { type: definePropType(String) }
  54037. });
  54038. const tourStepEmits = { close: () => true };
  54039. //#endregion
  54040. //#region ../../packages/components/tour/src/step.vue?vue&type=script&setup=true&lang.ts
  54041. const _hoisted_1$6 = ["aria-label"];
  54042. var step_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54043. name: "ElTourStep",
  54044. __name: "step",
  54045. props: tourStepProps,
  54046. emits: tourStepEmits,
  54047. setup(__props, { emit: __emit }) {
  54048. const props = __props;
  54049. const emit = __emit;
  54050. const { Close } = CloseComponents;
  54051. const { t } = useLocale();
  54052. const { currentStep, current, total, showClose, closeIcon, mergedType, ns, slots: tourSlots, updateModelValue, onClose: tourOnClose, onFinish: tourOnFinish, onChange } = (0, vue.inject)(tourKey);
  54053. (0, vue.watch)(props, (val) => {
  54054. currentStep.value = val;
  54055. }, { immediate: true });
  54056. const mergedShowClose = (0, vue.computed)(() => props.showClose ?? showClose.value);
  54057. const mergedCloseIcon = (0, vue.computed)(() => props.closeIcon ?? closeIcon.value ?? Close);
  54058. const filterButtonProps = (btnProps) => {
  54059. if (!btnProps) return;
  54060. return omit(btnProps, ["children", "onClick"]);
  54061. };
  54062. const onPrev = () => {
  54063. current.value -= 1;
  54064. if (props.prevButtonProps?.onClick) props.prevButtonProps?.onClick();
  54065. onChange();
  54066. };
  54067. const onNext = () => {
  54068. if (current.value >= total.value - 1) onFinish();
  54069. else current.value += 1;
  54070. if (props.nextButtonProps?.onClick) props.nextButtonProps.onClick();
  54071. onChange();
  54072. };
  54073. const onFinish = () => {
  54074. onClose();
  54075. tourOnFinish();
  54076. };
  54077. const onClose = () => {
  54078. updateModelValue(false);
  54079. tourOnClose();
  54080. emit("close");
  54081. };
  54082. const handleKeydown = (e) => {
  54083. if (e.target?.isContentEditable) return;
  54084. switch (getEventCode(e)) {
  54085. case EVENT_CODE.left:
  54086. e.preventDefault();
  54087. current.value > 0 && onPrev();
  54088. break;
  54089. case EVENT_CODE.right:
  54090. e.preventDefault();
  54091. onNext();
  54092. break;
  54093. }
  54094. };
  54095. (0, vue.onMounted)(() => {
  54096. window.addEventListener("keydown", handleKeydown);
  54097. });
  54098. (0, vue.onBeforeUnmount)(() => {
  54099. window.removeEventListener("keydown", handleKeydown);
  54100. });
  54101. return (_ctx, _cache) => {
  54102. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [
  54103. mergedShowClose.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  54104. key: 0,
  54105. "aria-label": (0, vue.unref)(t)("el.tour.close"),
  54106. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("closebtn")),
  54107. type: "button",
  54108. onClick: onClose
  54109. }, [(0, vue.createVNode)((0, vue.unref)(ElIcon), { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("close")) }, {
  54110. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(mergedCloseIcon.value)))]),
  54111. _: 1
  54112. }, 8, ["class"])], 10, _hoisted_1$6)) : (0, vue.createCommentVNode)("v-if", true),
  54113. (0, vue.createElementVNode)("header", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("header"), { "show-close": (0, vue.unref)(showClose) }]) }, [(0, vue.renderSlot)(_ctx.$slots, "header", {}, () => [(0, vue.createElementVNode)("span", {
  54114. role: "heading",
  54115. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title"))
  54116. }, (0, vue.toDisplayString)(__props.title), 3)])], 2),
  54117. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("body")) }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.description), 1)])], 2),
  54118. (0, vue.createElementVNode)("footer", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("footer")) }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("indicators")) }, [(0, vue.unref)(tourSlots).indicators ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(tourSlots).indicators), {
  54119. key: 0,
  54120. current: (0, vue.unref)(current),
  54121. total: (0, vue.unref)(total)
  54122. }, null, 8, ["current", "total"])) : ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, (0, vue.renderList)((0, vue.unref)(total), (item, index) => {
  54123. return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
  54124. key: item,
  54125. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b("indicator"), (0, vue.unref)(ns).is("active", index === (0, vue.unref)(current))])
  54126. }, null, 2);
  54127. }), 128))], 2), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("buttons")) }, [(0, vue.unref)(current) > 0 ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), (0, vue.mergeProps)({
  54128. key: 0,
  54129. size: "small",
  54130. type: (0, vue.unref)(mergedType)
  54131. }, filterButtonProps(__props.prevButtonProps), { onClick: onPrev }), {
  54132. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.prevButtonProps?.children ?? (0, vue.unref)(t)("el.tour.previous")), 1)]),
  54133. _: 1
  54134. }, 16, ["type"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.unref)(current) <= (0, vue.unref)(total) - 1 ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElButton), (0, vue.mergeProps)({
  54135. key: 1,
  54136. size: "small",
  54137. type: (0, vue.unref)(mergedType) === "primary" ? "default" : "primary"
  54138. }, filterButtonProps(__props.nextButtonProps), { onClick: onNext }), {
  54139. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.nextButtonProps?.children ?? ((0, vue.unref)(current) === (0, vue.unref)(total) - 1 ? (0, vue.unref)(t)("el.tour.finish") : (0, vue.unref)(t)("el.tour.next"))), 1)]),
  54140. _: 1
  54141. }, 16, ["type"])) : (0, vue.createCommentVNode)("v-if", true)], 2)], 2)
  54142. ], 64);
  54143. };
  54144. }
  54145. });
  54146. //#endregion
  54147. //#region ../../packages/components/tour/src/step.vue
  54148. var step_default = step_vue_vue_type_script_setup_true_lang_default;
  54149. //#endregion
  54150. //#region ../../packages/components/tour/index.ts
  54151. const ElTour = withInstall(tour_default, { TourStep: step_default });
  54152. const ElTourStep = withNoopInstall(step_default);
  54153. //#endregion
  54154. //#region ../../packages/components/anchor/src/anchor.ts
  54155. /**
  54156. * @deprecated Removed after 3.0.0, Use `AnchorProps` instead.
  54157. */
  54158. const anchorProps = buildProps({
  54159. container: { type: definePropType([String, Object]) },
  54160. offset: {
  54161. type: Number,
  54162. default: 0
  54163. },
  54164. bound: {
  54165. type: Number,
  54166. default: 15
  54167. },
  54168. duration: {
  54169. type: Number,
  54170. default: 300
  54171. },
  54172. marker: {
  54173. type: Boolean,
  54174. default: true
  54175. },
  54176. type: {
  54177. type: definePropType(String),
  54178. default: "default"
  54179. },
  54180. direction: {
  54181. type: definePropType(String),
  54182. default: "vertical"
  54183. },
  54184. selectScrollTop: Boolean
  54185. });
  54186. const anchorEmits = {
  54187. change: (href) => isString(href),
  54188. click: (e, href) => e instanceof MouseEvent && (isString(href) || isUndefined(href))
  54189. };
  54190. //#endregion
  54191. //#region ../../packages/components/anchor/src/constants.ts
  54192. const anchorKey = Symbol("anchor");
  54193. //#endregion
  54194. //#region ../../packages/components/anchor/src/anchor.vue?vue&type=script&setup=true&lang.ts
  54195. var anchor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54196. name: "ElAnchor",
  54197. __name: "anchor",
  54198. props: anchorProps,
  54199. emits: anchorEmits,
  54200. setup(__props, { expose: __expose, emit: __emit }) {
  54201. const props = __props;
  54202. const emit = __emit;
  54203. const slots = (0, vue.useSlots)();
  54204. const currentAnchor = (0, vue.ref)("");
  54205. const markerStyle = (0, vue.ref)({});
  54206. const anchorRef = (0, vue.ref)(null);
  54207. const markerRef = (0, vue.ref)(null);
  54208. const containerEl = (0, vue.ref)();
  54209. const links = {};
  54210. let isScrolling = false;
  54211. let currentScrollTop = 0;
  54212. const ns = useNamespace("anchor");
  54213. const cls = (0, vue.computed)(() => [
  54214. ns.b(),
  54215. props.type === "underline" ? ns.m("underline") : "",
  54216. ns.m(props.direction)
  54217. ]);
  54218. const addLink = (state) => {
  54219. links[state.href] = state.el;
  54220. };
  54221. const removeLink = (href) => {
  54222. delete links[href];
  54223. };
  54224. const setCurrentAnchor = (href) => {
  54225. if (currentAnchor.value !== href) {
  54226. currentAnchor.value = href;
  54227. emit(CHANGE_EVENT, href);
  54228. }
  54229. };
  54230. let clearAnimate = null;
  54231. let currentTargetHref = "";
  54232. const scrollToAnchor = (href) => {
  54233. if (!containerEl.value) return;
  54234. const target = getElement(href);
  54235. if (!target) return;
  54236. if (clearAnimate) {
  54237. if (currentTargetHref === href) return;
  54238. clearAnimate();
  54239. }
  54240. currentTargetHref = href;
  54241. isScrolling = true;
  54242. const scrollEle = getScrollElement(target, containerEl.value);
  54243. const distance = getOffsetTopDistance(target, scrollEle);
  54244. const max = scrollEle.scrollHeight - scrollEle.clientHeight;
  54245. const to = Math.min(distance - props.offset, max);
  54246. clearAnimate = animateScrollTo(containerEl.value, currentScrollTop, to, props.duration, () => {
  54247. setTimeout(() => {
  54248. isScrolling = false;
  54249. currentTargetHref = "";
  54250. }, 20);
  54251. });
  54252. };
  54253. const scrollTo = (href) => {
  54254. if (href) {
  54255. setCurrentAnchor(href);
  54256. scrollToAnchor(href);
  54257. }
  54258. };
  54259. const handleClick = (e, href) => {
  54260. emit("click", e, href);
  54261. scrollTo(href);
  54262. };
  54263. const handleScroll = throttleByRaf(() => {
  54264. if (containerEl.value) currentScrollTop = getScrollTop(containerEl.value);
  54265. const currentHref = getCurrentHref();
  54266. if (isScrolling || isUndefined(currentHref)) return;
  54267. setCurrentAnchor(currentHref);
  54268. });
  54269. const getCurrentHref = () => {
  54270. if (!containerEl.value) return;
  54271. const scrollTop = getScrollTop(containerEl.value);
  54272. const anchorTopList = [];
  54273. for (const href of Object.keys(links)) {
  54274. const target = getElement(href);
  54275. if (!target) continue;
  54276. const distance = getOffsetTopDistance(target, getScrollElement(target, containerEl.value));
  54277. anchorTopList.push({
  54278. top: distance - props.offset - props.bound,
  54279. href
  54280. });
  54281. }
  54282. anchorTopList.sort((prev, next) => prev.top - next.top);
  54283. for (let i = 0; i < anchorTopList.length; i++) {
  54284. const item = anchorTopList[i];
  54285. const next = anchorTopList[i + 1];
  54286. if (i === 0 && scrollTop === 0) return props.selectScrollTop ? item.href : "";
  54287. if (item.top <= scrollTop && (!next || next.top > scrollTop)) return item.href;
  54288. }
  54289. };
  54290. const getContainer = () => {
  54291. const el = getElement(props.container);
  54292. if (!el || isWindow(el)) containerEl.value = window;
  54293. else containerEl.value = el;
  54294. };
  54295. useEventListener(containerEl, "scroll", handleScroll);
  54296. const updateMarkerStyle = () => {
  54297. (0, vue.nextTick)(() => {
  54298. if (!anchorRef.value || !markerRef.value || !currentAnchor.value) {
  54299. markerStyle.value = {};
  54300. return;
  54301. }
  54302. const currentLinkEl = links[currentAnchor.value];
  54303. if (!currentLinkEl) {
  54304. markerStyle.value = {};
  54305. return;
  54306. }
  54307. const anchorRect = anchorRef.value.getBoundingClientRect();
  54308. const markerRect = markerRef.value.getBoundingClientRect();
  54309. const linkRect = currentLinkEl.getBoundingClientRect();
  54310. if (props.direction === "horizontal") markerStyle.value = {
  54311. left: `${linkRect.left - anchorRect.left}px`,
  54312. width: `${linkRect.width}px`,
  54313. opacity: 1
  54314. };
  54315. else markerStyle.value = {
  54316. top: `${linkRect.top - anchorRect.top + (linkRect.height - markerRect.height) / 2}px`,
  54317. opacity: 1
  54318. };
  54319. });
  54320. };
  54321. (0, vue.watch)(currentAnchor, updateMarkerStyle);
  54322. (0, vue.watch)(() => slots.default?.(), updateMarkerStyle);
  54323. (0, vue.onMounted)(() => {
  54324. getContainer();
  54325. const hash = decodeURIComponent(window.location.hash);
  54326. if (getElement(hash)) scrollTo(hash);
  54327. else handleScroll();
  54328. });
  54329. (0, vue.watch)(() => props.container, () => {
  54330. getContainer();
  54331. });
  54332. (0, vue.provide)(anchorKey, {
  54333. ns,
  54334. direction: props.direction,
  54335. currentAnchor,
  54336. addLink,
  54337. removeLink,
  54338. handleClick
  54339. });
  54340. __expose({ scrollTo });
  54341. return (_ctx, _cache) => {
  54342. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54343. ref_key: "anchorRef",
  54344. ref: anchorRef,
  54345. class: (0, vue.normalizeClass)(cls.value)
  54346. }, [__props.marker ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54347. key: 0,
  54348. ref_key: "markerRef",
  54349. ref: markerRef,
  54350. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("marker")),
  54351. style: (0, vue.normalizeStyle)(markerStyle.value)
  54352. }, null, 6)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("list")) }, [(0, vue.renderSlot)(_ctx.$slots, "default")], 2)], 2);
  54353. };
  54354. }
  54355. });
  54356. //#endregion
  54357. //#region ../../packages/components/anchor/src/anchor.vue
  54358. var anchor_default = anchor_vue_vue_type_script_setup_true_lang_default;
  54359. //#endregion
  54360. //#region ../../packages/components/anchor/src/anchor-link.ts
  54361. /**
  54362. * @deprecated Removed after 3.0.0, Use `AnchorLinkProps` instead.
  54363. */
  54364. const anchorLinkProps = buildProps({
  54365. title: String,
  54366. href: String
  54367. });
  54368. //#endregion
  54369. //#region ../../packages/components/anchor/src/anchor-link.vue?vue&type=script&setup=true&lang.ts
  54370. const _hoisted_1$5 = ["href"];
  54371. var anchor_link_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54372. name: "ElAnchorLink",
  54373. __name: "anchor-link",
  54374. props: anchorLinkProps,
  54375. setup(__props) {
  54376. const props = __props;
  54377. const linkRef = (0, vue.ref)(null);
  54378. const { ns, direction, currentAnchor, addLink, removeLink, handleClick: contextHandleClick } = (0, vue.inject)(anchorKey);
  54379. const cls = (0, vue.computed)(() => [ns.e("link"), ns.is("active", currentAnchor.value === props.href)]);
  54380. const handleClick = (e) => {
  54381. contextHandleClick(e, props.href);
  54382. };
  54383. (0, vue.watch)(() => props.href, (val, oldVal) => {
  54384. (0, vue.nextTick)(() => {
  54385. if (oldVal) removeLink(oldVal);
  54386. if (val) addLink({
  54387. href: val,
  54388. el: linkRef.value
  54389. });
  54390. });
  54391. });
  54392. (0, vue.onMounted)(() => {
  54393. const { href } = props;
  54394. if (href) addLink({
  54395. href,
  54396. el: linkRef.value
  54397. });
  54398. });
  54399. (0, vue.onBeforeUnmount)(() => {
  54400. const { href } = props;
  54401. if (href) removeLink(href);
  54402. });
  54403. return (_ctx, _cache) => {
  54404. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item")) }, [(0, vue.createElementVNode)("a", {
  54405. ref_key: "linkRef",
  54406. ref: linkRef,
  54407. class: (0, vue.normalizeClass)(cls.value),
  54408. href: __props.href,
  54409. onClick: handleClick
  54410. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.title), 1)])], 10, _hoisted_1$5), _ctx.$slots["sub-link"] && (0, vue.unref)(direction) === "vertical" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54411. key: 0,
  54412. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("list"))
  54413. }, [(0, vue.renderSlot)(_ctx.$slots, "sub-link")], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2);
  54414. };
  54415. }
  54416. });
  54417. //#endregion
  54418. //#region ../../packages/components/anchor/src/anchor-link.vue
  54419. var anchor_link_default = anchor_link_vue_vue_type_script_setup_true_lang_default;
  54420. //#endregion
  54421. //#region ../../packages/components/anchor/index.ts
  54422. const ElAnchor = withInstall(anchor_default, { AnchorLink: anchor_link_default });
  54423. const ElAnchorLink = withNoopInstall(anchor_link_default);
  54424. //#endregion
  54425. //#region ../../packages/components/segmented/src/segmented.ts
  54426. const defaultProps = {
  54427. label: "label",
  54428. value: "value",
  54429. disabled: "disabled"
  54430. };
  54431. /**
  54432. * @deprecated Removed after 3.0.0, Use `SegmentedProps` instead.
  54433. */
  54434. const segmentedProps = buildProps({
  54435. direction: {
  54436. type: definePropType(String),
  54437. default: "horizontal"
  54438. },
  54439. options: {
  54440. type: definePropType(Array),
  54441. default: () => []
  54442. },
  54443. modelValue: {
  54444. type: [
  54445. String,
  54446. Number,
  54447. Boolean
  54448. ],
  54449. default: void 0
  54450. },
  54451. props: {
  54452. type: definePropType(Object),
  54453. default: () => defaultProps
  54454. },
  54455. block: Boolean,
  54456. size: useSizeProp,
  54457. disabled: {
  54458. type: Boolean,
  54459. default: void 0
  54460. },
  54461. validateEvent: {
  54462. type: Boolean,
  54463. default: true
  54464. },
  54465. id: String,
  54466. name: String,
  54467. ...useAriaProps(["ariaLabel"])
  54468. });
  54469. const segmentedEmits = {
  54470. [UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
  54471. [CHANGE_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val)
  54472. };
  54473. //#endregion
  54474. //#region ../../packages/components/segmented/src/segmented.vue?vue&type=script&setup=true&lang.ts
  54475. const _hoisted_1$4 = [
  54476. "id",
  54477. "aria-label",
  54478. "aria-labelledby"
  54479. ];
  54480. const _hoisted_2$3 = [
  54481. "name",
  54482. "disabled",
  54483. "checked",
  54484. "onChange"
  54485. ];
  54486. var segmented_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54487. name: "ElSegmented",
  54488. __name: "segmented",
  54489. props: segmentedProps,
  54490. emits: segmentedEmits,
  54491. setup(__props, { emit: __emit }) {
  54492. const props = __props;
  54493. const emit = __emit;
  54494. const ns = useNamespace("segmented");
  54495. const segmentedId = useId();
  54496. const segmentedSize = useFormSize();
  54497. const _disabled = useFormDisabled();
  54498. const { formItem } = useFormItem();
  54499. const { inputId, isLabeledByFormItem } = useFormItemInputId(props, { formItemContext: formItem });
  54500. const segmentedRef = (0, vue.ref)(null);
  54501. const activeElement = useActiveElement();
  54502. const state = (0, vue.reactive)({
  54503. isInit: false,
  54504. width: 0,
  54505. height: 0,
  54506. translateX: 0,
  54507. translateY: 0,
  54508. focusVisible: false
  54509. });
  54510. const handleChange = (evt, item) => {
  54511. const value = getValue(item);
  54512. emit(UPDATE_MODEL_EVENT, value);
  54513. emit(CHANGE_EVENT, value);
  54514. evt.target.checked = value === props.modelValue;
  54515. };
  54516. const aliasProps = (0, vue.computed)(() => ({
  54517. ...defaultProps,
  54518. ...props.props
  54519. }));
  54520. const intoAny = (item) => item;
  54521. const getValue = (item) => {
  54522. return isObject$1(item) ? item[aliasProps.value.value] : item;
  54523. };
  54524. const getLabel = (item) => {
  54525. return isObject$1(item) ? item[aliasProps.value.label] : item;
  54526. };
  54527. const getDisabled = (item) => {
  54528. return !!(_disabled.value || (isObject$1(item) ? item[aliasProps.value.disabled] : false));
  54529. };
  54530. const getSelected = (item) => {
  54531. return props.modelValue === getValue(item);
  54532. };
  54533. const getOption = (value) => {
  54534. return props.options.find((item) => getValue(item) === value);
  54535. };
  54536. const getItemCls = (item) => {
  54537. return [
  54538. ns.e("item"),
  54539. ns.is("selected", getSelected(item)),
  54540. ns.is("disabled", getDisabled(item))
  54541. ];
  54542. };
  54543. const updateSelect = () => {
  54544. if (!segmentedRef.value) return;
  54545. const selectedItem = segmentedRef.value.querySelector(".is-selected");
  54546. const selectedItemInput = segmentedRef.value.querySelector(".is-selected input");
  54547. if (!selectedItem || !selectedItemInput) {
  54548. state.width = 0;
  54549. state.height = 0;
  54550. state.translateX = 0;
  54551. state.translateY = 0;
  54552. state.focusVisible = false;
  54553. return;
  54554. }
  54555. state.isInit = true;
  54556. if (props.direction === "vertical") {
  54557. state.height = selectedItem.offsetHeight;
  54558. state.translateY = selectedItem.offsetTop;
  54559. } else {
  54560. state.width = selectedItem.offsetWidth;
  54561. state.translateX = selectedItem.offsetLeft;
  54562. }
  54563. try {
  54564. state.focusVisible = selectedItemInput.matches(":focus-visible");
  54565. } catch {}
  54566. };
  54567. const segmentedCls = (0, vue.computed)(() => [
  54568. ns.b(),
  54569. ns.m(segmentedSize.value),
  54570. ns.is("block", props.block)
  54571. ]);
  54572. const selectedStyle = (0, vue.computed)(() => ({
  54573. width: props.direction === "vertical" ? "100%" : `${state.width}px`,
  54574. height: props.direction === "vertical" ? `${state.height}px` : "100%",
  54575. transform: props.direction === "vertical" ? `translateY(${state.translateY}px)` : `translateX(${state.translateX}px)`,
  54576. display: state.isInit ? "block" : "none"
  54577. }));
  54578. const selectedCls = (0, vue.computed)(() => [
  54579. ns.e("item-selected"),
  54580. ns.is("disabled", getDisabled(getOption(props.modelValue))),
  54581. ns.is("focus-visible", state.focusVisible)
  54582. ]);
  54583. const name = (0, vue.computed)(() => {
  54584. return props.name || segmentedId.value;
  54585. });
  54586. useResizeObserver(segmentedRef, updateSelect);
  54587. (0, vue.watch)(activeElement, updateSelect);
  54588. (0, vue.watch)(() => props.modelValue, () => {
  54589. updateSelect();
  54590. if (props.validateEvent) formItem?.validate?.("change").catch((err) => /* @__PURE__ */ debugWarn(err));
  54591. }, { flush: "post" });
  54592. return (_ctx, _cache) => {
  54593. return __props.options.length ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54594. key: 0,
  54595. id: (0, vue.unref)(inputId),
  54596. ref_key: "segmentedRef",
  54597. ref: segmentedRef,
  54598. class: (0, vue.normalizeClass)(segmentedCls.value),
  54599. role: "radiogroup",
  54600. "aria-label": !(0, vue.unref)(isLabeledByFormItem) ? __props.ariaLabel || "segmented" : void 0,
  54601. "aria-labelledby": (0, vue.unref)(isLabeledByFormItem) ? (0, vue.unref)(formItem).labelId : void 0
  54602. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("group"), (0, vue.unref)(ns).m(__props.direction)]) }, [(0, vue.createElementVNode)("div", {
  54603. style: (0, vue.normalizeStyle)(selectedStyle.value),
  54604. class: (0, vue.normalizeClass)(selectedCls.value)
  54605. }, null, 6), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.options, (item, index) => {
  54606. return (0, vue.openBlock)(), (0, vue.createElementBlock)("label", {
  54607. key: index,
  54608. class: (0, vue.normalizeClass)(getItemCls(item))
  54609. }, [(0, vue.createElementVNode)("input", {
  54610. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item-input")),
  54611. type: "radio",
  54612. name: name.value,
  54613. disabled: getDisabled(item),
  54614. checked: getSelected(item),
  54615. onChange: ($event) => handleChange($event, item)
  54616. }, null, 42, _hoisted_2$3), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("item-label")) }, [(0, vue.renderSlot)(_ctx.$slots, "default", { item: intoAny(item) }, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)(getLabel(item)), 1)])], 2)], 2);
  54617. }), 128))], 2)], 10, _hoisted_1$4)) : (0, vue.createCommentVNode)("v-if", true);
  54618. };
  54619. }
  54620. });
  54621. //#endregion
  54622. //#region ../../packages/components/segmented/src/segmented.vue
  54623. var segmented_default = segmented_vue_vue_type_script_setup_true_lang_default;
  54624. //#endregion
  54625. //#region ../../packages/components/segmented/index.ts
  54626. const ElSegmented = withInstall(segmented_default);
  54627. //#endregion
  54628. //#region ../../packages/components/mention/src/helper.ts
  54629. const filterOption = (pattern, option) => {
  54630. const lowerCase = pattern.toLowerCase();
  54631. return (option.label || option.value || "").toLowerCase().includes(lowerCase);
  54632. };
  54633. const getMentionCtx = (inputEl, prefix, split) => {
  54634. const { selectionEnd } = inputEl;
  54635. if (selectionEnd === null) return;
  54636. const inputValue = inputEl.value;
  54637. const prefixArray = castArray$1(prefix);
  54638. let splitIndex = -1;
  54639. let mentionCtx;
  54640. for (let i = selectionEnd - 1; i >= 0; --i) {
  54641. const char = inputValue[i];
  54642. if (char === split || char === "\n" || char === "\r") {
  54643. splitIndex = i;
  54644. continue;
  54645. }
  54646. if (prefixArray.includes(char)) {
  54647. const end = splitIndex === -1 ? selectionEnd : splitIndex;
  54648. mentionCtx = {
  54649. pattern: inputValue.slice(i + 1, end),
  54650. start: i + 1,
  54651. end,
  54652. prefix: char,
  54653. prefixIndex: i,
  54654. splitIndex,
  54655. selectionEnd
  54656. };
  54657. break;
  54658. }
  54659. }
  54660. return mentionCtx;
  54661. };
  54662. /**
  54663. * fork from textarea-caret-position
  54664. * https://github.com/component/textarea-caret-position
  54665. * The MIT License (MIT)
  54666. * Copyright (c) 2015 Jonathan Ong me@jongleberry.com
  54667. * Permission is hereby granted, free of charge, to any person obtaining a copy
  54668. * of this software and associated documentation files (the "Software"), to deal
  54669. * in the Software without restriction, including without limitation the rights
  54670. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  54671. * copies of the Software, and to permit persons to whom the Software is
  54672. * furnished to do so, subject to the following conditions:
  54673. * The above copyright notice and this permission notice shall be included in all
  54674. * copies or substantial portions of the Software.
  54675. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  54676. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  54677. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  54678. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  54679. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  54680. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  54681. * SOFTWARE.
  54682. */
  54683. const getCursorPosition = (element, options = {
  54684. debug: false,
  54685. useSelectionEnd: false
  54686. }) => {
  54687. const selectionStart = element.selectionStart !== null ? element.selectionStart : 0;
  54688. const selectionEnd = element.selectionEnd !== null ? element.selectionEnd : 0;
  54689. const position = options.useSelectionEnd ? selectionEnd : selectionStart;
  54690. const properties = [
  54691. "direction",
  54692. "boxSizing",
  54693. "width",
  54694. "height",
  54695. "overflowX",
  54696. "overflowY",
  54697. "borderTopWidth",
  54698. "borderRightWidth",
  54699. "borderBottomWidth",
  54700. "borderLeftWidth",
  54701. "borderStyle",
  54702. "paddingTop",
  54703. "paddingRight",
  54704. "paddingBottom",
  54705. "paddingLeft",
  54706. "fontStyle",
  54707. "fontVariant",
  54708. "fontWeight",
  54709. "fontStretch",
  54710. "fontSize",
  54711. "fontSizeAdjust",
  54712. "lineHeight",
  54713. "fontFamily",
  54714. "textAlign",
  54715. "textTransform",
  54716. "textIndent",
  54717. "textDecoration",
  54718. "letterSpacing",
  54719. "wordSpacing",
  54720. "tabSize",
  54721. "MozTabSize"
  54722. ];
  54723. if (options.debug) {
  54724. const el = document.querySelector("#input-textarea-caret-position-mirror-div");
  54725. if (el?.parentNode) el.parentNode.removeChild(el);
  54726. }
  54727. const div = document.createElement("div");
  54728. div.id = "input-textarea-caret-position-mirror-div";
  54729. document.body.appendChild(div);
  54730. const style = div.style;
  54731. const computed = window.getComputedStyle(element);
  54732. const isInput = element.nodeName === "INPUT";
  54733. style.whiteSpace = isInput ? "nowrap" : "pre-wrap";
  54734. if (!isInput) style.wordWrap = "break-word";
  54735. style.position = "absolute";
  54736. if (!options.debug) style.visibility = "hidden";
  54737. properties.forEach((prop) => {
  54738. if (isInput && prop === "lineHeight") if (computed.boxSizing === "border-box") {
  54739. const height = Number.parseInt(computed.height);
  54740. const outerHeight = Number.parseInt(computed.paddingTop) + Number.parseInt(computed.paddingBottom) + Number.parseInt(computed.borderTopWidth) + Number.parseInt(computed.borderBottomWidth);
  54741. const targetHeight = outerHeight + Number.parseInt(computed.lineHeight);
  54742. if (height > targetHeight) style.lineHeight = `${height - outerHeight}px`;
  54743. else if (height === targetHeight) style.lineHeight = computed.lineHeight;
  54744. else style.lineHeight = "0";
  54745. } else style.lineHeight = computed.height;
  54746. else style[prop] = computed[prop];
  54747. });
  54748. if (isFirefox()) {
  54749. if (element.scrollHeight > Number.parseInt(computed.height)) style.overflowY = "scroll";
  54750. } else style.overflow = "hidden";
  54751. div.textContent = element.value.slice(0, Math.max(0, position));
  54752. if (isInput && div.textContent) div.textContent = div.textContent.replace(/\s/g, "\xA0");
  54753. const span = document.createElement("span");
  54754. span.textContent = element.value.slice(Math.max(0, position)) || ".";
  54755. span.style.position = "relative";
  54756. span.style.left = `${-element.scrollLeft}px`;
  54757. span.style.top = `${-element.scrollTop}px`;
  54758. div.appendChild(span);
  54759. const relativePosition = {
  54760. top: span.offsetTop + Number.parseInt(computed.borderTopWidth),
  54761. left: span.offsetLeft + Number.parseInt(computed.borderLeftWidth),
  54762. height: Number.parseInt(computed.fontSize) * 1.5
  54763. };
  54764. if (options.debug) span.style.backgroundColor = "#aaa";
  54765. else document.body.removeChild(div);
  54766. if (relativePosition.left >= element.clientWidth) relativePosition.left = element.clientWidth;
  54767. return relativePosition;
  54768. };
  54769. //#endregion
  54770. //#region ../../packages/components/mention/src/mention.ts
  54771. /**
  54772. * @deprecated Removed after 3.0.0, Use `MentionProps` instead.
  54773. */
  54774. const mentionProps = buildProps({
  54775. ...inputProps,
  54776. options: {
  54777. type: definePropType(Array),
  54778. default: () => []
  54779. },
  54780. prefix: {
  54781. type: definePropType([String, Array]),
  54782. default: "@",
  54783. validator: (val) => {
  54784. if (isString(val)) return val.length === 1;
  54785. return val.every((v) => isString(v) && v.length === 1);
  54786. }
  54787. },
  54788. split: {
  54789. type: String,
  54790. default: " ",
  54791. validator: (val) => val.length === 1
  54792. },
  54793. filterOption: {
  54794. type: definePropType([Boolean, Function]),
  54795. default: () => filterOption,
  54796. validator: (val) => {
  54797. if (val === false) return true;
  54798. return isFunction$1(val);
  54799. }
  54800. },
  54801. placement: {
  54802. type: definePropType(String),
  54803. default: "bottom"
  54804. },
  54805. showArrow: Boolean,
  54806. offset: {
  54807. type: Number,
  54808. default: 0
  54809. },
  54810. whole: Boolean,
  54811. checkIsWhole: { type: definePropType(Function) },
  54812. modelValue: String,
  54813. loading: Boolean,
  54814. popperClass: useTooltipContentProps.popperClass,
  54815. popperStyle: useTooltipContentProps.popperStyle,
  54816. popperOptions: {
  54817. type: definePropType(Object),
  54818. default: () => ({})
  54819. },
  54820. props: {
  54821. type: definePropType(Object),
  54822. default: () => mentionDefaultProps
  54823. }
  54824. });
  54825. const mentionEmits = {
  54826. [UPDATE_MODEL_EVENT]: (value) => isString(value),
  54827. "whole-remove": (pattern, prefix) => isString(pattern) && isString(prefix),
  54828. input: (value) => isString(value),
  54829. search: (pattern, prefix) => isString(pattern) && isString(prefix),
  54830. select: (option, prefix) => isObject$1(option) && isString(prefix),
  54831. focus: (evt) => evt instanceof FocusEvent,
  54832. blur: (evt) => evt instanceof FocusEvent
  54833. };
  54834. const mentionDefaultProps = {
  54835. value: "value",
  54836. label: "label",
  54837. disabled: "disabled"
  54838. };
  54839. //#endregion
  54840. //#region ../../packages/components/mention/src/mention-dropdown.ts
  54841. /**
  54842. * @deprecated Removed after 3.0.0, Use `MentionDropdownProps` instead.
  54843. */
  54844. const mentionDropdownProps = buildProps({
  54845. options: {
  54846. type: definePropType(Array),
  54847. default: () => []
  54848. },
  54849. loading: Boolean,
  54850. disabled: Boolean,
  54851. contentId: String,
  54852. ariaLabel: String
  54853. });
  54854. const mentionDropdownEmits = { select: (option) => isString(option.value) };
  54855. //#endregion
  54856. //#region ../../packages/components/mention/src/mention-dropdown.vue?vue&type=script&setup=true&lang.ts
  54857. const _hoisted_1$3 = [
  54858. "id",
  54859. "aria-disabled",
  54860. "aria-selected",
  54861. "onMousemove",
  54862. "onClick"
  54863. ];
  54864. var mention_dropdown_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54865. name: "ElMentionDropdown",
  54866. __name: "mention-dropdown",
  54867. props: mentionDropdownProps,
  54868. emits: mentionDropdownEmits,
  54869. setup(__props, { expose: __expose, emit: __emit }) {
  54870. const props = __props;
  54871. const emit = __emit;
  54872. const ns = useNamespace("mention");
  54873. const { t } = useLocale();
  54874. const hoveringIndex = (0, vue.ref)(-1);
  54875. const scrollbarRef = (0, vue.ref)();
  54876. const optionRefs = (0, vue.ref)();
  54877. const dropdownRef = (0, vue.ref)();
  54878. const optionkls = (item, index) => [
  54879. ns.be("dropdown", "item"),
  54880. ns.is("hovering", hoveringIndex.value === index),
  54881. ns.is("disabled", item.disabled || props.disabled)
  54882. ];
  54883. const handleSelect = (item) => {
  54884. if (item.disabled || props.disabled) return;
  54885. emit("select", item);
  54886. };
  54887. const handleMouseEnter = (index) => {
  54888. hoveringIndex.value = index;
  54889. };
  54890. const filteredAllDisabled = (0, vue.computed)(() => props.disabled || props.options.every((item) => item.disabled));
  54891. const hoverOption = (0, vue.computed)(() => props.options[hoveringIndex.value]);
  54892. const selectHoverOption = () => {
  54893. if (!hoverOption.value || hoverOption.value.disabled || props.disabled) return;
  54894. emit("select", hoverOption.value);
  54895. };
  54896. const navigateOptions = (direction) => {
  54897. const { options } = props;
  54898. if (options.length === 0 || filteredAllDisabled.value) return;
  54899. if (direction === "next") {
  54900. hoveringIndex.value++;
  54901. if (hoveringIndex.value === options.length) hoveringIndex.value = 0;
  54902. } else if (direction === "prev") {
  54903. hoveringIndex.value--;
  54904. if (hoveringIndex.value < 0) hoveringIndex.value = options.length - 1;
  54905. }
  54906. const option = options[hoveringIndex.value];
  54907. if (option.disabled) {
  54908. navigateOptions(direction);
  54909. return;
  54910. }
  54911. (0, vue.nextTick)(() => scrollToOption(option));
  54912. };
  54913. const scrollToOption = (option) => {
  54914. const { options } = props;
  54915. const index = options.findIndex((item) => item.value === option.value);
  54916. const target = optionRefs.value?.[index];
  54917. if (target) {
  54918. const menu = dropdownRef.value?.querySelector?.(`.${ns.be("dropdown", "wrap")}`);
  54919. if (menu) scrollIntoView(menu, target);
  54920. }
  54921. scrollbarRef.value?.handleScroll();
  54922. };
  54923. const resetHoveringIndex = () => {
  54924. if (filteredAllDisabled.value || props.options.length === 0) hoveringIndex.value = -1;
  54925. else hoveringIndex.value = props.options.findIndex((item) => !item.disabled);
  54926. };
  54927. (0, vue.watch)(() => props.options, resetHoveringIndex, { immediate: true });
  54928. __expose({
  54929. hoveringIndex,
  54930. navigateOptions,
  54931. selectHoverOption,
  54932. hoverOption
  54933. });
  54934. return (_ctx, _cache) => {
  54935. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54936. ref_key: "dropdownRef",
  54937. ref: dropdownRef,
  54938. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b("dropdown"))
  54939. }, [
  54940. _ctx.$slots.header ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54941. key: 0,
  54942. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("dropdown", "header"))
  54943. }, [(0, vue.renderSlot)(_ctx.$slots, "header")], 2)) : (0, vue.createCommentVNode)("v-if", true),
  54944. (0, vue.withDirectives)((0, vue.createVNode)((0, vue.unref)(ElScrollbar), {
  54945. id: __props.contentId,
  54946. ref_key: "scrollbarRef",
  54947. ref: scrollbarRef,
  54948. tag: "ul",
  54949. "wrap-class": (0, vue.unref)(ns).be("dropdown", "wrap"),
  54950. "view-class": (0, vue.unref)(ns).be("dropdown", "list"),
  54951. role: "listbox",
  54952. "aria-label": __props.ariaLabel,
  54953. "aria-orientation": "vertical"
  54954. }, {
  54955. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.options, (item, index) => {
  54956. return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
  54957. id: `${__props.contentId}-${index}`,
  54958. ref_for: true,
  54959. ref_key: "optionRefs",
  54960. ref: optionRefs,
  54961. key: index,
  54962. class: (0, vue.normalizeClass)(optionkls(item, index)),
  54963. role: "option",
  54964. "aria-disabled": item.disabled || __props.disabled || void 0,
  54965. "aria-selected": hoveringIndex.value === index,
  54966. onMousemove: ($event) => handleMouseEnter(index),
  54967. onClick: (0, vue.withModifiers)(($event) => handleSelect(item), ["stop"])
  54968. }, [(0, vue.renderSlot)(_ctx.$slots, "label", {
  54969. item,
  54970. index
  54971. }, () => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(item.label ?? item.value), 1)])], 42, _hoisted_1$3);
  54972. }), 128))]),
  54973. _: 3
  54974. }, 8, [
  54975. "id",
  54976. "wrap-class",
  54977. "view-class",
  54978. "aria-label"
  54979. ]), [[vue.vShow, __props.options.length > 0 && !__props.loading]]),
  54980. __props.loading ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54981. key: 1,
  54982. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("dropdown", "loading"))
  54983. }, [(0, vue.renderSlot)(_ctx.$slots, "loading", {}, () => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(t)("el.mention.loading")), 1)])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  54984. _ctx.$slots.footer ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  54985. key: 2,
  54986. class: (0, vue.normalizeClass)((0, vue.unref)(ns).be("dropdown", "footer"))
  54987. }, [(0, vue.renderSlot)(_ctx.$slots, "footer")], 2)) : (0, vue.createCommentVNode)("v-if", true)
  54988. ], 2);
  54989. };
  54990. }
  54991. });
  54992. //#endregion
  54993. //#region ../../packages/components/mention/src/mention-dropdown.vue
  54994. var mention_dropdown_default = mention_dropdown_vue_vue_type_script_setup_true_lang_default;
  54995. //#endregion
  54996. //#region ../../packages/components/mention/src/mention.vue?vue&type=script&setup=true&lang.ts
  54997. var mention_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  54998. name: "ElMention",
  54999. inheritAttrs: false,
  55000. __name: "mention",
  55001. props: mentionProps,
  55002. emits: mentionEmits,
  55003. setup(__props, { expose: __expose, emit: __emit }) {
  55004. const props = __props;
  55005. const emit = __emit;
  55006. const passInputProps = (0, vue.computed)(() => pick(props, Object.keys(inputProps)));
  55007. const ns = useNamespace("mention");
  55008. const disabled = useFormDisabled();
  55009. const contentId = useId();
  55010. const elInputRef = (0, vue.ref)();
  55011. const tooltipRef = (0, vue.ref)();
  55012. const dropdownRef = (0, vue.ref)();
  55013. const visible = (0, vue.ref)(false);
  55014. const cursorStyle = (0, vue.ref)();
  55015. const mentionCtx = (0, vue.ref)();
  55016. const computedPlacement = (0, vue.computed)(() => props.showArrow ? props.placement : `${props.placement}-start`);
  55017. const computedFallbackPlacements = (0, vue.computed)(() => props.showArrow ? ["bottom", "top"] : ["bottom-start", "top-start"]);
  55018. const aliasProps = (0, vue.computed)(() => ({
  55019. ...mentionDefaultProps,
  55020. ...props.props
  55021. }));
  55022. const mapOption = (option) => {
  55023. const base = {
  55024. label: option[aliasProps.value.label],
  55025. value: option[aliasProps.value.value],
  55026. disabled: option[aliasProps.value.disabled]
  55027. };
  55028. return {
  55029. ...option,
  55030. ...base
  55031. };
  55032. };
  55033. const options = (0, vue.computed)(() => props.options.map(mapOption));
  55034. const filteredOptions = (0, vue.computed)(() => {
  55035. const { filterOption } = props;
  55036. if (!mentionCtx.value || !filterOption) return options.value;
  55037. return options.value.filter((option) => filterOption(mentionCtx.value.pattern, option));
  55038. });
  55039. const dropdownVisible = (0, vue.computed)(() => {
  55040. return visible.value && (!!filteredOptions.value.length || props.loading);
  55041. });
  55042. const hoveringId = (0, vue.computed)(() => {
  55043. return `${contentId.value}-${dropdownRef.value?.hoveringIndex}`;
  55044. });
  55045. const handleInputChange = (value) => {
  55046. emit(UPDATE_MODEL_EVENT, value);
  55047. emit(INPUT_EVENT, value);
  55048. syncAfterCursorMove();
  55049. };
  55050. const handleInputKeyDown = (event) => {
  55051. if (elInputRef.value?.isComposing) return;
  55052. const code = getEventCode(event);
  55053. switch (code) {
  55054. case EVENT_CODE.left:
  55055. case EVENT_CODE.right:
  55056. syncAfterCursorMove();
  55057. break;
  55058. case EVENT_CODE.up:
  55059. case EVENT_CODE.down:
  55060. if (!visible.value) return;
  55061. event.preventDefault();
  55062. dropdownRef.value?.navigateOptions(code === EVENT_CODE.up ? "prev" : "next");
  55063. break;
  55064. case EVENT_CODE.enter:
  55065. case EVENT_CODE.numpadEnter:
  55066. if (!visible.value) {
  55067. props.type !== "textarea" && syncAfterCursorMove();
  55068. return;
  55069. }
  55070. event.preventDefault();
  55071. if (dropdownRef.value?.hoverOption) dropdownRef.value?.selectHoverOption();
  55072. else visible.value = false;
  55073. break;
  55074. case EVENT_CODE.esc:
  55075. if (!visible.value) return;
  55076. event.preventDefault();
  55077. visible.value = false;
  55078. break;
  55079. case EVENT_CODE.backspace: if (props.whole && mentionCtx.value) {
  55080. const { splitIndex, selectionEnd, pattern, prefixIndex, prefix } = mentionCtx.value;
  55081. const inputEl = getInputEl();
  55082. if (!inputEl) return;
  55083. const inputValue = inputEl.value;
  55084. const matchOption = options.value.find((item) => item.value === pattern);
  55085. if ((isFunction$1(props.checkIsWhole) ? props.checkIsWhole(pattern, prefix) : matchOption) && splitIndex !== -1 && splitIndex + 1 === selectionEnd) {
  55086. event.preventDefault();
  55087. const newValue = inputValue.slice(0, prefixIndex) + inputValue.slice(splitIndex + 1);
  55088. emit(UPDATE_MODEL_EVENT, newValue);
  55089. emit(INPUT_EVENT, newValue);
  55090. emit("whole-remove", pattern, prefix);
  55091. const newSelectionEnd = prefixIndex;
  55092. (0, vue.nextTick)(() => {
  55093. inputEl.selectionStart = newSelectionEnd;
  55094. inputEl.selectionEnd = newSelectionEnd;
  55095. syncDropdownVisible();
  55096. });
  55097. }
  55098. }
  55099. }
  55100. };
  55101. const { wrapperRef } = useFocusController(elInputRef, {
  55102. disabled,
  55103. afterFocus() {
  55104. syncAfterCursorMove();
  55105. },
  55106. beforeBlur(event) {
  55107. return tooltipRef.value?.isFocusInsideContent(event);
  55108. },
  55109. afterBlur() {
  55110. visible.value = false;
  55111. }
  55112. });
  55113. const handleInputMouseDown = () => {
  55114. syncAfterCursorMove();
  55115. };
  55116. const getOriginalOption = (mentionOption) => {
  55117. return props.options.find((option) => {
  55118. return mentionOption.value === option[aliasProps.value.value];
  55119. });
  55120. };
  55121. const handleSelect = (item) => {
  55122. if (!mentionCtx.value) return;
  55123. const inputEl = getInputEl();
  55124. if (!inputEl) return;
  55125. const inputValue = inputEl.value;
  55126. const { split } = props;
  55127. const newEndPart = inputValue.slice(mentionCtx.value.end);
  55128. const alreadySeparated = newEndPart.startsWith(split);
  55129. const newMiddlePart = `${item.value}${alreadySeparated ? "" : split}`;
  55130. const newValue = inputValue.slice(0, mentionCtx.value.start) + newMiddlePart + newEndPart;
  55131. emit(UPDATE_MODEL_EVENT, newValue);
  55132. emit(INPUT_EVENT, newValue);
  55133. emit("select", getOriginalOption(item), mentionCtx.value.prefix);
  55134. const newSelectionEnd = mentionCtx.value.start + newMiddlePart.length + (alreadySeparated ? 1 : 0);
  55135. (0, vue.nextTick)(() => {
  55136. inputEl.selectionStart = newSelectionEnd;
  55137. inputEl.selectionEnd = newSelectionEnd;
  55138. inputEl.focus();
  55139. syncDropdownVisible();
  55140. });
  55141. };
  55142. const getInputEl = () => props.type === "textarea" ? elInputRef.value?.textarea : elInputRef.value?.input;
  55143. const syncAfterCursorMove = () => {
  55144. setTimeout(() => {
  55145. syncCursor();
  55146. syncDropdownVisible();
  55147. (0, vue.nextTick)(() => tooltipRef.value?.updatePopper());
  55148. }, 0);
  55149. };
  55150. const syncCursor = () => {
  55151. const inputEl = getInputEl();
  55152. if (!inputEl) return;
  55153. const caretPosition = getCursorPosition(inputEl);
  55154. const inputRect = inputEl.getBoundingClientRect();
  55155. const wrapperRect = wrapperRef.value.getBoundingClientRect();
  55156. cursorStyle.value = {
  55157. position: "absolute",
  55158. width: 0,
  55159. height: `${caretPosition.height}px`,
  55160. left: `${caretPosition.left + inputRect.left - wrapperRect.left}px`,
  55161. top: `${caretPosition.top + inputRect.top - wrapperRect.top}px`
  55162. };
  55163. };
  55164. const syncDropdownVisible = () => {
  55165. const inputEl = getInputEl();
  55166. if (document.activeElement !== inputEl) {
  55167. visible.value = false;
  55168. return;
  55169. }
  55170. const { prefix, split } = props;
  55171. mentionCtx.value = getMentionCtx(inputEl, prefix, split);
  55172. if (mentionCtx.value && mentionCtx.value.splitIndex === -1) {
  55173. visible.value = true;
  55174. emit("search", mentionCtx.value.pattern, mentionCtx.value.prefix);
  55175. return;
  55176. }
  55177. visible.value = false;
  55178. };
  55179. __expose({
  55180. input: elInputRef,
  55181. tooltip: tooltipRef,
  55182. dropdownVisible
  55183. });
  55184. return (_ctx, _cache) => {
  55185. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55186. ref_key: "wrapperRef",
  55187. ref: wrapperRef,
  55188. class: (0, vue.normalizeClass)((0, vue.unref)(ns).b())
  55189. }, [(0, vue.createVNode)((0, vue.unref)(ElInput), (0, vue.mergeProps)((0, vue.mergeProps)(passInputProps.value, _ctx.$attrs), {
  55190. ref_key: "elInputRef",
  55191. ref: elInputRef,
  55192. "model-value": __props.modelValue,
  55193. disabled: (0, vue.unref)(disabled),
  55194. role: dropdownVisible.value ? "combobox" : void 0,
  55195. "aria-activedescendant": dropdownVisible.value ? hoveringId.value || "" : void 0,
  55196. "aria-controls": dropdownVisible.value ? (0, vue.unref)(contentId) : void 0,
  55197. "aria-expanded": dropdownVisible.value || void 0,
  55198. "aria-label": __props.ariaLabel,
  55199. "aria-autocomplete": dropdownVisible.value ? "none" : void 0,
  55200. "aria-haspopup": dropdownVisible.value ? "listbox" : void 0,
  55201. onInput: handleInputChange,
  55202. onKeydown: handleInputKeyDown,
  55203. onMousedown: handleInputMouseDown
  55204. }), (0, vue.createSlots)({ _: 2 }, [(0, vue.renderList)(_ctx.$slots, (_, name) => {
  55205. return {
  55206. name,
  55207. fn: (0, vue.withCtx)((slotProps) => [(0, vue.renderSlot)(_ctx.$slots, name, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps)))])
  55208. };
  55209. })]), 1040, [
  55210. "model-value",
  55211. "disabled",
  55212. "role",
  55213. "aria-activedescendant",
  55214. "aria-controls",
  55215. "aria-expanded",
  55216. "aria-label",
  55217. "aria-autocomplete",
  55218. "aria-haspopup"
  55219. ]), (0, vue.createVNode)((0, vue.unref)(ElTooltip), {
  55220. ref_key: "tooltipRef",
  55221. ref: tooltipRef,
  55222. visible: dropdownVisible.value,
  55223. "popper-class": [(0, vue.unref)(ns).e("popper"), __props.popperClass],
  55224. "popper-style": __props.popperStyle,
  55225. "popper-options": __props.popperOptions,
  55226. placement: computedPlacement.value,
  55227. "fallback-placements": computedFallbackPlacements.value,
  55228. effect: "light",
  55229. pure: "",
  55230. offset: __props.offset,
  55231. "show-arrow": __props.showArrow
  55232. }, {
  55233. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", { style: (0, vue.normalizeStyle)(cursorStyle.value) }, null, 4)]),
  55234. content: (0, vue.withCtx)(() => [(0, vue.createVNode)(mention_dropdown_default, {
  55235. ref_key: "dropdownRef",
  55236. ref: dropdownRef,
  55237. options: filteredOptions.value,
  55238. disabled: (0, vue.unref)(disabled),
  55239. loading: __props.loading,
  55240. "content-id": (0, vue.unref)(contentId),
  55241. "aria-label": __props.ariaLabel,
  55242. onSelect: handleSelect,
  55243. onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(($event) => elInputRef.value?.focus(), ["stop"]))
  55244. }, (0, vue.createSlots)({ _: 2 }, [(0, vue.renderList)(_ctx.$slots, (_, name) => {
  55245. return {
  55246. name,
  55247. fn: (0, vue.withCtx)((slotProps) => [(0, vue.renderSlot)(_ctx.$slots, name, (0, vue.normalizeProps)((0, vue.guardReactiveProps)(slotProps)))])
  55248. };
  55249. })]), 1032, [
  55250. "options",
  55251. "disabled",
  55252. "loading",
  55253. "content-id",
  55254. "aria-label"
  55255. ])]),
  55256. _: 3
  55257. }, 8, [
  55258. "visible",
  55259. "popper-class",
  55260. "popper-style",
  55261. "popper-options",
  55262. "placement",
  55263. "fallback-placements",
  55264. "offset",
  55265. "show-arrow"
  55266. ])], 2);
  55267. };
  55268. }
  55269. });
  55270. //#endregion
  55271. //#region ../../packages/components/mention/src/mention.vue
  55272. var mention_default = mention_vue_vue_type_script_setup_true_lang_default;
  55273. //#endregion
  55274. //#region ../../packages/components/mention/index.ts
  55275. const ElMention = withInstall(mention_default);
  55276. //#endregion
  55277. //#region ../../packages/components/splitter/src/splitter.ts
  55278. /**
  55279. * @deprecated Removed after 3.0.0, Use `SplitterProps` instead.
  55280. */
  55281. const splitterProps = buildProps({
  55282. layout: {
  55283. type: String,
  55284. default: "horizontal",
  55285. values: ["horizontal", "vertical"]
  55286. },
  55287. lazy: Boolean
  55288. });
  55289. const splitterEmits = {
  55290. resizeStart: (index, sizes) => true,
  55291. resize: (index, sizes) => true,
  55292. resizeEnd: (index, sizes) => true,
  55293. collapse: (index, type, sizes) => true
  55294. };
  55295. //#endregion
  55296. //#region ../../packages/components/splitter/src/hooks/useContainer.ts
  55297. function useContainer(layout) {
  55298. const containerEl = (0, vue.ref)();
  55299. const { width, height } = useElementSize(containerEl);
  55300. return {
  55301. containerEl,
  55302. containerSize: (0, vue.computed)(() => {
  55303. return layout.value === "horizontal" ? width.value : height.value;
  55304. })
  55305. };
  55306. }
  55307. //#endregion
  55308. //#region ../../packages/components/splitter/src/hooks/useSize.ts
  55309. function getPct(str) {
  55310. return Number(str.slice(0, -1)) / 100;
  55311. }
  55312. function getPx(str) {
  55313. return Number(str.slice(0, -2));
  55314. }
  55315. function isPct(itemSize) {
  55316. return isString(itemSize) && itemSize.endsWith("%");
  55317. }
  55318. function isPx(itemSize) {
  55319. return isString(itemSize) && itemSize.endsWith("px");
  55320. }
  55321. function useSize$1(panels, containerSize) {
  55322. const propSizes = (0, vue.computed)(() => panels.value.map((i) => i.size));
  55323. const panelCounts = (0, vue.computed)(() => panels.value.length);
  55324. const percentSizes = (0, vue.ref)([]);
  55325. (0, vue.watch)([
  55326. propSizes,
  55327. panelCounts,
  55328. containerSize
  55329. ], () => {
  55330. let ptgList = [];
  55331. let emptyCount = 0;
  55332. for (let i = 0; i < panelCounts.value; i += 1) {
  55333. const itemSize = panels.value[i]?.size;
  55334. if (isPct(itemSize)) ptgList[i] = getPct(itemSize);
  55335. else if (isPx(itemSize)) ptgList[i] = getPx(itemSize) / containerSize.value;
  55336. else if (itemSize || itemSize === 0) {
  55337. const num = Number(itemSize);
  55338. if (!Number.isNaN(num)) ptgList[i] = num / containerSize.value;
  55339. } else {
  55340. emptyCount += 1;
  55341. ptgList[i] = void 0;
  55342. }
  55343. }
  55344. const totalPtg = ptgList.reduce((acc, ptg) => acc + (ptg || 0), 0);
  55345. if (totalPtg > 1 || !emptyCount) {
  55346. const scale = 1 / totalPtg;
  55347. ptgList = ptgList.map((ptg) => ptg === void 0 ? 0 : ptg * scale);
  55348. } else {
  55349. const avgRest = (1 - totalPtg) / emptyCount;
  55350. ptgList = ptgList.map((ptg) => ptg === void 0 ? avgRest : ptg);
  55351. }
  55352. percentSizes.value = ptgList;
  55353. });
  55354. const ptg2px = (ptg) => ptg * containerSize.value;
  55355. return {
  55356. percentSizes,
  55357. pxSizes: (0, vue.computed)(() => percentSizes.value.map(ptg2px))
  55358. };
  55359. }
  55360. //#endregion
  55361. //#region ../../packages/components/splitter/src/hooks/useResize.ts
  55362. function useResize(panels, containerSize, pxSizes, lazy) {
  55363. const ptg2px = (ptg) => ptg * containerSize.value || 0;
  55364. function getLimitSize(str, defaultLimit) {
  55365. if (isPct(str)) return ptg2px(getPct(str));
  55366. else if (isPx(str)) return getPx(str);
  55367. return str ?? defaultLimit;
  55368. }
  55369. const lazyOffset = (0, vue.ref)(0);
  55370. const movingIndex = (0, vue.ref)(null);
  55371. let cachePxSizes = [];
  55372. let updatePanelSizes = NOOP;
  55373. const limitSizes = (0, vue.computed)(() => panels.value.map((item) => [item.min, item.max]));
  55374. (0, vue.watch)(lazy, () => {
  55375. if (lazyOffset.value) {
  55376. const mouseup = new MouseEvent("mouseup", { bubbles: true });
  55377. window.dispatchEvent(mouseup);
  55378. }
  55379. });
  55380. const onMoveStart = (index) => {
  55381. lazyOffset.value = 0;
  55382. movingIndex.value = {
  55383. index,
  55384. confirmed: false
  55385. };
  55386. cachePxSizes = pxSizes.value;
  55387. };
  55388. const onMoving = (index, offset) => {
  55389. let confirmedIndex = null;
  55390. if ((!movingIndex.value || !movingIndex.value.confirmed) && offset !== 0) {
  55391. if (offset > 0) {
  55392. confirmedIndex = index;
  55393. movingIndex.value = {
  55394. index,
  55395. confirmed: true
  55396. };
  55397. } else for (let i = index; i >= 0; i -= 1) if (cachePxSizes[i] > 0) {
  55398. confirmedIndex = i;
  55399. movingIndex.value = {
  55400. index: i,
  55401. confirmed: true
  55402. };
  55403. break;
  55404. }
  55405. }
  55406. const mergedIndex = confirmedIndex ?? movingIndex.value?.index ?? index;
  55407. const numSizes = [...cachePxSizes];
  55408. const nextIndex = mergedIndex + 1;
  55409. const startMinSize = getLimitSize(limitSizes.value[mergedIndex][0], 0);
  55410. const endMinSize = getLimitSize(limitSizes.value[nextIndex][0], 0);
  55411. const startMaxSize = getLimitSize(limitSizes.value[mergedIndex][1], containerSize.value || 0);
  55412. const endMaxSize = getLimitSize(limitSizes.value[nextIndex][1], containerSize.value || 0);
  55413. let mergedOffset = offset;
  55414. if (numSizes[mergedIndex] + mergedOffset < startMinSize) mergedOffset = startMinSize - numSizes[mergedIndex];
  55415. if (numSizes[nextIndex] - mergedOffset < endMinSize) mergedOffset = numSizes[nextIndex] - endMinSize;
  55416. if (numSizes[mergedIndex] + mergedOffset > startMaxSize) mergedOffset = startMaxSize - numSizes[mergedIndex];
  55417. if (numSizes[nextIndex] - mergedOffset > endMaxSize) mergedOffset = numSizes[nextIndex] - endMaxSize;
  55418. numSizes[mergedIndex] += mergedOffset;
  55419. numSizes[nextIndex] -= mergedOffset;
  55420. lazyOffset.value = mergedOffset;
  55421. updatePanelSizes = () => {
  55422. panels.value.forEach((panel, index) => {
  55423. panel.size = numSizes[index];
  55424. });
  55425. updatePanelSizes = NOOP;
  55426. };
  55427. if (!lazy.value) updatePanelSizes();
  55428. };
  55429. const onMoveEnd = () => {
  55430. if (lazy.value) updatePanelSizes();
  55431. lazyOffset.value = 0;
  55432. movingIndex.value = null;
  55433. cachePxSizes = [];
  55434. };
  55435. const cacheCollapsedSize = [];
  55436. const onCollapse = (index, type) => {
  55437. if (!cacheCollapsedSize.length) cacheCollapsedSize.push(...pxSizes.value);
  55438. const currentSizes = pxSizes.value;
  55439. const currentIndex = type === "start" ? index : index + 1;
  55440. const targetIndex = type === "start" ? index + 1 : index;
  55441. const currentSize = currentSizes[currentIndex];
  55442. const targetSize = currentSizes[targetIndex];
  55443. if (currentSize !== 0 && targetSize !== 0) {
  55444. currentSizes[currentIndex] = 0;
  55445. currentSizes[targetIndex] += currentSize;
  55446. cacheCollapsedSize[index] = currentSize;
  55447. } else {
  55448. const totalSize = currentSize + targetSize;
  55449. const targetCacheCollapsedSize = cacheCollapsedSize[index];
  55450. const currentCacheCollapsedSize = totalSize - targetCacheCollapsedSize;
  55451. currentSizes[targetIndex] = targetCacheCollapsedSize;
  55452. currentSizes[currentIndex] = currentCacheCollapsedSize;
  55453. }
  55454. panels.value.forEach((panel, index) => {
  55455. panel.size = currentSizes[index];
  55456. });
  55457. };
  55458. return {
  55459. lazyOffset,
  55460. onMoveStart,
  55461. onMoving,
  55462. onMoveEnd,
  55463. movingIndex,
  55464. onCollapse
  55465. };
  55466. }
  55467. //#endregion
  55468. //#region ../../packages/components/splitter/src/type.ts
  55469. const splitterRootContextKey = Symbol("splitterRootContextKey");
  55470. //#endregion
  55471. //#region ../../packages/components/splitter/src/splitter.vue?vue&type=script&setup=true&lang.ts
  55472. var splitter_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  55473. name: "ElSplitter",
  55474. __name: "splitter",
  55475. props: splitterProps,
  55476. emits: splitterEmits,
  55477. setup(__props, { emit: __emit }) {
  55478. const ns = useNamespace("splitter");
  55479. const emits = __emit;
  55480. const props = __props;
  55481. const layout = (0, vue.toRef)(props, "layout");
  55482. const lazy = (0, vue.toRef)(props, "lazy");
  55483. const { containerEl, containerSize } = useContainer(layout);
  55484. const { removeChild: unregisterPanel, children: panels, addChild: registerPanel, ChildrenSorter: PanelsSorter } = useOrderedChildren((0, vue.getCurrentInstance)(), "ElSplitterPanel");
  55485. (0, vue.watch)(panels, () => {
  55486. movingIndex.value = null;
  55487. panels.value.forEach((instance, index) => {
  55488. instance.setIndex(index);
  55489. });
  55490. });
  55491. const { percentSizes, pxSizes } = useSize$1(panels, containerSize);
  55492. const { lazyOffset, movingIndex, onMoveStart, onMoving, onMoveEnd, onCollapse } = useResize(panels, containerSize, pxSizes, lazy);
  55493. const splitterStyles = (0, vue.computed)(() => {
  55494. return { [ns.cssVarBlockName("bar-offset")]: lazy.value ? `${lazyOffset.value}px` : void 0 };
  55495. });
  55496. const onResizeStart = (index) => {
  55497. onMoveStart(index);
  55498. emits("resizeStart", index, pxSizes.value);
  55499. };
  55500. const onResize = (index, offset) => {
  55501. onMoving(index, offset);
  55502. if (!lazy.value) emits("resize", index, pxSizes.value);
  55503. };
  55504. const onResizeEnd = async (index) => {
  55505. onMoveEnd();
  55506. await (0, vue.nextTick)();
  55507. emits("resizeEnd", index, pxSizes.value);
  55508. };
  55509. const onCollapsible = (index, type) => {
  55510. onCollapse(index, type);
  55511. emits("collapse", index, type, pxSizes.value);
  55512. };
  55513. (0, vue.provide)(splitterRootContextKey, (0, vue.reactive)({
  55514. panels,
  55515. percentSizes,
  55516. pxSizes,
  55517. layout,
  55518. lazy,
  55519. movingIndex,
  55520. containerSize,
  55521. onMoveStart: onResizeStart,
  55522. onMoving: onResize,
  55523. onMoveEnd: onResizeEnd,
  55524. onCollapse: onCollapsible,
  55525. registerPanel,
  55526. unregisterPanel
  55527. }));
  55528. return (_ctx, _cache) => {
  55529. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55530. ref_key: "containerEl",
  55531. ref: containerEl,
  55532. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b(), (0, vue.unref)(ns).e(layout.value)]),
  55533. style: (0, vue.normalizeStyle)(splitterStyles.value)
  55534. }, [
  55535. (0, vue.renderSlot)(_ctx.$slots, "default"),
  55536. (0, vue.createVNode)((0, vue.unref)(PanelsSorter)),
  55537. (0, vue.createCommentVNode)(" Prevent iframe touch events from breaking "),
  55538. (0, vue.unref)(movingIndex) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55539. key: 0,
  55540. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("mask"), (0, vue.unref)(ns).e(`mask-${layout.value}`)])
  55541. }, null, 2)) : (0, vue.createCommentVNode)("v-if", true)
  55542. ], 6);
  55543. };
  55544. }
  55545. });
  55546. //#endregion
  55547. //#region ../../packages/components/splitter/src/splitter.vue
  55548. var splitter_default = splitter_vue_vue_type_script_setup_true_lang_default;
  55549. //#endregion
  55550. //#region ../../packages/components/splitter/src/split-panel.ts
  55551. /**
  55552. * @deprecated Removed after 3.0.0, Use `SplitterPanelProps` instead.
  55553. */
  55554. const splitterPanelProps = buildProps({
  55555. min: { type: [String, Number] },
  55556. max: { type: [String, Number] },
  55557. size: { type: [String, Number] },
  55558. resizable: {
  55559. type: Boolean,
  55560. default: true
  55561. },
  55562. collapsible: Boolean
  55563. });
  55564. const splitterPanelEmits = { "update:size": (value) => typeof value === "number" || typeof value === "string" };
  55565. //#endregion
  55566. //#region ../../packages/components/splitter/src/hooks/usePanel.ts
  55567. function getCollapsible(collapsible) {
  55568. if (collapsible && isObject$1(collapsible)) return collapsible;
  55569. return {
  55570. start: !!collapsible,
  55571. end: !!collapsible
  55572. };
  55573. }
  55574. function isCollapsible(panel, size, nextPanel, nextSize) {
  55575. if (panel?.collapsible.end && size > 0) return true;
  55576. if (nextPanel?.collapsible.start && nextSize === 0 && size > 0) return true;
  55577. return false;
  55578. }
  55579. //#endregion
  55580. //#region ../../packages/components/splitter/src/split-bar.vue?vue&type=script&setup=true&lang.ts
  55581. var split_bar_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  55582. name: "ElSplitterBar",
  55583. __name: "split-bar",
  55584. props: {
  55585. index: {
  55586. type: Number,
  55587. required: true
  55588. },
  55589. layout: {
  55590. type: String,
  55591. values: ["horizontal", "vertical"],
  55592. default: "horizontal"
  55593. },
  55594. resizable: {
  55595. type: Boolean,
  55596. default: true
  55597. },
  55598. lazy: Boolean,
  55599. startCollapsible: Boolean,
  55600. endCollapsible: Boolean
  55601. },
  55602. emits: [
  55603. "moveStart",
  55604. "moving",
  55605. "moveEnd",
  55606. "collapse"
  55607. ],
  55608. setup(__props, { emit: __emit }) {
  55609. const ns = useNamespace("splitter-bar");
  55610. const props = __props;
  55611. const emit = __emit;
  55612. const isHorizontal = (0, vue.computed)(() => props.layout === "horizontal");
  55613. const barWrapStyles = (0, vue.computed)(() => {
  55614. if (isHorizontal.value) return { width: 0 };
  55615. return { height: 0 };
  55616. });
  55617. const draggerStyles = (0, vue.computed)(() => {
  55618. return {
  55619. width: isHorizontal.value ? "16px" : "100%",
  55620. height: isHorizontal.value ? "100%" : "16px",
  55621. cursor: !props.resizable ? "auto" : isHorizontal.value ? "ew-resize" : "ns-resize",
  55622. touchAction: "none"
  55623. };
  55624. });
  55625. const draggerPseudoClass = (0, vue.computed)(() => {
  55626. const prefix = ns.e("dragger");
  55627. return {
  55628. [`${prefix}-horizontal`]: isHorizontal.value,
  55629. [`${prefix}-vertical`]: !isHorizontal.value,
  55630. [`${prefix}-active`]: !!startPos.value
  55631. };
  55632. });
  55633. const startPos = (0, vue.ref)(null);
  55634. const onMousedown = (e) => {
  55635. if (!props.resizable) return;
  55636. startPos.value = [e.pageX, e.pageY];
  55637. emit("moveStart", props.index);
  55638. window.addEventListener("mouseup", onMouseUp);
  55639. window.addEventListener("mousemove", onMouseMove);
  55640. };
  55641. const onTouchStart = (e) => {
  55642. if (props.resizable && e.touches.length === 1) {
  55643. e.preventDefault();
  55644. const touch = e.touches[0];
  55645. startPos.value = [touch.pageX, touch.pageY];
  55646. emit("moveStart", props.index);
  55647. window.addEventListener("touchend", onTouchEnd);
  55648. window.addEventListener("touchmove", onTouchMove);
  55649. }
  55650. };
  55651. const onMouseMove = (e) => {
  55652. const { pageX, pageY } = e;
  55653. const offsetX = pageX - startPos.value[0];
  55654. const offsetY = pageY - startPos.value[1];
  55655. const offset = isHorizontal.value ? offsetX : offsetY;
  55656. emit("moving", props.index, offset);
  55657. };
  55658. const onTouchMove = (e) => {
  55659. if (e.touches.length === 1) {
  55660. e.preventDefault();
  55661. const touch = e.touches[0];
  55662. const offsetX = touch.pageX - startPos.value[0];
  55663. const offsetY = touch.pageY - startPos.value[1];
  55664. const offset = isHorizontal.value ? offsetX : offsetY;
  55665. emit("moving", props.index, offset);
  55666. }
  55667. };
  55668. const onMouseUp = () => {
  55669. startPos.value = null;
  55670. window.removeEventListener("mouseup", onMouseUp);
  55671. window.removeEventListener("mousemove", onMouseMove);
  55672. emit("moveEnd", props.index);
  55673. };
  55674. const onTouchEnd = () => {
  55675. startPos.value = null;
  55676. window.removeEventListener("touchend", onTouchEnd);
  55677. window.removeEventListener("touchmove", onTouchMove);
  55678. emit("moveEnd", props.index);
  55679. };
  55680. const StartIcon = (0, vue.computed)(() => isHorizontal.value ? arrow_left_default : arrow_up_default);
  55681. const EndIcon = (0, vue.computed)(() => isHorizontal.value ? arrow_right_default : arrow_down_default);
  55682. return (_ctx, _cache) => {
  55683. return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55684. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).b()]),
  55685. style: (0, vue.normalizeStyle)(barWrapStyles.value)
  55686. }, [
  55687. __props.startCollapsible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55688. key: 0,
  55689. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("collapse-icon"), (0, vue.unref)(ns).e(`${__props.layout}-collapse-icon-start`)]),
  55690. onClick: _cache[0] || (_cache[0] = ($event) => emit("collapse", __props.index, "start"))
  55691. }, [(0, vue.renderSlot)(_ctx.$slots, "start-collapsible", {}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(StartIcon.value), { style: {
  55692. "width": "12px",
  55693. "height": "12px"
  55694. } }))])], 2)) : (0, vue.createCommentVNode)("v-if", true),
  55695. (0, vue.createElementVNode)("div", {
  55696. class: (0, vue.normalizeClass)([
  55697. (0, vue.unref)(ns).e("dragger"),
  55698. draggerPseudoClass.value,
  55699. (0, vue.unref)(ns).is("disabled", !__props.resizable),
  55700. (0, vue.unref)(ns).is("lazy", __props.resizable && __props.lazy)
  55701. ]),
  55702. style: (0, vue.normalizeStyle)(draggerStyles.value),
  55703. onMousedown,
  55704. onTouchstart: onTouchStart
  55705. }, null, 38),
  55706. __props.endCollapsible ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  55707. key: 1,
  55708. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("collapse-icon"), (0, vue.unref)(ns).e(`${__props.layout}-collapse-icon-end`)]),
  55709. onClick: _cache[1] || (_cache[1] = ($event) => emit("collapse", __props.index, "end"))
  55710. }, [(0, vue.renderSlot)(_ctx.$slots, "end-collapsible", {}, () => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(EndIcon.value), { style: {
  55711. "width": "12px",
  55712. "height": "12px"
  55713. } }))])], 2)) : (0, vue.createCommentVNode)("v-if", true)
  55714. ], 6);
  55715. };
  55716. }
  55717. });
  55718. //#endregion
  55719. //#region ../../packages/components/splitter/src/split-bar.vue
  55720. var split_bar_default = split_bar_vue_vue_type_script_setup_true_lang_default;
  55721. //#endregion
  55722. //#region ../../packages/components/splitter/src/split-panel.vue?vue&type=script&setup=true&lang.ts
  55723. const COMPONENT_NAME = "ElSplitterPanel";
  55724. var split_panel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  55725. name: COMPONENT_NAME,
  55726. __name: "split-panel",
  55727. props: splitterPanelProps,
  55728. emits: splitterPanelEmits,
  55729. setup(__props, { expose: __expose, emit: __emit }) {
  55730. const ns = useNamespace("splitter-panel");
  55731. const props = __props;
  55732. const emits = __emit;
  55733. const splitterContext = (0, vue.inject)(splitterRootContextKey);
  55734. if (!splitterContext) throwError(COMPONENT_NAME, "usage: <el-splitter><el-splitter-panel /></el-splitter/>");
  55735. const { panels, layout, lazy, containerSize, pxSizes } = (0, vue.toRefs)(splitterContext);
  55736. const { registerPanel, unregisterPanel, onCollapse, onMoveEnd, onMoveStart, onMoving } = splitterContext;
  55737. const panelEl = (0, vue.ref)();
  55738. const instance = (0, vue.getCurrentInstance)();
  55739. const uid = instance.uid;
  55740. const index = (0, vue.ref)(0);
  55741. const panel = (0, vue.computed)(() => panels.value[index.value]);
  55742. const setIndex = (val) => {
  55743. index.value = val;
  55744. };
  55745. const panelSize = (0, vue.computed)(() => {
  55746. if (!panel.value) return 0;
  55747. return pxSizes.value[index.value] ?? 0;
  55748. });
  55749. const nextSize = (0, vue.computed)(() => {
  55750. if (!panel.value) return 0;
  55751. return pxSizes.value[index.value + 1] ?? 0;
  55752. });
  55753. const nextPanel = (0, vue.computed)(() => {
  55754. if (panel.value) return panels.value[index.value + 1];
  55755. return null;
  55756. });
  55757. const isResizable = (0, vue.computed)(() => {
  55758. if (!nextPanel.value) return false;
  55759. return props.resizable && nextPanel.value?.resizable && (panelSize.value !== 0 || !props.min) && (nextSize.value !== 0 || !nextPanel.value.min);
  55760. });
  55761. const isShowBar = (0, vue.computed)(() => {
  55762. if (!panel.value) return false;
  55763. return index.value !== panels.value.length - 1;
  55764. });
  55765. const startCollapsible = (0, vue.computed)(() => isCollapsible(panel.value, panelSize.value, nextPanel.value, nextSize.value));
  55766. const endCollapsible = (0, vue.computed)(() => isCollapsible(nextPanel.value, nextSize.value, panel.value, panelSize.value));
  55767. function sizeToPx(str) {
  55768. if (isPct(str)) return getPct(str) * containerSize.value || 0;
  55769. else if (isPx(str)) return getPx(str);
  55770. return str ?? 0;
  55771. }
  55772. let isSizeUpdating = false;
  55773. (0, vue.watch)(() => props.size, () => {
  55774. if (!isSizeUpdating && panel.value) {
  55775. if (!containerSize.value) {
  55776. panel.value.size = props.size;
  55777. return;
  55778. }
  55779. const size = sizeToPx(props.size);
  55780. const maxSize = sizeToPx(props.max);
  55781. const minSize = sizeToPx(props.min);
  55782. const finalSize = Math.min(Math.max(size, minSize || 0), maxSize || size);
  55783. if (finalSize !== size) emits("update:size", finalSize);
  55784. panel.value.size = finalSize;
  55785. }
  55786. });
  55787. (0, vue.watch)(() => panel.value?.size, (val) => {
  55788. if (val !== props.size) {
  55789. isSizeUpdating = true;
  55790. emits("update:size", val);
  55791. (0, vue.nextTick)(() => isSizeUpdating = false);
  55792. }
  55793. });
  55794. (0, vue.watch)(() => props.resizable, (val) => {
  55795. if (panel.value) panel.value.resizable = val;
  55796. });
  55797. const _panel = (0, vue.reactive)({
  55798. uid,
  55799. getVnode: () => instance.vnode,
  55800. setIndex,
  55801. ...props,
  55802. collapsible: (0, vue.computed)(() => getCollapsible(props.collapsible))
  55803. });
  55804. registerPanel(_panel);
  55805. (0, vue.onBeforeUnmount)(() => unregisterPanel(_panel));
  55806. __expose({ splitterPanelRef: panelEl });
  55807. return (_ctx, _cache) => {
  55808. return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createElementVNode)("div", (0, vue.mergeProps)({
  55809. ref_key: "panelEl",
  55810. ref: panelEl,
  55811. class: [(0, vue.unref)(ns).b()],
  55812. style: { flexBasis: `${panelSize.value}px` }
  55813. }, _ctx.$attrs), [(0, vue.renderSlot)(_ctx.$slots, "default")], 16), isShowBar.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(split_bar_default, {
  55814. key: 0,
  55815. index: index.value,
  55816. layout: (0, vue.unref)(layout),
  55817. lazy: (0, vue.unref)(lazy),
  55818. resizable: isResizable.value,
  55819. "start-collapsible": startCollapsible.value,
  55820. "end-collapsible": endCollapsible.value,
  55821. onMoveStart: (0, vue.unref)(onMoveStart),
  55822. onMoving: (0, vue.unref)(onMoving),
  55823. onMoveEnd: (0, vue.unref)(onMoveEnd),
  55824. onCollapse: (0, vue.unref)(onCollapse)
  55825. }, {
  55826. "start-collapsible": (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "start-collapsible")]),
  55827. "end-collapsible": (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "end-collapsible")]),
  55828. _: 3
  55829. }, 8, [
  55830. "index",
  55831. "layout",
  55832. "lazy",
  55833. "resizable",
  55834. "start-collapsible",
  55835. "end-collapsible",
  55836. "onMoveStart",
  55837. "onMoving",
  55838. "onMoveEnd",
  55839. "onCollapse"
  55840. ])) : (0, vue.createCommentVNode)("v-if", true)], 64);
  55841. };
  55842. }
  55843. });
  55844. //#endregion
  55845. //#region ../../packages/components/splitter/src/split-panel.vue
  55846. var split_panel_default = split_panel_vue_vue_type_script_setup_true_lang_default;
  55847. //#endregion
  55848. //#region ../../packages/components/splitter/index.ts
  55849. const ElSplitter = withInstall(splitter_default, { SplitPanel: split_panel_default });
  55850. const ElSplitterPanel = withNoopInstall(split_panel_default);
  55851. //#endregion
  55852. //#region ../../packages/element-plus/component.ts
  55853. var component_default = [
  55854. ElAffix,
  55855. ElAlert,
  55856. ElAutocomplete,
  55857. ElAutoResizer,
  55858. ElAvatar,
  55859. ElAvatarGroup,
  55860. ElBacktop,
  55861. ElBadge,
  55862. ElBreadcrumb,
  55863. ElBreadcrumbItem,
  55864. ElButton,
  55865. ElButtonGroup,
  55866. ElCalendar,
  55867. ElCard,
  55868. ElCarousel,
  55869. ElCarouselItem,
  55870. ElCascader,
  55871. ElCascaderPanel,
  55872. ElCheckTag,
  55873. ElCheckbox,
  55874. ElCheckboxButton,
  55875. ElCheckboxGroup,
  55876. ElCol,
  55877. ElCollapse,
  55878. ElCollapseItem,
  55879. ElCollapseTransition,
  55880. ElColorPickerPanel,
  55881. ElColorPicker,
  55882. ElConfigProvider,
  55883. ElContainer,
  55884. ElAside,
  55885. ElFooter,
  55886. ElHeader,
  55887. ElMain,
  55888. ElDatePicker,
  55889. ElDatePickerPanel,
  55890. ElDescriptions,
  55891. ElDescriptionsItem,
  55892. ElDialog,
  55893. ElDivider,
  55894. ElDrawer,
  55895. ElDropdown,
  55896. ElDropdownItem,
  55897. ElDropdownMenu,
  55898. ElEmpty,
  55899. ElForm,
  55900. ElFormItem,
  55901. ElIcon,
  55902. ElImage,
  55903. ElImageViewer,
  55904. ElInput,
  55905. ElInputNumber,
  55906. ElInputTag,
  55907. ElLink,
  55908. ElMenu,
  55909. ElMenuItem,
  55910. ElMenuItemGroup,
  55911. ElSubMenu,
  55912. ElPageHeader,
  55913. ElPagination,
  55914. ElPopconfirm,
  55915. ElPopover,
  55916. ElPopper,
  55917. ElProgress,
  55918. ElRadio,
  55919. ElRadioButton,
  55920. ElRadioGroup,
  55921. ElRate,
  55922. ElResult,
  55923. ElRow,
  55924. ElScrollbar,
  55925. ElSelect,
  55926. ElOption,
  55927. ElOptionGroup,
  55928. ElSelectV2,
  55929. ElSkeleton,
  55930. ElSkeletonItem,
  55931. ElSlider,
  55932. ElSpace,
  55933. ElStatistic,
  55934. ElCountdown,
  55935. ElSteps,
  55936. ElStep,
  55937. ElSwitch,
  55938. ElTable,
  55939. ElTableColumn,
  55940. ElTableV2,
  55941. ElTabs,
  55942. ElTabPane,
  55943. ElTag,
  55944. ElText,
  55945. ElTimePicker,
  55946. ElTimeSelect,
  55947. ElTimeline,
  55948. ElTimelineItem,
  55949. ElTooltip,
  55950. ElTransfer,
  55951. ElTree,
  55952. ElTreeSelect,
  55953. ElTreeV2,
  55954. ElUpload,
  55955. ElWatermark,
  55956. ElTour,
  55957. ElTourStep,
  55958. ElAnchor,
  55959. ElAnchorLink,
  55960. ElSegmented,
  55961. ElMention,
  55962. ElSplitter,
  55963. ElSplitterPanel
  55964. ];
  55965. //#endregion
  55966. //#region ../../packages/components/infinite-scroll/src/index.ts
  55967. const SCOPE$1 = "ElInfiniteScroll";
  55968. const CHECK_INTERVAL = 50;
  55969. const DEFAULT_DELAY = 200;
  55970. const DEFAULT_DISTANCE = 0;
  55971. const attributes = {
  55972. delay: {
  55973. type: Number,
  55974. default: DEFAULT_DELAY
  55975. },
  55976. distance: {
  55977. type: Number,
  55978. default: DEFAULT_DISTANCE
  55979. },
  55980. disabled: {
  55981. type: Boolean,
  55982. default: false
  55983. },
  55984. immediate: {
  55985. type: Boolean,
  55986. default: true
  55987. }
  55988. };
  55989. const getScrollOptions = (el, instance) => {
  55990. return Object.entries(attributes).reduce((acm, [name, option]) => {
  55991. const { type, default: defaultValue } = option;
  55992. const attrVal = el.getAttribute(`infinite-scroll-${name}`);
  55993. let value = instance[attrVal] ?? attrVal ?? defaultValue;
  55994. value = value === "false" ? false : value;
  55995. value = type(value);
  55996. acm[name] = Number.isNaN(value) ? defaultValue : value;
  55997. return acm;
  55998. }, {});
  55999. };
  56000. const destroyObserver = (el) => {
  56001. const { observer } = el[SCOPE$1];
  56002. if (observer) {
  56003. observer.disconnect();
  56004. delete el[SCOPE$1].observer;
  56005. }
  56006. };
  56007. const handleScroll = (el, cb) => {
  56008. const { container, containerEl, instance, observer, lastScrollTop } = el[SCOPE$1];
  56009. const { disabled, distance } = getScrollOptions(el, instance);
  56010. const { clientHeight, scrollHeight, scrollTop } = containerEl;
  56011. const delta = scrollTop - lastScrollTop;
  56012. el[SCOPE$1].lastScrollTop = scrollTop;
  56013. if (observer || disabled || delta < 0) return;
  56014. let shouldTrigger = false;
  56015. if (container === el) shouldTrigger = scrollHeight - (clientHeight + scrollTop) <= distance;
  56016. else {
  56017. const { clientTop, scrollHeight: height } = el;
  56018. const offsetTop = getOffsetTopDistance(el, containerEl);
  56019. shouldTrigger = scrollTop + clientHeight >= offsetTop + clientTop + height - distance;
  56020. }
  56021. if (shouldTrigger) cb.call(instance);
  56022. };
  56023. function checkFull(el, cb) {
  56024. const { containerEl, instance } = el[SCOPE$1];
  56025. const { disabled } = getScrollOptions(el, instance);
  56026. if (disabled || containerEl.clientHeight === 0) return;
  56027. if (containerEl.scrollHeight <= containerEl.clientHeight) cb.call(instance);
  56028. else destroyObserver(el);
  56029. }
  56030. const InfiniteScroll = {
  56031. async mounted(el, binding) {
  56032. const { instance, value: cb } = binding;
  56033. useDeprecated({
  56034. scope: SCOPE$1,
  56035. from: "the directive v-infinite-scroll",
  56036. replacement: "the el-scrollbar infinite scroll",
  56037. version: "3.0.0",
  56038. ref: "https://element-plus.org/en-US/component/scrollbar#infinite-scroll"
  56039. }, true);
  56040. if (!isFunction$1(cb)) throwError(SCOPE$1, "'v-infinite-scroll' binding value must be a function");
  56041. await (0, vue.nextTick)();
  56042. const { delay, immediate } = getScrollOptions(el, instance);
  56043. const container = getScrollContainer(el, true);
  56044. const containerEl = container === window ? document.documentElement : container;
  56045. const onScroll = throttle(handleScroll.bind(null, el, cb), delay);
  56046. if (!container) return;
  56047. el[SCOPE$1] = {
  56048. instance,
  56049. container,
  56050. containerEl,
  56051. delay,
  56052. cb,
  56053. onScroll,
  56054. lastScrollTop: containerEl.scrollTop
  56055. };
  56056. if (immediate) {
  56057. const observer = new MutationObserver(throttle(checkFull.bind(null, el, cb), CHECK_INTERVAL));
  56058. el[SCOPE$1].observer = observer;
  56059. observer.observe(el, {
  56060. childList: true,
  56061. subtree: true
  56062. });
  56063. checkFull(el, cb);
  56064. }
  56065. container.addEventListener("scroll", onScroll);
  56066. },
  56067. unmounted(el) {
  56068. if (!el[SCOPE$1]) return;
  56069. const { container, onScroll } = el[SCOPE$1];
  56070. container?.removeEventListener("scroll", onScroll);
  56071. destroyObserver(el);
  56072. },
  56073. async updated(el) {
  56074. if (!el[SCOPE$1]) await (0, vue.nextTick)();
  56075. else {
  56076. const { containerEl, cb, observer } = el[SCOPE$1];
  56077. if (containerEl.clientHeight && observer) checkFull(el, cb);
  56078. }
  56079. }
  56080. };
  56081. //#endregion
  56082. //#region ../../packages/components/infinite-scroll/index.ts
  56083. const _InfiniteScroll = InfiniteScroll;
  56084. _InfiniteScroll.install = (app) => {
  56085. app.directive("InfiniteScroll", _InfiniteScroll);
  56086. };
  56087. const ElInfiniteScroll = _InfiniteScroll;
  56088. //#endregion
  56089. //#region ../../packages/components/loading/src/loading.ts
  56090. function createLoadingComponent(options, appContext) {
  56091. let afterLeaveTimer;
  56092. const afterLeaveFlag = (0, vue.ref)(false);
  56093. const data = (0, vue.reactive)({
  56094. ...options,
  56095. originalPosition: "",
  56096. originalOverflow: "",
  56097. visible: false
  56098. });
  56099. function setText(text) {
  56100. data.text = text;
  56101. }
  56102. function destroySelf() {
  56103. const target = data.parent;
  56104. const ns = vm.ns;
  56105. if (!target.vLoadingAddClassList) {
  56106. let loadingNumber = target.getAttribute("loading-number");
  56107. loadingNumber = Number.parseInt(loadingNumber) - 1;
  56108. if (!loadingNumber) {
  56109. removeClass(target, ns.bm("parent", "relative"));
  56110. target.removeAttribute("loading-number");
  56111. } else target.setAttribute("loading-number", loadingNumber.toString());
  56112. removeClass(target, ns.bm("parent", "hidden"));
  56113. }
  56114. removeElLoadingChild();
  56115. loadingInstance.unmount();
  56116. }
  56117. function removeElLoadingChild() {
  56118. vm.$el?.parentNode?.removeChild(vm.$el);
  56119. }
  56120. function close() {
  56121. if (options.beforeClose && !options.beforeClose()) return;
  56122. afterLeaveFlag.value = true;
  56123. clearTimeout(afterLeaveTimer);
  56124. afterLeaveTimer = setTimeout(handleAfterLeave, 400);
  56125. data.visible = false;
  56126. options.closed?.();
  56127. }
  56128. function handleAfterLeave() {
  56129. if (!afterLeaveFlag.value) return;
  56130. const target = data.parent;
  56131. afterLeaveFlag.value = false;
  56132. target.vLoadingAddClassList = void 0;
  56133. destroySelf();
  56134. }
  56135. const loadingInstance = (0, vue.createApp)((0, vue.defineComponent)({
  56136. name: "ElLoading",
  56137. setup(_, { expose }) {
  56138. const { ns, zIndex } = useGlobalComponentSettings("loading");
  56139. expose({
  56140. ns,
  56141. zIndex
  56142. });
  56143. return () => {
  56144. const svg = data.spinner || data.svg;
  56145. const spinner = (0, vue.h)("svg", {
  56146. class: "circular",
  56147. viewBox: data.svgViewBox ? data.svgViewBox : "0 0 50 50",
  56148. ...svg ? { innerHTML: svg } : {}
  56149. }, [(0, vue.h)("circle", {
  56150. class: "path",
  56151. cx: "25",
  56152. cy: "25",
  56153. r: "20",
  56154. fill: "none"
  56155. })]);
  56156. const spinnerText = data.text ? (0, vue.h)("p", { class: ns.b("text") }, [data.text]) : void 0;
  56157. return (0, vue.h)(vue.Transition, {
  56158. name: ns.b("fade"),
  56159. onAfterLeave: handleAfterLeave
  56160. }, { default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)("div", {
  56161. style: { backgroundColor: data.background || "" },
  56162. class: [
  56163. ns.b("mask"),
  56164. data.customClass,
  56165. ns.is("fullscreen", data.fullscreen)
  56166. ]
  56167. }, [(0, vue.h)("div", { class: ns.b("spinner") }, [spinner, spinnerText])]), [[vue.vShow, data.visible]])]) });
  56168. };
  56169. }
  56170. }));
  56171. Object.assign(loadingInstance._context, appContext ?? {});
  56172. const vm = loadingInstance.mount(document.createElement("div"));
  56173. return {
  56174. ...(0, vue.toRefs)(data),
  56175. setText,
  56176. removeElLoadingChild,
  56177. close,
  56178. handleAfterLeave,
  56179. vm,
  56180. get $el() {
  56181. return vm.$el;
  56182. }
  56183. };
  56184. }
  56185. //#endregion
  56186. //#region ../../packages/components/loading/src/service.ts
  56187. let fullscreenInstance = void 0;
  56188. const Loading = function(options = {}, context) {
  56189. if (!isClient) return void 0;
  56190. const resolved = resolveOptions(options);
  56191. if (resolved.fullscreen && fullscreenInstance) return fullscreenInstance;
  56192. const instance = createLoadingComponent({
  56193. ...resolved,
  56194. closed: () => {
  56195. resolved.closed?.();
  56196. if (resolved.fullscreen) fullscreenInstance = void 0;
  56197. }
  56198. }, context ?? Loading._context);
  56199. addStyle(resolved, resolved.parent, instance);
  56200. addClassList(resolved, resolved.parent, instance);
  56201. resolved.parent.vLoadingAddClassList = () => addClassList(resolved, resolved.parent, instance);
  56202. /**
  56203. * add loading-number to parent.
  56204. * because if a fullscreen loading is triggered when somewhere
  56205. * a v-loading.body was triggered before and it's parent is
  56206. * document.body which with a margin , the fullscreen loading's
  56207. * destroySelf function will remove 'el-loading-parent--relative',
  56208. * and then the position of v-loading.body will be error.
  56209. */
  56210. let loadingNumber = resolved.parent.getAttribute("loading-number");
  56211. if (!loadingNumber) loadingNumber = "1";
  56212. else loadingNumber = `${Number.parseInt(loadingNumber) + 1}`;
  56213. resolved.parent.setAttribute("loading-number", loadingNumber);
  56214. resolved.parent.appendChild(instance.$el);
  56215. (0, vue.nextTick)(() => instance.visible.value = resolved.visible);
  56216. if (resolved.fullscreen) fullscreenInstance = instance;
  56217. return instance;
  56218. };
  56219. const resolveOptions = (options) => {
  56220. let target;
  56221. if (isString(options.target)) target = document.querySelector(options.target) ?? document.body;
  56222. else target = options.target || document.body;
  56223. return {
  56224. parent: target === document.body || options.body ? document.body : target,
  56225. background: options.background || "",
  56226. svg: options.svg || "",
  56227. svgViewBox: options.svgViewBox || "",
  56228. spinner: options.spinner || false,
  56229. text: options.text || "",
  56230. fullscreen: target === document.body && (options.fullscreen ?? true),
  56231. lock: options.lock ?? false,
  56232. customClass: options.customClass || "",
  56233. visible: options.visible ?? true,
  56234. beforeClose: options.beforeClose,
  56235. closed: options.closed,
  56236. target
  56237. };
  56238. };
  56239. const addStyle = async (options, parent, instance) => {
  56240. const { nextZIndex } = instance.vm.zIndex || instance.vm._.exposed.zIndex;
  56241. const maskStyle = {};
  56242. if (options.fullscreen) {
  56243. instance.originalPosition.value = getStyle(document.body, "position");
  56244. instance.originalOverflow.value = getStyle(document.body, "overflow");
  56245. maskStyle.zIndex = nextZIndex();
  56246. } else if (options.parent === document.body) {
  56247. instance.originalPosition.value = getStyle(document.body, "position");
  56248. /**
  56249. * await dom render when visible is true in init,
  56250. * because some component's height maybe 0.
  56251. * e.g. el-table.
  56252. */
  56253. await (0, vue.nextTick)();
  56254. for (const property of ["top", "left"]) {
  56255. const scroll = property === "top" ? "scrollTop" : "scrollLeft";
  56256. maskStyle[property] = `${options.target.getBoundingClientRect()[property] + document.body[scroll] + document.documentElement[scroll] - Number.parseInt(getStyle(document.body, `margin-${property}`), 10)}px`;
  56257. }
  56258. for (const property of ["height", "width"]) maskStyle[property] = `${options.target.getBoundingClientRect()[property]}px`;
  56259. } else instance.originalPosition.value = getStyle(parent, "position");
  56260. for (const [key, value] of Object.entries(maskStyle)) instance.$el.style[key] = value;
  56261. };
  56262. const addClassList = (options, parent, instance) => {
  56263. const ns = instance.vm.ns || instance.vm._.exposed.ns;
  56264. if (![
  56265. "absolute",
  56266. "fixed",
  56267. "sticky"
  56268. ].includes(instance.originalPosition.value)) addClass(parent, ns.bm("parent", "relative"));
  56269. else removeClass(parent, ns.bm("parent", "relative"));
  56270. if (options.fullscreen && options.lock) addClass(parent, ns.bm("parent", "hidden"));
  56271. else removeClass(parent, ns.bm("parent", "hidden"));
  56272. };
  56273. Loading._context = null;
  56274. //#endregion
  56275. //#region ../../packages/components/loading/src/directive.ts
  56276. const INSTANCE_KEY = Symbol("ElLoading");
  56277. const getAttributeName = (name) => {
  56278. return `element-loading-${hyphenate(name)}`;
  56279. };
  56280. const createInstance = (el, binding) => {
  56281. const vm = binding.instance;
  56282. const getBindingProp = (key) => isObject$1(binding.value) ? binding.value[key] : void 0;
  56283. const resolveExpression = (key) => {
  56284. return (0, vue.ref)(isString(key) && vm?.[key] || key);
  56285. };
  56286. const getProp = (name) => resolveExpression(getBindingProp(name) || el.getAttribute(getAttributeName(name)));
  56287. const fullscreen = getBindingProp("fullscreen") ?? binding.modifiers.fullscreen;
  56288. const options = {
  56289. text: getProp("text"),
  56290. svg: getProp("svg"),
  56291. svgViewBox: getProp("svgViewBox"),
  56292. spinner: getProp("spinner"),
  56293. background: getProp("background"),
  56294. customClass: getProp("customClass"),
  56295. fullscreen,
  56296. target: getBindingProp("target") ?? (fullscreen ? void 0 : el),
  56297. body: getBindingProp("body") ?? binding.modifiers.body,
  56298. lock: getBindingProp("lock") ?? binding.modifiers.lock
  56299. };
  56300. const instance = Loading(options);
  56301. instance._context = vLoading._context;
  56302. el[INSTANCE_KEY] = {
  56303. options,
  56304. instance
  56305. };
  56306. };
  56307. const updateOptions = (originalOptions, newOptions) => {
  56308. for (const key of Object.keys(originalOptions)) if ((0, vue.isRef)(originalOptions[key])) originalOptions[key].value = newOptions[key];
  56309. };
  56310. const vLoading = {
  56311. mounted(el, binding) {
  56312. if (binding.value) createInstance(el, binding);
  56313. },
  56314. updated(el, binding) {
  56315. const instance = el[INSTANCE_KEY];
  56316. if (!binding.value) {
  56317. instance?.instance.close();
  56318. el[INSTANCE_KEY] = null;
  56319. return;
  56320. }
  56321. if (!instance) createInstance(el, binding);
  56322. else updateOptions(instance.options, isObject$1(binding.value) ? binding.value : {
  56323. text: el.getAttribute(getAttributeName("text")),
  56324. svg: el.getAttribute(getAttributeName("svg")),
  56325. svgViewBox: el.getAttribute(getAttributeName("svgViewBox")),
  56326. spinner: el.getAttribute(getAttributeName("spinner")),
  56327. background: el.getAttribute(getAttributeName("background")),
  56328. customClass: el.getAttribute(getAttributeName("customClass"))
  56329. });
  56330. },
  56331. unmounted(el) {
  56332. el[INSTANCE_KEY]?.instance.close();
  56333. el[INSTANCE_KEY] = null;
  56334. }
  56335. };
  56336. vLoading._context = null;
  56337. //#endregion
  56338. //#region ../../packages/components/loading/index.ts
  56339. const ElLoading = {
  56340. install(app) {
  56341. Loading._context = app._context;
  56342. vLoading._context = app._context;
  56343. app.directive("loading", vLoading);
  56344. app.config.globalProperties.$loading = Loading;
  56345. },
  56346. directive: vLoading,
  56347. service: Loading
  56348. };
  56349. //#endregion
  56350. //#region ../../packages/components/message/src/message.ts
  56351. const messageTypes = [
  56352. "primary",
  56353. "success",
  56354. "info",
  56355. "warning",
  56356. "error"
  56357. ];
  56358. const messagePlacement = [
  56359. "top",
  56360. "top-left",
  56361. "top-right",
  56362. "bottom",
  56363. "bottom-left",
  56364. "bottom-right"
  56365. ];
  56366. const MESSAGE_DEFAULT_PLACEMENT = "top";
  56367. const messageDefaults = mutable({
  56368. customClass: "",
  56369. dangerouslyUseHTMLString: false,
  56370. duration: 3e3,
  56371. icon: void 0,
  56372. id: "",
  56373. message: "",
  56374. onClose: void 0,
  56375. showClose: false,
  56376. type: "info",
  56377. plain: false,
  56378. offset: 16,
  56379. placement: void 0,
  56380. zIndex: 0,
  56381. grouping: false,
  56382. repeatNum: 1,
  56383. appendTo: isClient ? document.body : void 0
  56384. });
  56385. /**
  56386. * @deprecated Removed after 3.0.0, Use `MessageProps` instead.
  56387. */
  56388. const messageProps = buildProps({
  56389. customClass: {
  56390. type: String,
  56391. default: messageDefaults.customClass
  56392. },
  56393. dangerouslyUseHTMLString: {
  56394. type: Boolean,
  56395. default: messageDefaults.dangerouslyUseHTMLString
  56396. },
  56397. duration: {
  56398. type: Number,
  56399. default: messageDefaults.duration
  56400. },
  56401. icon: {
  56402. type: iconPropType,
  56403. default: messageDefaults.icon
  56404. },
  56405. id: {
  56406. type: String,
  56407. default: messageDefaults.id
  56408. },
  56409. message: {
  56410. type: definePropType([
  56411. String,
  56412. Object,
  56413. Function
  56414. ]),
  56415. default: messageDefaults.message
  56416. },
  56417. onClose: {
  56418. type: definePropType(Function),
  56419. default: messageDefaults.onClose
  56420. },
  56421. showClose: {
  56422. type: Boolean,
  56423. default: messageDefaults.showClose
  56424. },
  56425. type: {
  56426. type: String,
  56427. values: messageTypes,
  56428. default: messageDefaults.type
  56429. },
  56430. plain: {
  56431. type: Boolean,
  56432. default: messageDefaults.plain
  56433. },
  56434. offset: {
  56435. type: Number,
  56436. default: messageDefaults.offset
  56437. },
  56438. placement: {
  56439. type: String,
  56440. values: messagePlacement,
  56441. default: messageDefaults.placement
  56442. },
  56443. zIndex: {
  56444. type: Number,
  56445. default: messageDefaults.zIndex
  56446. },
  56447. grouping: {
  56448. type: Boolean,
  56449. default: messageDefaults.grouping
  56450. },
  56451. repeatNum: {
  56452. type: Number,
  56453. default: messageDefaults.repeatNum
  56454. }
  56455. });
  56456. const messageEmits = { destroy: () => true };
  56457. //#endregion
  56458. //#region ../../packages/components/message/src/instance.ts
  56459. const placementInstances = (0, vue.shallowReactive)({});
  56460. const getOrCreatePlacementInstances = (placement) => {
  56461. if (!placementInstances[placement]) placementInstances[placement] = (0, vue.shallowReactive)([]);
  56462. return placementInstances[placement];
  56463. };
  56464. const getInstance = (id, placement) => {
  56465. const instances = placementInstances[placement] || [];
  56466. const idx = instances.findIndex((instance) => instance.id === id);
  56467. const current = instances[idx];
  56468. let prev;
  56469. if (idx > 0) prev = instances[idx - 1];
  56470. return {
  56471. current,
  56472. prev
  56473. };
  56474. };
  56475. const getLastOffset = (id, placement) => {
  56476. const { prev } = getInstance(id, placement);
  56477. if (!prev) return 0;
  56478. return prev.vm.exposed.bottom.value;
  56479. };
  56480. const getOffsetOrSpace = (id, offset, placement) => {
  56481. return (placementInstances[placement] || []).findIndex((instance) => instance.id === id) > 0 ? 16 : offset;
  56482. };
  56483. //#endregion
  56484. //#region ../../packages/components/message/src/message.vue?vue&type=script&setup=true&lang.ts
  56485. const _hoisted_1$2 = ["id"];
  56486. const _hoisted_2$2 = ["innerHTML"];
  56487. var message_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  56488. name: "ElMessage",
  56489. __name: "message",
  56490. props: messageProps,
  56491. emits: messageEmits,
  56492. setup(__props, { expose: __expose, emit: __emit }) {
  56493. const { Close } = TypeComponents;
  56494. const props = __props;
  56495. const emit = __emit;
  56496. const isStartTransition = (0, vue.ref)(false);
  56497. const { ns, zIndex } = useGlobalComponentSettings("message");
  56498. const { currentZIndex, nextZIndex } = zIndex;
  56499. const messageRef = (0, vue.ref)();
  56500. const visible = (0, vue.ref)(false);
  56501. const height = (0, vue.ref)(0);
  56502. let stopTimer = void 0;
  56503. const badgeType = (0, vue.computed)(() => props.type ? props.type === "error" ? "danger" : props.type : "info");
  56504. const typeClass = (0, vue.computed)(() => {
  56505. const type = props.type;
  56506. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  56507. });
  56508. const iconComponent = (0, vue.computed)(() => props.icon || TypeComponentsMap[props.type] || "");
  56509. const placement = (0, vue.computed)(() => props.placement || MESSAGE_DEFAULT_PLACEMENT);
  56510. const lastOffset = (0, vue.computed)(() => getLastOffset(props.id, placement.value));
  56511. const offset = (0, vue.computed)(() => {
  56512. return getOffsetOrSpace(props.id, props.offset, placement.value) + lastOffset.value;
  56513. });
  56514. const bottom = (0, vue.computed)(() => height.value + offset.value);
  56515. const horizontalClass = (0, vue.computed)(() => {
  56516. if (placement.value.includes("left")) return ns.is("left");
  56517. if (placement.value.includes("right")) return ns.is("right");
  56518. return ns.is("center");
  56519. });
  56520. const verticalProperty = (0, vue.computed)(() => placement.value.startsWith("top") ? "top" : "bottom");
  56521. const customStyle = (0, vue.computed)(() => ({
  56522. [verticalProperty.value]: `${offset.value}px`,
  56523. zIndex: currentZIndex.value
  56524. }));
  56525. function startTimer() {
  56526. if (props.duration === 0) return;
  56527. ({stop: stopTimer} = useTimeoutFn(() => {
  56528. close();
  56529. }, props.duration));
  56530. }
  56531. function clearTimer() {
  56532. stopTimer?.();
  56533. }
  56534. function close() {
  56535. visible.value = false;
  56536. (0, vue.nextTick)(() => {
  56537. if (!isStartTransition.value) {
  56538. props.onClose?.();
  56539. emit("destroy");
  56540. }
  56541. });
  56542. }
  56543. function keydown(event) {
  56544. if (getEventCode(event) === EVENT_CODE.esc) close();
  56545. }
  56546. (0, vue.onMounted)(() => {
  56547. startTimer();
  56548. nextZIndex();
  56549. visible.value = true;
  56550. });
  56551. (0, vue.watch)(() => props.repeatNum, () => {
  56552. clearTimer();
  56553. startTimer();
  56554. });
  56555. useEventListener(document, "keydown", keydown);
  56556. useResizeObserver(messageRef, () => {
  56557. height.value = messageRef.value.getBoundingClientRect().height;
  56558. });
  56559. __expose({
  56560. visible,
  56561. bottom,
  56562. close
  56563. });
  56564. return (_ctx, _cache) => {
  56565. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  56566. name: (0, vue.unref)(ns).b("fade"),
  56567. onBeforeEnter: _cache[0] || (_cache[0] = ($event) => isStartTransition.value = true),
  56568. onBeforeLeave: __props.onClose,
  56569. onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
  56570. persisted: ""
  56571. }, {
  56572. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  56573. id: __props.id,
  56574. ref_key: "messageRef",
  56575. ref: messageRef,
  56576. class: (0, vue.normalizeClass)([
  56577. (0, vue.unref)(ns).b(),
  56578. { [(0, vue.unref)(ns).m(__props.type)]: __props.type },
  56579. (0, vue.unref)(ns).is("closable", __props.showClose),
  56580. (0, vue.unref)(ns).is("plain", __props.plain),
  56581. (0, vue.unref)(ns).is("bottom", verticalProperty.value === "bottom"),
  56582. horizontalClass.value,
  56583. __props.customClass
  56584. ]),
  56585. style: (0, vue.normalizeStyle)(customStyle.value),
  56586. role: "alert",
  56587. onMouseenter: clearTimer,
  56588. onMouseleave: startTimer
  56589. }, [
  56590. __props.repeatNum > 1 ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElBadge), {
  56591. key: 0,
  56592. value: __props.repeatNum,
  56593. type: badgeType.value,
  56594. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("badge"))
  56595. }, null, 8, [
  56596. "value",
  56597. "type",
  56598. "class"
  56599. ])) : (0, vue.createCommentVNode)("v-if", true),
  56600. iconComponent.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  56601. key: 1,
  56602. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), typeClass.value])
  56603. }, {
  56604. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(iconComponent.value)))]),
  56605. _: 1
  56606. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true),
  56607. (0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", {
  56608. key: 0,
  56609. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content"))
  56610. }, (0, vue.toDisplayString)(__props.message), 3)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createCommentVNode)(" Caution here, message could've been compromised, never use user's input as message "), (0, vue.createElementVNode)("p", {
  56611. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")),
  56612. innerHTML: __props.message
  56613. }, null, 10, _hoisted_2$2)], 2112))]),
  56614. __props.showClose ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  56615. key: 2,
  56616. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("closeBtn")),
  56617. onClick: (0, vue.withModifiers)(close, ["stop"])
  56618. }, {
  56619. default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(Close))]),
  56620. _: 1
  56621. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  56622. ], 46, _hoisted_1$2), [[vue.vShow, visible.value]])]),
  56623. _: 3
  56624. }, 8, ["name", "onBeforeLeave"]);
  56625. };
  56626. }
  56627. });
  56628. //#endregion
  56629. //#region ../../packages/components/message/src/message.vue
  56630. var message_default = message_vue_vue_type_script_setup_true_lang_default;
  56631. //#endregion
  56632. //#region ../../packages/components/message/src/method.ts
  56633. let seed$1 = 1;
  56634. const normalizeAppendTo = (normalized) => {
  56635. if (!normalized.appendTo) normalized.appendTo = document.body;
  56636. else if (isString(normalized.appendTo)) {
  56637. let appendTo = document.querySelector(normalized.appendTo);
  56638. if (!isElement$1(appendTo)) {
  56639. /* @__PURE__ */ debugWarn("ElMessage", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  56640. appendTo = document.body;
  56641. }
  56642. normalized.appendTo = appendTo;
  56643. }
  56644. };
  56645. const normalizePlacement = (normalized) => {
  56646. if (!normalized.placement && isString(messageConfig.placement) && messageConfig.placement) normalized.placement = messageConfig.placement;
  56647. if (!normalized.placement) normalized.placement = MESSAGE_DEFAULT_PLACEMENT;
  56648. if (!messagePlacement.includes(normalized.placement)) {
  56649. /* @__PURE__ */ debugWarn("ElMessage", `Invalid placement: ${normalized.placement}. Falling back to '${MESSAGE_DEFAULT_PLACEMENT}'.`);
  56650. normalized.placement = MESSAGE_DEFAULT_PLACEMENT;
  56651. }
  56652. };
  56653. const normalizeOptions = (params) => {
  56654. const options = !params || isString(params) || (0, vue.isVNode)(params) || isFunction$1(params) ? { message: params } : params;
  56655. const normalized = {
  56656. ...messageDefaults,
  56657. ...options
  56658. };
  56659. normalizeAppendTo(normalized);
  56660. normalizePlacement(normalized);
  56661. if (isBoolean(messageConfig.grouping) && !normalized.grouping) normalized.grouping = messageConfig.grouping;
  56662. if (isNumber(messageConfig.duration) && normalized.duration === 3e3) normalized.duration = messageConfig.duration;
  56663. if (isNumber(messageConfig.offset) && normalized.offset === 16) normalized.offset = messageConfig.offset;
  56664. if (isBoolean(messageConfig.showClose) && !normalized.showClose) normalized.showClose = messageConfig.showClose;
  56665. if (isBoolean(messageConfig.plain) && !normalized.plain) normalized.plain = messageConfig.plain;
  56666. return normalized;
  56667. };
  56668. const closeMessage = (instance) => {
  56669. const instances = placementInstances[instance.props.placement || MESSAGE_DEFAULT_PLACEMENT];
  56670. const idx = instances.indexOf(instance);
  56671. if (idx === -1) return;
  56672. instances.splice(idx, 1);
  56673. const { handler } = instance;
  56674. handler.close();
  56675. };
  56676. const createMessage = ({ appendTo, ...options }, context) => {
  56677. const id = `message_${seed$1++}`;
  56678. const userOnClose = options.onClose;
  56679. const container = document.createElement("div");
  56680. const props = {
  56681. ...options,
  56682. id,
  56683. onClose: () => {
  56684. userOnClose?.();
  56685. closeMessage(instance);
  56686. },
  56687. onDestroy: () => {
  56688. (0, vue.render)(null, container);
  56689. }
  56690. };
  56691. const vnode = (0, vue.createVNode)(message_default, props, isFunction$1(props.message) || (0, vue.isVNode)(props.message) ? { default: isFunction$1(props.message) ? props.message : () => props.message } : null);
  56692. vnode.appContext = context || message._context;
  56693. (0, vue.render)(vnode, container);
  56694. appendTo.appendChild(container.firstElementChild);
  56695. const vm = vnode.component;
  56696. const instance = {
  56697. id,
  56698. vnode,
  56699. vm,
  56700. handler: { close: () => {
  56701. vm.exposed.close();
  56702. } },
  56703. props: vnode.component.props
  56704. };
  56705. return instance;
  56706. };
  56707. const message = (options = {}, context) => {
  56708. if (!isClient) return { close: () => void 0 };
  56709. const normalized = normalizeOptions(options);
  56710. const instances = getOrCreatePlacementInstances(normalized.placement || MESSAGE_DEFAULT_PLACEMENT);
  56711. if (normalized.grouping && instances.length) {
  56712. const instance = instances.find(({ vnode: vm }) => vm.props?.message === normalized.message);
  56713. if (instance) {
  56714. instance.props.repeatNum += 1;
  56715. instance.props.type = normalized.type;
  56716. return instance.handler;
  56717. }
  56718. }
  56719. if (isNumber(messageConfig.max) && instances.length >= messageConfig.max) return { close: () => void 0 };
  56720. const instance = createMessage(normalized, context);
  56721. instances.push(instance);
  56722. return instance.handler;
  56723. };
  56724. messageTypes.forEach((type) => {
  56725. message[type] = (options = {}, appContext) => {
  56726. return message({
  56727. ...normalizeOptions(options),
  56728. type
  56729. }, appContext);
  56730. };
  56731. });
  56732. function closeAll$1(type) {
  56733. for (const placement in placementInstances) if (hasOwn(placementInstances, placement)) {
  56734. const instances = [...placementInstances[placement]];
  56735. for (const instance of instances) if (!type || type === instance.props.type) instance.handler.close();
  56736. }
  56737. }
  56738. function closeAllByPlacement(placement) {
  56739. if (!placementInstances[placement]) return;
  56740. [...placementInstances[placement]].forEach((instance) => instance.handler.close());
  56741. }
  56742. message.closeAll = closeAll$1;
  56743. message.closeAllByPlacement = closeAllByPlacement;
  56744. message._context = null;
  56745. //#endregion
  56746. //#region ../../packages/components/message/index.ts
  56747. const ElMessage = withInstallFunction(message, "$message");
  56748. //#endregion
  56749. //#region ../../packages/components/message-box/src/index.vue?vue&type=script&lang.ts
  56750. var index_vue_vue_type_script_lang_default = (0, vue.defineComponent)({
  56751. name: "ElMessageBox",
  56752. directives: { TrapFocus },
  56753. components: {
  56754. ElButton,
  56755. ElFocusTrap: focus_trap_default,
  56756. ElInput,
  56757. ElOverlay,
  56758. ElIcon,
  56759. ...TypeComponents
  56760. },
  56761. inheritAttrs: false,
  56762. props: {
  56763. buttonSize: {
  56764. type: String,
  56765. validator: isValidComponentSize
  56766. },
  56767. modal: {
  56768. type: Boolean,
  56769. default: true
  56770. },
  56771. lockScroll: {
  56772. type: Boolean,
  56773. default: true
  56774. },
  56775. showClose: {
  56776. type: Boolean,
  56777. default: true
  56778. },
  56779. closeOnClickModal: {
  56780. type: Boolean,
  56781. default: true
  56782. },
  56783. closeOnPressEscape: {
  56784. type: Boolean,
  56785. default: true
  56786. },
  56787. closeOnHashChange: {
  56788. type: Boolean,
  56789. default: true
  56790. },
  56791. center: Boolean,
  56792. draggable: Boolean,
  56793. overflow: Boolean,
  56794. roundButton: Boolean,
  56795. container: {
  56796. type: String,
  56797. default: "body"
  56798. },
  56799. boxType: {
  56800. type: String,
  56801. default: ""
  56802. }
  56803. },
  56804. emits: ["vanish", "action"],
  56805. setup(props, { emit }) {
  56806. const { locale, zIndex, ns, size: btnSize } = useGlobalComponentSettings("message-box", (0, vue.computed)(() => props.buttonSize));
  56807. const { t } = locale;
  56808. const { nextZIndex } = zIndex;
  56809. const visible = (0, vue.ref)(false);
  56810. const state = (0, vue.reactive)({
  56811. autofocus: true,
  56812. beforeClose: null,
  56813. callback: null,
  56814. cancelButtonText: "",
  56815. cancelButtonClass: "",
  56816. confirmButtonText: "",
  56817. confirmButtonClass: "",
  56818. cancelButtonType: "",
  56819. confirmButtonType: "primary",
  56820. customClass: "",
  56821. customStyle: {},
  56822. dangerouslyUseHTMLString: false,
  56823. distinguishCancelAndClose: false,
  56824. icon: "",
  56825. closeIcon: "",
  56826. inputPattern: null,
  56827. inputPlaceholder: "",
  56828. inputType: "text",
  56829. inputValue: "",
  56830. inputValidator: void 0,
  56831. inputErrorMessage: "",
  56832. message: "",
  56833. modalFade: true,
  56834. modalClass: "",
  56835. showCancelButton: false,
  56836. showConfirmButton: true,
  56837. type: "",
  56838. title: void 0,
  56839. showInput: false,
  56840. action: "",
  56841. confirmButtonLoading: false,
  56842. cancelButtonLoading: false,
  56843. confirmButtonLoadingIcon: (0, vue.markRaw)(loading_default),
  56844. cancelButtonLoadingIcon: (0, vue.markRaw)(loading_default),
  56845. confirmButtonDisabled: false,
  56846. editorErrorMessage: "",
  56847. validateError: false,
  56848. zIndex: nextZIndex()
  56849. });
  56850. const typeClass = (0, vue.computed)(() => {
  56851. const type = state.type;
  56852. return { [ns.bm("icon", type)]: type && TypeComponentsMap[type] };
  56853. });
  56854. const contentId = useId();
  56855. const inputId = useId();
  56856. const iconComponent = (0, vue.computed)(() => {
  56857. const type = state.type;
  56858. return state.icon || type && TypeComponentsMap[type] || "";
  56859. });
  56860. const hasMessage = (0, vue.computed)(() => !!state.message);
  56861. const rootRef = (0, vue.ref)();
  56862. const headerRef = (0, vue.ref)();
  56863. const focusStartRef = (0, vue.ref)();
  56864. const inputRef = (0, vue.ref)();
  56865. const confirmRef = (0, vue.ref)();
  56866. const confirmButtonClasses = (0, vue.computed)(() => state.confirmButtonClass);
  56867. (0, vue.watch)(() => state.inputValue, async (val) => {
  56868. await (0, vue.nextTick)();
  56869. if (props.boxType === "prompt" && val) validate();
  56870. }, { immediate: true });
  56871. (0, vue.watch)(() => visible.value, (val) => {
  56872. if (val) {
  56873. if (props.boxType !== "prompt") if (state.autofocus) focusStartRef.value = confirmRef.value?.$el ?? rootRef.value;
  56874. else focusStartRef.value = rootRef.value;
  56875. state.zIndex = nextZIndex();
  56876. }
  56877. if (props.boxType !== "prompt") return;
  56878. if (val) (0, vue.nextTick)().then(() => {
  56879. if (inputRef.value && inputRef.value.$el) if (state.autofocus) focusStartRef.value = getInputElement() ?? rootRef.value;
  56880. else focusStartRef.value = rootRef.value;
  56881. });
  56882. else {
  56883. state.editorErrorMessage = "";
  56884. state.validateError = false;
  56885. }
  56886. });
  56887. const { isDragging } = useDraggable(rootRef, headerRef, (0, vue.computed)(() => props.draggable), (0, vue.computed)(() => props.overflow));
  56888. (0, vue.onMounted)(async () => {
  56889. await (0, vue.nextTick)();
  56890. if (props.closeOnHashChange) window.addEventListener("hashchange", doClose);
  56891. });
  56892. (0, vue.onBeforeUnmount)(() => {
  56893. if (props.closeOnHashChange) window.removeEventListener("hashchange", doClose);
  56894. });
  56895. function doClose() {
  56896. if (!visible.value) return;
  56897. visible.value = false;
  56898. (0, vue.nextTick)(() => {
  56899. if (state.action) emit("action", state.action);
  56900. });
  56901. }
  56902. const handleWrapperClick = () => {
  56903. if (props.closeOnClickModal) handleAction(state.distinguishCancelAndClose ? "close" : "cancel");
  56904. };
  56905. const overlayEvent = useSameTarget(handleWrapperClick);
  56906. const handleInputEnter = (e) => {
  56907. if (state.inputType !== "textarea" && !inputRef.value?.isComposing) {
  56908. e.preventDefault();
  56909. return handleAction("confirm");
  56910. }
  56911. };
  56912. const handleAction = (action) => {
  56913. if (props.boxType === "prompt" && action === "confirm" && !validate()) return;
  56914. state.action = action;
  56915. if (state.beforeClose) state.beforeClose?.(action, state, doClose);
  56916. else doClose();
  56917. };
  56918. const validate = () => {
  56919. if (props.boxType === "prompt") {
  56920. const inputPattern = state.inputPattern;
  56921. if (inputPattern && !inputPattern.test(state.inputValue || "")) {
  56922. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  56923. state.validateError = true;
  56924. return false;
  56925. }
  56926. const inputValidator = state.inputValidator;
  56927. if (isFunction$1(inputValidator)) {
  56928. const validateResult = inputValidator(state.inputValue);
  56929. if (validateResult === false) {
  56930. state.editorErrorMessage = state.inputErrorMessage || t("el.messagebox.error");
  56931. state.validateError = true;
  56932. return false;
  56933. }
  56934. if (isString(validateResult)) {
  56935. state.editorErrorMessage = validateResult;
  56936. state.validateError = true;
  56937. return false;
  56938. }
  56939. }
  56940. }
  56941. state.editorErrorMessage = "";
  56942. state.validateError = false;
  56943. return true;
  56944. };
  56945. const getInputElement = () => {
  56946. const inputRefs = inputRef.value?.$refs;
  56947. return inputRefs?.input ?? inputRefs?.textarea;
  56948. };
  56949. const handleClose = () => {
  56950. handleAction("close");
  56951. };
  56952. const onCloseRequested = () => {
  56953. if (props.closeOnPressEscape) handleClose();
  56954. };
  56955. if (props.lockScroll) useLockscreen(visible, { ns });
  56956. return {
  56957. ...(0, vue.toRefs)(state),
  56958. ns,
  56959. overlayEvent,
  56960. visible,
  56961. hasMessage,
  56962. typeClass,
  56963. contentId,
  56964. inputId,
  56965. btnSize,
  56966. iconComponent,
  56967. confirmButtonClasses,
  56968. rootRef,
  56969. focusStartRef,
  56970. headerRef,
  56971. inputRef,
  56972. isDragging,
  56973. confirmRef,
  56974. doClose,
  56975. handleClose,
  56976. onCloseRequested,
  56977. handleWrapperClick,
  56978. handleInputEnter,
  56979. handleAction,
  56980. t
  56981. };
  56982. }
  56983. });
  56984. //#endregion
  56985. //#region ../../packages/components/message-box/src/index.vue
  56986. const _hoisted_1$1 = ["aria-label", "aria-describedby"];
  56987. const _hoisted_2$1 = ["aria-label"];
  56988. const _hoisted_3$1 = ["id"];
  56989. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  56990. const _component_el_icon = (0, vue.resolveComponent)("el-icon");
  56991. const _component_el_input = (0, vue.resolveComponent)("el-input");
  56992. const _component_el_button = (0, vue.resolveComponent)("el-button");
  56993. const _component_el_focus_trap = (0, vue.resolveComponent)("el-focus-trap");
  56994. const _component_el_overlay = (0, vue.resolveComponent)("el-overlay");
  56995. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  56996. name: "fade-in-linear",
  56997. onAfterLeave: _cache[11] || (_cache[11] = ($event) => _ctx.$emit("vanish")),
  56998. persisted: ""
  56999. }, {
  57000. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createVNode)(_component_el_overlay, {
  57001. "z-index": _ctx.zIndex,
  57002. "overlay-class": [_ctx.ns.is("message-box"), _ctx.modalClass],
  57003. mask: _ctx.modal
  57004. }, {
  57005. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  57006. role: "dialog",
  57007. "aria-label": _ctx.title,
  57008. "aria-modal": "true",
  57009. "aria-describedby": !_ctx.showInput ? _ctx.contentId : void 0,
  57010. class: (0, vue.normalizeClass)(`${_ctx.ns.namespace.value}-overlay-message-box`),
  57011. onClick: _cache[8] || (_cache[8] = (...args) => _ctx.overlayEvent.onClick && _ctx.overlayEvent.onClick(...args)),
  57012. onMousedown: _cache[9] || (_cache[9] = (...args) => _ctx.overlayEvent.onMousedown && _ctx.overlayEvent.onMousedown(...args)),
  57013. onMouseup: _cache[10] || (_cache[10] = (...args) => _ctx.overlayEvent.onMouseup && _ctx.overlayEvent.onMouseup(...args))
  57014. }, [(0, vue.createVNode)(_component_el_focus_trap, {
  57015. loop: "",
  57016. trapped: _ctx.visible,
  57017. "focus-trap-el": _ctx.rootRef,
  57018. "focus-start-el": _ctx.focusStartRef,
  57019. onReleaseRequested: _ctx.onCloseRequested
  57020. }, {
  57021. default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", {
  57022. ref: "rootRef",
  57023. class: (0, vue.normalizeClass)([
  57024. _ctx.ns.b(),
  57025. _ctx.customClass,
  57026. _ctx.ns.is("draggable", _ctx.draggable),
  57027. _ctx.ns.is("dragging", _ctx.isDragging),
  57028. { [_ctx.ns.m("center")]: _ctx.center }
  57029. ]),
  57030. style: (0, vue.normalizeStyle)(_ctx.customStyle),
  57031. tabindex: "-1",
  57032. onClick: _cache[7] || (_cache[7] = (0, vue.withModifiers)(() => {}, ["stop"]))
  57033. }, [
  57034. _ctx.title !== null && _ctx.title !== void 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  57035. key: 0,
  57036. ref: "headerRef",
  57037. class: (0, vue.normalizeClass)([_ctx.ns.e("header"), { "show-close": _ctx.showClose }])
  57038. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("title")) }, [_ctx.iconComponent && _ctx.center ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  57039. key: 0,
  57040. class: (0, vue.normalizeClass)([_ctx.ns.e("status"), _ctx.typeClass])
  57041. }, {
  57042. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  57043. _: 1
  57044. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(_ctx.title), 1)], 2), _ctx.showClose ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
  57045. key: 0,
  57046. type: "button",
  57047. class: (0, vue.normalizeClass)(_ctx.ns.e("headerbtn")),
  57048. "aria-label": _ctx.t("el.messagebox.close"),
  57049. onClick: _cache[0] || (_cache[0] = ($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel")),
  57050. onKeydown: _cache[1] || (_cache[1] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction(_ctx.distinguishCancelAndClose ? "close" : "cancel"), ["prevent"]), ["enter"]))
  57051. }, [(0, vue.createVNode)(_component_el_icon, { class: (0, vue.normalizeClass)(_ctx.ns.e("close")) }, {
  57052. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.closeIcon || "close")))]),
  57053. _: 1
  57054. }, 8, ["class"])], 42, _hoisted_2$1)) : (0, vue.createCommentVNode)("v-if", true)], 2)) : (0, vue.createCommentVNode)("v-if", true),
  57055. (0, vue.createElementVNode)("div", {
  57056. id: _ctx.contentId,
  57057. class: (0, vue.normalizeClass)(_ctx.ns.e("content"))
  57058. }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("container")) }, [_ctx.iconComponent && !_ctx.center && _ctx.hasMessage ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_icon, {
  57059. key: 0,
  57060. class: (0, vue.normalizeClass)([_ctx.ns.e("status"), _ctx.typeClass])
  57061. }, {
  57062. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.iconComponent)))]),
  57063. _: 1
  57064. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), _ctx.hasMessage ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
  57065. key: 1,
  57066. class: (0, vue.normalizeClass)(_ctx.ns.e("message"))
  57067. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [!_ctx.dangerouslyUseHTMLString ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.showInput ? "label" : "p"), {
  57068. key: 0,
  57069. for: _ctx.showInput ? _ctx.inputId : void 0,
  57070. textContent: (0, vue.toDisplayString)(_ctx.message)
  57071. }, null, 8, ["for", "textContent"])) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(_ctx.showInput ? "label" : "p"), {
  57072. key: 1,
  57073. for: _ctx.showInput ? _ctx.inputId : void 0,
  57074. innerHTML: _ctx.message
  57075. }, null, 8, ["for", "innerHTML"]))])], 2)) : (0, vue.createCommentVNode)("v-if", true)], 2), (0, vue.withDirectives)((0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("input")) }, [(0, vue.createVNode)(_component_el_input, {
  57076. id: _ctx.inputId,
  57077. ref: "inputRef",
  57078. modelValue: _ctx.inputValue,
  57079. "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.inputValue = $event),
  57080. type: _ctx.inputType,
  57081. placeholder: _ctx.inputPlaceholder,
  57082. "aria-invalid": _ctx.validateError,
  57083. class: (0, vue.normalizeClass)({ invalid: _ctx.validateError }),
  57084. onKeydown: (0, vue.withKeys)(_ctx.handleInputEnter, ["enter"])
  57085. }, null, 8, [
  57086. "id",
  57087. "modelValue",
  57088. "type",
  57089. "placeholder",
  57090. "aria-invalid",
  57091. "class",
  57092. "onKeydown"
  57093. ]), (0, vue.createElementVNode)("div", {
  57094. class: (0, vue.normalizeClass)(_ctx.ns.e("errormsg")),
  57095. style: (0, vue.normalizeStyle)({ visibility: !!_ctx.editorErrorMessage ? "visible" : "hidden" })
  57096. }, (0, vue.toDisplayString)(_ctx.editorErrorMessage), 7)], 2), [[vue.vShow, _ctx.showInput]])], 10, _hoisted_3$1),
  57097. (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(_ctx.ns.e("btns")) }, [_ctx.showCancelButton ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_el_button, {
  57098. key: 0,
  57099. type: _ctx.cancelButtonType === "text" ? "" : _ctx.cancelButtonType,
  57100. text: _ctx.cancelButtonType === "text",
  57101. loading: _ctx.cancelButtonLoading,
  57102. "loading-icon": _ctx.cancelButtonLoadingIcon,
  57103. class: (0, vue.normalizeClass)([_ctx.cancelButtonClass]),
  57104. round: _ctx.roundButton,
  57105. size: _ctx.btnSize,
  57106. onClick: _cache[3] || (_cache[3] = ($event) => _ctx.handleAction("cancel")),
  57107. onKeydown: _cache[4] || (_cache[4] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction("cancel"), ["prevent"]), ["enter"]))
  57108. }, {
  57109. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.cancelButtonText || _ctx.t("el.messagebox.cancel")), 1)]),
  57110. _: 1
  57111. }, 8, [
  57112. "type",
  57113. "text",
  57114. "loading",
  57115. "loading-icon",
  57116. "class",
  57117. "round",
  57118. "size"
  57119. ])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.withDirectives)((0, vue.createVNode)(_component_el_button, {
  57120. ref: "confirmRef",
  57121. type: _ctx.confirmButtonType === "text" ? "" : _ctx.confirmButtonType,
  57122. text: _ctx.confirmButtonType === "text",
  57123. loading: _ctx.confirmButtonLoading,
  57124. "loading-icon": _ctx.confirmButtonLoadingIcon,
  57125. class: (0, vue.normalizeClass)([_ctx.confirmButtonClasses]),
  57126. round: _ctx.roundButton,
  57127. disabled: _ctx.confirmButtonDisabled,
  57128. size: _ctx.btnSize,
  57129. onClick: _cache[5] || (_cache[5] = ($event) => _ctx.handleAction("confirm")),
  57130. onKeydown: _cache[6] || (_cache[6] = (0, vue.withKeys)((0, vue.withModifiers)(($event) => _ctx.handleAction("confirm"), ["prevent"]), ["enter"]))
  57131. }, {
  57132. default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(_ctx.confirmButtonText || _ctx.t("el.messagebox.confirm")), 1)]),
  57133. _: 1
  57134. }, 8, [
  57135. "type",
  57136. "text",
  57137. "loading",
  57138. "loading-icon",
  57139. "class",
  57140. "round",
  57141. "disabled",
  57142. "size"
  57143. ]), [[vue.vShow, _ctx.showConfirmButton]])], 2)
  57144. ], 6)]),
  57145. _: 3
  57146. }, 8, [
  57147. "trapped",
  57148. "focus-trap-el",
  57149. "focus-start-el",
  57150. "onReleaseRequested"
  57151. ])], 42, _hoisted_1$1)]),
  57152. _: 3
  57153. }, 8, [
  57154. "z-index",
  57155. "overlay-class",
  57156. "mask"
  57157. ]), [[vue.vShow, _ctx.visible]])]),
  57158. _: 3
  57159. });
  57160. }
  57161. var src_default = /* @__PURE__ */ _plugin_vue_export_helper_default(index_vue_vue_type_script_lang_default, [["render", _sfc_render]]);
  57162. //#endregion
  57163. //#region ../../packages/components/message-box/src/messageBox.ts
  57164. const messageInstance = /* @__PURE__ */ new Map();
  57165. const getAppendToElement = (props) => {
  57166. let appendTo = document.body;
  57167. if (props.appendTo) {
  57168. if (isString(props.appendTo)) appendTo = document.querySelector(props.appendTo);
  57169. if (isElement$1(props.appendTo)) appendTo = props.appendTo;
  57170. if (!isElement$1(appendTo)) {
  57171. /* @__PURE__ */ debugWarn("ElMessageBox", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  57172. appendTo = document.body;
  57173. }
  57174. }
  57175. return appendTo;
  57176. };
  57177. const initInstance = (props, container, appContext = null) => {
  57178. const vnode = (0, vue.createVNode)(src_default, props, isFunction$1(props.message) || (0, vue.isVNode)(props.message) ? { default: isFunction$1(props.message) ? props.message : () => props.message } : null);
  57179. vnode.appContext = appContext;
  57180. (0, vue.render)(vnode, container);
  57181. getAppendToElement(props).appendChild(container.firstElementChild);
  57182. return vnode.component;
  57183. };
  57184. const genContainer = () => {
  57185. return document.createElement("div");
  57186. };
  57187. const showMessage = (options, appContext) => {
  57188. const container = genContainer();
  57189. options.onVanish = () => {
  57190. (0, vue.render)(null, container);
  57191. messageInstance.delete(vm);
  57192. };
  57193. options.onAction = (action) => {
  57194. const currentMsg = messageInstance.get(vm);
  57195. let resolve;
  57196. if (options.showInput) resolve = {
  57197. value: vm.inputValue,
  57198. action
  57199. };
  57200. else resolve = action;
  57201. if (options.callback) options.callback(resolve, instance.proxy);
  57202. else if (action === "cancel" || action === "close") if (options.distinguishCancelAndClose && action !== "cancel") currentMsg.reject("close");
  57203. else currentMsg.reject("cancel");
  57204. else currentMsg.resolve(resolve);
  57205. };
  57206. const instance = initInstance(options, container, appContext);
  57207. const vm = instance.proxy;
  57208. for (const prop in options) if (hasOwn(options, prop) && !hasOwn(vm.$props, prop)) if (prop === "closeIcon" && isObject$1(options[prop])) vm[prop] = (0, vue.markRaw)(options[prop]);
  57209. else vm[prop] = options[prop];
  57210. vm.visible = true;
  57211. return vm;
  57212. };
  57213. function MessageBox(options, appContext = null) {
  57214. if (!isClient) return Promise.reject();
  57215. let callback;
  57216. if (isString(options) || (0, vue.isVNode)(options)) options = { message: options };
  57217. else callback = options.callback;
  57218. return new Promise((resolve, reject) => {
  57219. const vm = showMessage(options, appContext ?? MessageBox._context);
  57220. messageInstance.set(vm, {
  57221. options,
  57222. callback,
  57223. resolve,
  57224. reject
  57225. });
  57226. });
  57227. }
  57228. const MESSAGE_BOX_VARIANTS = [
  57229. "alert",
  57230. "confirm",
  57231. "prompt"
  57232. ];
  57233. const MESSAGE_BOX_DEFAULT_OPTS = {
  57234. alert: {
  57235. closeOnPressEscape: false,
  57236. closeOnClickModal: false
  57237. },
  57238. confirm: { showCancelButton: true },
  57239. prompt: {
  57240. showCancelButton: true,
  57241. showInput: true
  57242. }
  57243. };
  57244. MESSAGE_BOX_VARIANTS.forEach((boxType) => {
  57245. MessageBox[boxType] = messageBoxFactory(boxType);
  57246. });
  57247. function messageBoxFactory(boxType) {
  57248. return (message, title, options, appContext) => {
  57249. let titleOrOpts = "";
  57250. if (isObject$1(title)) {
  57251. options = title;
  57252. titleOrOpts = "";
  57253. } else if (isUndefined(title)) titleOrOpts = "";
  57254. else titleOrOpts = title;
  57255. return MessageBox(Object.assign({
  57256. title: titleOrOpts,
  57257. message,
  57258. type: "",
  57259. ...MESSAGE_BOX_DEFAULT_OPTS[boxType]
  57260. }, options, { boxType }), appContext);
  57261. };
  57262. }
  57263. MessageBox.close = () => {
  57264. messageInstance.forEach((_, vm) => {
  57265. vm.doClose();
  57266. });
  57267. messageInstance.clear();
  57268. };
  57269. MessageBox._context = null;
  57270. //#endregion
  57271. //#region ../../packages/components/message-box/index.ts
  57272. const _MessageBox = MessageBox;
  57273. _MessageBox.install = (app) => {
  57274. _MessageBox._context = app._context;
  57275. app.config.globalProperties.$msgbox = _MessageBox;
  57276. app.config.globalProperties.$messageBox = _MessageBox;
  57277. app.config.globalProperties.$alert = _MessageBox.alert;
  57278. app.config.globalProperties.$confirm = _MessageBox.confirm;
  57279. app.config.globalProperties.$prompt = _MessageBox.prompt;
  57280. };
  57281. const ElMessageBox = _MessageBox;
  57282. //#endregion
  57283. //#region ../../packages/components/notification/src/notification.ts
  57284. const notificationTypes = [
  57285. "primary",
  57286. "success",
  57287. "info",
  57288. "warning",
  57289. "error"
  57290. ];
  57291. /**
  57292. * @deprecated Removed after 3.0.0, Use `NotificationProps` instead.
  57293. */
  57294. const notificationProps = buildProps({
  57295. customClass: {
  57296. type: String,
  57297. default: ""
  57298. },
  57299. dangerouslyUseHTMLString: Boolean,
  57300. duration: {
  57301. type: Number,
  57302. default: 4500
  57303. },
  57304. icon: { type: iconPropType },
  57305. id: {
  57306. type: String,
  57307. default: ""
  57308. },
  57309. message: {
  57310. type: definePropType([
  57311. String,
  57312. Object,
  57313. Function
  57314. ]),
  57315. default: ""
  57316. },
  57317. offset: {
  57318. type: Number,
  57319. default: 0
  57320. },
  57321. onClick: {
  57322. type: definePropType(Function),
  57323. default: () => void 0
  57324. },
  57325. onClose: {
  57326. type: definePropType(Function),
  57327. required: true
  57328. },
  57329. position: {
  57330. type: String,
  57331. values: [
  57332. "top-right",
  57333. "top-left",
  57334. "bottom-right",
  57335. "bottom-left"
  57336. ],
  57337. default: "top-right"
  57338. },
  57339. showClose: {
  57340. type: Boolean,
  57341. default: true
  57342. },
  57343. title: {
  57344. type: String,
  57345. default: ""
  57346. },
  57347. type: {
  57348. type: String,
  57349. values: [...notificationTypes, ""],
  57350. default: ""
  57351. },
  57352. zIndex: Number,
  57353. closeIcon: {
  57354. type: iconPropType,
  57355. default: close_default
  57356. }
  57357. });
  57358. const notificationEmits = { destroy: () => true };
  57359. //#endregion
  57360. //#region ../../packages/components/notification/src/notification.vue?vue&type=script&setup=true&lang.ts
  57361. const _hoisted_1 = ["id"];
  57362. const _hoisted_2 = ["textContent"];
  57363. const _hoisted_3 = { key: 0 };
  57364. const _hoisted_4 = ["innerHTML"];
  57365. var notification_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
  57366. name: "ElNotification",
  57367. __name: "notification",
  57368. props: notificationProps,
  57369. emits: notificationEmits,
  57370. setup(__props, { expose: __expose }) {
  57371. const props = __props;
  57372. const { ns, zIndex } = useGlobalComponentSettings("notification");
  57373. const { nextZIndex, currentZIndex } = zIndex;
  57374. const visible = (0, vue.ref)(false);
  57375. let timer = void 0;
  57376. const typeClass = (0, vue.computed)(() => {
  57377. const type = props.type;
  57378. return type && TypeComponentsMap[props.type] ? ns.m(type) : "";
  57379. });
  57380. const iconComponent = (0, vue.computed)(() => {
  57381. if (!props.type) return props.icon;
  57382. return TypeComponentsMap[props.type] || props.icon;
  57383. });
  57384. const horizontalClass = (0, vue.computed)(() => props.position.endsWith("right") ? "right" : "left");
  57385. const verticalProperty = (0, vue.computed)(() => props.position.startsWith("top") ? "top" : "bottom");
  57386. const positionStyle = (0, vue.computed)(() => {
  57387. return {
  57388. [verticalProperty.value]: `${props.offset}px`,
  57389. zIndex: props.zIndex ?? currentZIndex.value
  57390. };
  57391. });
  57392. function startTimer() {
  57393. if (props.duration > 0) ({stop: timer} = useTimeoutFn(() => {
  57394. if (visible.value) close();
  57395. }, props.duration));
  57396. }
  57397. function clearTimer() {
  57398. timer?.();
  57399. }
  57400. function close() {
  57401. visible.value = false;
  57402. }
  57403. function onKeydown(event) {
  57404. switch (getEventCode(event)) {
  57405. case EVENT_CODE.delete:
  57406. case EVENT_CODE.backspace:
  57407. clearTimer();
  57408. break;
  57409. case EVENT_CODE.esc:
  57410. if (visible.value) close();
  57411. break;
  57412. default:
  57413. startTimer();
  57414. break;
  57415. }
  57416. }
  57417. (0, vue.onMounted)(() => {
  57418. startTimer();
  57419. nextZIndex();
  57420. visible.value = true;
  57421. });
  57422. useEventListener(document, "keydown", onKeydown);
  57423. __expose({
  57424. visible,
  57425. close
  57426. });
  57427. return (_ctx, _cache) => {
  57428. return (0, vue.openBlock)(), (0, vue.createBlock)(vue.Transition, {
  57429. name: (0, vue.unref)(ns).b("fade"),
  57430. onBeforeLeave: __props.onClose,
  57431. onAfterLeave: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("destroy")),
  57432. persisted: ""
  57433. }, {
  57434. default: (0, vue.withCtx)(() => [(0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  57435. id: __props.id,
  57436. class: (0, vue.normalizeClass)([
  57437. (0, vue.unref)(ns).b(),
  57438. __props.customClass,
  57439. horizontalClass.value
  57440. ]),
  57441. style: (0, vue.normalizeStyle)(positionStyle.value),
  57442. role: "alert",
  57443. onMouseenter: clearTimer,
  57444. onMouseleave: startTimer,
  57445. onClick: _cache[0] || (_cache[0] = (...args) => __props.onClick && __props.onClick(...args))
  57446. }, [iconComponent.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  57447. key: 0,
  57448. class: (0, vue.normalizeClass)([(0, vue.unref)(ns).e("icon"), typeClass.value])
  57449. }, {
  57450. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(iconComponent.value)))]),
  57451. _: 1
  57452. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("group")) }, [
  57453. (0, vue.createElementVNode)("h2", {
  57454. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("title")),
  57455. textContent: (0, vue.toDisplayString)(__props.title)
  57456. }, null, 10, _hoisted_2),
  57457. (0, vue.withDirectives)((0, vue.createElementVNode)("div", {
  57458. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("content")),
  57459. style: (0, vue.normalizeStyle)(!!__props.title ? void 0 : { margin: 0 })
  57460. }, [(0, vue.renderSlot)(_ctx.$slots, "default", {}, () => [!__props.dangerouslyUseHTMLString ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_3, (0, vue.toDisplayString)(__props.message), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [(0, vue.createCommentVNode)(" Caution here, message could've been compromised, never use user's input as message "), (0, vue.createElementVNode)("p", { innerHTML: __props.message }, null, 8, _hoisted_4)], 2112))])], 6), [[vue.vShow, __props.message]]),
  57461. __props.showClose ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(ElIcon), {
  57462. key: 0,
  57463. class: (0, vue.normalizeClass)((0, vue.unref)(ns).e("closeBtn")),
  57464. onClick: (0, vue.withModifiers)(close, ["stop"])
  57465. }, {
  57466. default: (0, vue.withCtx)(() => [((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(__props.closeIcon)))]),
  57467. _: 1
  57468. }, 8, ["class"])) : (0, vue.createCommentVNode)("v-if", true)
  57469. ], 2)], 46, _hoisted_1), [[vue.vShow, visible.value]])]),
  57470. _: 3
  57471. }, 8, ["name", "onBeforeLeave"]);
  57472. };
  57473. }
  57474. });
  57475. //#endregion
  57476. //#region ../../packages/components/notification/src/notification.vue
  57477. var notification_default = notification_vue_vue_type_script_setup_true_lang_default;
  57478. //#endregion
  57479. //#region ../../packages/components/notification/src/notify.ts
  57480. const notifications = {
  57481. "top-left": [],
  57482. "top-right": [],
  57483. "bottom-left": [],
  57484. "bottom-right": []
  57485. };
  57486. const GAP_SIZE = 16;
  57487. let seed = 1;
  57488. const notify = function(options = {}, context) {
  57489. if (!isClient) return { close: () => void 0 };
  57490. if (isString(options) || (0, vue.isVNode)(options)) options = { message: options };
  57491. const position = options.position || "top-right";
  57492. let verticalOffset = options.offset || 0;
  57493. notifications[position].forEach(({ vm }) => {
  57494. verticalOffset += (vm.el?.offsetHeight || 0) + GAP_SIZE;
  57495. });
  57496. verticalOffset += GAP_SIZE;
  57497. const id = `notification_${seed++}`;
  57498. const userOnClose = options.onClose;
  57499. const props = {
  57500. ...options,
  57501. offset: verticalOffset,
  57502. id,
  57503. onClose: () => {
  57504. close(id, position, userOnClose);
  57505. }
  57506. };
  57507. let appendTo = document.body;
  57508. if (isElement$1(options.appendTo)) appendTo = options.appendTo;
  57509. else if (isString(options.appendTo)) appendTo = document.querySelector(options.appendTo);
  57510. if (!isElement$1(appendTo)) {
  57511. /* @__PURE__ */ debugWarn("ElNotification", "the appendTo option is not an HTMLElement. Falling back to document.body.");
  57512. appendTo = document.body;
  57513. }
  57514. const container = document.createElement("div");
  57515. const vm = (0, vue.createVNode)(notification_default, props, isFunction$1(props.message) ? props.message : (0, vue.isVNode)(props.message) ? () => props.message : null);
  57516. vm.appContext = isUndefined(context) ? notify._context : context;
  57517. vm.props.onDestroy = () => {
  57518. (0, vue.render)(null, container);
  57519. };
  57520. (0, vue.render)(vm, container);
  57521. notifications[position].push({ vm });
  57522. appendTo.appendChild(container.firstElementChild);
  57523. return { close: () => {
  57524. vm.component.exposed.visible.value = false;
  57525. } };
  57526. };
  57527. notificationTypes.forEach((type) => {
  57528. notify[type] = (options = {}, appContext) => {
  57529. if (isString(options) || (0, vue.isVNode)(options)) options = { message: options };
  57530. return notify({
  57531. ...options,
  57532. type
  57533. }, appContext);
  57534. };
  57535. });
  57536. /**
  57537. * This function gets called when user click `x` button or press `esc` or the time reached its limitation.
  57538. * Emitted by transition@before-leave event so that we can fetch the current notification.offsetHeight, if this was called
  57539. * by @after-leave the DOM element will be removed from the page thus we can no longer fetch the offsetHeight.
  57540. * @param {String} id notification id to be closed
  57541. * @param {Position} position the positioning strategy
  57542. * @param {Function} userOnClose the callback called when close passed by user
  57543. */
  57544. function close(id, position, userOnClose) {
  57545. const orientedNotifications = notifications[position];
  57546. const idx = orientedNotifications.findIndex(({ vm }) => vm.component?.props.id === id);
  57547. if (idx === -1) return;
  57548. const { vm } = orientedNotifications[idx];
  57549. if (!vm) return;
  57550. userOnClose?.(vm);
  57551. const removedHeight = vm.el.offsetHeight;
  57552. const verticalPos = position.split("-")[0];
  57553. orientedNotifications.splice(idx, 1);
  57554. const len = orientedNotifications.length;
  57555. if (len < 1) return;
  57556. for (let i = idx; i < len; i++) {
  57557. const { el, component } = orientedNotifications[i].vm;
  57558. const pos = Number.parseInt(el.style[verticalPos], 10) - removedHeight - GAP_SIZE;
  57559. component.props.offset = pos;
  57560. }
  57561. }
  57562. function closeAll() {
  57563. for (const orientedNotifications of Object.values(notifications)) orientedNotifications.forEach(({ vm }) => {
  57564. vm.component.exposed.visible.value = false;
  57565. });
  57566. }
  57567. function updateOffsets(position = "top-right") {
  57568. let verticalOffset = notifications[position][0]?.vm.component?.props?.offset || 0;
  57569. for (const { vm } of notifications[position]) {
  57570. vm.component.props.offset = verticalOffset;
  57571. verticalOffset += (vm.el?.offsetHeight || 0) + GAP_SIZE;
  57572. }
  57573. }
  57574. notify.closeAll = closeAll;
  57575. notify.updateOffsets = updateOffsets;
  57576. notify._context = null;
  57577. //#endregion
  57578. //#region ../../packages/components/notification/index.ts
  57579. const ElNotification = withInstallFunction(notify, "$notify");
  57580. //#endregion
  57581. //#region ../../packages/element-plus/plugin.ts
  57582. var plugin_default = [
  57583. ElInfiniteScroll,
  57584. ElLoading,
  57585. ElMessage,
  57586. ElMessageBox,
  57587. ElNotification,
  57588. ElPopoverDirective
  57589. ];
  57590. //#endregion
  57591. //#region ../../packages/element-plus/defaults.ts
  57592. var defaults_default = makeInstaller([...component_default, ...plugin_default]);
  57593. //#endregion
  57594. //#region ../../packages/element-plus/index.ts
  57595. const install = defaults_default.install;
  57596. const version = defaults_default.version;
  57597. var element_plus_default = defaults_default;
  57598. //#endregion
  57599. exports.BAR_MAP = BAR_MAP;
  57600. exports.BORDER_HORIZONTAL_WIDTH = BORDER_HORIZONTAL_WIDTH;
  57601. exports.CAROUSEL_ITEM_NAME = CAROUSEL_ITEM_NAME;
  57602. exports.CASCADER_PANEL_INJECTION_KEY = CASCADER_PANEL_INJECTION_KEY;
  57603. exports.CHANGE_EVENT = CHANGE_EVENT;
  57604. exports.ClickOutside = ClickOutside;
  57605. exports.CommonPicker = picker_default;
  57606. exports.CommonProps = CommonProps;
  57607. exports.DEFAULT_DIALOG_TRANSITION = DEFAULT_DIALOG_TRANSITION;
  57608. exports.DEFAULT_EMPTY_VALUES = DEFAULT_EMPTY_VALUES;
  57609. exports.DEFAULT_FORMATS_DATE = DEFAULT_FORMATS_DATE;
  57610. exports.DEFAULT_FORMATS_DATEPICKER = DEFAULT_FORMATS_DATEPICKER;
  57611. exports.DEFAULT_FORMATS_TIME = DEFAULT_FORMATS_TIME;
  57612. exports.DEFAULT_STEP = DEFAULT_STEP;
  57613. exports.DEFAULT_VALUE_ON_CLEAR = DEFAULT_VALUE_ON_CLEAR;
  57614. exports.DROPDOWN_INJECTION_KEY = DROPDOWN_INJECTION_KEY;
  57615. exports.DROPDOWN_INSTANCE_INJECTION_KEY = DROPDOWN_INSTANCE_INJECTION_KEY;
  57616. exports.DefaultProps = DefaultProps;
  57617. exports.DynamicSizeGrid = DynamicSizeGrid;
  57618. exports.DynamicSizeList = DynamicSizeList;
  57619. exports.EVENT_CODE = EVENT_CODE;
  57620. exports.Effect = Effect;
  57621. exports.ElAffix = ElAffix;
  57622. exports.ElAlert = ElAlert;
  57623. exports.ElAnchor = ElAnchor;
  57624. exports.ElAnchorLink = ElAnchorLink;
  57625. exports.ElAside = ElAside;
  57626. exports.ElAutoResizer = ElAutoResizer;
  57627. exports.ElAutocomplete = ElAutocomplete;
  57628. exports.ElAvatar = ElAvatar;
  57629. exports.ElAvatarGroup = ElAvatarGroup;
  57630. exports.ElBacktop = ElBacktop;
  57631. exports.ElBadge = ElBadge;
  57632. exports.ElBreadcrumb = ElBreadcrumb;
  57633. exports.ElBreadcrumbItem = ElBreadcrumbItem;
  57634. exports.ElButton = ElButton;
  57635. exports.ElButtonGroup = ElButtonGroup;
  57636. exports.ElCalendar = ElCalendar;
  57637. exports.ElCard = ElCard;
  57638. exports.ElCarousel = ElCarousel;
  57639. exports.ElCarouselItem = ElCarouselItem;
  57640. exports.ElCascader = ElCascader;
  57641. exports.ElCascaderPanel = ElCascaderPanel;
  57642. exports.ElCheckTag = ElCheckTag;
  57643. exports.ElCheckbox = ElCheckbox;
  57644. exports.ElCheckboxButton = ElCheckboxButton;
  57645. exports.ElCheckboxGroup = ElCheckboxGroup;
  57646. exports.ElCol = ElCol;
  57647. exports.ElCollapse = ElCollapse;
  57648. exports.ElCollapseItem = ElCollapseItem;
  57649. exports.ElCollapseTransition = ElCollapseTransition;
  57650. exports.ElColorPicker = ElColorPicker;
  57651. exports.ElColorPickerPanel = ElColorPickerPanel;
  57652. exports.ElConfigProvider = ElConfigProvider;
  57653. exports.ElContainer = ElContainer;
  57654. exports.ElCountdown = ElCountdown;
  57655. exports.ElDatePicker = ElDatePicker;
  57656. exports.ElDatePickerPanel = ElDatePickerPanel;
  57657. exports.ElDescriptions = ElDescriptions;
  57658. exports.ElDescriptionsItem = ElDescriptionsItem;
  57659. exports.ElDialog = ElDialog;
  57660. exports.ElDivider = ElDivider;
  57661. exports.ElDrawer = ElDrawer;
  57662. exports.ElDropdown = ElDropdown;
  57663. exports.ElDropdownItem = ElDropdownItem;
  57664. exports.ElDropdownMenu = ElDropdownMenu;
  57665. exports.ElEmpty = ElEmpty;
  57666. exports.ElFooter = ElFooter;
  57667. exports.ElForm = ElForm;
  57668. exports.ElFormItem = ElFormItem;
  57669. exports.ElHeader = ElHeader;
  57670. exports.ElIcon = ElIcon;
  57671. exports.ElImage = ElImage;
  57672. exports.ElImageViewer = ElImageViewer;
  57673. exports.ElInfiniteScroll = ElInfiniteScroll;
  57674. exports.ElInput = ElInput;
  57675. exports.ElInputNumber = ElInputNumber;
  57676. exports.ElInputTag = ElInputTag;
  57677. exports.ElLink = ElLink;
  57678. exports.ElLoading = ElLoading;
  57679. exports.ElLoadingDirective = vLoading;
  57680. exports.vLoading = vLoading;
  57681. exports.ElLoadingService = Loading;
  57682. exports.ElMain = ElMain;
  57683. exports.ElMention = ElMention;
  57684. exports.ElMenu = ElMenu;
  57685. exports.ElMenuItem = ElMenuItem;
  57686. exports.ElMenuItemGroup = ElMenuItemGroup;
  57687. exports.ElMessage = ElMessage;
  57688. exports.ElMessageBox = ElMessageBox;
  57689. exports.ElNotification = ElNotification;
  57690. exports.ElOption = ElOption;
  57691. exports.ElOptionGroup = ElOptionGroup;
  57692. exports.ElOverlay = ElOverlay;
  57693. exports.ElPageHeader = ElPageHeader;
  57694. exports.ElPagination = ElPagination;
  57695. exports.ElPopconfirm = ElPopconfirm;
  57696. exports.ElPopover = ElPopover;
  57697. exports.ElPopoverDirective = ElPopoverDirective;
  57698. exports.ElPopper = ElPopper;
  57699. exports.ElPopperArrow = arrow_default;
  57700. exports.ElPopperContent = content_default;
  57701. exports.ElPopperTrigger = trigger_default;
  57702. exports.ElProgress = ElProgress;
  57703. exports.ElRadio = ElRadio;
  57704. exports.ElRadioButton = ElRadioButton;
  57705. exports.ElRadioGroup = ElRadioGroup;
  57706. exports.ElRate = ElRate;
  57707. exports.ElResult = ElResult;
  57708. exports.ElRow = ElRow;
  57709. exports.ElScrollbar = ElScrollbar;
  57710. exports.ElSegmented = ElSegmented;
  57711. exports.ElSelect = ElSelect;
  57712. exports.ElSelectV2 = ElSelectV2;
  57713. exports.ElSkeleton = ElSkeleton;
  57714. exports.ElSkeletonItem = ElSkeletonItem;
  57715. exports.ElSlider = ElSlider;
  57716. exports.ElSpace = ElSpace;
  57717. exports.ElSplitter = ElSplitter;
  57718. exports.ElSplitterPanel = ElSplitterPanel;
  57719. exports.ElStatistic = ElStatistic;
  57720. exports.ElStep = ElStep;
  57721. exports.ElSteps = ElSteps;
  57722. exports.ElSubMenu = ElSubMenu;
  57723. exports.ElSwitch = ElSwitch;
  57724. exports.ElTabPane = ElTabPane;
  57725. exports.ElTable = ElTable;
  57726. exports.ElTableColumn = ElTableColumn;
  57727. exports.ElTableV2 = ElTableV2;
  57728. exports.ElTabs = ElTabs;
  57729. exports.ElTag = ElTag;
  57730. exports.ElText = ElText;
  57731. exports.ElTimePicker = ElTimePicker;
  57732. exports.ElTimeSelect = ElTimeSelect;
  57733. exports.ElTimeline = ElTimeline;
  57734. exports.ElTimelineItem = ElTimelineItem;
  57735. exports.ElTooltip = ElTooltip;
  57736. exports.ElTour = ElTour;
  57737. exports.ElTourStep = ElTourStep;
  57738. exports.ElTransfer = ElTransfer;
  57739. exports.ElTree = ElTree;
  57740. exports.ElTreeSelect = ElTreeSelect;
  57741. exports.ElTreeV2 = ElTreeV2;
  57742. exports.ElUpload = ElUpload;
  57743. exports.ElWatermark = ElWatermark;
  57744. exports.FIRST_KEYS = FIRST_KEYS;
  57745. exports.FIRST_LAST_KEYS = FIRST_LAST_KEYS;
  57746. exports.FORWARD_REF_INJECTION_KEY = FORWARD_REF_INJECTION_KEY;
  57747. exports.FixedSizeGrid = FixedSizeGrid;
  57748. exports.FixedSizeList = FixedSizeList;
  57749. exports.GAP = GAP;
  57750. exports.ID_INJECTION_KEY = ID_INJECTION_KEY;
  57751. exports.INPUT_EVENT = INPUT_EVENT;
  57752. exports.INSTALLED_KEY = INSTALLED_KEY;
  57753. exports.IconComponentMap = IconComponentMap;
  57754. exports.IconMap = IconMap;
  57755. exports.LAST_KEYS = LAST_KEYS;
  57756. exports.LEFT_CHECK_CHANGE_EVENT = LEFT_CHECK_CHANGE_EVENT;
  57757. exports.MENU_INJECTION_KEY = MENU_INJECTION_KEY;
  57758. exports.MESSAGE_DEFAULT_PLACEMENT = MESSAGE_DEFAULT_PLACEMENT;
  57759. exports.MINIMUM_INPUT_WIDTH = MINIMUM_INPUT_WIDTH;
  57760. exports.Mousewheel = Mousewheel;
  57761. exports.NODE_INSTANCE_INJECTION_KEY = NODE_INSTANCE_INJECTION_KEY;
  57762. exports.PICKER_BASE_INJECTION_KEY = PICKER_BASE_INJECTION_KEY;
  57763. exports.PICKER_POPPER_OPTIONS_INJECTION_KEY = PICKER_POPPER_OPTIONS_INJECTION_KEY;
  57764. exports.POPPER_CONTENT_INJECTION_KEY = POPPER_CONTENT_INJECTION_KEY;
  57765. exports.POPPER_INJECTION_KEY = POPPER_INJECTION_KEY;
  57766. exports.RIGHT_CHECK_CHANGE_EVENT = RIGHT_CHECK_CHANGE_EVENT;
  57767. exports.ROOT_COMMON_COLOR_INJECTION_KEY = ROOT_COMMON_COLOR_INJECTION_KEY;
  57768. exports.ROOT_COMMON_PICKER_INJECTION_KEY = ROOT_COMMON_PICKER_INJECTION_KEY;
  57769. exports.ROOT_PICKER_INJECTION_KEY = ROOT_PICKER_INJECTION_KEY;
  57770. exports.ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY = ROOT_PICKER_IS_DEFAULT_FORMAT_INJECTION_KEY;
  57771. exports.ROOT_TREE_INJECTION_KEY = ROOT_TREE_INJECTION_KEY;
  57772. exports.RowAlign = RowAlign;
  57773. exports.RowJustify = RowJustify;
  57774. exports.SCOPE = SCOPE;
  57775. exports.SIZE_INJECTION_KEY = SIZE_INJECTION_KEY;
  57776. exports.STEPS_INJECTION_KEY = STEPS_INJECTION_KEY;
  57777. exports.SUB_MENU_INJECTION_KEY = SUB_MENU_INJECTION_KEY;
  57778. exports.TIMELINE_INJECTION_KEY = TIMELINE_INJECTION_KEY;
  57779. exports.TOOLTIP_INJECTION_KEY = TOOLTIP_INJECTION_KEY;
  57780. exports.TREE_NODE_MAP_INJECTION_KEY = TREE_NODE_MAP_INJECTION_KEY;
  57781. exports.TableV2 = TableV2;
  57782. exports.TableV2Alignment = Alignment;
  57783. exports.TableV2FixedDir = FixedDir;
  57784. exports.TableV2Placeholder = placeholderSign;
  57785. exports.TableV2SortOrder = SortOrder;
  57786. exports.TimePickPanel = panel_time_pick_default;
  57787. exports.TrapFocus = TrapFocus;
  57788. exports.UPDATE_MODEL_EVENT = UPDATE_MODEL_EVENT;
  57789. exports.WEEK_DAYS = WEEK_DAYS;
  57790. exports.ZINDEX_INJECTION_KEY = ZINDEX_INJECTION_KEY;
  57791. exports.affixEmits = affixEmits;
  57792. exports.affixProps = affixProps;
  57793. exports.alertEffects = alertEffects;
  57794. exports.alertEmits = alertEmits;
  57795. exports.alertProps = alertProps;
  57796. exports.anchorEmits = anchorEmits;
  57797. exports.anchorProps = anchorProps;
  57798. exports.ariaProps = ariaProps;
  57799. exports.arrowMiddleware = arrowMiddleware;
  57800. exports.autoResizerProps = autoResizerProps;
  57801. exports.autocompleteEmits = autocompleteEmits;
  57802. exports.autocompleteProps = autocompleteProps;
  57803. exports.avatarEmits = avatarEmits;
  57804. exports.avatarGroupContextKey = avatarGroupContextKey;
  57805. exports.avatarGroupProps = avatarGroupProps;
  57806. exports.avatarProps = avatarProps;
  57807. exports.backtopEmits = backtopEmits;
  57808. exports.backtopProps = backtopProps;
  57809. exports.badgeProps = badgeProps;
  57810. exports.breadcrumbItemProps = breadcrumbItemProps;
  57811. exports.breadcrumbKey = breadcrumbKey;
  57812. exports.breadcrumbProps = breadcrumbProps;
  57813. exports.buildLocaleContext = buildLocaleContext;
  57814. exports.buildTimeList = buildTimeList;
  57815. exports.buildTranslator = buildTranslator;
  57816. exports.buttonEmits = buttonEmits;
  57817. exports.buttonGroupContextKey = buttonGroupContextKey;
  57818. exports.buttonNativeTypes = buttonNativeTypes;
  57819. exports.buttonProps = buttonProps;
  57820. exports.buttonTypes = buttonTypes;
  57821. exports.calendarEmits = calendarEmits;
  57822. exports.calendarProps = calendarProps;
  57823. exports.cardContextKey = cardContextKey;
  57824. exports.cardProps = cardProps;
  57825. exports.carouselContextKey = carouselContextKey;
  57826. exports.carouselEmits = carouselEmits;
  57827. exports.carouselItemProps = carouselItemProps;
  57828. exports.carouselProps = carouselProps;
  57829. exports.cascaderEmits = cascaderEmits;
  57830. exports.cascaderPanelEmits = cascaderPanelEmits;
  57831. exports.cascaderPanelProps = cascaderPanelProps;
  57832. exports.cascaderProps = cascaderProps;
  57833. exports.checkTagEmits = checkTagEmits;
  57834. exports.checkTagProps = checkTagProps;
  57835. exports.checkboxDefaultProps = checkboxDefaultProps;
  57836. exports.checkboxEmits = checkboxEmits;
  57837. exports.checkboxGroupContextKey = checkboxGroupContextKey;
  57838. exports.checkboxGroupEmits = checkboxGroupEmits;
  57839. exports.checkboxGroupProps = checkboxGroupProps;
  57840. exports.checkboxProps = checkboxProps;
  57841. exports.checkboxPropsDefaults = checkboxPropsDefaults;
  57842. exports.colProps = colProps;
  57843. exports.collapseContextKey = collapseContextKey;
  57844. exports.collapseEmits = collapseEmits;
  57845. exports.collapseItemProps = collapseItemProps;
  57846. exports.collapseProps = collapseProps;
  57847. exports.colorPickerEmits = colorPickerEmits;
  57848. exports.colorPickerPanelContextKey = colorPickerPanelContextKey;
  57849. exports.colorPickerPanelEmits = colorPickerPanelEmits;
  57850. exports.colorPickerPanelProps = colorPickerPanelProps;
  57851. exports.colorPickerProps = colorPickerProps;
  57852. exports.colorPickerPropsDefaults = colorPickerPropsDefaults;
  57853. exports.columnAlignment = columnAlignment;
  57854. exports.componentSizeMap = componentSizeMap;
  57855. exports.componentSizes = componentSizes;
  57856. exports.configProviderContextKey = configProviderContextKey;
  57857. exports.configProviderProps = configProviderProps;
  57858. exports.countdownEmits = countdownEmits;
  57859. exports.countdownProps = countdownProps;
  57860. exports.createModelToggleComposable = createModelToggleComposable;
  57861. exports.dateEquals = dateEquals;
  57862. exports.datePickTypes = datePickTypes;
  57863. exports.datePickerPanelProps = datePickerPanelProps;
  57864. exports.datePickerProps = datePickerProps;
  57865. exports.dayOrDaysToDate = dayOrDaysToDate;
  57866. Object.defineProperty(exports, 'dayjs', {
  57867. enumerable: true,
  57868. get: function () {
  57869. return import_dayjs_min.default;
  57870. }
  57871. });
  57872. exports.default = element_plus_default;
  57873. exports.defaultInitialZIndex = defaultInitialZIndex;
  57874. exports.defaultNamespace = defaultNamespace;
  57875. exports.defaultProps = defaultProps;
  57876. exports.descriptionItemProps = descriptionItemProps;
  57877. exports.descriptionProps = descriptionProps;
  57878. exports.dialogContextKey = dialogContextKey;
  57879. exports.dialogEmits = dialogEmits;
  57880. exports.dialogInjectionKey = dialogInjectionKey;
  57881. exports.dialogProps = dialogProps;
  57882. exports.dialogPropsDefaults = dialogPropsDefaults;
  57883. exports.dividerProps = dividerProps;
  57884. exports.drawerEmits = drawerEmits;
  57885. exports.drawerProps = drawerProps;
  57886. exports.dropdownItemProps = dropdownItemProps;
  57887. exports.dropdownMenuProps = dropdownMenuProps;
  57888. exports.dropdownProps = dropdownProps;
  57889. exports.elPaginationKey = elPaginationKey;
  57890. exports.emitChangeFn = emitChangeFn;
  57891. exports.emptyProps = emptyProps;
  57892. exports.emptyValuesContextKey = emptyValuesContextKey;
  57893. exports.extractDateFormat = extractDateFormat;
  57894. exports.extractTimeFormat = extractTimeFormat;
  57895. exports.formContextKey = formContextKey;
  57896. exports.formEmits = formEmits;
  57897. exports.formItemContextKey = formItemContextKey;
  57898. exports.formItemProps = formItemProps;
  57899. exports.formItemValidateStates = formItemValidateStates;
  57900. exports.formMetaProps = formMetaProps;
  57901. exports.formProps = formProps;
  57902. exports.formatter = formatter;
  57903. exports.genFileId = genFileId;
  57904. exports.getPositionDataWithUnit = getPositionDataWithUnit;
  57905. exports.iconProps = iconProps;
  57906. exports.imageEmits = imageEmits;
  57907. exports.imageProps = imageProps;
  57908. exports.imageViewerEmits = imageViewerEmits;
  57909. exports.imageViewerProps = imageViewerProps;
  57910. exports.inputEmits = inputEmits;
  57911. exports.inputNumberEmits = inputNumberEmits;
  57912. exports.inputNumberProps = inputNumberProps;
  57913. exports.inputProps = inputProps;
  57914. exports.inputPropsDefaults = inputPropsDefaults;
  57915. exports.inputTagEmits = inputTagEmits;
  57916. exports.inputTagProps = inputTagProps;
  57917. exports.install = install;
  57918. exports.linkEmits = linkEmits;
  57919. exports.linkProps = linkProps;
  57920. exports.localeContextKey = localeContextKey;
  57921. exports.makeInstaller = makeInstaller;
  57922. exports.makeList = makeList;
  57923. exports.mentionDefaultProps = mentionDefaultProps;
  57924. exports.mentionEmits = mentionEmits;
  57925. exports.mentionProps = mentionProps;
  57926. exports.menuEmits = menuEmits;
  57927. exports.menuItemEmits = menuItemEmits;
  57928. exports.menuItemGroupProps = menuItemGroupProps;
  57929. exports.menuItemProps = menuItemProps;
  57930. exports.menuProps = menuProps;
  57931. exports.messageConfig = messageConfig;
  57932. exports.messageDefaults = messageDefaults;
  57933. exports.messageEmits = messageEmits;
  57934. exports.messagePlacement = messagePlacement;
  57935. exports.messageProps = messageProps;
  57936. exports.messageTypes = messageTypes;
  57937. exports.namespaceContextKey = namespaceContextKey;
  57938. exports.notificationEmits = notificationEmits;
  57939. exports.notificationProps = notificationProps;
  57940. exports.notificationTypes = notificationTypes;
  57941. exports.overlayEmits = overlayEmits;
  57942. exports.overlayProps = overlayProps;
  57943. exports.pageHeaderEmits = pageHeaderEmits;
  57944. exports.pageHeaderProps = pageHeaderProps;
  57945. exports.paginationEmits = paginationEmits;
  57946. exports.paginationProps = paginationProps;
  57947. exports.parseDate = parseDate;
  57948. exports.popconfirmEmits = popconfirmEmits;
  57949. exports.popconfirmProps = popconfirmProps;
  57950. exports.popoverEmits = popoverEmits;
  57951. exports.popoverProps = popoverProps;
  57952. exports.popoverPropsDefaults = popoverPropsDefaults;
  57953. exports.popperArrowProps = popperArrowProps;
  57954. exports.popperArrowPropsDefaults = popperArrowPropsDefaults;
  57955. exports.popperContentEmits = popperContentEmits;
  57956. exports.popperContentProps = popperContentProps;
  57957. exports.popperContentPropsDefaults = popperContentPropsDefaults;
  57958. exports.popperCoreConfigProps = popperCoreConfigProps;
  57959. exports.popperCoreConfigPropsDefaults = popperCoreConfigPropsDefaults;
  57960. exports.popperProps = popperProps;
  57961. exports.popperTriggerProps = popperTriggerProps;
  57962. exports.progressProps = progressProps;
  57963. exports.provideGlobalConfig = provideGlobalConfig;
  57964. exports.radioButtonProps = radioButtonProps;
  57965. exports.radioButtonPropsDefaults = radioButtonPropsDefaults;
  57966. exports.radioDefaultProps = radioDefaultProps;
  57967. exports.radioEmits = radioEmits;
  57968. exports.radioGroupEmits = radioGroupEmits;
  57969. exports.radioGroupKey = radioGroupKey;
  57970. exports.radioGroupProps = radioGroupProps;
  57971. exports.radioGroupPropsDefaults = radioGroupPropsDefaults;
  57972. exports.radioProps = radioProps;
  57973. exports.radioPropsBase = radioPropsBase;
  57974. exports.radioPropsDefaults = radioPropsDefaults;
  57975. exports.rangeArr = rangeArr;
  57976. exports.rateEmits = rateEmits;
  57977. exports.rateProps = rateProps;
  57978. exports.renderThumbStyle = renderThumbStyle;
  57979. exports.resultProps = resultProps;
  57980. exports.roleTypes = roleTypes;
  57981. exports.rowContextKey = rowContextKey;
  57982. exports.rowProps = rowProps;
  57983. exports.scrollbarContextKey = scrollbarContextKey;
  57984. exports.scrollbarEmits = scrollbarEmits;
  57985. exports.scrollbarProps = scrollbarProps;
  57986. exports.segmentedEmits = segmentedEmits;
  57987. exports.segmentedProps = segmentedProps;
  57988. exports.selectEmits = selectEmits;
  57989. exports.selectGroupKey = selectGroupKey;
  57990. exports.selectKey = selectKey;
  57991. exports.selectProps = selectProps;
  57992. exports.selectV2InjectionKey = selectV2InjectionKey;
  57993. exports.skeletonItemProps = skeletonItemProps;
  57994. exports.skeletonProps = skeletonProps;
  57995. exports.sliderContextKey = sliderContextKey;
  57996. exports.sliderEmits = sliderEmits;
  57997. exports.sliderProps = sliderProps;
  57998. exports.spaceItemProps = spaceItemProps;
  57999. exports.spaceProps = spaceProps;
  58000. exports.splitterEmits = splitterEmits;
  58001. exports.splitterPanelEmits = splitterPanelEmits;
  58002. exports.splitterPanelProps = splitterPanelProps;
  58003. exports.splitterProps = splitterProps;
  58004. exports.statisticProps = statisticProps;
  58005. exports.stepProps = stepProps;
  58006. exports.stepsEmits = stepsEmits;
  58007. exports.stepsProps = stepsProps;
  58008. exports.subMenuProps = subMenuProps;
  58009. exports.switchEmits = switchEmits;
  58010. exports.switchProps = switchProps;
  58011. exports.tabBarProps = tabBarProps;
  58012. exports.tabNavEmits = tabNavEmits;
  58013. exports.tabNavProps = tabNavProps;
  58014. exports.tabPaneProps = tabPaneProps;
  58015. exports.tableV2Props = tableV2Props;
  58016. exports.tableV2RowProps = tableV2RowProps;
  58017. exports.tabsEmits = tabsEmits;
  58018. exports.tabsProps = tabsProps;
  58019. exports.tabsRootContextKey = tabsRootContextKey;
  58020. exports.tagEmits = tagEmits;
  58021. exports.tagProps = tagProps;
  58022. exports.textProps = textProps;
  58023. exports.thumbProps = thumbProps;
  58024. exports.timePickerDefaultProps = timePickerDefaultProps;
  58025. exports.timePickerRangeTriggerProps = timePickerRangeTriggerProps;
  58026. exports.timePickerRngeTriggerProps = timePickerRngeTriggerProps;
  58027. exports.timeSelectProps = timeSelectProps;
  58028. exports.timeUnits = timeUnits;
  58029. exports.timelineItemProps = timelineItemProps;
  58030. exports.timelineProps = timelineProps;
  58031. exports.tooltipEmits = tooltipEmits;
  58032. exports.tourContentEmits = tourContentEmits;
  58033. exports.tourContentProps = tourContentProps;
  58034. exports.tourEmits = tourEmits;
  58035. exports.tourPlacements = tourPlacements;
  58036. exports.tourProps = tourProps;
  58037. exports.tourStepEmits = tourStepEmits;
  58038. exports.tourStepProps = tourStepProps;
  58039. exports.tourStrategies = tourStrategies;
  58040. exports.transferCheckedChangeFn = transferCheckedChangeFn;
  58041. exports.transferEmits = transferEmits;
  58042. exports.transferProps = transferProps;
  58043. exports.translate = translate;
  58044. exports.treeEmits = treeEmits;
  58045. exports.treeProps = treeProps;
  58046. exports.uploadBaseProps = uploadBaseProps;
  58047. exports.uploadBasePropsDefaults = uploadBasePropsDefaults;
  58048. exports.uploadContentProps = uploadContentProps;
  58049. exports.uploadContentPropsDefaults = uploadContentPropsDefaults;
  58050. exports.uploadContextKey = uploadContextKey;
  58051. exports.uploadDraggerEmits = uploadDraggerEmits;
  58052. exports.uploadDraggerProps = uploadDraggerProps;
  58053. exports.uploadListEmits = uploadListEmits;
  58054. exports.uploadListProps = uploadListProps;
  58055. exports.uploadListTypes = uploadListTypes;
  58056. exports.uploadProps = uploadProps;
  58057. exports.uploadPropsDefaults = uploadPropsDefaults;
  58058. exports.useAriaProps = useAriaProps;
  58059. exports.useAttrs = useAttrs;
  58060. exports.useCalcInputWidth = useCalcInputWidth;
  58061. exports.useCascaderConfig = useCascaderConfig;
  58062. exports.useComposition = useComposition;
  58063. exports.useCursor = useCursor;
  58064. exports.useDelayedRender = useDelayedRender;
  58065. exports.useDelayedToggle = useDelayedToggle;
  58066. exports.useDelayedToggleProps = useDelayedToggleProps;
  58067. exports.useDelayedTogglePropsDefaults = useDelayedTogglePropsDefaults;
  58068. exports.useDeprecated = useDeprecated;
  58069. exports.useDialog = useDialog;
  58070. exports.useDisabled = useDisabled;
  58071. exports.useDraggable = useDraggable;
  58072. exports.useEmptyValues = useEmptyValues;
  58073. exports.useEmptyValuesProps = useEmptyValuesProps;
  58074. exports.useEscapeKeydown = useEscapeKeydown;
  58075. exports.useFloating = useFloating;
  58076. exports.useFloatingProps = useFloatingProps;
  58077. exports.useFocus = useFocus;
  58078. exports.useFocusController = useFocusController;
  58079. exports.useFormDisabled = useFormDisabled;
  58080. exports.useFormItem = useFormItem;
  58081. exports.useFormItemInputId = useFormItemInputId;
  58082. exports.useFormSize = useFormSize;
  58083. exports.useForwardRef = useForwardRef;
  58084. exports.useForwardRefDirective = useForwardRefDirective;
  58085. exports.useGetDerivedNamespace = useGetDerivedNamespace;
  58086. exports.useGlobalComponentSettings = useGlobalComponentSettings;
  58087. exports.useGlobalConfig = useGlobalConfig;
  58088. exports.useGlobalSize = useGlobalSize;
  58089. exports.useId = useId;
  58090. exports.useIdInjection = useIdInjection;
  58091. exports.useLocale = useLocale;
  58092. exports.useLockscreen = useLockscreen;
  58093. exports.useModal = useModal;
  58094. exports.useModelToggle = useModelToggle;
  58095. exports.useModelToggleEmits = useModelToggleEmits;
  58096. exports.useModelToggleProps = useModelToggleProps;
  58097. exports.useNamespace = useNamespace;
  58098. exports.useOrderedChildren = useOrderedChildren;
  58099. exports.usePopper = usePopper;
  58100. exports.usePopperArrowProps = usePopperArrowProps;
  58101. exports.usePopperContainer = usePopperContainer;
  58102. exports.usePopperContainerId = usePopperContainerId;
  58103. exports.usePopperContentEmits = usePopperContentEmits;
  58104. exports.usePopperContentProps = usePopperContentProps;
  58105. exports.usePopperCoreConfigProps = usePopperCoreConfigProps;
  58106. exports.usePopperProps = usePopperProps;
  58107. exports.usePopperTriggerProps = usePopperTriggerProps;
  58108. exports.usePreventGlobal = usePreventGlobal;
  58109. exports.useProp = useProp;
  58110. exports.useSameTarget = useSameTarget;
  58111. exports.useSize = useSize;
  58112. exports.useSizeProp = useSizeProp;
  58113. exports.useSizeProps = useSizeProps;
  58114. exports.useSpace = useSpace;
  58115. exports.useTeleport = useTeleport;
  58116. exports.useThrottleRender = useThrottleRender;
  58117. exports.useTimeout = useTimeout;
  58118. exports.useTooltipContentProps = useTooltipContentProps;
  58119. exports.useTooltipContentPropsDefaults = useTooltipContentPropsDefaults;
  58120. exports.useTooltipModelToggle = useTooltipModelToggle;
  58121. exports.useTooltipModelToggleEmits = useTooltipModelToggleEmits;
  58122. exports.useTooltipModelToggleProps = useTooltipModelToggleProps;
  58123. exports.useTooltipProps = useTooltipProps;
  58124. exports.useTooltipTriggerProps = useTooltipTriggerProps;
  58125. exports.useTooltipTriggerPropsDefaults = useTooltipTriggerPropsDefaults;
  58126. exports.useTransitionFallthrough = useTransitionFallthrough;
  58127. exports.useTransitionFallthroughEmits = useTransitionFallthroughEmits;
  58128. exports.useZIndex = useZIndex;
  58129. exports.vRepeatClick = vRepeatClick;
  58130. exports.valueEquals = valueEquals;
  58131. exports.version = version;
  58132. exports.virtualizedGridProps = virtualizedGridProps;
  58133. exports.virtualizedListProps = virtualizedListProps;
  58134. exports.virtualizedProps = virtualizedProps;
  58135. exports.virtualizedScrollbarProps = virtualizedScrollbarProps;
  58136. exports.watermarkProps = watermarkProps;
  58137. exports.zIndexContextKey = zIndexContextKey;
  58138. });