| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848 |
- var av = Object.defineProperty;
- var ov = (e, t, n) => t in e ? av(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
- var qa = (e, t, n) => ov(e, typeof t != "symbol" ? t + "" : t, n);
- import * as d from "react";
- import me, { forwardRef as $t, useRef as Ce, createElement as Xt, createContext as hu, useMemo as Ht, useContext as Sn, useState as rt, useCallback as Ot, useEffect as lt, isValidElement as pc, cloneElement as hc, version as iv, useLayoutEffect as gc, useImperativeHandle as yc, Fragment as uv } from "react";
- import nr, { createPortal as $a, unstable_batchedUpdates as lv, flushSync as Di } from "react-dom";
- function Aa(e) {
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
- }
- function bc(e) {
- if (e.__esModule) return e;
- var t = e.default;
- if (typeof t == "function") {
- var n = function r() {
- return this instanceof r ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
- };
- n.prototype = t.prototype;
- } else n = {};
- return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(r) {
- var a = Object.getOwnPropertyDescriptor(e, r);
- Object.defineProperty(n, r, a.get ? a : {
- enumerable: !0,
- get: function() {
- return e[r];
- }
- });
- }), n;
- }
- var ii = { exports: {} }, ta = {};
- /**
- * @license React
- * react-jsx-runtime.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- var rl;
- function sv() {
- if (rl) return ta;
- rl = 1;
- var e = me, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, a = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
- function i(u, l, c) {
- var s, v = {}, C = null, p = null;
- c !== void 0 && (C = "" + c), l.key !== void 0 && (C = "" + l.key), l.ref !== void 0 && (p = l.ref);
- for (s in l) r.call(l, s) && !o.hasOwnProperty(s) && (v[s] = l[s]);
- if (u && u.defaultProps) for (s in l = u.defaultProps, l) v[s] === void 0 && (v[s] = l[s]);
- return { $$typeof: t, type: u, key: C, ref: p, props: v, _owner: a.current };
- }
- return ta.Fragment = n, ta.jsx = i, ta.jsxs = i, ta;
- }
- var al;
- function cv() {
- return al || (al = 1, ii.exports = sv()), ii.exports;
- }
- var q = cv();
- function Cc(e) {
- var t, n, r = "";
- if (typeof e == "string" || typeof e == "number") r += e;
- else if (typeof e == "object") if (Array.isArray(e)) {
- var a = e.length;
- for (t = 0; t < a; t++) e[t] && (n = Cc(e[t])) && (r && (r += " "), r += n);
- } else for (n in e) e[n] && (r && (r += " "), r += n);
- return r;
- }
- function jt() {
- for (var e, t, n = 0, r = "", a = arguments.length; n < a; n++) (e = arguments[n]) && (t = Cc(e)) && (r && (r += " "), r += t);
- return r;
- }
- const dv = "univer-avatar", fv = "univer-avatar-square", vv = "univer-avatar-circle", mv = "univer-avatar-middle", pv = "univer-avatar-small", hv = "univer-avatar-image", Dr = {
- avatar: dv,
- avatarSquare: fv,
- avatarCircle: vv,
- avatarMiddle: mv,
- avatarSmall: pv,
- avatarImage: hv
- };
- function OO(e) {
- const {
- children: t,
- style: n,
- title: r,
- alt: a,
- shape: o = "circle",
- size: i = "middle",
- src: u,
- fit: l = "fill",
- onError: c,
- onLoad: s
- } = e, v = typeof i == "number" ? {
- width: `${i}px`,
- height: `${i}px`,
- lineHeight: `${i}px`
- } : {}, C = jt(Dr.avatar, {
- [Dr.avatarCircle]: o === "circle",
- [Dr.avatarSquare]: o === "square",
- [Dr.avatarImage]: u,
- [Dr.avatarMiddle]: i === "middle",
- [Dr.avatarSmall]: i === "small"
- }), p = { objectFit: l };
- return u ? /* @__PURE__ */ q.jsxs("span", { className: C, style: { ...v, ...n, ...p }, children: [
- /* @__PURE__ */ q.jsx("img", { src: u, title: r, alt: a, onError: c, onLoad: s }),
- t
- ] }) : /* @__PURE__ */ q.jsx("span", { className: C, style: { ...v, ...n }, children: t });
- }
- const gv = "univer-button", yv = "univer-button-default", bv = "univer-button-primary", Cv = "univer-button-text", Sv = "univer-button-link", wv = "univer-button-small", xv = "univer-button-middle", Ev = "univer-button-large", Rv = "univer-button-block", An = {
- button: gv,
- buttonDefault: yv,
- buttonPrimary: bv,
- buttonText: Cv,
- buttonLink: Sv,
- buttonSmall: wv,
- buttonMiddle: xv,
- buttonLarge: Ev,
- buttonBlock: Rv
- };
- function Po(e) {
- const {
- children: t,
- className: n,
- style: r,
- type: a = "default",
- size: o = "middle",
- block: i,
- htmlType: u,
- disabled: l = !1,
- onClick: c,
- ...s
- } = e, v = jt(
- An.button,
- {
- [An.buttonPrimary]: a === "primary",
- [An.buttonDefault]: a === "default",
- [An.buttonText]: a === "text",
- [An.buttonLink]: a === "link",
- [An.buttonSmall]: o === "small",
- [An.buttonMiddle]: o === "middle",
- [An.buttonLarge]: o === "large",
- [An.buttonBlock]: i
- },
- n
- );
- return /* @__PURE__ */ q.jsx(
- "button",
- {
- className: v,
- style: r,
- type: u,
- onClick: c,
- disabled: l,
- ...s,
- children: t
- }
- );
- }
- var Cn = function() {
- return Cn = Object.assign || function(e) {
- for (var t, n = 1, r = arguments.length; n < r; n++) {
- t = arguments[n];
- for (var a in t) Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
- }
- return e;
- }, Cn.apply(this, arguments);
- }, Pv = function(e, t) {
- var n = {};
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
- for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
- t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
- return n;
- }, Zt = $t(function(e, t) {
- var n = e.icon, r = e.id, a = e.className, o = e.extend, i = Pv(e, ["icon", "id", "className", "extend"]), u = "univerjs-icon univerjs-icon-".concat(r, " ").concat(a || "").trim(), l = Ce("_".concat(Dv()));
- return Sc(n, "".concat(r), { defIds: n.defIds, idSuffix: l.current }, Cn({ ref: t, className: u }, i), o);
- });
- function Sc(e, t, n, r, a) {
- return Xt(e.tag, Cn(Cn({ key: t }, Mv(e, n, a)), r), (kv(e, n).children || []).map(function(o, i) {
- return Sc(o, "".concat(t, "-").concat(e.tag, "-").concat(i), n, void 0, a);
- }));
- }
- function Mv(e, t, n) {
- var r = Cn({}, e.attrs);
- n != null && n.colorChannel1 && r.fill === "colorChannel1" && (r.fill = n.colorChannel1);
- var a = t.defIds;
- return !a || a.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(o) {
- var i = o[0], u = o[1];
- typeof u == "string" && (r[i] = u.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
- })), r;
- }
- function kv(e, t) {
- var n, r = t.defIds;
- return !r || r.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? Cn(Cn({}, e), { children: e.children.map(function(a) {
- return typeof a.attrs.id == "string" && r && r.indexOf(a.attrs.id) > -1 ? Cn(Cn({}, a), { attrs: Cn(Cn({}, a.attrs), { id: a.attrs.id + t.idSuffix }) }) : a;
- }) }) : e;
- }
- function Dv() {
- return Math.random().toString(36).substring(2, 8);
- }
- Zt.displayName = "UniverIcon";
- var Nv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.87598 11.8327C8.87598 11.5013 9.14461 11.2327 9.47598 11.2327H11.476C11.8073 11.2327 12.076 11.5013 12.076 11.8327 12.076 12.164 11.8073 12.4327 11.476 12.4327H9.47598C9.14461 12.4327 8.87598 12.164 8.87598 11.8327zM4.80898 11.2327C4.47761 11.2327 4.20898 11.5013 4.20898 11.8327 4.20898 12.164 4.47761 12.4327 4.80898 12.4327H6.80898C7.14036 12.4327 7.40898 12.164 7.40898 11.8327 7.40898 11.5013 7.14036 11.2327 6.80898 11.2327H4.80898zM8.87598 9.16592C8.87598 8.83455 9.14461 8.56592 9.47598 8.56592H11.476C11.8073 8.56592 12.076 8.83455 12.076 9.16592 12.076 9.49729 11.8073 9.76592 11.476 9.76592H9.47598C9.14461 9.76592 8.87598 9.49729 8.87598 9.16592zM4.80898 8.56592C4.47761 8.56592 4.20898 8.83455 4.20898 9.16592 4.20898 9.49729 4.47761 9.76592 4.80898 9.76592H6.80898C7.14036 9.76592 7.40898 9.49729 7.40898 9.16592 7.40898 8.83455 7.14036 8.56592 6.80898 8.56592H4.80898z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.00615 1.69985C6.00615 1.36848 5.73752 1.09985 5.40615 1.09985C5.07478 1.09985 4.80615 1.36848 4.80615 1.69985V2.34009H3.64248C2.20654 2.34009 1.04248 3.50415 1.04248 4.94009V12.3C1.04248 13.7359 2.20654 14.9 3.64248 14.9H12.6425C14.0784 14.9 15.2425 13.7359 15.2425 12.3V4.94009C15.2425 3.50415 14.0784 2.34009 12.6425 2.34009H11.4798V1.69985C11.4798 1.36848 11.2112 1.09985 10.8798 1.09985C10.5484 1.09985 10.2798 1.36848 10.2798 1.69985V2.34009H6.00615V1.69985ZM14.0425 5.97021V4.94009C14.0425 4.16689 13.4157 3.54009 12.6425 3.54009H11.4798V4.09985C11.4798 4.43122 11.2112 4.69985 10.8798 4.69985C10.5484 4.69985 10.2798 4.43122 10.2798 4.09985V3.54009H6.00615V4.09985C6.00615 4.43122 5.73752 4.69985 5.40615 4.69985C5.07478 4.69985 4.80615 4.43122 4.80615 4.09985V3.54009H3.64248C2.86928 3.54009 2.24248 4.16689 2.24248 4.94009V5.97021H14.0425ZM2.24248 7.17021H14.0425V12.3C14.0425 13.0731 13.4157 13.7 12.6425 13.7H3.64248C2.86928 13.7 2.24248 13.0732 2.24248 12.3V7.17021Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, wc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "calendar-single",
- ref: t,
- icon: Nv
- }));
- });
- wc.displayName = "CalendarSingle";
- var Iv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ao = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "check-mark-single",
- ref: t,
- icon: Iv
- }));
- });
- Ao.displayName = "CheckMarkSingle";
- var Ov = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7.52892 2.86201C7.78927 2.60166 8.21138 2.60166 8.47173 2.86201L11.1384 5.52868C11.3987 5.78903 11.3987 6.21114 11.1384 6.47149C10.878 6.73184 10.4559 6.73184 10.1956 6.47149L8.00033 4.27622L5.80506 6.47149C5.54471 6.73184 5.1226 6.73184 4.86225 6.47149C4.6019 6.21114 4.6019 5.78903 4.86225 5.52868L7.52892 2.86201ZM4.86225 9.52868C5.1226 9.26833 5.54471 9.26833 5.80506 9.52868L8.00033 11.7239L10.1956 9.52868C10.4559 9.26833 10.878 9.26833 11.1384 9.52868C11.3987 9.78903 11.3987 10.2111 11.1384 10.4715L8.47173 13.1382C8.21138 13.3985 7.78927 13.3985 7.52892 13.1382L4.86225 10.4715C4.6019 10.2111 4.6019 9.78903 4.86225 9.52868Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, xc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "chevron-sort-single",
- ref: t,
- icon: Ov
- }));
- });
- xc.displayName = "ChevronSortSingle";
- var _v = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, gu = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "close-single",
- ref: t,
- icon: _v
- }));
- });
- gu.displayName = "CloseSingle";
- var Lv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_371_77", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_371_77)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.85869 12.9216C8.38445 13.4708 7.61555 13.4708 7.14131 12.9216L0.358114 5.06726C-0.406895 4.18144 0.134916 2.66683 1.2168 2.66683L14.7832 2.66683C15.8651 2.66683 16.4069 4.18144 15.6419 5.06726L8.85869 12.9216Z" } }] }] }, Ec = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "dropdown-single",
- ref: t,
- icon: Lv
- }));
- });
- Ec.displayName = "DropdownSingle";
- var Tv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM10.3097 5.69014C10.544 5.92445 10.544 6.30435 10.3097 6.53867L8.84843 7.9999L10.3099 9.46137C10.5442 9.69569 10.5442 10.0756 10.3099 10.3099C10.0756 10.5442 9.69569 10.5442 9.46137 10.3099L7.9999 8.84843L6.53842 10.3099C6.30411 10.5442 5.92421 10.5442 5.6899 10.3099C5.45558 10.0756 5.45558 9.69569 5.6899 9.46137L7.15137 7.9999L5.69014 6.53867C5.45583 6.30435 5.45583 5.92445 5.69014 5.69014C5.92445 5.45583 6.30435 5.45583 6.53867 5.69014L7.9999 7.15137L9.46113 5.69014C9.69544 5.45583 10.0753 5.45583 10.3097 5.69014Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "error-single",
- ref: t,
- icon: Tv
- }));
- });
- Rc.displayName = "ErrorSingle";
- var $v = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, Pc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "increase-single",
- ref: t,
- icon: $v
- }));
- });
- Pc.displayName = "IncreaseSingle";
- var Av = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z" } }] }, Mc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "info-single",
- ref: t,
- icon: Av
- }));
- });
- Mc.displayName = "InfoSingle";
- var jv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "colorChannel1", d: "M8.00695 14.9998C8.00461 14.9999 8.00227 14.9999 7.99993 14.9999C4.13397 14.9999 1 11.8659 1 7.99995C1 4.13624 4.13035 1.00365 7.99321 1.00003C7.9955 1.00001 7.99779 1 8.00008 1C11.866 1 15 4.13397 15 7.99993C15 11.8636 11.8697 14.9961 8.00695 14.9998ZM13.3569 8.01503C13.3568 8.01001 13.3568 8.00499 13.3568 7.99995C13.3568 5.04144 10.9584 2.64309 7.99993 2.64309C5.04645 2.64309 2.65123 5.03327 2.64308 7.98484C2.64317 7.98986 2.64322 7.99489 2.64322 7.99993C2.64322 10.9584 5.04157 13.3568 8.00008 13.3568C10.9536 13.3568 13.3488 10.9666 13.3569 8.01503Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M7.17852 1.82153C7.17852 1.36781 7.54633 1 8.00005 1C11.866 1 15 4.13397 15 7.99993C15 11.8659 11.866 14.9999 8.00005 14.9999C4.1341 14.9999 1.00012 11.8659 1.00012 7.99993C1.00012 7.54621 1.36793 7.1784 1.82165 7.1784C2.27537 7.1784 2.64318 7.54621 2.64318 7.99993C2.64318 10.9584 5.04153 13.3568 8.00005 13.3568C10.9586 13.3568 13.3569 10.9584 13.3569 7.99993C13.3569 5.04141 10.9586 2.64306 8.00005 2.64306C7.54633 2.64306 7.17852 2.27525 7.17852 1.82153Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, kc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "loading",
- ref: t,
- icon: jv
- }));
- });
- kc.displayName = "Loading";
- var Fv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Dc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "more-down-single",
- ref: t,
- icon: Fv
- }));
- });
- Dc.displayName = "MoreDownSingle";
- var zv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M10.3536 12.3536C10.1583 12.5488 9.84171 12.5488 9.64645 12.3536L6.64645 9.35355C6.45118 9.15829 6.45118 8.84171 6.64645 8.64645L9.64645 5.64645C9.84171 5.45118 10.1583 5.45118 10.3536 5.64645C10.5488 5.84171 10.5488 6.15829 10.3536 6.35355L7.70711 9L10.3536 11.6464C10.5488 11.8417 10.5488 12.1583 10.3536 12.3536Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Nc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "more-left-single",
- ref: t,
- icon: zv
- }));
- });
- Nc.displayName = "MoreLeftSingle";
- var Hv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M6.14645 4.64645C6.34171 4.45118 6.65829 4.45118 6.85355 4.64645L9.85355 7.64645C10.0488 7.84171 10.0488 8.15829 9.85355 8.35355L6.85355 11.3536C6.65829 11.5488 6.34171 11.5488 6.14645 11.3536C5.95118 11.1583 5.95118 10.8417 6.14645 10.6464L8.79289 8L6.14645 5.35355C5.95118 5.15829 5.95118 4.84171 6.14645 4.64645Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Ic = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "more-right-single",
- ref: t,
- icon: Hv
- }));
- });
- Ic.displayName = "MoreRightSingle";
- var Vv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.64645 9.85355C4.45118 9.65829 4.45118 9.34171 4.64645 9.14645L7.64645 6.14645C7.84171 5.95118 8.15829 5.95118 8.35355 6.14645L11.3536 9.14645C11.5488 9.34171 11.5488 9.65829 11.3536 9.85355C11.1583 10.0488 10.8417 10.0488 10.6464 9.85355L8 7.20711L5.35355 9.85355C5.15829 10.0488 4.84171 10.0488 4.64645 9.85355Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Oc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "more-up-single",
- ref: t,
- icon: Vv
- }));
- });
- Oc.displayName = "MoreUpSingle";
- var Wv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.3999 7.9999C1.3999 7.66853 1.66853 7.3999 1.9999 7.3999H13.9999C14.3313 7.3999 14.5999 7.66853 14.5999 7.9999C14.5999 8.33127 14.3313 8.5999 13.9999 8.5999H1.9999C1.66853 8.5999 1.3999 8.33127 1.3999 7.9999Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, _c = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "reduce-single",
- ref: t,
- icon: Wv
- }));
- });
- _c.displayName = "ReduceSingle";
- var Bv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Lc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "success-single",
- ref: t,
- icon: Bv
- }));
- });
- Lc.displayName = "SuccessSingle";
- var Uv = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM8.00008 12.3671C8.46031 12.3671 8.83342 11.994 8.83342 11.5338C8.83342 11.0735 8.46031 10.7004 8.00008 10.7004C7.53985 10.7004 7.16675 11.0735 7.16675 11.5338C7.16675 11.994 7.53985 12.3671 8.00008 12.3671ZM8.5999 4.4335C8.5999 4.10213 8.33127 3.8335 7.9999 3.8335C7.66853 3.8335 7.3999 4.10213 7.3999 4.4335V9.36683C7.3999 9.6982 7.66853 9.96683 7.9999 9.96683C8.33127 9.96683 8.5999 9.6982 8.5999 9.36683V4.4335Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Tc = $t(function(e, t) {
- return Xt(Zt, Object.assign({}, e, {
- id: "warning-single",
- ref: t,
- icon: Uv
- }));
- });
- Tc.displayName = "WarningSingle";
- var Ka = {}, ol;
- function qv() {
- if (ol) return Ka;
- ol = 1, Object.defineProperty(Ka, "__esModule", {
- value: !0
- }), Ka.default = e;
- function e() {
- return !!(typeof window < "u" && window.document && window.document.createElement);
- }
- return Ka;
- }
- var Kv = qv();
- const Kr = /* @__PURE__ */ Aa(Kv), In = hu({
- mountContainer: Kr() ? document.body : null
- });
- function _O(e) {
- const { children: t, locale: n, mountContainer: r } = e, a = Ht(() => ({
- locale: n,
- mountContainer: r
- }), [n, r]);
- return /* @__PURE__ */ q.jsx(In.Provider, { value: a, children: t });
- }
- const Yv = "univer-cascader-list", Gv = "univer-cascader-list-board", Xv = "univer-cascader-list-item-active", Zv = "univer-cascader-list-option", Qv = "univer-cascader-list-check-mark", Jv = "univer-cascader-list-item", em = "univer-cascader-list-empty", Un = {
- cascaderList: Yv,
- cascaderListBoard: Gv,
- cascaderListItemActive: Xv,
- cascaderListOption: Zv,
- cascaderListCheckMark: Qv,
- cascaderListItem: Jv,
- cascaderListEmpty: em
- };
- function LO(e) {
- const { value: t, options: n = [], onChange: r } = e, { locale: a } = Sn(In), o = Ht(() => {
- const u = [n];
- return t.forEach((l, c) => {
- const s = u[c].find((v) => v.value === l);
- s != null && s.children && u.push(s.children);
- }), u;
- }, [t]);
- function i(u, l) {
- if (l === t[u])
- return;
- if (t[u + 1]) {
- const s = t.slice(0, u + 1);
- s[u] = l, r(s);
- return;
- }
- const c = [...t];
- c[u] = l, r(c);
- }
- return /* @__PURE__ */ q.jsxs("section", { className: Un.cascaderList, children: [
- o.map(
- (u, l) => u.length ? /* @__PURE__ */ q.jsx("ul", { className: Un.cascaderListBoard, children: u.map((c) => /* @__PURE__ */ q.jsx(
- "li",
- {
- className: jt(Un.cascaderListItem, {
- [Un.cascaderListItemActive]: c.value === t[l]
- }),
- children: /* @__PURE__ */ q.jsxs(
- "a",
- {
- className: Un.cascaderListOption,
- onClick: () => i(l, c.value),
- children: [
- /* @__PURE__ */ q.jsx("span", { className: Un.cascaderListCheckMark, children: c.value === t[l] && /* @__PURE__ */ q.jsx(Ao, {}) }),
- /* @__PURE__ */ q.jsx("span", { children: c.label })
- ]
- }
- )
- },
- c.value
- )) }, l) : /* @__PURE__ */ q.jsx("section", { className: Un.cascaderListEmpty, children: a == null ? void 0 : a.CascaderList.empty }, l)
- ),
- t.length <= 0 && /* @__PURE__ */ q.jsx("section", { className: Un.cascaderListEmpty, children: a == null ? void 0 : a.CascaderList.empty })
- ] });
- }
- const tm = "univer-checkbox", nm = "univer-checkbox-target-input", rm = "univer-checkbox-target-inner", am = "univer-checkbox-disabled", om = "univer-checkbox-indeterminate", im = "univer-checkbox-target", Nr = {
- checkbox: tm,
- checkboxTargetInput: nm,
- checkboxTargetInner: rm,
- checkboxDisabled: am,
- checkboxIndeterminate: om,
- checkboxTarget: im
- };
- function um(e) {
- const { children: t, className: n, style: r, checked: a = !1, indeterminate: o = !1, value: i, disabled: u = !1, onChange: l, contentClassName: c } = e, s = Ce(null);
- function v(p) {
- var m, b;
- if (p.stopPropagation(), !(!l || u))
- if (typeof i < "u")
- l == null || l(i);
- else {
- const f = (b = (m = s == null ? void 0 : s.current) == null ? void 0 : m.checked) != null ? b : !1;
- l == null || l(f);
- }
- }
- const C = jt(n, Nr.checkbox, {
- [Nr.checkboxDisabled]: u,
- [Nr.checkboxIndeterminate]: o && !a
- });
- return /* @__PURE__ */ q.jsxs("label", { className: C, style: r, children: [
- /* @__PURE__ */ q.jsxs("span", { className: Nr.checkboxTarget, children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- ref: s,
- className: Nr.checkboxTargetInput,
- type: "checkbox",
- checked: a,
- disabled: u,
- onChange: v
- }
- ),
- /* @__PURE__ */ q.jsx("span", { className: Nr.checkboxTargetInner })
- ] }),
- /* @__PURE__ */ q.jsx("span", { className: c, children: t })
- ] });
- }
- const lm = "univer-checkbox-group", sm = "univer-checkbox-group-direction-vertical", il = {
- checkboxGroup: lm,
- checkboxGroupDirectionVertical: sm
- };
- function TO(e) {
- const { children: t, className: n, style: r, value: a, disabled: o, direction: i = "horizontal", onChange: u } = e, l = (s) => {
- a.includes(s) ? u(a.filter((v) => v !== s)) : u([...a, s]);
- }, c = jt(n, il.checkboxGroup, {
- [il.checkboxGroupDirectionVertical]: i === "vertical"
- });
- return /* @__PURE__ */ q.jsx("div", { className: c, style: r, children: me.Children.map(t, (s, v) => me.isValidElement(s) ? me.cloneElement(s, {
- key: v,
- children: s.props.children,
- checked: s.props.value ? a.includes(s.props.value) : !1,
- disabled: o != null ? o : s.props.disabled,
- onChange: l
- }) : s) });
- }
- const Da = (e, t, n) => {
- t = t / 100, n = n / 100;
- const r = n * t, a = r * (1 - Math.abs(e / 60 % 2 - 1)), o = n - r;
- let i = 0, u = 0, l = 0;
- return e >= 0 && e < 60 ? (i = r, u = a, l = 0) : e >= 60 && e < 120 ? (i = a, u = r, l = 0) : e >= 120 && e < 180 ? (i = 0, u = r, l = a) : e >= 180 && e < 240 ? (i = 0, u = a, l = r) : e >= 240 && e < 300 ? (i = a, u = 0, l = r) : e >= 300 && e < 360 && (i = r, u = 0, l = a), [
- Math.round((i + o) * 255),
- Math.round((u + o) * 255),
- Math.round((l + o) * 255)
- ];
- }, $c = (e, t, n) => {
- const r = (a) => a.toString(16).padStart(2, "0");
- return `#${r(e)}${r(t)}${r(n)}`;
- }, Ac = (e, t, n) => {
- e /= 255, t /= 255, n /= 255;
- const r = Math.max(e, t, n), a = Math.min(e, t, n), o = r - a;
- let i = 0, u = 0;
- const l = r;
- return r !== 0 && (u = o / r), o !== 0 && (r === e ? i = (t - n) / o + (t < n ? 6 : 0) : r === t ? i = (n - e) / o + 2 : r === n && (i = (e - t) / o + 4), i *= 60), [
- i,
- u * 100,
- l * 100
- ];
- }, yu = (e) => {
- const [t, n, r] = e.match(/\w\w/g).map((a) => Number.parseInt(a, 16));
- return Ac(t, n, r);
- }, bu = (e, t, n) => {
- const [r, a, o] = Da(e, t, n);
- return $c(r, a, o);
- }, ul = (e, t, n) => {
- const r = (2 - t / 100) * n / 2, a = r && r < 50 ? t * n / (r * 2) : t + r;
- return [e, a, r];
- }, cm = (e, t, n) => {
- t /= 100, n /= 100;
- const r = n + t * Math.min(n, 1 - n), a = r === 0 ? 0 : 2 * (1 - n / r);
- return [
- e,
- // Hue remains the same
- Math.round(a * 100),
- // Convert S back to percentage
- Math.round(r * 100)
- // Convert V back to percentage
- ];
- }, dm = ({ hsv: e, alpha: t, onChange: n, onChanged: r }) => {
- const [a, o] = rt(!1), i = Ce(null), u = Ce(null), l = Ht(() => {
- var m, b;
- return (b = (m = u.current) == null ? void 0 : m.clientWidth) != null ? b : 0;
- }, [u.current]), c = Ot((m) => {
- const b = i.current;
- if (!b) return;
- const f = b.getBoundingClientRect(), h = f.width - l, g = Math.max(0, Math.min(m - f.left, h));
- n(Math.round(g / h * 100) / 100);
- }, [n]), s = Ot((m) => {
- a && c(m.clientX);
- }, [a, c]), v = Ot(() => {
- o(!1), r == null || r(t);
- }, [t]);
- lt(() => (a && (window.addEventListener("pointermove", s), window.addEventListener("pointerup", v), window.addEventListener("mouseup", v)), () => {
- window.removeEventListener("pointermove", s), window.removeEventListener("pointerup", v), window.removeEventListener("mouseup", v);
- }), [a, s, v]);
- const C = () => {
- var b;
- return `${Math.min(Math.max(t * 100, 0), 100) / 100 * (100 - l / ((b = i.current) == null ? void 0 : b.clientWidth) * 100)}%`;
- }, p = Da(...e);
- return /* @__PURE__ */ q.jsxs("div", { className: "univer-relative univer-w-full univer-select-none", children: [
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: "univer-absolute univer-inset-0 univer-rounded-full",
- style: {
- backgroundImage: "linear-gradient(45deg, #E3E5EA 25%, transparent 25%), linear-gradient(-45deg, #E3E5EA 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #E3E5EA 75%), linear-gradient(-45deg, transparent 75%, #E3E5EA 75%)",
- backgroundPosition: "0 0, 0 4px, 4px -4px, -4px 0",
- backgroundSize: "8px 8px"
- }
- }
- ),
- /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: i,
- className: `
- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner
- `,
- style: {
- background: `linear-gradient(to right, transparent, rgb(${p}))`
- },
- onPointerDown: (m) => {
- o(!0), c(m.clientX);
- },
- children: /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: u,
- className: `
- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full
- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform
- univer-duration-75 univer-will-change-transform
- `,
- style: {
- left: C(),
- transform: "translateY(-50%)",
- transition: a ? "none" : "all 0.1s ease-out"
- }
- }
- )
- }
- )
- ] });
- }, Cu = "-", fm = (e) => {
- const t = mm(e), {
- conflictingClassGroups: n,
- conflictingClassGroupModifiers: r
- } = e;
- return {
- getClassGroupId: (i) => {
- const u = i.split(Cu);
- return u[0] === "" && u.length !== 1 && u.shift(), jc(u, t) || vm(i);
- },
- getConflictingClassGroupIds: (i, u) => {
- const l = n[i] || [];
- return u && r[i] ? [...l, ...r[i]] : l;
- }
- };
- }, jc = (e, t) => {
- var i;
- if (e.length === 0)
- return t.classGroupId;
- const n = e[0], r = t.nextPart.get(n), a = r ? jc(e.slice(1), r) : void 0;
- if (a)
- return a;
- if (t.validators.length === 0)
- return;
- const o = e.join(Cu);
- return (i = t.validators.find(({
- validator: u
- }) => u(o))) == null ? void 0 : i.classGroupId;
- }, ll = /^\[(.+)\]$/, vm = (e) => {
- if (ll.test(e)) {
- const t = ll.exec(e)[1], n = t == null ? void 0 : t.substring(0, t.indexOf(":"));
- if (n)
- return "arbitrary.." + n;
- }
- }, mm = (e) => {
- const {
- theme: t,
- prefix: n
- } = e, r = {
- nextPart: /* @__PURE__ */ new Map(),
- validators: []
- };
- return hm(Object.entries(e.classGroups), n).forEach(([o, i]) => {
- Ni(i, r, o, t);
- }), r;
- }, Ni = (e, t, n, r) => {
- e.forEach((a) => {
- if (typeof a == "string") {
- const o = a === "" ? t : sl(t, a);
- o.classGroupId = n;
- return;
- }
- if (typeof a == "function") {
- if (pm(a)) {
- Ni(a(r), t, n, r);
- return;
- }
- t.validators.push({
- validator: a,
- classGroupId: n
- });
- return;
- }
- Object.entries(a).forEach(([o, i]) => {
- Ni(i, sl(t, o), n, r);
- });
- });
- }, sl = (e, t) => {
- let n = e;
- return t.split(Cu).forEach((r) => {
- n.nextPart.has(r) || n.nextPart.set(r, {
- nextPart: /* @__PURE__ */ new Map(),
- validators: []
- }), n = n.nextPart.get(r);
- }), n;
- }, pm = (e) => e.isThemeGetter, hm = (e, t) => t ? e.map(([n, r]) => {
- const a = r.map((o) => typeof o == "string" ? t + o : typeof o == "object" ? Object.fromEntries(Object.entries(o).map(([i, u]) => [t + i, u])) : o);
- return [n, a];
- }) : e, gm = (e) => {
- if (e < 1)
- return {
- get: () => {
- },
- set: () => {
- }
- };
- let t = 0, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
- const a = (o, i) => {
- n.set(o, i), t++, t > e && (t = 0, r = n, n = /* @__PURE__ */ new Map());
- };
- return {
- get(o) {
- let i = n.get(o);
- if (i !== void 0)
- return i;
- if ((i = r.get(o)) !== void 0)
- return a(o, i), i;
- },
- set(o, i) {
- n.has(o) ? n.set(o, i) : a(o, i);
- }
- };
- }, Fc = "!", ym = (e) => {
- const {
- separator: t,
- experimentalParseClassName: n
- } = e, r = t.length === 1, a = t[0], o = t.length, i = (u) => {
- const l = [];
- let c = 0, s = 0, v;
- for (let f = 0; f < u.length; f++) {
- let h = u[f];
- if (c === 0) {
- if (h === a && (r || u.slice(f, f + o) === t)) {
- l.push(u.slice(s, f)), s = f + o;
- continue;
- }
- if (h === "/") {
- v = f;
- continue;
- }
- }
- h === "[" ? c++ : h === "]" && c--;
- }
- const C = l.length === 0 ? u : u.substring(s), p = C.startsWith(Fc), m = p ? C.substring(1) : C, b = v && v > s ? v - s : void 0;
- return {
- modifiers: l,
- hasImportantModifier: p,
- baseClassName: m,
- maybePostfixModifierPosition: b
- };
- };
- return n ? (u) => n({
- className: u,
- parseClassName: i
- }) : i;
- }, bm = (e) => {
- if (e.length <= 1)
- return e;
- const t = [];
- let n = [];
- return e.forEach((r) => {
- r[0] === "[" ? (t.push(...n.sort(), r), n = []) : n.push(r);
- }), t.push(...n.sort()), t;
- }, Cm = (e) => ({
- cache: gm(e.cacheSize),
- parseClassName: ym(e),
- ...fm(e)
- }), Sm = /\s+/, wm = (e, t) => {
- const {
- parseClassName: n,
- getClassGroupId: r,
- getConflictingClassGroupIds: a
- } = t, o = [], i = e.trim().split(Sm);
- let u = "";
- for (let l = i.length - 1; l >= 0; l -= 1) {
- const c = i[l], {
- modifiers: s,
- hasImportantModifier: v,
- baseClassName: C,
- maybePostfixModifierPosition: p
- } = n(c);
- let m = !!p, b = r(m ? C.substring(0, p) : C);
- if (!b) {
- if (!m) {
- u = c + (u.length > 0 ? " " + u : u);
- continue;
- }
- if (b = r(C), !b) {
- u = c + (u.length > 0 ? " " + u : u);
- continue;
- }
- m = !1;
- }
- const f = bm(s).join(":"), h = v ? f + Fc : f, g = h + b;
- if (o.includes(g))
- continue;
- o.push(g);
- const y = a(b, m);
- for (let w = 0; w < y.length; ++w) {
- const E = y[w];
- o.push(h + E);
- }
- u = c + (u.length > 0 ? " " + u : u);
- }
- return u;
- };
- function xm() {
- let e = 0, t, n, r = "";
- for (; e < arguments.length; )
- (t = arguments[e++]) && (n = zc(t)) && (r && (r += " "), r += n);
- return r;
- }
- const zc = (e) => {
- if (typeof e == "string")
- return e;
- let t, n = "";
- for (let r = 0; r < e.length; r++)
- e[r] && (t = zc(e[r])) && (n && (n += " "), n += t);
- return n;
- };
- function Em(e, ...t) {
- let n, r, a, o = i;
- function i(l) {
- const c = t.reduce((s, v) => v(s), e());
- return n = Cm(c), r = n.cache.get, a = n.cache.set, o = u, u(l);
- }
- function u(l) {
- const c = r(l);
- if (c)
- return c;
- const s = wm(l, n);
- return a(l, s), s;
- }
- return function() {
- return o(xm.apply(null, arguments));
- };
- }
- const Pt = (e) => {
- const t = (n) => n[e] || [];
- return t.isThemeGetter = !0, t;
- }, Hc = /^\[(?:([a-z-]+):)?(.+)\]$/i, Rm = /^\d+\/\d+$/, Pm = /* @__PURE__ */ new Set(["px", "full", "screen"]), Mm = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, km = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, Dm = /^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/, Nm = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, Im = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, jn = (e) => Vr(e) || Pm.has(e) || Rm.test(e), qn = (e) => Yr(e, "length", Fm), Vr = (e) => !!e && !Number.isNaN(Number(e)), ui = (e) => Yr(e, "number", Vr), na = (e) => !!e && Number.isInteger(Number(e)), Om = (e) => e.endsWith("%") && Vr(e.slice(0, -1)), ot = (e) => Hc.test(e), Kn = (e) => Mm.test(e), _m = /* @__PURE__ */ new Set(["length", "size", "percentage"]), Lm = (e) => Yr(e, _m, Vc), Tm = (e) => Yr(e, "position", Vc), $m = /* @__PURE__ */ new Set(["image", "url"]), Am = (e) => Yr(e, $m, Hm), jm = (e) => Yr(e, "", zm), ra = () => !0, Yr = (e, t, n) => {
- const r = Hc.exec(e);
- return r ? r[1] ? typeof t == "string" ? r[1] === t : t.has(r[1]) : n(r[2]) : !1;
- }, Fm = (e) => (
- // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
- // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
- // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
- km.test(e) && !Dm.test(e)
- ), Vc = () => !1, zm = (e) => Nm.test(e), Hm = (e) => Im.test(e), Vm = () => {
- const e = Pt("colors"), t = Pt("spacing"), n = Pt("blur"), r = Pt("brightness"), a = Pt("borderColor"), o = Pt("borderRadius"), i = Pt("borderSpacing"), u = Pt("borderWidth"), l = Pt("contrast"), c = Pt("grayscale"), s = Pt("hueRotate"), v = Pt("invert"), C = Pt("gap"), p = Pt("gradientColorStops"), m = Pt("gradientColorStopPositions"), b = Pt("inset"), f = Pt("margin"), h = Pt("opacity"), g = Pt("padding"), y = Pt("saturate"), w = Pt("scale"), E = Pt("sepia"), S = Pt("skew"), x = Pt("space"), R = Pt("translate"), k = () => ["auto", "contain", "none"], L = () => ["auto", "hidden", "clip", "visible", "scroll"], O = () => ["auto", ot, t], N = () => [ot, t], F = () => ["", jn, qn], I = () => ["auto", Vr, ot], T = () => ["bottom", "center", "left", "left-bottom", "left-top", "right", "right-bottom", "right-top", "top"], P = () => ["solid", "dashed", "dotted", "double", "none"], z = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], _ = () => ["start", "end", "center", "between", "around", "evenly", "stretch"], A = () => ["", "0", ot], H = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], $ = () => [Vr, ot];
- return {
- cacheSize: 500,
- separator: ":",
- theme: {
- colors: [ra],
- spacing: [jn, qn],
- blur: ["none", "", Kn, ot],
- brightness: $(),
- borderColor: [e],
- borderRadius: ["none", "", "full", Kn, ot],
- borderSpacing: N(),
- borderWidth: F(),
- contrast: $(),
- grayscale: A(),
- hueRotate: $(),
- invert: A(),
- gap: N(),
- gradientColorStops: [e],
- gradientColorStopPositions: [Om, qn],
- inset: O(),
- margin: O(),
- opacity: $(),
- padding: N(),
- saturate: $(),
- scale: $(),
- sepia: A(),
- skew: $(),
- space: N(),
- translate: N()
- },
- classGroups: {
- // Layout
- /**
- * Aspect Ratio
- * @see https://tailwindcss.com/docs/aspect-ratio
- */
- aspect: [{
- aspect: ["auto", "square", "video", ot]
- }],
- /**
- * Container
- * @see https://tailwindcss.com/docs/container
- */
- container: ["container"],
- /**
- * Columns
- * @see https://tailwindcss.com/docs/columns
- */
- columns: [{
- columns: [Kn]
- }],
- /**
- * Break After
- * @see https://tailwindcss.com/docs/break-after
- */
- "break-after": [{
- "break-after": H()
- }],
- /**
- * Break Before
- * @see https://tailwindcss.com/docs/break-before
- */
- "break-before": [{
- "break-before": H()
- }],
- /**
- * Break Inside
- * @see https://tailwindcss.com/docs/break-inside
- */
- "break-inside": [{
- "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
- }],
- /**
- * Box Decoration Break
- * @see https://tailwindcss.com/docs/box-decoration-break
- */
- "box-decoration": [{
- "box-decoration": ["slice", "clone"]
- }],
- /**
- * Box Sizing
- * @see https://tailwindcss.com/docs/box-sizing
- */
- box: [{
- box: ["border", "content"]
- }],
- /**
- * Display
- * @see https://tailwindcss.com/docs/display
- */
- display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
- /**
- * Floats
- * @see https://tailwindcss.com/docs/float
- */
- float: [{
- float: ["right", "left", "none", "start", "end"]
- }],
- /**
- * Clear
- * @see https://tailwindcss.com/docs/clear
- */
- clear: [{
- clear: ["left", "right", "both", "none", "start", "end"]
- }],
- /**
- * Isolation
- * @see https://tailwindcss.com/docs/isolation
- */
- isolation: ["isolate", "isolation-auto"],
- /**
- * Object Fit
- * @see https://tailwindcss.com/docs/object-fit
- */
- "object-fit": [{
- object: ["contain", "cover", "fill", "none", "scale-down"]
- }],
- /**
- * Object Position
- * @see https://tailwindcss.com/docs/object-position
- */
- "object-position": [{
- object: [...T(), ot]
- }],
- /**
- * Overflow
- * @see https://tailwindcss.com/docs/overflow
- */
- overflow: [{
- overflow: L()
- }],
- /**
- * Overflow X
- * @see https://tailwindcss.com/docs/overflow
- */
- "overflow-x": [{
- "overflow-x": L()
- }],
- /**
- * Overflow Y
- * @see https://tailwindcss.com/docs/overflow
- */
- "overflow-y": [{
- "overflow-y": L()
- }],
- /**
- * Overscroll Behavior
- * @see https://tailwindcss.com/docs/overscroll-behavior
- */
- overscroll: [{
- overscroll: k()
- }],
- /**
- * Overscroll Behavior X
- * @see https://tailwindcss.com/docs/overscroll-behavior
- */
- "overscroll-x": [{
- "overscroll-x": k()
- }],
- /**
- * Overscroll Behavior Y
- * @see https://tailwindcss.com/docs/overscroll-behavior
- */
- "overscroll-y": [{
- "overscroll-y": k()
- }],
- /**
- * Position
- * @see https://tailwindcss.com/docs/position
- */
- position: ["static", "fixed", "absolute", "relative", "sticky"],
- /**
- * Top / Right / Bottom / Left
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- inset: [{
- inset: [b]
- }],
- /**
- * Right / Left
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- "inset-x": [{
- "inset-x": [b]
- }],
- /**
- * Top / Bottom
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- "inset-y": [{
- "inset-y": [b]
- }],
- /**
- * Start
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- start: [{
- start: [b]
- }],
- /**
- * End
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- end: [{
- end: [b]
- }],
- /**
- * Top
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- top: [{
- top: [b]
- }],
- /**
- * Right
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- right: [{
- right: [b]
- }],
- /**
- * Bottom
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- bottom: [{
- bottom: [b]
- }],
- /**
- * Left
- * @see https://tailwindcss.com/docs/top-right-bottom-left
- */
- left: [{
- left: [b]
- }],
- /**
- * Visibility
- * @see https://tailwindcss.com/docs/visibility
- */
- visibility: ["visible", "invisible", "collapse"],
- /**
- * Z-Index
- * @see https://tailwindcss.com/docs/z-index
- */
- z: [{
- z: ["auto", na, ot]
- }],
- // Flexbox and Grid
- /**
- * Flex Basis
- * @see https://tailwindcss.com/docs/flex-basis
- */
- basis: [{
- basis: O()
- }],
- /**
- * Flex Direction
- * @see https://tailwindcss.com/docs/flex-direction
- */
- "flex-direction": [{
- flex: ["row", "row-reverse", "col", "col-reverse"]
- }],
- /**
- * Flex Wrap
- * @see https://tailwindcss.com/docs/flex-wrap
- */
- "flex-wrap": [{
- flex: ["wrap", "wrap-reverse", "nowrap"]
- }],
- /**
- * Flex
- * @see https://tailwindcss.com/docs/flex
- */
- flex: [{
- flex: ["1", "auto", "initial", "none", ot]
- }],
- /**
- * Flex Grow
- * @see https://tailwindcss.com/docs/flex-grow
- */
- grow: [{
- grow: A()
- }],
- /**
- * Flex Shrink
- * @see https://tailwindcss.com/docs/flex-shrink
- */
- shrink: [{
- shrink: A()
- }],
- /**
- * Order
- * @see https://tailwindcss.com/docs/order
- */
- order: [{
- order: ["first", "last", "none", na, ot]
- }],
- /**
- * Grid Template Columns
- * @see https://tailwindcss.com/docs/grid-template-columns
- */
- "grid-cols": [{
- "grid-cols": [ra]
- }],
- /**
- * Grid Column Start / End
- * @see https://tailwindcss.com/docs/grid-column
- */
- "col-start-end": [{
- col: ["auto", {
- span: ["full", na, ot]
- }, ot]
- }],
- /**
- * Grid Column Start
- * @see https://tailwindcss.com/docs/grid-column
- */
- "col-start": [{
- "col-start": I()
- }],
- /**
- * Grid Column End
- * @see https://tailwindcss.com/docs/grid-column
- */
- "col-end": [{
- "col-end": I()
- }],
- /**
- * Grid Template Rows
- * @see https://tailwindcss.com/docs/grid-template-rows
- */
- "grid-rows": [{
- "grid-rows": [ra]
- }],
- /**
- * Grid Row Start / End
- * @see https://tailwindcss.com/docs/grid-row
- */
- "row-start-end": [{
- row: ["auto", {
- span: [na, ot]
- }, ot]
- }],
- /**
- * Grid Row Start
- * @see https://tailwindcss.com/docs/grid-row
- */
- "row-start": [{
- "row-start": I()
- }],
- /**
- * Grid Row End
- * @see https://tailwindcss.com/docs/grid-row
- */
- "row-end": [{
- "row-end": I()
- }],
- /**
- * Grid Auto Flow
- * @see https://tailwindcss.com/docs/grid-auto-flow
- */
- "grid-flow": [{
- "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
- }],
- /**
- * Grid Auto Columns
- * @see https://tailwindcss.com/docs/grid-auto-columns
- */
- "auto-cols": [{
- "auto-cols": ["auto", "min", "max", "fr", ot]
- }],
- /**
- * Grid Auto Rows
- * @see https://tailwindcss.com/docs/grid-auto-rows
- */
- "auto-rows": [{
- "auto-rows": ["auto", "min", "max", "fr", ot]
- }],
- /**
- * Gap
- * @see https://tailwindcss.com/docs/gap
- */
- gap: [{
- gap: [C]
- }],
- /**
- * Gap X
- * @see https://tailwindcss.com/docs/gap
- */
- "gap-x": [{
- "gap-x": [C]
- }],
- /**
- * Gap Y
- * @see https://tailwindcss.com/docs/gap
- */
- "gap-y": [{
- "gap-y": [C]
- }],
- /**
- * Justify Content
- * @see https://tailwindcss.com/docs/justify-content
- */
- "justify-content": [{
- justify: ["normal", ..._()]
- }],
- /**
- * Justify Items
- * @see https://tailwindcss.com/docs/justify-items
- */
- "justify-items": [{
- "justify-items": ["start", "end", "center", "stretch"]
- }],
- /**
- * Justify Self
- * @see https://tailwindcss.com/docs/justify-self
- */
- "justify-self": [{
- "justify-self": ["auto", "start", "end", "center", "stretch"]
- }],
- /**
- * Align Content
- * @see https://tailwindcss.com/docs/align-content
- */
- "align-content": [{
- content: ["normal", ..._(), "baseline"]
- }],
- /**
- * Align Items
- * @see https://tailwindcss.com/docs/align-items
- */
- "align-items": [{
- items: ["start", "end", "center", "baseline", "stretch"]
- }],
- /**
- * Align Self
- * @see https://tailwindcss.com/docs/align-self
- */
- "align-self": [{
- self: ["auto", "start", "end", "center", "stretch", "baseline"]
- }],
- /**
- * Place Content
- * @see https://tailwindcss.com/docs/place-content
- */
- "place-content": [{
- "place-content": [..._(), "baseline"]
- }],
- /**
- * Place Items
- * @see https://tailwindcss.com/docs/place-items
- */
- "place-items": [{
- "place-items": ["start", "end", "center", "baseline", "stretch"]
- }],
- /**
- * Place Self
- * @see https://tailwindcss.com/docs/place-self
- */
- "place-self": [{
- "place-self": ["auto", "start", "end", "center", "stretch"]
- }],
- // Spacing
- /**
- * Padding
- * @see https://tailwindcss.com/docs/padding
- */
- p: [{
- p: [g]
- }],
- /**
- * Padding X
- * @see https://tailwindcss.com/docs/padding
- */
- px: [{
- px: [g]
- }],
- /**
- * Padding Y
- * @see https://tailwindcss.com/docs/padding
- */
- py: [{
- py: [g]
- }],
- /**
- * Padding Start
- * @see https://tailwindcss.com/docs/padding
- */
- ps: [{
- ps: [g]
- }],
- /**
- * Padding End
- * @see https://tailwindcss.com/docs/padding
- */
- pe: [{
- pe: [g]
- }],
- /**
- * Padding Top
- * @see https://tailwindcss.com/docs/padding
- */
- pt: [{
- pt: [g]
- }],
- /**
- * Padding Right
- * @see https://tailwindcss.com/docs/padding
- */
- pr: [{
- pr: [g]
- }],
- /**
- * Padding Bottom
- * @see https://tailwindcss.com/docs/padding
- */
- pb: [{
- pb: [g]
- }],
- /**
- * Padding Left
- * @see https://tailwindcss.com/docs/padding
- */
- pl: [{
- pl: [g]
- }],
- /**
- * Margin
- * @see https://tailwindcss.com/docs/margin
- */
- m: [{
- m: [f]
- }],
- /**
- * Margin X
- * @see https://tailwindcss.com/docs/margin
- */
- mx: [{
- mx: [f]
- }],
- /**
- * Margin Y
- * @see https://tailwindcss.com/docs/margin
- */
- my: [{
- my: [f]
- }],
- /**
- * Margin Start
- * @see https://tailwindcss.com/docs/margin
- */
- ms: [{
- ms: [f]
- }],
- /**
- * Margin End
- * @see https://tailwindcss.com/docs/margin
- */
- me: [{
- me: [f]
- }],
- /**
- * Margin Top
- * @see https://tailwindcss.com/docs/margin
- */
- mt: [{
- mt: [f]
- }],
- /**
- * Margin Right
- * @see https://tailwindcss.com/docs/margin
- */
- mr: [{
- mr: [f]
- }],
- /**
- * Margin Bottom
- * @see https://tailwindcss.com/docs/margin
- */
- mb: [{
- mb: [f]
- }],
- /**
- * Margin Left
- * @see https://tailwindcss.com/docs/margin
- */
- ml: [{
- ml: [f]
- }],
- /**
- * Space Between X
- * @see https://tailwindcss.com/docs/space
- */
- "space-x": [{
- "space-x": [x]
- }],
- /**
- * Space Between X Reverse
- * @see https://tailwindcss.com/docs/space
- */
- "space-x-reverse": ["space-x-reverse"],
- /**
- * Space Between Y
- * @see https://tailwindcss.com/docs/space
- */
- "space-y": [{
- "space-y": [x]
- }],
- /**
- * Space Between Y Reverse
- * @see https://tailwindcss.com/docs/space
- */
- "space-y-reverse": ["space-y-reverse"],
- // Sizing
- /**
- * Width
- * @see https://tailwindcss.com/docs/width
- */
- w: [{
- w: ["auto", "min", "max", "fit", "svw", "lvw", "dvw", ot, t]
- }],
- /**
- * Min-Width
- * @see https://tailwindcss.com/docs/min-width
- */
- "min-w": [{
- "min-w": [ot, t, "min", "max", "fit"]
- }],
- /**
- * Max-Width
- * @see https://tailwindcss.com/docs/max-width
- */
- "max-w": [{
- "max-w": [ot, t, "none", "full", "min", "max", "fit", "prose", {
- screen: [Kn]
- }, Kn]
- }],
- /**
- * Height
- * @see https://tailwindcss.com/docs/height
- */
- h: [{
- h: [ot, t, "auto", "min", "max", "fit", "svh", "lvh", "dvh"]
- }],
- /**
- * Min-Height
- * @see https://tailwindcss.com/docs/min-height
- */
- "min-h": [{
- "min-h": [ot, t, "min", "max", "fit", "svh", "lvh", "dvh"]
- }],
- /**
- * Max-Height
- * @see https://tailwindcss.com/docs/max-height
- */
- "max-h": [{
- "max-h": [ot, t, "min", "max", "fit", "svh", "lvh", "dvh"]
- }],
- /**
- * Size
- * @see https://tailwindcss.com/docs/size
- */
- size: [{
- size: [ot, t, "auto", "min", "max", "fit"]
- }],
- // Typography
- /**
- * Font Size
- * @see https://tailwindcss.com/docs/font-size
- */
- "font-size": [{
- text: ["base", Kn, qn]
- }],
- /**
- * Font Smoothing
- * @see https://tailwindcss.com/docs/font-smoothing
- */
- "font-smoothing": ["antialiased", "subpixel-antialiased"],
- /**
- * Font Style
- * @see https://tailwindcss.com/docs/font-style
- */
- "font-style": ["italic", "not-italic"],
- /**
- * Font Weight
- * @see https://tailwindcss.com/docs/font-weight
- */
- "font-weight": [{
- font: ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black", ui]
- }],
- /**
- * Font Family
- * @see https://tailwindcss.com/docs/font-family
- */
- "font-family": [{
- font: [ra]
- }],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-normal": ["normal-nums"],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-ordinal": ["ordinal"],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-slashed-zero": ["slashed-zero"],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-figure": ["lining-nums", "oldstyle-nums"],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-spacing": ["proportional-nums", "tabular-nums"],
- /**
- * Font Variant Numeric
- * @see https://tailwindcss.com/docs/font-variant-numeric
- */
- "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
- /**
- * Letter Spacing
- * @see https://tailwindcss.com/docs/letter-spacing
- */
- tracking: [{
- tracking: ["tighter", "tight", "normal", "wide", "wider", "widest", ot]
- }],
- /**
- * Line Clamp
- * @see https://tailwindcss.com/docs/line-clamp
- */
- "line-clamp": [{
- "line-clamp": ["none", Vr, ui]
- }],
- /**
- * Line Height
- * @see https://tailwindcss.com/docs/line-height
- */
- leading: [{
- leading: ["none", "tight", "snug", "normal", "relaxed", "loose", jn, ot]
- }],
- /**
- * List Style Image
- * @see https://tailwindcss.com/docs/list-style-image
- */
- "list-image": [{
- "list-image": ["none", ot]
- }],
- /**
- * List Style Type
- * @see https://tailwindcss.com/docs/list-style-type
- */
- "list-style-type": [{
- list: ["none", "disc", "decimal", ot]
- }],
- /**
- * List Style Position
- * @see https://tailwindcss.com/docs/list-style-position
- */
- "list-style-position": [{
- list: ["inside", "outside"]
- }],
- /**
- * Placeholder Color
- * @deprecated since Tailwind CSS v3.0.0
- * @see https://tailwindcss.com/docs/placeholder-color
- */
- "placeholder-color": [{
- placeholder: [e]
- }],
- /**
- * Placeholder Opacity
- * @see https://tailwindcss.com/docs/placeholder-opacity
- */
- "placeholder-opacity": [{
- "placeholder-opacity": [h]
- }],
- /**
- * Text Alignment
- * @see https://tailwindcss.com/docs/text-align
- */
- "text-alignment": [{
- text: ["left", "center", "right", "justify", "start", "end"]
- }],
- /**
- * Text Color
- * @see https://tailwindcss.com/docs/text-color
- */
- "text-color": [{
- text: [e]
- }],
- /**
- * Text Opacity
- * @see https://tailwindcss.com/docs/text-opacity
- */
- "text-opacity": [{
- "text-opacity": [h]
- }],
- /**
- * Text Decoration
- * @see https://tailwindcss.com/docs/text-decoration
- */
- "text-decoration": ["underline", "overline", "line-through", "no-underline"],
- /**
- * Text Decoration Style
- * @see https://tailwindcss.com/docs/text-decoration-style
- */
- "text-decoration-style": [{
- decoration: [...P(), "wavy"]
- }],
- /**
- * Text Decoration Thickness
- * @see https://tailwindcss.com/docs/text-decoration-thickness
- */
- "text-decoration-thickness": [{
- decoration: ["auto", "from-font", jn, qn]
- }],
- /**
- * Text Underline Offset
- * @see https://tailwindcss.com/docs/text-underline-offset
- */
- "underline-offset": [{
- "underline-offset": ["auto", jn, ot]
- }],
- /**
- * Text Decoration Color
- * @see https://tailwindcss.com/docs/text-decoration-color
- */
- "text-decoration-color": [{
- decoration: [e]
- }],
- /**
- * Text Transform
- * @see https://tailwindcss.com/docs/text-transform
- */
- "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
- /**
- * Text Overflow
- * @see https://tailwindcss.com/docs/text-overflow
- */
- "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
- /**
- * Text Wrap
- * @see https://tailwindcss.com/docs/text-wrap
- */
- "text-wrap": [{
- text: ["wrap", "nowrap", "balance", "pretty"]
- }],
- /**
- * Text Indent
- * @see https://tailwindcss.com/docs/text-indent
- */
- indent: [{
- indent: N()
- }],
- /**
- * Vertical Alignment
- * @see https://tailwindcss.com/docs/vertical-align
- */
- "vertical-align": [{
- align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", ot]
- }],
- /**
- * Whitespace
- * @see https://tailwindcss.com/docs/whitespace
- */
- whitespace: [{
- whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
- }],
- /**
- * Word Break
- * @see https://tailwindcss.com/docs/word-break
- */
- break: [{
- break: ["normal", "words", "all", "keep"]
- }],
- /**
- * Hyphens
- * @see https://tailwindcss.com/docs/hyphens
- */
- hyphens: [{
- hyphens: ["none", "manual", "auto"]
- }],
- /**
- * Content
- * @see https://tailwindcss.com/docs/content
- */
- content: [{
- content: ["none", ot]
- }],
- // Backgrounds
- /**
- * Background Attachment
- * @see https://tailwindcss.com/docs/background-attachment
- */
- "bg-attachment": [{
- bg: ["fixed", "local", "scroll"]
- }],
- /**
- * Background Clip
- * @see https://tailwindcss.com/docs/background-clip
- */
- "bg-clip": [{
- "bg-clip": ["border", "padding", "content", "text"]
- }],
- /**
- * Background Opacity
- * @deprecated since Tailwind CSS v3.0.0
- * @see https://tailwindcss.com/docs/background-opacity
- */
- "bg-opacity": [{
- "bg-opacity": [h]
- }],
- /**
- * Background Origin
- * @see https://tailwindcss.com/docs/background-origin
- */
- "bg-origin": [{
- "bg-origin": ["border", "padding", "content"]
- }],
- /**
- * Background Position
- * @see https://tailwindcss.com/docs/background-position
- */
- "bg-position": [{
- bg: [...T(), Tm]
- }],
- /**
- * Background Repeat
- * @see https://tailwindcss.com/docs/background-repeat
- */
- "bg-repeat": [{
- bg: ["no-repeat", {
- repeat: ["", "x", "y", "round", "space"]
- }]
- }],
- /**
- * Background Size
- * @see https://tailwindcss.com/docs/background-size
- */
- "bg-size": [{
- bg: ["auto", "cover", "contain", Lm]
- }],
- /**
- * Background Image
- * @see https://tailwindcss.com/docs/background-image
- */
- "bg-image": [{
- bg: ["none", {
- "gradient-to": ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
- }, Am]
- }],
- /**
- * Background Color
- * @see https://tailwindcss.com/docs/background-color
- */
- "bg-color": [{
- bg: [e]
- }],
- /**
- * Gradient Color Stops From Position
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-from-pos": [{
- from: [m]
- }],
- /**
- * Gradient Color Stops Via Position
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-via-pos": [{
- via: [m]
- }],
- /**
- * Gradient Color Stops To Position
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-to-pos": [{
- to: [m]
- }],
- /**
- * Gradient Color Stops From
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-from": [{
- from: [p]
- }],
- /**
- * Gradient Color Stops Via
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-via": [{
- via: [p]
- }],
- /**
- * Gradient Color Stops To
- * @see https://tailwindcss.com/docs/gradient-color-stops
- */
- "gradient-to": [{
- to: [p]
- }],
- // Borders
- /**
- * Border Radius
- * @see https://tailwindcss.com/docs/border-radius
- */
- rounded: [{
- rounded: [o]
- }],
- /**
- * Border Radius Start
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-s": [{
- "rounded-s": [o]
- }],
- /**
- * Border Radius End
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-e": [{
- "rounded-e": [o]
- }],
- /**
- * Border Radius Top
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-t": [{
- "rounded-t": [o]
- }],
- /**
- * Border Radius Right
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-r": [{
- "rounded-r": [o]
- }],
- /**
- * Border Radius Bottom
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-b": [{
- "rounded-b": [o]
- }],
- /**
- * Border Radius Left
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-l": [{
- "rounded-l": [o]
- }],
- /**
- * Border Radius Start Start
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-ss": [{
- "rounded-ss": [o]
- }],
- /**
- * Border Radius Start End
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-se": [{
- "rounded-se": [o]
- }],
- /**
- * Border Radius End End
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-ee": [{
- "rounded-ee": [o]
- }],
- /**
- * Border Radius End Start
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-es": [{
- "rounded-es": [o]
- }],
- /**
- * Border Radius Top Left
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-tl": [{
- "rounded-tl": [o]
- }],
- /**
- * Border Radius Top Right
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-tr": [{
- "rounded-tr": [o]
- }],
- /**
- * Border Radius Bottom Right
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-br": [{
- "rounded-br": [o]
- }],
- /**
- * Border Radius Bottom Left
- * @see https://tailwindcss.com/docs/border-radius
- */
- "rounded-bl": [{
- "rounded-bl": [o]
- }],
- /**
- * Border Width
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w": [{
- border: [u]
- }],
- /**
- * Border Width X
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-x": [{
- "border-x": [u]
- }],
- /**
- * Border Width Y
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-y": [{
- "border-y": [u]
- }],
- /**
- * Border Width Start
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-s": [{
- "border-s": [u]
- }],
- /**
- * Border Width End
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-e": [{
- "border-e": [u]
- }],
- /**
- * Border Width Top
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-t": [{
- "border-t": [u]
- }],
- /**
- * Border Width Right
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-r": [{
- "border-r": [u]
- }],
- /**
- * Border Width Bottom
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-b": [{
- "border-b": [u]
- }],
- /**
- * Border Width Left
- * @see https://tailwindcss.com/docs/border-width
- */
- "border-w-l": [{
- "border-l": [u]
- }],
- /**
- * Border Opacity
- * @see https://tailwindcss.com/docs/border-opacity
- */
- "border-opacity": [{
- "border-opacity": [h]
- }],
- /**
- * Border Style
- * @see https://tailwindcss.com/docs/border-style
- */
- "border-style": [{
- border: [...P(), "hidden"]
- }],
- /**
- * Divide Width X
- * @see https://tailwindcss.com/docs/divide-width
- */
- "divide-x": [{
- "divide-x": [u]
- }],
- /**
- * Divide Width X Reverse
- * @see https://tailwindcss.com/docs/divide-width
- */
- "divide-x-reverse": ["divide-x-reverse"],
- /**
- * Divide Width Y
- * @see https://tailwindcss.com/docs/divide-width
- */
- "divide-y": [{
- "divide-y": [u]
- }],
- /**
- * Divide Width Y Reverse
- * @see https://tailwindcss.com/docs/divide-width
- */
- "divide-y-reverse": ["divide-y-reverse"],
- /**
- * Divide Opacity
- * @see https://tailwindcss.com/docs/divide-opacity
- */
- "divide-opacity": [{
- "divide-opacity": [h]
- }],
- /**
- * Divide Style
- * @see https://tailwindcss.com/docs/divide-style
- */
- "divide-style": [{
- divide: P()
- }],
- /**
- * Border Color
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color": [{
- border: [a]
- }],
- /**
- * Border Color X
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-x": [{
- "border-x": [a]
- }],
- /**
- * Border Color Y
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-y": [{
- "border-y": [a]
- }],
- /**
- * Border Color S
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-s": [{
- "border-s": [a]
- }],
- /**
- * Border Color E
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-e": [{
- "border-e": [a]
- }],
- /**
- * Border Color Top
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-t": [{
- "border-t": [a]
- }],
- /**
- * Border Color Right
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-r": [{
- "border-r": [a]
- }],
- /**
- * Border Color Bottom
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-b": [{
- "border-b": [a]
- }],
- /**
- * Border Color Left
- * @see https://tailwindcss.com/docs/border-color
- */
- "border-color-l": [{
- "border-l": [a]
- }],
- /**
- * Divide Color
- * @see https://tailwindcss.com/docs/divide-color
- */
- "divide-color": [{
- divide: [a]
- }],
- /**
- * Outline Style
- * @see https://tailwindcss.com/docs/outline-style
- */
- "outline-style": [{
- outline: ["", ...P()]
- }],
- /**
- * Outline Offset
- * @see https://tailwindcss.com/docs/outline-offset
- */
- "outline-offset": [{
- "outline-offset": [jn, ot]
- }],
- /**
- * Outline Width
- * @see https://tailwindcss.com/docs/outline-width
- */
- "outline-w": [{
- outline: [jn, qn]
- }],
- /**
- * Outline Color
- * @see https://tailwindcss.com/docs/outline-color
- */
- "outline-color": [{
- outline: [e]
- }],
- /**
- * Ring Width
- * @see https://tailwindcss.com/docs/ring-width
- */
- "ring-w": [{
- ring: F()
- }],
- /**
- * Ring Width Inset
- * @see https://tailwindcss.com/docs/ring-width
- */
- "ring-w-inset": ["ring-inset"],
- /**
- * Ring Color
- * @see https://tailwindcss.com/docs/ring-color
- */
- "ring-color": [{
- ring: [e]
- }],
- /**
- * Ring Opacity
- * @see https://tailwindcss.com/docs/ring-opacity
- */
- "ring-opacity": [{
- "ring-opacity": [h]
- }],
- /**
- * Ring Offset Width
- * @see https://tailwindcss.com/docs/ring-offset-width
- */
- "ring-offset-w": [{
- "ring-offset": [jn, qn]
- }],
- /**
- * Ring Offset Color
- * @see https://tailwindcss.com/docs/ring-offset-color
- */
- "ring-offset-color": [{
- "ring-offset": [e]
- }],
- // Effects
- /**
- * Box Shadow
- * @see https://tailwindcss.com/docs/box-shadow
- */
- shadow: [{
- shadow: ["", "inner", "none", Kn, jm]
- }],
- /**
- * Box Shadow Color
- * @see https://tailwindcss.com/docs/box-shadow-color
- */
- "shadow-color": [{
- shadow: [ra]
- }],
- /**
- * Opacity
- * @see https://tailwindcss.com/docs/opacity
- */
- opacity: [{
- opacity: [h]
- }],
- /**
- * Mix Blend Mode
- * @see https://tailwindcss.com/docs/mix-blend-mode
- */
- "mix-blend": [{
- "mix-blend": [...z(), "plus-lighter", "plus-darker"]
- }],
- /**
- * Background Blend Mode
- * @see https://tailwindcss.com/docs/background-blend-mode
- */
- "bg-blend": [{
- "bg-blend": z()
- }],
- // Filters
- /**
- * Filter
- * @deprecated since Tailwind CSS v3.0.0
- * @see https://tailwindcss.com/docs/filter
- */
- filter: [{
- filter: ["", "none"]
- }],
- /**
- * Blur
- * @see https://tailwindcss.com/docs/blur
- */
- blur: [{
- blur: [n]
- }],
- /**
- * Brightness
- * @see https://tailwindcss.com/docs/brightness
- */
- brightness: [{
- brightness: [r]
- }],
- /**
- * Contrast
- * @see https://tailwindcss.com/docs/contrast
- */
- contrast: [{
- contrast: [l]
- }],
- /**
- * Drop Shadow
- * @see https://tailwindcss.com/docs/drop-shadow
- */
- "drop-shadow": [{
- "drop-shadow": ["", "none", Kn, ot]
- }],
- /**
- * Grayscale
- * @see https://tailwindcss.com/docs/grayscale
- */
- grayscale: [{
- grayscale: [c]
- }],
- /**
- * Hue Rotate
- * @see https://tailwindcss.com/docs/hue-rotate
- */
- "hue-rotate": [{
- "hue-rotate": [s]
- }],
- /**
- * Invert
- * @see https://tailwindcss.com/docs/invert
- */
- invert: [{
- invert: [v]
- }],
- /**
- * Saturate
- * @see https://tailwindcss.com/docs/saturate
- */
- saturate: [{
- saturate: [y]
- }],
- /**
- * Sepia
- * @see https://tailwindcss.com/docs/sepia
- */
- sepia: [{
- sepia: [E]
- }],
- /**
- * Backdrop Filter
- * @deprecated since Tailwind CSS v3.0.0
- * @see https://tailwindcss.com/docs/backdrop-filter
- */
- "backdrop-filter": [{
- "backdrop-filter": ["", "none"]
- }],
- /**
- * Backdrop Blur
- * @see https://tailwindcss.com/docs/backdrop-blur
- */
- "backdrop-blur": [{
- "backdrop-blur": [n]
- }],
- /**
- * Backdrop Brightness
- * @see https://tailwindcss.com/docs/backdrop-brightness
- */
- "backdrop-brightness": [{
- "backdrop-brightness": [r]
- }],
- /**
- * Backdrop Contrast
- * @see https://tailwindcss.com/docs/backdrop-contrast
- */
- "backdrop-contrast": [{
- "backdrop-contrast": [l]
- }],
- /**
- * Backdrop Grayscale
- * @see https://tailwindcss.com/docs/backdrop-grayscale
- */
- "backdrop-grayscale": [{
- "backdrop-grayscale": [c]
- }],
- /**
- * Backdrop Hue Rotate
- * @see https://tailwindcss.com/docs/backdrop-hue-rotate
- */
- "backdrop-hue-rotate": [{
- "backdrop-hue-rotate": [s]
- }],
- /**
- * Backdrop Invert
- * @see https://tailwindcss.com/docs/backdrop-invert
- */
- "backdrop-invert": [{
- "backdrop-invert": [v]
- }],
- /**
- * Backdrop Opacity
- * @see https://tailwindcss.com/docs/backdrop-opacity
- */
- "backdrop-opacity": [{
- "backdrop-opacity": [h]
- }],
- /**
- * Backdrop Saturate
- * @see https://tailwindcss.com/docs/backdrop-saturate
- */
- "backdrop-saturate": [{
- "backdrop-saturate": [y]
- }],
- /**
- * Backdrop Sepia
- * @see https://tailwindcss.com/docs/backdrop-sepia
- */
- "backdrop-sepia": [{
- "backdrop-sepia": [E]
- }],
- // Tables
- /**
- * Border Collapse
- * @see https://tailwindcss.com/docs/border-collapse
- */
- "border-collapse": [{
- border: ["collapse", "separate"]
- }],
- /**
- * Border Spacing
- * @see https://tailwindcss.com/docs/border-spacing
- */
- "border-spacing": [{
- "border-spacing": [i]
- }],
- /**
- * Border Spacing X
- * @see https://tailwindcss.com/docs/border-spacing
- */
- "border-spacing-x": [{
- "border-spacing-x": [i]
- }],
- /**
- * Border Spacing Y
- * @see https://tailwindcss.com/docs/border-spacing
- */
- "border-spacing-y": [{
- "border-spacing-y": [i]
- }],
- /**
- * Table Layout
- * @see https://tailwindcss.com/docs/table-layout
- */
- "table-layout": [{
- table: ["auto", "fixed"]
- }],
- /**
- * Caption Side
- * @see https://tailwindcss.com/docs/caption-side
- */
- caption: [{
- caption: ["top", "bottom"]
- }],
- // Transitions and Animation
- /**
- * Tranisition Property
- * @see https://tailwindcss.com/docs/transition-property
- */
- transition: [{
- transition: ["none", "all", "", "colors", "opacity", "shadow", "transform", ot]
- }],
- /**
- * Transition Duration
- * @see https://tailwindcss.com/docs/transition-duration
- */
- duration: [{
- duration: $()
- }],
- /**
- * Transition Timing Function
- * @see https://tailwindcss.com/docs/transition-timing-function
- */
- ease: [{
- ease: ["linear", "in", "out", "in-out", ot]
- }],
- /**
- * Transition Delay
- * @see https://tailwindcss.com/docs/transition-delay
- */
- delay: [{
- delay: $()
- }],
- /**
- * Animation
- * @see https://tailwindcss.com/docs/animation
- */
- animate: [{
- animate: ["none", "spin", "ping", "pulse", "bounce", ot]
- }],
- // Transforms
- /**
- * Transform
- * @see https://tailwindcss.com/docs/transform
- */
- transform: [{
- transform: ["", "gpu", "none"]
- }],
- /**
- * Scale
- * @see https://tailwindcss.com/docs/scale
- */
- scale: [{
- scale: [w]
- }],
- /**
- * Scale X
- * @see https://tailwindcss.com/docs/scale
- */
- "scale-x": [{
- "scale-x": [w]
- }],
- /**
- * Scale Y
- * @see https://tailwindcss.com/docs/scale
- */
- "scale-y": [{
- "scale-y": [w]
- }],
- /**
- * Rotate
- * @see https://tailwindcss.com/docs/rotate
- */
- rotate: [{
- rotate: [na, ot]
- }],
- /**
- * Translate X
- * @see https://tailwindcss.com/docs/translate
- */
- "translate-x": [{
- "translate-x": [R]
- }],
- /**
- * Translate Y
- * @see https://tailwindcss.com/docs/translate
- */
- "translate-y": [{
- "translate-y": [R]
- }],
- /**
- * Skew X
- * @see https://tailwindcss.com/docs/skew
- */
- "skew-x": [{
- "skew-x": [S]
- }],
- /**
- * Skew Y
- * @see https://tailwindcss.com/docs/skew
- */
- "skew-y": [{
- "skew-y": [S]
- }],
- /**
- * Transform Origin
- * @see https://tailwindcss.com/docs/transform-origin
- */
- "transform-origin": [{
- origin: ["center", "top", "top-right", "right", "bottom-right", "bottom", "bottom-left", "left", "top-left", ot]
- }],
- // Interactivity
- /**
- * Accent Color
- * @see https://tailwindcss.com/docs/accent-color
- */
- accent: [{
- accent: ["auto", e]
- }],
- /**
- * Appearance
- * @see https://tailwindcss.com/docs/appearance
- */
- appearance: [{
- appearance: ["none", "auto"]
- }],
- /**
- * Cursor
- * @see https://tailwindcss.com/docs/cursor
- */
- cursor: [{
- cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", ot]
- }],
- /**
- * Caret Color
- * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
- */
- "caret-color": [{
- caret: [e]
- }],
- /**
- * Pointer Events
- * @see https://tailwindcss.com/docs/pointer-events
- */
- "pointer-events": [{
- "pointer-events": ["none", "auto"]
- }],
- /**
- * Resize
- * @see https://tailwindcss.com/docs/resize
- */
- resize: [{
- resize: ["none", "y", "x", ""]
- }],
- /**
- * Scroll Behavior
- * @see https://tailwindcss.com/docs/scroll-behavior
- */
- "scroll-behavior": [{
- scroll: ["auto", "smooth"]
- }],
- /**
- * Scroll Margin
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-m": [{
- "scroll-m": N()
- }],
- /**
- * Scroll Margin X
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-mx": [{
- "scroll-mx": N()
- }],
- /**
- * Scroll Margin Y
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-my": [{
- "scroll-my": N()
- }],
- /**
- * Scroll Margin Start
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-ms": [{
- "scroll-ms": N()
- }],
- /**
- * Scroll Margin End
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-me": [{
- "scroll-me": N()
- }],
- /**
- * Scroll Margin Top
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-mt": [{
- "scroll-mt": N()
- }],
- /**
- * Scroll Margin Right
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-mr": [{
- "scroll-mr": N()
- }],
- /**
- * Scroll Margin Bottom
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-mb": [{
- "scroll-mb": N()
- }],
- /**
- * Scroll Margin Left
- * @see https://tailwindcss.com/docs/scroll-margin
- */
- "scroll-ml": [{
- "scroll-ml": N()
- }],
- /**
- * Scroll Padding
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-p": [{
- "scroll-p": N()
- }],
- /**
- * Scroll Padding X
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-px": [{
- "scroll-px": N()
- }],
- /**
- * Scroll Padding Y
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-py": [{
- "scroll-py": N()
- }],
- /**
- * Scroll Padding Start
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-ps": [{
- "scroll-ps": N()
- }],
- /**
- * Scroll Padding End
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-pe": [{
- "scroll-pe": N()
- }],
- /**
- * Scroll Padding Top
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-pt": [{
- "scroll-pt": N()
- }],
- /**
- * Scroll Padding Right
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-pr": [{
- "scroll-pr": N()
- }],
- /**
- * Scroll Padding Bottom
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-pb": [{
- "scroll-pb": N()
- }],
- /**
- * Scroll Padding Left
- * @see https://tailwindcss.com/docs/scroll-padding
- */
- "scroll-pl": [{
- "scroll-pl": N()
- }],
- /**
- * Scroll Snap Align
- * @see https://tailwindcss.com/docs/scroll-snap-align
- */
- "snap-align": [{
- snap: ["start", "end", "center", "align-none"]
- }],
- /**
- * Scroll Snap Stop
- * @see https://tailwindcss.com/docs/scroll-snap-stop
- */
- "snap-stop": [{
- snap: ["normal", "always"]
- }],
- /**
- * Scroll Snap Type
- * @see https://tailwindcss.com/docs/scroll-snap-type
- */
- "snap-type": [{
- snap: ["none", "x", "y", "both"]
- }],
- /**
- * Scroll Snap Type Strictness
- * @see https://tailwindcss.com/docs/scroll-snap-type
- */
- "snap-strictness": [{
- snap: ["mandatory", "proximity"]
- }],
- /**
- * Touch Action
- * @see https://tailwindcss.com/docs/touch-action
- */
- touch: [{
- touch: ["auto", "none", "manipulation"]
- }],
- /**
- * Touch Action X
- * @see https://tailwindcss.com/docs/touch-action
- */
- "touch-x": [{
- "touch-pan": ["x", "left", "right"]
- }],
- /**
- * Touch Action Y
- * @see https://tailwindcss.com/docs/touch-action
- */
- "touch-y": [{
- "touch-pan": ["y", "up", "down"]
- }],
- /**
- * Touch Action Pinch Zoom
- * @see https://tailwindcss.com/docs/touch-action
- */
- "touch-pz": ["touch-pinch-zoom"],
- /**
- * User Select
- * @see https://tailwindcss.com/docs/user-select
- */
- select: [{
- select: ["none", "text", "all", "auto"]
- }],
- /**
- * Will Change
- * @see https://tailwindcss.com/docs/will-change
- */
- "will-change": [{
- "will-change": ["auto", "scroll", "contents", "transform", ot]
- }],
- // SVG
- /**
- * Fill
- * @see https://tailwindcss.com/docs/fill
- */
- fill: [{
- fill: [e, "none"]
- }],
- /**
- * Stroke Width
- * @see https://tailwindcss.com/docs/stroke-width
- */
- "stroke-w": [{
- stroke: [jn, qn, ui]
- }],
- /**
- * Stroke
- * @see https://tailwindcss.com/docs/stroke
- */
- stroke: [{
- stroke: [e, "none"]
- }],
- // Accessibility
- /**
- * Screen Readers
- * @see https://tailwindcss.com/docs/screen-readers
- */
- sr: ["sr-only", "not-sr-only"],
- /**
- * Forced Color Adjust
- * @see https://tailwindcss.com/docs/forced-color-adjust
- */
- "forced-color-adjust": [{
- "forced-color-adjust": ["auto", "none"]
- }]
- },
- conflictingClassGroups: {
- overflow: ["overflow-x", "overflow-y"],
- overscroll: ["overscroll-x", "overscroll-y"],
- inset: ["inset-x", "inset-y", "start", "end", "top", "right", "bottom", "left"],
- "inset-x": ["right", "left"],
- "inset-y": ["top", "bottom"],
- flex: ["basis", "grow", "shrink"],
- gap: ["gap-x", "gap-y"],
- p: ["px", "py", "ps", "pe", "pt", "pr", "pb", "pl"],
- px: ["pr", "pl"],
- py: ["pt", "pb"],
- m: ["mx", "my", "ms", "me", "mt", "mr", "mb", "ml"],
- mx: ["mr", "ml"],
- my: ["mt", "mb"],
- size: ["w", "h"],
- "font-size": ["leading"],
- "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
- "fvn-ordinal": ["fvn-normal"],
- "fvn-slashed-zero": ["fvn-normal"],
- "fvn-figure": ["fvn-normal"],
- "fvn-spacing": ["fvn-normal"],
- "fvn-fraction": ["fvn-normal"],
- "line-clamp": ["display", "overflow"],
- rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
- "rounded-s": ["rounded-ss", "rounded-es"],
- "rounded-e": ["rounded-se", "rounded-ee"],
- "rounded-t": ["rounded-tl", "rounded-tr"],
- "rounded-r": ["rounded-tr", "rounded-br"],
- "rounded-b": ["rounded-br", "rounded-bl"],
- "rounded-l": ["rounded-tl", "rounded-bl"],
- "border-spacing": ["border-spacing-x", "border-spacing-y"],
- "border-w": ["border-w-s", "border-w-e", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
- "border-w-x": ["border-w-r", "border-w-l"],
- "border-w-y": ["border-w-t", "border-w-b"],
- "border-color": ["border-color-s", "border-color-e", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
- "border-color-x": ["border-color-r", "border-color-l"],
- "border-color-y": ["border-color-t", "border-color-b"],
- "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
- "scroll-mx": ["scroll-mr", "scroll-ml"],
- "scroll-my": ["scroll-mt", "scroll-mb"],
- "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
- "scroll-px": ["scroll-pr", "scroll-pl"],
- "scroll-py": ["scroll-pt", "scroll-pb"],
- touch: ["touch-x", "touch-y", "touch-pz"],
- "touch-x": ["touch"],
- "touch-y": ["touch"],
- "touch-pz": ["touch"]
- },
- conflictingClassGroupModifiers: {
- "font-size": ["leading"]
- }
- };
- }, Wm = /* @__PURE__ */ Em(Vm);
- function Na(...e) {
- return Wm(jt(e));
- }
- const Wc = hu(null), Bc = () => {
- const e = Sn(Wc);
- if (!e)
- throw new Error("useDropdown must be used within a DropdownProvider");
- return e;
- };
- function Bm({ children: e, className: t, offset: n }) {
- if (!Kr)
- return null;
- const { show: r, updateShow: a, overlayRef: o, triggerRef: i } = Bc(), [u, l] = rt(!1), [c, s] = rt({ top: 0, left: 0 });
- lt(() => {
- var C, p;
- if (r && i.current && o.current) {
- const m = i.current.getBoundingClientRect(), b = o.current.getBoundingClientRect(), f = document.documentElement.clientWidth, h = document.documentElement.clientHeight;
- let g = m.bottom + window.scrollY, y = m.left + window.scrollX;
- g + b.height > h + window.scrollY && (g = m.top - b.height + window.scrollY), y + b.width > f + window.scrollX && (y = m.right - b.width + window.scrollX), g = Math.max(g, window.scrollY), y = Math.max(y, window.scrollX), s({
- top: g + ((C = n == null ? void 0 : n.y) != null ? C : 0),
- left: y + ((p = n == null ? void 0 : n.x) != null ? p : 0)
- }), requestAnimationFrame(() => {
- l(!0);
- });
- }
- }, [r, n == null ? void 0 : n.x, n == null ? void 0 : n.y, o, i]);
- const v = Ot((C) => {
- C.stopPropagation(), a(!1);
- }, []);
- return r ? $a(
- /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: o,
- className: Na(
- `
- univer-fixed univer-z-[1071] univer-overflow-hidden univer-rounded-md univer-border univer-bg-white
- univer-opacity-0 univer-shadow-md
- dark:univer-bg-gray-700
- `,
- {
- "univer-opacity-100 univer-animate-in univer-slide-in-from-top-2": u
- },
- t
- ),
- style: {
- top: c.top,
- left: c.left
- },
- onClick: v,
- onPointerUpCapture: (C) => C.stopPropagation(),
- children: e
- }
- ),
- document.body
- ) : null;
- }
- function Um({ visible: e, children: t, disabled: n = !1, onVisibleChange: r }) {
- const a = Ce(null), o = Ce(null), [i, u] = rt(!1), l = e !== void 0, c = l ? e : i, s = Ot((C) => {
- n || (l || u(C), r == null || r(C));
- }, [n, l, r]);
- lt(() => {
- if (!c) return;
- const C = (p) => {
- var b, f;
- const m = p.target;
- !((b = a.current) != null && b.contains(m)) && !((f = o.current) != null && f.contains(m)) && s(!1);
- };
- return window.addEventListener("pointerup", C), () => window.removeEventListener("pointerup", C);
- }, [c, s]);
- const v = Ht(() => ({ show: c, updateShow: s, disabled: n, triggerRef: a, overlayRef: o }), [c, n]);
- return /* @__PURE__ */ q.jsx(Wc.Provider, { value: v, children: t });
- }
- function qm({ children: e }) {
- const { show: t, updateShow: n, triggerRef: r } = Bc();
- if (!pc(e))
- throw new Error("DropdownTrigger children must be a valid React element");
- return hc(e, {
- ref: r,
- onClick: (a) => {
- var o, i;
- a.stopPropagation(), n(!t), (i = (o = e.props) == null ? void 0 : o.onClick) == null || i.call(o, a);
- }
- // eslint-disable-next-line ts/no-explicit-any
- });
- }
- function Km({ hsv: e, onChange: t }) {
- const [n, r] = rt(""), a = Ht(() => bu(e[0], e[1], e[2]), [e]);
- lt(() => {
- r(a.replace(/^#/, ""));
- }, [a]);
- const o = (l) => /^[0-9A-Fa-f]{6}$/.test(l), i = (l) => {
- const c = l.target.value.trim();
- if (!(c.length > 6) && !(c !== "" && !/^[0-9A-Fa-f]*$/.test(c)) && (r(c), o(c))) {
- const s = yu(c);
- t && t(...s);
- }
- }, u = () => {
- o(n) || r(a.replace(/^#/, ""));
- };
- return /* @__PURE__ */ q.jsxs(q.Fragment, { children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- className: `
- univer-w-full univer-px-2 !univer-pl-4 univer-uppercase
- focus:univer-border-blue-500 focus:univer-outline-none
- `,
- value: n,
- onChange: i,
- onBlur: u,
- maxLength: 6,
- spellCheck: !1
- }
- ),
- /* @__PURE__ */ q.jsx(
- "span",
- {
- className: `
- univer-absolute univer-left-1.5 univer-top-1/2 -univer-translate-y-1/2 univer-text-sm
- univer-text-gray-400
- `,
- children: "#"
- }
- )
- ] });
- }
- function Ym({ hsv: e, onChange: t }) {
- const [n, r] = rt({ r: 0, g: 0, b: 0 });
- lt(() => {
- const [i, u, l] = Da(e[0], e[1], e[2]);
- r({
- r: Math.round(i),
- g: Math.round(u),
- b: Math.round(l)
- });
- }, [e]);
- const a = (i, u) => {
- if (u !== "" && !/^\d*$/.test(u)) return;
- const l = u === "" ? 0 : Number.parseInt(u, 10);
- if (l > 255) return;
- const c = { ...n, [i]: l };
- if (r(c), t) {
- const s = Ac(c.r, c.g, c.b);
- t(...s);
- }
- }, o = () => {
- const [i, u, l] = Da(e[0], e[1], e[2]);
- r({
- r: Math.round(i),
- g: Math.round(u),
- b: Math.round(l)
- });
- };
- return /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: `
- univer-flex univer-items-center univer-gap-2
- [&>input]:univer-w-11
- `,
- children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.r,
- onChange: (i) => a("r", i.target.value),
- onBlur: o,
- maxLength: 3
- }
- ),
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.g,
- onChange: (i) => a("g", i.target.value),
- onBlur: o,
- maxLength: 3
- }
- ),
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.b,
- onChange: (i) => a("b", i.target.value),
- onBlur: o,
- maxLength: 3
- }
- )
- ]
- }
- );
- }
- function Gm({ hsv: e, onChange: t }) {
- const [n, r] = rt({ h: 0, s: 0, l: 0 });
- lt(() => {
- const [i, u, l] = ul(e[0], e[1], e[2]);
- r({
- h: Math.round(i),
- s: Math.round(u),
- l: Math.round(l)
- });
- }, [e]);
- const a = (i, u) => {
- if (u !== "" && !/^\d*$/.test(u)) return;
- const l = u === "" ? 0 : Number.parseInt(u, 10);
- if (i === "h" && l > 360 || (i === "s" || i === "l") && l > 100) return;
- const c = { ...n, [i]: l };
- if (r(c), t) {
- const s = cm(c.h, c.s, c.l);
- t(...s);
- }
- }, o = () => {
- const [i, u, l] = ul(e[0], e[1], e[2]);
- r({
- h: Math.round(i),
- s: Math.round(u),
- l: Math.round(l)
- });
- };
- return /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: `
- univer-flex univer-items-center univer-gap-2
- [&>input]:univer-w-11
- `,
- children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.h,
- onChange: (i) => a("h", i.target.value),
- onBlur: o,
- maxLength: 3,
- "aria-label": "Hue"
- }
- ),
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.s,
- onChange: (i) => a("s", i.target.value),
- onBlur: o,
- maxLength: 3,
- "aria-label": "Saturation"
- }
- ),
- /* @__PURE__ */ q.jsx(
- "input",
- {
- value: n.l,
- onChange: (i) => a("l", i.target.value),
- onBlur: o,
- maxLength: 3,
- "aria-label": "Lightness"
- }
- )
- ]
- }
- );
- }
- function Xm({ alpha: e, onChange: t }) {
- const [n, r] = rt("");
- lt(() => {
- r(String(Math.round(e * 100)));
- }, [e]);
- const a = (i) => {
- if (i !== "" && !/^\d*$/.test(i)) return;
- const u = i === "" ? 0 : Number.parseInt(i, 10);
- u > 100 || (r(i), t && t(u / 100));
- }, o = () => {
- const i = Math.round(e * 100);
- r(String(i));
- };
- return /* @__PURE__ */ q.jsxs("div", { className: "univer-relative", children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- className: "univer-w-14 !univer-pr-5 univer-text-right",
- value: n,
- onChange: (i) => a(i.target.value),
- onBlur: o,
- maxLength: 3,
- "aria-label": "Alpha",
- inputMode: "numeric"
- }
- ),
- /* @__PURE__ */ q.jsx(
- "span",
- {
- className: `
- univer-pointer-events-none univer-absolute univer-right-1.5 univer-top-1/2 -univer-translate-y-1/2
- univer-text-sm univer-text-gray-400
- `,
- children: "%"
- }
- )
- ] });
- }
- function Zm({ hsv: e, alpha: t, showAlpha: n, onChangeColor: r, onChangeAlpha: a }) {
- const [o, i] = rt("hex");
- function u(l) {
- switch (l) {
- case "hex":
- return /* @__PURE__ */ q.jsx(Km, { hsv: e, onChange: r });
- case "rgb":
- return /* @__PURE__ */ q.jsx(Ym, { hsv: e, onChange: r });
- case "hsl":
- return /* @__PURE__ */ q.jsx(Gm, { hsv: e, onChange: r });
- default:
- return null;
- }
- }
- return /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: `
- univer-flex univer-gap-2
- [&_input]:univer-box-border [&_input]:univer-flex [&_input]:univer-h-8 [&_input]:univer-items-center
- [&_input]:univer-rounded [&_input]:univer-border [&_input]:univer-border-solid
- [&_input]:univer-border-gray-200 [&_input]:univer-bg-transparent [&_input]:univer-px-1.5
- [&_input]:univer-text-sm [&_input]:univer-text-gray-700 [&_input]:univer-outline-none
- dark:[&_input]:univer-border-gray-600 dark:[&_input]:univer-text-white
- `,
- children: [
- /* @__PURE__ */ q.jsxs(Um, { children: [
- /* @__PURE__ */ q.jsx(qm, { children: /* @__PURE__ */ q.jsxs(
- "a",
- {
- className: `
- univer-box-border univer-flex univer-h-8 univer-flex-1 univer-cursor-pointer
- univer-items-center univer-justify-between univer-gap-1 univer-rounded univer-border
- univer-border-solid univer-border-gray-200 univer-px-1.5 univer-text-sm univer-text-gray-700
- dark:univer-border-gray-600 dark:univer-text-white
- `,
- children: [
- /* @__PURE__ */ q.jsx("span", { children: o.toUpperCase() }),
- /* @__PURE__ */ q.jsx(xc, { className: "univer-size-5 univer-text-gray-400" })
- ]
- }
- ) }),
- /* @__PURE__ */ q.jsx(Bm, { children: /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: `
- univer-grid univer-w-16
- [&>a]:univer-cursor-pointer [&>a]:univer-px-2 [&>a]:univer-py-1 [&>a]:univer-text-sm
- dark:univer-text-white
- `,
- children: [
- /* @__PURE__ */ q.jsx("a", { onClick: () => i("hex"), children: "HEX" }),
- /* @__PURE__ */ q.jsx("a", { onClick: () => i("hsl"), children: "HSL" }),
- /* @__PURE__ */ q.jsx("a", { onClick: () => i("rgb"), children: "RGB" })
- ]
- }
- ) })
- ] }),
- /* @__PURE__ */ q.jsx("div", { className: "univer-relative univer-flex univer-gap-2", children: u(o) }),
- n && /* @__PURE__ */ q.jsx(Xm, { alpha: t, onChange: a })
- ]
- }
- );
- }
- const Qm = [
- ["#EEEFF1", "#E1EFFE", "#FDE8E8", "#FEECDC", "#FFF4B9", "#DEF7EC", "#D5F5F6", "#EDEBFE", "#FCE8F3"],
- ["#CDD0D8", "#A4CAFE", "#F8B4B4", "#FDBA8C", "#FAC815", "#84E1BC", "#7EDCE2", "#CABFFD", "#F8B4D9"],
- ["#979DAC", "#3F83F8", "#F05252", "#FF5A1F", "#D49D0F", "#0DA471", "#0694A2", "#9061F9", "#E74694"],
- ["#414657", "#1A56DB", "#C81E1E", "#B43403", "#9A6D15", "#046C4E", "#036672", "#6C2BD9", "#BF125D"],
- ["#181C2A", "#233876", "#771D1D", "#771D1D", "#634312", "#014737", "#014451", "#4A1D96", "#751A3D"]
- ];
- function Jm({ hsv: e, onChange: t }) {
- const n = Ot((a) => {
- const [o, i, u] = yu(a);
- t(o, i, u);
- }, [t]), r = bu(e[0], e[1], e[2]);
- return /* @__PURE__ */ q.jsx("div", { className: "univer-grid univer-content-center univer-gap-2", children: Qm.map((a, o) => /* @__PURE__ */ q.jsx(
- "div",
- {
- className: "univer-grid univer-grid-flow-col univer-items-center univer-justify-between univer-gap-2",
- children: a.map((i, u) => /* @__PURE__ */ q.jsx(
- "button",
- {
- type: "button",
- className: Na(`
- univer-h-5 univer-w-5 univer-cursor-pointer univer-rounded-full univer-border-none
- univer-bg-gray-300 univer-transition-shadow
- `, {
- "univer-ring-2 univer-ring-offset-2 univer-ring-offset-white dark:univer-ring-primary-600 dark:univer-ring-offset-gray-600": i.toUpperCase() === r.toUpperCase()
- }),
- style: { backgroundColor: i },
- onClick: () => n(i)
- },
- u
- ))
- },
- o
- )) });
- }
- function ep({ hsv: e, onChange: t, onChanged: n }) {
- const r = Ce(null), a = Ce(null), [o, i] = rt(!1);
- lt(() => {
- const v = r.current;
- if (!v) return;
- const C = v.getContext("2d");
- if (!C) return;
- const p = C.createLinearGradient(0, 0, v.width, 0);
- p.addColorStop(0, `hsl(${e[0]}, 0%, 50%)`), p.addColorStop(1, `hsl(${e[0]}, 100%, 50%)`), C.fillStyle = p, C.fillRect(0, 0, v.width, v.height);
- const m = C.createLinearGradient(0, 0, 0, v.height);
- m.addColorStop(0, "rgba(255, 255, 255, 0)"), m.addColorStop(1, "rgba(0, 0, 0, 1)"), C.fillStyle = m, C.fillRect(0, 0, v.width, v.height);
- }, [e]);
- const u = (v) => {
- const C = r.current;
- if (!C) return;
- const p = C.getBoundingClientRect(), m = Math.max(0, Math.min(v.clientX - p.left, p.width)), b = Math.max(0, Math.min(v.clientY - p.top, p.height)), f = m / p.width * 100, h = 100 - b / p.height * 100;
- t(e[0], f, h);
- }, l = Ot(() => {
- i(!1);
- }, [e]);
- function c() {
- n == null || n(e[0], e[1], e[2]);
- }
- lt(() => {
- var v;
- return (v = a.current) == null || v.addEventListener("mouseup", c), window.addEventListener("pointerup", l), window.addEventListener("mouseup", l), () => {
- var C;
- (C = a.current) == null || C.removeEventListener("mouseup", c), window.removeEventListener("pointerup", l), window.removeEventListener("mouseup", l);
- };
- }, [e]);
- const s = () => {
- var h, g, y, w;
- const p = (g = (h = a.current) == null ? void 0 : h.clientWidth) != null ? g : 0, m = (w = (y = a.current) == null ? void 0 : y.clientHeight) != null ? w : 0, b = e[1] / 100 * p - 8, f = (100 - e[2]) / 100 * m - 8;
- return {
- transform: `translate(${b}px, ${f}px)`,
- transition: o ? "none" : "transform 0.1s ease-out"
- };
- };
- return lt(() => {
- const v = () => {
- i(!1);
- };
- return window.addEventListener("pointerup", v), window.addEventListener("mouseup", v), () => {
- window.removeEventListener("pointerup", v), window.removeEventListener("mouseup", v);
- };
- }, []), /* @__PURE__ */ q.jsxs(
- "div",
- {
- ref: a,
- className: "univer-relative univer-overflow-hidden",
- children: [
- /* @__PURE__ */ q.jsx(
- "canvas",
- {
- ref: r,
- className: "univer-h-[148px] univer-w-full univer-min-w-[260px] univer-cursor-crosshair univer-rounded",
- onPointerDown: (v) => {
- i(!0), u(v);
- },
- onPointerMove: (v) => o && u(v)
- }
- ),
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: `
- univer-pointer-events-none univer-absolute univer-left-0 univer-top-0 univer-size-4
- univer-rounded-full univer-border-2 univer-border-white univer-shadow-md univer-ring-2
- univer-ring-white univer-will-change-transform
- `,
- style: s()
- }
- )
- ]
- }
- );
- }
- function tp({ hsv: e, onChange: t, onChanged: n }) {
- const [r, a] = rt(!1), o = Ce(null), i = Ce(null), u = Ht(() => {
- var C, p;
- return (p = (C = i.current) == null ? void 0 : C.clientWidth) != null ? p : 0;
- }, []), l = Ot((C) => {
- const p = o.current;
- if (!p) return;
- const m = p.getBoundingClientRect(), b = m.width - u, f = Math.max(0, Math.min(C - m.left, b)), h = Math.round(f / b * 360);
- t(h, e[1], e[2]);
- }, [e, u, t]), c = Ot((C) => {
- r && l(C.clientX);
- }, [r, l]), s = Ot(() => {
- a(!1), n == null || n(e[0], e[1], e[2]);
- }, [e, n]);
- lt(() => (r && (window.addEventListener("pointermove", c), window.addEventListener("pointerup", s), window.addEventListener("mouseup", s)), () => {
- window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", s), window.removeEventListener("mouseup", s);
- }), [r, c, s]);
- const v = () => {
- var p;
- return `${Math.min(Math.max(e[0], 0), 360) / 360 * (100 - u / ((p = o.current) == null ? void 0 : p.clientWidth) * 100)}%`;
- };
- return /* @__PURE__ */ q.jsx("div", { className: "univer-relative univer-w-full univer-select-none", children: /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: o,
- className: `
- univer-relative univer-h-2 univer-w-full univer-cursor-pointer univer-rounded-full univer-shadow-inner
- `,
- style: {
- background: `linear-gradient(to right,
- hsl(0, 100%, 50%),
- hsl(60, 100%, 50%),
- hsl(120, 100%, 50%),
- hsl(180, 100%, 50%),
- hsl(240, 100%, 50%),
- hsl(300, 100%, 50%),
- hsl(360, 100%, 50%))`
- },
- onPointerDown: (C) => {
- a(!0), l(C.clientX);
- },
- children: /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: i,
- className: `
- univer-absolute univer-top-1/2 univer-box-border univer-size-2 univer-rounded-full
- univer-bg-transparent univer-shadow-md univer-ring-2 univer-ring-white univer-transition-transform
- univer-duration-75 univer-will-change-transform
- `,
- style: {
- left: v(),
- transform: "translateY(-50%)",
- transition: r ? "none" : "all 0.1s ease-out"
- }
- }
- )
- }
- ) });
- }
- const np = me.memo(ep), rp = me.memo(tp), ap = me.memo(dm), op = me.memo(Zm), ip = me.memo(Jm);
- function $O({ format: e = "hex", value: t = "#000000", showAlpha: n = !1, onChange: r }) {
- if (!Kr) return null;
- const [a, o] = rt([0, 100, 100]), [i, u] = rt(1), l = Ot((p, m, b) => Da(p, m, b), []);
- lt(() => {
- try {
- if (e === "hex") {
- const [p, m, b] = yu(t);
- o([p, m, b]), u(1);
- }
- } catch (p) {
- console.error("Invalid RGBA value:", p);
- }
- }, [t]);
- function c(p, m, b) {
- o([p, m, b]);
- }
- function s(p, m, b) {
- const [f, h, g] = l(p, m, b);
- if (e === "hex") {
- const y = $c(f, h, g);
- r == null || r(y);
- }
- }
- function v(p) {
- u(p);
- }
- function C(p) {
- if (e === "hex") {
- const m = bu(a[0], a[1], a[2]);
- r == null || r(m);
- }
- }
- return /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: `
- univer-w-[292px] univer-cursor-default univer-space-y-4 univer-rounded-lg univer-bg-white
- dark:univer-bg-gray-700
- `,
- onClick: (p) => p.stopPropagation(),
- children: [
- /* @__PURE__ */ q.jsx(
- np,
- {
- hsv: a,
- onChange: c,
- onChanged: s
- }
- ),
- /* @__PURE__ */ q.jsx(
- rp,
- {
- hsv: a,
- onChange: c,
- onChanged: s
- }
- ),
- n && /* @__PURE__ */ q.jsx(
- ap,
- {
- hsv: a,
- alpha: i,
- onChange: v,
- onChanged: C
- }
- ),
- /* @__PURE__ */ q.jsx(
- op,
- {
- hsv: a,
- alpha: i,
- showAlpha: n,
- onChangeColor: s,
- onChangeAlpha: C
- }
- ),
- /* @__PURE__ */ q.jsx(
- ip,
- {
- hsv: a,
- onChange: (p, m, b) => {
- c(p, m, b), s(p, m, b);
- }
- }
- )
- ]
- }
- );
- }
- function sn() {
- return sn = Object.assign ? Object.assign.bind() : function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
- }
- return e;
- }, sn.apply(null, arguments);
- }
- function up(e) {
- if (Array.isArray(e)) return e;
- }
- function lp(e, t) {
- var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
- if (n != null) {
- var r, a, o, i, u = [], l = !0, c = !1;
- try {
- if (o = (n = n.call(e)).next, t === 0) {
- if (Object(n) !== n) return;
- l = !1;
- } else for (; !(l = (r = o.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) ;
- } catch (s) {
- c = !0, a = s;
- } finally {
- try {
- if (!l && n.return != null && (i = n.return(), Object(i) !== i)) return;
- } finally {
- if (c) throw a;
- }
- }
- return u;
- }
- }
- function cl(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- function sp(e, t) {
- if (e) {
- if (typeof e == "string") return cl(e, t);
- var n = {}.toString.call(e).slice(8, -1);
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? cl(e, t) : void 0;
- }
- }
- function cp() {
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function nn(e, t) {
- return up(e) || lp(e, t) || sp(e, t) || cp();
- }
- function dp(e) {
- if (Array.isArray(e)) return e;
- }
- function fp(e, t) {
- var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
- if (n != null) {
- var r, a, o, i, u = [], l = !0, c = !1;
- try {
- if (o = (n = n.call(e)).next, t === 0) {
- if (Object(n) !== n) return;
- l = !1;
- } else for (; !(l = (r = o.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) ;
- } catch (s) {
- c = !0, a = s;
- } finally {
- try {
- if (!l && n.return != null && (i = n.return(), Object(i) !== i)) return;
- } finally {
- if (c) throw a;
- }
- }
- return u;
- }
- }
- function Ii(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- function Uc(e, t) {
- if (e) {
- if (typeof e == "string") return Ii(e, t);
- var n = {}.toString.call(e).slice(8, -1);
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Ii(e, t) : void 0;
- }
- }
- function vp() {
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function cn(e, t) {
- return dp(e) || fp(e, t) || Uc(e, t) || vp();
- }
- function dn() {
- return !!(typeof window < "u" && window.document && window.document.createElement);
- }
- var Oi = {}, mp = function(t) {
- };
- function pp(e, t) {
- }
- function hp(e, t) {
- }
- function gp() {
- Oi = {};
- }
- function qc(e, t, n) {
- !t && !Oi[n] && (e(!1, n), Oi[n] = !0);
- }
- function ur(e, t) {
- qc(pp, e, t);
- }
- function yp(e, t) {
- qc(hp, e, t);
- }
- ur.preMessage = mp;
- ur.resetWarned = gp;
- ur.noteOnce = yp;
- function Dn(e) {
- "@babel/helpers - typeof";
- return Dn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
- return typeof t;
- } : function(t) {
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
- }, Dn(e);
- }
- var li = { exports: {} }, bt = {};
- /**
- * @license React
- * react-is.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
- var dl;
- function bp() {
- if (dl) return bt;
- dl = 1;
- var e = Symbol.for("react.element"), t = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), a = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), i = Symbol.for("react.context"), u = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), c = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), m;
- m = Symbol.for("react.module.reference");
- function b(f) {
- if (typeof f == "object" && f !== null) {
- var h = f.$$typeof;
- switch (h) {
- case e:
- switch (f = f.type, f) {
- case n:
- case a:
- case r:
- case c:
- case s:
- return f;
- default:
- switch (f = f && f.$$typeof, f) {
- case u:
- case i:
- case l:
- case C:
- case v:
- case o:
- return f;
- default:
- return h;
- }
- }
- case t:
- return h;
- }
- }
- }
- return bt.ContextConsumer = i, bt.ContextProvider = o, bt.Element = e, bt.ForwardRef = l, bt.Fragment = n, bt.Lazy = C, bt.Memo = v, bt.Portal = t, bt.Profiler = a, bt.StrictMode = r, bt.Suspense = c, bt.SuspenseList = s, bt.isAsyncMode = function() {
- return !1;
- }, bt.isConcurrentMode = function() {
- return !1;
- }, bt.isContextConsumer = function(f) {
- return b(f) === i;
- }, bt.isContextProvider = function(f) {
- return b(f) === o;
- }, bt.isElement = function(f) {
- return typeof f == "object" && f !== null && f.$$typeof === e;
- }, bt.isForwardRef = function(f) {
- return b(f) === l;
- }, bt.isFragment = function(f) {
- return b(f) === n;
- }, bt.isLazy = function(f) {
- return b(f) === C;
- }, bt.isMemo = function(f) {
- return b(f) === v;
- }, bt.isPortal = function(f) {
- return b(f) === t;
- }, bt.isProfiler = function(f) {
- return b(f) === a;
- }, bt.isStrictMode = function(f) {
- return b(f) === r;
- }, bt.isSuspense = function(f) {
- return b(f) === c;
- }, bt.isSuspenseList = function(f) {
- return b(f) === s;
- }, bt.isValidElementType = function(f) {
- return typeof f == "string" || typeof f == "function" || f === n || f === a || f === r || f === c || f === s || f === p || typeof f == "object" && f !== null && (f.$$typeof === C || f.$$typeof === v || f.$$typeof === o || f.$$typeof === i || f.$$typeof === l || f.$$typeof === m || f.getModuleId !== void 0);
- }, bt.typeOf = b, bt;
- }
- var fl;
- function Cp() {
- return fl || (fl = 1, li.exports = bp()), li.exports;
- }
- var Ma = Cp();
- function Su(e, t, n) {
- var r = d.useRef({});
- return (!("value" in r.current) || n(r.current.condition, t)) && (r.current.value = e(), r.current.condition = t), r.current.value;
- }
- var jo = function(t, n) {
- typeof t == "function" ? t(n) : Dn(t) === "object" && t && "current" in t && (t.current = n);
- }, lr = function() {
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
- n[r] = arguments[r];
- var a = n.filter(Boolean);
- return a.length <= 1 ? a[0] : function(o) {
- n.forEach(function(i) {
- jo(i, o);
- });
- };
- }, Gr = function() {
- for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
- n[r] = arguments[r];
- return Su(function() {
- return lr.apply(void 0, n);
- }, n, function(a, o) {
- return a.length !== o.length || a.every(function(i, u) {
- return i !== o[u];
- });
- });
- }, xr = function(t) {
- var n, r, a = Ma.isMemo(t) ? t.type.type : t.type;
- return !(typeof a == "function" && !((n = a.prototype) !== null && n !== void 0 && n.render) && a.$$typeof !== Ma.ForwardRef || typeof t == "function" && !((r = t.prototype) !== null && r !== void 0 && r.render) && t.$$typeof !== Ma.ForwardRef);
- };
- function vl(e) {
- return /* @__PURE__ */ pc(e) && !Ma.isFragment(e);
- }
- Number(iv.split(".")[0]) >= 19;
- var Kc = /* @__PURE__ */ d.createContext(null);
- function Sp(e) {
- if (Array.isArray(e)) return Ii(e);
- }
- function wp(e) {
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
- }
- function xp() {
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function Yc(e) {
- return Sp(e) || wp(e) || Uc(e) || xp();
- }
- var ml = dn() ? d.useLayoutEffect : d.useEffect, St = function(t, n) {
- var r = d.useRef(!0);
- ml(function() {
- return t(r.current);
- }, n), ml(function() {
- return r.current = !1, function() {
- r.current = !0;
- };
- }, []);
- }, Wr = function(t, n) {
- St(function(r) {
- if (!r)
- return t();
- }, n);
- }, pl = [];
- function Ep(e, t) {
- var n = d.useState(function() {
- if (!dn())
- return null;
- var m = document.createElement("div");
- return m;
- }), r = cn(n, 1), a = r[0], o = d.useRef(!1), i = d.useContext(Kc), u = d.useState(pl), l = cn(u, 2), c = l[0], s = l[1], v = i || (o.current ? void 0 : function(m) {
- s(function(b) {
- var f = [m].concat(Yc(b));
- return f;
- });
- });
- function C() {
- a.parentElement || document.body.appendChild(a), o.current = !0;
- }
- function p() {
- var m;
- (m = a.parentElement) === null || m === void 0 || m.removeChild(a), o.current = !1;
- }
- return St(function() {
- return e ? i ? i(C) : C() : p(), p;
- }, [e]), St(function() {
- c.length && (c.forEach(function(m) {
- return m();
- }), s(pl));
- }, [c]), [a, v];
- }
- function Rp(e, t) {
- if (Dn(e) != "object" || !e) return e;
- var n = e[Symbol.toPrimitive];
- if (n !== void 0) {
- var r = n.call(e, t || "default");
- if (Dn(r) != "object") return r;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (t === "string" ? String : Number)(e);
- }
- function Gc(e) {
- var t = Rp(e, "string");
- return Dn(t) == "symbol" ? t : t + "";
- }
- function Xc(e, t, n) {
- return (t = Gc(t)) in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- function hl(e, t) {
- var n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var r = Object.getOwnPropertySymbols(e);
- t && (r = r.filter(function(a) {
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
- })), n.push.apply(n, r);
- }
- return n;
- }
- function Ur(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2 ? hl(Object(n), !0).forEach(function(r) {
- Xc(e, r, n[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : hl(Object(n)).forEach(function(r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
- });
- }
- return e;
- }
- function _i(e, t) {
- if (!e)
- return !1;
- if (e.contains)
- return e.contains(t);
- for (var n = t; n; ) {
- if (n === e)
- return !0;
- n = n.parentNode;
- }
- return !1;
- }
- var gl = "data-rc-order", yl = "data-rc-priority", Pp = "rc-util-key", Li = /* @__PURE__ */ new Map();
- function Zc() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.mark;
- return t ? t.startsWith("data-") ? t : "data-".concat(t) : Pp;
- }
- function Fo(e) {
- if (e.attachTo)
- return e.attachTo;
- var t = document.querySelector("head");
- return t || document.body;
- }
- function Mp(e) {
- return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
- }
- function wu(e) {
- return Array.from((Li.get(e) || e).children).filter(function(t) {
- return t.tagName === "STYLE";
- });
- }
- function Qc(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- if (!dn())
- return null;
- var n = t.csp, r = t.prepend, a = t.priority, o = a === void 0 ? 0 : a, i = Mp(r), u = i === "prependQueue", l = document.createElement("style");
- l.setAttribute(gl, i), u && o && l.setAttribute(yl, "".concat(o)), n != null && n.nonce && (l.nonce = n == null ? void 0 : n.nonce), l.innerHTML = e;
- var c = Fo(t), s = c.firstChild;
- if (r) {
- if (u) {
- var v = (t.styles || wu(c)).filter(function(C) {
- if (!["prepend", "prependQueue"].includes(C.getAttribute(gl)))
- return !1;
- var p = Number(C.getAttribute(yl) || 0);
- return o >= p;
- });
- if (v.length)
- return c.insertBefore(l, v[v.length - 1].nextSibling), l;
- }
- c.insertBefore(l, s);
- } else
- c.appendChild(l);
- return l;
- }
- function Jc(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = Fo(t);
- return (t.styles || wu(n)).find(function(r) {
- return r.getAttribute(Zc(t)) === e;
- });
- }
- function Ti(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = Jc(e, t);
- if (n) {
- var r = Fo(t);
- r.removeChild(n);
- }
- }
- function kp(e, t) {
- var n = Li.get(e);
- if (!n || !_i(document, n)) {
- var r = Qc("", t), a = r.parentNode;
- Li.set(e, a), e.removeChild(r);
- }
- }
- function ed(e, t) {
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = Fo(n), a = wu(r), o = Ur(Ur({}, n), {}, {
- styles: a
- });
- kp(r, o);
- var i = Jc(t, o);
- if (i) {
- var u, l;
- if ((u = o.csp) !== null && u !== void 0 && u.nonce && i.nonce !== ((l = o.csp) === null || l === void 0 ? void 0 : l.nonce)) {
- var c;
- i.nonce = (c = o.csp) === null || c === void 0 ? void 0 : c.nonce;
- }
- return i.innerHTML !== e && (i.innerHTML = e), i;
- }
- var s = Qc(e, o);
- return s.setAttribute(Zc(o), t), s;
- }
- function Dp(e) {
- var t = "rc-scrollbar-measure-".concat(Math.random().toString(36).substring(7)), n = document.createElement("div");
- n.id = t;
- var r = n.style;
- r.position = "absolute", r.left = "0", r.top = "0", r.width = "100px", r.height = "100px", r.overflow = "scroll";
- var a, o;
- if (e) {
- var i = getComputedStyle(e);
- r.scrollbarColor = i.scrollbarColor, r.scrollbarWidth = i.scrollbarWidth;
- var u = getComputedStyle(e, "::-webkit-scrollbar"), l = parseInt(u.width, 10), c = parseInt(u.height, 10);
- try {
- var s = l ? "width: ".concat(u.width, ";") : "", v = c ? "height: ".concat(u.height, ";") : "";
- ed(`
- #`.concat(t, `::-webkit-scrollbar {
- `).concat(s, `
- `).concat(v, `
- }`), t);
- } catch (m) {
- console.error(m), a = l, o = c;
- }
- }
- document.body.appendChild(n);
- var C = e && a && !isNaN(a) ? a : n.offsetWidth - n.clientWidth, p = e && o && !isNaN(o) ? o : n.offsetHeight - n.clientHeight;
- return document.body.removeChild(n), Ti(t), {
- width: C,
- height: p
- };
- }
- function Np(e) {
- return typeof document > "u" || !e || !(e instanceof Element) ? {
- width: 0,
- height: 0
- } : Dp(e);
- }
- function Ip() {
- return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
- }
- var Op = "rc-util-locker-".concat(Date.now()), bl = 0;
- function _p(e) {
- var t = !!e, n = d.useState(function() {
- return bl += 1, "".concat(Op, "_").concat(bl);
- }), r = cn(n, 1), a = r[0];
- St(function() {
- if (t) {
- var o = Np(document.body).width, i = Ip();
- ed(`
- html body {
- overflow-y: hidden;
- `.concat(i ? "width: calc(100% - ".concat(o, "px);") : "", `
- }`), a);
- } else
- Ti(a);
- return function() {
- Ti(a);
- };
- }, [t, a]);
- }
- var Lp = !1;
- function Tp(e) {
- return Lp;
- }
- var Cl = function(t) {
- return t === !1 ? !1 : !dn() || !t ? null : typeof t == "string" ? document.querySelector(t) : typeof t == "function" ? t() : t;
- }, xu = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.open, r = e.autoLock, a = e.getContainer;
- e.debug;
- var o = e.autoDestroy, i = o === void 0 ? !0 : o, u = e.children, l = d.useState(n), c = cn(l, 2), s = c[0], v = c[1], C = s || n;
- d.useEffect(function() {
- (i || n) && v(n);
- }, [n, i]);
- var p = d.useState(function() {
- return Cl(a);
- }), m = cn(p, 2), b = m[0], f = m[1];
- d.useEffect(function() {
- var O = Cl(a);
- f(O != null ? O : null);
- });
- var h = Ep(C && !b), g = cn(h, 2), y = g[0], w = g[1], E = b != null ? b : y;
- _p(r && n && dn() && (E === y || E === document.body));
- var S = null;
- if (u && xr(u) && t) {
- var x = u;
- S = x.ref;
- }
- var R = Gr(S, t);
- if (!C || !dn() || b === void 0)
- return null;
- var k = E === !1 || Tp(), L = u;
- return t && (L = /* @__PURE__ */ d.cloneElement(u, {
- ref: R
- })), /* @__PURE__ */ d.createElement(Kc.Provider, {
- value: w
- }, k ? L : /* @__PURE__ */ $a(L, E));
- }), td = /* @__PURE__ */ d.createContext({});
- function fn(e) {
- "@babel/helpers - typeof";
- return fn = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
- return typeof t;
- } : function(t) {
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
- }, fn(e);
- }
- function $p(e, t) {
- if (fn(e) != "object" || !e) return e;
- var n = e[Symbol.toPrimitive];
- if (n !== void 0) {
- var r = n.call(e, t || "default");
- if (fn(r) != "object") return r;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (t === "string" ? String : Number)(e);
- }
- function nd(e) {
- var t = $p(e, "string");
- return fn(t) == "symbol" ? t : t + "";
- }
- function At(e, t, n) {
- return (t = nd(t)) in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- function Sl(e, t) {
- var n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var r = Object.getOwnPropertySymbols(e);
- t && (r = r.filter(function(a) {
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
- })), n.push.apply(n, r);
- }
- return n;
- }
- function et(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2 ? Sl(Object(n), !0).forEach(function(r) {
- At(e, r, n[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Sl(Object(n)).forEach(function(r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
- });
- }
- return e;
- }
- var si = { exports: {} };
- /*!
- Copyright (c) 2018 Jed Watson.
- Licensed under the MIT License (MIT), see
- http://jedwatson.github.io/classnames
- */
- var wl;
- function Ap() {
- return wl || (wl = 1, function(e) {
- (function() {
- var t = {}.hasOwnProperty;
- function n() {
- for (var o = "", i = 0; i < arguments.length; i++) {
- var u = arguments[i];
- u && (o = a(o, r(u)));
- }
- return o;
- }
- function r(o) {
- if (typeof o == "string" || typeof o == "number")
- return o;
- if (typeof o != "object")
- return "";
- if (Array.isArray(o))
- return n.apply(null, o);
- if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
- return o.toString();
- var i = "";
- for (var u in o)
- t.call(o, u) && o[u] && (i = a(i, u));
- return i;
- }
- function a(o, i) {
- return i ? o ? o + " " + i : o + i : o;
- }
- e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
- })();
- }(si)), si.exports;
- }
- var jp = Ap();
- const xe = /* @__PURE__ */ Aa(jp);
- function Fp() {
- var e = Ur({}, d);
- return e.useId;
- }
- var xl = 0, El = Fp();
- const rd = El ? (
- // Use React `useId`
- function(t) {
- var n = El();
- return t || n;
- }
- ) : (
- // Use compatible of `useId`
- function(t) {
- var n = d.useState("ssr-id"), r = cn(n, 2), a = r[0], o = r[1];
- return d.useEffect(function() {
- var i = xl;
- xl += 1, o("rc_unique_".concat(i));
- }, []), t || a;
- }
- );
- var fe = {
- /**
- * MAC_ENTER
- */
- MAC_ENTER: 3,
- /**
- * BACKSPACE
- */
- BACKSPACE: 8,
- /**
- * TAB
- */
- TAB: 9,
- /**
- * NUMLOCK on FF/Safari Mac
- */
- NUM_CENTER: 12,
- // NUMLOCK on FF/Safari Mac
- /**
- * ENTER
- */
- ENTER: 13,
- /**
- * SHIFT
- */
- SHIFT: 16,
- /**
- * CTRL
- */
- CTRL: 17,
- /**
- * ALT
- */
- ALT: 18,
- /**
- * PAUSE
- */
- PAUSE: 19,
- /**
- * CAPS_LOCK
- */
- CAPS_LOCK: 20,
- /**
- * ESC
- */
- ESC: 27,
- /**
- * SPACE
- */
- SPACE: 32,
- /**
- * PAGE_UP
- */
- PAGE_UP: 33,
- // also NUM_NORTH_EAST
- /**
- * PAGE_DOWN
- */
- PAGE_DOWN: 34,
- // also NUM_SOUTH_EAST
- /**
- * END
- */
- END: 35,
- // also NUM_SOUTH_WEST
- /**
- * HOME
- */
- HOME: 36,
- // also NUM_NORTH_WEST
- /**
- * LEFT
- */
- LEFT: 37,
- // also NUM_WEST
- /**
- * UP
- */
- UP: 38,
- // also NUM_NORTH
- /**
- * RIGHT
- */
- RIGHT: 39,
- // also NUM_EAST
- /**
- * DOWN
- */
- DOWN: 40,
- // also NUM_SOUTH
- /**
- * PRINT_SCREEN
- */
- PRINT_SCREEN: 44,
- /**
- * INSERT
- */
- INSERT: 45,
- // also NUM_INSERT
- /**
- * DELETE
- */
- DELETE: 46,
- // also NUM_DELETE
- /**
- * ZERO
- */
- ZERO: 48,
- /**
- * ONE
- */
- ONE: 49,
- /**
- * TWO
- */
- TWO: 50,
- /**
- * THREE
- */
- THREE: 51,
- /**
- * FOUR
- */
- FOUR: 52,
- /**
- * FIVE
- */
- FIVE: 53,
- /**
- * SIX
- */
- SIX: 54,
- /**
- * SEVEN
- */
- SEVEN: 55,
- /**
- * EIGHT
- */
- EIGHT: 56,
- /**
- * NINE
- */
- NINE: 57,
- /**
- * QUESTION_MARK
- */
- QUESTION_MARK: 63,
- // needs localization
- /**
- * A
- */
- A: 65,
- /**
- * B
- */
- B: 66,
- /**
- * C
- */
- C: 67,
- /**
- * D
- */
- D: 68,
- /**
- * E
- */
- E: 69,
- /**
- * F
- */
- F: 70,
- /**
- * G
- */
- G: 71,
- /**
- * H
- */
- H: 72,
- /**
- * I
- */
- I: 73,
- /**
- * J
- */
- J: 74,
- /**
- * K
- */
- K: 75,
- /**
- * L
- */
- L: 76,
- /**
- * M
- */
- M: 77,
- /**
- * N
- */
- N: 78,
- /**
- * O
- */
- O: 79,
- /**
- * P
- */
- P: 80,
- /**
- * Q
- */
- Q: 81,
- /**
- * R
- */
- R: 82,
- /**
- * S
- */
- S: 83,
- /**
- * T
- */
- T: 84,
- /**
- * U
- */
- U: 85,
- /**
- * V
- */
- V: 86,
- /**
- * W
- */
- W: 87,
- /**
- * X
- */
- X: 88,
- /**
- * Y
- */
- Y: 89,
- /**
- * Z
- */
- Z: 90,
- /**
- * META
- */
- META: 91,
- // WIN_KEY_LEFT
- /**
- * WIN_KEY_RIGHT
- */
- WIN_KEY_RIGHT: 92,
- /**
- * CONTEXT_MENU
- */
- CONTEXT_MENU: 93,
- /**
- * NUM_ZERO
- */
- NUM_ZERO: 96,
- /**
- * NUM_ONE
- */
- NUM_ONE: 97,
- /**
- * NUM_TWO
- */
- NUM_TWO: 98,
- /**
- * NUM_THREE
- */
- NUM_THREE: 99,
- /**
- * NUM_FOUR
- */
- NUM_FOUR: 100,
- /**
- * NUM_FIVE
- */
- NUM_FIVE: 101,
- /**
- * NUM_SIX
- */
- NUM_SIX: 102,
- /**
- * NUM_SEVEN
- */
- NUM_SEVEN: 103,
- /**
- * NUM_EIGHT
- */
- NUM_EIGHT: 104,
- /**
- * NUM_NINE
- */
- NUM_NINE: 105,
- /**
- * NUM_MULTIPLY
- */
- NUM_MULTIPLY: 106,
- /**
- * NUM_PLUS
- */
- NUM_PLUS: 107,
- /**
- * NUM_MINUS
- */
- NUM_MINUS: 109,
- /**
- * NUM_PERIOD
- */
- NUM_PERIOD: 110,
- /**
- * NUM_DIVISION
- */
- NUM_DIVISION: 111,
- /**
- * F1
- */
- F1: 112,
- /**
- * F2
- */
- F2: 113,
- /**
- * F3
- */
- F3: 114,
- /**
- * F4
- */
- F4: 115,
- /**
- * F5
- */
- F5: 116,
- /**
- * F6
- */
- F6: 117,
- /**
- * F7
- */
- F7: 118,
- /**
- * F8
- */
- F8: 119,
- /**
- * F9
- */
- F9: 120,
- /**
- * F10
- */
- F10: 121,
- /**
- * F11
- */
- F11: 122,
- /**
- * F12
- */
- F12: 123,
- /**
- * NUMLOCK
- */
- NUMLOCK: 144,
- /**
- * SEMICOLON
- */
- SEMICOLON: 186,
- // needs localization
- /**
- * DASH
- */
- DASH: 189,
- // needs localization
- /**
- * EQUALS
- */
- EQUALS: 187,
- // needs localization
- /**
- * COMMA
- */
- COMMA: 188,
- // needs localization
- /**
- * PERIOD
- */
- PERIOD: 190,
- // needs localization
- /**
- * SLASH
- */
- SLASH: 191,
- // needs localization
- /**
- * APOSTROPHE
- */
- APOSTROPHE: 192,
- // needs localization
- /**
- * SINGLE_QUOTE
- */
- SINGLE_QUOTE: 222,
- // needs localization
- /**
- * OPEN_SQUARE_BRACKET
- */
- OPEN_SQUARE_BRACKET: 219,
- // needs localization
- /**
- * BACKSLASH
- */
- BACKSLASH: 220,
- // needs localization
- /**
- * CLOSE_SQUARE_BRACKET
- */
- CLOSE_SQUARE_BRACKET: 221,
- // needs localization
- /**
- * WIN_KEY
- */
- WIN_KEY: 224,
- /**
- * MAC_FF_META
- */
- MAC_FF_META: 224,
- // Firefox (Gecko) fires this for the meta key instead of 91
- /**
- * WIN_IME
- */
- WIN_IME: 229,
- // ======================== Function ========================
- /**
- * whether text and modified key is entered at the same time.
- */
- isTextModifyingKeyEvent: function(t) {
- var n = t.keyCode;
- if (t.altKey && !t.ctrlKey || t.metaKey || // Function keys don't generate text
- n >= fe.F1 && n <= fe.F12)
- return !1;
- switch (n) {
- case fe.ALT:
- case fe.CAPS_LOCK:
- case fe.CONTEXT_MENU:
- case fe.CTRL:
- case fe.DOWN:
- case fe.END:
- case fe.ESC:
- case fe.HOME:
- case fe.INSERT:
- case fe.LEFT:
- case fe.MAC_FF_META:
- case fe.META:
- case fe.NUMLOCK:
- case fe.NUM_CENTER:
- case fe.PAGE_DOWN:
- case fe.PAGE_UP:
- case fe.PAUSE:
- case fe.PRINT_SCREEN:
- case fe.RIGHT:
- case fe.SHIFT:
- case fe.UP:
- case fe.WIN_KEY:
- case fe.WIN_KEY_RIGHT:
- return !1;
- default:
- return !0;
- }
- },
- /**
- * whether character is entered.
- */
- isCharacterKey: function(t) {
- if (t >= fe.ZERO && t <= fe.NINE || t >= fe.NUM_ZERO && t <= fe.NUM_MULTIPLY || t >= fe.A && t <= fe.Z || window.navigator.userAgent.indexOf("WebKit") !== -1 && t === 0)
- return !0;
- switch (t) {
- case fe.SPACE:
- case fe.QUESTION_MARK:
- case fe.NUM_PLUS:
- case fe.NUM_MINUS:
- case fe.NUM_PERIOD:
- case fe.NUM_DIVISION:
- case fe.SEMICOLON:
- case fe.DASH:
- case fe.EQUALS:
- case fe.COMMA:
- case fe.PERIOD:
- case fe.SLASH:
- case fe.APOSTROPHE:
- case fe.SINGLE_QUOTE:
- case fe.OPEN_SQUARE_BRACKET:
- case fe.BACKSLASH:
- case fe.CLOSE_SQUARE_BRACKET:
- return !0;
- default:
- return !1;
- }
- }
- }, zp = `accept acceptCharset accessKey action allowFullScreen allowTransparency
- alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
- charSet checked classID className colSpan cols content contentEditable contextMenu
- controls coords crossOrigin data dateTime default defer dir disabled download draggable
- encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
- headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
- is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
- mediaGroup method min minLength multiple muted name noValidate nonce open
- optimum pattern placeholder poster preload radioGroup readOnly rel required
- reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
- shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
- summary tabIndex target title type useMap value width wmode wrap`, Hp = `onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
- onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
- onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
- onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
- onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
- onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
- onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`, Vp = "".concat(zp, " ").concat(Hp).split(/[\s\n]+/), Wp = "aria-", Bp = "data-";
- function Rl(e, t) {
- return e.indexOf(t) === 0;
- }
- function or(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n;
- t === !1 ? n = {
- aria: !0,
- data: !0,
- attr: !0
- } : t === !0 ? n = {
- aria: !0
- } : n = Ur({}, t);
- var r = {};
- return Object.keys(e).forEach(function(a) {
- // Aria
- (n.aria && (a === "role" || Rl(a, Wp)) || // Data
- n.data && Rl(a, Bp) || // Attr
- n.attr && Vp.includes(a)) && (r[a] = e[a]);
- }), r;
- }
- function Pl(e, t, n) {
- var r = t;
- return !r && n && (r = "".concat(e, "-").concat(n)), r;
- }
- function Ml(e, t) {
- var n = e["page".concat(t ? "Y" : "X", "Offset")], r = "scroll".concat(t ? "Top" : "Left");
- if (typeof n != "number") {
- var a = e.document;
- n = a.documentElement[r], typeof n != "number" && (n = a.body[r]);
- }
- return n;
- }
- function Up(e) {
- var t = e.getBoundingClientRect(), n = {
- left: t.left,
- top: t.top
- }, r = e.ownerDocument, a = r.defaultView || r.parentWindow;
- return n.left += Ml(a), n.top += Ml(a, !0), n;
- }
- function Ia(e) {
- return e instanceof HTMLElement || e instanceof SVGElement;
- }
- function qp(e) {
- return e && Dn(e) === "object" && Ia(e.nativeElement) ? e.nativeElement : Ia(e) ? e : null;
- }
- function Br(e) {
- var t = qp(e);
- if (t)
- return t;
- if (e instanceof me.Component) {
- var n;
- return (n = nr.findDOMNode) === null || n === void 0 ? void 0 : n.call(nr, e);
- }
- return null;
- }
- function Kp(e, t) {
- if (e == null) return {};
- var n = {};
- for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
- if (t.includes(r)) continue;
- n[r] = e[r];
- }
- return n;
- }
- function $i(e, t) {
- if (e == null) return {};
- var n, r, a = Kp(e, t);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- for (r = 0; r < o.length; r++) n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- }
- return a;
- }
- var Yp = /* @__PURE__ */ d.createContext({});
- function ad(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
- }
- function kl(e, t) {
- for (var n = 0; n < t.length; n++) {
- var r = t[n];
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, nd(r.key), r);
- }
- }
- function od(e, t, n) {
- return t && kl(e.prototype, t), n && kl(e, n), Object.defineProperty(e, "prototype", {
- writable: !1
- }), e;
- }
- function Ai(e, t) {
- return Ai = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
- return n.__proto__ = r, n;
- }, Ai(e, t);
- }
- function id(e, t) {
- if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }), Object.defineProperty(e, "prototype", {
- writable: !1
- }), t && Ai(e, t);
- }
- function Mo(e) {
- return Mo = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
- return t.__proto__ || Object.getPrototypeOf(t);
- }, Mo(e);
- }
- function ud() {
- try {
- var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
- }));
- } catch {
- }
- return (ud = function() {
- return !!e;
- })();
- }
- function ji(e) {
- if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e;
- }
- function Gp(e, t) {
- if (t && (fn(t) == "object" || typeof t == "function")) return t;
- if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
- return ji(e);
- }
- function ld(e) {
- var t = ud();
- return function() {
- var n, r = Mo(e);
- if (t) {
- var a = Mo(this).constructor;
- n = Reflect.construct(r, arguments, a);
- } else n = r.apply(this, arguments);
- return Gp(this, n);
- };
- }
- var Xp = /* @__PURE__ */ function(e) {
- id(n, e);
- var t = ld(n);
- function n() {
- return ad(this, n), t.apply(this, arguments);
- }
- return od(n, [{
- key: "render",
- value: function() {
- return this.props.children;
- }
- }]), n;
- }(d.Component);
- function Ct(e) {
- var t = d.useRef();
- t.current = e;
- var n = d.useCallback(function() {
- for (var r, a = arguments.length, o = new Array(a), i = 0; i < a; i++)
- o[i] = arguments[i];
- return (r = t.current) === null || r === void 0 ? void 0 : r.call.apply(r, [t].concat(o));
- }, []);
- return n;
- }
- function ir(e) {
- var t = d.useRef(!1), n = d.useState(e), r = cn(n, 2), a = r[0], o = r[1];
- d.useEffect(function() {
- return t.current = !1, function() {
- t.current = !0;
- };
- }, []);
- function i(u, l) {
- l && t.current || o(u);
- }
- return [a, i];
- }
- function ci(e) {
- return e !== void 0;
- }
- function Gt(e, t) {
- var n = t || {}, r = n.defaultValue, a = n.value, o = n.onChange, i = n.postState, u = ir(function() {
- return ci(a) ? a : ci(r) ? typeof r == "function" ? r() : r : typeof e == "function" ? e() : e;
- }), l = cn(u, 2), c = l[0], s = l[1], v = a !== void 0 ? a : c, C = i ? i(v) : v, p = Ct(o), m = ir([v]), b = cn(m, 2), f = b[0], h = b[1];
- Wr(function() {
- var y = f[0];
- c !== y && p(c, y);
- }, [f]), Wr(function() {
- ci(a) || s(a);
- }, [a]);
- var g = Ct(function(y, w) {
- s(y, w), h([v], w);
- });
- return [C, g];
- }
- function sd(e) {
- var t = d.useReducer(function(u) {
- return u + 1;
- }, 0), n = cn(t, 2), r = n[1], a = d.useRef(e), o = Ct(function() {
- return a.current;
- }), i = Ct(function(u) {
- a.current = typeof u == "function" ? u(a.current) : u, r();
- });
- return [o, i];
- }
- var Jn = "none", Ya = "appear", Ga = "enter", Xa = "leave", Dl = "none", Pn = "prepare", jr = "start", Fr = "active", Eu = "end", cd = "prepared";
- function Nl(e, t) {
- var n = {};
- return n[e.toLowerCase()] = t.toLowerCase(), n["Webkit".concat(e)] = "webkit".concat(t), n["Moz".concat(e)] = "moz".concat(t), n["ms".concat(e)] = "MS".concat(t), n["O".concat(e)] = "o".concat(t.toLowerCase()), n;
- }
- function Zp(e, t) {
- var n = {
- animationend: Nl("Animation", "AnimationEnd"),
- transitionend: Nl("Transition", "TransitionEnd")
- };
- return e && ("AnimationEvent" in t || delete n.animationend.animation, "TransitionEvent" in t || delete n.transitionend.transition), n;
- }
- var Qp = Zp(dn(), typeof window < "u" ? window : {}), dd = {};
- if (dn()) {
- var Jp = document.createElement("div");
- dd = Jp.style;
- }
- var Za = {};
- function fd(e) {
- if (Za[e])
- return Za[e];
- var t = Qp[e];
- if (t)
- for (var n = Object.keys(t), r = n.length, a = 0; a < r; a += 1) {
- var o = n[a];
- if (Object.prototype.hasOwnProperty.call(t, o) && o in dd)
- return Za[e] = t[o], Za[e];
- }
- return "";
- }
- var vd = fd("animationend"), md = fd("transitionend"), pd = !!(vd && md), Il = vd || "animationend", Ol = md || "transitionend";
- function _l(e, t) {
- if (!e) return null;
- if (fn(e) === "object") {
- var n = t.replace(/-\w/g, function(r) {
- return r[1].toUpperCase();
- });
- return e[n];
- }
- return "".concat(e, "-").concat(t);
- }
- const eh = function(e) {
- var t = Ce();
- function n(a) {
- a && (a.removeEventListener(Ol, e), a.removeEventListener(Il, e));
- }
- function r(a) {
- t.current && t.current !== a && n(t.current), a && a !== t.current && (a.addEventListener(Ol, e), a.addEventListener(Il, e), t.current = a);
- }
- return d.useEffect(function() {
- return function() {
- n(t.current);
- };
- }, []), [r, n];
- };
- var hd = dn() ? gc : lt, gd = function(t) {
- return +setTimeout(t, 16);
- }, yd = function(t) {
- return clearTimeout(t);
- };
- typeof window < "u" && "requestAnimationFrame" in window && (gd = function(t) {
- return window.requestAnimationFrame(t);
- }, yd = function(t) {
- return window.cancelAnimationFrame(t);
- });
- var Ll = 0, Ru = /* @__PURE__ */ new Map();
- function bd(e) {
- Ru.delete(e);
- }
- var st = function(t) {
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
- Ll += 1;
- var r = Ll;
- function a(o) {
- if (o === 0)
- bd(r), t();
- else {
- var i = gd(function() {
- a(o - 1);
- });
- Ru.set(r, i);
- }
- }
- return a(n), r;
- };
- st.cancel = function(e) {
- var t = Ru.get(e);
- return bd(e), yd(t);
- };
- const th = function() {
- var e = d.useRef(null);
- function t() {
- st.cancel(e.current);
- }
- function n(r) {
- var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2;
- t();
- var o = st(function() {
- a <= 1 ? r({
- isCanceled: function() {
- return o !== e.current;
- }
- }) : n(r, a - 1);
- });
- e.current = o;
- }
- return d.useEffect(function() {
- return function() {
- t();
- };
- }, []), [n, t];
- };
- var nh = [Pn, jr, Fr, Eu], rh = [Pn, cd], Cd = !1, ah = !0;
- function Sd(e) {
- return e === Fr || e === Eu;
- }
- const oh = function(e, t, n) {
- var r = ir(Dl), a = nn(r, 2), o = a[0], i = a[1], u = th(), l = nn(u, 2), c = l[0], s = l[1];
- function v() {
- i(Pn, !0);
- }
- var C = t ? rh : nh;
- return hd(function() {
- if (o !== Dl && o !== Eu) {
- var p = C.indexOf(o), m = C[p + 1], b = n(o);
- b === Cd ? i(m, !0) : m && c(function(f) {
- function h() {
- f.isCanceled() || i(m, !0);
- }
- b === !0 ? h() : Promise.resolve(b).then(h);
- });
- }
- }, [e, o]), d.useEffect(function() {
- return function() {
- s();
- };
- }, []), [v, o];
- };
- function ih(e, t, n, r) {
- var a = r.motionEnter, o = a === void 0 ? !0 : a, i = r.motionAppear, u = i === void 0 ? !0 : i, l = r.motionLeave, c = l === void 0 ? !0 : l, s = r.motionDeadline, v = r.motionLeaveImmediately, C = r.onAppearPrepare, p = r.onEnterPrepare, m = r.onLeavePrepare, b = r.onAppearStart, f = r.onEnterStart, h = r.onLeaveStart, g = r.onAppearActive, y = r.onEnterActive, w = r.onLeaveActive, E = r.onAppearEnd, S = r.onEnterEnd, x = r.onLeaveEnd, R = r.onVisibleChanged, k = ir(), L = nn(k, 2), O = L[0], N = L[1], F = sd(Jn), I = nn(F, 2), T = I[0], P = I[1], z = ir(null), _ = nn(z, 2), A = _[0], H = _[1], $ = T(), U = Ce(!1), G = Ce(null);
- function B() {
- return n();
- }
- var ne = Ce(!1);
- function le() {
- P(Jn), H(null, !0);
- }
- var ee = Ct(function(ue) {
- var se = T();
- if (se !== Jn) {
- var pe = B();
- if (!(ue && !ue.deadline && ue.target !== pe)) {
- var oe = ne.current, ve;
- se === Ya && oe ? ve = E == null ? void 0 : E(pe, ue) : se === Ga && oe ? ve = S == null ? void 0 : S(pe, ue) : se === Xa && oe && (ve = x == null ? void 0 : x(pe, ue)), oe && ve !== !1 && le();
- }
- }
- }), V = eh(ee), X = nn(V, 1), J = X[0], M = function(se) {
- switch (se) {
- case Ya:
- return At(At(At({}, Pn, C), jr, b), Fr, g);
- case Ga:
- return At(At(At({}, Pn, p), jr, f), Fr, y);
- case Xa:
- return At(At(At({}, Pn, m), jr, h), Fr, w);
- default:
- return {};
- }
- }, D = d.useMemo(function() {
- return M($);
- }, [$]), j = oh($, !e, function(ue) {
- if (ue === Pn) {
- var se = D[Pn];
- return se ? se(B()) : Cd;
- }
- if (Y in D) {
- var pe;
- H(((pe = D[Y]) === null || pe === void 0 ? void 0 : pe.call(D, B(), null)) || null);
- }
- return Y === Fr && $ !== Jn && (J(B()), s > 0 && (clearTimeout(G.current), G.current = setTimeout(function() {
- ee({
- deadline: !0
- });
- }, s))), Y === cd && le(), ah;
- }), W = nn(j, 2), K = W[0], Y = W[1], te = Sd(Y);
- ne.current = te, hd(function() {
- N(t);
- var ue = U.current;
- U.current = !0;
- var se;
- !ue && t && u && (se = Ya), ue && t && o && (se = Ga), (ue && !t && c || !ue && v && !t && c) && (se = Xa);
- var pe = M(se);
- se && (e || pe[Pn]) ? (P(se), K()) : P(Jn);
- }, [t]), lt(function() {
- // Cancel appear
- ($ === Ya && !u || // Cancel enter
- $ === Ga && !o || // Cancel leave
- $ === Xa && !c) && P(Jn);
- }, [u, o, c]), lt(function() {
- return function() {
- U.current = !1, clearTimeout(G.current);
- };
- }, []);
- var Q = d.useRef(!1);
- lt(function() {
- O && (Q.current = !0), O !== void 0 && $ === Jn && ((Q.current || O) && (R == null || R(O)), Q.current = !0);
- }, [O, $]);
- var ae = A;
- return D[Pn] && Y === jr && (ae = et({
- transition: "none"
- }, ae)), [$, Y, ae, O != null ? O : t];
- }
- function uh(e) {
- var t = e;
- fn(e) === "object" && (t = e.transitionSupport);
- function n(a, o) {
- return !!(a.motionName && t && o !== !1);
- }
- var r = /* @__PURE__ */ d.forwardRef(function(a, o) {
- var i = a.visible, u = i === void 0 ? !0 : i, l = a.removeOnLeave, c = l === void 0 ? !0 : l, s = a.forceRender, v = a.children, C = a.motionName, p = a.leavedClassName, m = a.eventProps, b = d.useContext(Yp), f = b.motion, h = n(a, f), g = Ce(), y = Ce();
- function w() {
- try {
- return g.current instanceof HTMLElement ? g.current : Br(y.current);
- } catch {
- return null;
- }
- }
- var E = ih(h, u, w, a), S = nn(E, 4), x = S[0], R = S[1], k = S[2], L = S[3], O = d.useRef(L);
- L && (O.current = !0);
- var N = d.useCallback(function(A) {
- g.current = A, jo(o, A);
- }, [o]), F, I = et(et({}, m), {}, {
- visible: u
- });
- if (!v)
- F = null;
- else if (x === Jn)
- L ? F = v(et({}, I), N) : !c && O.current && p ? F = v(et(et({}, I), {}, {
- className: p
- }), N) : s || !c && !p ? F = v(et(et({}, I), {}, {
- style: {
- display: "none"
- }
- }), N) : F = null;
- else {
- var T;
- R === Pn ? T = "prepare" : Sd(R) ? T = "active" : R === jr && (T = "start");
- var P = _l(C, "".concat(x, "-").concat(T));
- F = v(et(et({}, I), {}, {
- className: xe(_l(C, x), At(At({}, P, P && T), C, typeof C == "string")),
- style: k
- }), N);
- }
- if (/* @__PURE__ */ d.isValidElement(F) && xr(F)) {
- var z = F, _ = z.ref;
- _ || (F = /* @__PURE__ */ d.cloneElement(F, {
- ref: N
- }));
- }
- return /* @__PURE__ */ d.createElement(Xp, {
- ref: y
- }, F);
- });
- return r.displayName = "CSSMotion", r;
- }
- const zo = uh(pd);
- var Fi = "add", zi = "keep", Hi = "remove", di = "removed";
- function lh(e) {
- var t;
- return e && fn(e) === "object" && "key" in e ? t = e : t = {
- key: e
- }, et(et({}, t), {}, {
- key: String(t.key)
- });
- }
- function Vi() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
- return e.map(lh);
- }
- function sh() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = [], r = 0, a = t.length, o = Vi(e), i = Vi(t);
- o.forEach(function(c) {
- for (var s = !1, v = r; v < a; v += 1) {
- var C = i[v];
- if (C.key === c.key) {
- r < v && (n = n.concat(i.slice(r, v).map(function(p) {
- return et(et({}, p), {}, {
- status: Fi
- });
- })), r = v), n.push(et(et({}, C), {}, {
- status: zi
- })), r += 1, s = !0;
- break;
- }
- }
- s || n.push(et(et({}, c), {}, {
- status: Hi
- }));
- }), r < a && (n = n.concat(i.slice(r).map(function(c) {
- return et(et({}, c), {}, {
- status: Fi
- });
- })));
- var u = {};
- n.forEach(function(c) {
- var s = c.key;
- u[s] = (u[s] || 0) + 1;
- });
- var l = Object.keys(u).filter(function(c) {
- return u[c] > 1;
- });
- return l.forEach(function(c) {
- n = n.filter(function(s) {
- var v = s.key, C = s.status;
- return v !== c || C !== Hi;
- }), n.forEach(function(s) {
- s.key === c && (s.status = zi);
- });
- }), n;
- }
- var ch = ["component", "children", "onVisibleChanged", "onAllRemoved"], dh = ["status"], fh = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearPrepare", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"];
- function vh(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : zo, n = /* @__PURE__ */ function(r) {
- id(o, r);
- var a = ld(o);
- function o() {
- var i;
- ad(this, o);
- for (var u = arguments.length, l = new Array(u), c = 0; c < u; c++)
- l[c] = arguments[c];
- return i = a.call.apply(a, [this].concat(l)), At(ji(i), "state", {
- keyEntities: []
- }), At(ji(i), "removeKey", function(s) {
- var v = i.state.keyEntities, C = v.map(function(p) {
- return p.key !== s ? p : et(et({}, p), {}, {
- status: di
- });
- });
- return i.setState({
- keyEntities: C
- }), C.filter(function(p) {
- var m = p.status;
- return m !== di;
- }).length;
- }), i;
- }
- return od(o, [{
- key: "render",
- value: function() {
- var u = this, l = this.state.keyEntities, c = this.props, s = c.component, v = c.children, C = c.onVisibleChanged, p = c.onAllRemoved, m = $i(c, ch), b = s || d.Fragment, f = {};
- return fh.forEach(function(h) {
- f[h] = m[h], delete m[h];
- }), delete m.keys, /* @__PURE__ */ d.createElement(b, m, l.map(function(h, g) {
- var y = h.status, w = $i(h, dh), E = y === Fi || y === zi;
- return /* @__PURE__ */ d.createElement(t, sn({}, f, {
- key: w.key,
- visible: E,
- eventProps: w,
- onVisibleChanged: function(x) {
- if (C == null || C(x, {
- key: w.key
- }), !x) {
- var R = u.removeKey(w.key);
- R === 0 && p && p();
- }
- }
- }), function(S, x) {
- return v(et(et({}, S), {}, {
- index: g
- }), x);
- });
- }));
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function(u, l) {
- var c = u.keys, s = l.keyEntities, v = Vi(c), C = sh(s, v);
- return {
- keyEntities: C.filter(function(p) {
- var m = s.find(function(b) {
- var f = b.key;
- return p.key === f;
- });
- return !(m && m.status === di && p.status === Hi);
- })
- };
- }
- }]), o;
- }(d.Component);
- return At(n, "defaultProps", {
- component: "div"
- }), n;
- }
- vh(pd);
- const mh = /* @__PURE__ */ d.memo(function(e) {
- var t = e.children;
- return t;
- }, function(e, t) {
- var n = t.shouldUpdate;
- return !n;
- });
- var ph = {
- width: 0,
- height: 0,
- overflow: "hidden",
- outline: "none"
- }, hh = {
- outline: "none"
- }, gh = /* @__PURE__ */ me.forwardRef(function(e, t) {
- var n = e.prefixCls, r = e.className, a = e.style, o = e.title, i = e.ariaId, u = e.footer, l = e.closable, c = e.closeIcon, s = e.onClose, v = e.children, C = e.bodyStyle, p = e.bodyProps, m = e.modalRender, b = e.onMouseDown, f = e.onMouseUp, h = e.holderRef, g = e.visible, y = e.forceRender, w = e.width, E = e.height, S = e.classNames, x = e.styles, R = me.useContext(td), k = R.panel, L = Gr(h, k), O = Ce(), N = Ce();
- me.useImperativeHandle(t, function() {
- return {
- focus: function() {
- var U;
- (U = O.current) === null || U === void 0 || U.focus({
- preventScroll: !0
- });
- },
- changeActive: function(U) {
- var G = document, B = G.activeElement;
- U && B === N.current ? O.current.focus({
- preventScroll: !0
- }) : !U && B === O.current && N.current.focus({
- preventScroll: !0
- });
- }
- };
- });
- var F = {};
- w !== void 0 && (F.width = w), E !== void 0 && (F.height = E);
- var I = u ? /* @__PURE__ */ me.createElement("div", {
- className: xe("".concat(n, "-footer"), S == null ? void 0 : S.footer),
- style: et({}, x == null ? void 0 : x.footer)
- }, u) : null, T = o ? /* @__PURE__ */ me.createElement("div", {
- className: xe("".concat(n, "-header"), S == null ? void 0 : S.header),
- style: et({}, x == null ? void 0 : x.header)
- }, /* @__PURE__ */ me.createElement("div", {
- className: "".concat(n, "-title"),
- id: i
- }, o)) : null, P = Ht(function() {
- return fn(l) === "object" && l !== null ? l : l ? {
- closeIcon: c != null ? c : /* @__PURE__ */ me.createElement("span", {
- className: "".concat(n, "-close-x")
- })
- } : {};
- }, [l, c, n]), z = or(P, !0), _ = fn(l) === "object" && l.disabled, A = l ? /* @__PURE__ */ me.createElement("button", sn({
- type: "button",
- onClick: s,
- "aria-label": "Close"
- }, z, {
- className: "".concat(n, "-close"),
- disabled: _
- }), P.closeIcon) : null, H = /* @__PURE__ */ me.createElement("div", {
- className: xe("".concat(n, "-content"), S == null ? void 0 : S.content),
- style: x == null ? void 0 : x.content
- }, A, T, /* @__PURE__ */ me.createElement("div", sn({
- className: xe("".concat(n, "-body"), S == null ? void 0 : S.body),
- style: et(et({}, C), x == null ? void 0 : x.body)
- }, p), v), I);
- return /* @__PURE__ */ me.createElement("div", {
- key: "dialog-element",
- role: "dialog",
- "aria-labelledby": o ? i : null,
- "aria-modal": "true",
- ref: L,
- style: et(et({}, a), F),
- className: xe(n, r),
- onMouseDown: b,
- onMouseUp: f
- }, /* @__PURE__ */ me.createElement("div", {
- ref: O,
- tabIndex: 0,
- style: hh
- }, /* @__PURE__ */ me.createElement(mh, {
- shouldUpdate: g || y
- }, m ? m(H) : H)), /* @__PURE__ */ me.createElement("div", {
- tabIndex: 0,
- ref: N,
- style: ph
- }));
- }), wd = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.prefixCls, r = e.title, a = e.style, o = e.className, i = e.visible, u = e.forceRender, l = e.destroyOnClose, c = e.motionName, s = e.ariaId, v = e.onVisibleChanged, C = e.mousePosition, p = Ce(), m = d.useState(), b = nn(m, 2), f = b[0], h = b[1], g = {};
- f && (g.transformOrigin = f);
- function y() {
- var w = Up(p.current);
- h(C && (C.x || C.y) ? "".concat(C.x - w.left, "px ").concat(C.y - w.top, "px") : "");
- }
- return /* @__PURE__ */ d.createElement(zo, {
- visible: i,
- onVisibleChanged: v,
- onAppearPrepare: y,
- onEnterPrepare: y,
- forceRender: u,
- motionName: c,
- removeOnLeave: l,
- ref: p
- }, function(w, E) {
- var S = w.className, x = w.style;
- return /* @__PURE__ */ d.createElement(gh, sn({}, e, {
- ref: t,
- title: r,
- ariaId: s,
- prefixCls: n,
- holderRef: E,
- style: et(et(et({}, x), a), g),
- className: xe(o, S)
- }));
- });
- });
- wd.displayName = "Content";
- var yh = function(t) {
- var n = t.prefixCls, r = t.style, a = t.visible, o = t.maskProps, i = t.motionName, u = t.className;
- return /* @__PURE__ */ d.createElement(zo, {
- key: "mask",
- visible: a,
- motionName: i,
- leavedClassName: "".concat(n, "-mask-hidden")
- }, function(l, c) {
- var s = l.className, v = l.style;
- return /* @__PURE__ */ d.createElement("div", sn({
- ref: c,
- style: et(et({}, v), r),
- className: xe("".concat(n, "-mask"), s, u)
- }, o));
- });
- }, bh = function(t) {
- var n = t.prefixCls, r = n === void 0 ? "rc-dialog" : n, a = t.zIndex, o = t.visible, i = o === void 0 ? !1 : o, u = t.keyboard, l = u === void 0 ? !0 : u, c = t.focusTriggerAfterClose, s = c === void 0 ? !0 : c, v = t.wrapStyle, C = t.wrapClassName, p = t.wrapProps, m = t.onClose, b = t.afterOpenChange, f = t.afterClose, h = t.transitionName, g = t.animation, y = t.closable, w = y === void 0 ? !0 : y, E = t.mask, S = E === void 0 ? !0 : E, x = t.maskTransitionName, R = t.maskAnimation, k = t.maskClosable, L = k === void 0 ? !0 : k, O = t.maskStyle, N = t.maskProps, F = t.rootClassName, I = t.classNames, T = t.styles, P = Ce(), z = Ce(), _ = Ce(), A = d.useState(i), H = nn(A, 2), $ = H[0], U = H[1], G = rd();
- function B() {
- _i(z.current, document.activeElement) || (P.current = document.activeElement);
- }
- function ne() {
- if (!_i(z.current, document.activeElement)) {
- var K;
- (K = _.current) === null || K === void 0 || K.focus();
- }
- }
- function le(K) {
- if (K)
- ne();
- else {
- if (U(!1), S && P.current && s) {
- try {
- P.current.focus({
- preventScroll: !0
- });
- } catch {
- }
- P.current = null;
- }
- $ && (f == null || f());
- }
- b == null || b(K);
- }
- function ee(K) {
- m == null || m(K);
- }
- var V = Ce(!1), X = Ce(), J = function() {
- clearTimeout(X.current), V.current = !0;
- }, M = function() {
- X.current = setTimeout(function() {
- V.current = !1;
- });
- }, D = null;
- L && (D = function(Y) {
- V.current ? V.current = !1 : z.current === Y.target && ee(Y);
- });
- function j(K) {
- if (l && K.keyCode === fe.ESC) {
- K.stopPropagation(), ee(K);
- return;
- }
- i && K.keyCode === fe.TAB && _.current.changeActive(!K.shiftKey);
- }
- lt(function() {
- i && (U(!0), B());
- }, [i]), lt(function() {
- return function() {
- clearTimeout(X.current);
- };
- }, []);
- var W = et(et(et({
- zIndex: a
- }, v), T == null ? void 0 : T.wrapper), {}, {
- display: $ ? null : "none"
- });
- return /* @__PURE__ */ d.createElement("div", sn({
- className: xe("".concat(r, "-root"), F)
- }, or(t, {
- data: !0
- })), /* @__PURE__ */ d.createElement(yh, {
- prefixCls: r,
- visible: S && i,
- motionName: Pl(r, x, R),
- style: et(et({
- zIndex: a
- }, O), T == null ? void 0 : T.mask),
- maskProps: N,
- className: I == null ? void 0 : I.mask
- }), /* @__PURE__ */ d.createElement("div", sn({
- tabIndex: -1,
- onKeyDown: j,
- className: xe("".concat(r, "-wrap"), C, I == null ? void 0 : I.wrapper),
- ref: z,
- onClick: D,
- style: W
- }, p), /* @__PURE__ */ d.createElement(wd, sn({}, t, {
- onMouseDown: J,
- onMouseUp: M,
- ref: _,
- closable: w,
- ariaId: G,
- prefixCls: r,
- visible: i && $,
- onClose: ee,
- onVisibleChanged: le,
- motionName: Pl(r, h, g)
- }))));
- }, xd = function(t) {
- var n = t.visible, r = t.getContainer, a = t.forceRender, o = t.destroyOnClose, i = o === void 0 ? !1 : o, u = t.afterClose, l = t.panelRef, c = d.useState(n), s = nn(c, 2), v = s[0], C = s[1], p = d.useMemo(function() {
- return {
- panel: l
- };
- }, [l]);
- return d.useEffect(function() {
- n && C(!0);
- }, [n]), !a && i && !v ? null : /* @__PURE__ */ d.createElement(td.Provider, {
- value: p
- }, /* @__PURE__ */ d.createElement(xu, {
- open: n || a || v,
- autoDestroy: !1,
- getContainer: r,
- autoLock: n || v
- }, /* @__PURE__ */ d.createElement(bh, sn({}, t, {
- destroyOnClose: i,
- afterClose: function() {
- u == null || u(), C(!1);
- }
- }))));
- };
- xd.displayName = "Dialog";
- var aa = { exports: {} }, fi = {}, vi = { exports: {} }, mi, Tl;
- function Ch() {
- if (Tl) return mi;
- Tl = 1;
- var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
- return mi = e, mi;
- }
- var pi, $l;
- function Sh() {
- if ($l) return pi;
- $l = 1;
- var e = /* @__PURE__ */ Ch();
- function t() {
- }
- function n() {
- }
- return n.resetWarningCache = t, pi = function() {
- function r(i, u, l, c, s, v) {
- if (v !== e) {
- var C = new Error(
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
- );
- throw C.name = "Invariant Violation", C;
- }
- }
- r.isRequired = r;
- function a() {
- return r;
- }
- var o = {
- array: r,
- bigint: r,
- bool: r,
- func: r,
- number: r,
- object: r,
- string: r,
- symbol: r,
- any: r,
- arrayOf: a,
- element: r,
- elementType: r,
- instanceOf: a,
- node: r,
- objectOf: a,
- oneOf: a,
- oneOfType: a,
- shape: a,
- exact: a,
- checkPropTypes: n,
- resetWarningCache: t
- };
- return o.PropTypes = o, o;
- }, pi;
- }
- var Al;
- function sr() {
- return Al || (Al = 1, vi.exports = /* @__PURE__ */ Sh()()), vi.exports;
- }
- function Ed(e) {
- var t, n, r = "";
- if (typeof e == "string" || typeof e == "number") r += e;
- else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = Ed(e[t])) && (r && (r += " "), r += n);
- else for (t in e) e[t] && (r && (r += " "), r += t);
- return r;
- }
- function jl() {
- for (var e, t, n = 0, r = ""; n < arguments.length; ) (e = arguments[n++]) && (t = Ed(e)) && (r && (r += " "), r += t);
- return r;
- }
- const wh = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- clsx: jl,
- default: jl
- }, Symbol.toStringTag, { value: "Module" })), xh = /* @__PURE__ */ bc(wh);
- var Tt = {}, Yn = {}, Fl;
- function Ho() {
- if (Fl) return Yn;
- Fl = 1, Object.defineProperty(Yn, "__esModule", {
- value: !0
- }), Yn.dontSetMe = a, Yn.findInArray = e, Yn.int = r, Yn.isFunction = t, Yn.isNum = n;
- function e(o, i) {
- for (let u = 0, l = o.length; u < l; u++)
- if (i.apply(i, [o[u], u, o])) return o[u];
- }
- function t(o) {
- return typeof o == "function" || Object.prototype.toString.call(o) === "[object Function]";
- }
- function n(o) {
- return typeof o == "number" && !isNaN(o);
- }
- function r(o) {
- return parseInt(o, 10);
- }
- function a(o, i, u) {
- if (o[i])
- return new Error("Invalid prop ".concat(i, " passed to ").concat(u, " - do not set this, set it on the child."));
- }
- return Yn;
- }
- var Gn = {}, zl;
- function Eh() {
- if (zl) return Gn;
- zl = 1, Object.defineProperty(Gn, "__esModule", {
- value: !0
- }), Gn.browserPrefixToKey = n, Gn.browserPrefixToStyle = r, Gn.default = void 0, Gn.getPrefix = t;
- const e = ["Moz", "Webkit", "O", "ms"];
- function t() {
- var o;
- let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform";
- if (typeof window > "u") return "";
- const u = (o = window.document) === null || o === void 0 || (o = o.documentElement) === null || o === void 0 ? void 0 : o.style;
- if (!u || i in u) return "";
- for (let l = 0; l < e.length; l++)
- if (n(i, e[l]) in u) return e[l];
- return "";
- }
- function n(o, i) {
- return i ? "".concat(i).concat(a(o)) : o;
- }
- function r(o, i) {
- return i ? "-".concat(i.toLowerCase(), "-").concat(o) : o;
- }
- function a(o) {
- let i = "", u = !0;
- for (let l = 0; l < o.length; l++)
- u ? (i += o[l].toUpperCase(), u = !1) : o[l] === "-" ? u = !0 : i += o[l];
- return i;
- }
- return Gn.default = t(), Gn;
- }
- var Hl;
- function Pu() {
- if (Hl) return Tt;
- Hl = 1, Object.defineProperty(Tt, "__esModule", {
- value: !0
- }), Tt.addClassName = E, Tt.addEvent = u, Tt.addUserSelectStyles = y, Tt.createCSSTransform = m, Tt.createSVGTransform = b, Tt.getTouch = h, Tt.getTouchIdentifier = g, Tt.getTranslation = f, Tt.innerHeight = v, Tt.innerWidth = C, Tt.matchesSelector = o, Tt.matchesSelectorAndParentsTo = i, Tt.offsetXYFromParent = p, Tt.outerHeight = c, Tt.outerWidth = s, Tt.removeClassName = S, Tt.removeEvent = l, Tt.removeUserSelectStyles = w;
- var e = Ho(), t = r(Eh());
- function n(x) {
- if (typeof WeakMap != "function") return null;
- var R = /* @__PURE__ */ new WeakMap(), k = /* @__PURE__ */ new WeakMap();
- return (n = function(L) {
- return L ? k : R;
- })(x);
- }
- function r(x, R) {
- if (x && x.__esModule)
- return x;
- if (x === null || typeof x != "object" && typeof x != "function")
- return { default: x };
- var k = n(R);
- if (k && k.has(x))
- return k.get(x);
- var L = {}, O = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var N in x)
- if (N !== "default" && Object.prototype.hasOwnProperty.call(x, N)) {
- var F = O ? Object.getOwnPropertyDescriptor(x, N) : null;
- F && (F.get || F.set) ? Object.defineProperty(L, N, F) : L[N] = x[N];
- }
- return L.default = x, k && k.set(x, L), L;
- }
- let a = "";
- function o(x, R) {
- return a || (a = (0, e.findInArray)(["matches", "webkitMatchesSelector", "mozMatchesSelector", "msMatchesSelector", "oMatchesSelector"], function(k) {
- return (0, e.isFunction)(x[k]);
- })), (0, e.isFunction)(x[a]) ? x[a](R) : !1;
- }
- function i(x, R, k) {
- let L = x;
- do {
- if (o(L, R)) return !0;
- if (L === k) return !1;
- L = L.parentNode;
- } while (L);
- return !1;
- }
- function u(x, R, k, L) {
- if (!x) return;
- const O = {
- capture: !0,
- ...L
- };
- x.addEventListener ? x.addEventListener(R, k, O) : x.attachEvent ? x.attachEvent("on" + R, k) : x["on" + R] = k;
- }
- function l(x, R, k, L) {
- if (!x) return;
- const O = {
- capture: !0,
- ...L
- };
- x.removeEventListener ? x.removeEventListener(R, k, O) : x.detachEvent ? x.detachEvent("on" + R, k) : x["on" + R] = null;
- }
- function c(x) {
- let R = x.clientHeight;
- const k = x.ownerDocument.defaultView.getComputedStyle(x);
- return R += (0, e.int)(k.borderTopWidth), R += (0, e.int)(k.borderBottomWidth), R;
- }
- function s(x) {
- let R = x.clientWidth;
- const k = x.ownerDocument.defaultView.getComputedStyle(x);
- return R += (0, e.int)(k.borderLeftWidth), R += (0, e.int)(k.borderRightWidth), R;
- }
- function v(x) {
- let R = x.clientHeight;
- const k = x.ownerDocument.defaultView.getComputedStyle(x);
- return R -= (0, e.int)(k.paddingTop), R -= (0, e.int)(k.paddingBottom), R;
- }
- function C(x) {
- let R = x.clientWidth;
- const k = x.ownerDocument.defaultView.getComputedStyle(x);
- return R -= (0, e.int)(k.paddingLeft), R -= (0, e.int)(k.paddingRight), R;
- }
- function p(x, R, k) {
- const O = R === R.ownerDocument.body ? {
- left: 0,
- top: 0
- } : R.getBoundingClientRect(), N = (x.clientX + R.scrollLeft - O.left) / k, F = (x.clientY + R.scrollTop - O.top) / k;
- return {
- x: N,
- y: F
- };
- }
- function m(x, R) {
- const k = f(x, R, "px");
- return {
- [(0, t.browserPrefixToKey)("transform", t.default)]: k
- };
- }
- function b(x, R) {
- return f(x, R, "");
- }
- function f(x, R, k) {
- let {
- x: L,
- y: O
- } = x, N = "translate(".concat(L).concat(k, ",").concat(O).concat(k, ")");
- if (R) {
- const F = "".concat(typeof R.x == "string" ? R.x : R.x + k), I = "".concat(typeof R.y == "string" ? R.y : R.y + k);
- N = "translate(".concat(F, ", ").concat(I, ")") + N;
- }
- return N;
- }
- function h(x, R) {
- return x.targetTouches && (0, e.findInArray)(x.targetTouches, (k) => R === k.identifier) || x.changedTouches && (0, e.findInArray)(x.changedTouches, (k) => R === k.identifier);
- }
- function g(x) {
- if (x.targetTouches && x.targetTouches[0]) return x.targetTouches[0].identifier;
- if (x.changedTouches && x.changedTouches[0]) return x.changedTouches[0].identifier;
- }
- function y(x) {
- if (!x) return;
- let R = x.getElementById("react-draggable-style-el");
- R || (R = x.createElement("style"), R.type = "text/css", R.id = "react-draggable-style-el", R.innerHTML = `.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
- `, R.innerHTML += `.react-draggable-transparent-selection *::selection {all: inherit;}
- `, x.getElementsByTagName("head")[0].appendChild(R)), x.body && E(x.body, "react-draggable-transparent-selection");
- }
- function w(x) {
- if (x)
- try {
- if (x.body && S(x.body, "react-draggable-transparent-selection"), x.selection)
- x.selection.empty();
- else {
- const R = (x.defaultView || window).getSelection();
- R && R.type !== "Caret" && R.removeAllRanges();
- }
- } catch {
- }
- }
- function E(x, R) {
- x.classList ? x.classList.add(R) : x.className.match(new RegExp("(?:^|\\s)".concat(R, "(?!\\S)"))) || (x.className += " ".concat(R));
- }
- function S(x, R) {
- x.classList ? x.classList.remove(R) : x.className = x.className.replace(new RegExp("(?:^|\\s)".concat(R, "(?!\\S)"), "g"), "");
- }
- return Tt;
- }
- var Ln = {}, Vl;
- function Rd() {
- if (Vl) return Ln;
- Vl = 1, Object.defineProperty(Ln, "__esModule", {
- value: !0
- }), Ln.canDragX = a, Ln.canDragY = o, Ln.createCoreData = u, Ln.createDraggableData = l, Ln.getBoundPosition = n, Ln.getControlPosition = i, Ln.snapToGrid = r;
- var e = Ho(), t = Pu();
- function n(v, C, p) {
- if (!v.props.bounds) return [C, p];
- let {
- bounds: m
- } = v.props;
- m = typeof m == "string" ? m : c(m);
- const b = s(v);
- if (typeof m == "string") {
- const {
- ownerDocument: f
- } = b, h = f.defaultView;
- let g;
- if (m === "parent" ? g = b.parentNode : g = f.querySelector(m), !(g instanceof h.HTMLElement))
- throw new Error('Bounds selector "' + m + '" could not find an element.');
- const y = g, w = h.getComputedStyle(b), E = h.getComputedStyle(y);
- m = {
- left: -b.offsetLeft + (0, e.int)(E.paddingLeft) + (0, e.int)(w.marginLeft),
- top: -b.offsetTop + (0, e.int)(E.paddingTop) + (0, e.int)(w.marginTop),
- right: (0, t.innerWidth)(y) - (0, t.outerWidth)(b) - b.offsetLeft + (0, e.int)(E.paddingRight) - (0, e.int)(w.marginRight),
- bottom: (0, t.innerHeight)(y) - (0, t.outerHeight)(b) - b.offsetTop + (0, e.int)(E.paddingBottom) - (0, e.int)(w.marginBottom)
- };
- }
- return (0, e.isNum)(m.right) && (C = Math.min(C, m.right)), (0, e.isNum)(m.bottom) && (p = Math.min(p, m.bottom)), (0, e.isNum)(m.left) && (C = Math.max(C, m.left)), (0, e.isNum)(m.top) && (p = Math.max(p, m.top)), [C, p];
- }
- function r(v, C, p) {
- const m = Math.round(C / v[0]) * v[0], b = Math.round(p / v[1]) * v[1];
- return [m, b];
- }
- function a(v) {
- return v.props.axis === "both" || v.props.axis === "x";
- }
- function o(v) {
- return v.props.axis === "both" || v.props.axis === "y";
- }
- function i(v, C, p) {
- const m = typeof C == "number" ? (0, t.getTouch)(v, C) : null;
- if (typeof C == "number" && !m) return null;
- const b = s(p), f = p.props.offsetParent || b.offsetParent || b.ownerDocument.body;
- return (0, t.offsetXYFromParent)(m || v, f, p.props.scale);
- }
- function u(v, C, p) {
- const m = !(0, e.isNum)(v.lastX), b = s(v);
- return m ? {
- node: b,
- deltaX: 0,
- deltaY: 0,
- lastX: C,
- lastY: p,
- x: C,
- y: p
- } : {
- node: b,
- deltaX: C - v.lastX,
- deltaY: p - v.lastY,
- lastX: v.lastX,
- lastY: v.lastY,
- x: C,
- y: p
- };
- }
- function l(v, C) {
- const p = v.props.scale;
- return {
- node: C.node,
- x: v.state.x + C.deltaX / p,
- y: v.state.y + C.deltaY / p,
- deltaX: C.deltaX / p,
- deltaY: C.deltaY / p,
- lastX: v.state.x,
- lastY: v.state.y
- };
- }
- function c(v) {
- return {
- left: v.left,
- top: v.top,
- right: v.right,
- bottom: v.bottom
- };
- }
- function s(v) {
- const C = v.findDOMNode();
- if (!C)
- throw new Error("<DraggableCore>: Unmounted during event!");
- return C;
- }
- return Ln;
- }
- var oa = {}, Qa = {}, Wl;
- function Pd() {
- if (Wl) return Qa;
- Wl = 1, Object.defineProperty(Qa, "__esModule", {
- value: !0
- }), Qa.default = e;
- function e() {
- }
- return Qa;
- }
- var Bl;
- function Rh() {
- if (Bl) return oa;
- Bl = 1, Object.defineProperty(oa, "__esModule", {
- value: !0
- }), oa.default = void 0;
- var e = c(me), t = u(/* @__PURE__ */ sr()), n = u(nr), r = Pu(), a = Rd(), o = Ho(), i = u(Pd());
- function u(f) {
- return f && f.__esModule ? f : { default: f };
- }
- function l(f) {
- if (typeof WeakMap != "function") return null;
- var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap();
- return (l = function(y) {
- return y ? g : h;
- })(f);
- }
- function c(f, h) {
- if (f && f.__esModule)
- return f;
- if (f === null || typeof f != "object" && typeof f != "function")
- return { default: f };
- var g = l(h);
- if (g && g.has(f))
- return g.get(f);
- var y = {}, w = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var E in f)
- if (E !== "default" && Object.prototype.hasOwnProperty.call(f, E)) {
- var S = w ? Object.getOwnPropertyDescriptor(f, E) : null;
- S && (S.get || S.set) ? Object.defineProperty(y, E, S) : y[E] = f[E];
- }
- return y.default = f, g && g.set(f, y), y;
- }
- function s(f, h, g) {
- return h = v(h), h in f ? Object.defineProperty(f, h, { value: g, enumerable: !0, configurable: !0, writable: !0 }) : f[h] = g, f;
- }
- function v(f) {
- var h = C(f, "string");
- return typeof h == "symbol" ? h : String(h);
- }
- function C(f, h) {
- if (typeof f != "object" || f === null) return f;
- var g = f[Symbol.toPrimitive];
- if (g !== void 0) {
- var y = g.call(f, h || "default");
- if (typeof y != "object") return y;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (h === "string" ? String : Number)(f);
- }
- const p = {
- touch: {
- start: "touchstart",
- move: "touchmove",
- stop: "touchend"
- },
- mouse: {
- start: "mousedown",
- move: "mousemove",
- stop: "mouseup"
- }
- };
- let m = p.mouse, b = class extends e.Component {
- constructor() {
- super(...arguments), s(this, "dragging", !1), s(this, "lastX", NaN), s(this, "lastY", NaN), s(this, "touchIdentifier", null), s(this, "mounted", !1), s(this, "handleDragStart", (h) => {
- if (this.props.onMouseDown(h), !this.props.allowAnyClick && typeof h.button == "number" && h.button !== 0) return !1;
- const g = this.findDOMNode();
- if (!g || !g.ownerDocument || !g.ownerDocument.body)
- throw new Error("<DraggableCore> not mounted on DragStart!");
- const {
- ownerDocument: y
- } = g;
- if (this.props.disabled || !(h.target instanceof y.defaultView.Node) || this.props.handle && !(0, r.matchesSelectorAndParentsTo)(h.target, this.props.handle, g) || this.props.cancel && (0, r.matchesSelectorAndParentsTo)(h.target, this.props.cancel, g))
- return;
- h.type === "touchstart" && h.preventDefault();
- const w = (0, r.getTouchIdentifier)(h);
- this.touchIdentifier = w;
- const E = (0, a.getControlPosition)(h, w, this);
- if (E == null) return;
- const {
- x: S,
- y: x
- } = E, R = (0, a.createCoreData)(this, S, x);
- (0, i.default)("DraggableCore: handleDragStart: %j", R), (0, i.default)("calling", this.props.onStart), !(this.props.onStart(h, R) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, r.addUserSelectStyles)(y), this.dragging = !0, this.lastX = S, this.lastY = x, (0, r.addEvent)(y, m.move, this.handleDrag), (0, r.addEvent)(y, m.stop, this.handleDragStop));
- }), s(this, "handleDrag", (h) => {
- const g = (0, a.getControlPosition)(h, this.touchIdentifier, this);
- if (g == null) return;
- let {
- x: y,
- y: w
- } = g;
- if (Array.isArray(this.props.grid)) {
- let x = y - this.lastX, R = w - this.lastY;
- if ([x, R] = (0, a.snapToGrid)(this.props.grid, x, R), !x && !R) return;
- y = this.lastX + x, w = this.lastY + R;
- }
- const E = (0, a.createCoreData)(this, y, w);
- if ((0, i.default)("DraggableCore: handleDrag: %j", E), this.props.onDrag(h, E) === !1 || this.mounted === !1) {
- try {
- this.handleDragStop(new MouseEvent("mouseup"));
- } catch {
- const R = document.createEvent("MouseEvents");
- R.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(R);
- }
- return;
- }
- this.lastX = y, this.lastY = w;
- }), s(this, "handleDragStop", (h) => {
- if (!this.dragging) return;
- const g = (0, a.getControlPosition)(h, this.touchIdentifier, this);
- if (g == null) return;
- let {
- x: y,
- y: w
- } = g;
- if (Array.isArray(this.props.grid)) {
- let R = y - this.lastX || 0, k = w - this.lastY || 0;
- [R, k] = (0, a.snapToGrid)(this.props.grid, R, k), y = this.lastX + R, w = this.lastY + k;
- }
- const E = (0, a.createCoreData)(this, y, w);
- if (this.props.onStop(h, E) === !1 || this.mounted === !1) return !1;
- const x = this.findDOMNode();
- x && this.props.enableUserSelectHack && (0, r.removeUserSelectStyles)(x.ownerDocument), (0, i.default)("DraggableCore: handleDragStop: %j", E), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, x && ((0, i.default)("DraggableCore: Removing handlers"), (0, r.removeEvent)(x.ownerDocument, m.move, this.handleDrag), (0, r.removeEvent)(x.ownerDocument, m.stop, this.handleDragStop));
- }), s(this, "onMouseDown", (h) => (m = p.mouse, this.handleDragStart(h))), s(this, "onMouseUp", (h) => (m = p.mouse, this.handleDragStop(h))), s(this, "onTouchStart", (h) => (m = p.touch, this.handleDragStart(h))), s(this, "onTouchEnd", (h) => (m = p.touch, this.handleDragStop(h)));
- }
- componentDidMount() {
- this.mounted = !0;
- const h = this.findDOMNode();
- h && (0, r.addEvent)(h, p.touch.start, this.onTouchStart, {
- passive: !1
- });
- }
- componentWillUnmount() {
- this.mounted = !1;
- const h = this.findDOMNode();
- if (h) {
- const {
- ownerDocument: g
- } = h;
- (0, r.removeEvent)(g, p.mouse.move, this.handleDrag), (0, r.removeEvent)(g, p.touch.move, this.handleDrag), (0, r.removeEvent)(g, p.mouse.stop, this.handleDragStop), (0, r.removeEvent)(g, p.touch.stop, this.handleDragStop), (0, r.removeEvent)(h, p.touch.start, this.onTouchStart, {
- passive: !1
- }), this.props.enableUserSelectHack && (0, r.removeUserSelectStyles)(g);
- }
- }
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
- // the underlying DOM node ourselves. See the README for more information.
- findDOMNode() {
- var h, g;
- return (h = this.props) !== null && h !== void 0 && h.nodeRef ? (g = this.props) === null || g === void 0 || (g = g.nodeRef) === null || g === void 0 ? void 0 : g.current : n.default.findDOMNode(this);
- }
- render() {
- return /* @__PURE__ */ e.cloneElement(e.Children.only(this.props.children), {
- // Note: mouseMove handler is attached to document so it will still function
- // when the user drags quickly and leaves the bounds of the element.
- onMouseDown: this.onMouseDown,
- onMouseUp: this.onMouseUp,
- // onTouchStart is added on `componentDidMount` so they can be added with
- // {passive: false}, which allows it to cancel. See
- // https://developers.google.com/web/updates/2017/01/scrolling-intervention
- onTouchEnd: this.onTouchEnd
- });
- }
- };
- return oa.default = b, s(b, "displayName", "DraggableCore"), s(b, "propTypes", {
- /**
- * `allowAnyClick` allows dragging using any mouse button.
- * By default, we only accept the left button.
- *
- * Defaults to `false`.
- */
- allowAnyClick: t.default.bool,
- children: t.default.node.isRequired,
- /**
- * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
- * with the exception of `onMouseDown`, will not fire.
- */
- disabled: t.default.bool,
- /**
- * By default, we add 'user-select:none' attributes to the document body
- * to prevent ugly text selection during drag. If this is causing problems
- * for your app, set this to `false`.
- */
- enableUserSelectHack: t.default.bool,
- /**
- * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
- * instead of using the parent node.
- */
- offsetParent: function(f, h) {
- if (f[h] && f[h].nodeType !== 1)
- throw new Error("Draggable's offsetParent must be a DOM Node.");
- },
- /**
- * `grid` specifies the x and y that dragging should snap to.
- */
- grid: t.default.arrayOf(t.default.number),
- /**
- * `handle` specifies a selector to be used as the handle that initiates drag.
- *
- * Example:
- *
- * ```jsx
- * let App = React.createClass({
- * render: function () {
- * return (
- * <Draggable handle=".handle">
- * <div>
- * <div className="handle">Click me to drag</div>
- * <div>This is some other content</div>
- * </div>
- * </Draggable>
- * );
- * }
- * });
- * ```
- */
- handle: t.default.string,
- /**
- * `cancel` specifies a selector to be used to prevent drag initialization.
- *
- * Example:
- *
- * ```jsx
- * let App = React.createClass({
- * render: function () {
- * return(
- * <Draggable cancel=".cancel">
- * <div>
- * <div className="cancel">You can't drag from here</div>
- * <div>Dragging here works fine</div>
- * </div>
- * </Draggable>
- * );
- * }
- * });
- * ```
- */
- cancel: t.default.string,
- /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
- * Unfortunately, in order for <Draggable> to work properly, we need raw access
- * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
- * as in this example:
- *
- * function MyComponent() {
- * const nodeRef = React.useRef(null);
- * return (
- * <Draggable nodeRef={nodeRef}>
- * <div ref={nodeRef}>Example Target</div>
- * </Draggable>
- * );
- * }
- *
- * This can be used for arbitrarily nested components, so long as the ref ends up
- * pointing to the actual child DOM node and not a custom component.
- */
- nodeRef: t.default.object,
- /**
- * Called when dragging starts.
- * If this function returns the boolean false, dragging will be canceled.
- */
- onStart: t.default.func,
- /**
- * Called while dragging.
- * If this function returns the boolean false, dragging will be canceled.
- */
- onDrag: t.default.func,
- /**
- * Called when dragging stops.
- * If this function returns the boolean false, the drag will remain active.
- */
- onStop: t.default.func,
- /**
- * A workaround option which can be passed if onMouseDown needs to be accessed,
- * since it'll always be blocked (as there is internal use of onMouseDown)
- */
- onMouseDown: t.default.func,
- /**
- * `scale`, if set, applies scaling while dragging an element
- */
- scale: t.default.number,
- /**
- * These properties should be defined on the child, not here.
- */
- className: o.dontSetMe,
- style: o.dontSetMe,
- transform: o.dontSetMe
- }), s(b, "defaultProps", {
- allowAnyClick: !1,
- // by default only accept left click
- disabled: !1,
- enableUserSelectHack: !0,
- onStart: function() {
- },
- onDrag: function() {
- },
- onStop: function() {
- },
- onMouseDown: function() {
- },
- scale: 1
- }), oa;
- }
- var Ul;
- function Ph() {
- return Ul || (Ul = 1, function(e) {
- Object.defineProperty(e, "__esModule", {
- value: !0
- }), Object.defineProperty(e, "DraggableCore", {
- enumerable: !0,
- get: function() {
- return l.default;
- }
- }), e.default = void 0;
- var t = C(me), n = s(/* @__PURE__ */ sr()), r = s(nr), a = s(xh), o = Pu(), i = Rd(), u = Ho(), l = s(Rh()), c = s(Pd());
- function s(g) {
- return g && g.__esModule ? g : { default: g };
- }
- function v(g) {
- if (typeof WeakMap != "function") return null;
- var y = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap();
- return (v = function(E) {
- return E ? w : y;
- })(g);
- }
- function C(g, y) {
- if (g && g.__esModule)
- return g;
- if (g === null || typeof g != "object" && typeof g != "function")
- return { default: g };
- var w = v(y);
- if (w && w.has(g))
- return w.get(g);
- var E = {}, S = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var x in g)
- if (x !== "default" && Object.prototype.hasOwnProperty.call(g, x)) {
- var R = S ? Object.getOwnPropertyDescriptor(g, x) : null;
- R && (R.get || R.set) ? Object.defineProperty(E, x, R) : E[x] = g[x];
- }
- return E.default = g, w && w.set(g, E), E;
- }
- function p() {
- return p = Object.assign ? Object.assign.bind() : function(g) {
- for (var y = 1; y < arguments.length; y++) {
- var w = arguments[y];
- for (var E in w)
- Object.prototype.hasOwnProperty.call(w, E) && (g[E] = w[E]);
- }
- return g;
- }, p.apply(this, arguments);
- }
- function m(g, y, w) {
- return y = b(y), y in g ? Object.defineProperty(g, y, { value: w, enumerable: !0, configurable: !0, writable: !0 }) : g[y] = w, g;
- }
- function b(g) {
- var y = f(g, "string");
- return typeof y == "symbol" ? y : String(y);
- }
- function f(g, y) {
- if (typeof g != "object" || g === null) return g;
- var w = g[Symbol.toPrimitive];
- if (w !== void 0) {
- var E = w.call(g, y || "default");
- if (typeof E != "object") return E;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (y === "string" ? String : Number)(g);
- }
- class h extends t.Component {
- // React 16.3+
- // Arity (props, state)
- static getDerivedStateFromProps(y, w) {
- let {
- position: E
- } = y, {
- prevPropsPosition: S
- } = w;
- return E && (!S || E.x !== S.x || E.y !== S.y) ? ((0, c.default)("Draggable: getDerivedStateFromProps %j", {
- position: E,
- prevPropsPosition: S
- }), {
- x: E.x,
- y: E.y,
- prevPropsPosition: {
- ...E
- }
- }) : null;
- }
- constructor(y) {
- super(y), m(this, "onDragStart", (w, E) => {
- if ((0, c.default)("Draggable: onDragStart: %j", E), this.props.onStart(w, (0, i.createDraggableData)(this, E)) === !1) return !1;
- this.setState({
- dragging: !0,
- dragged: !0
- });
- }), m(this, "onDrag", (w, E) => {
- if (!this.state.dragging) return !1;
- (0, c.default)("Draggable: onDrag: %j", E);
- const S = (0, i.createDraggableData)(this, E), x = {
- x: S.x,
- y: S.y,
- slackX: 0,
- slackY: 0
- };
- if (this.props.bounds) {
- const {
- x: k,
- y: L
- } = x;
- x.x += this.state.slackX, x.y += this.state.slackY;
- const [O, N] = (0, i.getBoundPosition)(this, x.x, x.y);
- x.x = O, x.y = N, x.slackX = this.state.slackX + (k - x.x), x.slackY = this.state.slackY + (L - x.y), S.x = x.x, S.y = x.y, S.deltaX = x.x - this.state.x, S.deltaY = x.y - this.state.y;
- }
- if (this.props.onDrag(w, S) === !1) return !1;
- this.setState(x);
- }), m(this, "onDragStop", (w, E) => {
- if (!this.state.dragging || this.props.onStop(w, (0, i.createDraggableData)(this, E)) === !1) return !1;
- (0, c.default)("Draggable: onDragStop: %j", E);
- const x = {
- dragging: !1,
- slackX: 0,
- slackY: 0
- };
- if (!!this.props.position) {
- const {
- x: k,
- y: L
- } = this.props.position;
- x.x = k, x.y = L;
- }
- this.setState(x);
- }), this.state = {
- // Whether or not we are currently dragging.
- dragging: !1,
- // Whether or not we have been dragged before.
- dragged: !1,
- // Current transform x and y.
- x: y.position ? y.position.x : y.defaultPosition.x,
- y: y.position ? y.position.y : y.defaultPosition.y,
- prevPropsPosition: {
- ...y.position
- },
- // Used for compensating for out-of-bounds drags
- slackX: 0,
- slackY: 0,
- // Can only determine if SVG after mounting
- isElementSVG: !1
- }, y.position && !(y.onDrag || y.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
- }
- componentDidMount() {
- typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
- isElementSVG: !0
- });
- }
- componentWillUnmount() {
- this.setState({
- dragging: !1
- });
- }
- // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
- // the underlying DOM node ourselves. See the README for more information.
- findDOMNode() {
- var y, w;
- return (y = (w = this.props) === null || w === void 0 || (w = w.nodeRef) === null || w === void 0 ? void 0 : w.current) !== null && y !== void 0 ? y : r.default.findDOMNode(this);
- }
- render() {
- const {
- axis: y,
- bounds: w,
- children: E,
- defaultPosition: S,
- defaultClassName: x,
- defaultClassNameDragging: R,
- defaultClassNameDragged: k,
- position: L,
- positionOffset: O,
- scale: N,
- ...F
- } = this.props;
- let I = {}, T = null;
- const z = !!!L || this.state.dragging, _ = L || S, A = {
- // Set left if horizontal drag is enabled
- x: (0, i.canDragX)(this) && z ? this.state.x : _.x,
- // Set top if vertical drag is enabled
- y: (0, i.canDragY)(this) && z ? this.state.y : _.y
- };
- this.state.isElementSVG ? T = (0, o.createSVGTransform)(A, O) : I = (0, o.createCSSTransform)(A, O);
- const H = (0, a.default)(E.props.className || "", x, {
- [R]: this.state.dragging,
- [k]: this.state.dragged
- });
- return /* @__PURE__ */ t.createElement(l.default, p({}, F, {
- onStart: this.onDragStart,
- onDrag: this.onDrag,
- onStop: this.onDragStop
- }), /* @__PURE__ */ t.cloneElement(t.Children.only(E), {
- className: H,
- style: {
- ...E.props.style,
- ...I
- },
- transform: T
- }));
- }
- }
- e.default = h, m(h, "displayName", "Draggable"), m(h, "propTypes", {
- // Accepts all props <DraggableCore> accepts.
- ...l.default.propTypes,
- /**
- * `axis` determines which axis the draggable can move.
- *
- * Note that all callbacks will still return data as normal. This only
- * controls flushing to the DOM.
- *
- * 'both' allows movement horizontally and vertically.
- * 'x' limits movement to horizontal axis.
- * 'y' limits movement to vertical axis.
- * 'none' limits all movement.
- *
- * Defaults to 'both'.
- */
- axis: n.default.oneOf(["both", "x", "y", "none"]),
- /**
- * `bounds` determines the range of movement available to the element.
- * Available values are:
- *
- * 'parent' restricts movement within the Draggable's parent node.
- *
- * Alternatively, pass an object with the following properties, all of which are optional:
- *
- * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
- *
- * All values are in px.
- *
- * Example:
- *
- * ```jsx
- * let App = React.createClass({
- * render: function () {
- * return (
- * <Draggable bounds={{right: 300, bottom: 300}}>
- * <div>Content</div>
- * </Draggable>
- * );
- * }
- * });
- * ```
- */
- bounds: n.default.oneOfType([n.default.shape({
- left: n.default.number,
- right: n.default.number,
- top: n.default.number,
- bottom: n.default.number
- }), n.default.string, n.default.oneOf([!1])]),
- defaultClassName: n.default.string,
- defaultClassNameDragging: n.default.string,
- defaultClassNameDragged: n.default.string,
- /**
- * `defaultPosition` specifies the x and y that the dragged item should start at
- *
- * Example:
- *
- * ```jsx
- * let App = React.createClass({
- * render: function () {
- * return (
- * <Draggable defaultPosition={{x: 25, y: 25}}>
- * <div>I start with transformX: 25px and transformY: 25px;</div>
- * </Draggable>
- * );
- * }
- * });
- * ```
- */
- defaultPosition: n.default.shape({
- x: n.default.number,
- y: n.default.number
- }),
- positionOffset: n.default.shape({
- x: n.default.oneOfType([n.default.number, n.default.string]),
- y: n.default.oneOfType([n.default.number, n.default.string])
- }),
- /**
- * `position`, if present, defines the current position of the element.
- *
- * This is similar to how form elements in React work - if no `position` is supplied, the component
- * is uncontrolled.
- *
- * Example:
- *
- * ```jsx
- * let App = React.createClass({
- * render: function () {
- * return (
- * <Draggable position={{x: 25, y: 25}}>
- * <div>I start with transformX: 25px and transformY: 25px;</div>
- * </Draggable>
- * );
- * }
- * });
- * ```
- */
- position: n.default.shape({
- x: n.default.number,
- y: n.default.number
- }),
- /**
- * These properties should be defined on the child, not here.
- */
- className: u.dontSetMe,
- style: u.dontSetMe,
- transform: u.dontSetMe
- }), m(h, "defaultProps", {
- ...l.default.defaultProps,
- axis: "both",
- bounds: !1,
- defaultClassName: "react-draggable",
- defaultClassNameDragging: "react-draggable-dragging",
- defaultClassNameDragged: "react-draggable-dragged",
- defaultPosition: {
- x: 0,
- y: 0
- },
- scale: 1
- });
- }(fi)), fi;
- }
- var ql;
- function Vo() {
- if (ql) return aa.exports;
- ql = 1;
- const {
- default: e,
- DraggableCore: t
- } = Ph();
- return aa.exports = e, aa.exports.default = e, aa.exports.DraggableCore = t, aa.exports;
- }
- var Mh = Vo();
- const kh = /* @__PURE__ */ Aa(Mh), Dh = "univer-dialog", Nh = "univer-dialog-wrap", Ih = "univer-dialog-title", Oh = "univer-dialog-title-content", _h = "univer-dialog-content", Lh = "univer-dialog-close", Th = "univer-dialog-header", $h = "univer-dialog-body", Ah = "univer-dialog-footer", jh = "univer-dialog-zoom-enter", Fh = "univer-dialog-zoom-appear", zh = "univer-dialog-zoom-leave", Hh = "univer-dialog-zoom-enter-active", Vh = "univer-dialog-zoom-appear-active", Wh = "univer-dialog-zoom-in", Bh = "univer-dialog-zoom-leave-active", Uh = "univer-dialog-zoom-out", qh = "univer-dialog-mask", Kh = "univer-dialog-mask-hidden", Yh = "univer-dialog-fade-enter", Gh = "univer-dialog-fade-appear", Xh = "univer-dialog-fade-leave", Zh = "univer-dialog-fade-enter-active", Qh = "univer-dialog-fade-appear-active", Jh = "univer-dialog-fade-in", eg = "univer-dialog-fade-leave-active", tg = "univer-dialog-fade-out", ng = "univer-dialog-root-draggable", ia = {
- dialog: Dh,
- dialogWrap: Nh,
- dialogTitle: Ih,
- dialogTitleContent: Oh,
- dialogContent: _h,
- dialogClose: Lh,
- dialogHeader: Th,
- dialogBody: $h,
- dialogFooter: Ah,
- dialogZoomEnter: jh,
- dialogZoomAppear: Fh,
- dialogZoomLeave: zh,
- dialogZoomEnterActive: Hh,
- dialogZoomAppearActive: Vh,
- dialogZoomIn: Wh,
- dialogZoomLeaveActive: Bh,
- dialogZoomOut: Uh,
- dialogMask: qh,
- dialogMaskHidden: Kh,
- dialogFadeEnter: Yh,
- dialogFadeAppear: Gh,
- dialogFadeLeave: Xh,
- dialogFadeEnterActive: Zh,
- dialogFadeAppearActive: Qh,
- dialogFadeIn: Jh,
- dialogFadeLeaveActive: eg,
- dialogFadeOut: tg,
- dialogRootDraggable: ng
- };
- function rg(e) {
- const {
- className: t,
- children: n,
- style: r,
- visible: a = !1,
- title: o,
- width: i,
- draggable: u = !1,
- closeIcon: l = /* @__PURE__ */ q.jsx(gu, {}),
- defaultPosition: c,
- destroyOnClose: s = !1,
- preservePositionOnDestroy: v = !1,
- footer: C,
- onClose: p,
- mask: m,
- dialogStyles: b,
- closable: f,
- maskClosable: h
- } = e, [g, y] = rt(!1), [w, E] = rt(null), { mountContainer: S } = Sn(In), x = u ? /* @__PURE__ */ q.jsx(
- "div",
- {
- className: ia.dialogTitleContent,
- style: {
- width: "100%",
- cursor: "pointer",
- ...b == null ? void 0 : b.header
- },
- onMouseOver: () => {
- g && y(!1);
- },
- onMouseOut: () => {
- y(!0);
- },
- onFocus: () => {
- },
- onBlur: () => {
- },
- children: o
- }
- ) : /* @__PURE__ */ q.jsx("div", { className: ia.dialogTitleContent, children: o }), R = (L) => {
- const [O, N] = rt({ left: 0, top: 0, bottom: 0, right: 0 }), F = Ce(null);
- function I(z, _) {
- v && E({ x: _.x, y: _.y });
- }
- const T = w || c || { x: 0, y: 0 }, P = (z, _) => {
- var U;
- const { clientWidth: A, clientHeight: H } = window.document.documentElement, $ = (U = F.current) == null ? void 0 : U.getBoundingClientRect();
- $ && N({
- left: -$.left + _.x,
- right: A - ($.right - _.x),
- top: -$.top + _.y,
- bottom: H - ($.bottom - _.y)
- });
- };
- return u ? /* @__PURE__ */ q.jsx(
- kh,
- {
- disabled: g,
- defaultPosition: T,
- bounds: O,
- nodeRef: F,
- onStart: (z, _) => P(z, _),
- onStop: I,
- children: /* @__PURE__ */ q.jsx("div", { ref: F, children: L })
- }
- ) : L;
- }, k = m != null ? m : !u;
- return S && /* @__PURE__ */ q.jsx(
- xd,
- {
- className: t,
- width: i,
- prefixCls: ia.dialog,
- rootClassName: k ? ia.dialogRoot : ia.dialogRootDraggable,
- getContainer: () => S,
- visible: a,
- title: x,
- modalRender: R,
- closeIcon: l,
- destroyOnClose: s,
- footer: C,
- mask: k,
- style: r,
- onClose: p,
- styles: b,
- closable: f,
- maskClosable: h,
- children: n
- }
- );
- }
- const ag = "univer-confirm-footer", og = {
- confirmFooter: ag
- };
- function ig(e) {
- const { locale: t, cancelText: n, confirmText: r, onClose: a, onConfirm: o } = e;
- return /* @__PURE__ */ q.jsxs("footer", { className: og.confirmFooter, children: [
- /* @__PURE__ */ q.jsx(Po, { onClick: a, children: n != null ? n : t == null ? void 0 : t.Confirm.cancel }),
- /* @__PURE__ */ q.jsx(Po, { type: "primary", onClick: o, children: r != null ? r : t == null ? void 0 : t.Confirm.confirm })
- ] });
- }
- function jO(e) {
- const { children: t, visible: n = !1, title: r, cancelText: a, confirmText: o, width: i, onClose: u, onConfirm: l } = e, { locale: c } = Sn(In);
- return /* @__PURE__ */ q.jsx(
- rg,
- {
- visible: n,
- title: r,
- footer: /* @__PURE__ */ q.jsx(
- ig,
- {
- locale: c,
- cancelText: a,
- confirmText: o,
- onClose: u,
- onConfirm: l
- }
- ),
- onClose: u,
- width: i,
- children: t
- }
- );
- }
- function _e() {
- return _e = Object.assign ? Object.assign.bind() : function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
- }
- return e;
- }, _e.apply(null, arguments);
- }
- function Wi(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- function ug(e) {
- if (Array.isArray(e)) return Wi(e);
- }
- function Md(e) {
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
- }
- function Mu(e, t) {
- if (e) {
- if (typeof e == "string") return Wi(e, t);
- var n = {}.toString.call(e).slice(8, -1);
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Wi(e, t) : void 0;
- }
- }
- function lg() {
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function ft(e) {
- return ug(e) || Md(e) || Mu(e) || lg();
- }
- function _t(e) {
- "@babel/helpers - typeof";
- return _t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
- return typeof t;
- } : function(t) {
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
- }, _t(e);
- }
- function sg(e, t) {
- if (_t(e) != "object" || !e) return e;
- var n = e[Symbol.toPrimitive];
- if (n !== void 0) {
- var r = n.call(e, t || "default");
- if (_t(r) != "object") return r;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (t === "string" ? String : Number)(e);
- }
- function kd(e) {
- var t = sg(e, "string");
- return _t(t) == "symbol" ? t : t + "";
- }
- function ie(e, t, n) {
- return (t = kd(t)) in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- function Kl(e, t) {
- var n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var r = Object.getOwnPropertySymbols(e);
- t && (r = r.filter(function(a) {
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
- })), n.push.apply(n, r);
- }
- return n;
- }
- function re(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2 ? Kl(Object(n), !0).forEach(function(r) {
- ie(e, r, n[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Kl(Object(n)).forEach(function(r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
- });
- }
- return e;
- }
- function Dd(e) {
- if (Array.isArray(e)) return e;
- }
- function cg(e, t) {
- var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
- if (n != null) {
- var r, a, o, i, u = [], l = !0, c = !1;
- try {
- if (o = (n = n.call(e)).next, t === 0) {
- if (Object(n) !== n) return;
- l = !1;
- } else for (; !(l = (r = o.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) ;
- } catch (s) {
- c = !0, a = s;
- } finally {
- try {
- if (!l && n.return != null && (i = n.return(), Object(i) !== i)) return;
- } finally {
- if (c) throw a;
- }
- }
- return u;
- }
- }
- function Nd() {
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function Z(e, t) {
- return Dd(e) || cg(e, t) || Mu(e, t) || Nd();
- }
- function Er(e, t) {
- var n = Object.assign({}, e);
- return Array.isArray(t) && t.forEach(function(r) {
- delete n[r];
- }), n;
- }
- function ku(e, t) {
- if (e == null) return {};
- var n = {};
- for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
- if (t.includes(r)) continue;
- n[r] = e[r];
- }
- return n;
- }
- function mt(e, t) {
- if (e == null) return {};
- var n, r, a = ku(e, t);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- for (r = 0; r < o.length; r++) n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- }
- return a;
- }
- function ko() {
- return ko = Object.assign ? Object.assign.bind() : function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
- }
- return e;
- }, ko.apply(null, arguments);
- }
- function Oa(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = [];
- return me.Children.forEach(e, function(r) {
- r == null && !t.keepEmpty || (Array.isArray(r) ? n = n.concat(Oa(r)) : Ma.isFragment(r) && r.props ? n = n.concat(Oa(r.props.children, t)) : n.push(r));
- }), n;
- }
- var Bi = /* @__PURE__ */ d.createContext(null);
- function dg(e) {
- var t = e.children, n = e.onBatchResize, r = d.useRef(0), a = d.useRef([]), o = d.useContext(Bi), i = d.useCallback(function(u, l, c) {
- r.current += 1;
- var s = r.current;
- a.current.push({
- size: u,
- element: l,
- data: c
- }), Promise.resolve().then(function() {
- s === r.current && (n == null || n(a.current), a.current = []);
- }), o == null || o(u, l, c);
- }, [n, o]);
- return /* @__PURE__ */ d.createElement(Bi.Provider, {
- value: i
- }, t);
- }
- var Id = function() {
- if (typeof Map < "u")
- return Map;
- function e(t, n) {
- var r = -1;
- return t.some(function(a, o) {
- return a[0] === n ? (r = o, !0) : !1;
- }), r;
- }
- return (
- /** @class */
- function() {
- function t() {
- this.__entries__ = [];
- }
- return Object.defineProperty(t.prototype, "size", {
- /**
- * @returns {boolean}
- */
- get: function() {
- return this.__entries__.length;
- },
- enumerable: !0,
- configurable: !0
- }), t.prototype.get = function(n) {
- var r = e(this.__entries__, n), a = this.__entries__[r];
- return a && a[1];
- }, t.prototype.set = function(n, r) {
- var a = e(this.__entries__, n);
- ~a ? this.__entries__[a][1] = r : this.__entries__.push([n, r]);
- }, t.prototype.delete = function(n) {
- var r = this.__entries__, a = e(r, n);
- ~a && r.splice(a, 1);
- }, t.prototype.has = function(n) {
- return !!~e(this.__entries__, n);
- }, t.prototype.clear = function() {
- this.__entries__.splice(0);
- }, t.prototype.forEach = function(n, r) {
- r === void 0 && (r = null);
- for (var a = 0, o = this.__entries__; a < o.length; a++) {
- var i = o[a];
- n.call(r, i[1], i[0]);
- }
- }, t;
- }()
- );
- }(), Ui = typeof window < "u" && typeof document < "u" && window.document === document, Do = function() {
- return typeof global < "u" && global.Math === Math ? global : typeof self < "u" && self.Math === Math ? self : typeof window < "u" && window.Math === Math ? window : Function("return this")();
- }(), fg = function() {
- return typeof requestAnimationFrame == "function" ? requestAnimationFrame.bind(Do) : function(e) {
- return setTimeout(function() {
- return e(Date.now());
- }, 1e3 / 60);
- };
- }(), vg = 2;
- function mg(e, t) {
- var n = !1, r = !1, a = 0;
- function o() {
- n && (n = !1, e()), r && u();
- }
- function i() {
- fg(o);
- }
- function u() {
- var l = Date.now();
- if (n) {
- if (l - a < vg)
- return;
- r = !0;
- } else
- n = !0, r = !1, setTimeout(i, t);
- a = l;
- }
- return u;
- }
- var pg = 20, hg = ["top", "right", "bottom", "left", "width", "height", "size", "weight"], gg = typeof MutationObserver < "u", yg = (
- /** @class */
- function() {
- function e() {
- this.connected_ = !1, this.mutationEventsAdded_ = !1, this.mutationsObserver_ = null, this.observers_ = [], this.onTransitionEnd_ = this.onTransitionEnd_.bind(this), this.refresh = mg(this.refresh.bind(this), pg);
- }
- return e.prototype.addObserver = function(t) {
- ~this.observers_.indexOf(t) || this.observers_.push(t), this.connected_ || this.connect_();
- }, e.prototype.removeObserver = function(t) {
- var n = this.observers_, r = n.indexOf(t);
- ~r && n.splice(r, 1), !n.length && this.connected_ && this.disconnect_();
- }, e.prototype.refresh = function() {
- var t = this.updateObservers_();
- t && this.refresh();
- }, e.prototype.updateObservers_ = function() {
- var t = this.observers_.filter(function(n) {
- return n.gatherActive(), n.hasActive();
- });
- return t.forEach(function(n) {
- return n.broadcastActive();
- }), t.length > 0;
- }, e.prototype.connect_ = function() {
- !Ui || this.connected_ || (document.addEventListener("transitionend", this.onTransitionEnd_), window.addEventListener("resize", this.refresh), gg ? (this.mutationsObserver_ = new MutationObserver(this.refresh), this.mutationsObserver_.observe(document, {
- attributes: !0,
- childList: !0,
- characterData: !0,
- subtree: !0
- })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
- }, e.prototype.disconnect_ = function() {
- !Ui || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
- }, e.prototype.onTransitionEnd_ = function(t) {
- var n = t.propertyName, r = n === void 0 ? "" : n, a = hg.some(function(o) {
- return !!~r.indexOf(o);
- });
- a && this.refresh();
- }, e.getInstance = function() {
- return this.instance_ || (this.instance_ = new e()), this.instance_;
- }, e.instance_ = null, e;
- }()
- ), Od = function(e, t) {
- for (var n = 0, r = Object.keys(t); n < r.length; n++) {
- var a = r[n];
- Object.defineProperty(e, a, {
- value: t[a],
- enumerable: !1,
- writable: !1,
- configurable: !0
- });
- }
- return e;
- }, qr = function(e) {
- var t = e && e.ownerDocument && e.ownerDocument.defaultView;
- return t || Do;
- }, _d = Wo(0, 0, 0, 0);
- function No(e) {
- return parseFloat(e) || 0;
- }
- function Yl(e) {
- for (var t = [], n = 1; n < arguments.length; n++)
- t[n - 1] = arguments[n];
- return t.reduce(function(r, a) {
- var o = e["border-" + a + "-width"];
- return r + No(o);
- }, 0);
- }
- function bg(e) {
- for (var t = ["top", "right", "bottom", "left"], n = {}, r = 0, a = t; r < a.length; r++) {
- var o = a[r], i = e["padding-" + o];
- n[o] = No(i);
- }
- return n;
- }
- function Cg(e) {
- var t = e.getBBox();
- return Wo(0, 0, t.width, t.height);
- }
- function Sg(e) {
- var t = e.clientWidth, n = e.clientHeight;
- if (!t && !n)
- return _d;
- var r = qr(e).getComputedStyle(e), a = bg(r), o = a.left + a.right, i = a.top + a.bottom, u = No(r.width), l = No(r.height);
- if (r.boxSizing === "border-box" && (Math.round(u + o) !== t && (u -= Yl(r, "left", "right") + o), Math.round(l + i) !== n && (l -= Yl(r, "top", "bottom") + i)), !xg(e)) {
- var c = Math.round(u + o) - t, s = Math.round(l + i) - n;
- Math.abs(c) !== 1 && (u -= c), Math.abs(s) !== 1 && (l -= s);
- }
- return Wo(a.left, a.top, u, l);
- }
- var wg = /* @__PURE__ */ function() {
- return typeof SVGGraphicsElement < "u" ? function(e) {
- return e instanceof qr(e).SVGGraphicsElement;
- } : function(e) {
- return e instanceof qr(e).SVGElement && typeof e.getBBox == "function";
- };
- }();
- function xg(e) {
- return e === qr(e).document.documentElement;
- }
- function Eg(e) {
- return Ui ? wg(e) ? Cg(e) : Sg(e) : _d;
- }
- function Rg(e) {
- var t = e.x, n = e.y, r = e.width, a = e.height, o = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, i = Object.create(o.prototype);
- return Od(i, {
- x: t,
- y: n,
- width: r,
- height: a,
- top: n,
- right: t + r,
- bottom: a + n,
- left: t
- }), i;
- }
- function Wo(e, t, n, r) {
- return { x: e, y: t, width: n, height: r };
- }
- var Pg = (
- /** @class */
- function() {
- function e(t) {
- this.broadcastWidth = 0, this.broadcastHeight = 0, this.contentRect_ = Wo(0, 0, 0, 0), this.target = t;
- }
- return e.prototype.isActive = function() {
- var t = Eg(this.target);
- return this.contentRect_ = t, t.width !== this.broadcastWidth || t.height !== this.broadcastHeight;
- }, e.prototype.broadcastRect = function() {
- var t = this.contentRect_;
- return this.broadcastWidth = t.width, this.broadcastHeight = t.height, t;
- }, e;
- }()
- ), Mg = (
- /** @class */
- /* @__PURE__ */ function() {
- function e(t, n) {
- var r = Rg(n);
- Od(this, { target: t, contentRect: r });
- }
- return e;
- }()
- ), kg = (
- /** @class */
- function() {
- function e(t, n, r) {
- if (this.activeObservations_ = [], this.observations_ = new Id(), typeof t != "function")
- throw new TypeError("The callback provided as parameter 1 is not a function.");
- this.callback_ = t, this.controller_ = n, this.callbackCtx_ = r;
- }
- return e.prototype.observe = function(t) {
- if (!arguments.length)
- throw new TypeError("1 argument required, but only 0 present.");
- if (!(typeof Element > "u" || !(Element instanceof Object))) {
- if (!(t instanceof qr(t).Element))
- throw new TypeError('parameter 1 is not of type "Element".');
- var n = this.observations_;
- n.has(t) || (n.set(t, new Pg(t)), this.controller_.addObserver(this), this.controller_.refresh());
- }
- }, e.prototype.unobserve = function(t) {
- if (!arguments.length)
- throw new TypeError("1 argument required, but only 0 present.");
- if (!(typeof Element > "u" || !(Element instanceof Object))) {
- if (!(t instanceof qr(t).Element))
- throw new TypeError('parameter 1 is not of type "Element".');
- var n = this.observations_;
- n.has(t) && (n.delete(t), n.size || this.controller_.removeObserver(this));
- }
- }, e.prototype.disconnect = function() {
- this.clearActive(), this.observations_.clear(), this.controller_.removeObserver(this);
- }, e.prototype.gatherActive = function() {
- var t = this;
- this.clearActive(), this.observations_.forEach(function(n) {
- n.isActive() && t.activeObservations_.push(n);
- });
- }, e.prototype.broadcastActive = function() {
- if (this.hasActive()) {
- var t = this.callbackCtx_, n = this.activeObservations_.map(function(r) {
- return new Mg(r.target, r.broadcastRect());
- });
- this.callback_.call(t, n, t), this.clearActive();
- }
- }, e.prototype.clearActive = function() {
- this.activeObservations_.splice(0);
- }, e.prototype.hasActive = function() {
- return this.activeObservations_.length > 0;
- }, e;
- }()
- ), Ld = typeof WeakMap < "u" ? /* @__PURE__ */ new WeakMap() : new Id(), Td = (
- /** @class */
- /* @__PURE__ */ function() {
- function e(t) {
- if (!(this instanceof e))
- throw new TypeError("Cannot call a class as a function.");
- if (!arguments.length)
- throw new TypeError("1 argument required, but only 0 present.");
- var n = yg.getInstance(), r = new kg(t, n, this);
- Ld.set(this, r);
- }
- return e;
- }()
- );
- [
- "observe",
- "unobserve",
- "disconnect"
- ].forEach(function(e) {
- Td.prototype[e] = function() {
- var t;
- return (t = Ld.get(this))[e].apply(t, arguments);
- };
- });
- var $d = function() {
- return typeof Do.ResizeObserver < "u" ? Do.ResizeObserver : Td;
- }();
- const Dg = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
- __proto__: null,
- default: $d
- }, Symbol.toStringTag, { value: "Module" }));
- var rr = /* @__PURE__ */ new Map();
- function Ng(e) {
- e.forEach(function(t) {
- var n, r = t.target;
- (n = rr.get(r)) === null || n === void 0 || n.forEach(function(a) {
- return a(r);
- });
- });
- }
- var Ad = new $d(Ng);
- function Ig(e, t) {
- rr.has(e) || (rr.set(e, /* @__PURE__ */ new Set()), Ad.observe(e)), rr.get(e).add(t);
- }
- function Og(e, t) {
- rr.has(e) && (rr.get(e).delete(t), rr.get(e).size || (Ad.unobserve(e), rr.delete(e)));
- }
- function _g(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
- }
- function Lg(e, t) {
- for (var n = 0; n < t.length; n++) {
- var r = t[n];
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, Gc(r.key), r);
- }
- }
- function Tg(e, t, n) {
- return Lg(e.prototype, t), Object.defineProperty(e, "prototype", {
- writable: !1
- }), e;
- }
- function qi(e, t) {
- return qi = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
- return n.__proto__ = r, n;
- }, qi(e, t);
- }
- function $g(e, t) {
- if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }), Object.defineProperty(e, "prototype", {
- writable: !1
- }), t && qi(e, t);
- }
- function Io(e) {
- return Io = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
- return t.__proto__ || Object.getPrototypeOf(t);
- }, Io(e);
- }
- function jd() {
- try {
- var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
- }));
- } catch {
- }
- return (jd = function() {
- return !!e;
- })();
- }
- function Ag(e) {
- if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e;
- }
- function jg(e, t) {
- if (t && (Dn(t) == "object" || typeof t == "function")) return t;
- if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
- return Ag(e);
- }
- function Fg(e) {
- var t = jd();
- return function() {
- var n, r = Io(e);
- if (t) {
- var a = Io(this).constructor;
- n = Reflect.construct(r, arguments, a);
- } else n = r.apply(this, arguments);
- return jg(this, n);
- };
- }
- var zg = /* @__PURE__ */ function(e) {
- $g(n, e);
- var t = Fg(n);
- function n() {
- return _g(this, n), t.apply(this, arguments);
- }
- return Tg(n, [{
- key: "render",
- value: function() {
- return this.props.children;
- }
- }]), n;
- }(d.Component);
- function Hg(e, t) {
- var n = e.children, r = e.disabled, a = d.useRef(null), o = d.useRef(null), i = d.useContext(Bi), u = typeof n == "function", l = u ? n(a) : n, c = d.useRef({
- width: -1,
- height: -1,
- offsetWidth: -1,
- offsetHeight: -1
- }), s = !u && /* @__PURE__ */ d.isValidElement(l) && xr(l), v = s ? l.ref : null, C = Gr(v, a), p = function() {
- var h;
- return Br(a.current) || // Support `nativeElement` format
- (a.current && Dn(a.current) === "object" ? Br((h = a.current) === null || h === void 0 ? void 0 : h.nativeElement) : null) || Br(o.current);
- };
- d.useImperativeHandle(t, function() {
- return p();
- });
- var m = d.useRef(e);
- m.current = e;
- var b = d.useCallback(function(f) {
- var h = m.current, g = h.onResize, y = h.data, w = f.getBoundingClientRect(), E = w.width, S = w.height, x = f.offsetWidth, R = f.offsetHeight, k = Math.floor(E), L = Math.floor(S);
- if (c.current.width !== k || c.current.height !== L || c.current.offsetWidth !== x || c.current.offsetHeight !== R) {
- var O = {
- width: k,
- height: L,
- offsetWidth: x,
- offsetHeight: R
- };
- c.current = O;
- var N = x === Math.round(E) ? E : x, F = R === Math.round(S) ? S : R, I = Ur(Ur({}, O), {}, {
- offsetWidth: N,
- offsetHeight: F
- });
- i == null || i(I, f, y), g && Promise.resolve().then(function() {
- g(I, f);
- });
- }
- }, []);
- return d.useEffect(function() {
- var f = p();
- return f && !r && Ig(f, b), function() {
- return Og(f, b);
- };
- }, [a.current, r]), /* @__PURE__ */ d.createElement(zg, {
- ref: o
- }, s ? /* @__PURE__ */ d.cloneElement(l, {
- ref: C
- }) : l);
- }
- var Vg = /* @__PURE__ */ d.forwardRef(Hg), Wg = "rc-observer-key";
- function Bg(e, t) {
- var n = e.children, r = typeof n == "function" ? [n] : Oa(n);
- return r.map(function(a, o) {
- var i = (a == null ? void 0 : a.key) || "".concat(Wg, "-").concat(o);
- return /* @__PURE__ */ d.createElement(Vg, ko({}, e, {
- key: i,
- ref: o === 0 ? t : void 0
- }), a);
- });
- }
- var cr = /* @__PURE__ */ d.forwardRef(Bg);
- cr.Collection = dg;
- function Fd(e) {
- var t;
- return e == null || (t = e.getRootNode) === null || t === void 0 ? void 0 : t.call(e);
- }
- function Ug(e) {
- return Fd(e) instanceof ShadowRoot;
- }
- function Ki(e) {
- return Ug(e) ? Fd(e) : null;
- }
- const Du = function() {
- if (typeof navigator > "u" || typeof window > "u")
- return !1;
- var e = navigator.userAgent || navigator.vendor || window.opera;
- return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(e == null ? void 0 : e.substr(0, 4));
- };
- var qg = /* @__PURE__ */ d.createContext({});
- function Rr(e, t) {
- if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
- }
- function Gl(e, t) {
- for (var n = 0; n < t.length; n++) {
- var r = t[n];
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, kd(r.key), r);
- }
- }
- function Pr(e, t, n) {
- return t && Gl(e.prototype, t), n && Gl(e, n), Object.defineProperty(e, "prototype", {
- writable: !1
- }), e;
- }
- function Oo(e, t) {
- return Oo = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, r) {
- return n.__proto__ = r, n;
- }, Oo(e, t);
- }
- function Nu(e, t) {
- if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }), Object.defineProperty(e, "prototype", {
- writable: !1
- }), t && Oo(e, t);
- }
- function _o(e) {
- return _o = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
- return t.__proto__ || Object.getPrototypeOf(t);
- }, _o(e);
- }
- function zd() {
- try {
- var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
- }));
- } catch {
- }
- return (zd = function() {
- return !!e;
- })();
- }
- function Yi(e) {
- if (e === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e;
- }
- function Kg(e, t) {
- if (t && (_t(t) == "object" || typeof t == "function")) return t;
- if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
- return Yi(e);
- }
- function Iu(e) {
- var t = zd();
- return function() {
- var n, r = _o(e);
- if (t) {
- var a = _o(this).constructor;
- n = Reflect.construct(r, arguments, a);
- } else n = r.apply(this, arguments);
- return Kg(this, n);
- };
- }
- var Yg = /* @__PURE__ */ function(e) {
- Nu(n, e);
- var t = Iu(n);
- function n() {
- return Rr(this, n), t.apply(this, arguments);
- }
- return Pr(n, [{
- key: "render",
- value: function() {
- return this.props.children;
- }
- }]), n;
- }(d.Component), er = "none", Ja = "appear", eo = "enter", to = "leave", Xl = "none", Mn = "prepare", zr = "start", Hr = "active", Ou = "end", Hd = "prepared";
- function Zl(e, t) {
- var n = {};
- return n[e.toLowerCase()] = t.toLowerCase(), n["Webkit".concat(e)] = "webkit".concat(t), n["Moz".concat(e)] = "moz".concat(t), n["ms".concat(e)] = "MS".concat(t), n["O".concat(e)] = "o".concat(t.toLowerCase()), n;
- }
- function Gg(e, t) {
- var n = {
- animationend: Zl("Animation", "AnimationEnd"),
- transitionend: Zl("Transition", "TransitionEnd")
- };
- return e && ("AnimationEvent" in t || delete n.animationend.animation, "TransitionEvent" in t || delete n.transitionend.transition), n;
- }
- var Xg = Gg(dn(), typeof window < "u" ? window : {}), Vd = {};
- if (dn()) {
- var Zg = document.createElement("div");
- Vd = Zg.style;
- }
- var no = {};
- function Wd(e) {
- if (no[e])
- return no[e];
- var t = Xg[e];
- if (t)
- for (var n = Object.keys(t), r = n.length, a = 0; a < r; a += 1) {
- var o = n[a];
- if (Object.prototype.hasOwnProperty.call(t, o) && o in Vd)
- return no[e] = t[o], no[e];
- }
- return "";
- }
- var Bd = Wd("animationend"), Ud = Wd("transitionend"), qd = !!(Bd && Ud), Ql = Bd || "animationend", Jl = Ud || "transitionend";
- function es(e, t) {
- if (!e) return null;
- if (_t(e) === "object") {
- var n = t.replace(/-\w/g, function(r) {
- return r[1].toUpperCase();
- });
- return e[n];
- }
- return "".concat(e, "-").concat(t);
- }
- const Qg = function(e) {
- var t = Ce();
- function n(a) {
- a && (a.removeEventListener(Jl, e), a.removeEventListener(Ql, e));
- }
- function r(a) {
- t.current && t.current !== a && n(t.current), a && a !== t.current && (a.addEventListener(Jl, e), a.addEventListener(Ql, e), t.current = a);
- }
- return d.useEffect(function() {
- return function() {
- n(t.current);
- };
- }, []), [r, n];
- };
- var Kd = dn() ? gc : lt;
- const Jg = function() {
- var e = d.useRef(null);
- function t() {
- st.cancel(e.current);
- }
- function n(r) {
- var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 2;
- t();
- var o = st(function() {
- a <= 1 ? r({
- isCanceled: function() {
- return o !== e.current;
- }
- }) : n(r, a - 1);
- });
- e.current = o;
- }
- return d.useEffect(function() {
- return function() {
- t();
- };
- }, []), [n, t];
- };
- var e0 = [Mn, zr, Hr, Ou], t0 = [Mn, Hd], Yd = !1, n0 = !0;
- function Gd(e) {
- return e === Hr || e === Ou;
- }
- const r0 = function(e, t, n) {
- var r = ir(Xl), a = Z(r, 2), o = a[0], i = a[1], u = Jg(), l = Z(u, 2), c = l[0], s = l[1];
- function v() {
- i(Mn, !0);
- }
- var C = t ? t0 : e0;
- return Kd(function() {
- if (o !== Xl && o !== Ou) {
- var p = C.indexOf(o), m = C[p + 1], b = n(o);
- b === Yd ? i(m, !0) : m && c(function(f) {
- function h() {
- f.isCanceled() || i(m, !0);
- }
- b === !0 ? h() : Promise.resolve(b).then(h);
- });
- }
- }, [e, o]), d.useEffect(function() {
- return function() {
- s();
- };
- }, []), [v, o];
- };
- function a0(e, t, n, r) {
- var a = r.motionEnter, o = a === void 0 ? !0 : a, i = r.motionAppear, u = i === void 0 ? !0 : i, l = r.motionLeave, c = l === void 0 ? !0 : l, s = r.motionDeadline, v = r.motionLeaveImmediately, C = r.onAppearPrepare, p = r.onEnterPrepare, m = r.onLeavePrepare, b = r.onAppearStart, f = r.onEnterStart, h = r.onLeaveStart, g = r.onAppearActive, y = r.onEnterActive, w = r.onLeaveActive, E = r.onAppearEnd, S = r.onEnterEnd, x = r.onLeaveEnd, R = r.onVisibleChanged, k = ir(), L = Z(k, 2), O = L[0], N = L[1], F = sd(er), I = Z(F, 2), T = I[0], P = I[1], z = ir(null), _ = Z(z, 2), A = _[0], H = _[1], $ = T(), U = Ce(!1), G = Ce(null);
- function B() {
- return n();
- }
- var ne = Ce(!1);
- function le() {
- P(er), H(null, !0);
- }
- var ee = Ct(function(ue) {
- var se = T();
- if (se !== er) {
- var pe = B();
- if (!(ue && !ue.deadline && ue.target !== pe)) {
- var oe = ne.current, ve;
- se === Ja && oe ? ve = E == null ? void 0 : E(pe, ue) : se === eo && oe ? ve = S == null ? void 0 : S(pe, ue) : se === to && oe && (ve = x == null ? void 0 : x(pe, ue)), oe && ve !== !1 && le();
- }
- }
- }), V = Qg(ee), X = Z(V, 1), J = X[0], M = function(se) {
- switch (se) {
- case Ja:
- return ie(ie(ie({}, Mn, C), zr, b), Hr, g);
- case eo:
- return ie(ie(ie({}, Mn, p), zr, f), Hr, y);
- case to:
- return ie(ie(ie({}, Mn, m), zr, h), Hr, w);
- default:
- return {};
- }
- }, D = d.useMemo(function() {
- return M($);
- }, [$]), j = r0($, !e, function(ue) {
- if (ue === Mn) {
- var se = D[Mn];
- return se ? se(B()) : Yd;
- }
- if (Y in D) {
- var pe;
- H(((pe = D[Y]) === null || pe === void 0 ? void 0 : pe.call(D, B(), null)) || null);
- }
- return Y === Hr && $ !== er && (J(B()), s > 0 && (clearTimeout(G.current), G.current = setTimeout(function() {
- ee({
- deadline: !0
- });
- }, s))), Y === Hd && le(), n0;
- }), W = Z(j, 2), K = W[0], Y = W[1], te = Gd(Y);
- ne.current = te, Kd(function() {
- N(t);
- var ue = U.current;
- U.current = !0;
- var se;
- !ue && t && u && (se = Ja), ue && t && o && (se = eo), (ue && !t && c || !ue && v && !t && c) && (se = to);
- var pe = M(se);
- se && (e || pe[Mn]) ? (P(se), K()) : P(er);
- }, [t]), lt(function() {
- // Cancel appear
- ($ === Ja && !u || // Cancel enter
- $ === eo && !o || // Cancel leave
- $ === to && !c) && P(er);
- }, [u, o, c]), lt(function() {
- return function() {
- U.current = !1, clearTimeout(G.current);
- };
- }, []);
- var Q = d.useRef(!1);
- lt(function() {
- O && (Q.current = !0), O !== void 0 && $ === er && ((Q.current || O) && (R == null || R(O)), Q.current = !0);
- }, [O, $]);
- var ae = A;
- return D[Mn] && Y === zr && (ae = re({
- transition: "none"
- }, ae)), [$, Y, ae, O != null ? O : t];
- }
- function o0(e) {
- var t = e;
- _t(e) === "object" && (t = e.transitionSupport);
- function n(a, o) {
- return !!(a.motionName && t && o !== !1);
- }
- var r = /* @__PURE__ */ d.forwardRef(function(a, o) {
- var i = a.visible, u = i === void 0 ? !0 : i, l = a.removeOnLeave, c = l === void 0 ? !0 : l, s = a.forceRender, v = a.children, C = a.motionName, p = a.leavedClassName, m = a.eventProps, b = d.useContext(qg), f = b.motion, h = n(a, f), g = Ce(), y = Ce();
- function w() {
- try {
- return g.current instanceof HTMLElement ? g.current : Br(y.current);
- } catch {
- return null;
- }
- }
- var E = a0(h, u, w, a), S = Z(E, 4), x = S[0], R = S[1], k = S[2], L = S[3], O = d.useRef(L);
- L && (O.current = !0);
- var N = d.useCallback(function(A) {
- g.current = A, jo(o, A);
- }, [o]), F, I = re(re({}, m), {}, {
- visible: u
- });
- if (!v)
- F = null;
- else if (x === er)
- L ? F = v(re({}, I), N) : !c && O.current && p ? F = v(re(re({}, I), {}, {
- className: p
- }), N) : s || !c && !p ? F = v(re(re({}, I), {}, {
- style: {
- display: "none"
- }
- }), N) : F = null;
- else {
- var T;
- R === Mn ? T = "prepare" : Gd(R) ? T = "active" : R === zr && (T = "start");
- var P = es(C, "".concat(x, "-").concat(T));
- F = v(re(re({}, I), {}, {
- className: xe(es(C, x), ie(ie({}, P, P && T), C, typeof C == "string")),
- style: k
- }), N);
- }
- if (/* @__PURE__ */ d.isValidElement(F) && xr(F)) {
- var z = F, _ = z.ref;
- _ || (F = /* @__PURE__ */ d.cloneElement(F, {
- ref: N
- }));
- }
- return /* @__PURE__ */ d.createElement(Yg, {
- ref: y
- }, F);
- });
- return r.displayName = "CSSMotion", r;
- }
- const Bo = o0(qd);
- var Gi = "add", Xi = "keep", Zi = "remove", hi = "removed";
- function i0(e) {
- var t;
- return e && _t(e) === "object" && "key" in e ? t = e : t = {
- key: e
- }, re(re({}, t), {}, {
- key: String(t.key)
- });
- }
- function Qi() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
- return e.map(i0);
- }
- function u0() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = [], r = 0, a = t.length, o = Qi(e), i = Qi(t);
- o.forEach(function(c) {
- for (var s = !1, v = r; v < a; v += 1) {
- var C = i[v];
- if (C.key === c.key) {
- r < v && (n = n.concat(i.slice(r, v).map(function(p) {
- return re(re({}, p), {}, {
- status: Gi
- });
- })), r = v), n.push(re(re({}, C), {}, {
- status: Xi
- })), r += 1, s = !0;
- break;
- }
- }
- s || n.push(re(re({}, c), {}, {
- status: Zi
- }));
- }), r < a && (n = n.concat(i.slice(r).map(function(c) {
- return re(re({}, c), {}, {
- status: Gi
- });
- })));
- var u = {};
- n.forEach(function(c) {
- var s = c.key;
- u[s] = (u[s] || 0) + 1;
- });
- var l = Object.keys(u).filter(function(c) {
- return u[c] > 1;
- });
- return l.forEach(function(c) {
- n = n.filter(function(s) {
- var v = s.key, C = s.status;
- return v !== c || C !== Zi;
- }), n.forEach(function(s) {
- s.key === c && (s.status = Xi);
- });
- }), n;
- }
- var l0 = ["component", "children", "onVisibleChanged", "onAllRemoved"], s0 = ["status"], c0 = ["eventProps", "visible", "children", "motionName", "motionAppear", "motionEnter", "motionLeave", "motionLeaveImmediately", "motionDeadline", "removeOnLeave", "leavedClassName", "onAppearPrepare", "onAppearStart", "onAppearActive", "onAppearEnd", "onEnterStart", "onEnterActive", "onEnterEnd", "onLeaveStart", "onLeaveActive", "onLeaveEnd"];
- function d0(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bo, n = /* @__PURE__ */ function(r) {
- Nu(o, r);
- var a = Iu(o);
- function o() {
- var i;
- Rr(this, o);
- for (var u = arguments.length, l = new Array(u), c = 0; c < u; c++)
- l[c] = arguments[c];
- return i = a.call.apply(a, [this].concat(l)), ie(Yi(i), "state", {
- keyEntities: []
- }), ie(Yi(i), "removeKey", function(s) {
- i.setState(function(v) {
- var C = v.keyEntities.map(function(p) {
- return p.key !== s ? p : re(re({}, p), {}, {
- status: hi
- });
- });
- return {
- keyEntities: C
- };
- }, function() {
- var v = i.state.keyEntities, C = v.filter(function(p) {
- var m = p.status;
- return m !== hi;
- }).length;
- C === 0 && i.props.onAllRemoved && i.props.onAllRemoved();
- });
- }), i;
- }
- return Pr(o, [{
- key: "render",
- value: function() {
- var u = this, l = this.state.keyEntities, c = this.props, s = c.component, v = c.children, C = c.onVisibleChanged;
- c.onAllRemoved;
- var p = mt(c, l0), m = s || d.Fragment, b = {};
- return c0.forEach(function(f) {
- b[f] = p[f], delete p[f];
- }), delete p.keys, /* @__PURE__ */ d.createElement(m, p, l.map(function(f, h) {
- var g = f.status, y = mt(f, s0), w = g === Gi || g === Xi;
- return /* @__PURE__ */ d.createElement(t, _e({}, b, {
- key: y.key,
- visible: w,
- eventProps: y,
- onVisibleChanged: function(S) {
- C == null || C(S, {
- key: y.key
- }), S || u.removeKey(y.key);
- }
- }), function(E, S) {
- return v(re(re({}, E), {}, {
- index: h
- }), S);
- });
- }));
- }
- }], [{
- key: "getDerivedStateFromProps",
- value: function(u, l) {
- var c = u.keys, s = l.keyEntities, v = Qi(c), C = u0(s, v);
- return {
- keyEntities: C.filter(function(p) {
- var m = s.find(function(b) {
- var f = b.key;
- return p.key === f;
- });
- return !(m && m.status === hi && p.status === Zi);
- })
- };
- }
- }]), o;
- }(d.Component);
- return ie(n, "defaultProps", {
- component: "div"
- }), n;
- }
- d0(qd);
- function f0(e) {
- var t = e.prefixCls, n = e.align, r = e.arrow, a = e.arrowPos, o = r || {}, i = o.className, u = o.content, l = a.x, c = l === void 0 ? 0 : l, s = a.y, v = s === void 0 ? 0 : s, C = d.useRef();
- if (!n || !n.points)
- return null;
- var p = {
- position: "absolute"
- };
- if (n.autoArrow !== !1) {
- var m = n.points[0], b = n.points[1], f = m[0], h = m[1], g = b[0], y = b[1];
- f === g || !["t", "b"].includes(f) ? p.top = v : f === "t" ? p.top = 0 : p.bottom = 0, h === y || !["l", "r"].includes(h) ? p.left = c : h === "l" ? p.left = 0 : p.right = 0;
- }
- return /* @__PURE__ */ d.createElement("div", {
- ref: C,
- className: xe("".concat(t, "-arrow"), i),
- style: p
- }, u);
- }
- function v0(e) {
- var t = e.prefixCls, n = e.open, r = e.zIndex, a = e.mask, o = e.motion;
- return a ? /* @__PURE__ */ d.createElement(Bo, _e({}, o, {
- motionAppear: !0,
- visible: n,
- removeOnLeave: !0
- }), function(i) {
- var u = i.className;
- return /* @__PURE__ */ d.createElement("div", {
- style: {
- zIndex: r
- },
- className: xe("".concat(t, "-mask"), u)
- });
- }) : null;
- }
- var m0 = /* @__PURE__ */ d.memo(function(e) {
- var t = e.children;
- return t;
- }, function(e, t) {
- return t.cache;
- }), p0 = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.popup, r = e.className, a = e.prefixCls, o = e.style, i = e.target, u = e.onVisibleChanged, l = e.open, c = e.keepDom, s = e.fresh, v = e.onClick, C = e.mask, p = e.arrow, m = e.arrowPos, b = e.align, f = e.motion, h = e.maskMotion, g = e.forceRender, y = e.getPopupContainer, w = e.autoDestroy, E = e.portal, S = e.zIndex, x = e.onMouseEnter, R = e.onMouseLeave, k = e.onPointerEnter, L = e.onPointerDownCapture, O = e.ready, N = e.offsetX, F = e.offsetY, I = e.offsetR, T = e.offsetB, P = e.onAlign, z = e.onPrepare, _ = e.stretch, A = e.targetWidth, H = e.targetHeight, $ = typeof n == "function" ? n() : n, U = l || c, G = (y == null ? void 0 : y.length) > 0, B = d.useState(!y || !G), ne = Z(B, 2), le = ne[0], ee = ne[1];
- if (St(function() {
- !le && G && i && ee(!0);
- }, [le, G, i]), !le)
- return null;
- var V = "auto", X = {
- left: "-1000vw",
- top: "-1000vh",
- right: V,
- bottom: V
- };
- if (O || !l) {
- var J, M = b.points, D = b.dynamicInset || ((J = b._experimental) === null || J === void 0 ? void 0 : J.dynamicInset), j = D && M[0][1] === "r", W = D && M[0][0] === "b";
- j ? (X.right = I, X.left = V) : (X.left = N, X.right = V), W ? (X.bottom = T, X.top = V) : (X.top = F, X.bottom = V);
- }
- var K = {};
- return _ && (_.includes("height") && H ? K.height = H : _.includes("minHeight") && H && (K.minHeight = H), _.includes("width") && A ? K.width = A : _.includes("minWidth") && A && (K.minWidth = A)), l || (K.pointerEvents = "none"), /* @__PURE__ */ d.createElement(E, {
- open: g || U,
- getContainer: y && function() {
- return y(i);
- },
- autoDestroy: w
- }, /* @__PURE__ */ d.createElement(v0, {
- prefixCls: a,
- open: l,
- zIndex: S,
- mask: C,
- motion: h
- }), /* @__PURE__ */ d.createElement(cr, {
- onResize: P,
- disabled: !l
- }, function(Y) {
- return /* @__PURE__ */ d.createElement(Bo, _e({
- motionAppear: !0,
- motionEnter: !0,
- motionLeave: !0,
- removeOnLeave: !1,
- forceRender: g,
- leavedClassName: "".concat(a, "-hidden")
- }, f, {
- onAppearPrepare: z,
- onEnterPrepare: z,
- visible: l,
- onVisibleChanged: function(Q) {
- var ae;
- f == null || (ae = f.onVisibleChanged) === null || ae === void 0 || ae.call(f, Q), u(Q);
- }
- }), function(te, Q) {
- var ae = te.className, ue = te.style, se = xe(a, ae, r);
- return /* @__PURE__ */ d.createElement("div", {
- ref: lr(Y, t, Q),
- className: se,
- style: re(re(re(re({
- "--arrow-x": "".concat(m.x || 0, "px"),
- "--arrow-y": "".concat(m.y || 0, "px")
- }, X), K), ue), {}, {
- boxSizing: "border-box",
- zIndex: S
- }, o),
- onMouseEnter: x,
- onMouseLeave: R,
- onPointerEnter: k,
- onClick: v,
- onPointerDownCapture: L
- }, p && /* @__PURE__ */ d.createElement(f0, {
- prefixCls: a,
- arrow: p,
- arrowPos: m,
- align: b
- }), /* @__PURE__ */ d.createElement(m0, {
- cache: !l && !s
- }, $));
- });
- }));
- }), h0 = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.children, r = e.getTriggerDOMNode, a = xr(n), o = d.useCallback(function(u) {
- jo(t, r ? r(u) : u);
- }, [r]), i = Gr(o, n.ref);
- return a ? /* @__PURE__ */ d.cloneElement(n, {
- ref: i
- }) : n;
- }), ts = /* @__PURE__ */ d.createContext(null);
- function ns(e) {
- return e ? Array.isArray(e) ? e : [e] : [];
- }
- function g0(e, t, n, r) {
- return d.useMemo(function() {
- var a = ns(n != null ? n : t), o = ns(r != null ? r : t), i = new Set(a), u = new Set(o);
- return e && (i.has("hover") && (i.delete("hover"), i.add("click")), u.has("hover") && (u.delete("hover"), u.add("click"))), [i, u];
- }, [e, t, n, r]);
- }
- const _u = function(e) {
- if (!e)
- return !1;
- if (e instanceof Element) {
- if (e.offsetParent)
- return !0;
- if (e.getBBox) {
- var t = e.getBBox(), n = t.width, r = t.height;
- if (n || r)
- return !0;
- }
- if (e.getBoundingClientRect) {
- var a = e.getBoundingClientRect(), o = a.width, i = a.height;
- if (o || i)
- return !0;
- }
- }
- return !1;
- };
- function y0() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = arguments.length > 2 ? arguments[2] : void 0;
- return n ? e[0] === t[0] : e[0] === t[0] && e[1] === t[1];
- }
- function b0(e, t, n, r) {
- for (var a = n.points, o = Object.keys(e), i = 0; i < o.length; i += 1) {
- var u, l = o[i];
- if (y0((u = e[l]) === null || u === void 0 ? void 0 : u.points, a, r))
- return "".concat(t, "-placement-").concat(l);
- }
- return "";
- }
- function rs(e, t, n, r) {
- return t || (n ? {
- motionName: "".concat(e, "-").concat(n)
- } : r ? {
- motionName: r
- } : null);
- }
- function ja(e) {
- return e.ownerDocument.defaultView;
- }
- function Ji(e) {
- for (var t = [], n = e == null ? void 0 : e.parentElement, r = ["hidden", "scroll", "clip", "auto"]; n; ) {
- var a = ja(n).getComputedStyle(n), o = a.overflowX, i = a.overflowY, u = a.overflow;
- [o, i, u].some(function(l) {
- return r.includes(l);
- }) && t.push(n), n = n.parentElement;
- }
- return t;
- }
- function _a(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1;
- return Number.isNaN(e) ? t : e;
- }
- function ua(e) {
- return _a(parseFloat(e), 0);
- }
- function as(e, t) {
- var n = re({}, e);
- return (t || []).forEach(function(r) {
- if (!(r instanceof HTMLBodyElement || r instanceof HTMLHtmlElement)) {
- var a = ja(r).getComputedStyle(r), o = a.overflow, i = a.overflowClipMargin, u = a.borderTopWidth, l = a.borderBottomWidth, c = a.borderLeftWidth, s = a.borderRightWidth, v = r.getBoundingClientRect(), C = r.offsetHeight, p = r.clientHeight, m = r.offsetWidth, b = r.clientWidth, f = ua(u), h = ua(l), g = ua(c), y = ua(s), w = _a(Math.round(v.width / m * 1e3) / 1e3), E = _a(Math.round(v.height / C * 1e3) / 1e3), S = (m - b - g - y) * w, x = (C - p - f - h) * E, R = f * E, k = h * E, L = g * w, O = y * w, N = 0, F = 0;
- if (o === "clip") {
- var I = ua(i);
- N = I * w, F = I * E;
- }
- var T = v.x + L - N, P = v.y + R - F, z = T + v.width + 2 * N - L - O - S, _ = P + v.height + 2 * F - R - k - x;
- n.left = Math.max(n.left, T), n.top = Math.max(n.top, P), n.right = Math.min(n.right, z), n.bottom = Math.min(n.bottom, _);
- }
- }), n;
- }
- function os(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = "".concat(t), r = n.match(/^(.*)\%$/);
- return r ? e * (parseFloat(r[1]) / 100) : parseFloat(n);
- }
- function is(e, t) {
- var n = t || [], r = Z(n, 2), a = r[0], o = r[1];
- return [os(e.width, a), os(e.height, o)];
- }
- function us() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
- return [e[0], e[1]];
- }
- function Ir(e, t) {
- var n = t[0], r = t[1], a, o;
- return n === "t" ? o = e.y : n === "b" ? o = e.y + e.height : o = e.y + e.height / 2, r === "l" ? a = e.x : r === "r" ? a = e.x + e.width : a = e.x + e.width / 2, {
- x: a,
- y: o
- };
- }
- function Xn(e, t) {
- var n = {
- t: "b",
- b: "t",
- l: "r",
- r: "l"
- };
- return e.map(function(r, a) {
- return a === t ? n[r] || "c" : r;
- }).join("");
- }
- function C0(e, t, n, r, a, o, i) {
- var u = d.useState({
- ready: !1,
- offsetX: 0,
- offsetY: 0,
- offsetR: 0,
- offsetB: 0,
- arrowX: 0,
- arrowY: 0,
- scaleX: 1,
- scaleY: 1,
- align: a[r] || {}
- }), l = Z(u, 2), c = l[0], s = l[1], v = d.useRef(0), C = d.useMemo(function() {
- return t ? Ji(t) : [];
- }, [t]), p = d.useRef({}), m = function() {
- p.current = {};
- };
- e || m();
- var b = Ct(function() {
- if (t && n && e) {
- let bn = function(kr, Wn) {
- var Bn = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ve, ea = B.x + kr, Wa = B.y + Wn, ni = ea + j, ri = Wa + D, ai = Math.max(ea, Bn.left), Ae = Math.max(Wa, Bn.top), Qe = Math.min(ni, Bn.right), kt = Math.min(ri, Bn.bottom);
- return Math.max(0, (Qe - ai) * (kt - Ae));
- }, Va = function() {
- xt = B.y + ye, Ft = xt + D, Mt = B.x + we, Qt = Mt + j;
- };
- var g, y, w, E, S = t, x = S.ownerDocument, R = ja(S), k = R.getComputedStyle(S), L = k.width, O = k.height, N = k.position, F = S.style.left, I = S.style.top, T = S.style.right, P = S.style.bottom, z = S.style.overflow, _ = re(re({}, a[r]), o), A = x.createElement("div");
- (g = S.parentElement) === null || g === void 0 || g.appendChild(A), A.style.left = "".concat(S.offsetLeft, "px"), A.style.top = "".concat(S.offsetTop, "px"), A.style.position = N, A.style.height = "".concat(S.offsetHeight, "px"), A.style.width = "".concat(S.offsetWidth, "px"), S.style.left = "0", S.style.top = "0", S.style.right = "auto", S.style.bottom = "auto", S.style.overflow = "hidden";
- var H;
- if (Array.isArray(n))
- H = {
- x: n[0],
- y: n[1],
- width: 0,
- height: 0
- };
- else {
- var $, U, G = n.getBoundingClientRect();
- G.x = ($ = G.x) !== null && $ !== void 0 ? $ : G.left, G.y = (U = G.y) !== null && U !== void 0 ? U : G.top, H = {
- x: G.x,
- y: G.y,
- width: G.width,
- height: G.height
- };
- }
- var B = S.getBoundingClientRect();
- B.x = (y = B.x) !== null && y !== void 0 ? y : B.left, B.y = (w = B.y) !== null && w !== void 0 ? w : B.top;
- var ne = x.documentElement, le = ne.clientWidth, ee = ne.clientHeight, V = ne.scrollWidth, X = ne.scrollHeight, J = ne.scrollTop, M = ne.scrollLeft, D = B.height, j = B.width, W = H.height, K = H.width, Y = {
- left: 0,
- top: 0,
- right: le,
- bottom: ee
- }, te = {
- left: -M,
- top: -J,
- right: V - M,
- bottom: X - J
- }, Q = _.htmlRegion, ae = "visible", ue = "visibleFirst";
- Q !== "scroll" && Q !== ue && (Q = ae);
- var se = Q === ue, pe = as(te, C), oe = as(Y, C), ve = Q === ae ? oe : pe, ze = se ? oe : ve;
- S.style.left = "auto", S.style.top = "auto", S.style.right = "0", S.style.bottom = "0";
- var Re = S.getBoundingClientRect();
- S.style.left = F, S.style.top = I, S.style.right = T, S.style.bottom = P, S.style.overflow = z, (E = S.parentElement) === null || E === void 0 || E.removeChild(A);
- var Be = _a(Math.round(j / parseFloat(L) * 1e3) / 1e3), je = _a(Math.round(D / parseFloat(O) * 1e3) / 1e3);
- if (Be === 0 || je === 0 || Ia(n) && !_u(n))
- return;
- var He = _.offset, Ye = _.targetOffset, nt = is(B, He), Ge = Z(nt, 2), Ne = Ge[0], ce = Ge[1], he = is(H, Ye), Ve = Z(he, 2), de = Ve[0], be = Ve[1];
- H.x -= de, H.y -= be;
- var Xe = _.points || [], it = Z(Xe, 2), tt = it[0], $e = it[1], ge = us($e), ke = us(tt), Te = Ir(H, ge), Ke = Ir(B, ke), De = re({}, _), we = Te.x - Ke.x + Ne, ye = Te.y - Ke.y + ce, ut = bn(we, ye), yt = bn(we, ye, oe), Ie = Ir(H, ["t", "l"]), Oe = Ir(B, ["t", "l"]), We = Ir(H, ["b", "r"]), Ue = Ir(B, ["b", "r"]), Ze = _.overflow || {}, at = Ze.adjustX, Lt = Ze.adjustY, Et = Ze.shiftX, wt = Ze.shiftY, pt = function(Wn) {
- return typeof Wn == "boolean" ? Wn : Wn >= 0;
- }, xt, Ft, Mt, Qt;
- Va();
- var Le = pt(Lt), Pe = ke[0] === ge[0];
- if (Le && ke[0] === "t" && (Ft > ze.bottom || p.current.bt)) {
- var qe = ye;
- Pe ? qe -= D - W : qe = Ie.y - Ue.y - ce;
- var vt = bn(we, qe), ht = bn(we, qe, oe);
- // Of course use larger one
- vt > ut || vt === ut && (!se || // Choose recommend one
- ht >= yt) ? (p.current.bt = !0, ye = qe, ce = -ce, De.points = [Xn(ke, 0), Xn(ge, 0)]) : p.current.bt = !1;
- }
- if (Le && ke[0] === "b" && (xt < ze.top || p.current.tb)) {
- var Dt = ye;
- Pe ? Dt += D - W : Dt = We.y - Oe.y - ce;
- var Nt = bn(we, Dt), an = bn(we, Dt, oe);
- // Of course use larger one
- Nt > ut || Nt === ut && (!se || // Choose recommend one
- an >= yt) ? (p.current.tb = !0, ye = Dt, ce = -ce, De.points = [Xn(ke, 0), Xn(ge, 0)]) : p.current.tb = !1;
- }
- var vn = pt(at), on = ke[1] === ge[1];
- if (vn && ke[1] === "l" && (Qt > ze.right || p.current.rl)) {
- var Wt = we;
- on ? Wt -= j - K : Wt = Ie.x - Ue.x - Ne;
- var mn = bn(Wt, ye), Jt = bn(Wt, ye, oe);
- // Of course use larger one
- mn > ut || mn === ut && (!se || // Choose recommend one
- Jt >= yt) ? (p.current.rl = !0, we = Wt, Ne = -Ne, De.points = [Xn(ke, 1), Xn(ge, 1)]) : p.current.rl = !1;
- }
- if (vn && ke[1] === "r" && (Mt < ze.left || p.current.lr)) {
- var en = we;
- on ? en += j - K : en = We.x - Oe.x - Ne;
- var On = bn(en, ye), wn = bn(en, ye, oe);
- // Of course use larger one
- On > ut || On === ut && (!se || // Choose recommend one
- wn >= yt) ? (p.current.lr = !0, we = en, Ne = -Ne, De.points = [Xn(ke, 1), Xn(ge, 1)]) : p.current.lr = !1;
- }
- Va();
- var Bt = Et === !0 ? 0 : Et;
- typeof Bt == "number" && (Mt < oe.left && (we -= Mt - oe.left - Ne, H.x + K < oe.left + Bt && (we += H.x - oe.left + K - Bt)), Qt > oe.right && (we -= Qt - oe.right - Ne, H.x > oe.right - Bt && (we += H.x - oe.right + Bt)));
- var Ut = wt === !0 ? 0 : wt;
- typeof Ut == "number" && (xt < oe.top && (ye -= xt - oe.top - ce, H.y + W < oe.top + Ut && (ye += H.y - oe.top + W - Ut)), Ft > oe.bottom && (ye -= Ft - oe.bottom - ce, H.y > oe.bottom - Ut && (ye += H.y - oe.bottom + Ut)));
- var pn = B.x + we, hn = pn + j, qt = B.y + ye, xn = qt + D, Fe = H.x, Ee = Fe + K, Je = H.y, ct = Je + W, Se = Math.max(pn, Fe), Me = Math.min(hn, Ee), gt = (Se + Me) / 2, Rt = gt - pn, Kt = Math.max(qt, Je), rn = Math.min(xn, ct), Yt = (Kt + rn) / 2, gn = Yt - qt;
- i == null || i(t, De);
- var yn = Re.right - B.x - (we + B.width), _n = Re.bottom - B.y - (ye + B.height);
- Be === 1 && (we = Math.round(we), yn = Math.round(yn)), je === 1 && (ye = Math.round(ye), _n = Math.round(_n));
- var ti = {
- ready: !0,
- offsetX: we / Be,
- offsetY: ye / je,
- offsetR: yn / Be,
- offsetB: _n / je,
- arrowX: Rt / Be,
- arrowY: gn / je,
- scaleX: Be,
- scaleY: je,
- align: De
- };
- s(ti);
- }
- }), f = function() {
- v.current += 1;
- var y = v.current;
- Promise.resolve().then(function() {
- v.current === y && b();
- });
- }, h = function() {
- s(function(y) {
- return re(re({}, y), {}, {
- ready: !1
- });
- });
- };
- return St(h, [r]), St(function() {
- e || h();
- }, [e]), [c.ready, c.offsetX, c.offsetY, c.offsetR, c.offsetB, c.arrowX, c.arrowY, c.scaleX, c.scaleY, c.align, f];
- }
- function S0(e, t, n, r, a) {
- St(function() {
- if (e && t && n) {
- let v = function() {
- r(), a();
- };
- var o = t, i = n, u = Ji(o), l = Ji(i), c = ja(i), s = new Set([c].concat(ft(u), ft(l)));
- return s.forEach(function(C) {
- C.addEventListener("scroll", v, {
- passive: !0
- });
- }), c.addEventListener("resize", v, {
- passive: !0
- }), r(), function() {
- s.forEach(function(C) {
- C.removeEventListener("scroll", v), c.removeEventListener("resize", v);
- });
- };
- }
- }, [e, t, n]);
- }
- function w0(e, t, n, r, a, o, i, u) {
- var l = d.useRef(e);
- l.current = e;
- var c = d.useRef(!1);
- d.useEffect(function() {
- if (t && r && (!a || o)) {
- var v = function() {
- c.current = !1;
- }, C = function(f) {
- var h;
- l.current && !i(((h = f.composedPath) === null || h === void 0 || (h = h.call(f)) === null || h === void 0 ? void 0 : h[0]) || f.target) && !c.current && u(!1);
- }, p = ja(r);
- p.addEventListener("pointerdown", v, !0), p.addEventListener("mousedown", C, !0), p.addEventListener("contextmenu", C, !0);
- var m = Ki(n);
- return m && (m.addEventListener("mousedown", C, !0), m.addEventListener("contextmenu", C, !0)), function() {
- p.removeEventListener("pointerdown", v, !0), p.removeEventListener("mousedown", C, !0), p.removeEventListener("contextmenu", C, !0), m && (m.removeEventListener("mousedown", C, !0), m.removeEventListener("contextmenu", C, !0));
- };
- }
- }, [t, n, r, a, o]);
- function s() {
- c.current = !0;
- }
- return s;
- }
- var x0 = ["prefixCls", "children", "action", "showAction", "hideAction", "popupVisible", "defaultPopupVisible", "onPopupVisibleChange", "afterPopupVisibleChange", "mouseEnterDelay", "mouseLeaveDelay", "focusDelay", "blurDelay", "mask", "maskClosable", "getPopupContainer", "forceRender", "autoDestroy", "destroyPopupOnHide", "popup", "popupClassName", "popupStyle", "popupPlacement", "builtinPlacements", "popupAlign", "zIndex", "stretch", "getPopupClassNameFromAlign", "fresh", "alignPoint", "onPopupClick", "onPopupAlign", "arrow", "popupMotion", "maskMotion", "popupTransitionName", "popupAnimation", "maskTransitionName", "maskAnimation", "className", "getTriggerDOMNode"];
- function E0() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : xu, t = /* @__PURE__ */ d.forwardRef(function(n, r) {
- var a = n.prefixCls, o = a === void 0 ? "rc-trigger-popup" : a, i = n.children, u = n.action, l = u === void 0 ? "hover" : u, c = n.showAction, s = n.hideAction, v = n.popupVisible, C = n.defaultPopupVisible, p = n.onPopupVisibleChange, m = n.afterPopupVisibleChange, b = n.mouseEnterDelay, f = n.mouseLeaveDelay, h = f === void 0 ? 0.1 : f, g = n.focusDelay, y = n.blurDelay, w = n.mask, E = n.maskClosable, S = E === void 0 ? !0 : E, x = n.getPopupContainer, R = n.forceRender, k = n.autoDestroy, L = n.destroyPopupOnHide, O = n.popup, N = n.popupClassName, F = n.popupStyle, I = n.popupPlacement, T = n.builtinPlacements, P = T === void 0 ? {} : T, z = n.popupAlign, _ = n.zIndex, A = n.stretch, H = n.getPopupClassNameFromAlign, $ = n.fresh, U = n.alignPoint, G = n.onPopupClick, B = n.onPopupAlign, ne = n.arrow, le = n.popupMotion, ee = n.maskMotion, V = n.popupTransitionName, X = n.popupAnimation, J = n.maskTransitionName, M = n.maskAnimation, D = n.className, j = n.getTriggerDOMNode, W = mt(n, x0), K = k || L || !1, Y = d.useState(!1), te = Z(Y, 2), Q = te[0], ae = te[1];
- St(function() {
- ae(Du());
- }, []);
- var ue = d.useRef({}), se = d.useContext(ts), pe = d.useMemo(function() {
- return {
- registerSubPopup: function(Qe, kt) {
- ue.current[Qe] = kt, se == null || se.registerSubPopup(Qe, kt);
- }
- };
- }, [se]), oe = rd(), ve = d.useState(null), ze = Z(ve, 2), Re = ze[0], Be = ze[1], je = d.useRef(null), He = Ct(function(Ae) {
- je.current = Ae, Ia(Ae) && Re !== Ae && Be(Ae), se == null || se.registerSubPopup(oe, Ae);
- }), Ye = d.useState(null), nt = Z(Ye, 2), Ge = nt[0], Ne = nt[1], ce = d.useRef(null), he = Ct(function(Ae) {
- Ia(Ae) && Ge !== Ae && (Ne(Ae), ce.current = Ae);
- }), Ve = d.Children.only(i), de = (Ve == null ? void 0 : Ve.props) || {}, be = {}, Xe = Ct(function(Ae) {
- var Qe, kt, zt = Ge;
- return (zt == null ? void 0 : zt.contains(Ae)) || ((Qe = Ki(zt)) === null || Qe === void 0 ? void 0 : Qe.host) === Ae || Ae === zt || (Re == null ? void 0 : Re.contains(Ae)) || ((kt = Ki(Re)) === null || kt === void 0 ? void 0 : kt.host) === Ae || Ae === Re || Object.values(ue.current).some(function(It) {
- return (It == null ? void 0 : It.contains(Ae)) || Ae === It;
- });
- }), it = rs(o, le, X, V), tt = rs(o, ee, M, J), $e = d.useState(C || !1), ge = Z($e, 2), ke = ge[0], Te = ge[1], Ke = v != null ? v : ke, De = Ct(function(Ae) {
- v === void 0 && Te(Ae);
- });
- St(function() {
- Te(v || !1);
- }, [v]);
- var we = d.useRef(Ke);
- we.current = Ke;
- var ye = d.useRef([]);
- ye.current = [];
- var ut = Ct(function(Ae) {
- var Qe;
- De(Ae), ((Qe = ye.current[ye.current.length - 1]) !== null && Qe !== void 0 ? Qe : Ke) !== Ae && (ye.current.push(Ae), p == null || p(Ae));
- }), yt = d.useRef(), Ie = function() {
- clearTimeout(yt.current);
- }, Oe = function(Qe) {
- var kt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
- Ie(), kt === 0 ? ut(Qe) : yt.current = setTimeout(function() {
- ut(Qe);
- }, kt * 1e3);
- };
- d.useEffect(function() {
- return Ie;
- }, []);
- var We = d.useState(!1), Ue = Z(We, 2), Ze = Ue[0], at = Ue[1];
- St(function(Ae) {
- (!Ae || Ke) && at(!0);
- }, [Ke]);
- var Lt = d.useState(null), Et = Z(Lt, 2), wt = Et[0], pt = Et[1], xt = d.useState(null), Ft = Z(xt, 2), Mt = Ft[0], Qt = Ft[1], Le = function(Qe) {
- Qt([Qe.clientX, Qe.clientY]);
- }, Pe = C0(Ke, Re, U && Mt !== null ? Mt : Ge, I, P, z, B), qe = Z(Pe, 11), vt = qe[0], ht = qe[1], Dt = qe[2], Nt = qe[3], an = qe[4], vn = qe[5], on = qe[6], Wt = qe[7], mn = qe[8], Jt = qe[9], en = qe[10], On = g0(Q, l, c, s), wn = Z(On, 2), Bt = wn[0], Ut = wn[1], pn = Bt.has("click"), hn = Ut.has("click") || Ut.has("contextMenu"), qt = Ct(function() {
- Ze || en();
- }), xn = function() {
- we.current && U && hn && Oe(!1);
- };
- S0(Ke, Ge, Re, qt, xn), St(function() {
- qt();
- }, [Mt, I]), St(function() {
- Ke && !(P != null && P[I]) && qt();
- }, [JSON.stringify(z)]);
- var Fe = d.useMemo(function() {
- var Ae = b0(P, o, Jt, U);
- return xe(Ae, H == null ? void 0 : H(Jt));
- }, [Jt, H, P, o, U]);
- d.useImperativeHandle(r, function() {
- return {
- nativeElement: ce.current,
- popupElement: je.current,
- forceAlign: qt
- };
- });
- var Ee = d.useState(0), Je = Z(Ee, 2), ct = Je[0], Se = Je[1], Me = d.useState(0), gt = Z(Me, 2), Rt = gt[0], Kt = gt[1], rn = function() {
- if (A && Ge) {
- var Qe = Ge.getBoundingClientRect();
- Se(Qe.width), Kt(Qe.height);
- }
- }, Yt = function() {
- rn(), qt();
- }, gn = function(Qe) {
- at(!1), en(), m == null || m(Qe);
- }, yn = function() {
- return new Promise(function(Qe) {
- rn(), pt(function() {
- return Qe;
- });
- });
- };
- St(function() {
- wt && (en(), wt(), pt(null));
- }, [wt]);
- function _n(Ae, Qe, kt, zt) {
- be[Ae] = function(It) {
- var Ba;
- zt == null || zt(It), Oe(Qe, kt);
- for (var oi = arguments.length, nl = new Array(oi > 1 ? oi - 1 : 0), Ua = 1; Ua < oi; Ua++)
- nl[Ua - 1] = arguments[Ua];
- (Ba = de[Ae]) === null || Ba === void 0 || Ba.call.apply(Ba, [de, It].concat(nl));
- };
- }
- (pn || hn) && (be.onClick = function(Ae) {
- var Qe;
- we.current && hn ? Oe(!1) : !we.current && pn && (Le(Ae), Oe(!0));
- for (var kt = arguments.length, zt = new Array(kt > 1 ? kt - 1 : 0), It = 1; It < kt; It++)
- zt[It - 1] = arguments[It];
- (Qe = de.onClick) === null || Qe === void 0 || Qe.call.apply(Qe, [de, Ae].concat(zt));
- });
- var ti = w0(Ke, hn, Ge, Re, w, S, Xe, Oe), bn = Bt.has("hover"), Va = Ut.has("hover"), kr, Wn;
- bn && (_n("onMouseEnter", !0, b, function(Ae) {
- Le(Ae);
- }), _n("onPointerEnter", !0, b, function(Ae) {
- Le(Ae);
- }), kr = function(Qe) {
- (Ke || Ze) && Re !== null && Re !== void 0 && Re.contains(Qe.target) && Oe(!0, b);
- }, U && (be.onMouseMove = function(Ae) {
- var Qe;
- (Qe = de.onMouseMove) === null || Qe === void 0 || Qe.call(de, Ae);
- })), Va && (_n("onMouseLeave", !1, h), _n("onPointerLeave", !1, h), Wn = function() {
- Oe(!1, h);
- }), Bt.has("focus") && _n("onFocus", !0, g), Ut.has("focus") && _n("onBlur", !1, y), Bt.has("contextMenu") && (be.onContextMenu = function(Ae) {
- var Qe;
- we.current && Ut.has("contextMenu") ? Oe(!1) : (Le(Ae), Oe(!0)), Ae.preventDefault();
- for (var kt = arguments.length, zt = new Array(kt > 1 ? kt - 1 : 0), It = 1; It < kt; It++)
- zt[It - 1] = arguments[It];
- (Qe = de.onContextMenu) === null || Qe === void 0 || Qe.call.apply(Qe, [de, Ae].concat(zt));
- }), D && (be.className = xe(de.className, D));
- var Bn = re(re({}, de), be), ea = {}, Wa = ["onContextMenu", "onClick", "onMouseDown", "onTouchStart", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur"];
- Wa.forEach(function(Ae) {
- W[Ae] && (ea[Ae] = function() {
- for (var Qe, kt = arguments.length, zt = new Array(kt), It = 0; It < kt; It++)
- zt[It] = arguments[It];
- (Qe = Bn[Ae]) === null || Qe === void 0 || Qe.call.apply(Qe, [Bn].concat(zt)), W[Ae].apply(W, zt);
- });
- });
- var ni = /* @__PURE__ */ d.cloneElement(Ve, re(re({}, Bn), ea)), ri = {
- x: vn,
- y: on
- }, ai = ne ? re({}, ne !== !0 ? ne : {}) : null;
- return /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(cr, {
- disabled: !Ke,
- ref: he,
- onResize: Yt
- }, /* @__PURE__ */ d.createElement(h0, {
- getTriggerDOMNode: j
- }, ni)), /* @__PURE__ */ d.createElement(ts.Provider, {
- value: pe
- }, /* @__PURE__ */ d.createElement(p0, {
- portal: e,
- ref: He,
- prefixCls: o,
- popup: O,
- className: xe(N, Fe),
- style: F,
- target: Ge,
- onMouseEnter: kr,
- onMouseLeave: Wn,
- onPointerEnter: kr,
- zIndex: _,
- open: Ke,
- keepDom: Ze,
- fresh: $,
- onClick: G,
- onPointerDownCapture: ti,
- mask: w,
- motion: it,
- maskMotion: tt,
- onVisibleChanged: gn,
- onPrepare: yn,
- forceRender: R,
- autoDestroy: K,
- getPopupContainer: x,
- align: Jt,
- arrow: ai,
- arrowPos: ri,
- ready: vt,
- offsetX: ht,
- offsetY: Dt,
- offsetR: Nt,
- offsetB: an,
- onAlign: qt,
- stretch: A,
- targetWidth: ct / Wt,
- targetHeight: Rt / mn
- })));
- });
- return t;
- }
- const Uo = E0(xu);
- function Lu(e, t) {
- return e !== void 0 ? e : t ? "bottomRight" : "bottomLeft";
- }
- function R0(e, t) {
- var n = Lu(e, t), r = n == null ? void 0 : n.toLowerCase().endsWith("right"), a = r ? "insetInlineEnd" : "insetInlineStart";
- return t && (a = ["insetInlineStart", "insetInlineEnd"].find(function(o) {
- return o !== a;
- })), a;
- }
- var Hn = /* @__PURE__ */ d.createContext(null), P0 = {
- bottomLeft: {
- points: ["tl", "bl"],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- bottomRight: {
- points: ["tr", "br"],
- offset: [0, 4],
- overflow: {
- adjustX: 1,
- adjustY: 1
- }
- },
- topLeft: {
- points: ["bl", "tl"],
- offset: [0, -4],
- overflow: {
- adjustX: 0,
- adjustY: 1
- }
- },
- topRight: {
- points: ["br", "tr"],
- offset: [0, -4],
- overflow: {
- adjustX: 0,
- adjustY: 1
- }
- }
- };
- function M0(e) {
- var t = e.popupElement, n = e.popupStyle, r = e.popupClassName, a = e.popupAlign, o = e.transitionName, i = e.getPopupContainer, u = e.children, l = e.range, c = e.placement, s = e.builtinPlacements, v = s === void 0 ? P0 : s, C = e.direction, p = e.visible, m = e.onClose, b = d.useContext(Hn), f = b.prefixCls, h = "".concat(f, "-dropdown"), g = Lu(c, C === "rtl");
- return /* @__PURE__ */ d.createElement(Uo, {
- showAction: [],
- hideAction: ["click"],
- popupPlacement: g,
- builtinPlacements: v,
- prefixCls: h,
- popupTransitionName: o,
- popup: t,
- popupAlign: a,
- popupVisible: p,
- popupClassName: xe(r, ie(ie({}, "".concat(h, "-range"), l), "".concat(h, "-rtl"), C === "rtl")),
- popupStyle: n,
- stretch: "minWidth",
- getPopupContainer: i,
- onPopupVisibleChange: function(w) {
- w || m();
- }
- }, u);
- }
- function Tu(e, t) {
- for (var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "0", r = String(e); r.length < t; )
- r = "".concat(n).concat(r);
- return r;
- }
- function Xr(e) {
- return e == null ? [] : Array.isArray(e) ? e : [e];
- }
- function Xd(e, t, n) {
- var r = ft(e);
- return r[t] = n, r;
- }
- function qo(e, t) {
- var n = {}, r = t || Object.keys(e);
- return r.forEach(function(a) {
- e[a] !== void 0 && (n[a] = e[a]);
- }), n;
- }
- function Zd(e, t, n) {
- if (n)
- return n;
- switch (e) {
- // All from the `locale.fieldXXXFormat` first
- case "time":
- return t.fieldTimeFormat;
- case "datetime":
- return t.fieldDateTimeFormat;
- case "month":
- return t.fieldMonthFormat;
- case "year":
- return t.fieldYearFormat;
- case "quarter":
- return t.fieldQuarterFormat;
- case "week":
- return t.fieldWeekFormat;
- default:
- return t.fieldDateFormat;
- }
- }
- function k0(e) {
- return qo(e, ["placement", "builtinPlacements", "popupAlign", "getPopupContainer", "transitionName", "direction"]);
- }
- function Qd(e, t, n, r) {
- var a = d.useMemo(function() {
- return e || function(i, u) {
- var l = i;
- return t && u.type === "date" ? t(l, u.today) : n && u.type === "month" ? n(l, u.locale) : u.originNode;
- };
- }, [e, n, t]), o = d.useCallback(function(i, u) {
- return a(i, re(re({}, u), {}, {
- range: r
- }));
- }, [a, r]);
- return o;
- }
- function D0(e, t) {
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = d.useState([!1, !1]), a = Z(r, 2), o = a[0], i = a[1], u = function(s, v) {
- i(function(C) {
- return Xd(C, v, s);
- });
- }, l = d.useMemo(function() {
- return o.map(function(c, s) {
- if (c)
- return !0;
- var v = e[s];
- return v ? !!(!n[s] && !v || v && t(v, {
- activeIndex: s
- })) : !1;
- });
- }, [e, o, t, n]);
- return [l, u];
- }
- function Jd(e, t, n, r, a) {
- var o = "", i = [];
- return e && i.push(a ? "hh" : "HH"), t && i.push("mm"), n && i.push("ss"), o = i.join(":"), r && (o += ".SSS"), a && (o += " A"), o;
- }
- function N0(e, t, n, r, a, o) {
- var i = e.fieldDateTimeFormat, u = e.fieldDateFormat, l = e.fieldTimeFormat, c = e.fieldMonthFormat, s = e.fieldYearFormat, v = e.fieldWeekFormat, C = e.fieldQuarterFormat, p = e.yearFormat, m = e.cellYearFormat, b = e.cellQuarterFormat, f = e.dayFormat, h = e.cellDateFormat, g = Jd(t, n, r, a, o);
- return re(re({}, e), {}, {
- fieldDateTimeFormat: i || "YYYY-MM-DD ".concat(g),
- fieldDateFormat: u || "YYYY-MM-DD",
- fieldTimeFormat: l || g,
- fieldMonthFormat: c || "YYYY-MM",
- fieldYearFormat: s || "YYYY",
- fieldWeekFormat: v || "gggg-wo",
- fieldQuarterFormat: C || "YYYY-[Q]Q",
- yearFormat: p || "YYYY",
- cellYearFormat: m || "YYYY",
- cellQuarterFormat: b || "[Q]Q",
- cellDateFormat: h || f || "D"
- });
- }
- function ef(e, t) {
- var n = t.showHour, r = t.showMinute, a = t.showSecond, o = t.showMillisecond, i = t.use12Hours;
- return me.useMemo(function() {
- return N0(e, n, r, a, o, i);
- }, [e, n, r, a, o, i]);
- }
- function la(e, t, n) {
- return n != null ? n : t.some(function(r) {
- return e.includes(r);
- });
- }
- var I0 = [
- // 'format',
- "showNow",
- "showHour",
- "showMinute",
- "showSecond",
- "showMillisecond",
- "use12Hours",
- "hourStep",
- "minuteStep",
- "secondStep",
- "millisecondStep",
- "hideDisabledOptions",
- "defaultValue",
- "disabledHours",
- "disabledMinutes",
- "disabledSeconds",
- "disabledMilliseconds",
- "disabledTime",
- "changeOnScroll",
- "defaultOpenValue"
- ];
- function O0(e) {
- var t = qo(e, I0), n = e.format, r = e.picker, a = null;
- return n && (a = n, Array.isArray(a) && (a = a[0]), a = _t(a) === "object" ? a.format : a), r === "time" && (t.format = a), [t, a];
- }
- function _0(e) {
- return e && typeof e == "string";
- }
- function tf(e, t, n, r) {
- return [e, t, n, r].some(function(a) {
- return a !== void 0;
- });
- }
- function nf(e, t, n, r, a) {
- var o = t, i = n, u = r;
- if (!e && !o && !i && !u && !a)
- o = !0, i = !0, u = !0;
- else if (e) {
- var l, c, s, v = [o, i, u].some(function(m) {
- return m === !1;
- }), C = [o, i, u].some(function(m) {
- return m === !0;
- }), p = v ? !0 : !C;
- o = (l = o) !== null && l !== void 0 ? l : p, i = (c = i) !== null && c !== void 0 ? c : p, u = (s = u) !== null && s !== void 0 ? s : p;
- }
- return [o, i, u, a];
- }
- function rf(e) {
- var t = e.showTime, n = O0(e), r = Z(n, 2), a = r[0], o = r[1], i = t && _t(t) === "object" ? t : {}, u = re(re({
- defaultOpenValue: i.defaultOpenValue || i.defaultValue
- }, a), i), l = u.showMillisecond, c = u.showHour, s = u.showMinute, v = u.showSecond, C = tf(c, s, v, l), p = nf(C, c, s, v, l), m = Z(p, 3);
- return c = m[0], s = m[1], v = m[2], [u, re(re({}, u), {}, {
- showHour: c,
- showMinute: s,
- showSecond: v,
- showMillisecond: l
- }), u.format, o];
- }
- function af(e, t, n, r, a) {
- var o = e === "time";
- if (e === "datetime" || o) {
- for (var i = r, u = Zd(e, a, null), l = u, c = [t, n], s = 0; s < c.length; s += 1) {
- var v = Xr(c[s])[0];
- if (_0(v)) {
- l = v;
- break;
- }
- }
- var C = i.showHour, p = i.showMinute, m = i.showSecond, b = i.showMillisecond, f = i.use12Hours, h = la(l, ["a", "A", "LT", "LLL", "LTS"], f), g = tf(C, p, m, b);
- g || (C = la(l, ["H", "h", "k", "LT", "LLL"]), p = la(l, ["m", "LT", "LLL"]), m = la(l, ["s", "LTS"]), b = la(l, ["SSS"]));
- var y = nf(g, C, p, m, b), w = Z(y, 3);
- C = w[0], p = w[1], m = w[2];
- var E = t || Jd(C, p, m, b, h);
- return re(re({}, i), {}, {
- // Format
- format: E,
- // Show Config
- showHour: C,
- showMinute: p,
- showSecond: m,
- showMillisecond: b,
- use12Hours: h
- });
- }
- return null;
- }
- function L0(e, t, n) {
- if (t === !1)
- return null;
- var r = t && _t(t) === "object" ? t : {};
- return r.clearIcon || n || /* @__PURE__ */ d.createElement("span", {
- className: "".concat(e, "-clear-btn")
- });
- }
- var gi = 7;
- function dr(e, t, n) {
- return !e && !t || e === t ? !0 : !e || !t ? !1 : n();
- }
- function eu(e, t, n) {
- return dr(t, n, function() {
- var r = Math.floor(e.getYear(t) / 10), a = Math.floor(e.getYear(n) / 10);
- return r === a;
- });
- }
- function Sr(e, t, n) {
- return dr(t, n, function() {
- return e.getYear(t) === e.getYear(n);
- });
- }
- function ls(e, t) {
- var n = Math.floor(e.getMonth(t) / 3);
- return n + 1;
- }
- function T0(e, t, n) {
- return dr(t, n, function() {
- return Sr(e, t, n) && ls(e, t) === ls(e, n);
- });
- }
- function $u(e, t, n) {
- return dr(t, n, function() {
- return Sr(e, t, n) && e.getMonth(t) === e.getMonth(n);
- });
- }
- function Au(e, t, n) {
- return dr(t, n, function() {
- return Sr(e, t, n) && $u(e, t, n) && e.getDate(t) === e.getDate(n);
- });
- }
- function of(e, t, n) {
- return dr(t, n, function() {
- return e.getHour(t) === e.getHour(n) && e.getMinute(t) === e.getMinute(n) && e.getSecond(t) === e.getSecond(n);
- });
- }
- function uf(e, t, n) {
- return dr(t, n, function() {
- return Au(e, t, n) && of(e, t, n) && e.getMillisecond(t) === e.getMillisecond(n);
- });
- }
- function xa(e, t, n, r) {
- return dr(n, r, function() {
- var a = e.locale.getWeekFirstDate(t, n), o = e.locale.getWeekFirstDate(t, r);
- return Sr(e, a, o) && e.locale.getWeek(t, n) === e.locale.getWeek(t, r);
- });
- }
- function ln(e, t, n, r, a) {
- switch (a) {
- case "date":
- return Au(e, n, r);
- case "week":
- return xa(e, t.locale, n, r);
- case "month":
- return $u(e, n, r);
- case "quarter":
- return T0(e, n, r);
- case "year":
- return Sr(e, n, r);
- case "decade":
- return eu(e, n, r);
- case "time":
- return of(e, n, r);
- default:
- return uf(e, n, r);
- }
- }
- function Ko(e, t, n, r) {
- return !t || !n || !r ? !1 : e.isAfter(r, t) && e.isAfter(n, r);
- }
- function ro(e, t, n, r, a) {
- return ln(e, t, n, r, a) ? !0 : e.isAfter(n, r);
- }
- function $0(e, t, n) {
- var r = t.locale.getWeekFirstDay(e), a = t.setDate(n, 1), o = t.getWeekDay(a), i = t.addDate(a, r - o);
- return t.getMonth(i) === t.getMonth(n) && t.getDate(i) > 1 && (i = t.addDate(i, -7)), i;
- }
- function Vt(e, t) {
- var n = t.generateConfig, r = t.locale, a = t.format;
- return e ? typeof a == "function" ? a(e) : n.locale.format(r.locale, e, a) : "";
- }
- function Lo(e, t, n) {
- var r = t, a = ["getHour", "getMinute", "getSecond", "getMillisecond"], o = ["setHour", "setMinute", "setSecond", "setMillisecond"];
- return o.forEach(function(i, u) {
- n ? r = e[i](r, e[a[u]](n)) : r = e[i](r, 0);
- }), r;
- }
- function A0(e, t, n, r, a) {
- var o = Ct(function(i, u) {
- return !!(n && n(i, u) || r && e.isAfter(r, i) && !ln(e, t, r, i, u.type) || a && e.isAfter(i, a) && !ln(e, t, a, i, u.type));
- });
- return o;
- }
- function j0(e, t, n) {
- return d.useMemo(function() {
- var r = Zd(e, t, n), a = Xr(r), o = a[0], i = _t(o) === "object" && o.type === "mask" ? o.format : null;
- return [
- // Format list
- a.map(function(u) {
- return typeof u == "string" || typeof u == "function" ? u : u.format;
- }),
- // Mask Format
- i
- ];
- }, [e, t, n]);
- }
- function F0(e, t, n) {
- return typeof e[0] == "function" || n ? !0 : t;
- }
- function z0(e, t, n, r) {
- var a = Ct(function(o, i) {
- var u = re({
- type: t
- }, i);
- if (delete u.activeIndex, // Date object is invalid
- !e.isValidate(o) || // Date is disabled by `disabledDate`
- n && n(o, u))
- return !0;
- if ((t === "date" || t === "time") && r) {
- var l, c = i && i.activeIndex === 1 ? "end" : "start", s = ((l = r.disabledTime) === null || l === void 0 ? void 0 : l.call(r, o, c, {
- from: u.from
- })) || {}, v = s.disabledHours, C = s.disabledMinutes, p = s.disabledSeconds, m = s.disabledMilliseconds, b = r.disabledHours, f = r.disabledMinutes, h = r.disabledSeconds, g = v || b, y = C || f, w = p || h, E = e.getHour(o), S = e.getMinute(o), x = e.getSecond(o), R = e.getMillisecond(o);
- if (g && g().includes(E) || y && y(E).includes(S) || w && w(E, S).includes(x) || m && m(E, S, x).includes(R))
- return !0;
- }
- return !1;
- });
- return a;
- }
- function ao(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = d.useMemo(function() {
- var r = e && Xr(e);
- return t && r && (r[1] = r[1] || r[0]), r;
- }, [e, t]);
- return n;
- }
- function H0(e, t) {
- var n = e.generateConfig, r = e.locale, a = e.picker, o = a === void 0 ? "date" : a, i = e.prefixCls, u = i === void 0 ? "rc-picker" : i, l = e.styles, c = l === void 0 ? {} : l, s = e.classNames, v = s === void 0 ? {} : s, C = e.order, p = C === void 0 ? !0 : C, m = e.components, b = m === void 0 ? {} : m, f = e.inputRender, h = e.allowClear, g = e.clearIcon, y = e.needConfirm, w = e.multiple, E = e.format, S = e.inputReadOnly, x = e.disabledDate, R = e.minDate, k = e.maxDate, L = e.showTime, O = e.value, N = e.defaultValue, F = e.pickerValue, I = e.defaultPickerValue, T = ao(O), P = ao(N), z = ao(F), _ = ao(I), A = o === "date" && L ? "datetime" : o, H = A === "time" || A === "datetime", $ = H || w, U = y != null ? y : H, G = rf(e), B = Z(G, 4), ne = B[0], le = B[1], ee = B[2], V = B[3], X = ef(r, le), J = d.useMemo(function() {
- return af(A, ee, V, ne, X);
- }, [A, ee, V, ne, X]), M = d.useMemo(function() {
- return re(re({}, e), {}, {
- prefixCls: u,
- locale: X,
- picker: o,
- styles: c,
- classNames: v,
- order: p,
- components: re({
- input: f
- }, b),
- clearIcon: L0(u, h, g),
- showTime: J,
- value: T,
- defaultValue: P,
- pickerValue: z,
- defaultPickerValue: _
- }, void 0);
- }, [e]), D = j0(A, X, E), j = Z(D, 2), W = j[0], K = j[1], Y = F0(W, S, w), te = A0(n, r, x, R, k), Q = z0(n, o, te, J), ae = d.useMemo(function() {
- return re(re({}, M), {}, {
- needConfirm: U,
- inputReadOnly: Y,
- disabledDate: te
- });
- }, [M, U, Y, te]);
- return [ae, A, $, W, K, Q];
- }
- function V0(e, t, n) {
- var r = Gt(t, {
- value: e
- }), a = Z(r, 2), o = a[0], i = a[1], u = me.useRef(e), l = me.useRef(), c = function() {
- st.cancel(l.current);
- }, s = Ct(function() {
- i(u.current), n && o !== u.current && n(u.current);
- }), v = Ct(function(C, p) {
- c(), u.current = C, C || p ? s() : l.current = st(s);
- });
- return me.useEffect(function() {
- return c;
- }, []), [o, v];
- }
- function W0(e, t) {
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [], r = arguments.length > 3 ? arguments[3] : void 0, a = n.every(function(s) {
- return s;
- }) ? !1 : e, o = V0(a, t || !1, r), i = Z(o, 2), u = i[0], l = i[1];
- function c(s) {
- var v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
- (!v.inherit || u) && l(s, v.force);
- }
- return [u, c];
- }
- function B0(e) {
- var t = d.useRef();
- return d.useImperativeHandle(e, function() {
- var n;
- return {
- nativeElement: (n = t.current) === null || n === void 0 ? void 0 : n.nativeElement,
- focus: function(a) {
- var o;
- (o = t.current) === null || o === void 0 || o.focus(a);
- },
- blur: function() {
- var a;
- (a = t.current) === null || a === void 0 || a.blur();
- }
- };
- }), t;
- }
- function U0(e, t) {
- return d.useMemo(function() {
- return e || [];
- }, [e, t]);
- }
- function ju(e, t) {
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, r = d.useRef(t);
- r.current = t, Wr(function() {
- if (e)
- r.current(e);
- else {
- var a = st(function() {
- r.current(e);
- }, n);
- return function() {
- st.cancel(a);
- };
- }
- }, [e]);
- }
- function q0(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, r = d.useState(0), a = Z(r, 2), o = a[0], i = a[1], u = d.useState(!1), l = Z(u, 2), c = l[0], s = l[1], v = d.useRef([]), C = d.useRef(null), p = function(h) {
- s(h);
- }, m = function(h) {
- return h && (C.current = h), C.current;
- }, b = function(h) {
- var g = v.current, y = new Set(g.filter(function(E) {
- return h[E] || t[E];
- })), w = g[g.length - 1] === 0 ? 1 : 0;
- return y.size >= 2 || e[w] ? null : w;
- };
- return ju(c || n, function() {
- c || (v.current = []);
- }), d.useEffect(function() {
- c && v.current.push(o);
- }, [c, o]), [c, p, m, o, i, b, v.current];
- }
- function K0(e, t, n, r) {
- switch (t) {
- case "date":
- case "week":
- return e.addMonth(n, r);
- case "month":
- case "quarter":
- return e.addYear(n, r);
- case "year":
- return e.addYear(n, r * 10);
- case "decade":
- return e.addYear(n, r * 100);
- default:
- return n;
- }
- }
- var yi = [];
- function Y0(e, t, n, r, a, o, i, u) {
- var l = arguments.length > 8 && arguments[8] !== void 0 ? arguments[8] : yi, c = arguments.length > 9 && arguments[9] !== void 0 ? arguments[9] : yi, s = arguments.length > 10 && arguments[10] !== void 0 ? arguments[10] : yi, v = arguments.length > 11 ? arguments[11] : void 0, C = arguments.length > 12 ? arguments[12] : void 0, p = arguments.length > 13 ? arguments[13] : void 0, m = i === "time", b = o || 0, f = function(z) {
- var _ = e.getNow();
- return m && (_ = Lo(e, _)), l[z] || n[z] || _;
- }, h = Z(c, 2), g = h[0], y = h[1], w = Gt(function() {
- return f(0);
- }, {
- value: g
- }), E = Z(w, 2), S = E[0], x = E[1], R = Gt(function() {
- return f(1);
- }, {
- value: y
- }), k = Z(R, 2), L = k[0], O = k[1], N = d.useMemo(function() {
- var P = [S, L][b];
- return m ? P : Lo(e, P, s[b]);
- }, [m, S, L, b, e, s]), F = function(z) {
- var _ = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "panel", A = [x, O][b];
- A(z);
- var H = [S, L];
- H[b] = z, v && (!ln(e, t, S, H[0], i) || !ln(e, t, L, H[1], i)) && v(H, {
- source: _,
- range: b === 1 ? "end" : "start",
- mode: r
- });
- }, I = function(z, _) {
- return _;
- }, T = d.useRef(null);
- return St(function() {
- if (a && !l[b]) {
- var P = m ? null : e.getNow();
- if (T.current !== null && T.current !== b ? P = [S, L][b ^ 1] : n[b] ? P = b === 0 ? n[0] : I(n[0], n[1]) : n[b ^ 1] && (P = n[b ^ 1]), P) {
- C && e.isAfter(C, P) && (P = C);
- var z = P;
- p && e.isAfter(z, p) && (P = p), F(P, "reset");
- }
- }
- }, [a, b, n[b]]), d.useEffect(function() {
- a ? T.current = b : T.current = null;
- }, [a, b]), St(function() {
- a && l && l[b] && F(l[b], "reset");
- }, [a, b]), [N, F];
- }
- function lf(e, t) {
- var n = d.useRef(e), r = d.useState({}), a = Z(r, 2), o = a[1], i = function(c) {
- return c && t !== void 0 ? t : n.current;
- }, u = function(c) {
- n.current = c, o({});
- };
- return [i, u, i(!0)];
- }
- var G0 = [];
- function sf(e, t, n) {
- var r = function(i) {
- return i.map(function(u) {
- return Vt(u, {
- generateConfig: e,
- locale: t,
- format: n[0]
- });
- });
- }, a = function(i, u) {
- for (var l = Math.max(i.length, u.length), c = -1, s = 0; s < l; s += 1) {
- var v = i[s] || null, C = u[s] || null;
- if (v !== C && !uf(e, v, C)) {
- c = s;
- break;
- }
- }
- return [c < 0, c !== 0];
- };
- return [r, a];
- }
- function cf(e, t) {
- return ft(e).sort(function(n, r) {
- return t.isAfter(n, r) ? 1 : -1;
- });
- }
- function X0(e) {
- var t = lf(e), n = Z(t, 2), r = n[0], a = n[1], o = Ct(function() {
- a(e);
- });
- return d.useEffect(function() {
- o();
- }, [e]), [r, a];
- }
- function Z0(e, t, n, r, a, o, i, u, l) {
- var c = Gt(o, {
- value: i
- }), s = Z(c, 2), v = s[0], C = s[1], p = v || G0, m = X0(p), b = Z(m, 2), f = b[0], h = b[1], g = sf(e, t, n), y = Z(g, 2), w = y[0], E = y[1], S = Ct(function(R) {
- var k = ft(R);
- a && (k = cf(k.filter(function(T) {
- return T;
- }), e));
- var L = E(f(), k), O = Z(L, 2), N = O[0], F = O[1];
- if (!N) {
- h(k);
- {
- var I = w(k);
- u(k, I, {
- range: F ? "end" : "start"
- });
- }
- }
- }), x = function() {
- l(f());
- };
- return [p, C, f, S, x];
- }
- function Q0(e, t, n, r, a, o, i, u, l, c) {
- var s = e.generateConfig, v = e.locale, C = e.picker, p = e.onChange, m = e.allowEmpty, b = e.order, f = o.some(function(I) {
- return I;
- }) ? !1 : b, h = sf(s, v, i), g = Z(h, 2), y = g[0], w = g[1], E = lf(t), S = Z(E, 2), x = S[0], R = S[1], k = Ct(function() {
- R(t);
- });
- d.useEffect(function() {
- k();
- }, [t]);
- var L = Ct(function(I) {
- var T = I === null, P = ft(I || x());
- if (T)
- for (var z = Math.max(o.length, P.length), _ = 0; _ < z; _ += 1)
- o[_] || (P[_] = null);
- f && P[0] && P[1] && (P = cf(P, s)), a(P);
- var A = P, H = Z(A, 2), $ = H[0], U = H[1], G = !$, B = !U, ne = m ? (
- // Validate empty start
- (!G || m[0]) && // Validate empty end
- (!B || m[1])
- ) : !0, le = !b || G || B || ln(s, v, $, U, C) || s.isAfter(U, $), ee = (
- // Validate start
- (o[0] || !$ || !c($, {
- activeIndex: 0
- })) && // Validate end
- (o[1] || !U || !c(U, {
- from: $,
- activeIndex: 1
- }))
- ), V = (
- // Null value is from clear button
- T || // Normal check
- ne && le && ee
- );
- if (V) {
- n(P);
- var X = w(P, t), J = Z(X, 1), M = J[0];
- p && !M && p(
- // Return null directly if all date are empty
- T && P.every(function(D) {
- return !D;
- }) ? null : P,
- y(P)
- );
- }
- return V;
- }), O = Ct(function(I, T) {
- var P = Xd(x(), I, r()[I]);
- R(P), T && L();
- }), N = !u && !l;
- ju(!N, function() {
- N && (L(), a(t), k());
- }, 2);
- function F(I) {
- return !!x()[I];
- }
- return [O, L, F];
- }
- function J0(e, t, n, r, a) {
- return t !== "date" && t !== "time" ? !1 : n !== void 0 ? n : r !== void 0 ? r : e === "date" || e === "time";
- }
- function ey(e, t, n, r, a, o) {
- var i = e;
- function u(v, C, p) {
- var m = o[v](i), b = p.find(function(y) {
- return y.value === m;
- });
- if (!b || b.disabled) {
- var f = p.filter(function(y) {
- return !y.disabled;
- }), h = ft(f).reverse(), g = h.find(function(y) {
- return y.value <= m;
- }) || f[0];
- g && (m = g.value, i = o[C](i, m));
- }
- return m;
- }
- var l = u("getHour", "setHour", t()), c = u("getMinute", "setMinute", n(l)), s = u("getSecond", "setSecond", r(l, c));
- return u("getMillisecond", "setMillisecond", a(l, c, s)), i;
- }
- function oo() {
- return [];
- }
- function io(e, t) {
- for (var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, a = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : [], o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : 2, i = [], u = n >= 1 ? n | 0 : 1, l = e; l <= t; l += u) {
- var c = a.includes(l);
- (!c || !r) && i.push({
- label: Tu(l, o),
- value: l,
- disabled: c
- });
- }
- return i;
- }
- function Fu(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0, r = t || {}, a = r.use12Hours, o = r.hourStep, i = o === void 0 ? 1 : o, u = r.minuteStep, l = u === void 0 ? 1 : u, c = r.secondStep, s = c === void 0 ? 1 : c, v = r.millisecondStep, C = v === void 0 ? 100 : v, p = r.hideDisabledOptions, m = r.disabledTime, b = r.disabledHours, f = r.disabledMinutes, h = r.disabledSeconds, g = d.useMemo(function() {
- return n || e.getNow();
- }, [n, e]), y = d.useCallback(function(_) {
- var A = (m == null ? void 0 : m(_)) || {};
- return [A.disabledHours || b || oo, A.disabledMinutes || f || oo, A.disabledSeconds || h || oo, A.disabledMilliseconds || oo];
- }, [m, b, f, h]), w = d.useMemo(function() {
- return y(g);
- }, [g, y]), E = Z(w, 4), S = E[0], x = E[1], R = E[2], k = E[3], L = d.useCallback(function(_, A, H, $) {
- var U = io(0, 23, i, p, _()), G = a ? U.map(function(ee) {
- return re(re({}, ee), {}, {
- label: Tu(ee.value % 12 || 12, 2)
- });
- }) : U, B = function(V) {
- return io(0, 59, l, p, A(V));
- }, ne = function(V, X) {
- return io(0, 59, s, p, H(V, X));
- }, le = function(V, X, J) {
- return io(0, 999, C, p, $(V, X, J), 3);
- };
- return [G, B, ne, le];
- }, [p, i, a, C, l, s]), O = d.useMemo(function() {
- return L(S, x, R, k);
- }, [L, S, x, R, k]), N = Z(O, 4), F = N[0], I = N[1], T = N[2], P = N[3], z = function(A, H) {
- var $ = function() {
- return F;
- }, U = I, G = T, B = P;
- if (H) {
- var ne = y(H), le = Z(ne, 4), ee = le[0], V = le[1], X = le[2], J = le[3], M = L(ee, V, X, J), D = Z(M, 4), j = D[0], W = D[1], K = D[2], Y = D[3];
- $ = function() {
- return j;
- }, U = W, G = K, B = Y;
- }
- var te = ey(A, $, U, G, B, e);
- return te;
- };
- return [
- // getValidTime
- z,
- // Units
- F,
- I,
- T,
- P
- ];
- }
- function ty(e) {
- var t = e.mode, n = e.internalMode, r = e.renderExtraFooter, a = e.showNow, o = e.showTime, i = e.onSubmit, u = e.onNow, l = e.invalid, c = e.needConfirm, s = e.generateConfig, v = e.disabledDate, C = d.useContext(Hn), p = C.prefixCls, m = C.locale, b = C.button, f = b === void 0 ? "button" : b, h = s.getNow(), g = Fu(s, o, h), y = Z(g, 1), w = y[0], E = r == null ? void 0 : r(t), S = v(h, {
- type: t
- }), x = function() {
- if (!S) {
- var I = w(h);
- u(I);
- }
- }, R = "".concat(p, "-now"), k = "".concat(R, "-btn"), L = a && /* @__PURE__ */ d.createElement("li", {
- className: R
- }, /* @__PURE__ */ d.createElement("a", {
- className: xe(k, S && "".concat(k, "-disabled")),
- "aria-disabled": S,
- onClick: x
- }, n === "date" ? m.today : m.now)), O = c && /* @__PURE__ */ d.createElement("li", {
- className: "".concat(p, "-ok")
- }, /* @__PURE__ */ d.createElement(f, {
- disabled: l,
- onClick: i
- }, m.ok)), N = (L || O) && /* @__PURE__ */ d.createElement("ul", {
- className: "".concat(p, "-ranges")
- }, L, O);
- return !E && !N ? null : /* @__PURE__ */ d.createElement("div", {
- className: "".concat(p, "-footer")
- }, E && /* @__PURE__ */ d.createElement("div", {
- className: "".concat(p, "-footer-extra")
- }, E), N);
- }
- function df(e, t, n) {
- function r(a, o) {
- var i = a.findIndex(function(l) {
- return ln(e, t, l, o, n);
- });
- if (i === -1)
- return [].concat(ft(a), [o]);
- var u = ft(a);
- return u.splice(i, 1), u;
- }
- return r;
- }
- var Mr = /* @__PURE__ */ d.createContext(null);
- function Yo() {
- return d.useContext(Mr);
- }
- function Zr(e, t) {
- var n = e.prefixCls, r = e.generateConfig, a = e.locale, o = e.disabledDate, i = e.minDate, u = e.maxDate, l = e.cellRender, c = e.hoverValue, s = e.hoverRangeValue, v = e.onHover, C = e.values, p = e.pickerValue, m = e.onSelect, b = e.prevIcon, f = e.nextIcon, h = e.superPrevIcon, g = e.superNextIcon, y = r.getNow(), w = {
- now: y,
- values: C,
- pickerValue: p,
- prefixCls: n,
- disabledDate: o,
- minDate: i,
- maxDate: u,
- cellRender: l,
- hoverValue: c,
- hoverRangeValue: s,
- onHover: v,
- locale: a,
- generateConfig: r,
- onSelect: m,
- panelType: t,
- // Icons
- prevIcon: b,
- nextIcon: f,
- superPrevIcon: h,
- superNextIcon: g
- };
- return [w, y];
- }
- var ar = /* @__PURE__ */ d.createContext({});
- function Fa(e) {
- for (var t = e.rowNum, n = e.colNum, r = e.baseDate, a = e.getCellDate, o = e.prefixColumn, i = e.rowClassName, u = e.titleFormat, l = e.getCellText, c = e.getCellClassName, s = e.headerCells, v = e.cellSelection, C = v === void 0 ? !0 : v, p = e.disabledDate, m = Yo(), b = m.prefixCls, f = m.panelType, h = m.now, g = m.disabledDate, y = m.cellRender, w = m.onHover, E = m.hoverValue, S = m.hoverRangeValue, x = m.generateConfig, R = m.values, k = m.locale, L = m.onSelect, O = p || g, N = "".concat(b, "-cell"), F = d.useContext(ar), I = F.onCellDblClick, T = function(G) {
- return R.some(function(B) {
- return B && ln(x, k, G, B, f);
- });
- }, P = [], z = 0; z < t; z += 1) {
- for (var _ = [], A = void 0, H = function() {
- var G = z * n + $, B = a(r, G), ne = O == null ? void 0 : O(B, {
- type: f
- });
- $ === 0 && (A = B, o && _.push(o(A)));
- var le = !1, ee = !1, V = !1;
- if (C && S) {
- var X = Z(S, 2), J = X[0], M = X[1];
- le = Ko(x, J, M, B), ee = ln(x, k, B, J, f), V = ln(x, k, B, M, f);
- }
- var D = u ? Vt(B, {
- locale: k,
- format: u,
- generateConfig: x
- }) : void 0, j = /* @__PURE__ */ d.createElement("div", {
- className: "".concat(N, "-inner")
- }, l(B));
- _.push(/* @__PURE__ */ d.createElement("td", {
- key: $,
- title: D,
- className: xe(N, re(ie(ie(ie(ie(ie(ie({}, "".concat(N, "-disabled"), ne), "".concat(N, "-hover"), (E || []).some(function(W) {
- return ln(x, k, B, W, f);
- })), "".concat(N, "-in-range"), le && !ee && !V), "".concat(N, "-range-start"), ee), "".concat(N, "-range-end"), V), "".concat(b, "-cell-selected"), !S && // WeekPicker use row instead
- f !== "week" && T(B)), c(B))),
- onClick: function() {
- ne || L(B);
- },
- onDoubleClick: function() {
- !ne && I && I();
- },
- onMouseEnter: function() {
- ne || w == null || w(B);
- },
- onMouseLeave: function() {
- ne || w == null || w(null);
- }
- }, y ? y(B, {
- prefixCls: b,
- originNode: j,
- today: h,
- type: f,
- locale: k
- }) : j));
- }, $ = 0; $ < n; $ += 1)
- H();
- P.push(/* @__PURE__ */ d.createElement("tr", {
- key: z,
- className: i == null ? void 0 : i(A)
- }, _));
- }
- return /* @__PURE__ */ d.createElement("div", {
- className: "".concat(b, "-body")
- }, /* @__PURE__ */ d.createElement("table", {
- className: "".concat(b, "-content")
- }, s && /* @__PURE__ */ d.createElement("thead", null, /* @__PURE__ */ d.createElement("tr", null, s)), /* @__PURE__ */ d.createElement("tbody", null, P)));
- }
- var uo = {
- visibility: "hidden"
- };
- function Qr(e) {
- var t = e.offset, n = e.superOffset, r = e.onChange, a = e.getStart, o = e.getEnd, i = e.children, u = Yo(), l = u.prefixCls, c = u.prevIcon, s = c === void 0 ? "‹" : c, v = u.nextIcon, C = v === void 0 ? "›" : v, p = u.superPrevIcon, m = p === void 0 ? "«" : p, b = u.superNextIcon, f = b === void 0 ? "»" : b, h = u.minDate, g = u.maxDate, y = u.generateConfig, w = u.locale, E = u.pickerValue, S = u.panelType, x = "".concat(l, "-header"), R = d.useContext(ar), k = R.hidePrev, L = R.hideNext, O = R.hideHeader, N = d.useMemo(function() {
- if (!h || !t || !o)
- return !1;
- var U = o(t(-1, E));
- return !ro(y, w, U, h, S);
- }, [h, t, E, o, y, w, S]), F = d.useMemo(function() {
- if (!h || !n || !o)
- return !1;
- var U = o(n(-1, E));
- return !ro(y, w, U, h, S);
- }, [h, n, E, o, y, w, S]), I = d.useMemo(function() {
- if (!g || !t || !a)
- return !1;
- var U = a(t(1, E));
- return !ro(y, w, g, U, S);
- }, [g, t, E, a, y, w, S]), T = d.useMemo(function() {
- if (!g || !n || !a)
- return !1;
- var U = a(n(1, E));
- return !ro(y, w, g, U, S);
- }, [g, n, E, a, y, w, S]), P = function(G) {
- t && r(t(G, E));
- }, z = function(G) {
- n && r(n(G, E));
- };
- if (O)
- return null;
- var _ = "".concat(x, "-prev-btn"), A = "".concat(x, "-next-btn"), H = "".concat(x, "-super-prev-btn"), $ = "".concat(x, "-super-next-btn");
- return /* @__PURE__ */ d.createElement("div", {
- className: x
- }, n && /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "super-prev-year",
- onClick: function() {
- return z(-1);
- },
- tabIndex: -1,
- className: xe(H, F && "".concat(H, "-disabled")),
- disabled: F,
- style: k ? uo : {}
- }, m), t && /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "prev-year",
- onClick: function() {
- return P(-1);
- },
- tabIndex: -1,
- className: xe(_, N && "".concat(_, "-disabled")),
- disabled: N,
- style: k ? uo : {}
- }, s), /* @__PURE__ */ d.createElement("div", {
- className: "".concat(x, "-view")
- }, i), t && /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "next-year",
- onClick: function() {
- return P(1);
- },
- tabIndex: -1,
- className: xe(A, I && "".concat(A, "-disabled")),
- disabled: I,
- style: L ? uo : {}
- }, C), n && /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "super-next-year",
- onClick: function() {
- return z(1);
- },
- tabIndex: -1,
- className: xe($, T && "".concat($, "-disabled")),
- disabled: T,
- style: L ? uo : {}
- }, f));
- }
- function Go(e) {
- var t = e.prefixCls, n = e.panelName, r = n === void 0 ? "date" : n, a = e.locale, o = e.generateConfig, i = e.pickerValue, u = e.onPickerValueChange, l = e.onModeChange, c = e.mode, s = c === void 0 ? "date" : c, v = e.disabledDate, C = e.onSelect, p = e.onHover, m = e.showWeek, b = "".concat(t, "-").concat(r, "-panel"), f = "".concat(t, "-cell"), h = s === "week", g = Zr(e, s), y = Z(g, 2), w = y[0], E = y[1], S = o.locale.getWeekFirstDay(a.locale), x = o.setDate(i, 1), R = $0(a.locale, o, x), k = o.getMonth(i), L = m === void 0 ? h : m, O = L ? function(U) {
- var G = v == null ? void 0 : v(U, {
- type: "week"
- });
- return /* @__PURE__ */ d.createElement("td", {
- key: "week",
- className: xe(f, "".concat(f, "-week"), ie({}, "".concat(f, "-disabled"), G)),
- onClick: function() {
- G || C(U);
- },
- onMouseEnter: function() {
- G || p == null || p(U);
- },
- onMouseLeave: function() {
- G || p == null || p(null);
- }
- }, /* @__PURE__ */ d.createElement("div", {
- className: "".concat(f, "-inner")
- }, o.locale.getWeek(a.locale, U)));
- } : null, N = [], F = a.shortWeekDays || (o.locale.getShortWeekDays ? o.locale.getShortWeekDays(a.locale) : []);
- O && N.push(/* @__PURE__ */ d.createElement("th", {
- key: "empty",
- "aria-label": "empty cell"
- }));
- for (var I = 0; I < gi; I += 1)
- N.push(/* @__PURE__ */ d.createElement("th", {
- key: I
- }, F[(I + S) % gi]));
- var T = function(G, B) {
- return o.addDate(G, B);
- }, P = function(G) {
- return Vt(G, {
- locale: a,
- format: a.cellDateFormat,
- generateConfig: o
- });
- }, z = function(G) {
- var B = ie(ie({}, "".concat(t, "-cell-in-view"), $u(o, G, i)), "".concat(t, "-cell-today"), Au(o, G, E));
- return B;
- }, _ = a.shortMonths || (o.locale.getShortMonths ? o.locale.getShortMonths(a.locale) : []), A = /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "year panel",
- key: "year",
- onClick: function() {
- l("year", i);
- },
- tabIndex: -1,
- className: "".concat(t, "-year-btn")
- }, Vt(i, {
- locale: a,
- format: a.yearFormat,
- generateConfig: o
- })), H = /* @__PURE__ */ d.createElement("button", {
- type: "button",
- "aria-label": "month panel",
- key: "month",
- onClick: function() {
- l("month", i);
- },
- tabIndex: -1,
- className: "".concat(t, "-month-btn")
- }, a.monthFormat ? Vt(i, {
- locale: a,
- format: a.monthFormat,
- generateConfig: o
- }) : _[k]), $ = a.monthBeforeYear ? [H, A] : [A, H];
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: w
- }, /* @__PURE__ */ d.createElement("div", {
- className: xe(b, m && "".concat(b, "-show-week"))
- }, /* @__PURE__ */ d.createElement(Qr, {
- offset: function(G) {
- return o.addMonth(i, G);
- },
- superOffset: function(G) {
- return o.addYear(i, G);
- },
- onChange: u,
- getStart: function(G) {
- return o.setDate(G, 1);
- },
- getEnd: function(G) {
- var B = o.setDate(G, 1);
- return B = o.addMonth(B, 1), o.addDate(B, -1);
- }
- }, $), /* @__PURE__ */ d.createElement(Fa, _e({
- titleFormat: a.fieldDateFormat
- }, e, {
- colNum: gi,
- rowNum: 6,
- baseDate: R,
- headerCells: N,
- getCellDate: T,
- getCellText: P,
- getCellClassName: z,
- prefixColumn: O,
- cellSelection: !h
- }))));
- }
- var ny = 1 / 3;
- function ry(e, t) {
- var n = d.useRef(!1), r = d.useRef(null), a = d.useRef(null), o = function() {
- return n.current;
- }, i = function() {
- st.cancel(r.current), n.current = !1;
- }, u = d.useRef(), l = function() {
- var v = e.current;
- if (a.current = null, u.current = 0, v) {
- var C = v.querySelector('[data-value="'.concat(t, '"]')), p = v.querySelector("li"), m = function b() {
- i(), n.current = !0, u.current += 1;
- var f = v.scrollTop, h = p.offsetTop, g = C.offsetTop, y = g - h;
- if (g === 0 && C !== p || !_u(v)) {
- u.current <= 5 && (r.current = st(b));
- return;
- }
- var w = f + (y - f) * ny, E = Math.abs(y - w);
- if (a.current !== null && a.current < E) {
- i();
- return;
- }
- if (a.current = E, E <= 1) {
- v.scrollTop = y, i();
- return;
- }
- v.scrollTop = w, r.current = st(b);
- };
- C && p && m();
- }
- }, c = Ct(l);
- return [c, i, o];
- }
- var ay = 300;
- function sa(e) {
- var t = e.units, n = e.value, r = e.optionalValue, a = e.type, o = e.onChange, i = e.onHover, u = e.onDblClick, l = e.changeOnScroll, c = Yo(), s = c.prefixCls, v = c.cellRender, C = c.now, p = c.locale, m = "".concat(s, "-time-panel"), b = "".concat(s, "-time-panel-cell"), f = d.useRef(null), h = d.useRef(), g = function() {
- clearTimeout(h.current);
- }, y = ry(f, n != null ? n : r), w = Z(y, 3), E = w[0], S = w[1], x = w[2];
- St(function() {
- return E(), g(), function() {
- S(), g();
- };
- }, [n, r, t]);
- var R = function(O) {
- g();
- var N = O.target;
- !x() && l && (h.current = setTimeout(function() {
- var F = f.current, I = F.querySelector("li").offsetTop, T = Array.from(F.querySelectorAll("li")), P = T.map(function($) {
- return $.offsetTop - I;
- }), z = P.map(function($, U) {
- return t[U].disabled ? Number.MAX_SAFE_INTEGER : Math.abs($ - N.scrollTop);
- }), _ = Math.min.apply(Math, ft(z)), A = z.findIndex(function($) {
- return $ === _;
- }), H = t[A];
- H && !H.disabled && o(H.value);
- }, ay));
- }, k = "".concat(m, "-column");
- return /* @__PURE__ */ d.createElement("ul", {
- className: k,
- ref: f,
- "data-type": a,
- onScroll: R
- }, t.map(function(L) {
- var O = L.label, N = L.value, F = L.disabled, I = /* @__PURE__ */ d.createElement("div", {
- className: "".concat(b, "-inner")
- }, O);
- return /* @__PURE__ */ d.createElement("li", {
- key: N,
- className: xe(b, ie(ie({}, "".concat(b, "-selected"), n === N), "".concat(b, "-disabled"), F)),
- onClick: function() {
- F || o(N);
- },
- onDoubleClick: function() {
- !F && u && u();
- },
- onMouseEnter: function() {
- i(N);
- },
- onMouseLeave: function() {
- i(null);
- },
- "data-value": N
- }, v ? v(N, {
- prefixCls: s,
- originNode: I,
- today: C,
- type: "time",
- subType: a,
- locale: p
- }) : I);
- }));
- }
- function Zn(e) {
- return e < 12;
- }
- function oy(e) {
- var t = e.showHour, n = e.showMinute, r = e.showSecond, a = e.showMillisecond, o = e.use12Hours, i = e.changeOnScroll, u = Yo(), l = u.prefixCls, c = u.values, s = u.generateConfig, v = u.locale, C = u.onSelect, p = u.onHover, m = p === void 0 ? function() {
- } : p, b = u.pickerValue, f = (c == null ? void 0 : c[0]) || null, h = d.useContext(ar), g = h.onCellDblClick, y = Fu(s, e, f), w = Z(y, 5), E = w[0], S = w[1], x = w[2], R = w[3], k = w[4], L = function(be) {
- var Xe = f && s[be](f), it = b && s[be](b);
- return [Xe, it];
- }, O = L("getHour"), N = Z(O, 2), F = N[0], I = N[1], T = L("getMinute"), P = Z(T, 2), z = P[0], _ = P[1], A = L("getSecond"), H = Z(A, 2), $ = H[0], U = H[1], G = L("getMillisecond"), B = Z(G, 2), ne = B[0], le = B[1], ee = F === null ? null : Zn(F) ? "am" : "pm", V = d.useMemo(function() {
- return o ? Zn(F) ? S.filter(function(de) {
- return Zn(de.value);
- }) : S.filter(function(de) {
- return !Zn(de.value);
- }) : S;
- }, [F, S, o]), X = function(be, Xe) {
- var it, tt = be.filter(function($e) {
- return !$e.disabled;
- });
- return Xe != null ? Xe : (
- // Fallback to enabled value
- tt == null || (it = tt[0]) === null || it === void 0 ? void 0 : it.value
- );
- }, J = X(S, F), M = d.useMemo(function() {
- return x(J);
- }, [x, J]), D = X(M, z), j = d.useMemo(function() {
- return R(J, D);
- }, [R, J, D]), W = X(j, $), K = d.useMemo(function() {
- return k(J, D, W);
- }, [k, J, D, W]), Y = X(K, ne), te = d.useMemo(function() {
- if (!o)
- return [];
- var de = s.getNow(), be = s.setHour(de, 6), Xe = s.setHour(de, 18), it = function($e, ge) {
- var ke = v.cellMeridiemFormat;
- return ke ? Vt($e, {
- generateConfig: s,
- locale: v,
- format: ke
- }) : ge;
- };
- return [{
- label: it(be, "AM"),
- value: "am",
- disabled: S.every(function(tt) {
- return tt.disabled || !Zn(tt.value);
- })
- }, {
- label: it(Xe, "PM"),
- value: "pm",
- disabled: S.every(function(tt) {
- return tt.disabled || Zn(tt.value);
- })
- }];
- }, [S, o, s, v]), Q = function(be) {
- var Xe = E(be);
- C(Xe);
- }, ae = d.useMemo(function() {
- var de = f || b || s.getNow(), be = function(it) {
- return it != null;
- };
- return be(F) ? (de = s.setHour(de, F), de = s.setMinute(de, z), de = s.setSecond(de, $), de = s.setMillisecond(de, ne)) : be(I) ? (de = s.setHour(de, I), de = s.setMinute(de, _), de = s.setSecond(de, U), de = s.setMillisecond(de, le)) : be(J) && (de = s.setHour(de, J), de = s.setMinute(de, D), de = s.setSecond(de, W), de = s.setMillisecond(de, Y)), de;
- }, [f, b, F, z, $, ne, J, D, W, Y, I, _, U, le, s]), ue = function(be, Xe) {
- return be === null ? null : s[Xe](ae, be);
- }, se = function(be) {
- return ue(be, "setHour");
- }, pe = function(be) {
- return ue(be, "setMinute");
- }, oe = function(be) {
- return ue(be, "setSecond");
- }, ve = function(be) {
- return ue(be, "setMillisecond");
- }, ze = function(be) {
- return be === null ? null : be === "am" && !Zn(F) ? s.setHour(ae, F - 12) : be === "pm" && Zn(F) ? s.setHour(ae, F + 12) : ae;
- }, Re = function(be) {
- Q(se(be));
- }, Be = function(be) {
- Q(pe(be));
- }, je = function(be) {
- Q(oe(be));
- }, He = function(be) {
- Q(ve(be));
- }, Ye = function(be) {
- Q(ze(be));
- }, nt = function(be) {
- m(se(be));
- }, Ge = function(be) {
- m(pe(be));
- }, Ne = function(be) {
- m(oe(be));
- }, ce = function(be) {
- m(ve(be));
- }, he = function(be) {
- m(ze(be));
- }, Ve = {
- onDblClick: g,
- changeOnScroll: i
- };
- return /* @__PURE__ */ d.createElement("div", {
- className: "".concat(l, "-content")
- }, t && /* @__PURE__ */ d.createElement(sa, _e({
- units: V,
- value: F,
- optionalValue: I,
- type: "hour",
- onChange: Re,
- onHover: nt
- }, Ve)), n && /* @__PURE__ */ d.createElement(sa, _e({
- units: M,
- value: z,
- optionalValue: _,
- type: "minute",
- onChange: Be,
- onHover: Ge
- }, Ve)), r && /* @__PURE__ */ d.createElement(sa, _e({
- units: j,
- value: $,
- optionalValue: U,
- type: "second",
- onChange: je,
- onHover: Ne
- }, Ve)), a && /* @__PURE__ */ d.createElement(sa, _e({
- units: K,
- value: ne,
- optionalValue: le,
- type: "millisecond",
- onChange: He,
- onHover: ce
- }, Ve)), o && /* @__PURE__ */ d.createElement(sa, _e({
- units: te,
- value: ee,
- type: "meridiem",
- onChange: Ye,
- onHover: he
- }, Ve)));
- }
- function ff(e) {
- var t = e.prefixCls, n = e.value, r = e.locale, a = e.generateConfig, o = e.showTime, i = o || {}, u = i.format, l = "".concat(t, "-time-panel"), c = Zr(e, "time"), s = Z(c, 1), v = s[0];
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: v
- }, /* @__PURE__ */ d.createElement("div", {
- className: xe(l)
- }, /* @__PURE__ */ d.createElement(Qr, null, n ? Vt(n, {
- locale: r,
- format: u,
- generateConfig: a
- }) : " "), /* @__PURE__ */ d.createElement(oy, o)));
- }
- function iy(e) {
- var t = e.prefixCls, n = e.generateConfig, r = e.showTime, a = e.onSelect, o = e.value, i = e.pickerValue, u = e.onHover, l = "".concat(t, "-datetime-panel"), c = Fu(n, r), s = Z(c, 1), v = s[0], C = function(f) {
- return o ? Lo(n, f, o) : Lo(n, f, i);
- }, p = function(f) {
- u == null || u(f && C(f));
- }, m = function(f) {
- var h = C(f);
- a(v(h, h));
- };
- return /* @__PURE__ */ d.createElement("div", {
- className: l
- }, /* @__PURE__ */ d.createElement(Go, _e({}, e, {
- onSelect: m,
- onHover: p
- })), /* @__PURE__ */ d.createElement(ff, e));
- }
- function uy(e) {
- var t = e.prefixCls, n = e.locale, r = e.generateConfig, a = e.pickerValue, o = e.disabledDate, i = e.onPickerValueChange, u = "".concat(t, "-decade-panel"), l = Zr(e, "decade"), c = Z(l, 1), s = c[0], v = function(S) {
- var x = Math.floor(r.getYear(S) / 100) * 100;
- return r.setYear(S, x);
- }, C = function(S) {
- var x = v(S);
- return r.addYear(x, 99);
- }, p = v(a), m = C(a), b = r.addYear(p, -10), f = function(S, x) {
- return r.addYear(S, x * 10);
- }, h = function(S) {
- var x = n.cellYearFormat, R = Vt(S, {
- locale: n,
- format: x,
- generateConfig: r
- }), k = Vt(r.addYear(S, 9), {
- locale: n,
- format: x,
- generateConfig: r
- });
- return "".concat(R, "-").concat(k);
- }, g = function(S) {
- return ie({}, "".concat(t, "-cell-in-view"), eu(r, S, p) || eu(r, S, m) || Ko(r, p, m, S));
- }, y = o ? function(E, S) {
- var x = r.setDate(E, 1), R = r.setMonth(x, 0), k = r.setYear(R, Math.floor(r.getYear(R) / 10) * 10), L = r.addYear(k, 10), O = r.addDate(L, -1);
- return o(k, S) && o(O, S);
- } : null, w = "".concat(Vt(p, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }), "-").concat(Vt(m, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }));
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: s
- }, /* @__PURE__ */ d.createElement("div", {
- className: u
- }, /* @__PURE__ */ d.createElement(Qr, {
- superOffset: function(S) {
- return r.addYear(a, S * 100);
- },
- onChange: i,
- getStart: v,
- getEnd: C
- }, w), /* @__PURE__ */ d.createElement(Fa, _e({}, e, {
- disabledDate: y,
- colNum: 3,
- rowNum: 4,
- baseDate: b,
- getCellDate: f,
- getCellText: h,
- getCellClassName: g
- }))));
- }
- function ly(e) {
- var t = e.prefixCls, n = e.locale, r = e.generateConfig, a = e.pickerValue, o = e.disabledDate, i = e.onPickerValueChange, u = e.onModeChange, l = "".concat(t, "-month-panel"), c = Zr(e, "month"), s = Z(c, 1), v = s[0], C = r.setMonth(a, 0), p = n.shortMonths || (r.locale.getShortMonths ? r.locale.getShortMonths(n.locale) : []), m = function(w, E) {
- return r.addMonth(w, E);
- }, b = function(w) {
- var E = r.getMonth(w);
- return n.monthFormat ? Vt(w, {
- locale: n,
- format: n.monthFormat,
- generateConfig: r
- }) : p[E];
- }, f = function() {
- return ie({}, "".concat(t, "-cell-in-view"), !0);
- }, h = o ? function(y, w) {
- var E = r.setDate(y, 1), S = r.setMonth(E, r.getMonth(E) + 1), x = r.addDate(S, -1);
- return o(E, w) && o(x, w);
- } : null, g = /* @__PURE__ */ d.createElement("button", {
- type: "button",
- key: "year",
- "aria-label": "year panel",
- onClick: function() {
- u("year");
- },
- tabIndex: -1,
- className: "".concat(t, "-year-btn")
- }, Vt(a, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }));
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: v
- }, /* @__PURE__ */ d.createElement("div", {
- className: l
- }, /* @__PURE__ */ d.createElement(Qr, {
- superOffset: function(w) {
- return r.addYear(a, w);
- },
- onChange: i,
- getStart: function(w) {
- return r.setMonth(w, 0);
- },
- getEnd: function(w) {
- return r.setMonth(w, 11);
- }
- }, g), /* @__PURE__ */ d.createElement(Fa, _e({}, e, {
- disabledDate: h,
- titleFormat: n.fieldMonthFormat,
- colNum: 3,
- rowNum: 4,
- baseDate: C,
- getCellDate: m,
- getCellText: b,
- getCellClassName: f
- }))));
- }
- function sy(e) {
- var t = e.prefixCls, n = e.locale, r = e.generateConfig, a = e.pickerValue, o = e.onPickerValueChange, i = e.onModeChange, u = "".concat(t, "-quarter-panel"), l = Zr(e, "quarter"), c = Z(l, 1), s = c[0], v = r.setMonth(a, 0), C = function(h, g) {
- return r.addMonth(h, g * 3);
- }, p = function(h) {
- return Vt(h, {
- locale: n,
- format: n.cellQuarterFormat,
- generateConfig: r
- });
- }, m = function() {
- return ie({}, "".concat(t, "-cell-in-view"), !0);
- }, b = /* @__PURE__ */ d.createElement("button", {
- type: "button",
- key: "year",
- "aria-label": "year panel",
- onClick: function() {
- i("year");
- },
- tabIndex: -1,
- className: "".concat(t, "-year-btn")
- }, Vt(a, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }));
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: s
- }, /* @__PURE__ */ d.createElement("div", {
- className: u
- }, /* @__PURE__ */ d.createElement(Qr, {
- superOffset: function(h) {
- return r.addYear(a, h);
- },
- onChange: o,
- getStart: function(h) {
- return r.setMonth(h, 0);
- },
- getEnd: function(h) {
- return r.setMonth(h, 11);
- }
- }, b), /* @__PURE__ */ d.createElement(Fa, _e({}, e, {
- titleFormat: n.fieldQuarterFormat,
- colNum: 4,
- rowNum: 1,
- baseDate: v,
- getCellDate: C,
- getCellText: p,
- getCellClassName: m
- }))));
- }
- function cy(e) {
- var t = e.prefixCls, n = e.generateConfig, r = e.locale, a = e.value, o = e.hoverValue, i = e.hoverRangeValue, u = r.locale, l = "".concat(t, "-week-panel-row"), c = function(v) {
- var C = {};
- if (i) {
- var p = Z(i, 2), m = p[0], b = p[1], f = xa(n, u, m, v), h = xa(n, u, b, v);
- C["".concat(l, "-range-start")] = f, C["".concat(l, "-range-end")] = h, C["".concat(l, "-range-hover")] = !f && !h && Ko(n, m, b, v);
- }
- return o && (C["".concat(l, "-hover")] = o.some(function(g) {
- return xa(n, u, v, g);
- })), xe(
- l,
- ie({}, "".concat(l, "-selected"), !i && xa(n, u, a, v)),
- // Patch for hover range
- C
- );
- };
- return /* @__PURE__ */ d.createElement(Go, _e({}, e, {
- mode: "week",
- panelName: "week",
- rowClassName: c
- }));
- }
- function dy(e) {
- var t = e.prefixCls, n = e.locale, r = e.generateConfig, a = e.pickerValue, o = e.disabledDate, i = e.onPickerValueChange, u = e.onModeChange, l = "".concat(t, "-year-panel"), c = Zr(e, "year"), s = Z(c, 1), v = s[0], C = function(x) {
- var R = Math.floor(r.getYear(x) / 10) * 10;
- return r.setYear(x, R);
- }, p = function(x) {
- var R = C(x);
- return r.addYear(R, 9);
- }, m = C(a), b = p(a), f = r.addYear(m, -1), h = function(x, R) {
- return r.addYear(x, R);
- }, g = function(x) {
- return Vt(x, {
- locale: n,
- format: n.cellYearFormat,
- generateConfig: r
- });
- }, y = function(x) {
- return ie({}, "".concat(t, "-cell-in-view"), Sr(r, x, m) || Sr(r, x, b) || Ko(r, m, b, x));
- }, w = o ? function(S, x) {
- var R = r.setMonth(S, 0), k = r.setDate(R, 1), L = r.addYear(k, 1), O = r.addDate(L, -1);
- return o(k, x) && o(O, x);
- } : null, E = /* @__PURE__ */ d.createElement("button", {
- type: "button",
- key: "decade",
- "aria-label": "decade panel",
- onClick: function() {
- u("decade");
- },
- tabIndex: -1,
- className: "".concat(t, "-decade-btn")
- }, Vt(m, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }), "-", Vt(b, {
- locale: n,
- format: n.yearFormat,
- generateConfig: r
- }));
- return /* @__PURE__ */ d.createElement(Mr.Provider, {
- value: v
- }, /* @__PURE__ */ d.createElement("div", {
- className: l
- }, /* @__PURE__ */ d.createElement(Qr, {
- superOffset: function(x) {
- return r.addYear(a, x * 10);
- },
- onChange: i,
- getStart: C,
- getEnd: p
- }, E), /* @__PURE__ */ d.createElement(Fa, _e({}, e, {
- disabledDate: w,
- titleFormat: n.fieldYearFormat,
- colNum: 3,
- rowNum: 4,
- baseDate: f,
- getCellDate: h,
- getCellText: g,
- getCellClassName: y
- }))));
- }
- var fy = {
- date: Go,
- datetime: iy,
- week: cy,
- month: ly,
- quarter: sy,
- year: dy,
- decade: uy,
- time: ff
- };
- function vy(e, t) {
- var n, r = e.locale, a = e.generateConfig, o = e.direction, i = e.prefixCls, u = e.tabIndex, l = u === void 0 ? 0 : u, c = e.multiple, s = e.defaultValue, v = e.value, C = e.onChange, p = e.onSelect, m = e.defaultPickerValue, b = e.pickerValue, f = e.onPickerValueChange, h = e.mode, g = e.onPanelChange, y = e.picker, w = y === void 0 ? "date" : y, E = e.showTime, S = e.hoverValue, x = e.hoverRangeValue, R = e.cellRender, k = e.dateRender, L = e.monthCellRender, O = e.components, N = O === void 0 ? {} : O, F = e.hideHeader, I = ((n = d.useContext(Hn)) === null || n === void 0 ? void 0 : n.prefixCls) || i || "rc-picker", T = d.useRef();
- d.useImperativeHandle(t, function() {
- return {
- nativeElement: T.current
- };
- });
- var P = rf(e), z = Z(P, 4), _ = z[0], A = z[1], H = z[2], $ = z[3], U = ef(r, A), G = w === "date" && E ? "datetime" : w, B = d.useMemo(function() {
- return af(G, H, $, _, U);
- }, [G, H, $, _, U]), ne = a.getNow(), le = Gt(w, {
- value: h,
- postState: function(he) {
- return he || "date";
- }
- }), ee = Z(le, 2), V = ee[0], X = ee[1], J = V === "date" && B ? "datetime" : V, M = df(a, r, G), D = Gt(s, {
- value: v
- }), j = Z(D, 2), W = j[0], K = j[1], Y = d.useMemo(function() {
- var ce = Xr(W).filter(function(he) {
- return he;
- });
- return c ? ce : ce.slice(0, 1);
- }, [W, c]), te = Ct(function(ce) {
- K(ce), C && (ce === null || Y.length !== ce.length || Y.some(function(he, Ve) {
- return !ln(a, r, he, ce[Ve], G);
- })) && (C == null || C(c ? ce : ce[0]));
- }), Q = Ct(function(ce) {
- if (p == null || p(ce), V === w) {
- var he = c ? M(Y, ce) : [ce];
- te(he);
- }
- }), ae = Gt(m || Y[0] || ne, {
- value: b
- }), ue = Z(ae, 2), se = ue[0], pe = ue[1];
- d.useEffect(function() {
- Y[0] && !b && pe(Y[0]);
- }, [Y[0]]);
- var oe = function(he, Ve) {
- g == null || g(he || b, Ve || V);
- }, ve = function(he) {
- var Ve = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- pe(he), f == null || f(he), Ve && oe(he);
- }, ze = function(he, Ve) {
- X(he), Ve && ve(Ve), oe(Ve, he);
- }, Re = function(he) {
- if (Q(he), ve(he), V !== w) {
- var Ve = ["decade", "year"], de = [].concat(Ve, ["month"]), be = {
- quarter: [].concat(Ve, ["quarter"]),
- week: [].concat(ft(de), ["week"]),
- date: [].concat(ft(de), ["date"])
- }, Xe = be[w] || de, it = Xe.indexOf(V), tt = Xe[it + 1];
- tt && ze(tt, he);
- }
- }, Be = d.useMemo(function() {
- var ce, he;
- if (Array.isArray(x)) {
- var Ve = Z(x, 2);
- ce = Ve[0], he = Ve[1];
- } else
- ce = x;
- return !ce && !he ? null : (ce = ce || he, he = he || ce, a.isAfter(ce, he) ? [he, ce] : [ce, he]);
- }, [x, a]), je = Qd(R, k, L), He = N[J] || fy[J] || Go, Ye = d.useContext(ar), nt = d.useMemo(function() {
- return re(re({}, Ye), {}, {
- hideHeader: F
- });
- }, [Ye, F]), Ge = "".concat(I, "-panel"), Ne = qo(e, [
- // Week
- "showWeek",
- // Icons
- "prevIcon",
- "nextIcon",
- "superPrevIcon",
- "superNextIcon",
- // Disabled
- "disabledDate",
- "minDate",
- "maxDate",
- // Hover
- "onHover"
- ]);
- return /* @__PURE__ */ d.createElement(ar.Provider, {
- value: nt
- }, /* @__PURE__ */ d.createElement("div", {
- ref: T,
- tabIndex: l,
- className: xe(Ge, ie({}, "".concat(Ge, "-rtl"), o === "rtl"))
- }, /* @__PURE__ */ d.createElement(He, _e({}, Ne, {
- // Time
- showTime: B,
- prefixCls: I,
- locale: U,
- generateConfig: a,
- onModeChange: ze,
- pickerValue: se,
- onPickerValueChange: function(he) {
- ve(he, !0);
- },
- value: Y[0],
- onSelect: Re,
- values: Y,
- cellRender: je,
- hoverRangeValue: Be,
- hoverValue: S
- }))));
- }
- var po = /* @__PURE__ */ d.memo(/* @__PURE__ */ d.forwardRef(vy));
- function my(e) {
- var t = e.picker, n = e.multiplePanel, r = e.pickerValue, a = e.onPickerValueChange, o = e.needConfirm, i = e.onSubmit, u = e.range, l = e.hoverValue, c = d.useContext(Hn), s = c.prefixCls, v = c.generateConfig, C = d.useCallback(function(g, y) {
- return K0(v, t, g, y);
- }, [v, t]), p = d.useMemo(function() {
- return C(r, 1);
- }, [r, C]), m = function(y) {
- a(C(y, -1));
- }, b = {
- onCellDblClick: function() {
- o && i();
- }
- }, f = t === "time", h = re(re({}, e), {}, {
- hoverValue: null,
- hoverRangeValue: null,
- hideHeader: f
- });
- return u ? h.hoverRangeValue = l : h.hoverValue = l, n ? /* @__PURE__ */ d.createElement("div", {
- className: "".concat(s, "-panels")
- }, /* @__PURE__ */ d.createElement(ar.Provider, {
- value: re(re({}, b), {}, {
- hideNext: !0
- })
- }, /* @__PURE__ */ d.createElement(po, h)), /* @__PURE__ */ d.createElement(ar.Provider, {
- value: re(re({}, b), {}, {
- hidePrev: !0
- })
- }, /* @__PURE__ */ d.createElement(po, _e({}, h, {
- pickerValue: p,
- onPickerValueChange: m
- })))) : /* @__PURE__ */ d.createElement(ar.Provider, {
- value: re({}, b)
- }, /* @__PURE__ */ d.createElement(po, h));
- }
- function ss(e) {
- return typeof e == "function" ? e() : e;
- }
- function py(e) {
- var t = e.prefixCls, n = e.presets, r = e.onClick, a = e.onHover;
- return n.length ? /* @__PURE__ */ d.createElement("div", {
- className: "".concat(t, "-presets")
- }, /* @__PURE__ */ d.createElement("ul", null, n.map(function(o, i) {
- var u = o.label, l = o.value;
- return /* @__PURE__ */ d.createElement("li", {
- key: i,
- onClick: function() {
- r(ss(l));
- },
- onMouseEnter: function() {
- a(ss(l));
- },
- onMouseLeave: function() {
- a(null);
- }
- }, u);
- }))) : null;
- }
- function hy(e) {
- var t = e.panelRender, n = e.internalMode, r = e.picker, a = e.showNow, o = e.range, i = e.multiple, u = e.activeOffset, l = u === void 0 ? 0 : u, c = e.placement, s = e.presets, v = e.onPresetHover, C = e.onPresetSubmit, p = e.onFocus, m = e.onBlur, b = e.onPanelMouseDown, f = e.direction, h = e.value, g = e.onSelect, y = e.isInvalid, w = e.defaultOpenValue, E = e.onOk, S = e.onSubmit, x = d.useContext(Hn), R = x.prefixCls, k = "".concat(R, "-panel"), L = f === "rtl", O = d.useRef(null), N = d.useRef(null), F = d.useState(0), I = Z(F, 2), T = I[0], P = I[1], z = d.useState(0), _ = Z(z, 2), A = _[0], H = _[1], $ = function(te) {
- te.offsetWidth && P(te.offsetWidth);
- };
- d.useEffect(function() {
- if (o) {
- var Y, te = ((Y = O.current) === null || Y === void 0 ? void 0 : Y.offsetWidth) || 0, Q = T - te;
- l <= Q ? H(0) : H(l + te - T);
- }
- }, [T, l, o]);
- function U(Y) {
- return Y.filter(function(te) {
- return te;
- });
- }
- var G = d.useMemo(function() {
- return U(Xr(h));
- }, [h]), B = r === "time" && !G.length, ne = d.useMemo(function() {
- return B ? U([w]) : G;
- }, [B, G, w]), le = B ? w : G, ee = d.useMemo(function() {
- return ne.length ? ne.some(function(Y) {
- return y(Y);
- }) : !0;
- }, [ne, y]), V = function() {
- B && g(w), E(), S();
- }, X = /* @__PURE__ */ d.createElement("div", {
- className: "".concat(R, "-panel-layout")
- }, /* @__PURE__ */ d.createElement(py, {
- prefixCls: R,
- presets: s,
- onClick: C,
- onHover: v
- }), /* @__PURE__ */ d.createElement("div", null, /* @__PURE__ */ d.createElement(my, _e({}, e, {
- value: le
- })), /* @__PURE__ */ d.createElement(ty, _e({}, e, {
- showNow: i ? !1 : a,
- invalid: ee,
- onSubmit: V
- }))));
- t && (X = t(X));
- var J = "".concat(k, "-container"), M = "marginLeft", D = "marginRight", j = /* @__PURE__ */ d.createElement("div", {
- onMouseDown: b,
- tabIndex: -1,
- className: xe(
- J,
- // Used for Today Button style, safe to remove if no need
- "".concat(R, "-").concat(n, "-panel-container")
- ),
- style: ie(ie({}, L ? D : M, A), L ? M : D, "auto"),
- onFocus: p,
- onBlur: m
- }, X);
- if (o) {
- var W = Lu(c, L), K = R0(W, L);
- j = /* @__PURE__ */ d.createElement("div", {
- onMouseDown: b,
- ref: N,
- className: xe("".concat(R, "-range-wrapper"), "".concat(R, "-").concat(r, "-range-wrapper"))
- }, /* @__PURE__ */ d.createElement("div", {
- ref: O,
- className: "".concat(R, "-range-arrow"),
- style: ie({}, K, l)
- }), /* @__PURE__ */ d.createElement(cr, {
- onResize: $
- }, j));
- }
- return j;
- }
- function gy(e, t) {
- var n = e.format, r = e.maskFormat, a = e.generateConfig, o = e.locale, i = e.preserveInvalidOnBlur, u = e.inputReadOnly, l = e.required, c = e["aria-required"], s = e.onSubmit, v = e.onFocus, C = e.onBlur, p = e.onInputChange, m = e.onInvalid, b = e.open, f = e.onOpenChange, h = e.onKeyDown, g = e.onChange, y = e.activeHelp, w = e.name, E = e.autoComplete, S = e.id, x = e.value, R = e.invalid, k = e.placeholder, L = e.disabled, O = e.activeIndex, N = e.allHelp, F = e.picker, I = function(U, G) {
- var B = a.locale.parse(o.locale, U, [G]);
- return B && a.isValidate(B) ? B : null;
- }, T = n[0], P = d.useCallback(function($) {
- return Vt($, {
- locale: o,
- format: T,
- generateConfig: a
- });
- }, [o, a, T]), z = d.useMemo(function() {
- return x.map(P);
- }, [x, P]), _ = d.useMemo(function() {
- var $ = F === "time" ? 8 : 10, U = typeof T == "function" ? T(a.getNow()).length : T.length;
- return Math.max($, U) + 2;
- }, [T, F, a]), A = function(U) {
- for (var G = 0; G < n.length; G += 1) {
- var B = n[G];
- if (typeof B == "string") {
- var ne = I(U, B);
- if (ne)
- return ne;
- }
- }
- return !1;
- }, H = function(U) {
- function G(le) {
- return U !== void 0 ? le[U] : le;
- }
- var B = or(e, {
- aria: !0,
- data: !0
- }), ne = re(re({}, B), {}, {
- // ============== Shared ==============
- format: r,
- validateFormat: function(ee) {
- return !!A(ee);
- },
- preserveInvalidOnBlur: i,
- readOnly: u,
- required: l,
- "aria-required": c,
- name: w,
- autoComplete: E,
- size: _,
- // ============= By Index =============
- id: G(S),
- value: G(z) || "",
- invalid: G(R),
- placeholder: G(k),
- active: O === U,
- helped: N || y && O === U,
- disabled: G(L),
- onFocus: function(ee) {
- v(ee, U);
- },
- onBlur: function(ee) {
- C(ee, U);
- },
- onSubmit: s,
- // Get validate text value
- onChange: function(ee) {
- p();
- var V = A(ee);
- if (V) {
- m(!1, U), g(V, U);
- return;
- }
- m(!!ee, U);
- },
- onHelp: function() {
- f(!0, {
- index: U
- });
- },
- onKeyDown: function(ee) {
- var V = !1;
- if (h == null || h(ee, function() {
- V = !0;
- }), !ee.defaultPrevented && !V)
- switch (ee.key) {
- case "Escape":
- f(!1, {
- index: U
- });
- break;
- case "Enter":
- b || f(!0);
- break;
- }
- }
- }, t == null ? void 0 : t({
- valueTexts: z
- }));
- return Object.keys(ne).forEach(function(le) {
- ne[le] === void 0 && delete ne[le];
- }), ne;
- };
- return [H, P];
- }
- var yy = ["onMouseEnter", "onMouseLeave"];
- function by(e) {
- return d.useMemo(function() {
- return qo(e, yy);
- }, [e]);
- }
- var Cy = ["icon", "type"], Sy = ["onClear"];
- function zu(e) {
- var t = e.icon, n = e.type, r = mt(e, Cy), a = d.useContext(Hn), o = a.prefixCls;
- return t ? /* @__PURE__ */ d.createElement("span", _e({
- className: "".concat(o, "-").concat(n)
- }, r), t) : null;
- }
- function cs(e) {
- var t = e.onClear, n = mt(e, Sy);
- return /* @__PURE__ */ d.createElement(zu, _e({}, n, {
- type: "clear",
- role: "button",
- onMouseDown: function(a) {
- a.preventDefault();
- },
- onClick: function(a) {
- a.stopPropagation(), t();
- }
- }));
- }
- var bi = ["YYYY", "MM", "DD", "HH", "mm", "ss", "SSS"], ds = "顧", wy = /* @__PURE__ */ function() {
- function e(t) {
- Rr(this, e), ie(this, "format", void 0), ie(this, "maskFormat", void 0), ie(this, "cells", void 0), ie(this, "maskCells", void 0), this.format = t;
- var n = bi.map(function(u) {
- return "(".concat(u, ")");
- }).join("|"), r = new RegExp(n, "g");
- this.maskFormat = t.replace(
- r,
- // Use Chinese character to avoid user use it in format
- function(u) {
- return ds.repeat(u.length);
- }
- );
- var a = new RegExp("(".concat(bi.join("|"), ")")), o = (t.split(a) || []).filter(function(u) {
- return u;
- }), i = 0;
- this.cells = o.map(function(u) {
- var l = bi.includes(u), c = i, s = i + u.length;
- return i = s, {
- text: u,
- mask: l,
- start: c,
- end: s
- };
- }), this.maskCells = this.cells.filter(function(u) {
- return u.mask;
- });
- }
- return Pr(e, [{
- key: "getSelection",
- value: function(n) {
- var r = this.maskCells[n] || {}, a = r.start, o = r.end;
- return [a || 0, o || 0];
- }
- /** Check given text match format */
- }, {
- key: "match",
- value: function(n) {
- for (var r = 0; r < this.maskFormat.length; r += 1) {
- var a = this.maskFormat[r], o = n[r];
- if (!o || a !== ds && a !== o)
- return !1;
- }
- return !0;
- }
- /** Get mask cell count */
- }, {
- key: "size",
- value: function() {
- return this.maskCells.length;
- }
- }, {
- key: "getMaskCellIndex",
- value: function(n) {
- for (var r = Number.MAX_SAFE_INTEGER, a = 0, o = 0; o < this.maskCells.length; o += 1) {
- var i = this.maskCells[o], u = i.start, l = i.end;
- if (n >= u && n <= l)
- return o;
- var c = Math.min(Math.abs(n - u), Math.abs(n - l));
- c < r && (r = c, a = o);
- }
- return a;
- }
- }]), e;
- }();
- function xy(e) {
- var t = {
- YYYY: [0, 9999, (/* @__PURE__ */ new Date()).getFullYear()],
- MM: [1, 12],
- DD: [1, 31],
- HH: [0, 23],
- mm: [0, 59],
- ss: [0, 59],
- SSS: [0, 999]
- };
- return t[e];
- }
- var Ey = ["active", "showActiveCls", "suffixIcon", "format", "validateFormat", "onChange", "onInput", "helped", "onHelp", "onSubmit", "onKeyDown", "preserveInvalidOnBlur", "invalid", "clearIcon"], Ry = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.active, r = e.showActiveCls, a = r === void 0 ? !0 : r, o = e.suffixIcon, i = e.format, u = e.validateFormat, l = e.onChange;
- e.onInput;
- var c = e.helped, s = e.onHelp, v = e.onSubmit, C = e.onKeyDown, p = e.preserveInvalidOnBlur, m = p === void 0 ? !1 : p, b = e.invalid, f = e.clearIcon, h = mt(e, Ey), g = e.value, y = e.onFocus, w = e.onBlur, E = e.onMouseUp, S = d.useContext(Hn), x = S.prefixCls, R = S.input, k = R === void 0 ? "input" : R, L = "".concat(x, "-input"), O = d.useState(!1), N = Z(O, 2), F = N[0], I = N[1], T = d.useState(g), P = Z(T, 2), z = P[0], _ = P[1], A = d.useState(""), H = Z(A, 2), $ = H[0], U = H[1], G = d.useState(null), B = Z(G, 2), ne = B[0], le = B[1], ee = d.useState(null), V = Z(ee, 2), X = V[0], J = V[1], M = z || "";
- d.useEffect(function() {
- _(g);
- }, [g]);
- var D = d.useRef(), j = d.useRef();
- d.useImperativeHandle(t, function() {
- return {
- nativeElement: D.current,
- inputElement: j.current,
- focus: function(ce) {
- j.current.focus(ce);
- },
- blur: function() {
- j.current.blur();
- }
- };
- });
- var W = d.useMemo(function() {
- return new wy(i || "");
- }, [i]), K = d.useMemo(function() {
- return c ? [0, 0] : W.getSelection(ne);
- }, [W, ne, c]), Y = Z(K, 2), te = Y[0], Q = Y[1], ae = function(ce) {
- ce && ce !== i && ce !== g && s();
- }, ue = Ct(function(Ne) {
- u(Ne) && l(Ne), _(Ne), ae(Ne);
- }), se = function(ce) {
- if (!i) {
- var he = ce.target.value;
- ae(he), _(he), l(he);
- }
- }, pe = function(ce) {
- var he = ce.clipboardData.getData("text");
- u(he) && ue(he);
- }, oe = d.useRef(!1), ve = function() {
- oe.current = !0;
- }, ze = function(ce) {
- var he = ce.target, Ve = he.selectionStart, de = W.getMaskCellIndex(Ve);
- le(de), J({}), E == null || E(ce), oe.current = !1;
- }, Re = function(ce) {
- I(!0), le(0), U(""), y(ce);
- }, Be = function(ce) {
- w(ce);
- }, je = function(ce) {
- I(!1), Be(ce);
- };
- ju(n, function() {
- !n && !m && _(g);
- });
- var He = function(ce) {
- ce.key === "Enter" && u(M) && v(), C == null || C(ce);
- }, Ye = function(ce) {
- He(ce);
- var he = ce.key, Ve = null, de = null, be = Q - te, Xe = i.slice(te, Q), it = function(ke) {
- le(function(Te) {
- var Ke = Te + ke;
- return Ke = Math.max(Ke, 0), Ke = Math.min(Ke, W.size() - 1), Ke;
- });
- }, tt = function(ke) {
- var Te = xy(Xe), Ke = Z(Te, 3), De = Ke[0], we = Ke[1], ye = Ke[2], ut = M.slice(te, Q), yt = Number(ut);
- if (isNaN(yt))
- return String(ye || (ke > 0 ? De : we));
- var Ie = yt + ke, Oe = we - De + 1;
- return String(De + (Oe + Ie - De) % Oe);
- };
- switch (he) {
- // =============== Remove ===============
- case "Backspace":
- case "Delete":
- Ve = "", de = Xe;
- break;
- // =============== Arrows ===============
- // Left key
- case "ArrowLeft":
- Ve = "", it(-1);
- break;
- // Right key
- case "ArrowRight":
- Ve = "", it(1);
- break;
- // Up key
- case "ArrowUp":
- Ve = "", de = tt(1);
- break;
- // Down key
- case "ArrowDown":
- Ve = "", de = tt(-1);
- break;
- // =============== Number ===============
- default:
- isNaN(Number(he)) || (Ve = $ + he, de = Ve);
- break;
- }
- if (Ve !== null && (U(Ve), Ve.length >= be && (it(1), U(""))), de !== null) {
- var $e = (
- // before
- M.slice(0, te) + // replace
- Tu(de, be) + // after
- M.slice(Q)
- );
- ue($e.slice(0, i.length));
- }
- J({});
- }, nt = d.useRef();
- St(function() {
- if (!(!F || !i || oe.current)) {
- if (!W.match(M)) {
- ue(i);
- return;
- }
- return j.current.setSelectionRange(te, Q), nt.current = st(function() {
- j.current.setSelectionRange(te, Q);
- }), function() {
- st.cancel(nt.current);
- };
- }
- }, [W, i, F, M, ne, te, Q, X, ue]);
- var Ge = i ? {
- onFocus: Re,
- onBlur: je,
- onKeyDown: Ye,
- onMouseDown: ve,
- onMouseUp: ze,
- onPaste: pe
- } : {};
- return /* @__PURE__ */ d.createElement("div", {
- ref: D,
- className: xe(L, ie(ie({}, "".concat(L, "-active"), n && a), "".concat(L, "-placeholder"), c))
- }, /* @__PURE__ */ d.createElement(k, _e({
- ref: j,
- "aria-invalid": b,
- autoComplete: "off"
- }, h, {
- onKeyDown: He,
- onBlur: Be
- // Replace with format
- }, Ge, {
- // Value
- value: M,
- onChange: se
- })), /* @__PURE__ */ d.createElement(zu, {
- type: "suffix",
- icon: o
- }), f);
- }), Py = ["prefixCls", "invalidate", "item", "renderItem", "responsive", "responsiveDisabled", "registerSize", "itemKey", "className", "style", "children", "display", "order", "component"], Or = void 0;
- function My(e, t) {
- var n = e.prefixCls, r = e.invalidate, a = e.item, o = e.renderItem, i = e.responsive, u = e.responsiveDisabled, l = e.registerSize, c = e.itemKey, s = e.className, v = e.style, C = e.children, p = e.display, m = e.order, b = e.component, f = b === void 0 ? "div" : b, h = mt(e, Py), g = i && !p;
- function y(R) {
- l(c, R);
- }
- d.useEffect(function() {
- return function() {
- y(null);
- };
- }, []);
- var w = o && a !== Or ? o(a) : C, E;
- r || (E = {
- opacity: g ? 0 : 1,
- height: g ? 0 : Or,
- overflowY: g ? "hidden" : Or,
- order: i ? m : Or,
- pointerEvents: g ? "none" : Or,
- position: g ? "absolute" : Or
- });
- var S = {};
- g && (S["aria-hidden"] = !0);
- var x = /* @__PURE__ */ d.createElement(f, _e({
- className: xe(!r && n, s),
- style: re(re({}, E), v)
- }, S, h, {
- ref: t
- }), w);
- return i && (x = /* @__PURE__ */ d.createElement(cr, {
- onResize: function(k) {
- var L = k.offsetWidth;
- y(L);
- },
- disabled: u
- }, x)), x;
- }
- var ka = /* @__PURE__ */ d.forwardRef(My);
- ka.displayName = "Item";
- function ky(e) {
- if (typeof MessageChannel > "u")
- st(e);
- else {
- var t = new MessageChannel();
- t.port1.onmessage = function() {
- return e();
- }, t.port2.postMessage(void 0);
- }
- }
- function Dy() {
- var e = d.useRef(null), t = function(r) {
- e.current || (e.current = [], ky(function() {
- lv(function() {
- e.current.forEach(function(a) {
- a();
- }), e.current = null;
- });
- })), e.current.push(r);
- };
- return t;
- }
- function ca(e, t) {
- var n = d.useState(t), r = Z(n, 2), a = r[0], o = r[1], i = Ct(function(u) {
- e(function() {
- o(u);
- });
- });
- return [a, i];
- }
- var To = /* @__PURE__ */ me.createContext(null), Ny = ["component"], Iy = ["className"], Oy = ["className"], _y = function(t, n) {
- var r = d.useContext(To);
- if (!r) {
- var a = t.component, o = a === void 0 ? "div" : a, i = mt(t, Ny);
- return /* @__PURE__ */ d.createElement(o, _e({}, i, {
- ref: n
- }));
- }
- var u = r.className, l = mt(r, Iy), c = t.className, s = mt(t, Oy);
- return /* @__PURE__ */ d.createElement(To.Provider, {
- value: null
- }, /* @__PURE__ */ d.createElement(ka, _e({
- ref: n,
- className: xe(u, c)
- }, l, s)));
- }, vf = /* @__PURE__ */ d.forwardRef(_y);
- vf.displayName = "RawItem";
- var Ly = ["prefixCls", "data", "renderItem", "renderRawItem", "itemKey", "itemWidth", "ssr", "style", "className", "maxCount", "renderRest", "renderRawRest", "suffix", "component", "itemComponent", "onVisibleChange"], mf = "responsive", pf = "invalidate";
- function Ty(e) {
- return "+ ".concat(e.length, " ...");
- }
- function $y(e, t) {
- var n = e.prefixCls, r = n === void 0 ? "rc-overflow" : n, a = e.data, o = a === void 0 ? [] : a, i = e.renderItem, u = e.renderRawItem, l = e.itemKey, c = e.itemWidth, s = c === void 0 ? 10 : c, v = e.ssr, C = e.style, p = e.className, m = e.maxCount, b = e.renderRest, f = e.renderRawRest, h = e.suffix, g = e.component, y = g === void 0 ? "div" : g, w = e.itemComponent, E = e.onVisibleChange, S = mt(e, Ly), x = v === "full", R = Dy(), k = ca(R, null), L = Z(k, 2), O = L[0], N = L[1], F = O || 0, I = ca(R, /* @__PURE__ */ new Map()), T = Z(I, 2), P = T[0], z = T[1], _ = ca(R, 0), A = Z(_, 2), H = A[0], $ = A[1], U = ca(R, 0), G = Z(U, 2), B = G[0], ne = G[1], le = ca(R, 0), ee = Z(le, 2), V = ee[0], X = ee[1], J = rt(null), M = Z(J, 2), D = M[0], j = M[1], W = rt(null), K = Z(W, 2), Y = K[0], te = K[1], Q = d.useMemo(function() {
- return Y === null && x ? Number.MAX_SAFE_INTEGER : Y || 0;
- }, [Y, O]), ae = rt(!1), ue = Z(ae, 2), se = ue[0], pe = ue[1], oe = "".concat(r, "-item"), ve = Math.max(H, B), ze = m === mf, Re = o.length && ze, Be = m === pf, je = Re || typeof m == "number" && o.length > m, He = Ht(function() {
- var De = o;
- return Re ? O === null && x ? De = o : De = o.slice(0, Math.min(o.length, F / s)) : typeof m == "number" && (De = o.slice(0, m)), De;
- }, [o, s, O, m, Re]), Ye = Ht(function() {
- return Re ? o.slice(Q + 1) : o.slice(He.length);
- }, [o, He, Re, Q]), nt = Ot(function(De, we) {
- var ye;
- return typeof l == "function" ? l(De) : (ye = l && (De == null ? void 0 : De[l])) !== null && ye !== void 0 ? ye : we;
- }, [l]), Ge = Ot(i || function(De) {
- return De;
- }, [i]);
- function Ne(De, we, ye) {
- Y === De && (we === void 0 || we === D) || (te(De), ye || (pe(De < o.length - 1), E == null || E(De)), we !== void 0 && j(we));
- }
- function ce(De, we) {
- N(we.clientWidth);
- }
- function he(De, we) {
- z(function(ye) {
- var ut = new Map(ye);
- return we === null ? ut.delete(De) : ut.set(De, we), ut;
- });
- }
- function Ve(De, we) {
- ne(we), $(B);
- }
- function de(De, we) {
- X(we);
- }
- function be(De) {
- return P.get(nt(He[De], De));
- }
- St(function() {
- if (F && typeof ve == "number" && He) {
- var De = V, we = He.length, ye = we - 1;
- if (!we) {
- Ne(0, null);
- return;
- }
- for (var ut = 0; ut < we; ut += 1) {
- var yt = be(ut);
- if (x && (yt = yt || 0), yt === void 0) {
- Ne(ut - 1, void 0, !0);
- break;
- }
- if (De += yt, // Only one means `totalWidth` is the final width
- ye === 0 && De <= F || // Last two width will be the final width
- ut === ye - 1 && De + be(ye) <= F) {
- Ne(ye, null);
- break;
- } else if (De + ve > F) {
- Ne(ut - 1, De - yt - V + B);
- break;
- }
- }
- h && be(0) + V > F && j(null);
- }
- }, [F, P, B, V, nt, He]);
- var Xe = se && !!Ye.length, it = {};
- D !== null && Re && (it = {
- position: "absolute",
- left: D,
- top: 0
- });
- var tt = {
- prefixCls: oe,
- responsive: Re,
- component: w,
- invalidate: Be
- }, $e = u ? function(De, we) {
- var ye = nt(De, we);
- return /* @__PURE__ */ d.createElement(To.Provider, {
- key: ye,
- value: re(re({}, tt), {}, {
- order: we,
- item: De,
- itemKey: ye,
- registerSize: he,
- display: we <= Q
- })
- }, u(De, we));
- } : function(De, we) {
- var ye = nt(De, we);
- return /* @__PURE__ */ d.createElement(ka, _e({}, tt, {
- order: we,
- key: ye,
- item: De,
- renderItem: Ge,
- itemKey: ye,
- registerSize: he,
- display: we <= Q
- }));
- }, ge, ke = {
- order: Xe ? Q : Number.MAX_SAFE_INTEGER,
- className: "".concat(oe, "-rest"),
- registerSize: Ve,
- display: Xe
- };
- if (f)
- f && (ge = /* @__PURE__ */ d.createElement(To.Provider, {
- value: re(re({}, tt), ke)
- }, f(Ye)));
- else {
- var Te = b || Ty;
- ge = /* @__PURE__ */ d.createElement(ka, _e({}, tt, ke), typeof Te == "function" ? Te(Ye) : Te);
- }
- var Ke = /* @__PURE__ */ d.createElement(y, _e({
- className: xe(!Be && r, p),
- style: C,
- ref: t
- }, S), He.map($e), je ? ge : null, h && /* @__PURE__ */ d.createElement(ka, _e({}, tt, {
- responsive: ze,
- responsiveDisabled: !Re,
- order: Q,
- className: "".concat(oe, "-suffix"),
- registerSize: de,
- display: !0,
- style: it
- }), h));
- return ze && (Ke = /* @__PURE__ */ d.createElement(cr, {
- onResize: ce,
- disabled: !Re
- }, Ke)), Ke;
- }
- var kn = /* @__PURE__ */ d.forwardRef($y);
- kn.displayName = "Overflow";
- kn.Item = vf;
- kn.RESPONSIVE = mf;
- kn.INVALIDATE = pf;
- function Ay(e) {
- var t = e.prefixCls, n = e.value, r = e.onRemove, a = e.removeIcon, o = a === void 0 ? "×" : a, i = e.formatDate, u = e.disabled, l = e.maxTagCount, c = e.placeholder, s = "".concat(t, "-selector"), v = "".concat(t, "-selection"), C = "".concat(v, "-overflow");
- function p(f, h) {
- return /* @__PURE__ */ d.createElement("span", {
- className: xe("".concat(v, "-item")),
- title: typeof f == "string" ? f : null
- }, /* @__PURE__ */ d.createElement("span", {
- className: "".concat(v, "-item-content")
- }, f), !u && h && /* @__PURE__ */ d.createElement("span", {
- onMouseDown: function(y) {
- y.preventDefault();
- },
- onClick: h,
- className: "".concat(v, "-item-remove")
- }, o));
- }
- function m(f) {
- var h = i(f), g = function(w) {
- w && w.stopPropagation(), r(f);
- };
- return p(h, g);
- }
- function b(f) {
- var h = "+ ".concat(f.length, " ...");
- return p(h);
- }
- return /* @__PURE__ */ d.createElement("div", {
- className: s
- }, /* @__PURE__ */ d.createElement(kn, {
- prefixCls: C,
- data: n,
- renderItem: m,
- renderRest: b,
- itemKey: function(h) {
- return i(h);
- },
- maxCount: l
- }), !n.length && /* @__PURE__ */ d.createElement("span", {
- className: "".concat(t, "-selection-placeholder")
- }, c));
- }
- var jy = ["id", "open", "prefix", "clearIcon", "suffixIcon", "activeHelp", "allHelp", "focused", "onFocus", "onBlur", "onKeyDown", "locale", "generateConfig", "placeholder", "className", "style", "onClick", "onClear", "internalPicker", "value", "onChange", "onSubmit", "onInputChange", "multiple", "maxTagCount", "format", "maskFormat", "preserveInvalidOnBlur", "onInvalid", "disabled", "invalid", "inputReadOnly", "direction", "onOpenChange", "onMouseDown", "required", "aria-required", "autoFocus", "tabIndex", "removeIcon"];
- function Fy(e, t) {
- e.id;
- var n = e.open, r = e.prefix, a = e.clearIcon, o = e.suffixIcon;
- e.activeHelp, e.allHelp;
- var i = e.focused;
- e.onFocus, e.onBlur, e.onKeyDown;
- var u = e.locale, l = e.generateConfig, c = e.placeholder, s = e.className, v = e.style, C = e.onClick, p = e.onClear, m = e.internalPicker, b = e.value, f = e.onChange, h = e.onSubmit;
- e.onInputChange;
- var g = e.multiple, y = e.maxTagCount;
- e.format, e.maskFormat, e.preserveInvalidOnBlur, e.onInvalid;
- var w = e.disabled, E = e.invalid;
- e.inputReadOnly;
- var S = e.direction;
- e.onOpenChange;
- var x = e.onMouseDown;
- e.required, e["aria-required"];
- var R = e.autoFocus, k = e.tabIndex, L = e.removeIcon, O = mt(e, jy), N = S === "rtl", F = d.useContext(Hn), I = F.prefixCls, T = d.useRef(), P = d.useRef();
- d.useImperativeHandle(t, function() {
- return {
- nativeElement: T.current,
- focus: function(ee) {
- var V;
- (V = P.current) === null || V === void 0 || V.focus(ee);
- },
- blur: function() {
- var ee;
- (ee = P.current) === null || ee === void 0 || ee.blur();
- }
- };
- });
- var z = by(O), _ = function(ee) {
- f([ee]);
- }, A = function(ee) {
- var V = b.filter(function(X) {
- return X && !ln(l, u, X, ee, m);
- });
- f(V), n || h();
- }, H = gy(re(re({}, e), {}, {
- onChange: _
- }), function(le) {
- var ee = le.valueTexts;
- return {
- value: ee[0] || "",
- active: i
- };
- }), $ = Z(H, 2), U = $[0], G = $[1], B = !!(a && b.length && !w), ne = g ? /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement(Ay, {
- prefixCls: I,
- value: b,
- onRemove: A,
- formatDate: G,
- maxTagCount: y,
- disabled: w,
- removeIcon: L,
- placeholder: c
- }), /* @__PURE__ */ d.createElement("input", {
- className: "".concat(I, "-multiple-input"),
- value: b.map(G).join(","),
- ref: P,
- readOnly: !0,
- autoFocus: R,
- tabIndex: k
- }), /* @__PURE__ */ d.createElement(zu, {
- type: "suffix",
- icon: o
- }), B && /* @__PURE__ */ d.createElement(cs, {
- icon: a,
- onClear: p
- })) : /* @__PURE__ */ d.createElement(Ry, _e({
- ref: P
- }, U(), {
- autoFocus: R,
- tabIndex: k,
- suffixIcon: o,
- clearIcon: B && /* @__PURE__ */ d.createElement(cs, {
- icon: a,
- onClear: p
- }),
- showActiveCls: !1
- }));
- return /* @__PURE__ */ d.createElement("div", _e({}, z, {
- className: xe(I, ie(ie(ie(ie(ie({}, "".concat(I, "-multiple"), g), "".concat(I, "-focused"), i), "".concat(I, "-disabled"), w), "".concat(I, "-invalid"), E), "".concat(I, "-rtl"), N), s),
- style: v,
- ref: T,
- onClick: C,
- onMouseDown: function(ee) {
- var V, X = ee.target;
- X !== ((V = P.current) === null || V === void 0 ? void 0 : V.inputElement) && ee.preventDefault(), x == null || x(ee);
- }
- }), r && /* @__PURE__ */ d.createElement("div", {
- className: "".concat(I, "-prefix")
- }, r), ne);
- }
- var zy = /* @__PURE__ */ d.forwardRef(Fy);
- function Hy(e, t) {
- var n = H0(e), r = Z(n, 6), a = r[0], o = r[1], i = r[2], u = r[3], l = r[4], c = r[5], s = a, v = s.prefixCls, C = s.styles, p = s.classNames, m = s.order, b = s.defaultValue, f = s.value, h = s.needConfirm, g = s.onChange, y = s.onKeyDown, w = s.disabled, E = s.disabledDate, S = s.minDate, x = s.maxDate, R = s.defaultOpen, k = s.open, L = s.onOpenChange, O = s.locale, N = s.generateConfig, F = s.picker, I = s.showNow, T = s.showToday, P = s.showTime, z = s.mode, _ = s.onPanelChange, A = s.onCalendarChange, H = s.onOk, $ = s.multiple, U = s.defaultPickerValue, G = s.pickerValue, B = s.onPickerValueChange, ne = s.inputReadOnly, le = s.suffixIcon, ee = s.removeIcon, V = s.onFocus, X = s.onBlur, J = s.presets, M = s.components, D = s.cellRender, j = s.dateRender, W = s.monthCellRender, K = s.onClick, Y = B0(t);
- function te(Se) {
- return Se === null ? null : $ ? Se : Se[0];
- }
- var Q = df(N, O, o), ae = W0(k, R, [w], L), ue = Z(ae, 2), se = ue[0], pe = ue[1], oe = function(Me, gt, Rt) {
- if (A) {
- var Kt = re({}, Rt);
- delete Kt.range, A(te(Me), te(gt), Kt);
- }
- }, ve = function(Me) {
- H == null || H(te(Me));
- }, ze = Z0(N, O, u, !1, m, b, f, oe, ve), Re = Z(ze, 5), Be = Re[0], je = Re[1], He = Re[2], Ye = Re[3], nt = Re[4], Ge = He(), Ne = q0([w]), ce = Z(Ne, 4), he = ce[0], Ve = ce[1], de = ce[2], be = ce[3], Xe = function(Me) {
- Ve(!0), V == null || V(Me, {});
- }, it = function(Me) {
- Ve(!1), X == null || X(Me, {});
- }, tt = Gt(F, {
- value: z
- }), $e = Z(tt, 2), ge = $e[0], ke = $e[1], Te = ge === "date" && P ? "datetime" : ge, Ke = J0(F, ge, I, T), De = g && function(Se, Me) {
- g(te(Se), te(Me));
- }, we = Q0(
- re(re({}, a), {}, {
- onChange: De
- }),
- Be,
- je,
- He,
- Ye,
- [],
- //disabled,
- u,
- he,
- se,
- c
- ), ye = Z(we, 2), ut = ye[1], yt = D0(Ge, c), Ie = Z(yt, 2), Oe = Ie[0], We = Ie[1], Ue = d.useMemo(function() {
- return Oe.some(function(Se) {
- return Se;
- });
- }, [Oe]), Ze = function(Me, gt) {
- if (B) {
- var Rt = re(re({}, gt), {}, {
- mode: gt.mode[0]
- });
- delete Rt.range, B(Me[0], Rt);
- }
- }, at = Y0(
- N,
- O,
- Ge,
- [ge],
- se,
- be,
- o,
- !1,
- // multiplePanel,
- U,
- G,
- Xr(P == null ? void 0 : P.defaultOpenValue),
- Ze,
- S,
- x
- ), Lt = Z(at, 2), Et = Lt[0], wt = Lt[1], pt = Ct(function(Se, Me, gt) {
- if (ke(Me), _ && gt !== !1) {
- var Rt = Se || Ge[Ge.length - 1];
- _(Rt, Me);
- }
- }), xt = function() {
- ut(He()), pe(!1, {
- force: !0
- });
- }, Ft = function(Me) {
- !w && !Y.current.nativeElement.contains(document.activeElement) && Y.current.focus(), pe(!0), K == null || K(Me);
- }, Mt = function() {
- ut(null), pe(!1, {
- force: !0
- });
- }, Qt = d.useState(null), Le = Z(Qt, 2), Pe = Le[0], qe = Le[1], vt = d.useState(null), ht = Z(vt, 2), Dt = ht[0], Nt = ht[1], an = d.useMemo(function() {
- var Se = [Dt].concat(ft(Ge)).filter(function(Me) {
- return Me;
- });
- return $ ? Se : Se.slice(0, 1);
- }, [Ge, Dt, $]), vn = d.useMemo(function() {
- return !$ && Dt ? [Dt] : Ge.filter(function(Se) {
- return Se;
- });
- }, [Ge, Dt, $]);
- d.useEffect(function() {
- se || Nt(null);
- }, [se]);
- var on = U0(J), Wt = function(Me) {
- Nt(Me), qe("preset");
- }, mn = function(Me) {
- var gt = $ ? Q(He(), Me) : [Me], Rt = ut(gt);
- Rt && !$ && pe(!1, {
- force: !0
- });
- }, Jt = function(Me) {
- mn(Me);
- }, en = function(Me) {
- Nt(Me), qe("cell");
- }, On = function(Me) {
- pe(!0), Xe(Me);
- }, wn = function(Me) {
- de("panel");
- var gt = $ ? Q(He(), Me) : [Me];
- Ye(gt), !h && !i && o === Te && xt();
- }, Bt = function() {
- pe(!1);
- }, Ut = Qd(D, j, W), pn = d.useMemo(function() {
- var Se = or(a, !1), Me = Er(a, [].concat(ft(Object.keys(Se)), ["onChange", "onCalendarChange", "style", "className", "onPanelChange"]));
- return re(re({}, Me), {}, {
- multiple: a.multiple
- });
- }, [a]), hn = /* @__PURE__ */ d.createElement(hy, _e({}, pn, {
- showNow: Ke,
- showTime: P,
- disabledDate: E,
- onFocus: On,
- onBlur: it,
- picker: F,
- mode: ge,
- internalMode: Te,
- onPanelChange: pt,
- format: l,
- value: Ge,
- isInvalid: c,
- onChange: null,
- onSelect: wn,
- pickerValue: Et,
- defaultOpenValue: P == null ? void 0 : P.defaultOpenValue,
- onPickerValueChange: wt,
- hoverValue: an,
- onHover: en,
- needConfirm: h,
- onSubmit: xt,
- onOk: nt,
- presets: on,
- onPresetHover: Wt,
- onPresetSubmit: mn,
- onNow: Jt,
- cellRender: Ut
- })), qt = function(Me) {
- Ye(Me);
- }, xn = function() {
- de("input");
- }, Fe = function(Me) {
- de("input"), pe(!0, {
- inherit: !0
- }), Xe(Me);
- }, Ee = function(Me) {
- pe(!1), it(Me);
- }, Je = function(Me, gt) {
- Me.key === "Tab" && xt(), y == null || y(Me, gt);
- }, ct = d.useMemo(function() {
- return {
- prefixCls: v,
- locale: O,
- generateConfig: N,
- button: M.button,
- input: M.input
- };
- }, [v, O, N, M.button, M.input]);
- return St(function() {
- se && be !== void 0 && pt(null, F, !1);
- }, [se, be, F]), St(function() {
- var Se = de();
- !se && Se === "input" && (pe(!1), xt()), !se && i && !h && Se === "panel" && (pe(!0), xt());
- }, [se]), /* @__PURE__ */ d.createElement(Hn.Provider, {
- value: ct
- }, /* @__PURE__ */ d.createElement(M0, _e({}, k0(a), {
- popupElement: hn,
- popupStyle: C.popup,
- popupClassName: p.popup,
- visible: se,
- onClose: Bt
- }), /* @__PURE__ */ d.createElement(
- zy,
- _e({}, a, {
- // Ref
- ref: Y,
- suffixIcon: le,
- removeIcon: ee,
- activeHelp: !!Dt,
- allHelp: !!Dt && Pe === "preset",
- focused: he,
- onFocus: Fe,
- onBlur: Ee,
- onKeyDown: Je,
- onSubmit: xt,
- value: vn,
- maskFormat: l,
- onChange: qt,
- onInputChange: xn,
- internalPicker: o,
- format: u,
- inputReadOnly: ne,
- disabled: w,
- open: se,
- onOpenChange: pe,
- onClick: Ft,
- onClear: Mt,
- invalid: Ue,
- onInvalid: function(Me) {
- We(Me, 0);
- }
- })
- )));
- }
- var Vy = /* @__PURE__ */ d.forwardRef(Hy), da = {}, Ci = { exports: {} }, fs;
- function Wy() {
- return fs || (fs = 1, function(e) {
- function t(n) {
- return n && n.__esModule ? n : {
- default: n
- };
- }
- e.exports = t, e.exports.__esModule = !0, e.exports.default = e.exports;
- }(Ci)), Ci.exports;
- }
- var ho = { exports: {} }, By = ho.exports, vs;
- function Uy() {
- return vs || (vs = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(By, function() {
- var n = 1e3, r = 6e4, a = 36e5, o = "millisecond", i = "second", u = "minute", l = "hour", c = "day", s = "week", v = "month", C = "quarter", p = "year", m = "date", b = "Invalid Date", f = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, h = /\[([^\]]+)]|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, g = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(I) {
- var T = ["th", "st", "nd", "rd"], P = I % 100;
- return "[" + I + (T[(P - 20) % 10] || T[P] || T[0]) + "]";
- } }, y = function(I, T, P) {
- var z = String(I);
- return !z || z.length >= T ? I : "" + Array(T + 1 - z.length).join(P) + I;
- }, w = { s: y, z: function(I) {
- var T = -I.utcOffset(), P = Math.abs(T), z = Math.floor(P / 60), _ = P % 60;
- return (T <= 0 ? "+" : "-") + y(z, 2, "0") + ":" + y(_, 2, "0");
- }, m: function I(T, P) {
- if (T.date() < P.date()) return -I(P, T);
- var z = 12 * (P.year() - T.year()) + (P.month() - T.month()), _ = T.clone().add(z, v), A = P - _ < 0, H = T.clone().add(z + (A ? -1 : 1), v);
- return +(-(z + (P - _) / (A ? _ - H : H - _)) || 0);
- }, a: function(I) {
- return I < 0 ? Math.ceil(I) || 0 : Math.floor(I);
- }, p: function(I) {
- return { M: v, y: p, w: s, d: c, D: m, h: l, m: u, s: i, ms: o, Q: C }[I] || String(I || "").toLowerCase().replace(/s$/, "");
- }, u: function(I) {
- return I === void 0;
- } }, E = "en", S = {};
- S[E] = g;
- var x = "$isDayjsObject", R = function(I) {
- return I instanceof N || !(!I || !I[x]);
- }, k = function I(T, P, z) {
- var _;
- if (!T) return E;
- if (typeof T == "string") {
- var A = T.toLowerCase();
- S[A] && (_ = A), P && (S[A] = P, _ = A);
- var H = T.split("-");
- if (!_ && H.length > 1) return I(H[0]);
- } else {
- var $ = T.name;
- S[$] = T, _ = $;
- }
- return !z && _ && (E = _), _ || !z && E;
- }, L = function(I, T) {
- if (R(I)) return I.clone();
- var P = typeof T == "object" ? T : {};
- return P.date = I, P.args = arguments, new N(P);
- }, O = w;
- O.l = k, O.i = R, O.w = function(I, T) {
- return L(I, { locale: T.$L, utc: T.$u, x: T.$x, $offset: T.$offset });
- };
- var N = function() {
- function I(P) {
- this.$L = k(P.locale, null, !0), this.parse(P), this.$x = this.$x || P.x || {}, this[x] = !0;
- }
- var T = I.prototype;
- return T.parse = function(P) {
- this.$d = function(z) {
- var _ = z.date, A = z.utc;
- if (_ === null) return /* @__PURE__ */ new Date(NaN);
- if (O.u(_)) return /* @__PURE__ */ new Date();
- if (_ instanceof Date) return new Date(_);
- if (typeof _ == "string" && !/Z$/i.test(_)) {
- var H = _.match(f);
- if (H) {
- var $ = H[2] - 1 || 0, U = (H[7] || "0").substring(0, 3);
- return A ? new Date(Date.UTC(H[1], $, H[3] || 1, H[4] || 0, H[5] || 0, H[6] || 0, U)) : new Date(H[1], $, H[3] || 1, H[4] || 0, H[5] || 0, H[6] || 0, U);
- }
- }
- return new Date(_);
- }(P), this.init();
- }, T.init = function() {
- var P = this.$d;
- this.$y = P.getFullYear(), this.$M = P.getMonth(), this.$D = P.getDate(), this.$W = P.getDay(), this.$H = P.getHours(), this.$m = P.getMinutes(), this.$s = P.getSeconds(), this.$ms = P.getMilliseconds();
- }, T.$utils = function() {
- return O;
- }, T.isValid = function() {
- return this.$d.toString() !== b;
- }, T.isSame = function(P, z) {
- var _ = L(P);
- return this.startOf(z) <= _ && _ <= this.endOf(z);
- }, T.isAfter = function(P, z) {
- return L(P) < this.startOf(z);
- }, T.isBefore = function(P, z) {
- return this.endOf(z) < L(P);
- }, T.$g = function(P, z, _) {
- return O.u(P) ? this[z] : this.set(_, P);
- }, T.unix = function() {
- return Math.floor(this.valueOf() / 1e3);
- }, T.valueOf = function() {
- return this.$d.getTime();
- }, T.startOf = function(P, z) {
- var _ = this, A = !!O.u(z) || z, H = O.p(P), $ = function(X, J) {
- var M = O.w(_.$u ? Date.UTC(_.$y, J, X) : new Date(_.$y, J, X), _);
- return A ? M : M.endOf(c);
- }, U = function(X, J) {
- return O.w(_.toDate()[X].apply(_.toDate("s"), (A ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(J)), _);
- }, G = this.$W, B = this.$M, ne = this.$D, le = "set" + (this.$u ? "UTC" : "");
- switch (H) {
- case p:
- return A ? $(1, 0) : $(31, 11);
- case v:
- return A ? $(1, B) : $(0, B + 1);
- case s:
- var ee = this.$locale().weekStart || 0, V = (G < ee ? G + 7 : G) - ee;
- return $(A ? ne - V : ne + (6 - V), B);
- case c:
- case m:
- return U(le + "Hours", 0);
- case l:
- return U(le + "Minutes", 1);
- case u:
- return U(le + "Seconds", 2);
- case i:
- return U(le + "Milliseconds", 3);
- default:
- return this.clone();
- }
- }, T.endOf = function(P) {
- return this.startOf(P, !1);
- }, T.$set = function(P, z) {
- var _, A = O.p(P), H = "set" + (this.$u ? "UTC" : ""), $ = (_ = {}, _[c] = H + "Date", _[m] = H + "Date", _[v] = H + "Month", _[p] = H + "FullYear", _[l] = H + "Hours", _[u] = H + "Minutes", _[i] = H + "Seconds", _[o] = H + "Milliseconds", _)[A], U = A === c ? this.$D + (z - this.$W) : z;
- if (A === v || A === p) {
- var G = this.clone().set(m, 1);
- G.$d[$](U), G.init(), this.$d = G.set(m, Math.min(this.$D, G.daysInMonth())).$d;
- } else $ && this.$d[$](U);
- return this.init(), this;
- }, T.set = function(P, z) {
- return this.clone().$set(P, z);
- }, T.get = function(P) {
- return this[O.p(P)]();
- }, T.add = function(P, z) {
- var _, A = this;
- P = Number(P);
- var H = O.p(z), $ = function(B) {
- var ne = L(A);
- return O.w(ne.date(ne.date() + Math.round(B * P)), A);
- };
- if (H === v) return this.set(v, this.$M + P);
- if (H === p) return this.set(p, this.$y + P);
- if (H === c) return $(1);
- if (H === s) return $(7);
- var U = (_ = {}, _[u] = r, _[l] = a, _[i] = n, _)[H] || 1, G = this.$d.getTime() + P * U;
- return O.w(G, this);
- }, T.subtract = function(P, z) {
- return this.add(-1 * P, z);
- }, T.format = function(P) {
- var z = this, _ = this.$locale();
- if (!this.isValid()) return _.invalidDate || b;
- var A = P || "YYYY-MM-DDTHH:mm:ssZ", H = O.z(this), $ = this.$H, U = this.$m, G = this.$M, B = _.weekdays, ne = _.months, le = _.meridiem, ee = function(J, M, D, j) {
- return J && (J[M] || J(z, A)) || D[M].slice(0, j);
- }, V = function(J) {
- return O.s($ % 12 || 12, J, "0");
- }, X = le || function(J, M, D) {
- var j = J < 12 ? "AM" : "PM";
- return D ? j.toLowerCase() : j;
- };
- return A.replace(h, function(J, M) {
- return M || function(D) {
- switch (D) {
- case "YY":
- return String(z.$y).slice(-2);
- case "YYYY":
- return O.s(z.$y, 4, "0");
- case "M":
- return G + 1;
- case "MM":
- return O.s(G + 1, 2, "0");
- case "MMM":
- return ee(_.monthsShort, G, ne, 3);
- case "MMMM":
- return ee(ne, G);
- case "D":
- return z.$D;
- case "DD":
- return O.s(z.$D, 2, "0");
- case "d":
- return String(z.$W);
- case "dd":
- return ee(_.weekdaysMin, z.$W, B, 2);
- case "ddd":
- return ee(_.weekdaysShort, z.$W, B, 3);
- case "dddd":
- return B[z.$W];
- case "H":
- return String($);
- case "HH":
- return O.s($, 2, "0");
- case "h":
- return V(1);
- case "hh":
- return V(2);
- case "a":
- return X($, U, !0);
- case "A":
- return X($, U, !1);
- case "m":
- return String(U);
- case "mm":
- return O.s(U, 2, "0");
- case "s":
- return String(z.$s);
- case "ss":
- return O.s(z.$s, 2, "0");
- case "SSS":
- return O.s(z.$ms, 3, "0");
- case "Z":
- return H;
- }
- return null;
- }(J) || H.replace(":", "");
- });
- }, T.utcOffset = function() {
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
- }, T.diff = function(P, z, _) {
- var A, H = this, $ = O.p(z), U = L(P), G = (U.utcOffset() - this.utcOffset()) * r, B = this - U, ne = function() {
- return O.m(H, U);
- };
- switch ($) {
- case p:
- A = ne() / 12;
- break;
- case v:
- A = ne();
- break;
- case C:
- A = ne() / 3;
- break;
- case s:
- A = (B - G) / 6048e5;
- break;
- case c:
- A = (B - G) / 864e5;
- break;
- case l:
- A = B / a;
- break;
- case u:
- A = B / r;
- break;
- case i:
- A = B / n;
- break;
- default:
- A = B;
- }
- return _ ? A : O.a(A);
- }, T.daysInMonth = function() {
- return this.endOf(v).$D;
- }, T.$locale = function() {
- return S[this.$L];
- }, T.locale = function(P, z) {
- if (!P) return this.$L;
- var _ = this.clone(), A = k(P, z, !0);
- return A && (_.$L = A), _;
- }, T.clone = function() {
- return O.w(this.$d, this);
- }, T.toDate = function() {
- return new Date(this.valueOf());
- }, T.toJSON = function() {
- return this.isValid() ? this.toISOString() : null;
- }, T.toISOString = function() {
- return this.$d.toISOString();
- }, T.toString = function() {
- return this.$d.toUTCString();
- }, I;
- }(), F = N.prototype;
- return L.prototype = F, [["$ms", o], ["$s", i], ["$m", u], ["$H", l], ["$W", c], ["$M", v], ["$y", p], ["$D", m]].forEach(function(I) {
- F[I[1]] = function(T) {
- return this.$g(T, I[0], I[1]);
- };
- }), L.extend = function(I, T) {
- return I.$i || (I(T, N, L), I.$i = !0), L;
- }, L.locale = k, L.isDayjs = R, L.unix = function(I) {
- return L(1e3 * I);
- }, L.en = S[E], L.Ls = S, L.p = {}, L;
- });
- }(ho)), ho.exports;
- }
- var un = {}, ms;
- function qy() {
- if (ms) return un;
- ms = 1, Object.defineProperty(un, "__esModule", {
- value: !0
- }), un.call = o, un.default = void 0, un.note = r, un.noteOnce = u, un.preMessage = void 0, un.resetWarned = a, un.warning = n, un.warningOnce = i;
- var e = {}, t = un.preMessage = function(c) {
- };
- function n(l, c) {
- }
- function r(l, c) {
- }
- function a() {
- e = {};
- }
- function o(l, c, s) {
- !c && !e[s] && (l(!1, s), e[s] = !0);
- }
- function i(l, c) {
- o(n, l, c);
- }
- function u(l, c) {
- o(r, l, c);
- }
- return i.preMessage = t, i.resetWarned = a, i.noteOnce = u, un.default = i, un;
- }
- var go = { exports: {} }, Ky = go.exports, ps;
- function Yy() {
- return ps || (ps = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(Ky, function() {
- return function(n, r) {
- r.prototype.weekday = function(a) {
- var o = this.$locale().weekStart || 0, i = this.$W, u = (i < o ? i + 7 : i) - o;
- return this.$utils().u(a) ? u : this.subtract(u, "day").add(a, "day");
- };
- };
- });
- }(go)), go.exports;
- }
- var yo = { exports: {} }, Gy = yo.exports, hs;
- function Xy() {
- return hs || (hs = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(Gy, function() {
- return function(n, r, a) {
- var o = r.prototype, i = function(v) {
- return v && (v.indexOf ? v : v.s);
- }, u = function(v, C, p, m, b) {
- var f = v.name ? v : v.$locale(), h = i(f[C]), g = i(f[p]), y = h || g.map(function(E) {
- return E.slice(0, m);
- });
- if (!b) return y;
- var w = f.weekStart;
- return y.map(function(E, S) {
- return y[(S + (w || 0)) % 7];
- });
- }, l = function() {
- return a.Ls[a.locale()];
- }, c = function(v, C) {
- return v.formats[C] || function(p) {
- return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(m, b, f) {
- return b || f.slice(1);
- });
- }(v.formats[C.toUpperCase()]);
- }, s = function() {
- var v = this;
- return { months: function(C) {
- return C ? C.format("MMMM") : u(v, "months");
- }, monthsShort: function(C) {
- return C ? C.format("MMM") : u(v, "monthsShort", "months", 3);
- }, firstDayOfWeek: function() {
- return v.$locale().weekStart || 0;
- }, weekdays: function(C) {
- return C ? C.format("dddd") : u(v, "weekdays");
- }, weekdaysMin: function(C) {
- return C ? C.format("dd") : u(v, "weekdaysMin", "weekdays", 2);
- }, weekdaysShort: function(C) {
- return C ? C.format("ddd") : u(v, "weekdaysShort", "weekdays", 3);
- }, longDateFormat: function(C) {
- return c(v.$locale(), C);
- }, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
- };
- o.localeData = function() {
- return s.bind(this)();
- }, a.localeData = function() {
- var v = l();
- return { firstDayOfWeek: function() {
- return v.weekStart || 0;
- }, weekdays: function() {
- return a.weekdays();
- }, weekdaysShort: function() {
- return a.weekdaysShort();
- }, weekdaysMin: function() {
- return a.weekdaysMin();
- }, months: function() {
- return a.months();
- }, monthsShort: function() {
- return a.monthsShort();
- }, longDateFormat: function(C) {
- return c(v, C);
- }, meridiem: v.meridiem, ordinal: v.ordinal };
- }, a.months = function() {
- return u(l(), "months");
- }, a.monthsShort = function() {
- return u(l(), "monthsShort", "months", 3);
- }, a.weekdays = function(v) {
- return u(l(), "weekdays", null, null, v);
- }, a.weekdaysShort = function(v) {
- return u(l(), "weekdaysShort", "weekdays", 3, v);
- }, a.weekdaysMin = function(v) {
- return u(l(), "weekdaysMin", "weekdays", 2, v);
- };
- };
- });
- }(yo)), yo.exports;
- }
- var bo = { exports: {} }, Zy = bo.exports, gs;
- function Qy() {
- return gs || (gs = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(Zy, function() {
- var n = "week", r = "year";
- return function(a, o, i) {
- var u = o.prototype;
- u.week = function(l) {
- if (l === void 0 && (l = null), l !== null) return this.add(7 * (l - this.week()), "day");
- var c = this.$locale().yearStart || 1;
- if (this.month() === 11 && this.date() > 25) {
- var s = i(this).startOf(r).add(1, r).date(c), v = i(this).endOf(n);
- if (s.isBefore(v)) return 1;
- }
- var C = i(this).startOf(r).date(c).startOf(n).subtract(1, "millisecond"), p = this.diff(C, n, !0);
- return p < 0 ? i(this).startOf("week").week() : Math.ceil(p);
- }, u.weeks = function(l) {
- return l === void 0 && (l = null), this.week(l);
- };
- };
- });
- }(bo)), bo.exports;
- }
- var Co = { exports: {} }, Jy = Co.exports, ys;
- function eb() {
- return ys || (ys = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(Jy, function() {
- return function(n, r) {
- r.prototype.weekYear = function() {
- var a = this.month(), o = this.week(), i = this.year();
- return o === 1 && a === 11 ? i + 1 : a === 0 && o >= 52 ? i - 1 : i;
- };
- };
- });
- }(Co)), Co.exports;
- }
- var So = { exports: {} }, tb = So.exports, bs;
- function nb() {
- return bs || (bs = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(tb, function() {
- return function(n, r) {
- var a = r.prototype, o = a.format;
- a.format = function(i) {
- var u = this, l = this.$locale();
- if (!this.isValid()) return o.bind(this)(i);
- var c = this.$utils(), s = (i || "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(v) {
- switch (v) {
- case "Q":
- return Math.ceil((u.$M + 1) / 3);
- case "Do":
- return l.ordinal(u.$D);
- case "gggg":
- return u.weekYear();
- case "GGGG":
- return u.isoWeekYear();
- case "wo":
- return l.ordinal(u.week(), "W");
- case "w":
- case "ww":
- return c.s(u.week(), v === "w" ? 1 : 2, "0");
- case "W":
- case "WW":
- return c.s(u.isoWeek(), v === "W" ? 1 : 2, "0");
- case "k":
- case "kk":
- return c.s(String(u.$H === 0 ? 24 : u.$H), v === "k" ? 1 : 2, "0");
- case "X":
- return Math.floor(u.$d.getTime() / 1e3);
- case "x":
- return u.$d.getTime();
- case "z":
- return "[" + u.offsetName() + "]";
- case "zzz":
- return "[" + u.offsetName("long") + "]";
- default:
- return v;
- }
- });
- return o.bind(this)(s);
- };
- };
- });
- }(So)), So.exports;
- }
- var wo = { exports: {} }, rb = wo.exports, Cs;
- function ab() {
- return Cs || (Cs = 1, function(e, t) {
- (function(n, r) {
- e.exports = r();
- })(rb, function() {
- var n = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, r = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, a = /\d/, o = /\d\d/, i = /\d\d?/, u = /\d*[^-_:/,()\s\d]+/, l = {}, c = function(f) {
- return (f = +f) + (f > 68 ? 1900 : 2e3);
- }, s = function(f) {
- return function(h) {
- this[f] = +h;
- };
- }, v = [/[+-]\d\d:?(\d\d)?|Z/, function(f) {
- (this.zone || (this.zone = {})).offset = function(h) {
- if (!h || h === "Z") return 0;
- var g = h.match(/([+-]|\d\d)/g), y = 60 * g[1] + (+g[2] || 0);
- return y === 0 ? 0 : g[0] === "+" ? -y : y;
- }(f);
- }], C = function(f) {
- var h = l[f];
- return h && (h.indexOf ? h : h.s.concat(h.f));
- }, p = function(f, h) {
- var g, y = l.meridiem;
- if (y) {
- for (var w = 1; w <= 24; w += 1) if (f.indexOf(y(w, 0, h)) > -1) {
- g = w > 12;
- break;
- }
- } else g = f === (h ? "pm" : "PM");
- return g;
- }, m = { A: [u, function(f) {
- this.afternoon = p(f, !1);
- }], a: [u, function(f) {
- this.afternoon = p(f, !0);
- }], Q: [a, function(f) {
- this.month = 3 * (f - 1) + 1;
- }], S: [a, function(f) {
- this.milliseconds = 100 * +f;
- }], SS: [o, function(f) {
- this.milliseconds = 10 * +f;
- }], SSS: [/\d{3}/, function(f) {
- this.milliseconds = +f;
- }], s: [i, s("seconds")], ss: [i, s("seconds")], m: [i, s("minutes")], mm: [i, s("minutes")], H: [i, s("hours")], h: [i, s("hours")], HH: [i, s("hours")], hh: [i, s("hours")], D: [i, s("day")], DD: [o, s("day")], Do: [u, function(f) {
- var h = l.ordinal, g = f.match(/\d+/);
- if (this.day = g[0], h) for (var y = 1; y <= 31; y += 1) h(y).replace(/\[|\]/g, "") === f && (this.day = y);
- }], w: [i, s("week")], ww: [o, s("week")], M: [i, s("month")], MM: [o, s("month")], MMM: [u, function(f) {
- var h = C("months"), g = (C("monthsShort") || h.map(function(y) {
- return y.slice(0, 3);
- })).indexOf(f) + 1;
- if (g < 1) throw new Error();
- this.month = g % 12 || g;
- }], MMMM: [u, function(f) {
- var h = C("months").indexOf(f) + 1;
- if (h < 1) throw new Error();
- this.month = h % 12 || h;
- }], Y: [/[+-]?\d+/, s("year")], YY: [o, function(f) {
- this.year = c(f);
- }], YYYY: [/\d{4}/, s("year")], Z: v, ZZ: v };
- function b(f) {
- var h, g;
- h = f, g = l && l.formats;
- for (var y = (f = h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(L, O, N) {
- var F = N && N.toUpperCase();
- return O || g[N] || n[N] || g[F].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(I, T, P) {
- return T || P.slice(1);
- });
- })).match(r), w = y.length, E = 0; E < w; E += 1) {
- var S = y[E], x = m[S], R = x && x[0], k = x && x[1];
- y[E] = k ? { regex: R, parser: k } : S.replace(/^\[|\]$/g, "");
- }
- return function(L) {
- for (var O = {}, N = 0, F = 0; N < w; N += 1) {
- var I = y[N];
- if (typeof I == "string") F += I.length;
- else {
- var T = I.regex, P = I.parser, z = L.slice(F), _ = T.exec(z)[0];
- P.call(O, _), L = L.replace(_, "");
- }
- }
- return function(A) {
- var H = A.afternoon;
- if (H !== void 0) {
- var $ = A.hours;
- H ? $ < 12 && (A.hours += 12) : $ === 12 && (A.hours = 0), delete A.afternoon;
- }
- }(O), O;
- };
- }
- return function(f, h, g) {
- g.p.customParseFormat = !0, f && f.parseTwoDigitYear && (c = f.parseTwoDigitYear);
- var y = h.prototype, w = y.parse;
- y.parse = function(E) {
- var S = E.date, x = E.utc, R = E.args;
- this.$u = x;
- var k = R[1];
- if (typeof k == "string") {
- var L = R[2] === !0, O = R[3] === !0, N = L || O, F = R[2];
- O && (F = R[2]), l = this.$locale(), !L && F && (l = g.Ls[F]), this.$d = function(z, _, A, H) {
- try {
- if (["x", "X"].indexOf(_) > -1) return new Date((_ === "X" ? 1e3 : 1) * z);
- var $ = b(_)(z), U = $.year, G = $.month, B = $.day, ne = $.hours, le = $.minutes, ee = $.seconds, V = $.milliseconds, X = $.zone, J = $.week, M = /* @__PURE__ */ new Date(), D = B || (U || G ? 1 : M.getDate()), j = U || M.getFullYear(), W = 0;
- U && !G || (W = G > 0 ? G - 1 : M.getMonth());
- var K, Y = ne || 0, te = le || 0, Q = ee || 0, ae = V || 0;
- return X ? new Date(Date.UTC(j, W, D, Y, te, Q, ae + 60 * X.offset * 1e3)) : A ? new Date(Date.UTC(j, W, D, Y, te, Q, ae)) : (K = new Date(j, W, D, Y, te, Q, ae), J && (K = H(K).week(J).toDate()), K);
- } catch {
- return /* @__PURE__ */ new Date("");
- }
- }(S, k, x, g), this.init(), F && F !== !0 && (this.$L = this.locale(F).$L), N && S != this.format(k) && (this.$d = /* @__PURE__ */ new Date("")), l = {};
- } else if (k instanceof Array) for (var I = k.length, T = 1; T <= I; T += 1) {
- R[1] = k[T - 1];
- var P = g.apply(this, R);
- if (P.isValid()) {
- this.$d = P.$d, this.$L = P.$L, this.init();
- break;
- }
- T === I && (this.$d = /* @__PURE__ */ new Date(""));
- }
- else w.call(this, E);
- };
- };
- });
- }(wo)), wo.exports;
- }
- var Ss;
- function ob() {
- if (Ss) return da;
- Ss = 1;
- var e = Wy().default;
- Object.defineProperty(da, "__esModule", {
- value: !0
- }), da.default = void 0;
- var t = e(Uy()), n = qy(), r = e(Yy()), a = e(Xy()), o = e(Qy()), i = e(eb()), u = e(nb()), l = e(ab());
- t.default.extend(l.default), t.default.extend(u.default), t.default.extend(r.default), t.default.extend(a.default), t.default.extend(o.default), t.default.extend(i.default), t.default.extend(function(p, m) {
- var b = m.prototype, f = b.format;
- b.format = function(g) {
- var y = (g || "").replace("Wo", "wo");
- return f.bind(this)(y);
- };
- });
- var c = {
- // ar_EG:
- // az_AZ:
- // bg_BG:
- bn_BD: "bn-bd",
- by_BY: "be",
- // ca_ES:
- // cs_CZ:
- // da_DK:
- // de_DE:
- // el_GR:
- en_GB: "en-gb",
- en_US: "en",
- // es_ES:
- // et_EE:
- // fa_IR:
- // fi_FI:
- fr_BE: "fr",
- // todo: dayjs has no fr_BE locale, use fr at present
- fr_CA: "fr-ca",
- // fr_FR:
- // ga_IE:
- // gl_ES:
- // he_IL:
- // hi_IN:
- // hr_HR:
- // hu_HU:
- hy_AM: "hy-am",
- // id_ID:
- // is_IS:
- // it_IT:
- // ja_JP:
- // ka_GE:
- // kk_KZ:
- // km_KH:
- kmr_IQ: "ku",
- // kn_IN:
- // ko_KR:
- // ku_IQ: // previous ku in antd
- // lt_LT:
- // lv_LV:
- // mk_MK:
- // ml_IN:
- // mn_MN:
- // ms_MY:
- // nb_NO:
- // ne_NP:
- nl_BE: "nl-be",
- // nl_NL:
- // pl_PL:
- pt_BR: "pt-br",
- // pt_PT:
- // ro_RO:
- // ru_RU:
- // sk_SK:
- // sl_SI:
- // sr_RS:
- // sv_SE:
- // ta_IN:
- // th_TH:
- // tr_TR:
- // uk_UA:
- // ur_PK:
- // vi_VN:
- zh_CN: "zh-cn",
- zh_HK: "zh-hk",
- zh_TW: "zh-tw"
- }, s = function(m) {
- var b = c[m];
- return b || m.split("_")[0];
- }, v = function() {
- (0, n.noteOnce)(!1, "Not match any format. Please help to fire a issue about this.");
- }, C = {
- // get
- getNow: function() {
- var m = (0, t.default)();
- return typeof m.tz == "function" ? m.tz() : m;
- },
- getFixedDate: function(m) {
- return (0, t.default)(m, ["YYYY-M-DD", "YYYY-MM-DD"]);
- },
- getEndDate: function(m) {
- return m.endOf("month");
- },
- getWeekDay: function(m) {
- var b = m.locale("en");
- return b.weekday() + b.localeData().firstDayOfWeek();
- },
- getYear: function(m) {
- return m.year();
- },
- getMonth: function(m) {
- return m.month();
- },
- getDate: function(m) {
- return m.date();
- },
- getHour: function(m) {
- return m.hour();
- },
- getMinute: function(m) {
- return m.minute();
- },
- getSecond: function(m) {
- return m.second();
- },
- getMillisecond: function(m) {
- return m.millisecond();
- },
- // set
- addYear: function(m, b) {
- return m.add(b, "year");
- },
- addMonth: function(m, b) {
- return m.add(b, "month");
- },
- addDate: function(m, b) {
- return m.add(b, "day");
- },
- setYear: function(m, b) {
- return m.year(b);
- },
- setMonth: function(m, b) {
- return m.month(b);
- },
- setDate: function(m, b) {
- return m.date(b);
- },
- setHour: function(m, b) {
- return m.hour(b);
- },
- setMinute: function(m, b) {
- return m.minute(b);
- },
- setSecond: function(m, b) {
- return m.second(b);
- },
- setMillisecond: function(m, b) {
- return m.millisecond(b);
- },
- // Compare
- isAfter: function(m, b) {
- return m.isAfter(b);
- },
- isValidate: function(m) {
- return m.isValid();
- },
- locale: {
- getWeekFirstDay: function(m) {
- return (0, t.default)().locale(s(m)).localeData().firstDayOfWeek();
- },
- getWeekFirstDate: function(m, b) {
- return b.locale(s(m)).weekday(0);
- },
- getWeek: function(m, b) {
- return b.locale(s(m)).week();
- },
- getShortWeekDays: function(m) {
- return (0, t.default)().locale(s(m)).localeData().weekdaysMin();
- },
- getShortMonths: function(m) {
- return (0, t.default)().locale(s(m)).localeData().monthsShort();
- },
- format: function(m, b, f) {
- return b.locale(s(m)).format(f);
- },
- parse: function(m, b, f) {
- for (var h = s(m), g = 0; g < f.length; g += 1) {
- var y = f[g], w = b;
- if (y.includes("wo") || y.includes("Wo")) {
- for (var E = w.split("-")[0], S = w.split("-")[1], x = (0, t.default)(E, "YYYY").startOf("year").locale(h), R = 0; R <= 52; R += 1) {
- var k = x.add(R, "week");
- if (k.format("Wo") === S)
- return k;
- }
- return v(), null;
- }
- var L = (0, t.default)(w, y, !0).locale(h);
- if (L.isValid())
- return L;
- }
- return b && v(), null;
- }
- }
- };
- return da.default = C, da;
- }
- var ib = ob();
- const hf = /* @__PURE__ */ Aa(ib), ub = "univer-date-picker", lb = "univer-date-picker-rtl", sb = "univer-date-picker-invalid", cb = "univer-date-picker-panel", db = "univer-date-picker-panel-focused", fb = "univer-date-picker-panel-rtl", vb = "univer-date-picker-suffix-icon", mb = "univer-date-picker-decade-panel", pb = "univer-date-picker-year-panel", hb = "univer-date-picker-month-panel", gb = "univer-date-picker-week-panel", yb = "univer-date-picker-date-panel", bb = "univer-date-picker-time-panel", Cb = "univer-date-picker-header", Sb = "univer-date-picker-header-view", wb = "univer-date-picker-header-super-prev-btn", xb = "univer-date-picker-header-super-next-btn", Eb = "univer-date-picker-header-prev-btn", Rb = "univer-date-picker-header-next-btn", Pb = "univer-date-picker-cell", Mb = "univer-date-picker-cell-disabled", kb = "univer-date-picker-cell-inner", Db = "univer-date-picker-cell-in-view", Nb = "univer-date-picker-cell-in-range", Ib = "univer-date-picker-cell-hover", Ob = "univer-date-picker-cell-range-hover-start", _b = "univer-date-picker-cell-range-hover-end", Lb = "univer-date-picker-cell-range-hover", Tb = "univer-date-picker-cell-today", $b = "univer-date-picker-cell-range-start", Ab = "univer-date-picker-cell-range-end", jb = "univer-date-picker-cell-selected", Fb = "univer-date-picker-presets", zb = "univer-date-picker-now", Hb = "univer-date-picker-now-btn", Vb = "univer-date-picker-footer", Wb = "univer-date-picker-picker-footer", Bb = "univer-date-picker-ranges", Ub = "univer-date-picker-ok", qb = "univer-date-picker-content", Kb = "univer-date-picker-week-panel-row", Yb = "univer-date-picker-week-panel-row-selected", Gb = "univer-date-picker-week-panel-row-range-hover", Xb = "univer-date-picker-week-panel-row-range-start", Zb = "univer-date-picker-week-panel-row-range-end", Qb = "univer-date-picker-cell-week", Jb = "univer-date-picker-time-panel-column-title", e1 = "univer-date-picker-time-panel-column", t1 = "univer-date-picker-time-panel-column-active", n1 = "univer-date-picker-time-panel-cell-disabled", r1 = "univer-date-picker-time-panel-cell-selected", a1 = "univer-date-picker-time-panel-cell-inner", o1 = "univer-date-picker-datetime-panel", i1 = "univer-date-picker-datetime-panel-active", u1 = "univer-date-picker-date-panel-active", l1 = "univer-date-picker-time-panel-active", s1 = "univer-date-picker-input", c1 = "univer-date-picker-input-active", d1 = "univer-date-picker-input-placeholder", f1 = "univer-date-picker-clear", v1 = "univer-date-picker-clear-btn", m1 = "univer-date-picker-dropdown", p1 = "univer-date-picker-dropdown-range", h1 = "univer-date-picker-dropdown-hidden", g1 = "univer-date-picker-dropdown-placement-topLeft", y1 = "univer-date-picker-range-arrow", b1 = "univer-date-picker-dropdown-placement-topRight", C1 = "univer-date-picker-dropdown-placement-bottomLeft", S1 = "univer-date-picker-dropdown-placement-bottomright", w1 = "univer-date-picker-dropdown-rtl", x1 = "univer-date-picker-range", E1 = "univer-date-picker-range-wrapper", R1 = "univer-date-picker-active-bar", P1 = "univer-date-picker-focused", M1 = "univer-date-picker-panel-container", k1 = "univer-date-picker-panel-layout", D1 = "univer-date-picker-selector", N1 = "univer-date-picker-selection-overflow", I1 = "univer-date-picker-selection-overflow-item", O1 = "univer-date-picker-selection-item", _1 = "univer-date-picker-multiple-input", tu = {
- datePicker: ub,
- datePickerRtl: lb,
- datePickerInvalid: sb,
- datePickerPanel: cb,
- datePickerPanelFocused: db,
- datePickerPanelRtl: fb,
- datePickerSuffixIcon: vb,
- datePickerDecadePanel: mb,
- datePickerYearPanel: pb,
- datePickerMonthPanel: hb,
- datePickerWeekPanel: gb,
- datePickerDatePanel: yb,
- datePickerTimePanel: bb,
- datePickerHeader: Cb,
- datePickerHeaderView: Sb,
- datePickerHeaderSuperPrevBtn: wb,
- datePickerHeaderSuperNextBtn: xb,
- datePickerHeaderPrevBtn: Eb,
- datePickerHeaderNextBtn: Rb,
- datePickerCell: Pb,
- datePickerCellDisabled: Mb,
- datePickerCellInner: kb,
- datePickerCellInView: Db,
- datePickerCellInRange: Nb,
- datePickerCellHover: Ib,
- datePickerCellRangeHoverStart: Ob,
- datePickerCellRangeHoverEnd: _b,
- datePickerCellRangeHover: Lb,
- datePickerCellToday: Tb,
- datePickerCellRangeStart: $b,
- datePickerCellRangeEnd: Ab,
- datePickerCellSelected: jb,
- datePickerPresets: Fb,
- datePickerNow: zb,
- datePickerNowBtn: Hb,
- datePickerFooter: Vb,
- datePickerPickerFooter: Wb,
- datePickerRanges: Bb,
- datePickerOk: Ub,
- datePickerContent: qb,
- datePickerWeekPanelRow: Kb,
- datePickerWeekPanelRowSelected: Yb,
- datePickerWeekPanelRowRangeHover: Gb,
- datePickerWeekPanelRowRangeStart: Xb,
- datePickerWeekPanelRowRangeEnd: Zb,
- datePickerCellWeek: Qb,
- datePickerTimePanelColumnTitle: Jb,
- datePickerTimePanelColumn: e1,
- datePickerTimePanelColumnActive: t1,
- datePickerTimePanelCellDisabled: n1,
- datePickerTimePanelCellSelected: r1,
- datePickerTimePanelCellInner: a1,
- datePickerDatetimePanel: o1,
- datePickerDatetimePanelActive: i1,
- datePickerDatePanelActive: u1,
- datePickerTimePanelActive: l1,
- datePickerInput: s1,
- datePickerInputActive: c1,
- datePickerInputPlaceholder: d1,
- datePickerClear: f1,
- datePickerClearBtn: v1,
- datePickerDropdown: m1,
- datePickerDropdownRange: p1,
- datePickerDropdownHidden: h1,
- datePickerDropdownPlacementTopLeft: g1,
- datePickerRangeArrow: y1,
- datePickerDropdownPlacementTopRight: b1,
- datePickerDropdownPlacementBottomLeft: C1,
- datePickerDropdownPlacementBottomright: S1,
- datePickerDropdownRtl: w1,
- datePickerRange: x1,
- datePickerRangeWrapper: E1,
- datePickerActiveBar: R1,
- datePickerFocused: P1,
- datePickerPanelContainer: M1,
- datePickerPanelLayout: k1,
- datePickerSelector: D1,
- datePickerSelectionOverflow: N1,
- datePickerSelectionOverflowItem: I1,
- datePickerSelectionItem: O1,
- datePickerMultipleInput: _1
- }, FO = (e) => {
- const { locale: t } = Sn(In);
- return /* @__PURE__ */ q.jsx(
- po,
- {
- ...e,
- generateConfig: hf,
- prefixCls: tu.datePicker,
- locale: t == null ? void 0 : t.Picker
- }
- );
- };
- function zO(e) {
- const { value: t, onChange: n, ...r } = e, { locale: a } = Sn(In);
- function o(i, u) {
- !Array.isArray(i) && !Array.isArray(u) && n(i, u);
- }
- return /* @__PURE__ */ q.jsx(
- Vy,
- {
- ...r,
- value: t,
- prefixCls: tu.datePicker,
- generateConfig: hf,
- locale: a == null ? void 0 : a.Picker,
- suffixIcon: /* @__PURE__ */ q.jsx(wc, { className: tu.datePickerSuffixIcon }),
- onChange: o
- }
- );
- }
- function L1(e, t) {
- if (e == null) return {};
- var n = {};
- for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
- if (t.indexOf(r) >= 0) continue;
- n[r] = e[r];
- }
- return n;
- }
- function T1(e, t) {
- if (e == null) return {};
- var n, r, a = L1(e, t);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- for (r = 0; r < o.length; r++) n = o[r], t.indexOf(n) >= 0 || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- }
- return a;
- }
- var $1 = fe.ESC, A1 = fe.TAB;
- function j1(e) {
- var t = e.visible, n = e.triggerRef, r = e.onVisibleChange, a = e.autoFocus, o = e.overlayRef, i = d.useRef(!1), u = function() {
- if (t) {
- var v, C;
- (v = n.current) === null || v === void 0 || (C = v.focus) === null || C === void 0 || C.call(v), r == null || r(!1);
- }
- }, l = function() {
- var v;
- return (v = o.current) !== null && v !== void 0 && v.focus ? (o.current.focus(), i.current = !0, !0) : !1;
- }, c = function(v) {
- switch (v.keyCode) {
- case $1:
- u();
- break;
- case A1: {
- var C = !1;
- i.current || (C = l()), C ? v.preventDefault() : u();
- break;
- }
- }
- };
- d.useEffect(function() {
- return t ? (window.addEventListener("keydown", c), a && st(l, 3), function() {
- window.removeEventListener("keydown", c), i.current = !1;
- }) : function() {
- i.current = !1;
- };
- }, [t]);
- }
- var F1 = /* @__PURE__ */ $t(function(e, t) {
- var n = e.overlay, r = e.arrow, a = e.prefixCls, o = Ht(function() {
- var u;
- return typeof n == "function" ? u = n() : u = n, u;
- }, [n]), i = lr(t, o == null ? void 0 : o.ref);
- return /* @__PURE__ */ me.createElement(me.Fragment, null, r && /* @__PURE__ */ me.createElement("div", {
- className: "".concat(a, "-arrow")
- }), /* @__PURE__ */ me.cloneElement(o, {
- ref: xr(o) ? i : void 0
- }));
- }), _r = {
- adjustX: 1,
- adjustY: 1
- }, Lr = [0, 0], z1 = {
- topLeft: {
- points: ["bl", "tl"],
- overflow: _r,
- offset: [0, -4],
- targetOffset: Lr
- },
- top: {
- points: ["bc", "tc"],
- overflow: _r,
- offset: [0, -4],
- targetOffset: Lr
- },
- topRight: {
- points: ["br", "tr"],
- overflow: _r,
- offset: [0, -4],
- targetOffset: Lr
- },
- bottomLeft: {
- points: ["tl", "bl"],
- overflow: _r,
- offset: [0, 4],
- targetOffset: Lr
- },
- bottom: {
- points: ["tc", "bc"],
- overflow: _r,
- offset: [0, 4],
- targetOffset: Lr
- },
- bottomRight: {
- points: ["tr", "br"],
- overflow: _r,
- offset: [0, 4],
- targetOffset: Lr
- }
- }, H1 = ["arrow", "prefixCls", "transitionName", "animation", "align", "placement", "placements", "getPopupContainer", "showAction", "hideAction", "overlayClassName", "overlayStyle", "visible", "trigger", "autoFocus", "overlay", "children", "onVisibleChange"];
- function V1(e, t) {
- var n, r = e.arrow, a = r === void 0 ? !1 : r, o = e.prefixCls, i = o === void 0 ? "rc-dropdown" : o, u = e.transitionName, l = e.animation, c = e.align, s = e.placement, v = s === void 0 ? "bottomLeft" : s, C = e.placements, p = C === void 0 ? z1 : C, m = e.getPopupContainer, b = e.showAction, f = e.hideAction, h = e.overlayClassName, g = e.overlayStyle, y = e.visible, w = e.trigger, E = w === void 0 ? ["hover"] : w, S = e.autoFocus, x = e.overlay, R = e.children, k = e.onVisibleChange, L = T1(e, H1), O = me.useState(), N = cn(O, 2), F = N[0], I = N[1], T = "visible" in e ? y : F, P = me.useRef(null), z = me.useRef(null), _ = me.useRef(null);
- me.useImperativeHandle(t, function() {
- return P.current;
- });
- var A = function(V) {
- I(V), k == null || k(V);
- };
- j1({
- visible: T,
- triggerRef: _,
- onVisibleChange: A,
- autoFocus: S,
- overlayRef: z
- });
- var H = function(V) {
- var X = e.onOverlayClick;
- I(!1), X && X(V);
- }, $ = function() {
- return /* @__PURE__ */ me.createElement(F1, {
- ref: z,
- overlay: x,
- prefixCls: i,
- arrow: a
- });
- }, U = function() {
- return typeof x == "function" ? $ : $();
- }, G = function() {
- var V = e.minOverlayWidthMatchTrigger, X = e.alignPoint;
- return "minOverlayWidthMatchTrigger" in e ? V : !X;
- }, B = function() {
- var V = e.openClassName;
- return V !== void 0 ? V : "".concat(i, "-open");
- }, ne = /* @__PURE__ */ me.cloneElement(R, {
- className: xe((n = R.props) === null || n === void 0 ? void 0 : n.className, T && B()),
- ref: xr(R) ? lr(_, R.ref) : void 0
- }), le = f;
- return !le && E.indexOf("contextMenu") !== -1 && (le = ["click"]), /* @__PURE__ */ me.createElement(Uo, ko({
- builtinPlacements: p
- }, L, {
- prefixCls: i,
- ref: P,
- popupClassName: xe(h, Xc({}, "".concat(i, "-show-arrow"), a)),
- popupStyle: g,
- action: E,
- showAction: b,
- hideAction: le,
- popupPlacement: v,
- popupAlign: c,
- popupTransitionName: u,
- popupAnimation: l,
- popupVisible: T,
- stretch: G() ? "minWidth" : "",
- popup: U(),
- onPopupVisibleChange: A,
- onPopupClick: H,
- getPopupContainer: m
- }), ne);
- }
- const W1 = /* @__PURE__ */ me.forwardRef(V1), B1 = "univer-dropdown", U1 = "univer-dropdown-hidden", q1 = "univer-dropdown-slide-up-enter", K1 = "univer-dropdown-slide-up-appear", Y1 = "univer-dropdown-slide-up-leave", G1 = "univer-dropdown-slide-up-enter-active", X1 = "univer-dropdown-placement-bottomLeft", Z1 = "univer-dropdown-slide-up-appear-active", Q1 = "univer-dropdown-placement-bottomCenter", J1 = "univer-dropdown-placement-bottomRight", eC = "univer-dropdown-slide-up-in", tC = "univer-dropdown-placement-topLeft", nC = "univer-dropdown-placement-topCenter", rC = "univer-dropdown-placement-topRight", aC = "univer-dropdown-slide-down-in", oC = "univer-dropdown-slide-up-leave-active", iC = "univer-dropdown-slide-up-out", uC = "univer-dropdown-slide-down-out", lC = {
- dropdown: B1,
- dropdownHidden: U1,
- dropdownSlideUpEnter: q1,
- dropdownSlideUpAppear: K1,
- dropdownSlideUpLeave: Y1,
- dropdownSlideUpEnterActive: G1,
- dropdownPlacementBottomLeft: X1,
- dropdownSlideUpAppearActive: Z1,
- dropdownPlacementBottomCenter: Q1,
- dropdownPlacementBottomRight: J1,
- dropdownSlideUpIn: eC,
- dropdownPlacementTopLeft: tC,
- dropdownPlacementTopCenter: nC,
- dropdownPlacementTopRight: rC,
- dropdownSlideDownIn: aC,
- dropdownSlideUpLeaveActive: oC,
- dropdownSlideUpOut: iC,
- dropdownSlideDownOut: uC
- };
- function sC(e) {
- const {
- className: t,
- placement: n,
- children: r,
- overlay: a,
- alignPoint: o = !1,
- align: i,
- disabled: u,
- onVisibleChange: l
- } = e, c = u ? [] : e.trigger || ["click"], { mountContainer: s } = Sn(In);
- return s && /* @__PURE__ */ q.jsx(
- W1,
- {
- ...e,
- overlayClassName: t,
- prefixCls: lC.dropdown,
- getPopupContainer: () => s,
- trigger: c,
- animation: "slide-up",
- placement: n,
- overlay: a,
- alignPoint: o,
- align: i,
- onVisibleChange: l,
- children: r
- }
- );
- }
- const cC = "univer-form-layout", dC = "univer-form-layout-inner", fC = "univer-form-layout-content", vC = "univer-form-layout-label", mC = "univer-form-layout-desc", pC = "univer-input-affix-wrapper", hC = "univer-select", gC = "univer-range-selector", yC = "univer-form-layout-content-error", bC = "univer-select-single", CC = "univer-select-customize-input", SC = "univer-select-selector", wC = "univer-form-layout-error", xC = "univer-form-dual-column-layout", tr = {
- formLayout: cC,
- formLayoutInner: dC,
- formLayoutContent: fC,
- formLayoutLabel: vC,
- formLayoutDesc: mC,
- inputAffixWrapper: pC,
- select: hC,
- rangeSelector: gC,
- formLayoutContentError: yC,
- selectSingle: bC,
- selectCustomizeInput: CC,
- selectSelector: SC,
- formLayoutError: wC,
- formDualColumnLayout: xC
- }, ws = hu(!1), HO = (e) => {
- const { label: t, desc: n, children: r, style: a, className: o, error: i, contentStyle: u, collapsable: l = !1, defaultCollapsed: c = !1 } = e, [s, v] = rt(c), C = Sn(ws);
- return /* @__PURE__ */ q.jsx(ws.Provider, { value: !0, children: /* @__PURE__ */ q.jsxs("div", { className: jt(tr.formLayout, C ? tr.formLayoutInner : "", o), style: a, children: [
- t && /* @__PURE__ */ q.jsxs("div", { style: { cursor: l ? "pointer" : "default" }, className: tr.formLayoutLabel, onClick: () => v(!s), children: [
- t,
- l ? /* @__PURE__ */ q.jsx(
- Oc,
- {
- style: {
- marginLeft: 4,
- transform: s ? "rotate(180deg)" : "rotate(0deg)",
- transition: "transform 0.3s"
- }
- }
- ) : null
- ] }),
- s && l ? null : /* @__PURE__ */ q.jsxs(q.Fragment, { children: [
- n && /* @__PURE__ */ q.jsx("div", { className: tr.formLayoutDesc, children: n }),
- r ? /* @__PURE__ */ q.jsxs("div", { style: u, className: jt(tr.formLayoutContent, i ? tr.formLayoutContentError : ""), children: [
- r,
- i ? /* @__PURE__ */ q.jsx("div", { className: tr.formLayoutError, children: i }) : null
- ] }) : null
- ] })
- ] }) });
- }, VO = (e) => /* @__PURE__ */ q.jsx("div", { className: tr.formDualColumnLayout, children: e.children });
- function wr(e) {
- "@babel/helpers - typeof";
- return wr = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
- return typeof t;
- } : function(t) {
- return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
- }, wr(e);
- }
- function EC(e, t) {
- if (wr(e) != "object" || !e) return e;
- var n = e[Symbol.toPrimitive];
- if (n !== void 0) {
- var r = n.call(e, t || "default");
- if (wr(r) != "object") return r;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (t === "string" ? String : Number)(e);
- }
- function RC(e) {
- var t = EC(e, "string");
- return wr(t) == "symbol" ? t : t + "";
- }
- function Rn(e, t, n) {
- return (t = RC(t)) in e ? Object.defineProperty(e, t, {
- value: n,
- enumerable: !0,
- configurable: !0,
- writable: !0
- }) : e[t] = n, e;
- }
- function xs(e, t) {
- var n = Object.keys(e);
- if (Object.getOwnPropertySymbols) {
- var r = Object.getOwnPropertySymbols(e);
- t && (r = r.filter(function(a) {
- return Object.getOwnPropertyDescriptor(e, a).enumerable;
- })), n.push.apply(n, r);
- }
- return n;
- }
- function yr(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t] != null ? arguments[t] : {};
- t % 2 ? xs(Object(n), !0).forEach(function(r) {
- Rn(e, r, n[r]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : xs(Object(n)).forEach(function(r) {
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
- });
- }
- return e;
- }
- function La() {
- return La = Object.assign ? Object.assign.bind() : function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
- }
- return e;
- }, La.apply(null, arguments);
- }
- function PC(e) {
- return !!(e.addonBefore || e.addonAfter);
- }
- function MC(e) {
- return !!(e.prefix || e.suffix || e.allowClear);
- }
- function Es(e, t, n) {
- var r = t.cloneNode(!0), a = Object.create(e, {
- target: {
- value: r
- },
- currentTarget: {
- value: r
- }
- });
- return r.value = n, typeof t.selectionStart == "number" && typeof t.selectionEnd == "number" && (r.selectionStart = t.selectionStart, r.selectionEnd = t.selectionEnd), r.setSelectionRange = function() {
- t.setSelectionRange.apply(t, arguments);
- }, a;
- }
- function Rs(e, t, n, r) {
- if (n) {
- var a = t;
- if (t.type === "click") {
- a = Es(t, e, ""), n(a);
- return;
- }
- if (e.type !== "file" && r !== void 0) {
- a = Es(t, e, r), n(a);
- return;
- }
- n(a);
- }
- }
- function gf(e, t) {
- if (e) {
- e.focus(t);
- var n = t || {}, r = n.cursor;
- if (r) {
- var a = e.value.length;
- switch (r) {
- case "start":
- e.setSelectionRange(0, 0);
- break;
- case "end":
- e.setSelectionRange(a, a);
- break;
- default:
- e.setSelectionRange(0, a);
- }
- }
- }
- }
- var yf = /* @__PURE__ */ me.forwardRef(function(e, t) {
- var n, r, a = e.inputElement, o = e.children, i = e.prefixCls, u = e.prefix, l = e.suffix, c = e.addonBefore, s = e.addonAfter, v = e.className, C = e.style, p = e.disabled, m = e.readOnly, b = e.focused, f = e.triggerFocus, h = e.allowClear, g = e.value, y = e.handleReset, w = e.hidden, E = e.classes, S = e.classNames, x = e.dataAttrs, R = e.styles, k = e.components, L = e.onClear, O = o != null ? o : a, N = (k == null ? void 0 : k.affixWrapper) || "span", F = (k == null ? void 0 : k.groupWrapper) || "span", I = (k == null ? void 0 : k.wrapper) || "span", T = (k == null ? void 0 : k.groupAddon) || "span", P = Ce(null), z = function(W) {
- var K;
- (K = P.current) !== null && K !== void 0 && K.contains(W.target) && (f == null || f());
- }, _ = MC(e), A = /* @__PURE__ */ hc(O, {
- value: g,
- className: xe(O.props.className, !_ && (S == null ? void 0 : S.variant)) || null
- }), H = Ce(null);
- if (me.useImperativeHandle(t, function() {
- return {
- nativeElement: H.current || P.current
- };
- }), _) {
- var $ = null;
- if (h) {
- var U = !p && !m && g, G = "".concat(i, "-clear-icon"), B = wr(h) === "object" && h !== null && h !== void 0 && h.clearIcon ? h.clearIcon : "✖";
- $ = /* @__PURE__ */ me.createElement("span", {
- onClick: function(W) {
- y == null || y(W), L == null || L();
- },
- onMouseDown: function(W) {
- return W.preventDefault();
- },
- className: xe(G, Rn(Rn({}, "".concat(G, "-hidden"), !U), "".concat(G, "-has-suffix"), !!l)),
- role: "button",
- tabIndex: -1
- }, B);
- }
- var ne = "".concat(i, "-affix-wrapper"), le = xe(ne, Rn(Rn(Rn(Rn(Rn({}, "".concat(i, "-disabled"), p), "".concat(ne, "-disabled"), p), "".concat(ne, "-focused"), b), "".concat(ne, "-readonly"), m), "".concat(ne, "-input-with-clear-btn"), l && h && g), E == null ? void 0 : E.affixWrapper, S == null ? void 0 : S.affixWrapper, S == null ? void 0 : S.variant), ee = (l || h) && /* @__PURE__ */ me.createElement("span", {
- className: xe("".concat(i, "-suffix"), S == null ? void 0 : S.suffix),
- style: R == null ? void 0 : R.suffix
- }, $, l);
- A = /* @__PURE__ */ me.createElement(N, La({
- className: le,
- style: R == null ? void 0 : R.affixWrapper,
- onClick: z
- }, x == null ? void 0 : x.affixWrapper, {
- ref: P
- }), u && /* @__PURE__ */ me.createElement("span", {
- className: xe("".concat(i, "-prefix"), S == null ? void 0 : S.prefix),
- style: R == null ? void 0 : R.prefix
- }, u), A, ee);
- }
- if (PC(e)) {
- var V = "".concat(i, "-group"), X = "".concat(V, "-addon"), J = "".concat(V, "-wrapper"), M = xe("".concat(i, "-wrapper"), V, E == null ? void 0 : E.wrapper, S == null ? void 0 : S.wrapper), D = xe(J, Rn({}, "".concat(J, "-disabled"), p), E == null ? void 0 : E.group, S == null ? void 0 : S.groupWrapper);
- A = /* @__PURE__ */ me.createElement(F, {
- className: D,
- ref: H
- }, /* @__PURE__ */ me.createElement(I, {
- className: M
- }, c && /* @__PURE__ */ me.createElement(T, {
- className: X
- }, c), A, s && /* @__PURE__ */ me.createElement(T, {
- className: X
- }, s)));
- }
- return /* @__PURE__ */ me.cloneElement(A, {
- className: xe((n = A.props) === null || n === void 0 ? void 0 : n.className, v) || null,
- style: yr(yr({}, (r = A.props) === null || r === void 0 ? void 0 : r.style), C),
- hidden: w
- });
- });
- function nu(e, t) {
- (t == null || t > e.length) && (t = e.length);
- for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
- return r;
- }
- function kC(e) {
- if (Array.isArray(e)) return nu(e);
- }
- function DC(e) {
- if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
- }
- function bf(e, t) {
- if (e) {
- if (typeof e == "string") return nu(e, t);
- var n = {}.toString.call(e).slice(8, -1);
- return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? nu(e, t) : void 0;
- }
- }
- function NC() {
- throw new TypeError(`Invalid attempt to spread non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function IC(e) {
- return kC(e) || DC(e) || bf(e) || NC();
- }
- function OC(e) {
- if (Array.isArray(e)) return e;
- }
- function _C(e, t) {
- var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
- if (n != null) {
- var r, a, o, i, u = [], l = !0, c = !1;
- try {
- if (o = (n = n.call(e)).next, t !== 0) for (; !(l = (r = o.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) ;
- } catch (s) {
- c = !0, a = s;
- } finally {
- try {
- if (!l && n.return != null && (i = n.return(), Object(i) !== i)) return;
- } finally {
- if (c) throw a;
- }
- }
- return u;
- }
- }
- function LC() {
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
- }
- function Si(e, t) {
- return OC(e) || _C(e, t) || bf(e, t) || LC();
- }
- function TC(e, t) {
- if (e == null) return {};
- var n = {};
- for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
- if (t.includes(r)) continue;
- n[r] = e[r];
- }
- return n;
- }
- function Cf(e, t) {
- if (e == null) return {};
- var n, r, a = TC(e, t);
- if (Object.getOwnPropertySymbols) {
- var o = Object.getOwnPropertySymbols(e);
- for (r = 0; r < o.length; r++) n = o[r], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
- }
- return a;
- }
- var $C = ["show"];
- function AC(e, t) {
- return d.useMemo(function() {
- var n = {};
- t && (n.show = wr(t) === "object" && t.formatter ? t.formatter : !!t), n = yr(yr({}, n), e);
- var r = n, a = r.show, o = Cf(r, $C);
- return yr(yr({}, o), {}, {
- show: !!a,
- showFormatter: typeof a == "function" ? a : void 0,
- strategy: o.strategy || function(i) {
- return i.length;
- }
- });
- }, [e, t]);
- }
- var jC = ["autoComplete", "onChange", "onFocus", "onBlur", "onPressEnter", "onKeyDown", "onKeyUp", "prefixCls", "disabled", "htmlSize", "className", "maxLength", "suffix", "showCount", "count", "type", "classes", "classNames", "styles", "onCompositionStart", "onCompositionEnd"], FC = /* @__PURE__ */ $t(function(e, t) {
- var n = e.autoComplete, r = e.onChange, a = e.onFocus, o = e.onBlur, i = e.onPressEnter, u = e.onKeyDown, l = e.onKeyUp, c = e.prefixCls, s = c === void 0 ? "rc-input" : c, v = e.disabled, C = e.htmlSize, p = e.className, m = e.maxLength, b = e.suffix, f = e.showCount, h = e.count, g = e.type, y = g === void 0 ? "text" : g, w = e.classes, E = e.classNames, S = e.styles, x = e.onCompositionStart, R = e.onCompositionEnd, k = Cf(e, jC), L = rt(!1), O = Si(L, 2), N = O[0], F = O[1], I = Ce(!1), T = Ce(!1), P = Ce(null), z = Ce(null), _ = function(ve) {
- P.current && gf(P.current, ve);
- }, A = Gt(e.defaultValue, {
- value: e.value
- }), H = Si(A, 2), $ = H[0], U = H[1], G = $ == null ? "" : String($), B = rt(null), ne = Si(B, 2), le = ne[0], ee = ne[1], V = AC(h, f), X = V.max || m, J = V.strategy(G), M = !!X && J > X;
- yc(t, function() {
- var oe;
- return {
- focus: _,
- blur: function() {
- var ze;
- (ze = P.current) === null || ze === void 0 || ze.blur();
- },
- setSelectionRange: function(ze, Re, Be) {
- var je;
- (je = P.current) === null || je === void 0 || je.setSelectionRange(ze, Re, Be);
- },
- select: function() {
- var ze;
- (ze = P.current) === null || ze === void 0 || ze.select();
- },
- input: P.current,
- nativeElement: ((oe = z.current) === null || oe === void 0 ? void 0 : oe.nativeElement) || P.current
- };
- }), lt(function() {
- F(function(oe) {
- return oe && v ? !1 : oe;
- });
- }, [v]);
- var D = function(ve, ze, Re) {
- var Be = ze;
- if (!I.current && V.exceedFormatter && V.max && V.strategy(ze) > V.max) {
- if (Be = V.exceedFormatter(ze, {
- max: V.max
- }), ze !== Be) {
- var je, He;
- ee([((je = P.current) === null || je === void 0 ? void 0 : je.selectionStart) || 0, ((He = P.current) === null || He === void 0 ? void 0 : He.selectionEnd) || 0]);
- }
- } else if (Re.source === "compositionEnd")
- return;
- U(Be), P.current && Rs(P.current, ve, r, Be);
- };
- lt(function() {
- if (le) {
- var oe;
- (oe = P.current) === null || oe === void 0 || oe.setSelectionRange.apply(oe, IC(le));
- }
- }, [le]);
- var j = function(ve) {
- D(ve, ve.target.value, {
- source: "change"
- });
- }, W = function(ve) {
- I.current = !1, D(ve, ve.currentTarget.value, {
- source: "compositionEnd"
- }), R == null || R(ve);
- }, K = function(ve) {
- i && ve.key === "Enter" && !T.current && (T.current = !0, i(ve)), u == null || u(ve);
- }, Y = function(ve) {
- ve.key === "Enter" && (T.current = !1), l == null || l(ve);
- }, te = function(ve) {
- F(!0), a == null || a(ve);
- }, Q = function(ve) {
- F(!1), o == null || o(ve);
- }, ae = function(ve) {
- U(""), _(), P.current && Rs(P.current, ve, r);
- }, ue = M && "".concat(s, "-out-of-range"), se = function() {
- var ve = Er(e, [
- "prefixCls",
- "onPressEnter",
- "addonBefore",
- "addonAfter",
- "prefix",
- "suffix",
- "allowClear",
- // Input elements must be either controlled or uncontrolled,
- // specify either the value prop, or the defaultValue prop, but not both.
- "defaultValue",
- "showCount",
- "count",
- "classes",
- "htmlSize",
- "styles",
- "classNames",
- "onClear"
- ]);
- return /* @__PURE__ */ me.createElement("input", La({
- autoComplete: n
- }, ve, {
- onChange: j,
- onFocus: te,
- onBlur: Q,
- onKeyDown: K,
- onKeyUp: Y,
- className: xe(s, Rn({}, "".concat(s, "-disabled"), v), E == null ? void 0 : E.input),
- style: S == null ? void 0 : S.input,
- ref: P,
- size: C,
- type: y,
- onCompositionStart: function(Re) {
- I.current = !0, x == null || x(Re);
- },
- onCompositionEnd: W
- }));
- }, pe = function() {
- var ve = Number(X) > 0;
- if (b || V.show) {
- var ze = V.showFormatter ? V.showFormatter({
- value: G,
- count: J,
- maxLength: X
- }) : "".concat(J).concat(ve ? " / ".concat(X) : "");
- return /* @__PURE__ */ me.createElement(me.Fragment, null, V.show && /* @__PURE__ */ me.createElement("span", {
- className: xe("".concat(s, "-show-count-suffix"), Rn({}, "".concat(s, "-show-count-has-suffix"), !!b), E == null ? void 0 : E.count),
- style: yr({}, S == null ? void 0 : S.count)
- }, ze), b);
- }
- return null;
- };
- return /* @__PURE__ */ me.createElement(yf, La({}, k, {
- prefixCls: s,
- className: xe(p, ue),
- handleReset: ae,
- value: G,
- focused: N,
- triggerFocus: _,
- suffix: pe(),
- disabled: v,
- classes: w,
- classNames: E,
- styles: S
- }), se());
- });
- const zC = "univer-input", HC = "univer-input-affix-wrapper", VC = "univer-input-affix-wrapper-small", WC = "univer-input-affix-wrapper-middle", BC = "univer-input-affix-wrapper-large", UC = "univer-input-affix-wrapper-disabled", qC = "univer-input-suffix", KC = "univer-input-not-allow-clear", YC = "univer-input-clear-icon", GC = "univer-input-clear-icon-hidden", XC = "univer-input-slot-container", ZC = "univer-input-slot", hr = {
- input: zC,
- inputAffixWrapper: HC,
- inputAffixWrapperSmall: VC,
- inputAffixWrapperMiddle: WC,
- inputAffixWrapperLarge: BC,
- inputAffixWrapperDisabled: UC,
- inputSuffix: qC,
- inputNotAllowClear: KC,
- inputClearIcon: YC,
- inputClearIconHidden: GC,
- inputSlotContainer: XC,
- inputSlot: ZC
- };
- function QC(e) {
- const {
- affixWrapperStyle: t,
- autoFocus: n = !1,
- type: r = "text",
- className: a,
- placeholder: o,
- value: i,
- size: u = "middle",
- allowClear: l,
- disabled: c = !1,
- onClick: s,
- onKeyDown: v,
- onChange: C,
- ...p
- } = e;
- function m(f) {
- const { value: h } = f.target;
- C == null || C(h);
- }
- const b = jt(a, {
- [hr.inputAffixWrapperSmall]: u === "small",
- [hr.inputAffixWrapperMiddle]: u === "middle",
- [hr.inputAffixWrapperLarge]: u === "large",
- [hr.inputNotAllowClear]: !l
- }, a);
- return /* @__PURE__ */ q.jsx(
- FC,
- {
- prefixCls: hr.input,
- classNames: { affixWrapper: b },
- styles: { affixWrapper: t },
- autoFocus: n,
- type: r,
- placeholder: o,
- value: i,
- disabled: c,
- onClick: s,
- onKeyDown: v,
- onChange: m,
- allowClear: { clearIcon: l ? /* @__PURE__ */ q.jsx(gu, {}) : /* @__PURE__ */ q.jsx(q.Fragment, {}) },
- ...p
- }
- );
- }
- function Ps(e) {
- switch (e) {
- case "small":
- return 6;
- case "middle":
- return 6;
- case "large":
- return 8;
- default:
- return 6;
- }
- }
- function WO(e) {
- const { slot: t, ...n } = e, r = Ce(null), [a, o] = me.useState(Ps(e.size));
- return lt(() => {
- let i;
- return r.current && (i = new ResizeObserver(() => {
- const u = Ps(e.size) * 2 + r.current.offsetWidth;
- o(u);
- }), i.observe(r.current)), () => {
- i == null || i.disconnect();
- };
- }, [t, r.current, e.size]), /* @__PURE__ */ q.jsxs("div", { className: hr.inputSlotContainer, children: [
- /* @__PURE__ */ q.jsx(QC, { ...n, affixWrapperStyle: { paddingRight: a } }),
- /* @__PURE__ */ q.jsx("div", { ref: r, className: hr.inputSlot, tabIndex: -1, onPointerDown: (i) => i.preventDefault(), children: t })
- ] });
- }
- function ru() {
- return typeof BigInt == "function";
- }
- function Sf(e) {
- return !e && e !== 0 && !Number.isNaN(e) || !String(e).trim();
- }
- function Cr(e) {
- var t = e.trim(), n = t.startsWith("-");
- n && (t = t.slice(1)), t = t.replace(/(\.\d*[^0])0*$/, "$1").replace(/\.0*$/, "").replace(/^0+/, ""), t.startsWith(".") && (t = "0".concat(t));
- var r = t || "0", a = r.split("."), o = a[0] || "0", i = a[1] || "0";
- o === "0" && i === "0" && (n = !1);
- var u = n ? "-" : "";
- return {
- negative: n,
- negativeStr: u,
- trimStr: r,
- integerStr: o,
- decimalStr: i,
- fullStr: "".concat(u).concat(r)
- };
- }
- function Hu(e) {
- var t = String(e);
- return !Number.isNaN(Number(t)) && t.includes("e");
- }
- function br(e) {
- var t = String(e);
- if (Hu(e)) {
- var n = Number(t.slice(t.indexOf("e-") + 2)), r = t.match(/\.(\d+)/);
- return r != null && r[1] && (n += r[1].length), n;
- }
- return t.includes(".") && Vu(t) ? t.length - t.indexOf(".") - 1 : 0;
- }
- function Xo(e) {
- var t = String(e);
- if (Hu(e)) {
- if (e > Number.MAX_SAFE_INTEGER)
- return String(ru() ? BigInt(e).toString() : Number.MAX_SAFE_INTEGER);
- if (e < Number.MIN_SAFE_INTEGER)
- return String(ru() ? BigInt(e).toString() : Number.MIN_SAFE_INTEGER);
- t = e.toFixed(br(t));
- }
- return Cr(t).fullStr;
- }
- function Vu(e) {
- return typeof e == "number" ? !Number.isNaN(e) : e ? (
- // Normal type: 11.28
- /^\s*-?\d+(\.\d+)?\s*$/.test(e) || // Pre-number: 1.
- /^\s*-?\d+\.\s*$/.test(e) || // Post-number: .1
- /^\s*-?\.\d+\s*$/.test(e)
- ) : !1;
- }
- var JC = /* @__PURE__ */ function() {
- function e(t) {
- if (Rr(this, e), ie(this, "origin", ""), ie(this, "negative", void 0), ie(this, "integer", void 0), ie(this, "decimal", void 0), ie(this, "decimalLen", void 0), ie(this, "empty", void 0), ie(this, "nan", void 0), Sf(t)) {
- this.empty = !0;
- return;
- }
- if (this.origin = String(t), t === "-" || Number.isNaN(t)) {
- this.nan = !0;
- return;
- }
- var n = t;
- if (Hu(n) && (n = Number(n)), n = typeof n == "string" ? n : Xo(n), Vu(n)) {
- var r = Cr(n);
- this.negative = r.negative;
- var a = r.trimStr.split(".");
- this.integer = BigInt(a[0]);
- var o = a[1] || "0";
- this.decimal = BigInt(o), this.decimalLen = o.length;
- } else
- this.nan = !0;
- }
- return Pr(e, [{
- key: "getMark",
- value: function() {
- return this.negative ? "-" : "";
- }
- }, {
- key: "getIntegerStr",
- value: function() {
- return this.integer.toString();
- }
- /**
- * @private get decimal string
- */
- }, {
- key: "getDecimalStr",
- value: function() {
- return this.decimal.toString().padStart(this.decimalLen, "0");
- }
- /**
- * @private Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
- * This is used for add function only.
- */
- }, {
- key: "alignDecimal",
- value: function(n) {
- var r = "".concat(this.getMark()).concat(this.getIntegerStr()).concat(this.getDecimalStr().padEnd(n, "0"));
- return BigInt(r);
- }
- }, {
- key: "negate",
- value: function() {
- var n = new e(this.toString());
- return n.negative = !n.negative, n;
- }
- }, {
- key: "cal",
- value: function(n, r, a) {
- var o = Math.max(this.getDecimalStr().length, n.getDecimalStr().length), i = this.alignDecimal(o), u = n.alignDecimal(o), l = r(i, u).toString(), c = a(o), s = Cr(l), v = s.negativeStr, C = s.trimStr, p = "".concat(v).concat(C.padStart(c + 1, "0"));
- return new e("".concat(p.slice(0, -c), ".").concat(p.slice(-c)));
- }
- }, {
- key: "add",
- value: function(n) {
- if (this.isInvalidate())
- return new e(n);
- var r = new e(n);
- return r.isInvalidate() ? this : this.cal(r, function(a, o) {
- return a + o;
- }, function(a) {
- return a;
- });
- }
- }, {
- key: "multi",
- value: function(n) {
- var r = new e(n);
- return this.isInvalidate() || r.isInvalidate() ? new e(NaN) : this.cal(r, function(a, o) {
- return a * o;
- }, function(a) {
- return a * 2;
- });
- }
- }, {
- key: "isEmpty",
- value: function() {
- return this.empty;
- }
- }, {
- key: "isNaN",
- value: function() {
- return this.nan;
- }
- }, {
- key: "isInvalidate",
- value: function() {
- return this.isEmpty() || this.isNaN();
- }
- }, {
- key: "equals",
- value: function(n) {
- return this.toString() === (n == null ? void 0 : n.toString());
- }
- }, {
- key: "lessEquals",
- value: function(n) {
- return this.add(n.negate().toString()).toNumber() <= 0;
- }
- }, {
- key: "toNumber",
- value: function() {
- return this.isNaN() ? NaN : Number(this.toString());
- }
- }, {
- key: "toString",
- value: function() {
- var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
- return n ? this.isInvalidate() ? "" : Cr("".concat(this.getMark()).concat(this.getIntegerStr(), ".").concat(this.getDecimalStr())).fullStr : this.origin;
- }
- }]), e;
- }(), eS = /* @__PURE__ */ function() {
- function e(t) {
- if (Rr(this, e), ie(this, "origin", ""), ie(this, "number", void 0), ie(this, "empty", void 0), Sf(t)) {
- this.empty = !0;
- return;
- }
- this.origin = String(t), this.number = Number(t);
- }
- return Pr(e, [{
- key: "negate",
- value: function() {
- return new e(-this.toNumber());
- }
- }, {
- key: "add",
- value: function(n) {
- if (this.isInvalidate())
- return new e(n);
- var r = Number(n);
- if (Number.isNaN(r))
- return this;
- var a = this.number + r;
- if (a > Number.MAX_SAFE_INTEGER)
- return new e(Number.MAX_SAFE_INTEGER);
- if (a < Number.MIN_SAFE_INTEGER)
- return new e(Number.MIN_SAFE_INTEGER);
- var o = Math.max(br(this.number), br(r));
- return new e(a.toFixed(o));
- }
- }, {
- key: "multi",
- value: function(n) {
- var r = Number(n);
- if (this.isInvalidate() || Number.isNaN(r))
- return new e(NaN);
- var a = this.number * r;
- if (a > Number.MAX_SAFE_INTEGER)
- return new e(Number.MAX_SAFE_INTEGER);
- if (a < Number.MIN_SAFE_INTEGER)
- return new e(Number.MIN_SAFE_INTEGER);
- var o = Math.max(br(this.number), br(r));
- return new e(a.toFixed(o));
- }
- }, {
- key: "isEmpty",
- value: function() {
- return this.empty;
- }
- }, {
- key: "isNaN",
- value: function() {
- return Number.isNaN(this.number);
- }
- }, {
- key: "isInvalidate",
- value: function() {
- return this.isEmpty() || this.isNaN();
- }
- }, {
- key: "equals",
- value: function(n) {
- return this.toNumber() === (n == null ? void 0 : n.toNumber());
- }
- }, {
- key: "lessEquals",
- value: function(n) {
- return this.add(n.negate().toString()).toNumber() <= 0;
- }
- }, {
- key: "toNumber",
- value: function() {
- return this.number;
- }
- }, {
- key: "toString",
- value: function() {
- var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !0;
- return n ? this.isInvalidate() ? "" : Xo(this.number) : this.origin;
- }
- }]), e;
- }();
- function En(e) {
- return ru() ? new JC(e) : new eS(e);
- }
- function xo(e, t, n) {
- var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1;
- if (e === "")
- return "";
- var a = Cr(e), o = a.negativeStr, i = a.integerStr, u = a.decimalStr, l = "".concat(t).concat(u), c = "".concat(o).concat(i);
- if (n >= 0) {
- var s = Number(u[n]);
- if (s >= 5 && !r) {
- var v = En(e).add("".concat(o, "0.").concat("0".repeat(n)).concat(10 - s));
- return xo(v.toString(), t, n, r);
- }
- return n === 0 ? c : "".concat(c).concat(t).concat(u.padEnd(n, "0").slice(0, n));
- }
- return l === ".0" ? c : "".concat(c).concat(l);
- }
- function tS(e, t) {
- return typeof Proxy < "u" && e ? new Proxy(e, {
- get: function(r, a) {
- if (t[a])
- return t[a];
- var o = r[a];
- return typeof o == "function" ? o.bind(r) : o;
- }
- }) : e;
- }
- function nS(e, t) {
- var n = Ce(null);
- function r() {
- try {
- var o = e.selectionStart, i = e.selectionEnd, u = e.value, l = u.substring(0, o), c = u.substring(i);
- n.current = {
- start: o,
- end: i,
- value: u,
- beforeTxt: l,
- afterTxt: c
- };
- } catch {
- }
- }
- function a() {
- if (e && n.current && t)
- try {
- var o = e.value, i = n.current, u = i.beforeTxt, l = i.afterTxt, c = i.start, s = o.length;
- if (o.startsWith(u))
- s = u.length;
- else if (o.endsWith(l))
- s = o.length - n.current.afterTxt.length;
- else {
- var v = u[c - 1], C = o.indexOf(v, c - 1);
- C !== -1 && (s = C + 1);
- }
- e.setSelectionRange(s, s);
- } catch (p) {
- ur(!1, "Something warning of cursor restore. Please fire issue about this: ".concat(p.message));
- }
- }
- return [r, a];
- }
- var rS = function() {
- var t = rt(!1), n = cn(t, 2), r = n[0], a = n[1];
- return St(function() {
- a(Du());
- }, []), r;
- }, aS = 200, oS = 600;
- function iS(e) {
- var t = e.prefixCls, n = e.upNode, r = e.downNode, a = e.upDisabled, o = e.downDisabled, i = e.onStep, u = d.useRef(), l = d.useRef([]), c = d.useRef();
- c.current = i;
- var s = function() {
- clearTimeout(u.current);
- }, v = function(y, w) {
- y.preventDefault(), s(), c.current(w);
- function E() {
- c.current(w), u.current = setTimeout(E, aS);
- }
- u.current = setTimeout(E, oS);
- };
- d.useEffect(function() {
- return function() {
- s(), l.current.forEach(function(g) {
- return st.cancel(g);
- });
- };
- }, []);
- var C = rS();
- if (C)
- return null;
- var p = "".concat(t, "-handler"), m = xe(p, "".concat(p, "-up"), ie({}, "".concat(p, "-up-disabled"), a)), b = xe(p, "".concat(p, "-down"), ie({}, "".concat(p, "-down-disabled"), o)), f = function() {
- return l.current.push(st(s));
- }, h = {
- unselectable: "on",
- role: "button",
- onMouseUp: f,
- onMouseLeave: f
- };
- return /* @__PURE__ */ d.createElement("div", {
- className: "".concat(p, "-wrap")
- }, /* @__PURE__ */ d.createElement("span", _e({}, h, {
- onMouseDown: function(y) {
- v(y, !0);
- },
- "aria-label": "Increase Value",
- "aria-disabled": a,
- className: m
- }), n || /* @__PURE__ */ d.createElement("span", {
- unselectable: "on",
- className: "".concat(t, "-handler-up-inner")
- })), /* @__PURE__ */ d.createElement("span", _e({}, h, {
- onMouseDown: function(y) {
- v(y, !1);
- },
- "aria-label": "Decrease Value",
- "aria-disabled": o,
- className: b
- }), r || /* @__PURE__ */ d.createElement("span", {
- unselectable: "on",
- className: "".concat(t, "-handler-down-inner")
- })));
- }
- function Ms(e) {
- var t = typeof e == "number" ? Xo(e) : Cr(e).fullStr, n = t.includes(".");
- return n ? Cr(t.replace(/(\d)\.(\d)/g, "$1$2.")).fullStr : e + "0";
- }
- const uS = function() {
- var e = Ce(0), t = function() {
- st.cancel(e.current);
- };
- return lt(function() {
- return t;
- }, []), function(n) {
- t(), e.current = st(function() {
- n();
- });
- };
- };
- var lS = ["prefixCls", "className", "style", "min", "max", "step", "defaultValue", "value", "disabled", "readOnly", "upHandler", "downHandler", "keyboard", "changeOnWheel", "controls", "classNames", "stringMode", "parser", "formatter", "precision", "decimalSeparator", "onChange", "onInput", "onPressEnter", "onStep", "changeOnBlur", "domRef"], sS = ["disabled", "style", "prefixCls", "value", "prefix", "suffix", "addonBefore", "addonAfter", "className", "classNames"], ks = function(t, n) {
- return t || n.isEmpty() ? n.toString() : n.toNumber();
- }, Ds = function(t) {
- var n = En(t);
- return n.isInvalidate() ? null : n;
- }, cS = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.prefixCls, r = e.className, a = e.style, o = e.min, i = e.max, u = e.step, l = u === void 0 ? 1 : u, c = e.defaultValue, s = e.value, v = e.disabled, C = e.readOnly, p = e.upHandler, m = e.downHandler, b = e.keyboard, f = e.changeOnWheel, h = f === void 0 ? !1 : f, g = e.controls, y = g === void 0 ? !0 : g;
- e.classNames;
- var w = e.stringMode, E = e.parser, S = e.formatter, x = e.precision, R = e.decimalSeparator, k = e.onChange, L = e.onInput, O = e.onPressEnter, N = e.onStep, F = e.changeOnBlur, I = F === void 0 ? !0 : F, T = e.domRef, P = mt(e, lS), z = "".concat(n, "-input"), _ = d.useRef(null), A = d.useState(!1), H = Z(A, 2), $ = H[0], U = H[1], G = d.useRef(!1), B = d.useRef(!1), ne = d.useRef(!1), le = d.useState(function() {
- return En(s != null ? s : c);
- }), ee = Z(le, 2), V = ee[0], X = ee[1];
- function J($e) {
- s === void 0 && X($e);
- }
- var M = d.useCallback(function($e, ge) {
- if (!ge)
- return x >= 0 ? x : Math.max(br($e), br(l));
- }, [x, l]), D = d.useCallback(function($e) {
- var ge = String($e);
- if (E)
- return E(ge);
- var ke = ge;
- return R && (ke = ke.replace(R, ".")), ke.replace(/[^\w.-]+/g, "");
- }, [E, R]), j = d.useRef(""), W = d.useCallback(function($e, ge) {
- if (S)
- return S($e, {
- userTyping: ge,
- input: String(j.current)
- });
- var ke = typeof $e == "number" ? Xo($e) : $e;
- if (!ge) {
- var Te = M(ke, ge);
- if (Vu(ke) && (R || Te >= 0)) {
- var Ke = R || ".";
- ke = xo(ke, Ke, Te);
- }
- }
- return ke;
- }, [S, M, R]), K = d.useState(function() {
- var $e = c != null ? c : s;
- return V.isInvalidate() && ["string", "number"].includes(_t($e)) ? Number.isNaN($e) ? "" : $e : W(V.toString(), !1);
- }), Y = Z(K, 2), te = Y[0], Q = Y[1];
- j.current = te;
- function ae($e, ge) {
- Q(W(
- // Invalidate number is sometime passed by external control, we should let it go
- // Otherwise is controlled by internal interactive logic which check by userTyping
- // You can ref 'show limited value when input is not focused' test for more info.
- $e.isInvalidate() ? $e.toString(!1) : $e.toString(!ge),
- ge
- ));
- }
- var ue = d.useMemo(function() {
- return Ds(i);
- }, [i, x]), se = d.useMemo(function() {
- return Ds(o);
- }, [o, x]), pe = d.useMemo(function() {
- return !ue || !V || V.isInvalidate() ? !1 : ue.lessEquals(V);
- }, [ue, V]), oe = d.useMemo(function() {
- return !se || !V || V.isInvalidate() ? !1 : V.lessEquals(se);
- }, [se, V]), ve = nS(_.current, $), ze = Z(ve, 2), Re = ze[0], Be = ze[1], je = function(ge) {
- return ue && !ge.lessEquals(ue) ? ue : se && !se.lessEquals(ge) ? se : null;
- }, He = function(ge) {
- return !je(ge);
- }, Ye = function(ge, ke) {
- var Te = ge, Ke = He(Te) || Te.isEmpty();
- if (!Te.isEmpty() && !ke && (Te = je(Te) || Te, Ke = !0), !C && !v && Ke) {
- var De = Te.toString(), we = M(De, ke);
- return we >= 0 && (Te = En(xo(De, ".", we)), He(Te) || (Te = En(xo(De, ".", we, !0)))), Te.equals(V) || (J(Te), k == null || k(Te.isEmpty() ? null : ks(w, Te)), s === void 0 && ae(Te, ke)), Te;
- }
- return V;
- }, nt = uS(), Ge = function $e(ge) {
- if (Re(), j.current = ge, Q(ge), !B.current) {
- var ke = D(ge), Te = En(ke);
- Te.isNaN() || Ye(Te, !0);
- }
- L == null || L(ge), nt(function() {
- var Ke = ge;
- E || (Ke = ge.replace(/。/g, ".")), Ke !== ge && $e(Ke);
- });
- }, Ne = function() {
- B.current = !0;
- }, ce = function() {
- B.current = !1, Ge(_.current.value);
- }, he = function(ge) {
- Ge(ge.target.value);
- }, Ve = function(ge) {
- var ke;
- if (!(ge && pe || !ge && oe)) {
- G.current = !1;
- var Te = En(ne.current ? Ms(l) : l);
- ge || (Te = Te.negate());
- var Ke = (V || En(0)).add(Te.toString()), De = Ye(Ke, !1);
- N == null || N(ks(w, De), {
- offset: ne.current ? Ms(l) : l,
- type: ge ? "up" : "down"
- }), (ke = _.current) === null || ke === void 0 || ke.focus();
- }
- }, de = function(ge) {
- var ke = En(D(te)), Te;
- ke.isNaN() ? Te = Ye(V, ge) : Te = Ye(ke, ge), s !== void 0 ? ae(V, !1) : Te.isNaN() || ae(Te, !1);
- }, be = function() {
- G.current = !0;
- }, Xe = function(ge) {
- var ke = ge.key, Te = ge.shiftKey;
- G.current = !0, ne.current = Te, ke === "Enter" && (B.current || (G.current = !1), de(!1), O == null || O(ge)), b !== !1 && !B.current && ["Up", "ArrowUp", "Down", "ArrowDown"].includes(ke) && (Ve(ke === "Up" || ke === "ArrowUp"), ge.preventDefault());
- }, it = function() {
- G.current = !1, ne.current = !1;
- };
- d.useEffect(function() {
- if (h && $) {
- var $e = function(Te) {
- Ve(Te.deltaY < 0), Te.preventDefault();
- }, ge = _.current;
- if (ge)
- return ge.addEventListener("wheel", $e, {
- passive: !1
- }), function() {
- return ge.removeEventListener("wheel", $e);
- };
- }
- });
- var tt = function() {
- I && de(!1), U(!1), G.current = !1;
- };
- return Wr(function() {
- V.isInvalidate() || ae(V, !1);
- }, [x, S]), Wr(function() {
- var $e = En(s);
- X($e);
- var ge = En(D(te));
- (!$e.equals(ge) || !G.current || S) && ae($e, G.current);
- }, [s]), Wr(function() {
- S && Be();
- }, [te]), /* @__PURE__ */ d.createElement("div", {
- ref: T,
- className: xe(n, r, ie(ie(ie(ie(ie({}, "".concat(n, "-focused"), $), "".concat(n, "-disabled"), v), "".concat(n, "-readonly"), C), "".concat(n, "-not-a-number"), V.isNaN()), "".concat(n, "-out-of-range"), !V.isInvalidate() && !He(V))),
- style: a,
- onFocus: function() {
- U(!0);
- },
- onBlur: tt,
- onKeyDown: Xe,
- onKeyUp: it,
- onCompositionStart: Ne,
- onCompositionEnd: ce,
- onBeforeInput: be
- }, y && /* @__PURE__ */ d.createElement(iS, {
- prefixCls: n,
- upNode: p,
- downNode: m,
- upDisabled: pe,
- downDisabled: oe,
- onStep: Ve
- }), /* @__PURE__ */ d.createElement("div", {
- className: "".concat(z, "-wrap")
- }, /* @__PURE__ */ d.createElement("input", _e({
- autoComplete: "off",
- role: "spinbutton",
- "aria-valuemin": o,
- "aria-valuemax": i,
- "aria-valuenow": V.isInvalidate() ? null : V.toString(),
- step: l
- }, P, {
- ref: lr(_, t),
- className: z,
- value: te,
- onChange: he,
- disabled: v,
- readOnly: C
- }))));
- }), dS = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.disabled, r = e.style, a = e.prefixCls, o = a === void 0 ? "rc-input-number" : a, i = e.value, u = e.prefix, l = e.suffix, c = e.addonBefore, s = e.addonAfter, v = e.className, C = e.classNames, p = mt(e, sS), m = d.useRef(null), b = d.useRef(null), f = d.useRef(null), h = function(y) {
- f.current && gf(f.current, y);
- };
- return d.useImperativeHandle(t, function() {
- return tS(f.current, {
- focus: h,
- nativeElement: m.current.nativeElement || b.current
- });
- }), /* @__PURE__ */ d.createElement(yf, {
- className: v,
- triggerFocus: h,
- prefixCls: o,
- value: i,
- disabled: n,
- style: r,
- prefix: u,
- suffix: l,
- addonAfter: s,
- addonBefore: c,
- classNames: C,
- components: {
- affixWrapper: "div",
- groupWrapper: "div",
- wrapper: "div",
- groupAddon: "div"
- },
- ref: m
- }, /* @__PURE__ */ d.createElement(cS, _e({
- prefixCls: o,
- disabled: n,
- ref: f,
- domRef: b,
- className: C == null ? void 0 : C.input
- }, p)));
- });
- const fS = "univer-input-number", vS = "univer-input-number-focused", mS = "univer-input-number-handler-up", pS = "univer-input-number-handler-wrap", hS = "univer-input-number-handler", gS = "univer-input-number-handler-up-inner", yS = "univer-input-number-handler-down-inner", bS = "univer-input-number-disabled", CS = "univer-input-number-input-wrap", SS = "univer-input-number-input", wS = "univer-input-number-handler-down", xS = "univer-input-number-handler-down-disabled", ES = "univer-input-number-handler-up-disabled", RS = {
- inputNumber: fS,
- inputNumberFocused: vS,
- inputNumberHandlerUp: mS,
- inputNumberHandlerWrap: pS,
- inputNumberHandler: hS,
- inputNumberHandlerUpInner: gS,
- inputNumberHandlerDownInner: yS,
- inputNumberDisabled: bS,
- inputNumberInputWrap: CS,
- inputNumberInput: SS,
- inputNumberHandlerDown: wS,
- inputNumberHandlerDownDisabled: xS,
- inputNumberHandlerUpDisabled: ES
- }, BO = $t((e, t) => {
- const {
- className: n,
- value: r,
- max: a,
- min: o,
- step: i = 1,
- precision: u,
- disabled: l = !1,
- controls: c = !0,
- onClick: s,
- onKeyDown: v,
- onChange: C,
- onPressEnter: p,
- onBlur: m,
- onFocus: b
- } = e;
- function f(h) {
- h !== null && (C == null || C(h));
- }
- return /* @__PURE__ */ q.jsx(
- dS,
- {
- ref: t,
- prefixCls: RS.inputNumber,
- className: n,
- value: r,
- max: a,
- min: o,
- step: i,
- precision: u,
- disabled: l,
- controls: c,
- onClick: s,
- onKeyDown: v,
- onChange: f,
- onPressEnter: p,
- onFocus: b,
- onBlur: m
- }
- );
- });
- function wf(e, t) {
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, r = /* @__PURE__ */ new Set();
- function a(o, i) {
- var u = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, l = r.has(o);
- if (ur(!l, "Warning: There may be circular references"), l)
- return !1;
- if (o === i)
- return !0;
- if (n && u > 1)
- return !1;
- r.add(o);
- var c = u + 1;
- if (Array.isArray(o)) {
- if (!Array.isArray(i) || o.length !== i.length)
- return !1;
- for (var s = 0; s < o.length; s++)
- if (!a(o[s], i[s], c))
- return !1;
- return !0;
- }
- if (o && i && Dn(o) === "object" && Dn(i) === "object") {
- var v = Object.keys(o);
- return v.length !== Object.keys(i).length ? !1 : v.every(function(C) {
- return a(o[C], i[C], c);
- });
- }
- return !1;
- }
- return a(e, t);
- }
- var xf = /* @__PURE__ */ d.createContext(null);
- function Ef(e, t) {
- return e === void 0 ? null : "".concat(e, "-").concat(t);
- }
- function Rf(e) {
- var t = d.useContext(xf);
- return Ef(t, e);
- }
- var PS = ["children", "locked"], Nn = /* @__PURE__ */ d.createContext(null);
- function MS(e, t) {
- var n = re({}, e);
- return Object.keys(t).forEach(function(r) {
- var a = t[r];
- a !== void 0 && (n[r] = a);
- }), n;
- }
- function Ta(e) {
- var t = e.children, n = e.locked, r = mt(e, PS), a = d.useContext(Nn), o = Su(function() {
- return MS(a, r);
- }, [a, r], function(i, u) {
- return !n && (i[0] !== u[0] || !wf(i[1], u[1], !0));
- });
- return /* @__PURE__ */ d.createElement(Nn.Provider, {
- value: o
- }, t);
- }
- var kS = [], Pf = /* @__PURE__ */ d.createContext(null);
- function Zo() {
- return d.useContext(Pf);
- }
- var Mf = /* @__PURE__ */ d.createContext(kS);
- function za(e) {
- var t = d.useContext(Mf);
- return d.useMemo(function() {
- return e !== void 0 ? [].concat(ft(t), [e]) : t;
- }, [t, e]);
- }
- var kf = /* @__PURE__ */ d.createContext(null), Wu = /* @__PURE__ */ d.createContext({});
- function Ns(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- if (_u(e)) {
- var n = e.nodeName.toLowerCase(), r = (
- // Focusable element
- ["input", "select", "textarea", "button"].includes(n) || // Editable element
- e.isContentEditable || // Anchor with href element
- n === "a" && !!e.getAttribute("href")
- ), a = e.getAttribute("tabindex"), o = Number(a), i = null;
- return a && !Number.isNaN(o) ? i = o : r && i === null && (i = 0), r && e.disabled && (i = null), i !== null && (i >= 0 || t && i < 0);
- }
- return !1;
- }
- function DS(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, n = Yc(e.querySelectorAll("*")).filter(function(r) {
- return Ns(r, t);
- });
- return Ns(e, t) && n.unshift(e), n;
- }
- var au = fe.LEFT, ou = fe.RIGHT, iu = fe.UP, Eo = fe.DOWN, Ro = fe.ENTER, Df = fe.ESC, fa = fe.HOME, va = fe.END, Is = [iu, Eo, au, ou];
- function NS(e, t, n, r) {
- var a, o = "prev", i = "next", u = "children", l = "parent";
- if (e === "inline" && r === Ro)
- return {
- inlineTrigger: !0
- };
- var c = ie(ie({}, iu, o), Eo, i), s = ie(ie(ie(ie({}, au, n ? i : o), ou, n ? o : i), Eo, u), Ro, u), v = ie(ie(ie(ie(ie(ie({}, iu, o), Eo, i), Ro, u), Df, l), au, n ? u : l), ou, n ? l : u), C = {
- inline: c,
- horizontal: s,
- vertical: v,
- inlineSub: c,
- horizontalSub: v,
- verticalSub: v
- }, p = (a = C["".concat(e).concat(t ? "" : "Sub")]) === null || a === void 0 ? void 0 : a[r];
- switch (p) {
- case o:
- return {
- offset: -1,
- sibling: !0
- };
- case i:
- return {
- offset: 1,
- sibling: !0
- };
- case l:
- return {
- offset: -1,
- sibling: !1
- };
- case u:
- return {
- offset: 1,
- sibling: !1
- };
- default:
- return null;
- }
- }
- function IS(e) {
- for (var t = e; t; ) {
- if (t.getAttribute("data-menu-list"))
- return t;
- t = t.parentElement;
- }
- return null;
- }
- function OS(e, t) {
- for (var n = e || document.activeElement; n; ) {
- if (t.has(n))
- return n;
- n = n.parentElement;
- }
- return null;
- }
- function Bu(e, t) {
- var n = DS(e, !0);
- return n.filter(function(r) {
- return t.has(r);
- });
- }
- function Os(e, t, n) {
- var r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
- if (!e)
- return null;
- var a = Bu(e, t), o = a.length, i = a.findIndex(function(u) {
- return n === u;
- });
- return r < 0 ? i === -1 ? i = o - 1 : i -= 1 : r > 0 && (i += 1), i = (i + o) % o, a[i];
- }
- var uu = function(t, n) {
- var r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
- return t.forEach(function(i) {
- var u = document.querySelector("[data-menu-id='".concat(Ef(n, i), "']"));
- u && (r.add(u), o.set(u, i), a.set(i, u));
- }), {
- elements: r,
- key2element: a,
- element2key: o
- };
- };
- function _S(e, t, n, r, a, o, i, u, l, c) {
- var s = d.useRef(), v = d.useRef();
- v.current = t;
- var C = function() {
- st.cancel(s.current);
- };
- return d.useEffect(function() {
- return function() {
- C();
- };
- }, []), function(p) {
- var m = p.which;
- if ([].concat(Is, [Ro, Df, fa, va]).includes(m)) {
- var b = o(), f = uu(b, r), h = f, g = h.elements, y = h.key2element, w = h.element2key, E = y.get(t), S = OS(E, g), x = w.get(S), R = NS(e, i(x, !0).length === 1, n, m);
- if (!R && m !== fa && m !== va)
- return;
- (Is.includes(m) || [fa, va].includes(m)) && p.preventDefault();
- var k = function(z) {
- if (z) {
- var _ = z, A = z.querySelector("a");
- A != null && A.getAttribute("href") && (_ = A);
- var H = w.get(z);
- u(H), C(), s.current = st(function() {
- v.current === H && _.focus();
- });
- }
- };
- if ([fa, va].includes(m) || R.sibling || !S) {
- var L;
- !S || e === "inline" ? L = a.current : L = IS(S);
- var O, N = Bu(L, g);
- m === fa ? O = N[0] : m === va ? O = N[N.length - 1] : O = Os(L, g, S, R.offset), k(O);
- } else if (R.inlineTrigger)
- l(x);
- else if (R.offset > 0)
- l(x, !0), C(), s.current = st(function() {
- f = uu(b, r);
- var P = S.getAttribute("aria-controls"), z = document.getElementById(P), _ = Os(z, f.elements);
- k(_);
- }, 5);
- else if (R.offset < 0) {
- var F = i(x, !0), I = F[F.length - 2], T = y.get(I);
- l(I, !1), k(T);
- }
- }
- c == null || c(p);
- };
- }
- function LS(e) {
- Promise.resolve().then(e);
- }
- var Uu = "__RC_UTIL_PATH_SPLIT__", _s = function(t) {
- return t.join(Uu);
- }, TS = function(t) {
- return t.split(Uu);
- }, lu = "rc-menu-more";
- function $S() {
- var e = d.useState({}), t = Z(e, 2), n = t[1], r = Ce(/* @__PURE__ */ new Map()), a = Ce(/* @__PURE__ */ new Map()), o = d.useState([]), i = Z(o, 2), u = i[0], l = i[1], c = Ce(0), s = Ce(!1), v = function() {
- s.current || n({});
- }, C = Ot(function(y, w) {
- var E = _s(w);
- a.current.set(E, y), r.current.set(y, E), c.current += 1;
- var S = c.current;
- LS(function() {
- S === c.current && v();
- });
- }, []), p = Ot(function(y, w) {
- var E = _s(w);
- a.current.delete(E), r.current.delete(y);
- }, []), m = Ot(function(y) {
- l(y);
- }, []), b = Ot(function(y, w) {
- var E = r.current.get(y) || "", S = TS(E);
- return w && u.includes(S[0]) && S.unshift(lu), S;
- }, [u]), f = Ot(function(y, w) {
- return y.filter(function(E) {
- return E !== void 0;
- }).some(function(E) {
- var S = b(E, !0);
- return S.includes(w);
- });
- }, [b]), h = function() {
- var w = ft(r.current.keys());
- return u.length && w.push(lu), w;
- }, g = Ot(function(y) {
- var w = "".concat(r.current.get(y)).concat(Uu), E = /* @__PURE__ */ new Set();
- return ft(a.current.keys()).forEach(function(S) {
- S.startsWith(w) && E.add(a.current.get(S));
- }), E;
- }, []);
- return d.useEffect(function() {
- return function() {
- s.current = !0;
- };
- }, []), {
- // Register
- registerPath: C,
- unregisterPath: p,
- refreshOverflowKeys: m,
- // Util
- isSubPathKey: f,
- getKeyPath: b,
- getKeys: h,
- getSubPathKeys: g
- };
- }
- function Ea(e) {
- var t = d.useRef(e);
- t.current = e;
- var n = d.useCallback(function() {
- for (var r, a = arguments.length, o = new Array(a), i = 0; i < a; i++)
- o[i] = arguments[i];
- return (r = t.current) === null || r === void 0 ? void 0 : r.call.apply(r, [t].concat(o));
- }, []);
- return e ? n : void 0;
- }
- var AS = Math.random().toFixed(5).toString().slice(2), Ls = 0;
- function jS(e) {
- var t = Gt(e, {
- value: e
- }), n = Z(t, 2), r = n[0], a = n[1];
- return d.useEffect(function() {
- Ls += 1;
- var o = "".concat(AS, "-").concat(Ls);
- a("rc-menu-uuid-".concat(o));
- }, []), r;
- }
- function Nf(e, t, n, r) {
- var a = d.useContext(Nn), o = a.activeKey, i = a.onActive, u = a.onInactive, l = {
- active: o === e
- };
- return t || (l.onMouseEnter = function(c) {
- n == null || n({
- key: e,
- domEvent: c
- }), i(e);
- }, l.onMouseLeave = function(c) {
- r == null || r({
- key: e,
- domEvent: c
- }), u(e);
- }), l;
- }
- function If(e) {
- var t = d.useContext(Nn), n = t.mode, r = t.rtl, a = t.inlineIndent;
- if (n !== "inline")
- return null;
- var o = e;
- return r ? {
- paddingRight: o * a
- } : {
- paddingLeft: o * a
- };
- }
- function Of(e) {
- var t = e.icon, n = e.props, r = e.children, a;
- return t === null || t === !1 ? null : (typeof t == "function" ? a = /* @__PURE__ */ d.createElement(t, re({}, n)) : typeof t != "boolean" && (a = t), a || r || null);
- }
- var FS = ["item"];
- function $o(e) {
- var t = e.item, n = mt(e, FS);
- return Object.defineProperty(n, "item", {
- get: function() {
- return ur(!1, "`info.item` is deprecated since we will move to function component that not provides React Node instance in future."), t;
- }
- }), n;
- }
- var zS = ["title", "attribute", "elementRef"], HS = ["style", "className", "eventKey", "warnKey", "disabled", "itemIcon", "children", "role", "onMouseEnter", "onMouseLeave", "onClick", "onKeyDown", "onFocus"], VS = ["active"], WS = /* @__PURE__ */ function(e) {
- Nu(n, e);
- var t = Iu(n);
- function n() {
- return Rr(this, n), t.apply(this, arguments);
- }
- return Pr(n, [{
- key: "render",
- value: function() {
- var a = this.props, o = a.title, i = a.attribute, u = a.elementRef, l = mt(a, zS), c = Er(l, ["eventKey", "popupClassName", "popupOffset", "onTitleClick"]);
- return ur(!i, "`attribute` of Menu.Item is deprecated. Please pass attribute directly."), /* @__PURE__ */ d.createElement(kn.Item, _e({}, i, {
- title: typeof o == "string" ? o : void 0
- }, c, {
- ref: u
- }));
- }
- }]), n;
- }(d.Component), BS = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.style, r = e.className, a = e.eventKey;
- e.warnKey;
- var o = e.disabled, i = e.itemIcon, u = e.children, l = e.role, c = e.onMouseEnter, s = e.onMouseLeave, v = e.onClick, C = e.onKeyDown, p = e.onFocus, m = mt(e, HS), b = Rf(a), f = d.useContext(Nn), h = f.prefixCls, g = f.onItemClick, y = f.disabled, w = f.overflowDisabled, E = f.itemIcon, S = f.selectedKeys, x = f.onActive, R = d.useContext(Wu), k = R._internalRenderMenuItem, L = "".concat(h, "-item"), O = d.useRef(), N = d.useRef(), F = y || o, I = Gr(t, N), T = za(a), P = function(X) {
- return {
- key: a,
- // Note: For legacy code is reversed which not like other antd component
- keyPath: ft(T).reverse(),
- item: O.current,
- domEvent: X
- };
- }, z = i || E, _ = Nf(a, F, c, s), A = _.active, H = mt(_, VS), $ = S.includes(a), U = If(T.length), G = function(X) {
- if (!F) {
- var J = P(X);
- v == null || v($o(J)), g(J);
- }
- }, B = function(X) {
- if (C == null || C(X), X.which === fe.ENTER) {
- var J = P(X);
- v == null || v($o(J)), g(J);
- }
- }, ne = function(X) {
- x(a), p == null || p(X);
- }, le = {};
- e.role === "option" && (le["aria-selected"] = $);
- var ee = /* @__PURE__ */ d.createElement(WS, _e({
- ref: O,
- elementRef: I,
- role: l === null ? "none" : l || "menuitem",
- tabIndex: o ? null : -1,
- "data-menu-id": w && b ? null : b
- }, Er(m, ["extra"]), H, le, {
- component: "li",
- "aria-disabled": o,
- style: re(re({}, U), n),
- className: xe(L, ie(ie(ie({}, "".concat(L, "-active"), A), "".concat(L, "-selected"), $), "".concat(L, "-disabled"), F), r),
- onClick: G,
- onKeyDown: B,
- onFocus: ne
- }), u, /* @__PURE__ */ d.createElement(Of, {
- props: re(re({}, e), {}, {
- isSelected: $
- }),
- icon: z
- }));
- return k && (ee = k(ee, e, {
- selected: $
- })), ee;
- });
- function US(e, t) {
- var n = e.eventKey, r = Zo(), a = za(n);
- return d.useEffect(function() {
- if (r)
- return r.registerPath(n, a), function() {
- r.unregisterPath(n, a);
- };
- }, [a]), r ? null : /* @__PURE__ */ d.createElement(BS, _e({}, e, {
- ref: t
- }));
- }
- const Qo = /* @__PURE__ */ d.forwardRef(US);
- var qS = ["className", "children"], KS = function(t, n) {
- var r = t.className, a = t.children, o = mt(t, qS), i = d.useContext(Nn), u = i.prefixCls, l = i.mode, c = i.rtl;
- return /* @__PURE__ */ d.createElement("ul", _e({
- className: xe(u, c && "".concat(u, "-rtl"), "".concat(u, "-sub"), "".concat(u, "-").concat(l === "inline" ? "inline" : "vertical"), r),
- role: "menu"
- }, o, {
- "data-menu-list": !0,
- ref: n
- }), a);
- }, qu = /* @__PURE__ */ d.forwardRef(KS);
- qu.displayName = "SubMenuList";
- function Ku(e, t) {
- return Oa(e).map(function(n, r) {
- if (/* @__PURE__ */ d.isValidElement(n)) {
- var a, o, i = n.key, u = (a = (o = n.props) === null || o === void 0 ? void 0 : o.eventKey) !== null && a !== void 0 ? a : i, l = u == null;
- l && (u = "tmp_key-".concat([].concat(ft(t), [r]).join("-")));
- var c = {
- key: u,
- eventKey: u
- };
- return /* @__PURE__ */ d.cloneElement(n, c);
- }
- return n;
- });
- }
- var tn = {
- adjustX: 1,
- adjustY: 1
- }, YS = {
- topLeft: {
- points: ["bl", "tl"],
- overflow: tn
- },
- topRight: {
- points: ["br", "tr"],
- overflow: tn
- },
- bottomLeft: {
- points: ["tl", "bl"],
- overflow: tn
- },
- bottomRight: {
- points: ["tr", "br"],
- overflow: tn
- },
- leftTop: {
- points: ["tr", "tl"],
- overflow: tn
- },
- leftBottom: {
- points: ["br", "bl"],
- overflow: tn
- },
- rightTop: {
- points: ["tl", "tr"],
- overflow: tn
- },
- rightBottom: {
- points: ["bl", "br"],
- overflow: tn
- }
- }, GS = {
- topLeft: {
- points: ["bl", "tl"],
- overflow: tn
- },
- topRight: {
- points: ["br", "tr"],
- overflow: tn
- },
- bottomLeft: {
- points: ["tl", "bl"],
- overflow: tn
- },
- bottomRight: {
- points: ["tr", "br"],
- overflow: tn
- },
- rightTop: {
- points: ["tr", "tl"],
- overflow: tn
- },
- rightBottom: {
- points: ["br", "bl"],
- overflow: tn
- },
- leftTop: {
- points: ["tl", "tr"],
- overflow: tn
- },
- leftBottom: {
- points: ["bl", "br"],
- overflow: tn
- }
- };
- function _f(e, t, n) {
- if (t)
- return t;
- if (n)
- return n[e] || n.other;
- }
- var XS = {
- horizontal: "bottomLeft",
- vertical: "rightTop",
- "vertical-left": "rightTop",
- "vertical-right": "leftTop"
- };
- function ZS(e) {
- var t = e.prefixCls, n = e.visible, r = e.children, a = e.popup, o = e.popupStyle, i = e.popupClassName, u = e.popupOffset, l = e.disabled, c = e.mode, s = e.onVisibleChange, v = d.useContext(Nn), C = v.getPopupContainer, p = v.rtl, m = v.subMenuOpenDelay, b = v.subMenuCloseDelay, f = v.builtinPlacements, h = v.triggerSubMenuAction, g = v.forceSubMenuRender, y = v.rootClassName, w = v.motion, E = v.defaultMotions, S = d.useState(!1), x = Z(S, 2), R = x[0], k = x[1], L = re(p ? re({}, GS) : re({}, YS), f), O = XS[c], N = _f(c, w, E), F = d.useRef(N);
- c !== "inline" && (F.current = N);
- var I = re(re({}, F.current), {}, {
- leavedClassName: "".concat(t, "-hidden"),
- removeOnLeave: !1,
- motionAppear: !0
- }), T = d.useRef();
- return d.useEffect(function() {
- return T.current = st(function() {
- k(n);
- }), function() {
- st.cancel(T.current);
- };
- }, [n]), /* @__PURE__ */ d.createElement(Uo, {
- prefixCls: t,
- popupClassName: xe("".concat(t, "-popup"), ie({}, "".concat(t, "-rtl"), p), i, y),
- stretch: c === "horizontal" ? "minWidth" : null,
- getPopupContainer: C,
- builtinPlacements: L,
- popupPlacement: O,
- popupVisible: R,
- popup: a,
- popupStyle: o,
- popupAlign: u && {
- offset: u
- },
- action: l ? [] : [h],
- mouseEnterDelay: m,
- mouseLeaveDelay: b,
- onPopupVisibleChange: s,
- forceRender: g,
- popupMotion: I,
- fresh: !0
- }, r);
- }
- function QS(e) {
- var t = e.id, n = e.open, r = e.keyPath, a = e.children, o = "inline", i = d.useContext(Nn), u = i.prefixCls, l = i.forceSubMenuRender, c = i.motion, s = i.defaultMotions, v = i.mode, C = d.useRef(!1);
- C.current = v === o;
- var p = d.useState(!C.current), m = Z(p, 2), b = m[0], f = m[1], h = C.current ? n : !1;
- d.useEffect(function() {
- C.current && f(!1);
- }, [v]);
- var g = re({}, _f(o, c, s));
- r.length > 1 && (g.motionAppear = !1);
- var y = g.onVisibleChanged;
- return g.onVisibleChanged = function(w) {
- return !C.current && !w && f(!0), y == null ? void 0 : y(w);
- }, b ? null : /* @__PURE__ */ d.createElement(Ta, {
- mode: o,
- locked: !C.current
- }, /* @__PURE__ */ d.createElement(Bo, _e({
- visible: h
- }, g, {
- forceRender: l,
- removeOnLeave: !1,
- leavedClassName: "".concat(u, "-hidden")
- }), function(w) {
- var E = w.className, S = w.style;
- return /* @__PURE__ */ d.createElement(qu, {
- id: t,
- className: E,
- style: S
- }, a);
- }));
- }
- var JS = ["style", "className", "title", "eventKey", "warnKey", "disabled", "internalPopupClose", "children", "itemIcon", "expandIcon", "popupClassName", "popupOffset", "popupStyle", "onClick", "onMouseEnter", "onMouseLeave", "onTitleClick", "onTitleMouseEnter", "onTitleMouseLeave"], ew = ["active"], tw = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.style, r = e.className, a = e.title, o = e.eventKey;
- e.warnKey;
- var i = e.disabled, u = e.internalPopupClose, l = e.children, c = e.itemIcon, s = e.expandIcon, v = e.popupClassName, C = e.popupOffset, p = e.popupStyle, m = e.onClick, b = e.onMouseEnter, f = e.onMouseLeave, h = e.onTitleClick, g = e.onTitleMouseEnter, y = e.onTitleMouseLeave, w = mt(e, JS), E = Rf(o), S = d.useContext(Nn), x = S.prefixCls, R = S.mode, k = S.openKeys, L = S.disabled, O = S.overflowDisabled, N = S.activeKey, F = S.selectedKeys, I = S.itemIcon, T = S.expandIcon, P = S.onItemClick, z = S.onOpenChange, _ = S.onActive, A = d.useContext(Wu), H = A._internalRenderSubMenuItem, $ = d.useContext(kf), U = $.isSubPathKey, G = za(), B = "".concat(x, "-submenu"), ne = L || i, le = d.useRef(), ee = d.useRef(), V = c != null ? c : I, X = s != null ? s : T, J = k.includes(o), M = !O && J, D = U(F, o), j = Nf(o, ne, g, y), W = j.active, K = mt(j, ew), Y = d.useState(!1), te = Z(Y, 2), Q = te[0], ae = te[1], ue = function(he) {
- ne || ae(he);
- }, se = function(he) {
- ue(!0), b == null || b({
- key: o,
- domEvent: he
- });
- }, pe = function(he) {
- ue(!1), f == null || f({
- key: o,
- domEvent: he
- });
- }, oe = d.useMemo(function() {
- return W || (R !== "inline" ? Q || U([N], o) : !1);
- }, [R, W, N, Q, o, U]), ve = If(G.length), ze = function(he) {
- ne || (h == null || h({
- key: o,
- domEvent: he
- }), R === "inline" && z(o, !J));
- }, Re = Ea(function(ce) {
- m == null || m($o(ce)), P(ce);
- }), Be = function(he) {
- R !== "inline" && z(o, he);
- }, je = function() {
- _(o);
- }, He = E && "".concat(E, "-popup"), Ye = /* @__PURE__ */ d.createElement("div", _e({
- role: "menuitem",
- style: ve,
- className: "".concat(B, "-title"),
- tabIndex: ne ? null : -1,
- ref: le,
- title: typeof a == "string" ? a : null,
- "data-menu-id": O && E ? null : E,
- "aria-expanded": M,
- "aria-haspopup": !0,
- "aria-controls": He,
- "aria-disabled": ne,
- onClick: ze,
- onFocus: je
- }, K), a, /* @__PURE__ */ d.createElement(Of, {
- icon: R !== "horizontal" ? X : void 0,
- props: re(re({}, e), {}, {
- isOpen: M,
- // [Legacy] Not sure why need this mark
- isSubMenu: !0
- })
- }, /* @__PURE__ */ d.createElement("i", {
- className: "".concat(B, "-arrow")
- }))), nt = d.useRef(R);
- if (R !== "inline" && G.length > 1 ? nt.current = "vertical" : nt.current = R, !O) {
- var Ge = nt.current;
- Ye = /* @__PURE__ */ d.createElement(ZS, {
- mode: Ge,
- prefixCls: B,
- visible: !u && M && R !== "inline",
- popupClassName: v,
- popupOffset: C,
- popupStyle: p,
- popup: /* @__PURE__ */ d.createElement(
- Ta,
- {
- mode: Ge === "horizontal" ? "vertical" : Ge
- },
- /* @__PURE__ */ d.createElement(qu, {
- id: He,
- ref: ee
- }, l)
- ),
- disabled: ne,
- onVisibleChange: Be
- }, Ye);
- }
- var Ne = /* @__PURE__ */ d.createElement(kn.Item, _e({
- ref: t,
- role: "none"
- }, w, {
- component: "li",
- style: n,
- className: xe(B, "".concat(B, "-").concat(R), r, ie(ie(ie(ie({}, "".concat(B, "-open"), M), "".concat(B, "-active"), oe), "".concat(B, "-selected"), D), "".concat(B, "-disabled"), ne)),
- onMouseEnter: se,
- onMouseLeave: pe
- }), Ye, !O && /* @__PURE__ */ d.createElement(QS, {
- id: He,
- open: M,
- keyPath: G
- }, l));
- return H && (Ne = H(Ne, e, {
- selected: D,
- active: oe,
- open: M,
- disabled: ne
- })), /* @__PURE__ */ d.createElement(Ta, {
- onItemClick: Re,
- mode: R === "horizontal" ? "vertical" : R,
- itemIcon: V,
- expandIcon: X
- }, Ne);
- }), Jo = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.eventKey, r = e.children, a = za(n), o = Ku(r, a), i = Zo();
- d.useEffect(function() {
- if (i)
- return i.registerPath(n, a), function() {
- i.unregisterPath(n, a);
- };
- }, [a]);
- var u;
- return i ? u = o : u = /* @__PURE__ */ d.createElement(tw, _e({
- ref: t
- }, e), o), /* @__PURE__ */ d.createElement(Mf.Provider, {
- value: a
- }, u);
- });
- function Lf(e) {
- var t = e.className, n = e.style, r = d.useContext(Nn), a = r.prefixCls, o = Zo();
- return o ? null : /* @__PURE__ */ d.createElement("li", {
- role: "separator",
- className: xe("".concat(a, "-item-divider"), t),
- style: n
- });
- }
- var nw = ["className", "title", "eventKey", "children"], rw = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.className, r = e.title;
- e.eventKey;
- var a = e.children, o = mt(e, nw), i = d.useContext(Nn), u = i.prefixCls, l = "".concat(u, "-item-group");
- return /* @__PURE__ */ d.createElement("li", _e({
- ref: t,
- role: "presentation"
- }, o, {
- onClick: function(s) {
- return s.stopPropagation();
- },
- className: xe(l, n)
- }), /* @__PURE__ */ d.createElement("div", {
- role: "presentation",
- className: "".concat(l, "-title"),
- title: typeof r == "string" ? r : void 0
- }, r), /* @__PURE__ */ d.createElement("ul", {
- role: "group",
- className: "".concat(l, "-list")
- }, a));
- }), Yu = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.eventKey, r = e.children, a = za(n), o = Ku(r, a), i = Zo();
- return i ? o : /* @__PURE__ */ d.createElement(rw, _e({
- ref: t
- }, Er(e, ["warnKey"])), o);
- }), aw = ["label", "children", "key", "type", "extra"];
- function su(e, t, n) {
- var r = t.item, a = t.group, o = t.submenu, i = t.divider;
- return (e || []).map(function(u, l) {
- if (u && _t(u) === "object") {
- var c = u, s = c.label, v = c.children, C = c.key, p = c.type, m = c.extra, b = mt(c, aw), f = C != null ? C : "tmp-".concat(l);
- return v || p === "group" ? p === "group" ? /* @__PURE__ */ d.createElement(a, _e({
- key: f
- }, b, {
- title: s
- }), su(v, t, n)) : /* @__PURE__ */ d.createElement(o, _e({
- key: f
- }, b, {
- title: s
- }), su(v, t, n)) : p === "divider" ? /* @__PURE__ */ d.createElement(i, _e({
- key: f
- }, b)) : /* @__PURE__ */ d.createElement(r, _e({
- key: f
- }, b, {
- extra: m
- }), s, (!!m || m === 0) && /* @__PURE__ */ d.createElement("span", {
- className: "".concat(n, "-item-extra")
- }, m));
- }
- return null;
- }).filter(function(u) {
- return u;
- });
- }
- function Ts(e, t, n, r, a) {
- var o = e, i = re({
- divider: Lf,
- item: Qo,
- group: Yu,
- submenu: Jo
- }, r);
- return t && (o = su(t, i, a)), Ku(o, n);
- }
- var ow = ["prefixCls", "rootClassName", "style", "className", "tabIndex", "items", "children", "direction", "id", "mode", "inlineCollapsed", "disabled", "disabledOverflow", "subMenuOpenDelay", "subMenuCloseDelay", "forceSubMenuRender", "defaultOpenKeys", "openKeys", "activeKey", "defaultActiveFirst", "selectable", "multiple", "defaultSelectedKeys", "selectedKeys", "onSelect", "onDeselect", "inlineIndent", "motion", "defaultMotions", "triggerSubMenuAction", "builtinPlacements", "itemIcon", "expandIcon", "overflowedIndicator", "overflowedIndicatorPopupClassName", "getPopupContainer", "onClick", "onOpenChange", "onKeyDown", "openAnimation", "openTransitionName", "_internalRenderMenuItem", "_internalRenderSubMenuItem", "_internalComponents"], fr = [], iw = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n, r = e, a = r.prefixCls, o = a === void 0 ? "rc-menu" : a, i = r.rootClassName, u = r.style, l = r.className, c = r.tabIndex, s = c === void 0 ? 0 : c, v = r.items, C = r.children, p = r.direction, m = r.id, b = r.mode, f = b === void 0 ? "vertical" : b, h = r.inlineCollapsed, g = r.disabled, y = r.disabledOverflow, w = r.subMenuOpenDelay, E = w === void 0 ? 0.1 : w, S = r.subMenuCloseDelay, x = S === void 0 ? 0.1 : S, R = r.forceSubMenuRender, k = r.defaultOpenKeys, L = r.openKeys, O = r.activeKey, N = r.defaultActiveFirst, F = r.selectable, I = F === void 0 ? !0 : F, T = r.multiple, P = T === void 0 ? !1 : T, z = r.defaultSelectedKeys, _ = r.selectedKeys, A = r.onSelect, H = r.onDeselect, $ = r.inlineIndent, U = $ === void 0 ? 24 : $, G = r.motion, B = r.defaultMotions, ne = r.triggerSubMenuAction, le = ne === void 0 ? "hover" : ne, ee = r.builtinPlacements, V = r.itemIcon, X = r.expandIcon, J = r.overflowedIndicator, M = J === void 0 ? "..." : J, D = r.overflowedIndicatorPopupClassName, j = r.getPopupContainer, W = r.onClick, K = r.onOpenChange, Y = r.onKeyDown;
- r.openAnimation, r.openTransitionName;
- var te = r._internalRenderMenuItem, Q = r._internalRenderSubMenuItem, ae = r._internalComponents, ue = mt(r, ow), se = d.useMemo(function() {
- return [Ts(C, v, fr, ae, o), Ts(C, v, fr, {}, o)];
- }, [C, v, ae]), pe = Z(se, 2), oe = pe[0], ve = pe[1], ze = d.useState(!1), Re = Z(ze, 2), Be = Re[0], je = Re[1], He = d.useRef(), Ye = jS(m), nt = p === "rtl", Ge = Gt(k, {
- value: L,
- postState: function(Ee) {
- return Ee || fr;
- }
- }), Ne = Z(Ge, 2), ce = Ne[0], he = Ne[1], Ve = function(Ee) {
- var Je = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- function ct() {
- he(Ee), K == null || K(Ee);
- }
- Je ? Di(ct) : ct();
- }, de = d.useState(ce), be = Z(de, 2), Xe = be[0], it = be[1], tt = d.useRef(!1), $e = d.useMemo(function() {
- return (f === "inline" || f === "vertical") && h ? ["vertical", h] : [f, !1];
- }, [f, h]), ge = Z($e, 2), ke = ge[0], Te = ge[1], Ke = ke === "inline", De = d.useState(ke), we = Z(De, 2), ye = we[0], ut = we[1], yt = d.useState(Te), Ie = Z(yt, 2), Oe = Ie[0], We = Ie[1];
- d.useEffect(function() {
- ut(ke), We(Te), tt.current && (Ke ? he(Xe) : Ve(fr));
- }, [ke, Te]);
- var Ue = d.useState(0), Ze = Z(Ue, 2), at = Ze[0], Lt = Ze[1], Et = at >= oe.length - 1 || ye !== "horizontal" || y;
- d.useEffect(function() {
- Ke && it(ce);
- }, [ce]), d.useEffect(function() {
- return tt.current = !0, function() {
- tt.current = !1;
- };
- }, []);
- var wt = $S(), pt = wt.registerPath, xt = wt.unregisterPath, Ft = wt.refreshOverflowKeys, Mt = wt.isSubPathKey, Qt = wt.getKeyPath, Le = wt.getKeys, Pe = wt.getSubPathKeys, qe = d.useMemo(function() {
- return {
- registerPath: pt,
- unregisterPath: xt
- };
- }, [pt, xt]), vt = d.useMemo(function() {
- return {
- isSubPathKey: Mt
- };
- }, [Mt]);
- d.useEffect(function() {
- Ft(Et ? fr : oe.slice(at + 1).map(function(Fe) {
- return Fe.key;
- }));
- }, [at, Et]);
- var ht = Gt(O || N && ((n = oe[0]) === null || n === void 0 ? void 0 : n.key), {
- value: O
- }), Dt = Z(ht, 2), Nt = Dt[0], an = Dt[1], vn = Ea(function(Fe) {
- an(Fe);
- }), on = Ea(function() {
- an(void 0);
- });
- yc(t, function() {
- return {
- list: He.current,
- focus: function(Ee) {
- var Je, ct = Le(), Se = uu(ct, Ye), Me = Se.elements, gt = Se.key2element, Rt = Se.element2key, Kt = Bu(He.current, Me), rn = Nt != null ? Nt : Kt[0] ? Rt.get(Kt[0]) : (Je = oe.find(function(yn) {
- return !yn.props.disabled;
- })) === null || Je === void 0 ? void 0 : Je.key, Yt = gt.get(rn);
- if (rn && Yt) {
- var gn;
- Yt == null || (gn = Yt.focus) === null || gn === void 0 || gn.call(Yt, Ee);
- }
- }
- };
- });
- var Wt = Gt(z || [], {
- value: _,
- // Legacy convert key to array
- postState: function(Ee) {
- return Array.isArray(Ee) ? Ee : Ee == null ? fr : [Ee];
- }
- }), mn = Z(Wt, 2), Jt = mn[0], en = mn[1], On = function(Ee) {
- if (I) {
- var Je = Ee.key, ct = Jt.includes(Je), Se;
- P ? ct ? Se = Jt.filter(function(gt) {
- return gt !== Je;
- }) : Se = [].concat(ft(Jt), [Je]) : Se = [Je], en(Se);
- var Me = re(re({}, Ee), {}, {
- selectedKeys: Se
- });
- ct ? H == null || H(Me) : A == null || A(Me);
- }
- !P && ce.length && ye !== "inline" && Ve(fr);
- }, wn = Ea(function(Fe) {
- W == null || W($o(Fe)), On(Fe);
- }), Bt = Ea(function(Fe, Ee) {
- var Je = ce.filter(function(Se) {
- return Se !== Fe;
- });
- if (Ee)
- Je.push(Fe);
- else if (ye !== "inline") {
- var ct = Pe(Fe);
- Je = Je.filter(function(Se) {
- return !ct.has(Se);
- });
- }
- wf(ce, Je, !0) || Ve(Je, !0);
- }), Ut = function(Ee, Je) {
- var ct = Je != null ? Je : !ce.includes(Ee);
- Bt(Ee, ct);
- }, pn = _S(ye, Nt, nt, Ye, He, Le, Qt, an, Ut, Y);
- d.useEffect(function() {
- je(!0);
- }, []);
- var hn = d.useMemo(function() {
- return {
- _internalRenderMenuItem: te,
- _internalRenderSubMenuItem: Q
- };
- }, [te, Q]), qt = ye !== "horizontal" || y ? oe : (
- // Need wrap for overflow dropdown that do not response for open
- oe.map(function(Fe, Ee) {
- return (
- // Always wrap provider to avoid sub node re-mount
- /* @__PURE__ */ d.createElement(Ta, {
- key: Fe.key,
- overflowDisabled: Ee > at
- }, Fe)
- );
- })
- ), xn = /* @__PURE__ */ d.createElement(kn, _e({
- id: m,
- ref: He,
- prefixCls: "".concat(o, "-overflow"),
- component: "ul",
- itemComponent: Qo,
- className: xe(o, "".concat(o, "-root"), "".concat(o, "-").concat(ye), l, ie(ie({}, "".concat(o, "-inline-collapsed"), Oe), "".concat(o, "-rtl"), nt), i),
- dir: p,
- style: u,
- role: "menu",
- tabIndex: s,
- data: qt,
- renderRawItem: function(Ee) {
- return Ee;
- },
- renderRawRest: function(Ee) {
- var Je = Ee.length, ct = Je ? oe.slice(-Je) : null;
- return /* @__PURE__ */ d.createElement(Jo, {
- eventKey: lu,
- title: M,
- disabled: Et,
- internalPopupClose: Je === 0,
- popupClassName: D
- }, ct);
- },
- maxCount: ye !== "horizontal" || y ? kn.INVALIDATE : kn.RESPONSIVE,
- ssr: "full",
- "data-menu-list": !0,
- onVisibleChange: function(Ee) {
- Lt(Ee);
- },
- onKeyDown: pn
- }, ue));
- return /* @__PURE__ */ d.createElement(Wu.Provider, {
- value: hn
- }, /* @__PURE__ */ d.createElement(xf.Provider, {
- value: Ye
- }, /* @__PURE__ */ d.createElement(Ta, {
- prefixCls: o,
- rootClassName: i,
- mode: ye,
- openKeys: ce,
- rtl: nt,
- disabled: g,
- motion: Be ? G : null,
- defaultMotions: Be ? B : null,
- activeKey: Nt,
- onActive: vn,
- onInactive: on,
- selectedKeys: Jt,
- inlineIndent: U,
- subMenuOpenDelay: E,
- subMenuCloseDelay: x,
- forceSubMenuRender: R,
- builtinPlacements: ee,
- triggerSubMenuAction: le,
- getPopupContainer: j,
- itemIcon: V,
- expandIcon: X,
- onItemClick: wn,
- onOpenChange: Bt
- }, /* @__PURE__ */ d.createElement(kf.Provider, {
- value: vt
- }, xn), /* @__PURE__ */ d.createElement("div", {
- style: {
- display: "none"
- },
- "aria-hidden": !0
- }, /* @__PURE__ */ d.createElement(Pf.Provider, {
- value: qe
- }, ve)))));
- }), Ha = iw;
- Ha.Item = Qo;
- Ha.SubMenu = Jo;
- Ha.ItemGroup = Yu;
- Ha.Divider = Lf;
- const uw = "univer-menu", lw = "univer-menu-vertical", sw = "univer-menu-hidden", cw = "univer-menu-submenu-hidden", dw = "univer-menu-item-group", fw = "univer-menu-item-group-list", vw = "univer-menu-item-group-title", mw = "univer-menu-item-active", pw = "univer-menu-submenu-active", hw = "univer-menu-item-selected", gw = "univer-menu-submenu-selected", yw = "univer-menu-submenu", bw = "univer-menu-horizontal", Cw = "univer-menu-sub", Sw = "univer-menu-vertical-left", ww = "univer-menu-vertical-right", xw = "univer-menu-item", Ew = "univer-menu-item-disabled", Rw = "univer-menu-submenu-disabled", Pw = "univer-menu-submenu-popup", Mw = "univer-submenu-title-wrapper", kw = "univer-menu-submenu-title", Dw = "univer-menu-submenu-title-more-icon", Nw = "univer-menu-item-more-icon", Iw = "univer-menu-inline", Ow = "univer-menu-submenu-arrow", _w = "univer-menu-open-slide-up-enter", Lw = "univer-menu-open-slide-up-appear", Tw = "univer-menu-open-slide-up-leave", $w = "univer-menu-open-slide-up-enter-active", Aw = "univer-menu-open-slide-up-appear-active", jw = "univer-menu-open-slide-up-in", Fw = "univer-menu-open-slide-up-leave-active", zw = "univer-menu-open-slide-up-out", Hw = "univer-menu-open-zoom-enter", Vw = "univer-menu-open-zoom-appear", Ww = "univer-menu-open-zoom-leave", Bw = "univer-menu-open-zoom-enter-active", Uw = "univer-menu-open-zoom-appear-active", qw = "univer-menu-open-zoom-in", Kw = "univer-menu-open-zoom-leave-active", Yw = "univer-menu-open-zoom-out", Gw = {
- menu: uw,
- menuVertical: lw,
- menuHidden: sw,
- menuSubmenuHidden: cw,
- menuItemGroup: dw,
- menuItemGroupList: fw,
- menuItemGroupTitle: vw,
- menuItemActive: mw,
- menuSubmenuActive: pw,
- menuItemSelected: hw,
- menuSubmenuSelected: gw,
- menuSubmenu: yw,
- menuHorizontal: bw,
- menuSub: Cw,
- menuVerticalLeft: Sw,
- menuVerticalRight: ww,
- menuItem: xw,
- menuItemDisabled: Ew,
- menuSubmenuDisabled: Rw,
- menuSubmenuPopup: Pw,
- submenuTitleWrapper: Mw,
- menuSubmenuTitle: kw,
- menuSubmenuTitleMoreIcon: Dw,
- menuItemMoreIcon: Nw,
- menuInline: Iw,
- menuSubmenuArrow: Ow,
- menuOpenSlideUpEnter: _w,
- menuOpenSlideUpAppear: Lw,
- menuOpenSlideUpLeave: Tw,
- menuOpenSlideUpEnterActive: $w,
- menuOpenSlideUpAppearActive: Aw,
- menuOpenSlideUpIn: jw,
- menuOpenSlideUpLeaveActive: Fw,
- menuOpenSlideUpOut: zw,
- menuOpenZoomEnter: Hw,
- menuOpenZoomAppear: Vw,
- menuOpenZoomLeave: Ww,
- menuOpenZoomEnterActive: Bw,
- menuOpenZoomAppearActive: Uw,
- menuOpenZoomIn: qw,
- menuOpenZoomLeaveActive: Kw,
- menuOpenZoomOut: Yw
- }, UO = me.forwardRef((e, t) => {
- const { mountContainer: n } = Sn(In);
- return n && me.cloneElement(/* @__PURE__ */ q.jsx(Ha, { ref: t, prefixCls: Gw.menu, getPopupContainer: () => n }), {
- ...e
- });
- });
- function qO(e) {
- return me.cloneElement(/* @__PURE__ */ q.jsx(Qo, {}), { ...e });
- }
- function KO(e) {
- return me.cloneElement(/* @__PURE__ */ q.jsx(Jo, {}), { ...e });
- }
- function YO(e) {
- return me.cloneElement(/* @__PURE__ */ q.jsx(Yu, {}), { ...e });
- }
- var Xw = /* @__PURE__ */ ((e) => (e.Success = "success", e.Info = "info", e.Warning = "warning", e.Error = "error", e.Loading = "loading", e))(Xw || {});
- const Zw = {
- success: /* @__PURE__ */ q.jsx(Lc, { className: "univer-text-green-500" }),
- info: /* @__PURE__ */ q.jsx(Mc, { className: "univer-text-indigo-600 dark:univer-text-primary-500" }),
- warning: /* @__PURE__ */ q.jsx(Tc, { className: "univer-text-yellow-400" }),
- error: /* @__PURE__ */ q.jsx(Rc, { className: "univer-text-red-500" }),
- loading: /* @__PURE__ */ q.jsx(kc, { className: "univer-text-yellow-400 univer-animate-spin" })
- }, Qw = ({
- content: e,
- type: t = "info"
- /* Info */
- }) => {
- const n = Ht(() => Zw[t], [t]);
- return /* @__PURE__ */ q.jsx(
- "div",
- {
- className: Na(
- `
- univer-font-sans univer-rounded-xl univer-p-4 univer-min-w-[320px] univer-transition-all
- univer-bg-white univer-duration-300 univer-animate-in univer-fade-in univer-slide-in-from-top-4
- univer-shadow-md univer-max-w-[480px] univer-border univer-border-gray-200 univer-border-solid
- dark:univer-border-gray-700 dark:univer-bg-gray-700
- `
- ),
- children: /* @__PURE__ */ q.jsxs("div", { className: "univer-flex univer-gap-2 univer-items-start", children: [
- /* @__PURE__ */ q.jsx("span", { className: "[&>svg]:univer-relative [&>svg]:univer-top-0.5 [&>svg]:univer-block", children: n }),
- /* @__PURE__ */ q.jsx(
- "p",
- {
- className: `
- univer-text-sm univer-opacity-90 univer-m-0 univer-text-gray-500
- dark:univer-text-gray-400
- `,
- children: e
- }
- )
- ] })
- }
- );
- };
- let Jw = 0;
- const ex = /* @__PURE__ */ (() => {
- let e = () => {
- }, t = () => {
- };
- return {
- Messager: () => {
- if (!Kr())
- return null;
- const [r, a] = rt({ messages: [] });
- return t = (o) => {
- o || a({
- messages: []
- }), a((i) => ({
- messages: i.messages.filter((u) => u.id !== o)
- }));
- }, lt(() => {
- e = (o) => {
- const i = String(Jw++);
- a((u) => ({
- messages: [...u.messages, { ...o, id: i }]
- })), o.duration !== 1 / 0 && setTimeout(() => {
- a((u) => ({
- messages: u.messages.filter((l) => l.id !== i)
- }));
- }, o.duration || 3e3);
- };
- }, []), $a(
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: `
- univer-fixed univer-left-1/2 univer-top-4 univer-z-50 univer-flex univer-flex-col univer-items-center
- univer-gap-1 -univer-translate-x-1/2
- `,
- children: r.messages.map((o, i) => /* @__PURE__ */ q.jsx(
- "div",
- {
- style: {
- position: "relative",
- top: `${i * 4}px`,
- zIndex: 50 - i
- },
- children: /* @__PURE__ */ q.jsx(Qw, { ...o, onClose: () => t(o.id) })
- },
- o.id
- ))
- }
- ),
- document.body
- );
- },
- message: (r) => e(r),
- removeMessage: t
- };
- })(), { Messager: GO, message: XO, removeMessage: ZO } = ex, tx = "univer-pager", nx = "univer-pager-left-arrow", rx = "univer-pager-right-arrow", ax = "univer-pager-number", ma = {
- pager: tx,
- pagerLeftArrow: nx,
- pagerRightArrow: rx,
- pagerNumber: ax
- };
- function QO(e) {
- const { value: t = 0, total: n = 0, loop: r, text: a } = e, o = Ht(() => a != null ? a : `${t}/${n}`, [t, n, a]), i = n > 0, u = () => {
- var c, s;
- t === 1 ? r && ((c = e.onChange) == null || c.call(e, n)) : (s = e.onChange) == null || s.call(e, t - 1);
- }, l = () => {
- var c, s;
- t === n ? r && ((c = e.onChange) == null || c.call(e, 1)) : (s = e.onChange) == null || s.call(e, t + 1);
- };
- return /* @__PURE__ */ q.jsx("div", { className: ma.pager, children: i ? /* @__PURE__ */ q.jsxs(uv, { children: [
- /* @__PURE__ */ q.jsx("div", { role: "button", className: ma.pagerLeftArrow, onClick: u, children: /* @__PURE__ */ q.jsx(Nc, {}) }),
- /* @__PURE__ */ q.jsx("div", { className: ma.pagerNumber, children: o }),
- /* @__PURE__ */ q.jsx("div", { role: "button", className: ma.pagerRightArrow, onClick: l, children: /* @__PURE__ */ q.jsx(Ic, {}) })
- ] }) : /* @__PURE__ */ q.jsx("div", { className: ma.pagerNumber, children: o }) });
- }
- function Tf(e, t) {
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, Oo(e, t);
- }
- function ox(e, t) {
- return e.classList ? !!t && e.classList.contains(t) : (" " + (e.className.baseVal || e.className) + " ").indexOf(" " + t + " ") !== -1;
- }
- function ix(e, t) {
- e.classList ? e.classList.add(t) : ox(e, t) || (typeof e.className == "string" ? e.className = e.className + " " + t : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + t));
- }
- function $s(e, t) {
- return e.replace(new RegExp("(^|\\s)" + t + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
- }
- function ux(e, t) {
- e.classList ? e.classList.remove(t) : typeof e.className == "string" ? e.className = $s(e.className, t) : e.setAttribute("class", $s(e.className && e.className.baseVal || "", t));
- }
- const As = {
- disabled: !1
- }, $f = me.createContext(null);
- var Af = function(t) {
- return t.scrollTop;
- }, Ra = "unmounted", mr = "exited", pr = "entering", Ar = "entered", cu = "exiting", Vn = /* @__PURE__ */ function(e) {
- Tf(t, e);
- function t(r, a) {
- var o;
- o = e.call(this, r, a) || this;
- var i = a, u = i && !i.isMounting ? r.enter : r.appear, l;
- return o.appearStatus = null, r.in ? u ? (l = mr, o.appearStatus = pr) : l = Ar : r.unmountOnExit || r.mountOnEnter ? l = Ra : l = mr, o.state = {
- status: l
- }, o.nextCallback = null, o;
- }
- t.getDerivedStateFromProps = function(a, o) {
- var i = a.in;
- return i && o.status === Ra ? {
- status: mr
- } : null;
- };
- var n = t.prototype;
- return n.componentDidMount = function() {
- this.updateStatus(!0, this.appearStatus);
- }, n.componentDidUpdate = function(a) {
- var o = null;
- if (a !== this.props) {
- var i = this.state.status;
- this.props.in ? i !== pr && i !== Ar && (o = pr) : (i === pr || i === Ar) && (o = cu);
- }
- this.updateStatus(!1, o);
- }, n.componentWillUnmount = function() {
- this.cancelNextCallback();
- }, n.getTimeouts = function() {
- var a = this.props.timeout, o, i, u;
- return o = i = u = a, a != null && typeof a != "number" && (o = a.exit, i = a.enter, u = a.appear !== void 0 ? a.appear : i), {
- exit: o,
- enter: i,
- appear: u
- };
- }, n.updateStatus = function(a, o) {
- if (a === void 0 && (a = !1), o !== null)
- if (this.cancelNextCallback(), o === pr) {
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
- var i = this.props.nodeRef ? this.props.nodeRef.current : nr.findDOMNode(this);
- i && Af(i);
- }
- this.performEnter(a);
- } else
- this.performExit();
- else this.props.unmountOnExit && this.state.status === mr && this.setState({
- status: Ra
- });
- }, n.performEnter = function(a) {
- var o = this, i = this.props.enter, u = this.context ? this.context.isMounting : a, l = this.props.nodeRef ? [u] : [nr.findDOMNode(this), u], c = l[0], s = l[1], v = this.getTimeouts(), C = u ? v.appear : v.enter;
- if (!a && !i || As.disabled) {
- this.safeSetState({
- status: Ar
- }, function() {
- o.props.onEntered(c);
- });
- return;
- }
- this.props.onEnter(c, s), this.safeSetState({
- status: pr
- }, function() {
- o.props.onEntering(c, s), o.onTransitionEnd(C, function() {
- o.safeSetState({
- status: Ar
- }, function() {
- o.props.onEntered(c, s);
- });
- });
- });
- }, n.performExit = function() {
- var a = this, o = this.props.exit, i = this.getTimeouts(), u = this.props.nodeRef ? void 0 : nr.findDOMNode(this);
- if (!o || As.disabled) {
- this.safeSetState({
- status: mr
- }, function() {
- a.props.onExited(u);
- });
- return;
- }
- this.props.onExit(u), this.safeSetState({
- status: cu
- }, function() {
- a.props.onExiting(u), a.onTransitionEnd(i.exit, function() {
- a.safeSetState({
- status: mr
- }, function() {
- a.props.onExited(u);
- });
- });
- });
- }, n.cancelNextCallback = function() {
- this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
- }, n.safeSetState = function(a, o) {
- o = this.setNextCallback(o), this.setState(a, o);
- }, n.setNextCallback = function(a) {
- var o = this, i = !0;
- return this.nextCallback = function(u) {
- i && (i = !1, o.nextCallback = null, a(u));
- }, this.nextCallback.cancel = function() {
- i = !1;
- }, this.nextCallback;
- }, n.onTransitionEnd = function(a, o) {
- this.setNextCallback(o);
- var i = this.props.nodeRef ? this.props.nodeRef.current : nr.findDOMNode(this), u = a == null && !this.props.addEndListener;
- if (!i || u) {
- setTimeout(this.nextCallback, 0);
- return;
- }
- if (this.props.addEndListener) {
- var l = this.props.nodeRef ? [this.nextCallback] : [i, this.nextCallback], c = l[0], s = l[1];
- this.props.addEndListener(c, s);
- }
- a != null && setTimeout(this.nextCallback, a);
- }, n.render = function() {
- var a = this.state.status;
- if (a === Ra)
- return null;
- var o = this.props, i = o.children;
- o.in, o.mountOnEnter, o.unmountOnExit, o.appear, o.enter, o.exit, o.timeout, o.addEndListener, o.onEnter, o.onEntering, o.onEntered, o.onExit, o.onExiting, o.onExited, o.nodeRef;
- var u = ku(o, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
- return (
- // allows for nested Transitions
- /* @__PURE__ */ me.createElement($f.Provider, {
- value: null
- }, typeof i == "function" ? i(a, u) : me.cloneElement(me.Children.only(i), u))
- );
- }, t;
- }(me.Component);
- Vn.contextType = $f;
- Vn.propTypes = {};
- function Tr() {
- }
- Vn.defaultProps = {
- in: !1,
- mountOnEnter: !1,
- unmountOnExit: !1,
- appear: !1,
- enter: !0,
- exit: !0,
- onEnter: Tr,
- onEntering: Tr,
- onEntered: Tr,
- onExit: Tr,
- onExiting: Tr,
- onExited: Tr
- };
- Vn.UNMOUNTED = Ra;
- Vn.EXITED = mr;
- Vn.ENTERING = pr;
- Vn.ENTERED = Ar;
- Vn.EXITING = cu;
- var lx = function(t, n) {
- return t && n && n.split(" ").forEach(function(r) {
- return ix(t, r);
- });
- }, wi = function(t, n) {
- return t && n && n.split(" ").forEach(function(r) {
- return ux(t, r);
- });
- }, Gu = /* @__PURE__ */ function(e) {
- Tf(t, e);
- function t() {
- for (var r, a = arguments.length, o = new Array(a), i = 0; i < a; i++)
- o[i] = arguments[i];
- return r = e.call.apply(e, [this].concat(o)) || this, r.appliedClasses = {
- appear: {},
- enter: {},
- exit: {}
- }, r.onEnter = function(u, l) {
- var c = r.resolveArguments(u, l), s = c[0], v = c[1];
- r.removeClasses(s, "exit"), r.addClass(s, v ? "appear" : "enter", "base"), r.props.onEnter && r.props.onEnter(u, l);
- }, r.onEntering = function(u, l) {
- var c = r.resolveArguments(u, l), s = c[0], v = c[1], C = v ? "appear" : "enter";
- r.addClass(s, C, "active"), r.props.onEntering && r.props.onEntering(u, l);
- }, r.onEntered = function(u, l) {
- var c = r.resolveArguments(u, l), s = c[0], v = c[1], C = v ? "appear" : "enter";
- r.removeClasses(s, C), r.addClass(s, C, "done"), r.props.onEntered && r.props.onEntered(u, l);
- }, r.onExit = function(u) {
- var l = r.resolveArguments(u), c = l[0];
- r.removeClasses(c, "appear"), r.removeClasses(c, "enter"), r.addClass(c, "exit", "base"), r.props.onExit && r.props.onExit(u);
- }, r.onExiting = function(u) {
- var l = r.resolveArguments(u), c = l[0];
- r.addClass(c, "exit", "active"), r.props.onExiting && r.props.onExiting(u);
- }, r.onExited = function(u) {
- var l = r.resolveArguments(u), c = l[0];
- r.removeClasses(c, "exit"), r.addClass(c, "exit", "done"), r.props.onExited && r.props.onExited(u);
- }, r.resolveArguments = function(u, l) {
- return r.props.nodeRef ? [r.props.nodeRef.current, u] : [u, l];
- }, r.getClassNames = function(u) {
- var l = r.props.classNames, c = typeof l == "string", s = c && l ? l + "-" : "", v = c ? "" + s + u : l[u], C = c ? v + "-active" : l[u + "Active"], p = c ? v + "-done" : l[u + "Done"];
- return {
- baseClassName: v,
- activeClassName: C,
- doneClassName: p
- };
- }, r;
- }
- var n = t.prototype;
- return n.addClass = function(a, o, i) {
- var u = this.getClassNames(o)[i + "ClassName"], l = this.getClassNames("enter"), c = l.doneClassName;
- o === "appear" && i === "done" && c && (u += " " + c), i === "active" && a && Af(a), u && (this.appliedClasses[o][i] = u, lx(a, u));
- }, n.removeClasses = function(a, o) {
- var i = this.appliedClasses[o], u = i.base, l = i.active, c = i.done;
- this.appliedClasses[o] = {}, u && wi(a, u), l && wi(a, l), c && wi(a, c);
- }, n.render = function() {
- var a = this.props;
- a.classNames;
- var o = ku(a, ["classNames"]);
- return /* @__PURE__ */ me.createElement(Vn, _e({}, o, {
- onEnter: this.onEnter,
- onEntered: this.onEntered,
- onEntering: this.onEntering,
- onExit: this.onExit,
- onExiting: this.onExiting,
- onExited: this.onExited
- }));
- }, t;
- }(me.Component);
- Gu.defaultProps = {
- classNames: ""
- };
- Gu.propTypes = {};
- const sx = "univer-popup", cx = "univer-popup-enter", dx = "univer-popup-enter-active", fx = "univer-popup-slide-up-in", vx = "univer-popup-exit", mx = "univer-popup-slide-up-out", px = "univer-popup-exit-active", hx = "univer-popup-mask", $r = {
- popup: sx,
- popupEnter: cx,
- popupEnterActive: dx,
- popupSlideUpIn: fx,
- popupExit: vx,
- popupSlideUpOut: mx,
- popupExitActive: px,
- popupMask: hx
- };
- function JO(e) {
- const { children: t, visible: n = !1, offset: r = [0, 0] } = e, a = Ce(null), [o, i] = rt(r), { mountContainer: u } = Sn(In);
- lt(() => {
- if (!n) {
- i([-9999, -9999]);
- return;
- }
- const [c, s] = r, { clientWidth: v, clientHeight: C } = a.current, { innerWidth: p, innerHeight: m } = window, b = c + v > p ? p - v : c, f = s + C > m ? m - C : s;
- i([b, f]);
- }, [r, n]);
- function l(c) {
- c.preventDefault();
- }
- return $a(
- /* @__PURE__ */ q.jsx(
- Gu,
- {
- in: n,
- nodeRef: a,
- timeout: 500,
- classNames: {
- enter: $r.popupEnter,
- enterActive: $r.popupEnterActive,
- enterDone: $r.popupEnterDone,
- exitActive: $r.popupExit,
- exitDone: $r.popupExitActive
- },
- children: /* @__PURE__ */ q.jsx(
- "section",
- {
- ref: a,
- className: $r.popup,
- style: {
- // Fix #1089. If the popup does not have this 2px offset, the pointerup event's target would
- // become the popup itself not the canvas element, hence the selection gesture is not terminated.
- // It should be considered as debt of the rendering engine.
- left: o[0] + 2,
- top: o[1] + 2
- },
- onContextMenu: l,
- children: t
- }
- )
- }
- ),
- u
- );
- }
- const gx = "univer-radio", yx = "univer-radio-target-input", bx = "univer-radio-target-inner", Cx = "univer-radio-disabled", Sx = "univer-radio-target", pa = {
- radio: gx,
- radioTargetInput: yx,
- radioTargetInner: bx,
- radioDisabled: Cx,
- radioTarget: Sx
- };
- function e_(e) {
- const { children: t, checked: n, value: r, disabled: a = !1, onChange: o } = e, i = Ce(null);
- function u(c) {
- var s;
- if (c.stopPropagation(), !(!o || a))
- if (typeof r < "u")
- o && o(r);
- else {
- const v = (s = i == null ? void 0 : i.current) == null ? void 0 : s.checked;
- o && o(v);
- }
- }
- const l = jt(pa.radio, {
- [pa.radioDisabled]: a
- });
- return /* @__PURE__ */ q.jsxs("label", { className: l, children: [
- /* @__PURE__ */ q.jsxs("span", { className: pa.radioTarget, children: [
- /* @__PURE__ */ q.jsx(
- "input",
- {
- ref: i,
- className: pa.radioTargetInput,
- type: "radio",
- checked: n,
- disabled: a,
- onChange: u
- }
- ),
- /* @__PURE__ */ q.jsx("span", { className: pa.radioTargetInner })
- ] }),
- /* @__PURE__ */ q.jsx("span", { children: t })
- ] });
- }
- const wx = "univer-radio-group", xx = "univer-radio-group-direction-vertical", xi = {
- radioGroup: wx,
- radioGroupDirectionVertical: xx
- };
- function t_(e) {
- const { children: t, className: n, style: r, value: a, disabled: o = !1, direction: i = "horizontal", onChange: u } = e, l = (s) => {
- u(s);
- }, c = jt(n, xi.radioGroup, {
- [xi.radioGroupDirectionVertical]: i === "vertical"
- });
- return /* @__PURE__ */ q.jsx("div", { className: jt(xi.radioGroup, c), style: r, children: me.Children.map(t, (s, v) => me.isValidElement(s) ? me.cloneElement(s, {
- key: v,
- children: s.props.children,
- value: s.props.value,
- checked: a === s.props.value,
- disabled: o != null ? o : s.props.disabled,
- onChange: l
- }) : s) });
- }
- const Ex = "univer-scrollbar-container", Rx = "univer-scrollbar-bar", Px = "univer-scrollbar-bar-thumb", Mx = "univer-scrollbar-content", lo = {
- scrollbarContainer: Ex,
- scrollbarBar: Rx,
- scrollbarBarThumb: Px,
- scrollbarContent: Mx
- };
- function n_(e) {
- const { children: t } = e, [n, r] = rt(!1), [a, o] = rt(0), [i, u] = rt(0), l = Ot((g) => {
- g.preventDefault(), g.stopPropagation(), r(!0), u(g.clientY), o(C.current.scrollTop);
- }, []), c = Ot(
- (g) => {
- g.preventDefault(), g.stopPropagation(), n && r(!1);
- },
- [n]
- ), s = Ot(
- (g) => {
- if (g.preventDefault(), g.stopPropagation(), n) {
- const { scrollHeight: y, offsetHeight: w } = C.current, E = w * (w / y), S = (g.clientY - i) * (w / E), x = Math.min(a + S, y - w);
- C.current.scrollTop = x;
- }
- },
- [n]
- );
- lt(() => (document.addEventListener("mousemove", s), document.addEventListener("mouseup", c), document.addEventListener("mouseleave", c), () => {
- document.removeEventListener("mousemove", s), document.removeEventListener("mouseup", c), document.removeEventListener("mouseleave", c);
- }), [s, c]);
- const v = Ce(null), C = Ce(null), [p, m] = rt(0), [b, f] = rt(0);
- lt(() => {
- function g() {
- if (!v.current)
- return;
- const { height: E } = v.current.parentElement.getBoundingClientRect(), { scrollHeight: S } = C.current;
- m(E / S * 100), v.current.style.height = `${Math.floor(E)}px`;
- }
- function y(E) {
- const { scrollTop: S, scrollHeight: x } = E.target, R = S / x * 100;
- f(R);
- }
- g();
- const w = new ResizeObserver(g);
- return w.observe(v.current.parentElement), C.current.addEventListener("scroll", y), () => {
- var E;
- (E = C.current) == null || E.removeEventListener("scroll", y), w.disconnect();
- };
- }, []);
- function h(g) {
- const { scrollHeight: y, offsetHeight: w } = C.current, E = w * (w / y), S = (g.clientY - i) * (w / E), x = Math.min(a + S, y - w);
- C.current.scrollTo({
- top: x,
- behavior: "smooth"
- });
- }
- return /* @__PURE__ */ q.jsxs("div", { ref: v, className: lo.scrollbarContainer, children: [
- /* @__PURE__ */ q.jsx("div", { className: lo.scrollbarContent, ref: C, ...e, children: t }),
- p < 100 && p > 0 && /* @__PURE__ */ q.jsx("div", { className: lo.scrollbarBar, role: "scrollbar", onClick: h, children: /* @__PURE__ */ q.jsx(
- "div",
- {
- className: lo.scrollbarBarThumb,
- style: {
- height: `${p}%`,
- top: `${b}%`
- },
- onMouseDown: l
- }
- ) })
- ] });
- }
- var ei = function(t) {
- var n = t.className, r = t.customizeIcon, a = t.customizeIconProps, o = t.children, i = t.onMouseDown, u = t.onClick, l = typeof r == "function" ? r(a) : r;
- return /* @__PURE__ */ d.createElement("span", {
- className: n,
- onMouseDown: function(s) {
- s.preventDefault(), i == null || i(s);
- },
- style: {
- userSelect: "none",
- WebkitUserSelect: "none"
- },
- unselectable: "on",
- onClick: u,
- "aria-hidden": !0
- }, l !== void 0 ? l : /* @__PURE__ */ d.createElement("span", {
- className: xe(n.split(/\s+/).map(function(c) {
- return "".concat(c, "-icon");
- }))
- }, o));
- }, kx = function(t, n, r, a, o) {
- var i = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, u = arguments.length > 6 ? arguments[6] : void 0, l = arguments.length > 7 ? arguments[7] : void 0, c = me.useMemo(function() {
- if (_t(a) === "object")
- return a.clearIcon;
- if (o)
- return o;
- }, [a, o]), s = me.useMemo(function() {
- return !!(!i && a && (r.length || u) && !(l === "combobox" && u === ""));
- }, [a, i, r.length, u, l]);
- return {
- allowClear: s,
- clearIcon: /* @__PURE__ */ me.createElement(ei, {
- className: "".concat(t, "-clear"),
- onMouseDown: n,
- customizeIcon: c
- }, "×")
- };
- }, jf = /* @__PURE__ */ d.createContext(null);
- function Dx() {
- return d.useContext(jf);
- }
- function Nx() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10, t = d.useState(!1), n = Z(t, 2), r = n[0], a = n[1], o = d.useRef(null), i = function() {
- window.clearTimeout(o.current);
- };
- d.useEffect(function() {
- return i;
- }, []);
- var u = function(c, s) {
- i(), o.current = window.setTimeout(function() {
- a(c), s && s();
- }, e);
- };
- return [r, u, i];
- }
- function Ff() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, t = d.useRef(null), n = d.useRef(null);
- d.useEffect(function() {
- return function() {
- window.clearTimeout(n.current);
- };
- }, []);
- function r(a) {
- (a || t.current === null) && (t.current = a), window.clearTimeout(n.current), n.current = window.setTimeout(function() {
- t.current = null;
- }, e);
- }
- return [function() {
- return t.current;
- }, r];
- }
- function Ix(e, t, n, r) {
- var a = d.useRef(null);
- a.current = {
- open: t,
- triggerOpen: n,
- customizedTrigger: r
- }, d.useEffect(function() {
- function o(i) {
- var u;
- if (!((u = a.current) !== null && u !== void 0 && u.customizedTrigger)) {
- var l = i.target;
- l.shadowRoot && i.composed && (l = i.composedPath()[0] || l), a.current.open && e().filter(function(c) {
- return c;
- }).every(function(c) {
- return !c.contains(l) && c !== l;
- }) && a.current.triggerOpen(!1);
- }
- }
- return window.addEventListener("mousedown", o), function() {
- return window.removeEventListener("mousedown", o);
- };
- }, []);
- }
- function Ox(e) {
- return ![
- // System function button
- fe.ESC,
- fe.SHIFT,
- fe.BACKSPACE,
- fe.TAB,
- fe.WIN_KEY,
- fe.ALT,
- fe.META,
- fe.WIN_KEY_RIGHT,
- fe.CTRL,
- fe.SEMICOLON,
- fe.EQUALS,
- fe.CAPS_LOCK,
- fe.CONTEXT_MENU,
- // F1-F12
- fe.F1,
- fe.F2,
- fe.F3,
- fe.F4,
- fe.F5,
- fe.F6,
- fe.F7,
- fe.F8,
- fe.F9,
- fe.F10,
- fe.F11,
- fe.F12
- ].includes(e);
- }
- var _x = function(t, n) {
- var r, a = t.prefixCls, o = t.id, i = t.inputElement, u = t.disabled, l = t.tabIndex, c = t.autoFocus, s = t.autoComplete, v = t.editable, C = t.activeDescendantId, p = t.value, m = t.maxLength, b = t.onKeyDown, f = t.onMouseDown, h = t.onChange, g = t.onPaste, y = t.onCompositionStart, w = t.onCompositionEnd, E = t.open, S = t.attrs, x = i || /* @__PURE__ */ d.createElement("input", null), R = x, k = R.ref, L = R.props, O = L.onKeyDown, N = L.onChange, F = L.onMouseDown, I = L.onCompositionStart, T = L.onCompositionEnd, P = L.style;
- return "maxLength" in x.props, x = /* @__PURE__ */ d.cloneElement(x, re(re(re({
- type: "search"
- }, L), {}, {
- // Override over origin props
- id: o,
- ref: lr(n, k),
- disabled: u,
- tabIndex: l,
- autoComplete: s || "off",
- autoFocus: c,
- className: xe("".concat(a, "-selection-search-input"), (r = x) === null || r === void 0 || (r = r.props) === null || r === void 0 ? void 0 : r.className),
- role: "combobox",
- "aria-expanded": E || !1,
- "aria-haspopup": "listbox",
- "aria-owns": "".concat(o, "_list"),
- "aria-autocomplete": "list",
- "aria-controls": "".concat(o, "_list"),
- "aria-activedescendant": E ? C : void 0
- }, S), {}, {
- value: v ? p : "",
- maxLength: m,
- readOnly: !v,
- unselectable: v ? null : "on",
- style: re(re({}, P), {}, {
- opacity: v ? null : 0
- }),
- onKeyDown: function(_) {
- b(_), O && O(_);
- },
- onMouseDown: function(_) {
- f(_), F && F(_);
- },
- onChange: function(_) {
- h(_), N && N(_);
- },
- onCompositionStart: function(_) {
- y(_), I && I(_);
- },
- onCompositionEnd: function(_) {
- w(_), T && T(_);
- },
- onPaste: g
- })), x;
- }, zf = /* @__PURE__ */ d.forwardRef(_x);
- function Hf(e) {
- return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
- }
- var Lx = typeof window < "u" && window.document && window.document.documentElement, Tx = Lx;
- function $x(e) {
- return e != null;
- }
- function Ax(e) {
- return !e && e !== 0;
- }
- function js(e) {
- return ["string", "number"].includes(_t(e));
- }
- function Vf(e) {
- var t = void 0;
- return e && (js(e.title) ? t = e.title.toString() : js(e.label) && (t = e.label.toString())), t;
- }
- function jx(e, t) {
- Tx ? d.useLayoutEffect(e, t) : d.useEffect(e, t);
- }
- function Fx(e) {
- var t;
- return (t = e.key) !== null && t !== void 0 ? t : e.value;
- }
- var Fs = function(t) {
- t.preventDefault(), t.stopPropagation();
- }, zx = function(t) {
- var n = t.id, r = t.prefixCls, a = t.values, o = t.open, i = t.searchValue, u = t.autoClearSearchValue, l = t.inputRef, c = t.placeholder, s = t.disabled, v = t.mode, C = t.showSearch, p = t.autoFocus, m = t.autoComplete, b = t.activeDescendantId, f = t.tabIndex, h = t.removeIcon, g = t.maxTagCount, y = t.maxTagTextLength, w = t.maxTagPlaceholder, E = w === void 0 ? function(j) {
- return "+ ".concat(j.length, " ...");
- } : w, S = t.tagRender, x = t.onToggleOpen, R = t.onRemove, k = t.onInputChange, L = t.onInputPaste, O = t.onInputKeyDown, N = t.onInputMouseDown, F = t.onInputCompositionStart, I = t.onInputCompositionEnd, T = d.useRef(null), P = rt(0), z = Z(P, 2), _ = z[0], A = z[1], H = rt(!1), $ = Z(H, 2), U = $[0], G = $[1], B = "".concat(r, "-selection"), ne = o || v === "multiple" && u === !1 || v === "tags" ? i : "", le = v === "tags" || v === "multiple" && u === !1 || C && (o || U);
- jx(function() {
- A(T.current.scrollWidth);
- }, [ne]);
- var ee = function(W, K, Y, te, Q) {
- return /* @__PURE__ */ d.createElement("span", {
- title: Vf(W),
- className: xe("".concat(B, "-item"), ie({}, "".concat(B, "-item-disabled"), Y))
- }, /* @__PURE__ */ d.createElement("span", {
- className: "".concat(B, "-item-content")
- }, K), te && /* @__PURE__ */ d.createElement(ei, {
- className: "".concat(B, "-item-remove"),
- onMouseDown: Fs,
- onClick: Q,
- customizeIcon: h
- }, "×"));
- }, V = function(W, K, Y, te, Q, ae) {
- var ue = function(pe) {
- Fs(pe), x(!o);
- };
- return /* @__PURE__ */ d.createElement("span", {
- onMouseDown: ue
- }, S({
- label: K,
- value: W,
- disabled: Y,
- closable: te,
- onClose: Q,
- isMaxTag: !!ae
- }));
- }, X = function(W) {
- var K = W.disabled, Y = W.label, te = W.value, Q = !s && !K, ae = Y;
- if (typeof y == "number" && (typeof Y == "string" || typeof Y == "number")) {
- var ue = String(ae);
- ue.length > y && (ae = "".concat(ue.slice(0, y), "..."));
- }
- var se = function(oe) {
- oe && oe.stopPropagation(), R(W);
- };
- return typeof S == "function" ? V(te, ae, K, Q, se) : ee(W, ae, K, Q, se);
- }, J = function(W) {
- var K = typeof E == "function" ? E(W) : E;
- return typeof S == "function" ? V(void 0, K, !1, !1, void 0, !0) : ee({
- title: K
- }, K, !1);
- }, M = /* @__PURE__ */ d.createElement("div", {
- className: "".concat(B, "-search"),
- style: {
- width: _
- },
- onFocus: function() {
- G(!0);
- },
- onBlur: function() {
- G(!1);
- }
- }, /* @__PURE__ */ d.createElement(zf, {
- ref: l,
- open: o,
- prefixCls: r,
- id: n,
- inputElement: null,
- disabled: s,
- autoFocus: p,
- autoComplete: m,
- editable: le,
- activeDescendantId: b,
- value: ne,
- onKeyDown: O,
- onMouseDown: N,
- onChange: k,
- onPaste: L,
- onCompositionStart: F,
- onCompositionEnd: I,
- tabIndex: f,
- attrs: or(t, !0)
- }), /* @__PURE__ */ d.createElement("span", {
- ref: T,
- className: "".concat(B, "-search-mirror"),
- "aria-hidden": !0
- }, ne, " ")), D = /* @__PURE__ */ d.createElement(kn, {
- prefixCls: "".concat(B, "-overflow"),
- data: a,
- renderItem: X,
- renderRest: J,
- suffix: M,
- itemKey: Fx,
- maxCount: g
- });
- return /* @__PURE__ */ d.createElement("span", {
- className: "".concat(B, "-wrap")
- }, D, !a.length && !ne && /* @__PURE__ */ d.createElement("span", {
- className: "".concat(B, "-placeholder")
- }, c));
- }, Hx = function(t) {
- var n = t.inputElement, r = t.prefixCls, a = t.id, o = t.inputRef, i = t.disabled, u = t.autoFocus, l = t.autoComplete, c = t.activeDescendantId, s = t.mode, v = t.open, C = t.values, p = t.placeholder, m = t.tabIndex, b = t.showSearch, f = t.searchValue, h = t.activeValue, g = t.maxLength, y = t.onInputKeyDown, w = t.onInputMouseDown, E = t.onInputChange, S = t.onInputPaste, x = t.onInputCompositionStart, R = t.onInputCompositionEnd, k = t.title, L = d.useState(!1), O = Z(L, 2), N = O[0], F = O[1], I = s === "combobox", T = I || b, P = C[0], z = f || "";
- I && h && !N && (z = h), d.useEffect(function() {
- I && F(!1);
- }, [I, h]);
- var _ = s !== "combobox" && !v && !b ? !1 : !!z, A = k === void 0 ? Vf(P) : k, H = d.useMemo(function() {
- return P ? null : /* @__PURE__ */ d.createElement("span", {
- className: "".concat(r, "-selection-placeholder"),
- style: _ ? {
- visibility: "hidden"
- } : void 0
- }, p);
- }, [P, _, p, r]);
- return /* @__PURE__ */ d.createElement("span", {
- className: "".concat(r, "-selection-wrap")
- }, /* @__PURE__ */ d.createElement("span", {
- className: "".concat(r, "-selection-search")
- }, /* @__PURE__ */ d.createElement(zf, {
- ref: o,
- prefixCls: r,
- id: a,
- open: v,
- inputElement: n,
- disabled: i,
- autoFocus: u,
- autoComplete: l,
- editable: T,
- activeDescendantId: c,
- value: z,
- onKeyDown: y,
- onMouseDown: w,
- onChange: function(U) {
- F(!0), E(U);
- },
- onPaste: S,
- onCompositionStart: x,
- onCompositionEnd: R,
- tabIndex: m,
- attrs: or(t, !0),
- maxLength: I ? g : void 0
- })), !I && P ? /* @__PURE__ */ d.createElement("span", {
- className: "".concat(r, "-selection-item"),
- title: A,
- style: _ ? {
- visibility: "hidden"
- } : void 0
- }, P.label) : null, H);
- }, Vx = function(t, n) {
- var r = Ce(null), a = Ce(!1), o = t.prefixCls, i = t.open, u = t.mode, l = t.showSearch, c = t.tokenWithEnter, s = t.disabled, v = t.prefix, C = t.autoClearSearchValue, p = t.onSearch, m = t.onSearchSubmit, b = t.onToggleOpen, f = t.onInputKeyDown, h = t.domRef;
- d.useImperativeHandle(n, function() {
- return {
- focus: function(A) {
- r.current.focus(A);
- },
- blur: function() {
- r.current.blur();
- }
- };
- });
- var g = Ff(0), y = Z(g, 2), w = y[0], E = y[1], S = function(A) {
- var H = A.which, $ = r.current instanceof HTMLTextAreaElement;
- !$ && i && (H === fe.UP || H === fe.DOWN) && A.preventDefault(), f && f(A), H === fe.ENTER && u === "tags" && !a.current && !i && (m == null || m(A.target.value)), !($ && !i && ~[fe.UP, fe.DOWN, fe.LEFT, fe.RIGHT].indexOf(H)) && Ox(H) && b(!0);
- }, x = function() {
- E(!0);
- }, R = Ce(null), k = function(A) {
- p(A, !0, a.current) !== !1 && b(!0);
- }, L = function() {
- a.current = !0;
- }, O = function(A) {
- a.current = !1, u !== "combobox" && k(A.target.value);
- }, N = function(A) {
- var H = A.target.value;
- if (c && R.current && /[\r\n]/.test(R.current)) {
- var $ = R.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
- H = H.replace($, R.current);
- }
- R.current = null, k(H);
- }, F = function(A) {
- var H = A.clipboardData, $ = H == null ? void 0 : H.getData("text");
- R.current = $ || "";
- }, I = function(A) {
- var H = A.target;
- if (H !== r.current) {
- var $ = document.body.style.msTouchAction !== void 0;
- $ ? setTimeout(function() {
- r.current.focus();
- }) : r.current.focus();
- }
- }, T = function(A) {
- var H = w();
- A.target !== r.current && !H && !(u === "combobox" && s) && A.preventDefault(), (u !== "combobox" && (!l || !H) || !i) && (i && C !== !1 && p("", !0, !1), b());
- }, P = {
- inputRef: r,
- onInputKeyDown: S,
- onInputMouseDown: x,
- onInputChange: N,
- onInputPaste: F,
- onInputCompositionStart: L,
- onInputCompositionEnd: O
- }, z = u === "multiple" || u === "tags" ? /* @__PURE__ */ d.createElement(zx, _e({}, t, P)) : /* @__PURE__ */ d.createElement(Hx, _e({}, t, P));
- return /* @__PURE__ */ d.createElement("div", {
- ref: h,
- className: "".concat(o, "-selector"),
- onClick: I,
- onMouseDown: T
- }, v && /* @__PURE__ */ d.createElement("div", {
- className: "".concat(o, "-prefix")
- }, v), z);
- }, Wx = /* @__PURE__ */ d.forwardRef(Vx), Bx = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"], Ux = function(t) {
- var n = t === !0 ? 0 : 1;
- return {
- bottomLeft: {
- points: ["tl", "bl"],
- offset: [0, 4],
- overflow: {
- adjustX: n,
- adjustY: 1
- },
- htmlRegion: "scroll"
- },
- bottomRight: {
- points: ["tr", "br"],
- offset: [0, 4],
- overflow: {
- adjustX: n,
- adjustY: 1
- },
- htmlRegion: "scroll"
- },
- topLeft: {
- points: ["bl", "tl"],
- offset: [0, -4],
- overflow: {
- adjustX: n,
- adjustY: 1
- },
- htmlRegion: "scroll"
- },
- topRight: {
- points: ["br", "tr"],
- offset: [0, -4],
- overflow: {
- adjustX: n,
- adjustY: 1
- },
- htmlRegion: "scroll"
- }
- };
- }, qx = function(t, n) {
- var r = t.prefixCls;
- t.disabled;
- var a = t.visible, o = t.children, i = t.popupElement, u = t.animation, l = t.transitionName, c = t.dropdownStyle, s = t.dropdownClassName, v = t.direction, C = v === void 0 ? "ltr" : v, p = t.placement, m = t.builtinPlacements, b = t.dropdownMatchSelectWidth, f = t.dropdownRender, h = t.dropdownAlign, g = t.getPopupContainer, y = t.empty, w = t.getTriggerDOMNode, E = t.onPopupVisibleChange, S = t.onPopupMouseEnter, x = mt(t, Bx), R = "".concat(r, "-dropdown"), k = i;
- f && (k = f(i));
- var L = d.useMemo(function() {
- return m || Ux(b);
- }, [m, b]), O = u ? "".concat(R, "-").concat(u) : l, N = typeof b == "number", F = d.useMemo(function() {
- return N ? null : b === !1 ? "minWidth" : "width";
- }, [b, N]), I = c;
- N && (I = re(re({}, I), {}, {
- width: b
- }));
- var T = d.useRef(null);
- return d.useImperativeHandle(n, function() {
- return {
- getPopupElement: function() {
- var z;
- return (z = T.current) === null || z === void 0 ? void 0 : z.popupElement;
- }
- };
- }), /* @__PURE__ */ d.createElement(Uo, _e({}, x, {
- showAction: E ? ["click"] : [],
- hideAction: E ? ["click"] : [],
- popupPlacement: p || (C === "rtl" ? "bottomRight" : "bottomLeft"),
- builtinPlacements: L,
- prefixCls: R,
- popupTransitionName: O,
- popup: /* @__PURE__ */ d.createElement("div", {
- onMouseEnter: S
- }, k),
- ref: T,
- stretch: F,
- popupAlign: h,
- popupVisible: a,
- getPopupContainer: g,
- popupClassName: xe(s, ie({}, "".concat(R, "-empty"), y)),
- popupStyle: I,
- getTriggerDOMNode: w,
- onPopupVisibleChange: E
- }), o);
- }, Kx = /* @__PURE__ */ d.forwardRef(qx);
- function Yx(e) {
- return Dd(e) || Md(e) || Mu(e) || Nd();
- }
- function zs(e, t) {
- var n = e.key, r;
- return "value" in e && (r = e.value), n != null ? n : r !== void 0 ? r : "rc-index-key-".concat(t);
- }
- function du(e) {
- return typeof e < "u" && !Number.isNaN(e);
- }
- function Wf(e, t) {
- var n = e || {}, r = n.label, a = n.value, o = n.options, i = n.groupLabel, u = r || (t ? "children" : "label");
- return {
- label: u,
- value: a || "value",
- options: o || "options",
- groupLabel: i || u
- };
- }
- function Gx(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = t.fieldNames, r = t.childrenAsData, a = [], o = Wf(n, !1), i = o.label, u = o.value, l = o.options, c = o.groupLabel;
- function s(v, C) {
- Array.isArray(v) && v.forEach(function(p) {
- if (C || !(l in p)) {
- var m = p[u];
- a.push({
- key: zs(p, a.length),
- groupOption: C,
- data: p,
- label: p[i],
- value: m
- });
- } else {
- var b = p[c];
- b === void 0 && r && (b = p.label), a.push({
- key: zs(p, a.length),
- group: !0,
- data: p,
- label: b
- }), s(p[l], !0);
- }
- });
- }
- return s(e, !1), a;
- }
- function fu(e) {
- var t = re({}, e);
- return "props" in t || Object.defineProperty(t, "props", {
- get: function() {
- return ur(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), t;
- }
- }), t;
- }
- var Xx = function(t, n, r) {
- if (!n || !n.length)
- return null;
- var a = !1, o = function u(l, c) {
- var s = Yx(c), v = s[0], C = s.slice(1);
- if (!v)
- return [l];
- var p = l.split(v);
- return a = a || p.length > 1, p.reduce(function(m, b) {
- return [].concat(ft(m), ft(u(b, C)));
- }, []).filter(Boolean);
- }, i = o(t, n);
- return a ? typeof r < "u" ? i.slice(0, r) : i : null;
- }, Xu = /* @__PURE__ */ d.createContext(null);
- function Zx(e) {
- var t = e.visible, n = e.values;
- if (!t)
- return null;
- var r = 50;
- return /* @__PURE__ */ d.createElement("span", {
- "aria-live": "polite",
- style: {
- width: 0,
- height: 0,
- position: "absolute",
- overflow: "hidden",
- opacity: 0
- }
- }, "".concat(n.slice(0, r).map(function(a) {
- var o = a.label, i = a.value;
- return ["number", "string"].includes(_t(o)) ? o : i;
- }).join(", ")), n.length > r ? ", ..." : null);
- }
- var Qx = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "prefix", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"], Jx = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"], vu = function(t) {
- return t === "tags" || t === "multiple";
- }, eE = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n, r = e.id, a = e.prefixCls, o = e.className, i = e.showSearch, u = e.tagRender, l = e.direction, c = e.omitDomProps, s = e.displayValues, v = e.onDisplayValuesChange, C = e.emptyOptions, p = e.notFoundContent, m = p === void 0 ? "Not Found" : p, b = e.onClear, f = e.mode, h = e.disabled, g = e.loading, y = e.getInputElement, w = e.getRawInputElement, E = e.open, S = e.defaultOpen, x = e.onDropdownVisibleChange, R = e.activeValue, k = e.onActiveValueChange, L = e.activeDescendantId, O = e.searchValue, N = e.autoClearSearchValue, F = e.onSearch, I = e.onSearchSplit, T = e.tokenSeparators, P = e.allowClear, z = e.prefix, _ = e.suffixIcon, A = e.clearIcon, H = e.OptionList, $ = e.animation, U = e.transitionName, G = e.dropdownStyle, B = e.dropdownClassName, ne = e.dropdownMatchSelectWidth, le = e.dropdownRender, ee = e.dropdownAlign, V = e.placement, X = e.builtinPlacements, J = e.getPopupContainer, M = e.showAction, D = M === void 0 ? [] : M, j = e.onFocus, W = e.onBlur, K = e.onKeyUp, Y = e.onKeyDown, te = e.onMouseDown, Q = mt(e, Qx), ae = vu(f), ue = (i !== void 0 ? i : ae) || f === "combobox", se = re({}, Q);
- Jx.forEach(function(Fe) {
- delete se[Fe];
- }), c == null || c.forEach(function(Fe) {
- delete se[Fe];
- });
- var pe = d.useState(!1), oe = Z(pe, 2), ve = oe[0], ze = oe[1];
- d.useEffect(function() {
- ze(Du());
- }, []);
- var Re = d.useRef(null), Be = d.useRef(null), je = d.useRef(null), He = d.useRef(null), Ye = d.useRef(null), nt = d.useRef(!1), Ge = Nx(), Ne = Z(Ge, 3), ce = Ne[0], he = Ne[1], Ve = Ne[2];
- d.useImperativeHandle(t, function() {
- var Fe, Ee;
- return {
- focus: (Fe = He.current) === null || Fe === void 0 ? void 0 : Fe.focus,
- blur: (Ee = He.current) === null || Ee === void 0 ? void 0 : Ee.blur,
- scrollTo: function(ct) {
- var Se;
- return (Se = Ye.current) === null || Se === void 0 ? void 0 : Se.scrollTo(ct);
- },
- nativeElement: Re.current || Be.current
- };
- });
- var de = d.useMemo(function() {
- var Fe;
- if (f !== "combobox")
- return O;
- var Ee = (Fe = s[0]) === null || Fe === void 0 ? void 0 : Fe.value;
- return typeof Ee == "string" || typeof Ee == "number" ? String(Ee) : "";
- }, [O, f, s]), be = f === "combobox" && typeof y == "function" && y() || null, Xe = typeof w == "function" && w(), it = Gr(Be, Xe == null || (n = Xe.props) === null || n === void 0 ? void 0 : n.ref), tt = d.useState(!1), $e = Z(tt, 2), ge = $e[0], ke = $e[1];
- St(function() {
- ke(!0);
- }, []);
- var Te = Gt(!1, {
- defaultValue: S,
- value: E
- }), Ke = Z(Te, 2), De = Ke[0], we = Ke[1], ye = ge ? De : !1, ut = !m && C;
- (h || ut && ye && f === "combobox") && (ye = !1);
- var yt = ut ? !1 : ye, Ie = d.useCallback(function(Fe) {
- var Ee = Fe !== void 0 ? Fe : !ye;
- h || (we(Ee), ye !== Ee && (x == null || x(Ee)));
- }, [h, ye, we, x]), Oe = d.useMemo(function() {
- return (T || []).some(function(Fe) {
- return [`
- `, `\r
- `].includes(Fe);
- });
- }, [T]), We = d.useContext(Xu) || {}, Ue = We.maxCount, Ze = We.rawValues, at = function(Ee, Je, ct) {
- if (!(ae && du(Ue) && (Ze == null ? void 0 : Ze.size) >= Ue)) {
- var Se = !0, Me = Ee;
- k == null || k(null);
- var gt = Xx(Ee, T, du(Ue) ? Ue - Ze.size : void 0), Rt = ct ? null : gt;
- return f !== "combobox" && Rt && (Me = "", I == null || I(Rt), Ie(!1), Se = !1), F && de !== Me && F(Me, {
- source: Je ? "typing" : "effect"
- }), Se;
- }
- }, Lt = function(Ee) {
- !Ee || !Ee.trim() || F(Ee, {
- source: "submit"
- });
- };
- d.useEffect(function() {
- !ye && !ae && f !== "combobox" && at("", !1, !1);
- }, [ye]), d.useEffect(function() {
- De && h && we(!1), h && !nt.current && he(!1);
- }, [h]);
- var Et = Ff(), wt = Z(Et, 2), pt = wt[0], xt = wt[1], Ft = d.useRef(!1), Mt = function(Ee) {
- var Je = pt(), ct = Ee.key, Se = ct === "Enter";
- if (Se && (f !== "combobox" && Ee.preventDefault(), ye || Ie(!0)), xt(!!de), ct === "Backspace" && !Je && ae && !de && s.length) {
- for (var Me = ft(s), gt = null, Rt = Me.length - 1; Rt >= 0; Rt -= 1) {
- var Kt = Me[Rt];
- if (!Kt.disabled) {
- Me.splice(Rt, 1), gt = Kt;
- break;
- }
- }
- gt && v(Me, {
- type: "remove",
- values: [gt]
- });
- }
- for (var rn = arguments.length, Yt = new Array(rn > 1 ? rn - 1 : 0), gn = 1; gn < rn; gn++)
- Yt[gn - 1] = arguments[gn];
- if (ye && (!Se || !Ft.current)) {
- var yn;
- (yn = Ye.current) === null || yn === void 0 || yn.onKeyDown.apply(yn, [Ee].concat(Yt));
- }
- Se && (Ft.current = !0), Y == null || Y.apply(void 0, [Ee].concat(Yt));
- }, Qt = function(Ee) {
- for (var Je = arguments.length, ct = new Array(Je > 1 ? Je - 1 : 0), Se = 1; Se < Je; Se++)
- ct[Se - 1] = arguments[Se];
- if (ye) {
- var Me;
- (Me = Ye.current) === null || Me === void 0 || Me.onKeyUp.apply(Me, [Ee].concat(ct));
- }
- Ee.key === "Enter" && (Ft.current = !1), K == null || K.apply(void 0, [Ee].concat(ct));
- }, Le = function(Ee) {
- var Je = s.filter(function(ct) {
- return ct !== Ee;
- });
- v(Je, {
- type: "remove",
- values: [Ee]
- });
- }, Pe = d.useRef(!1), qe = function() {
- he(!0), h || (j && !Pe.current && j.apply(void 0, arguments), D.includes("focus") && Ie(!0)), Pe.current = !0;
- }, vt = function() {
- nt.current = !0, he(!1, function() {
- Pe.current = !1, nt.current = !1, Ie(!1);
- }), !h && (de && (f === "tags" ? F(de, {
- source: "submit"
- }) : f === "multiple" && F("", {
- source: "blur"
- })), W && W.apply(void 0, arguments));
- }, ht = [];
- d.useEffect(function() {
- return function() {
- ht.forEach(function(Fe) {
- return clearTimeout(Fe);
- }), ht.splice(0, ht.length);
- };
- }, []);
- var Dt = function(Ee) {
- var Je, ct = Ee.target, Se = (Je = je.current) === null || Je === void 0 ? void 0 : Je.getPopupElement();
- if (Se && Se.contains(ct)) {
- var Me = setTimeout(function() {
- var rn = ht.indexOf(Me);
- if (rn !== -1 && ht.splice(rn, 1), Ve(), !ve && !Se.contains(document.activeElement)) {
- var Yt;
- (Yt = He.current) === null || Yt === void 0 || Yt.focus();
- }
- });
- ht.push(Me);
- }
- for (var gt = arguments.length, Rt = new Array(gt > 1 ? gt - 1 : 0), Kt = 1; Kt < gt; Kt++)
- Rt[Kt - 1] = arguments[Kt];
- te == null || te.apply(void 0, [Ee].concat(Rt));
- }, Nt = d.useState({}), an = Z(Nt, 2), vn = an[1];
- function on() {
- vn({});
- }
- var Wt;
- Xe && (Wt = function(Ee) {
- Ie(Ee);
- }), Ix(function() {
- var Fe;
- return [Re.current, (Fe = je.current) === null || Fe === void 0 ? void 0 : Fe.getPopupElement()];
- }, yt, Ie, !!Xe);
- var mn = d.useMemo(function() {
- return re(re({}, e), {}, {
- notFoundContent: m,
- open: ye,
- triggerOpen: yt,
- id: r,
- showSearch: ue,
- multiple: ae,
- toggleOpen: Ie
- });
- }, [e, m, yt, ye, r, ue, ae, Ie]), Jt = !!_ || g, en;
- Jt && (en = /* @__PURE__ */ d.createElement(ei, {
- className: xe("".concat(a, "-arrow"), ie({}, "".concat(a, "-arrow-loading"), g)),
- customizeIcon: _,
- customizeIconProps: {
- loading: g,
- searchValue: de,
- open: ye,
- focused: ce,
- showSearch: ue
- }
- }));
- var On = function() {
- var Ee;
- b == null || b(), (Ee = He.current) === null || Ee === void 0 || Ee.focus(), v([], {
- type: "clear",
- values: s
- }), at("", !1, !1);
- }, wn = kx(a, On, s, P, A, h, de, f), Bt = wn.allowClear, Ut = wn.clearIcon, pn = /* @__PURE__ */ d.createElement(H, {
- ref: Ye
- }), hn = xe(a, o, ie(ie(ie(ie(ie(ie(ie(ie(ie(ie({}, "".concat(a, "-focused"), ce), "".concat(a, "-multiple"), ae), "".concat(a, "-single"), !ae), "".concat(a, "-allow-clear"), P), "".concat(a, "-show-arrow"), Jt), "".concat(a, "-disabled"), h), "".concat(a, "-loading"), g), "".concat(a, "-open"), ye), "".concat(a, "-customize-input"), be), "".concat(a, "-show-search"), ue)), qt = /* @__PURE__ */ d.createElement(Kx, {
- ref: je,
- disabled: h,
- prefixCls: a,
- visible: yt,
- popupElement: pn,
- animation: $,
- transitionName: U,
- dropdownStyle: G,
- dropdownClassName: B,
- direction: l,
- dropdownMatchSelectWidth: ne,
- dropdownRender: le,
- dropdownAlign: ee,
- placement: V,
- builtinPlacements: X,
- getPopupContainer: J,
- empty: C,
- getTriggerDOMNode: function(Ee) {
- return (
- // TODO: This is workaround and should be removed in `rc-select`
- // And use new standard `nativeElement` for ref.
- // But we should update `rc-resize-observer` first.
- Be.current || Ee
- );
- },
- onPopupVisibleChange: Wt,
- onPopupMouseEnter: on
- }, Xe ? /* @__PURE__ */ d.cloneElement(Xe, {
- ref: it
- }) : /* @__PURE__ */ d.createElement(Wx, _e({}, e, {
- domRef: Be,
- prefixCls: a,
- inputElement: be,
- ref: He,
- id: r,
- prefix: z,
- showSearch: ue,
- autoClearSearchValue: N,
- mode: f,
- activeDescendantId: L,
- tagRender: u,
- values: s,
- open: ye,
- onToggleOpen: Ie,
- activeValue: R,
- searchValue: de,
- onSearch: at,
- onSearchSubmit: Lt,
- onRemove: Le,
- tokenWithEnter: Oe
- }))), xn;
- return Xe ? xn = qt : xn = /* @__PURE__ */ d.createElement("div", _e({
- className: hn
- }, se, {
- ref: Re,
- onMouseDown: Dt,
- onKeyDown: Mt,
- onKeyUp: Qt,
- onFocus: qe,
- onBlur: vt
- }), /* @__PURE__ */ d.createElement(Zx, {
- visible: ce && !ye,
- values: s
- }), qt, en, Bt && Ut), /* @__PURE__ */ d.createElement(jf.Provider, {
- value: mn
- }, xn);
- }), Bf = function() {
- return null;
- };
- Bf.isSelectOptGroup = !0;
- var Uf = function() {
- return null;
- };
- Uf.isSelectOption = !0;
- var qf = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.height, r = e.offsetY, a = e.offsetX, o = e.children, i = e.prefixCls, u = e.onInnerResize, l = e.innerProps, c = e.rtl, s = e.extra, v = {}, C = {
- display: "flex",
- flexDirection: "column"
- };
- return r !== void 0 && (v = {
- height: n,
- position: "relative",
- overflow: "hidden"
- }, C = re(re({}, C), {}, ie(ie(ie(ie(ie({
- transform: "translateY(".concat(r, "px)")
- }, c ? "marginRight" : "marginLeft", -a), "position", "absolute"), "left", 0), "right", 0), "top", 0))), /* @__PURE__ */ d.createElement("div", {
- style: v
- }, /* @__PURE__ */ d.createElement(cr, {
- onResize: function(m) {
- var b = m.offsetHeight;
- b && u && u();
- }
- }, /* @__PURE__ */ d.createElement("div", _e({
- style: C,
- className: xe(ie({}, "".concat(i, "-holder-inner"), i)),
- ref: t
- }, l), o, s)));
- });
- qf.displayName = "Filler";
- function tE(e) {
- var t = e.children, n = e.setRef, r = d.useCallback(function(a) {
- n(a);
- }, []);
- return /* @__PURE__ */ d.cloneElement(t, {
- ref: r
- });
- }
- function nE(e, t, n, r, a, o, i, u) {
- var l = u.getKey;
- return e.slice(t, n + 1).map(function(c, s) {
- var v = t + s, C = i(c, v, {
- style: {
- width: r
- },
- offsetX: a
- }), p = l(c);
- return /* @__PURE__ */ d.createElement(tE, {
- key: p,
- setRef: function(b) {
- return o(c, b);
- }
- }, C);
- });
- }
- function rE(e, t, n) {
- var r = e.length, a = t.length, o, i;
- if (r === 0 && a === 0)
- return null;
- r < a ? (o = e, i = t) : (o = t, i = e);
- var u = {
- __EMPTY_ITEM__: !0
- };
- function l(m) {
- return m !== void 0 ? n(m) : u;
- }
- for (var c = null, s = Math.abs(r - a) !== 1, v = 0; v < i.length; v += 1) {
- var C = l(o[v]), p = l(i[v]);
- if (C !== p) {
- c = v, s = s || C !== l(i[v + 1]);
- break;
- }
- }
- return c === null ? null : {
- index: c,
- multiple: s
- };
- }
- function aE(e, t, n) {
- var r = d.useState(e), a = Z(r, 2), o = a[0], i = a[1], u = d.useState(null), l = Z(u, 2), c = l[0], s = l[1];
- return d.useEffect(function() {
- var v = rE(o || [], e, t);
- (v == null ? void 0 : v.index) !== void 0 && s(e[v.index]), i(e);
- }, [e]), [c];
- }
- var Hs = (typeof navigator > "u" ? "undefined" : _t(navigator)) === "object" && /Firefox/i.test(navigator.userAgent);
- const Kf = function(e, t, n, r) {
- var a = Ce(!1), o = Ce(null);
- function i() {
- clearTimeout(o.current), a.current = !0, o.current = setTimeout(function() {
- a.current = !1;
- }, 50);
- }
- var u = Ce({
- top: e,
- bottom: t,
- left: n,
- right: r
- });
- return u.current.top = e, u.current.bottom = t, u.current.left = n, u.current.right = r, function(l, c) {
- var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, v = l ? (
- // Pass origin wheel when on the left
- c < 0 && u.current.left || // Pass origin wheel when on the right
- c > 0 && u.current.right
- ) : c < 0 && u.current.top || // Pass origin wheel when on the bottom
- c > 0 && u.current.bottom;
- return s && v ? (clearTimeout(o.current), a.current = !1) : (!v || a.current) && i(), !a.current && v;
- };
- };
- function oE(e, t, n, r, a, o, i) {
- var u = Ce(0), l = Ce(null), c = Ce(null), s = Ce(!1), v = Kf(t, n, r, a);
- function C(g, y) {
- if (st.cancel(l.current), !v(!1, y)) {
- var w = g;
- if (!w._virtualHandled)
- w._virtualHandled = !0;
- else
- return;
- u.current += y, c.current = y, Hs || w.preventDefault(), l.current = st(function() {
- var E = s.current ? 10 : 1;
- i(u.current * E, !1), u.current = 0;
- });
- }
- }
- function p(g, y) {
- i(y, !0), Hs || g.preventDefault();
- }
- var m = Ce(null), b = Ce(null);
- function f(g) {
- if (e) {
- st.cancel(b.current), b.current = st(function() {
- m.current = null;
- }, 2);
- var y = g.deltaX, w = g.deltaY, E = g.shiftKey, S = y, x = w;
- (m.current === "sx" || !m.current && E && w && !y) && (S = w, x = 0, m.current = "sx");
- var R = Math.abs(S), k = Math.abs(x);
- m.current === null && (m.current = o && R > k ? "x" : "y"), m.current === "y" ? C(g, x) : p(g, S);
- }
- }
- function h(g) {
- e && (s.current = g.detail === c.current);
- }
- return [f, h];
- }
- function iE(e, t, n, r) {
- var a = d.useMemo(function() {
- return [/* @__PURE__ */ new Map(), []];
- }, [e, n.id, r]), o = Z(a, 2), i = o[0], u = o[1], l = function(s) {
- var v = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : s, C = i.get(s), p = i.get(v);
- if (C === void 0 || p === void 0)
- for (var m = e.length, b = u.length; b < m; b += 1) {
- var f, h = e[b], g = t(h);
- i.set(g, b);
- var y = (f = n.get(g)) !== null && f !== void 0 ? f : r;
- if (u[b] = (u[b - 1] || 0) + y, g === s && (C = b), g === v && (p = b), C !== void 0 && p !== void 0)
- break;
- }
- return {
- top: u[C - 1] || 0,
- bottom: u[p]
- };
- };
- return l;
- }
- var uE = /* @__PURE__ */ function() {
- function e() {
- Rr(this, e), ie(this, "maps", void 0), ie(this, "id", 0), this.maps = /* @__PURE__ */ Object.create(null);
- }
- return Pr(e, [{
- key: "set",
- value: function(n, r) {
- this.maps[n] = r, this.id += 1;
- }
- }, {
- key: "get",
- value: function(n) {
- return this.maps[n];
- }
- }]), e;
- }();
- function Vs(e) {
- var t = parseFloat(e);
- return isNaN(t) ? 0 : t;
- }
- function lE(e, t, n) {
- var r = d.useState(0), a = Z(r, 2), o = a[0], i = a[1], u = Ce(/* @__PURE__ */ new Map()), l = Ce(new uE()), c = Ce();
- function s() {
- st.cancel(c.current);
- }
- function v() {
- var p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
- s();
- var m = function() {
- u.current.forEach(function(f, h) {
- if (f && f.offsetParent) {
- var g = Br(f), y = g.offsetHeight, w = getComputedStyle(g), E = w.marginTop, S = w.marginBottom, x = Vs(E), R = Vs(S), k = y + x + R;
- l.current.get(h) !== k && l.current.set(h, k);
- }
- }), i(function(f) {
- return f + 1;
- });
- };
- p ? m() : c.current = st(m);
- }
- function C(p, m) {
- var b = e(p);
- u.current.get(b), m ? (u.current.set(b, m), v()) : u.current.delete(b);
- }
- return lt(function() {
- return s;
- }, []), [C, v, l.current, o];
- }
- var Ws = 14 / 15;
- function sE(e, t, n) {
- var r = Ce(!1), a = Ce(0), o = Ce(0), i = Ce(null), u = Ce(null), l, c = function(p) {
- if (r.current) {
- var m = Math.ceil(p.touches[0].pageX), b = Math.ceil(p.touches[0].pageY), f = a.current - m, h = o.current - b, g = Math.abs(f) > Math.abs(h);
- g ? a.current = m : o.current = b;
- var y = n(g, g ? f : h, !1, p);
- y && p.preventDefault(), clearInterval(u.current), y && (u.current = setInterval(function() {
- g ? f *= Ws : h *= Ws;
- var w = Math.floor(g ? f : h);
- (!n(g, w, !0) || Math.abs(w) <= 0.1) && clearInterval(u.current);
- }, 16));
- }
- }, s = function() {
- r.current = !1, l();
- }, v = function(p) {
- l(), p.touches.length === 1 && !r.current && (r.current = !0, a.current = Math.ceil(p.touches[0].pageX), o.current = Math.ceil(p.touches[0].pageY), i.current = p.target, i.current.addEventListener("touchmove", c, {
- passive: !1
- }), i.current.addEventListener("touchend", s, {
- passive: !0
- }));
- };
- l = function() {
- i.current && (i.current.removeEventListener("touchmove", c), i.current.removeEventListener("touchend", s));
- }, St(function() {
- return e && t.current.addEventListener("touchstart", v, {
- passive: !0
- }), function() {
- var C;
- (C = t.current) === null || C === void 0 || C.removeEventListener("touchstart", v), l(), clearInterval(u.current);
- };
- }, [e]);
- }
- var cE = 10;
- function dE(e, t, n, r, a, o, i, u) {
- var l = d.useRef(), c = d.useState(null), s = Z(c, 2), v = s[0], C = s[1];
- return St(function() {
- if (v && v.times < cE) {
- if (!e.current) {
- C(function(A) {
- return re({}, A);
- });
- return;
- }
- o();
- var p = v.targetAlign, m = v.originAlign, b = v.index, f = v.offset, h = e.current.clientHeight, g = !1, y = p, w = null;
- if (h) {
- for (var E = p || m, S = 0, x = 0, R = 0, k = Math.min(t.length - 1, b), L = 0; L <= k; L += 1) {
- var O = a(t[L]);
- x = S;
- var N = n.get(O);
- R = x + (N === void 0 ? r : N), S = R;
- }
- for (var F = E === "top" ? f : h - f, I = k; I >= 0; I -= 1) {
- var T = a(t[I]), P = n.get(T);
- if (P === void 0) {
- g = !0;
- break;
- }
- if (F -= P, F <= 0)
- break;
- }
- switch (E) {
- case "top":
- w = x - f;
- break;
- case "bottom":
- w = R - h + f;
- break;
- default: {
- var z = e.current.scrollTop, _ = z + h;
- x < z ? y = "top" : R > _ && (y = "bottom");
- }
- }
- w !== null && i(w), w !== v.lastTop && (g = !0);
- }
- g && C(re(re({}, v), {}, {
- times: v.times + 1,
- targetAlign: y,
- lastTop: w
- }));
- }
- }, [v, e.current]), function(p) {
- if (p == null) {
- u();
- return;
- }
- if (st.cancel(l.current), typeof p == "number")
- i(p);
- else if (p && _t(p) === "object") {
- var m, b = p.align;
- "index" in p ? m = p.index : m = t.findIndex(function(g) {
- return a(g) === p.key;
- });
- var f = p.offset, h = f === void 0 ? 0 : f;
- C({
- times: 0,
- index: m,
- offset: h,
- originAlign: b
- });
- }
- };
- }
- function Bs(e, t) {
- var n = "touches" in e ? e.touches[0] : e;
- return n[t ? "pageX" : "pageY"];
- }
- var Us = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.prefixCls, r = e.rtl, a = e.scrollOffset, o = e.scrollRange, i = e.onStartMove, u = e.onStopMove, l = e.onScroll, c = e.horizontal, s = e.spinSize, v = e.containerSize, C = e.style, p = e.thumbStyle, m = d.useState(!1), b = Z(m, 2), f = b[0], h = b[1], g = d.useState(null), y = Z(g, 2), w = y[0], E = y[1], S = d.useState(null), x = Z(S, 2), R = x[0], k = x[1], L = !r, O = d.useRef(), N = d.useRef(), F = d.useState(!1), I = Z(F, 2), T = I[0], P = I[1], z = d.useRef(), _ = function() {
- clearTimeout(z.current), P(!0), z.current = setTimeout(function() {
- P(!1);
- }, 3e3);
- }, A = o - v || 0, H = v - s || 0, $ = d.useMemo(function() {
- if (a === 0 || A === 0)
- return 0;
- var J = a / A;
- return J * H;
- }, [a, A, H]), U = function(M) {
- M.stopPropagation(), M.preventDefault();
- }, G = d.useRef({
- top: $,
- dragging: f,
- pageY: w,
- startTop: R
- });
- G.current = {
- top: $,
- dragging: f,
- pageY: w,
- startTop: R
- };
- var B = function(M) {
- h(!0), E(Bs(M, c)), k(G.current.top), i(), M.stopPropagation(), M.preventDefault();
- };
- d.useEffect(function() {
- var J = function(W) {
- W.preventDefault();
- }, M = O.current, D = N.current;
- return M.addEventListener("touchstart", J, {
- passive: !1
- }), D.addEventListener("touchstart", B, {
- passive: !1
- }), function() {
- M.removeEventListener("touchstart", J), D.removeEventListener("touchstart", B);
- };
- }, []);
- var ne = d.useRef();
- ne.current = A;
- var le = d.useRef();
- le.current = H, d.useEffect(function() {
- if (f) {
- var J, M = function(W) {
- var K = G.current, Y = K.dragging, te = K.pageY, Q = K.startTop;
- st.cancel(J);
- var ae = O.current.getBoundingClientRect(), ue = v / (c ? ae.width : ae.height);
- if (Y) {
- var se = (Bs(W, c) - te) * ue, pe = Q;
- !L && c ? pe -= se : pe += se;
- var oe = ne.current, ve = le.current, ze = ve ? pe / ve : 0, Re = Math.ceil(ze * oe);
- Re = Math.max(Re, 0), Re = Math.min(Re, oe), J = st(function() {
- l(Re, c);
- });
- }
- }, D = function() {
- h(!1), u();
- };
- return window.addEventListener("mousemove", M, {
- passive: !0
- }), window.addEventListener("touchmove", M, {
- passive: !0
- }), window.addEventListener("mouseup", D, {
- passive: !0
- }), window.addEventListener("touchend", D, {
- passive: !0
- }), function() {
- window.removeEventListener("mousemove", M), window.removeEventListener("touchmove", M), window.removeEventListener("mouseup", D), window.removeEventListener("touchend", D), st.cancel(J);
- };
- }
- }, [f]), d.useEffect(function() {
- return _(), function() {
- clearTimeout(z.current);
- };
- }, [a]), d.useImperativeHandle(t, function() {
- return {
- delayHidden: _
- };
- });
- var ee = "".concat(n, "-scrollbar"), V = {
- position: "absolute",
- visibility: T ? null : "hidden"
- }, X = {
- position: "absolute",
- background: "rgba(0, 0, 0, 0.5)",
- borderRadius: 99,
- cursor: "pointer",
- userSelect: "none"
- };
- return c ? (V.height = 8, V.left = 0, V.right = 0, V.bottom = 0, X.height = "100%", X.width = s, L ? X.left = $ : X.right = $) : (V.width = 8, V.top = 0, V.bottom = 0, L ? V.right = 0 : V.left = 0, X.width = "100%", X.height = s, X.top = $), /* @__PURE__ */ d.createElement("div", {
- ref: O,
- className: xe(ee, ie(ie(ie({}, "".concat(ee, "-horizontal"), c), "".concat(ee, "-vertical"), !c), "".concat(ee, "-visible"), T)),
- style: re(re({}, V), C),
- onMouseDown: U,
- onMouseMove: _
- }, /* @__PURE__ */ d.createElement("div", {
- ref: N,
- className: xe("".concat(ee, "-thumb"), ie({}, "".concat(ee, "-thumb-moving"), f)),
- style: re(re({}, X), p),
- onMouseDown: B
- }));
- }), fE = 20;
- function qs() {
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = e / t * e;
- return isNaN(n) && (n = 0), n = Math.max(n, fE), Math.floor(n);
- }
- var vE = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles"], mE = [], pE = {
- overflowY: "auto",
- overflowAnchor: "none"
- };
- function hE(e, t) {
- var n = e.prefixCls, r = n === void 0 ? "rc-virtual-list" : n, a = e.className, o = e.height, i = e.itemHeight, u = e.fullHeight, l = u === void 0 ? !0 : u, c = e.style, s = e.data, v = e.children, C = e.itemKey, p = e.virtual, m = e.direction, b = e.scrollWidth, f = e.component, h = f === void 0 ? "div" : f, g = e.onScroll, y = e.onVirtualScroll, w = e.onVisibleChange, E = e.innerProps, S = e.extraRender, x = e.styles, R = mt(e, vE), k = d.useCallback(function(Le) {
- return typeof C == "function" ? C(Le) : Le == null ? void 0 : Le[C];
- }, [C]), L = lE(k), O = Z(L, 4), N = O[0], F = O[1], I = O[2], T = O[3], P = !!(p !== !1 && o && i), z = d.useMemo(function() {
- return Object.values(I.maps).reduce(function(Le, Pe) {
- return Le + Pe;
- }, 0);
- }, [I.id, I.maps]), _ = P && s && (Math.max(i * s.length, z) > o || !!b), A = m === "rtl", H = xe(r, ie({}, "".concat(r, "-rtl"), A), a), $ = s || mE, U = Ce(), G = Ce(), B = Ce(), ne = rt(0), le = Z(ne, 2), ee = le[0], V = le[1], X = rt(0), J = Z(X, 2), M = J[0], D = J[1], j = rt(!1), W = Z(j, 2), K = W[0], Y = W[1], te = function() {
- Y(!0);
- }, Q = function() {
- Y(!1);
- }, ae = {
- getKey: k
- };
- function ue(Le) {
- V(function(Pe) {
- var qe;
- typeof Le == "function" ? qe = Le(Pe) : qe = Le;
- var vt = $e(qe);
- return U.current.scrollTop = vt, vt;
- });
- }
- var se = Ce({
- start: 0,
- end: $.length
- }), pe = Ce(), oe = aE($, k), ve = Z(oe, 1), ze = ve[0];
- pe.current = ze;
- var Re = d.useMemo(function() {
- if (!P)
- return {
- scrollHeight: void 0,
- start: 0,
- end: $.length - 1,
- offset: void 0
- };
- if (!_) {
- var Le;
- return {
- scrollHeight: ((Le = G.current) === null || Le === void 0 ? void 0 : Le.offsetHeight) || 0,
- start: 0,
- end: $.length - 1,
- offset: void 0
- };
- }
- for (var Pe = 0, qe, vt, ht, Dt = $.length, Nt = 0; Nt < Dt; Nt += 1) {
- var an = $[Nt], vn = k(an), on = I.get(vn), Wt = Pe + (on === void 0 ? i : on);
- Wt >= ee && qe === void 0 && (qe = Nt, vt = Pe), Wt > ee + o && ht === void 0 && (ht = Nt), Pe = Wt;
- }
- return qe === void 0 && (qe = 0, vt = 0, ht = Math.ceil(o / i)), ht === void 0 && (ht = $.length - 1), ht = Math.min(ht + 1, $.length - 1), {
- scrollHeight: Pe,
- start: qe,
- end: ht,
- offset: vt
- };
- }, [_, P, ee, $, T, o]), Be = Re.scrollHeight, je = Re.start, He = Re.end, Ye = Re.offset;
- se.current.start = je, se.current.end = He;
- var nt = d.useState({
- width: 0,
- height: o
- }), Ge = Z(nt, 2), Ne = Ge[0], ce = Ge[1], he = function(Pe) {
- ce({
- width: Pe.offsetWidth,
- height: Pe.offsetHeight
- });
- }, Ve = Ce(), de = Ce(), be = d.useMemo(function() {
- return qs(Ne.width, b);
- }, [Ne.width, b]), Xe = d.useMemo(function() {
- return qs(Ne.height, Be);
- }, [Ne.height, Be]), it = Be - o, tt = Ce(it);
- tt.current = it;
- function $e(Le) {
- var Pe = Le;
- return Number.isNaN(tt.current) || (Pe = Math.min(Pe, tt.current)), Pe = Math.max(Pe, 0), Pe;
- }
- var ge = ee <= 0, ke = ee >= it, Te = M <= 0, Ke = M >= b, De = Kf(ge, ke, Te, Ke), we = function() {
- return {
- x: A ? -M : M,
- y: ee
- };
- }, ye = Ce(we()), ut = Ct(function(Le) {
- if (y) {
- var Pe = re(re({}, we()), Le);
- (ye.current.x !== Pe.x || ye.current.y !== Pe.y) && (y(Pe), ye.current = Pe);
- }
- });
- function yt(Le, Pe) {
- var qe = Le;
- Pe ? (Di(function() {
- D(qe);
- }), ut()) : ue(qe);
- }
- function Ie(Le) {
- var Pe = Le.currentTarget.scrollTop;
- Pe !== ee && ue(Pe), g == null || g(Le), ut();
- }
- var Oe = function(Pe) {
- var qe = Pe, vt = b ? b - Ne.width : 0;
- return qe = Math.max(qe, 0), qe = Math.min(qe, vt), qe;
- }, We = Ct(function(Le, Pe) {
- Pe ? (Di(function() {
- D(function(qe) {
- var vt = qe + (A ? -Le : Le);
- return Oe(vt);
- });
- }), ut()) : ue(function(qe) {
- var vt = qe + Le;
- return vt;
- });
- }), Ue = oE(P, ge, ke, Te, Ke, !!b, We), Ze = Z(Ue, 2), at = Ze[0], Lt = Ze[1];
- sE(P, U, function(Le, Pe, qe, vt) {
- var ht = vt;
- return De(Le, Pe, qe) ? !1 : !ht || !ht._virtualHandled ? (ht && (ht._virtualHandled = !0), at({
- preventDefault: function() {
- },
- deltaX: Le ? Pe : 0,
- deltaY: Le ? 0 : Pe
- }), !0) : !1;
- }), St(function() {
- function Le(qe) {
- var vt = ge && qe.detail < 0, ht = ke && qe.detail > 0;
- P && !vt && !ht && qe.preventDefault();
- }
- var Pe = U.current;
- return Pe.addEventListener("wheel", at, {
- passive: !1
- }), Pe.addEventListener("DOMMouseScroll", Lt, {
- passive: !0
- }), Pe.addEventListener("MozMousePixelScroll", Le, {
- passive: !1
- }), function() {
- Pe.removeEventListener("wheel", at), Pe.removeEventListener("DOMMouseScroll", Lt), Pe.removeEventListener("MozMousePixelScroll", Le);
- };
- }, [P, ge, ke]), St(function() {
- if (b) {
- var Le = Oe(M);
- D(Le), ut({
- x: Le
- });
- }
- }, [Ne.width, b]);
- var Et = function() {
- var Pe, qe;
- (Pe = Ve.current) === null || Pe === void 0 || Pe.delayHidden(), (qe = de.current) === null || qe === void 0 || qe.delayHidden();
- }, wt = dE(U, $, I, i, k, function() {
- return F(!0);
- }, ue, Et);
- d.useImperativeHandle(t, function() {
- return {
- nativeElement: B.current,
- getScrollInfo: we,
- scrollTo: function(Pe) {
- function qe(vt) {
- return vt && _t(vt) === "object" && ("left" in vt || "top" in vt);
- }
- qe(Pe) ? (Pe.left !== void 0 && D(Oe(Pe.left)), wt(Pe.top)) : wt(Pe);
- }
- };
- }), St(function() {
- if (w) {
- var Le = $.slice(je, He + 1);
- w(Le, $);
- }
- }, [je, He, $]);
- var pt = iE($, k, I, i), xt = S == null ? void 0 : S({
- start: je,
- end: He,
- virtual: _,
- offsetX: M,
- offsetY: Ye,
- rtl: A,
- getSize: pt
- }), Ft = nE($, je, He, b, M, N, v, ae), Mt = null;
- o && (Mt = re(ie({}, l ? "height" : "maxHeight", o), pE), P && (Mt.overflowY = "hidden", b && (Mt.overflowX = "hidden"), K && (Mt.pointerEvents = "none")));
- var Qt = {};
- return A && (Qt.dir = "rtl"), /* @__PURE__ */ d.createElement("div", _e({
- ref: B,
- style: re(re({}, c), {}, {
- position: "relative"
- }),
- className: H
- }, Qt, R), /* @__PURE__ */ d.createElement(cr, {
- onResize: he
- }, /* @__PURE__ */ d.createElement(h, {
- className: "".concat(r, "-holder"),
- style: Mt,
- ref: U,
- onScroll: Ie,
- onMouseEnter: Et
- }, /* @__PURE__ */ d.createElement(qf, {
- prefixCls: r,
- height: Be,
- offsetX: M,
- offsetY: Ye,
- scrollWidth: b,
- onInnerResize: F,
- ref: G,
- innerProps: E,
- rtl: A,
- extra: xt
- }, Ft))), _ && Be > o && /* @__PURE__ */ d.createElement(Us, {
- ref: Ve,
- prefixCls: r,
- scrollOffset: ee,
- scrollRange: Be,
- rtl: A,
- onScroll: yt,
- onStartMove: te,
- onStopMove: Q,
- spinSize: Xe,
- containerSize: Ne.height,
- style: x == null ? void 0 : x.verticalScrollBar,
- thumbStyle: x == null ? void 0 : x.verticalScrollBarThumb
- }), _ && b > Ne.width && /* @__PURE__ */ d.createElement(Us, {
- ref: de,
- prefixCls: r,
- scrollOffset: M,
- scrollRange: b,
- rtl: A,
- onScroll: yt,
- onStartMove: te,
- onStopMove: Q,
- spinSize: be,
- containerSize: Ne.width,
- horizontal: !0,
- style: x == null ? void 0 : x.horizontalScrollBar,
- thumbStyle: x == null ? void 0 : x.horizontalScrollBarThumb
- }));
- }
- var Zu = /* @__PURE__ */ d.forwardRef(hE);
- Zu.displayName = "List";
- function gE() {
- return /(mac\sos|macintosh)/i.test(navigator.appVersion);
- }
- var yE = ["disabled", "title", "children", "style", "className"];
- function Ks(e) {
- return typeof e == "string" || typeof e == "number";
- }
- var bE = function(t, n) {
- var r = Dx(), a = r.prefixCls, o = r.id, i = r.open, u = r.multiple, l = r.mode, c = r.searchValue, s = r.toggleOpen, v = r.notFoundContent, C = r.onPopupScroll, p = d.useContext(Xu), m = p.maxCount, b = p.flattenOptions, f = p.onActiveValue, h = p.defaultActiveFirstOption, g = p.onSelect, y = p.menuItemSelectedIcon, w = p.rawValues, E = p.fieldNames, S = p.virtual, x = p.direction, R = p.listHeight, k = p.listItemHeight, L = p.optionRender, O = "".concat(a, "-item"), N = Su(function() {
- return b;
- }, [i, b], function(M, D) {
- return D[0] && M[1] !== D[1];
- }), F = d.useRef(null), I = d.useMemo(function() {
- return u && du(m) && (w == null ? void 0 : w.size) >= m;
- }, [u, m, w == null ? void 0 : w.size]), T = function(D) {
- D.preventDefault();
- }, P = function(D) {
- var j;
- (j = F.current) === null || j === void 0 || j.scrollTo(typeof D == "number" ? {
- index: D
- } : D);
- }, z = function(D) {
- for (var j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, W = N.length, K = 0; K < W; K += 1) {
- var Y = (D + K * j + W) % W, te = N[Y] || {}, Q = te.group, ae = te.data;
- if (!Q && !(ae != null && ae.disabled) && !I)
- return Y;
- }
- return -1;
- }, _ = d.useState(function() {
- return z(0);
- }), A = Z(_, 2), H = A[0], $ = A[1], U = function(D) {
- var j = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- $(D);
- var W = {
- source: j ? "keyboard" : "mouse"
- }, K = N[D];
- if (!K) {
- f(null, -1, W);
- return;
- }
- f(K.value, D, W);
- };
- lt(function() {
- U(h !== !1 ? z(0) : -1);
- }, [N.length, c]);
- var G = d.useCallback(function(M) {
- return l === "combobox" ? !1 : w.has(M);
- }, [l, ft(w).toString(), w.size]), B = d.useCallback(function(M) {
- return l === "combobox" ? String(M).toLowerCase() === c.toLowerCase() : w.has(M);
- }, [l, c, ft(w).toString(), w.size]);
- lt(function() {
- var M = setTimeout(function() {
- if (!u && i && w.size === 1) {
- var j = Array.from(w)[0], W = N.findIndex(function(K) {
- var Y = K.data;
- return Y.value === j;
- });
- W !== -1 && (U(W), P(W));
- }
- });
- if (i) {
- var D;
- (D = F.current) === null || D === void 0 || D.scrollTo(void 0);
- }
- return function() {
- return clearTimeout(M);
- };
- }, [i, c]);
- var ne = function(D) {
- D !== void 0 && g(D, {
- selected: !w.has(D)
- }), u || s(!1);
- };
- if (d.useImperativeHandle(n, function() {
- return {
- onKeyDown: function(D) {
- var j = D.which, W = D.ctrlKey;
- switch (j) {
- // >>> Arrow keys & ctrl + n/p on Mac
- case fe.N:
- case fe.P:
- case fe.UP:
- case fe.DOWN: {
- var K = 0;
- if (j === fe.UP ? K = -1 : j === fe.DOWN ? K = 1 : gE() && W && (j === fe.N ? K = 1 : j === fe.P && (K = -1)), K !== 0) {
- var Y = z(H + K, K);
- P(Y), U(Y, !0);
- }
- break;
- }
- // >>> Select (Tab / Enter)
- case fe.TAB:
- case fe.ENTER: {
- var te, Q = N[H];
- Q && !(Q != null && (te = Q.data) !== null && te !== void 0 && te.disabled) && !I ? ne(Q.value) : ne(void 0), i && D.preventDefault();
- break;
- }
- // >>> Close
- case fe.ESC:
- s(!1), i && D.stopPropagation();
- }
- },
- onKeyUp: function() {
- },
- scrollTo: function(D) {
- P(D);
- }
- };
- }), N.length === 0)
- return /* @__PURE__ */ d.createElement("div", {
- role: "listbox",
- id: "".concat(o, "_list"),
- className: "".concat(O, "-empty"),
- onMouseDown: T
- }, v);
- var le = Object.keys(E).map(function(M) {
- return E[M];
- }), ee = function(D) {
- return D.label;
- };
- function V(M, D) {
- var j = M.group;
- return {
- role: j ? "presentation" : "option",
- id: "".concat(o, "_list_").concat(D)
- };
- }
- var X = function(D) {
- var j = N[D];
- if (!j)
- return null;
- var W = j.data || {}, K = W.value, Y = j.group, te = or(W, !0), Q = ee(j);
- return j ? /* @__PURE__ */ d.createElement("div", _e({
- "aria-label": typeof Q == "string" && !Y ? Q : null
- }, te, {
- key: D
- }, V(j, D), {
- "aria-selected": B(K)
- }), K) : null;
- }, J = {
- role: "listbox",
- id: "".concat(o, "_list")
- };
- return /* @__PURE__ */ d.createElement(d.Fragment, null, S && /* @__PURE__ */ d.createElement("div", _e({}, J, {
- style: {
- height: 0,
- width: 0,
- overflow: "hidden"
- }
- }), X(H - 1), X(H), X(H + 1)), /* @__PURE__ */ d.createElement(Zu, {
- itemKey: "key",
- ref: F,
- data: N,
- height: R,
- itemHeight: k,
- fullHeight: !1,
- onMouseDown: T,
- onScroll: C,
- virtual: S,
- direction: x,
- innerProps: S ? null : J
- }, function(M, D) {
- var j = M.group, W = M.groupOption, K = M.data, Y = M.label, te = M.value, Q = K.key;
- if (j) {
- var ae, ue = (ae = K.title) !== null && ae !== void 0 ? ae : Ks(Y) ? Y.toString() : void 0;
- return /* @__PURE__ */ d.createElement("div", {
- className: xe(O, "".concat(O, "-group"), K.className),
- title: ue
- }, Y !== void 0 ? Y : Q);
- }
- var se = K.disabled, pe = K.title;
- K.children;
- var oe = K.style, ve = K.className, ze = mt(K, yE), Re = Er(ze, le), Be = G(te), je = se || !Be && I, He = "".concat(O, "-option"), Ye = xe(O, He, ve, ie(ie(ie(ie({}, "".concat(He, "-grouped"), W), "".concat(He, "-active"), H === D && !je), "".concat(He, "-disabled"), je), "".concat(He, "-selected"), Be)), nt = ee(M), Ge = !y || typeof y == "function" || Be, Ne = typeof nt == "number" ? nt : nt || te, ce = Ks(Ne) ? Ne.toString() : void 0;
- return pe !== void 0 && (ce = pe), /* @__PURE__ */ d.createElement("div", _e({}, or(Re), S ? {} : V(M, D), {
- "aria-selected": B(te),
- className: Ye,
- title: ce,
- onMouseMove: function() {
- H === D || je || U(D);
- },
- onClick: function() {
- je || ne(te);
- },
- style: oe
- }), /* @__PURE__ */ d.createElement("div", {
- className: "".concat(He, "-content")
- }, typeof L == "function" ? L(M, {
- index: D
- }) : Ne), /* @__PURE__ */ d.isValidElement(y) || Be, Ge && /* @__PURE__ */ d.createElement(ei, {
- className: "".concat(O, "-option-state"),
- customizeIcon: y,
- customizeIconProps: {
- value: te,
- disabled: je,
- isSelected: Be
- }
- }, Be ? "✓" : null));
- }));
- }, CE = /* @__PURE__ */ d.forwardRef(bE);
- const SE = function(e, t) {
- var n = d.useRef({
- values: /* @__PURE__ */ new Map(),
- options: /* @__PURE__ */ new Map()
- }), r = d.useMemo(function() {
- var o = n.current, i = o.values, u = o.options, l = e.map(function(v) {
- if (v.label === void 0) {
- var C;
- return re(re({}, v), {}, {
- label: (C = i.get(v.value)) === null || C === void 0 ? void 0 : C.label
- });
- }
- return v;
- }), c = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
- return l.forEach(function(v) {
- c.set(v.value, v), s.set(v.value, t.get(v.value) || u.get(v.value));
- }), n.current.values = c, n.current.options = s, l;
- }, [e, t]), a = d.useCallback(function(o) {
- return t.get(o) || n.current.options.get(o);
- }, [t]);
- return [r, a];
- };
- function Ei(e, t) {
- return Hf(e).join("").toUpperCase().includes(t);
- }
- const wE = function(e, t, n, r, a) {
- return d.useMemo(function() {
- if (!n || r === !1)
- return e;
- var o = t.options, i = t.label, u = t.value, l = [], c = typeof r == "function", s = n.toUpperCase(), v = c ? r : function(p, m) {
- return a ? Ei(m[a], s) : m[o] ? Ei(m[i !== "children" ? i : "label"], s) : Ei(m[u], s);
- }, C = c ? function(p) {
- return fu(p);
- } : function(p) {
- return p;
- };
- return e.forEach(function(p) {
- if (p[o]) {
- var m = v(n, C(p));
- if (m)
- l.push(p);
- else {
- var b = p[o].filter(function(f) {
- return v(n, C(f));
- });
- b.length && l.push(re(re({}, p), {}, ie({}, o, b)));
- }
- return;
- }
- v(n, C(p)) && l.push(p);
- }), l;
- }, [e, r, a, n, t]);
- };
- var Ys = 0, xE = dn();
- function EE() {
- var e;
- return xE ? (e = Ys, Ys += 1) : e = "TEST_OR_SSR", e;
- }
- function RE(e) {
- var t = d.useState(), n = Z(t, 2), r = n[0], a = n[1];
- return d.useEffect(function() {
- a("rc_select_".concat(EE()));
- }, []), e || r;
- }
- var PE = ["children", "value"], ME = ["children"];
- function kE(e) {
- var t = e, n = t.key, r = t.props, a = r.children, o = r.value, i = mt(r, PE);
- return re({
- key: n,
- value: o !== void 0 ? o : n,
- children: a
- }, i);
- }
- function Yf(e) {
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
- return Oa(e).map(function(n, r) {
- if (!/* @__PURE__ */ d.isValidElement(n) || !n.type)
- return null;
- var a = n, o = a.type.isSelectOptGroup, i = a.key, u = a.props, l = u.children, c = mt(u, ME);
- return t || !o ? kE(n) : re(re({
- key: "__RC_SELECT_GRP__".concat(i === null ? r : i, "__"),
- label: i
- }, c), {}, {
- options: Yf(l)
- });
- }).filter(function(n) {
- return n;
- });
- }
- var DE = function(t, n, r, a, o) {
- return d.useMemo(function() {
- var i = t, u = !t;
- u && (i = Yf(n));
- var l = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), s = function(p, m, b) {
- b && typeof b == "string" && p.set(m[b], m);
- }, v = function C(p) {
- for (var m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, b = 0; b < p.length; b += 1) {
- var f = p[b];
- !f[r.options] || m ? (l.set(f[r.value], f), s(c, f, r.label), s(c, f, a), s(c, f, o)) : C(f[r.options], !0);
- }
- };
- return v(i), {
- options: i,
- valueOptions: l,
- labelOptions: c
- };
- }, [t, n, r, a, o]);
- };
- function Gs(e) {
- var t = d.useRef();
- t.current = e;
- var n = d.useCallback(function() {
- return t.current.apply(t, arguments);
- }, []);
- return n;
- }
- var NE = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "optionRender", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "labelRender", "value", "defaultValue", "labelInValue", "onChange", "maxCount"], IE = ["inputValue"];
- function OE(e) {
- return !e || _t(e) !== "object";
- }
- var _E = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n = e.id, r = e.mode, a = e.prefixCls, o = a === void 0 ? "rc-select" : a, i = e.backfill, u = e.fieldNames, l = e.inputValue, c = e.searchValue, s = e.onSearch, v = e.autoClearSearchValue, C = v === void 0 ? !0 : v, p = e.onSelect, m = e.onDeselect, b = e.dropdownMatchSelectWidth, f = b === void 0 ? !0 : b, h = e.filterOption, g = e.filterSort, y = e.optionFilterProp, w = e.optionLabelProp, E = e.options, S = e.optionRender, x = e.children, R = e.defaultActiveFirstOption, k = e.menuItemSelectedIcon, L = e.virtual, O = e.direction, N = e.listHeight, F = N === void 0 ? 200 : N, I = e.listItemHeight, T = I === void 0 ? 20 : I, P = e.labelRender, z = e.value, _ = e.defaultValue, A = e.labelInValue, H = e.onChange, $ = e.maxCount, U = mt(e, NE), G = RE(n), B = vu(r), ne = !!(!E && x), le = d.useMemo(function() {
- return h === void 0 && r === "combobox" ? !1 : h;
- }, [h, r]), ee = d.useMemo(
- function() {
- return Wf(u, ne);
- },
- /* eslint-disable react-hooks/exhaustive-deps */
- [
- // We stringify fieldNames to avoid unnecessary re-renders.
- JSON.stringify(u),
- ne
- ]
- /* eslint-enable react-hooks/exhaustive-deps */
- ), V = Gt("", {
- value: c !== void 0 ? c : l,
- postState: function(Oe) {
- return Oe || "";
- }
- }), X = Z(V, 2), J = X[0], M = X[1], D = DE(E, x, ee, y, w), j = D.valueOptions, W = D.labelOptions, K = D.options, Y = d.useCallback(function(Ie) {
- var Oe = Hf(Ie);
- return Oe.map(function(We) {
- var Ue, Ze, at, Lt, Et;
- if (OE(We))
- Ue = We;
- else {
- var wt;
- at = We.key, Ze = We.label, Ue = (wt = We.value) !== null && wt !== void 0 ? wt : at;
- }
- var pt = j.get(Ue);
- if (pt) {
- var xt;
- Ze === void 0 && (Ze = pt == null ? void 0 : pt[w || ee.label]), at === void 0 && (at = (xt = pt == null ? void 0 : pt.key) !== null && xt !== void 0 ? xt : Ue), Lt = pt == null ? void 0 : pt.disabled, Et = pt == null ? void 0 : pt.title;
- }
- return {
- label: Ze,
- value: Ue,
- key: at,
- disabled: Lt,
- title: Et
- };
- });
- }, [ee, w, j]), te = Gt(_, {
- value: z
- }), Q = Z(te, 2), ae = Q[0], ue = Q[1], se = d.useMemo(function() {
- var Ie, Oe = B && ae === null ? [] : ae, We = Y(Oe);
- return r === "combobox" && Ax((Ie = We[0]) === null || Ie === void 0 ? void 0 : Ie.value) ? [] : We;
- }, [ae, Y, r, B]), pe = SE(se, j), oe = Z(pe, 2), ve = oe[0], ze = oe[1], Re = d.useMemo(function() {
- if (!r && ve.length === 1) {
- var Ie = ve[0];
- if (Ie.value === null && (Ie.label === null || Ie.label === void 0))
- return [];
- }
- return ve.map(function(Oe) {
- var We;
- return re(re({}, Oe), {}, {
- label: (We = typeof P == "function" ? P(Oe) : Oe.label) !== null && We !== void 0 ? We : Oe.value
- });
- });
- }, [r, ve, P]), Be = d.useMemo(function() {
- return new Set(ve.map(function(Ie) {
- return Ie.value;
- }));
- }, [ve]);
- d.useEffect(function() {
- if (r === "combobox") {
- var Ie, Oe = (Ie = ve[0]) === null || Ie === void 0 ? void 0 : Ie.value;
- M($x(Oe) ? String(Oe) : "");
- }
- }, [ve]);
- var je = Gs(function(Ie, Oe) {
- var We = Oe != null ? Oe : Ie;
- return ie(ie({}, ee.value, Ie), ee.label, We);
- }), He = d.useMemo(function() {
- if (r !== "tags")
- return K;
- var Ie = ft(K), Oe = function(Ue) {
- return j.has(Ue);
- };
- return ft(ve).sort(function(We, Ue) {
- return We.value < Ue.value ? -1 : 1;
- }).forEach(function(We) {
- var Ue = We.value;
- Oe(Ue) || Ie.push(je(Ue, We.label));
- }), Ie;
- }, [je, K, j, ve, r]), Ye = wE(He, ee, J, le, y), nt = d.useMemo(function() {
- return r !== "tags" || !J || Ye.some(function(Ie) {
- return Ie[y || "value"] === J;
- }) || Ye.some(function(Ie) {
- return Ie[ee.value] === J;
- }) ? Ye : [je(J)].concat(ft(Ye));
- }, [je, y, r, Ye, J, ee]), Ge = function Ie(Oe) {
- var We = ft(Oe).sort(function(Ue, Ze) {
- return g(Ue, Ze, {
- searchValue: J
- });
- });
- return We.map(function(Ue) {
- return Array.isArray(Ue.options) ? re(re({}, Ue), {}, {
- options: Ue.options.length > 0 ? Ie(Ue.options) : Ue.options
- }) : Ue;
- });
- }, Ne = d.useMemo(function() {
- return g ? Ge(nt) : nt;
- }, [nt, g, J]), ce = d.useMemo(function() {
- return Gx(Ne, {
- fieldNames: ee,
- childrenAsData: ne
- });
- }, [Ne, ee, ne]), he = function(Oe) {
- var We = Y(Oe);
- if (ue(We), H && // Trigger event only when value changed
- (We.length !== ve.length || We.some(function(at, Lt) {
- var Et;
- return ((Et = ve[Lt]) === null || Et === void 0 ? void 0 : Et.value) !== (at == null ? void 0 : at.value);
- }))) {
- var Ue = A ? We : We.map(function(at) {
- return at.value;
- }), Ze = We.map(function(at) {
- return fu(ze(at.value));
- });
- H(
- // Value
- B ? Ue : Ue[0],
- // Option
- B ? Ze : Ze[0]
- );
- }
- }, Ve = d.useState(null), de = Z(Ve, 2), be = de[0], Xe = de[1], it = d.useState(0), tt = Z(it, 2), $e = tt[0], ge = tt[1], ke = R !== void 0 ? R : r !== "combobox", Te = d.useCallback(function(Ie, Oe) {
- var We = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, Ue = We.source, Ze = Ue === void 0 ? "keyboard" : Ue;
- ge(Oe), i && r === "combobox" && Ie !== null && Ze === "keyboard" && Xe(String(Ie));
- }, [i, r]), Ke = function(Oe, We, Ue) {
- var Ze = function() {
- var Le, Pe = ze(Oe);
- return [A ? {
- label: Pe == null ? void 0 : Pe[ee.label],
- value: Oe,
- key: (Le = Pe == null ? void 0 : Pe.key) !== null && Le !== void 0 ? Le : Oe
- } : Oe, fu(Pe)];
- };
- if (We && p) {
- var at = Ze(), Lt = Z(at, 2), Et = Lt[0], wt = Lt[1];
- p(Et, wt);
- } else if (!We && m && Ue !== "clear") {
- var pt = Ze(), xt = Z(pt, 2), Ft = xt[0], Mt = xt[1];
- m(Ft, Mt);
- }
- }, De = Gs(function(Ie, Oe) {
- var We, Ue = B ? Oe.selected : !0;
- Ue ? We = B ? [].concat(ft(ve), [Ie]) : [Ie] : We = ve.filter(function(Ze) {
- return Ze.value !== Ie;
- }), he(We), Ke(Ie, Ue), r === "combobox" ? Xe("") : (!vu || C) && (M(""), Xe(""));
- }), we = function(Oe, We) {
- he(Oe);
- var Ue = We.type, Ze = We.values;
- (Ue === "remove" || Ue === "clear") && Ze.forEach(function(at) {
- Ke(at.value, !1, Ue);
- });
- }, ye = function(Oe, We) {
- if (M(Oe), Xe(null), We.source === "submit") {
- var Ue = (Oe || "").trim();
- if (Ue) {
- var Ze = Array.from(new Set([].concat(ft(Be), [Ue])));
- he(Ze), Ke(Ue, !0), M("");
- }
- return;
- }
- We.source !== "blur" && (r === "combobox" && he(Oe), s == null || s(Oe));
- }, ut = function(Oe) {
- var We = Oe;
- r !== "tags" && (We = Oe.map(function(Ze) {
- var at = W.get(Ze);
- return at == null ? void 0 : at.value;
- }).filter(function(Ze) {
- return Ze !== void 0;
- }));
- var Ue = Array.from(new Set([].concat(ft(Be), ft(We))));
- he(Ue), Ue.forEach(function(Ze) {
- Ke(Ze, !0);
- });
- }, yt = d.useMemo(function() {
- var Ie = L !== !1 && f !== !1;
- return re(re({}, D), {}, {
- flattenOptions: ce,
- onActiveValue: Te,
- defaultActiveFirstOption: ke,
- onSelect: De,
- menuItemSelectedIcon: k,
- rawValues: Be,
- fieldNames: ee,
- virtual: Ie,
- direction: O,
- listHeight: F,
- listItemHeight: T,
- childrenAsData: ne,
- maxCount: $,
- optionRender: S
- });
- }, [$, D, ce, Te, ke, De, k, Be, ee, L, f, O, F, T, ne, S]);
- return /* @__PURE__ */ d.createElement(Xu.Provider, {
- value: yt
- }, /* @__PURE__ */ d.createElement(eE, _e({}, U, {
- // >>> MISC
- id: G,
- prefixCls: o,
- ref: t,
- omitDomProps: IE,
- mode: r,
- displayValues: Re,
- onDisplayValuesChange: we,
- direction: O,
- searchValue: J,
- onSearch: ye,
- autoClearSearchValue: C,
- onSearchSplit: ut,
- dropdownMatchSelectWidth: f,
- OptionList: CE,
- emptyOptions: !ce.length,
- activeValue: be,
- activeDescendantId: "".concat(G, "_list_").concat($e)
- })));
- }), Qu = _E;
- Qu.Option = Uf;
- Qu.OptGroup = Bf;
- const LE = "univer-select", TE = "univer-select-disabled", $E = "univer-select-selector", AE = "univer-select-show-arrow", jE = "univer-select-loading", FE = "univer-select-arrow-icon", zE = "univer-select-loading-icon", HE = "univer-select-selection-placeholder", VE = "univer-select-selection-search-input", WE = "univer-select-single", BE = "univer-select-selection-search", UE = "univer-select-selection-item", qE = "univer-select-customize-input", KE = "univer-select-multiple", YE = "univer-select-selection-item-disabled", GE = "univer-select-selection-overflow", XE = "univer-select-selection-overflow-item", ZE = "univer-select-selection-search-mirror", QE = "univer-select-borderless", JE = "univer-select-focused", eR = "univer-select-allow-clear", tR = "univer-select-clear", nR = "univer-select-arrow", rR = "univer-select-dropdown", aR = "univer-select-dropdown-hidden", oR = "univer-select-item", iR = "univer-select-item-group", uR = "univer-select-item-option", lR = "univer-select-item-option-state", sR = "univer-select-item-option-active", cR = "univer-select-item-option-disabled", dR = "univer-select-item-empty", fR = "univer-select-selection__choice-zoom", vR = "univer-select-selection__choice-zoom-appear", mR = "univer-select-selection__choice-zoom-appear-active", pR = "univer-select-selection__choice-zoom-leave", hR = "univer-select-selection__choice-zoom-leave-active", gR = "univer-select-dropdown-slide-up-enter", yR = "univer-select-dropdown-slide-up-appear", bR = "univer-select-dropdown-slide-up-leave", CR = "univer-select-dropdown-slide-up-enter-active", SR = "univer-select-dropdown-placement-bottomLeft", wR = "univer-select-dropdown-slide-up-appear-active", xR = "univer-select-dropdown-placement-bottomRight", ER = "univer-select-dropdown-slide-up-in", RR = "univer-select-dropdown-slide-up-leave-active", PR = "univer-select-dropdown-slide-up-out", MR = "univer-select-dropdown-placement-topLeft", kR = "univer-select-dropdown-placement-topRight", DR = "univer-select-dropdown-slide-down-in", NR = "univer-select-dropdown-slide-down-out", Xs = {
- select: LE,
- selectDisabled: TE,
- selectSelector: $E,
- selectShowArrow: AE,
- selectLoading: jE,
- selectArrowIcon: FE,
- selectLoadingIcon: zE,
- selectSelectionPlaceholder: HE,
- selectSelectionSearchInput: VE,
- selectSingle: WE,
- selectSelectionSearch: BE,
- selectSelectionItem: UE,
- selectCustomizeInput: qE,
- selectMultiple: KE,
- selectSelectionItemDisabled: YE,
- selectSelectionOverflow: GE,
- selectSelectionOverflowItem: XE,
- selectSelectionSearchMirror: ZE,
- selectBorderless: QE,
- selectFocused: JE,
- selectAllowClear: eR,
- selectClear: tR,
- selectArrow: nR,
- selectDropdown: rR,
- selectDropdownHidden: aR,
- selectItem: oR,
- selectItemGroup: iR,
- selectItemOption: uR,
- selectItemOptionState: lR,
- selectItemOptionActive: sR,
- selectItemOptionDisabled: cR,
- selectItemEmpty: dR,
- selectSelectionChoiceZoom: fR,
- selectSelectionChoiceZoomAppear: vR,
- selectSelectionChoiceZoomAppearActive: mR,
- selectSelectionChoiceZoomLeave: pR,
- selectSelectionChoiceZoomLeaveActive: hR,
- selectDropdownSlideUpEnter: gR,
- selectDropdownSlideUpAppear: yR,
- selectDropdownSlideUpLeave: bR,
- selectDropdownSlideUpEnterActive: CR,
- selectDropdownPlacementBottomLeft: SR,
- selectDropdownSlideUpAppearActive: wR,
- selectDropdownPlacementBottomRight: xR,
- selectDropdownSlideUpIn: ER,
- selectDropdownSlideUpLeaveActive: RR,
- selectDropdownSlideUpOut: PR,
- selectDropdownPlacementTopLeft: MR,
- selectDropdownPlacementTopRight: kR,
- selectDropdownSlideDownIn: DR,
- selectDropdownSlideDownOut: NR
- };
- function r_(e) {
- const {
- value: t,
- options: n = [],
- onChange: r,
- style: a,
- className: o,
- mode: i,
- borderless: u = !1,
- dropdownRender: l,
- labelRender: c,
- open: s,
- dropdownStyle: v,
- onDropdownVisibleChange: C,
- disabled: p
- } = e, { mountContainer: m, locale: b } = Sn(In), f = jt(o, {
- [Xs.selectBorderless]: u
- });
- return m && /* @__PURE__ */ q.jsx(
- Qu,
- {
- mode: i,
- prefixCls: Xs.select,
- getPopupContainer: () => m,
- options: n,
- value: t,
- menuItemSelectedIcon: null,
- suffixIcon: /* @__PURE__ */ q.jsx(Dc, {}),
- onChange: r,
- style: a,
- className: f,
- dropdownRender: l,
- labelRender: c,
- open: s,
- dropdownStyle: v,
- onDropdownVisibleChange: C,
- notFoundContent: b == null ? void 0 : b.Select.empty,
- disabled: p
- }
- );
- }
- const IR = "univer-select-list", OR = "univer-select-list-item", _R = "univer-select-list-item-icon", LR = "univer-select-list-item-select", so = {
- selectList: IR,
- selectListItem: OR,
- selectListItemIcon: _R,
- selectListItemSelect: LR
- };
- function a_(e) {
- const { value: t, options: n = [], hideCheckMark: r = !1, onChange: a, multiple: o, className: i, optionClassName: u } = e, l = Array.isArray(t) ? t : [t];
- function c(s) {
- const v = l.indexOf(s);
- o ? v > -1 ? a(l.filter((C) => C === s)) : a([...l, s]) : v > -1 ? a(void 0) : a(s);
- }
- return /* @__PURE__ */ q.jsx("ul", { className: jt(so.selectList, i), children: n.map((s, v) => {
- const C = l.indexOf(s.value) > -1;
- return /* @__PURE__ */ q.jsx(
- "li",
- {
- className: jt(so.selectListItem, u, { [so.selectListItemSelect]: C }),
- children: /* @__PURE__ */ q.jsxs("a", { onClick: () => c(s.value), children: [
- !r && /* @__PURE__ */ q.jsx("span", { className: so.selectListItemIcon, children: C && /* @__PURE__ */ q.jsx(Ao, {}) }),
- /* @__PURE__ */ q.jsx("span", { style: { color: s.color }, children: s.label })
- ] })
- },
- v
- );
- }) });
- }
- var Zs = function(t, n) {
- if (!t) return null;
- var r = {
- left: t.offsetLeft,
- right: t.parentElement.clientWidth - t.clientWidth - t.offsetLeft,
- width: t.clientWidth,
- top: t.offsetTop,
- bottom: t.parentElement.clientHeight - t.clientHeight - t.offsetTop,
- height: t.clientHeight
- };
- return n ? {
- left: 0,
- right: 0,
- width: 0,
- top: r.top,
- bottom: r.bottom,
- height: r.height
- } : {
- left: r.left,
- right: r.right,
- width: r.width,
- top: 0,
- bottom: 0,
- height: 0
- };
- }, Tn = function(t) {
- return t !== void 0 ? "".concat(t, "px") : void 0;
- };
- function TR(e) {
- var t = e.prefixCls, n = e.containerRef, r = e.value, a = e.getValueIndex, o = e.motionName, i = e.onMotionStart, u = e.onMotionEnd, l = e.direction, c = e.vertical, s = c === void 0 ? !1 : c, v = d.useRef(null), C = d.useState(r), p = nn(C, 2), m = p[0], b = p[1], f = function(T) {
- var P, z = a(T), _ = (P = n.current) === null || P === void 0 ? void 0 : P.querySelectorAll(".".concat(t, "-item"))[z];
- return (_ == null ? void 0 : _.offsetParent) && _;
- }, h = d.useState(null), g = nn(h, 2), y = g[0], w = g[1], E = d.useState(null), S = nn(E, 2), x = S[0], R = S[1];
- St(function() {
- if (m !== r) {
- var I = f(m), T = f(r), P = Zs(I, s), z = Zs(T, s);
- b(r), w(P), R(z), I && T ? i() : u();
- }
- }, [r]);
- var k = d.useMemo(function() {
- if (s) {
- var I;
- return Tn((I = y == null ? void 0 : y.top) !== null && I !== void 0 ? I : 0);
- }
- return Tn(l === "rtl" ? -(y == null ? void 0 : y.right) : y == null ? void 0 : y.left);
- }, [s, l, y]), L = d.useMemo(function() {
- if (s) {
- var I;
- return Tn((I = x == null ? void 0 : x.top) !== null && I !== void 0 ? I : 0);
- }
- return Tn(l === "rtl" ? -(x == null ? void 0 : x.right) : x == null ? void 0 : x.left);
- }, [s, l, x]), O = function() {
- return s ? {
- transform: "translateY(var(--thumb-start-top))",
- height: "var(--thumb-start-height)"
- } : {
- transform: "translateX(var(--thumb-start-left))",
- width: "var(--thumb-start-width)"
- };
- }, N = function() {
- return s ? {
- transform: "translateY(var(--thumb-active-top))",
- height: "var(--thumb-active-height)"
- } : {
- transform: "translateX(var(--thumb-active-left))",
- width: "var(--thumb-active-width)"
- };
- }, F = function() {
- w(null), R(null), u();
- };
- return !y || !x ? null : /* @__PURE__ */ d.createElement(zo, {
- visible: !0,
- motionName: o,
- motionAppear: !0,
- onAppearStart: O,
- onAppearActive: N,
- onVisibleChanged: F
- }, function(I, T) {
- var P = I.className, z = I.style, _ = et(et({}, z), {}, {
- "--thumb-start-left": k,
- "--thumb-start-width": Tn(y == null ? void 0 : y.width),
- "--thumb-active-left": L,
- "--thumb-active-width": Tn(x == null ? void 0 : x.width),
- "--thumb-start-top": k,
- "--thumb-start-height": Tn(y == null ? void 0 : y.height),
- "--thumb-active-top": L,
- "--thumb-active-height": Tn(x == null ? void 0 : x.height)
- }), A = {
- ref: lr(v, T),
- style: _,
- className: xe("".concat(t, "-thumb"), P)
- };
- return /* @__PURE__ */ d.createElement("div", A);
- });
- }
- var $R = ["prefixCls", "direction", "vertical", "options", "disabled", "defaultValue", "value", "onChange", "className", "motionName"];
- function AR(e) {
- if (typeof e.title < "u")
- return e.title;
- if (fn(e.label) !== "object") {
- var t;
- return (t = e.label) === null || t === void 0 ? void 0 : t.toString();
- }
- }
- function jR(e) {
- return e.map(function(t) {
- if (fn(t) === "object" && t !== null) {
- var n = AR(t);
- return et(et({}, t), {}, {
- title: n
- });
- }
- return {
- label: t == null ? void 0 : t.toString(),
- title: t == null ? void 0 : t.toString(),
- value: t
- };
- });
- }
- var FR = function(t) {
- var n = t.prefixCls, r = t.className, a = t.disabled, o = t.checked, i = t.label, u = t.title, l = t.value, c = t.onChange, s = function(C) {
- a || c(C, l);
- };
- return /* @__PURE__ */ d.createElement("label", {
- className: xe(r, At({}, "".concat(n, "-item-disabled"), a))
- }, /* @__PURE__ */ d.createElement("input", {
- className: "".concat(n, "-item-input"),
- type: "radio",
- disabled: a,
- checked: o,
- onChange: s
- }), /* @__PURE__ */ d.createElement("div", {
- className: "".concat(n, "-item-label"),
- title: u,
- role: "option",
- "aria-selected": o
- }, i));
- }, zR = /* @__PURE__ */ d.forwardRef(function(e, t) {
- var n, r, a = e.prefixCls, o = a === void 0 ? "rc-segmented" : a, i = e.direction, u = e.vertical, l = e.options, c = l === void 0 ? [] : l, s = e.disabled, v = e.defaultValue, C = e.value, p = e.onChange, m = e.className, b = m === void 0 ? "" : m, f = e.motionName, h = f === void 0 ? "thumb-motion" : f, g = $i(e, $R), y = d.useRef(null), w = d.useMemo(function() {
- return lr(y, t);
- }, [y, t]), E = d.useMemo(function() {
- return jR(c);
- }, [c]), S = Gt((n = E[0]) === null || n === void 0 ? void 0 : n.value, {
- value: C,
- defaultValue: v
- }), x = nn(S, 2), R = x[0], k = x[1], L = d.useState(!1), O = nn(L, 2), N = O[0], F = O[1], I = function(z, _) {
- s || (k(_), p == null || p(_));
- }, T = Er(g, ["children"]);
- return /* @__PURE__ */ d.createElement("div", sn({
- role: "listbox",
- "aria-label": "segmented control"
- }, T, {
- className: xe(o, (r = {}, At(r, "".concat(o, "-rtl"), i === "rtl"), At(r, "".concat(o, "-disabled"), s), At(r, "".concat(o, "-vertical"), u), r), b),
- ref: w
- }), /* @__PURE__ */ d.createElement("div", {
- className: "".concat(o, "-group")
- }, /* @__PURE__ */ d.createElement(TR, {
- vertical: u,
- prefixCls: o,
- value: R,
- containerRef: y,
- motionName: "".concat(o, "-").concat(h),
- direction: i,
- getValueIndex: function(z) {
- return E.findIndex(function(_) {
- return _.value === z;
- });
- },
- onMotionStart: function() {
- F(!0);
- },
- onMotionEnd: function() {
- F(!1);
- }
- }), E.map(function(P) {
- return /* @__PURE__ */ d.createElement(FR, sn({}, P, {
- key: P.value,
- prefixCls: o,
- className: xe(P.className, "".concat(o, "-item"), At({}, "".concat(o, "-item-selected"), P.value === R && !N)),
- checked: P.value === R,
- onChange: I,
- disabled: !!s || !!P.disabled
- }));
- })));
- }), HR = zR;
- const VR = "univer-segmented", WR = "univer-segmented-group", BR = "univer-segmented-item", UR = "univer-segmented-item-selected", qR = "univer-segmented-item-disabled", KR = "univer-segmented-item-label", YR = "univer-segmented-item-input", GR = "univer-segmented-disabled", XR = "univer-segmented-thumb", ZR = "univer-segmented-thumb-motion-appear-active", QR = "univer-segmented-thumb-motion-enter-active", JR = "univer-segmented-rtl", eP = {
- segmented: VR,
- segmentedGroup: WR,
- segmentedItem: BR,
- segmentedItemSelected: UR,
- segmentedItemDisabled: qR,
- segmentedItemLabel: KR,
- segmentedItemInput: YR,
- segmentedDisabled: GR,
- segmentedThumb: XR,
- segmentedThumbMotionAppearActive: ZR,
- segmentedThumbMotionEnterActive: QR,
- segmentedRtl: JR
- }, o_ = $t(function(t, n) {
- return /* @__PURE__ */ q.jsx(HR, { prefixCls: eP.segmented, ...t, ref: n });
- });
- function Gf({ visible: e, asChild: t = !1, title: n, children: r, placement: a = "bottom", showIfEllipsis: o = !1, onVisibleChange: i }) {
- if (!Kr || n === void 0)
- return null;
- const [u, l] = rt(!1), [c, s] = rt({ x: 0, y: 0 }), [v, C] = rt(a), p = Ce(null), m = Ce(null), [b, f] = rt(0), [h, g] = rt(!1), y = e !== void 0, w = y ? e : h, E = (R) => {
- y || g(R), i == null || i(R);
- }, S = () => {
- if (!p.current || !m.current) return;
- const R = p.current.getBoundingClientRect(), k = m.current.getBoundingClientRect(), L = window.scrollX, O = window.scrollY, N = 8, F = 12;
- let I = a, T = 0;
- const P = () => {
- switch (I) {
- case "top":
- return {
- x: R.left + (R.width - k.width) / 2,
- y: R.top - k.height - N
- };
- case "bottom":
- return {
- x: R.left + (R.width - k.width) / 2,
- y: R.bottom + N
- };
- case "left":
- return {
- x: R.left - k.width - N,
- y: R.top + (R.height - k.height) / 2
- };
- case "right":
- return {
- x: R.right + N,
- y: R.top + (R.height - k.height) / 2
- };
- }
- }, z = (H) => {
- switch (I) {
- case "top":
- return H.y < N;
- case "bottom":
- return H.y + k.height > window.innerHeight - N;
- case "left":
- return H.x < N;
- case "right":
- return H.x + k.width > window.innerWidth - N;
- }
- }, _ = () => ({
- top: "bottom",
- bottom: "top",
- left: "right",
- right: "left"
- })[I];
- let A = P();
- if (z(A))
- I = _(), A = P();
- else if (["top", "bottom"].includes(I)) {
- const H = N, $ = window.innerWidth - k.width - N;
- A.x < H ? (T = A.x - H, A.x = H) : A.x > $ && (T = A.x - $, A.x = $);
- const U = k.width / 2 - F;
- T = Math.max(Math.min(T, U), -U);
- } else {
- const H = N, $ = window.innerHeight - k.height - N;
- A.y < H ? (T = A.y - H, A.y = H) : A.y > $ && (T = A.y - $, A.y = $);
- const U = k.height / 2 - F;
- T = Math.max(Math.min(T, U), -U);
- }
- A.x += L, A.y += O, s(A), C(I), f(T), l(!0);
- };
- lt(() => {
- if (w) {
- l(!1), requestAnimationFrame(() => {
- S();
- });
- const R = () => {
- l(!1), requestAnimationFrame(S);
- };
- return window.addEventListener("scroll", R), window.addEventListener("resize", R), () => {
- window.removeEventListener("scroll", R), window.removeEventListener("resize", R);
- };
- }
- }, [w]), lt(() => {
- const R = p.current;
- if (!R)
- return;
- const k = t ? R : R.firstElementChild;
- function L(F) {
- return Math.abs(F.scrollWidth - F.clientWidth) > 1;
- }
- function O() {
- o && k && !L(k) || E(!0);
- }
- function N() {
- E(!1), l(!1);
- }
- if (!(y && !i))
- return R.addEventListener("mouseenter", O), R.addEventListener("mouseleave", N), () => {
- R.removeEventListener("mouseenter", O), R.removeEventListener("mouseleave", N);
- };
- }, [t, o, y, i]), lt(() => {
- y && (e ? (l(!1), requestAnimationFrame(() => {
- S();
- })) : l(!1));
- }, [e, y]);
- const x = me.cloneElement(
- // eslint-disable-next-line react/no-children-only
- me.Children.only(r),
- {
- ref: p
- }
- );
- return /* @__PURE__ */ q.jsxs(q.Fragment, { children: [
- t ? x : /* @__PURE__ */ q.jsx("div", { ref: p, className: "univer-inline-block", children: r }),
- w && $a(
- /* @__PURE__ */ q.jsx(
- "div",
- {
- ref: m,
- className: Na(`
- univer-pointer-events-none univer-fixed univer-z-[1100] univer-font-sans univer-opacity-0
- univer-duration-200 univer-animate-in univer-fade-in-0 univer-zoom-in-95
- `, {
- "univer-opacity-100": u,
- "univer-slide-in-from-bottom-2": v === "top" && u,
- "univer-slide-in-from-top-2": v === "bottom" && u,
- "univer-slide-in-from-right-2": v === "left" && u,
- "univer-slide-in-from-left-2": v === "right" && u
- }),
- "data-state": w ? "open" : "closed",
- style: {
- left: c.x,
- top: c.y,
- transition: "opacity 150ms ease-out"
- },
- children: /* @__PURE__ */ q.jsxs("div", { className: "univer-relative", children: [
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: `
- univer-w-fit univer-max-w-[192px] univer-break-words univer-rounded-lg univer-bg-gray-700
- univer-px-3 univer-py-2.5 univer-text-xs univer-font-medium univer-text-white
- `,
- children: n
- }
- ),
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: Na("univer-absolute univer-h-2 univer-w-2 univer-rotate-45 univer-bg-gray-700", {
- "-univer-bottom-1 univer-left-1/2 -univer-translate-x-1/2": v === "top",
- "-univer-top-1 univer-left-1/2 -univer-translate-x-1/2": v === "bottom",
- "-univer-right-1 univer-top-1/2 -univer-translate-y-1/2": v === "left",
- "-univer-left-1 univer-top-1/2 -univer-translate-y-1/2": v === "right"
- }),
- style: {
- ...v === "top" && {
- "--tw-translate-x": `calc(-50% + ${b}px)`
- },
- ...v === "bottom" && {
- "--tw-translate-x": `calc(-50% + ${b}px)`
- },
- ...v === "left" && {
- "--tw-translate-y": `calc(-50% + ${b}px)`
- },
- ...v === "right" && {
- "--tw-translate-y": `calc(-50% + ${b}px)`
- }
- }
- }
- )
- ] })
- }
- ),
- document.body
- )
- ] });
- }
- const tP = "116", nP = "12", rP = "univer-slider", aP = "univer-slider-disabled", oP = "univer-slider-rail", iP = "univer-slider-handle", uP = "univer-slider-reset-point", lP = "univer-slider-value", sP = "univer-slider-inner-rail", cP = "univer-dropdown-open", dP = "univer-slider-shortcuts", fP = "univer-slider-shortcut", vP = "univer-slider-shortcut-icon", mP = "univer-slider-shortcut-active", $n = {
- sliderWidth: tP,
- sliderHandleSize: nP,
- slider: rP,
- sliderDisabled: aP,
- sliderRail: oP,
- sliderHandle: iP,
- sliderResetPoint: uP,
- sliderValue: lP,
- sliderInnerRail: sP,
- dropdownOpen: cP,
- sliderShortcuts: dP,
- sliderShortcut: fP,
- sliderShortcutIcon: vP,
- sliderShortcutActive: mP
- };
- function i_(e) {
- const { value: t, min: n = 0, max: r = 400, disabled: a = !1, resetPoint: o = 100, shortcuts: i, onChange: u } = e, l = Ce(null), { locale: c } = Sn(In);
- function s() {
- a || u && u(o);
- }
- function v(m) {
- if (a) return;
- let b = t + m;
- t + m <= n ? b = n : t + m >= r && (b = r), u && u(b);
- }
- const C = Ht(() => {
- if (t <= o) {
- const m = 50 / (o - n);
- return (t - n) * m;
- }
- if (t <= r)
- return o * 0.5 + (t - o) / (r - o) * 50;
- }, [n, r, o, t]);
- function p(m) {
- if (a) return;
- m.preventDefault();
- const b = l.current;
- let f = !0;
- function h(w) {
- if (f) {
- let S = w.clientX - b.getBoundingClientRect().x;
- S <= 0 ? S = 0 : S >= 116 && (S = 116);
- const x = S / 116;
- let R = 0;
- x <= 0.5 ? R = n + x * (o - n) * 2 : R = o + (x - 0.5) * (r - o) * 2, u && u(Math.ceil(R));
- }
- }
- function g() {
- f = !1, document.removeEventListener("pointermove", h), window.removeEventListener("pointerup", g);
- }
- function y(w) {
- w.relatedTarget === null && g();
- }
- window.addEventListener("pointermove", h), window.addEventListener("pointerup", g), window.addEventListener("pointerout", y);
- }
- return /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: jt($n.slider, {
- [$n.sliderDisabled]: a
- }),
- children: [
- /* @__PURE__ */ q.jsx(Po, { type: "text", size: "small", disabled: t <= n || a, onClick: () => v(-10), children: /* @__PURE__ */ q.jsx(_c, {}) }),
- /* @__PURE__ */ q.jsx("div", { className: $n.sliderRail, children: /* @__PURE__ */ q.jsxs("div", { ref: l, role: "track", className: $n.sliderInnerRail, children: [
- /* @__PURE__ */ q.jsx(Gf, { title: `${c == null ? void 0 : c.Slider.resetTo} ${o}%`, placement: "top", asChild: !0, children: /* @__PURE__ */ q.jsx(
- "a",
- {
- className: `
- univer-cursor-pointer univer-absolute univer-left-1/2 univer-top-1/2
- -univer-translate-x-1/2 -univer-translate-y-1/2 univer-box-border univer-w-0.5
- univer-h-0.5 univer-bg-white univer-rounded-full univer-block
- `,
- role: "button",
- onClick: s
- },
- "reset-button"
- ) }),
- /* @__PURE__ */ q.jsx(
- "div",
- {
- className: $n.sliderHandle,
- role: "handle",
- style: {
- left: `${C}%`
- },
- onPointerDown: p
- }
- )
- ] }) }),
- /* @__PURE__ */ q.jsx(Po, { type: "text", size: "small", disabled: t >= r || a, onClick: () => v(10), children: /* @__PURE__ */ q.jsx(Pc, {}) }),
- /* @__PURE__ */ q.jsx(
- sC,
- {
- placement: "topLeft",
- overlay: /* @__PURE__ */ q.jsx("div", { className: $n.sliderShortcuts, children: i == null ? void 0 : i.map((m) => /* @__PURE__ */ q.jsxs(
- "a",
- {
- className: jt(
- $n.sliderShortcut,
- m === t ? $n.sliderShortcutActive : ""
- ),
- onClick: () => u && u(m),
- children: [
- m === t && /* @__PURE__ */ q.jsx("span", { className: $n.sliderShortcutIcon, children: /* @__PURE__ */ q.jsx(Ao, {}) }),
- /* @__PURE__ */ q.jsxs("span", { children: [
- m,
- "%"
- ] })
- ]
- },
- m
- )) }),
- children: /* @__PURE__ */ q.jsxs("a", { className: $n.sliderValue, children: [
- t,
- "%"
- ] })
- }
- )
- ]
- }
- );
- }
- const pP = "univer-tree", hP = "univer-tree-icon", gP = "univer-tree-icon-expand", yP = "univer-tree-list", bP = "univer-tree-list-expand", CP = "univer-tree-list-item", SP = "univer-tree-list-item-title", wP = "univer-tree-list-item-content", xP = "univer-tree-list-item-content-selected-icon", Qn = {
- tree: pP,
- treeIcon: hP,
- treeIconExpand: gP,
- treeList: yP,
- treeListExpand: bP,
- treeListItem: CP,
- treeListItemTitle: SP,
- treeListItemContent: wP,
- treeListItemContentSelectedIcon: xP
- }, EP = (e, t) => {
- const n = [], r = (a) => {
- var o;
- if (n.push(a.key), t === a.key || (o = a.children) != null && o.length && a.children.some(r))
- return !0;
- n.pop();
- };
- return e.some(r), n;
- }, Xf = (e, t) => {
- const n = t != null ? t : /* @__PURE__ */ new Map();
- let r = e;
- return {
- findNodePathFromTreeWithCache: (a) => {
- const o = n.get(a);
- if (o)
- return o;
- const i = EP(r, a);
- return i.map((l, c, s) => {
- const v = [];
- for (let C = 0; C <= c; C++)
- v.push(s[C]);
- return v;
- }).reverse().forEach((l) => {
- const c = l[l.length - 1];
- n.set(c, l);
- }), i;
- },
- reset: (a) => {
- n.clear(), a && (r = a);
- }
- };
- }, mu = (e, t) => t.length ? t.reduce((n, r) => {
- const a = n.find((o) => o.key === r);
- return (a == null ? void 0 : a.children) || [];
- }, e) : e, RP = (e, t) => {
- const n = t.slice(0), r = n.pop();
- return mu(e, n).find((o) => o.key === r);
- }, u_ = (e, t, n) => {
- const r = new Set(t), a = n[n.length - 1], o = mu(e, n);
- if (r.has(a)) {
- if (o.length) {
- const u = (l) => {
- r.delete(l.key), l.children && l.children.forEach((c) => u(c));
- };
- o.forEach(u);
- }
- n.map((u, l, c) => {
- const s = [];
- for (let v = 0; v <= l; v++)
- s.push(c[v]);
- return s;
- }).reverse().some((u) => {
- const l = mu(e, u), c = u[u.length - 1];
- if (l.every((s) => !r.has(s.key)))
- r.delete(c);
- else
- return !0;
- return !1;
- });
- } else {
- const i = (u) => {
- r.add(u.key), u.children && u.children.forEach((l) => i(l));
- };
- n.forEach((u) => r.add(u)), o.length && o.forEach(i);
- }
- return [...r];
- }, PP = (e, t) => {
- const n = t.children || [], r = (a) => {
- var o;
- return (o = a.children) != null && o.length ? !!a.children.every(r) : e.has(a.key);
- };
- return n.length ? n.some((a) => !r(a)) : !1;
- }, l_ = (e, t) => {
- const n = [], r = Xf(e);
- return t.forEach((a) => {
- var u;
- const o = r.findNodePathFromTreeWithCache(a), i = RP(e, o);
- i && ((u = i.children) != null && u.length || n.push(i));
- }), n;
- };
- var MP = /* @__PURE__ */ ((e) => (e[e.ONLY_LEAF_NODE = 0] = "ONLY_LEAF_NODE", e[e.ALL = 1] = "ALL", e))(MP || {});
- function Zf(e, t, n = 1) {
- const r = [];
- return e.forEach((a) => {
- r.push({ ...a, level: n }), a.children && t.has(a.key) && r.push(...Zf(a.children, t, n + 1));
- }), r;
- }
- function s_(e) {
- const { data: t = [], defaultCache: n, style: r, defaultExpandAll: a = !1, selectionMode: o = 1, valueGroup: i = [], onChange: u, onExpend: l, height: c = 200, itemHeight: s = 32, attachRender: v } = e, [C, p] = rt({}), m = Ht(() => /* @__PURE__ */ new Set(), []), b = Ht(() => Xf(t, n), [t, n]), f = Ht(() => {
- const w = /* @__PURE__ */ new Set();
- return i.forEach((E) => {
- b.findNodePathFromTreeWithCache(E).forEach((x) => w.add(x));
- }), w;
- }, [i, b]);
- lt(() => {
- function w(E) {
- var S;
- m.add(E.key), (S = E.children) == null || S.forEach(w);
- }
- a && t.forEach(w), p({});
- }, [a, t]);
- const h = Ht(() => Zf(t, m), [t, C, m]);
- function g(w) {
- var E;
- (E = w.children) != null && E.length && (m.has(w.key) ? m.delete(w.key) : m.add(w.key), p({})), !(o === 0 && w.children) && (l == null || l(w.key));
- }
- function y(w) {
- const { title: E, key: S, level: x = 0 } = w, R = e.treeNodeClassName, k = m.has(S), L = f.has(S), O = PP(f, w);
- return /* @__PURE__ */ q.jsx(
- "div",
- {
- className: jt(Qn.treeListItem, R),
- style: { paddingLeft: `${x * 20}px` },
- children: /* @__PURE__ */ q.jsxs(
- "div",
- {
- className: jt(Qn.treeListItemContent, {
- [Qn.treeListItemContentSelected]: L
- }),
- children: [
- w.children && w.children.length > 0 && /* @__PURE__ */ q.jsx(
- "span",
- {
- className: jt(Qn.treeIcon, {
- [Qn.treeIconExpand]: k
- }),
- onClick: (N) => {
- N.stopPropagation(), g(w);
- },
- children: /* @__PURE__ */ q.jsx(Ec, {})
- }
- ),
- /* @__PURE__ */ q.jsx(
- um,
- {
- checked: L && !O,
- indeterminate: L && O,
- onChange: () => {
- u == null || u(w);
- }
- }
- ),
- /* @__PURE__ */ q.jsx(Gf, { showIfEllipsis: !0, placement: "top", title: E, children: /* @__PURE__ */ q.jsx(
- "span",
- {
- className: Qn.treeListItemTitle,
- onClick: (N) => {
- N.stopPropagation(), g(w);
- },
- children: E
- }
- ) }),
- v && v(w)
- ]
- }
- )
- },
- S
- );
- }
- return /* @__PURE__ */ q.jsx("section", { className: Qn.tree, children: /* @__PURE__ */ q.jsx("div", { className: Qn.treeList, style: r, children: /* @__PURE__ */ q.jsx(
- Zu,
- {
- data: h,
- itemKey: (w) => w.key,
- height: c,
- itemHeight: s,
- children: (w) => y(w)
- }
- ) }) });
- }
- const kP = "univer-switch-wrapper", DP = "univer-slider", Ri = {
- switchWrapper: kP,
- switch: "univer-switch",
- slider: DP
- }, c_ = (e) => {
- const { defaultChecked: t = !1, onChange: n } = e, [r, a] = rt(t), o = () => {
- a(!r), n == null || n(!r);
- };
- return lt(() => {
- a(t);
- }, [t]), /* @__PURE__ */ q.jsx("div", { className: Ri.switchWrapper, children: /* @__PURE__ */ q.jsxs("label", { className: Ri.switch, children: [
- /* @__PURE__ */ q.jsx("input", { type: "checkbox", checked: r, onChange: o }),
- /* @__PURE__ */ q.jsx("span", { className: Ri.slider })
- ] }) });
- }, NP = "#fee7e7", IP = "#fdcece", OP = "#fb9d9d", _P = "#fa7979", LP = "#fe4b4b", TP = "#f30b0b", $P = "#e30909", AP = "#cd0f0f", jP = "#b20000", FP = "#9d0000", zP = "#fef0e6", HP = "#fee1cd", VP = "#fdc49b", WP = "#fca669", BP = "#ff8c51", UP = "#fb8937", qP = "#f96800", KP = "#df5d00", YP = "#cc4f10", GP = "#b24000", XP = "#fef6e6", ZP = "#feeecd", QP = "#fddc9b", JP = "#fccb69", eM = "#ffbd37", tM = "#faad14", nM = "#e59b07", rM = "#c68400", aM = "#a97100", oM = "#8f5f00", iM = "#fefbe6", uM = "#fef7cd", lM = "#fdf09b", sM = "#fce869", cM = "#fbe137", dM = "#f9d700", fM = "#ebc301", vM = "#d8b300", mM = "#c5a300", pM = "#b19401", hM = "#f7fde8", gM = "#effbd0", yM = "#def6a2", bM = "#cef273", CM = "#beee44", SM = "#a4dc16", wM = "#8bbb11", xM = "#7aa017", EM = "#688c0d", RM = "#58770a", PM = "#effce8", MM = "#dff9d2", kM = "#bff3a5", DM = "#9fed78", NM = "#7fe74b", IM = "#59d01e", OM = "#49b811", _M = "#409f11", LM = "#398712", TM = "#317310", $M = "#e5fffb", AM = "#ccfff7", jM = "#a9fff2", FM = "#78fce8", zM = "#2afede", HM = "#10e8c7", VM = "#00d2b2", WM = "#00b298", BM = "#009e87", UM = "#008b76", qM = "#e4f4fe", KM = "#d0edff", YM = "#9fdaff", GM = "#62c2ff", XM = "#2daeff", ZM = "#0b9efb", QM = "#0493ee", JM = "#0080d2", e2 = "#006cae", t2 = "#005f9a", n2 = "#e8ecfd", r2 = "#d0d9fb", a2 = "#a2b3f6", o2 = "#738df2", i2 = "#3a60f7", u2 = "#274fee", l2 = "#143ee3", s2 = "#012bd2", c2 = "#0025b7", d2 = "#001f9c", f2 = "#f1eafa", v2 = "#e3d5f6", m2 = "#c7abed", p2 = "#aa82e3", h2 = "#9e6de3", g2 = "#894ede", y2 = "#7735d4", b2 = "#6721cb", C2 = "#510eb0", S2 = "#3f0198", w2 = "#fde8f3", x2 = "#fbd0e8", E2 = "#f6a2d0", R2 = "#f273b9", P2 = "#f248a6", M2 = "#e7258f", k2 = "#d4157e", D2 = "#c1026b", N2 = "#a1095c", I2 = "#8f0550", O2 = "#f5f5f5", _2 = "#ececec", L2 = "#e5e5e5", T2 = "#d8d8d8", $2 = "#bcbcbc", A2 = "#999999", j2 = "#7a7a7a", F2 = "#656565", z2 = "#565656", H2 = "#4b4b4b", V2 = "#1e222b", W2 = "#ffffff", B2 = "0 4px 12px rgba(30, 34, 43, 0.08)", U2 = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", q2 = "#ececec", K2 = "#d8d8d8", Y2 = "#ffffff", G2 = "#ffffff", X2 = "#1e222b", Z2 = "#7a7a7a", Q2 = "#4b4b4b", J2 = "#bcbcbc", ek = "#e5e5e5", tk = "#bcbcbc", nk = "#999999", rk = "#7a7a7a", ak = "4px", ok = "8px", ik = "12px", uk = "24px", lk = "20px", sk = "16px", ck = "12px", dk = "8px", fk = "4px", vk = "20px", mk = "16px", pk = "12px", hk = "8px", gk = "4px", yk = "20px", bk = "18px", Ck = "16px", Sk = "15px", wk = "14px", xk = "13px", Ek = "12px", Rk = "768px", Pk = "1024px", Mk = "1280px", kk = "1536px", Dk = "#2daeff", Nk = "#59d01e", Ik = "#ffbd37", Ok = "#fe4b4b", _k = "#274fee", Lk = "#3a60f7", Tk = "#0b9efb", $k = "#9e6de3", Ak = "#49b811", jk = "#0b9efb", Fk = "#ffbd37", zk = "#f273b9", Hk = "#00d2b2", Vk = "#ff8c51", Wk = "#565656", Bk = "#274fee", Uk = "#fa7979", qk = "#8bbb11", Kk = "#d8b300", d_ = {
- red50: NP,
- red100: IP,
- red200: OP,
- red300: _P,
- red400: LP,
- red500: TP,
- red600: $P,
- red700: AP,
- red800: jP,
- red900: FP,
- orange50: zP,
- orange100: HP,
- orange200: VP,
- orange300: WP,
- orange400: BP,
- orange500: UP,
- orange600: qP,
- orange700: KP,
- orange800: YP,
- orange900: GP,
- gold50: XP,
- gold100: ZP,
- gold200: QP,
- gold300: JP,
- gold400: eM,
- gold500: tM,
- gold600: nM,
- gold700: rM,
- gold800: aM,
- gold900: oM,
- yellow50: iM,
- yellow100: uM,
- yellow200: lM,
- yellow300: sM,
- yellow400: cM,
- yellow500: dM,
- yellow600: fM,
- yellow700: vM,
- yellow800: mM,
- yellow900: pM,
- verdancy50: hM,
- verdancy100: gM,
- verdancy200: yM,
- verdancy300: bM,
- verdancy400: CM,
- verdancy500: SM,
- verdancy600: wM,
- verdancy700: xM,
- verdancy800: EM,
- verdancy900: RM,
- green50: PM,
- green100: MM,
- green200: kM,
- green300: DM,
- green400: NM,
- green500: IM,
- green600: OM,
- green700: _M,
- green800: LM,
- green900: TM,
- jiqing50: $M,
- jiqing100: AM,
- jiqing200: jM,
- jiqing300: FM,
- jiqing400: zM,
- jiqing500: HM,
- jiqing600: VM,
- jiqing700: WM,
- jiqing800: BM,
- jiqing900: UM,
- blue50: qM,
- blue100: KM,
- blue200: YM,
- blue300: GM,
- blue400: XM,
- blue500: ZM,
- blue600: QM,
- blue700: JM,
- blue800: e2,
- blue900: t2,
- hyacinth50: n2,
- hyacinth100: r2,
- hyacinth200: a2,
- hyacinth300: o2,
- hyacinth400: i2,
- hyacinth500: u2,
- hyacinth600: l2,
- hyacinth700: s2,
- hyacinth800: c2,
- hyacinth900: d2,
- purple50: f2,
- purple100: v2,
- purple200: m2,
- purple300: p2,
- purple400: h2,
- purple500: g2,
- purple600: y2,
- purple700: b2,
- purple800: C2,
- purple900: S2,
- magenta50: w2,
- magenta100: x2,
- magenta200: E2,
- magenta300: R2,
- magenta400: P2,
- magenta500: M2,
- magenta600: k2,
- magenta700: D2,
- magenta800: N2,
- magenta900: I2,
- grey50: O2,
- grey100: _2,
- grey200: L2,
- grey300: T2,
- grey400: $2,
- grey500: A2,
- grey600: j2,
- grey700: F2,
- grey800: z2,
- grey900: H2,
- colorBlack: V2,
- colorWhite: W2,
- boxShadowBase: B2,
- boxShadowLg: U2,
- bgColor: q2,
- bgColorHover: K2,
- bgColorSecondary: Y2,
- bgColorOverlay: G2,
- textColor: X2,
- textColorSecondary: Z2,
- textColorSecondaryDarker: Q2,
- textColorTertiary: J2,
- borderColor: ek,
- scrollbarColor: tk,
- scrollbarColorHover: nk,
- scrollbarColorActive: rk,
- borderRadiusBase: ak,
- borderRadiusLg: ok,
- borderRadiusXl: ik,
- marginXl: uk,
- marginLg: lk,
- marginBase: sk,
- marginSm: ck,
- marginXs: dk,
- marginXxs: fk,
- paddingXl: vk,
- paddingLg: mk,
- paddingBase: pk,
- paddingSm: hk,
- paddingXs: gk,
- fontSizeXxl: yk,
- fontSizeXl: bk,
- fontSizeLg: Ck,
- fontSizeBase: Sk,
- fontSizeSm: wk,
- fontSizeXs: xk,
- fontSizeXxs: Ek,
- breakpointXs: Rk,
- breakpointSm: Pk,
- breakpointBase: Mk,
- breakpointLg: kk,
- infoColor: Dk,
- successColor: Nk,
- warningColor: Ik,
- errorColor: Ok,
- primaryColor: _k,
- primaryColorHover: Lk,
- linkColor: Tk,
- loopColor1: $k,
- loopColor2: Ak,
- loopColor3: jk,
- loopColor4: Fk,
- loopColor5: zk,
- loopColor6: Hk,
- loopColor7: Vk,
- loopColor8: Wk,
- loopColor9: Bk,
- loopColor10: Uk,
- loopColor11: qk,
- loopColor12: Kk
- }, Yk = "#fee7e7", Gk = "#fdcece", Xk = "#fb9d9d", Zk = "#fa7979", Qk = "#fe4b4b", Jk = "#f30b0b", eD = "#e30909", tD = "#cd0f0f", nD = "#b20000", rD = "#9d0000", aD = "#fef0e6", oD = "#fee1cd", iD = "#fdc49b", uD = "#fca669", lD = "#ff8c51", sD = "#fb8937", cD = "#f96800", dD = "#df5d00", fD = "#cc4f10", vD = "#b24000", mD = "#fef6e6", pD = "#feeecd", hD = "#fddc9b", gD = "#fccb69", yD = "#ffbd37", bD = "#faad14", CD = "#e59b07", SD = "#c68400", wD = "#a97100", xD = "#8f5f00", ED = "#fefbe6", RD = "#fef7cd", PD = "#fdf09b", MD = "#fce869", kD = "#fbe137", DD = "#f9d700", ND = "#ebc301", ID = "#d8b300", OD = "#c5a300", _D = "#b19401", LD = "#f7fde8", TD = "#effbd0", $D = "#def6a2", AD = "#cef273", jD = "#beee44", FD = "#a4dc16", zD = "#8bbb11", HD = "#7aa017", VD = "#688c0d", WD = "#58770a", BD = "#effce8", UD = "#dff9d2", qD = "#bff3a5", KD = "#9fed78", YD = "#7fe74b", GD = "#59d01e", XD = "#49b811", ZD = "#409f11", QD = "#398712", JD = "#317310", eN = "#e5fffb", tN = "#ccfff7", nN = "#a9fff2", rN = "#78fce8", aN = "#2afede", oN = "#10e8c7", iN = "#00d2b2", uN = "#00b298", lN = "#009e87", sN = "#008b76", cN = "#e4f4fe", dN = "#d0edff", fN = "#9fdaff", vN = "#62c2ff", mN = "#2daeff", pN = "#0b9efb", hN = "#0493ee", gN = "#0080d2", yN = "#006cae", bN = "#005f9a", CN = "#e8ecfd", SN = "#d0d9fb", wN = "#a2b3f6", xN = "#738df2", EN = "#3a60f7", RN = "#274fee", PN = "#143ee3", MN = "#012bd2", kN = "#0025b7", DN = "#001f9c", NN = "#f1eafa", IN = "#e3d5f6", ON = "#c7abed", _N = "#aa82e3", LN = "#9e6de3", TN = "#894ede", $N = "#7735d4", AN = "#6721cb", jN = "#510eb0", FN = "#3f0198", zN = "#fde8f3", HN = "#fbd0e8", VN = "#f6a2d0", WN = "#f273b9", BN = "#f248a6", UN = "#e7258f", qN = "#d4157e", KN = "#c1026b", YN = "#a1095c", GN = "#8f0550", XN = "#f5f5f5", ZN = "#ececec", QN = "#e5e5e5", JN = "#d8d8d8", eI = "#bcbcbc", tI = "#999999", nI = "#7a7a7a", rI = "#656565", aI = "#565656", oI = "#4b4b4b", iI = "#1e222b", uI = "#ffffff", lI = "0 4px 12px rgba(30, 34, 43, 0.08)", sI = "0 4px 24px 0 rgba(30, 34, 43, 0.08)", cI = "#ececec", dI = "#d8d8d8", fI = "#ffffff", vI = "#ffffff", mI = "#1e222b", pI = "#7a7a7a", hI = "#4b4b4b", gI = "#bcbcbc", yI = "#e5e5e5", bI = "#bcbcbc", CI = "#999999", SI = "#7a7a7a", wI = "4px", xI = "8px", EI = "12px", RI = "24px", PI = "20px", MI = "16px", kI = "12px", DI = "8px", NI = "4px", II = "20px", OI = "16px", _I = "12px", LI = "8px", TI = "4px", $I = "20px", AI = "18px", jI = "16px", FI = "15px", zI = "14px", HI = "13px", VI = "12px", WI = "768px", BI = "1024px", UI = "1280px", qI = "1536px", KI = "#2daeff", YI = "#59d01e", GI = "#ffbd37", XI = "#fe4b4b", ZI = "#409f11", QI = "#49b811", JI = "#0b9efb", eO = "#9e6de3", tO = "#49b811", nO = "#0b9efb", rO = "#ffbd37", aO = "#f273b9", oO = "#00d2b2", iO = "#ff8c51", uO = "#565656", lO = "#274fee", sO = "#fa7979", cO = "#8bbb11", dO = "#d8b300", f_ = {
- red50: Yk,
- red100: Gk,
- red200: Xk,
- red300: Zk,
- red400: Qk,
- red500: Jk,
- red600: eD,
- red700: tD,
- red800: nD,
- red900: rD,
- orange50: aD,
- orange100: oD,
- orange200: iD,
- orange300: uD,
- orange400: lD,
- orange500: sD,
- orange600: cD,
- orange700: dD,
- orange800: fD,
- orange900: vD,
- gold50: mD,
- gold100: pD,
- gold200: hD,
- gold300: gD,
- gold400: yD,
- gold500: bD,
- gold600: CD,
- gold700: SD,
- gold800: wD,
- gold900: xD,
- yellow50: ED,
- yellow100: RD,
- yellow200: PD,
- yellow300: MD,
- yellow400: kD,
- yellow500: DD,
- yellow600: ND,
- yellow700: ID,
- yellow800: OD,
- yellow900: _D,
- verdancy50: LD,
- verdancy100: TD,
- verdancy200: $D,
- verdancy300: AD,
- verdancy400: jD,
- verdancy500: FD,
- verdancy600: zD,
- verdancy700: HD,
- verdancy800: VD,
- verdancy900: WD,
- green50: BD,
- green100: UD,
- green200: qD,
- green300: KD,
- green400: YD,
- green500: GD,
- green600: XD,
- green700: ZD,
- green800: QD,
- green900: JD,
- jiqing50: eN,
- jiqing100: tN,
- jiqing200: nN,
- jiqing300: rN,
- jiqing400: aN,
- jiqing500: oN,
- jiqing600: iN,
- jiqing700: uN,
- jiqing800: lN,
- jiqing900: sN,
- blue50: cN,
- blue100: dN,
- blue200: fN,
- blue300: vN,
- blue400: mN,
- blue500: pN,
- blue600: hN,
- blue700: gN,
- blue800: yN,
- blue900: bN,
- hyacinth50: CN,
- hyacinth100: SN,
- hyacinth200: wN,
- hyacinth300: xN,
- hyacinth400: EN,
- hyacinth500: RN,
- hyacinth600: PN,
- hyacinth700: MN,
- hyacinth800: kN,
- hyacinth900: DN,
- purple50: NN,
- purple100: IN,
- purple200: ON,
- purple300: _N,
- purple400: LN,
- purple500: TN,
- purple600: $N,
- purple700: AN,
- purple800: jN,
- purple900: FN,
- magenta50: zN,
- magenta100: HN,
- magenta200: VN,
- magenta300: WN,
- magenta400: BN,
- magenta500: UN,
- magenta600: qN,
- magenta700: KN,
- magenta800: YN,
- magenta900: GN,
- grey50: XN,
- grey100: ZN,
- grey200: QN,
- grey300: JN,
- grey400: eI,
- grey500: tI,
- grey600: nI,
- grey700: rI,
- grey800: aI,
- grey900: oI,
- colorBlack: iI,
- colorWhite: uI,
- boxShadowBase: lI,
- boxShadowLg: sI,
- bgColor: cI,
- bgColorHover: dI,
- bgColorSecondary: fI,
- bgColorOverlay: vI,
- textColor: mI,
- textColorSecondary: pI,
- textColorSecondaryDarker: hI,
- textColorTertiary: gI,
- borderColor: yI,
- scrollbarColor: bI,
- scrollbarColorHover: CI,
- scrollbarColorActive: SI,
- borderRadiusBase: wI,
- borderRadiusLg: xI,
- borderRadiusXl: EI,
- marginXl: RI,
- marginLg: PI,
- marginBase: MI,
- marginSm: kI,
- marginXs: DI,
- marginXxs: NI,
- paddingXl: II,
- paddingLg: OI,
- paddingBase: _I,
- paddingSm: LI,
- paddingXs: TI,
- fontSizeXxl: $I,
- fontSizeXl: AI,
- fontSizeLg: jI,
- fontSizeBase: FI,
- fontSizeSm: zI,
- fontSizeXs: HI,
- fontSizeXxs: VI,
- breakpointXs: WI,
- breakpointSm: BI,
- breakpointBase: UI,
- breakpointLg: qI,
- infoColor: KI,
- successColor: YI,
- warningColor: GI,
- errorColor: XI,
- primaryColor: ZI,
- primaryColorHover: QI,
- linkColor: JI,
- loopColor1: eO,
- loopColor2: tO,
- loopColor3: nO,
- loopColor4: rO,
- loopColor5: aO,
- loopColor6: oO,
- loopColor7: iO,
- loopColor8: uO,
- loopColor9: lO,
- loopColor10: sO,
- loopColor11: cO,
- loopColor12: dO
- }, fO = "univer-theme", vO = "univer-render-canvas", mO = {
- theme: fO,
- renderCanvas: vO
- };
- function pO(e) {
- return `--${e.replace(/([A-Z])/g, (n) => `-${n.toLowerCase()}`).replace(/(\d+)/g, "-$1")}`;
- }
- function hO(e) {
- if (e.startsWith("#")) {
- const t = e.replace("#", ""), n = Number.parseInt(t.substring(0, 2), 16), r = Number.parseInt(t.substring(2, 4), 16), a = Number.parseInt(t.substring(4, 6), 16);
- return `${n}, ${r}, ${a}`;
- }
- return e;
- }
- const gr = class gr {
- constructor() {
- qa(this, "_styleSheet", null);
- qa(this, "_themeRootName", mO.theme);
- if (!Kr()) return;
- const t = document.createElement("style");
- t.id = this._themeRootName;
- let n = null;
- const r = document.getRootNode();
- r === document ? n = document.head : r instanceof ShadowRoot ? n = r : n = r.head, n && (n.appendChild(t), this._styleSheet = t);
- }
- static getInstance() {
- return gr._instance || (gr._instance = new gr()), gr._instance;
- }
- setTheme(t, n) {
- this._styleSheet && (t.classList.remove(this._themeRootName), t.classList.add(this._themeRootName), this._styleSheet.innerHTML = "", this._styleSheet.innerHTML = `.${this._themeRootName} {${Object.keys(n).map((r) => `${pO(r)}: ${hO(n[r])};`).join("")}}`);
- }
- };
- qa(gr, "_instance", null);
- let pu = gr;
- const v_ = pu.getInstance();
- var Pi = { exports: {} }, ha = {}, Pa = { exports: {} }, gO = Pa.exports, Qs;
- function Ju() {
- return Qs || (Qs = 1, function(e, t) {
- (function(n, r) {
- r(t);
- })(gO, function(n) {
- function r(V) {
- return function(J, M, D, j, W, K, Y) {
- return V(J, M, Y);
- };
- }
- function a(V) {
- return function(J, M, D, j) {
- if (!J || !M || typeof J != "object" || typeof M != "object")
- return V(J, M, D, j);
- var W = j.get(J), K = j.get(M);
- if (W && K)
- return W === M && K === J;
- j.set(J, M), j.set(M, J);
- var Y = V(J, M, D, j);
- return j.delete(J), j.delete(M), Y;
- };
- }
- function o(V, X) {
- var J = {};
- for (var M in V)
- J[M] = V[M];
- for (var M in X)
- J[M] = X[M];
- return J;
- }
- function i(V) {
- return V.constructor === Object || V.constructor == null;
- }
- function u(V) {
- return typeof V.then == "function";
- }
- function l(V, X) {
- return V === X || V !== V && X !== X;
- }
- var c = "[object Arguments]", s = "[object Boolean]", v = "[object Date]", C = "[object RegExp]", p = "[object Map]", m = "[object Number]", b = "[object Object]", f = "[object Set]", h = "[object String]", g = Object.prototype.toString;
- function y(V) {
- var X = V.areArraysEqual, J = V.areDatesEqual, M = V.areMapsEqual, D = V.areObjectsEqual, j = V.areRegExpsEqual, W = V.areSetsEqual, K = V.createIsNestedEqual, Y = K(te);
- function te(Q, ae, ue) {
- if (Q === ae)
- return !0;
- if (!Q || !ae || typeof Q != "object" || typeof ae != "object")
- return Q !== Q && ae !== ae;
- if (i(Q) && i(ae))
- return D(Q, ae, Y, ue);
- var se = Array.isArray(Q), pe = Array.isArray(ae);
- if (se || pe)
- return se === pe && X(Q, ae, Y, ue);
- var oe = g.call(Q);
- return oe !== g.call(ae) ? !1 : oe === v ? J(Q, ae, Y, ue) : oe === C ? j(Q, ae, Y, ue) : oe === p ? M(Q, ae, Y, ue) : oe === f ? W(Q, ae, Y, ue) : oe === b || oe === c ? u(Q) || u(ae) ? !1 : D(Q, ae, Y, ue) : oe === s || oe === m || oe === h ? l(Q.valueOf(), ae.valueOf()) : !1;
- }
- return te;
- }
- function w(V, X, J, M) {
- var D = V.length;
- if (X.length !== D)
- return !1;
- for (; D-- > 0; )
- if (!J(V[D], X[D], D, D, V, X, M))
- return !1;
- return !0;
- }
- var E = a(w);
- function S(V, X) {
- return l(V.valueOf(), X.valueOf());
- }
- function x(V, X, J, M) {
- var D = V.size === X.size;
- if (!D)
- return !1;
- if (!V.size)
- return !0;
- var j = {}, W = 0;
- return V.forEach(function(K, Y) {
- if (D) {
- var te = !1, Q = 0;
- X.forEach(function(ae, ue) {
- !te && !j[Q] && (te = J(Y, ue, W, Q, V, X, M) && J(K, ae, Y, ue, V, X, M)) && (j[Q] = !0), Q++;
- }), W++, D = te;
- }
- }), D;
- }
- var R = a(x), k = "_owner", L = Object.prototype.hasOwnProperty;
- function O(V, X, J, M) {
- var D = Object.keys(V), j = D.length;
- if (Object.keys(X).length !== j)
- return !1;
- for (var W; j-- > 0; ) {
- if (W = D[j], W === k) {
- var K = !!V.$$typeof, Y = !!X.$$typeof;
- if ((K || Y) && K !== Y)
- return !1;
- }
- if (!L.call(X, W) || !J(V[W], X[W], W, W, V, X, M))
- return !1;
- }
- return !0;
- }
- var N = a(O);
- function F(V, X) {
- return V.source === X.source && V.flags === X.flags;
- }
- function I(V, X, J, M) {
- var D = V.size === X.size;
- if (!D)
- return !1;
- if (!V.size)
- return !0;
- var j = {};
- return V.forEach(function(W, K) {
- if (D) {
- var Y = !1, te = 0;
- X.forEach(function(Q, ae) {
- !Y && !j[te] && (Y = J(W, Q, K, ae, V, X, M)) && (j[te] = !0), te++;
- }), D = Y;
- }
- }), D;
- }
- var T = a(I), P = Object.freeze({
- areArraysEqual: w,
- areDatesEqual: S,
- areMapsEqual: x,
- areObjectsEqual: O,
- areRegExpsEqual: F,
- areSetsEqual: I,
- createIsNestedEqual: r
- }), z = Object.freeze({
- areArraysEqual: E,
- areDatesEqual: S,
- areMapsEqual: R,
- areObjectsEqual: N,
- areRegExpsEqual: F,
- areSetsEqual: T,
- createIsNestedEqual: r
- }), _ = y(P);
- function A(V, X) {
- return _(V, X, void 0);
- }
- var H = y(o(P, { createIsNestedEqual: function() {
- return l;
- } }));
- function $(V, X) {
- return H(V, X, void 0);
- }
- var U = y(z);
- function G(V, X) {
- return U(V, X, /* @__PURE__ */ new WeakMap());
- }
- var B = y(o(z, {
- createIsNestedEqual: function() {
- return l;
- }
- }));
- function ne(V, X) {
- return B(V, X, /* @__PURE__ */ new WeakMap());
- }
- function le(V) {
- return y(o(P, V(P)));
- }
- function ee(V) {
- var X = y(o(z, V(z)));
- return function(J, M, D) {
- return D === void 0 && (D = /* @__PURE__ */ new WeakMap()), X(J, M, D);
- };
- }
- n.circularDeepEqual = G, n.circularShallowEqual = ne, n.createCustomCircularEqual = ee, n.createCustomEqual = le, n.deepEqual = A, n.sameValueZeroEqual = l, n.shallowEqual = $, Object.defineProperty(n, "__esModule", { value: !0 });
- });
- }(Pa, Pa.exports)), Pa.exports;
- }
- var co = { exports: {} }, Js;
- function el() {
- if (Js) return co.exports;
- Js = 1;
- function e(n) {
- var r, a, o = "";
- if (typeof n == "string" || typeof n == "number") o += n;
- else if (typeof n == "object") if (Array.isArray(n)) {
- var i = n.length;
- for (r = 0; r < i; r++) n[r] && (a = e(n[r])) && (o && (o += " "), o += a);
- } else for (a in n) n[a] && (o && (o += " "), o += a);
- return o;
- }
- function t() {
- for (var n, r, a = 0, o = "", i = arguments.length; a < i; a++) (n = arguments[a]) && (r = e(n)) && (o && (o += " "), o += r);
- return o;
- }
- return co.exports = t, co.exports.clsx = t, co.exports;
- }
- var dt = {}, Mi, ec;
- function yO() {
- return ec || (ec = 1, Mi = function(t, n, r) {
- return t === n ? !0 : t.className === n.className && r(t.style, n.style) && t.width === n.width && t.autoSize === n.autoSize && t.cols === n.cols && t.draggableCancel === n.draggableCancel && t.draggableHandle === n.draggableHandle && r(t.verticalCompact, n.verticalCompact) && r(t.compactType, n.compactType) && r(t.layout, n.layout) && r(t.margin, n.margin) && r(t.containerPadding, n.containerPadding) && t.rowHeight === n.rowHeight && t.maxRows === n.maxRows && t.isBounded === n.isBounded && t.isDraggable === n.isDraggable && t.isResizable === n.isResizable && t.allowOverlap === n.allowOverlap && t.preventCollision === n.preventCollision && t.useCSSTransforms === n.useCSSTransforms && t.transformScale === n.transformScale && t.isDroppable === n.isDroppable && r(t.resizeHandles, n.resizeHandles) && r(t.resizeHandle, n.resizeHandle) && t.onLayoutChange === n.onLayoutChange && t.onDragStart === n.onDragStart && t.onDrag === n.onDrag && t.onDragStop === n.onDragStop && t.onResizeStart === n.onResizeStart && t.onResize === n.onResize && t.onResizeStop === n.onResizeStop && t.onDrop === n.onDrop && r(t.droppingItem, n.droppingItem) && r(t.innerRef, n.innerRef);
- }), Mi;
- }
- var tc;
- function Jr() {
- if (tc) return dt;
- tc = 1, Object.defineProperty(dt, "__esModule", {
- value: !0
- }), dt.bottom = r, dt.childrenEqual = l, dt.cloneLayout = a, dt.cloneLayoutItem = u, dt.collides = s, dt.compact = v, dt.compactItem = m, dt.compactType = V, dt.correctBounds = b, dt.fastPositionEqual = c, dt.fastRGLPropsEqual = void 0, dt.getAllCollisions = g, dt.getFirstCollision = h, dt.getLayoutItem = f, dt.getStatics = y, dt.modifyLayout = o, dt.moveElement = w, dt.moveElementAwayFromCollision = E, dt.noop = void 0, dt.perc = S, dt.resizeItemInDirection = H, dt.setTopLeft = U, dt.setTransform = $, dt.sortLayoutItems = G, dt.sortLayoutItemsByColRow = ne, dt.sortLayoutItemsByRowCol = B, dt.synchronizeLayoutWithChildren = le, dt.validateLayout = ee, dt.withLayoutItem = i;
- var e = /* @__PURE__ */ Ju(), t = n(me);
- function n(M) {
- return M && M.__esModule ? M : { default: M };
- }
- function r(M) {
- let D = 0, j;
- for (let W = 0, K = M.length; W < K; W++)
- j = M[W].y + M[W].h, j > D && (D = j);
- return D;
- }
- function a(M) {
- const D = Array(M.length);
- for (let j = 0, W = M.length; j < W; j++)
- D[j] = u(M[j]);
- return D;
- }
- function o(M, D) {
- const j = Array(M.length);
- for (let W = 0, K = M.length; W < K; W++)
- D.i === M[W].i ? j[W] = D : j[W] = M[W];
- return j;
- }
- function i(M, D, j) {
- let W = f(M, D);
- return W ? (W = j(u(W)), M = o(M, W), [M, W]) : [M, null];
- }
- function u(M) {
- return {
- w: M.w,
- h: M.h,
- x: M.x,
- y: M.y,
- i: M.i,
- minW: M.minW,
- maxW: M.maxW,
- minH: M.minH,
- maxH: M.maxH,
- moved: !!M.moved,
- static: !!M.static,
- // These can be null/undefined
- isDraggable: M.isDraggable,
- isResizable: M.isResizable,
- resizeHandles: M.resizeHandles,
- isBounded: M.isBounded
- };
- }
- function l(M, D) {
- return (0, e.deepEqual)(t.default.Children.map(M, (j) => j == null ? void 0 : j.key), t.default.Children.map(D, (j) => j == null ? void 0 : j.key)) && (0, e.deepEqual)(t.default.Children.map(M, (j) => j == null ? void 0 : j.props["data-grid"]), t.default.Children.map(D, (j) => j == null ? void 0 : j.props["data-grid"]));
- }
- dt.fastRGLPropsEqual = yO();
- function c(M, D) {
- return M.left === D.left && M.top === D.top && M.width === D.width && M.height === D.height;
- }
- function s(M, D) {
- return !(M.i === D.i || M.x + M.w <= D.x || M.x >= D.x + D.w || M.y + M.h <= D.y || M.y >= D.y + D.h);
- }
- function v(M, D, j, W) {
- const K = y(M), Y = G(M, D), te = Array(M.length);
- for (let Q = 0, ae = Y.length; Q < ae; Q++) {
- let ue = u(Y[Q]);
- ue.static || (ue = m(K, ue, D, j, Y, W), K.push(ue)), te[M.indexOf(Y[Q])] = ue, ue.moved = !1;
- }
- return te;
- }
- const C = {
- x: "w",
- y: "h"
- };
- function p(M, D, j, W) {
- const K = C[W];
- D[W] += 1;
- const Y = M.map((te) => te.i).indexOf(D.i);
- for (let te = Y + 1; te < M.length; te++) {
- const Q = M[te];
- if (!Q.static) {
- if (Q.y > D.y + D.h) break;
- s(D, Q) && p(M, Q, j + D[K], W);
- }
- }
- D[W] = j;
- }
- function m(M, D, j, W, K, Y) {
- const te = j === "vertical", Q = j === "horizontal";
- if (te)
- for (D.y = Math.min(r(M), D.y); D.y > 0 && !h(M, D); )
- D.y--;
- else if (Q)
- for (; D.x > 0 && !h(M, D); )
- D.x--;
- let ae;
- for (; (ae = h(M, D)) && !(j === null && Y); )
- if (Q ? p(K, D, ae.x + ae.w, "x") : p(K, D, ae.y + ae.h, "y"), Q && D.x + D.w > W)
- for (D.x = W - D.w, D.y++; D.x > 0 && !h(M, D); )
- D.x--;
- return D.y = Math.max(D.y, 0), D.x = Math.max(D.x, 0), D;
- }
- function b(M, D) {
- const j = y(M);
- for (let W = 0, K = M.length; W < K; W++) {
- const Y = M[W];
- if (Y.x + Y.w > D.cols && (Y.x = D.cols - Y.w), Y.x < 0 && (Y.x = 0, Y.w = D.cols), !Y.static) j.push(Y);
- else
- for (; h(j, Y); )
- Y.y++;
- }
- return M;
- }
- function f(M, D) {
- for (let j = 0, W = M.length; j < W; j++)
- if (M[j].i === D) return M[j];
- }
- function h(M, D) {
- for (let j = 0, W = M.length; j < W; j++)
- if (s(M[j], D)) return M[j];
- }
- function g(M, D) {
- return M.filter((j) => s(j, D));
- }
- function y(M) {
- return M.filter((D) => D.static);
- }
- function w(M, D, j, W, K, Y, te, Q, ae) {
- if (D.static && D.isDraggable !== !0 || D.y === W && D.x === j) return M;
- `${D.i}${String(j)}${String(W)}${D.x}${D.y}`;
- const ue = D.x, se = D.y;
- typeof j == "number" && (D.x = j), typeof W == "number" && (D.y = W), D.moved = !0;
- let pe = G(M, te);
- (te === "vertical" && typeof W == "number" ? se >= W : te === "horizontal" && typeof j == "number" ? ue >= j : !1) && (pe = pe.reverse());
- const ve = g(pe, D), ze = ve.length > 0;
- if (ze && ae)
- return a(M);
- if (ze && Y)
- return `${D.i}`, D.x = ue, D.y = se, D.moved = !1, M;
- for (let Re = 0, Be = ve.length; Re < Be; Re++) {
- const je = ve[Re];
- `${D.i}${D.x}${D.y}${je.i}${je.x}${je.y}`, !je.moved && (je.static ? M = E(M, je, D, K, te) : M = E(M, D, je, K, te));
- }
- return M;
- }
- function E(M, D, j, W, K, Y) {
- const te = K === "horizontal", Q = K === "vertical", ae = D.static;
- if (W) {
- W = !1;
- const pe = {
- x: te ? Math.max(D.x - j.w, 0) : j.x,
- y: Q ? Math.max(D.y - j.h, 0) : j.y,
- w: j.w,
- h: j.h,
- i: "-1"
- }, oe = h(M, pe), ve = oe && oe.y + oe.h > D.y, ze = oe && D.x + D.w > oe.x;
- if (oe) {
- if (ve && Q)
- return w(M, j, void 0, D.y + 1, W, ae, K);
- if (ve && K == null)
- return D.y = j.y, j.y = j.y + j.h, M;
- if (ze && te)
- return w(M, D, j.x, void 0, W, ae, K);
- } else return `${j.i}${pe.x}${pe.y}`, w(M, j, te ? pe.x : void 0, Q ? pe.y : void 0, W, ae, K);
- }
- const ue = te ? j.x + 1 : void 0, se = Q ? j.y + 1 : void 0;
- return ue == null && se == null ? M : w(M, j, te ? j.x + 1 : void 0, Q ? j.y + 1 : void 0, W, ae, K);
- }
- function S(M) {
- return M * 100 + "%";
- }
- const x = (M, D, j, W) => M + j > W ? D : j, R = (M, D, j) => M < 0 ? D : j, k = (M) => Math.max(0, M), L = (M) => Math.max(0, M), O = (M, D, j) => {
- let {
- left: W,
- height: K,
- width: Y
- } = D;
- const te = M.top - (K - M.height);
- return {
- left: W,
- width: Y,
- height: R(te, M.height, K),
- top: L(te)
- };
- }, N = (M, D, j) => {
- let {
- top: W,
- left: K,
- height: Y,
- width: te
- } = D;
- return {
- top: W,
- height: Y,
- width: x(M.left, M.width, te, j),
- left: k(K)
- };
- }, F = (M, D, j) => {
- let {
- top: W,
- height: K,
- width: Y
- } = D;
- const te = M.left - (Y - M.width);
- return {
- height: K,
- width: te < 0 ? M.width : x(M.left, M.width, Y, j),
- top: L(W),
- left: k(te)
- };
- }, I = (M, D, j) => {
- let {
- top: W,
- left: K,
- height: Y,
- width: te
- } = D;
- return {
- width: te,
- left: K,
- height: R(W, M.height, Y),
- top: L(W)
- };
- }, A = {
- n: O,
- ne: function() {
- return O(arguments.length <= 0 ? void 0 : arguments[0], N(...arguments));
- },
- e: N,
- se: function() {
- return I(arguments.length <= 0 ? void 0 : arguments[0], N(...arguments));
- },
- s: I,
- sw: function() {
- return I(arguments.length <= 0 ? void 0 : arguments[0], F(...arguments));
- },
- w: F,
- nw: function() {
- return O(arguments.length <= 0 ? void 0 : arguments[0], F(...arguments));
- }
- };
- function H(M, D, j, W) {
- const K = A[M];
- return K ? K(D, {
- ...D,
- ...j
- }, W) : j;
- }
- function $(M) {
- let {
- top: D,
- left: j,
- width: W,
- height: K
- } = M;
- const Y = `translate(${j}px,${D}px)`;
- return {
- transform: Y,
- WebkitTransform: Y,
- MozTransform: Y,
- msTransform: Y,
- OTransform: Y,
- width: `${W}px`,
- height: `${K}px`,
- position: "absolute"
- };
- }
- function U(M) {
- let {
- top: D,
- left: j,
- width: W,
- height: K
- } = M;
- return {
- top: `${D}px`,
- left: `${j}px`,
- width: `${W}px`,
- height: `${K}px`,
- position: "absolute"
- };
- }
- function G(M, D) {
- return D === "horizontal" ? ne(M) : D === "vertical" ? B(M) : M;
- }
- function B(M) {
- return M.slice(0).sort(function(D, j) {
- return D.y > j.y || D.y === j.y && D.x > j.x ? 1 : D.y === j.y && D.x === j.x ? 0 : -1;
- });
- }
- function ne(M) {
- return M.slice(0).sort(function(D, j) {
- return D.x > j.x || D.x === j.x && D.y > j.y ? 1 : -1;
- });
- }
- function le(M, D, j, W, K) {
- M = M || [];
- const Y = [];
- t.default.Children.forEach(D, (Q) => {
- if ((Q == null ? void 0 : Q.key) == null) return;
- const ae = f(M, String(Q.key)), ue = Q.props["data-grid"];
- ae && ue == null ? Y.push(u(ae)) : ue ? Y.push(u({
- ...ue,
- i: Q.key
- })) : Y.push(u({
- w: 1,
- h: 1,
- x: 0,
- y: r(Y),
- i: String(Q.key)
- }));
- });
- const te = b(Y, {
- cols: j
- });
- return K ? te : v(te, W, j);
- }
- function ee(M) {
- let D = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "Layout";
- const j = ["x", "y", "w", "h"];
- if (!Array.isArray(M)) throw new Error(D + " must be an array!");
- for (let W = 0, K = M.length; W < K; W++) {
- const Y = M[W];
- for (let te = 0; te < j.length; te++) {
- const Q = j[te], ae = Y[Q];
- if (typeof ae != "number" || Number.isNaN(ae))
- throw new Error(`ReactGridLayout: ${D}[${W}].${Q} must be a number! Received: ${ae} (${typeof ae})`);
- }
- if (typeof Y.i < "u" && typeof Y.i != "string")
- throw new Error(`ReactGridLayout: ${D}[${W}].i must be a string! Received: ${Y.i} (${typeof Y.i})`);
- }
- }
- function V(M) {
- const {
- verticalCompact: D,
- compactType: j
- } = M || {};
- return D === !1 ? null : j;
- }
- function X() {
- }
- const J = () => {
- };
- return dt.noop = J, dt;
- }
- var Fn = {}, nc;
- function tl() {
- if (nc) return Fn;
- nc = 1, Object.defineProperty(Fn, "__esModule", {
- value: !0
- }), Fn.calcGridColWidth = e, Fn.calcGridItemPosition = n, Fn.calcGridItemWHPx = t, Fn.calcWH = a, Fn.calcXY = r, Fn.clamp = o;
- function e(i) {
- const {
- margin: u,
- containerPadding: l,
- containerWidth: c,
- cols: s
- } = i;
- return (c - u[0] * (s - 1) - l[0] * 2) / s;
- }
- function t(i, u, l) {
- return Number.isFinite(i) ? Math.round(u * i + Math.max(0, i - 1) * l) : i;
- }
- function n(i, u, l, c, s, v) {
- const {
- margin: C,
- containerPadding: p,
- rowHeight: m
- } = i, b = e(i), f = {};
- return v && v.resizing ? (f.width = Math.round(v.resizing.width), f.height = Math.round(v.resizing.height)) : (f.width = t(c, b, C[0]), f.height = t(s, m, C[1])), v && v.dragging ? (f.top = Math.round(v.dragging.top), f.left = Math.round(v.dragging.left)) : v && v.resizing && typeof v.resizing.top == "number" && typeof v.resizing.left == "number" ? (f.top = Math.round(v.resizing.top), f.left = Math.round(v.resizing.left)) : (f.top = Math.round((m + C[1]) * l + p[1]), f.left = Math.round((b + C[0]) * u + p[0])), f;
- }
- function r(i, u, l, c, s) {
- const {
- margin: v,
- containerPadding: C,
- cols: p,
- rowHeight: m,
- maxRows: b
- } = i, f = e(i);
- let h = Math.round((l - C[0]) / (f + v[0])), g = Math.round((u - C[1]) / (m + v[1]));
- return h = o(h, 0, p - c), g = o(g, 0, b - s), {
- x: h,
- y: g
- };
- }
- function a(i, u, l, c, s, v) {
- const {
- margin: C,
- maxRows: p,
- cols: m,
- rowHeight: b
- } = i, f = e(i);
- let h = Math.round((u + C[0]) / (f + C[0])), g = Math.round((l + C[1]) / (b + C[1])), y = o(h, 0, m - c), w = o(g, 0, p - s);
- return ["sw", "w", "nw"].indexOf(v) !== -1 && (y = o(h, 0, m)), ["nw", "n", "ne"].indexOf(v) !== -1 && (w = o(g, 0, p)), {
- w: y,
- h: w
- };
- }
- function o(i, u, l) {
- return Math.max(Math.min(i, l), u);
- }
- return Fn;
- }
- var ga = {}, ya = { exports: {} }, ba = {}, fo = {}, rc;
- function bO() {
- if (rc) return fo;
- rc = 1, fo.__esModule = !0, fo.cloneElement = u;
- var e = t(me);
- function t(l) {
- return l && l.__esModule ? l : { default: l };
- }
- function n(l, c) {
- var s = Object.keys(l);
- if (Object.getOwnPropertySymbols) {
- var v = Object.getOwnPropertySymbols(l);
- c && (v = v.filter(function(C) {
- return Object.getOwnPropertyDescriptor(l, C).enumerable;
- })), s.push.apply(s, v);
- }
- return s;
- }
- function r(l) {
- for (var c = 1; c < arguments.length; c++) {
- var s = arguments[c] != null ? arguments[c] : {};
- c % 2 ? n(Object(s), !0).forEach(function(v) {
- a(l, v, s[v]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(l, Object.getOwnPropertyDescriptors(s)) : n(Object(s)).forEach(function(v) {
- Object.defineProperty(l, v, Object.getOwnPropertyDescriptor(s, v));
- });
- }
- return l;
- }
- function a(l, c, s) {
- return c = o(c), c in l ? Object.defineProperty(l, c, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : l[c] = s, l;
- }
- function o(l) {
- var c = i(l, "string");
- return typeof c == "symbol" ? c : String(c);
- }
- function i(l, c) {
- if (typeof l != "object" || l === null) return l;
- var s = l[Symbol.toPrimitive];
- if (s !== void 0) {
- var v = s.call(l, c || "default");
- if (typeof v != "object") return v;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (c === "string" ? String : Number)(l);
- }
- function u(l, c) {
- return c.style && l.props.style && (c.style = r(r({}, l.props.style), c.style)), c.className && l.props.className && (c.className = l.props.className + " " + c.className), /* @__PURE__ */ e.default.cloneElement(l, c);
- }
- return fo;
- }
- var Ca = {}, ac;
- function Qf() {
- if (ac) return Ca;
- ac = 1, Ca.__esModule = !0, Ca.resizableProps = void 0;
- var e = t(/* @__PURE__ */ sr());
- Vo();
- function t(r) {
- return r && r.__esModule ? r : { default: r };
- }
- var n = {
- /*
- * Restricts resizing to a particular axis (default: 'both')
- * 'both' - allows resizing by width or height
- * 'x' - only allows the width to be changed
- * 'y' - only allows the height to be changed
- * 'none' - disables resizing altogether
- * */
- axis: e.default.oneOf(["both", "x", "y", "none"]),
- className: e.default.string,
- /*
- * Require that one and only one child be present.
- * */
- children: e.default.element.isRequired,
- /*
- * These will be passed wholesale to react-draggable's DraggableCore
- * */
- draggableOpts: e.default.shape({
- allowAnyClick: e.default.bool,
- cancel: e.default.string,
- children: e.default.node,
- disabled: e.default.bool,
- enableUserSelectHack: e.default.bool,
- offsetParent: e.default.node,
- grid: e.default.arrayOf(e.default.number),
- handle: e.default.string,
- nodeRef: e.default.object,
- onStart: e.default.func,
- onDrag: e.default.func,
- onStop: e.default.func,
- onMouseDown: e.default.func,
- scale: e.default.number
- }),
- /*
- * Initial height
- * */
- height: function() {
- for (var a = arguments.length, o = new Array(a), i = 0; i < a; i++)
- o[i] = arguments[i];
- var u = o[0];
- if (u.axis === "both" || u.axis === "y") {
- var l;
- return (l = e.default.number).isRequired.apply(l, o);
- }
- return e.default.number.apply(e.default, o);
- },
- /*
- * Customize cursor resize handle
- * */
- handle: e.default.oneOfType([e.default.node, e.default.func]),
- /*
- * If you change this, be sure to update your css
- * */
- handleSize: e.default.arrayOf(e.default.number),
- lockAspectRatio: e.default.bool,
- /*
- * Max X & Y measure
- * */
- maxConstraints: e.default.arrayOf(e.default.number),
- /*
- * Min X & Y measure
- * */
- minConstraints: e.default.arrayOf(e.default.number),
- /*
- * Called on stop resize event
- * */
- onResizeStop: e.default.func,
- /*
- * Called on start resize event
- * */
- onResizeStart: e.default.func,
- /*
- * Called on resize event
- * */
- onResize: e.default.func,
- /*
- * Defines which resize handles should be rendered (default: 'se')
- * 's' - South handle (bottom-center)
- * 'w' - West handle (left-center)
- * 'e' - East handle (right-center)
- * 'n' - North handle (top-center)
- * 'sw' - Southwest handle (bottom-left)
- * 'nw' - Northwest handle (top-left)
- * 'se' - Southeast handle (bottom-right)
- * 'ne' - Northeast handle (top-center)
- * */
- resizeHandles: e.default.arrayOf(e.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])),
- /*
- * If `transform: scale(n)` is set on the parent, this should be set to `n`.
- * */
- transformScale: e.default.number,
- /*
- * Initial width
- */
- width: function() {
- for (var a = arguments.length, o = new Array(a), i = 0; i < a; i++)
- o[i] = arguments[i];
- var u = o[0];
- if (u.axis === "both" || u.axis === "x") {
- var l;
- return (l = e.default.number).isRequired.apply(l, o);
- }
- return e.default.number.apply(e.default, o);
- }
- };
- return Ca.resizableProps = n, Ca;
- }
- var oc;
- function Jf() {
- if (oc) return ba;
- oc = 1, ba.__esModule = !0, ba.default = void 0;
- var e = i(me), t = Vo(), n = bO(), r = Qf(), a = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
- function o(h) {
- if (typeof WeakMap != "function") return null;
- var g = /* @__PURE__ */ new WeakMap(), y = /* @__PURE__ */ new WeakMap();
- return (o = function(E) {
- return E ? y : g;
- })(h);
- }
- function i(h, g) {
- if (h && h.__esModule)
- return h;
- if (h === null || typeof h != "object" && typeof h != "function")
- return { default: h };
- var y = o(g);
- if (y && y.has(h))
- return y.get(h);
- var w = {}, E = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var S in h)
- if (S !== "default" && Object.prototype.hasOwnProperty.call(h, S)) {
- var x = E ? Object.getOwnPropertyDescriptor(h, S) : null;
- x && (x.get || x.set) ? Object.defineProperty(w, S, x) : w[S] = h[S];
- }
- return w.default = h, y && y.set(h, w), w;
- }
- function u() {
- return u = Object.assign ? Object.assign.bind() : function(h) {
- for (var g = 1; g < arguments.length; g++) {
- var y = arguments[g];
- for (var w in y)
- Object.prototype.hasOwnProperty.call(y, w) && (h[w] = y[w]);
- }
- return h;
- }, u.apply(this, arguments);
- }
- function l(h, g) {
- if (h == null) return {};
- var y = {}, w = Object.keys(h), E, S;
- for (S = 0; S < w.length; S++)
- E = w[S], !(g.indexOf(E) >= 0) && (y[E] = h[E]);
- return y;
- }
- function c(h, g) {
- var y = Object.keys(h);
- if (Object.getOwnPropertySymbols) {
- var w = Object.getOwnPropertySymbols(h);
- g && (w = w.filter(function(E) {
- return Object.getOwnPropertyDescriptor(h, E).enumerable;
- })), y.push.apply(y, w);
- }
- return y;
- }
- function s(h) {
- for (var g = 1; g < arguments.length; g++) {
- var y = arguments[g] != null ? arguments[g] : {};
- g % 2 ? c(Object(y), !0).forEach(function(w) {
- v(h, w, y[w]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(h, Object.getOwnPropertyDescriptors(y)) : c(Object(y)).forEach(function(w) {
- Object.defineProperty(h, w, Object.getOwnPropertyDescriptor(y, w));
- });
- }
- return h;
- }
- function v(h, g, y) {
- return g = C(g), g in h ? Object.defineProperty(h, g, { value: y, enumerable: !0, configurable: !0, writable: !0 }) : h[g] = y, h;
- }
- function C(h) {
- var g = p(h, "string");
- return typeof g == "symbol" ? g : String(g);
- }
- function p(h, g) {
- if (typeof h != "object" || h === null) return h;
- var y = h[Symbol.toPrimitive];
- if (y !== void 0) {
- var w = y.call(h, g || "default");
- if (typeof w != "object") return w;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (g === "string" ? String : Number)(h);
- }
- function m(h, g) {
- h.prototype = Object.create(g.prototype), h.prototype.constructor = h, b(h, g);
- }
- function b(h, g) {
- return b = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(w, E) {
- return w.__proto__ = E, w;
- }, b(h, g);
- }
- var f = /* @__PURE__ */ function(h) {
- m(g, h);
- function g() {
- for (var w, E = arguments.length, S = new Array(E), x = 0; x < E; x++)
- S[x] = arguments[x];
- return w = h.call.apply(h, [this].concat(S)) || this, w.handleRefs = {}, w.lastHandleRect = null, w.slack = null, w;
- }
- var y = g.prototype;
- return y.componentWillUnmount = function() {
- this.resetData();
- }, y.resetData = function() {
- this.lastHandleRect = this.slack = null;
- }, y.runConstraints = function(E, S) {
- var x = this.props, R = x.minConstraints, k = x.maxConstraints, L = x.lockAspectRatio;
- if (!R && !k && !L) return [E, S];
- if (L) {
- var O = this.props.width / this.props.height, N = E - this.props.width, F = S - this.props.height;
- Math.abs(N) > Math.abs(F * O) ? S = E / O : E = S * O;
- }
- var I = E, T = S, P = this.slack || [0, 0], z = P[0], _ = P[1];
- return E += z, S += _, R && (E = Math.max(R[0], E), S = Math.max(R[1], S)), k && (E = Math.min(k[0], E), S = Math.min(k[1], S)), this.slack = [z + (I - E), _ + (T - S)], [E, S];
- }, y.resizeHandler = function(E, S) {
- var x = this;
- return function(R, k) {
- var L = k.node, O = k.deltaX, N = k.deltaY;
- E === "onResizeStart" && x.resetData();
- var F = (x.props.axis === "both" || x.props.axis === "x") && S !== "n" && S !== "s", I = (x.props.axis === "both" || x.props.axis === "y") && S !== "e" && S !== "w";
- if (!(!F && !I)) {
- var T = S[0], P = S[S.length - 1], z = L.getBoundingClientRect();
- if (x.lastHandleRect != null) {
- if (P === "w") {
- var _ = z.left - x.lastHandleRect.left;
- O += _;
- }
- if (T === "n") {
- var A = z.top - x.lastHandleRect.top;
- N += A;
- }
- }
- x.lastHandleRect = z, P === "w" && (O = -O), T === "n" && (N = -N);
- var H = x.props.width + (F ? O / x.props.transformScale : 0), $ = x.props.height + (I ? N / x.props.transformScale : 0), U = x.runConstraints(H, $);
- H = U[0], $ = U[1];
- var G = H !== x.props.width || $ !== x.props.height, B = typeof x.props[E] == "function" ? x.props[E] : null, ne = E === "onResize" && !G;
- B && !ne && (R.persist == null || R.persist(), B(R, {
- node: L,
- size: {
- width: H,
- height: $
- },
- handle: S
- })), E === "onResizeStop" && x.resetData();
- }
- };
- }, y.renderResizeHandle = function(E, S) {
- var x = this.props.handle;
- if (!x)
- return /* @__PURE__ */ e.createElement("span", {
- className: "react-resizable-handle react-resizable-handle-" + E,
- ref: S
- });
- if (typeof x == "function")
- return x(E, S);
- var R = typeof x.type == "string", k = s({
- ref: S
- }, R ? {} : {
- handleAxis: E
- });
- return /* @__PURE__ */ e.cloneElement(x, k);
- }, y.render = function() {
- var E = this, S = this.props, x = S.children, R = S.className, k = S.draggableOpts;
- S.width, S.height, S.handle, S.handleSize, S.lockAspectRatio, S.axis, S.minConstraints, S.maxConstraints, S.onResize, S.onResizeStop, S.onResizeStart;
- var L = S.resizeHandles;
- S.transformScale;
- var O = l(S, a);
- return (0, n.cloneElement)(x, s(s({}, O), {}, {
- className: (R ? R + " " : "") + "react-resizable",
- children: [].concat(x.props.children, L.map(function(N) {
- var F, I = (F = E.handleRefs[N]) != null ? F : E.handleRefs[N] = /* @__PURE__ */ e.createRef();
- return /* @__PURE__ */ e.createElement(t.DraggableCore, u({}, k, {
- nodeRef: I,
- key: "resizableHandle-" + N,
- onStop: E.resizeHandler("onResizeStop", N),
- onStart: E.resizeHandler("onResizeStart", N),
- onDrag: E.resizeHandler("onResize", N)
- }), E.renderResizeHandle(N, I));
- }))
- }));
- }, g;
- }(e.Component);
- return ba.default = f, f.propTypes = r.resizableProps, f.defaultProps = {
- axis: "both",
- handleSize: [20, 20],
- lockAspectRatio: !1,
- minConstraints: [20, 20],
- maxConstraints: [1 / 0, 1 / 0],
- resizeHandles: ["se"],
- transformScale: 1
- }, ba;
- }
- var Sa = {}, ic;
- function CO() {
- if (ic) return Sa;
- ic = 1, Sa.__esModule = !0, Sa.default = void 0;
- var e = u(me), t = o(/* @__PURE__ */ sr()), n = o(Jf()), r = Qf(), a = ["handle", "handleSize", "onResize", "onResizeStart", "onResizeStop", "draggableOpts", "minConstraints", "maxConstraints", "lockAspectRatio", "axis", "width", "height", "resizeHandles", "style", "transformScale"];
- function o(g) {
- return g && g.__esModule ? g : { default: g };
- }
- function i(g) {
- if (typeof WeakMap != "function") return null;
- var y = /* @__PURE__ */ new WeakMap(), w = /* @__PURE__ */ new WeakMap();
- return (i = function(S) {
- return S ? w : y;
- })(g);
- }
- function u(g, y) {
- if (g && g.__esModule)
- return g;
- if (g === null || typeof g != "object" && typeof g != "function")
- return { default: g };
- var w = i(y);
- if (w && w.has(g))
- return w.get(g);
- var E = {}, S = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var x in g)
- if (x !== "default" && Object.prototype.hasOwnProperty.call(g, x)) {
- var R = S ? Object.getOwnPropertyDescriptor(g, x) : null;
- R && (R.get || R.set) ? Object.defineProperty(E, x, R) : E[x] = g[x];
- }
- return E.default = g, w && w.set(g, E), E;
- }
- function l() {
- return l = Object.assign ? Object.assign.bind() : function(g) {
- for (var y = 1; y < arguments.length; y++) {
- var w = arguments[y];
- for (var E in w)
- Object.prototype.hasOwnProperty.call(w, E) && (g[E] = w[E]);
- }
- return g;
- }, l.apply(this, arguments);
- }
- function c(g, y) {
- var w = Object.keys(g);
- if (Object.getOwnPropertySymbols) {
- var E = Object.getOwnPropertySymbols(g);
- y && (E = E.filter(function(S) {
- return Object.getOwnPropertyDescriptor(g, S).enumerable;
- })), w.push.apply(w, E);
- }
- return w;
- }
- function s(g) {
- for (var y = 1; y < arguments.length; y++) {
- var w = arguments[y] != null ? arguments[y] : {};
- y % 2 ? c(Object(w), !0).forEach(function(E) {
- v(g, E, w[E]);
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(g, Object.getOwnPropertyDescriptors(w)) : c(Object(w)).forEach(function(E) {
- Object.defineProperty(g, E, Object.getOwnPropertyDescriptor(w, E));
- });
- }
- return g;
- }
- function v(g, y, w) {
- return y = C(y), y in g ? Object.defineProperty(g, y, { value: w, enumerable: !0, configurable: !0, writable: !0 }) : g[y] = w, g;
- }
- function C(g) {
- var y = p(g, "string");
- return typeof y == "symbol" ? y : String(y);
- }
- function p(g, y) {
- if (typeof g != "object" || g === null) return g;
- var w = g[Symbol.toPrimitive];
- if (w !== void 0) {
- var E = w.call(g, y || "default");
- if (typeof E != "object") return E;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (y === "string" ? String : Number)(g);
- }
- function m(g, y) {
- if (g == null) return {};
- var w = {}, E = Object.keys(g), S, x;
- for (x = 0; x < E.length; x++)
- S = E[x], !(y.indexOf(S) >= 0) && (w[S] = g[S]);
- return w;
- }
- function b(g, y) {
- g.prototype = Object.create(y.prototype), g.prototype.constructor = g, f(g, y);
- }
- function f(g, y) {
- return f = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(E, S) {
- return E.__proto__ = S, E;
- }, f(g, y);
- }
- var h = /* @__PURE__ */ function(g) {
- b(y, g);
- function y() {
- for (var E, S = arguments.length, x = new Array(S), R = 0; R < S; R++)
- x[R] = arguments[R];
- return E = g.call.apply(g, [this].concat(x)) || this, E.state = {
- width: E.props.width,
- height: E.props.height,
- propsWidth: E.props.width,
- propsHeight: E.props.height
- }, E.onResize = function(k, L) {
- var O = L.size;
- E.props.onResize ? (k.persist == null || k.persist(), E.setState(O, function() {
- return E.props.onResize && E.props.onResize(k, L);
- })) : E.setState(O);
- }, E;
- }
- y.getDerivedStateFromProps = function(S, x) {
- return x.propsWidth !== S.width || x.propsHeight !== S.height ? {
- width: S.width,
- height: S.height,
- propsWidth: S.width,
- propsHeight: S.height
- } : null;
- };
- var w = y.prototype;
- return w.render = function() {
- var S = this.props, x = S.handle, R = S.handleSize;
- S.onResize;
- var k = S.onResizeStart, L = S.onResizeStop, O = S.draggableOpts, N = S.minConstraints, F = S.maxConstraints, I = S.lockAspectRatio, T = S.axis;
- S.width, S.height;
- var P = S.resizeHandles, z = S.style, _ = S.transformScale, A = m(S, a);
- return /* @__PURE__ */ e.createElement(n.default, {
- axis: T,
- draggableOpts: O,
- handle: x,
- handleSize: R,
- height: this.state.height,
- lockAspectRatio: I,
- maxConstraints: F,
- minConstraints: N,
- onResizeStart: k,
- onResize: this.onResize,
- onResizeStop: L,
- resizeHandles: P,
- transformScale: _,
- width: this.state.width
- }, /* @__PURE__ */ e.createElement("div", l({}, A, {
- style: s(s({}, z), {}, {
- width: this.state.width + "px",
- height: this.state.height + "px"
- })
- })));
- }, y;
- }(e.Component);
- return Sa.default = h, h.propTypes = s(s({}, r.resizableProps), {}, {
- children: t.default.element
- }), Sa;
- }
- var uc;
- function SO() {
- return uc || (uc = 1, ya.exports = function() {
- throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable");
- }, ya.exports.Resizable = Jf().default, ya.exports.ResizableBox = CO().default), ya.exports;
- }
- var zn = {}, lc;
- function ev() {
- if (lc) return zn;
- lc = 1, Object.defineProperty(zn, "__esModule", {
- value: !0
- }), zn.resizeHandleType = zn.resizeHandleAxesType = zn.default = void 0;
- var e = n(/* @__PURE__ */ sr()), t = n(me);
- function n(o) {
- return o && o.__esModule ? o : { default: o };
- }
- const r = zn.resizeHandleAxesType = e.default.arrayOf(e.default.oneOf(["s", "w", "e", "n", "sw", "nw", "se", "ne"])), a = zn.resizeHandleType = e.default.oneOfType([e.default.node, e.default.func]);
- return zn.default = {
- //
- // Basic props
- //
- className: e.default.string,
- style: e.default.object,
- // This can be set explicitly. If it is not set, it will automatically
- // be set to the container width. Note that resizes will *not* cause this to adjust.
- // If you need that behavior, use WidthProvider.
- width: e.default.number,
- // If true, the container height swells and contracts to fit contents
- autoSize: e.default.bool,
- // # of cols.
- cols: e.default.number,
- // A selector that will not be draggable.
- draggableCancel: e.default.string,
- // A selector for the draggable handler
- draggableHandle: e.default.string,
- // Deprecated
- verticalCompact: function(o) {
- o.verticalCompact;
- },
- // Choose vertical or hotizontal compaction
- compactType: e.default.oneOf(["vertical", "horizontal"]),
- // layout is an array of object with the format:
- // {x: Number, y: Number, w: Number, h: Number, i: String}
- layout: function(o) {
- var i = o.layout;
- i !== void 0 && Jr().validateLayout(i, "layout");
- },
- //
- // Grid Dimensions
- //
- // Margin between items [x, y] in px
- margin: e.default.arrayOf(e.default.number),
- // Padding inside the container [x, y] in px
- containerPadding: e.default.arrayOf(e.default.number),
- // Rows have a static height, but you can change this based on breakpoints if you like
- rowHeight: e.default.number,
- // Default Infinity, but you can specify a max here if you like.
- // Note that this isn't fully fleshed out and won't error if you specify a layout that
- // extends beyond the row capacity. It will, however, not allow users to drag/resize
- // an item past the barrier. They can push items beyond the barrier, though.
- // Intentionally not documented for this reason.
- maxRows: e.default.number,
- //
- // Flags
- //
- isBounded: e.default.bool,
- isDraggable: e.default.bool,
- isResizable: e.default.bool,
- // If true, grid can be placed one over the other.
- allowOverlap: e.default.bool,
- // If true, grid items won't change position when being dragged over.
- preventCollision: e.default.bool,
- // Use CSS transforms instead of top/left
- useCSSTransforms: e.default.bool,
- // parent layout transform scale
- transformScale: e.default.number,
- // If true, an external element can trigger onDrop callback with a specific grid position as a parameter
- isDroppable: e.default.bool,
- // Resize handle options
- resizeHandles: r,
- resizeHandle: a,
- //
- // Callbacks
- //
- // Callback so you can save the layout. Calls after each drag & resize stops.
- onLayoutChange: e.default.func,
- // Calls when drag starts. Callback is of the signature (layout, oldItem, newItem, placeholder, e, ?node).
- // All callbacks below have the same signature. 'start' and 'stop' callbacks omit the 'placeholder'.
- onDragStart: e.default.func,
- // Calls on each drag movement.
- onDrag: e.default.func,
- // Calls when drag is complete.
- onDragStop: e.default.func,
- //Calls when resize starts.
- onResizeStart: e.default.func,
- // Calls when resize movement happens.
- onResize: e.default.func,
- // Calls when resize is complete.
- onResizeStop: e.default.func,
- // Calls when some element is dropped.
- onDrop: e.default.func,
- //
- // Other validations
- //
- droppingItem: e.default.shape({
- i: e.default.string.isRequired,
- w: e.default.number.isRequired,
- h: e.default.number.isRequired
- }),
- // Children must not have duplicate keys.
- children: function(o, i) {
- const u = o[i], l = {};
- t.default.Children.forEach(u, function(c) {
- if ((c == null ? void 0 : c.key) != null) {
- if (l[c.key])
- throw new Error('Duplicate child key "' + c.key + '" found! This will cause problems in ReactGridLayout.');
- l[c.key] = !0;
- }
- });
- },
- // Optional ref for getting a reference for the wrapping div.
- innerRef: e.default.any
- }, zn;
- }
- var sc;
- function wO() {
- if (sc) return ga;
- sc = 1, Object.defineProperty(ga, "__esModule", {
- value: !0
- }), ga.default = void 0;
- var e = l(me), t = l(/* @__PURE__ */ sr()), n = Vo(), r = SO(), a = Jr(), o = tl(), i = ev(), u = l(el());
- function l(p) {
- return p && p.__esModule ? p : { default: p };
- }
- function c(p, m, b) {
- return m = s(m), m in p ? Object.defineProperty(p, m, { value: b, enumerable: !0, configurable: !0, writable: !0 }) : p[m] = b, p;
- }
- function s(p) {
- var m = v(p, "string");
- return typeof m == "symbol" ? m : String(m);
- }
- function v(p, m) {
- if (typeof p != "object" || p === null) return p;
- var b = p[Symbol.toPrimitive];
- if (b !== void 0) {
- var f = b.call(p, m || "default");
- if (typeof f != "object") return f;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (m === "string" ? String : Number)(p);
- }
- let C = class extends e.default.Component {
- constructor() {
- super(...arguments), c(this, "state", {
- resizing: null,
- dragging: null,
- className: ""
- }), c(this, "elementRef", /* @__PURE__ */ e.default.createRef()), c(this, "onDragStart", (m, b) => {
- let {
- node: f
- } = b;
- const {
- onDragStart: h,
- transformScale: g
- } = this.props;
- if (!h) return;
- const y = {
- top: 0,
- left: 0
- }, {
- offsetParent: w
- } = f;
- if (!w) return;
- const E = w.getBoundingClientRect(), S = f.getBoundingClientRect(), x = S.left / g, R = E.left / g, k = S.top / g, L = E.top / g;
- y.left = x - R + w.scrollLeft, y.top = k - L + w.scrollTop, this.setState({
- dragging: y
- });
- const {
- x: O,
- y: N
- } = (0, o.calcXY)(this.getPositionParams(), y.top, y.left, this.props.w, this.props.h);
- return h.call(this, this.props.i, O, N, {
- e: m,
- node: f,
- newPosition: y
- });
- }), c(this, "onDrag", (m, b) => {
- let {
- node: f,
- deltaX: h,
- deltaY: g
- } = b;
- const {
- onDrag: y
- } = this.props;
- if (!y) return;
- if (!this.state.dragging)
- throw new Error("onDrag called before onDragStart.");
- let w = this.state.dragging.top + g, E = this.state.dragging.left + h;
- const {
- isBounded: S,
- i: x,
- w: R,
- h: k,
- containerWidth: L
- } = this.props, O = this.getPositionParams();
- if (S) {
- const {
- offsetParent: T
- } = f;
- if (T) {
- const {
- margin: P,
- rowHeight: z,
- containerPadding: _
- } = this.props, A = T.clientHeight - (0, o.calcGridItemWHPx)(k, z, P[1]);
- w = (0, o.clamp)(w - _[1], 0, A);
- const H = (0, o.calcGridColWidth)(O), $ = L - (0, o.calcGridItemWHPx)(R, H, P[0]);
- E = (0, o.clamp)(E - _[0], 0, $);
- }
- }
- const N = {
- top: w,
- left: E
- };
- this.setState({
- dragging: N
- });
- const {
- x: F,
- y: I
- } = (0, o.calcXY)(O, w, E, R, k);
- return y.call(this, x, F, I, {
- e: m,
- node: f,
- newPosition: N
- });
- }), c(this, "onDragStop", (m, b) => {
- let {
- node: f
- } = b;
- const {
- onDragStop: h
- } = this.props;
- if (!h) return;
- if (!this.state.dragging)
- throw new Error("onDragEnd called before onDragStart.");
- const {
- w: g,
- h: y,
- i: w
- } = this.props, {
- left: E,
- top: S
- } = this.state.dragging, x = {
- top: S,
- left: E
- };
- this.setState({
- dragging: null
- });
- const {
- x: R,
- y: k
- } = (0, o.calcXY)(this.getPositionParams(), S, E, g, y);
- return h.call(this, w, R, k, {
- e: m,
- node: f,
- newPosition: x
- });
- }), c(this, "onResizeStop", (m, b, f) => this.onResizeHandler(m, b, f, "onResizeStop")), c(this, "onResizeStart", (m, b, f) => this.onResizeHandler(m, b, f, "onResizeStart")), c(this, "onResize", (m, b, f) => this.onResizeHandler(m, b, f, "onResize"));
- }
- shouldComponentUpdate(m, b) {
- if (this.props.children !== m.children || this.props.droppingPosition !== m.droppingPosition) return !0;
- const f = (0, o.calcGridItemPosition)(this.getPositionParams(this.props), this.props.x, this.props.y, this.props.w, this.props.h, this.state), h = (0, o.calcGridItemPosition)(this.getPositionParams(m), m.x, m.y, m.w, m.h, b);
- return !(0, a.fastPositionEqual)(f, h) || this.props.useCSSTransforms !== m.useCSSTransforms;
- }
- componentDidMount() {
- this.moveDroppingItem({});
- }
- componentDidUpdate(m) {
- this.moveDroppingItem(m);
- }
- // When a droppingPosition is present, this means we should fire a move event, as if we had moved
- // this element by `x, y` pixels.
- moveDroppingItem(m) {
- const {
- droppingPosition: b
- } = this.props;
- if (!b) return;
- const f = this.elementRef.current;
- if (!f) return;
- const h = m.droppingPosition || {
- left: 0,
- top: 0
- }, {
- dragging: g
- } = this.state, y = g && b.left !== h.left || b.top !== h.top;
- if (!g)
- this.onDragStart(b.e, {
- node: f,
- deltaX: b.left,
- deltaY: b.top
- });
- else if (y) {
- const w = b.left - g.left, E = b.top - g.top;
- this.onDrag(b.e, {
- node: f,
- deltaX: w,
- deltaY: E
- });
- }
- }
- getPositionParams() {
- let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.props;
- return {
- cols: m.cols,
- containerPadding: m.containerPadding,
- containerWidth: m.containerWidth,
- margin: m.margin,
- maxRows: m.maxRows,
- rowHeight: m.rowHeight
- };
- }
- /**
- * This is where we set the grid item's absolute placement. It gets a little tricky because we want to do it
- * well when server rendering, and the only way to do that properly is to use percentage width/left because
- * we don't know exactly what the browser viewport is.
- * Unfortunately, CSS Transforms, which are great for performance, break in this instance because a percentage
- * left is relative to the item itself, not its container! So we cannot use them on the server rendering pass.
- *
- * @param {Object} pos Position object with width, height, left, top.
- * @return {Object} Style object.
- */
- createStyle(m) {
- const {
- usePercentages: b,
- containerWidth: f,
- useCSSTransforms: h
- } = this.props;
- let g;
- return h ? g = (0, a.setTransform)(m) : (g = (0, a.setTopLeft)(m), b && (g.left = (0, a.perc)(m.left / f), g.width = (0, a.perc)(m.width / f))), g;
- }
- /**
- * Mix a Draggable instance into a child.
- * @param {Element} child Child element.
- * @return {Element} Child wrapped in Draggable.
- */
- mixinDraggable(m, b) {
- return /* @__PURE__ */ e.default.createElement(n.DraggableCore, {
- disabled: !b,
- onStart: this.onDragStart,
- onDrag: this.onDrag,
- onStop: this.onDragStop,
- handle: this.props.handle,
- cancel: ".react-resizable-handle" + (this.props.cancel ? "," + this.props.cancel : ""),
- scale: this.props.transformScale,
- nodeRef: this.elementRef
- }, m);
- }
- /**
- * Utility function to setup callback handler definitions for
- * similarily structured resize events.
- */
- curryResizeHandler(m, b) {
- return (f, h) => (
- /*: Function*/
- b(f, h, m)
- );
- }
- /**
- * Mix a Resizable instance into a child.
- * @param {Element} child Child element.
- * @param {Object} position Position object (pixel values)
- * @return {Element} Child wrapped in Resizable.
- */
- mixinResizable(m, b, f) {
- const {
- cols: h,
- minW: g,
- minH: y,
- maxW: w,
- maxH: E,
- transformScale: S,
- resizeHandles: x,
- resizeHandle: R
- } = this.props, k = this.getPositionParams(), L = (0, o.calcGridItemPosition)(k, 0, 0, h, 0).width, O = (0, o.calcGridItemPosition)(k, 0, 0, g, y), N = (0, o.calcGridItemPosition)(k, 0, 0, w, E), F = [O.width, O.height], I = [Math.min(N.width, L), Math.min(N.height, 1 / 0)];
- return /* @__PURE__ */ e.default.createElement(
- r.Resizable,
- {
- draggableOpts: {
- disabled: !f
- },
- className: f ? void 0 : "react-resizable-hide",
- width: b.width,
- height: b.height,
- minConstraints: F,
- maxConstraints: I,
- onResizeStop: this.curryResizeHandler(b, this.onResizeStop),
- onResizeStart: this.curryResizeHandler(b, this.onResizeStart),
- onResize: this.curryResizeHandler(b, this.onResize),
- transformScale: S,
- resizeHandles: x,
- handle: R
- },
- m
- );
- }
- /**
- * Wrapper around resize events to provide more useful data.
- */
- onResizeHandler(m, b, f, h) {
- let {
- node: g,
- size: y,
- handle: w
- } = b;
- const E = this.props[h];
- if (!E) return;
- const {
- x: S,
- y: x,
- i: R,
- maxH: k,
- minH: L,
- containerWidth: O
- } = this.props, {
- minW: N,
- maxW: F
- } = this.props;
- let I = y;
- g && (I = (0, a.resizeItemInDirection)(w, f, y, O), this.setState({
- resizing: h === "onResizeStop" ? null : I
- }));
- let {
- w: T,
- h: P
- } = (0, o.calcWH)(this.getPositionParams(), I.width, I.height, S, x, w);
- T = (0, o.clamp)(T, Math.max(N, 1), F), P = (0, o.clamp)(P, L, k), E.call(this, R, T, P, {
- e: m,
- node: g,
- size: I,
- handle: w
- });
- }
- render() {
- const {
- x: m,
- y: b,
- w: f,
- h,
- isDraggable: g,
- isResizable: y,
- droppingPosition: w,
- useCSSTransforms: E
- } = this.props, S = (0, o.calcGridItemPosition)(this.getPositionParams(), m, b, f, h, this.state), x = e.default.Children.only(this.props.children);
- let R = /* @__PURE__ */ e.default.cloneElement(x, {
- ref: this.elementRef,
- className: (0, u.default)("react-grid-item", x.props.className, this.props.className, {
- static: this.props.static,
- resizing: !!this.state.resizing,
- "react-draggable": g,
- "react-draggable-dragging": !!this.state.dragging,
- dropping: !!w,
- cssTransforms: E
- }),
- // We can set the width and height on the child, but unfortunately we can't set the position.
- style: {
- ...this.props.style,
- ...x.props.style,
- ...this.createStyle(S)
- }
- });
- return R = this.mixinResizable(R, S, y), R = this.mixinDraggable(R, g), R;
- }
- };
- return ga.default = C, c(C, "propTypes", {
- // Children must be only a single element
- children: t.default.element,
- // General grid attributes
- cols: t.default.number.isRequired,
- containerWidth: t.default.number.isRequired,
- rowHeight: t.default.number.isRequired,
- margin: t.default.array.isRequired,
- maxRows: t.default.number.isRequired,
- containerPadding: t.default.array.isRequired,
- // These are all in grid units
- x: t.default.number.isRequired,
- y: t.default.number.isRequired,
- w: t.default.number.isRequired,
- h: t.default.number.isRequired,
- // All optional
- minW: function(p, m) {
- const b = p[m];
- if (typeof b != "number") return new Error("minWidth not Number");
- if (b > p.w || b > p.maxW) return new Error("minWidth larger than item width/maxWidth");
- },
- maxW: function(p, m) {
- const b = p[m];
- if (typeof b != "number") return new Error("maxWidth not Number");
- if (b < p.w || b < p.minW) return new Error("maxWidth smaller than item width/minWidth");
- },
- minH: function(p, m) {
- const b = p[m];
- if (typeof b != "number") return new Error("minHeight not Number");
- if (b > p.h || b > p.maxH) return new Error("minHeight larger than item height/maxHeight");
- },
- maxH: function(p, m) {
- const b = p[m];
- if (typeof b != "number") return new Error("maxHeight not Number");
- if (b < p.h || b < p.minH) return new Error("maxHeight smaller than item height/minHeight");
- },
- // ID is nice to have for callbacks
- i: t.default.string.isRequired,
- // Resize handle options
- resizeHandles: i.resizeHandleAxesType,
- resizeHandle: i.resizeHandleType,
- // Functions
- onDragStop: t.default.func,
- onDragStart: t.default.func,
- onDrag: t.default.func,
- onResizeStop: t.default.func,
- onResizeStart: t.default.func,
- onResize: t.default.func,
- // Flags
- isDraggable: t.default.bool.isRequired,
- isResizable: t.default.bool.isRequired,
- isBounded: t.default.bool.isRequired,
- static: t.default.bool,
- // Use CSS transforms instead of top/left
- useCSSTransforms: t.default.bool.isRequired,
- transformScale: t.default.number,
- // Others
- className: t.default.string,
- // Selector for draggable handle
- handle: t.default.string,
- // Selector for draggable cancel (see react-draggable)
- cancel: t.default.string,
- // Current position of a dropping element
- droppingPosition: t.default.shape({
- e: t.default.object.isRequired,
- left: t.default.number.isRequired,
- top: t.default.number.isRequired
- })
- }), c(C, "defaultProps", {
- className: "",
- cancel: "",
- handle: "",
- minH: 1,
- minW: 1,
- maxH: 1 / 0,
- maxW: 1 / 0,
- transformScale: 1
- }), ga;
- }
- var cc;
- function tv() {
- if (cc) return ha;
- cc = 1, Object.defineProperty(ha, "__esModule", {
- value: !0
- }), ha.default = void 0;
- var e = c(me), t = /* @__PURE__ */ Ju(), n = u(el()), r = Jr(), a = tl(), o = u(wO()), i = u(ev());
- function u(f) {
- return f && f.__esModule ? f : { default: f };
- }
- function l(f) {
- if (typeof WeakMap != "function") return null;
- var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap();
- return (l = function(y) {
- return y ? g : h;
- })(f);
- }
- function c(f, h) {
- if (f && f.__esModule) return f;
- if (f === null || typeof f != "object" && typeof f != "function") return { default: f };
- var g = l(h);
- if (g && g.has(f)) return g.get(f);
- var y = { __proto__: null }, w = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var E in f) if (E !== "default" && Object.prototype.hasOwnProperty.call(f, E)) {
- var S = w ? Object.getOwnPropertyDescriptor(f, E) : null;
- S && (S.get || S.set) ? Object.defineProperty(y, E, S) : y[E] = f[E];
- }
- return y.default = f, g && g.set(f, y), y;
- }
- function s(f, h, g) {
- return h = v(h), h in f ? Object.defineProperty(f, h, { value: g, enumerable: !0, configurable: !0, writable: !0 }) : f[h] = g, f;
- }
- function v(f) {
- var h = C(f, "string");
- return typeof h == "symbol" ? h : String(h);
- }
- function C(f, h) {
- if (typeof f != "object" || f === null) return f;
- var g = f[Symbol.toPrimitive];
- if (g !== void 0) {
- var y = g.call(f, h || "default");
- if (typeof y != "object") return y;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (h === "string" ? String : Number)(f);
- }
- const p = "react-grid-layout";
- let m = !1;
- try {
- m = /firefox/i.test(navigator.userAgent);
- } catch {
- }
- class b extends e.Component {
- constructor() {
- super(...arguments), s(this, "state", {
- activeDrag: null,
- layout: (0, r.synchronizeLayoutWithChildren)(
- this.props.layout,
- this.props.children,
- this.props.cols,
- // Legacy support for verticalCompact: false
- (0, r.compactType)(this.props),
- this.props.allowOverlap
- ),
- mounted: !1,
- oldDragItem: null,
- oldLayout: null,
- oldResizeItem: null,
- resizing: !1,
- droppingDOMNode: null,
- children: []
- }), s(this, "dragEnterCounter", 0), s(this, "onDragStart", (h, g, y, w) => {
- let {
- e: E,
- node: S
- } = w;
- const {
- layout: x
- } = this.state, R = (0, r.getLayoutItem)(x, h);
- if (!R) return;
- const k = {
- w: R.w,
- h: R.h,
- x: R.x,
- y: R.y,
- placeholder: !0,
- i: h
- };
- return this.setState({
- oldDragItem: (0, r.cloneLayoutItem)(R),
- oldLayout: x,
- activeDrag: k
- }), this.props.onDragStart(x, R, R, null, E, S);
- }), s(this, "onDrag", (h, g, y, w) => {
- let {
- e: E,
- node: S
- } = w;
- const {
- oldDragItem: x
- } = this.state;
- let {
- layout: R
- } = this.state;
- const {
- cols: k,
- allowOverlap: L,
- preventCollision: O
- } = this.props, N = (0, r.getLayoutItem)(R, h);
- if (!N) return;
- const F = {
- w: N.w,
- h: N.h,
- x: N.x,
- y: N.y,
- placeholder: !0,
- i: h
- };
- R = (0, r.moveElement)(R, N, g, y, !0, O, (0, r.compactType)(this.props), k, L), this.props.onDrag(R, x, N, F, E, S), this.setState({
- layout: L ? R : (0, r.compact)(R, (0, r.compactType)(this.props), k),
- activeDrag: F
- });
- }), s(this, "onDragStop", (h, g, y, w) => {
- let {
- e: E,
- node: S
- } = w;
- if (!this.state.activeDrag) return;
- const {
- oldDragItem: x
- } = this.state;
- let {
- layout: R
- } = this.state;
- const {
- cols: k,
- preventCollision: L,
- allowOverlap: O
- } = this.props, N = (0, r.getLayoutItem)(R, h);
- if (!N) return;
- R = (0, r.moveElement)(R, N, g, y, !0, L, (0, r.compactType)(this.props), k, O);
- const I = O ? R : (0, r.compact)(R, (0, r.compactType)(this.props), k);
- this.props.onDragStop(I, x, N, null, E, S);
- const {
- oldLayout: T
- } = this.state;
- this.setState({
- activeDrag: null,
- layout: I,
- oldDragItem: null,
- oldLayout: null
- }), this.onLayoutMaybeChanged(I, T);
- }), s(this, "onResizeStart", (h, g, y, w) => {
- let {
- e: E,
- node: S
- } = w;
- const {
- layout: x
- } = this.state, R = (0, r.getLayoutItem)(x, h);
- R && (this.setState({
- oldResizeItem: (0, r.cloneLayoutItem)(R),
- oldLayout: this.state.layout,
- resizing: !0
- }), this.props.onResizeStart(x, R, R, null, E, S));
- }), s(this, "onResize", (h, g, y, w) => {
- let {
- e: E,
- node: S,
- size: x,
- handle: R
- } = w;
- const {
- oldResizeItem: k
- } = this.state, {
- layout: L
- } = this.state, {
- cols: O,
- preventCollision: N,
- allowOverlap: F
- } = this.props;
- let I = !1, T, P, z;
- const [_, A] = (0, r.withLayoutItem)(L, h, ($) => {
- let U;
- return P = $.x, z = $.y, ["sw", "w", "nw", "n", "ne"].indexOf(R) !== -1 && (["sw", "nw", "w"].indexOf(R) !== -1 && (P = $.x + ($.w - g), g = $.x !== P && P < 0 ? $.w : g, P = P < 0 ? 0 : P), ["ne", "n", "nw"].indexOf(R) !== -1 && (z = $.y + ($.h - y), y = $.y !== z && z < 0 ? $.h : y, z = z < 0 ? 0 : z), I = !0), N && !F && (U = (0, r.getAllCollisions)(L, {
- ...$,
- w: g,
- h: y,
- x: P,
- y: z
- }).filter((B) => B.i !== $.i).length > 0, U && (z = $.y, y = $.h, P = $.x, g = $.w, I = !1)), $.w = g, $.h = y, $;
- });
- if (!A) return;
- T = _, I && (T = (0, r.moveElement)(_, A, P, z, !0, this.props.preventCollision, (0, r.compactType)(this.props), O, F));
- const H = {
- w: A.w,
- h: A.h,
- x: A.x,
- y: A.y,
- static: !0,
- i: h
- };
- this.props.onResize(T, k, A, H, E, S), this.setState({
- layout: F ? T : (0, r.compact)(T, (0, r.compactType)(this.props), O),
- activeDrag: H
- });
- }), s(this, "onResizeStop", (h, g, y, w) => {
- let {
- e: E,
- node: S
- } = w;
- const {
- layout: x,
- oldResizeItem: R
- } = this.state, {
- cols: k,
- allowOverlap: L
- } = this.props, O = (0, r.getLayoutItem)(x, h), N = L ? x : (0, r.compact)(x, (0, r.compactType)(this.props), k);
- this.props.onResizeStop(N, R, O, null, E, S);
- const {
- oldLayout: F
- } = this.state;
- this.setState({
- activeDrag: null,
- layout: N,
- oldResizeItem: null,
- oldLayout: null,
- resizing: !1
- }), this.onLayoutMaybeChanged(N, F);
- }), s(this, "onDragOver", (h) => {
- var _;
- if (h.preventDefault(), h.stopPropagation(), m && // $FlowIgnore can't figure this out
- !((_ = h.nativeEvent.target) != null && _.classList.contains(p)))
- return !1;
- const {
- droppingItem: g,
- onDropDragOver: y,
- margin: w,
- cols: E,
- rowHeight: S,
- maxRows: x,
- width: R,
- containerPadding: k,
- transformScale: L
- } = this.props, O = y == null ? void 0 : y(h);
- if (O === !1)
- return this.state.droppingDOMNode && this.removeDroppingPlaceholder(), !1;
- const N = {
- ...g,
- ...O
- }, {
- layout: F
- } = this.state, I = h.currentTarget.getBoundingClientRect(), T = h.clientX - I.left, P = h.clientY - I.top, z = {
- left: T / L,
- top: P / L,
- e: h
- };
- if (this.state.droppingDOMNode) {
- if (this.state.droppingPosition) {
- const {
- left: A,
- top: H
- } = this.state.droppingPosition;
- (A != T || H != P) && this.setState({
- droppingPosition: z
- });
- }
- } else {
- const A = {
- cols: E,
- margin: w,
- maxRows: x,
- rowHeight: S,
- containerWidth: R,
- containerPadding: k || w
- }, H = (0, a.calcXY)(A, P, T, N.w, N.h);
- this.setState({
- droppingDOMNode: /* @__PURE__ */ e.createElement("div", {
- key: N.i
- }),
- droppingPosition: z,
- layout: [...F, {
- ...N,
- x: H.x,
- y: H.y,
- static: !1,
- isDraggable: !0
- }]
- });
- }
- }), s(this, "removeDroppingPlaceholder", () => {
- const {
- droppingItem: h,
- cols: g
- } = this.props, {
- layout: y
- } = this.state, w = (0, r.compact)(y.filter((E) => E.i !== h.i), (0, r.compactType)(this.props), g, this.props.allowOverlap);
- this.setState({
- layout: w,
- droppingDOMNode: null,
- activeDrag: null,
- droppingPosition: void 0
- });
- }), s(this, "onDragLeave", (h) => {
- h.preventDefault(), h.stopPropagation(), this.dragEnterCounter--, this.dragEnterCounter === 0 && this.removeDroppingPlaceholder();
- }), s(this, "onDragEnter", (h) => {
- h.preventDefault(), h.stopPropagation(), this.dragEnterCounter++;
- }), s(this, "onDrop", (h) => {
- h.preventDefault(), h.stopPropagation();
- const {
- droppingItem: g
- } = this.props, {
- layout: y
- } = this.state, w = y.find((E) => E.i === g.i);
- this.dragEnterCounter = 0, this.removeDroppingPlaceholder(), this.props.onDrop(y, w, h);
- });
- }
- componentDidMount() {
- this.setState({
- mounted: !0
- }), this.onLayoutMaybeChanged(this.state.layout, this.props.layout);
- }
- static getDerivedStateFromProps(h, g) {
- let y;
- return g.activeDrag ? null : (!(0, t.deepEqual)(h.layout, g.propsLayout) || h.compactType !== g.compactType ? y = h.layout : (0, r.childrenEqual)(h.children, g.children) || (y = g.layout), y ? {
- layout: (0, r.synchronizeLayoutWithChildren)(y, h.children, h.cols, (0, r.compactType)(h), h.allowOverlap),
- // We need to save these props to state for using
- // getDerivedStateFromProps instead of componentDidMount (in which we would get extra rerender)
- compactType: h.compactType,
- children: h.children,
- propsLayout: h.layout
- } : null);
- }
- shouldComponentUpdate(h, g) {
- return (
- // NOTE: this is almost always unequal. Therefore the only way to get better performance
- // from SCU is if the user intentionally memoizes children. If they do, and they can
- // handle changes properly, performance will increase.
- this.props.children !== h.children || !(0, r.fastRGLPropsEqual)(this.props, h, t.deepEqual) || this.state.activeDrag !== g.activeDrag || this.state.mounted !== g.mounted || this.state.droppingPosition !== g.droppingPosition
- );
- }
- componentDidUpdate(h, g) {
- if (!this.state.activeDrag) {
- const y = this.state.layout, w = g.layout;
- this.onLayoutMaybeChanged(y, w);
- }
- }
- /**
- * Calculates a pixel value for the container.
- * @return {String} Container height in pixels.
- */
- containerHeight() {
- if (!this.props.autoSize) return;
- const h = (0, r.bottom)(this.state.layout), g = this.props.containerPadding ? this.props.containerPadding[1] : this.props.margin[1];
- return h * this.props.rowHeight + (h - 1) * this.props.margin[1] + g * 2 + "px";
- }
- onLayoutMaybeChanged(h, g) {
- g || (g = this.state.layout), (0, t.deepEqual)(g, h) || this.props.onLayoutChange(h);
- }
- /**
- * Create a placeholder object.
- * @return {Element} Placeholder div.
- */
- placeholder() {
- const {
- activeDrag: h
- } = this.state;
- if (!h) return null;
- const {
- width: g,
- cols: y,
- margin: w,
- containerPadding: E,
- rowHeight: S,
- maxRows: x,
- useCSSTransforms: R,
- transformScale: k
- } = this.props;
- return /* @__PURE__ */ e.createElement(o.default, {
- w: h.w,
- h: h.h,
- x: h.x,
- y: h.y,
- i: h.i,
- className: `react-grid-placeholder ${this.state.resizing ? "placeholder-resizing" : ""}`,
- containerWidth: g,
- cols: y,
- margin: w,
- containerPadding: E || w,
- maxRows: x,
- rowHeight: S,
- isDraggable: !1,
- isResizable: !1,
- isBounded: !1,
- useCSSTransforms: R,
- transformScale: k
- }, /* @__PURE__ */ e.createElement("div", null));
- }
- /**
- * Given a grid item, set its style attributes & surround in a <Draggable>.
- * @param {Element} child React element.
- * @return {Element} Element wrapped in draggable and properly placed.
- */
- processGridItem(h, g) {
- if (!h || !h.key) return;
- const y = (0, r.getLayoutItem)(this.state.layout, String(h.key));
- if (!y) return null;
- const {
- width: w,
- cols: E,
- margin: S,
- containerPadding: x,
- rowHeight: R,
- maxRows: k,
- isDraggable: L,
- isResizable: O,
- isBounded: N,
- useCSSTransforms: F,
- transformScale: I,
- draggableCancel: T,
- draggableHandle: P,
- resizeHandles: z,
- resizeHandle: _
- } = this.props, {
- mounted: A,
- droppingPosition: H
- } = this.state, $ = typeof y.isDraggable == "boolean" ? y.isDraggable : !y.static && L, U = typeof y.isResizable == "boolean" ? y.isResizable : !y.static && O, G = y.resizeHandles || z, B = $ && N && y.isBounded !== !1;
- return /* @__PURE__ */ e.createElement(o.default, {
- containerWidth: w,
- cols: E,
- margin: S,
- containerPadding: x || S,
- maxRows: k,
- rowHeight: R,
- cancel: T,
- handle: P,
- onDragStop: this.onDragStop,
- onDragStart: this.onDragStart,
- onDrag: this.onDrag,
- onResizeStart: this.onResizeStart,
- onResize: this.onResize,
- onResizeStop: this.onResizeStop,
- isDraggable: $,
- isResizable: U,
- isBounded: B,
- useCSSTransforms: F && A,
- usePercentages: !A,
- transformScale: I,
- w: y.w,
- h: y.h,
- x: y.x,
- y: y.y,
- i: y.i,
- minH: y.minH,
- minW: y.minW,
- maxH: y.maxH,
- maxW: y.maxW,
- static: y.static,
- droppingPosition: g ? H : void 0,
- resizeHandles: G,
- resizeHandle: _
- }, h);
- }
- render() {
- const {
- className: h,
- style: g,
- isDroppable: y,
- innerRef: w
- } = this.props, E = (0, n.default)(p, h), S = {
- height: this.containerHeight(),
- ...g
- };
- return /* @__PURE__ */ e.createElement("div", {
- ref: w,
- className: E,
- style: S,
- onDrop: y ? this.onDrop : r.noop,
- onDragLeave: y ? this.onDragLeave : r.noop,
- onDragEnter: y ? this.onDragEnter : r.noop,
- onDragOver: y ? this.onDragOver : r.noop
- }, e.Children.map(this.props.children, (x) => this.processGridItem(x)), y && this.state.droppingDOMNode && this.processGridItem(this.state.droppingDOMNode, !0), this.placeholder());
- }
- }
- return ha.default = b, s(b, "displayName", "ReactGridLayout"), s(b, "propTypes", i.default), s(b, "defaultProps", {
- autoSize: !0,
- cols: 12,
- className: "",
- style: {},
- draggableHandle: "",
- draggableCancel: "",
- containerPadding: null,
- rowHeight: 150,
- maxRows: 1 / 0,
- // infinite vertical growth
- layout: [],
- margin: [10, 10],
- isBounded: !1,
- isDraggable: !0,
- isResizable: !0,
- allowOverlap: !1,
- isDroppable: !1,
- useCSSTransforms: !0,
- transformScale: 1,
- verticalCompact: !0,
- compactType: "vertical",
- preventCollision: !1,
- droppingItem: {
- i: "__dropping-elem__",
- h: 1,
- w: 1
- },
- resizeHandles: ["se"],
- onLayoutChange: r.noop,
- onDragStart: r.noop,
- onDrag: r.noop,
- onDragStop: r.noop,
- onResizeStart: r.noop,
- onResize: r.noop,
- onResizeStop: r.noop,
- onDrop: r.noop,
- onDropDragOver: r.noop
- }), ha;
- }
- var wa = {}, vr = {}, dc;
- function nv() {
- if (dc) return vr;
- dc = 1, Object.defineProperty(vr, "__esModule", {
- value: !0
- }), vr.findOrGenerateResponsiveLayout = r, vr.getBreakpointFromWidth = t, vr.getColsFromBreakpoint = n, vr.sortBreakpoints = a;
- var e = Jr();
- function t(o, i) {
- const u = a(o);
- let l = u[0];
- for (let c = 1, s = u.length; c < s; c++) {
- const v = u[c];
- i > o[v] && (l = v);
- }
- return l;
- }
- function n(o, i) {
- if (!i[o])
- throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint " + o + " is missing!");
- return i[o];
- }
- function r(o, i, u, l, c, s) {
- if (o[u]) return (0, e.cloneLayout)(o[u]);
- let v = o[l];
- const C = a(i), p = C.slice(C.indexOf(u));
- for (let m = 0, b = p.length; m < b; m++) {
- const f = p[m];
- if (o[f]) {
- v = o[f];
- break;
- }
- }
- return v = (0, e.cloneLayout)(v || []), (0, e.compact)((0, e.correctBounds)(v, {
- cols: c
- }), s, c);
- }
- function a(o) {
- return Object.keys(o).sort(function(u, l) {
- return o[u] - o[l];
- });
- }
- return vr;
- }
- var fc;
- function xO() {
- if (fc) return wa;
- fc = 1, Object.defineProperty(wa, "__esModule", {
- value: !0
- }), wa.default = void 0;
- var e = l(me), t = i(/* @__PURE__ */ sr()), n = /* @__PURE__ */ Ju(), r = Jr(), a = nv(), o = i(tv());
- function i(f) {
- return f && f.__esModule ? f : { default: f };
- }
- function u(f) {
- if (typeof WeakMap != "function") return null;
- var h = /* @__PURE__ */ new WeakMap(), g = /* @__PURE__ */ new WeakMap();
- return (u = function(y) {
- return y ? g : h;
- })(f);
- }
- function l(f, h) {
- if (f && f.__esModule) return f;
- if (f === null || typeof f != "object" && typeof f != "function") return { default: f };
- var g = u(h);
- if (g && g.has(f)) return g.get(f);
- var y = { __proto__: null }, w = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var E in f) if (E !== "default" && Object.prototype.hasOwnProperty.call(f, E)) {
- var S = w ? Object.getOwnPropertyDescriptor(f, E) : null;
- S && (S.get || S.set) ? Object.defineProperty(y, E, S) : y[E] = f[E];
- }
- return y.default = f, g && g.set(f, y), y;
- }
- function c() {
- return c = Object.assign ? Object.assign.bind() : function(f) {
- for (var h = 1; h < arguments.length; h++) {
- var g = arguments[h];
- for (var y in g)
- Object.prototype.hasOwnProperty.call(g, y) && (f[y] = g[y]);
- }
- return f;
- }, c.apply(this, arguments);
- }
- function s(f, h, g) {
- return h = v(h), h in f ? Object.defineProperty(f, h, { value: g, enumerable: !0, configurable: !0, writable: !0 }) : f[h] = g, f;
- }
- function v(f) {
- var h = C(f, "string");
- return typeof h == "symbol" ? h : String(h);
- }
- function C(f, h) {
- if (typeof f != "object" || f === null) return f;
- var g = f[Symbol.toPrimitive];
- if (g !== void 0) {
- var y = g.call(f, h || "default");
- if (typeof y != "object") return y;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (h === "string" ? String : Number)(f);
- }
- const p = (f) => Object.prototype.toString.call(f);
- function m(f, h) {
- return f == null ? null : Array.isArray(f) ? f : f[h];
- }
- let b = class extends e.Component {
- constructor() {
- super(...arguments), s(this, "state", this.generateInitialState()), s(this, "onLayoutChange", (h) => {
- this.props.onLayoutChange(h, {
- ...this.props.layouts,
- [this.state.breakpoint]: h
- });
- });
- }
- generateInitialState() {
- const {
- width: h,
- breakpoints: g,
- layouts: y,
- cols: w
- } = this.props, E = (0, a.getBreakpointFromWidth)(g, h), S = (0, a.getColsFromBreakpoint)(E, w), x = this.props.verticalCompact === !1 ? null : this.props.compactType;
- return {
- layout: (0, a.findOrGenerateResponsiveLayout)(y, g, E, E, S, x),
- breakpoint: E,
- cols: S
- };
- }
- static getDerivedStateFromProps(h, g) {
- if (!(0, n.deepEqual)(h.layouts, g.layouts)) {
- const {
- breakpoint: y,
- cols: w
- } = g;
- return {
- layout: (0, a.findOrGenerateResponsiveLayout)(h.layouts, h.breakpoints, y, y, w, h.compactType),
- layouts: h.layouts
- };
- }
- return null;
- }
- componentDidUpdate(h) {
- (this.props.width != h.width || this.props.breakpoint !== h.breakpoint || !(0, n.deepEqual)(this.props.breakpoints, h.breakpoints) || !(0, n.deepEqual)(this.props.cols, h.cols)) && this.onWidthChange(h);
- }
- /**
- * When the width changes work through breakpoints and reset state with the new width & breakpoint.
- * Width changes are necessary to figure out the widget widths.
- */
- onWidthChange(h) {
- const {
- breakpoints: g,
- cols: y,
- layouts: w,
- compactType: E
- } = this.props, S = this.props.breakpoint || (0, a.getBreakpointFromWidth)(this.props.breakpoints, this.props.width), x = this.state.breakpoint, R = (0, a.getColsFromBreakpoint)(S, y), k = {
- ...w
- };
- if (x !== S || h.breakpoints !== g || h.cols !== y) {
- x in k || (k[x] = (0, r.cloneLayout)(this.state.layout));
- let N = (0, a.findOrGenerateResponsiveLayout)(k, g, S, x, R, E);
- N = (0, r.synchronizeLayoutWithChildren)(N, this.props.children, R, E, this.props.allowOverlap), k[S] = N, this.props.onBreakpointChange(S, R), this.props.onLayoutChange(N, k), this.setState({
- breakpoint: S,
- layout: N,
- cols: R
- });
- }
- const L = m(this.props.margin, S), O = m(this.props.containerPadding, S);
- this.props.onWidthChange(this.props.width, L, R, O);
- }
- render() {
- const {
- breakpoint: h,
- breakpoints: g,
- cols: y,
- layouts: w,
- margin: E,
- containerPadding: S,
- onBreakpointChange: x,
- onLayoutChange: R,
- onWidthChange: k,
- ...L
- } = this.props;
- return /* @__PURE__ */ e.createElement(o.default, c({}, L, {
- // $FlowIgnore should allow nullable here due to DefaultProps
- margin: m(E, this.state.breakpoint),
- containerPadding: m(S, this.state.breakpoint),
- onLayoutChange: this.onLayoutChange,
- layout: this.state.layout,
- cols: this.state.cols
- }));
- }
- };
- return wa.default = b, s(b, "propTypes", {
- //
- // Basic props
- //
- // Optional, but if you are managing width yourself you may want to set the breakpoint
- // yourself as well.
- breakpoint: t.default.string,
- // {name: pxVal}, e.g. {lg: 1200, md: 996, sm: 768, xs: 480}
- breakpoints: t.default.object,
- allowOverlap: t.default.bool,
- // # of cols. This is a breakpoint -> cols map
- cols: t.default.object,
- // # of margin. This is a breakpoint -> margin map
- // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }
- // Margin between items [x, y] in px
- // e.g. [10, 10]
- margin: t.default.oneOfType([t.default.array, t.default.object]),
- // # of containerPadding. This is a breakpoint -> containerPadding map
- // e.g. { lg: [5, 5], md: [10, 10], sm: [15, 15] }
- // Padding inside the container [x, y] in px
- // e.g. [10, 10]
- containerPadding: t.default.oneOfType([t.default.array, t.default.object]),
- // layouts is an object mapping breakpoints to layouts.
- // e.g. {lg: Layout, md: Layout, ...}
- layouts(f, h) {
- if (p(f[h]) !== "[object Object]")
- throw new Error("Layout property must be an object. Received: " + p(f[h]));
- Object.keys(f[h]).forEach((g) => {
- if (!(g in f.breakpoints))
- throw new Error("Each key in layouts must align with a key in breakpoints.");
- (0, r.validateLayout)(f.layouts[g], "layouts." + g);
- });
- },
- // The width of this component.
- // Required in this propTypes stanza because generateInitialState() will fail without it.
- width: t.default.number.isRequired,
- //
- // Callbacks
- //
- // Calls back with breakpoint and new # cols
- onBreakpointChange: t.default.func,
- // Callback so you can save the layout.
- // Calls back with (currentLayout, allLayouts). allLayouts are keyed by breakpoint.
- onLayoutChange: t.default.func,
- // Calls back with (containerWidth, margin, cols, containerPadding)
- onWidthChange: t.default.func
- }), s(b, "defaultProps", {
- breakpoints: {
- lg: 1200,
- md: 996,
- sm: 768,
- xs: 480,
- xxs: 0
- },
- cols: {
- lg: 12,
- md: 10,
- sm: 6,
- xs: 4,
- xxs: 2
- },
- containerPadding: {
- lg: null,
- md: null,
- sm: null,
- xs: null,
- xxs: null
- },
- layouts: {},
- margin: [10, 10],
- allowOverlap: !1,
- onBreakpointChange: r.noop,
- onLayoutChange: r.noop,
- onWidthChange: r.noop
- }), wa;
- }
- var vo = {};
- const EO = /* @__PURE__ */ bc(Dg);
- var vc;
- function RO() {
- if (vc) return vo;
- vc = 1, Object.defineProperty(vo, "__esModule", {
- value: !0
- }), vo.default = C;
- var e = i(me), t = a(/* @__PURE__ */ sr()), n = a(EO), r = a(el());
- function a(p) {
- return p && p.__esModule ? p : { default: p };
- }
- function o(p) {
- if (typeof WeakMap != "function") return null;
- var m = /* @__PURE__ */ new WeakMap(), b = /* @__PURE__ */ new WeakMap();
- return (o = function(f) {
- return f ? b : m;
- })(p);
- }
- function i(p, m) {
- if (p && p.__esModule) return p;
- if (p === null || typeof p != "object" && typeof p != "function") return { default: p };
- var b = o(m);
- if (b && b.has(p)) return b.get(p);
- var f = { __proto__: null }, h = Object.defineProperty && Object.getOwnPropertyDescriptor;
- for (var g in p) if (g !== "default" && Object.prototype.hasOwnProperty.call(p, g)) {
- var y = h ? Object.getOwnPropertyDescriptor(p, g) : null;
- y && (y.get || y.set) ? Object.defineProperty(f, g, y) : f[g] = p[g];
- }
- return f.default = p, b && b.set(p, f), f;
- }
- function u() {
- return u = Object.assign ? Object.assign.bind() : function(p) {
- for (var m = 1; m < arguments.length; m++) {
- var b = arguments[m];
- for (var f in b)
- Object.prototype.hasOwnProperty.call(b, f) && (p[f] = b[f]);
- }
- return p;
- }, u.apply(this, arguments);
- }
- function l(p, m, b) {
- return m = c(m), m in p ? Object.defineProperty(p, m, { value: b, enumerable: !0, configurable: !0, writable: !0 }) : p[m] = b, p;
- }
- function c(p) {
- var m = s(p, "string");
- return typeof m == "symbol" ? m : String(m);
- }
- function s(p, m) {
- if (typeof p != "object" || p === null) return p;
- var b = p[Symbol.toPrimitive];
- if (b !== void 0) {
- var f = b.call(p, m || "default");
- if (typeof f != "object") return f;
- throw new TypeError("@@toPrimitive must return a primitive value.");
- }
- return (m === "string" ? String : Number)(p);
- }
- const v = "react-grid-layout";
- function C(p) {
- var m;
- return m = class extends e.Component {
- constructor() {
- super(...arguments), l(this, "state", {
- width: 1280
- }), l(this, "elementRef", /* @__PURE__ */ e.createRef()), l(this, "mounted", !1), l(this, "resizeObserver", void 0);
- }
- componentDidMount() {
- this.mounted = !0, this.resizeObserver = new n.default((h) => {
- if (this.elementRef.current instanceof HTMLElement) {
- const y = h[0].contentRect.width;
- this.setState({
- width: y
- });
- }
- });
- const f = this.elementRef.current;
- f instanceof HTMLElement && this.resizeObserver.observe(f);
- }
- componentWillUnmount() {
- this.mounted = !1;
- const f = this.elementRef.current;
- f instanceof HTMLElement && this.resizeObserver.unobserve(f), this.resizeObserver.disconnect();
- }
- render() {
- const {
- measureBeforeMount: f,
- ...h
- } = this.props;
- return f && !this.mounted ? /* @__PURE__ */ e.createElement("div", {
- className: (0, r.default)(this.props.className, v),
- style: this.props.style,
- ref: this.elementRef
- }) : /* @__PURE__ */ e.createElement(p, u({
- innerRef: this.elementRef
- }, h, this.state));
- }
- }, l(m, "defaultProps", {
- measureBeforeMount: !1
- }), l(m, "propTypes", {
- // If true, will not render children until mounted. Useful for getting the exact width before
- // rendering, to prevent any unsightly resizing.
- measureBeforeMount: t.default.bool
- }), m;
- }
- return vo;
- }
- var mc;
- function PO() {
- return mc || (mc = 1, function(e) {
- e.exports = tv().default, e.exports.utils = Jr(), e.exports.calculateUtils = tl(), e.exports.Responsive = xO().default, e.exports.Responsive.utils = nv(), e.exports.WidthProvider = RO().default;
- }(Pi)), Pi.exports;
- }
- var rv = PO();
- const MO = /* @__PURE__ */ Aa(rv), kO = rv.WidthProvider(MO);
- function g_(e) {
- const { list: t, onListChange: n, idKey: r, itemRender: a, ...o } = e, i = Ht(() => {
- const l = /* @__PURE__ */ new Map();
- return t.forEach((c) => {
- const s = c[r];
- l.set(s, c);
- }), l;
- }, [r, t]), u = Ht(() => t.map((l, c) => ({
- i: l[r],
- w: 12,
- h: 1,
- x: 0,
- y: c,
- col: 12
- })), [r, t]);
- return /* @__PURE__ */ q.jsx(
- kO,
- {
- ...o,
- cols: 12,
- preventCollision: !1,
- isResizable: !1,
- isDraggable: !0,
- onLayoutChange: (l) => {
- const c = l.sort((s, v) => s.y - v.y).map((s) => i.get(s.i));
- n(c);
- },
- children: u.map((l, c) => /* @__PURE__ */ q.jsx("div", { "data-grid": l, children: a(i.get(l.i), c) }, l.i))
- }
- );
- }
- const ki = /* @__PURE__ */ new Set();
- let mo;
- function y_(e) {
- return mo || (mo = new ResizeObserver((...t) => {
- ki.forEach((n) => n(...t));
- })), {
- observe(t, n) {
- ki.add(e), mo.observe(t, n);
- },
- unobserve(t) {
- ki.delete(e), mo.unobserve(t);
- }
- };
- }
- export {
- OO as Avatar,
- Po as Button,
- LO as CascaderList,
- um as Checkbox,
- TO as CheckboxGroup,
- $O as ColorPicker,
- In as ConfigContext,
- _O as ConfigProvider,
- jO as Confirm,
- FO as DatePanel,
- zO as DatePicker,
- rg as Dialog,
- g_ as DraggableList,
- sC as DropdownLegacy,
- Bm as DropdownOverlay,
- Um as DropdownProvider,
- qm as DropdownTrigger,
- VO as FormDualColumnLayout,
- HO as FormLayout,
- QC as Input,
- BO as InputNumber,
- WO as InputWithSlot,
- UO as Menu,
- qO as MenuItem,
- YO as MenuItemGroup,
- Xw as MessageType,
- GO as Messager,
- QO as Pager,
- JO as Popup,
- e_ as Radio,
- t_ as RadioGroup,
- n_ as Scrollbar,
- o_ as Segmented,
- r_ as Select,
- a_ as SelectList,
- i_ as Slider,
- KO as SubMenu,
- c_ as Switch,
- Gf as Tooltip,
- s_ as Tree,
- MP as TreeSelectionMode,
- Na as clsx,
- d_ as defaultTheme,
- l_ as filterLeafNode,
- EP as findNodePathFromTree,
- mu as findSubTreeFromPath,
- f_ as greenTheme,
- u_ as mergeTreeSelected,
- XO as message,
- ZO as removeMessage,
- y_ as resizeObserverCtor,
- v_ as themeInstance
- };
|