- md5
- 4166e2dd8efa2162fa4698e289ad545e
- sha1
- 6b7b3679508d51280c42eba42fcafcc42b5c61cd
- sha256
- 9db010a74fbc5d9dbcf91ccdd2caeaff4ff0666fe952fad5c8c232d4672abeb2
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// package-external:@wordpress/html-entities
var require_html_entities = __commonJS({
"package-external:@wordpress/html-entities"(exports, module) {
module.exports = window.wp.htmlEntities;
}
});
// vendor-external:react
var require_react = __commonJS({
"vendor-external:react"(exports, module) {
module.exports = window.React;
}
});
// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
"vendor-external:react/jsx-runtime"(exports, module) {
module.exports = window.ReactJSXRuntime;
}
});
// vendor-external:react-dom
var require_react_dom = __commonJS({
"vendor-external:react-dom"(exports, module) {
module.exports = window.ReactDOM;
}
});
// package-external:@wordpress/element
var require_element = __commonJS({
"package-external:@wordpress/element"(exports, module) {
module.exports = window.wp.element;
}
});
// package-external:@wordpress/primitives
var require_primitives = __commonJS({
"package-external:@wordpress/primitives"(exports, module) {
module.exports = window.wp.primitives;
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
"use strict";
(function() {
function is(x, y) {
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
function useSyncExternalStore$2(subscribe, getSnapshot) {
didWarnOld18Alpha || void 0 === React49.startTransition || (didWarnOld18Alpha = true, console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
));
var value = getSnapshot();
if (!didWarnUncachedGetSnapshot) {
var cachedValue = getSnapshot();
objectIs(value, cachedValue) || (console.error(
"The result of getSnapshot should be cached to avoid an infinite loop"
), didWarnUncachedGetSnapshot = true);
}
cachedValue = useState12({
inst: { value, getSnapshot }
});
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
useLayoutEffect3(
function() {
inst.value = value;
inst.getSnapshot = getSnapshot;
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
},
[subscribe, value, getSnapshot]
);
useEffect11(
function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
return subscribe(function() {
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
});
},
[subscribe]
);
useDebugValue2(value);
return value;
}
function checkIfSnapshotChanged(inst) {
var latestGetSnapshot = inst.getSnapshot;
inst = inst.value;
try {
var nextValue = latestGetSnapshot();
return !objectIs(inst, nextValue);
} catch (error) {
return true;
}
}
function useSyncExternalStore$1(subscribe, getSnapshot) {
return getSnapshot();
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React49 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState12 = React49.useState, useEffect11 = React49.useEffect, useLayoutEffect3 = React49.useLayoutEffect, useDebugValue2 = React49.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
exports.useSyncExternalStore = void 0 !== React49.useSyncExternalStore ? React49.useSyncExternalStore : shim;
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_use_sync_external_store_shim_development();
}
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js
var require_with_selector_development = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) {
"use strict";
(function() {
function is(x, y) {
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
}
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var React49 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef19 = React49.useRef, useEffect11 = React49.useEffect, useMemo16 = React49.useMemo, useDebugValue2 = React49.useDebugValue;
exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {
var instRef = useRef19(null);
if (null === instRef.current) {
var inst = { hasValue: false, value: null };
instRef.current = inst;
} else inst = instRef.current;
instRef = useMemo16(
function() {
function memoizedSelector(nextSnapshot) {
if (!hasMemo) {
hasMemo = true;
memoizedSnapshot = nextSnapshot;
nextSnapshot = selector(nextSnapshot);
if (void 0 !== isEqual && inst.hasValue) {
var currentSelection = inst.value;
if (isEqual(currentSelection, nextSnapshot))
return memoizedSelection = currentSelection;
}
return memoizedSelection = nextSnapshot;
}
currentSelection = memoizedSelection;
if (objectIs(memoizedSnapshot, nextSnapshot))
return currentSelection;
var nextSelection = selector(nextSnapshot);
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
return memoizedSnapshot = nextSnapshot, currentSelection;
memoizedSnapshot = nextSnapshot;
return memoizedSelection = nextSelection;
}
var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot;
return [
function() {
return memoizedSelector(getSnapshot());
},
null === maybeGetServerSnapshot ? void 0 : function() {
return memoizedSelector(maybeGetServerSnapshot());
}
];
},
[getSnapshot, getServerSnapshot, selector, isEqual]
);
var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]);
useEffect11(
function() {
inst.hasValue = true;
inst.value = value;
},
[value]
);
useDebugValue2(value);
return value;
};
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
});
// node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/with-selector.js
var require_with_selector = __commonJS({
"node_modules/.store/[email protected]/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) {
"use strict";
if (false) {
module.exports = null;
} else {
module.exports = require_with_selector_development();
}
}
});
// package-external:@wordpress/i18n
var require_i18n = __commonJS({
"package-external:@wordpress/i18n"(exports, module) {
module.exports = window.wp.i18n;
}
});
// package-external:@wordpress/theme
var require_theme = __commonJS({
"package-external:@wordpress/theme"(exports, module) {
module.exports = window.wp.theme;
}
});
// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
"package-external:@wordpress/private-apis"(exports, module) {
module.exports = window.wp.privateApis;
}
});
// packages/core-fields/build-module/wp_block/description/field.mjs
var import_html_entities = __toESM(require_html_entities(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useRenderElement.mjs
var React4 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useRefWithInit.mjs
var React = __toESM(require_react(), 1);
var UNINITIALIZED = {};
function useRefWithInit(init, initArg) {
const ref = React.useRef(UNINITIALIZED);
if (ref.current === UNINITIALIZED) {
ref.current = init(initArg);
}
return ref;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useMergedRefs.mjs
function useMergedRefs(a, b, c, d) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChange(forkRef, a, b, c, d)) {
update(forkRef, [a, b, c, d]);
}
return forkRef.callback;
}
function useMergedRefsN(refs) {
const forkRef = useRefWithInit(createForkRef).current;
if (didChangeN(forkRef, refs)) {
update(forkRef, refs);
}
return forkRef.callback;
}
function createForkRef() {
return {
callback: null,
cleanup: null,
refs: []
};
}
function didChange(forkRef, a, b, c, d) {
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
}
function didChangeN(forkRef, newRefs) {
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
}
function update(forkRef, refs) {
forkRef.refs = refs;
if (refs.every((ref) => ref == null)) {
forkRef.callback = null;
return;
}
forkRef.callback = (instance) => {
if (forkRef.cleanup) {
forkRef.cleanup();
forkRef.cleanup = null;
}
if (instance != null) {
const cleanupCallbacks = Array(refs.length).fill(null);
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const refCleanup = ref(instance);
if (typeof refCleanup === "function") {
cleanupCallbacks[i] = refCleanup;
}
break;
}
case "object": {
ref.current = instance;
break;
}
default:
}
}
forkRef.cleanup = () => {
for (let i = 0; i < refs.length; i += 1) {
const ref = refs[i];
if (ref == null) {
continue;
}
switch (typeof ref) {
case "function": {
const cleanupCallback = cleanupCallbacks[i];
if (typeof cleanupCallback === "function") {
cleanupCallback();
} else {
void ref(null);
}
break;
}
case "object": {
ref.current = null;
break;
}
default:
}
}
};
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/getReactElementRef.mjs
var React3 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/reactVersion.mjs
var React2 = __toESM(require_react(), 1);
var majorVersion = parseInt(React2.version, 10);
function isReactVersionAtLeast(reactVersionToCheck) {
return majorVersion >= reactVersionToCheck;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/getReactElementRef.mjs
function getReactElementRef(element) {
if (!/* @__PURE__ */ React3.isValidElement(element)) {
return null;
}
const reactElement = element;
const propsWithRef = reactElement.props;
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/mergeObjects.mjs
function mergeObjects(a, b) {
if (a && !b) {
return a;
}
if (!a && b) {
return b;
}
if (a || b) {
return {
...a,
...b
};
}
return void 0;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/createLogOnce.mjs
var loggedMessages;
if (true) {
loggedMessages = /* @__PURE__ */ new Set();
}
function createLogOnce(severity, prefix) {
return function logOnce(...messages) {
if (true) {
const message = messages.join(" ");
const output = prefix ? `${prefix}: ${message}` : message;
const key = `${severity}:${output}`;
if (!loggedMessages.has(key)) {
loggedMessages.add(key);
if (severity === "warn") {
console.warn(output);
} else {
console.error(output);
}
}
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/warn.mjs
var warn = createLogOnce("warn", "Base UI");
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/empty.mjs
function NOOP() {
}
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
function getStateAttributesProps(state, customMapping) {
const props = {};
for (const key in state) {
const value = state[key];
if (customMapping?.hasOwnProperty(key)) {
const customProps = customMapping[key](value);
if (customProps != null) {
Object.assign(props, customProps);
}
continue;
}
if (value === true) {
props[`data-${key.toLowerCase()}`] = "";
} else if (value) {
props[`data-${key.toLowerCase()}`] = value.toString();
}
}
return props;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveClassName.mjs
function resolveClassName(className, state) {
return typeof className === "function" ? className(state) : className;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveStyle.mjs
function resolveStyle(style, state) {
return typeof style === "function" ? style(state) : style;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/merge-props/mergeProps.mjs
var EMPTY_PROPS = {};
function mergeProps(a, b, c, d, e) {
if (!c && !d && !e && !a) {
return createInitialMergedProps(b);
}
let merged = createInitialMergedProps(a);
if (b) {
merged = mergeInto(merged, b);
}
if (c) {
merged = mergeInto(merged, c);
}
if (d) {
merged = mergeInto(merged, d);
}
if (e) {
merged = mergeInto(merged, e);
}
return merged;
}
function mergePropsN(props) {
if (props.length === 0) {
return EMPTY_PROPS;
}
if (props.length === 1) {
return createInitialMergedProps(props[0]);
}
let merged = createInitialMergedProps(props[0]);
for (let i = 1; i < props.length; i += 1) {
merged = mergeInto(merged, props[i]);
}
return merged;
}
function createInitialMergedProps(inputProps) {
if (isPropsGetter(inputProps)) {
return {
...inputProps(EMPTY_PROPS)
};
}
return copyInitialProps(inputProps);
}
function mergeInto(merged, inputProps) {
if (isPropsGetter(inputProps)) {
return inputProps(merged);
}
return mutablyMergeInto(merged, inputProps);
}
function copyInitialProps(inputProps) {
const copiedProps = {
...inputProps
};
for (const propName in copiedProps) {
const propValue = copiedProps[propName];
if (isEventHandler(propName, propValue)) {
copiedProps[propName] = wrapEventHandler(propValue);
}
}
return copiedProps;
}
function mutablyMergeInto(mergedProps, externalProps) {
if (!externalProps) {
return mergedProps;
}
for (const propName in externalProps) {
const externalPropValue = externalProps[propName];
switch (propName) {
case "style": {
mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
break;
}
case "className": {
mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
break;
}
default: {
if (isEventHandler(propName, externalPropValue)) {
mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
} else {
mergedProps[propName] = externalPropValue;
}
}
}
}
return mergedProps;
}
function isEventHandler(key, value) {
const code0 = key.charCodeAt(0);
const code1 = key.charCodeAt(1);
const code2 = key.charCodeAt(2);
return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
}
function isPropsGetter(inputProps) {
return typeof inputProps === "function";
}
function mergeEventHandlers(ourHandler, theirHandler) {
if (!theirHandler) {
return ourHandler;
}
if (!ourHandler) {
return wrapEventHandler(theirHandler);
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
const baseUIEvent = event;
makeEventPreventable(baseUIEvent);
const result2 = theirHandler(...args);
if (!baseUIEvent.baseUIHandlerPrevented) {
ourHandler?.(...args);
}
return result2;
}
const result = theirHandler(...args);
ourHandler?.(...args);
return result;
};
}
function wrapEventHandler(handler) {
if (!handler) {
return handler;
}
return (...args) => {
const event = args[0];
if (isSyntheticEvent(event)) {
makeEventPreventable(event);
}
return handler(...args);
};
}
function makeEventPreventable(event) {
event.preventBaseUIHandler = () => {
event.baseUIHandlerPrevented = true;
};
return event;
}
function mergeClassNames(ourClassName, theirClassName) {
if (theirClassName) {
if (ourClassName) {
return theirClassName + " " + ourClassName;
}
return theirClassName;
}
return ourClassName;
}
function isSyntheticEvent(event) {
return event != null && typeof event === "object" && "nativeEvent" in event;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useRenderElement.mjs
var import_react = __toESM(require_react(), 1);
function useRenderElement(element, componentProps, params = {}) {
let renderProp = componentProps.render;
if (params.enabled !== false) {
renderProp = unwrapLazyRenderProp(renderProp);
}
const outProps = useRenderElementProps(componentProps, params, renderProp);
if (params.enabled === false) {
return null;
}
const state = params.state ?? EMPTY_OBJECT;
return evaluateRenderProp(element, renderProp, outProps, state);
}
function useRenderElementProps(componentProps, params, renderProp) {
const {
className: classNameProp,
style: styleProp
} = componentProps;
const {
state = EMPTY_OBJECT,
ref,
props,
stateAttributesMapping,
enabled = true
} = params;
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
const style = enabled ? resolveStyle(styleProp, state) : void 0;
const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
if (typeof document !== "undefined") {
if (!enabled) {
void useMergedRefs(null, null);
} else if (Array.isArray(ref)) {
outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
} else {
outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
}
}
if (!enabled) {
return EMPTY_OBJECT;
}
if (className !== void 0) {
outProps.className = mergeClassNames(outProps.className, className);
}
if (style !== void 0) {
outProps.style = mergeObjects(outProps.style, style);
}
return outProps;
}
function resolveRenderFunctionProps(props) {
if (Array.isArray(props)) {
return mergePropsN(props);
}
return mergeProps(void 0, props);
}
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
function unwrapLazyRenderProp(render) {
if (render?.$$typeof !== REACT_LAZY_TYPE) {
return render;
}
const unwrapped = React4.Children.toArray(render)[0];
return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render;
}
function evaluateRenderProp(element, render, props, state) {
if (render) {
if (typeof render === "function") {
if (true) {
warnIfRenderPropLooksLikeComponent(render);
}
return render(props, state);
}
const mergedProps = mergeProps(props, render.props);
mergedProps.ref = props.ref;
if (true) {
if (!/* @__PURE__ */ React4.isValidElement(render)) {
throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
}
}
return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
}
return renderTag(element, props);
}
function warnIfRenderPropLooksLikeComponent(renderFn) {
const functionName = renderFn.name;
if (functionName.length === 0) {
return;
}
if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
return;
}
if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
return;
}
warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
}
function renderTag(Tag, props) {
if (Tag === "button") {
return /* @__PURE__ */ (0, import_react.createElement)("button", {
type: "button",
...props,
key: props.key
});
}
if (Tag === "img") {
return /* @__PURE__ */ (0, import_react.createElement)("img", {
alt: "",
...props,
key: props.key
});
}
return /* @__PURE__ */ React4.createElement(Tag, props);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/safeReact.mjs
var React5 = __toESM(require_react(), 1);
var SafeReact = {
...React5
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useStableCallback.mjs
var useInsertionEffect = SafeReact.useInsertionEffect;
var useSafeInsertionEffect = (
// React 17 doesn't have useInsertionEffect.
useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn()
);
function useStableCallback(callback) {
const stable = useRefWithInit(createStableCallback).current;
stable.next = callback;
useSafeInsertionEffect(stable.effect);
return stable.trampoline;
}
function createStableCallback() {
const stable = {
next: void 0,
callback: assertNotCalled,
trampoline: (...args) => stable.callback?.(...args),
effect: () => {
stable.callback = stable.next;
}
};
return stable;
}
function assertNotCalled() {
if (true) {
throw (
/* minify-error-disabled */
new Error("Base UI: Cannot call an event handler while rendering.")
);
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
var React6 = __toESM(require_react(), 1);
var noop = () => {
};
var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
var React8 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
var ReactDOM = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useOnMount.mjs
var React7 = __toESM(require_react(), 1);
function useOnMount(fn) {
React7.useEffect(fn, EMPTY_ARRAY);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useAnimationFrame.mjs
var EMPTY = null;
var LAST_RAF = globalThis.requestAnimationFrame;
var Scheduler = class {
/* This implementation uses an array as a backing data-structure for frame callbacks.
* It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
* never calls the native `cancelAnimationFrame` if there are no frames left. This can
* be much more efficient if there is a call pattern that alterns as
* "request-cancel-request-cancel-…".
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
callbacks = [];
callbacksCount = 0;
nextId = 1;
startId = 1;
isScheduled = false;
tick = (timestamp) => {
this.isScheduled = false;
const currentCallbacks = this.callbacks;
const currentCallbacksCount = this.callbacksCount;
this.callbacks = [];
this.callbacksCount = 0;
this.startId = this.nextId;
if (currentCallbacksCount > 0) {
for (let i = 0; i < currentCallbacks.length; i += 1) {
currentCallbacks[i]?.(timestamp);
}
}
};
request(fn) {
const id = this.nextId;
this.nextId += 1;
this.callbacks.push(fn);
this.callbacksCount += 1;
const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
if (!this.isScheduled || didRAFChange) {
requestAnimationFrame(this.tick);
this.isScheduled = true;
}
return id;
}
cancel(id) {
const index2 = id - this.startId;
if (index2 < 0 || index2 >= this.callbacks.length) {
return;
}
if (this.callbacks[index2] === null) {
return;
}
this.callbacks[index2] = null;
this.callbacksCount -= 1;
}
};
var scheduler = new Scheduler();
var AnimationFrame = class _AnimationFrame {
static create() {
return new _AnimationFrame();
}
static request(fn) {
return scheduler.request(fn);
}
static cancel(id) {
return scheduler.cancel(id);
}
currentId = EMPTY;
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
request(fn) {
this.cancel();
this.currentId = scheduler.request(() => {
this.currentId = EMPTY;
fn();
});
}
cancel = () => {
if (this.currentId !== EMPTY) {
scheduler.cancel(this.currentId);
this.currentId = EMPTY;
}
};
disposeEffect = () => {
return this.cancel;
};
};
function useAnimationFrame() {
const timeout = useRefWithInit(AnimationFrame.create).current;
useOnMount(timeout.disposeEffect);
return timeout;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/resolveRef.mjs
function resolveRef(maybeRef) {
if (maybeRef == null) {
return maybeRef;
}
return "current" in maybeRef ? maybeRef.current : maybeRef;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs
function getFiniteAnimations(element, options) {
return element.getAnimations(options).filter((animation) => {
const timing = animation.effect?.getTiming();
return timing?.duration !== Infinity && timing?.iterations !== Infinity;
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
var startingStyle = "data-starting-style";
var endingStyle = "data-ending-style";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
var pendingCallbacks = null;
function flushBeforePaint(fn) {
if (!pendingCallbacks) {
const callbacks = [];
pendingCallbacks = callbacks;
queueMicrotask(() => {
pendingCallbacks = null;
ReactDOM.flushSync(() => {
for (const callback of callbacks) {
callback();
}
});
});
}
pendingCallbacks.push(fn);
}
function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
const frame = useAnimationFrame();
return useStableCallback((fnToExecute, signal = null) => {
frame.cancel();
const element = resolveRef(elementOrRef);
if (element == null) {
return;
}
const resolvedElement = element;
const done = () => {
if (!batch) {
ReactDOM.flushSync(fnToExecute);
return;
}
flushBeforePaint(() => {
if (!signal?.aborted) {
fnToExecute();
}
});
};
if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
fnToExecute();
return;
}
function exec() {
Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => {
if (!signal?.aborted) {
done();
}
}, () => {
if (signal?.aborted) {
return;
}
const currentAnimations = getFiniteAnimations(resolvedElement);
if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
exec();
return;
}
done();
});
}
if (waitForStartingStyleRemoved) {
const startingStyleAttribute = startingStyle;
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
frame.request(exec);
return;
}
const attributeObserver = new MutationObserver(() => {
if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
attributeObserver.disconnect();
exec();
}
});
attributeObserver.observe(resolvedElement, {
attributes: true,
attributeFilter: [startingStyleAttribute]
});
signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
once: true
});
return;
}
frame.request(exec);
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
function useOpenChangeComplete(parameters) {
const {
enabled = true,
open: open2,
ref,
batch = false,
onComplete: onCompleteParam
} = parameters;
const onComplete = useStableCallback(onCompleteParam);
const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch);
React8.useEffect(() => {
if (!enabled) {
return void 0;
}
const abortController = new AbortController();
runOnceAnimationsFinish(onComplete, abortController.signal);
return () => {
abortController.abort();
};
}, [enabled, open2, onComplete, runOnceAnimationsFinish]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
var STARTING_HOOK = {
[startingStyle]: ""
};
var ENDING_HOOK = {
[endingStyle]: ""
};
var transitionStatusMapping = {
transitionStatus(value) {
if (value === "starting") {
return STARTING_HOOK;
}
if (value === "ending") {
return ENDING_HOOK;
}
return null;
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useTransitionStatus.mjs
var React9 = __toESM(require_react(), 1);
function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0);
const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen);
if (open2 && !mounted) {
setMounted(true);
setTransitionStatus("starting");
}
if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) {
setTransitionStatus("ending");
}
if (!open2 && !mounted && transitionStatus === "ending") {
setTransitionStatus(void 0);
}
useIsoLayoutEffect(() => {
if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) {
const frame = AnimationFrame.request(() => {
setTransitionStatus("ending");
});
return () => {
AnimationFrame.cancel(frame);
};
}
return void 0;
}, [open2, mounted, transitionStatus, deferEndingState]);
useIsoLayoutEffect(() => {
if (!open2 || enableIdleState || transitionStatus === void 0) {
return void 0;
}
const frame = AnimationFrame.request(() => {
setTransitionStatus(void 0);
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2, transitionStatus]);
useIsoLayoutEffect(() => {
if (!open2 || !enableIdleState) {
return void 0;
}
if (open2 && mounted && transitionStatus !== "idle") {
setTransitionStatus("starting");
}
const frame = AnimationFrame.request(() => {
setTransitionStatus("idle");
});
return () => {
AnimationFrame.cancel(frame);
};
}, [enableIdleState, open2, mounted, transitionStatus]);
return {
mounted,
setMounted,
transitionStatus
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useTimeout.mjs
var EMPTY2 = 0;
var Timeout = class _Timeout {
static create() {
return new _Timeout();
}
currentId = EMPTY2;
/**
* Executes `fn` after `delay`, clearing any previously scheduled call.
*/
start(delay, fn) {
this.clear();
this.currentId = setTimeout(() => {
this.currentId = EMPTY2;
fn();
}, delay);
}
isStarted() {
return this.currentId !== EMPTY2;
}
clear = () => {
if (this.currentId !== EMPTY2) {
clearTimeout(this.currentId);
this.currentId = EMPTY2;
}
};
disposeEffect = () => {
return this.clear;
};
};
function useTimeout() {
const timeout = useRefWithInit(Timeout.create).current;
useOnMount(timeout.disposeEffect);
return timeout;
}
// node_modules/.store/[email protected]/node_modules/clsx/dist/clsx.mjs
function r(e) {
var t, f, n = "";
if ("string" == typeof e || "number" == typeof e) n += e;
else if ("object" == typeof e) if (Array.isArray(e)) {
var o = e.length;
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
} else for (f in e) e[f] && (n && (n += " "), n += f);
return n;
}
function clsx() {
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
return n;
}
var clsx_default = clsx;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useId.mjs
var React11 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useForcedRerendering.mjs
var React10 = __toESM(require_react(), 1);
function useForcedRerendering() {
const [, setState] = React10.useState({});
return React10.useCallback(() => {
setState({});
}, []);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useId.mjs
var globalId = 0;
function useGlobalId(idOverride, prefix = "mui") {
const defaultId = React11.useRef(void 0);
const forceRerender = useForcedRerendering();
const id = idOverride ?? defaultId.current;
React11.useEffect(() => {
if (defaultId.current == null) {
globalId += 1;
defaultId.current = `${prefix}-${globalId}`;
if (idOverride == null) {
forceRerender();
}
}
}, [idOverride, prefix, forceRerender]);
return id;
}
var maybeReactUseId = SafeReact.useId;
function useId(idOverride, prefix) {
if (maybeReactUseId !== void 0) {
const reactId = maybeReactUseId();
return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
}
return useGlobalId(idOverride, prefix);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useBaseUiId.mjs
function useBaseUiId(idOverride) {
return useId(idOverride, "base-ui");
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
function createChangeEventDetails(reason, event, trigger, customProperties) {
let canceled = false;
let allowPropagation = false;
const custom = customProperties ?? EMPTY_OBJECT;
const details = {
reason,
event: event ?? new Event("base-ui"),
cancel() {
canceled = true;
},
allowPropagation() {
allowPropagation = true;
},
get isCanceled() {
return canceled;
},
get isPropagationAllowed() {
return allowPropagation;
},
trigger,
...custom
};
return details;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/reason-parts.mjs
var reason_parts_exports = {};
__export(reason_parts_exports, {
cancelOpen: () => cancelOpen,
chipRemovePress: () => chipRemovePress,
clearPress: () => clearPress,
closePress: () => closePress,
closeWatcher: () => closeWatcher,
decrementPress: () => decrementPress,
disabled: () => disabled,
drag: () => drag,
escapeKey: () => escapeKey,
focusOut: () => focusOut,
imperativeAction: () => imperativeAction,
incrementPress: () => incrementPress,
initial: () => initial,
inputBlur: () => inputBlur,
inputChange: () => inputChange,
inputClear: () => inputClear,
inputPaste: () => inputPaste,
inputPress: () => inputPress,
itemPress: () => itemPress,
keyboard: () => keyboard,
linkPress: () => linkPress,
listNavigation: () => listNavigation,
missing: () => missing,
none: () => none,
outsidePress: () => outsidePress,
pointer: () => pointer,
popupClose: () => popupClose,
scrub: () => scrub,
siblingOpen: () => siblingOpen,
swipe: () => swipe,
trackPress: () => trackPress,
triggerFocus: () => triggerFocus,
triggerHover: () => triggerHover,
triggerPress: () => triggerPress,
wheel: () => wheel,
windowResize: () => windowResize
});
var none = "none";
var triggerPress = "trigger-press";
var triggerHover = "trigger-hover";
var triggerFocus = "trigger-focus";
var outsidePress = "outside-press";
var itemPress = "item-press";
var closePress = "close-press";
var linkPress = "link-press";
var clearPress = "clear-press";
var chipRemovePress = "chip-remove-press";
var trackPress = "track-press";
var incrementPress = "increment-press";
var decrementPress = "decrement-press";
var inputChange = "input-change";
var inputClear = "input-clear";
var inputBlur = "input-blur";
var inputPaste = "input-paste";
var inputPress = "input-press";
var focusOut = "focus-out";
var escapeKey = "escape-key";
var closeWatcher = "close-watcher";
var listNavigation = "list-navigation";
var keyboard = "keyboard";
var pointer = "pointer";
var drag = "drag";
var wheel = "wheel";
var scrub = "scrub";
var popupClose = "popup-close";
var cancelOpen = "cancel-open";
var siblingOpen = "sibling-open";
var disabled = "disabled";
var missing = "missing";
var initial = "initial";
var imperativeAction = "imperative-action";
var swipe = "swipe";
var windowResize = "window-resize";
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
return typeof window !== "undefined";
}
function getNodeName(node) {
if (isNode(node)) {
return (node.nodeName || "").toLowerCase();
}
return "#document";
}
function getWindow(node) {
var _node$ownerDocument;
return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function getDocumentElement(node) {
var _ref;
return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
}
function isNode(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Node || value instanceof getWindow(value).Node;
}
function isElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof Element || value instanceof getWindow(value).Element;
}
function isHTMLElement(value) {
if (!hasWindow()) {
return false;
}
return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
if (!hasWindow() || typeof ShadowRoot === "undefined") {
return false;
}
return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
function isOverflowElement(element) {
const {
overflow,
overflowX,
overflowY,
display
} = getComputedStyle2(element);
return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents";
}
function isTableElement(element) {
return /^(table|td|th)$/.test(getNodeName(element));
}
function isTopLayer(element) {
try {
if (element.matches(":popover-open")) {
return true;
}
} catch (_e) {
}
try {
return element.matches(":modal");
} catch (_e) {
return false;
}
}
var willChangeRe = /transform|translate|scale|rotate|perspective|filter/;
var containRe = /paint|layout|strict|content/;
var isNotNone = (value) => !!value && value !== "none";
var isWebKitValue;
function isContainingBlock(elementOrCss) {
const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss;
return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || "");
}
function getContainingBlock(element) {
let currentNode = getParentNode(element);
while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
if (isContainingBlock(currentNode)) {
return currentNode;
} else if (isTopLayer(currentNode)) {
return null;
}
currentNode = getParentNode(currentNode);
}
return null;
}
function isWebKit() {
if (isWebKitValue == null) {
isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none");
}
return isWebKitValue;
}
function isLastTraversableNode(node) {
return /^(html|body|#document)$/.test(getNodeName(node));
}
function getComputedStyle2(element) {
return getWindow(element).getComputedStyle(element);
}
function getNodeScroll(element) {
if (isElement(element)) {
return {
scrollLeft: element.scrollLeft,
scrollTop: element.scrollTop
};
}
return {
scrollLeft: element.scrollX,
scrollTop: element.scrollY
};
}
function getParentNode(node) {
if (getNodeName(node) === "html") {
return node;
}
const result = (
// Step into the shadow DOM of the parent of a slotted node.
node.assignedSlot || // DOM Element detected.
node.parentNode || // ShadowRoot detected.
isShadowRoot(node) && node.host || // Fallback.
getDocumentElement(node)
);
return isShadowRoot(result) ? result.host : result;
}
function getNearestOverflowAncestor(node) {
const parentNode = getParentNode(node);
if (isLastTraversableNode(parentNode)) {
return (node.ownerDocument || node).body;
}
if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
return parentNode;
}
return getNearestOverflowAncestor(parentNode);
}
function getOverflowAncestors(node, list, traverseIframes) {
var _node$ownerDocument2;
if (list === void 0) {
list = [];
}
if (traverseIframes === void 0) {
traverseIframes = true;
}
const scrollableAncestor = getNearestOverflowAncestor(node);
const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
const win = getWindow(scrollableAncestor);
if (isBody) {
const frameElement = getFrameElement(win);
return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);
} else {
return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));
}
}
function getFrameElement(win) {
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/owner.mjs
function ownerDocument(node) {
return node?.ownerDocument || document;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/addEventListener.mjs
function addEventListener(target, type, listener, options) {
target.addEventListener(type, listener, options);
return () => {
target.removeEventListener(type, listener, options);
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/useValueAsRef.mjs
function useValueAsRef(value) {
const latest = useRefWithInit(createLatestRef, value).current;
latest.next = value;
useIsoLayoutEffect(latest.effect);
return latest;
}
function createLatestRef(value) {
const latest = {
current: value,
next: value,
effect: () => {
latest.current = latest.next;
}
};
return latest;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/parts.mjs
var parts_exports = {};
__export(parts_exports, {
engine: () => engine_exports,
env: () => env_exports,
mediaQuery: () => media_query_exports,
os: () => os_exports,
screenReader: () => screen_reader_exports
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/os.mjs
var os_exports = {};
__export(os_exports, {
android: () => android,
apple: () => apple,
ios: () => ios,
linux: () => linux,
mac: () => mac,
windows: () => windows
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/shared.mjs
function readRawData() {
if (typeof navigator === "undefined") {
return {
userAgent: "",
platform: "",
maxTouchPoints: 0
};
}
if (true) {
const uaData = navigator.userAgentData;
if (uaData && Array.isArray(uaData.brands)) {
return {
userAgent: uaData.brands.map(({
brand,
version: version2
}) => `${brand}/${version2}`).join(" "),
platform: uaData.platform ?? navigator.platform ?? "",
maxTouchPoints: navigator.maxTouchPoints ?? 0
};
}
}
return {
userAgent: navigator.userAgent,
platform: navigator.platform ?? "",
maxTouchPoints: navigator.maxTouchPoints ?? 0
};
}
var {
userAgent,
platform,
maxTouchPoints
} = readRawData();
var lowerUserAgent = userAgent.toLowerCase();
var lowerPlatform = platform.toLowerCase();
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/os.mjs
var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1;
var ANDROID_STRING = "android";
var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);
var mac = !ios && lowerPlatform.startsWith("mac");
var windows = lowerPlatform.startsWith("win");
var linux = !android && /^(linux|chrome os)/.test(lowerPlatform);
var apple = mac || ios;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/engine.mjs
var engine_exports = {};
__export(engine_exports, {
blink: () => blink,
gecko: () => gecko,
webkit: () => webkit
});
var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none");
var gecko = !webkit && lowerUserAgent.includes("firefox");
var blink = !webkit && lowerUserAgent.includes("chrom");
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/screen-reader.mjs
var screen_reader_exports = {};
__export(screen_reader_exports, {
voiceOver: () => voiceOver
});
var voiceOver = apple;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/env.mjs
var env_exports = {};
__export(env_exports, {
jsdom: () => jsdom
});
var jsdom = /jsdom|happydom/.test(lowerUserAgent);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/platform/media-query.mjs
var media_query_exports = {};
__export(media_query_exports, {
iOS: () => iOS
});
var iOS = "@supports (-webkit-touch-callout: none)";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
var React12 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs
function isReactEvent(event) {
return "nativeEvent" in event;
}
function isVirtualClick(event) {
if (event.pointerType === "" && event.isTrusted) {
return true;
}
if (parts_exports.os.android && event.pointerType) {
return event.type === "click" && event.buttons === 1;
}
return event.detail === 0 && !event.pointerType;
}
function isMouseLikePointerType(pointerType, strict) {
const values = ["mouse", "pen"];
if (!strict) {
values.push("", void 0);
}
return values.includes(pointerType);
}
function isClickLikeEvent(event) {
const type = event.type;
return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/shadowDom.mjs
function activeElement(doc) {
let element = doc.activeElement;
while (element?.shadowRoot?.activeElement != null) {
element = element.shadowRoot.activeElement;
}
return element;
}
function contains(parent, child) {
if (!parent || !child) {
return false;
}
const rootNode = child.getRootNode?.();
if (parent.contains(child)) {
return true;
}
if (rootNode && isShadowRoot(rootNode)) {
let next = child;
while (next) {
if (parent === next) {
return true;
}
next = next.parentNode || next.host;
}
}
return false;
}
function closest(node, selector) {
let current = node;
while (current) {
if (isElement(current) && current.matches(selector)) {
return current;
}
current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null);
}
return null;
}
function getTarget(event) {
if ("composedPath" in event) {
return event.composedPath()[0] ?? event.target;
}
return event.target;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs
var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable";
var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs
var open = "data-open";
var closed = "data-closed";
var anchorHidden = "data-anchor-hidden";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs
var CommonTriggerDataAttributes_exports = {};
__export(CommonTriggerDataAttributes_exports, {
popupOpen: () => popupOpen,
pressed: () => pressed
});
var popupOpen = "data-popup-open";
var pressed = "data-pressed";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popupStateMapping.mjs
var TRIGGER_HOOK = {
[popupOpen]: ""
};
var PRESSABLE_TRIGGER_HOOK = {
[popupOpen]: "",
[pressed]: ""
};
var POPUP_OPEN_HOOK = {
[open]: ""
};
var POPUP_CLOSED_HOOK = {
[closed]: ""
};
var ANCHOR_HIDDEN_HOOK = {
[anchorHidden]: ""
};
var triggerOpenStateMapping = {
open(value) {
if (value) {
return TRIGGER_HOOK;
}
return null;
}
};
var popupStateMapping = {
open(value) {
if (value) {
return POPUP_OPEN_HOOK;
}
return POPUP_CLOSED_HOOK;
},
anchorHidden(value) {
if (value) {
return ANCHOR_HIDDEN_HOOK;
}
return null;
}
};
var popupTransitionStateMapping = {
...popupStateMapping,
...transitionStatusMapping
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs
var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen;
var triggerDisabled = "data-trigger-disabled";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs
function isTargetInsideEnabledTrigger(target, triggerElements) {
if (!isElement(target)) {
return false;
}
const targetElement = target;
if (triggerElements.hasElement(targetElement)) {
return !targetElement.hasAttribute(triggerDisabled);
}
for (const [, trigger] of triggerElements.entries()) {
if (contains(trigger, targetElement)) {
return !trigger.hasAttribute(triggerDisabled);
}
}
return false;
}
function isEventTargetWithin(event, node) {
if (node == null) {
return false;
}
if ("composedPath" in event) {
return event.composedPath().includes(node);
}
const eventAgain = event;
return eventAgain.target != null && node.contains(eventAgain.target);
}
function isRootElement(element) {
return element.matches("html,body");
}
function isTypeableElement(element) {
return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);
}
function isInteractiveElement(element) {
return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${TYPEABLE_SELECTOR}`) != null;
}
function matchesFocusVisible(element) {
if (!element || parts_exports.env.jsdom) {
return true;
}
try {
return element.matches(":focus-visible");
} catch (_e) {
return true;
}
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs
function resolveValue(value, pointerType) {
if (pointerType != null && !isMouseLikePointerType(pointerType)) {
return 0;
}
if (typeof value === "function") {
return value();
}
return value;
}
function getDelay(value, prop, pointerType) {
const result = resolveValue(value, pointerType);
if (typeof result === "number") {
return result;
}
return result?.[prop];
}
function getRestMs(value) {
if (typeof value === "function") {
return value();
}
return value;
}
function isClickLikeOpenEvent(openEventType, interactedInside) {
return interactedInside || openEventType === "click" || openEventType === "mousedown";
}
function isHoverOpenEvent(openEventType) {
return openEventType?.includes("mouse") && openEventType !== "mousedown";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
var FloatingDelayGroupContext = /* @__PURE__ */ React12.createContext({
hasProvider: false,
timeoutMs: 0,
delayRef: {
current: 0
},
initialDelayRef: {
current: 0
},
timeout: new Timeout(),
currentIdRef: {
current: null
},
currentContextRef: {
current: null
}
});
if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext";
function resetDelayRef(delayRef, initialDelayRef) {
delayRef.current = initialDelayRef.current;
}
function FloatingDelayGroup(props) {
const {
children,
delay,
timeoutMs = 0
} = props;
const delayRef = React12.useRef(delay);
const initialDelayRef = React12.useRef(delay);
const currentIdRef = React12.useRef(null);
const currentContextRef = React12.useRef(null);
const timeout = useTimeout();
useIsoLayoutEffect(() => {
initialDelayRef.current = delay;
if (!currentIdRef.current) {
delayRef.current = delay;
return;
}
delayRef.current = {
open: getDelay(delayRef.current, "open"),
close: getDelay(delay, "close")
};
}, [delay, currentIdRef, delayRef, initialDelayRef]);
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, {
value: React12.useMemo(() => ({
hasProvider: true,
delayRef,
initialDelayRef,
currentIdRef,
timeoutMs,
currentContextRef,
timeout
}), [timeoutMs, timeout]),
children
});
}
function useDelayGroup(store, options = {
open: false
}) {
const {
open: open2
} = options;
const floatingId = store.useState("floatingId");
const groupContext = React12.useContext(FloatingDelayGroupContext);
const {
currentIdRef,
delayRef,
timeoutMs,
initialDelayRef,
currentContextRef,
hasProvider,
timeout
} = groupContext;
const [isInstantPhase, setIsInstantPhase] = React12.useState(false);
const openRef = React12.useRef(open2);
useIsoLayoutEffect(() => {
openRef.current = open2;
}, [open2]);
useIsoLayoutEffect(() => {
function unset() {
currentContextRef.current?.setIsInstantPhase(false);
currentIdRef.current = null;
currentContextRef.current = null;
delayRef.current = initialDelayRef.current;
timeout.clear();
}
if (!currentIdRef.current) {
return void 0;
}
if (!open2 && currentIdRef.current === floatingId) {
setIsInstantPhase(false);
if (timeoutMs) {
const closingId = floatingId;
timeout.start(timeoutMs, () => {
if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) {
return;
}
unset();
});
return () => {
if (openRef.current || currentIdRef.current !== closingId) {
timeout.clear();
}
};
}
unset();
}
return void 0;
}, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]);
useIsoLayoutEffect(() => {
if (!open2) {
return;
}
const prevContext = currentContextRef.current;
const prevId = currentIdRef.current;
timeout.clear();
currentContextRef.current = {
onOpenChange: store.setOpen,
setIsInstantPhase
};
currentIdRef.current = floatingId;
delayRef.current = {
open: 0,
close: getDelay(initialDelayRef.current, "close")
};
if (prevId !== null && prevId !== floatingId) {
setIsInstantPhase(true);
prevContext?.setIsInstantPhase(true);
prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none));
} else {
setIsInstantPhase(false);
prevContext?.setIsInstantPhase(false);
}
}, [open2, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]);
useIsoLayoutEffect(() => {
return () => {
if (currentIdRef.current === floatingId) {
currentContextRef.current = null;
if (!openRef.current) {
return;
}
currentIdRef.current = null;
resetDelayRef(delayRef, initialDelayRef);
timeout.clear();
}
};
}, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]);
return React12.useMemo(() => ({
activeIdRef: currentIdRef,
hasProvider,
delayRef,
isInstantPhase
}), [currentIdRef, hasProvider, delayRef, isInstantPhase]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/mergeCleanups.mjs
function mergeCleanups(...cleanups) {
return () => {
for (let i = 0; i < cleanups.length; i += 1) {
const cleanup = cleanups[i];
if (cleanup) {
cleanup();
}
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FocusGuard.mjs
var React13 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/visuallyHidden.mjs
var visuallyHiddenBase = {
clipPath: "inset(50%)",
overflow: "hidden",
whiteSpace: "nowrap",
border: 0,
padding: 0,
width: 1,
height: 1,
margin: -1
};
var visuallyHidden = {
...visuallyHiddenBase,
position: "fixed",
margin: 0,
top: 0,
left: 0
};
var visuallyHiddenInput = {
...visuallyHiddenBase,
position: "absolute"
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FocusGuard.mjs
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var FocusGuard = /* @__PURE__ */ React13.forwardRef(function FocusGuard2(props, ref) {
const [role, setRole] = React13.useState();
useIsoLayoutEffect(() => {
if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) {
setRole("button");
}
}, []);
const restProps = {
tabIndex: 0,
// Role is only for VoiceOver
role
};
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", {
...props,
ref,
style: visuallyHidden,
"aria-hidden": role ? void 0 : true,
...restProps,
"data-base-ui-focus-guard": ""
});
});
if (true) FocusGuard.displayName = "FocusGuard";
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var min = Math.min;
var max = Math.max;
var round = Math.round;
var floor = Math.floor;
var createCoords = (v) => ({
x: v,
y: v
});
var oppositeSideMap = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function clamp(start, value, end) {
return max(start, min(value, end));
}
function evaluate(value, param) {
return typeof value === "function" ? value(param) : value;
}
function getSide(placement) {
return placement.split("-")[0];
}
function getAlignment(placement) {
return placement.split("-")[1];
}
function getOppositeAxis(axis) {
return axis === "x" ? "y" : "x";
}
function getAxisLength(axis) {
return axis === "y" ? "height" : "width";
}
function getSideAxis(placement) {
const firstChar = placement[0];
return firstChar === "t" || firstChar === "b" ? "y" : "x";
}
function getAlignmentAxis(placement) {
return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start");
}
var lrPlacement = ["left", "right"];
var rlPlacement = ["right", "left"];
var tbPlacement = ["top", "bottom"];
var btPlacement = ["bottom", "top"];
function getSideList(side, isStart, rtl) {
switch (side) {
case "top":
case "bottom":
if (rtl) return isStart ? rlPlacement : lrPlacement;
return isStart ? lrPlacement : rlPlacement;
case "left":
case "right":
return isStart ? tbPlacement : btPlacement;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction === "start", rtl);
if (alignment) {
list = list.map((side) => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
const side = getSide(placement);
return oppositeSideMap[side] + placement.slice(side.length);
}
function expandPaddingObject(padding) {
var _padding$top, _padding$right, _padding$bottom, _padding$left;
return {
top: (_padding$top = padding.top) != null ? _padding$top : 0,
right: (_padding$right = padding.right) != null ? _padding$right : 0,
bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,
left: (_padding$left = padding.left) != null ? _padding$left : 0
};
}
function getPaddingObject(padding) {
return typeof padding !== "number" ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
const {
x,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x,
right: x + width,
bottom: y + height,
x,
y
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
function isHiddenByStyles(styles) {
return styles.visibility === "hidden" || styles.visibility === "collapse";
}
function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) {
if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) {
return false;
}
if (typeof element.checkVisibility === "function") {
return element.checkVisibility();
}
return styles.display !== "none" && styles.display !== "contents";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs
var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';
function getParentElement(element) {
const assignedSlot = element.assignedSlot;
if (assignedSlot) {
return assignedSlot;
}
if (element.parentElement) {
return element.parentElement;
}
const rootNode = element.getRootNode();
return isShadowRoot(rootNode) ? rootNode.host : null;
}
function getDetailsSummary(details) {
for (const child of Array.from(details.children)) {
if (getNodeName(child) === "summary") {
return child;
}
}
return null;
}
function isWithinOpenDetailsSummary(element, details) {
const summary = getDetailsSummary(details);
return !!summary && (element === summary || contains(summary, element));
}
function isFocusableCandidate(element) {
const nodeName = element ? getNodeName(element) : "";
return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden");
}
function isFocusableElement(element) {
if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) {
return false;
}
for (let current = element; current; current = getParentElement(current)) {
const isAncestor = current !== element;
const isSlot = getNodeName(current) === "slot";
if (current.hasAttribute("inert")) {
return false;
}
if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {
return false;
}
}
return true;
}
function isVisibleInTabbableTree(element, isAncestor) {
const styles = getComputedStyle2(element);
if (!isAncestor) {
return isElementVisible(element, styles);
}
return styles.display !== "none";
}
function getTabIndex(element) {
const tabIndex = element.tabIndex;
if (tabIndex < 0) {
const nodeName = getNodeName(element);
if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) {
return 0;
}
}
return tabIndex;
}
function getNamedRadioInput(element) {
if (getNodeName(element) !== "input") {
return null;
}
const input = element;
return input.type === "radio" && input.name !== "" ? input : null;
}
function isTabbableRadio(element, candidates) {
const input = getNamedRadioInput(element);
if (!input) {
return true;
}
const checkedRadio = candidates.find((candidate) => {
const radio = getNamedRadioInput(candidate);
return radio?.name === input.name && radio.form === input.form && radio.checked;
});
if (checkedRadio) {
return checkedRadio === input;
}
return candidates.find((candidate) => {
const radio = getNamedRadioInput(candidate);
return radio?.name === input.name && radio.form === input.form;
}) === input;
}
function getComposedChildren(container) {
if (isHTMLElement(container) && getNodeName(container) === "slot") {
const assignedElements = container.assignedElements({
flatten: true
});
if (assignedElements.length > 0) {
return assignedElements;
}
}
if (isHTMLElement(container) && container.shadowRoot) {
return Array.from(container.shadowRoot.children);
}
return Array.from(container.children);
}
function appendCandidates(container, list) {
getComposedChildren(container).forEach((child) => {
if (isFocusableCandidate(child)) {
list.push(child);
}
appendCandidates(child, list);
});
}
function appendMatchingElements(container, selector, list) {
getComposedChildren(container).forEach((child) => {
if (isHTMLElement(child) && child.matches(selector)) {
list.push(child);
}
appendMatchingElements(child, selector, list);
});
}
function focusable(container) {
const candidates = [];
appendCandidates(container, candidates);
return candidates.filter(isFocusableElement);
}
function tabbable(container) {
const candidates = focusable(container);
return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));
}
function getTabbableIn(container, dir) {
const list = tabbable(container);
const len = list.length;
if (len === 0) {
return void 0;
}
const active = activeElement(ownerDocument(container));
const index2 = list.indexOf(active);
const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir;
return list[nextIndex];
}
function getNextTabbable(referenceElement) {
return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;
}
function getPreviousTabbable(referenceElement) {
return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
}
function isOutsideEvent(event, container) {
const containerElement = container || event.currentTarget;
const relatedTarget = event.relatedTarget;
return !relatedTarget || !contains(containerElement, relatedTarget);
}
function disableFocusInside(container) {
const tabbableElements = tabbable(container);
tabbableElements.forEach((element) => {
element.dataset.tabindex = element.getAttribute("tabindex") || "";
element.setAttribute("tabindex", "-1");
});
}
function enableFocusInside(container) {
const elements = [];
appendMatchingElements(container, "[data-tabindex]", elements);
elements.forEach((element) => {
const tabindex = element.dataset.tabindex;
delete element.dataset.tabindex;
if (tabindex) {
element.setAttribute("tabindex", tabindex);
} else {
element.removeAttribute("tabindex");
}
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs
function getNodeChildren(nodes, id, onlyOpenChildren = true) {
const directChildren = nodes.filter((node) => node.parentId === id);
return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs
function createAttribute(name) {
return `data-base-ui-${name}`;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
var React14 = __toESM(require_react(), 1);
var ReactDOM2 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/constants.mjs
var DISABLED_TRANSITIONS_STYLE = {
style: {
transition: "none"
}
};
var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;
var POPUP_COLLISION_AVOIDANCE = {
fallbackAxisSide: "end"
};
var ownerVisuallyHidden = {
clipPath: "inset(50%)",
position: "fixed",
top: 0,
left: 0
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
var PortalContext = /* @__PURE__ */ React14.createContext(null);
if (true) PortalContext.displayName = "PortalContext";
var usePortalContext = () => React14.useContext(PortalContext);
var attr = createAttribute("portal");
function useFloatingPortalNode(props = {}) {
const {
ref,
container: containerProp,
componentProps = EMPTY_OBJECT,
elementProps
} = props;
const uniqueId = useId();
const portalContext = usePortalContext();
const parentPortalNode = portalContext?.portalNode;
const [containerElement, setContainerElement] = React14.useState(null);
const [portalNode, setPortalNode] = React14.useState(null);
const setPortalNodeRef = useStableCallback((node) => {
if (node !== null) {
setPortalNode(node);
}
});
const containerRef = React14.useRef(null);
useIsoLayoutEffect(() => {
if (containerProp === null) {
if (containerRef.current) {
containerRef.current = null;
setPortalNode(null);
setContainerElement(null);
}
return;
}
const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;
if (resolvedContainer == null) {
if (containerRef.current) {
containerRef.current = null;
setPortalNode(null);
setContainerElement(null);
}
return;
}
if (containerRef.current !== resolvedContainer) {
containerRef.current = resolvedContainer;
setPortalNode(null);
setContainerElement(resolvedContainer);
}
}, [containerProp, parentPortalNode]);
const portalElement = useRenderElement("div", componentProps, {
ref: [ref, setPortalNodeRef],
props: [{
id: uniqueId,
[attr]: ""
}, elementProps]
});
const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null;
return {
node: portalNode,
// `id` and `render` props can override or remove the generated ID. Use the exact
// rendered value so `aria-owns` never points at an ID absent from the DOM.
nodeId: /* @__PURE__ */ React14.isValidElement(portalElement) ? portalElement.props.id : void 0,
subtree: portalSubtree
};
}
var FloatingPortal = /* @__PURE__ */ React14.forwardRef(function FloatingPortal2(componentProps, forwardedRef) {
const {
render,
className,
style,
children,
container,
portalOwnerRole,
...elementProps
} = componentProps;
const {
node: portalNode,
nodeId: portalNodeId,
subtree: portalSubtree
} = useFloatingPortalNode({
container,
ref: forwardedRef,
componentProps,
elementProps
});
const beforeOutsideRef = React14.useRef(null);
const afterOutsideRef = React14.useRef(null);
const beforeInsideRef = React14.useRef(null);
const afterInsideRef = React14.useRef(null);
const [focusManagerState, setFocusManagerState] = React14.useState(null);
const focusInsideDisabledRef = React14.useRef(false);
const modal = focusManagerState?.modal;
const open2 = focusManagerState?.open;
const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;
React14.useEffect(() => {
if (!portalNode || modal) {
return void 0;
}
function onFocus(event) {
if (portalNode && event.relatedTarget && isOutsideEvent(event)) {
if (event.type === "focusin") {
if (focusInsideDisabledRef.current) {
enableFocusInside(portalNode);
focusInsideDisabledRef.current = false;
}
} else {
disableFocusInside(portalNode);
focusInsideDisabledRef.current = true;
}
}
}
return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true));
}, [portalNode, modal]);
useIsoLayoutEffect(() => {
if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) {
return;
}
enableFocusInside(portalNode);
focusInsideDisabledRef.current = false;
}, [open2, portalNode]);
const portalContextValue = React14.useMemo(() => ({
beforeOutsideRef,
afterOutsideRef,
beforeInsideRef,
afterInsideRef,
portalNode,
setFocusManagerState
}), [portalNode]);
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React14.Fragment, {
children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, {
value: portalContextValue,
children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, {
"data-type": "outside",
ref: beforeOutsideRef,
onFocus: (event) => {
if (isOutsideEvent(event, portalNode)) {
beforeInsideRef.current?.focus();
} else {
const domReference = focusManagerState ? focusManagerState.domReference : null;
const prevTabbable = getPreviousTabbable(domReference);
prevTabbable?.focus();
}
}
}), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", {
role: portalOwnerRole,
"aria-owns": portalNodeId,
style: ownerVisuallyHidden
}), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, {
"data-type": "outside",
ref: afterOutsideRef,
onFocus: (event) => {
if (isOutsideEvent(event, portalNode)) {
afterInsideRef.current?.focus();
} else {
const domReference = focusManagerState ? focusManagerState.domReference : null;
const nextTabbable = getNextTabbable(domReference);
nextTabbable?.focus();
if (focusManagerState?.closeOnFocusOut) {
focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent));
}
}
}
})]
})]
});
});
if (true) FloatingPortal.displayName = "FloatingPortal";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
var React15 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs
function createEventEmitter() {
const map = /* @__PURE__ */ new Map();
return {
emit(event, data) {
map.get(event)?.forEach((listener) => listener(data));
},
on(event, listener) {
if (!map.has(event)) {
map.set(event, /* @__PURE__ */ new Set());
}
map.get(event).add(listener);
},
off(event, listener) {
map.get(event)?.delete(listener);
}
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
var FloatingNodeContext = /* @__PURE__ */ React15.createContext(null);
if (true) FloatingNodeContext.displayName = "FloatingNodeContext";
var FloatingTreeContext = /* @__PURE__ */ React15.createContext(null);
if (true) FloatingTreeContext.displayName = "FloatingTreeContext";
var useFloatingParentNodeId = () => React15.useContext(FloatingNodeContext)?.id || null;
var useFloatingTree = (externalTree) => {
const contextTree = React15.useContext(FloatingTreeContext);
return externalTree ?? contextTree;
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs
var React16 = __toESM(require_react(), 1);
function createVirtualElement(domElement, data) {
let offsetX = null;
let offsetY = null;
let isAutoUpdateEvent = false;
return {
contextElement: domElement || void 0,
getBoundingClientRect() {
const domRect = domElement?.getBoundingClientRect() || {
width: 0,
height: 0,
x: 0,
y: 0
};
const isXAxis = data.axis === "x" || data.axis === "both";
const isYAxis = data.axis === "y" || data.axis === "both";
const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch";
const width = data.axis === "y" ? domRect.width : 0;
const height = data.axis === "x" ? domRect.height : 0;
let x = domRect.x;
let y = domRect.y;
if (offsetX == null && data.x && isXAxis) {
offsetX = domRect.x - data.x;
}
if (offsetY == null && data.y && isYAxis) {
offsetY = domRect.y - data.y;
}
x -= offsetX || 0;
y -= offsetY || 0;
if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) {
x = isXAxis && data.x != null ? data.x : x;
y = isYAxis && data.y != null ? data.y : y;
}
isAutoUpdateEvent = true;
return {
width,
height,
x,
y,
top: y,
right: x + width,
bottom: y + height,
left: x
};
}
};
}
function isMouseBasedEvent(event) {
return event != null && event.clientX != null;
}
function useClientPoint(store, props = {}) {
const {
enabled = true,
axis = "both"
} = props;
const open2 = store.useState("open");
const floating = store.useState("floatingElement");
const domReference = store.useState("domReferenceElement");
const dataRef = store.context.dataRef;
const initialRef = React16.useRef(false);
const cleanupListenerRef = React16.useRef(null);
const [pointerType, setPointerType] = React16.useState();
const [reactive, setReactive] = React16.useState([]);
const resetReference = useStableCallback((reference2) => {
store.set("positionReference", reference2);
});
const setReference = useStableCallback((newX, newY, referenceElement) => {
if (initialRef.current) {
return;
}
if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) {
return;
}
store.set("positionReference", createVirtualElement(referenceElement ?? domReference, {
x: newX,
y: newY,
axis,
dataRef,
pointerType
}));
});
const handleReferenceEnterOrMove = useStableCallback((event) => {
if (!open2) {
setReference(event.clientX, event.clientY, event.currentTarget);
} else if (!cleanupListenerRef.current) {
setReference(event.clientX, event.clientY, event.currentTarget);
setReactive([]);
}
});
const openCheck = isMouseLikePointerType(pointerType) ? floating : open2;
React16.useEffect(() => {
if (!enabled) {
resetReference(domReference);
return void 0;
}
if (!openCheck) {
return void 0;
}
function cleanupListener() {
cleanupListenerRef.current?.();
cleanupListenerRef.current = null;
}
const win = getWindow(floating);
function handleMouseMove(event) {
const target = getTarget(event);
if (!contains(floating, target)) {
setReference(event.clientX, event.clientY);
} else {
cleanupListener();
}
}
if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) {
cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove);
} else {
resetReference(domReference);
}
return cleanupListener;
}, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]);
React16.useEffect(() => () => {
store.set("positionReference", null);
}, [store]);
React16.useEffect(() => {
if (enabled && !floating) {
initialRef.current = false;
}
}, [enabled, floating]);
React16.useEffect(() => {
if (!enabled && open2) {
initialRef.current = true;
}
}, [enabled, open2]);
const reference = React16.useMemo(() => {
function setPointerTypeRef(event) {
setPointerType(event.pointerType);
}
return {
onPointerDown: setPointerTypeRef,
onPointerEnter: setPointerTypeRef,
onMouseMove: handleReferenceEnterOrMove,
onMouseEnter: handleReferenceEnterOrMove
};
}, [handleReferenceEnterOrMove]);
return React16.useMemo(() => enabled ? {
reference,
trigger: reference
} : {}, [enabled, reference]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs
var React17 = __toESM(require_react(), 1);
function alwaysFalse() {
return false;
}
function normalizeProp(normalizable) {
return {
escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false,
outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true
};
}
function useDismiss(store, props = {}) {
const {
enabled = true,
escapeKey: escapeKey2 = true,
outsidePress: outsidePressProp = true,
outsidePressEvent = "sloppy",
referencePress = alwaysFalse,
bubbles,
externalTree
} = props;
const open2 = store.useState("open");
const floatingElement = store.useState("floatingElement");
const {
dataRef,
events
} = store.context;
const tree = useFloatingTree(externalTree);
const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false);
const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp;
const outsidePressEnabled = outsidePress2 !== false;
const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);
const {
escapeKey: escapeKeyBubbles,
outsidePress: outsidePressBubbles
} = normalizeProp(bubbles);
const pressStartedInsideRef = React17.useRef(false);
const pressStartPreventedRef = React17.useRef(false);
const suppressNextOutsideClickRef = React17.useRef(false);
const sawPressWhileOpenRef = React17.useRef(false);
const isComposingRef = React17.useRef(false);
const currentPointerTypeRef = React17.useRef("");
const touchStateRef = React17.useRef(null);
const cancelDismissOnEndTimeout = useTimeout();
const clearInsideReactTreeTimeout = useTimeout();
const compositionTimeout = useTimeout();
const clearInsideReactTree = useStableCallback(() => {
clearInsideReactTreeTimeout.clear();
dataRef.current.insideReactTree = false;
});
const hasBlockingChild = useStableCallback((bubbleKey) => {
const nodeId = dataRef.current.floatingContext?.nodeId;
const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];
return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]);
});
const isEventWithinOwnElements = useStableCallback((event) => {
return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"));
});
const closeOnReferencePress = useStableCallback((event) => {
if (!referencePress()) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent));
});
const closeOnEscapeKeyDown = useStableCallback((event) => {
if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") {
return;
}
const native = isReactEvent(event) ? event.nativeEvent : event;
if (isComposingRef.current || native.isComposing) {
return;
}
if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) {
return;
}
const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native);
store.setOpen(false, eventDetails);
if (!eventDetails.isCanceled) {
event.preventDefault();
}
if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {
event.stopPropagation();
}
});
const markInsideReactTree = useStableCallback(() => {
dataRef.current.insideReactTree = true;
clearInsideReactTreeTimeout.start(0, clearInsideReactTree);
});
const markPressStartedInsideReactTree = useStableCallback((event) => {
if (!open2 || !enabled || event.button !== 0) {
return;
}
const target = getTarget(event.nativeEvent);
if (!contains(store.select("floatingElement"), target)) {
return;
}
if (!pressStartedInsideRef.current) {
pressStartedInsideRef.current = true;
pressStartPreventedRef.current = false;
}
});
const markInsidePressStartPrevented = useStableCallback((event) => {
if (!open2 || !enabled) {
return;
}
if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {
return;
}
if (pressStartedInsideRef.current) {
pressStartPreventedRef.current = true;
}
});
React17.useEffect(() => {
function handleOpenChange(details) {
if (!details.open) {
sawPressWhileOpenRef.current = false;
}
}
events.on("openchange", handleOpenChange);
return () => {
events.off("openchange", handleOpenChange);
};
}, [events]);
React17.useEffect(() => clearInsideReactTree, [clearInsideReactTree]);
React17.useEffect(() => {
if (!open2 || !enabled) {
if (!open2) {
sawPressWhileOpenRef.current = false;
isComposingRef.current = false;
currentPointerTypeRef.current = "";
touchStateRef.current = null;
}
return clearInsideReactTree;
}
dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;
dataRef.current.__outsidePressBubbles = outsidePressBubbles;
const preventedPressSuppressionTimeout = new Timeout();
const doc = ownerDocument(floatingElement);
function handleCompositionStart() {
compositionTimeout.clear();
isComposingRef.current = true;
}
function handleCompositionEnd() {
isComposingRef.current = true;
compositionTimeout.start(
// 0ms or 1ms don't work in Safari. 5ms appears to consistently work.
// Only apply to WebKit for the test to remain 0ms.
parts_exports.engine.webkit ? 5 : 0,
() => {
isComposingRef.current = false;
}
);
}
function suppressImmediateOutsideClickAfterPreventedStart() {
suppressNextOutsideClickRef.current = true;
preventedPressSuppressionTimeout.start(0, () => {
suppressNextOutsideClickRef.current = false;
});
}
function resetPressStartState() {
pressStartedInsideRef.current = false;
pressStartPreventedRef.current = false;
}
function getOutsidePressEvent() {
const type = currentPointerTypeRef.current;
const computedType = type === "pen" || !type ? "mouse" : type;
const outsidePressEventValue = getOutsidePressEventProp();
const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue;
if (typeof resolved === "string") {
return resolved;
}
return resolved[computedType];
}
function shouldIgnoreEvent(event) {
const computedOutsidePressEvent = getOutsidePressEvent();
return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click";
}
function isEventWithinFloatingTree(event) {
const nodeId = dataRef.current.floatingContext?.nodeId;
const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating));
return isEventWithinOwnElements(event) || targetIsInsideChildren;
}
function closeOnPressOutside(event) {
if (shouldIgnoreEvent(event)) {
if (event.type !== "click" && !isEventWithinOwnElements(event)) {
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = false;
}
clearInsideReactTree();
return;
}
if (dataRef.current.insideReactTree) {
clearInsideReactTree();
return;
}
const target = getTarget(event);
const inertSelector = `[${createAttribute("inert")}]`;
const targetRoot = isElement(target) ? target.getRootNode() : null;
const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector));
const triggers = store.context.triggerElements;
if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) {
return;
}
let targetRootAncestor = isElement(target) ? target : null;
while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {
const nextParent = getParentNode(targetRootAncestor);
if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {
break;
}
targetRootAncestor = nextParent;
}
if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay).
!contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the
// element was injected after the floating element rendered.
markers.every((marker) => !contains(targetRootAncestor, marker))) {
return;
}
if (isHTMLElement(target) && !("touches" in event)) {
const lastTraversableNode = isLastTraversableNode(target);
const style = getComputedStyle2(target);
const scrollRe = /auto|scroll/;
const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);
const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);
const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;
const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;
const isRTL3 = style.direction === "rtl";
const pressedVerticalScrollbar = canScrollY && (isRTL3 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);
const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;
if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {
return;
}
}
if (isEventWithinFloatingTree(event)) {
return;
}
if (getOutsidePressEvent() === "intentional") {
if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {
return;
}
if (suppressNextOutsideClickRef.current) {
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = false;
return;
}
}
if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
return;
}
if (hasBlockingChild("__outsidePressBubbles")) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event));
clearInsideReactTree();
}
function handlePointerDown(event) {
if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
return;
}
closeOnPressOutside(event);
}
function handleTouchStart(event) {
if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) {
return;
}
const touch = event.touches[0];
if (touch) {
touchStateRef.current = {
startTime: Date.now(),
startX: touch.clientX,
startY: touch.clientY,
dismissOnTouchEnd: false,
dismissOnMouseDown: true
};
cancelDismissOnEndTimeout.start(1e3, () => {
if (touchStateRef.current) {
touchStateRef.current.dismissOnTouchEnd = false;
touchStateRef.current.dismissOnMouseDown = false;
}
});
}
}
function addTargetEventListenerOnce(event, listener) {
const target = getTarget(event);
if (!target) {
return;
}
const unsubscribe2 = addEventListener(target, event.type, () => {
listener(event);
unsubscribe2();
});
}
function handleTouchStartCapture(event) {
currentPointerTypeRef.current = "touch";
addTargetEventListenerOnce(event, handleTouchStart);
}
function closeOnPressOutsideCapture(event) {
cancelDismissOnEndTimeout.clear();
if (event.type === "pointerdown") {
if (event.button === 0) {
sawPressWhileOpenRef.current = true;
}
currentPointerTypeRef.current = event.pointerType;
}
if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {
return;
}
addTargetEventListenerOnce(event, (targetEvent) => {
if (targetEvent.type === "pointerdown") {
handlePointerDown(targetEvent);
} else {
closeOnPressOutside(targetEvent);
}
});
}
function handlePressEndCapture(event) {
if (event.type === "pointercancel") {
sawPressWhileOpenRef.current = false;
}
if (!pressStartedInsideRef.current) {
return;
}
const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;
resetPressStartState();
if (getOutsidePressEvent() !== "intentional") {
return;
}
if (event.type === "pointercancel") {
if (pressStartedInsideDefaultPrevented) {
suppressImmediateOutsideClickAfterPreventedStart();
}
return;
}
if (isEventWithinFloatingTree(event)) {
return;
}
if (pressStartedInsideDefaultPrevented) {
suppressImmediateOutsideClickAfterPreventedStart();
return;
}
if (typeof outsidePress2 === "function" && !outsidePress2(event)) {
return;
}
preventedPressSuppressionTimeout.clear();
suppressNextOutsideClickRef.current = true;
clearInsideReactTree();
}
function handleTouchMove(event) {
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
return;
}
const touch = event.touches[0];
if (!touch) {
return;
}
const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);
const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
if (distance > 5) {
touchStateRef.current.dismissOnTouchEnd = true;
}
if (distance > 10) {
closeOnPressOutside(event);
cancelDismissOnEndTimeout.clear();
touchStateRef.current = null;
}
}
function handleTouchMoveCapture(event) {
addTargetEventListenerOnce(event, handleTouchMove);
}
function handleTouchEnd(event) {
if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) {
return;
}
if (touchStateRef.current.dismissOnTouchEnd) {
closeOnPressOutside(event);
}
cancelDismissOnEndTimeout.clear();
touchStateRef.current = null;
}
function handleTouchEndCapture(event) {
addTargetEventListenerOnce(event, handleTouchEnd);
}
const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, {
capture: true,
passive: true
}), addEventListener(doc, "touchmove", handleTouchMoveCapture, {
capture: true,
passive: true
}), addEventListener(doc, "touchend", handleTouchEndCapture, {
capture: true,
passive: true
})));
return () => {
unsubscribe();
preventedPressSuppressionTimeout.clear();
resetPressStartState();
suppressNextOutsideClickRef.current = false;
};
}, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]);
const reference = React17.useMemo(() => ({
onKeyDown: closeOnEscapeKeyDown,
onPointerDown: closeOnReferencePress,
onClick: closeOnReferencePress
}), [closeOnEscapeKeyDown, closeOnReferencePress]);
const floating = React17.useMemo(() => ({
onKeyDown: closeOnEscapeKeyDown,
// `onMouseDown` may be blocked if `event.preventDefault()` is called in
// `onPointerDown`, such as with <NumberField.ScrubArea>.
// See https://github.com/mui/base-ui/pull/3379
onPointerDown: markInsidePressStartPrevented,
onMouseDown: markInsidePressStartPrevented,
onClickCapture: markInsideReactTree,
onMouseDownCapture(event) {
markInsideReactTree();
markPressStartedInsideReactTree(event);
},
onPointerDownCapture(event) {
markInsideReactTree();
markPressStartedInsideReactTree(event);
},
onMouseUpCapture: markInsideReactTree,
onTouchEndCapture: markInsideReactTree,
onTouchMoveCapture: markInsideReactTree
}), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);
return React17.useMemo(() => enabled ? {
reference,
floating,
trigger: reference
} : {}, [enabled, reference, floating]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupHandle.mjs
var BasePopupHandle = class {
/**
* Stores of every root currently using this handle, in attach order. A handle is meant to be used
* by a single mounted root, but roots can transiently overlap (e.g. during an animated route
* transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
* leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
*/
attachedStores = [];
/**
* Store of the root that currently controls the handle: the most recently attached one still
* mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
*/
attachedStoreValue = null;
/**
* Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
*/
storeListeners = /* @__PURE__ */ new Set();
/**
* Creates a handle backed by the store used while no root is attached.
*
* @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
* so they can render and register without a mounted root. Triggers register into whichever store
* `store` currently resolves to, so while detached they live in this store's trigger map and
* migrate themselves to the root's store (and back) as it attaches/detaches.
* @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
* `MenuHandle.open()` in warning text.
* @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
* registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
* so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
*/
constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
this.fallbackStore = fallbackStore;
this.componentName = componentName;
this.throwOnMissingTrigger = throwOnMissingTrigger;
}
get attachedStore() {
return this.attachedStoreValue;
}
/**
* Store that detached triggers read from: the attached root's store, or an inert fallback store
* used while no root is attached.
* @internal
*/
get store() {
return this.attachedStoreValue ?? this.fallbackStore;
}
/**
* Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
* the handle during render because a handle can be shared by concurrent server-rendered requests.
* @internal
*/
get serverStore() {
return this.fallbackStore;
}
/**
* Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
* when a root attaches or detaches. Returns a function that removes the listener.
* @internal
*/
subscribeStore(listener) {
this.storeListeners.add(listener);
return () => {
this.storeListeners.delete(listener);
};
}
/**
* Points the handle at a root's store and notifies subscribers so detached triggers re-render and
* re-register into it (their registration effect migrates them when the store pointer changes).
* Returns a cleanup function that detaches the store again.
* @internal
*/
attachStore(newStore) {
this.attachedStores.push(newStore);
this.setActiveStore(newStore);
if (true) {
if (this.attachedStores.length > 1) {
const dev = this;
(dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
if (this.attachedStores.length > 1) {
console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
}
});
}
}
return () => {
const index2 = this.attachedStores.lastIndexOf(newStore);
if (index2 !== -1) {
this.attachedStores.splice(index2, 1);
}
this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
};
}
/**
* Sets the store that currently controls the handle and notifies subscribers when it changes, so
* detached triggers re-render and migrate their registration to the new store.
*/
setActiveStore(store) {
if (this.attachedStoreValue !== store) {
this.attachedStoreValue = store;
this.storeListeners.forEach((listener) => {
listener();
});
}
}
/**
* Opens the attached root's store and associates it with the trigger with the given id, or a
* no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
* `open()` method, which only narrows the parameter type.
*
* When a trigger id is given but no matching trigger is registered, anchored popups throw (see
* `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
*
* This method should only be called in an event handler or an effect (not during rendering).
*
* @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
* without associating any trigger.
*/
openByTrigger(triggerId) {
const attachedStore = this.attachedStore;
if (attachedStore === null) {
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
}
return;
}
let triggerElement;
if (triggerId) {
for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
}
triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
}
if (triggerId && !triggerElement) {
if (this.throwOnMissingTrigger) {
throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
}
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
}
}
attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
}
/**
* Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
* while no root is attached. Shared by every concrete handle's public `close()` method.
*
* This method should only be called in an event handler or an effect (not during rendering).
*/
closePopup() {
const attachedStore = this.attachedStore;
if (attachedStore === null) {
if (true) {
console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
}
return;
}
attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
var React19 = __toESM(require_react(), 1);
var ReactDOM3 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs
function useSyncedFloatingRootContext(options) {
const {
popupStore,
treatPopupAsFloatingElement = false,
floatingRootContext: store,
floatingId,
nested,
onOpenChange
} = options;
const open2 = popupStore.useState("open");
const referenceElement = popupStore.useState("activeTriggerElement");
const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement");
const handleOpenChange = onOpenChange;
popupStore.useSyncedValue("floatingId", floatingId);
useIsoLayoutEffect(() => {
const valuesToSync = {
open: open2,
floatingId,
referenceElement,
floatingElement
};
if (isElement(referenceElement)) {
valuesToSync.domReferenceElement = referenceElement;
}
if (store.state.positionReference === store.state.referenceElement) {
valuesToSync.positionReference = referenceElement;
}
store.update(valuesToSync);
}, [open2, floatingId, referenceElement, floatingElement, store]);
store.context.onOpenChange = handleOpenChange;
store.context.nested = nested;
return store;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs
var React18 = __toESM(require_react(), 1);
function useUnmountAfterClose(parameters) {
const {
open: open2,
ref,
preventUnmountOnClose,
setPreventUnmountOnClose: setPreventUnmountOnCloseParam,
onUnmount,
animateInitialOpen
} = parameters;
const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam);
const {
mounted,
setMounted,
transitionStatus
} = useTransitionStatus(open2, false, false, animateInitialOpen);
const preventUnmountingOnClose = open2 ? false : preventUnmountOnClose;
useIsoLayoutEffect(() => {
if (open2) {
setPreventUnmountOnClose(false);
}
}, [open2, setPreventUnmountOnClose]);
const mountedRef = React18.useRef(mounted);
const pendingUnmountRef = React18.useRef(false);
const rerender = useForcedRerendering();
const unmount = () => {
mountedRef.current = false;
setMounted(false);
onUnmount();
};
useIsoLayoutEffect(() => {
mountedRef.current = mounted;
if (pendingUnmountRef.current) {
pendingUnmountRef.current = false;
if (!open2 && mounted) {
unmount();
}
}
});
const forceUnmount = useStableCallback(() => {
if (!mountedRef.current) {
return;
}
if (open2) {
pendingUnmountRef.current = true;
rerender();
return;
}
unmount();
});
useOpenChangeComplete({
enabled: mounted && !open2 && !preventUnmountingOnClose,
open: open2,
ref,
onComplete() {
if (!open2) {
forceUnmount();
}
}
});
return {
mounted,
transitionStatus,
preventUnmountingOnClose,
forceUnmount
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs
var FOCUSABLE_POPUP_PROPS = {
tabIndex: -1,
[FOCUSABLE_ATTRIBUTE]: ""
};
function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {
const floatingId = useId();
const nested = useFloatingParentNodeId() != null;
const store = useRefWithInit(() => createStore(floatingId, nested)).current;
useSyncedFloatingRootContext({
popupStore: store,
treatPopupAsFloatingElement,
floatingRootContext: store.state.floatingRootContext,
floatingId,
nested,
onOpenChange: store.setOpen
});
return store;
}
function PopupHandleAttachment({
handle,
store
}) {
useIsoLayoutEffect(() => {
return handle.attachStore(store);
}, [handle, store]);
return null;
}
function syncTriggerCount(store) {
const triggerCount = store.context.triggerElements.size;
if (store.select("open") && store.state.triggerCount !== triggerCount) {
store.set("triggerCount", triggerCount);
}
}
function useTriggerRegistration(id, store) {
const registrationRef = React19.useRef(null);
return useStableCallback((element) => {
const registration = registrationRef.current;
if (registration !== null) {
if (registration.element === element && registration.store === store && registration.id === id) {
return;
}
registrationRef.current = null;
const registeredStore = registration.store;
if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {
registeredStore.context.triggerElements.delete(registration.id);
syncTriggerCount(registeredStore);
}
}
if (element !== null && id !== void 0) {
registrationRef.current = {
store,
id,
element
};
store.context.triggerElements.add(id, element);
syncTriggerCount(store);
}
});
}
function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) {
let preventUnmountingOnClose = state.preventUnmountingOnClose;
if (open2) {
preventUnmountingOnClose = false;
} else if (preventUnmountOnClose) {
preventUnmountingOnClose = true;
}
const triggerId = trigger?.id ?? null;
let activeTriggerId = state.activeTriggerId;
let activeTriggerElement = state.activeTriggerElement;
if (triggerId || open2) {
activeTriggerId = triggerId;
activeTriggerElement = trigger ?? null;
}
return {
open: open2,
preventUnmountingOnClose,
activeTriggerId,
activeTriggerElement,
// An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not
// be reassociated with a lone registered trigger later on. Controlled and default opens never
// pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a
// controlled root may decline it and stay open, so the Root clears the flag only once the
// popup is effectively closed.
openedWithoutTrigger: open2 ? trigger == null : state.openedWithoutTrigger
};
}
function attachPreventUnmountOnClose(eventDetails) {
let preventUnmountOnClose = false;
eventDetails.preventUnmountOnClose = () => {
preventUnmountOnClose = true;
};
return () => preventUnmountOnClose;
}
function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {
const reason = eventDetails.reason;
const isHover = reason === reason_parts_exports.triggerHover;
const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus;
const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey);
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
store.context.onOpenChange?.(nextOpen, eventDetails);
if (eventDetails.isCanceled) {
return;
}
options.onBeforeDispatch?.();
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
const changeState = () => {
const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
const updatedState = {
...options.extraState,
...popupOpenState
};
if (isFocusOpen) {
updatedState.instantType = "focus";
} else if (isDismissClose) {
updatedState.instantType = "dismiss";
} else if (isHover) {
updatedState.instantType = void 0;
}
store.update(updatedState);
};
if (isHover) {
ReactDOM3.flushSync(changeState);
} else {
changeState();
}
}
function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {
const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId);
const baseRegisterTrigger = useTriggerRegistration(triggerId, store);
const applyTriggerData = useStableCallback((element) => {
const open2 = store.select("open");
const activeTriggerId = store.select("activeTriggerId");
if (activeTriggerId === triggerId) {
const changes = {
activeTriggerElement: element,
...open2 ? stateUpdates : null
};
store.update(changes);
return;
}
if (activeTriggerId == null && open2 && !store.state.openedWithoutTrigger) {
const changes = {
activeTriggerId: triggerId ?? null,
activeTriggerElement: element,
...stateUpdates
};
store.update(changes);
}
});
const registerTrigger = useStableCallback((element) => {
baseRegisterTrigger(element);
if (element) {
applyTriggerData(element);
}
});
useIsoLayoutEffect(() => {
registerTrigger(triggerElementRef.current);
return () => registerTrigger(null);
}, [registerTrigger, triggerElementRef, store, triggerId]);
useIsoLayoutEffect(() => {
if (isMountedByThisTrigger) {
const changes = {
activeTriggerElement: triggerElementRef.current,
...stateUpdates
};
store.update(changes);
}
}, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);
return {
registerTrigger,
isMountedByThisTrigger
};
}
function useImplicitActiveTrigger(store, options = {}) {
const {
closeOnActiveTriggerUnmount = false
} = options;
const resolvedActiveTriggerIdRef = React19.useRef(null);
const open2 = store.useState("open");
const reactiveTriggerCount = store.useState("triggerCount");
const activeTriggerId = store.useState("activeTriggerId");
const reactiveActiveTriggerElement = store.useState("activeTriggerElement");
useIsoLayoutEffect(() => {
if (!open2) {
resolvedActiveTriggerIdRef.current = null;
if (store.state.triggerCount !== 0) {
store.set("triggerCount", 0);
}
if (store.state.openedWithoutTrigger) {
store.set("openedWithoutTrigger", false);
}
return;
}
const triggerCount = store.context.triggerElements.size;
const stateUpdates = {};
if (store.state.triggerCount !== triggerCount) {
stateUpdates.triggerCount = triggerCount;
}
const currentActiveTriggerId = store.select("activeTriggerId");
let lostActiveTriggerId = null;
if (currentActiveTriggerId) {
const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);
if (!activeTriggerElement) {
for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {
if (triggerElement === store.state.activeTriggerElement) {
stateUpdates.activeTriggerId = triggerId;
stateUpdates.activeTriggerElement = triggerElement;
resolvedActiveTriggerIdRef.current = triggerId;
break;
}
}
if (stateUpdates.activeTriggerId === void 0) {
if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {
lostActiveTriggerId = currentActiveTriggerId;
} else {
resolvedActiveTriggerIdRef.current = null;
}
}
} else {
resolvedActiveTriggerIdRef.current = currentActiveTriggerId;
if (activeTriggerElement !== store.state.activeTriggerElement) {
stateUpdates.activeTriggerElement = activeTriggerElement;
}
}
} else {
resolvedActiveTriggerIdRef.current = null;
}
if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) {
const iteratorResult = store.context.triggerElements.entries().next();
if (!iteratorResult.done) {
const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;
stateUpdates.activeTriggerId = implicitTriggerId;
stateUpdates.activeTriggerElement = implicitTriggerElement;
resolvedActiveTriggerIdRef.current = implicitTriggerId;
}
}
if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) {
store.update(stateUpdates);
}
if (lostActiveTriggerId) {
if (closeOnActiveTriggerUnmount) {
queueMicrotask(() => {
if (store.select("open") && store.select("activeTriggerId") === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {
const eventDetails = createChangeEventDetails(reason_parts_exports.none);
store.setOpen(false, eventDetails);
if (!eventDetails.isCanceled) {
store.update({
activeTriggerId: null,
activeTriggerElement: null
});
}
}
});
}
}
}, [open2, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);
}
function useOpenStateTransitions(open2, store, onUnmount, animateInitialOpen) {
const {
mounted,
transitionStatus,
forceUnmount
} = useUnmountAfterClose({
open: open2,
ref: store.context.popupRef,
preventUnmountOnClose: store.useState("preventUnmountingOnClose"),
setPreventUnmountOnClose: (preventUnmountOnClose) => store.set("preventUnmountingOnClose", preventUnmountOnClose),
animateInitialOpen,
onUnmount() {
store.update({
activeTriggerId: null,
activeTriggerElement: null,
mounted: false,
preventUnmountingOnClose: false
});
onUnmount?.();
store.context.onOpenChangeComplete?.(false);
}
});
useRefWithInit(() => {
store.set("mounted", mounted);
return null;
});
store.useSyncedValues({
mounted,
transitionStatus
});
return {
forceUnmount,
transitionStatus
};
}
function usePopupInteractionProps(store, statePart) {
store.useSyncedValues(statePart);
useIsoLayoutEffect(() => () => {
store.update({
activeTriggerProps: EMPTY_OBJECT,
inactiveTriggerProps: EMPTY_OBJECT,
popupProps: EMPTY_OBJECT
});
}, [store]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs
var devElementIdsByMap;
function getDevElementIds(map) {
devElementIdsByMap ??= /* @__PURE__ */ new WeakMap();
let elementIds = devElementIdsByMap.get(map);
if (!elementIds) {
elementIds = /* @__PURE__ */ new WeakMap();
devElementIdsByMap.set(map, elementIds);
}
return elementIds;
}
var PopupTriggerMap = class {
idMap = /* @__PURE__ */ new Map();
/**
* Adds a trigger element with the given ID.
*
* Note: The provided element is assumed to not be registered under multiple IDs.
*/
add(id, element) {
if (true) {
const elementIds = getDevElementIds(this);
const existingId = elementIds.get(element);
if (existingId !== void 0 && existingId !== id) {
throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.");
}
const previousElement = this.idMap.get(id);
if (previousElement !== void 0 && previousElement !== element) {
elementIds.delete(previousElement);
}
elementIds.set(element, id);
}
this.idMap.set(id, element);
}
/**
* Removes the trigger element with the given ID.
*/
delete(id) {
if (true) {
const element = this.idMap.get(id);
if (element !== void 0) {
devElementIdsByMap?.get(this)?.delete(element);
}
}
this.idMap.delete(id);
}
/**
* Whether the given element is registered as a trigger.
*/
hasElement(element) {
for (const registered of this.idMap.values()) {
if (registered === element) {
return true;
}
}
return false;
}
/**
* Whether there is a registered trigger element matching the given predicate.
*/
hasMatchingElement(predicate) {
for (const element of this.idMap.values()) {
if (predicate(element)) {
return true;
}
}
return false;
}
/**
* Returns the trigger element associated with the given ID, or undefined if no such element exists.
*/
getById(id) {
return this.idMap.get(id);
}
/**
* Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].
*/
entries() {
return this.idMap.entries();
}
/**
* Returns an iterable of all registered trigger elements.
*/
elements() {
return this.idMap.values();
}
/**
* Returns the number of registered trigger elements.
*/
get size() {
return this.idMap.size;
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/useStore.mjs
var React21 = __toESM(require_react(), 1);
var import_shim = __toESM(require_shim(), 1);
var import_with_selector = __toESM(require_with_selector(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/fastHooks.mjs
var React20 = __toESM(require_react(), 1);
var hooks = [];
var currentInstance = void 0;
function getInstance() {
return currentInstance;
}
function register(hook) {
hooks.push(hook);
}
function fastComponent(fn) {
const FastComponent = (props, forwardedRef) => {
const instance = useRefWithInit(createInstance).current;
let result;
try {
currentInstance = instance;
for (const hook of hooks) {
hook.before(instance);
}
result = fn(props, forwardedRef);
for (const hook of hooks) {
hook.after(instance);
}
instance.didInitialize = true;
} finally {
currentInstance = void 0;
}
return result;
};
FastComponent.displayName = fn.displayName || fn.name;
return FastComponent;
}
function fastComponentRef(fn) {
return /* @__PURE__ */ React20.forwardRef(fastComponent(fn));
}
function createInstance() {
return {
didInitialize: false
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/useStore.mjs
var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);
var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;
function useStore(store, selector, a1, a2, a3) {
return useStoreImplementation(store, selector, a1, a2, a3);
}
function useStoreR19(store, selector, a1, a2, a3) {
const getSelection = React21.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);
return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection);
}
register({
before(instance) {
instance.syncIndex = 0;
if (!instance.didInitialize) {
instance.syncTick = 1;
instance.syncHooks = [];
instance.didChangeStore = true;
instance.getSnapshot = () => {
let didChange2 = false;
for (let i = 0; i < instance.syncHooks.length; i += 1) {
const hook = instance.syncHooks[i];
const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);
if (!Object.is(hook.value, value)) {
didChange2 = true;
hook.value = value;
}
}
if (didChange2) {
instance.syncTick += 1;
}
return instance.syncTick;
};
}
},
after(instance) {
if (instance.syncHooks.length > 0) {
if (instance.didChangeStore) {
instance.didChangeStore = false;
instance.subscribe = (onStoreChange) => {
const stores = /* @__PURE__ */ new Set();
for (const hook of instance.syncHooks) {
stores.add(hook.store);
}
const unsubscribes = [];
for (const store of stores) {
unsubscribes.push(store.subscribe(onStoreChange));
}
return () => {
for (const unsubscribe of unsubscribes) {
unsubscribe();
}
};
};
}
(0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot);
}
}
});
function useStoreFast(store, selector, a1, a2, a3) {
const instance = getInstance();
if (!instance) {
return useStoreR19(store, selector, a1, a2, a3);
}
const index2 = instance.syncIndex;
instance.syncIndex += 1;
let hook;
if (!instance.didInitialize) {
hook = {
store,
selector,
a1,
a2,
a3,
value: selector(store.getSnapshot(), a1, a2, a3)
};
instance.syncHooks.push(hook);
} else {
hook = instance.syncHooks[index2];
if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {
if (hook.store !== store) {
instance.didChangeStore = true;
}
hook.store = store;
hook.selector = selector;
hook.a1 = a1;
hook.a2 = a2;
hook.a3 = a3;
hook.value = selector(store.getSnapshot(), a1, a2, a3);
}
}
return hook.value;
}
function useStoreLegacy(store, selector, a1, a2, a3) {
return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3));
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/Store.mjs
var Store = class {
/**
* Creates a store with the given initial state, constructing the class it is called on.
* Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that
* class but degrades the inferred instance type to `Store`; use `new` there instead.
*/
static create(state) {
return new this(state);
}
/**
* The current state of the store.
* This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.
* To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).
* The values can be used directly (to avoid subscribing to the store) in effects or event handlers.
*
* Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.
*/
// Internal state to handle recursive `setState()` calls
constructor(state) {
this.state = state;
this.listeners = /* @__PURE__ */ new Set();
this.updateTick = 0;
}
/**
* Registers a listener that will be called whenever the store's state changes.
*
* @param fn The listener function to be called on state changes.
* @returns A function to unsubscribe the listener.
*/
subscribe = (fn) => {
this.listeners.add(fn);
return () => {
this.listeners.delete(fn);
};
};
/**
* Returns the current state of the store.
*/
getSnapshot = () => {
return this.state;
};
/**
* Updates the entire store's state and notifies all registered listeners.
*
* @param newState The new state to set for the store.
*/
setState(newState) {
if (this.state === newState) {
return;
}
this.state = newState;
this.updateTick += 1;
const currentTick = this.updateTick;
for (const listener of this.listeners) {
if (currentTick !== this.updateTick) {
return;
}
listener(newState);
}
}
/**
* Merges the provided changes into the current state and notifies listeners if there are changes.
* Each value must match its state key. Pass an exact known subset rather than a broad
* `Partial<State>`, which may contain `undefined` for required state fields.
*
* @param changes An object containing the changes to apply to the current state.
*/
update(changes) {
for (const key in changes) {
if (!Object.is(this.state[key], changes[key])) {
this.setState({
...this.state,
...changes
});
return;
}
}
}
/**
* Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.
*
* @param key The key in the store's state to update.
* @param value The new value to set for the specified key.
*/
set(key, value) {
if (!Object.is(this.state[key], value)) {
this.setState({
...this.state,
[key]: value
});
}
}
/**
* Gives the state a new reference and updates all registered listeners.
*/
notifyAll() {
const newState = {
...this.state
};
this.setState(newState);
}
use(selector, a1, a2, a3) {
return useStore(this, selector, a1, a2, a3);
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/store/ReactStore.mjs
var React22 = __toESM(require_react(), 1);
var ReactStore = class extends Store {
/**
* Creates a new ReactStore instance.
*
* @param state Initial state of the store.
* @param context Non-reactive context values.
* @param selectors Optional selectors for use with `useState`.
*/
constructor(state, context = {}, selectors3) {
super(state);
this.context = context;
this.selectors = selectors3;
}
/**
* Non-reactive values such as refs, callbacks, etc.
*/
/**
* Synchronizes a single external value into the store.
*
* Note that the while the value in `state` is updated immediately, the value returned
* by `useState` is updated before the next render (similarly to React's `useState`).
*/
useSyncedValue(key, value) {
React22.useDebugValue(key);
const store = this;
useIsoLayoutEffect(() => {
if (store.state[key] !== value) {
store.set(key, value);
}
}, [store, key, value]);
}
/**
* Synchronizes a single external value into the store and
* cleans it up (sets to `undefined`) on unmount.
*
* Note that the while the value in `state` is updated immediately, the value returned
* by `useState` is updated before the next render (similarly to React's `useState`).
*/
useSyncedValueWithCleanup(key, value) {
const store = this;
useIsoLayoutEffect(() => {
if (store.state[key] !== value) {
store.set(key, value);
}
return () => {
store.set(key, void 0);
};
}, [store, key, value]);
}
/**
* Synchronizes multiple external values into the store.
* Each value must match its state key. Pass an exact known subset rather than a broad
* `Partial<State>`, which may contain `undefined` for required state fields.
*
* Note that the while the values in `state` are updated immediately, the values returned
* by `useState` are updated before the next render (similarly to React's `useState`).
*
* @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.
*/
useSyncedValues(statePart) {
const store = this;
if (true) {
React22.useDebugValue(statePart, (p) => Object.keys(p));
const keys = React22.useRef(Object.keys(statePart)).current;
const nextKeys = Object.keys(statePart);
if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) {
console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.");
}
}
const dependencies = Object.values(statePart);
useIsoLayoutEffect(() => {
store.update(statePart);
}, [store, ...dependencies]);
}
/**
* Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`
* is non-undefined, the store's state at `key` is updated to match `controlled`.
*/
useControlledProp(key, controlled) {
React22.useDebugValue(key);
const store = this;
const isControlled = controlled !== void 0;
useIsoLayoutEffect(() => {
if (isControlled && !Object.is(store.state[key], controlled)) {
store.setState({
...store.state,
[key]: controlled
});
}
}, [store, key, controlled, isControlled]);
if (true) {
const cache = this.controlledValues ??= /* @__PURE__ */ new Map();
if (!cache.has(key)) {
cache.set(key, isControlled);
}
const previouslyControlled = cache.get(key);
if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) {
console.error(`A component is changing the ${previouslyControlled ? "" : "un"}controlled state of ${key.toString()} to be ${previouslyControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);
}
}
}
/** Gets the current value from the store using a selector with the provided key.
*
* @param key Key of the selector to use.
*/
select(key, a1, a2, a3) {
const selector = this.selectors[key];
return selector(this.state, a1, a2, a3);
}
/**
* Returns a value from the store's state using a selector function.
* Used to subscribe to specific parts of the state.
* This methods causes a rerender whenever the selected state changes.
*
* @param key Key of the selector to use.
*/
useState(key, a1, a2, a3) {
React22.useDebugValue(key);
return useStore(this, this.selectors[key], a1, a2, a3);
}
/**
* Wraps a function with `useStableCallback` to ensure it has a stable reference
* and assigns it to the context.
*
* @param key Key of the event callback. Must be a function in the context.
* @param fn Function to assign.
*/
useContextCallback(key, fn) {
React22.useDebugValue(key);
const stableFunction = useStableCallback(fn ?? NOOP);
this.context[key] = stableFunction;
}
/**
* Returns a stable setter function for a specific key in the store's state.
* It's commonly used to pass as a ref callback to React elements.
*
* @param key Key of the state to set.
*/
useStateSetter(key) {
const ref = React22.useRef(void 0);
if (ref.current === void 0) {
ref.current = (value) => {
this.set(key, value);
};
}
return ref.current;
}
/**
* Observes changes derived from the store's selectors and calls the listener when the selected value changes.
*
* @param key Key of the selector to observe.
* @param listener Listener function called when the selector result changes.
*/
observe(selector, listener) {
let selectFn;
if (typeof selector === "function") {
selectFn = selector;
} else {
selectFn = this.selectors[selector];
}
let prevValue = selectFn(this.state);
listener(prevValue, prevValue, this);
return this.subscribe((nextState) => {
const nextValue = selectFn(nextState);
if (!Object.is(prevValue, nextValue)) {
const oldValue = prevValue;
prevValue = nextValue;
listener(nextValue, oldValue, this);
}
});
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs
var selectors = {
open: (state) => state.open,
transitionStatus: (state) => state.transitionStatus,
domReferenceElement: (state) => state.domReferenceElement,
referenceElement: (state) => state.positionReference ?? state.referenceElement,
floatingElement: (state) => state.floatingElement,
floatingId: (state) => state.floatingId
};
var FloatingRootStore = class extends ReactStore {
constructor(options) {
const {
syncOnly,
nested,
onOpenChange,
triggerElements,
...initialState
} = options;
super({
...initialState,
positionReference: initialState.referenceElement,
domReferenceElement: initialState.referenceElement
}, {
onOpenChange,
dataRef: {
current: {}
},
events: createEventEmitter(),
nested,
triggerElements
}, selectors);
this.syncOnly = syncOnly;
}
/**
* Syncs the event used by hover logic to distinguish hover-open from click-like interaction.
*/
syncOpenEvent = (newOpen, event) => {
if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing
// click events to upgrade a hover-open.
event != null && isClickLikeEvent(event)) {
this.context.dataRef.current.openEvent = newOpen ? event : void 0;
}
};
/**
* Runs the root-owned side effects for an open state change.
*/
dispatchOpenChange = (newOpen, eventDetails) => {
this.syncOpenEvent(newOpen, eventDetails.event);
const details = {
open: newOpen,
reason: eventDetails.reason,
nativeEvent: eventDetails.event,
nested: this.context.nested,
triggerElement: eventDetails.trigger
};
this.context.events.emit("openchange", details);
};
/**
* Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.
*
* @param newOpen The new open state.
* @param eventDetails Details about the event that triggered the open state change.
*/
setOpen = (newOpen, eventDetails) => {
if (this.syncOnly) {
this.context.onOpenChange?.(newOpen, eventDetails);
return;
}
this.dispatchOpenChange(newOpen, eventDetails);
this.context.onOpenChange?.(newOpen, eventDetails);
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/store.mjs
function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
return {
open: false,
openProp: void 0,
mounted: false,
transitionStatus: void 0,
floatingRootContext: new FloatingRootStore({
open: false,
transitionStatus: void 0,
floatingElement: null,
referenceElement: null,
triggerElements,
floatingId,
syncOnly: true,
nested,
onOpenChange: void 0
}),
floatingId,
triggerCount: 0,
preventUnmountingOnClose: false,
payload: void 0,
activeTriggerId: null,
activeTriggerElement: null,
openedWithoutTrigger: false,
triggerIdProp: void 0,
popupElement: null,
positionerElement: null,
activeTriggerProps: EMPTY_OBJECT,
inactiveTriggerProps: EMPTY_OBJECT,
popupProps: EMPTY_OBJECT
};
}
var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
var openSelector = (state) => state.openProp ?? state.open;
var popupIdSelector = (state) => {
const popupId = state.popupElement?.id ?? state.floatingId;
return popupId || void 0;
};
function triggerOwnsOpenPopup(state, triggerId) {
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
}
function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
if (triggerOwnsOpenPopup(state, triggerId)) {
return true;
}
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1;
}
var popupStoreSelectors = {
open: openSelector,
mounted: (state) => state.mounted,
// `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a
// layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase.
transitionStatus: (state) => openSelector(state) && !state.mounted ? "starting" : state.transitionStatus,
floatingRootContext: (state) => state.floatingRootContext,
triggerCount: (state) => state.triggerCount,
preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
payload: (state) => state.payload,
activeTriggerId: activeTriggerIdSelector,
activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
popupId: popupIdSelector,
/**
* Whether the trigger with the given ID was used to open the popup.
*/
isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
/**
* Whether the popup is open and was activated by a trigger with the given ID.
*/
isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
/**
* Whether the popup is mounted and was activated by a trigger with the given ID.
*/
isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
/**
* Popup id for the trigger that currently owns the open popup.
*/
triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
popupProps: (state) => state.popupProps,
popupElement: (state) => state.popupElement,
positionerElement: (state) => state.positionerElement
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
var React23 = __toESM(require_react(), 1);
var import_shim2 = __toESM(require_shim(), 1);
function usePopupHandleStore(handle) {
const subscribe = React23.useCallback((listener) => {
if (handle === void 0) {
return NOOP;
}
return handle.subscribeStore(listener);
}, [handle]);
const getSnapshot = React23.useCallback(() => {
return handle === void 0 ? void 0 : handle.store;
}, [handle]);
return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs
var React24 = __toESM(require_react(), 1);
var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit;
function useFocus(store, props = {}) {
const {
enabled = true,
delay
} = props;
const {
events,
dataRef
} = store.context;
const blockFocusRef = React24.useRef(false);
const blockedReferenceRef = React24.useRef(null);
const keyboardModalityRef = React24.useRef(true);
const timeout = useTimeout();
React24.useEffect(() => {
const domReference = store.select("domReferenceElement");
if (!enabled) {
return void 0;
}
const win = getWindow(domReference);
function onBlur() {
const currentDomReference = store.select("domReferenceElement");
if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) {
blockFocusRef.current = true;
blockedReferenceRef.current = currentDomReference;
}
}
function onKeyDown() {
keyboardModalityRef.current = true;
}
function onPointerDown() {
keyboardModalityRef.current = false;
}
return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true));
}, [store, enabled]);
React24.useEffect(() => {
if (!enabled) {
return void 0;
}
function onOpenChangeLocal(details) {
if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) {
const referenceElement = store.select("domReferenceElement");
if (isElement(referenceElement)) {
blockedReferenceRef.current = referenceElement;
blockFocusRef.current = true;
}
}
}
events.on("openchange", onOpenChangeLocal);
return () => {
events.off("openchange", onOpenChangeLocal);
};
}, [events, enabled, store]);
const reference = React24.useMemo(() => {
function resetBlockedFocus() {
blockFocusRef.current = false;
blockedReferenceRef.current = null;
}
return {
onMouseLeave() {
resetBlockedFocus();
},
onFocus(event) {
const focusTarget = event.currentTarget;
if (blockFocusRef.current) {
if (blockedReferenceRef.current === focusTarget) {
return;
}
resetBlockedFocus();
}
const target = getTarget(event.nativeEvent);
if (isElement(target)) {
if (isMacSafari && !event.relatedTarget) {
if (!keyboardModalityRef.current && !isTypeableElement(target)) {
return;
}
} else if (!matchesFocusVisible(target)) {
return;
}
}
const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements);
const {
nativeEvent,
currentTarget
} = event;
if (store.select("open") && movedFromOtherEnabledTrigger || !delay) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
return;
}
timeout.start(delay, () => {
if (blockFocusRef.current) {
return;
}
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget));
});
},
onBlur(event) {
resetBlockedFocus();
const relatedTarget = event.relatedTarget;
const nativeEvent = event.nativeEvent;
const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside";
timeout.start(0, () => {
const domReference = store.select("domReferenceElement");
const activeEl = activeElement(ownerDocument(domReference));
if (!relatedTarget && activeEl === domReference) {
return;
}
if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) {
return;
}
const nextFocusedElement = relatedTarget ?? activeEl;
if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) {
return;
}
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent));
});
}
};
}, [dataRef, delay, store, timeout]);
return React24.useMemo(() => enabled ? {
reference,
trigger: reference
} : {}, [enabled, reference]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
var React25 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs
var HoverInteraction = class _HoverInteraction {
pointerType = void 0;
interactedInside = false;
handler = void 0;
blockMouseMove = true;
performedPointerEventsMutation = false;
pointerEventsScopeElement = null;
pointerEventsReferenceElement = null;
pointerEventsFloatingElement = null;
restTimeoutPending = false;
openChangeTimeout = new Timeout();
restTimeout = new Timeout();
handleCloseOptions = void 0;
static create() {
return new _HoverInteraction();
}
dispose = () => {
this.openChangeTimeout.clear();
this.restTimeout.clear();
};
disposeEffect = () => {
return this.dispose;
};
};
var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap();
function clearSafePolygonPointerEventsMutation(instance) {
if (!instance.performedPointerEventsMutation) {
return;
}
const scopeElement = instance.pointerEventsScopeElement;
if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) {
instance.pointerEventsScopeElement?.style.removeProperty("pointer-events");
instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events");
instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events");
pointerEventsMutationOwnerByScopeElement.delete(scopeElement);
}
instance.performedPointerEventsMutation = false;
instance.pointerEventsScopeElement = null;
instance.pointerEventsReferenceElement = null;
instance.pointerEventsFloatingElement = null;
}
function applySafePolygonPointerEventsMutation(instance, options) {
const {
scopeElement,
referenceElement,
floatingElement
} = options;
const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement);
if (existingOwner && existingOwner !== instance) {
clearSafePolygonPointerEventsMutation(existingOwner);
}
clearSafePolygonPointerEventsMutation(instance);
instance.performedPointerEventsMutation = true;
instance.pointerEventsScopeElement = scopeElement;
instance.pointerEventsReferenceElement = referenceElement;
instance.pointerEventsFloatingElement = floatingElement;
pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance);
scopeElement.style.pointerEvents = "none";
referenceElement.style.pointerEvents = "auto";
floatingElement.style.pointerEvents = "auto";
}
function useHoverInteractionSharedState(store) {
const data = store.context.dataRef.current;
const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current;
if (!data.hoverInteractionState) {
data.hoverInteractionState = instance;
}
useOnMount(data.hoverInteractionState.disposeEffect);
return data.hoverInteractionState;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs
function useHoverFloatingInteraction(store, parameters = {}) {
const {
enabled = true,
closeDelay: closeDelayProp = 0,
nodeId: nodeIdProp
} = parameters;
const open2 = store.useState("open");
const floatingElement = store.useState("floatingElement");
const domReferenceElement = store.useState("domReferenceElement");
const {
dataRef
} = store.context;
const tree = useFloatingTree();
const parentId = useFloatingParentNodeId();
const instance = useHoverInteractionSharedState(store);
const childClosedTimeout = useTimeout();
const isClickLikeOpenEvent2 = useStableCallback(() => {
return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
});
const isHoverOpen = useStableCallback(() => {
return isHoverOpenEvent(dataRef.current.openEvent?.type);
});
const clearPointerEvents = useStableCallback(() => {
clearSafePolygonPointerEventsMutation(instance);
});
useIsoLayoutEffect(() => {
if (!open2) {
instance.pointerType = void 0;
instance.restTimeoutPending = false;
instance.interactedInside = false;
clearPointerEvents();
}
}, [open2, instance, clearPointerEvents]);
React25.useEffect(() => {
return clearPointerEvents;
}, [clearPointerEvents]);
useIsoLayoutEffect(() => {
if (!enabled) {
return void 0;
}
if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) {
const ref = domReferenceElement;
const floatingEl = floatingElement;
const doc = ownerDocument(floatingElement);
const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating;
if (parentFloating) {
parentFloating.style.pointerEvents = "";
}
const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null;
const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null;
const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, "[data-rootownerid]") ?? doc.body;
applySafePolygonPointerEventsMutation(instance, {
scopeElement,
referenceElement: ref,
floatingElement: floatingEl
});
return () => {
clearPointerEvents();
};
}
return void 0;
}, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]);
React25.useEffect(() => {
if (!enabled) {
return void 0;
}
function hasParentChildren() {
return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0);
}
function closeWithDelay(event) {
const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType);
const close = () => {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
};
if (closeDelay) {
instance.openChangeTimeout.start(closeDelay, close);
} else {
instance.openChangeTimeout.clear();
close();
}
}
function handleInteractInside(event) {
const target = getTarget(event);
if (!isInteractiveElement(target)) {
instance.interactedInside = false;
return;
}
instance.interactedInside = closest(target, "[aria-haspopup]") != null;
}
function onFloatingMouseEnter() {
instance.openChangeTimeout.clear();
childClosedTimeout.clear();
tree?.events.off("floating.closed", onNodeClosed);
clearPointerEvents();
}
function onFloatingMouseLeave(event) {
if (hasParentChildren() && tree) {
tree.events.on("floating.closed", onNodeClosed);
return;
}
if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
return;
}
const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp;
const relatedTarget = event.relatedTarget;
const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget));
if (isMovingIntoDescendantFloating) {
return;
}
if (instance.handler) {
instance.handler(event);
return;
}
clearPointerEvents();
if (isHoverOpen() && !isClickLikeOpenEvent2()) {
closeWithDelay(event);
}
}
function onNodeClosed(event) {
if (!tree || !parentId || hasParentChildren()) {
return;
}
childClosedTimeout.start(0, () => {
tree.events.off("floating.closed", onNodeClosed);
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree.events.emit("floating.closed", event);
});
}
const floating = floatingElement;
return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => {
tree?.events.off("floating.closed", onNodeClosed);
});
}, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs
var React26 = __toESM(require_react(), 1);
var ReactDOM4 = __toESM(require_react_dom(), 1);
var EMPTY_REF = {
current: null
};
function useHoverReferenceInteraction(store, props = {}) {
const {
enabled = true,
delay = 0,
handleClose = null,
mouseOnly = false,
restMs = 0,
move = true,
triggerElementRef = EMPTY_REF,
externalTree,
isActiveTrigger = true,
getHandleCloseContext,
isClosing,
shouldOpen: shouldOpenProp,
guardStaleOpen = false
} = props;
const {
dataRef,
events
} = store.context;
const tree = useFloatingTree(externalTree);
const instance = useHoverInteractionSharedState(store);
const isHoverCloseActiveRef = React26.useRef(false);
const handleCloseRef = useValueAsRef(handleClose);
const delayRef = useValueAsRef(delay);
const restMsRef = useValueAsRef(restMs);
const enabledRef = useValueAsRef(enabled);
const shouldOpenRef = useValueAsRef(shouldOpenProp);
const isClosingRef = useValueAsRef(isClosing);
const isClickLikeOpenEvent2 = useStableCallback(() => {
return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside);
});
const checkShouldOpen = useStableCallback(() => {
return shouldOpenRef.current?.() !== false;
});
const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => {
const allTriggers = store.context.triggerElements;
if (allTriggers.hasElement(currentTarget)) {
return !currentDomReference || !contains(currentDomReference, currentTarget);
}
if (!isElement(target)) {
return false;
}
const targetElement = target;
return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement));
});
const cleanupMouseMoveHandler = useStableCallback(() => {
if (!instance.handler) {
return;
}
const doc = ownerDocument(store.select("domReferenceElement"));
doc.removeEventListener("mousemove", instance.handler);
instance.handler = void 0;
});
const clearPointerEvents = useStableCallback(() => {
clearSafePolygonPointerEventsMutation(instance);
});
if (isActiveTrigger) {
instance.handleCloseOptions = handleClose?.__options;
}
React26.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]);
React26.useEffect(() => {
if (!enabled) {
return void 0;
}
function onOpenChangeLocal(details) {
if (!details.open) {
isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover;
cleanupMouseMoveHandler();
instance.openChangeTimeout.clear();
instance.restTimeout.clear();
instance.blockMouseMove = true;
instance.restTimeoutPending = false;
} else {
isHoverCloseActiveRef.current = false;
}
}
events.on("openchange", onOpenChangeLocal);
return () => {
events.off("openchange", onOpenChangeLocal);
};
}, [enabled, events, instance, cleanupMouseMoveHandler]);
React26.useEffect(() => {
if (!enabled) {
return void 0;
}
function closeWithDelay(event, runElseBranch = true) {
const closeDelay = getDelay(delayRef.current, "close", instance.pointerType);
if (closeDelay) {
instance.openChangeTimeout.start(closeDelay, () => {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
});
} else if (runElseBranch) {
instance.openChangeTimeout.clear();
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
tree?.events.emit("floating.closed", event);
}
}
const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null);
if (!isElement(trigger)) {
return void 0;
}
function onMouseEnter(event) {
instance.openChangeTimeout.clear();
instance.blockMouseMove = false;
if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
return;
}
const restMsValue = getRestMs(restMsRef.current);
const openDelay = getDelay(delayRef.current, "open", instance.pointerType);
const eventTarget = getTarget(event);
const currentTarget = event.currentTarget ?? null;
const currentDomReference = store.select("domReferenceElement");
let triggerNode = currentTarget;
if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) {
for (const triggerElement of store.context.triggerElements.elements()) {
if (contains(triggerElement, eventTarget)) {
triggerNode = triggerElement;
break;
}
}
}
if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) {
triggerNode = currentDomReference;
}
const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget);
const isOpen = store.select("open");
const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending";
const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current;
const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition;
const isRestOnlyDelay = restMsValue > 0 && !openDelay;
const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition;
const shouldOpen = !isOpen || isOverInactive;
if (shouldOpenImmediately) {
if (checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
return;
}
if (isRestOnlyDelay) {
return;
}
if (openDelay) {
instance.openChangeTimeout.start(openDelay, () => {
if (shouldOpen && checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
});
} else if (shouldOpen) {
if (checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode));
}
}
}
function onMouseLeave(event) {
if (isClickLikeOpenEvent2()) {
clearPointerEvents();
return;
}
cleanupMouseMoveHandler();
const domReferenceElement = store.select("domReferenceElement");
const doc = ownerDocument(domReferenceElement);
instance.restTimeout.clear();
instance.restTimeoutPending = false;
const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.();
if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) {
return;
}
if (handleCloseRef.current && handleCloseContextBase) {
if (!store.select("open")) {
instance.openChangeTimeout.clear();
}
const currentTrigger = triggerElementRef.current;
instance.handler = handleCloseRef.current({
...handleCloseContextBase,
tree,
x: event.clientX,
y: event.clientY,
onClose() {
clearPointerEvents();
cleanupMouseMoveHandler();
if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) {
closeWithDelay(event, true);
}
}
});
doc.addEventListener("mousemove", instance.handler);
instance.handler(event);
return;
}
const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true;
if (shouldClose) {
closeWithDelay(event);
}
}
function onMouseOut(event) {
if (contains(trigger, event.relatedTarget)) {
return;
}
instance.openChangeTimeout.clear();
instance.restTimeout.clear();
instance.restTimeoutPending = false;
}
const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0;
if (move) {
return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, {
once: true
}), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
}
return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard);
}, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]);
return React26.useMemo(() => {
if (!enabled) {
return void 0;
}
function setPointerRef(event) {
instance.pointerType = event.pointerType;
}
return {
onPointerDown: setPointerRef,
onPointerEnter: setPointerRef,
onMouseMove(event) {
const {
nativeEvent
} = event;
const trigger = event.currentTarget;
const currentDomReference = store.select("domReferenceElement");
const currentOpen = store.select("open");
const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target);
if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) {
return;
}
if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) {
const floatingElement = store.select("floatingElement");
if (floatingElement) {
const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body;
applySafePolygonPointerEventsMutation(instance, {
scopeElement,
referenceElement: trigger,
floatingElement
});
}
}
const restMsValue = getRestMs(restMsRef.current);
if (currentOpen && !isOverInactive || restMsValue === 0) {
return;
}
if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) {
return;
}
instance.restTimeout.clear();
function handleMouseMove() {
instance.restTimeoutPending = false;
if (isClickLikeOpenEvent2()) {
return;
}
const latestOpen = store.select("open");
if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger));
}
}
if (instance.pointerType === "touch") {
ReactDOM4.flushSync(() => {
handleMouseMove();
});
} else if (isOverInactive && currentOpen) {
handleMouseMove();
} else {
instance.restTimeoutPending = true;
instance.restTimeout.start(restMsValue, handleMouseMove);
}
}
};
}, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs
var CURSOR_SPEED_THRESHOLD = 0.1;
var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;
var POLYGON_BUFFER = 0.5;
function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) {
return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi;
}
function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) {
let isInsideValue = false;
if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) {
isInsideValue = !isInsideValue;
}
if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) {
isInsideValue = !isInsideValue;
}
return isInsideValue;
}
function isInsideRect(pointX, pointY, rect) {
return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height;
}
function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) {
const minX = Math.min(x1, x2);
const maxX = Math.max(x1, x2);
const minY = Math.min(y1, y2);
const maxY = Math.max(y1, y2);
return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY;
}
function safePolygon(options = {}) {
const {
blockPointerEvents = false
} = options;
const timeout = new Timeout();
const fn = ({
x,
y,
placement,
elements,
onClose,
nodeId,
tree
}) => {
const side = placement?.split("-")[0];
let hasLanded = false;
let lastX = null;
let lastY = null;
let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0;
function isCursorMovingSlowly(nextX, nextY) {
const currentTime = performance.now();
const elapsedTime = currentTime - lastCursorTime;
if (lastX === null || lastY === null || elapsedTime === 0) {
lastX = nextX;
lastY = nextY;
lastCursorTime = currentTime;
return false;
}
const deltaX = nextX - lastX;
const deltaY = nextY - lastY;
const distanceSquared = deltaX * deltaX + deltaY * deltaY;
const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED;
lastX = nextX;
lastY = nextY;
lastCursorTime = currentTime;
return distanceSquared < thresholdSquared;
}
function close() {
timeout.clear();
onClose();
}
return function onMouseMove(event) {
timeout.clear();
const domReference = elements.domReference;
const floating = elements.floating;
if (!domReference || !floating || side == null || x == null || y == null) {
return void 0;
}
const {
clientX,
clientY
} = event;
const target = getTarget(event);
const isLeave = event.type === "mouseleave";
const isOverFloatingEl = contains(floating, target);
const isOverReferenceEl = contains(domReference, target);
if (isOverFloatingEl) {
hasLanded = true;
if (!isLeave) {
return void 0;
}
}
if (isOverReferenceEl) {
hasLanded = false;
if (!isLeave) {
hasLanded = true;
return void 0;
}
}
if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) {
return void 0;
}
function hasOpenChildNode() {
return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0);
}
function closeIfNoOpenChild() {
if (!hasOpenChildNode()) {
close();
}
}
if (hasOpenChildNode()) {
return void 0;
}
const refRect = domReference.getBoundingClientRect();
const rect = floating.getBoundingClientRect();
const cursorLeaveFromRight = x > rect.right - rect.width / 2;
const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;
const isFloatingWider = rect.width > refRect.width;
const isFloatingTaller = rect.height > refRect.height;
const left = (isFloatingWider ? refRect : rect).left;
const right = (isFloatingWider ? refRect : rect).right;
const top = (isFloatingTaller ? refRect : rect).top;
const bottom = (isFloatingTaller ? refRect : rect).bottom;
if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) {
closeIfNoOpenChild();
return void 0;
}
let isInsideTroughRect = false;
switch (side) {
case "top":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1);
break;
case "bottom":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1);
break;
case "left":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top);
break;
case "right":
isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top);
break;
default:
}
if (isInsideTroughRect) {
return void 0;
}
if (hasLanded && !isInsideRect(clientX, clientY, refRect)) {
closeIfNoOpenChild();
return void 0;
}
if (!isLeave && isCursorMovingSlowly(clientX, clientY)) {
closeIfNoOpenChild();
return void 0;
}
let isInsidePolygon = false;
switch (side) {
case "top": {
const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointY = y + POLYGON_BUFFER + 1;
const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top;
const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
break;
}
case "bottom": {
const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset;
const cursorPointY = y - POLYGON_BUFFER;
const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom;
const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight);
break;
}
case "left": {
const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointX = x + POLYGON_BUFFER + 1;
const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left;
const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY);
break;
}
case "right": {
const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4;
const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset;
const cursorPointX = x - POLYGON_BUFFER;
const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right;
const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER;
isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom);
break;
}
default:
}
if (!isInsidePolygon) {
closeIfNoOpenChild();
} else if (!hasLanded) {
timeout.start(40, closeIfNoOpenChild);
}
return void 0;
};
};
fn.__options = {
...options,
blockPointerEvents
};
return fn;
}
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const sideAxis = getSideAxis(placement);
const alignmentAxis = getAlignmentAxis(placement);
const alignLength = getAxisLength(alignmentAxis);
const side = getSide(placement);
const isVertical = sideAxis === "y";
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height / 2;
const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
let coords;
switch (side) {
case "top":
coords = {
x: commonX,
y: reference.y - floating.height
};
break;
case "bottom":
coords = {
x: commonX,
y: reference.y + reference.height
};
break;
case "right":
coords = {
x: reference.x + reference.width,
y: commonY
};
break;
case "left":
coords = {
x: reference.x - floating.width,
y: commonY
};
break;
default:
coords = {
x: reference.x,
y: reference.y
};
}
const alignment = getAlignment(placement);
if (alignment) {
coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1);
}
return coords;
}
async function detectOverflow(state, options) {
var _await$platform$isEle;
if (options === void 0) {
options = {};
}
const {
x,
y,
platform: platform3,
rects,
elements,
strategy
} = state;
const {
boundary = "clippingAncestors",
rootBoundary = "viewport",
elementContext = "floating",
altBoundary = false,
padding = 0
} = evaluate(options, state);
const paddingObject = getPaddingObject(padding);
const altContext = elementContext === "floating" ? "reference" : "floating";
const element = elements[altBoundary ? altContext : elementContext];
const clippingClientRect = rectToClientRect(await platform3.getClippingRect({
element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)),
boundary,
rootBoundary,
strategy
}));
const rect = elementContext === "floating" ? {
x,
y,
width: rects.floating.width,
height: rects.floating.height
} : rects.reference;
const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating));
const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || {
x: 1,
y: 1
};
const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({
elements,
rect,
offsetParent,
strategy
}) : rect);
return {
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
};
}
var MAX_RESET_COUNT = 50;
var computePosition = async (reference, floating, config) => {
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform: platform3
} = config;
const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : {
...platform3,
detectOverflow
};
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating));
let rects = await platform3.getElementRects({
reference,
floating,
strategy
});
let {
x,
y
} = computeCoordsFromPlacement(rects, placement, rtl);
let statefulPlacement = placement;
let resetCount = 0;
const middlewareData = {};
for (let i = 0; i < middleware.length; i++) {
const currentMiddleware = middleware[i];
if (!currentMiddleware) {
continue;
}
const {
name,
fn
} = currentMiddleware;
const {
x: nextX,
y: nextY,
data,
reset
} = await fn({
x,
y,
initialPlacement: placement,
placement: statefulPlacement,
strategy,
middlewareData,
rects,
platform: platformWithDetectOverflow,
elements: {
reference,
floating
}
});
x = nextX != null ? nextX : x;
y = nextY != null ? nextY : y;
middlewareData[name] = {
...middlewareData[name],
...data
};
if (reset && resetCount < MAX_RESET_COUNT) {
resetCount++;
if (typeof reset === "object") {
if (reset.placement) {
statefulPlacement = reset.placement;
}
if (reset.rects) {
rects = reset.rects === true ? await platform3.getElementRects({
reference,
floating,
strategy
}) : reset.rects;
}
({
x,
y
} = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
}
i = -1;
}
}
return {
x,
y,
placement: statefulPlacement,
strategy,
middlewareData
};
};
var flip = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "flip",
options,
async fn(state) {
var _middlewareData$arrow, _middlewareData$flip;
const {
placement,
middlewareData,
rects,
initialPlacement,
platform: platform3,
elements
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true,
fallbackPlacements: specifiedFallbackPlacements,
fallbackStrategy = "bestFit",
fallbackAxisSideDirection = "none",
flipAlignment = true,
...detectOverflowOptions
} = evaluate(options, state);
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
const side = getSide(placement);
const initialSideAxis = getSideAxis(initialPlacement);
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
}
const placements2 = [initialPlacement, ...fallbackPlacements];
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const overflows = [];
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
if (checkMainAxis) {
overflows.push(overflow[side]);
}
if (checkCrossAxis) {
const sides2 = getAlignmentSides(placement, rects, rtl);
overflows.push(overflow[sides2[0]], overflow[sides2[1]]);
}
overflowsData = [...overflowsData, {
placement,
overflows
}];
if (!overflows.every((side2) => side2 <= 0)) {
var _middlewareData$flip2, _overflowsData$filter;
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
const nextPlacement = placements2[nextIndex];
if (nextPlacement) {
const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false;
if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis
// overflows the main axis.
overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {
return {
data: {
index: nextIndex,
overflows: overflowsData
},
reset: {
placement: nextPlacement
}
};
}
}
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
if (!resetPlacement) {
switch (fallbackStrategy) {
case "bestFit": {
var _overflowsData$filter2;
const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => {
if (hasFallbackAxisSideDirection) {
const currentSideAxis = getSideAxis(d.placement);
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
// reading directions favoring greater width.
currentSideAxis === "y";
}
return true;
}).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];
if (placement2) {
resetPlacement = placement2;
}
break;
}
case "initialPlacement":
resetPlacement = initialPlacement;
break;
}
}
if (placement !== resetPlacement) {
return {
reset: {
placement: resetPlacement
}
};
}
}
return {};
}
};
};
var originSides = /* @__PURE__ */ new Set(["left", "top"]);
async function convertValueToCoords(state, options) {
const {
placement,
platform: platform3,
elements
} = state;
const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating));
const side = getSide(placement);
const alignment = getAlignment(placement);
const isVertical = getSideAxis(placement) === "y";
const mainAxisMulti = originSides.has(side) ? -1 : 1;
const crossAxisMulti = rtl && isVertical ? -1 : 1;
const rawValue = evaluate(options, state);
let {
mainAxis,
crossAxis,
alignmentAxis
} = typeof rawValue === "number" ? {
mainAxis: rawValue,
crossAxis: 0,
alignmentAxis: null
} : {
mainAxis: rawValue.mainAxis || 0,
crossAxis: rawValue.crossAxis || 0,
alignmentAxis: rawValue.alignmentAxis
};
if (alignment && typeof alignmentAxis === "number") {
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
}
return isVertical ? {
x: crossAxis * crossAxisMulti,
y: mainAxis * mainAxisMulti
} : {
x: mainAxis * mainAxisMulti,
y: crossAxis * crossAxisMulti
};
}
var offset = function(options) {
if (options === void 0) {
options = 0;
}
return {
name: "offset",
options,
async fn(state) {
var _middlewareData$offse, _middlewareData$arrow;
const {
x,
y,
placement,
middlewareData
} = state;
const diffCoords = await convertValueToCoords(state, options);
if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
return {};
}
return {
x: x + diffCoords.x,
y: y + diffCoords.y,
data: {
...diffCoords,
placement
}
};
}
};
};
var shift = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "shift",
options,
async fn(state) {
const {
x,
y,
placement,
platform: platform3
} = state;
const {
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = false,
limiter = {
fn: (_ref) => {
let {
x: x2,
y: y2
} = _ref;
return {
x: x2,
y: y2
};
}
},
...detectOverflowOptions
} = evaluate(options, state);
const coords = {
x,
y
};
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const crossAxis = getSideAxis(placement);
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]);
if (checkMainAxis) {
mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);
}
if (checkCrossAxis) {
crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);
}
const limitedCoords = limiter.fn({
...state,
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
});
return {
...limitedCoords,
data: {
x: limitedCoords.x - x,
y: limitedCoords.y - y,
enabled: {
[mainAxis]: checkMainAxis,
[crossAxis]: checkCrossAxis
}
}
};
}
};
};
var limitShift = function(options) {
if (options === void 0) {
options = {};
}
return {
options,
fn(state) {
var _rawOffset$mainAxis, _rawOffset$crossAxis;
const {
x,
y,
placement,
rects,
middlewareData
} = state;
const {
offset: offset4 = 0,
mainAxis: checkMainAxis = true,
crossAxis: checkCrossAxis = true
} = evaluate(options, state);
const coords = {
x,
y
};
const crossAxis = getSideAxis(placement);
const mainAxis = getOppositeAxis(crossAxis);
let mainAxisCoord = coords[mainAxis];
let crossAxisCoord = coords[crossAxis];
const rawOffset = evaluate(offset4, state);
const computedOffset = typeof rawOffset === "number" ? {
mainAxis: rawOffset,
crossAxis: 0
} : {
mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,
crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0
};
if (checkMainAxis) {
const len = mainAxis === "y" ? "height" : "width";
const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
if (mainAxisCoord < limitMin) {
mainAxisCoord = limitMin;
} else if (mainAxisCoord > limitMax) {
mainAxisCoord = limitMax;
}
}
if (checkCrossAxis) {
var _middlewareData$offse, _middlewareData$offse2;
const len = mainAxis === "y" ? "width" : "height";
const isOriginSide = originSides.has(getSide(placement));
const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
if (crossAxisCoord < limitMin) {
crossAxisCoord = limitMin;
} else if (crossAxisCoord > limitMax) {
crossAxisCoord = limitMax;
}
}
return {
[mainAxis]: mainAxisCoord,
[crossAxis]: crossAxisCoord
};
}
};
};
var size = function(options) {
if (options === void 0) {
options = {};
}
return {
name: "size",
options,
async fn(state) {
const {
placement,
rects,
platform: platform3,
elements
} = state;
const {
apply = () => {
},
...detectOverflowOptions
} = evaluate(options, state);
const overflow = await platform3.detectOverflow(state, detectOverflowOptions);
const side = getSide(placement);
const alignment = getAlignment(placement);
const isYAxis = getSideAxis(placement) === "y";
const {
width,
height
} = rects.floating;
let heightSide;
let widthSide;
if (side === "top" || side === "bottom") {
heightSide = side;
widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right";
} else {
widthSide = side;
heightSide = alignment === "end" ? "top" : "bottom";
}
const maximumClippingHeight = height - overflow.top - overflow.bottom;
const maximumClippingWidth = width - overflow.left - overflow.right;
const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);
const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);
const shiftData = state.middlewareData.shift;
const noShift = !shiftData;
let availableHeight2 = overflowAvailableHeight;
let availableWidth2 = overflowAvailableWidth;
if (shiftData != null && shiftData.enabled.x) {
availableWidth2 = maximumClippingWidth;
}
if (shiftData != null && shiftData.enabled.y) {
availableHeight2 = maximumClippingHeight;
}
if (noShift && !alignment) {
if (isYAxis) {
availableWidth2 = width - 2 * max(overflow.left, overflow.right);
} else {
availableHeight2 = height - 2 * max(overflow.top, overflow.bottom);
}
}
await apply({
...state,
availableWidth: availableWidth2,
availableHeight: availableHeight2
});
const nextDimensions = await platform3.getDimensions(elements.floating);
if (width !== nextDimensions.width || height !== nextDimensions.height) {
return {
reset: {
rects: true
}
};
}
return {};
}
};
};
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
function getCssDimensions(element) {
const css = getComputedStyle2(element);
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height,
$: shouldFallback
};
}
function unwrapElement(element) {
return !isElement(element) ? element.contextElement : element;
}
function getScale(element) {
const domElement = unwrapElement(element);
if (!isHTMLElement(domElement)) {
return createCoords(1);
}
const rect = domElement.getBoundingClientRect();
const {
width,
height,
$
} = getCssDimensions(domElement);
let x = ($ ? round(rect.width) : rect.width) / width;
let y = ($ ? round(rect.height) : rect.height) / height;
if (!x || !Number.isFinite(x)) {
x = 1;
}
if (!y || !Number.isFinite(y)) {
y = 1;
}
return {
x,
y
};
}
var noOffsets = /* @__PURE__ */ createCoords(0);
function getVisualOffsets(element) {
const win = getWindow(element);
if (!isWebKit() || !win.visualViewport) {
return noOffsets;
}
return {
x: win.visualViewport.offsetLeft,
y: win.visualViewport.offsetTop
};
}
function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
if (isFixed === void 0) {
isFixed = false;
}
return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);
}
function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
if (includeScale === void 0) {
includeScale = false;
}
if (isFixedStrategy === void 0) {
isFixedStrategy = false;
}
const clientRect = element.getBoundingClientRect();
const domElement = unwrapElement(element);
let scale = createCoords(1);
if (includeScale) {
if (offsetParent) {
if (isElement(offsetParent)) {
scale = getScale(offsetParent);
}
} else {
scale = getScale(element);
}
}
const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
let x = (clientRect.left + visualOffsets.x) / scale.x;
let y = (clientRect.top + visualOffsets.y) / scale.y;
let width = clientRect.width / scale.x;
let height = clientRect.height / scale.y;
if (domElement && offsetParent) {
const win = getWindow(domElement);
const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
let currentWin = win;
let currentIFrame = getFrameElement(currentWin);
while (currentIFrame && offsetWin !== currentWin) {
const iframeScale = getScale(currentIFrame);
const iframeRect = currentIFrame.getBoundingClientRect();
const css = getComputedStyle2(currentIFrame);
const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
x *= iframeScale.x;
y *= iframeScale.y;
width *= iframeScale.x;
height *= iframeScale.y;
x += left;
y += top;
currentWin = getWindow(currentIFrame);
currentIFrame = getFrameElement(currentWin);
}
}
return rectToClientRect({
width,
height,
x,
y
});
}
function getWindowScrollBarX(element, rect) {
const leftScroll = getNodeScroll(element).scrollLeft;
if (!rect) {
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
}
return rect.left + leftScroll;
}
function getHTMLOffset(documentElement, scroll) {
const htmlRect = documentElement.getBoundingClientRect();
const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);
const y = htmlRect.top + scroll.scrollTop;
return {
x,
y
};
}
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
let {
elements,
rect,
offsetParent,
strategy
} = _ref;
const isFixed = strategy === "fixed";
const documentElement = getDocumentElement(offsetParent);
const topLayer = elements ? isTopLayer(elements.floating) : false;
if (offsetParent === documentElement || topLayer && isFixed) {
return rect;
}
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
let scale = createCoords(1);
const offsets = createCoords(0);
const isOffsetParentAnElement = isHTMLElement(offsetParent);
if (isOffsetParentAnElement || !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent);
scale = getScale(offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
return {
width: rect.width * scale.x,
height: rect.height * scale.y,
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
};
}
function getClientRects(element) {
return element.getClientRects ? Array.from(element.getClientRects()) : [];
}
function getDocumentRect(html) {
const scroll = getNodeScroll(html);
const body = html.ownerDocument.body;
const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
let x = -scroll.scrollLeft + getWindowScrollBarX(html);
const y = -scroll.scrollTop;
if (getComputedStyle2(body).direction === "rtl") {
x += max(html.clientWidth, body.clientWidth) - width;
}
return {
width,
height,
x,
y
};
}
var SCROLLBAR_MAX = 25;
function getViewportRect(element, strategy, rootBoundary) {
if (rootBoundary === void 0) {
rootBoundary = "viewport";
}
const isLayoutViewport = rootBoundary === "layoutViewport";
const win = getWindow(element);
const html = getDocumentElement(element);
const visualViewport = win.visualViewport;
let width = html.clientWidth;
let height = html.clientHeight;
let x = 0;
let y = 0;
if (visualViewport) {
const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed";
if (isLayoutViewport) {
if (!layoutRelativeClientCoords) {
x = -visualViewport.offsetLeft;
y = -visualViewport.offsetTop;
}
} else {
width = visualViewport.width;
height = visualViewport.height;
if (layoutRelativeClientCoords) {
x = visualViewport.offsetLeft;
y = visualViewport.offsetTop;
}
}
}
const windowScrollbarX = getWindowScrollBarX(html);
if (windowScrollbarX <= 0) {
const doc = html.ownerDocument;
const body = doc.body;
const bodyStyles = getComputedStyle(body);
const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;
const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);
const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth;
if (gutter <= SCROLLBAR_MAX) {
width -= gutter;
}
}
return {
width,
height,
x,
y
};
}
function getInnerBoundingClientRect(element, strategy) {
const clientRect = getBoundingClientRect(element, true, strategy === "fixed");
const top = clientRect.top + element.clientTop;
const left = clientRect.left + element.clientLeft;
const scale = getScale(element);
const width = element.clientWidth * scale.x;
const height = element.clientHeight * scale.y;
const x = left * scale.x;
const y = top * scale.y;
return {
width,
height,
x,
y
};
}
function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
let rect;
if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") {
rect = getViewportRect(element, strategy, clippingAncestor);
} else if (clippingAncestor === "document") {
rect = getDocumentRect(getDocumentElement(element));
} else if (isElement(clippingAncestor)) {
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
} else {
const visualOffsets = getVisualOffsets(element);
rect = {
x: clippingAncestor.x - visualOffsets.x,
y: clippingAncestor.y - visualOffsets.y,
width: clippingAncestor.width,
height: clippingAncestor.height
};
}
return rectToClientRect(rect);
}
function getClippingElementAncestors(element, cache) {
const cachedResult = cache.get(element);
if (cachedResult) {
return cachedResult;
}
let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body");
let lastKeptComputedStyle = null;
const elementIsFixed = getComputedStyle2(element).position === "fixed";
let currentNode = elementIsFixed ? getParentNode(element) : element;
while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {
const computedStyle = getComputedStyle2(currentNode);
const currentNodeIsContaining = isContainingBlock(currentNode);
const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : "";
const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static");
if (shouldDropCurrentNode) {
result = result.filter((ancestor) => ancestor !== currentNode);
} else {
lastKeptComputedStyle = computedStyle;
}
currentNode = getParentNode(currentNode);
}
cache.set(element, result);
return result;
}
function getClippingRect(_ref) {
let {
element,
boundary,
rootBoundary,
strategy
} = _ref;
const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
const clippingAncestors = [...elementClippingAncestors, rootBoundary];
const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);
let top = firstRect.top;
let right = firstRect.right;
let bottom = firstRect.bottom;
let left = firstRect.left;
for (let i = 1; i < clippingAncestors.length; i++) {
const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);
top = max(rect.top, top);
right = min(rect.right, right);
bottom = min(rect.bottom, bottom);
left = max(rect.left, left);
}
return {
width: right - left,
height: bottom - top,
x: left,
y: top
};
}
function getDimensions(element) {
const {
width,
height
} = getCssDimensions(element);
return {
width,
height
};
}
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
const isOffsetParentAnElement = isHTMLElement(offsetParent);
const documentElement = getDocumentElement(offsetParent);
const isFixed = strategy === "fixed";
const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
let scroll = {
scrollLeft: 0,
scrollTop: 0
};
const offsets = createCoords(0);
if (isOffsetParentAnElement || !isFixed) {
if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) {
scroll = getNodeScroll(offsetParent);
}
if (isOffsetParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
offsets.x = offsetRect.x + offsetParent.clientLeft;
offsets.y = offsetRect.y + offsetParent.clientTop;
}
}
if (!isOffsetParentAnElement && documentElement) {
offsets.x = getWindowScrollBarX(documentElement);
}
const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
return {
x,
y,
width: rect.width,
height: rect.height
};
}
function isStaticPositioned(element) {
return getComputedStyle2(element).position === "static";
}
function getTrueOffsetParent(element, polyfill) {
if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") {
return null;
}
if (polyfill) {
return polyfill(element);
}
let rawOffsetParent = element.offsetParent;
if (getDocumentElement(element) === rawOffsetParent) {
rawOffsetParent = rawOffsetParent.ownerDocument.body;
}
return rawOffsetParent;
}
function getOffsetParent(element, polyfill) {
const win = getWindow(element);
if (isTopLayer(element)) {
return win;
}
if (!isHTMLElement(element)) {
let svgOffsetParent = getParentNode(element);
while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
return svgOffsetParent;
}
svgOffsetParent = getParentNode(svgOffsetParent);
}
return win;
}
let offsetParent = getTrueOffsetParent(element, polyfill);
while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {
offsetParent = getTrueOffsetParent(offsetParent, polyfill);
}
if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
return win;
}
return offsetParent || getContainingBlock(element) || win;
}
var getElementRects = async function(data) {
const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
const getDimensionsFn = this.getDimensions;
const floatingDimensions = await getDimensionsFn(data.floating);
return {
reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
floating: {
x: 0,
y: 0,
width: floatingDimensions.width,
height: floatingDimensions.height
}
};
};
function isRTL(element) {
return getComputedStyle2(element).direction === "rtl";
}
var platform2 = {
convertOffsetParentRelativeRectToViewportRelativeRect,
getDocumentElement,
getClippingRect,
getOffsetParent,
getElementRects,
getClientRects,
getDimensions,
getScale,
isElement,
isRTL
};
function rectsAreEqual(a, b) {
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
}
function observeMove(element, onMove, ancestorResize) {
let io = null;
let timeoutId;
const root = getDocumentElement(element);
function cleanup() {
var _io;
clearTimeout(timeoutId);
(_io = io) == null || _io.disconnect();
io = null;
}
function refresh(skip, threshold) {
if (skip === void 0) {
skip = false;
}
if (threshold === void 0) {
threshold = 1;
}
cleanup();
const elementRectForRootMargin = element.getBoundingClientRect();
const {
left,
top,
width,
height
} = elementRectForRootMargin;
if (!skip) {
onMove();
}
if (!width || !height) {
return;
}
const insetTop = floor(top);
const insetRight = floor(root.clientWidth - (left + width));
const insetBottom = floor(root.clientHeight - (top + height));
const insetLeft = floor(left);
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
const options = {
rootMargin,
threshold: max(0, min(1, threshold)) || 1
};
let isFirstUpdate = true;
function handleObserve(entries) {
const ratio = entries[0].intersectionRatio;
if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
return refresh();
}
if (ratio !== threshold) {
if (!isFirstUpdate) {
return refresh();
}
if (!ratio) {
timeoutId = setTimeout(() => {
refresh(false, 1e-7);
}, 1e3);
} else {
refresh(false, ratio);
}
}
isFirstUpdate = false;
}
try {
io = new IntersectionObserver(handleObserve, {
...options,
// Handle <iframe>s
root: root.ownerDocument
});
} catch (_e) {
io = new IntersectionObserver(handleObserve, options);
}
io.observe(element);
}
const win = getWindow(element);
const handleResize = () => refresh(ancestorResize);
win.addEventListener("resize", handleResize);
refresh(true);
return () => {
win.removeEventListener("resize", handleResize);
cleanup();
};
}
function autoUpdate(reference, floating, update2, options) {
if (options === void 0) {
options = {};
}
const {
ancestorScroll = true,
ancestorResize = true,
elementResize = typeof ResizeObserver === "function",
layoutShift = typeof IntersectionObserver === "function",
animationFrame = false
} = options;
const referenceEl = unwrapElement(reference);
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : [];
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.addEventListener("scroll", update2);
ancestorResize && ancestor.addEventListener("resize", update2);
});
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null;
let reobserveFrame = -1;
let resizeObserver = null;
if (elementResize) {
resizeObserver = new ResizeObserver((_ref) => {
let [firstEntry] = _ref;
if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {
resizeObserver.unobserve(floating);
cancelAnimationFrame(reobserveFrame);
reobserveFrame = requestAnimationFrame(() => {
var _resizeObserver;
(_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);
});
}
update2();
});
if (referenceEl && !animationFrame) {
resizeObserver.observe(referenceEl);
}
if (floating) {
resizeObserver.observe(floating);
}
}
let frameId;
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
if (animationFrame) {
frameLoop();
}
function frameLoop() {
const nextRefRect = getBoundingClientRect(reference);
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
update2();
}
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
}
update2();
return () => {
var _resizeObserver2;
ancestors.forEach((ancestor) => {
ancestorScroll && ancestor.removeEventListener("scroll", update2);
ancestorResize && ancestor.removeEventListener("resize", update2);
});
cleanupIo == null || cleanupIo();
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
resizeObserver = null;
if (animationFrame) {
cancelAnimationFrame(frameId);
}
};
}
var offset2 = offset;
var shift2 = shift;
var flip2 = flip;
var size2 = size;
var limitShift2 = limitShift;
var computePosition2 = (reference, floating, options) => {
const cache = /* @__PURE__ */ new Map();
const mergedOptions = options != null ? options : {};
const platformWithCache = {
...platform2,
...mergedOptions.platform,
_c: cache
};
return computePosition(reference, floating, {
...mergedOptions,
platform: platformWithCache
});
};
// node_modules/.store/@floating-ui/[email protected]/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
var React27 = __toESM(require_react(), 1);
var import_react2 = __toESM(require_react(), 1);
var ReactDOM5 = __toESM(require_react_dom(), 1);
var isClient = typeof document !== "undefined";
var noop2 = function noop3() {
};
var index = isClient ? import_react2.useLayoutEffect : noop2;
function deepEqual(a, b) {
if (a === b) {
return true;
}
if (typeof a !== typeof b) {
return false;
}
if (typeof a === "function" && a.toString() === b.toString()) {
return true;
}
let length;
let i;
let keys;
if (a && b && typeof a === "object") {
if (Array.isArray(a)) {
length = a.length;
if (length !== b.length) return false;
for (i = length; i-- !== 0; ) {
if (!deepEqual(a[i], b[i])) {
return false;
}
}
return true;
}
keys = Object.keys(a);
length = keys.length;
if (length !== Object.keys(b).length) {
return false;
}
for (i = length; i-- !== 0; ) {
if (!{}.hasOwnProperty.call(b, keys[i])) {
return false;
}
}
for (i = length; i-- !== 0; ) {
const key = keys[i];
if (key === "_owner" && a.$$typeof) {
continue;
}
if (!deepEqual(a[key], b[key])) {
return false;
}
}
return true;
}
return a !== a && b !== b;
}
function getDPR(element) {
if (typeof window === "undefined") {
return 1;
}
const win = element.ownerDocument.defaultView || window;
return win.devicePixelRatio || 1;
}
function roundByDPR(element, value) {
const dpr = getDPR(element);
return Math.round(value * dpr) / dpr;
}
function useLatestRef(value) {
const ref = React27.useRef(value);
index(() => {
ref.current = value;
});
return ref;
}
function useFloating(options) {
if (options === void 0) {
options = {};
}
const {
placement = "bottom",
strategy = "absolute",
middleware = [],
platform: platform3,
elements: {
reference: externalReference,
floating: externalFloating
} = {},
transform = true,
whileElementsMounted,
open: open2
} = options;
const [data, setData] = React27.useState({
x: 0,
y: 0,
strategy,
placement,
middlewareData: {},
isPositioned: false
});
const [latestMiddleware, setLatestMiddleware] = React27.useState(middleware);
if (!deepEqual(latestMiddleware, middleware)) {
setLatestMiddleware(middleware);
}
const [_reference, _setReference] = React27.useState(null);
const [_floating, _setFloating] = React27.useState(null);
const setReference = React27.useCallback((node) => {
if (node !== referenceRef.current) {
referenceRef.current = node;
_setReference(node);
}
}, []);
const setFloating = React27.useCallback((node) => {
if (node !== floatingRef.current) {
floatingRef.current = node;
_setFloating(node);
}
}, []);
const referenceEl = externalReference || _reference;
const floatingEl = externalFloating || _floating;
const referenceRef = React27.useRef(null);
const floatingRef = React27.useRef(null);
const dataRef = React27.useRef(data);
const hasWhileElementsMounted = whileElementsMounted != null;
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
const platformRef = useLatestRef(platform3);
const openRef = useLatestRef(open2);
const update2 = React27.useCallback(() => {
if (!referenceRef.current || !floatingRef.current) {
return;
}
const config = {
placement,
strategy,
middleware: latestMiddleware
};
if (platformRef.current) {
config.platform = platformRef.current;
}
computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => {
const fullData = {
...data2,
// The floating element's position may be recomputed while it's closed
// but still mounted (such as when transitioning out). To ensure
// `isPositioned` will be `false` initially on the next open, avoid
// setting it to `true` when `open === false` (must be specified).
isPositioned: openRef.current !== false
};
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
dataRef.current = fullData;
ReactDOM5.flushSync(() => {
setData(fullData);
});
}
});
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
index(() => {
if (open2 === false && dataRef.current.isPositioned) {
dataRef.current.isPositioned = false;
setData((data2) => ({
...data2,
isPositioned: false
}));
}
}, [open2]);
const isMountedRef = React27.useRef(false);
index(() => {
isMountedRef.current = true;
return () => {
isMountedRef.current = false;
};
}, []);
index(() => {
if (referenceEl) referenceRef.current = referenceEl;
if (floatingEl) floatingRef.current = floatingEl;
if (referenceEl && floatingEl) {
if (whileElementsMountedRef.current) {
return whileElementsMountedRef.current(referenceEl, floatingEl, update2);
}
update2();
}
}, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]);
const refs = React27.useMemo(() => ({
reference: referenceRef,
floating: floatingRef,
setReference,
setFloating
}), [setReference, setFloating]);
const elements = React27.useMemo(() => ({
reference: referenceEl,
floating: floatingEl
}), [referenceEl, floatingEl]);
const floatingStyles = React27.useMemo(() => {
const initialStyles = {
position: strategy,
left: 0,
top: 0
};
if (!elements.floating) {
return initialStyles;
}
const x = roundByDPR(elements.floating, data.x);
const y = roundByDPR(elements.floating, data.y);
if (transform) {
return {
...initialStyles,
transform: "translate(" + x + "px, " + y + "px)",
...getDPR(elements.floating) >= 1.5 && {
willChange: "transform"
}
};
}
return {
position: strategy,
left: x,
top: y
};
}, [strategy, transform, elements.floating, data.x, data.y]);
return React27.useMemo(() => ({
...data,
update: update2,
refs,
elements,
floatingStyles
}), [data, update2, refs, elements, floatingStyles]);
}
var offset3 = (options, deps) => {
const result = offset2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var shift3 = (options, deps) => {
const result = shift2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var limitShift3 = (options, deps) => {
const result = limitShift2(options);
return {
fn: result.fn,
options: [options, deps]
};
};
var flip3 = (options, deps) => {
const result = flip2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
var size3 = (options, deps) => {
const result = size2(options);
return {
name: result.name,
fn: result.fn,
options: [options, deps]
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/NullStore.mjs
var NullStore = class extends ReactStore {
// `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
// `setState` alone would neutralize them today. They are overridden explicitly so the store stays
// inert even if a future base-class change stops routing a mutator through `setState`.
setState(_newState) {
}
update(_changes) {
}
set(_key, _value) {
}
notifyAll() {
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/inertValue.mjs
function inertValue(value) {
if (isReactVersionAtLeast(19)) {
return value;
}
return value ? "true" : void 0;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
var React28 = __toESM(require_react(), 1);
var DirectionContext = /* @__PURE__ */ React28.createContext(void 0);
if (true) DirectionContext.displayName = "DirectionContext";
function useDirection() {
const context = React28.useContext(DirectionContext);
return context?.direction ?? "ltr";
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
var React30 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs
var React29 = __toESM(require_react(), 1);
function useBaseUIFloating(options) {
const {
nodeId,
externalTree,
rootContext: store
} = options;
const referenceElement = store.useState("referenceElement");
const floatingElement = store.useState("floatingElement");
const domReferenceElement = store.useState("domReferenceElement");
const open2 = store.useState("open");
const floatingId = store.useState("floatingId");
const [positionReference, setPositionReferenceRaw] = React29.useState(null);
const domReferenceRef = React29.useRef(null);
const tree = useFloatingTree(externalTree);
const storeElements = React29.useMemo(() => ({
reference: referenceElement,
floating: floatingElement,
domReference: domReferenceElement
}), [referenceElement, floatingElement, domReferenceElement]);
const position = useFloating({
...options,
elements: {
...storeElements,
...positionReference && {
reference: positionReference
}
}
});
const setPositionReference = React29.useCallback((node) => {
const computedPositionReference = isElement(node) ? {
getBoundingClientRect: () => node.getBoundingClientRect(),
getClientRects: () => node.getClientRects(),
contextElement: node
} : node;
setPositionReferenceRaw(computedPositionReference);
position.refs.setReference(computedPositionReference);
}, [position.refs]);
const refs = React29.useMemo(() => ({
...position.refs,
setPositionReference,
domReference: domReferenceRef
}), [position.refs, setPositionReference]);
const elements = React29.useMemo(() => ({
...position.elements,
domReference: domReferenceElement
}), [position.elements, domReferenceElement]);
const context = React29.useMemo(() => ({
...position,
dataRef: store.context.dataRef,
open: open2,
onOpenChange: store.setOpen,
events: store.context.events,
floatingId,
refs,
elements,
nodeId,
rootStore: store
}), [position, refs, elements, nodeId, store, open2, floatingId]);
useIsoLayoutEffect(() => {
if (domReferenceElement) {
domReferenceRef.current = domReferenceElement;
}
}, [domReferenceElement]);
useIsoLayoutEffect(() => {
store.context.dataRef.current.floatingContext = context;
const node = tree?.nodesRef.current.find((n) => n.id === nodeId);
if (node) {
node.context = context;
}
});
return React29.useMemo(() => ({
...position,
context,
refs,
elements,
rootStore: store
}), [position, refs, elements, context, store]);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs
var baseArrow = (options) => ({
name: "arrow",
options,
async fn(state) {
const {
x,
y,
placement,
rects,
platform: platform3,
elements,
middlewareData
} = state;
const {
element,
padding = 0
} = evaluate(options, state) || {};
if (element == null) {
return {};
}
const paddingObject = getPaddingObject(padding);
const coords = {
x,
y
};
const axis = getAlignmentAxis(placement);
const length = getAxisLength(axis);
const arrowDimensions = await platform3.getDimensions(element);
const isYAxis = axis === "y";
const minProp = isYAxis ? "top" : "left";
const maxProp = isYAxis ? "bottom" : "right";
const clientProp = isYAxis ? "clientHeight" : "clientWidth";
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
const startDiff = coords[axis] - rects.reference[axis];
const clientSize = elements.floating[clientProp] || rects.floating[length];
const centerToReference = endDiff / 2 - startDiff / 2;
const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding);
const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding);
const min2 = minPadding;
const max2 = clientSize - arrowDimensions[length] - maxPadding;
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
const offset4 = clamp(min2, center, max2);
const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0;
return {
[axis]: coords[axis] + alignmentOffset,
data: {
[axis]: offset4,
centerOffset: center - offset4 - alignmentOffset,
...shouldAddOffset && {
alignmentOffset
}
},
reset: shouldAddOffset
};
}
});
var arrow4 = (options, deps) => {
const {
name,
fn
} = baseArrow(options);
return {
name,
fn,
options: [options, deps]
};
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/hideMiddleware.mjs
var hide4 = {
name: "hide",
async fn(state) {
const {
width,
height,
x,
y
} = state.rects.reference;
const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0;
const overflow = await state.platform.detectOverflow(state, {
elementContext: "reference"
});
const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0;
return {
data: {
referenceHidden: referenceHidden || anchorHidden2
}
};
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs
var DEFAULT_SIDES = {
sideX: "left",
sideY: "top"
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs
var availableWidth = "--available-width";
var availableHeight = "--available-height";
var anchorWidth = "--anchor-width";
var anchorHeight = "--anchor-height";
var transformOrigin = "--transform-origin";
var positionerWidth = "--positioner-width";
var positionerHeight = "--positioner-height";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs
var AVAILABLE_WIDTH_VAR = availableWidth;
var AVAILABLE_HEIGHT_VAR = availableHeight;
function getLogicalSide(sideParam, renderedSide, isRtl) {
const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end";
const logicalRight = isRtl ? "inline-start" : "inline-end";
const logicalLeft = isRtl ? "inline-end" : "inline-start";
return {
top: "top",
right: isLogicalSideParam ? logicalRight : "right",
bottom: "bottom",
left: isLogicalSideParam ? logicalLeft : "left"
}[renderedSide];
}
function getOffsetData(state, sideParam, isRtl) {
const {
rects,
placement
} = state;
const data = {
side: getLogicalSide(sideParam, getSide(placement), isRtl),
align: getAlignment(placement) || "center",
anchor: {
width: rects.reference.width,
height: rects.reference.height
},
positioner: {
width: rects.floating.width,
height: rects.floating.height
}
};
return data;
}
function useAnchorPositioning(params) {
return useAnchorPositioningWithHook(params, useBaseUIFloating);
}
function useAnchorPositioningWithHook(params, useFloatingHook) {
const {
// Public parameters
anchor,
positionMethod = "absolute",
side: sideParam = "bottom",
sideOffset = 0,
align = "center",
alignOffset = 0,
collisionBoundary,
collisionPadding: collisionPaddingParam = 5,
sticky = false,
arrowPadding = 5,
disableAnchorTracking = false,
inline: inlineMiddleware,
// Private parameters
keepMounted = false,
floatingRootContext,
mounted,
collisionAvoidance,
shift: shift4,
nodeId,
adaptiveOrigin: adaptiveOrigin2,
lazyFlip = false,
externalTree
} = params;
const collisionAvoidanceSide = collisionAvoidance.side || "flip";
const collisionAvoidanceAlign = collisionAvoidance.align || "flip";
const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end";
const shiftCrossAxis = shift4?.crossAxis ?? false;
const shiftRootBoundary = shift4?.rootBoundary;
const anchorFn = typeof anchor === "function" ? anchor : void 0;
const anchorFnCallback = useStableCallback(anchorFn);
const anchorDep = anchorFn ? anchorFnCallback : anchor;
const anchorValueRef = useValueAsRef(anchor);
const mountedRef = useValueAsRef(mounted);
const direction = useDirection();
const isRtl = direction === "rtl";
const [mountPlacement, setMountPlacement] = React30.useState(null);
if (!mounted && mountPlacement !== null) {
setMountPlacement(null);
}
const lockAlign = lazyFlip === "placement";
const mountSide = mountPlacement ? getSide(mountPlacement) : null;
const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || "center" : null;
const side = mountSide || {
top: "top",
right: "right",
bottom: "bottom",
left: "left",
"inline-end": isRtl ? "left" : "right",
"inline-start": isRtl ? "right" : "left"
}[sideParam];
const placementAlign = mountAlign || align;
const placement = placementAlign === "center" ? side : `${side}-${placementAlign}`;
let collisionPadding = collisionPaddingParam;
if (typeof collisionPadding === "number") {
collisionPadding = {
top: collisionPadding,
right: collisionPadding,
bottom: collisionPadding,
left: collisionPadding
};
} else if (collisionPadding) {
collisionPadding = {
top: collisionPadding.top || 0,
right: collisionPadding.right || 0,
bottom: collisionPadding.bottom || 0,
left: collisionPadding.left || 0
};
}
const bias = 1;
const biasTop = sideParam === "bottom" ? bias : 0;
const biasBottom = sideParam === "top" ? bias : 0;
const biasLeft = sideParam === "right" ? bias : 0;
const biasRight = sideParam === "left" ? bias : 0;
const commonCollisionProps = {
boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary,
padding: collisionPadding
};
const arrowRef = React30.useRef(null);
const sideOffsetRef = useValueAsRef(sideOffset);
const alignOffsetRef = useValueAsRef(alignOffset);
const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0;
const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0;
const middleware = [];
if (inlineMiddleware) {
middleware.push(inlineMiddleware);
}
middleware.push(offset3((state) => {
const data = getOffsetData(state, sideParam, isRtl);
const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current;
const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current;
return {
mainAxis: sideAxis,
crossAxis: alignAxis,
alignmentAxis: alignAxis
};
}, [sideOffsetDep, alignOffsetDep, isRtl, sideParam]));
const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift";
const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift");
const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({
...commonCollisionProps,
// Ensure the popup flips if it's been limited by its --available-height and it resizes.
// Since the size() padding is smaller than the flip() padding, flip() will take precedence.
padding: {
top: collisionPadding.top + bias + biasTop,
right: collisionPadding.right + bias + biasRight,
bottom: collisionPadding.bottom + bias + biasBottom,
left: collisionPadding.left + bias + biasLeft
},
mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip",
crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false,
fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide
});
const shiftMiddleware = shiftDisabled ? null : shift3({
...commonCollisionProps,
// Use the Layout Viewport to avoid shifting around when pinch-zooming.
rootBoundary: shiftRootBoundary,
mainAxis: collisionAvoidanceAlign !== "none",
crossAxis: crossAxisShiftEnabled,
limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => {
if (!arrowRef.current) {
return {};
}
const {
width,
height
} = arrowRef.current.getBoundingClientRect();
const sideAxis = getSideAxis(getSide(limitData.placement));
const arrowSize = sideAxis === "y" ? width : height;
const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom;
return {
offset: arrowSize / 2 + offsetAmount / 2
};
})
}, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]);
if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || placementAlign === "center") {
middleware.push(shiftMiddleware, flipMiddleware);
} else {
middleware.push(flipMiddleware, shiftMiddleware);
}
middleware.push(size3({
...commonCollisionProps,
apply({
elements: {
floating
},
availableWidth: availableWidth2,
availableHeight: availableHeight2,
rects
}) {
if (!mountedRef.current) {
return;
}
const floatingStyle = floating.style;
floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`);
floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`);
const dpr = getWindow(floating).devicePixelRatio || 1;
const {
x: x2,
y: y2,
width,
height
} = rects.reference;
const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr;
const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr;
floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`);
floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`);
}
}), arrow4((state) => ({
// `transform-origin` calculations rely on an element existing. If the arrow hasn't been set,
// we'll create a fake element.
element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"),
// No padding for the fake arrow: it would displace aligned popups on narrow anchors.
padding: arrowRef.current ? arrowPadding : 0
}), [arrowPadding]), {
name: "transformOrigin",
fn(state) {
const {
elements: {
floating
},
middlewareData: middlewareData2,
placement: renderedPlacement2,
platform: platform3,
rects,
y: y2
} = state;
const renderedSide2 = getSide(renderedPlacement2);
const renderedAlign2 = getAlignment(renderedPlacement2);
const isVertical = getSideAxis(renderedSide2) === "y";
const arrowEl = arrowRef.current;
const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset;
let crossOrigin;
if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) {
crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%";
} else {
const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0;
const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0;
crossOrigin = `${arrowOffset + arrowSize / 2}px`;
}
let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`;
if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) {
sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y2}px`;
}
floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`);
return {};
}
}, hide4, adaptiveOrigin2);
useIsoLayoutEffect(() => {
if (!mounted && floatingRootContext) {
floatingRootContext.update({
referenceElement: null,
floatingElement: null,
domReferenceElement: null,
positionReference: null
});
}
}, [mounted, floatingRootContext]);
const autoUpdateOptions = React30.useMemo(() => ({
ancestorScroll: !disableAnchorTracking,
elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined",
layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined"
}), [disableAnchorTracking]);
const {
refs,
elements,
x,
y,
middlewareData,
update: update2,
placement: renderedPlacement,
context,
isPositioned,
floatingStyles: originalFloatingStyles
} = useFloatingHook({
rootContext: floatingRootContext,
open: keepMounted ? mounted : void 0,
placement,
middleware,
strategy: positionMethod,
whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions),
nodeId,
externalTree
});
const {
sideX,
sideY
} = middlewareData.adaptiveOrigin || DEFAULT_SIDES;
const resolvedPosition = isPositioned ? positionMethod : "fixed";
const floatingStyles = React30.useMemo(() => {
let base;
if (!isPositioned) {
base = {
position: resolvedPosition,
top: 0,
left: 0
};
} else if (adaptiveOrigin2) {
base = {
position: resolvedPosition,
[sideX]: x,
[sideY]: y
};
} else {
base = {
...originalFloatingStyles,
position: resolvedPosition
};
}
base[AVAILABLE_WIDTH_VAR] = "100vw";
base[AVAILABLE_HEIGHT_VAR] = "100vh";
if (!isPositioned) {
base.opacity = 0;
}
return base;
}, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]);
const registeredPositionReferenceRef = React30.useRef(null);
useIsoLayoutEffect(() => {
if (!mounted) {
return;
}
const anchorValue = anchorValueRef.current;
const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue;
const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null;
const finalAnchor = unwrappedElement || null;
if (finalAnchor !== registeredPositionReferenceRef.current) {
refs.setPositionReference(finalAnchor);
registeredPositionReferenceRef.current = finalAnchor;
}
}, [mounted, refs, anchorDep, anchorValueRef]);
React30.useEffect(() => {
if (!mounted) {
return;
}
const anchorValue = anchorValueRef.current;
if (typeof anchorValue === "function") {
return;
}
if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) {
refs.setPositionReference(anchorValue.current);
registeredPositionReferenceRef.current = anchorValue.current;
}
}, [mounted, refs, anchorDep, anchorValueRef]);
React30.useEffect(() => {
if (keepMounted && mounted && elements.reference && elements.floating) {
return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions);
}
return void 0;
}, [keepMounted, mounted, elements, update2, autoUpdateOptions]);
const renderedSide = getSide(renderedPlacement);
const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl);
const renderedAlign = getAlignment(renderedPlacement) || "center";
const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden);
useIsoLayoutEffect(() => {
if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) {
setMountPlacement(renderedPlacement);
}
}, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]);
const arrowStyles = React30.useMemo(() => ({
position: "absolute",
top: middlewareData.arrow?.y,
left: middlewareData.arrow?.x
}), [middlewareData.arrow]);
const arrowUncentered = middlewareData.arrow?.centerOffset !== 0;
return React30.useMemo(() => ({
positionerStyles: floatingStyles,
arrowStyles,
arrowRef,
arrowUncentered,
side: logicalRenderedSide,
align: renderedAlign,
physicalSide: renderedSide,
anchorHidden: anchorHidden2,
refs,
context,
isPositioned,
update: update2
}), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]);
}
function isRef(param) {
return param != null && "current" in param;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs
function getDisabledMountTransitionStyles(transitionStatus) {
return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePositioner.mjs
function usePositioner(componentProps, state, {
styles,
transitionStatus,
props,
refs,
hidden,
inert = false
}) {
const style = {
...styles
};
if (inert) {
style.pointerEvents = "none";
}
return useRenderElement("div", componentProps, {
state,
ref: refs,
props: [{
role: "presentation",
hidden,
style
}, getDisabledMountTransitionStyles(transitionStatus), props],
stateAttributesMapping: popupStateMapping
});
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupViewport.mjs
var React34 = __toESM(require_react(), 1);
var ReactDOM6 = __toESM(require_react_dom(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/utils/usePreviousValue.mjs
var React31 = __toESM(require_react(), 1);
function usePreviousValue(value) {
const [state, setState] = React31.useState({
current: value,
previous: null
});
if (!Object.is(value, state.current)) {
setState({
current: value,
previous: state.current
});
}
return state.previous;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
var React32 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/getCssDimensions.mjs
function getCssDimensions2(element) {
const css = getComputedStyle2(element);
let width = parseFloat(css.width) || 0;
let height = parseFloat(css.height) || 0;
const hasOffset = isHTMLElement(element);
const offsetWidth = hasOffset ? element.offsetWidth : width;
const offsetHeight = hasOffset ? element.offsetHeight : height;
const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
if (shouldFallback) {
width = offsetWidth;
height = offsetHeight;
}
return {
width,
height
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs
var popupWidth = "--popup-width";
var popupHeight = "--popup-height";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs
function usePopupAutoResize(parameters) {
const {
popupElement,
positionerElement,
content,
mounted,
onMeasureLayout: onMeasureLayoutParam,
onMeasureLayoutComplete: onMeasureLayoutCompleteParam,
side,
direction
} = parameters;
const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true);
const animationFrame = useAnimationFrame();
const committedDimensionsRef = React32.useRef(null);
const onMeasureLayout = useStableCallback(onMeasureLayoutParam);
const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam);
const anchoringStyles = React32.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]);
useIsoLayoutEffect(() => {
if (!mounted) {
committedDimensionsRef.current = null;
return void 0;
}
if (!popupElement || !positionerElement) {
return void 0;
}
const restoreAnchoringStyles = applyElementStyles(popupElement, anchoringStyles);
setPopupCssSize(popupElement, "auto");
const restorePopupPosition = overrideElementStyle(popupElement, "position", "static");
const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none");
const restorePopupScale = overrideElementStyle(popupElement, "scale", "1");
const restorePositionerAvailableSize = applyElementStyles(positionerElement, {
[availableWidth]: "max-content",
[availableHeight]: "max-content"
});
function restoreMeasurementOverrides() {
restorePopupPosition();
restorePopupTransform();
restorePositionerAvailableSize();
restorePopupScale();
}
onMeasureLayout?.();
if (committedDimensionsRef.current === null) {
setPositionerCssSize(positionerElement, "max-content");
const dimensions = getCssDimensions2(popupElement);
committedDimensionsRef.current = dimensions;
setPositionerCssSize(positionerElement, dimensions);
restoreMeasurementOverrides();
onMeasureLayoutComplete?.(null, dimensions);
return restoreAnchoringStyles;
}
setPositionerCssSize(positionerElement, "max-content");
const previousDimensions = committedDimensionsRef.current;
const newDimensions = getCssDimensions2(popupElement);
committedDimensionsRef.current = newDimensions;
setPopupCssSize(popupElement, previousDimensions);
restoreMeasurementOverrides();
onMeasureLayoutComplete?.(previousDimensions, newDimensions);
setPositionerCssSize(positionerElement, newDimensions);
const abortController = new AbortController();
animationFrame.request(() => {
setPopupCssSize(popupElement, newDimensions);
runOnceAnimationsFinish(() => {
popupElement.style.setProperty(popupWidth, "auto");
popupElement.style.setProperty(popupHeight, "auto");
}, abortController.signal);
});
return () => {
abortController.abort();
animationFrame.cancel();
restoreAnchoringStyles();
};
}, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]);
}
function getPopupAnchoringStyles(side, direction) {
const isPhysicalTop = side === "top";
const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start");
if (!isPhysicalTop && !isPhysicalLeft) {
return EMPTY_OBJECT;
}
return {
position: "absolute",
[isPhysicalTop ? "bottom" : "top"]: "0",
[isPhysicalLeft ? "right" : "left"]: "0"
};
}
function overrideElementStyle(element, property, value) {
const originalValue = element.style.getPropertyValue(property);
element.style.setProperty(property, value);
return () => {
element.style.setProperty(property, originalValue);
};
}
function applyElementStyles(element, styles) {
const restorers = [];
for (const [key, value] of Object.entries(styles)) {
restorers.push(overrideElementStyle(element, key, value));
}
return restorers.length ? () => {
restorers.forEach((restore) => restore());
} : NOOP;
}
function setPopupCssSize(popupElement, size4) {
const width = size4 === "auto" ? "auto" : `${size4.width}px`;
const height = size4 === "auto" ? "auto" : `${size4.height}px`;
popupElement.style.setProperty(popupWidth, width);
popupElement.style.setProperty(popupHeight, height);
}
function setPositionerCssSize(positionerElement, size4) {
const width = size4 === "max-content" ? "max-content" : `${size4.width}px`;
const height = size4 === "max-content" ? "max-content" : `${size4.height}px`;
positionerElement.style.setProperty(positionerWidth, width);
positionerElement.style.setProperty(positionerHeight, height);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
var React33 = __toESM(require_react(), 1);
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var DirectionProvider = function DirectionProvider2(props) {
const {
direction = "ltr"
} = props;
const contextValue = React33.useMemo(() => ({
direction
}), [direction]);
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DirectionContext.Provider, {
value: contextValue,
children: props.children
});
};
if (true) DirectionProvider.displayName = "DirectionProvider";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs
var adaptiveOrigin = {
name: "adaptiveOrigin",
async fn(state) {
const {
x: rawX,
y: rawY,
rects: {
floating: floatRect
},
elements: {
floating
},
platform: platform3,
strategy,
placement
} = state;
const win = getWindow(floating);
const styles = win.getComputedStyle(floating);
const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== "";
if (!hasTransition) {
return {
x: rawX,
y: rawY,
data: DEFAULT_SIDES
};
}
const offsetParent = await platform3.getOffsetParent?.(floating);
let offsetDimensions = {
width: 0,
height: 0
};
if (strategy === "fixed" && win?.visualViewport) {
offsetDimensions = {
width: win.visualViewport.width,
height: win.visualViewport.height
};
} else if (offsetParent === win) {
const doc = ownerDocument(floating);
offsetDimensions = {
width: doc.documentElement.clientWidth,
height: doc.documentElement.clientHeight
};
} else if (await platform3.isElement?.(offsetParent)) {
offsetDimensions = await platform3.getDimensions(offsetParent);
}
const currentSide = getSide(placement);
let x = rawX;
let y = rawY;
if (currentSide === "left") {
x = offsetDimensions.width - (rawX + floatRect.width);
}
if (currentSide === "top") {
y = offsetDimensions.height - (rawY + floatRect.height);
}
const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX;
const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY;
return {
x,
y,
data: {
sideX,
sideY
}
};
}
};
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs
var activationDirection = "data-activation-direction";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/usePopupViewport.mjs
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
var popupViewportStateMapping = {
activationDirection: (value) => value ? {
[activationDirection]: value
} : null
};
function usePopupViewport(parameters) {
const {
store,
side,
children
} = parameters;
const direction = useDirection();
const activeTrigger = store.useState("activeTriggerElement");
const activeTriggerId = store.useState("activeTriggerId");
const open2 = store.useState("open");
const payload = store.useState("payload");
const mounted = store.useState("mounted");
const popupElement = store.useState("popupElement");
const positionerElement = store.useState("positionerElement");
const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null);
const currentContentKey = usePopupContentKey(activeTriggerId, payload);
const capturedNodeRef = React34.useRef(null);
const [previousContentNode, setPreviousContentNode] = React34.useState(null);
const [newTriggerOffset, setNewTriggerOffset] = React34.useState(null);
const currentContainerRef = React34.useRef(null);
const previousContainerRef = React34.useRef(null);
const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true);
const cleanupFrame = useAnimationFrame();
const cleanupControllerRef = React34.useRef(null);
const [previousContentDimensions, setPreviousContentDimensions] = React34.useState(null);
const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React34.useState(false);
useIsoLayoutEffect(() => {
store.set("adaptiveOrigin", adaptiveOrigin);
return () => {
store.set("adaptiveOrigin", void 0);
};
}, [store]);
const handleMeasureLayout = useStableCallback(() => {
currentContainerRef.current?.style.setProperty("animation", "none");
currentContainerRef.current?.style.setProperty("transition", "none");
previousContainerRef.current?.style.setProperty("display", "none");
});
const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => {
currentContainerRef.current?.style.removeProperty("animation");
currentContainerRef.current?.style.removeProperty("transition");
previousContainerRef.current?.style.removeProperty("display");
if (previousDimensions) {
setPreviousContentDimensions(previousDimensions);
}
});
const armViewportCleanup = useStableCallback(() => {
cleanupControllerRef.current?.abort();
const controller = new AbortController();
cleanupControllerRef.current = controller;
onAnimationsFinished(() => {
setPreviousContentNode(null);
setPreviousContentDimensions(null);
capturedNodeRef.current = null;
}, controller.signal);
});
const lastHandledTriggerRef = React34.useRef(null);
useIsoLayoutEffect(() => {
if (!open2 || !mounted) {
lastHandledTriggerRef.current = null;
}
}, [open2, mounted]);
useIsoLayoutEffect(() => {
if (open2 && activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) {
setPreviousContentNode(capturedNodeRef.current);
setShowStartingStyleAttribute(true);
const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger);
setNewTriggerOffset(offset4);
lastHandledTriggerRef.current = activeTrigger;
}
}, [open2, activeTrigger, previousActiveTrigger]);
useIsoLayoutEffect(() => {
if (previousContentNode == null) {
return;
}
cleanupControllerRef.current?.abort();
setShowStartingStyleAttribute(true);
cleanupFrame.request(() => {
ReactDOM6.flushSync(() => {
setShowStartingStyleAttribute(false);
});
armViewportCleanup();
});
}, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]);
useIsoLayoutEffect(() => {
const source = currentContainerRef.current;
if (!source) {
return;
}
const wrapper = ownerDocument(source).createElement("div");
for (const child of Array.from(source.childNodes)) {
wrapper.appendChild(child.cloneNode(true));
}
capturedNodeRef.current = wrapper;
});
const isTransitioning = previousContentNode != null;
let childrenToRender;
if (!isTransitioning) {
childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
"data-current": true,
ref: currentContainerRef,
children
}, currentContentKey);
} else {
childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React34.Fragment, {
children: [/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
"data-previous": true,
inert: inertValue(true),
ref: previousContainerRef,
style: {
...previousContentDimensions ? {
[popupWidth]: `${previousContentDimensions.width}px`,
[popupHeight]: `${previousContentDimensions.height}px`
} : null,
position: "absolute"
},
"data-ending-style": showStartingStyleAttribute ? void 0 : ""
}, "previous"), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", {
"data-current": true,
ref: currentContainerRef,
"data-starting-style": showStartingStyleAttribute ? "" : void 0,
children
}, currentContentKey)]
});
}
useIsoLayoutEffect(() => {
const container = previousContainerRef.current;
if (!container || !previousContentNode) {
return;
}
container.replaceChildren(...Array.from(previousContentNode.childNodes));
}, [previousContentNode]);
usePopupAutoResize({
popupElement,
positionerElement,
mounted,
content: payload,
onMeasureLayout: handleMeasureLayout,
onMeasureLayoutComplete: handleMeasureLayoutComplete,
side,
direction
});
const state = {
activationDirection: getActivationDirection(newTriggerOffset),
transitioning: isTransitioning
};
return {
children: childrenToRender,
state
};
}
function getActivationDirection(offset4) {
if (!offset4) {
return void 0;
}
return `${getValueWithTolerance(offset4.horizontal, 5, "right", "left")} ${getValueWithTolerance(offset4.vertical, 5, "down", "up")}`;
}
function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) {
if (value > tolerance) {
return positiveLabel;
}
if (value < -tolerance) {
return negativeLabel;
}
return "";
}
function calculateRelativePosition(from, to) {
const fromRect = from.getBoundingClientRect();
const toRect = to.getBoundingClientRect();
const fromCenter = {
x: fromRect.left + fromRect.width / 2,
y: fromRect.top + fromRect.height / 2
};
const toCenter = {
x: toRect.left + toRect.width / 2,
y: toRect.top + toRect.height / 2
};
return {
horizontal: toCenter.x - fromCenter.x,
vertical: toCenter.y - fromCenter.y
};
}
function usePopupContentKey(activeTriggerId, payload) {
const [contentKey, setContentKey] = React34.useState(0);
const previousActiveTriggerIdRef = React34.useRef(activeTriggerId);
const previousPayloadRef = React34.useRef(payload);
const pendingPayloadUpdateRef = React34.useRef(false);
useIsoLayoutEffect(() => {
const previousActiveTriggerId = previousActiveTriggerIdRef.current;
const previousPayload = previousPayloadRef.current;
const triggerIdChanged = activeTriggerId !== previousActiveTriggerId;
const payloadChanged = payload !== previousPayload;
if (triggerIdChanged) {
setContentKey((value) => value + 1);
pendingPayloadUpdateRef.current = !payloadChanged;
} else if (pendingPayloadUpdateRef.current && payloadChanged) {
setContentKey((value) => value + 1);
pendingPayloadUpdateRef.current = false;
}
previousActiveTriggerIdRef.current = activeTriggerId;
previousPayloadRef.current = payload;
}, [activeTriggerId, payload]);
return `${activeTriggerId ?? "current"}-${contentKey}`;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs
var React35 = __toESM(require_react(), 1);
var ReactDOM7 = __toESM(require_react_dom(), 1);
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
var FloatingPortalLite = /* @__PURE__ */ React35.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) {
const {
children,
container,
className,
render,
style,
...elementProps
} = componentProps;
const {
node: portalNode,
subtree: portalSubtree
} = useFloatingPortalNode({
container,
ref: forwardedRef,
componentProps,
elementProps
});
if (!portalSubtree && !portalNode) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React35.Fragment, {
children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)]
});
});
if (true) FloatingPortalLite.displayName = "FloatingPortalLite";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/index.parts.mjs
var index_parts_exports = {};
__export(index_parts_exports, {
Arrow: () => TooltipArrow,
Handle: () => TooltipHandle,
Popup: () => TooltipPopup,
Portal: () => TooltipPortal,
Positioner: () => TooltipPositioner,
Provider: () => TooltipProvider,
Root: () => TooltipRoot,
Trigger: () => TooltipTrigger,
Viewport: () => TooltipViewport,
createHandle: () => createTooltipHandle
});
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
var React38 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs
var React36 = __toESM(require_react(), 1);
var TooltipRootContext = /* @__PURE__ */ React36.createContext(void 0);
if (true) TooltipRootContext.displayName = "TooltipRootContext";
function useTooltipRootContext(optional) {
const context = React36.useContext(TooltipRootContext);
if (context === void 0 && !optional) {
throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs
var React37 = __toESM(require_react(), 1);
var selectors2 = {
...popupStoreSelectors,
disabled: (state) => state.disabled,
instantType: (state) => state.instantType,
isInstantPhase: (state) => state.isInstantPhase,
trackCursorAxis: (state) => state.trackCursorAxis,
disableHoverablePopup: (state) => state.disableHoverablePopup,
lastOpenChangeReason: (state) => state.openChangeReason,
closeOnClick: (state) => state.closeOnClick,
// Active and inactive trigger props are the same object, so a constant for triggers that discard
// them keeps those triggers from re-rendering when the props change.
appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : void 0,
closeDelay: (state) => state.closeDelay,
adaptiveOrigin: (state) => state.adaptiveOrigin
};
var TooltipStore = class extends ReactStore {
constructor(initialState, floatingId, nested) {
const triggerElements = new PopupTriggerMap();
super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2);
}
setOpen = (nextOpen, eventDetails) => {
applyPopupOpenChange(this, nextOpen, eventDetails, {
extraState: {
openChangeReason: eventDetails.reason
}
});
};
// Used by trigger clicks to clear a delayed hover open without reporting a public open-state change.
cancelPendingOpen(event) {
this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event));
}
};
function createNullTooltipStore() {
const triggerElements = new PopupTriggerMap();
const store = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2);
return Object.assign(store, {
setOpen: NOOP,
cancelPendingOpen: NOOP
});
}
function createInitialState(initialState, triggerElements, floatingId, nested = false) {
const state = {
...createInitialPopupStoreState(triggerElements, floatingId, nested),
disabled: false,
instantType: void 0,
isInstantPhase: false,
trackCursorAxis: "none",
disableHoverablePopup: false,
openChangeReason: null,
closeOnClick: true,
closeDelay: 0,
adaptiveOrigin: void 0,
...initialState
};
return state;
}
function createInitialContext(triggerElements) {
return {
popupRef: /* @__PURE__ */ React37.createRef(),
onOpenChange: void 0,
onOpenChangeComplete: void 0,
triggerElements
};
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
var TooltipRoot = fastComponent(function TooltipRoot2(props) {
const {
disabled: disabled2 = false,
defaultOpen = false,
open: openProp,
disableHoverablePopup = false,
trackCursorAxis = "none",
actionsRef,
onOpenChange,
onOpenChangeComplete,
handle,
triggerId: triggerIdProp,
defaultTriggerId: defaultTriggerIdProp = null,
children
} = props;
const store = usePopupRootStore((floatingId, nested) => new TooltipStore({
open: defaultOpen,
openProp,
activeTriggerId: defaultTriggerIdProp,
triggerIdProp
}, floatingId, nested));
store.useControlledProp("openProp", openProp);
store.useControlledProp("triggerIdProp", triggerIdProp);
store.useContextCallback("onOpenChange", onOpenChange);
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
const openState = store.useState("open");
const open2 = !disabled2 && openState;
const activeTriggerId = store.useState("activeTriggerId");
const mounted = store.useState("mounted");
const payload = store.useState("payload");
store.useSyncedValues({
trackCursorAxis,
disableHoverablePopup,
disabled: disabled2
});
useImplicitActiveTrigger(store, {
closeOnActiveTriggerUnmount: true
});
const {
forceUnmount,
transitionStatus
} = useOpenStateTransitions(open2, store);
const isInstantPhase = store.useState("isInstantPhase");
const instantType = store.useState("instantType");
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
const previousInstantTypeRef = React38.useRef(null);
useIsoLayoutEffect(() => {
if (openState && disabled2) {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled));
}
}, [openState, disabled2, store]);
useIsoLayoutEffect(() => {
if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) {
if (instantType !== "delay") {
previousInstantTypeRef.current = instantType;
}
store.set("instantType", "delay");
} else if (previousInstantTypeRef.current !== null) {
store.set("instantType", previousInstantTypeRef.current);
previousInstantTypeRef.current = null;
}
}, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]);
useIsoLayoutEffect(() => {
if (open2) {
if (activeTriggerId == null) {
store.set("payload", void 0);
}
}
}, [store, activeTriggerId, open2]);
React38.useImperativeHandle(actionsRef, () => ({
unmount: forceUnmount,
close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
}), [forceUnmount, store]);
const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none";
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TooltipRootContext.Provider, {
value: store,
children: [handle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopupHandleAttachment, {
handle,
store
}), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipInteractions, {
store,
disabled: disabled2,
trackCursorAxis
}), typeof children === "function" ? children({
payload
}) : children]
});
});
if (true) TooltipRoot.displayName = "TooltipRoot";
function TooltipInteractions({
store,
disabled: disabled2,
trackCursorAxis
}) {
const floatingRootContext = store.useState("floatingRootContext");
const dismiss = useDismiss(floatingRootContext, {
enabled: !disabled2,
referencePress: () => store.select("closeOnClick")
});
const clientPoint = useClientPoint(floatingRootContext, {
enabled: !disabled2 && trackCursorAxis !== "none",
axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis
});
const triggerProps = React38.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]);
usePopupInteractionProps(store, {
activeTriggerProps: triggerProps,
inactiveTriggerProps: triggerProps,
popupProps: dismiss.floating ?? EMPTY_OBJECT
});
return null;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
var React40 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs
var React39 = __toESM(require_react(), 1);
var TooltipProviderContext = /* @__PURE__ */ React39.createContext(void 0);
if (true) TooltipProviderContext.displayName = "TooltipProviderContext";
function useTooltipProviderContext() {
return React39.useContext(TooltipProviderContext);
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/utils/constants.mjs
var OPEN_DELAY = 600;
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs
var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger";
function getTargetElement(event) {
const target = getTarget(event);
return isElement(target) ? target : null;
}
var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) {
const {
render,
className,
style,
handle,
payload,
disabled: disabledProp,
delay,
closeOnClick = true,
closeDelay,
id: idProp,
...elementProps
} = componentProps;
const rootContext = useTooltipRootContext(true);
const handleStore = usePopupHandleStore(handle);
const store = handleStore ?? rootContext;
if (!store) {
throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82));
}
const thisTriggerId = useBaseUiId(idProp);
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
const floatingRootContext = store.useState("floatingRootContext");
const triggerElementRef = React40.useRef(null);
const closeDelayWithDefault = closeDelay ?? 0;
const {
registerTrigger,
isMountedByThisTrigger
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
payload,
closeOnClick,
closeDelay: closeDelayWithDefault
});
const providerDelay = useTooltipProviderContext();
const {
activeIdRef,
delayRef,
isInstantPhase,
hasProvider
} = useDelayGroup(floatingRootContext, {
open: isOpenedByThisTrigger
});
const hoverInteraction = useHoverInteractionSharedState(floatingRootContext);
store.useSyncedValue("isInstantPhase", isInstantPhase);
const rootDisabled = store.useState("disabled");
const disabled2 = disabledProp ?? rootDisabled;
const disabledRef = useValueAsRef(disabled2);
const trackCursorAxis = store.useState("trackCursorAxis");
const disableHoverablePopup = store.useState("disableHoverablePopup");
const isNestedTriggerHoveredRef = React40.useRef(false);
const nestedTriggerOpenTimeout = useTimeout();
const pointerTypeRef = React40.useRef(void 0);
function getOpenDelay() {
if (hasProvider && activeIdRef.current != null) {
return 0;
}
return delay ?? providerDelay ?? OPEN_DELAY;
}
function isEnabledNestedTriggerTarget(target) {
const triggerEl = triggerElementRef.current;
if (!triggerEl || !target) {
return false;
}
const nearestTrigger = closest(target, `[${TOOLTIP_TRIGGER_IDENTIFIER}]`);
return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger);
}
function detectNestedTriggerHover(target) {
const nestedTriggerHovered = isEnabledNestedTriggerTarget(target);
isNestedTriggerHoveredRef.current = nestedTriggerHovered;
if (nestedTriggerHovered) {
hoverInteraction.openChangeTimeout.clear();
hoverInteraction.restTimeout.clear();
hoverInteraction.restTimeoutPending = false;
nestedTriggerOpenTimeout.clear();
}
return nestedTriggerHovered;
}
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
enabled: !disabled2,
mouseOnly: true,
move: false,
handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null,
restMs: getOpenDelay,
delay() {
if (closeDelay == null && hasProvider) {
return {
close: getDelay(delayRef.current, "close")
};
}
return {
close: closeDelayWithDefault
};
},
triggerElementRef,
isActiveTrigger: isTriggerActive,
isClosing: () => store.select("transitionStatus") === "ending",
shouldOpen() {
return !isNestedTriggerHoveredRef.current;
}
});
const focusProps = useFocus(floatingRootContext, {
enabled: !disabled2
}).reference;
const handleNestedTriggerHover = (event) => {
const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current;
const target = getTargetElement(event);
const nestedTriggerHovered = detectNestedTriggerHover(target);
const triggerEl = triggerElementRef.current;
const targetInsideTrigger = triggerEl && target && contains(triggerEl, target);
if (nestedTriggerHovered && store.select("open") && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) {
store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event));
return;
}
if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences.
isMouseLikePointerType(pointerTypeRef.current)) {
const open2 = () => {
if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select("open")) {
store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl));
}
};
const openDelay = getOpenDelay();
if (openDelay === 0) {
nestedTriggerOpenTimeout.clear();
open2();
} else {
nestedTriggerOpenTimeout.start(openDelay, open2);
}
}
};
const rootTriggerProps = store.useState("appliedTriggerProps", isMountedByThisTrigger || trackCursorAxis !== "none");
const state = {
open: isOpenedByThisTrigger
};
const element = useRenderElement("button", componentProps, {
state,
ref: [forwardedRef, registerTrigger, triggerElementRef],
props: [hoverProps, focusProps, rootTriggerProps, {
onMouseOver(event) {
handleNestedTriggerHover(event.nativeEvent);
},
onFocus(event) {
if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) {
event.preventBaseUIHandler();
}
},
onMouseLeave() {
isNestedTriggerHoveredRef.current = false;
nestedTriggerOpenTimeout.clear();
pointerTypeRef.current = void 0;
},
onPointerEnter(event) {
pointerTypeRef.current = event.pointerType;
},
onPointerDown(event) {
pointerTypeRef.current = event.pointerType;
store.set("closeOnClick", closeOnClick);
if (closeOnClick && !store.select("open")) {
store.cancelPendingOpen(event.nativeEvent);
}
},
onClick(event) {
if (closeOnClick && !store.select("open")) {
store.cancelPendingOpen(event.nativeEvent);
}
},
id: thisTriggerId,
[triggerDisabled]: disabled2 ? "" : void 0,
[TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : ""
}, elementProps],
stateAttributesMapping: triggerOpenStateMapping
});
return element;
});
if (true) TooltipTrigger.displayName = "TooltipTrigger";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
var React42 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs
var React41 = __toESM(require_react(), 1);
var TooltipPortalContext = /* @__PURE__ */ React41.createContext(void 0);
if (true) TooltipPortalContext.displayName = "TooltipPortalContext";
function useTooltipPortalContext() {
const value = React41.useContext(TooltipPortalContext);
if (value === void 0) {
throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70));
}
return value;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
var TooltipPortal = /* @__PURE__ */ React42.forwardRef(function TooltipPortal2(props, forwardedRef) {
const {
keepMounted = false,
...portalProps
} = props;
const store = useTooltipRootContext();
const mounted = store.useState("mounted");
const shouldRender = mounted || keepMounted;
if (!shouldRender) {
return null;
}
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPortalContext.Provider, {
value: keepMounted,
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FloatingPortalLite, {
ref: forwardedRef,
...portalProps
})
});
});
if (true) TooltipPortal.displayName = "TooltipPortal";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
var React44 = __toESM(require_react(), 1);
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs
var React43 = __toESM(require_react(), 1);
var TooltipPositionerContext = /* @__PURE__ */ React43.createContext(void 0);
if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext";
function useTooltipPositionerContext() {
const context = React43.useContext(TooltipPositionerContext);
if (context === void 0) {
throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71));
}
return context;
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
var TooltipPositioner = /* @__PURE__ */ React44.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) {
const {
render,
className,
anchor,
positionMethod = "absolute",
side = "top",
align = "center",
sideOffset = 0,
alignOffset = 0,
collisionBoundary = "clipping-ancestors",
collisionPadding = 5,
arrowPadding = 5,
sticky = false,
disableAnchorTracking = false,
collisionAvoidance = POPUP_COLLISION_AVOIDANCE,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const keepMounted = useTooltipPortalContext();
const open2 = store.useState("open");
const mounted = store.useState("mounted");
const trackCursorAxis = store.useState("trackCursorAxis");
const disableHoverablePopup = store.useState("disableHoverablePopup");
const floatingRootContext = store.useState("floatingRootContext");
const instantType = store.useState("instantType");
const transitionStatus = store.useState("transitionStatus");
const adaptiveOrigin2 = store.useState("adaptiveOrigin");
const positioning = useAnchorPositioning({
anchor,
positionMethod,
floatingRootContext,
mounted,
side,
sideOffset,
align,
alignOffset,
collisionBoundary,
collisionPadding,
sticky,
arrowPadding,
disableAnchorTracking,
keepMounted,
collisionAvoidance,
adaptiveOrigin: adaptiveOrigin2
});
const state = React44.useMemo(() => ({
open: open2,
side: positioning.side,
align: positioning.align,
anchorHidden: positioning.anchorHidden,
instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType
}), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]);
const element = usePositioner(componentProps, state, {
styles: positioning.positionerStyles,
transitionStatus,
props: elementProps,
refs: [forwardedRef, store.useStateSetter("positionerElement")],
hidden: !mounted,
inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup
});
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPositionerContext.Provider, {
value: positioning,
children: element
});
});
if (true) TooltipPositioner.displayName = "TooltipPositioner";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs
var React45 = __toESM(require_react(), 1);
var TooltipPopup = /* @__PURE__ */ React45.forwardRef(function TooltipPopup2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const {
side,
align
} = useTooltipPositionerContext();
const open2 = store.useState("open");
const instantType = store.useState("instantType");
const transitionStatus = store.useState("transitionStatus");
const popupProps = store.useState("popupProps");
const floatingContext = store.useState("floatingRootContext");
const disabled2 = store.useState("disabled");
const closeDelay = store.useState("closeDelay");
useOpenChangeComplete({
open: open2,
ref: store.context.popupRef,
onComplete() {
if (open2) {
store.context.onOpenChangeComplete?.(true);
}
}
});
useHoverFloatingInteraction(floatingContext, {
enabled: !disabled2,
closeDelay
});
const setPopupElement = store.useStateSetter("popupElement");
const state = {
open: open2,
side,
align,
instant: instantType,
transitionStatus
};
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, store.context.popupRef, setPopupElement],
props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps],
stateAttributesMapping: popupTransitionStateMapping
});
return element;
});
if (true) TooltipPopup.displayName = "TooltipPopup";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs
var React46 = __toESM(require_react(), 1);
var TooltipArrow = /* @__PURE__ */ React46.forwardRef(function TooltipArrow2(componentProps, forwardedRef) {
const {
render,
className,
style,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const {
arrowRef,
side,
align,
arrowUncentered,
arrowStyles
} = useTooltipPositionerContext();
const open2 = store.useState("open");
const instantType = store.useState("instantType");
const state = {
open: open2,
side,
align,
uncentered: arrowUncentered,
instant: instantType
};
const element = useRenderElement("div", componentProps, {
state,
ref: [forwardedRef, arrowRef],
props: [{
style: arrowStyles,
"aria-hidden": true
}, elementProps],
stateAttributesMapping: popupStateMapping
});
return element;
});
if (true) TooltipArrow.displayName = "TooltipArrow";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs
var React47 = __toESM(require_react(), 1);
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
var TooltipProvider = function TooltipProvider2(props) {
const {
delay,
closeDelay,
timeout = 400
} = props;
const delayValue = React47.useMemo(() => ({
open: delay,
close: closeDelay
}), [delay, closeDelay]);
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProviderContext.Provider, {
value: delay,
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FloatingDelayGroup, {
delay: delayValue,
timeoutMs: timeout,
children: props.children
})
});
};
if (true) TooltipProvider.displayName = "TooltipProvider";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs
var React48 = __toESM(require_react(), 1);
var TooltipViewport = /* @__PURE__ */ React48.forwardRef(function TooltipViewport2(componentProps, forwardedRef) {
const {
render,
className,
style,
children,
...elementProps
} = componentProps;
const store = useTooltipRootContext();
const positioner = useTooltipPositionerContext();
const instantType = store.useState("instantType");
const {
children: childrenToRender,
state: viewportState
} = usePopupViewport({
store,
side: positioner.side,
children
});
const state = {
activationDirection: viewportState.activationDirection,
transitioning: viewportState.transitioning,
instant: instantType
};
return useRenderElement("div", componentProps, {
state,
ref: forwardedRef,
props: [elementProps, {
children: childrenToRender
}],
stateAttributesMapping: popupViewportStateMapping
});
});
if (true) TooltipViewport.displayName = "TooltipViewport";
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs
var TooltipHandle = class extends BasePopupHandle {
constructor() {
super(createNullTooltipStore(), "Tooltip");
}
/**
* Opens the tooltip and associates it with the trigger with the given id.
*
* This method should only be called in an event handler or an effect (not during rendering).
*
* @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching
* `Tooltip.Trigger` with this handle passed as a prop.
*/
open(triggerId) {
this.openByTrigger(triggerId);
}
/**
* Closes the tooltip.
*
* This method should only be called in an event handler or an effect (not during rendering).
*/
close() {
this.closePopup();
}
/**
* Whether the tooltip is currently open. Returns `false` while no root is attached to the handle.
*/
get isOpen() {
return this.attachedStore?.select("open") ?? false;
}
};
function createTooltipHandle() {
return new TooltipHandle();
}
// node_modules/.store/@base-ui/[email protected]/node_modules/@base-ui/react/use-render/useRender.mjs
function useRender(params) {
return useRenderElement(params.defaultTagName ?? "div", params, params);
}
// packages/ui/build-module/text/text.mjs
var import_element10 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
function getRuntime() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
return true;
}
}
return false;
}
function injectStyle(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument(targetDocument) {
const runtime = getRuntime();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle(hash, css) {
const runtime = getRuntime();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
}
var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
if (typeof process === "undefined" || true) {
registerStyle("abb19c3171", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._400bf7ee0c6061a9__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}");
}
var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li", "span": "_400bf7ee0c6061a9__span" };
var Text = (0, import_element10.forwardRef)(
function UnforwardedText({ variant = "body-md", render, className, ...props }, ref) {
const element = useRender({
render,
defaultTagName: "span",
ref,
props: mergeProps(props, {
className: clsx_default(
style_default.text,
global_css_defense_default.heading,
global_css_defense_default.p,
style_default[variant],
className
)
})
});
return element;
}
);
// packages/icons/build-module/icon/index.mjs
var import_element11 = __toESM(require_element(), 1);
var icon_default = (0, import_element11.forwardRef)(
({ icon, size: size4 = 24, style, ...props }, ref) => {
const intrinsicStyle = icon.props.style;
const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
return (0, import_element11.cloneElement)(icon, {
width: size4,
height: size4,
...props,
// Merge styles so the icon's intrinsic style (e.g. `fill: none` on
// stroke-based icons) is preserved unless the consumer overrides
// the same property explicitly.
...mergedStyle ? { style: mergedStyle } : {},
ref
});
}
);
// packages/icons/build-module/library/lock-small.mjs
var import_primitives = __toESM(require_primitives(), 1);
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
var lock_small_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 11h-.2V9c0-1.5-1.2-2.8-2.8-2.8S9.2 7.5 9.2 9v2H9c-.6 0-1 .4-1 1v4c0 .6.4 1 1 1h6c.6 0 1-.4 1-1v-4c0-.6-.4-1-1-1zm-1.8 0h-2.5V9c0-.7.6-1.2 1.2-1.2s1.2.6 1.2 1.2v2z" }) });
// packages/ui/build-module/visually-hidden/visually-hidden.mjs
var import_element12 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
function getRuntime2() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument2(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash2(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE2}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
return true;
}
}
return false;
}
function injectStyle2(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime2();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash2(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument2(targetDocument) {
const runtime = getRuntime2();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle2(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle2(hash, css) {
const runtime = getRuntime2();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle2(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle2("15abcab4d0", ".f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}");
}
var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
var VisuallyHidden = (0, import_element12.forwardRef)(
function UnforwardedVisuallyHidden({ render, ...restProps }, ref) {
const element = useRender({
render,
ref,
props: mergeProps(
{ className: style_default2["visually-hidden"] },
restProps,
{
// @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
"data-visually-hidden": ""
}
)
});
return element;
}
);
// packages/ui/build-module/utils/render-slot-with-children.mjs
var import_element13 = __toESM(require_element(), 1);
function renderSlotWithChildren(slot, defaultSlot, children) {
return (0, import_element13.cloneElement)(
slot ?? defaultSlot,
{ children }
);
}
// packages/ui/build-module/utils/wp-compat-overlay-slot.mjs
var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
function getRuntime3() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument3(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash3(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE3}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
return true;
}
}
return false;
}
function injectStyle3(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime3();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash3(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument3(targetDocument) {
const runtime = getRuntime3();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle3(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle3(hash, css) {
const runtime = getRuntime3();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle3(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle3("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}");
}
var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" };
var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot";
function resolveOwnerDocument() {
return typeof document === "undefined" ? null : document;
}
function isInWordPressEnvironment() {
let topWp;
try {
topWp = window.top?.wp;
} catch {
}
const wp = topWp ?? window.wp;
return typeof wp?.components === "object" && wp.components !== null;
}
var cachedSlot = null;
function ensureSlotIsAccessible(element) {
element.setAttribute("aria-hidden", "false");
return element;
}
function createSlot(ownerDocument2) {
const element = ownerDocument2.createElement("div");
element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, "");
if (wp_compat_overlay_slot_default.slot) {
element.classList.add(wp_compat_overlay_slot_default.slot);
}
ownerDocument2.body.appendChild(element);
return element;
}
function getWpCompatOverlaySlot() {
if (typeof window === "undefined") {
return void 0;
}
if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) {
return void 0;
}
const ownerDocument2 = resolveOwnerDocument();
if (!ownerDocument2 || !ownerDocument2.body) {
return void 0;
}
if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) {
return ensureSlotIsAccessible(cachedSlot);
}
const existing = ownerDocument2.querySelector(
`[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]`
);
if (existing instanceof HTMLDivElement) {
cachedSlot = ensureSlotIsAccessible(existing);
return cachedSlot;
}
if (cachedSlot?.isConnected) {
cachedSlot.remove();
}
cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2));
return cachedSlot;
}
// packages/ui/build-module/utils/direction-provider.mjs
var import_i18n = __toESM(require_i18n(), 1);
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
function DirectionProvider3({ children }) {
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DirectionProvider, { direction: (0, import_i18n.isRTL)() ? "rtl" : "ltr", children });
}
// packages/ui/build-module/tooltip/index.mjs
var tooltip_exports = {};
__export(tooltip_exports, {
Popup: () => Popup,
Portal: () => Portal,
Positioner: () => Positioner,
Provider: () => Provider,
Root: () => Root,
Trigger: () => Trigger
});
// packages/ui/build-module/tooltip/popup.mjs
var import_element16 = __toESM(require_element(), 1);
// packages/ui/build-module/tooltip/portal.mjs
var import_element14 = __toESM(require_element(), 1);
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var Portal = (0, import_element14.forwardRef)(
function TooltipPortal3({ container, ...restProps }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
index_parts_exports.Portal,
{
container: container === void 0 ? getWpCompatOverlaySlot() : container,
...restProps,
ref
}
);
}
);
// packages/ui/build-module/tooltip/positioner.mjs
var import_element15 = __toESM(require_element(), 1);
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
function getRuntime4() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument4(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash4(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE4}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
return true;
}
}
return false;
}
function injectStyle4(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime4();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash4(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument4(targetDocument) {
const runtime = getRuntime4();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle4(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle4(hash, css) {
const runtime = getRuntime4();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle4(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
}
var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
if (typeof process === "undefined" || true) {
registerStyle4("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
}
var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
var Positioner = (0, import_element15.forwardRef)(
function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
index_parts_exports.Positioner,
{
ref,
align,
side,
sideOffset,
...props,
className: clsx_default(
resets_default["box-sizing"],
style_default3.positioner,
className
)
}
);
}
);
// packages/ui/build-module/utils/theme-provider.mjs
var theme = __toESM(require_theme(), 1);
// packages/ui/build-module/lock-unlock.mjs
var import_private_apis = __toESM(require_private_apis(), 1);
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
"I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
"@wordpress/ui"
);
// packages/ui/build-module/utils/theme-provider.mjs
function getThemeProvider() {
const themePackage = theme;
if (themePackage.ThemeProvider) {
return themePackage.ThemeProvider;
}
if (!themePackage.privateApis) {
throw new Error(
"@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`."
);
}
return unlock(
themePackage.privateApis
).ThemeProvider;
}
var ThemeProvider = getThemeProvider();
// packages/ui/build-module/tooltip/popup.mjs
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
function getRuntime5() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument5(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash5(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE5}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
return true;
}
}
return false;
}
function injectStyle5(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime5();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash5(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument5(targetDocument) {
const runtime = getRuntime5();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle5(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle5(hash, css) {
const runtime = getRuntime5();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle5(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle5("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}');
}
var style_default4 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" };
var POPUP_COLOR = { background: "#1e1e1e" };
var Popup = (0, import_element16.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) {
const popupContent = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
index_parts_exports.Popup,
{
ref,
className: clsx_default(style_default4.popup, className),
...props,
children
}
) });
const positionedPopup = renderSlotWithChildren(
positioner,
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Positioner, {}),
popupContent
);
return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Portal, {}), positionedPopup);
});
// packages/ui/build-module/tooltip/trigger.mjs
var import_element17 = __toESM(require_element(), 1);
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var Trigger = (0, import_element17.forwardRef)(
function TooltipTrigger3(props, ref) {
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(index_parts_exports.Trigger, { ref, ...props });
}
);
// packages/ui/build-module/tooltip/root.mjs
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
function Root(props) {
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Root, { ...props }) });
}
// packages/ui/build-module/tooltip/provider.mjs
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
function Provider({ ...props }) {
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(index_parts_exports.Provider, { ...props });
}
// packages/ui/build-module/stack/stack.mjs
var import_element18 = __toESM(require_element(), 1);
var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
function getRuntime6() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument6(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash6(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE6}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
return true;
}
}
return false;
}
function injectStyle6(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime6();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash6(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument6(targetDocument) {
const runtime = getRuntime6();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle6(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle6(hash, css) {
const runtime = getRuntime6();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle6(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle6("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
}
var style_default5 = { "stack": "_19ce0419607e1896__stack" };
var gapTokens = {
xs: "var(--wpds-dimension-gap-xs, 4px)",
sm: "var(--wpds-dimension-gap-sm, 8px)",
md: "var(--wpds-dimension-gap-md, 12px)",
lg: "var(--wpds-dimension-gap-lg, 16px)",
xl: "var(--wpds-dimension-gap-xl, 24px)",
"2xl": "var(--wpds-dimension-gap-2xl, 32px)",
"3xl": "var(--wpds-dimension-gap-3xl, 40px)"
};
var Stack = (0, import_element18.forwardRef)(
function UnforwardedStack({ direction, gap, align, justify, wrap, render, ...props }, ref) {
const style = {
gap: gap && gapTokens[gap],
alignItems: align,
justifyContent: justify,
flexDirection: direction,
flexWrap: wrap
};
const element = useRender({
render,
ref,
props: mergeProps(props, {
style,
className: style_default5.stack
})
});
return element;
}
);
// packages/core-fields/build-module/wp_block/description/field.mjs
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
function getPatternDescription(item) {
if (typeof item.excerpt === "string") {
return (0, import_html_entities.decodeEntities)(item.excerpt);
}
return (0, import_html_entities.decodeEntities)(item.excerpt?.raw || "");
}
var fieldExtensions = {
getValue: ({ item }) => getPatternDescription(item),
render: ({ item }) => {
const description = getPatternDescription(item);
return description ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { children: description }) : null;
}
};
// packages/core-fields/build-module/wp_block/sync_status/field.mjs
var import_i18n2 = __toESM(require_i18n(), 1);
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var SYNC_STATUS_FILTERS = [
{
value: "fully",
label: (0, import_i18n2._x)("Synced", "pattern (singular)"),
description: (0, import_i18n2.__)("Patterns that are kept in sync across the site.")
},
{
value: "unsynced",
label: (0, import_i18n2._x)("Not synced", "pattern (singular)"),
description: (0, import_i18n2.__)(
"Patterns that can be changed freely without affecting the site."
)
}
];
function getPatternSyncStatus(item) {
if (item.type && item.type !== "wp_block") {
return "unsynced";
}
if (item.meta?.wp_pattern_sync_status === "unsynced") {
return "unsynced";
}
return item.wp_pattern_sync_status || "fully";
}
var fieldExtensions2 = {
render: ({ item }) => {
const syncStatus = getPatternSyncStatus(item);
const label = SYNC_STATUS_FILTERS.find(
({ value }) => value === syncStatus
)?.label;
return label ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
"span",
{
className: `fields-field__pattern-sync-status fields-field__pattern-sync-status-${syncStatus}`,
children: label
}
) : null;
}
};
// packages/core-fields/build-module/shared/title/get-item-title.mjs
var import_html_entities2 = __toESM(require_html_entities(), 1);
var import_i18n3 = __toESM(require_i18n(), 1);
function getItemTitle(item, fallback = (0, import_i18n3.__)("(no title)")) {
let title = "";
if (typeof item.title === "string") {
title = (0, import_html_entities2.decodeEntities)(item.title);
} else if (item.title && "rendered" in item.title) {
title = (0, import_html_entities2.decodeEntities)(item.title.rendered ?? "");
} else if (item.title && "raw" in item.title) {
title = (0, import_html_entities2.decodeEntities)(item.title.raw ?? "");
}
return title || fallback;
}
// packages/core-fields/build-module/shared/title/pattern-view.mjs
var import_i18n5 = __toESM(require_i18n(), 1);
// packages/core-fields/build-module/shared/title/view.mjs
var import_i18n4 = __toESM(require_i18n(), 1);
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
function getRuntime7() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument7(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash7(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE7}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
return true;
}
}
return false;
}
function injectStyle7(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime7();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash7(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument7(targetDocument) {
const runtime = getRuntime7();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle7(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle7(hash, css) {
const runtime = getRuntime7();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle7(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle7("cd9f81046b", ".f17c7d5418aade3c__title>span:first-child{display:block;flex-grow:0;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}._86b9872383a1ab5e__pattern-title>span:first-child{flex:1}");
}
var style_default6 = { "title": "f17c7d5418aade3c__title", "pattern-title": "_86b9872383a1ab5e__pattern-title" };
function BaseTitleView({
item,
className,
children
}) {
const renderedTitle = getItemTitle(item);
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
Stack,
{
direction: "row",
align: "center",
justify: "flex-start",
gap: "sm",
className: clsx_default("fields-field__title", style_default6.title, className),
children: [
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { children: renderedTitle || (0, import_i18n4.__)("(no title)") }),
children
]
}
);
}
// packages/core-fields/build-module/shared/title/pattern-view.mjs
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
function getRuntime8() {
const globalScope = globalThis;
if (globalScope.__wpStyleRuntime) {
return globalScope.__wpStyleRuntime;
}
globalScope.__wpStyleRuntime = {
documents: /* @__PURE__ */ new Map(),
styles: /* @__PURE__ */ new Map(),
injectedStyles: /* @__PURE__ */ new WeakMap()
};
if (typeof document !== "undefined") {
registerDocument8(document);
}
return globalScope.__wpStyleRuntime;
}
function documentContainsStyleHash8(targetDocument, hash) {
if (!targetDocument.head) {
return false;
}
for (const style of targetDocument.head.querySelectorAll(
`style[${STYLE_HASH_ATTRIBUTE8}]`
)) {
if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
return true;
}
}
return false;
}
function injectStyle8(targetDocument, hash, css) {
if (!targetDocument.head) {
return;
}
const runtime = getRuntime8();
let injectedStyles = runtime.injectedStyles.get(targetDocument);
if (!injectedStyles) {
injectedStyles = /* @__PURE__ */ new Set();
runtime.injectedStyles.set(targetDocument, injectedStyles);
}
if (injectedStyles.has(hash)) {
return;
}
if (documentContainsStyleHash8(targetDocument, hash)) {
injectedStyles.add(hash);
return;
}
const style = targetDocument.createElement("style");
style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
style.appendChild(targetDocument.createTextNode(css));
targetDocument.head.appendChild(style);
injectedStyles.add(hash);
}
function registerDocument8(targetDocument) {
const runtime = getRuntime8();
runtime.documents.set(
targetDocument,
(runtime.documents.get(targetDocument) ?? 0) + 1
);
for (const [hash, css] of runtime.styles) {
injectStyle8(targetDocument, hash, css);
}
return () => {
const count = runtime.documents.get(targetDocument);
if (count === void 0) {
return;
}
if (count <= 1) {
runtime.documents.delete(targetDocument);
return;
}
runtime.documents.set(targetDocument, count - 1);
};
}
function registerStyle8(hash, css) {
const runtime = getRuntime8();
runtime.styles.set(hash, css);
for (const targetDocument of runtime.documents.keys()) {
injectStyle8(targetDocument, hash, css);
}
}
if (typeof process === "undefined" || true) {
registerStyle8("cd9f81046b", ".f17c7d5418aade3c__title>span:first-child{display:block;flex-grow:0;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap}._86b9872383a1ab5e__pattern-title>span:first-child{flex:1}");
}
var style_default7 = { "title": "f17c7d5418aade3c__title", "pattern-title": "_86b9872383a1ab5e__pattern-title" };
function PatternTitleView({
item
}) {
const lockMessage = (0, import_i18n5.__)("This pattern cannot be edited.");
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
BaseTitleView,
{
item,
className: clsx_default(
"fields-field__pattern-title",
style_default7["pattern-title"]
),
children: item.type === "pattern" && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(VisuallyHidden, { children: lockMessage }),
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(tooltip_exports.Root, { children: [
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
tooltip_exports.Trigger,
{
render: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(icon_default, { icon: lock_small_default, size: 24 })
}
),
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(tooltip_exports.Popup, { children: lockMessage })
] })
] })
}
);
}
// packages/core-fields/build-module/wp_block/title/field.mjs
var fieldExtensions3 = {
getValue: ({ item }) => getItemTitle(item),
render: PatternTitleView
};
// packages/core-fields/build-module/wp_block/index.mjs
var fields = {
excerpt: fieldExtensions,
"sync-status": fieldExtensions2,
title: fieldExtensions3
};
var wp_block_default = fields;
export {
wp_block_default as default
};
/*! Bundled license information:
use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
(**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js:
(**
* @license React
* use-sync-external-store-shim/with-selector.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/
The same content is in 3 releases, WordPress 7.2-beta1 to 7.2-beta3. See them all, or every version of this file.