@deslop/scope 0.1.1239 → 0.1.1241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{(home)-25KYCZOQ.js → (home)-Cb5lyZ8o.js} +1 -1
- package/dist/client/assets/index-CwCJY3pX.css +2 -0
- package/dist/client/assets/{index-Dl7Dgqx9.js → index-jf9qdV0C.js} +2 -2
- package/dist/client/index.html +2 -2
- package/dist/server.js +1 -0
- package/package.json +2 -2
- package/dist/client/assets/index-5M6GWlLq.css +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{a as t,i as n,o as r,r as i,t as a}from"./react-CDnnZf73.js";import{$t as o,A as s,An as c,At as l,B as u,Bn as d,Bt as f,C as p,Cn as m,D as h,Dn as g,Dt as _,En as v,Et as y,F as b,Ft as x,G as S,Gt as C,H as w,Ht as T,I as E,In as D,It as O,Jt as k,K as A,Kt as j,L as M,Lt as N,M as P,Mn as F,Mt as I,N as L,Nn as R,Nt as ee,O as te,On as ne,Ot as z,P as re,Pn as ie,Pt as B,Qt as V,R as ae,S as oe,Sn as se,St as ce,Tn as le,U as H,Un as ue,V as de,Vn as fe,Vt as pe,W as U,Wn as me,X as he,Xt as ge,Y as _e,Yt as ve,Z as ye,Zt as be,_ as xe,_n as Se,_t as Ce,an as we,at as W,b as Te,bn as Ee,cn as De,ct as Oe,d as ke,dn as Ae,dt as je,en as Me,et as Ne,f as Pe,fn as Fe,ft as Ie,g as Le,gn as Re,gt as ze,h as Be,hn as Ve,ht as He,i as Ue,in as We,it as Ge,j as Ke,jn as qe,jt as Je,k as Ye,kn as Xe,kt as Ze,ln as Qe,lt as $e,m as et,mn as tt,mt as nt,n as rt,nn as it,nt as at,on as ot,ot as G,p as st,pn as ct,pt as lt,q as ut,qt as dt,r as ft,rn as pt,rt as mt,s as ht,sn as gt,st as _t,t as vt,tn as yt,tt as bt,u as xt,un as St,ut as Ct,v as wt,vn as Tt,vt as Et,wn as Dt,wt as Ot,x as kt,xn as At,xt as jt,y as Mt,yn as Nt,yt as Pt,z as Ft}from"./effect-ClC_Awyl.js";import{A as It,B as Lt,C as Rt,D as zt,E as Bt,F as Vt,G as Ht,H as Ut,I as Wt,J as Gt,K as Kt,L as qt,M as Jt,N as Yt,O as Xt,P as Zt,R as Qt,S as K,T as $t,U as en,V as tn,W as nn,_ as rn,a as an,b as on,c as sn,d as cn,f as ln,g as un,h as dn,i as fn,j as pn,k as mn,l as hn,m as gn,n as _n,o as vn,p as yn,q as bn,r as xn,s as Sn,t as Cn,u as wn,v as Tn,w as En,x as q,y as Dn,z as On}from"./index-Dl7Dgqx9.js";var kn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};kn.node;var An=Kt(kn),jn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};jn.node;var Mn=Kt(jn),Nn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Nn.node;var Pn=Kt(Nn),Fn={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Fn.node;var In=Kt(Fn),Ln={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ln.node;var Rn=Kt(Ln),zn={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};zn.node;var Bn=Kt(zn),Vn={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Vn.node;var Hn=Kt(Vn),Un={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Un.node;var Wn=Kt(Un),Gn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Gn.node;var Kn=Kt(Gn);function qn(e){return e?.ownerDocument||document}var J=e(r(),1),Y=t(),Jn=e(i(),1),X=a(),Yn=class extends A()(`AuthError`,{cause:Ge(P()),error:W(Ft([`invalid_request`,`invalid_client`,`invalid_client_metadata`,`invalid_redirect_uri`,`invalid_grant`,`invalid_target`,`invalid_scope`,`unsupported_grant_type`,`unsupported_response_type`,`access_denied`,`temporarily_unavailable`])),message:H}){};U({id:de,name:de}),H.check(at(/^https:\/\/[a-z\d-]+\.mp281x\.xyz(?:\/mcp)?$/u)),U({accessToken:de,clientId:de,expiresAt:re,refreshToken:de}),U({client_id:de}),U({access_token:de,expires_in:re,refresh_token:de});var Xn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23da702c'%20d='M17%2021h1v22h-1zM18%2022h2v22h-2zM20%2023h2v22h-2zM22%2024h2v22h-2zM24%2025h2v22h-2zM26%2026h2v5h-2zM28%2027h2v5h-2zM30%2028h2v22h-2zM32%2029h2v22h-2zM34%2030h2v22h-2zM26%2031h1v17h-1zM36%2031h2v22h-2zM29%2032h1v17h-1zM38%2032h1v22h-1zM27%2041h1v7h-1zM28%2042h1v7h-1z'/%3e%3cpath%20fill='%23bc5215'%20d='M46%2028h1v22h-1zM44%2029h2v22h-2zM42%2030h2v22h-2zM40%2031h2v22h-2zM39%2032h1v22h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M29%209h2v1h-2zM27%2010h2v1h-2zM31%2010h3v1h-3zM25%2011h2v1h-2zM34%2011h1v1h-1zM24%2012h1v1h-1zM35%2012h1v1h-1zM23%2013h1v2h-1zM36%2013h1v1h-1zM37%2014h1v1h-1zM22%2015h1v3h-1zM29%2015h1v1h-1zM38%2015h1v2h-1zM28%2016h1v3h-1zM30%2016h2v1h-2zM32%2017h1v1h-1zM39%2017h1v2h-1zM20%2018h2v1h-2zM29%2018h1v1h-1zM33%2018h1v1h-1zM18%2019h2v1h-2zM30%2019h2v1h-2zM34%2019h1v3h-1zM40%2019h1v2h-1zM17%2020h1v1h-1zM32%2020h2v1h-2zM16%2021h1v22h-1zM41%2021h1v4h-1zM42%2025h2v1h-2zM44%2026h2v1h-2zM46%2027h1v1h-1zM47%2028h1v22h-1zM17%2043h1v1h-1zM18%2044h2v1h-2zM20%2045h2v1h-2zM22%2046h2v1h-2zM24%2047h2v1h-2zM26%2048h2v1h-2zM28%2049h2v1h-2zM30%2050h2v1h-2zM46%2050h1v1h-1zM32%2051h2v1h-2zM44%2051h2v1h-2zM34%2052h2v1h-2zM42%2052h2v1h-2zM36%2053h2v1h-2zM40%2053h2v1h-2zM38%2054h2v1h-2z'/%3e%3cpath%20fill='%23ec8b49'%20d='M22%2018h1v5h-1zM20%2019h2v3h-2zM28%2019h2v7h-2zM18%2020h2v1h-2zM30%2020h2v7h-2zM23%2021h1v2h-1zM32%2021h2v7h-2zM24%2022h4v2h-4zM34%2022h2v7h-2zM26%2024h2v1h-2zM41%2025h1v5h-1zM42%2026h2v3h-2zM44%2027h2v1h-2zM36%2028h2v2h-2zM40%2028h1v2h-1zM38%2029h2v2h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M27%2011h2v4h-2zM25%2012h2v5h-2zM29%2012h3v3h-3zM24%2013h1v9h-1zM32%2013h1v4h-1zM33%2014h1v4h-1zM23%2015h1v6h-1zM27%2015h1v1h-1zM30%2015h2v1h-2zM34%2015h1v4h-1zM35%2016h1v6h-1zM25%2017h1v5h-1zM36%2018h1v10h-1zM37%2020h1v8h-1zM38%2022h1v7h-1z'/%3e%3cpath%20fill='%23878580'%20d='M28%2015h1v1h-1zM27%2016h1v6h-1zM26%2017h1v5h-1zM37%2019h3v1h-3zM38%2020h2v2h-2zM40%2021h1v7h-1zM39%2022h1v7h-1z'/%3e%3cpath%20fill='%23f9ae77'%20d='M18%2021h2v1h-2zM20%2022h2v1h-2zM22%2023h2v1h-2zM24%2024h2v1h-2zM26%2025h2v1h-2zM28%2026h2v1h-2zM30%2027h2v1h-2zM32%2028h2v1h-2zM44%2028h2v1h-2zM34%2029h2v1h-2zM42%2029h2v1h-2zM36%2030h2v1h-2zM40%2030h2v1h-2zM38%2031h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M29%2010h2v2h-2zM31%2011h3v1h-3zM32%2012h3v1h-3zM33%2013h3v1h-3zM34%2014h3v1h-3zM35%2015h3v1h-3zM36%2016h2v2h-2zM38%2017h1v2h-1zM37%2018h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M19%2045h1v1h-1zM20%2046h2v1h-2zM22%2047h2v1h-2zM24%2048h2v1h-2zM26%2049h2v1h-2zM28%2050h2v1h-2zM30%2051h2v1h-2zM32%2052h2v1h-2zM44%2052h1v1h-1zM34%2053h2v1h-2zM42%2053h2v1h-2zM36%2054h2v1h-2zM40%2054h2v1h-2zM38%2055h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M27%2031h1v10h-1zM28%2032h1v10h-1z'/%3e%3c/svg%3e`,Zn=`/assets/icon-B_7Zk4lP.svg`,Qn=`/assets/icon-61pmFc-p.svg`,$n=`/assets/icon-BGymHyAZ.svg`,er=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2018'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23fd7357'%20d='M12%200h1v1h-1zM11%201h1v1h-1zM10%202h2v1h-2zM9%203h2v1h-2zM8%204h3v1h-3zM7%205h3v1h-3zM6%206h4v1h-4zM5%207h4v1h-4zM4%208h5v1h-5zM3%209h10v1h-10zM8%2010h4v1h-4zM7%2011h4v1h-4zM7%2012h3v1h-3zM6%2013h3v1h-3zM6%2014h2v1h-2zM5%2015h2v1h-2zM5%2016h1v1h-1zM4%2017h1v1h-1z'/%3e%3cpath%20fill='%23050505'%20d='M13%200h1v1h-1zM3%201h1v1h-1zM7%201h1v1h-1zM12%201h1v1h-1zM6%202h1v1h-1zM12%202h1v1h-1zM5%203h1v1h-1zM11%203h1v1h-1zM4%204h1v1h-1zM11%204h1v1h-1zM10%205h1v1h-1zM10%206h1v1h-1zM9%207h1v1h-1zM9%208h1v1h-1zM13%209h1v1h-1zM12%2010h1v1h-1zM11%2011h1v1h-1zM10%2012h1v1h-1zM9%2013h1v1h-1zM8%2014h1v1h-1zM12%2014h1v1h-1zM7%2015h1v1h-1zM11%2015h1v1h-1zM6%2016h1v1h-1zM10%2016h1v1h-1zM5%2017h1v1h-1zM13%2017h1v1h-1z'/%3e%3c/svg%3e`,tr=`/assets/icon-D1hVTa1Q.svg`,nr=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23ce5d97'%20d='M9%2026h10v4h-10zM9%2030h1v6h-1zM12%2030h7v2h-7zM19%2031h10v4h-10zM12%2032h3v6h-3zM16%2032h3v1h-3zM17%2033h2v7h-2zM10%2034h2v3h-2zM19%2035h1v6h-1zM22%2035h7v2h-7zM15%2036h1v3h-1zM29%2036h10v4h-10zM16%2037h1v3h-1zM22%2037h3v6h-3zM26%2037h3v1h-3zM14%2038h1v1h-1zM27%2038h2v7h-2zM20%2039h2v3h-2zM18%2040h1v1h-1zM29%2040h1v6h-1zM32%2040h7v2h-7zM25%2041h1v3h-1zM26%2042h1v3h-1zM32%2042h3v6h-3zM36%2042h3v1h-3zM24%2043h1v1h-1zM37%2043h2v7h-2zM30%2044h2v3h-2zM28%2045h1v1h-1zM35%2046h1v3h-1zM36%2047h1v3h-1zM34%2048h1v1h-1zM38%2050h1v1h-1z'/%3e%3cpath%20fill='%23575653'%20d='M24%2017h10v1h-10zM22%2018h10v1h-10zM20%2019h10v1h-10zM18%2020h10v1h-10zM16%2021h10v1h-10zM14%2022h10v1h-10zM34%2022h8v2h-8zM12%2023h10v1h-10zM32%2023h2v5h-2zM10%2024h10v1h-10zM30%2024h2v5h-2zM34%2024h6v1h-6zM28%2025h2v5h-2zM34%2025h4v1h-4zM26%2026h2v4h-2zM34%2026h2v1h-2zM24%2027h2v3h-2zM50%2027h4v1h-4zM22%2028h2v2h-2zM49%2028h3v1h-3zM20%2029h2v1h-2zM40%2029h2v5h-2zM47%2029h3v1h-3zM38%2030h2v5h-2zM42%2030h6v1h-6zM36%2031h2v4h-2zM42%2031h4v1h-4zM34%2032h2v3h-2zM42%2032h2v1h-2zM32%2033h2v2h-2zM30%2034h2v1h-2z'/%3e%3cpath%20fill='%23403e3c'%20d='M34%2018h1v4h-1zM32%2019h2v1h-2zM30%2020h2v4h-2zM28%2021h2v1h-2zM26%2022h2v4h-2zM24%2023h2v1h-2zM22%2024h2v4h-2zM9%2025h10v1h-10zM20%2025h2v1h-2zM40%2025h2v4h-2zM19%2026h1v5h-1zM38%2026h2v1h-2zM36%2027h2v4h-2zM34%2028h2v1h-2zM54%2028h1v5h-1zM32%2029h2v4h-2zM52%2029h2v1h-2zM20%2030h9v1h-9zM30%2030h2v1h-2zM50%2030h2v5h-2zM29%2031h1v5h-1zM48%2031h2v1h-2zM46%2032h2v5h-2zM44%2033h2v1h-2zM52%2033h2v1h-2zM42%2034h2v5h-2zM30%2035h9v1h-9zM40%2035h2v1h-2zM48%2035h2v1h-2zM39%2036h1v5h-1zM44%2037h2v1h-2zM40%2039h2v1h-2z'/%3e%3cpath%20fill='%23a02f6f'%20d='M54%2033h1v10h-1zM52%2034h2v10h-2zM50%2035h2v10h-2zM48%2036h2v10h-2zM46%2037h2v10h-2zM44%2038h2v10h-2zM42%2039h2v10h-2zM40%2040h2v10h-2zM39%2041h1v10h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M43%2013h6v1h-6zM42%2014h1v1h-1zM49%2014h1v1h-1zM41%2015h1v7h-1zM50%2015h1v12h-1zM24%2016h11v1h-11zM22%2017h2v1h-2zM35%2017h1v5h-1zM20%2018h2v1h-2zM18%2019h2v1h-2zM16%2020h2v1h-2zM14%2021h2v1h-2zM36%2021h5v1h-5zM12%2022h2v1h-2zM10%2023h2v1h-2zM9%2024h1v1h-1zM8%2025h1v11h-1zM51%2026h4v1h-4zM55%2027h1v16h-1zM9%2036h1v1h-1zM10%2037h2v1h-2zM12%2038h2v1h-2zM14%2039h2v1h-2zM16%2040h2v1h-2zM18%2041h2v1h-2zM20%2042h2v1h-2zM22%2043h2v1h-2zM54%2043h1v1h-1zM24%2044h2v1h-2zM52%2044h2v1h-2zM26%2045h2v1h-2zM50%2045h2v1h-2zM28%2046h2v1h-2zM48%2046h2v1h-2zM30%2047h2v1h-2zM46%2047h2v1h-2zM32%2048h2v1h-2zM44%2048h2v1h-2zM34%2049h2v1h-2zM42%2049h2v1h-2zM36%2050h2v1h-2zM40%2050h2v1h-2zM38%2051h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M10%2030h2v4h-2zM15%2032h1v4h-1zM16%2033h1v4h-1zM20%2035h2v4h-2zM25%2037h1v4h-1zM26%2038h1v4h-1zM30%2040h2v4h-2zM35%2042h1v4h-1zM36%2043h1v4h-1z'/%3e%3cpath%20fill='%23343331'%20d='M34%2017h1v1h-1zM32%2018h2v1h-2zM30%2019h2v1h-2zM28%2020h2v1h-2zM26%2021h2v1h-2zM24%2022h2v1h-2zM22%2023h2v1h-2zM20%2024h2v1h-2zM40%2024h2v1h-2zM19%2025h1v1h-1zM38%2025h2v1h-2zM36%2026h2v1h-2zM34%2027h2v1h-2zM54%2027h1v1h-1zM32%2028h2v1h-2zM52%2028h2v1h-2zM30%2029h2v1h-2zM50%2029h2v1h-2zM29%2030h1v1h-1zM48%2030h2v1h-2zM46%2031h2v1h-2zM44%2032h2v1h-2zM42%2033h2v1h-2zM40%2034h2v1h-2zM39%2035h1v1h-1z'/%3e%3cpath%20fill='%23e47da8'%20d='M32%2021h2v2h-2zM28%2023h2v2h-2zM24%2025h2v2h-2zM20%2027h2v2h-2zM38%2028h2v2h-2zM34%2030h2v2h-2zM52%2031h2v2h-2zM30%2032h2v2h-2zM48%2033h2v2h-2zM44%2035h2v2h-2zM40%2037h2v2h-2z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M11%2038h1v1h-1zM12%2039h2v1h-2zM14%2040h2v1h-2zM16%2041h2v1h-2zM18%2042h2v1h-2zM20%2043h2v1h-2zM22%2044h2v1h-2zM24%2045h2v1h-2zM52%2045h1v1h-1zM26%2046h2v1h-2zM50%2046h2v1h-2zM28%2047h2v1h-2zM48%2047h2v1h-2zM30%2048h2v1h-2zM46%2048h2v1h-2zM32%2049h2v1h-2zM44%2049h2v1h-2zM34%2050h2v1h-2zM42%2050h2v1h-2zM36%2051h2v1h-2zM40%2051h2v1h-2zM38%2052h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M43%2014h6v2h-6zM43%2016h2v14h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M42%2016h1v14h-1zM45%2017h2v13h-2z'/%3e%3cpath%20fill='%23878580'%20d='M49%2016h1v12h-1zM47%2017h2v12h-2z'/%3e%3cpath%20fill='%23f4a4c2'%20d='M32%2020h2v1h-2zM28%2022h2v1h-2zM24%2024h2v1h-2zM20%2026h2v1h-2zM38%2027h2v1h-2zM34%2029h2v1h-2zM52%2030h2v1h-2zM30%2031h2v1h-2zM48%2032h2v1h-2zM44%2034h2v1h-2zM40%2036h2v1h-2z'/%3e%3cpath%20fill='%23e6e4d9'%20d='M42%2015h1v1h-1zM49%2015h1v1h-1zM45%2016h4v1h-4z'/%3e%3c/svg%3e`,rr=`/assets/icon-THdxja9j.svg`,ir=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%234385be'%20d='M17%2017h1v25h-1zM18%2018h2v25h-2zM20%2019h2v2h-2zM22%2020h2v25h-2zM24%2021h2v25h-2zM26%2022h2v2h-2zM28%2023h2v25h-2zM30%2024h2v25h-2zM32%2025h2v2h-2zM34%2026h2v25h-2zM36%2027h1v25h-1z'/%3e%3cpath%20fill='%23205ea6'%20d='M21%2021h1v23h-1zM46%2022h1v25h-1zM44%2023h2v25h-2zM27%2024h1v23h-1zM42%2024h2v25h-2zM40%2025h2v25h-2zM38%2026h2v25h-2zM33%2027h1v23h-1zM37%2027h1v25h-1z'/%3e%3cpath%20fill='%2366a0c8'%20d='M24%2013h2v7h-2zM22%2014h2v5h-2zM20%2015h2v3h-2zM30%2015h2v8h-2zM18%2016h2v1h-2zM32%2016h2v8h-2zM26%2018h4v3h-4zM38%2018h2v7h-2zM40%2019h2v5h-2zM42%2020h2v3h-2zM20%2021h1v23h-1zM28%2021h2v1h-2zM44%2021h2v1h-2zM34%2022h4v3h-4zM26%2024h1v23h-1zM36%2025h2v1h-2zM32%2027h1v23h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M26%209h4v1h-4zM25%2010h1v3h-1zM30%2010h2v1h-2zM32%2011h2v1h-2zM24%2012h1v1h-1zM34%2012h2v1h-2zM22%2013h2v1h-2zM36%2013h2v1h-2zM20%2014h2v1h-2zM38%2014h1v4h-1zM18%2015h2v1h-2zM17%2016h1v1h-1zM16%2017h1v25h-1zM39%2017h1v1h-1zM40%2018h2v1h-2zM42%2019h2v1h-2zM44%2020h2v1h-2zM46%2021h1v1h-1zM47%2022h1v25h-1zM17%2042h1v1h-1zM18%2043h1v3h-1zM19%2046h2v1h-2zM23%2046h3v1h-3zM21%2047h2v1h-2zM26%2047h2v1h-2zM46%2047h1v1h-1zM28%2048h2v1h-2zM45%2048h1v3h-1zM30%2049h2v1h-2zM32%2050h2v1h-2zM33%2051h1v2h-1zM40%2051h1v2h-1zM43%2051h2v1h-2zM41%2052h2v1h-2zM34%2053h1v1h-1zM39%2053h1v1h-1zM35%2054h4v1h-4z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M26%2011h2v7h-2zM28%2012h2v2h-2zM30%2013h2v2h-2zM32%2014h2v2h-2zM34%2015h2v7h-2z'/%3e%3cpath%20fill='%2392bfdb'%20d='M18%2017h2v1h-2zM20%2018h2v1h-2zM22%2019h2v1h-2zM24%2020h2v1h-2zM26%2021h2v1h-2zM28%2022h2v1h-2zM44%2022h2v1h-2zM30%2023h2v1h-2zM42%2023h2v1h-2zM32%2024h2v1h-2zM40%2024h2v1h-2zM34%2025h2v1h-2zM38%2025h2v1h-2zM36%2026h2v1h-2z'/%3e%3cpath%20fill='%23878580'%20d='M28%2014h2v4h-2zM36%2015h2v7h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M26%2010h4v1h-4zM28%2011h4v1h-4zM30%2012h4v1h-4zM32%2013h4v1h-4zM34%2014h4v1h-4z'/%3e%3cpath%20fill='%23403e3c'%20d='M19%2043h1v3h-1zM21%2044h1v3h-1zM22%2045h1v2h-1zM42%2049h1v3h-1zM41%2050h1v2h-1zM34%2051h1v2h-1zM36%2052h2v2h-2z'/%3e%3cpath%20fill='%23343331'%20d='M23%2045h1v1h-1zM44%2048h1v3h-1zM43%2049h1v2h-1zM38%2051h2v2h-2zM38%2053h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M21%2048h1v1h-1zM41%2053h2v1h-2zM39%2054h1v1h-1zM36%2055h3v1h-3z'/%3e%3cpath%20fill='%23575653'%20d='M20%2044h1v2h-1zM40%2050h1v1h-1zM35%2051h1v3h-1z'/%3e%3c/svg%3e`,ar=e(n(),1);function or(e){let t=ar.unstable_scheduleCallback(4,e);return()=>ar.unstable_cancelCallback(t)}var sr=J.createContext(Le({scheduleTask:or,defaultIdleTTL:400})),cr=new WeakMap,lr=0,ur=new Set;function dr(e){lr++;try{return e()}finally{lr--}}function fr(e){if(lr===0)return e();ur.size===0&&queueMicrotask(pr),ur.add(e)}function pr(){for(let e of ur)ur.delete(e),e()}function mr(e,t){let n=cr.get(e);n===void 0&&(n=new WeakMap,cr.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>fr(n));return()=>{i--,ur.delete(n),r()}},snapshot(){return dr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:dr(()=>ke(t,e))}),a.value}};return n.set(t,o),o}function hr(e,t){let n=mr(e,t);return J.useEffect(pr),J.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function gr(e,t,n){let r=mr(e,t),i=J.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return J.useEffect(pr),J.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var _r=(e,t)=>{let n=J.useContext(sr);return t?gr(n,e,t):hr(n,e)};function vr(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?J.useCallback(r=>{e.set(t,r);let i=Et(Be(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(yr):i},[e,t,n.mode]):J.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var yr=e=>{if(f(e))return e.value;throw C(e.cause)},br=(e,t)=>{let n=J.useContext(sr);return[hr(n,e),vr(n,e,t)]},xr={suspendOnWaiting:new WeakMap,default:new WeakMap};function Sr(e,t,n){let r=n?xr.suspendOnWaiting:xr.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function Cr(e,t,n){let r=hr(e,t);if(r._tag===`Initial`||n&&r.waiting)throw Sr(e,t,n);return r}var wr=(e,t)=>{let n=Cr(J.useContext(sr),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw C(n.cause);return n};function Tr({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(()=>t);return[i&&e!==void 0?e:a,J.useCallback(e=>{i||o(e)},[])]}function Er(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}function Dr(e){let t=Rt(Or,e).current;return t.next=e,q(t.effect),t}function Or(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var kr={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ar={...kr,position:`fixed`,margin:0,top:0,left:0},jr={...kr,position:`absolute`},Mr=[],Nr=void 0;function Pr(){return Nr}function Fr(e){Mr.push(e)}function Ir(e){let t=(t,n)=>{let r=Rt(Rr).current,i;try{Nr=r;for(let e of Mr)e.before(r);i=e(t,n);for(let e of Mr)e.after(r);r.didInitialize=!0}finally{Nr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Lr(e){return J.forwardRef(Ir(e))}function Rr(){return{didInitialize:!1}}var zr=Gt(),Br=bn(),Vr=gn(19)?Wr:Gr;function Hr(e,t,n,r,i){return Vr(e,t,n,r,i)}function Ur(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zr.useSyncExternalStore)(e.subscribe,a,a)}Fr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Wr(e,t,n,r,i){let a=Pr();if(!a)return Ur(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Gr(e,t,n,r,i){return(0,Br.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Kr=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Hr(this,e,t,n,r)}},qr=class extends Kr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);q(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),Hr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=K(t??yn);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Jr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Yr(e){J.useEffect(e,cn)}var Xr=0,Zr=class e{static create(){return new e}currentId=Xr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Xr,t()},e)}isStarted(){return this.currentId!==Xr}clear=()=>{this.currentId!==Xr&&(clearTimeout(this.currentId),this.currentId=Xr)};disposeEffect=()=>this.clear};function Qr(){let e=Rt(Zr.create).current;return Yr(e.disposeEffect),e}function $r(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ei,platform:ti,maxTouchPoints:ni}=$r(),ri=ei.toLowerCase(),ii=ti.toLowerCase(),ai=/^i(os$|p)/.test(ii)||ii===`macintel`&&ni>1,oi=`android`,si=ii===oi||ri.includes(oi),ci=!ai&&ii.startsWith(`mac`);ii.startsWith(`win`),!si&&/^(linux|chrome os)/.test(ii);var li=ci||ai,ui=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),di=!ui&&ri.includes(`firefox`);!ui&&ri.includes(`chrom`);var fi=li,pi=/jsdom|happydom/.test(ri),mi=null;globalThis.requestAnimationFrame;var hi=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},gi=class e{static create(){return new e}static request(e){return hi.request(e)}static cancel(e){return hi.cancel(e)}currentId=mi;request(e){this.cancel(),this.currentId=hi.request(()=>{this.currentId=mi,e()})}cancel=()=>{this.currentId!==mi&&(hi.cancel(this.currentId),this.currentId=mi)};disposeEffect=()=>this.cancel};function _i(){let e=Rt(gi.create).current;return Yr(e.disposeEffect),e}var vi=J.forwardRef(function(e,t){let[n,r]=J.useState();q(()=>{fi&&ui&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:Ar,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function yi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function bi(e,t){let n=e;for(;n;){if(Vt(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Lt(n)?n.host:null)}return null}function xi(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Si=`data-base-ui-focusable`,Ci=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,wi=`ArrowLeft`,Ti=`ArrowRight`,Ei=`ArrowUp`,Di=`ArrowDown`,Oi=`data-starting-style`,ki=`data-ending-style`,Ai={[Oi]:``},ji={[ki]:``},Mi={transitionStatus(e){return e===`starting`?Ai:e===`ending`?ji:null}},Ni=`data-open`,Pi=`data-closed`,Fi=`data-anchor-hidden`,Ii=`data-popup-open`,Li=`data-pressed`,Ri={[Ii]:``},zi={[Ii]:``,[Li]:``},Bi={[Ni]:``},Vi={[Pi]:``},Hi={[Fi]:``},Ui={open(e){return e?Ri:null}},Wi={open(e){return e?zi:null}},Gi={open(e){return e?Bi:Vi},anchorHidden(e){return e?Hi:null}},Ki={...Gi,...Mi},qi=`data-trigger-disabled`;function Ji(e,t){if(!Vt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(qi);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(qi);return!1}function Yi(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Xi(e){return e.matches(`html,body`)}function Zi(e){return Wt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Qi(e){return bi(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ci}`)!=null}function $i(e){return e?e.getAttribute(`role`)===`combobox`&&Zi(e):!1}function ea(e){if(!e||pi)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ta(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function na(e){e.preventDefault(),e.stopPropagation()}function ra(e){return`nativeEvent`in e}function ia(e){return e.pointerType===``&&e.isTrusted?!0:si&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function aa(e){return pi?!1:!si&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(si||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function oa(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function sa(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ca=Math.min,la=Math.max,ua=Math.round,da=Math.floor,fa=e=>({x:e,y:e}),pa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ma(e,t,n){return la(e,ca(t,n))}function ha(e,t){return typeof e==`function`?e(t):e}function ga(e){return e.split(`-`)[0]}function _a(e){return e.split(`-`)[1]}function va(e){return e===`x`?`y`:`x`}function ya(e){return e===`y`?`height`:`width`}function ba(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function xa(e){return va(ba(e))}function Sa(e,t,n){n===void 0&&(n=!1);let r=_a(e),i=xa(e),a=ya(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ja(o)),[o,ja(o)]}function Ca(e){let t=ja(e);return[wa(e),t,wa(t)]}function wa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ta=[`left`,`right`],Ea=[`right`,`left`],Da=[`top`,`bottom`],Oa=[`bottom`,`top`];function ka(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ea:Ta:t?Ta:Ea;case`left`:case`right`:return t?Da:Oa;default:return[]}}function Aa(e,t,n,r){let i=_a(e),a=ka(ga(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(wa)))),a}function ja(e){let t=ga(e);return pa[t]+e.slice(t.length)}function Ma(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Na(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ma(e)}function Pa(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Fa(e,t,n){return Math.floor(e/t)!==n}function Ia(e,t){return t<0||t>=e.length}function La(e,t){return Ba(e.current,{disabledIndices:t})}function Ra(e,t){return Ba(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function za(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Ba(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Ia(e,u)?-1:u,wrapped:d}}function Ba(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ha(e,a,r));return a}function Va(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=bi(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Ha(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=da(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Ha(e,r,s))return r}};d&&na(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Ba(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Ba(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Ia(e,f)&&(f=u)}if(n===`both`){let n=da(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&na(t),u%o===o-1?r&&(f=Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ba(e,{startingIndex:u,disabledIndices:s}),r&&Fa(f,o,n)&&(f=Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Fa(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&na(t),u%o===0?r&&(f=Ba(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ba(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Fa(f,o,n)&&(f=Ba(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Fa(f,o,n)&&(f=u));let c=da(l/o)===n;Ia(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Ha(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Wa(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ua(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Wa(e,t=e?$t(e):null){return!e||!e.isConnected||!t||Ua(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ga=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ka(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Lt(n)?n.host:null}function qa(e){for(let t of Array.from(e.children))if(mn(t)===`summary`)return t;return null}function Ja(e,t){let n=qa(t);return!!n&&(e===n||Q(n,e))}function Ya(e){let t=e?mn(e):``;return e!=null&&e.matches(Ga)&&(t!==`summary`||e.parentElement!=null&&mn(e.parentElement)===`details`&&qa(e.parentElement)===e)&&(t!==`details`||qa(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Xa(e){if(!Ya(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ka(t)){let n=t!==e,r=mn(t)===`slot`;if(t.hasAttribute(`inert`)||n&&mn(t)===`details`&&!t.open&&!Ja(e,t)||t.hasAttribute(`hidden`)||!r&&!Za(t,n))return!1}return!0}function Za(e,t){let n=$t(e);return t?n.display!==`none`:Wa(e,n)}function Qa(e){let t=e.tabIndex;if(t<0){let t=mn(e);if(t===`details`||t===`audio`||t===`video`||Wt(e)&&e.isContentEditable)return 0}return t}function $a(e){if(mn(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function eo(e,t){let n=$a(e);if(!n)return!0;let r=t.find(e=>{let t=$a(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=$a(e);return t?.name===n.name&&t.form===n.form})===n}function to(e){if(Wt(e)&&mn(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Wt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function no(e,t){to(e).forEach(e=>{Ya(e)&&t.push(e),no(e,t)})}function ro(e,t,n){to(e).forEach(e=>{Wt(e)&&e.matches(t)&&n.push(e),ro(e,t,n)})}function io(e){return Xa(e)&&Qa(e)>=0}function ao(e){let t=[];return no(e,t),t.filter(Xa)}function oo(e){let t=ao(e);return t.filter(e=>Qa(e)>=0&&eo(e,t))}function so(e,t){let n=oo(e),r=n.length;if(r===0)return;let i=yi(qn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function co(e){return so(qn(e).body,1)||e}function lo(e){return so(qn(e).body,-1)||e}function uo(e,t,n){if(!e)return null;let r=[];no(qn(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Xa);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&io(o)&&eo(o,a))return o}return r[i]}function fo(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function po(e){oo(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function mo(e){let t=[];ro(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ho(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ho(e,t.id,n)])}function go(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function $(e,t,n,r){let i=!1,a=!1,o=r??ln;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function _o(e,t,n){let r=n??ln;return{reason:e,event:t??new Event(`base-ui`),...r}}var vo=`none`,yo=`trigger-press`,bo=`trigger-hover`,xo=`trigger-focus`,So=`outside-press`,Co=`item-press`,wo=`close-press`,To=`clear-press`,Eo=`input-change`,Do=`input-clear`,Oo=`input-press`,ko=`focus-out`,Ao=`escape-key`,jo=`list-navigation`,Mo=`keyboard`,No=`pointer`,Po=`cancel-open`,Fo=`sibling-open`,Io=`imperative-action`;function Lo(e){return`data-base-ui-${e}`}var Ro=0;function zo(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ro);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),yn;let o=requestAnimationFrame(a);return Ro=o,()=>{Ro===o&&(cancelAnimationFrame(o),Ro=0)}}var Bo=`data-base-ui-inert`,Vo=new WeakMap,Ho=new WeakSet,Uo=new WeakMap,Wo=0;function Go(e){return e?Lt(e)?e.host:Go(e.parentNode):null}var Ko=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Go(t);return e.contains(n)?n:null}).filter(e=>e!=null),qo=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jo=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{mn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yo(e,t,n,{mark:r=!0}){let i=Ko(t,e),a=r?Jo(t,qo(i),new Set(i)):[],o=[],s=[];if(n){let e=Ko(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Jo(t,qo(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Vo.get(e)||0)+1;Vo.set(e,r),o.push(e),r===1&&n&&Ho.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Uo.get(e)||0)+1;Uo.set(e,t),s.push(e),t===1&&e.setAttribute(Bo,``)}),Wo+=1,()=>{o.forEach(e=>{let t=(Vo.get(e)||0)-1;Vo.set(e,t),t||(Ho.has(e)||e.removeAttribute(`aria-hidden`),Ho.delete(e))}),r&&s.forEach(e=>{let t=(Uo.get(e)||0)-1;Uo.set(e,t),t||e.removeAttribute(Bo)}),--Wo,Wo||(Vo=new WeakMap,Ho=new WeakSet,Uo=new WeakMap)}}function Xo(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=qn(e[0]).body;return Yo(e,i,n,{mark:r})}function Zo(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var Qo=0;function $o(e,t=`mui`){let n=J.useRef(void 0),r=Zo(),i=e??n.current;return J.useEffect(()=>{n.current??(Qo+=1,n.current=`${t}-${Qo}`,e??r())},[e,t,r]),i}var es=En.useId;function ts(e,t){if(es!==void 0){let n=es();return e??(t?`${t}-${n}`:n)}return $o(e,t)}var ns={style:{transition:`none`}},rs={fallbackAxisSide:`none`},is={fallbackAxisSide:`end`},as={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},os=J.createContext(null),ss=()=>J.useContext(os),cs=Lo(`portal`);function ls(e={}){let{ref:t,container:n,componentProps:r=ln,elementProps:i}=e,a=ts(),o=ss()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=K(e=>{e!==null&&u(e)}),f=J.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Qt(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=hn(`div`,r,{ref:[t,d],props:[{id:a,[cs]:``},i]}),m=s&&p?Jn.createPortal(p,s):null;return{node:l,nodeId:J.isValidElement(p)?p.props.id:void 0,subtree:m}}var us=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ls({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),p=J.useRef(null),m=J.useRef(null),h=J.useRef(null),[g,_]=J.useState(null),v=J.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;J.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&fo(e)&&(e.type===`focusin`?v.current&&=(mo(l),!1):(po(l),v.current=!0))}return Jr(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),q(()=>{l&&b===!0&&v.current&&(mo(l),v.current=!1)},[b,l]);let S=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(J.Fragment,{children:[d,(0,Y.jsxs)(os.Provider,{value:S,children:[x&&l&&(0,Y.jsx)(vi,{"data-type":`outside`,ref:f,onFocus:e=>{fo(e,l)?m.current?.focus():lo(g?g.domReference:null)?.focus()}}),x&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:as}),l&&Jn.createPortal(a,l),x&&l&&(0,Y.jsx)(vi,{"data-type":`outside`,ref:p,onFocus:e=>{fo(e,l)?h.current?.focus():(co(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$(`focus-out`,e.nativeEvent)))}})]})]})});function ds(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var fs=class{nodesRef={current:[]};events=ds();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ps=J.createContext(null),ms=J.createContext(null),hs=()=>J.useContext(ps)?.id||null,gs=e=>{let t=J.useContext(ms);return e??t};function _s(e){let t=ts(),n=gs(e),r=hs();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function vs(e){let{children:t,id:n}=e,r=hs();return(0,Y.jsx)(ps.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ys(e){let{children:t,externalTree:n}=e,r=Rt(()=>n??new fs).current;return(0,Y.jsx)(ms.Provider,{value:r,children:t})}function bs(e){return e==null?e:`current`in e?e.current:e}function xs(e,t){let n=Yt(xi(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ia(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ss=20,Cs=[];function ws(){Cs=Cs.filter(e=>e.deref()?.isConnected)}function Ts(e){ws(),e&&mn(e)!==`body`&&(Cs.push(new WeakRef(e)),Cs.length>Ss&&(Cs=Cs.slice(-20)))}function Es(){return ws(),Cs[Cs.length-1]?.deref()}function Ds(e){return e?io(e)?e:oo(e)[0]||e:null}function Os(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=ao(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return io(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ks(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=K(()=>b.current.floatingContext?.nodeId),S=i===!1,C=$i(_)&&S,w=Dr(i),T=Dr(a),E=Dr(o),D=Dr(u),O=Dr(g),k=gs(m),A=ss(),j=J.useRef(!1),M=J.useRef(!1),N=J.useRef(!1),P=J.useRef(null),F=J.useRef(``),I=J.useRef(``),L=J.useRef(null),R=J.useRef(null),ee=dn(L,p,A?.beforeInsideRef),te=dn(R,A?.afterInsideRef),ne=Qr(),z=Qr(),re=_i(),ie=A!=null,B=ta(v),V=K((e=B)=>e?oo(e):[]),ae=K(()=>h?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(B,yi(qn(B)))&&V().length===0&&!C&&na(e)}return Z(qn(B),`keydown`,e)},[r,B,c,C,V]),J.useEffect(()=>{if(r||!g)return;let e=qn(B);function t(){N.current=!1}function n(e){let t=xi(e),n=ae(),r=Q(v,t)||Q(_,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,bi(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,z.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Jr(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,B,g,A,z,ae]),J.useEffect(()=>{if(r||!l)return;let e=qn(B);function n(){M.current=!0,z.start(0,()=>{M.current=!1})}function i(e){let t=xi(e);io(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=xi(n);c&&r==null&&a!=null&&Q(v,a)&&Ts(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(Lo(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,bs(f),bs(d)].includes(r),m=!(Q(_,r)||Q(v,r)||Q(r,v)||Q(A?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||k&&(ho(k.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||go(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,ta(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&B&&Os(B),s&&i!==_&&!Wa(a)&&yi(e)===e.body){if(Wt(B)&&(B.focus(),s===`popup`)){re.request(()=>{B.focus()});return}let e=V(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;Wt(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==Es())&&(j.current=!0,t.setOpen(!1,$(ko,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ne.start(0,()=>{b.current.insideReactTree=!1}))}let u=Wt(_)?_:null;if(v||u)return Jr(u&&Z(u,`focusout`,a),u&&Z(u,`pointerdown`,n),v&&Z(v,`focusin`,i),v&&Z(v,`focusout`,a),v&&A&&Z(v,`focusout`,o,!0))},[r,_,v,B,c,k,A,t,l,s,V,C,x,b,ne,z,re,d,f,ae]),J.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Lo(`portal`)}]`)||[]),t=(k?go(k.nodesRef.current,x()):[]).find(e=>$i(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xo([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,bs(f),bs(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Xo([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,ae]),q(()=>{if(!g||r||!Wt(B))return;F.current=``,I.current=``;let e=qn(B),t=yi(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():bs(r),o||=a();let s=Q(B,yi(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&ia(c);zo(o,{sync:l,preventScroll:o===B,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=yi(e);return!(t!==o&&Q(B,t))}})})},[r,g,B,V,w,D,O,b]);let oe=J.useRef(null);q(()=>{if(r||!B){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=qn(B),t=yi(e),n=D.current==null;Ts(t);function i(e){if(e.open||(F.current=xs(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Lo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(ia(e.nativeEvent)||aa(e.nativeEvent))j.current=!1;else{let e=!1;qn(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&mn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Es()||null,typeof i==`boolean`?s:bs(i)||s||null}return()=>{y.off(`openchange`,i);let t=yi(e),n=ae(),r=Q(v,t)||n.some(e=>e===t||Q(e,t))||k&&ho(k.nodesRef.current,x(),!1).some(e=>Q(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=Ds(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&Wt(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,B,T,E,D,y,k,_,x,ae]),q(()=>{if(!ui||g||!v)return;let e=yi(qn(v));Wt(e)&&Zi(e)&&Q(v,e)&&e.blur()},[g,v]),q(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),q(()=>{if(!r&&B)return Os(B),()=>{queueMicrotask(ws)}},[r,B]);let se=!r&&(!c||!C)&&(ie||c);return(0,Y.jsxs)(J.Fragment,{children:[se&&(0,Y.jsx)(vi,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=V();zo(e[e.length-1])}else A?.portalNode&&(j.current=!1,fo(e,A.portalNode)?co(_)?.focus():bs(f??A.beforeOutsideRef)?.focus())}}),n,se&&(0,Y.jsx)(vi,{"data-type":`inside`,ref:te,onFocus:e=>{c?zo(V()[0]):A?.portalNode&&(l&&(j.current=!0),fo(e,A.portalNode)?lo(_)?.focus():bs(d??A.afterOutsideRef)?.focus())}})]})}function As(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=yo}=t,l=e.context.dataRef,u=J.useRef(void 0),d=_i(),f=Qr(),p=J.useMemo(()=>{function t(t,n,r,i){let a=$(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=oa(e.pointerType,!0)&&aa(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||oa(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=xi(s),p=Zi(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:oa(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return J.useMemo(()=>n?{reference:p}:ln,[n,p])}function js(){return!1}function Ms(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ns(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=js,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=gs(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=K(()=>a),{escapeKey:v,outsidePress:y}=Ms(s),b=J.useRef(!1),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),w=J.useRef(!1),T=J.useRef(``),E=J.useRef(null),D=Qr(),O=Qr(),k=Qr(),A=K(()=>{O.clear(),d.current.insideReactTree=!1}),j=K(e=>{let t=d.current.floatingContext?.nodeId;return(p?ho(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=K(t=>Yi(t,e.select(`floatingElement`))||Yi(t,e.select(`domReferenceElement`))),N=K(t=>{o()&&e.setOpen(!1,$(yo,t.nativeEvent))}),P=K(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ra(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=$(Ao,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=K(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=K(t=>{if(!l||!n||t.button!==0)return;let r=xi(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=K(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});J.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>A,[A]),J.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Zr,i=qn(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(ui?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&ho(p.nodesRef.current,t).some(t=>Yi(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=xi(n),i=`[${Lo(`inert`)}]`,a=Vt(r)?r.getRootNode():null,o=Array.from((Lt(a)?a:qn(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=Vt(r)?r:null;for(;c&&!qt(c);){let e=Jt(c);if(qt(e)||!Vt(e))break;c=e}if(!(o.length&&Vt(r)&&!Xi(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(Wt(r)&&!(`touches`in n)){let e=qt(r),t=$t(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!ia(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,$(So,n)),A())}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=xi(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function ee(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function te(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function ne(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function z(e){L(e,ne)}function re(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ie(e){L(e,re)}let B=Jr(r&&Jr(Z(i,`keydown`,P),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&Jr(Z(i,`click`,ee,!0),Z(i,`pointerdown`,ee,!0),Z(i,`pointerup`,te,!0),Z(i,`pointercancel`,te,!0),Z(i,`mousedown`,ee,!0),Z(i,`mouseup`,te,!0),Z(i,`touchstart`,R,{capture:!0,passive:!0}),Z(i,`touchmove`,z,{capture:!0,passive:!0}),Z(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{B(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=J.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),ee=J.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return J.useMemo(()=>n?{reference:R,floating:ee,trigger:R}:{},[n,R,ee])}function Ps(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Vt(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Fs(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=gi.request(()=>{a(`ending`)});return()=>{gi.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=gi.request(()=>{a(void 0)});return()=>{gi.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=gi.request(()=>{a(`idle`)});return()=>{gi.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Is(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Ls=null;function Rs(e){if(!Ls){let e=[];Ls=e,queueMicrotask(()=>{Ls=null,Jn.flushSync(()=>{for(let t of e)t()})})}Ls.push(e)}function zs(e,t=!1,n=!1){let r=_i();return K((i,a=null)=>{r.cancel();let o=bs(e);if(o==null)return;let s=o,c=()=>{n?Rs(()=>{a?.aborted||i()}):Jn.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Is(s).map(e=>e.finished.then(yn))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Is(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Oi;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Bs(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=zs(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Vs(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=K(i),{mounted:c,setMounted:l,transitionStatus:u}=Fs(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),p=J.useRef(!1),m=Zo(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=K(()=>{f.current&&(t?(p.current=!0,m()):h())});return Bs({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Hs={tabIndex:-1,[Si]:``};function Us({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Ws(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Gs(e,t){let n=J.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ws(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ws(t))})}function Ks(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function qs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Js(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Gs(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ys(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=$(vo);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Xs(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Vs({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Rt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Zs(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln})},[e])}var Qs=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},$s={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},ec=class extends qr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ds(),nested:n,triggerElements:i},$s),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&sa(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function tc(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ec({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln}}var nc=e=>e.triggerIdProp??e.activeTriggerId,rc=e=>e.openProp??e.open,ic=e=>(e.popupElement?.id??e.floatingId)||void 0;function ac(e,t){return t!==void 0&&rc(e)&&nc(e)===t}function oc(e,t){return ac(e,t)?!0:t!==void 0&&rc(e)&&nc(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var sc={open:rc,mounted:e=>e.mounted,transitionStatus:e=>rc(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nc,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:ic,isTriggerActive:(e,t)=>t!==void 0&&nc(e)===t,isOpenedByTrigger:(e,t)=>ac(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nc(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>oc(e,t)?ic(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function cc(e){let t=J.useCallback(t=>e===void 0?yn:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,zr.useSyncExternalStore)(t,n,()=>e?.serverStore)}function lc(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ts(),a=hs()!=null,o=Rt(()=>new ec({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Qs,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Vt(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var uc=ci&&ui;function dc(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=J.useRef(!1),s=J.useRef(null),c=J.useRef(!0),l=Qr();J.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Yt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Wt(t)&&t===yi(qn(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Jr(Z(r,`blur`,i),uc&&Z(r,`keydown`,a,!0),uc&&Z(r,`pointerdown`,l,!0))},[e,n]),J.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Vt(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=J.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=xi(n.nativeEvent);if(Vt(a)){if(uc&&!n.relatedTarget){if(!c.current&&!Zi(a))return}else if(!ea(a))return}let u=Ji(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,$(xo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,$(xo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Vt(r)&&r.hasAttribute(Lo(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=yi(qn(t));!r&&n===t||Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||Ji(r??n,e.context.triggerElements)||e.setOpen(!1,$(xo,i))})}}},[a,r,e,l]);return J.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var fc=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Zr;restTimeout=new Zr;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},pc=new WeakMap;function mc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&pc.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),pc.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function hc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=pc.get(n);a&&a!==e&&mc(a),mc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,pc.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function gc(e){let t=e.context.dataRef.current,n=Rt(()=>t.hoverInteractionState??fc.create()).current;return t.hoverInteractionState||=n,Yr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function _c(e,t){return t!=null&&!oa(t)?0:typeof e==`function`?e():e}function vc(e,t,n){let r=_c(e,n);return typeof r==`number`?r:r?.[t]}function yc(e){return typeof e==`function`?e():e}function bc(e,t){return t||e===`click`||e===`mousedown`}function xc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Sc(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=gs(),u=hs(),d=gc(e),f=Qr(),p=K(()=>bc(c.current.openEvent?.type,d.interactedInside)),m=K(()=>xc(c.current.openEvent?.type)),h=K(()=>{mc(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),J.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Vt(s)&&o){let e=s,t=o,n=qn(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??bi(e,`[data-rootownerid]`)??n.body;return hc(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),J.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ho(l.nodesRef.current,u).length>0)}function a(t){let n=vc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,$(bo,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=xi(e);Qi(t)?d.interactedInside=bi(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ji(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Vt(o)&&ho(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,$(bo,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Jr(y&&Z(y,`mouseenter`,g),y&&Z(y,`mouseleave`,_),y&&Z(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Cc={current:null};function wc(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Cc,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=gs(l),v=gc(e),y=J.useRef(!1),b=Dr(i),x=Dr(r),S=Dr(o),C=Dr(n),w=Dr(p),T=Dr(f),E=K(()=>bc(h.current.openEvent?.type,v.interactedInside)),D=K(()=>w.current?.()!==!1),O=K((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!Vt(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=K(()=>{v.handler&&=(qn(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=K(()=>{mc(v)});return u&&(v.handleCloseOptions=i?.__options),J.useEffect(()=>k,[k]),J.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===bo,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),J.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=vc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,$(bo,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,$(bo,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Vt(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!oa(v.pointerType))return;let n=yc(S.current),r=vc(x.current,`open`,v.pointerType),i=xi(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Vt(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}Vt(o)&&Vt(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&Vt(c)&&Vt(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,$(bo,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,$(bo,t,c))}):g&&D()&&e.setOpen(!0,$(bo,t,c)))}function o(n){if(E()){A();return}k();let r=qn(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ji(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&Q(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Z(r,`mouseout`,l):void 0;return s?Jr(Z(r,`mousemove`,i,{once:!0}),Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f):Jr(Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),J.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!oa(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;hc(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=yc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,$(bo,n,r))}v.pointerType===`touch`?Jn.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function Tc(e){return ui&&e.movementX===0&&e.movementY===0}function Ec(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Dc(e,t){return Ec(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Oc(e,t,n){return Ec(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function kc(e,t,n){return Ec(t,n?e===wi:e===Ti,e===Di)}function Ac(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ec(t,n?e===Ti:e===wi,e===Ei)}function jc(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=ta(E),A=$i(D),j=Dr(k),M=hs(),N=gs(x),P=J.useRef(f),F=J.useRef(o??-1),I=J.useRef(null),L=J.useRef(!0),R=K(e=>{i(F.current===-1?null:F.current,e)}),ee=J.useRef(!!E),te=J.useRef(T),ne=J.useRef(!1),z=J.useRef(!1),re=J.useRef(null),ie=Dr(h),B=Dr(T),V=Dr(o),ae=Dr(b),oe=_i(),se=_i(),ce=K(()=>{oe.cancel();function e(e){d||(re.current=zo(e,{sync:ne.current,preventScroll:!0}))}let t=n.current[F.current],r=z.current;t&&e(t),(ne.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{O.current.orientation=g},[O,g]),q(()=>{T||(I.current=null),T&&f===`auto`||(P.current=f)},[T,f]),q(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(z.current=!0,R())):ee.current&&(F.current=-1,R()))},[a,T,E,o,R]),q(()=>{if(a){if(!T)ne.current=!1;else if(E){if(r==null){if(ne.current=!1,V.current!=null)return;if(ee.current&&(F.current=-1,ce()),(!te.current||!ee.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>se.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||Oc(I.current,_,u)||l?La(n):Ra(n),I.current=null,R())};t()}}else Ia(n.current,r)||(F.current=r,ce(),z.current=!1)}}},[a,T,E,r,V,l,n,_,u,R,ce,se]),q(()=>{if(!a||E||!N||d||!ee.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=yi(qn(D??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),q(()=>{te.current=T,ee.current=!!E});let le=r!=null,H=K(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=K(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=K(()=>La(n,ie.current)),fe=K(t=>{if(L.current=!1,ne.current=!0,t.which===229||!B.current&&t.currentTarget===j.current)return;if(l&&Ac(t.key,g,u,w)){Dc(t.key,ue())||na(t),e.setOpen(!1,$(jo,t.nativeEvent));let n=S?.current??D;Wt(n)&&n.focus();return}r!=null&&r!==F.current&&!Ia(n.current,r)&&(F.current=r);let i=F.current,a=La(n,h),o=Ra(n,h);if(A||(t.key===`Home`&&(na(t),F.current=a,R(t)),t.key===`End`&&(na(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(Dc(t.key,g)){na(t);let e=yi(t.currentTarget.ownerDocument);if(T&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){F.current=Oc(t.key,g,u)?a:o,R(t),r===F.current&&ce();return}let{index:l,wrapped:f}=za(n.current,i,{decrement:!Oc(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ne.current=!1),F.current=l,R(t)}}),pe=J.useMemo(()=>({onFocus(e){ne.current=!0,H(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Tc(e)||(ne.current=!0,z.current=!1,p&&H(e))},onPointerLeave(e){if(!B.current||!L.current||e.pointerType===`touch`)return;ne.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(re.current?.(),re.current=null,F.current=-1,R(e),!d)){let e=j.current,t=yi(qn(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[H,B,j,p,n,R,ae,d]),U=J.useMemo(()=>d&&T&&le&&{"aria-activedescendant":`${y}-${r}`},[d,T,le,y,r]),me=J.useMemo(()=>({...A?{}:U,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=xi(t.nativeEvent);if(n&&!Q(j.current,n))return;na(t);let r=$(ko,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&Wt(i)&&i.focus()}else fe(t)},onPointerMove(e){Tc(e)||(L.current=!0)}}),[U,fe,j,A,e,T,d,D,S]),he=J.useMemo(()=>{function t(t){e.setOpen(!0,$(jo,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&ia(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&aa(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=kc(n.key,ue(),u),o=Dc(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Zi(n.currentTarget)))return fe(n);if(r||m||!i){if(s){let e=Dc(n.key,ue());I.current=l&&e?null:n.key}l?a&&(na(n),r?(F.current=de(),R(n),d&&j.current?.focus()):t(n)):o&&(V.current!=null&&(F.current=V.current),na(n),!r&&m?t(n):fe(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[fe,f,de,l,R,e,m,g,_,ue,u,V,d,j]),ge=J.useMemo(()=>({...U,...he}),[U,he]);return J.useMemo(()=>a?{reference:ge,floating:me,item:pe,trigger:he}:{},[a,ge,me,he,pe])}function Mc(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=K(s),f=e.useState(`open`),p=Qr(),m=J.useRef(``),h=J.useRef(u??i??-1),g=J.useRef(null),_=K(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Wa(n)||n?.matches(`:disabled`)?!1:o==null||!Ha(cn,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(na(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(na(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=K(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=J.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return J.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Nc=.1,Pc=Nc*Nc,Fc=.5;function Ic(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Lc(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ic(e,t,n,r,i,a)&&(u=!u),Ic(e,t,i,a,o,s)&&(u=!u),Ic(e,t,o,s,c,l)&&(u=!u),Ic(e,t,c,l,n,r)&&(u=!u),u}function Rc(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function zc(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Bc(e={}){let{blockPointerEvents:t=!1}=e,n=new Zr,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Pc;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=xi(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Vt(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&ho(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=zc(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=zc(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=zc(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=zc(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Rc(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Fc/2:Fc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Fc+1,o=C||T?S.bottom-Fc:S.top,s=C?T?S.bottom-Fc:S.top:S.bottom-Fc;M=Lc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Fc/2:Fc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Fc,o=C||T?S.top+Fc:S.bottom,s=C?T?S.top+Fc:S.bottom:S.top+Fc;M=Lc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Fc/2:Fc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Fc+1,o=w||E?S.right-Fc:S.left,s=w?E?S.right-Fc:S.left:S.right-Fc;M=Lc(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Fc/2:Fc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Fc,o=w||E?S.left+Fc:S.right,s=w?E?S.left+Fc:S.right:S.left+Fc;M=Lc(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Vc(e,t,n){let{reference:r,floating:i}=e,a=ba(t),o=xa(t),s=ya(o),c=ga(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=_a(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Hc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ha(t,e),p=Na(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Pa(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Pa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Uc=50,Wc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Hc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Vc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Uc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Vc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Gc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ha(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ga(r),_=ba(o),v=ga(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ja(o)]:Ca(o)),x=p!==`none`;!d&&x&&b.push(...Aa(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Sa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ba(t)||T.every(e=>ba(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ba(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Kc=new Set([`left`,`top`]);async function qc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ga(n),s=_a(n),c=ba(n)===`y`,l=Kc.has(o)?-1:1,u=a&&c?-1:1,d=ha(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ha(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ba(i),p=va(f),m=u[p],h=u[f],g=(e,t)=>ma(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Xc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ha(e,t),u={x:n,y:r},d=ba(i),f=va(d),p=u[f],m=u[d],h=ha(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Kc.has(ga(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Zc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ha(e,t),c=await i.detectOverflow(t,s),l=ga(n),u=_a(n),d=ba(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ca(p-c[m],g),y=ca(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*la(c.left,c.right):S=p-2*la(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Qc(e){let t=$t(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ua(n)!==a||ua(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $c(e){return Vt(e)?e:e.contextElement}function el(e){let t=$c(e);if(!Wt(t))return fa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qc(t),o=(a?ua(n.width):n.width)/r,s=(a?ua(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var tl=fa(0);function nl(e){let t=Yt(e);return!en()||!t.visualViewport?tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Yt(e)}function il(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$c(e),o=fa(1);t&&(r?Vt(r)&&(o=el(r)):o=el(e));let s=rl(a,n,r)?nl(a):fa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Yt(a),t=Vt(r)?Yt(r):r,n=e,i=Xt(n);for(;i&&t!==n;){let e=el(i),t=i.getBoundingClientRect(),r=$t(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Yt(i),i=Xt(n)}}return Pa({width:u,height:d,x:c,y:l})}function al(e,t){let n=It(e).scrollLeft;return t?t.left+n:il(zt(e)).left+n}function ol(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-al(e,n),y:n.top+t.scrollTop}}function sl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zt(r),s=t?Ut(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=fa(1),u=fa(0),d=Wt(r);if((d||!a)&&((mn(r)!==`body`||On(o))&&(c=It(r)),d)){let e=il(r);l=el(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ol(o,c):fa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ll(e){let t=It(e),n=e.ownerDocument.body,r=la(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=la(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+al(e),o=-t.scrollTop;return $t(n).direction===`rtl`&&(a+=la(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ul=25;function dl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Yt(e),a=zt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!en()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(al(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ul&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fl(e,t){let n=il(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=el(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dl(e,n,t);else if(t===`document`)r=ll(zt(e));else if(Vt(t))r=fl(t,n);else{let n=nl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Pa(r)}function ml(e,t){let n=t.get(e);if(n)return n;let r=pn(e,[],!1).filter(e=>Vt(e)&&mn(e)!==`body`),i=null,a=$t(e).position===`fixed`,o=a?Jt(e):e;for(;Vt(o)&&!qt(o);){let e=$t(o),t=Zt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Jt(o)}return t.set(e,r),r}function hl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ut(t)?[]:ml(t,this._c):[].concat(n),r],o=pl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pl(t,a[e],i);s=la(n.top,s),c=ca(n.right,c),l=ca(n.bottom,l),u=la(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gl(e){let{width:t,height:n}=Qc(e);return{width:t,height:n}}function _l(e,t,n){let r=Wt(t),i=zt(t),a=n===`fixed`,o=il(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=fa(0);if((r||!a)&&((mn(t)!==`body`||On(i))&&(s=It(t)),r)){let e=il(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=al(i));let l=i&&!r&&!a?ol(i,s):fa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function vl(e){return $t(e).position===`static`}function yl(e,t){if(!Wt(e)||$t(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function bl(e,t){let n=Yt(e);if(Ut(e))return n;if(!Wt(e)){let t=Jt(e);for(;t&&!qt(t);){if(Vt(t)&&!vl(t))return t;t=Jt(t)}return n}let r=yl(e,t);for(;r&&tn(r)&&vl(r);)r=yl(r,t);return r&&qt(r)&&vl(r)&&!Zt(r)?n:r||Bt(e)||n}var xl=async function(e){let t=this.getOffsetParent||bl,n=this.getDimensions,r=await n(e.floating);return{reference:_l(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sl(e){return $t(e).direction===`rtl`}var Cl={convertOffsetParentRelativeRectToViewportRelativeRect:sl,getDocumentElement:zt,getClippingRect:hl,getOffsetParent:bl,getElementRects:xl,getClientRects:cl,getDimensions:gl,getScale:el,isElement:Vt,isRTL:Sl};function wl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tl(e,t,n){let r=null,i,a=zt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=da(d),h=da(a.clientWidth-(u+f)),g=da(a.clientHeight-(d+p)),_=da(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:la(0,ca(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Yt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function El(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$c(e),u=i||a?[...l?pn(l):[],...t?pn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?il(e):null;c&&g();function g(){let t=il(e);h&&!wl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dl=Jc,Ol=Yc,kl=Gc,Al=Zc,jl=Xc,Ml=(e,t,n)=>{let r=new Map,i=n??{},a={...Cl,...i.platform,_c:r};return Wc(e,t,{...i,platform:a})},Nl=typeof document<`u`?J.useLayoutEffect:function(){};function Pl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Pl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Il(e,t){let n=Fl(e);return Math.round(t*n)/n}function Ll(e){let t=J.useRef(e);return Nl(()=>{t.current=e}),t}function Rl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);Pl(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=Ll(c),D=Ll(i),O=Ll(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ml(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Pl(w.current,t)&&(w.current=t,Jn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Nl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Nl(()=>(A.current=!0,()=>{A.current=!1}),[]),Nl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Il(M.floating,u.x),r=Il(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var zl=(e,t)=>{let n=Dl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bl=(e,t)=>{let n=Ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vl=(e,t)=>({fn:jl(e).fn,options:[e,t]}),Hl=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ul=(e,t)=>{let n=Al(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Wl(e,t,n,r,i,a,o,s,c,l=2){let u=Va(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Ia(n.current,u)?void 0:u}function Gl(e){return e==null?vo:e.type.startsWith(`key`)?Mo:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?No:vo}var Kl=J.createContext(void 0),ql=J.createContext(void 0),Jl=J.createContext(void 0),Yl=J.createContext(!1),Xl=J.createContext(``);function Zl(){let e=J.useContext(Kl);if(!e)throw Error(Dn(22));return e}function Ql(){let e=J.useContext(ql);if(!e)throw Error(Dn(23));return e}function $l(){let e=J.useContext(Jl);if(!e)throw Error(Dn(24));return e}function eu(){return J.useContext(Xl)}function tu(){return J.useContext(Yl)}function nu(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var ru=(e,t)=>Object.is(e,t);function iu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function au(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!nu(e,t,(e,t)=>iu(e,t,n)):e!==t}function ou(e,t,n){return e?e.some(e=>e!==void 0&&iu(t,e,n)):!1}function su(e,t,n){return e?e.findIndex(e=>e!==void 0&&iu(e,t,n)):-1}function cu(e,t){if(t!==ru)return n=>ou(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function lu(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(cu(t,n)):su(e,t,n);return i===-1?null:i}function uu(e,t,n,r,i,a){return ou(r,t,i)?a!=null&&e>a&&ou(r,n[a],i)?a:e:e===a?lu(n,r,i,!0):a}function du(e,t,n){return e.filter(e=>!iu(t,e,n))}function fu(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function pu(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function mu(e){return pu(e?.[0])}function hu(e){return mu(e)?e.flatMap(e=>e.items):e}function gu(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(mu(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function _u(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return fu(e)}function vu(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?fu(e.value):fu(e)}var yu={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?gu(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>iu(t,e,n)):iu(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},bu=`data-valid`,xu=`data-invalid`,Su={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Cu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},wu={disabled:!1,...Cu},Tu={valid(e){return e===null?null:e?{[bu]:``}:{[xu]:``}}},Eu={invalid:void 0,name:void 0,validityData:{state:Su,errors:[],error:``,value:``,initialValue:null},setValidityData:yn,disabled:void 0,setTouched:yn,setDirty:yn,setFilled:yn,setFocused:yn,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:wu,registerFieldControl:yn,validation:{getValidationProps:(e,t=ln)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:yn,getInputControl:()=>null,commit:async()=>{},change:yn}},Du=J.createContext(Eu);function Ou(e=!0){let t=J.useContext(Du);if(t.setValidityData===yn&&!e)throw Error(Dn(28));return t}function ku(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Ou(),s=Rt(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Au=J.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:yn,validationMode:`onSubmit`,submitCountRef:{current:0}});function ju(){return J.useContext(Au)}function Mu(e){return ts(e,`base-ui`)}var Nu=J.createContext({controlId:void 0,registerControlId:yn,resetControlId:yn,labelId:void 0,setLabelId:yn,messageIds:[],setMessageIds:yn,getDescriptionProps:e=>e});function Pu(){return J.useContext(Nu)}function Fu(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Pu(),o=Mu(),s=Rt(()=>Symbol()),c=J.useRef(!1),l=J.useRef(!1),u=K(()=>{c.current&&i!==yn&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===yn){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}function Iu(e){return e==null?void 0:`${e}-popup`}function Lu(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Ru(e){return Array.isArray(e)?e.map(e=>Ru(e)).join(`,`):e==null?``:String(e)}var zu=new Map;function Bu(e={}){let{locale:t,...n}=e,r={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...n},i=`${Ru(t)}|${JSON.stringify(r)}`,a=zu.get(i);if(a)return a;let o=new Intl.Collator(t,r),s={contains(e,t,n){if(!t)return!0;let r=_u(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(o.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=_u(e,n);return o.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=_u(e,n),i=t.length;return r.length>=i&&o.compare(r.slice(r.length-i),t)===0}};return zu.set(i,s),s}var Vu=Bu;function Hu(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Uu(e,t){let n=J.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Wu(e,t){let{onClick:n,onPointerDown:r}=Hu(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(ai?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Gu(e){let[t,n]=J.useState(null),r=Wu(e,n);return Uu(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Ku(e,t=!1){let{overflowY:n}=$t(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var qu=Symbol(`none`),Ju={value:qu,index:-1},Yu=J.createContext(void 0);function Xu(){return J.useContext(Yu)?.direction??`ltr`}function Zu(e,t,n){let r=e.get(t);if(r!==void 0||n===ru)return r;for(let[r,i]of e)if(iu(r,t,n))return i}function Qu(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=ru,virtualized:j=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:P=!1,limit:F=-1,autoComplete:I=`list`,formAutoComplete:L,locale:R,submitOnItemClick:ee=!1}=e,{clearErrors:te}=ju(),{setDirty:ne,validityData:z,setFilled:re,name:ie,disabled:B,setTouched:V,setFocused:ae,validationMode:oe,validation:se}=Ou(),ce=Xu(),le=Fu({id:t}),H=Vu({locale:R}),ue=Array.isArray(y)?null:y;if(ue&&typeof ue.label!=`function`)throw Error(Dn(100));let de=ue?ue.data:y,fe=ue?.value,pe=fe?void 0:de,U=J.useMemo(()=>{if(!b||!fe)return;let e=hu(b),t=e.map(fe),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Zu(n,r,i)}}},[b,fe]),me=J.useMemo(()=>ue?e=>ue.label(e,A,e=>{let t=U?.findItem(e,A);return t==null?_u(e,O):ue.itemLabel(t)}):O,[ue,O,U,A]),he=J.useMemo(()=>ue?Object.assign(e=>ue.itemLabel(e),{selected:e=>_u(e,me)}):O,[ue,me,O]);function ge(e){return _u(e,me)}let[_e,ve]=J.useState(!1),[ye,be]=J.useState(null),xe=J.useRef(ye),Se=J.useRef([]),Ce=J.useRef([]),we=J.useRef(null),W=J.useRef(null),Te=J.useRef(null),Ee=J.useRef(null),De=J.useRef(null),Oe=J.useRef(!1),ke=J.useRef(null),Ae=J.useRef(null),je=J.useRef(null),Me=J.useRef(Ju),Ne=J.useRef(null),Pe=J.useRef([]),Fe=J.useRef(null),Ie=B||m,Le=ie??f,Re=u===`multiple`,ze=u===`single`,Be=s!==void 0||o!==void 0,Ve=de!==void 0,He=b!==void 0,Ue;Ue=w===`always`?`always`:w?`input-change`:!1;let[We,Ge]=Tr({controlled:i,default:Re?r??cn:r,name:`Combobox`,state:`selectedValue`}),Ke=J.useMemo(()=>x===null?()=>!0:x===void 0?Lu(H,he):x,[x,H,he]),qe=Rt(()=>Be?o??``:ze?ge(We):``).current,[Je,Ye]=Tr({controlled:s,default:qe,name:`Combobox`,state:`inputValue`}),[Xe,Ze]=Tr({controlled:c,default:l,name:`Combobox`,state:`open`}),Qe=mu(de),$e=!Xe&&ye!==null?ye:String(Je).trim(),et=ze?ge(We):``,tt=ze&&!_e&&$e!==``&&et.length===$e.length&&H.contains(et,$e),nt=tt?``:S??$e,rt=Ve&&He&&tt&&(!ue||ue.hasValue(We,A)),it=J.useMemo(()=>de?hu(de):cn,[de]),at=J.useMemo(()=>{if(b&&!rt)return b;if(!de)return cn;if(Qe){let e=de,t=[],n=0;for(let r of e){if(F>-1&&n>=F)break;let e=F>-1?F-n:1/0,i=nt===``?r.items.slice(0,e):[];if(nt!==``)for(let t of r.items){if(i.length>=e)break;Ke(t,nt,he)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(nt===``)return F>-1?it.slice(0,F):it;let e=[];for(let t of it){if(F>-1&&e.length>=F)break;Ke(t,nt,he)&&e.push(t)}return e},[b,rt,de,Qe,nt,F,Ke,he,it]),ot=J.useMemo(()=>{if(U&&at===b)return U.values;let e=hu(at);return fe?e.map(e=>fe(e)):e},[at,b,U,fe]),G=Rt(()=>{let e=null;return M&&Xe&&Ve&&u!==`none`&&(e=lu(ot,We,A,Re)),new qr({id:le,labelId:void 0,selectedValue:We,open:Xe,items:pe,selectionMode:u,name:Le,form:p,disabled:Ie,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:me,isItemEqualToValue:A,modal:P,autoHighlight:Ue,submitOnItemClick:ee,hasInputValue:Be,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:M,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:ln,id:le,selectionMode:u,disabled:Ie,readOnly:h,isItemEqualToValue:A},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:yn,setOpen:yn,setInputValue:yn,setSelectedValue:yn,setIndices:yn,handleSelection:yn,forceMount:yn,requestSubmit:yn,listRef:Se,labelsRef:Ce,popupRef:we,emptyRef:De,inputRef:W,startDismissRef:Te,endDismissRef:Ee,chipsContainerRef:ke,clearRef:Ae,valuesRef:Pe,pointerDownItemRef:Fe,selectionEventRef:je},yu)}).current,st=u===`none`?Je:We,ct=J.useMemo(()=>u===`none`?st:Array.isArray(We)?We.map(e=>vu(e,k)):vu(We,k),[st,k,u,We]),lt=K(d),ut=K(n),dt=G.useState(`activeIndex`),ft=G.useState(`selectedIndex`),pt=G.useState(`positionerElement`),mt=G.useState(`listElement`),ht=G.useState(`triggerElement`),gt=G.useState(`inputElement`),_t=G.useState(`inputGroupElement`),vt=G.useState(`inline`),yt=G.useState(`inputInsidePopup`),bt=G.useState(`inputOwnsFormValue`),xt=ze&&!yt&&Je===et,St=Dr(ht),{openMethod:Ct,triggerProps:wt}=Gu(Xe),Tt=K(()=>ct);ku(yt?St:W,le,st,Tt,!Ie,f);let Et=K(()=>{de?Ce.current=ot.map(ge):G.set(`forceMounted`,!0)}),Dt=K((e,t,n,r)=>{if(t===-1){if(Me.current===Ju)return;Me.current=Ju}else Me.current={value:e,index:t};lt(e,_o(n,r,{index:t}))}),Ot=K(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),G.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Dt(void 0,-1,r,e.event):Dt(Pe.current[n],n,r,e.event)}),kt=K((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Oe.current=n.reason===Do,n.reason===`input-change`){Xe&&ye!==null&&be(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&ve(!0),Ne.current={hasQuery:e};let n=G.state.listElement;if(!G.state.virtualized&&n){let e=we.current;for(let t of pn(n.firstElementChild??n)){if(!Wt(t)||(e?!Q(e,t):t.getAttribute(`role`)===`dialog`))break;if(Ku(t)){t.scrollTop=0;break}}}e&&Ue&&G.state.activeIndex==null&&(Xe||vt)&&G.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&G.state.inputInsidePopup&&(Ne.current={hasQuery:!1,selection:!0});Ye(t)}}),At=K(e=>{let t=!e&&yt&&!vt&&Je!==``&&(String(Je).trim()===ye||Je===et);!e&&(t||Je===``||xt)&&ve(!1),be(null),t&&kt(``,$(Do))}),[jt,Mt]=J.useState(!1),Nt=K((t,n)=>{if(Xe===t)return;n.reason===`escape-key`&&Ve&&ot.length===0&&!De.current&&n.allowPropagation();let r=n,i=qs(r);if(e.onOpenChange?.(t,r),Ne.current?.hasQuery&&n.reason===`input-change`===n.isCanceled&&(Ne.current=null),!n.isCanceled&&(t&&ye!==null&&At(n.reason===Eo),!t&&_e&&(ze?(vt||be($e),$e===``&&ve(!1)):Re&&(vt||be($e),yt&&Ot({activeIndex:null}),(!yt||vt)&&kt(``,$(Do,n.event,void 0,{isItemPress:n.reason===Co})))),t||Mt(i()),Ze(t),!t&&yt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(V(!0),ae(!1),oe===`onBlur`))){let e=u===`none`?Je:We;se.commit(e)}}),Pt=K((e,t)=>{a?.(e,t),!t.isCanceled&&(Ge(e),(u===`none`&&we.current&&N||ze&&!G.state.inputInsidePopup)&&kt(ge(e),$(t.reason,t.event)))}),Ft=K((e,t)=>{let n=xi(e),r=je.current??e;je.current=null;let i=$(Co,r),a=bi(n,`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Nt(!1,i);else if(Re){let e=Array.isArray(We)?We:[],n=ou(e,t,A),r=n?du(e,t,A):[...e,t];if(Pt(r,i),i.isCanceled||!(W.current&&W.current.value.trim()!==``))return;if(G.state.inputInsidePopup){kt(``,$(Do,i.event,void 0,{isItemPress:!0}));let e=Ne.current;e&&!n&&(e.toggledValue=t)}else Nt(!1,i)}else{if(Pt(t,i),i.isCanceled)return;Nt(!1,i)}}),It=K(()=>{let e=se.inputRef.current?.form??G.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Lt=K(()=>{if(ut?.(!1),ve(!1),be(null),Ot(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Re&&W.current&&W.current.value!==``&&!Oe.current&&kt(``,$(Do)),ze){if(G.state.inputInsidePopup)W.current&&W.current.value!==``&&kt(``,$(Do));else{let e=ge(We);W.current&&W.current.value!==e&&kt(e,$(e===``?Do:vo))}}}),zt=J.useMemo(()=>vt&&pt?{current:bi(pt,`[role="dialog"]`)}:we,[vt,pt]),{mounted:Bt,transitionStatus:Vt,forceUnmount:Ht}=Vs({open:Xe,ref:zt,preventUnmountOnClose:jt,setPreventUnmountOnClose:Mt,onUnmount:Lt});J.useImperativeHandle(e.actionsRef,()=>({unmount:Ht,close:()=>Nt(!1,$(Io))}),[Ht,Nt]),q(function(){let e=xe.current!==null&&ye===null;if(xe.current=ye,Xe&&(!e||!Ve)||(Xe||(Fe.current=null),u===`none`))return;let t=Ve?ot:Pe.current;Ot({selectedIndex:lu(t,We,A,Re)})},[Xe,ye,We,u,Re,Ve,ot,A,Ot]),q(()=>{de&&(Pe.current=ot,Se.current.length=ot.length)},[de,ot]),q(()=>{!Xe&&Ne.current?.hasQuery&&(Ne.current=null)},[Xe]),q(()=>{if(!Xe&&vt&&zt.current){Ne.current=null;return}let e=Ve||He?ot:Pe.current,t=Ne.current;if(t){let n=Xe||vt||G.state.positionerElement?.hidden===!1;if(t.hasQuery){let t=W.current;!Ue||String(Je).trim()===``||vt&&Ue!==`always`&&(!t||yi(t.ownerDocument)!==t)?Ne.current=null:n&&(e[0]!==void 0||!Ve&&!He)&&(G.set(`activeIndex`,0),Ne.current=null)}else if(String(Je).trim()===``&&(Ne.current=null,n)){let e=t.selection;Ue===`always`&&!e&&G.state.selectionMode===`none`&&G.set(`activeIndex`,0),queueMicrotask(()=>{if(!G.state.open&&(!G.state.inline||zt.current)||W.current&&W.current.value.trim()!==``)return;let n=G.state.selectedValue,r=G.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:G.state.selectionMode!==`none`&&n!=null){let e=Ve||He?ot:Pe.current,i=su(e,t.toggledValue,G.state.isItemEqualToValue);G.set(`activeIndex`,i===-1?lu(e,n,G.state.isItemEqualToValue,r):i)}else e?G.set(`activeIndex`,null):Ue===`always`&&G.set(`activeIndex`,0)})}}if(!Xe&&!vt)return;let n=G.state.activeIndex;if(n==null){if(Ue===`always`&&e.length>0){G.set(`activeIndex`,0);return}Dt(void 0,-1,vo);return}if(n>=e.length){Dt(void 0,-1,vo),G.set(`activeIndex`,null);return}let r=e[n],i=Me.current.value,a=i!==qu&&iu(r,i,G.state.isItemEqualToValue);Me.current.index===n&&a||Dt(r,n,vo)},[dt,Ue,Dt,He,Ve,ot,vt,Xe,zt,G,Je]),q(()=>{re(u===`none`?String(Je)!==``:Re?Array.isArray(We)&&We.length>0:We!=null)},[re,u,Je,We,Re]),J.useEffect(()=>{Ve&&Ue&&ot.length===0&&Ot({activeIndex:null})},[Ve,Ue,ot.length,Ot]);function Ut(){Xe&&$e!==``&&$e!==String(qe)&&!xt&&ve(!0)}function Gt(){Xe&&ye!==null&&At(!1)}let Kt=!1;function qt(){!Kt&&Je!==et&&(Kt=!0,kt(et,$(vo)))}function Jt(){u!==`none`&&(te(Le),ne(au(We,z.initialValue,A)),se.change(We),ze&&!Be&&!yt&&qt())}function Yt(){ze&&!Be&&!yt&&!_e&&qt()}function Xt(){u===`none`&&(te(Le),ne(Je!==z.initialValue),se.change(Je))}Uu($e,Ut),Uu(Xe,Gt),Uu(We,Jt),Uu(et,Yt),Uu(de,Yt),Uu(Je,Xt);let Zt=lc({open:vt?!0:Xe,onOpenChange:Nt,elements:{reference:yt?ht:gt,floating:pt}}),Qt=v?`grid`:`listbox`,$t=Xe||vt,en=$t?`true`:`false`,tn=J.useMemo(()=>{let e=gt?.tagName===`INPUT`,t=gt==null||e,n=t||$t,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=en,r[`aria-haspopup`]=Qt,r[`aria-controls`]=$t?mt?.id:void 0,r[`aria-autocomplete`]=h?`none`:I),{reference:r,floating:{role:`presentation`}}},[gt,$t,en,Qt,mt?.id,I,h]),nn=As(Zt,{enabled:!Ie&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:yt?0:100,reason:Oo}),rn=Ns(Zt,{enabled:!Ie&&!vt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:vt?!0:void 0,outsidePress(e){let t=xi(e);return!Q(ht,t)&&!Q(Ae.current,t)&&!Q(ke.current,t)&&!Q(_t,t)}}),an=jc(Zt,{enabled:!Ie,id:le,listRef:Se,activeIndex:dt,selectedIndex:ft,virtual:!0,loopFocus:D,allowEscape:D&&!Ue,focusItemOnOpen:_e||u===`none`&&!Ue?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:ce===`rtl`,disabledIndices:cn,grid:v?Wl:void 0,onNavigate(e,t){(t||Xe||vt&&e===null)&&Vt!==`ending`&&Ot({activeIndex:e,type:Gl(t),event:t?.nativeEvent})}}),sn=J.useMemo(()=>on(an.reference,{onKeyDown(e){v&&G.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},rn.reference,nn.reference,tn.reference),[an.reference,rn.reference,nn.reference,tn.reference,v,G]),un=J.useMemo(()=>on(Hs,rn.floating),[rn.floating]),fn=J.useMemo(()=>on(an.floating,tn.floating),[an.floating,tn.floating]),mn=J.useMemo(()=>{let e=an.item;return{props:e?{...e,onFocus:void 0}:ln,id:le,selectionMode:u,disabled:Ie,readOnly:h,isItemEqualToValue:A}},[an.item,le,u,Ie,h,A]);G.useContextCallback(`setOpen`,Nt),G.useContextCallback(`setInputValue`,kt),G.useContextCallback(`setSelectedValue`,Pt),G.useContextCallback(`setIndices`,Ot),G.useContextCallback(`handleSelection`,Ft),G.useContextCallback(`forceMount`,Et),G.useContextCallback(`requestSubmit`,It),G.useContextCallback(`onOpenChangeComplete`,n),Er(()=>{G.update({inline:M,popupProps:un,listProps:fn,inputProps:sn,triggerProps:wt,itemRoot:mn})});let hn={id:le,selectedValue:We,open:Xe,mounted:Bt,transitionStatus:Vt,items:pe,inline:M,popupProps:un,listProps:fn,inputProps:sn,triggerProps:wt,itemRoot:mn,openMethod:Ct,selectionMode:u,name:Le,form:p,disabled:Ie,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:me,modal:P,autoHighlight:Ue,isItemEqualToValue:A,submitOnItemClick:ee,hasInputValue:Be};q(()=>{G.update({...hn,inputOwnsFormValue:u===`none`&&(M||!G.state.inputInsidePopup)})},[G,...Object.values(hn)]);let gn=dn(_,se.inputRef),_n=J.useMemo(()=>({query:$e,hasItems:Ve,filteredItems:at,flatFilteredValues:ot}),[$e,Ve,at,ot]),vn=J.useMemo(()=>Array.isArray(st)?``:vu(st,k),[st,k]),bn=Re&&Array.isArray(We)&&We.length>0,xn=Re||u===`none`&&bt?void 0:Le,Sn=J.useMemo(()=>!Re||!Array.isArray(We)||!Le?null:We.map(e=>{let t=vu(e,k);return(0,Y.jsx)(`input`,{type:`hidden`,form:p,name:Le,value:t,disabled:Ie},t)}),[Re,We,p,Le,k,Ie]),Cn=(0,Y.jsxs)(J.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...se.getValidationProps(Ie,{onFocus(){yt?ht?.focus():(W.current||ht)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ie||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=$(vo,e.nativeEvent),i=()=>Pe.current.findIndex(e=>vu(e,k).toLowerCase()===n||ge(e).toLowerCase()===n);function a(){if(Re)return;if(u===`none`){kt(t,r);return}let e=i();e===-1&&(e=Pe.current.findIndex((e,t)=>{let r=Ce.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Pe.current[e];a!=null&&Pt?.(a,r)}ze&&(Et(),de&&i()===-1&&G.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:le&&xn==null?`${le}-hidden-input`:void 0,form:p,name:xn,autoComplete:L,disabled:Ie,required:g&&!bn,readOnly:h,value:vn,ref:gn,style:xn?jr:Ar,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]});return(0,Y.jsx)(Kl.Provider,{value:G,children:(0,Y.jsx)(ql.Provider,{value:Zt,children:(0,Y.jsx)(Yl.Provider,{value:Ve,children:(0,Y.jsx)(Jl.Provider,{value:_n,children:(0,Y.jsx)(Xl.Provider,{value:Je,children:Cn})})})})})}function $u(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=J.useState(r??``),[p,m]=J.useState(``);J.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=Vu({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?_u(t,o):``)}return(0,Y.jsx)(Qu,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}var ed=`data-popup-side`,td=`data-list-empty`,nd={...Wi,...Tu,popupSide:e=>e?{[ed]:e}:null,listEmpty:e=>e?{[td]:``}:null};function rd(e,t,n){let{setFocused:r,focusOwnerRef:i}=Ou(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var id=5;function ad(e,t){let n=od(t);return e.clientX>=n.left-id&&e.clientX<=n.right+id&&e.clientY>=n.top-id&&e.clientY<=n.bottom+id}function od(e){let t=e.getBoundingClientRect(),n=Yt(e);if(pi)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function sd(e,t){return e??t}function cd(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function ld(){return $l().filteredItems.length===0}function ud(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function dd(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var fd=J.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,validationMode:f,validation:p}=Ou(),{labelId:m}=Pu(),h=Zl(),g=h.useState(`selectionMode`),_=h.useState(`disabled`),v=h.useState(`readOnly`),y=h.useState(`required`),b=h.useState(`positionerElement`),x=h.useState(`listElement`),S=h.useState(`popupId`),C=h.useState(`triggerProps`),w=h.useState(`inputInsidePopup`),T=h.useState(`id`),E=h.useState(`labelId`),D=h.useState(`open`),O=h.useState(`selectedValue`),k=h.useState(`activeIndex`),A=h.useState(`selectedIndex`),j=h.useState(`hasSelectedValue`),M=Ql(),N=eu(),P=Qr(),F=u||_||a,I=ld(),L=cd(h),R=J.useRef(null),ee=rd(F,R);Fu({id:w?o:void 0});let te=w?o??T:o,ne=sd(m,E),z;D&&w?z=S??Iu(T):D&&(z=x?.id);let re=J.useRef(``);function ie(e){re.current=e.pointerType}let{reference:B}=Mc(M,{enabled:!D&&!v&&!_&&g===`single`,listRef:h.context.labelsRef,activeIndex:k,selectedIndex:A,onMatch(e){let t=h.context.valuesRef.current[e];t!==void 0&&h.context.setSelectedValue(t,$(vo))}}),{reference:V}=As(M,{enabled:!_,event:`mousedown`}),{buttonRef:ae,getButtonProps:oe}=un({native:i,disabled:F}),se={...l,readOnly:v,open:D,disabled:F,popupSide:L,listEmpty:I,placeholder:g!==`none`&&!j},ce=K(e=>{h.set(`triggerElement`,e)});return hn(`button`,e,{ref:[t,ae,R,ce],state:se,props:[C,V,B,{id:te,tabIndex:w?0:-1,role:w?`combobox`:void 0,"aria-expanded":D,"aria-haspopup":w?`dialog`:`listbox`,"aria-controls":z,"aria-required":w&&y||void 0,"aria-readonly":w&&v||void 0,"aria-labelledby":ne,onPointerDown:ie,onPointerEnter:ie,onFocus(){ee(!0),!F&&P.start(0,h.context.forceMount)},onBlur(e){if(!Q(b,e.relatedTarget)&&(d(!0),ee(!1),f===`onBlur`)){let e=g===`none`?N:O;p.commit(e)}},onMouseDown(e){if(F||(w||M.set(`domReferenceElement`,e.currentTarget),h.context.forceMount(),re.current!==`touch`&&(h.context.inputRef.current?.focus(),w||e.preventDefault()),D))return;let t=qn(e.currentTarget);function n(e){let t=h.state.triggerElement;if(!t)return;let n=xi(e),r=h.state.positionerElement,i=h.state.listElement;Q(t,n)||Q(r,n)||Q(i,n)||ad(e,t)||h.context.setOpen(!1,$(Po,e))}w&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(na(e),h.context.setOpen(!0,$(jo,e.nativeEvent)),h.context.inputRef.current?.focus())}},p.getValidationProps(F,c),oe],stateAttributesMapping:nd})}),pd=J.createContext(void 0);function md(){return J.useContext(pd)}var hd=J.createContext(void 0);function gd(e){let t=J.useContext(hd);if(t===void 0&&!e)throw Error(Dn(21));return t}var _d=J.forwardRef(function(e,t){let n=Zl(),{buttonRef:r,getButtonProps:i}=un({native:!1}),a=dn(t,r);function o(e){n.context.setOpen(!1,$(wo,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:jr})}),vd=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,validationMode:d,validation:f}=Ou(),{labelId:p}=Pu(),m=md(),h=!!gd(!0),g=Zl(),_=eu(),v=Xu(),y=g.useState(`required`),b=g.useState(`disabled`),x=g.useState(`readOnly`),S=g.useState(`name`),C=g.useState(`form`),w=g.useState(`selectionMode`),T=g.useState(`autoHighlight`),E=g.useState(`inputProps`),D=g.useState(`triggerProps`),O=g.useState(`open`),k=g.useState(`mounted`),A=g.useState(`selectedValue`),j=g.useState(`id`),M=g.useState(`inline`),N=g.useState(`modal`),P=!!T,F=cd(g),I=l||b||i,L=ld(),R=rd(I,g.context.inputRef),ee=h||M,te=!ee||N,ne=Mu(a??(ee?void 0:j)),z=h?Cu:c,[re,ie]=J.useState(null),B=J.useRef(!1),V=J.useRef(null);q(()=>{O||(V.current=null)},[O]);let ae=w===`none`&&!h,oe=K(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.context.setInputValue(``,$(vo)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ae})}),se=h?s:f.getValidationProps(I,s);function ce(e){g.context.setIndices({activeIndex:null,selectedIndex:null,type:Gl(e),event:e})}let le={...z,open:O,disabled:I,readOnly:x,popupSide:F,listEmpty:L};function H(e){if(!m)return;let t,n=m.chipsRef.current.length,[r]=ud(v);return e.key===r&&(e.currentTarget.selectionStart??0)===0&&A.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}let ue=hn(`input`,e,{state:le,ref:[t,g.context.inputRef,oe],props:[E,D,{value:re??_,"aria-readonly":x||void 0,"aria-required":y||void 0,"aria-labelledby":p,disabled:I,readOnly:x,required:w===`none`?y:void 0,form:C,...ae&&S&&{name:S},id:ne,onFocus(){if(R(!0),!M)return;let e=V.current;V.current=null,e!=null&&Object.hasOwn(g.context.valuesRef.current,e)&&g.context.setIndices({activeIndex:e})},onBlur(){u(!0),R(!1);let e=g.state.activeIndex;if(M&&e!==null&&T!==`always`&&(V.current=e,g.context.setIndices({activeIndex:null})),d===`onBlur`){let e=w===`none`?_:A;f.commit(e)}},onCompositionStart(e){si||(B.current=!0,ie(e.currentTarget.value))},onCompositionEnd(e){B.current=!1;let t=e.currentTarget.value;ie(null),g.context.setInputValue(t,$(Eo,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=B.current||!r;function a(e){!x&&!I&&e&&i&&(g.context.setOpen(!0,$(Eo,t)),P||ce(t))}if(B.current){let n=e.currentTarget.value;ie(n),n===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.context.setOpen(!1,$(Do,t));let r=n.trim(),i=P&&r!==``;a(r),O&&g.state.activeIndex!==null&&!i&&ce(t);return}let o=$(Eo,t);if(g.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=$(Do,t);s&&!g.state.inputInsidePopup&&(w===`single`&&g.context.setSelectedValue(null,c),g.state.openOnInputClick||g.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),O&&g.state.activeIndex!==null&&!P&&ce(t)},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(I||x){x&&e.key===`Enter`&&O&&g.state.activeIndex!==null&&na(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=v===`rtl`;if(e.key===`Home`){na(e);let n=di&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){na(e);let i=di&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!k&&e.key===`Escape`){let t=w===`multiple`&&Array.isArray(A)?A.length===0:A===null,n=$(Ao,e.nativeEvent),r=w===`multiple`?[]:null;g.context.setInputValue(``,n),g.context.setSelectedValue(r,n),t||g.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&Array.isArray(A)&&A.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:A.length-1,r=A.filter((e,t)=>t!==n);ce(e.nativeEvent),g.context.setSelectedValue(r,$(vo,e.nativeEvent));return}let i=H(e);if(i!==void 0&&m?.chipsRef.current[i]?.focus(),e.which!==229&&e.key===`Enter`&&O){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(M)return;g.context.setOpen(!1,$(vo,n));return}na(e),dd(g,t,n)}}},se],stateAttributesMapping:nd}),de=h?(0,Y.jsx)(Du.Provider,{value:Eu,children:ue}):ue;return(0,Y.jsxs)(J.Fragment,{children:[O&&te&&(0,Y.jsx)(_d,{ref:g.context.startDismissRef}),de]})}),yd={...Mi,...Ui},bd=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=Ou(),u=Zl(),d=u.useState(`selectionMode`),f=u.useState(`disabled`),p=u.useState(`readOnly`),m=u.useState(`open`),h=u.useState(`selectedValue`),g=u.useState(`hasSelectionChips`),_=eu(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=un({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=Fs(v),T={disabled:y,visible:v,open:m,transitionStatus:C};Bs({open:v,ref:u.context.clearRef,onComplete(){v||w(!1)}});let E=hn(`button`,e,{state:T,ref:[t,b,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=Gl(e);u.context.setInputValue(``,$(To,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t,event:e.nativeEvent}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,$(To,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t,event:e.nativeEvent})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:yd});return o||S?E:null}),xd=J.createContext(null);function Sd(){return J.useContext(xd)}function Cd(e){let{children:t}=e,{filteredItems:n}=$l(),r=Sd(),i=r?r.items:n;return(0,Y.jsx)(J.Fragment,{children:i.map(t)})}var wd=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Td(){return J.useContext(wd)}function Ed(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=J.useState(0),s=Rt(Od).current,c=Rt(Dd).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!jd(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Md(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Ad(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=K(()=>{let[e,t]=kd(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&v()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=K(e=>(s.add(e),()=>{s.delete(e)})),b=J.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(wd.Provider,{value:b,children:t})}function Dd(){return new Map}function Od(){return new Set}function kd(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Md(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Ad(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function jd(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Md(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Nd=J.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=Zl(),l=Ql(),u=!!gd(!0),{filteredItems:d,hasItems:f}=$l(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=K(e=>{c.set(`positionerElement`,e)}),S=K(e=>{c.set(`listElement`,e)}),C=J.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(Cd,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=hn(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;na(e),dd(c,t,e.nativeEvent)}}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,Y.jsx)(Ed,{elementsRef:c.context.listRef,labelsRef:D,children:E})}),Pd=J.createContext(void 0);function Fd(){let e=J.useContext(Pd);if(e===void 0)throw Error(Dn(20));return e}var Id=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Zl(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Y.jsx)(Pd.Provider,{value:n,children:(0,Y.jsx)(us,{ref:t,...r})}):null});function Ld(e){return gn(19)?e:e?`true`:void 0}function Rd(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=J.useState(null),d=J.useRef(null),f=gs(n),p=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Rl({...e,elements:{...p,...l&&{reference:l}}}),h=J.useCallback(e=>{let t=Vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=J.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=J.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=J.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),J.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var zd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ha(e,t)||{};if(l==null)return{};let d=Na(u),f={x:n,y:r},p=xa(i),m=ya(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=ma(D,k,O),j=!c.arrow&&_a(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Bd=(e,t)=>{let{name:n,fn:r}=zd(e);return{name:n,fn:r,options:[e,t]}},Vd={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Hd={sideX:`left`,sideY:`top`},Ud=`--available-width`,Wd=`--available-height`,Gd=`--anchor-width`,Kd=`--anchor-height`,qd=`--transform-origin`,Jd=Ud,Yd=Wd;function Xd(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Zd(e,t,n){let{rects:r,placement:i}=e;return{side:Xd(t,ga(i),n),align:_a(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Qd(e){return $d(e,Rd)}function $d(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=K(O),A=O?k:n,j=Dr(n),M=Dr(g),N=Xu()===`rtl`,[P,F]=J.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?ga(P):null,R=P&&I?_a(P)||`center`:null,ee=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],te=R||o,ne=te===`center`?ee:`${ee}-${te}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let re=+(i===`bottom`),ie=+(i===`top`),B=+(i===`right`),V=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},oe=J.useRef(null),se=Dr(a),ce=Dr(s),le=typeof a==`function`?0:a,H=typeof s==`function`?0:s,ue=[];p&&ue.push(p),ue.push(zl(e=>{let t=Zd(e,i,N),n=typeof se.current==`function`?se.current(t):se.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,H,N,i]));let de=w===`none`&&C!==`shift`,fe=!de&&(u||E||C===`shift`),pe=C===`none`?null:Hl({...ae,padding:{top:z.top+1+re,right:z.right+1+V,bottom:z.bottom+1+ie,left:z.left+1+B},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),U=de?null:Bl({...ae,rootBoundary:D,mainAxis:w!==`none`,crossAxis:fe,limiter:u||E?void 0:Vl(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=ba(ga(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ae,u,E,D,z,w]);C===`shift`||w===`shift`||te===`center`?ue.push(U,pe):ue.push(pe,U),ue.push(Ul({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(Jd,`${t}px`),i.setProperty(Yd,`${n}px`);let a=Yt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Gd,`${u}px`),i.setProperty(Kd,`${d}px`)}}),Bd(e=>({element:oe.current||qn(e.elements.floating).createElement(`div`),padding:oe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=ga(r),u=_a(r),d=ba(l)===`y`,f=oe.current,p=typeof a==`function`?a(Zd(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(qd,d?`${m} ${h}`:`${h} ${m}`),{}}},Vd,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=J.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:be,placement:xe,context:Se,isPositioned:Ce,floatingStyles:we}=t({rootContext:h,open:m?g:void 0,placement:ne,middleware:ue,strategy:r,whileElementsMounted:m?void 0:(...e)=>El(...e,me),nodeId:y,externalTree:S}),{sideX:W,sideY:Te}=ye.adaptiveOrigin||Hd,Ee=Ce?r:`fixed`,De=J.useMemo(()=>{let e;return e=Ce?b?{position:Ee,[W]:_e,[Te]:ve}:{...we,position:Ee}:{position:Ee,top:0,left:0},e[Jd]=`100vw`,e[Yd]=`100vh`,Ce||(e.opacity=0),e},[b,Ee,W,_e,Te,ve,we,Ce]),Oe=J.useRef(null);q(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(ef(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,A,j]),J.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&ef(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,A,j]),J.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return El(ge.reference,ge.floating,be,me)},[m,g,ge,be,me]);let ke=ga(xe),Ae=Xd(i,ke,N),je=_a(xe)||`center`,Me=!!ye.hide?.referenceHidden;q(()=>{x&&g&&Ce&&(ke!==ee||I&&je!==te)&&F(xe)},[x,I,g,Ce,xe,ke,je,ee,te]);let Ne=J.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:oe,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:Se,isPositioned:Ce,update:be}),[De,Ne,oe,Pe,Ae,je,ke,Me,he,Se,Ce,be])}function ef(e){return e!=null&&`current`in e}var tf=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function nf(e){return e===`starting`?ns:ln}function rf(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),hn(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},nf(r),i],stateAttributesMapping:Gi})}var af={},of={},sf=``;function cf(e,t){return On(e)?e:t}function lf(e,t,n){return/hidden|clip/.test(e.getComputedStyle(cf(t,n)).overflowY)}function uf(e){if(typeof document>`u`)return!1;let t=qn(e);return Yt(t).innerWidth-t.documentElement.clientWidth>0}function df(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=qn(e),n=t.documentElement,r=t.body,i=cf(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ff(e){let t=qn(e),n=t.documentElement,r=t.body,i=cf(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function pf(e){let t=qn(e),n=t.documentElement,r=t.body,i=Yt(n),a=0,o=0,s=!1,c=gi.create();if(ui&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,af={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},sf=n.style.scrollBehavior,of={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=cf(n,r);s=df(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,af),Object.assign(r.style,of),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=sf)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var mf=new class{lockCount=0;restore=null;timeoutLock=Zr.create();timeoutUnlock=Zr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=qn(e),n=t.documentElement,r=t.body,i=Yt(n);if(lf(i,n,r)){let t=new i.MutationObserver(()=>{lf(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ai||!uf(e);this.restore=a?ff(e):pf(e)}};function hf(e=!0,t=null){q(()=>{if(e)return mf.acquire(t)},[e,t])}var gf=20;function _f(e,t,n,r){let[i,a]=J.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=qn(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-gf)},[e,t,n]),hf(e&&(!t||i),r)}var vf=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=rs,style:g,..._}=e,v=Zl(),y=Ql(),b=Fd(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=ld(),M=Qd({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});_f(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=K(e=>{v.set(`positionerElement`,e)}),F=rf(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,Y.jsxs)(hd.Provider,{value:M,children:[C&&x&&(0,Y.jsx)(tf,{inert:Ld(!S),cutout:O??D??E}),F]})}),yf={...Gi,...Mi},bf=J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Zl(),l=gd(),u=Ql(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=ld(),x=s.id??(g?Iu(y):void 0);q(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Bs({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S={open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},C=hn(`div`,e,{state:S,ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=xi(e.nativeEvent);p!==`touch`&&(Q(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},nf(h),s],stateAttributesMapping:yf}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,Y.jsx)(ks,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Y.jsxs)(J.Fragment,{children:[C,E&&(0,Y.jsx)(_d,{ref:c.context.endDismissRef})]})})});function xf(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Td(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=J.useRef(null),h=J.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Sf=J.createContext(void 0);function Cf(){let e=J.useContext(Sf);if(!e)throw Error(Dn(19));return e}var wf=J.createContext(!1);function Tf(){return J.useContext(wf)}function Ef(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=J.useRef(null),m=xf({guess:!0,index:l,textRef:p}),h=Zl(),g=Tf(),_=tu(),{props:v,id:y,selectionMode:b,disabled:x,readOnly:S,isItemEqualToValue:C}=h.useState(`itemRoot`),w=x||u,T=b!==`none`,E=l??i??m.index,D=E!==-1,O=h.useState(`isActive`,E),k=h.useState(`isSelected`,c),A=J.useRef(null),j=y!=null&&D?`${y}-${E}`:void 0,M=k&&T;q(()=>{if(!D||!r&&l==null)return;let e=h.context.listRef.current;return e[E]=A.current,()=>{delete e[E]}},[D,r,E,l,h]),q(()=>{if(!D||_)return;let e=h.context.valuesRef.current;return e[E]=c,()=>{delete e[E]}},[D,_,E,c,h]),q(()=>{if(!D||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=uu(E,c,h.context.valuesRef.current,e,C,t):iu(c,e,C)&&(t=E),h.set(`selectedIndex`,t)},[D,_,h,E,c,C]);let{getButtonProps:N,buttonRef:P}=un({disabled:w,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:w,selected:M,highlighted:O};function I(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(Jn.flushSync(t),h.context.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":T?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){w||S||I(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(w||S||e.button!==0||t||!O)&&I(e.nativeEvent)}},R=hn(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[v,L,f,N]}),ee=J.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,Y.jsx)(Sf.Provider,{value:ee,children:R})}function Df(e){let{componentProps:t,forwardedRef:n}=e,r=Zl().useState(`isItemEqualToValue`),{flatFilteredValues:i}=$l(),a=su(i,t.value??null,r);return(0,Y.jsx)(Ef,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var Of=J.memo(J.forwardRef(function(e,t){let n=Zl().useState(`virtualized`);return n&&e.index==null?(0,Y.jsx)(Df,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(Ef,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}));function kf(e){return hn(e.defaultTagName??`div`,e,e)}var Af=J.createContext(void 0);function jf(){let e=J.useContext(Af);if(e===void 0)throw Error(Dn(13));return e}var Mf={imageLoadingStatus:()=>null},Nf=J.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=J.useState(`idle`),c={imageLoadingStatus:o},l=J.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=hn(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:Mf});return(0,Y.jsx)(Af.Provider,{value:l,children:u})});function Pf(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=J.useState(`idle`),s=o[1];return q(()=>{if(!a)return yn;if(!e&&!i)return s(`error`),yn;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var Ff={...Mf,...Mi},If=J.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=jf(),[f,p]=Pf(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=Fs(m),v=J.useRef(null),y=J.useRef(!0);q(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=K(e=>{i?.(e),d(e)});q(()=>{f!==`idle`&&x(f)},[f,x]),q(()=>()=>d(`idle`),[d]),Bs({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=hn(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:Ff,enabled:C});return C?T:null}),Lf=J.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=jf(),[c,l]=J.useState(i===0),u=Qr();return J.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),hn(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:Mf,enabled:s!==`loaded`&&(i===0||c)})});function Rf(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=nn(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Y.jsx)(Nf,{"data-slot":`avatar`,"data-size":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function zf(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`aspect-square size-full rounded-full object-cover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(If,{"data-slot":`avatar-image`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bf(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Lf,{"data-slot":`avatar-fallback`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vf(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Tr({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Fs(a,!0,!0),u=Mu(),[d,f]=J.useState(),p=d===null?void 0:d??u,m=K(e=>{let t=!a,n=$(yo,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return J.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var Hf=J.createContext(void 0);function Uf(){let e=J.useContext(Hf);if(e===void 0)throw Error(Dn(15));return e}var Wf=`data-open`,Gf=`data-closed`,Kf=Oi,qf=`data-panel-open`,Jf={[Wf]:``},Yf={[Gf]:``},Xf={open(e){return e?{[qf]:``}:null}},Zf={open(e){return e?Jf:Yf},...Mi},Qf=J.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=K(o),d=Vf({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=J.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=J.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=hn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Zf});return(0,Y.jsx)(Hf.Provider,{value:p,children:m})}),$f={...Xf,...Mi},ep=J.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Uf(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=un({disabled:c,native:u});return hn(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:$f})}),tp={height:void 0,width:void 0};function np(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=J.useRef(null),f=J.useRef(null),[p,m]=J.useState(tp),h=J.useRef(tp),g=J.useRef(!1),_=J.useRef(s),v=J.useRef(!1),[y,b]=J.useState(!1),x=J.useRef(null),S=dn(t,d),C=Dr(s),w=zs(d),T=!s&&!a,E=y?`idle`:u,D=s&&(_.current||v.current),O=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,k=n&&T&&f.current!==`css-animation`,A=K((e,t=!0)=>{t&&(h.current=e),m(e)}),j=K(()=>{x.current?.(),x.current=null}),M=K(e=>{j(),x.current=()=>{x.current=null,e()}}),N=K(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});q(()=>{y&&u!==`starting`&&b(!1)},[y,u]),J.useEffect(()=>()=>{N(),j()},[N,j]),q(()=>{s||(_.current=!1,v.current=!1);let e=d.current;if(!e)return;!s&&x.current&&j();let t=ip(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=rp(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(rp(e)),b(!0);return}if(t===`css-transition`){let t=sp(e);if(A(rp(e)),!n)return t;let r=op(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(rp(e));let r=op(e,`animation-name`,`none`);if(!n){r();return}let i=op(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){A(tp,!1),c(!1);return}A(rp(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=rp(e);n.height>0||n.width>0?(A(n),t===`css-animation`&&op(e,`animation-name`,`none`)()):c(!1)},[a,s,j,A,c,M,D,u]),Bs({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(tp,!1)}}),J.useEffect(()=>{if(s||!a||E!==`ending`)return;if(!d.current){c(!1),A(tp,!1);return}let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(tp,!1))}return t=gi.request(()=>{w(n,e.signal)}),()=>{gi.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),q(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),J.useEffect(function(){let e=d.current;if(!e)return;let t=Zr.create(),n=-1,r=(r,i)=>{t.start(0,()=>{C.current||(n=gi.request(()=>{C.current||(r&&(g.current=!1),i&&e.setAttribute(Kf,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Z(e,`beforematch`,t=>{let n=$(vo,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(Kf);e.removeAttribute(Kf),l(!0),r(!0,i)});return()=>{t.clear(),gi.cancel(n),i()}},[C,o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[Kf]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function rp(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ip(e,t){let n=Yt(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&ap(n.animationDuration),i=ap(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function ap(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function op(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function sp(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=gi.request(n);return()=>{gi.cancel(r),n()}}var cp=`--collapsible-panel-height`,lp=`--collapsible-panel-width`,up=J.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=Uf(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;q(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=np({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=wn(s,k),j=hn(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[cp]:S===void 0?`auto`:`${S}px`,[lp]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Zf});return E?j:null}),dp=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=J.useRef(null),{transitionStatus:l,setMounted:u}=Fs(o),d=hn(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Mi});return Bs({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),fp=J.forwardRef(function(e,t){let{selected:n}=Cf();return e.keepMounted||n?(0,Y.jsx)(dp,{...e,selected:n,ref:t}):null}),pp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=Ou(),{clearErrors:S,elementRef:C,submitCountRef:w}=ju(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=Pu(),k=Fu({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=K(()=>x.inputRef.current?.value);ku(x.inputRef,k,j,M,!T,a),q(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),Uu(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=J.useRef(null),P=rd(T,N),F=Qr();return hn(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$(vo,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:Tu})}),mp=J.forwardRef(function(e,t){return(0,Y.jsx)(pp,{ref:t,...e})}),hp=J.createContext(void 0);function gp(e){let t=J.useContext(hp);if(t===void 0&&!e)throw Error(Dn(33));return t}var _p=J.createContext(void 0);function vp(e){let t=J.useContext(_p);if(t===void 0&&!e)throw Error(Dn(36));return t}var yp=J.createContext(void 0);function bp(e=!0){let t=J.useContext(yp);if(t===void 0&&!e)throw Error(Dn(25));return t}var xp=J.createContext(null);function Sp(e=`root`){let t=J.useContext(xp),n=J.useContext(_p);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Cp={visible:!0,ref:null};function wp(){return Cp}function Tp(e,t,n=`root`){let r=Sp(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??wp)({label:e.label,children:e.children,render:e.render}),a=dn(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ep(e){e.preventDefault()}function Dp(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=vp(),u=bp(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Ep:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Co})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!ci&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&rn(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Op={type:`regular-item`};function kp(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=un({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Dp({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>on(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=dn(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ap=J.createContext(void 0);function jp(){let e=J.useContext(Ap);if(e===void 0)throw Error(Dn(31));return e}var Mp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(void 0),c=hn(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Y.jsx)(Ap.Provider,{value:s,children:c})}),Np=J.forwardRef(function(e,t){let n=Sp()?.Group??Mp;return(0,Y.jsx)(n,{...e,ref:t})}),Pp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mu(a),c=jp();return q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),hn(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Fp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=vp(),f=xf({guess:!0,label:a}),p=Mu(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=kp({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Op});return hn(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Ip=J.forwardRef(function(e,t){let n=Tp(e,t);return n.visible?(0,Y.jsx)(Fp,{...e,ref:n.ref}):null}),Lp=J.createContext(void 0);function Rp(e){let t=J.useContext(Lp);if(t===void 0&&!e)throw Error(Dn(69));return t}var zp=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Bp=J.createContext(void 0);function Vp(){return J.useContext(Bp)}function Hp(e,t){let n=sn(e.render);if(J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Up(e,t,n){let r=Hp(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Wp(e,t,n){let r=sn(e.render),i=J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Gp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=vp(),m=Vp(),{side:h,align:g}=gp(),_=Rp(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=Up(e,u,d),L=Wp(e,C,N),R=w.type===`menu`?m:void 0,ee=w.type===`context-menu`,te=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(te=()=>l.state.activeIndex===null&&P),Bs({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,$(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Sc(D,{enabled:A&&!j&&!ee&&w.type!==`menubar`,closeDelay:k});let ne=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:z,handleFocus:re}=(J.useContext(xp)?.useParentHandoff??qp)(l,w,v,f),ie={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},B=hn(`div`,e,{state:ie,ref:[t,l.context.popupRef,ne,I],stateAttributesMapping:Ki,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&zp.has(e.key)&&e.stopPropagation()},onFocus:re},nf(y),c,{"data-rootownerid":E}]}),V=w.type===void 0||ee;(C||w.type===`menubar`&&T!==`outside-press`)&&(V=!0);let ae=R?.getReturnElement??z;return(0,Y.jsx)(ks,{context:D,openInteractionType:M,modal:ee,disabled:!x,returnFocus:a??ae??V,explicitReturnFocus:a===void 0&&ae?!1:void 0,initialFocus:te,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:B})}),Kp={parentVirtualFocusRef:void 0,handleFocus:void 0};function qp(){return Kp}var Jp=J.forwardRef(function(e,t){let n=Sp()?.Popup??Gp;return(0,Y.jsx)(n,{...e,ref:t})}),Yp=J.createContext(void 0);function Xp(){let e=J.useContext(Yp);if(e===void 0)throw Error(Dn(32));return e}var Zp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=vp();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(Yp.Provider,{value:n,children:(0,Y.jsx)(us,{ref:t,...r,portalOwnerRole:o})})});function Qp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=zs(r);q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var $p=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=rs,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=vp(),x=Xp(),S=bp(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),ee=n,te=c,ne=l,z=s,re=h;C.type===`context-menu`&&(ee=n??C.context?.anchor,z??=`start`,!o&&z!==`center`&&(ne=e.alignOffset??2,te=e.sideOffset??-5));let ie=o,B=z;C.type===`menu`?(ie??=`inline-end`,B??=`start`,re=e.collisionAvoidance??is):C.type===`menubar`&&(ie??=C.context.orientation===`vertical`?`inline-end`:`bottom`,B??=`start`);let V=C.type===`context-menu`,ae=Qd({anchor:ee,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ie,sideOffset:te,align:B,alignOffset:ne,arrowPadding:V?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:re,shift:V?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,$(Fo)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,$(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let oe=Qr();J.useEffect(()=>{D||oe.clear()},[D,oe]),J.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{v.setOpen(!1,$(Fo))}):v.setOpen(!1,$(Fo))}else oe.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,oe]),J.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),Qp({store:v,domReference:R,positionerElement:M,open:D});let se={open:D,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:C.type===`menu`,instant:N},ce=C.type===`menubar`&&C.context.modal;_f(D&&(ce||O&&F!==`trigger-hover`),k===`touch`,M,A);let le=rf(e,se,{styles:ae.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),H=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=A),(0,Y.jsxs)(hp.Provider,{value:ae,children:[H&&(0,Y.jsx)(tf,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:Ld(!D),cutout:ue}),(0,Y.jsx)(vs,{id:I,children:(0,Y.jsx)(Ed,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:le})})]})}),em=J.createContext(null);function tm(e){let t=J.useContext(em);if(t===null&&!e)throw Error(Dn(5));return t}var nm={...sc,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=sc.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>ui&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!sc.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},rm=class extends qr{constructor(e,t,n=!1){let r=new Qs,i=am(r,t,n,e);super(i,im(r),nm),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function im(e){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function am(e,t,n=!1,r){return{...tc(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:ln,inputProps:ln,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new fs,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ln,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var om=J.createContext(null);function sm(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function cm(e,t){return e===`list-navigation`||sm(e,t)}var lm=Ir(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=bp(!0),C=vp(!0),w=tm(!0),T=C?.store,E=C?.virtualFocus??!1,D=J.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=Mu(),k=Mu(),[A,j]=J.useState(void 0),M=(A??k)||void 0,N=hs(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=Rt(()=>F?P?.state.instantType:void 0).current,L=Rt(()=>{let e=new rm({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),ee=_s(R),te=L.useState(`open`),ne=L.useState(`activeTriggerElement`),z=L.useState(`positionerElement`),re=L.useState(`hoverEnabled`),ie=L.useState(`disabled`),B=L.useState(`lastOpenChangeReason`),V=L.useState(`parent`),ae=L.useState(`activeIndex`),oe=L.useState(`keyboardOpen`),se=L.useState(`payload`),ce=L.useState(`floatingParentNodeId`),le=J.useRef(null),H=J.useRef(V.type!==`context-menu`),ue=Qr(),de=J.useRef(!0),fe=Qr(),pe=ce!=null,{openMethod:U,triggerProps:me}=Gu(te);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:V.type===void 0?c:void 0,openMethod:U,rootId:O}),Ys(L);let{forceUnmount:he,transitionStatus:ge}=Xs(te,L,()=>{L.set(`allowMouseEnter`,!1)},F),_e=zs(L.context.popupRef);J.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!te){e();return}if(ge!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[I,te,ge,_e,L]),q(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:ee,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:ee,floatingParentNodeId:N})},[S,C,ee,N,ne,L]),J.useEffect(()=>{te||(le.current=null),V.type===`context-menu`&&(te?ue.start(500,()=>{H.current=!0}):(ue.clear(),H.current=!1))},[ue,te,V.type]),q(()=>{!te&&!re&&L.set(`hoverEnabled`,!0)},[te,re,L]);let ve=K((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||te===e&&t.trigger===ne&&B===n)return;let i=qs(t);if(!e&&t.trigger==null&&(t.trigger=ne??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=Ks(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&cm(n,a),s.instantType=V.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:sm(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),ye=Ps({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ve}),be=ye.context.events;q(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return be.on(`setOpen`,e),()=>{be?.off(`setOpen`,e)}},[be,ve]),q(()=>L.subscribeToParentMenu(),[L]);let xe=J.useCallback(()=>{L.setOpen(!1,$(Io))},[L]);J.useImperativeHandle(d,()=>({unmount:he,close:xe}),[he,xe]);let Se;V.type===`context-menu`&&(Se=V.context),J.useImperativeHandle(Se?.positionerRef,()=>z,[z]),J.useImperativeHandle(Se?.actionsRef,()=>({setOpen:ve}),[ve]);let Ce=Ns(ye,{enabled:!ie,bubbles:{escapeKey:f&&V.type===`menu`},outsidePress(){return V.type!==`context-menu`||le.current?.type===`contextmenu`||H.current},externalTree:pe?R:void 0}),we=Xu(),W=jc(ye,{enabled:!ie,listRef:L.context.itemDomElements,activeIndex:ae,virtual:v,nested:V.type===`menubar`||!v&&V.type!==void 0,parentOrientation:V.type===`menubar`?V.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?oe:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:we===`rtl`,disabledIndices:cn,onNavigate(e,t){L.setActiveIndex(e,Gl(t),t?.nativeEvent)},openOnArrowKeyDown:V.type!==`context-menu`&&!(v&&_),externalTree:!v&&pe?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Te=J.useCallback(e=>{L.context.typingRef.current=e},[L]),Ee=Mc(ye,{enabled:!ie&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:ae,resetMs:500,onMatch:(e,t)=>{te&&e!==ae&&L.setActiveIndex(e,Mo,t.nativeEvent)},onTyping:Te}),De=K(a),Oe=J.useRef(-1),ke=K(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Oe.current===n&&L.context.reportedItem===t)return;Oe.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=vo,L.context.highlightEvent=void 0,a&&De(t,_o(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});q(()=>{ke()},[ae,ke]);let Ae=J.useMemo(()=>{if(!v)return W.reference;if(!W.trigger)return ln;let{onFocus:e,...t}=W.trigger;return t},[v,W.reference,W.trigger]);L.useSyncedValue(`inputProps`,v?W.reference??ln:ln);let je=J.useMemo(()=>{let e=on(Ee.reference,Ae,Ce.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=te,e},[L,Ee.reference,Ae,Ce.reference,me,te]),Me=J.useMemo(()=>{let e=on(W.trigger,Ce.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[W.trigger,Ce.trigger,me]);Rt(()=>(L.update({inactiveTriggerProps:Me}),null)),Zs(L,{floatingRootContext:ye,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:J.useMemo(()=>on(Hs,{onMouseMove(){L.set(`allowMouseEnter`,!0),V.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,W.floating,Ce.floating),[V.type,L,Ee.floating,W.floating,Ce.floating]),itemProps:W.item??ln});let Ne=J.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:ke}),[L,D,u,l,b,k,v,E,ke]),Pe=typeof t==`function`?t({payload:se}):t,Fe=(0,Y.jsxs)(_p.Provider,{value:Ne,children:[p&&(0,Y.jsx)(Us,{handle:p,store:L}),Pe]});return(V.type===void 0||V.type===`context-menu`)&&(Fe=(0,Y.jsx)(ys,{externalTree:R,children:Fe})),Fe});function um(e){let t=J.useContext(om);if(t===null)return(0,Y.jsx)(lm,{...e});let n=t.Root;return(0,Y.jsx)(om.Provider,{value:null,children:(0,Y.jsx)(n,{...t.options,...e})})}function dm(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Tn(),{ref:i,index:a}=xf(e),o=n===a,s=J.useRef(null),c=dn(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function fm(e){let{render:t,className:n,style:r,state:i=ln,props:a=cn,refs:o=cn,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=dm({metadata:s});return hn(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function pm(e){if(Wt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!qt(e))return pm(Jt(e))}function mm(e,t){function n(n,r,i){let a=n.currentTarget;Jn.flushSync(()=>{e.setOpen(!1,$(ko,n.nativeEvent,a))}),uo(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&fo(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function hm(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,qn(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:ln,[t,n,r])}var gm=Lr(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=vp(!0),h=cc(d)??m?.store;if(!h)throw Error(Dn(85));let g=Mu(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=J.useRef(null),S=vm(),C=Tn(!0),w=gs(),T=J.useMemo(()=>w??new fs,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Js(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:_s(T),floatingParentNodeId:hs(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=un({disabled:A,native:o});J.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=J.useRef(null),P=Qr(),F=K(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(N.current,t)||Q(h.select(`positionerElement`),t)||t===N.current||t!=null&&pm(t)===h.select(`rootId`)||ad(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:Po})});J.useEffect(()=>{let e=qn(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=wc(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:Bc({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=_m(y,h.select(`lastOpenChangeReason`)),ee=As(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),te=dc(v,{enabled:!A&&I}),ne=hm({open:y,enabled:O,mouseDownAction:`open`}),z=J.useMemo(()=>on(te.reference,ee.reference),[te.reference,ee.reference]),re=h.useState(`triggerProps`,D),ie=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:B,handleFocusTargetFocus:V}=mm(h,x),ae={disabled:A,open:y},oe=[N,t,M,E,x],se=[z,L??ln,re,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),qn(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},ie,O?{role:`menuitem`}:{},ne,p,j],ce=hn(`button`,e,{enabled:!O,stateAttributesMapping:Wi,state:ae,ref:oe,props:se});return O?(0,Y.jsx)(fm,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Wi}):y?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(vi,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:B},`${g}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:ce},g),(0,Y.jsx)(vi,{ref:h.context.triggerFocusTargetRef,onFocus:V},`${g}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:ce},g)});function _m(e,t){let n=Qr(),[r,i]=J.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function vm(){let e=tm(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var ym=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return hn(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function bm(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=nn(`h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Y.jsx)(mp,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function xm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Sm=Ht(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Cm(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=nn(Sm({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:wm,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function wm(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}var Tm=Ht(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Em(e){let t=(0,X.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,type:i,variant:a,size:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`button`:i,c=a===void 0?`ghost`:a,l=o===void 0?`xs`:o,u;t[6]!==n||t[7]!==l?(u=nn(Tm({size:l}),n),t[6]=n,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==l||t[11]!==u||t[12]!==s||t[13]!==c?(d=(0,Y.jsx)(Sn,{type:s,"data-size":l,variant:c,className:u,...r}),t[9]=r,t[10]=l,t[11]=u,t[12]=s,t[13]=c,t[14]=d):d=t[14],d}function Dm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(bm,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Om(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=nn(`[&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Mn,{className:`pointer-events-none size-3.5 text-muted-foreground`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(fd,{"data-slot":`combobox-trigger`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function km(e){let t=(0,X.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(Em,{variant:`ghost`,size:`icon-xs`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=nn(n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Kn,{className:`pointer-events-none`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,Y.jsx)(bd,{"data-slot":`combobox-clear`,render:i,className:a,...r,children:o}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function Am(e){let t=(0,X.c)(28),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,disabled:a,showTrigger:o,showClear:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a!==void 0&&a,l=o===void 0||o,u=s!==void 0&&s,d;t[7]===r?d=t[8]:(d=nn(`w-auto`,r),t[7]=r,t[8]=d);let f;t[9]===c?f=t[10]:(f=(0,Y.jsx)(Dm,{disabled:c}),t[9]=c,t[10]=f);let p;t[11]!==i||t[12]!==f?(p=(0,Y.jsx)(vd,{render:f,...i}),t[11]=i,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==c||t[15]!==l?(m=l&&(0,Y.jsx)(Em,{size:`icon-xs`,variant:`ghost`,render:(0,Y.jsx)(Om,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:c}),t[14]=c,t[15]=l,t[16]=m):m=t[16];let h;t[17]!==c||t[18]!==u?(h=u&&(0,Y.jsx)(km,{disabled:c}),t[17]=c,t[18]=u,t[19]=h):h=t[19];let g;t[20]!==m||t[21]!==h?(g=(0,Y.jsxs)(Cm,{align:`inline-end`,children:[m,h]}),t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==n||t[24]!==d||t[25]!==p||t[26]!==g?(_=(0,Y.jsxs)(xm,{className:d,children:[p,g,n]}),t[23]=n,t[24]=d,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function jm(e){let t=(0,X.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,anchor:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`bottom`:a,u=o===void 0?6:o,d=s===void 0?`start`:s,f=c===void 0?0:c,p=!!n,m;t[8]===r?m=t[9]:(m=nn(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[8]=r,t[9]=m);let h;t[10]!==i||t[11]!==p||t[12]!==m?(h=(0,Y.jsx)(bf,{"data-slot":`combobox-content`,"data-chips":p,className:m,...i}),t[10]=i,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==d||t[15]!==f||t[16]!==n||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,Y.jsx)(Id,{children:(0,Y.jsx)(vf,{side:l,sideOffset:u,align:d,alignOffset:f,anchor:n,className:`isolate z-50`,children:h})}),t[14]=d,t[15]=f,t[16]=n,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function Mm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Nd,{"data-slot":`combobox-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nm(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=nn(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(fp,{render:(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Y.jsx)(An,{className:`pointer-events-none`})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(Of,{"data-slot":`combobox-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Pm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(um,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Fm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(gm,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Im(e){let t=(0,X.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=nn(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Y.jsx)(Jp,{"data-slot":`dropdown-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Y.jsx)(Zp,{children:(0,Y.jsx)($p,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function Lm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Np,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function Rm(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=nn(`px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Y.jsx)(Pp,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function zm(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=nn(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Y.jsx)(Ip,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Bm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`-mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(ym,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Hm=U({id:H,name:H,signOut:Ke}),Um=et(Te).atom(me(kt(`/auth/user`),He(oe),He(p(Hm)))),Wm=Pe(st(``));function Gm(){return I(B(_r(Wm)))}function Km(){let e=(0,X.c)(27),t=_r(Um);if(!Mt(t))return null;let n;e[0]===t.value.id?n=e[1]:(n=z(`github:`,``)(t.value.id),e[0]=t.value.id,e[1]=n);let r=`https://avatars.githubusercontent.com/u/${n}?s=96`,i;e[2]!==t.value.name||e[3]!==r?(i=(0,Y.jsx)(zf,{src:r,alt:t.value.name}),e[2]=t.value.name,e[3]=r,e[4]=i):i=e[4];let a;e[5]===t.value.name?a=e[6]:(a=ee(Ze(0,1)(t.value.name)),e[5]=t.value.name,e[6]=a);let o;e[7]===a?o=e[8]:(o=(0,Y.jsx)(Bf,{children:a}),e[7]=a,e[8]=o);let s;e[9]!==i||e[10]!==o?(s=(0,Y.jsx)(Fm,{"aria-label":`Account`,children:(0,Y.jsxs)(Rf,{size:`sm`,children:[i,o]})}),e[9]=i,e[10]=o,e[11]=s):s=e[11];let c;e[12]===t.value.name?c=e[13]:(c=(0,Y.jsx)(Lm,{children:(0,Y.jsxs)(Rm,{children:[`@`,t.value.name]})}),e[12]=t.value.name,e[13]=c);let l;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(Bm,{}),e[14]=l):l=e[14];let u=!t.value.signOut,d;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(d=new URLSearchParams({next:location.href}),e[15]=d):d=e[15];let f=`/auth/sign-out?${d}`,p;e[16]===f?p=e[17]:(p=(0,Y.jsx)(`a`,{"aria-label":`Sign out`,href:f}),e[16]=f,e[17]=p);let m;e[18]!==p||e[19]!==u?(m=(0,Y.jsx)(zm,{variant:`destructive`,disabled:u,render:p,children:`Sign out`}),e[18]=p,e[19]=u,e[20]=m):m=e[20];let h;e[21]!==m||e[22]!==c?(h=(0,Y.jsxs)(Im,{align:`end`,className:`w-auto min-w-48`,children:[c,l,m]}),e[21]=m,e[22]=c,e[23]=h):h=e[23];let g;return e[24]!==h||e[25]!==s?(g=(0,Y.jsxs)(Pm,{children:[s,h]}),e[24]=h,e[25]=s,e[26]=g):g=e[26],g}function qm(e){let t=(0,X.c)(66),[n,r]=br(Wm),[i,a]=(0,J.useState)(!1),o;t[0]===n?o=t[1]:(o=()=>n!==``,t[0]=n,t[1]=o);let[s,c]=(0,J.useState)(o),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=function(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),c(!0),l.current?.focus())};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},f=[],t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,J.useEffect)(d,f);let p,m,h,g,_,v,y,b,x,S,C;if(t[4]!==i||t[5]!==e.commands||t[6]!==e.label||t[7]!==n||t[8]!==s||t[9]!==r){let a;t[21]===n?a=t[22]:(a=e=>Ot(I(B(n)))(I(e.label)),t[21]=n,t[22]=a),m=Me(e.commands,a);let o,d;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{(0,Jn.flushSync)(()=>c(!0)),l.current?.focus()},d=(0,Y.jsx)(Rn,{}),t[23]=o,t[24]=d):(o=t[23],d=t[24]),t[25]===e.label?g=t[26]:(g=(0,Y.jsx)(Sn,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,className:`ml-auto sm:hidden`,onClick:o,children:d}),t[25]=e.label,t[26]=g),C=u;let f=s&&`max-sm:bg-background max-sm:absolute max-sm:inset-0 max-sm:z-10 max-sm:flex max-sm:max-w-none max-sm:items-center max-sm:gap-2 max-sm:px-3`;t[27]===f?h=t[28]:(h=nn(`mx-auto hidden w-full max-w-sm sm:flex lg:absolute lg:left-1/2 lg:-translate-x-1/2`,f),t[27]=f,t[28]=h),p=$u,_=m,v=null,y=Jm,b=n,t[29]===r?x=t[30]:(x=(e,t)=>{t.reason!==`item-press`&&r(e)},t[29]=r,t[30]=x),S=i&&we(m),t[4]=i,t[5]=e.commands,t[6]=e.label,t[7]=n,t[8]=s,t[9]=r,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S,t[20]=C}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20];let w=n!==``,T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>a(!0),t[31]=T):T=t[31];let E;t[32]!==m||t[33]!==i||t[34]!==r?(E=e=>{e.key!==`Escape`||i&&we(m)||(r(``),c(!1),e.currentTarget.blur())},t[32]=m,t[33]=i,t[34]=r,t[35]=E):E=t[35];let D;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(Cm,{children:(0,Y.jsx)(Rn,{})}),t[36]=D):D=t[36];let O;t[37]===n?O=t[38]:(O=n===``&&(0,Y.jsx)(Cm,{align:`inline-end`,className:`max-sm:hidden`,children:(0,Y.jsx)(Vm,{children:`⌘K`})}),t[37]=n,t[38]=O);let k;t[39]!==e.label||t[40]!==w||t[41]!==E||t[42]!==O?(k=(0,Y.jsxs)(Am,{ref:l,"aria-label":e.label,placeholder:`Search or run a command`,showTrigger:!1,showClear:w,className:`w-full`,onFocus:T,onKeyDown:E,children:[D,O]}),t[39]=e.label,t[40]=w,t[41]=E,t[42]=O,t[43]=k):k=t[43];let A;t[44]===r?A=t[45]:(A=(0,Y.jsx)(jm,{anchor:u,children:(0,Y.jsx)(Mm,{children:e=>(0,Y.jsxs)(Nm,{value:e,onClick:()=>{r(``),c(!1),e.run()},children:[e.icon,e.label]},e.label)})}),t[44]=r,t[45]=A);let j;t[46]!==p||t[47]!==k||t[48]!==A||t[49]!==_||t[50]!==v||t[51]!==y||t[52]!==b||t[53]!==x||t[54]!==S?(j=(0,Y.jsxs)(p,{items:_,filter:v,itemToStringValue:y,value:b,onValueChange:x,open:S,onOpenChange:a,autoHighlight:!0,children:[k,A]}),t[46]=p,t[47]=k,t[48]=A,t[49]=_,t[50]=v,t[51]=y,t[52]=b,t[53]=x,t[54]=S,t[55]=j):j=t[55];let M;t[56]===r?M=t[57]:(M=(0,Y.jsx)(Sn,{variant:`ghost`,size:`sm`,className:`sm:hidden`,onClick:()=>{r(``),c(!1)},children:`Cancel`}),t[56]=r,t[57]=M);let N;t[58]!==h||t[59]!==j||t[60]!==M||t[61]!==C?(N=(0,Y.jsxs)(`div`,{ref:C,className:h,children:[j,M]}),t[58]=h,t[59]=j,t[60]=M,t[61]=C,t[62]=N):N=t[62];let P;return t[63]!==g||t[64]!==N?(P=(0,Y.jsxs)(Y.Fragment,{children:[g,N]}),t[63]=g,t[64]=N,t[65]=P):P=t[65],P}function Jm(e){return e.label}function Ym(e){let t=(0,X.c)(25),n;t[0]===e.icon?n=t[1]:(n=(0,Y.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`}),t[0]=e.icon,t[1]=n);let r;t[2]===e.name?r=t[3]:(r=(0,Y.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),t[2]=e.name,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,Y.jsxs)(`a`,{href:`/`,className:`-ml-1 flex shrink-0 items-center gap-1.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a;t[7]===e.tabs?a=t[8]:(a=e.tabs!==void 0&&(0,Y.jsx)(`nav`,{"aria-label":`Sections`,className:`ml-2 flex items-center gap-1`,children:e.tabs}),t[7]=e.tabs,t[8]=a);let o;t[9]===e.commands?o=t[10]:(o=e.commands===void 0&&(0,Y.jsx)(`span`,{className:`flex-1`}),t[9]=e.commands,t[10]=o);let s;t[11]!==e.commands||t[12]!==e.name?(s=e.commands!==void 0&&(0,Y.jsx)(qm,{commands:e.commands,label:`Search ${e.name}`}),t[11]=e.commands,t[12]=e.name,t[13]=s):s=t[13];let c;t[14]===e.account?c=t[15]:(c=e.account??(0,Y.jsx)(Km,{}),t[14]=e.account,t[15]=c);let l;t[16]!==e.action||t[17]!==c?(l=(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 lg:ml-auto`,children:[e.action,c]}),t[16]=e.action,t[17]=c,t[18]=l):l=t[18];let u;return t[19]!==i||t[20]!==a||t[21]!==o||t[22]!==s||t[23]!==l?(u=(0,Y.jsxs)(`header`,{className:`bg-background border-border sticky top-0 z-30 flex h-12 shrink-0 items-center gap-2 border-b px-4`,children:[i,a,o,s,l]}),t[19]=i,t[20]=a,t[21]=o,t[22]=s,t[23]=l,t[24]=u):u=t[24],u}function Xm(e){let t=(0,X.c)(5),n;t[0]===e.className?n=t[1]:(n=nn(`flex min-h-full w-full max-w-3xl flex-col gap-4 self-start`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,Y.jsx)(`main`,{className:`pb-safe relative flex min-h-0 flex-1 justify-center overflow-y-auto px-4 pt-3`,children:(0,Y.jsx)(`div`,{className:n,children:e.children})}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}var Zm=Ht(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Qm(e){let t=(0,X.c)(13),n,r,i,a,o;if(t[0]!==e){let{className:s,variant:c,render:l,...u}=e;n=l,o=c===void 0?`default`:c,a=kf,r=`span`,i=on({className:nn(Zm({variant:o}),s)},u),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];let s;t[6]===o?s=t[7]:(s={slot:`badge`,variant:o},t[6]=o,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==s?(c={defaultTagName:r,props:i,render:n,state:s},t[8]=n,t[9]=r,t[10]=i,t[11]=s,t[12]=c):c=t[12],a(c)}function $m(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Qf,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function eh(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(ep,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function th(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(up,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function nh(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var rh=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z`,transform:`scale(64)`,fill:`#ffff`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Y.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r},ih=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`path`,{fill:`#1b1f23`,fillRule:`evenodd`,d:`M512 0C229.12 0 0 229.12 0 512c0 226.56 146.56 417.92 350.08 485.76 25.6 4.48 35.2-10.88 35.2-24.32 0-12.16-.64-52.48-.64-95.36-128.64 23.68-161.92-31.36-172.16-60.16-5.76-14.72-30.72-60.16-52.48-72.32-17.92-9.6-43.52-33.28-.64-33.92 40.32-.64 69.12 37.12 78.72 52.48 46.08 77.44 119.68 55.68 149.12 42.24 4.48-33.28 17.92-55.68 32.64-68.48-113.92-12.8-232.96-56.96-232.96-252.8 0-55.68 19.84-101.76 52.48-137.6-5.12-12.8-23.04-65.28 5.12-135.68 0 0 42.88-13.44 140.8 52.48 40.96-11.52 84.48-17.28 128-17.28s87.04 5.76 128 17.28c97.92-66.56 140.8-52.48 140.8-52.48 28.16 70.4 10.24 122.88 5.12 135.68 32.64 35.84 52.48 81.28 52.48 137.6 0 196.48-119.68 240-233.6 252.8 18.56 16 34.56 46.72 34.56 94.72 0 68.48-.64 123.52-.64 140.8 0 13.44 9.6 29.44 35.2 24.32C877.44 929.92 1024 737.92 1024 512 1024 229.12 794.88 0 512 0`,clipRule:`evenodd`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Y.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r};te(Ye(h(`AUTH_URL`)),le);function ah(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function oh(e){return Ne(Yn)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}k()(`@deslop/runtime/auth/lib/utils/CurrentUser`);var sh=class e extends vt()(`@deslop/runtime/auth/lib/utils/RpcAuth`,{error:Yn}){static layerClient=t=>rt(e,e=>ze(function*(){return yield*e.next({...e.request,headers:Oe(e.request.headers,`authorization`,`Bearer ${yield*t}`)})}))},ch=class extends A()(`TelemetryError`,{cause:Ge(P()),message:H}){},lh=me(H,he(at(/^[a-fA-F0-9]{32}$/u))),uh=me(H,he(at(/^[a-fA-F0-9]{16}$/u))),dh=me(H,he(at(/^\d{1,20}$/u))),fh=U({key:H,value:M}),ph=S(U({attributes:W(s(fh))}),[M]),mh=U({attributes:W(s(fh)),events:W(s(S(U({attributes:W(s(fh)),name:H,timeUnixNano:dh}),[M]))),links:W(s(S(U({attributes:W(s(fh)),spanId:uh,traceId:lh}),[M])))}),hh=S(U({...mh.fields,endTimeUnixNano:W(dh),name:W(H),parentSpanId:W(ut([uh,ae(``)])),spanId:uh,startTimeUnixNano:dh,status:W(S(U({code:W(b)}),[M])),traceId:lh}),[M]),gh=S(U({attributes:W(s(fh)),body:W(M),observedTimeUnixNano:W(dh),severityNumber:W(b),severityText:W(H),spanId:W(ut([uh,ae(``)])),timeUnixNano:W(dh),traceId:W(ut([lh,ae(``)]))}),[M]);U({resourceSpans:W(s(S(U({resource:W(ph),schemaUrl:W(H),scopeSpans:W(s(S(U({schemaUrl:W(H),scope:W(ph),spans:W(s(hh))}),[M])))}),[M])))}),U({resourceLogs:W(s(S(U({resource:W(ph),schemaUrl:W(H),scopeLogs:W(s(S(U({logRecords:W(s(gh)),schemaUrl:W(H),scope:W(ph)}),[M])))}),[M])))});var _h=U({durationMs:re,id:de,name:H,payload:M,resource:ph,resourceSchemaUrl:H,scope:ph,scopeSchemaUrl:H,service:H,signal:Ft([`trace`,`log`]),spanId:H,status:b,time:dh,traceId:H}).mapFields(_t([`resource`,`resourceSchemaUrl`,`scope`,`scopeSchemaUrl`])),vh=U({errors:Ke,from:re,limit:me(b,he(bt({maximum:1e3,minimum:1}))),offset:me(b,he(bt({maximum:1e5,minimum:0}))),operation:H,runs:Ft([`current`,`all`]),service:H,sort:Ft([`recent`,`slowest`]),text:H,to:re,traceId:H});U({entries:s(_h),total:b});var yh=Ft([`web`,`mobile`,`server`,`ci`,`unknown`]),bh=U({name:H,runtime:yh}),xh=U({...bh.fields,entries:u,lastEventAt:dh,runStartedAt:dh,version:H}),Sh=U({count:u,credential:Ft([`authorization`,`cookie`,`none`]),lastAt:re,route:Ft([`/v1/traces`,`/v1/logs`]),status:b});U({rejections:s(Sh),services:s(xh),since:re});var Ch=U({durationMs:re,errors:b,id:lh,logs:b,operation:H,service:H,services:s(bh),spans:b,time:dh});U({entries:s(Ch),total:b});var wh=U({durationMs:re,failure:Ge(U({message:H,span:H})),id:lh,time:dh}),Th=U({count:b,failures:b,name:H,p50Ms:re,runtime:yh,traces:s(wh)}),Eh=U({apps:s(U({name:H,operations:s(Th),versions:s(U({runtimes:s(yh),version:H}))}))});U({count:b,errors:b,from:re,maxMs:re,p50Ms:re,p95Ms:re,to:re});var Dh=U({..._h.fields,depth:u,logs:s(_h),offsetMs:re,parentSpanId:H,runtime:yh}),Oh=U({durationMs:re,id:lh,logs:s(_h),services:s(bh),spans:s(Dh)}),kh=U({errors:me(vh.fields.errors,G(Pt(!1)),_e({description:`Only failed spans and error logs.`})),operation:me(vh.fields.operation,G(Pt(``)),_e({description:`Exact span name.`})),runs:me(vh.fields.runs,G(Pt(`current`)),_e({description:`"current" searches the latest process/page load/app launch per service. "all" includes retained earlier runs in the lookback.`})),service:me(vh.fields.service,G(Pt(``)),_e({description:`Exact service name, from list_services.`})),since:me(L,he(mt(j,{expected:`a finite duration`})),G(Pt(dt(10))),_e({description:`Lookback, such as "10 minutes" or "1 hour".`})),text:me(vh.fields.text,G(Pt(``)),_e({description:`Case-insensitive text in the span name, log message or attributes.`})),traceId:me(vh.fields.traceId,G(Pt(``)),_e({description:`Only entries of this trace.`}))}),Ah=U({...kh.fields,limit:me(vh.fields.limit,G(Pt(20)),_e({description:`Page size, 1 to 1000.`})),offset:me(vh.fields.offset,G(Pt(0)),_e({description:`Entries to skip, for the next page.`}))});U({...Ah.fields,sort:me(vh.fields.sort,G(Pt(`recent`)),_e({description:`"recent" puts the newest first, "slowest" the longest first.`}))});var jh=class extends ft(ht(`scope.overview`,{error:ut([Yn,ch]),stream:!0,success:Eh}),ht(`scope.trace`,{error:ut([Yn,ch]),payload:U({id:lh}),success:Oh})).middleware(sh){},Mh=class extends Ue()(`@deslop/scope/lib/utils/RpcClient`,{group:jh,protocol:Cn}){},Nh=Pe(Mh.runtime.atom(me(Mh,Ce(e=>e(`scope.overview`,void 0)),nt,Ie(e=>me(e(jt(`2 seconds`)),ce(e=>e.input._tag===`RpcClientError`)))))),Ph=st(e=>{let t=e(Nh),n=Ee(e.self(),e=>e.seen);if(!Mt(t))return{arrived:V(),seen:n};let r=it(t.value.apps,e=>it(e.operations,e=>De(e.traces,e=>e.id)));return{arrived:ne(n,{onNone:()=>V(),onSome:e=>be(r,e)}),seen:c(r)}}),Fh=xt(e=>Mh.query(`scope.trace`,{id:m(pt(l(e,`:`)),()=>e)})),Ih=st(je(lt(`30 seconds`),()=>pe));function Lh(e,t){let n=x(0,(t-m(O(me(e,Ze(0,-6))),()=>t))/1e3);return n<10?`now`:n<60?`${N(n,0)}s`:n<3600?`${N(n/60,0)}m`:n<86400?`${N(n/3600,0)}h`:`${N(n/86400,0)}d`}function Rh(e){return e<999.5?`${N(e,0)} ms`:e<9950?`${N(e/1e3,1)} s`:e<59500?`${N(e/1e3,0)} s`:e<357e4?`${N(e/6e4,0)} min`:`${N(e/36e5,1)} h`}var zh=`/assets/icon-D1hVTa1Q.svg`;R(qe(F),e=>De(l(e,`.`),e=>m(O(e),()=>0)));function Bh(e){return me(e,z(/^@deslop\//u,``),z(/-(?:server|client|ios)$/u,``))}var Vh={ci:`ci`,mobile:`iOS`,server:`server`,unknown:``,web:`web`},Hh={ci:(0,Y.jsx)(Wn,{role:`img`,"aria-label":`ci`,"data-side":`ci`,className:`size-3.5 shrink-0 text-(--side)`}),mobile:(0,Y.jsx)(Hn,{role:`img`,"aria-label":`iOS`,"data-side":`mobile`,className:`size-3.5 shrink-0 text-(--side)`}),server:(0,Y.jsx)(Bn,{role:`img`,"aria-label":`server`,"data-side":`server`,className:`size-3.5 shrink-0 text-(--side)`}),unknown:(0,Y.jsx)(Bn,{"aria-hidden":!0,"data-side":`unknown`,className:`size-3.5 shrink-0 text-(--side)`}),web:(0,Y.jsx)(In,{role:`img`,"aria-label":`web`,"data-side":`web`,className:`size-3.5 shrink-0 text-(--side)`})},Uh=s(U({key:H,value:E})),Wh=w(H,E),Gh=Fe(De(Re(Object.assign({"../../../../auth/src/routes/icon.svg":Xn,"../../../../deploy/src/routes/icon.svg":Zn,"../../../../gateway/src/routes/icon.svg":Qn,"../../../../opm/src/routes/icon.svg":$n,"../../../../portfolio/src/routes/icon.svg":er,"../icon.svg":tr,"../../../../signal/src/routes/icon.svg":nr,"../../../../stash/src/routes/icon.svg":rr,"../../../../trips/src/routes/icon.svg":ir})),e=>[l(e[0],`/`)[4]??``,e[1]]));function Kh(e){return ne(T(e.cause),{onNone:()=>(0,Y.jsx)(_n,{error:C(e.cause),reset:()=>location.reload()}),onSome:e=>oh(e)?(0,Y.jsx)(xn,{href:ah(location.href)}):(0,Y.jsx)(_n,{error:e,reset:()=>location.reload()})})}function qh(e){return me(ye(Wh)(e),Ee(e=>pt(Se(e))),Nt(e=>ue(e)||d(e)||D(e)),ne({onNone:()=>ie(e),onSome:e=>`${e}`}))}function Jh(e){return Me(De(Me(m(ye(Uh)(e.payload.attributes),()=>[]),e=>e.key!==`service.name`),e=>({key:e.key,value:qh(e.value)})),t=>t.value!==e.name)}function Yh(e){return me(g(e,e=>e.status===2),Ee(e=>At(e.payload.status)),Nt(fe),Ee(e=>At(me(ct(e,`message`),Dt))),Nt(_),Nt(y))}function Xh(e){return v(Yh(e))||ot(Jh(e))||ot(e.logs)}function Zh(e){return`calc(var(--spacing) * 10 + ${x(0,e.depth-1)*12}px)`}function Qh(e){let t=(0,X.c)(4),n;t[0]===e.span?n=t[1]:(n=De([...ne(Yh(e.span),{onNone:ng,onSome:tg}),...De(Jh(e.span),eg),...De(e.span.logs,$h)],(t,n)=>(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-3 py-1 pr-1 pl-(--indent)`,style:{"--indent":Zh(e.span)},children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground shrink-0`,children:t.key}),(0,Y.jsx)(`dd`,{className:nn(`min-w-0 flex-1 text-right break-all select-text`,t.failed&&`text-destructive`),children:ve(t.key===`url.full`&&Je(`https://`)(t.value),{onFalse:()=>t.value,onTrue:()=>(0,Y.jsx)(`a`,{href:t.value,target:`_blank`,rel:`noreferrer`,className:`text-primary`,children:t.value})})}),(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`})]},`${t.key}:${n}`)),t[0]=e.span,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(`dl`,{className:`flex flex-col pb-1 font-mono text-xs`,children:n}),t[2]=n,t[3]=r),r}function $h(e){return{failed:e.status===2,key:`log`,value:e.name}}function eg(e){return{...e,failed:!1}}function tg(e){return[{failed:!0,key:`error`,value:e}]}function ng(){return[]}function rg(e){let t=(0,X.c)(35),n;t[0]===e.span?n=t[1]:(n=Zh(e.span),t[0]=e.span,t[1]=n);let r;t[2]===n?r=t[3]:(r={"--indent":n},t[2]=n,t[3]=r);let i;if(t[4]!==e.mark||t[5]!==e.span.service){let n;t[7]===e.span.service?n=t[8]:(n=t=>(0,Y.jsx)(`img`,{src:t,alt:Bh(e.span.service),className:`pixelated size-3.5 shrink-0`}),t[7]=e.span.service,t[8]=n),i=ne(e.mark,{onNone:cg,onSome:n}),t[4]=e.mark,t[5]=e.span.service,t[6]=i}else i=t[6];let a;t[9]===e.span.name?a=t[10]:(a=(0,Y.jsx)(`span`,{className:`truncate`,children:e.span.name}),t[9]=e.span.name,t[10]=a);let o;t[11]!==r||t[12]!==i||t[13]!==a?(o=(0,Y.jsxs)(`span`,{className:`flex w-36 shrink-0 items-center gap-1.5 pl-(--indent) text-left sm:w-56`,style:r,children:[i,a]}),t[11]=r,t[12]=i,t[13]=a,t[14]=o):o=t[14];let s=e.span.runtime,c;t[15]===e.span.status?c=t[16]:(c=nn(`absolute top-0 left-(--offset) h-2 w-(--length) min-w-0.5`,ve(e.span.status===2,{onFalse:sg,onTrue:og})),t[15]=e.span.status,t[16]=c);let l=`calc(${e.span.durationMs} / var(--trace-total) * 100%)`,u=`calc(${e.span.offsetMs} / var(--trace-total) * 100%)`,d;t[17]!==l||t[18]!==u?(d={"--length":l,"--offset":u},t[17]=l,t[18]=u,t[19]=d):d=t[19];let f;t[20]!==e.span.runtime||t[21]!==c||t[22]!==d?(f=(0,Y.jsx)(`span`,{className:`relative h-2 flex-1`,children:(0,Y.jsx)(`span`,{"data-side":s,className:c,style:d})}),t[20]=e.span.runtime,t[21]=c,t[22]=d,t[23]=f):f=t[23];let p;t[24]===e.span.durationMs?p=t[25]:(p=Rh(e.span.durationMs),t[24]=e.span.durationMs,t[25]=p);let m;t[26]===p?m=t[27]:(m=(0,Y.jsx)(`span`,{className:`text-muted-foreground w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:p}),t[26]=p,t[27]=m);let h;t[28]===e.open?h=t[29]:(h=ne(se(e.open),{onNone:ag,onSome:ig}),t[28]=e.open,t[29]=h);let g;return t[30]!==f||t[31]!==m||t[32]!==h||t[33]!==o?(g=(0,Y.jsxs)(Y.Fragment,{children:[o,f,m,h]}),t[30]=f,t[31]=m,t[32]=h,t[33]=o,t[34]=g):g=t[34],g}function ig(e){return(0,Y.jsx)(Pn,{className:nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,e&&`rotate-90`)})}function ag(){return(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`})}function og(){return`bg-destructive`}function sg(){return`bg-(--side)`}function cg(){return null}function lg(e){let t=Me(e,e=>e.status===2),n=De(t,e=>m(Nt(At(e.payload.parentSpanId),_),()=>``));return yt(t,e=>!St(n,t=>I(t)===e.spanId))}function ug(e){let t=(0,X.c)(16),n=`${e.id}:${e.size}`,r;t[0]===n?r=t[1]:(r=Fh(n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={includeFailure:!0},t[2]=i):i=t[2];let a=wr(r,i),[o,s]=(0,J.useState)();if(wt(a)){let e;return t[3]===a.cause?e=t[4]:(e=(0,Y.jsx)(Kh,{cause:a.cause}),t[3]=a.cause,t[4]=e),e}let c=a.value,l;if(t[5]!==o||t[6]!==c.durationMs||t[7]!==c.spans){let e=yt(c.spans,gg),n=Me(c.spans,t=>!Tt(e,e=>e.spanId===t.spanId)),r=Fe(De(c.spans,hg)),i=function(t){let n=r[t.parentSpanId]??ne(e,{onNone:()=>t.service,onSome:mg});return Nt(se(Gh[Bh(t.service)]),()=>Bh(t.service)!==Bh(n))},a;t[9]!==o||t[10]!==c.spans?(a=()=>yt(c.spans,e=>e.spanId===o),t[9]=o,t[10]=c.spans,t[11]=a):a=t[11];let u=Nt(ve(o===void 0,{onFalse:a,onTrue:()=>me(lg(c.spans),Xe(()=>e))}),Xh),d;t[12]===c.durationMs?d=t[13]:(d=x(c.durationMs,1),t[12]=c.durationMs,t[13]=d);let f=`${d}`,p;t[14]===f?p=t[15]:(p={"--trace-total":f},t[14]=f,t[15]=p),l=(0,Y.jsxs)(`div`,{className:`flex flex-col pb-2`,style:p,children:[ne(Nt(u,t=>Tt(e,e=>e.spanId===t.spanId)),{onNone:pg,onSome:fg}),De(n,e=>ve(Xh(e),{onFalse:()=>(0,Y.jsx)(`div`,{className:`flex h-8 w-full items-center gap-3 pr-1 text-xs`,children:(0,Y.jsx)(rg,{mark:i(e),span:e})},e.spanId),onTrue:()=>(0,Y.jsxs)($m,{open:Tt(u,t=>t.spanId===e.spanId),onOpenChange:t=>s(ve(t,{onFalse:dg,onTrue:()=>e.spanId})),className:`data-open:bg-muted/60`,children:[(0,Y.jsx)(eh,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 text-left text-xs`,children:(0,Y.jsx)(rg,{mark:i(e),span:e,open:Tt(u,t=>t.spanId===e.spanId)})}),(0,Y.jsx)(th,{children:(0,Y.jsx)(Qh,{span:e})})]},e.spanId)}))]}),t[5]=o,t[6]=c.durationMs,t[7]=c.spans,t[8]=l}else l=t[8];return l}function dg(){return``}function fg(e){return(0,Y.jsx)(Qh,{span:e})}function pg(){return null}function mg(e){return e.service}function hg(e){return[e.spanId,e.service]}function gg(e){return e.depth===0}function _g(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{"aria-busy":`true`,role:`status`,"aria-label":`Spans`,className:`flex flex-col gap-2 py-2 pr-1 pl-10`,children:De(Qe(1,4),vg)}),e[0]=t):t=e[0],t}function vg(e){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(nh,{className:`h-4 w-32`}),(0,Y.jsx)(nh,{className:`h-2 flex-1`})]},e)}function yg(e){let t=(0,X.c)(37),[n,r]=(0,J.useState)(!1),i=e.arrived&&`grow-in`,a;t[0]===i?a=t[1]:(a=nn(i),t[0]=i,t[1]=a);let o;t[2]===e?o=t[3]:(o=t=>{r(t),e.onOpenChange(t)},t[2]=e,t[3]=o);let s;t[4]!==e.now||t[5]!==e.trace.time?(s=Lh(e.trace.time,e.now),t[4]=e.now,t[5]=e.trace.time,t[6]=s):s=t[6];let c;t[7]===s?c=t[8]:(c=(0,Y.jsx)(`span`,{className:`text-muted-foreground w-8 shrink-0 font-mono`,children:s}),t[7]=s,t[8]=c);let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(`span`,{className:`flex-1`}),t[9]=l):l=t[9];let u;t[10]===e.trace.failure?u=t[11]:(u=e.trace.failure!==void 0&&(0,Y.jsx)(Qm,{variant:`destructive`,className:`max-w-40 shrink-0 font-mono`,title:`Failed at ${e.trace.failure.span}`,children:(0,Y.jsx)(`span`,{className:`truncate`,children:e.trace.failure.span})}),t[10]=e.trace.failure,t[11]=u);let d;t[12]===e.trace.durationMs?d=t[13]:(d=Rh(e.trace.durationMs),t[12]=e.trace.durationMs,t[13]=d);let f;t[14]===d?f=t[15]:(f=(0,Y.jsx)(`span`,{className:`w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:d}),t[14]=d,t[15]=f);let p=n&&`rotate-90`,m;t[16]===p?m=t[17]:(m=nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,p),t[16]=p,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,Y.jsx)(Pn,{className:m}),t[18]=m,t[19]=h);let g;t[20]!==h||t[21]!==c||t[22]!==u||t[23]!==f?(g=(0,Y.jsxs)(eh,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 pl-6 text-left text-xs`,children:[c,l,u,f,h]}),t[20]=h,t[21]=c,t[22]=u,t[23]=f,t[24]=g):g=t[24];let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(_g,{}),t[25]=_):_=t[25];let v;t[26]!==e.trace.durationMs||t[27]!==e.trace.id?(v=(0,Y.jsx)(th,{children:(0,Y.jsx)(J.Suspense,{fallback:_,children:(0,Y.jsx)(ug,{id:e.trace.id,size:e.trace.durationMs})})}),t[26]=e.trace.durationMs,t[27]=e.trace.id,t[28]=v):v=t[28];let y;t[29]!==n||t[30]!==g||t[31]!==v||t[32]!==o?(y=(0,Y.jsxs)($m,{open:n,onOpenChange:o,className:`border-b`,children:[g,v]}),t[29]=n,t[30]=g,t[31]=v,t[32]=o,t[33]=y):y=t[33];let b;return t[34]!==a||t[35]!==y?(b=(0,Y.jsx)(`div`,{className:a,children:y}),t[34]=a,t[35]=y,t[36]=b):b=t[36],b}function bg(e){let t=(0,X.c)(59),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(Ae),o,s,c,l,u,d,f,p,m;if(t[0]!==n||t[1]!==i||t[2]!==e.arrived||t[3]!==e.now||t[4]!==e.operation.count||t[5]!==e.operation.failures||t[6]!==e.operation.name||t[7]!==e.operation.p50Ms||t[8]!==e.operation.runtime||t[9]!==e.operation.traces){let h;t[19]===e.operation.traces?h=t[20]:(h=t=>!St(e.operation.traces,e=>e.id===t.id),t[19]=e.operation.traces,t[20]=h);let g=[...e.operation.traces,...Me(Se(i),h)];s=$m,u=`listitem`,d=n,f=r,p=`border-b`;let _=Hh[e.operation.runtime],v;t[21]===e.operation.name?v=t[22]:(v=(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.operation.name}),t[21]=e.operation.name,t[22]=v);let y;t[23]===e.operation.failures?y=t[24]:(y=e.operation.failures>0&&(0,Y.jsxs)(Qm,{variant:`destructive`,className:`shrink-0 font-mono`,title:`Failed`,children:[e.operation.failures,(0,Y.jsx)(`span`,{className:`sr-only`,children:` failed`})]}),t[23]=e.operation.failures,t[24]=y);let b;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(`span`,{className:`sr-only`,children:` runs`}),t[25]=b):b=t[25];let x;t[26]===e.operation.count?x=t[27]:(x=(0,Y.jsxs)(`span`,{className:`text-muted-foreground w-12 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums max-sm:hidden`,title:`Runs`,children:[e.operation.count,`×`,b]}),t[26]=e.operation.count,t[27]=x);let S;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(`span`,{className:`sr-only`,children:`typical `}),t[28]=S):S=t[28];let C;t[29]===e.operation.p50Ms?C=t[30]:(C=Rh(e.operation.p50Ms),t[29]=e.operation.p50Ms,t[30]=C);let w;t[31]===C?w=t[32]:(w=(0,Y.jsxs)(`span`,{className:`w-14 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums`,title:`Typical`,children:[S,C]}),t[31]=C,t[32]=w);let T=n&&`rotate-90`,E;t[33]===T?E=t[34]:(E=nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,T),t[33]=T,t[34]=E);let D;t[35]===E?D=t[36]:(D=(0,Y.jsx)(Pn,{className:E}),t[35]=E,t[36]=D),t[37]!==y||t[38]!==x||t[39]!==w||t[40]!==D||t[41]!==_||t[42]!==v?(m=(0,Y.jsxs)(eh,{className:`hover:bg-muted/50 flex h-10 w-full cursor-pointer items-center gap-3 px-1 text-left text-sm`,children:[_,v,y,x,w,D]}),t[37]=y,t[38]=x,t[39]=w,t[40]=D,t[41]=_,t[42]=v,t[43]=m):m=t[43],o=th,c=`border-t`;let O;t[44]!==e.arrived||t[45]!==e.now?(O=t=>(0,Y.jsx)(yg,{arrived:ge(e.arrived,t.id),now:e.now,onOpenChange:e=>a(n=>ve(e,{onFalse:()=>tt(n,t.id),onTrue:()=>Ve(n,t.id,t)})),trace:t},t.id),t[44]=e.arrived,t[45]=e.now,t[46]=O):O=t[46],l=De(g,O),t[0]=n,t[1]=i,t[2]=e.arrived,t[3]=e.now,t[4]=e.operation.count,t[5]=e.operation.failures,t[6]=e.operation.name,t[7]=e.operation.p50Ms,t[8]=e.operation.runtime,t[9]=e.operation.traces,t[10]=o,t[11]=s,t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=f,t[17]=p,t[18]=m}else o=t[10],s=t[11],c=t[12],l=t[13],u=t[14],d=t[15],f=t[16],p=t[17],m=t[18];let h;t[47]!==o||t[48]!==c||t[49]!==l?(h=(0,Y.jsx)(o,{className:c,children:l}),t[47]=o,t[48]=c,t[49]=l,t[50]=h):h=t[50];let g;return t[51]!==s||t[52]!==u||t[53]!==d||t[54]!==f||t[55]!==p||t[56]!==m||t[57]!==h?(g=(0,Y.jsxs)(s,{role:u,open:d,onOpenChange:f,className:p,children:[m,h]}),t[51]=s,t[52]=u,t[53]=d,t[54]=f,t[55]=p,t[56]=m,t[57]=h,t[58]=g):g=t[58],g}function xg(e){let t=(0,X.c)(5),n=I(Gm()),r=_r(Ph).arrived,i=xe(_r(Ih),Ng),a=Me(De(e.overview.apps,e=>({...e,operations:Me(e.operations,t=>Ot(n)(I(`${e.name} ${gt(De(e.versions,Mg),` `)} ${Vh[t.runtime]} ${t.name}`)))})),jg);if(We(a)){let e=ve(n===``,{onFalse:Ag,onTrue:kg}),r;return t[0]===e?r=t[1]:(r=(0,Y.jsx)(fn,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(vn,{children:e})})}),t[0]=e,t[1]=r),r}let s;return t[2]!==r||t[3]!==i?(s=e=>(0,Y.jsxs)(`section`,{"aria-label":e.name,className:`flex flex-col`,children:[(0,Y.jsxs)(`h2`,{className:`flex h-9 items-center gap-2 px-1 text-sm font-semibold`,children:[ne(se(Gh[e.name]),{onNone:()=>ve(o(e.operations,Og),{onFalse:Dg,onTrue:Eg}),onSome:Tg}),e.name,ne(pt(e.versions),{onNone:wg,onSome:t=>(0,Y.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs font-normal tabular-nums`,title:gt(De(e.versions,Sg),`
|
|
1
|
+
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{a as t,i as n,o as r,r as i,t as a}from"./react-CDnnZf73.js";import{$t as o,A as s,An as c,At as l,B as u,Bn as d,Bt as f,C as p,Cn as m,D as h,Dn as g,Dt as _,En as v,Et as y,F as b,Ft as x,G as S,Gt as C,H as w,Ht as T,I as E,In as D,It as O,Jt as k,K as A,Kt as j,L as M,Lt as N,M as P,Mn as F,Mt as I,N as L,Nn as R,Nt as ee,O as te,On as ne,Ot as z,P as re,Pn as ie,Pt as B,Qt as V,R as ae,S as oe,Sn as se,St as ce,Tn as le,U as H,Un as ue,V as de,Vn as fe,Vt as pe,W as U,Wn as me,X as he,Xt as ge,Y as _e,Yt as ve,Z as ye,Zt as be,_ as xe,_n as Se,_t as Ce,an as we,at as W,b as Te,bn as Ee,cn as De,ct as Oe,d as ke,dn as Ae,dt as je,en as Me,et as Ne,f as Pe,fn as Fe,ft as Ie,g as Le,gn as Re,gt as ze,h as Be,hn as Ve,ht as He,i as Ue,in as We,it as Ge,j as Ke,jn as qe,jt as Je,k as Ye,kn as Xe,kt as Ze,ln as Qe,lt as $e,m as et,mn as tt,mt as nt,n as rt,nn as it,nt as at,on as ot,ot as G,p as st,pn as ct,pt as lt,q as ut,qt as dt,r as ft,rn as pt,rt as mt,s as ht,sn as gt,st as _t,t as vt,tn as yt,tt as bt,u as xt,un as St,ut as Ct,v as wt,vn as Tt,vt as Et,wn as Dt,wt as Ot,x as kt,xn as At,xt as jt,y as Mt,yn as Nt,yt as Pt,z as Ft}from"./effect-ClC_Awyl.js";import{A as It,B as Lt,C as Rt,D as zt,E as Bt,F as Vt,G as Ht,H as Ut,I as Wt,J as Gt,K as Kt,L as qt,M as Jt,N as Yt,O as Xt,P as Zt,R as Qt,S as K,T as $t,U as en,V as tn,W as nn,_ as rn,a as an,b as on,c as sn,d as cn,f as ln,g as un,h as dn,i as fn,j as pn,k as mn,l as hn,m as gn,n as _n,o as vn,p as yn,q as bn,r as xn,s as Sn,t as Cn,u as wn,v as Tn,w as En,x as q,y as Dn,z as On}from"./index-jf9qdV0C.js";var kn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};kn.node;var An=Kt(kn),jn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};jn.node;var Mn=Kt(jn),Nn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Nn.node;var Pn=Kt(Nn),Fn={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Fn.node;var In=Kt(Fn),Ln={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Ln.node;var Rn=Kt(Ln),zn={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};zn.node;var Bn=Kt(zn),Vn={name:`smartphone`,size:24,node:[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]};Vn.node;var Hn=Kt(Vn),Un={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Un.node;var Wn=Kt(Un),Gn={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Gn.node;var Kn=Kt(Gn);function qn(e){return e?.ownerDocument||document}var J=e(r(),1),Y=t(),Jn=e(i(),1),X=a(),Yn=class extends A()(`AuthError`,{cause:Ge(P()),error:W(Ft([`invalid_request`,`invalid_client`,`invalid_client_metadata`,`invalid_redirect_uri`,`invalid_grant`,`invalid_target`,`invalid_scope`,`unsupported_grant_type`,`unsupported_response_type`,`access_denied`,`temporarily_unavailable`])),message:H}){};U({id:de,name:de}),H.check(at(/^https:\/\/[a-z\d-]+\.mp281x\.xyz(?:\/mcp)?$/u)),U({accessToken:de,clientId:de,expiresAt:re,refreshToken:de}),U({client_id:de}),U({access_token:de,expires_in:re,refresh_token:de});var Xn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23da702c'%20d='M17%2021h1v22h-1zM18%2022h2v22h-2zM20%2023h2v22h-2zM22%2024h2v22h-2zM24%2025h2v22h-2zM26%2026h2v5h-2zM28%2027h2v5h-2zM30%2028h2v22h-2zM32%2029h2v22h-2zM34%2030h2v22h-2zM26%2031h1v17h-1zM36%2031h2v22h-2zM29%2032h1v17h-1zM38%2032h1v22h-1zM27%2041h1v7h-1zM28%2042h1v7h-1z'/%3e%3cpath%20fill='%23bc5215'%20d='M46%2028h1v22h-1zM44%2029h2v22h-2zM42%2030h2v22h-2zM40%2031h2v22h-2zM39%2032h1v22h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M29%209h2v1h-2zM27%2010h2v1h-2zM31%2010h3v1h-3zM25%2011h2v1h-2zM34%2011h1v1h-1zM24%2012h1v1h-1zM35%2012h1v1h-1zM23%2013h1v2h-1zM36%2013h1v1h-1zM37%2014h1v1h-1zM22%2015h1v3h-1zM29%2015h1v1h-1zM38%2015h1v2h-1zM28%2016h1v3h-1zM30%2016h2v1h-2zM32%2017h1v1h-1zM39%2017h1v2h-1zM20%2018h2v1h-2zM29%2018h1v1h-1zM33%2018h1v1h-1zM18%2019h2v1h-2zM30%2019h2v1h-2zM34%2019h1v3h-1zM40%2019h1v2h-1zM17%2020h1v1h-1zM32%2020h2v1h-2zM16%2021h1v22h-1zM41%2021h1v4h-1zM42%2025h2v1h-2zM44%2026h2v1h-2zM46%2027h1v1h-1zM47%2028h1v22h-1zM17%2043h1v1h-1zM18%2044h2v1h-2zM20%2045h2v1h-2zM22%2046h2v1h-2zM24%2047h2v1h-2zM26%2048h2v1h-2zM28%2049h2v1h-2zM30%2050h2v1h-2zM46%2050h1v1h-1zM32%2051h2v1h-2zM44%2051h2v1h-2zM34%2052h2v1h-2zM42%2052h2v1h-2zM36%2053h2v1h-2zM40%2053h2v1h-2zM38%2054h2v1h-2z'/%3e%3cpath%20fill='%23ec8b49'%20d='M22%2018h1v5h-1zM20%2019h2v3h-2zM28%2019h2v7h-2zM18%2020h2v1h-2zM30%2020h2v7h-2zM23%2021h1v2h-1zM32%2021h2v7h-2zM24%2022h4v2h-4zM34%2022h2v7h-2zM26%2024h2v1h-2zM41%2025h1v5h-1zM42%2026h2v3h-2zM44%2027h2v1h-2zM36%2028h2v2h-2zM40%2028h1v2h-1zM38%2029h2v2h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M27%2011h2v4h-2zM25%2012h2v5h-2zM29%2012h3v3h-3zM24%2013h1v9h-1zM32%2013h1v4h-1zM33%2014h1v4h-1zM23%2015h1v6h-1zM27%2015h1v1h-1zM30%2015h2v1h-2zM34%2015h1v4h-1zM35%2016h1v6h-1zM25%2017h1v5h-1zM36%2018h1v10h-1zM37%2020h1v8h-1zM38%2022h1v7h-1z'/%3e%3cpath%20fill='%23878580'%20d='M28%2015h1v1h-1zM27%2016h1v6h-1zM26%2017h1v5h-1zM37%2019h3v1h-3zM38%2020h2v2h-2zM40%2021h1v7h-1zM39%2022h1v7h-1z'/%3e%3cpath%20fill='%23f9ae77'%20d='M18%2021h2v1h-2zM20%2022h2v1h-2zM22%2023h2v1h-2zM24%2024h2v1h-2zM26%2025h2v1h-2zM28%2026h2v1h-2zM30%2027h2v1h-2zM32%2028h2v1h-2zM44%2028h2v1h-2zM34%2029h2v1h-2zM42%2029h2v1h-2zM36%2030h2v1h-2zM40%2030h2v1h-2zM38%2031h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M29%2010h2v2h-2zM31%2011h3v1h-3zM32%2012h3v1h-3zM33%2013h3v1h-3zM34%2014h3v1h-3zM35%2015h3v1h-3zM36%2016h2v2h-2zM38%2017h1v2h-1zM37%2018h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M19%2045h1v1h-1zM20%2046h2v1h-2zM22%2047h2v1h-2zM24%2048h2v1h-2zM26%2049h2v1h-2zM28%2050h2v1h-2zM30%2051h2v1h-2zM32%2052h2v1h-2zM44%2052h1v1h-1zM34%2053h2v1h-2zM42%2053h2v1h-2zM36%2054h2v1h-2zM40%2054h2v1h-2zM38%2055h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M27%2031h1v10h-1zM28%2032h1v10h-1z'/%3e%3c/svg%3e`,Zn=`/assets/icon-B_7Zk4lP.svg`,Qn=`/assets/icon-61pmFc-p.svg`,$n=`/assets/icon-BGymHyAZ.svg`,er=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2018'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23fd7357'%20d='M12%200h1v1h-1zM11%201h1v1h-1zM10%202h2v1h-2zM9%203h2v1h-2zM8%204h3v1h-3zM7%205h3v1h-3zM6%206h4v1h-4zM5%207h4v1h-4zM4%208h5v1h-5zM3%209h10v1h-10zM8%2010h4v1h-4zM7%2011h4v1h-4zM7%2012h3v1h-3zM6%2013h3v1h-3zM6%2014h2v1h-2zM5%2015h2v1h-2zM5%2016h1v1h-1zM4%2017h1v1h-1z'/%3e%3cpath%20fill='%23050505'%20d='M13%200h1v1h-1zM3%201h1v1h-1zM7%201h1v1h-1zM12%201h1v1h-1zM6%202h1v1h-1zM12%202h1v1h-1zM5%203h1v1h-1zM11%203h1v1h-1zM4%204h1v1h-1zM11%204h1v1h-1zM10%205h1v1h-1zM10%206h1v1h-1zM9%207h1v1h-1zM9%208h1v1h-1zM13%209h1v1h-1zM12%2010h1v1h-1zM11%2011h1v1h-1zM10%2012h1v1h-1zM9%2013h1v1h-1zM8%2014h1v1h-1zM12%2014h1v1h-1zM7%2015h1v1h-1zM11%2015h1v1h-1zM6%2016h1v1h-1zM10%2016h1v1h-1zM5%2017h1v1h-1zM13%2017h1v1h-1z'/%3e%3c/svg%3e`,tr=`/assets/icon-D1hVTa1Q.svg`,nr=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23ce5d97'%20d='M9%2026h10v4h-10zM9%2030h1v6h-1zM12%2030h7v2h-7zM19%2031h10v4h-10zM12%2032h3v6h-3zM16%2032h3v1h-3zM17%2033h2v7h-2zM10%2034h2v3h-2zM19%2035h1v6h-1zM22%2035h7v2h-7zM15%2036h1v3h-1zM29%2036h10v4h-10zM16%2037h1v3h-1zM22%2037h3v6h-3zM26%2037h3v1h-3zM14%2038h1v1h-1zM27%2038h2v7h-2zM20%2039h2v3h-2zM18%2040h1v1h-1zM29%2040h1v6h-1zM32%2040h7v2h-7zM25%2041h1v3h-1zM26%2042h1v3h-1zM32%2042h3v6h-3zM36%2042h3v1h-3zM24%2043h1v1h-1zM37%2043h2v7h-2zM30%2044h2v3h-2zM28%2045h1v1h-1zM35%2046h1v3h-1zM36%2047h1v3h-1zM34%2048h1v1h-1zM38%2050h1v1h-1z'/%3e%3cpath%20fill='%23575653'%20d='M24%2017h10v1h-10zM22%2018h10v1h-10zM20%2019h10v1h-10zM18%2020h10v1h-10zM16%2021h10v1h-10zM14%2022h10v1h-10zM34%2022h8v2h-8zM12%2023h10v1h-10zM32%2023h2v5h-2zM10%2024h10v1h-10zM30%2024h2v5h-2zM34%2024h6v1h-6zM28%2025h2v5h-2zM34%2025h4v1h-4zM26%2026h2v4h-2zM34%2026h2v1h-2zM24%2027h2v3h-2zM50%2027h4v1h-4zM22%2028h2v2h-2zM49%2028h3v1h-3zM20%2029h2v1h-2zM40%2029h2v5h-2zM47%2029h3v1h-3zM38%2030h2v5h-2zM42%2030h6v1h-6zM36%2031h2v4h-2zM42%2031h4v1h-4zM34%2032h2v3h-2zM42%2032h2v1h-2zM32%2033h2v2h-2zM30%2034h2v1h-2z'/%3e%3cpath%20fill='%23403e3c'%20d='M34%2018h1v4h-1zM32%2019h2v1h-2zM30%2020h2v4h-2zM28%2021h2v1h-2zM26%2022h2v4h-2zM24%2023h2v1h-2zM22%2024h2v4h-2zM9%2025h10v1h-10zM20%2025h2v1h-2zM40%2025h2v4h-2zM19%2026h1v5h-1zM38%2026h2v1h-2zM36%2027h2v4h-2zM34%2028h2v1h-2zM54%2028h1v5h-1zM32%2029h2v4h-2zM52%2029h2v1h-2zM20%2030h9v1h-9zM30%2030h2v1h-2zM50%2030h2v5h-2zM29%2031h1v5h-1zM48%2031h2v1h-2zM46%2032h2v5h-2zM44%2033h2v1h-2zM52%2033h2v1h-2zM42%2034h2v5h-2zM30%2035h9v1h-9zM40%2035h2v1h-2zM48%2035h2v1h-2zM39%2036h1v5h-1zM44%2037h2v1h-2zM40%2039h2v1h-2z'/%3e%3cpath%20fill='%23a02f6f'%20d='M54%2033h1v10h-1zM52%2034h2v10h-2zM50%2035h2v10h-2zM48%2036h2v10h-2zM46%2037h2v10h-2zM44%2038h2v10h-2zM42%2039h2v10h-2zM40%2040h2v10h-2zM39%2041h1v10h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M43%2013h6v1h-6zM42%2014h1v1h-1zM49%2014h1v1h-1zM41%2015h1v7h-1zM50%2015h1v12h-1zM24%2016h11v1h-11zM22%2017h2v1h-2zM35%2017h1v5h-1zM20%2018h2v1h-2zM18%2019h2v1h-2zM16%2020h2v1h-2zM14%2021h2v1h-2zM36%2021h5v1h-5zM12%2022h2v1h-2zM10%2023h2v1h-2zM9%2024h1v1h-1zM8%2025h1v11h-1zM51%2026h4v1h-4zM55%2027h1v16h-1zM9%2036h1v1h-1zM10%2037h2v1h-2zM12%2038h2v1h-2zM14%2039h2v1h-2zM16%2040h2v1h-2zM18%2041h2v1h-2zM20%2042h2v1h-2zM22%2043h2v1h-2zM54%2043h1v1h-1zM24%2044h2v1h-2zM52%2044h2v1h-2zM26%2045h2v1h-2zM50%2045h2v1h-2zM28%2046h2v1h-2zM48%2046h2v1h-2zM30%2047h2v1h-2zM46%2047h2v1h-2zM32%2048h2v1h-2zM44%2048h2v1h-2zM34%2049h2v1h-2zM42%2049h2v1h-2zM36%2050h2v1h-2zM40%2050h2v1h-2zM38%2051h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M10%2030h2v4h-2zM15%2032h1v4h-1zM16%2033h1v4h-1zM20%2035h2v4h-2zM25%2037h1v4h-1zM26%2038h1v4h-1zM30%2040h2v4h-2zM35%2042h1v4h-1zM36%2043h1v4h-1z'/%3e%3cpath%20fill='%23343331'%20d='M34%2017h1v1h-1zM32%2018h2v1h-2zM30%2019h2v1h-2zM28%2020h2v1h-2zM26%2021h2v1h-2zM24%2022h2v1h-2zM22%2023h2v1h-2zM20%2024h2v1h-2zM40%2024h2v1h-2zM19%2025h1v1h-1zM38%2025h2v1h-2zM36%2026h2v1h-2zM34%2027h2v1h-2zM54%2027h1v1h-1zM32%2028h2v1h-2zM52%2028h2v1h-2zM30%2029h2v1h-2zM50%2029h2v1h-2zM29%2030h1v1h-1zM48%2030h2v1h-2zM46%2031h2v1h-2zM44%2032h2v1h-2zM42%2033h2v1h-2zM40%2034h2v1h-2zM39%2035h1v1h-1z'/%3e%3cpath%20fill='%23e47da8'%20d='M32%2021h2v2h-2zM28%2023h2v2h-2zM24%2025h2v2h-2zM20%2027h2v2h-2zM38%2028h2v2h-2zM34%2030h2v2h-2zM52%2031h2v2h-2zM30%2032h2v2h-2zM48%2033h2v2h-2zM44%2035h2v2h-2zM40%2037h2v2h-2z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M11%2038h1v1h-1zM12%2039h2v1h-2zM14%2040h2v1h-2zM16%2041h2v1h-2zM18%2042h2v1h-2zM20%2043h2v1h-2zM22%2044h2v1h-2zM24%2045h2v1h-2zM52%2045h1v1h-1zM26%2046h2v1h-2zM50%2046h2v1h-2zM28%2047h2v1h-2zM48%2047h2v1h-2zM30%2048h2v1h-2zM46%2048h2v1h-2zM32%2049h2v1h-2zM44%2049h2v1h-2zM34%2050h2v1h-2zM42%2050h2v1h-2zM36%2051h2v1h-2zM40%2051h2v1h-2zM38%2052h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M43%2014h6v2h-6zM43%2016h2v14h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M42%2016h1v14h-1zM45%2017h2v13h-2z'/%3e%3cpath%20fill='%23878580'%20d='M49%2016h1v12h-1zM47%2017h2v12h-2z'/%3e%3cpath%20fill='%23f4a4c2'%20d='M32%2020h2v1h-2zM28%2022h2v1h-2zM24%2024h2v1h-2zM20%2026h2v1h-2zM38%2027h2v1h-2zM34%2029h2v1h-2zM52%2030h2v1h-2zM30%2031h2v1h-2zM48%2032h2v1h-2zM44%2034h2v1h-2zM40%2036h2v1h-2z'/%3e%3cpath%20fill='%23e6e4d9'%20d='M42%2015h1v1h-1zM49%2015h1v1h-1zM45%2016h4v1h-4z'/%3e%3c/svg%3e`,rr=`/assets/icon-THdxja9j.svg`,ir=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%234385be'%20d='M17%2017h1v25h-1zM18%2018h2v25h-2zM20%2019h2v2h-2zM22%2020h2v25h-2zM24%2021h2v25h-2zM26%2022h2v2h-2zM28%2023h2v25h-2zM30%2024h2v25h-2zM32%2025h2v2h-2zM34%2026h2v25h-2zM36%2027h1v25h-1z'/%3e%3cpath%20fill='%23205ea6'%20d='M21%2021h1v23h-1zM46%2022h1v25h-1zM44%2023h2v25h-2zM27%2024h1v23h-1zM42%2024h2v25h-2zM40%2025h2v25h-2zM38%2026h2v25h-2zM33%2027h1v23h-1zM37%2027h1v25h-1z'/%3e%3cpath%20fill='%2366a0c8'%20d='M24%2013h2v7h-2zM22%2014h2v5h-2zM20%2015h2v3h-2zM30%2015h2v8h-2zM18%2016h2v1h-2zM32%2016h2v8h-2zM26%2018h4v3h-4zM38%2018h2v7h-2zM40%2019h2v5h-2zM42%2020h2v3h-2zM20%2021h1v23h-1zM28%2021h2v1h-2zM44%2021h2v1h-2zM34%2022h4v3h-4zM26%2024h1v23h-1zM36%2025h2v1h-2zM32%2027h1v23h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M26%209h4v1h-4zM25%2010h1v3h-1zM30%2010h2v1h-2zM32%2011h2v1h-2zM24%2012h1v1h-1zM34%2012h2v1h-2zM22%2013h2v1h-2zM36%2013h2v1h-2zM20%2014h2v1h-2zM38%2014h1v4h-1zM18%2015h2v1h-2zM17%2016h1v1h-1zM16%2017h1v25h-1zM39%2017h1v1h-1zM40%2018h2v1h-2zM42%2019h2v1h-2zM44%2020h2v1h-2zM46%2021h1v1h-1zM47%2022h1v25h-1zM17%2042h1v1h-1zM18%2043h1v3h-1zM19%2046h2v1h-2zM23%2046h3v1h-3zM21%2047h2v1h-2zM26%2047h2v1h-2zM46%2047h1v1h-1zM28%2048h2v1h-2zM45%2048h1v3h-1zM30%2049h2v1h-2zM32%2050h2v1h-2zM33%2051h1v2h-1zM40%2051h1v2h-1zM43%2051h2v1h-2zM41%2052h2v1h-2zM34%2053h1v1h-1zM39%2053h1v1h-1zM35%2054h4v1h-4z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M26%2011h2v7h-2zM28%2012h2v2h-2zM30%2013h2v2h-2zM32%2014h2v2h-2zM34%2015h2v7h-2z'/%3e%3cpath%20fill='%2392bfdb'%20d='M18%2017h2v1h-2zM20%2018h2v1h-2zM22%2019h2v1h-2zM24%2020h2v1h-2zM26%2021h2v1h-2zM28%2022h2v1h-2zM44%2022h2v1h-2zM30%2023h2v1h-2zM42%2023h2v1h-2zM32%2024h2v1h-2zM40%2024h2v1h-2zM34%2025h2v1h-2zM38%2025h2v1h-2zM36%2026h2v1h-2z'/%3e%3cpath%20fill='%23878580'%20d='M28%2014h2v4h-2zM36%2015h2v7h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M26%2010h4v1h-4zM28%2011h4v1h-4zM30%2012h4v1h-4zM32%2013h4v1h-4zM34%2014h4v1h-4z'/%3e%3cpath%20fill='%23403e3c'%20d='M19%2043h1v3h-1zM21%2044h1v3h-1zM22%2045h1v2h-1zM42%2049h1v3h-1zM41%2050h1v2h-1zM34%2051h1v2h-1zM36%2052h2v2h-2z'/%3e%3cpath%20fill='%23343331'%20d='M23%2045h1v1h-1zM44%2048h1v3h-1zM43%2049h1v2h-1zM38%2051h2v2h-2zM38%2053h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M21%2048h1v1h-1zM41%2053h2v1h-2zM39%2054h1v1h-1zM36%2055h3v1h-3z'/%3e%3cpath%20fill='%23575653'%20d='M20%2044h1v2h-1zM40%2050h1v1h-1zM35%2051h1v3h-1z'/%3e%3c/svg%3e`,ar=e(n(),1);function or(e){let t=ar.unstable_scheduleCallback(4,e);return()=>ar.unstable_cancelCallback(t)}var sr=J.createContext(Le({scheduleTask:or,defaultIdleTTL:400})),cr=new WeakMap,lr=0,ur=new Set;function dr(e){lr++;try{return e()}finally{lr--}}function fr(e){if(lr===0)return e();ur.size===0&&queueMicrotask(pr),ur.add(e)}function pr(){for(let e of ur)ur.delete(e),e()}function mr(e,t){let n=cr.get(e);n===void 0&&(n=new WeakMap,cr.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>fr(n));return()=>{i--,ur.delete(n),r()}},snapshot(){return dr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:dr(()=>ke(t,e))}),a.value}};return n.set(t,o),o}function hr(e,t){let n=mr(e,t);return J.useEffect(pr),J.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function gr(e,t,n){let r=mr(e,t),i=J.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return J.useEffect(pr),J.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var _r=(e,t)=>{let n=J.useContext(sr);return t?gr(n,e,t):hr(n,e)};function vr(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?J.useCallback(r=>{e.set(t,r);let i=Et(Be(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(yr):i},[e,t,n.mode]):J.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var yr=e=>{if(f(e))return e.value;throw C(e.cause)},br=(e,t)=>{let n=J.useContext(sr);return[hr(n,e),vr(n,e,t)]},xr={suspendOnWaiting:new WeakMap,default:new WeakMap};function Sr(e,t,n){let r=n?xr.suspendOnWaiting:xr.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function Cr(e,t,n){let r=hr(e,t);if(r._tag===`Initial`||n&&r.waiting)throw Sr(e,t,n);return r}var wr=(e,t)=>{let n=Cr(J.useContext(sr),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw C(n.cause);return n};function Tr({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=J.useRef(e!==void 0),[a,o]=J.useState(()=>t);return[i&&e!==void 0?e:a,J.useCallback(e=>{i||o(e)},[])]}function Er(e){let t=J.useRef(!0);t.current&&(t.current=!1,e())}function Dr(e){let t=Rt(Or,e).current;return t.next=e,q(t.effect),t}function Or(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var kr={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Ar={...kr,position:`fixed`,margin:0,top:0,left:0},jr={...kr,position:`absolute`},Mr=[],Nr=void 0;function Pr(){return Nr}function Fr(e){Mr.push(e)}function Ir(e){let t=(t,n)=>{let r=Rt(Rr).current,i;try{Nr=r;for(let e of Mr)e.before(r);i=e(t,n);for(let e of Mr)e.after(r);r.didInitialize=!0}finally{Nr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Lr(e){return J.forwardRef(Ir(e))}function Rr(){return{didInitialize:!1}}var zr=Gt(),Br=bn(),Vr=gn(19)?Wr:Gr;function Hr(e,t,n,r,i){return Vr(e,t,n,r,i)}function Ur(e,t,n,r,i){let a=J.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,zr.useSyncExternalStore)(e.subscribe,a,a)}Fr({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,zr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Wr(e,t,n,r,i){let a=Pr();if(!a)return Ur(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function Gr(e,t,n,r,i){return(0,Br.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Kr=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Hr(this,e,t,n,r)}},qr=class extends Kr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){J.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);q(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){J.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return J.useDebugValue(e),Hr(this,this.selectors[e],t,n,r)}useContextCallback(e,t){J.useDebugValue(e);let n=K(t??yn);this.context[e]=n}useStateSetter(e){let t=J.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Jr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Yr(e){J.useEffect(e,cn)}var Xr=0,Zr=class e{static create(){return new e}currentId=Xr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Xr,t()},e)}isStarted(){return this.currentId!==Xr}clear=()=>{this.currentId!==Xr&&(clearTimeout(this.currentId),this.currentId=Xr)};disposeEffect=()=>this.clear};function Qr(){let e=Rt(Zr.create).current;return Yr(e.disposeEffect),e}function $r(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:ei,platform:ti,maxTouchPoints:ni}=$r(),ri=ei.toLowerCase(),ii=ti.toLowerCase(),ai=/^i(os$|p)/.test(ii)||ii===`macintel`&&ni>1,oi=`android`,si=ii===oi||ri.includes(oi),ci=!ai&&ii.startsWith(`mac`);ii.startsWith(`win`),!si&&/^(linux|chrome os)/.test(ii);var li=ci||ai,ui=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),di=!ui&&ri.includes(`firefox`);!ui&&ri.includes(`chrom`);var fi=li,pi=/jsdom|happydom/.test(ri),mi=null;globalThis.requestAnimationFrame;var hi=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},gi=class e{static create(){return new e}static request(e){return hi.request(e)}static cancel(e){return hi.cancel(e)}currentId=mi;request(e){this.cancel(),this.currentId=hi.request(()=>{this.currentId=mi,e()})}cancel=()=>{this.currentId!==mi&&(hi.cancel(this.currentId),this.currentId=mi)};disposeEffect=()=>this.cancel};function _i(){let e=Rt(gi.create).current;return Yr(e.disposeEffect),e}var vi=J.forwardRef(function(e,t){let[n,r]=J.useState();q(()=>{fi&&ui&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:Ar,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function yi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Lt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function bi(e,t){let n=e;for(;n;){if(Vt(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Lt(n)?n.host:null)}return null}function xi(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Si=`data-base-ui-focusable`,Ci=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,wi=`ArrowLeft`,Ti=`ArrowRight`,Ei=`ArrowUp`,Di=`ArrowDown`,Oi=`data-starting-style`,ki=`data-ending-style`,Ai={[Oi]:``},ji={[ki]:``},Mi={transitionStatus(e){return e===`starting`?Ai:e===`ending`?ji:null}},Ni=`data-open`,Pi=`data-closed`,Fi=`data-anchor-hidden`,Ii=`data-popup-open`,Li=`data-pressed`,Ri={[Ii]:``},zi={[Ii]:``,[Li]:``},Bi={[Ni]:``},Vi={[Pi]:``},Hi={[Fi]:``},Ui={open(e){return e?Ri:null}},Wi={open(e){return e?zi:null}},Gi={open(e){return e?Bi:Vi},anchorHidden(e){return e?Hi:null}},Ki={...Gi,...Mi},qi=`data-trigger-disabled`;function Ji(e,t){if(!Vt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(qi);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(qi);return!1}function Yi(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Xi(e){return e.matches(`html,body`)}function Zi(e){return Wt(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function Qi(e){return bi(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ci}`)!=null}function $i(e){return e?e.getAttribute(`role`)===`combobox`&&Zi(e):!1}function ea(e){if(!e||pi)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function ta(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function na(e){e.preventDefault(),e.stopPropagation()}function ra(e){return`nativeEvent`in e}function ia(e){return e.pointerType===``&&e.isTrusted?!0:si&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function aa(e){return pi?!1:!si&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(si||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function oa(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function sa(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var ca=Math.min,la=Math.max,ua=Math.round,da=Math.floor,fa=e=>({x:e,y:e}),pa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ma(e,t,n){return la(e,ca(t,n))}function ha(e,t){return typeof e==`function`?e(t):e}function ga(e){return e.split(`-`)[0]}function _a(e){return e.split(`-`)[1]}function va(e){return e===`x`?`y`:`x`}function ya(e){return e===`y`?`height`:`width`}function ba(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function xa(e){return va(ba(e))}function Sa(e,t,n){n===void 0&&(n=!1);let r=_a(e),i=xa(e),a=ya(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ja(o)),[o,ja(o)]}function Ca(e){let t=ja(e);return[wa(e),t,wa(t)]}function wa(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Ta=[`left`,`right`],Ea=[`right`,`left`],Da=[`top`,`bottom`],Oa=[`bottom`,`top`];function ka(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ea:Ta:t?Ta:Ea;case`left`:case`right`:return t?Da:Oa;default:return[]}}function Aa(e,t,n,r){let i=_a(e),a=ka(ga(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(wa)))),a}function ja(e){let t=ga(e);return pa[t]+e.slice(t.length)}function Ma(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Na(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ma(e)}function Pa(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Fa(e,t,n){return Math.floor(e/t)!==n}function Ia(e,t){return t<0||t>=e.length}function La(e,t){return Ba(e.current,{disabledIndices:t})}function Ra(e,t){return Ba(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function za(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Ba(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Ia(e,u)?-1:u,wrapped:d}}function Ba(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&Ha(e,a,r));return a}function Va(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=bi(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!Ha(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=da(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!Ha(e,r,s))return r}};d&&na(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Ba(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Ba(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Ia(e,f)&&(f=u)}if(n===`both`){let n=da(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&na(t),u%o===o-1?r&&(f=Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ba(e,{startingIndex:u,disabledIndices:s}),r&&Fa(f,o,n)&&(f=Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Fa(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&na(t),u%o===0?r&&(f=Ba(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Ba(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Fa(f,o,n)&&(f=Ba(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Fa(f,o,n)&&(f=u));let c=da(l/o)===n;Ia(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Ba(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function Ha(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Wa(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Ua(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Wa(e,t=e?$t(e):null){return!e||!e.isConnected||!t||Ua(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ga=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Ka(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Lt(n)?n.host:null}function qa(e){for(let t of Array.from(e.children))if(mn(t)===`summary`)return t;return null}function Ja(e,t){let n=qa(t);return!!n&&(e===n||Q(n,e))}function Ya(e){let t=e?mn(e):``;return e!=null&&e.matches(Ga)&&(t!==`summary`||e.parentElement!=null&&mn(e.parentElement)===`details`&&qa(e.parentElement)===e)&&(t!==`details`||qa(e)==null)&&(t!==`input`||e.type!==`hidden`)}function Xa(e){if(!Ya(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Ka(t)){let n=t!==e,r=mn(t)===`slot`;if(t.hasAttribute(`inert`)||n&&mn(t)===`details`&&!t.open&&!Ja(e,t)||t.hasAttribute(`hidden`)||!r&&!Za(t,n))return!1}return!0}function Za(e,t){let n=$t(e);return t?n.display!==`none`:Wa(e,n)}function Qa(e){let t=e.tabIndex;if(t<0){let t=mn(e);if(t===`details`||t===`audio`||t===`video`||Wt(e)&&e.isContentEditable)return 0}return t}function $a(e){if(mn(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function eo(e,t){let n=$a(e);if(!n)return!0;let r=t.find(e=>{let t=$a(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=$a(e);return t?.name===n.name&&t.form===n.form})===n}function to(e){if(Wt(e)&&mn(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Wt(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function no(e,t){to(e).forEach(e=>{Ya(e)&&t.push(e),no(e,t)})}function ro(e,t,n){to(e).forEach(e=>{Wt(e)&&e.matches(t)&&n.push(e),ro(e,t,n)})}function io(e){return Xa(e)&&Qa(e)>=0}function ao(e){let t=[];return no(e,t),t.filter(Xa)}function oo(e){let t=ao(e);return t.filter(e=>Qa(e)>=0&&eo(e,t))}function so(e,t){let n=oo(e),r=n.length;if(r===0)return;let i=yi(qn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function co(e){return so(qn(e).body,1)||e}function lo(e){return so(qn(e).body,-1)||e}function uo(e,t,n){if(!e)return null;let r=[];no(qn(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(Xa);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&io(o)&&eo(o,a))return o}return r[i]}function fo(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function po(e){oo(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function mo(e){let t=[];ro(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function ho(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...ho(e,t.id,n)])}function go(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function $(e,t,n,r){let i=!1,a=!1,o=r??ln;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function _o(e,t,n){let r=n??ln;return{reason:e,event:t??new Event(`base-ui`),...r}}var vo=`none`,yo=`trigger-press`,bo=`trigger-hover`,xo=`trigger-focus`,So=`outside-press`,Co=`item-press`,wo=`close-press`,To=`clear-press`,Eo=`input-change`,Do=`input-clear`,Oo=`input-press`,ko=`focus-out`,Ao=`escape-key`,jo=`list-navigation`,Mo=`keyboard`,No=`pointer`,Po=`cancel-open`,Fo=`sibling-open`,Io=`imperative-action`;function Lo(e){return`data-base-ui-${e}`}var Ro=0;function zo(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Ro);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),yn;let o=requestAnimationFrame(a);return Ro=o,()=>{Ro===o&&(cancelAnimationFrame(o),Ro=0)}}var Bo=`data-base-ui-inert`,Vo=new WeakMap,Ho=new WeakSet,Uo=new WeakMap,Wo=0;function Go(e){return e?Lt(e)?e.host:Go(e.parentNode):null}var Ko=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Go(t);return e.contains(n)?n:null}).filter(e=>e!=null),qo=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Jo=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{mn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Yo(e,t,n,{mark:r=!0}){let i=Ko(t,e),a=r?Jo(t,qo(i),new Set(i)):[],o=[],s=[];if(n){let e=Ko(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Jo(t,qo(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Vo.get(e)||0)+1;Vo.set(e,r),o.push(e),r===1&&n&&Ho.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Uo.get(e)||0)+1;Uo.set(e,t),s.push(e),t===1&&e.setAttribute(Bo,``)}),Wo+=1,()=>{o.forEach(e=>{let t=(Vo.get(e)||0)-1;Vo.set(e,t),t||(Ho.has(e)||e.removeAttribute(`aria-hidden`),Ho.delete(e))}),r&&s.forEach(e=>{let t=(Uo.get(e)||0)-1;Uo.set(e,t),t||e.removeAttribute(Bo)}),--Wo,Wo||(Vo=new WeakMap,Ho=new WeakSet,Uo=new WeakMap)}}function Xo(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=qn(e[0]).body;return Yo(e,i,n,{mark:r})}function Zo(){let[,e]=J.useState({});return J.useCallback(()=>{e({})},[])}var Qo=0;function $o(e,t=`mui`){let n=J.useRef(void 0),r=Zo(),i=e??n.current;return J.useEffect(()=>{n.current??(Qo+=1,n.current=`${t}-${Qo}`,e??r())},[e,t,r]),i}var es=En.useId;function ts(e,t){if(es!==void 0){let n=es();return e??(t?`${t}-${n}`:n)}return $o(e,t)}var ns={style:{transition:`none`}},rs={fallbackAxisSide:`none`},is={fallbackAxisSide:`end`},as={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},os=J.createContext(null),ss=()=>J.useContext(os),cs=Lo(`portal`);function ls(e={}){let{ref:t,container:n,componentProps:r=ln,elementProps:i}=e,a=ts(),o=ss()?.portalNode,[s,c]=J.useState(null),[l,u]=J.useState(null),d=K(e=>{e!==null&&u(e)}),f=J.useRef(null);q(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Qt(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=hn(`div`,r,{ref:[t,d],props:[{id:a,[cs]:``},i]}),m=s&&p?Jn.createPortal(p,s):null;return{node:l,nodeId:J.isValidElement(p)?p.props.id:void 0,subtree:m}}var us=J.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=ls({container:o,ref:t,componentProps:e,elementProps:c}),f=J.useRef(null),p=J.useRef(null),m=J.useRef(null),h=J.useRef(null),[g,_]=J.useState(null),v=J.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;J.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&fo(e)&&(e.type===`focusin`?v.current&&=(mo(l),!1):(po(l),v.current=!0))}return Jr(Z(l,`focusin`,e,!0),Z(l,`focusout`,e,!0))},[l,y]),q(()=>{l&&b===!0&&v.current&&(mo(l),v.current=!1)},[b,l]);let S=J.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Y.jsxs)(J.Fragment,{children:[d,(0,Y.jsxs)(os.Provider,{value:S,children:[x&&l&&(0,Y.jsx)(vi,{"data-type":`outside`,ref:f,onFocus:e=>{fo(e,l)?m.current?.focus():lo(g?g.domReference:null)?.focus()}}),x&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:as}),l&&Jn.createPortal(a,l),x&&l&&(0,Y.jsx)(vi,{"data-type":`outside`,ref:p,onFocus:e=>{fo(e,l)?h.current?.focus():(co(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$(`focus-out`,e.nativeEvent)))}})]})]})});function ds(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var fs=class{nodesRef={current:[]};events=ds();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},ps=J.createContext(null),ms=J.createContext(null),hs=()=>J.useContext(ps)?.id||null,gs=e=>{let t=J.useContext(ms);return e??t};function _s(e){let t=ts(),n=gs(e),r=hs();return q(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function vs(e){let{children:t,id:n}=e,r=hs();return(0,Y.jsx)(ps.Provider,{value:J.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function ys(e){let{children:t,externalTree:n}=e,r=Rt(()=>n??new fs).current;return(0,Y.jsx)(ms.Provider,{value:r,children:t})}function bs(e){return e==null?e:`current`in e?e.current:e}function xs(e,t){let n=Yt(xi(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(ia(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Ss=20,Cs=[];function ws(){Cs=Cs.filter(e=>e.deref()?.isConnected)}function Ts(e){ws(),e&&mn(e)!==`body`&&(Cs.push(new WeakRef(e)),Cs.length>Ss&&(Cs=Cs.slice(-20)))}function Es(){return ws(),Cs[Cs.length-1]?.deref()}function Ds(e){return e?io(e)?e:oo(e)[0]||e:null}function Os(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=ao(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return io(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ks(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=K(()=>b.current.floatingContext?.nodeId),S=i===!1,C=$i(_)&&S,w=Dr(i),T=Dr(a),E=Dr(o),D=Dr(u),O=Dr(g),k=gs(m),A=ss(),j=J.useRef(!1),M=J.useRef(!1),N=J.useRef(!1),P=J.useRef(null),F=J.useRef(``),I=J.useRef(``),L=J.useRef(null),R=J.useRef(null),ee=dn(L,p,A?.beforeInsideRef),te=dn(R,A?.afterInsideRef),ne=Qr(),z=Qr(),re=_i(),ie=A!=null,B=ta(v),V=K((e=B)=>e?oo(e):[]),ae=K(()=>h?.().filter(e=>e!=null)??[]);J.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(B,yi(qn(B)))&&V().length===0&&!C&&na(e)}return Z(qn(B),`keydown`,e)},[r,B,c,C,V]),J.useEffect(()=>{if(r||!g)return;let e=qn(B);function t(){N.current=!1}function n(e){let t=xi(e),n=ae(),r=Q(v,t)||Q(_,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,bi(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,z.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Jr(Z(e,`pointerdown`,n,!0),Z(e,`pointerup`,t,!0),Z(e,`pointercancel`,t,!0),Z(e,`keydown`,i,!0),t)},[r,v,_,B,g,A,z,ae]),J.useEffect(()=>{if(r||!l)return;let e=qn(B);function n(){M.current=!0,z.start(0,()=>{M.current=!1})}function i(e){let t=xi(e);io(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=xi(n);c&&r==null&&a!=null&&Q(v,a)&&Ts(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=ae(),p=r?.hasAttribute(Lo(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,bs(f),bs(d)].includes(r),m=!(Q(_,r)||Q(v,r)||Q(r,v)||Q(A?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||k&&(ho(k.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||go(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,ta(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&B&&Os(B),s&&i!==_&&!Wa(a)&&yi(e)===e.body){if(Wt(B)&&(B.focus(),s===`popup`)){re.request(()=>{B.focus()});return}let e=V(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||B;Wt(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==Es())&&(j.current=!0,t.setOpen(!1,$(ko,n)))})}function o(){N.current||(b.current.insideReactTree=!0,ne.start(0,()=>{b.current.insideReactTree=!1}))}let u=Wt(_)?_:null;if(v||u)return Jr(u&&Z(u,`focusout`,a),u&&Z(u,`pointerdown`,n),v&&Z(v,`focusin`,i),v&&Z(v,`focusout`,a),v&&A&&Z(v,`focusout`,o,!0))},[r,_,v,B,c,k,A,t,l,s,V,C,x,b,ne,z,re,d,f,ae]),J.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${Lo(`portal`)}]`)||[]),t=(k?go(k.nodesRef.current,x()):[]).find(e=>$i(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Xo([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...ae(),t,bs(f),bs(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Xo([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,ae]),q(()=>{if(!g||r||!Wt(B))return;F.current=``,I.current=``;let e=qn(B),t=yi(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(B,t))return;let i=null,a=()=>(i??=V(B),i[0]||B),o;o=r===!0||r===null?a():bs(r),o||=a();let s=Q(B,yi(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&ia(c);zo(o,{sync:l,preventScroll:o===B,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=yi(e);return!(t!==o&&Q(B,t))}})})},[r,g,B,V,w,D,O,b]);let oe=J.useRef(null);q(()=>{if(r||!B){oe.current=null;return}oe.current&&=(oe.current.cancelled=!0,null);let e=qn(B),t=yi(e),n=D.current==null;Ts(t);function i(e){if(e.open||(F.current=xs(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Lo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(ia(e.nativeEvent)||aa(e.nativeEvent))j.current=!1;else{let e=!1;qn(B).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&mn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=Es()||null,typeof i==`boolean`?s:bs(i)||s||null}return()=>{y.off(`openchange`,i);let t=yi(e),n=ae(),r=Q(v,t)||n.some(e=>e===t||Q(e,t))||k&&ho(k.nodesRef.current,x(),!1).some(e=>Q(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};oe.current=l,queueMicrotask(()=>{oe.current===l&&(oe.current=null);let n=Ds(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&Wt(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,B,T,E,D,y,k,_,x,ae]),q(()=>{if(!ui||g||!v)return;let e=yi(qn(v));Wt(e)&&Zi(e)&&Q(v,e)&&e.blur()},[g,v]),q(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),q(()=>{if(!r&&B)return Os(B),()=>{queueMicrotask(ws)}},[r,B]);let se=!r&&(!c||!C)&&(ie||c);return(0,Y.jsxs)(J.Fragment,{children:[se&&(0,Y.jsx)(vi,{"data-type":`inside`,ref:ee,onFocus:e=>{if(c){let e=V();zo(e[e.length-1])}else A?.portalNode&&(j.current=!1,fo(e,A.portalNode)?co(_)?.focus():bs(f??A.beforeOutsideRef)?.focus())}}),n,se&&(0,Y.jsx)(vi,{"data-type":`inside`,ref:te,onFocus:e=>{c?zo(V()[0]):A?.portalNode&&(l&&(j.current=!0),fo(e,A.portalNode)?lo(_)?.focus():bs(d??A.afterOutsideRef)?.focus())}})]})}function As(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=yo}=t,l=e.context.dataRef,u=J.useRef(void 0),d=_i(),f=Qr(),p=J.useMemo(()=>{function t(t,n,r,i){let a=$(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=oa(e.pointerType,!0)&&aa(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||oa(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=xi(s),p=Zi(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:oa(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return J.useMemo(()=>n?{reference:p}:ln,[n,p])}function js(){return!1}function Ms(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function Ns(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=js,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=gs(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=K(()=>a),{escapeKey:v,outsidePress:y}=Ms(s),b=J.useRef(!1),x=J.useRef(!1),S=J.useRef(!1),C=J.useRef(!1),w=J.useRef(!1),T=J.useRef(``),E=J.useRef(null),D=Qr(),O=Qr(),k=Qr(),A=K(()=>{O.clear(),d.current.insideReactTree=!1}),j=K(e=>{let t=d.current.floatingContext?.nodeId;return(p?ho(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=K(t=>Yi(t,e.select(`floatingElement`))||Yi(t,e.select(`domReferenceElement`))),N=K(t=>{o()&&e.setOpen(!1,$(yo,t.nativeEvent))}),P=K(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=ra(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=$(Ao,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=K(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=K(t=>{if(!l||!n||t.button!==0)return;let r=xi(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=K(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});J.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),J.useEffect(()=>A,[A]),J.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Zr,i=qn(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(ui?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&ho(p.nodesRef.current,t).some(t=>Yi(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=xi(n),i=`[${Lo(`inert`)}]`,a=Vt(r)?r.getRootNode():null,o=Array.from((Lt(a)?a:qn(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=Vt(r)?r:null;for(;c&&!qt(c);){let e=Jt(c);if(qt(e)||!Vt(e))break;c=e}if(!(o.length&&Vt(r)&&!Xi(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(Wt(r)&&!(`touches`in n)){let e=qt(r),t=$t(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!ia(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,$(So,n)),A())}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=xi(e);if(!n)return;let r=Z(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function ee(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function te(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function ne(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function z(e){L(e,ne)}function re(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ie(e){L(e,re)}let B=Jr(r&&Jr(Z(i,`keydown`,P),Z(i,`compositionstart`,a),Z(i,`compositionend`,o)),g&&Jr(Z(i,`click`,ee,!0),Z(i,`pointerdown`,ee,!0),Z(i,`pointerup`,te,!0),Z(i,`pointercancel`,te,!0),Z(i,`mousedown`,ee,!0),Z(i,`mouseup`,te,!0),Z(i,`touchstart`,R,{capture:!0,passive:!0}),Z(i,`touchmove`,z,{capture:!0,passive:!0}),Z(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{B(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=J.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),ee=J.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return J.useMemo(()=>n?{reference:R,floating:ee,trigger:R}:{},[n,R,ee])}function Ps(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Vt(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Fs(e,t=!1,n=!1,r=!1){let[i,a]=J.useState(e&&t?`idle`:void 0),[o,s]=J.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),q(()=>{if(!e&&o&&i!==`ending`&&n){let e=gi.request(()=>{a(`ending`)});return()=>{gi.cancel(e)}}},[e,o,i,n]),q(()=>{if(!e||t||i===void 0)return;let n=gi.request(()=>{a(void 0)});return()=>{gi.cancel(n)}},[t,e,i]),q(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=gi.request(()=>{a(`idle`)});return()=>{gi.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Is(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Ls=null;function Rs(e){if(!Ls){let e=[];Ls=e,queueMicrotask(()=>{Ls=null,Jn.flushSync(()=>{for(let t of e)t()})})}Ls.push(e)}function zs(e,t=!1,n=!1){let r=_i();return K((i,a=null)=>{r.cancel();let o=bs(e);if(o==null)return;let s=o,c=()=>{n?Rs(()=>{a?.aborted||i()}):Jn.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Is(s).map(e=>e.finished.then(yn))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Is(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Oi;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Bs(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=zs(r,n,i);J.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Vs(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=K(i),{mounted:c,setMounted:l,transitionStatus:u}=Fs(t,!1,!1,o),d=!t&&r;q(()=>{t&&s(!1)},[t,s]);let f=J.useRef(c),p=J.useRef(!1),m=Zo(),h=()=>{f.current=!1,l(!1),a()};q(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=K(()=>{f.current&&(t?(p.current=!0,m()):h())});return Bs({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Hs={tabIndex:-1,[Si]:``};function Us({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function Ws(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Gs(e,t){let n=J.useRef(null);return K(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),Ws(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),Ws(t))})}function Ks(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function qs(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Js(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Gs(e,n),o=K(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=K(e=>{a(e),e&&o(e)});return q(()=>(s(t.current),()=>s(null)),[s,t,n,e]),q(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ys(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=J.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);q(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=$(vo);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Xs(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Vs({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return Rt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Zs(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln})},[e])}var Qs=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},$s={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId},ec=class extends qr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:ds(),nested:n,triggerElements:i},$s),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&sa(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function tc(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ec({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ln,inactiveTriggerProps:ln,popupProps:ln}}var nc=e=>e.triggerIdProp??e.activeTriggerId,rc=e=>e.openProp??e.open,ic=e=>(e.popupElement?.id??e.floatingId)||void 0;function ac(e,t){return t!==void 0&&rc(e)&&nc(e)===t}function oc(e,t){return ac(e,t)?!0:t!==void 0&&rc(e)&&nc(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var sc={open:rc,mounted:e=>e.mounted,transitionStatus:e=>rc(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:nc,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:ic,isTriggerActive:(e,t)=>t!==void 0&&nc(e)===t,isOpenedByTrigger:(e,t)=>ac(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&nc(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>oc(e,t)?ic(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function cc(e){let t=J.useCallback(t=>e===void 0?yn:e.subscribeStore(t),[e]),n=J.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,zr.useSyncExternalStore)(t,n,()=>e?.serverStore)}function lc(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=ts(),a=hs()!=null,o=Rt(()=>new ec({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Qs,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Vt(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var uc=ci&&ui;function dc(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=J.useRef(!1),s=J.useRef(null),c=J.useRef(!0),l=Qr();J.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Yt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Wt(t)&&t===yi(qn(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Jr(Z(r,`blur`,i),uc&&Z(r,`keydown`,a,!0),uc&&Z(r,`pointerdown`,l,!0))},[e,n]),J.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Vt(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=J.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=xi(n.nativeEvent);if(Vt(a)){if(uc&&!n.relatedTarget){if(!c.current&&!Zi(a))return}else if(!ea(a))return}let u=Ji(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,$(xo,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,$(xo,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Vt(r)&&r.hasAttribute(Lo(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=yi(qn(t));!r&&n===t||Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||Ji(r??n,e.context.triggerElements)||e.setOpen(!1,$(xo,i))})}}},[a,r,e,l]);return J.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var fc=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Zr;restTimeout=new Zr;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},pc=new WeakMap;function mc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&pc.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),pc.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function hc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=pc.get(n);a&&a!==e&&mc(a),mc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,pc.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function gc(e){let t=e.context.dataRef.current,n=Rt(()=>t.hoverInteractionState??fc.create()).current;return t.hoverInteractionState||=n,Yr(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function _c(e,t){return t!=null&&!oa(t)?0:typeof e==`function`?e():e}function vc(e,t,n){let r=_c(e,n);return typeof r==`number`?r:r?.[t]}function yc(e){return typeof e==`function`?e():e}function bc(e,t){return t||e===`click`||e===`mousedown`}function xc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Sc(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=gs(),u=hs(),d=gc(e),f=Qr(),p=K(()=>bc(c.current.openEvent?.type,d.interactedInside)),m=K(()=>xc(c.current.openEvent?.type)),h=K(()=>{mc(d)});q(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),J.useEffect(()=>h,[h]),q(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Vt(s)&&o){let e=s,t=o,n=qn(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??bi(e,`[data-rootownerid]`)??n.body;return hc(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),J.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&ho(l.nodesRef.current,u).length>0)}function a(t){let n=vc(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,$(bo,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=xi(e);Qi(t)?d.interactedInside=bi(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Ji(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Vt(o)&&ho(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,$(bo,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Jr(y&&Z(y,`mouseenter`,g),y&&Z(y,`mouseleave`,_),y&&Z(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var Cc={current:null};function wc(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=Cc,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=gs(l),v=gc(e),y=J.useRef(!1),b=Dr(i),x=Dr(r),S=Dr(o),C=Dr(n),w=Dr(p),T=Dr(f),E=K(()=>bc(h.current.openEvent?.type,v.interactedInside)),D=K(()=>w.current?.()!==!1),O=K((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!Vt(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=K(()=>{v.handler&&=(qn(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=K(()=>{mc(v)});return u&&(v.handleCloseOptions=i?.__options),J.useEffect(()=>k,[k]),J.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===bo,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),J.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=vc(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,$(bo,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,$(bo,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Vt(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!oa(v.pointerType))return;let n=yc(S.current),r=vc(x.current,`open`,v.pointerType),i=xi(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Vt(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}Vt(o)&&Vt(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&Vt(c)&&Vt(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,$(bo,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,$(bo,t,c))}):g&&D()&&e.setOpen(!0,$(bo,t,c)))}function o(n){if(E()){A();return}k();let r=qn(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Ji(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&Q(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Z(r,`mouseout`,l):void 0;return s?Jr(Z(r,`mousemove`,i,{once:!0}),Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f):Jr(Z(r,`mouseenter`,i),Z(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),J.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!oa(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;hc(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=yc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,$(bo,n,r))}v.pointerType===`touch`?Jn.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function Tc(e){return ui&&e.movementX===0&&e.movementY===0}function Ec(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Dc(e,t){return Ec(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Oc(e,t,n){return Ec(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function kc(e,t,n){return Ec(t,n?e===wi:e===Ti,e===Di)}function Ac(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ec(t,n?e===Ti:e===wi,e===Ei)}function jc(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=ta(E),A=$i(D),j=Dr(k),M=hs(),N=gs(x),P=J.useRef(f),F=J.useRef(o??-1),I=J.useRef(null),L=J.useRef(!0),R=K(e=>{i(F.current===-1?null:F.current,e)}),ee=J.useRef(!!E),te=J.useRef(T),ne=J.useRef(!1),z=J.useRef(!1),re=J.useRef(null),ie=Dr(h),B=Dr(T),V=Dr(o),ae=Dr(b),oe=_i(),se=_i(),ce=K(()=>{oe.cancel();function e(e){d||(re.current=zo(e,{sync:ne.current,preventScroll:!0}))}let t=n.current[F.current],r=z.current;t&&e(t),(ne.current?e=>e():e=>oe.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),pe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{O.current.orientation=g},[O,g]),q(()=>{T||(I.current=null),T&&f===`auto`||(P.current=f)},[T,f]),q(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(z.current=!0,R())):ee.current&&(F.current=-1,R()))},[a,T,E,o,R]),q(()=>{if(a){if(!T)ne.current=!1;else if(E){if(r==null){if(ne.current=!1,V.current!=null)return;if(ee.current&&(F.current=-1,ce()),(!te.current||!ee.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>se.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||Oc(I.current,_,u)||l?La(n):Ra(n),I.current=null,R())};t()}}else Ia(n.current,r)||(F.current=r,ce(),z.current=!1)}}},[a,T,E,r,V,l,n,_,u,R,ce,se]),q(()=>{if(!a||E||!N||d||!ee.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=yi(qn(D??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),q(()=>{te.current=T,ee.current=!!E});let le=r!=null,H=K(e=>{if(!B.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),ue=K(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),de=K(()=>La(n,ie.current)),fe=K(t=>{if(L.current=!1,ne.current=!0,t.which===229||!B.current&&t.currentTarget===j.current)return;if(l&&Ac(t.key,g,u,w)){Dc(t.key,ue())||na(t),e.setOpen(!1,$(jo,t.nativeEvent));let n=S?.current??D;Wt(n)&&n.focus();return}r!=null&&r!==F.current&&!Ia(n.current,r)&&(F.current=r);let i=F.current,a=La(n,h),o=Ra(n,h);if(A||(t.key===`Home`&&(na(t),F.current=a,R(t)),t.key===`End`&&(na(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(Dc(t.key,g)){na(t);let e=yi(t.currentTarget.ownerDocument);if(T&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){F.current=Oc(t.key,g,u)?a:o,R(t),r===F.current&&ce();return}let{index:l,wrapped:f}=za(n.current,i,{decrement:!Oc(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(ne.current=!1),F.current=l,R(t)}}),pe=J.useMemo(()=>({onFocus(e){ne.current=!0,H(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Tc(e)||(ne.current=!0,z.current=!1,p&&H(e))},onPointerLeave(e){if(!B.current||!L.current||e.pointerType===`touch`)return;ne.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&ae.current&&(re.current?.(),re.current=null,F.current=-1,R(e),!d)){let e=j.current,t=yi(qn(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[H,B,j,p,n,R,ae,d]),U=J.useMemo(()=>d&&T&&le&&{"aria-activedescendant":`${y}-${r}`},[d,T,le,y,r]),me=J.useMemo(()=>({...A?{}:U,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=xi(t.nativeEvent);if(n&&!Q(j.current,n))return;na(t);let r=$(ko,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&Wt(i)&&i.focus()}else fe(t)},onPointerMove(e){Tc(e)||(L.current=!0)}}),[U,fe,j,A,e,T,d,D,S]),he=J.useMemo(()=>{function t(t){e.setOpen(!0,$(jo,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&ia(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&aa(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=kc(n.key,ue(),u),o=Dc(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Zi(n.currentTarget)))return fe(n);if(r||m||!i){if(s){let e=Dc(n.key,ue());I.current=l&&e?null:n.key}l?a&&(na(n),r?(F.current=de(),R(n),d&&j.current?.focus()):t(n)):o&&(V.current!=null&&(F.current=V.current),na(n),!r&&m?t(n):fe(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[fe,f,de,l,R,e,m,g,_,ue,u,V,d,j]),ge=J.useMemo(()=>({...U,...he}),[U,he]);return J.useMemo(()=>a?{reference:ge,floating:me,item:pe,trigger:he}:{},[a,ge,me,he,pe])}function Mc(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=K(s),f=e.useState(`open`),p=Qr(),m=J.useRef(``),h=J.useRef(u??i??-1),g=J.useRef(null),_=K(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Wa(n)||n?.matches(`:disabled`)?!1:o==null||!Ha(cn,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(na(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(na(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=K(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});q(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=J.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return J.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Nc=.1,Pc=Nc*Nc,Fc=.5;function Ic(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Lc(e,t,n,r,i,a,o,s,c,l){let u=!1;return Ic(e,t,n,r,i,a)&&(u=!u),Ic(e,t,i,a,o,s)&&(u=!u),Ic(e,t,o,s,c,l)&&(u=!u),Ic(e,t,c,l,n,r)&&(u=!u),u}function Rc(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function zc(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Bc(e={}){let{blockPointerEvents:t=!1}=e,n=new Zr,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Pc;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=xi(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Vt(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&ho(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=zc(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=zc(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=zc(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=zc(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Rc(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Fc/2:Fc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Fc+1,o=C||T?S.bottom-Fc:S.top,s=C?T?S.bottom-Fc:S.top:S.bottom-Fc;M=Lc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Fc/2:Fc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Fc,o=C||T?S.top+Fc:S.bottom,s=C?T?S.top+Fc:S.bottom:S.top+Fc;M=Lc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Fc/2:Fc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Fc+1,o=w||E?S.right-Fc:S.left,s=w?E?S.right-Fc:S.left:S.right-Fc;M=Lc(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Fc/2:Fc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Fc,o=w||E?S.left+Fc:S.right,s=w?E?S.left+Fc:S.right:S.left+Fc;M=Lc(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Vc(e,t,n){let{reference:r,floating:i}=e,a=ba(t),o=xa(t),s=ya(o),c=ga(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=_a(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Hc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ha(t,e),p=Na(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Pa(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Pa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Uc=50,Wc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Hc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Vc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Uc&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Vc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Gc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ha(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ga(r),_=ba(o),v=ga(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ja(o)]:Ca(o)),x=p!==`none`;!d&&x&&b.push(...Aa(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Sa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===ba(t)||T.every(e=>ba(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=ba(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Kc=new Set([`left`,`top`]);async function qc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ga(n),s=_a(n),c=ba(n)===`y`,l=Kc.has(o)?-1:1,u=a&&c?-1:1,d=ha(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yc=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ha(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ba(i),p=va(f),m=u[p],h=u[f],g=(e,t)=>ma(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Xc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ha(e,t),u={x:n,y:r},d=ba(i),f=va(d),p=u[f],m=u[d],h=ha(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Kc.has(ga(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Zc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=ha(e,t),c=await i.detectOverflow(t,s),l=ga(n),u=_a(n),d=ba(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=ca(p-c[m],g),y=ca(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*la(c.left,c.right):S=p-2*la(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Qc(e){let t=$t(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Wt(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ua(n)!==a||ua(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $c(e){return Vt(e)?e:e.contextElement}function el(e){let t=$c(e);if(!Wt(t))return fa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qc(t),o=(a?ua(n.width):n.width)/r,s=(a?ua(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var tl=fa(0);function nl(e){let t=Yt(e);return!en()||!t.visualViewport?tl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Yt(e)}function il(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$c(e),o=fa(1);t&&(r?Vt(r)&&(o=el(r)):o=el(e));let s=rl(a,n,r)?nl(a):fa(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Yt(a),t=Vt(r)?Yt(r):r,n=e,i=Xt(n);for(;i&&t!==n;){let e=el(i),t=i.getBoundingClientRect(),r=$t(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Yt(i),i=Xt(n)}}return Pa({width:u,height:d,x:c,y:l})}function al(e,t){let n=It(e).scrollLeft;return t?t.left+n:il(zt(e)).left+n}function ol(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-al(e,n),y:n.top+t.scrollTop}}function sl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zt(r),s=t?Ut(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=fa(1),u=fa(0),d=Wt(r);if((d||!a)&&((mn(r)!==`body`||On(o))&&(c=It(r)),d)){let e=il(r);l=el(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ol(o,c):fa(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ll(e){let t=It(e),n=e.ownerDocument.body,r=la(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=la(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+al(e),o=-t.scrollTop;return $t(n).direction===`rtl`&&(a+=la(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ul=25;function dl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Yt(e),a=zt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!en()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(al(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ul&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fl(e,t){let n=il(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=el(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dl(e,n,t);else if(t===`document`)r=ll(zt(e));else if(Vt(t))r=fl(t,n);else{let n=nl(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Pa(r)}function ml(e,t){let n=t.get(e);if(n)return n;let r=pn(e,[],!1).filter(e=>Vt(e)&&mn(e)!==`body`),i=null,a=$t(e).position===`fixed`,o=a?Jt(e):e;for(;Vt(o)&&!qt(o);){let e=$t(o),t=Zt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Jt(o)}return t.set(e,r),r}function hl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ut(t)?[]:ml(t,this._c):[].concat(n),r],o=pl(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=pl(t,a[e],i);s=la(n.top,s),c=ca(n.right,c),l=ca(n.bottom,l),u=la(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gl(e){let{width:t,height:n}=Qc(e);return{width:t,height:n}}function _l(e,t,n){let r=Wt(t),i=zt(t),a=n===`fixed`,o=il(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=fa(0);if((r||!a)&&((mn(t)!==`body`||On(i))&&(s=It(t)),r)){let e=il(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=al(i));let l=i&&!r&&!a?ol(i,s):fa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function vl(e){return $t(e).position===`static`}function yl(e,t){if(!Wt(e)||$t(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zt(e)===n&&(n=n.ownerDocument.body),n}function bl(e,t){let n=Yt(e);if(Ut(e))return n;if(!Wt(e)){let t=Jt(e);for(;t&&!qt(t);){if(Vt(t)&&!vl(t))return t;t=Jt(t)}return n}let r=yl(e,t);for(;r&&tn(r)&&vl(r);)r=yl(r,t);return r&&qt(r)&&vl(r)&&!Zt(r)?n:r||Bt(e)||n}var xl=async function(e){let t=this.getOffsetParent||bl,n=this.getDimensions,r=await n(e.floating);return{reference:_l(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sl(e){return $t(e).direction===`rtl`}var Cl={convertOffsetParentRelativeRectToViewportRelativeRect:sl,getDocumentElement:zt,getClippingRect:hl,getOffsetParent:bl,getElementRects:xl,getClientRects:cl,getDimensions:gl,getScale:el,isElement:Vt,isRTL:Sl};function wl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tl(e,t,n){let r=null,i,a=zt(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=da(d),h=da(a.clientWidth-(u+f)),g=da(a.clientHeight-(d+p)),_=da(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:la(0,ca(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Yt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function El(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$c(e),u=i||a?[...l?pn(l):[],...t?pn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?il(e):null;c&&g();function g(){let t=il(e);h&&!wl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Dl=Jc,Ol=Yc,kl=Gc,Al=Zc,jl=Xc,Ml=(e,t,n)=>{let r=new Map,i=n??{},a={...Cl,...i.platform,_c:r};return Wc(e,t,{...i,platform:a})},Nl=typeof document<`u`?J.useLayoutEffect:function(){};function Pl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Pl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Pl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Il(e,t){let n=Fl(e);return Math.round(t*n)/n}function Ll(e){let t=J.useRef(e);return Nl(()=>{t.current=e}),t}function Rl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=J.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=J.useState(r);Pl(f,r)||p(r);let[m,h]=J.useState(null),[g,_]=J.useState(null),v=J.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=J.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=J.useRef(null),C=J.useRef(null),w=J.useRef(u),T=c!=null,E=Ll(c),D=Ll(i),O=Ll(l),k=J.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ml(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Pl(w.current,t)&&(w.current=t,Jn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Nl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=J.useRef(!1);Nl(()=>(A.current=!0,()=>{A.current=!1}),[]),Nl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=J.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=J.useMemo(()=>({reference:b,floating:x}),[b,x]),N=J.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Il(M.floating,u.x),r=Il(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return J.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var zl=(e,t)=>{let n=Dl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bl=(e,t)=>{let n=Ol(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vl=(e,t)=>({fn:jl(e).fn,options:[e,t]}),Hl=(e,t)=>{let n=kl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ul=(e,t)=>{let n=Al(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Wl(e,t,n,r,i,a,o,s,c,l=2){let u=Va(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Ia(n.current,u)?void 0:u}function Gl(e){return e==null?vo:e.type.startsWith(`key`)?Mo:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?No:vo}var Kl=J.createContext(void 0),ql=J.createContext(void 0),Jl=J.createContext(void 0),Yl=J.createContext(!1),Xl=J.createContext(``);function Zl(){let e=J.useContext(Kl);if(!e)throw Error(Dn(22));return e}function Ql(){let e=J.useContext(ql);if(!e)throw Error(Dn(23));return e}function $l(){let e=J.useContext(Jl);if(!e)throw Error(Dn(24));return e}function eu(){return J.useContext(Xl)}function tu(){return J.useContext(Yl)}function nu(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var ru=(e,t)=>Object.is(e,t);function iu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function au(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!nu(e,t,(e,t)=>iu(e,t,n)):e!==t}function ou(e,t,n){return e?e.some(e=>e!==void 0&&iu(t,e,n)):!1}function su(e,t,n){return e?e.findIndex(e=>e!==void 0&&iu(e,t,n)):-1}function cu(e,t){if(t!==ru)return n=>ou(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function lu(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(cu(t,n)):su(e,t,n);return i===-1?null:i}function uu(e,t,n,r,i,a){return ou(r,t,i)?a!=null&&e>a&&ou(r,n[a],i)?a:e:e===a?lu(n,r,i,!0):a}function du(e,t,n){return e.filter(e=>!iu(t,e,n))}function fu(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function pu(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function mu(e){return pu(e?.[0])}function hu(e){return mu(e)?e.flatMap(e=>e.items):e}function gu(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(mu(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function _u(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return fu(e)}function vu(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?fu(e.value):fu(e)}var yu={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?gu(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>iu(t,e,n)):iu(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},bu=`data-valid`,xu=`data-invalid`,Su={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Cu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},wu={disabled:!1,...Cu},Tu={valid(e){return e===null?null:e?{[bu]:``}:{[xu]:``}}},Eu={invalid:void 0,name:void 0,validityData:{state:Su,errors:[],error:``,value:``,initialValue:null},setValidityData:yn,disabled:void 0,setTouched:yn,setDirty:yn,setFilled:yn,setFocused:yn,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:wu,registerFieldControl:yn,validation:{getValidationProps:(e,t=ln)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:yn,getInputControl:()=>null,commit:async()=>{},change:yn}},Du=J.createContext(Eu);function Ou(e=!0){let t=J.useContext(Du);if(t.setValidityData===yn&&!e)throw Error(Dn(28));return t}function ku(e,t,n,r,i=!0,a){let{registerFieldControl:o}=Ou(),s=Rt(()=>Symbol());q(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var Au=J.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:yn,validationMode:`onSubmit`,submitCountRef:{current:0}});function ju(){return J.useContext(Au)}function Mu(e){return ts(e,`base-ui`)}var Nu=J.createContext({controlId:void 0,registerControlId:yn,resetControlId:yn,labelId:void 0,setLabelId:yn,messageIds:[],setMessageIds:yn,getDescriptionProps:e=>e});function Pu(){return J.useContext(Nu)}function Fu(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=Pu(),o=Mu(),s=Rt(()=>Symbol()),c=J.useRef(!1),l=J.useRef(!1),u=K(()=>{c.current&&i!==yn&&(c.current=!1,i(s.current,void 0))});return q(()=>{if(!n||i===yn){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),q(()=>u,[u]),(n?r:void 0)??t??o}function Iu(e){return e==null?void 0:`${e}-popup`}function Lu(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Ru(e){return Array.isArray(e)?e.map(e=>Ru(e)).join(`,`):e==null?``:String(e)}var zu=new Map;function Bu(e={}){let{locale:t,...n}=e,r={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...n},i=`${Ru(t)}|${JSON.stringify(r)}`,a=zu.get(i);if(a)return a;let o=new Intl.Collator(t,r),s={contains(e,t,n){if(!t)return!0;let r=_u(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(o.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=_u(e,n);return o.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=_u(e,n),i=t.length;return r.length>=i&&o.compare(r.slice(r.length-i),t)===0}};return zu.set(i,s),s}var Vu=Bu;function Hu(e){let t=J.useRef(``),n=J.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:J.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Uu(e,t){let n=J.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Wu(e,t){let{onClick:n,onPointerDown:r}=Hu(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(ai?`touch`:``))}));return J.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Gu(e){let[t,n]=J.useState(null),r=Wu(e,n);return Uu(e,t=>{t&&!e&&n(null)}),J.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Ku(e,t=!1){let{overflowY:n}=$t(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var qu=Symbol(`none`),Ju={value:qu,index:-1},Yu=J.createContext(void 0);function Xu(){return J.useContext(Yu)?.direction??`ltr`}function Zu(e,t,n){let r=e.get(t);if(r!==void 0||n===ru)return r;for(let[r,i]of e)if(iu(r,t,n))return i}function Qu(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=ru,virtualized:j=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:P=!1,limit:F=-1,autoComplete:I=`list`,formAutoComplete:L,locale:R,submitOnItemClick:ee=!1}=e,{clearErrors:te}=ju(),{setDirty:ne,validityData:z,setFilled:re,name:ie,disabled:B,setTouched:V,setFocused:ae,validationMode:oe,validation:se}=Ou(),ce=Xu(),le=Fu({id:t}),H=Vu({locale:R}),ue=Array.isArray(y)?null:y;if(ue&&typeof ue.label!=`function`)throw Error(Dn(100));let de=ue?ue.data:y,fe=ue?.value,pe=fe?void 0:de,U=J.useMemo(()=>{if(!b||!fe)return;let e=hu(b),t=e.map(fe),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Zu(n,r,i)}}},[b,fe]),me=J.useMemo(()=>ue?e=>ue.label(e,A,e=>{let t=U?.findItem(e,A);return t==null?_u(e,O):ue.itemLabel(t)}):O,[ue,O,U,A]),he=J.useMemo(()=>ue?Object.assign(e=>ue.itemLabel(e),{selected:e=>_u(e,me)}):O,[ue,me,O]);function ge(e){return _u(e,me)}let[_e,ve]=J.useState(!1),[ye,be]=J.useState(null),xe=J.useRef(ye),Se=J.useRef([]),Ce=J.useRef([]),we=J.useRef(null),W=J.useRef(null),Te=J.useRef(null),Ee=J.useRef(null),De=J.useRef(null),Oe=J.useRef(!1),ke=J.useRef(null),Ae=J.useRef(null),je=J.useRef(null),Me=J.useRef(Ju),Ne=J.useRef(null),Pe=J.useRef([]),Fe=J.useRef(null),Ie=B||m,Le=ie??f,Re=u===`multiple`,ze=u===`single`,Be=s!==void 0||o!==void 0,Ve=de!==void 0,He=b!==void 0,Ue;Ue=w===`always`?`always`:w?`input-change`:!1;let[We,Ge]=Tr({controlled:i,default:Re?r??cn:r,name:`Combobox`,state:`selectedValue`}),Ke=J.useMemo(()=>x===null?()=>!0:x===void 0?Lu(H,he):x,[x,H,he]),qe=Rt(()=>Be?o??``:ze?ge(We):``).current,[Je,Ye]=Tr({controlled:s,default:qe,name:`Combobox`,state:`inputValue`}),[Xe,Ze]=Tr({controlled:c,default:l,name:`Combobox`,state:`open`}),Qe=mu(de),$e=!Xe&&ye!==null?ye:String(Je).trim(),et=ze?ge(We):``,tt=ze&&!_e&&$e!==``&&et.length===$e.length&&H.contains(et,$e),nt=tt?``:S??$e,rt=Ve&&He&&tt&&(!ue||ue.hasValue(We,A)),it=J.useMemo(()=>de?hu(de):cn,[de]),at=J.useMemo(()=>{if(b&&!rt)return b;if(!de)return cn;if(Qe){let e=de,t=[],n=0;for(let r of e){if(F>-1&&n>=F)break;let e=F>-1?F-n:1/0,i=nt===``?r.items.slice(0,e):[];if(nt!==``)for(let t of r.items){if(i.length>=e)break;Ke(t,nt,he)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(nt===``)return F>-1?it.slice(0,F):it;let e=[];for(let t of it){if(F>-1&&e.length>=F)break;Ke(t,nt,he)&&e.push(t)}return e},[b,rt,de,Qe,nt,F,Ke,he,it]),ot=J.useMemo(()=>{if(U&&at===b)return U.values;let e=hu(at);return fe?e.map(e=>fe(e)):e},[at,b,U,fe]),G=Rt(()=>{let e=null;return M&&Xe&&Ve&&u!==`none`&&(e=lu(ot,We,A,Re)),new qr({id:le,labelId:void 0,selectedValue:We,open:Xe,items:pe,selectionMode:u,name:Le,form:p,disabled:Ie,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:me,isItemEqualToValue:A,modal:P,autoHighlight:Ue,submitOnItemClick:ee,hasInputValue:Be,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:M,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:ln,id:le,selectionMode:u,disabled:Ie,readOnly:h,isItemEqualToValue:A},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:yn,setOpen:yn,setInputValue:yn,setSelectedValue:yn,setIndices:yn,handleSelection:yn,forceMount:yn,requestSubmit:yn,listRef:Se,labelsRef:Ce,popupRef:we,emptyRef:De,inputRef:W,startDismissRef:Te,endDismissRef:Ee,chipsContainerRef:ke,clearRef:Ae,valuesRef:Pe,pointerDownItemRef:Fe,selectionEventRef:je},yu)}).current,st=u===`none`?Je:We,ct=J.useMemo(()=>u===`none`?st:Array.isArray(We)?We.map(e=>vu(e,k)):vu(We,k),[st,k,u,We]),lt=K(d),ut=K(n),dt=G.useState(`activeIndex`),ft=G.useState(`selectedIndex`),pt=G.useState(`positionerElement`),mt=G.useState(`listElement`),ht=G.useState(`triggerElement`),gt=G.useState(`inputElement`),_t=G.useState(`inputGroupElement`),vt=G.useState(`inline`),yt=G.useState(`inputInsidePopup`),bt=G.useState(`inputOwnsFormValue`),xt=ze&&!yt&&Je===et,St=Dr(ht),{openMethod:Ct,triggerProps:wt}=Gu(Xe),Tt=K(()=>ct);ku(yt?St:W,le,st,Tt,!Ie,f);let Et=K(()=>{de?Ce.current=ot.map(ge):G.set(`forceMounted`,!0)}),Dt=K((e,t,n,r)=>{if(t===-1){if(Me.current===Ju)return;Me.current=Ju}else Me.current={value:e,index:t};lt(e,_o(n,r,{index:t}))}),Ot=K(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),G.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Dt(void 0,-1,r,e.event):Dt(Pe.current[n],n,r,e.event)}),kt=K((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Oe.current=n.reason===Do,n.reason===`input-change`){Xe&&ye!==null&&be(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&ve(!0),Ne.current={hasQuery:e};let n=G.state.listElement;if(!G.state.virtualized&&n){let e=we.current;for(let t of pn(n.firstElementChild??n)){if(!Wt(t)||(e?!Q(e,t):t.getAttribute(`role`)===`dialog`))break;if(Ku(t)){t.scrollTop=0;break}}}e&&Ue&&G.state.activeIndex==null&&(Xe||vt)&&G.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&G.state.inputInsidePopup&&(Ne.current={hasQuery:!1,selection:!0});Ye(t)}}),At=K(e=>{let t=!e&&yt&&!vt&&Je!==``&&(String(Je).trim()===ye||Je===et);!e&&(t||Je===``||xt)&&ve(!1),be(null),t&&kt(``,$(Do))}),[jt,Mt]=J.useState(!1),Nt=K((t,n)=>{if(Xe===t)return;n.reason===`escape-key`&&Ve&&ot.length===0&&!De.current&&n.allowPropagation();let r=n,i=qs(r);if(e.onOpenChange?.(t,r),Ne.current?.hasQuery&&n.reason===`input-change`===n.isCanceled&&(Ne.current=null),!n.isCanceled&&(t&&ye!==null&&At(n.reason===Eo),!t&&_e&&(ze?(vt||be($e),$e===``&&ve(!1)):Re&&(vt||be($e),yt&&Ot({activeIndex:null}),(!yt||vt)&&kt(``,$(Do,n.event,void 0,{isItemPress:n.reason===Co})))),t||Mt(i()),Ze(t),!t&&yt&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(V(!0),ae(!1),oe===`onBlur`))){let e=u===`none`?Je:We;se.commit(e)}}),Pt=K((e,t)=>{a?.(e,t),!t.isCanceled&&(Ge(e),(u===`none`&&we.current&&N||ze&&!G.state.inputInsidePopup)&&kt(ge(e),$(t.reason,t.event)))}),Ft=K((e,t)=>{let n=xi(e),r=je.current??e;je.current=null;let i=$(Co,r),a=bi(n,`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Nt(!1,i);else if(Re){let e=Array.isArray(We)?We:[],n=ou(e,t,A),r=n?du(e,t,A):[...e,t];if(Pt(r,i),i.isCanceled||!(W.current&&W.current.value.trim()!==``))return;if(G.state.inputInsidePopup){kt(``,$(Do,i.event,void 0,{isItemPress:!0}));let e=Ne.current;e&&!n&&(e.toggledValue=t)}else Nt(!1,i)}else{if(Pt(t,i),i.isCanceled)return;Nt(!1,i)}}),It=K(()=>{let e=se.inputRef.current?.form??G.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Lt=K(()=>{if(ut?.(!1),ve(!1),be(null),Ot(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Re&&W.current&&W.current.value!==``&&!Oe.current&&kt(``,$(Do)),ze){if(G.state.inputInsidePopup)W.current&&W.current.value!==``&&kt(``,$(Do));else{let e=ge(We);W.current&&W.current.value!==e&&kt(e,$(e===``?Do:vo))}}}),zt=J.useMemo(()=>vt&&pt?{current:bi(pt,`[role="dialog"]`)}:we,[vt,pt]),{mounted:Bt,transitionStatus:Vt,forceUnmount:Ht}=Vs({open:Xe,ref:zt,preventUnmountOnClose:jt,setPreventUnmountOnClose:Mt,onUnmount:Lt});J.useImperativeHandle(e.actionsRef,()=>({unmount:Ht,close:()=>Nt(!1,$(Io))}),[Ht,Nt]),q(function(){let e=xe.current!==null&&ye===null;if(xe.current=ye,Xe&&(!e||!Ve)||(Xe||(Fe.current=null),u===`none`))return;let t=Ve?ot:Pe.current;Ot({selectedIndex:lu(t,We,A,Re)})},[Xe,ye,We,u,Re,Ve,ot,A,Ot]),q(()=>{de&&(Pe.current=ot,Se.current.length=ot.length)},[de,ot]),q(()=>{!Xe&&Ne.current?.hasQuery&&(Ne.current=null)},[Xe]),q(()=>{if(!Xe&&vt&&zt.current){Ne.current=null;return}let e=Ve||He?ot:Pe.current,t=Ne.current;if(t){let n=Xe||vt||G.state.positionerElement?.hidden===!1;if(t.hasQuery){let t=W.current;!Ue||String(Je).trim()===``||vt&&Ue!==`always`&&(!t||yi(t.ownerDocument)!==t)?Ne.current=null:n&&(e[0]!==void 0||!Ve&&!He)&&(G.set(`activeIndex`,0),Ne.current=null)}else if(String(Je).trim()===``&&(Ne.current=null,n)){let e=t.selection;Ue===`always`&&!e&&G.state.selectionMode===`none`&&G.set(`activeIndex`,0),queueMicrotask(()=>{if(!G.state.open&&(!G.state.inline||zt.current)||W.current&&W.current.value.trim()!==``)return;let n=G.state.selectedValue,r=G.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:G.state.selectionMode!==`none`&&n!=null){let e=Ve||He?ot:Pe.current,i=su(e,t.toggledValue,G.state.isItemEqualToValue);G.set(`activeIndex`,i===-1?lu(e,n,G.state.isItemEqualToValue,r):i)}else e?G.set(`activeIndex`,null):Ue===`always`&&G.set(`activeIndex`,0)})}}if(!Xe&&!vt)return;let n=G.state.activeIndex;if(n==null){if(Ue===`always`&&e.length>0){G.set(`activeIndex`,0);return}Dt(void 0,-1,vo);return}if(n>=e.length){Dt(void 0,-1,vo),G.set(`activeIndex`,null);return}let r=e[n],i=Me.current.value,a=i!==qu&&iu(r,i,G.state.isItemEqualToValue);Me.current.index===n&&a||Dt(r,n,vo)},[dt,Ue,Dt,He,Ve,ot,vt,Xe,zt,G,Je]),q(()=>{re(u===`none`?String(Je)!==``:Re?Array.isArray(We)&&We.length>0:We!=null)},[re,u,Je,We,Re]),J.useEffect(()=>{Ve&&Ue&&ot.length===0&&Ot({activeIndex:null})},[Ve,Ue,ot.length,Ot]);function Ut(){Xe&&$e!==``&&$e!==String(qe)&&!xt&&ve(!0)}function Gt(){Xe&&ye!==null&&At(!1)}let Kt=!1;function qt(){!Kt&&Je!==et&&(Kt=!0,kt(et,$(vo)))}function Jt(){u!==`none`&&(te(Le),ne(au(We,z.initialValue,A)),se.change(We),ze&&!Be&&!yt&&qt())}function Yt(){ze&&!Be&&!yt&&!_e&&qt()}function Xt(){u===`none`&&(te(Le),ne(Je!==z.initialValue),se.change(Je))}Uu($e,Ut),Uu(Xe,Gt),Uu(We,Jt),Uu(et,Yt),Uu(de,Yt),Uu(Je,Xt);let Zt=lc({open:vt?!0:Xe,onOpenChange:Nt,elements:{reference:yt?ht:gt,floating:pt}}),Qt=v?`grid`:`listbox`,$t=Xe||vt,en=$t?`true`:`false`,tn=J.useMemo(()=>{let e=gt?.tagName===`INPUT`,t=gt==null||e,n=t||$t,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=en,r[`aria-haspopup`]=Qt,r[`aria-controls`]=$t?mt?.id:void 0,r[`aria-autocomplete`]=h?`none`:I),{reference:r,floating:{role:`presentation`}}},[gt,$t,en,Qt,mt?.id,I,h]),nn=As(Zt,{enabled:!Ie&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:yt?0:100,reason:Oo}),rn=Ns(Zt,{enabled:!Ie&&!vt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:vt?!0:void 0,outsidePress(e){let t=xi(e);return!Q(ht,t)&&!Q(Ae.current,t)&&!Q(ke.current,t)&&!Q(_t,t)}}),an=jc(Zt,{enabled:!Ie,id:le,listRef:Se,activeIndex:dt,selectedIndex:ft,virtual:!0,loopFocus:D,allowEscape:D&&!Ue,focusItemOnOpen:_e||u===`none`&&!Ue?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:ce===`rtl`,disabledIndices:cn,grid:v?Wl:void 0,onNavigate(e,t){(t||Xe||vt&&e===null)&&Vt!==`ending`&&Ot({activeIndex:e,type:Gl(t),event:t?.nativeEvent})}}),sn=J.useMemo(()=>on(an.reference,{onKeyDown(e){v&&G.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},rn.reference,nn.reference,tn.reference),[an.reference,rn.reference,nn.reference,tn.reference,v,G]),un=J.useMemo(()=>on(Hs,rn.floating),[rn.floating]),fn=J.useMemo(()=>on(an.floating,tn.floating),[an.floating,tn.floating]),mn=J.useMemo(()=>{let e=an.item;return{props:e?{...e,onFocus:void 0}:ln,id:le,selectionMode:u,disabled:Ie,readOnly:h,isItemEqualToValue:A}},[an.item,le,u,Ie,h,A]);G.useContextCallback(`setOpen`,Nt),G.useContextCallback(`setInputValue`,kt),G.useContextCallback(`setSelectedValue`,Pt),G.useContextCallback(`setIndices`,Ot),G.useContextCallback(`handleSelection`,Ft),G.useContextCallback(`forceMount`,Et),G.useContextCallback(`requestSubmit`,It),G.useContextCallback(`onOpenChangeComplete`,n),Er(()=>{G.update({inline:M,popupProps:un,listProps:fn,inputProps:sn,triggerProps:wt,itemRoot:mn})});let hn={id:le,selectedValue:We,open:Xe,mounted:Bt,transitionStatus:Vt,items:pe,inline:M,popupProps:un,listProps:fn,inputProps:sn,triggerProps:wt,itemRoot:mn,openMethod:Ct,selectionMode:u,name:Le,form:p,disabled:Ie,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:me,modal:P,autoHighlight:Ue,isItemEqualToValue:A,submitOnItemClick:ee,hasInputValue:Be};q(()=>{G.update({...hn,inputOwnsFormValue:u===`none`&&(M||!G.state.inputInsidePopup)})},[G,...Object.values(hn)]);let gn=dn(_,se.inputRef),_n=J.useMemo(()=>({query:$e,hasItems:Ve,filteredItems:at,flatFilteredValues:ot}),[$e,Ve,at,ot]),vn=J.useMemo(()=>Array.isArray(st)?``:vu(st,k),[st,k]),bn=Re&&Array.isArray(We)&&We.length>0,xn=Re||u===`none`&&bt?void 0:Le,Sn=J.useMemo(()=>!Re||!Array.isArray(We)||!Le?null:We.map(e=>{let t=vu(e,k);return(0,Y.jsx)(`input`,{type:`hidden`,form:p,name:Le,value:t,disabled:Ie},t)}),[Re,We,p,Le,k,Ie]),Cn=(0,Y.jsxs)(J.Fragment,{children:[e.children,(0,Y.jsx)(`input`,{...se.getValidationProps(Ie,{onFocus(){yt?ht?.focus():(W.current||ht)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Ie||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=$(vo,e.nativeEvent),i=()=>Pe.current.findIndex(e=>vu(e,k).toLowerCase()===n||ge(e).toLowerCase()===n);function a(){if(Re)return;if(u===`none`){kt(t,r);return}let e=i();e===-1&&(e=Pe.current.findIndex((e,t)=>{let r=Ce.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Pe.current[e];a!=null&&Pt?.(a,r)}ze&&(Et(),de&&i()===-1&&G.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:le&&xn==null?`${le}-hidden-input`:void 0,form:p,name:xn,autoComplete:L,disabled:Ie,required:g&&!bn,readOnly:h,value:vn,ref:gn,style:xn?jr:Ar,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Sn]});return(0,Y.jsx)(Kl.Provider,{value:G,children:(0,Y.jsx)(ql.Provider,{value:Zt,children:(0,Y.jsx)(Yl.Provider,{value:Ve,children:(0,Y.jsx)(Jl.Provider,{value:_n,children:(0,Y.jsx)(Xl.Provider,{value:Je,children:Cn})})})})})}function $u(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=J.useState(r??``),[p,m]=J.useState(``);J.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=Vu({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?_u(t,o):``)}return(0,Y.jsx)(Qu,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}var ed=`data-popup-side`,td=`data-list-empty`,nd={...Wi,...Tu,popupSide:e=>e?{[ed]:e}:null,listEmpty:e=>e?{[td]:``}:null};function rd(e,t,n){let{setFocused:r,focusOwnerRef:i}=Ou(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var id=5;function ad(e,t){let n=od(t);return e.clientX>=n.left-id&&e.clientX<=n.right+id&&e.clientY>=n.top-id&&e.clientY<=n.bottom+id}function od(e){let t=e.getBoundingClientRect(),n=Yt(e);if(pi)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function sd(e,t){return e??t}function cd(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function ld(){return $l().filteredItems.length===0}function ud(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function dd(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var fd=J.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,validationMode:f,validation:p}=Ou(),{labelId:m}=Pu(),h=Zl(),g=h.useState(`selectionMode`),_=h.useState(`disabled`),v=h.useState(`readOnly`),y=h.useState(`required`),b=h.useState(`positionerElement`),x=h.useState(`listElement`),S=h.useState(`popupId`),C=h.useState(`triggerProps`),w=h.useState(`inputInsidePopup`),T=h.useState(`id`),E=h.useState(`labelId`),D=h.useState(`open`),O=h.useState(`selectedValue`),k=h.useState(`activeIndex`),A=h.useState(`selectedIndex`),j=h.useState(`hasSelectedValue`),M=Ql(),N=eu(),P=Qr(),F=u||_||a,I=ld(),L=cd(h),R=J.useRef(null),ee=rd(F,R);Fu({id:w?o:void 0});let te=w?o??T:o,ne=sd(m,E),z;D&&w?z=S??Iu(T):D&&(z=x?.id);let re=J.useRef(``);function ie(e){re.current=e.pointerType}let{reference:B}=Mc(M,{enabled:!D&&!v&&!_&&g===`single`,listRef:h.context.labelsRef,activeIndex:k,selectedIndex:A,onMatch(e){let t=h.context.valuesRef.current[e];t!==void 0&&h.context.setSelectedValue(t,$(vo))}}),{reference:V}=As(M,{enabled:!_,event:`mousedown`}),{buttonRef:ae,getButtonProps:oe}=un({native:i,disabled:F}),se={...l,readOnly:v,open:D,disabled:F,popupSide:L,listEmpty:I,placeholder:g!==`none`&&!j},ce=K(e=>{h.set(`triggerElement`,e)});return hn(`button`,e,{ref:[t,ae,R,ce],state:se,props:[C,V,B,{id:te,tabIndex:w?0:-1,role:w?`combobox`:void 0,"aria-expanded":D,"aria-haspopup":w?`dialog`:`listbox`,"aria-controls":z,"aria-required":w&&y||void 0,"aria-readonly":w&&v||void 0,"aria-labelledby":ne,onPointerDown:ie,onPointerEnter:ie,onFocus(){ee(!0),!F&&P.start(0,h.context.forceMount)},onBlur(e){if(!Q(b,e.relatedTarget)&&(d(!0),ee(!1),f===`onBlur`)){let e=g===`none`?N:O;p.commit(e)}},onMouseDown(e){if(F||(w||M.set(`domReferenceElement`,e.currentTarget),h.context.forceMount(),re.current!==`touch`&&(h.context.inputRef.current?.focus(),w||e.preventDefault()),D))return;let t=qn(e.currentTarget);function n(e){let t=h.state.triggerElement;if(!t)return;let n=xi(e),r=h.state.positionerElement,i=h.state.listElement;Q(t,n)||Q(r,n)||Q(i,n)||ad(e,t)||h.context.setOpen(!1,$(Po,e))}w&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(na(e),h.context.setOpen(!0,$(jo,e.nativeEvent)),h.context.inputRef.current?.focus())}},p.getValidationProps(F,c),oe],stateAttributesMapping:nd})}),pd=J.createContext(void 0);function md(){return J.useContext(pd)}var hd=J.createContext(void 0);function gd(e){let t=J.useContext(hd);if(t===void 0&&!e)throw Error(Dn(21));return t}var _d=J.forwardRef(function(e,t){let n=Zl(),{buttonRef:r,getButtonProps:i}=un({native:!1}),a=dn(t,r);function o(e){n.context.setOpen(!1,$(wo,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Y.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:jr})}),vd=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,validationMode:d,validation:f}=Ou(),{labelId:p}=Pu(),m=md(),h=!!gd(!0),g=Zl(),_=eu(),v=Xu(),y=g.useState(`required`),b=g.useState(`disabled`),x=g.useState(`readOnly`),S=g.useState(`name`),C=g.useState(`form`),w=g.useState(`selectionMode`),T=g.useState(`autoHighlight`),E=g.useState(`inputProps`),D=g.useState(`triggerProps`),O=g.useState(`open`),k=g.useState(`mounted`),A=g.useState(`selectedValue`),j=g.useState(`id`),M=g.useState(`inline`),N=g.useState(`modal`),P=!!T,F=cd(g),I=l||b||i,L=ld(),R=rd(I,g.context.inputRef),ee=h||M,te=!ee||N,ne=Mu(a??(ee?void 0:j)),z=h?Cu:c,[re,ie]=J.useState(null),B=J.useRef(!1),V=J.useRef(null);q(()=>{O||(V.current=null)},[O]);let ae=w===`none`&&!h,oe=K(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.context.setInputValue(``,$(vo)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:ae})}),se=h?s:f.getValidationProps(I,s);function ce(e){g.context.setIndices({activeIndex:null,selectedIndex:null,type:Gl(e),event:e})}let le={...z,open:O,disabled:I,readOnly:x,popupSide:F,listEmpty:L};function H(e){if(!m)return;let t,n=m.chipsRef.current.length,[r]=ud(v);return e.key===r&&(e.currentTarget.selectionStart??0)===0&&A.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}let ue=hn(`input`,e,{state:le,ref:[t,g.context.inputRef,oe],props:[E,D,{value:re??_,"aria-readonly":x||void 0,"aria-required":y||void 0,"aria-labelledby":p,disabled:I,readOnly:x,required:w===`none`?y:void 0,form:C,...ae&&S&&{name:S},id:ne,onFocus(){if(R(!0),!M)return;let e=V.current;V.current=null,e!=null&&Object.hasOwn(g.context.valuesRef.current,e)&&g.context.setIndices({activeIndex:e})},onBlur(){u(!0),R(!1);let e=g.state.activeIndex;if(M&&e!==null&&T!==`always`&&(V.current=e,g.context.setIndices({activeIndex:null})),d===`onBlur`){let e=w===`none`?_:A;f.commit(e)}},onCompositionStart(e){si||(B.current=!0,ie(e.currentTarget.value))},onCompositionEnd(e){B.current=!1;let t=e.currentTarget.value;ie(null),g.context.setInputValue(t,$(Eo,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=B.current||!r;function a(e){!x&&!I&&e&&i&&(g.context.setOpen(!0,$(Eo,t)),P||ce(t))}if(B.current){let n=e.currentTarget.value;ie(n),n===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.context.setOpen(!1,$(Do,t));let r=n.trim(),i=P&&r!==``;a(r),O&&g.state.activeIndex!==null&&!i&&ce(t);return}let o=$(Eo,t);if(g.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=$(Do,t);s&&!g.state.inputInsidePopup&&(w===`single`&&g.context.setSelectedValue(null,c),g.state.openOnInputClick||g.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),O&&g.state.activeIndex!==null&&!P&&ce(t)},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(I||x){x&&e.key===`Enter`&&O&&g.state.activeIndex!==null&&na(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=v===`rtl`;if(e.key===`Home`){na(e);let n=di&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){na(e);let i=di&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!k&&e.key===`Escape`){let t=w===`multiple`&&Array.isArray(A)?A.length===0:A===null,n=$(Ao,e.nativeEvent),r=w===`multiple`?[]:null;g.context.setInputValue(``,n),g.context.setSelectedValue(r,n),t||g.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&Array.isArray(A)&&A.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:A.length-1,r=A.filter((e,t)=>t!==n);ce(e.nativeEvent),g.context.setSelectedValue(r,$(vo,e.nativeEvent));return}let i=H(e);if(i!==void 0&&m?.chipsRef.current[i]?.focus(),e.which!==229&&e.key===`Enter`&&O){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(M)return;g.context.setOpen(!1,$(vo,n));return}na(e),dd(g,t,n)}}},se],stateAttributesMapping:nd}),de=h?(0,Y.jsx)(Du.Provider,{value:Eu,children:ue}):ue;return(0,Y.jsxs)(J.Fragment,{children:[O&&te&&(0,Y.jsx)(_d,{ref:g.context.startDismissRef}),de]})}),yd={...Mi,...Ui},bd=J.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=Ou(),u=Zl(),d=u.useState(`selectionMode`),f=u.useState(`disabled`),p=u.useState(`readOnly`),m=u.useState(`open`),h=u.useState(`selectedValue`),g=u.useState(`hasSelectionChips`),_=eu(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=un({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=Fs(v),T={disabled:y,visible:v,open:m,transitionStatus:C};Bs({open:v,ref:u.context.clearRef,onComplete(){v||w(!1)}});let E=hn(`button`,e,{state:T,ref:[t,b,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=Gl(e);u.context.setInputValue(``,$(To,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t,event:e.nativeEvent}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,$(To,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t,event:e.nativeEvent})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:yd});return o||S?E:null}),xd=J.createContext(null);function Sd(){return J.useContext(xd)}function Cd(e){let{children:t}=e,{filteredItems:n}=$l(),r=Sd(),i=r?r.items:n;return(0,Y.jsx)(J.Fragment,{children:i.map(t)})}var wd=J.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Td(){return J.useContext(wd)}function Ed(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=J.useState(0),s=Rt(Od).current,c=Rt(Dd).current,l=J.useRef(0),u=J.useRef(!0),d=J.useRef(null),f=J.useRef(null),p=K(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=K((e,t)=>{c.set(e,t),p()}),h=K(e=>{c.delete(e),p()}),g=K(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!jd(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&Md(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=Ad(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=K(()=>{let[e,t]=kd(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});q(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),q(()=>{u.current&&v()}),q(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=K(e=>(s.add(e),()=>{s.delete(e)})),b=J.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Y.jsx)(wd.Provider,{value:b,children:t})}function Dd(){return new Map}function Od(){return new Set}function kd(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>Md(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function Ad(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function jd(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function Md(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var Nd=J.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=Zl(),l=Ql(),u=!!gd(!0),{filteredItems:d,hasItems:f}=$l(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=K(e=>{c.set(`positionerElement`,e)}),S=K(e=>{c.set(`listElement`,e)}),C=J.useMemo(()=>typeof o==`function`?n||=(0,Y.jsx)(Cd,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=hn(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;na(e),dd(c,t,e.nativeEvent)}}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,Y.jsx)(Ed,{elementsRef:c.context.listRef,labelsRef:D,children:E})}),Pd=J.createContext(void 0);function Fd(){let e=J.useContext(Pd);if(e===void 0)throw Error(Dn(20));return e}var Id=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Zl(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Y.jsx)(Pd.Provider,{value:n,children:(0,Y.jsx)(us,{ref:t,...r})}):null});function Ld(e){return gn(19)?e:e?`true`:void 0}function Rd(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=J.useState(null),d=J.useRef(null),f=gs(n),p=J.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Rl({...e,elements:{...p,...l&&{reference:l}}}),h=J.useCallback(e=>{let t=Vt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=J.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=J.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=J.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return q(()=>{o&&(d.current=o)},[o]),q(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),J.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var zd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ha(e,t)||{};if(l==null)return{};let d=Na(u),f={x:n,y:r},p=xa(i),m=ya(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=ma(D,k,O),j=!c.arrow&&_a(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Bd=(e,t)=>{let{name:n,fn:r}=zd(e);return{name:n,fn:r,options:[e,t]}},Vd={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},Hd={sideX:`left`,sideY:`top`},Ud=`--available-width`,Wd=`--available-height`,Gd=`--anchor-width`,Kd=`--anchor-height`,qd=`--transform-origin`,Jd=Ud,Yd=Wd;function Xd(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Zd(e,t,n){let{rects:r,placement:i}=e;return{side:Xd(t,ga(i),n),align:_a(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function Qd(e){return $d(e,Rd)}function $d(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=K(O),A=O?k:n,j=Dr(n),M=Dr(g),N=Xu()===`rtl`,[P,F]=J.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?ga(P):null,R=P&&I?_a(P)||`center`:null,ee=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],te=R||o,ne=te===`center`?ee:`${ee}-${te}`,z=l;typeof z==`number`?z={top:z,right:z,bottom:z,left:z}:z&&={top:z.top||0,right:z.right||0,bottom:z.bottom||0,left:z.left||0};let re=+(i===`bottom`),ie=+(i===`top`),B=+(i===`right`),V=+(i===`left`),ae={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:z},oe=J.useRef(null),se=Dr(a),ce=Dr(s),le=typeof a==`function`?0:a,H=typeof s==`function`?0:s,ue=[];p&&ue.push(p),ue.push(zl(e=>{let t=Zd(e,i,N),n=typeof se.current==`function`?se.current(t):se.current,r=typeof ce.current==`function`?ce.current(t):ce.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[le,H,N,i]));let de=w===`none`&&C!==`shift`,fe=!de&&(u||E||C===`shift`),pe=C===`none`?null:Hl({...ae,padding:{top:z.top+1+re,right:z.right+1+V,bottom:z.bottom+1+ie,left:z.left+1+B},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),U=de?null:Bl({...ae,rootBoundary:D,mainAxis:w!==`none`,crossAxis:fe,limiter:u||E?void 0:Vl(e=>{if(!oe.current)return{};let{width:t,height:n}=oe.current.getBoundingClientRect(),r=ba(ga(e.placement)),i=r===`y`?t:n,a=r===`y`?z.left+z.right:z.top+z.bottom;return{offset:i/2+a/2}})},[ae,u,E,D,z,w]);C===`shift`||w===`shift`||te===`center`?ue.push(U,pe):ue.push(pe,U),ue.push(Ul({...ae,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(Jd,`${t}px`),i.setProperty(Yd,`${n}px`);let a=Yt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Gd,`${u}px`),i.setProperty(Kd,`${d}px`)}}),Bd(e=>({element:oe.current||qn(e.elements.floating).createElement(`div`),padding:oe.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=ga(r),u=_a(r),d=ba(l)===`y`,f=oe.current,p=typeof a==`function`?a(Zd(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return fe&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(qd,d?`${m} ${h}`:`${h} ${m}`),{}}},Vd,b),q(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=J.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:he,elements:ge,x:_e,y:ve,middlewareData:ye,update:be,placement:xe,context:Se,isPositioned:Ce,floatingStyles:we}=t({rootContext:h,open:m?g:void 0,placement:ne,middleware:ue,strategy:r,whileElementsMounted:m?void 0:(...e)=>El(...e,me),nodeId:y,externalTree:S}),{sideX:W,sideY:Te}=ye.adaptiveOrigin||Hd,Ee=Ce?r:`fixed`,De=J.useMemo(()=>{let e;return e=Ce?b?{position:Ee,[W]:_e,[Te]:ve}:{...we,position:Ee}:{position:Ee,top:0,left:0},e[Jd]=`100vw`,e[Yd]=`100vh`,Ce||(e.opacity=0),e},[b,Ee,W,_e,Te,ve,we,Ce]),Oe=J.useRef(null);q(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(ef(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,A,j]),J.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&ef(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,A,j]),J.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return El(ge.reference,ge.floating,be,me)},[m,g,ge,be,me]);let ke=ga(xe),Ae=Xd(i,ke,N),je=_a(xe)||`center`,Me=!!ye.hide?.referenceHidden;q(()=>{x&&g&&Ce&&(ke!==ee||I&&je!==te)&&F(xe)},[x,I,g,Ce,xe,ke,je,ee,te]);let Ne=J.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return J.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:oe,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:Se,isPositioned:Ce,update:be}),[De,Ne,oe,Pe,Ae,je,ke,Me,he,Se,Ce,be])}function ef(e){return e!=null&&`current`in e}var tf=J.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function nf(e){return e===`starting`?ns:ln}function rf(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),hn(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},nf(r),i],stateAttributesMapping:Gi})}var af={},of={},sf=``;function cf(e,t){return On(e)?e:t}function lf(e,t,n){return/hidden|clip/.test(e.getComputedStyle(cf(t,n)).overflowY)}function uf(e){if(typeof document>`u`)return!1;let t=qn(e);return Yt(t).innerWidth-t.documentElement.clientWidth>0}function df(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=qn(e),n=t.documentElement,r=t.body,i=cf(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function ff(e){let t=qn(e),n=t.documentElement,r=t.body,i=cf(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function pf(e){let t=qn(e),n=t.documentElement,r=t.body,i=Yt(n),a=0,o=0,s=!1,c=gi.create();if(ui&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,af={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},sf=n.style.scrollBehavior,of={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=cf(n,r);s=df(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,af),Object.assign(r.style,of),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=sf)}function d(){u(),c.request(l)}l();let f=Z(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var mf=new class{lockCount=0;restore=null;timeoutLock=Zr.create();timeoutUnlock=Zr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=qn(e),n=t.documentElement,r=t.body,i=Yt(n);if(lf(i,n,r)){let t=new i.MutationObserver(()=>{lf(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=ai||!uf(e);this.restore=a?ff(e):pf(e)}};function hf(e=!0,t=null){q(()=>{if(e)return mf.acquire(t)},[e,t])}var gf=20;function _f(e,t,n,r){let[i,a]=J.useState(!1);q(()=>{if(!e||!t||n==null){a(!1);return}let r=qn(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-gf)},[e,t,n]),hf(e&&(!t||i),r)}var vf=J.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=rs,style:g,..._}=e,v=Zl(),y=Ql(),b=Fd(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=ld(),M=Qd({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});_f(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};q(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=K(e=>{v.set(`positionerElement`,e)}),F=rf(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,Y.jsxs)(hd.Provider,{value:M,children:[C&&x&&(0,Y.jsx)(tf,{inert:Ld(!S),cutout:O??D??E}),F]})}),yf={...Gi,...Mi},bf=J.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Zl(),l=gd(),u=Ql(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=ld(),x=s.id??(g?Iu(y):void 0);q(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Bs({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S={open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},C=hn(`div`,e,{state:S,ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=xi(e.nativeEvent);p!==`touch`&&(Q(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},nf(h),s],stateAttributesMapping:yf}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,Y.jsx)(ks,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Y.jsxs)(J.Fragment,{children:[C,E&&(0,Y.jsx)(_d,{ref:c.context.endDismissRef})]})})});function xf(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Td(),u=J.useRef(-1),[d,f]=J.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=J.useRef(null),h=J.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return q(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var Sf=J.createContext(void 0);function Cf(){let e=J.useContext(Sf);if(!e)throw Error(Dn(19));return e}var wf=J.createContext(!1);function Tf(){return J.useContext(wf)}function Ef(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=J.useRef(null),m=xf({guess:!0,index:l,textRef:p}),h=Zl(),g=Tf(),_=tu(),{props:v,id:y,selectionMode:b,disabled:x,readOnly:S,isItemEqualToValue:C}=h.useState(`itemRoot`),w=x||u,T=b!==`none`,E=l??i??m.index,D=E!==-1,O=h.useState(`isActive`,E),k=h.useState(`isSelected`,c),A=J.useRef(null),j=y!=null&&D?`${y}-${E}`:void 0,M=k&&T;q(()=>{if(!D||!r&&l==null)return;let e=h.context.listRef.current;return e[E]=A.current,()=>{delete e[E]}},[D,r,E,l,h]),q(()=>{if(!D||_)return;let e=h.context.valuesRef.current;return e[E]=c,()=>{delete e[E]}},[D,_,E,c,h]),q(()=>{if(!D||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=uu(E,c,h.context.valuesRef.current,e,C,t):iu(c,e,C)&&(t=E),h.set(`selectedIndex`,t)},[D,_,h,E,c,C]);let{getButtonProps:N,buttonRef:P}=un({disabled:w,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:w,selected:M,highlighted:O};function I(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(Jn.flushSync(t),h.context.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":T?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){w||S||I(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(w||S||e.button!==0||t||!O)&&I(e.nativeEvent)}},R=hn(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[v,L,f,N]}),ee=J.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,Y.jsx)(Sf.Provider,{value:ee,children:R})}function Df(e){let{componentProps:t,forwardedRef:n}=e,r=Zl().useState(`isItemEqualToValue`),{flatFilteredValues:i}=$l(),a=su(i,t.value??null,r);return(0,Y.jsx)(Ef,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var Of=J.memo(J.forwardRef(function(e,t){let n=Zl().useState(`virtualized`);return n&&e.index==null?(0,Y.jsx)(Df,{componentProps:e,forwardedRef:t}):(0,Y.jsx)(Ef,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}));function kf(e){return hn(e.defaultTagName??`div`,e,e)}var Af=J.createContext(void 0);function jf(){let e=J.useContext(Af);if(e===void 0)throw Error(Dn(13));return e}var Mf={imageLoadingStatus:()=>null},Nf=J.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=J.useState(`idle`),c={imageLoadingStatus:o},l=J.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=hn(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:Mf});return(0,Y.jsx)(Af.Provider,{value:l,children:u})});function Pf(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=J.useState(`idle`),s=o[1];return q(()=>{if(!a)return yn;if(!e&&!i)return s(`error`),yn;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var Ff={...Mf,...Mi},If=J.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=jf(),[f,p]=Pf(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=Fs(m),v=J.useRef(null),y=J.useRef(!0);q(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=K(e=>{i?.(e),d(e)});q(()=>{f!==`idle`&&x(f)},[f,x]),q(()=>()=>d(`idle`),[d]),Bs({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=hn(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:Ff,enabled:C});return C?T:null}),Lf=J.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=jf(),[c,l]=J.useState(i===0),u=Qr();return J.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),hn(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:Mf,enabled:s!==`loaded`&&(i===0||c)})});function Rf(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=nn(`group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Y.jsx)(Nf,{"data-slot":`avatar`,"data-size":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function zf(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`aspect-square size-full rounded-full object-cover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(If,{"data-slot":`avatar-image`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bf(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Lf,{"data-slot":`avatar-fallback`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vf(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Tr({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Fs(a,!0,!0),u=Mu(),[d,f]=J.useState(),p=d===null?void 0:d??u,m=K(e=>{let t=!a,n=$(yo,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return J.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var Hf=J.createContext(void 0);function Uf(){let e=J.useContext(Hf);if(e===void 0)throw Error(Dn(15));return e}var Wf=`data-open`,Gf=`data-closed`,Kf=Oi,qf=`data-panel-open`,Jf={[Wf]:``},Yf={[Gf]:``},Xf={open(e){return e?{[qf]:``}:null}},Zf={open(e){return e?Jf:Yf},...Mi},Qf=J.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=K(o),d=Vf({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=J.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=J.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=hn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Zf});return(0,Y.jsx)(Hf.Provider,{value:p,children:m})}),$f={...Xf,...Mi},ep=J.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Uf(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=un({disabled:c,native:u});return hn(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:$f})}),tp={height:void 0,width:void 0};function np(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=J.useRef(null),f=J.useRef(null),[p,m]=J.useState(tp),h=J.useRef(tp),g=J.useRef(!1),_=J.useRef(s),v=J.useRef(!1),[y,b]=J.useState(!1),x=J.useRef(null),S=dn(t,d),C=Dr(s),w=zs(d),T=!s&&!a,E=y?`idle`:u,D=s&&(_.current||v.current),O=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,k=n&&T&&f.current!==`css-animation`,A=K((e,t=!0)=>{t&&(h.current=e),m(e)}),j=K(()=>{x.current?.(),x.current=null}),M=K(e=>{j(),x.current=()=>{x.current=null,e()}}),N=K(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});q(()=>{y&&u!==`starting`&&b(!1)},[y,u]),J.useEffect(()=>()=>{N(),j()},[N,j]),q(()=>{s||(_.current=!1,v.current=!1);let e=d.current;if(!e)return;!s&&x.current&&j();let t=ip(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=rp(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(rp(e)),b(!0);return}if(t===`css-transition`){let t=sp(e);if(A(rp(e)),!n)return t;let r=op(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(rp(e));let r=op(e,`animation-name`,`none`);if(!n){r();return}let i=op(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){A(tp,!1),c(!1);return}A(rp(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=rp(e);n.height>0||n.width>0?(A(n),t===`css-animation`&&op(e,`animation-name`,`none`)()):c(!1)},[a,s,j,A,c,M,D,u]),Bs({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(tp,!1)}}),J.useEffect(()=>{if(s||!a||E!==`ending`)return;if(!d.current){c(!1),A(tp,!1);return}let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(tp,!1))}return t=gi.request(()=>{w(n,e.signal)}),()=>{gi.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),q(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),J.useEffect(function(){let e=d.current;if(!e)return;let t=Zr.create(),n=-1,r=(r,i)=>{t.start(0,()=>{C.current||(n=gi.request(()=>{C.current||(r&&(g.current=!1),i&&e.setAttribute(Kf,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Z(e,`beforematch`,t=>{let n=$(vo,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(Kf);e.removeAttribute(Kf),l(!0),r(!0,i)});return()=>{t.clear(),gi.cancel(n),i()}},[C,o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[Kf]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function rp(e){return{height:e.scrollHeight,width:e.scrollWidth}}function ip(e,t){let n=Yt(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&ap(n.animationDuration),i=ap(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function ap(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function op(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function sp(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=gi.request(n);return()=>{gi.cancel(r),n()}}var cp=`--collapsible-panel-height`,lp=`--collapsible-panel-width`,up=J.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=Uf(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;q(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=np({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=wn(s,k),j=hn(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[cp]:S===void 0?`auto`:`${S}px`,[lp]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Zf});return E?j:null}),dp=J.memo(J.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=J.useRef(null),{transitionStatus:l,setMounted:u}=Fs(o),d=hn(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:Mi});return Bs({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),fp=J.forwardRef(function(e,t){let{selected:n}=Cf();return e.keepMounted||n?(0,Y.jsx)(dp,{...e,selected:n,ref:t}):null}),pp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=Ou(),{clearErrors:S,elementRef:C,submitCountRef:w}=ju(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=Pu(),k=Fu({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=K(()=>x.inputRef.current?.value);ku(x.inputRef,k,j,M,!T,a),q(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),Uu(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=J.useRef(null),P=rd(T,N),F=Qr();return hn(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$(vo,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:Tu})}),mp=J.forwardRef(function(e,t){return(0,Y.jsx)(pp,{ref:t,...e})}),hp=J.createContext(void 0);function gp(e){let t=J.useContext(hp);if(t===void 0&&!e)throw Error(Dn(33));return t}var _p=J.createContext(void 0);function vp(e){let t=J.useContext(_p);if(t===void 0&&!e)throw Error(Dn(36));return t}var yp=J.createContext(void 0);function bp(e=!0){let t=J.useContext(yp);if(t===void 0&&!e)throw Error(Dn(25));return t}var xp=J.createContext(null);function Sp(e=`root`){let t=J.useContext(xp),n=J.useContext(_p);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var Cp={visible:!0,ref:null};function wp(){return Cp}function Tp(e,t,n=`root`){let r=Sp(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??wp)({label:e.label,children:e.children,render:e.render}),a=dn(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Ep(e){e.preventDefault()}function Dp(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=vp(),u=bp(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return J.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Ep:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:Co})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!ci&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&rn(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Op={type:`regular-item`};function kp(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=J.useRef(null),{getButtonProps:d,buttonRef:f}=un({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Dp({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=J.useCallback(e=>on(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=dn(u,f);return J.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ap=J.createContext(void 0);function jp(){let e=J.useContext(Ap);if(e===void 0)throw Error(Dn(31));return e}var Mp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=J.useState(void 0),c=hn(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Y.jsx)(Ap.Provider,{value:s,children:c})}),Np=J.forwardRef(function(e,t){let n=Sp()?.Group??Mp;return(0,Y.jsx)(n,{...e,ref:t})}),Pp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Mu(a),c=jp();return q(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),hn(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Fp=J.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=vp(),f=xf({guess:!0,label:a}),p=Mu(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=kp({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Op});return hn(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Ip=J.forwardRef(function(e,t){let n=Tp(e,t);return n.visible?(0,Y.jsx)(Fp,{...e,ref:n.ref}):null}),Lp=J.createContext(void 0);function Rp(e){let t=J.useContext(Lp);if(t===void 0&&!e)throw Error(Dn(69));return t}var zp=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Bp=J.createContext(void 0);function Vp(){return J.useContext(Bp)}function Hp(e,t){let n=sn(e.render);if(J.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Up(e,t,n){let r=Hp(e,t),i=r===t?void 0:r;return[r,J.useCallback(e=>n?.(e?i:void 0),[i,n])]}function Wp(e,t,n){let r=sn(e.render),i=J.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Gp=J.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=vp(),m=Vp(),{side:h,align:g}=gp(),_=Rp(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=Up(e,u,d),L=Wp(e,C,N),R=w.type===`menu`?m:void 0,ee=w.type===`context-menu`,te=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(te=()=>l.state.activeIndex===null&&P),Bs({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),J.useEffect(()=>{function e(e){l.setOpen(!1,$(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Sc(D,{enabled:A&&!j&&!ee&&w.type!==`menubar`,closeDelay:k});let ne=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:z,handleFocus:re}=(J.useContext(xp)?.useParentHandoff??qp)(l,w,v,f),ie={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},B=hn(`div`,e,{state:ie,ref:[t,l.context.popupRef,ne,I],stateAttributesMapping:Ki,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&zp.has(e.key)&&e.stopPropagation()},onFocus:re},nf(y),c,{"data-rootownerid":E}]}),V=w.type===void 0||ee;(C||w.type===`menubar`&&T!==`outside-press`)&&(V=!0);let ae=R?.getReturnElement??z;return(0,Y.jsx)(ks,{context:D,openInteractionType:M,modal:ee,disabled:!x,returnFocus:a??ae??V,explicitReturnFocus:a===void 0&&ae?!1:void 0,initialFocus:te,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:B})}),Kp={parentVirtualFocusRef:void 0,handleFocus:void 0};function qp(){return Kp}var Jp=J.forwardRef(function(e,t){let n=Sp()?.Popup??Gp;return(0,Y.jsx)(n,{...e,ref:t})}),Yp=J.createContext(void 0);function Xp(){let e=J.useContext(Yp);if(e===void 0)throw Error(Dn(32));return e}var Zp=J.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=vp();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Y.jsx)(Yp.Provider,{value:n,children:(0,Y.jsx)(us,{ref:t,...r,portalOwnerRole:o})})});function Qp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=J.useRef(null),o=J.useRef(null),s=zs(r);q(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),q(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var $p=J.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=rs,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=vp(),x=Xp(),S=bp(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),ee=n,te=c,ne=l,z=s,re=h;C.type===`context-menu`&&(ee=n??C.context?.anchor,z??=`start`,!o&&z!==`center`&&(ne=e.alignOffset??2,te=e.sideOffset??-5));let ie=o,B=z;C.type===`menu`?(ie??=`inline-end`,B??=`start`,re=e.collisionAvoidance??is):C.type===`menubar`&&(ie??=C.context.orientation===`vertical`?`inline-end`:`bottom`,B??=`start`);let V=C.type===`context-menu`,ae=Qd({anchor:ee,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ie,sideOffset:te,align:B,alignOffset:ne,arrowPadding:V?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:re,shift:V?{crossAxis:!(`side`in re&&re.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});J.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,$(Fo)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),J.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,$(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let oe=Qr();J.useEffect(()=>{D||oe.clear()},[D,oe]),J.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?oe.isStarted()||oe.start(e,()=>{v.setOpen(!1,$(Fo))}):v.setOpen(!1,$(Fo))}else oe.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,oe]),J.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),Qp({store:v,domReference:R,positionerElement:M,open:D});let se={open:D,side:ae.side,align:ae.align,anchorHidden:ae.anchorHidden,nested:C.type===`menu`,instant:N},ce=C.type===`menubar`&&C.context.modal;_f(D&&(ce||O&&F!==`trigger-hover`),k===`touch`,M,A);let le=rf(e,se,{styles:ae.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),H=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=A),(0,Y.jsxs)(hp.Provider,{value:ae,children:[H&&(0,Y.jsx)(tf,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:Ld(!D),cutout:ue}),(0,Y.jsx)(vs,{id:I,children:(0,Y.jsx)(Ed,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:le})})]})}),em=J.createContext(null);function tm(e){let t=J.useContext(em);if(t===null&&!e)throw Error(Dn(5));return t}var nm={...sc,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=sc.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>ui&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!sc.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},rm=class extends qr{constructor(e,t,n=!1){let r=new Qs,i=am(r,t,n,e);super(i,im(r),nm),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function im(e){return{positionerRef:J.createRef(),popupRef:J.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:J.createRef(),beforeTriggerFocusGuardRef:J.createRef(),beforeContentFocusGuardRef:J.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function am(e,t,n=!1,r){return{...tc(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:ln,inputProps:ln,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new fs,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:ln,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var om=J.createContext(null);function sm(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function cm(e,t){return e===`list-navigation`||sm(e,t)}var lm=Ir(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=bp(!0),C=vp(!0),w=tm(!0),T=C?.store,E=C?.virtualFocus??!1,D=J.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=Mu(),k=Mu(),[A,j]=J.useState(void 0),M=(A??k)||void 0,N=hs(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=Rt(()=>F?P?.state.instantType:void 0).current,L=Rt(()=>{let e=new rm({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),ee=_s(R),te=L.useState(`open`),ne=L.useState(`activeTriggerElement`),z=L.useState(`positionerElement`),re=L.useState(`hoverEnabled`),ie=L.useState(`disabled`),B=L.useState(`lastOpenChangeReason`),V=L.useState(`parent`),ae=L.useState(`activeIndex`),oe=L.useState(`keyboardOpen`),se=L.useState(`payload`),ce=L.useState(`floatingParentNodeId`),le=J.useRef(null),H=J.useRef(V.type!==`context-menu`),ue=Qr(),de=J.useRef(!0),fe=Qr(),pe=ce!=null,{openMethod:U,triggerProps:me}=Gu(te);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:V.type===void 0?c:void 0,openMethod:U,rootId:O}),Ys(L);let{forceUnmount:he,transitionStatus:ge}=Xs(te,L,()=>{L.set(`allowMouseEnter`,!1)},F),_e=zs(L.context.popupRef);J.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!te){e();return}if(ge!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return _e(e,t.signal),()=>{t.abort()}},[I,te,ge,_e,L]),q(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:ee,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:ee,floatingParentNodeId:N})},[S,C,ee,N,ne,L]),J.useEffect(()=>{te||(le.current=null),V.type===`context-menu`&&(te?ue.start(500,()=>{H.current=!0}):(ue.clear(),H.current=!1))},[ue,te,V.type]),q(()=>{!te&&!re&&L.set(`hoverEnabled`,!0)},[te,re,L]);let ve=K((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||te===e&&t.trigger===ne&&B===n)return;let i=qs(t);if(!e&&t.trigger==null&&(t.trigger=ne??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!de.current)return;e&&n===`trigger-focus`?(de.current=!1,fe.start(300,()=>{de.current=!0})):(de.current=!0,fe.clear());let o=!e&&(n===`escape-key`||n==null);le.current=t.event;let s=Ks(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&cm(n,a),s.instantType=V.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:sm(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),ye=Ps({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ve}),be=ye.context.events;q(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return be.on(`setOpen`,e),()=>{be?.off(`setOpen`,e)}},[be,ve]),q(()=>L.subscribeToParentMenu(),[L]);let xe=J.useCallback(()=>{L.setOpen(!1,$(Io))},[L]);J.useImperativeHandle(d,()=>({unmount:he,close:xe}),[he,xe]);let Se;V.type===`context-menu`&&(Se=V.context),J.useImperativeHandle(Se?.positionerRef,()=>z,[z]),J.useImperativeHandle(Se?.actionsRef,()=>({setOpen:ve}),[ve]);let Ce=Ns(ye,{enabled:!ie,bubbles:{escapeKey:f&&V.type===`menu`},outsidePress(){return V.type!==`context-menu`||le.current?.type===`contextmenu`||H.current},externalTree:pe?R:void 0}),we=Xu(),W=jc(ye,{enabled:!ie,listRef:L.context.itemDomElements,activeIndex:ae,virtual:v,nested:V.type===`menubar`||!v&&V.type!==void 0,parentOrientation:V.type===`menubar`?V.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?oe:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:we===`rtl`,disabledIndices:cn,onNavigate(e,t){L.setActiveIndex(e,Gl(t),t?.nativeEvent)},openOnArrowKeyDown:V.type!==`context-menu`&&!(v&&_),externalTree:!v&&pe?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Te=J.useCallback(e=>{L.context.typingRef.current=e},[L]),Ee=Mc(ye,{enabled:!ie&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:ae,resetMs:500,onMatch:(e,t)=>{te&&e!==ae&&L.setActiveIndex(e,Mo,t.nativeEvent)},onTyping:Te}),De=K(a),Oe=J.useRef(-1),ke=K(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Oe.current===n&&L.context.reportedItem===t)return;Oe.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=vo,L.context.highlightEvent=void 0,a&&De(t,_o(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});q(()=>{ke()},[ae,ke]);let Ae=J.useMemo(()=>{if(!v)return W.reference;if(!W.trigger)return ln;let{onFocus:e,...t}=W.trigger;return t},[v,W.reference,W.trigger]);L.useSyncedValue(`inputProps`,v?W.reference??ln:ln);let je=J.useMemo(()=>{let e=on(Ee.reference,Ae,Ce.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=te,e},[L,Ee.reference,Ae,Ce.reference,me,te]),Me=J.useMemo(()=>{let e=on(W.trigger,Ce.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[W.trigger,Ce.trigger,me]);Rt(()=>(L.update({inactiveTriggerProps:Me}),null)),Zs(L,{floatingRootContext:ye,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:J.useMemo(()=>on(Hs,{onMouseMove(){L.set(`allowMouseEnter`,!0),V.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},Ee.floating,W.floating,Ce.floating),[V.type,L,Ee.floating,W.floating,Ce.floating]),itemProps:W.item??ln});let Ne=J.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:ke}),[L,D,u,l,b,k,v,E,ke]),Pe=typeof t==`function`?t({payload:se}):t,Fe=(0,Y.jsxs)(_p.Provider,{value:Ne,children:[p&&(0,Y.jsx)(Us,{handle:p,store:L}),Pe]});return(V.type===void 0||V.type===`context-menu`)&&(Fe=(0,Y.jsx)(ys,{externalTree:R,children:Fe})),Fe});function um(e){let t=J.useContext(om);if(t===null)return(0,Y.jsx)(lm,{...e});let n=t.Root;return(0,Y.jsx)(om.Provider,{value:null,children:(0,Y.jsx)(n,{...t.options,...e})})}function dm(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Tn(),{ref:i,index:a}=xf(e),o=n===a,s=J.useRef(null),c=dn(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function fm(e){let{render:t,className:n,style:r,state:i=ln,props:a=cn,refs:o=cn,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=dm({metadata:s});return hn(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function pm(e){if(Wt(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!qt(e))return pm(Jt(e))}function mm(e,t){function n(n,r,i){let a=n.currentTarget;Jn.flushSync(()=>{e.setOpen(!1,$(ko,n.nativeEvent,a))}),uo(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&fo(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function hm(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=J.useRef(!1);return J.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,qn(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:ln,[t,n,r])}var gm=Lr(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=vp(!0),h=cc(d)??m?.store;if(!h)throw Error(Dn(85));let g=Mu(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=J.useRef(null),S=vm(),C=Tn(!0),w=gs(),T=J.useMemo(()=>w??new fs,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Js(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:_s(T),floatingParentNodeId:hs(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=un({disabled:A,native:o});J.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=J.useRef(null),P=Qr(),F=K(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(N.current,t)||Q(h.select(`positionerElement`),t)||t===N.current||t!=null&&pm(t)===h.select(`rootId`)||ad(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:Po})});J.useEffect(()=>{let e=qn(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=wc(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:Bc({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=_m(y,h.select(`lastOpenChangeReason`)),ee=As(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),te=dc(v,{enabled:!A&&I}),ne=hm({open:y,enabled:O,mouseDownAction:`open`}),z=J.useMemo(()=>on(te.reference,ee.reference),[te.reference,ee.reference]),re=h.useState(`triggerProps`,D),ie=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:B,handleFocusTargetFocus:V}=mm(h,x),ae={disabled:A,open:y},oe=[N,t,M,E,x],se=[z,L??ln,re,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),qn(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},ie,O?{role:`menuitem`}:{},ne,p,j],ce=hn(`button`,e,{enabled:!O,stateAttributesMapping:Wi,state:ae,ref:oe,props:se});return O?(0,Y.jsx)(fm,{tag:`button`,render:n,className:r,style:i,state:ae,refs:oe,props:se,stateAttributesMapping:Wi}):y?(0,Y.jsxs)(J.Fragment,{children:[(0,Y.jsx)(vi,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:B},`${g}-pre-focus-guard`),(0,Y.jsx)(J.Fragment,{children:ce},g),(0,Y.jsx)(vi,{ref:h.context.triggerFocusTargetRef,onFocus:V},`${g}-post-focus-guard`)]}):(0,Y.jsx)(J.Fragment,{children:ce},g)});function _m(e,t){let n=Qr(),[r,i]=J.useState(!1);return q(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function vm(){let e=tm(!0);return J.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var ym=J.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return hn(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function bm(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=nn(`h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Y.jsx)(mp,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function xm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Sm=Ht(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function Cm(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=nn(Sm({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Y.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:wm,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function wm(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}var Tm=Ht(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function Em(e){let t=(0,X.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,type:i,variant:a,size:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`button`:i,c=a===void 0?`ghost`:a,l=o===void 0?`xs`:o,u;t[6]!==n||t[7]!==l?(u=nn(Tm({size:l}),n),t[6]=n,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==l||t[11]!==u||t[12]!==s||t[13]!==c?(d=(0,Y.jsx)(Sn,{type:s,"data-size":l,variant:c,className:u,...r}),t[9]=r,t[10]=l,t[11]=u,t[12]=s,t[13]=c,t[14]=d):d=t[14],d}function Dm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(bm,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Om(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=nn(`[&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Mn,{className:`pointer-events-none size-3.5 text-muted-foreground`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(fd,{"data-slot":`combobox-trigger`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function km(e){let t=(0,X.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Y.jsx)(Em,{variant:`ghost`,size:`icon-xs`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=nn(n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(Kn,{className:`pointer-events-none`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,Y.jsx)(bd,{"data-slot":`combobox-clear`,render:i,className:a,...r,children:o}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function Am(e){let t=(0,X.c)(28),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,disabled:a,showTrigger:o,showClear:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a!==void 0&&a,l=o===void 0||o,u=s!==void 0&&s,d;t[7]===r?d=t[8]:(d=nn(`w-auto`,r),t[7]=r,t[8]=d);let f;t[9]===c?f=t[10]:(f=(0,Y.jsx)(Dm,{disabled:c}),t[9]=c,t[10]=f);let p;t[11]!==i||t[12]!==f?(p=(0,Y.jsx)(vd,{render:f,...i}),t[11]=i,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==c||t[15]!==l?(m=l&&(0,Y.jsx)(Em,{size:`icon-xs`,variant:`ghost`,render:(0,Y.jsx)(Om,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:c}),t[14]=c,t[15]=l,t[16]=m):m=t[16];let h;t[17]!==c||t[18]!==u?(h=u&&(0,Y.jsx)(km,{disabled:c}),t[17]=c,t[18]=u,t[19]=h):h=t[19];let g;t[20]!==m||t[21]!==h?(g=(0,Y.jsxs)(Cm,{align:`inline-end`,children:[m,h]}),t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==n||t[24]!==d||t[25]!==p||t[26]!==g?(_=(0,Y.jsxs)(xm,{className:d,children:[p,g,n]}),t[23]=n,t[24]=d,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function jm(e){let t=(0,X.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,anchor:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`bottom`:a,u=o===void 0?6:o,d=s===void 0?`start`:s,f=c===void 0?0:c,p=!!n,m;t[8]===r?m=t[9]:(m=nn(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[8]=r,t[9]=m);let h;t[10]!==i||t[11]!==p||t[12]!==m?(h=(0,Y.jsx)(bf,{"data-slot":`combobox-content`,"data-chips":p,className:m,...i}),t[10]=i,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==d||t[15]!==f||t[16]!==n||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,Y.jsx)(Id,{children:(0,Y.jsx)(vf,{side:l,sideOffset:u,align:d,alignOffset:f,anchor:n,className:`isolate z-50`,children:h})}),t[14]=d,t[15]=f,t[16]=n,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function Mm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(Nd,{"data-slot":`combobox-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nm(e){let t=(0,X.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=nn(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Y.jsx)(fp,{render:(0,Y.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Y.jsx)(An,{className:`pointer-events-none`})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Y.jsxs)(Of,{"data-slot":`combobox-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Pm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(um,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Fm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(gm,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Im(e){let t=(0,X.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=nn(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Y.jsx)(Jp,{"data-slot":`dropdown-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Y.jsx)(Zp,{children:(0,Y.jsx)($p,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function Lm(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Np,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function Rm(e){let t=(0,X.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=nn(`px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Y.jsx)(Pp,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function zm(e){let t=(0,X.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=nn(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Y.jsx)(Ip,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Bm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`-mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(ym,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vm(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Hm=U({id:H,name:H,signOut:Ke}),Um=et(Te).atom(me(kt(`/auth/user`),He(oe),He(p(Hm)))),Wm=Pe(st(``));function Gm(){return I(B(_r(Wm)))}function Km(){let e=(0,X.c)(27),t=_r(Um);if(!Mt(t))return null;let n;e[0]===t.value.id?n=e[1]:(n=z(`github:`,``)(t.value.id),e[0]=t.value.id,e[1]=n);let r=`https://avatars.githubusercontent.com/u/${n}?s=96`,i;e[2]!==t.value.name||e[3]!==r?(i=(0,Y.jsx)(zf,{src:r,alt:t.value.name}),e[2]=t.value.name,e[3]=r,e[4]=i):i=e[4];let a;e[5]===t.value.name?a=e[6]:(a=ee(Ze(0,1)(t.value.name)),e[5]=t.value.name,e[6]=a);let o;e[7]===a?o=e[8]:(o=(0,Y.jsx)(Bf,{children:a}),e[7]=a,e[8]=o);let s;e[9]!==i||e[10]!==o?(s=(0,Y.jsx)(Fm,{"aria-label":`Account`,children:(0,Y.jsxs)(Rf,{size:`sm`,children:[i,o]})}),e[9]=i,e[10]=o,e[11]=s):s=e[11];let c;e[12]===t.value.name?c=e[13]:(c=(0,Y.jsx)(Lm,{children:(0,Y.jsxs)(Rm,{children:[`@`,t.value.name]})}),e[12]=t.value.name,e[13]=c);let l;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(Bm,{}),e[14]=l):l=e[14];let u=!t.value.signOut,d;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(d=new URLSearchParams({next:location.href}),e[15]=d):d=e[15];let f=`/auth/sign-out?${d}`,p;e[16]===f?p=e[17]:(p=(0,Y.jsx)(`a`,{"aria-label":`Sign out`,href:f}),e[16]=f,e[17]=p);let m;e[18]!==p||e[19]!==u?(m=(0,Y.jsx)(zm,{variant:`destructive`,disabled:u,render:p,children:`Sign out`}),e[18]=p,e[19]=u,e[20]=m):m=e[20];let h;e[21]!==m||e[22]!==c?(h=(0,Y.jsxs)(Im,{align:`end`,className:`w-auto min-w-48`,children:[c,l,m]}),e[21]=m,e[22]=c,e[23]=h):h=e[23];let g;return e[24]!==h||e[25]!==s?(g=(0,Y.jsxs)(Pm,{children:[s,h]}),e[24]=h,e[25]=s,e[26]=g):g=e[26],g}function qm(e){let t=(0,X.c)(66),[n,r]=br(Wm),[i,a]=(0,J.useState)(!1),o;t[0]===n?o=t[1]:(o=()=>n!==``,t[0]=n,t[1]=o);let[s,c]=(0,J.useState)(o),l=(0,J.useRef)(null),u=(0,J.useRef)(null),d,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=function(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),c(!0),l.current?.focus())};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},f=[],t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,J.useEffect)(d,f);let p,m,h,g,_,v,y,b,x,S,C;if(t[4]!==i||t[5]!==e.commands||t[6]!==e.label||t[7]!==n||t[8]!==s||t[9]!==r){let a;t[21]===n?a=t[22]:(a=e=>Ot(I(B(n)))(I(e.label)),t[21]=n,t[22]=a),m=Me(e.commands,a);let o,d;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{(0,Jn.flushSync)(()=>c(!0)),l.current?.focus()},d=(0,Y.jsx)(Rn,{}),t[23]=o,t[24]=d):(o=t[23],d=t[24]),t[25]===e.label?g=t[26]:(g=(0,Y.jsx)(Sn,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,className:`ml-auto sm:hidden`,onClick:o,children:d}),t[25]=e.label,t[26]=g),C=u;let f=s&&`max-sm:bg-background max-sm:absolute max-sm:inset-0 max-sm:z-10 max-sm:flex max-sm:max-w-none max-sm:items-center max-sm:gap-2 max-sm:px-3`;t[27]===f?h=t[28]:(h=nn(`mx-auto hidden w-full max-w-sm sm:flex lg:absolute lg:left-1/2 lg:-translate-x-1/2`,f),t[27]=f,t[28]=h),p=$u,_=m,v=null,y=Jm,b=n,t[29]===r?x=t[30]:(x=(e,t)=>{t.reason!==`item-press`&&r(e)},t[29]=r,t[30]=x),S=i&&we(m),t[4]=i,t[5]=e.commands,t[6]=e.label,t[7]=n,t[8]=s,t[9]=r,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S,t[20]=C}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20];let w=n!==``,T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>a(!0),t[31]=T):T=t[31];let E;t[32]!==m||t[33]!==i||t[34]!==r?(E=e=>{e.key!==`Escape`||i&&we(m)||(r(``),c(!1),e.currentTarget.blur())},t[32]=m,t[33]=i,t[34]=r,t[35]=E):E=t[35];let D;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Y.jsx)(Cm,{children:(0,Y.jsx)(Rn,{})}),t[36]=D):D=t[36];let O;t[37]===n?O=t[38]:(O=n===``&&(0,Y.jsx)(Cm,{align:`inline-end`,className:`max-sm:hidden`,children:(0,Y.jsx)(Vm,{children:`⌘K`})}),t[37]=n,t[38]=O);let k;t[39]!==e.label||t[40]!==w||t[41]!==E||t[42]!==O?(k=(0,Y.jsxs)(Am,{ref:l,"aria-label":e.label,placeholder:`Search or run a command`,showTrigger:!1,showClear:w,className:`w-full`,onFocus:T,onKeyDown:E,children:[D,O]}),t[39]=e.label,t[40]=w,t[41]=E,t[42]=O,t[43]=k):k=t[43];let A;t[44]===r?A=t[45]:(A=(0,Y.jsx)(jm,{anchor:u,children:(0,Y.jsx)(Mm,{children:e=>(0,Y.jsxs)(Nm,{value:e,onClick:()=>{r(``),c(!1),e.run()},children:[e.icon,e.label]},e.label)})}),t[44]=r,t[45]=A);let j;t[46]!==p||t[47]!==k||t[48]!==A||t[49]!==_||t[50]!==v||t[51]!==y||t[52]!==b||t[53]!==x||t[54]!==S?(j=(0,Y.jsxs)(p,{items:_,filter:v,itemToStringValue:y,value:b,onValueChange:x,open:S,onOpenChange:a,autoHighlight:!0,children:[k,A]}),t[46]=p,t[47]=k,t[48]=A,t[49]=_,t[50]=v,t[51]=y,t[52]=b,t[53]=x,t[54]=S,t[55]=j):j=t[55];let M;t[56]===r?M=t[57]:(M=(0,Y.jsx)(Sn,{variant:`ghost`,size:`sm`,className:`sm:hidden`,onClick:()=>{r(``),c(!1)},children:`Cancel`}),t[56]=r,t[57]=M);let N;t[58]!==h||t[59]!==j||t[60]!==M||t[61]!==C?(N=(0,Y.jsxs)(`div`,{ref:C,className:h,children:[j,M]}),t[58]=h,t[59]=j,t[60]=M,t[61]=C,t[62]=N):N=t[62];let P;return t[63]!==g||t[64]!==N?(P=(0,Y.jsxs)(Y.Fragment,{children:[g,N]}),t[63]=g,t[64]=N,t[65]=P):P=t[65],P}function Jm(e){return e.label}function Ym(e){let t=(0,X.c)(25),n;t[0]===e.icon?n=t[1]:(n=(0,Y.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`}),t[0]=e.icon,t[1]=n);let r;t[2]===e.name?r=t[3]:(r=(0,Y.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),t[2]=e.name,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,Y.jsxs)(`a`,{href:`/`,className:`-ml-1 flex shrink-0 items-center gap-1.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a;t[7]===e.tabs?a=t[8]:(a=e.tabs!==void 0&&(0,Y.jsx)(`nav`,{"aria-label":`Sections`,className:`ml-2 flex items-center gap-1`,children:e.tabs}),t[7]=e.tabs,t[8]=a);let o;t[9]===e.commands?o=t[10]:(o=e.commands===void 0&&(0,Y.jsx)(`span`,{className:`flex-1`}),t[9]=e.commands,t[10]=o);let s;t[11]!==e.commands||t[12]!==e.name?(s=e.commands!==void 0&&(0,Y.jsx)(qm,{commands:e.commands,label:`Search ${e.name}`}),t[11]=e.commands,t[12]=e.name,t[13]=s):s=t[13];let c;t[14]===e.account?c=t[15]:(c=e.account??(0,Y.jsx)(Km,{}),t[14]=e.account,t[15]=c);let l;t[16]!==e.action||t[17]!==c?(l=(0,Y.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 lg:ml-auto`,children:[e.action,c]}),t[16]=e.action,t[17]=c,t[18]=l):l=t[18];let u;return t[19]!==i||t[20]!==a||t[21]!==o||t[22]!==s||t[23]!==l?(u=(0,Y.jsxs)(`header`,{className:`bg-background border-border sticky top-0 z-30 flex h-12 shrink-0 items-center gap-2 border-b px-4`,children:[i,a,o,s,l]}),t[19]=i,t[20]=a,t[21]=o,t[22]=s,t[23]=l,t[24]=u):u=t[24],u}function Xm(e){let t=(0,X.c)(5),n;t[0]===e.className?n=t[1]:(n=nn(`flex min-h-full w-full max-w-3xl flex-col gap-4 self-start`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,Y.jsx)(`main`,{className:`pb-safe relative flex min-h-0 flex-1 justify-center overflow-y-auto px-4 pt-3`,children:(0,Y.jsx)(`div`,{className:n,children:e.children})}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}var Zm=Ht(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-2.5!`,{variants:{variant:{default:`bg-primary text-primary-foreground [a]:hover:bg-primary/80`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80`,destructive:`bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20`,outline:`border-border bg-input/20 text-foreground dark:bg-input/30 [a]:hover:bg-muted [a]:hover:text-muted-foreground`,ghost:`hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50`,link:`text-primary underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Qm(e){let t=(0,X.c)(13),n,r,i,a,o;if(t[0]!==e){let{className:s,variant:c,render:l,...u}=e;n=l,o=c===void 0?`default`:c,a=kf,r=`span`,i=on({className:nn(Zm({variant:o}),s)},u),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];let s;t[6]===o?s=t[7]:(s={slot:`badge`,variant:o},t[6]=o,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==s?(c={defaultTagName:r,props:i,render:n,state:s},t[8]=n,t[9]=r,t[10]=i,t[11]=s,t[12]=c):c=t[12],a(c)}function $m(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(Qf,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function eh(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(ep,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function th(e){let t=(0,X.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(up,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function nh(e){let t=(0,X.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=nn(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Y.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var rh=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`path`,{fillRule:`evenodd`,clipRule:`evenodd`,d:`M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z`,transform:`scale(64)`,fill:`#ffff`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Y.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r},ih=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsx)(`path`,{fill:`#1b1f23`,fillRule:`evenodd`,d:`M512 0C229.12 0 0 229.12 0 512c0 226.56 146.56 417.92 350.08 485.76 25.6 4.48 35.2-10.88 35.2-24.32 0-12.16-.64-52.48-.64-95.36-128.64 23.68-161.92-31.36-172.16-60.16-5.76-14.72-30.72-60.16-52.48-72.32-17.92-9.6-43.52-33.28-.64-33.92 40.32-.64 69.12 37.12 78.72 52.48 46.08 77.44 119.68 55.68 149.12 42.24 4.48-33.28 17.92-55.68 32.64-68.48-113.92-12.8-232.96-56.96-232.96-252.8 0-55.68 19.84-101.76 52.48-137.6-5.12-12.8-23.04-65.28 5.12-135.68 0 0 42.88-13.44 140.8 52.48 40.96-11.52 84.48-17.28 128-17.28s87.04 5.76 128 17.28c97.92-66.56 140.8-52.48 140.8-52.48 28.16 70.4 10.24 122.88 5.12 135.68 32.64 35.84 52.48 81.28 52.48 137.6 0 196.48-119.68 240-233.6 252.8 18.56 16 34.56 46.72 34.56 94.72 0 68.48-.64 123.52-.64 140.8 0 13.44 9.6 29.44 35.2 24.32C877.44 929.92 1024 737.92 1024 512 1024 229.12 794.88 0 512 0`,clipRule:`evenodd`}),t[0]=n):n=t[0];let r;return t[1]===e?r=t[2]:(r=(0,Y.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r};te(Ye(h(`AUTH_URL`)),le);function ah(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function oh(e){return Ne(Yn)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}k()(`@deslop/runtime/auth/lib/utils/CurrentUser`);var sh=class e extends vt()(`@deslop/runtime/auth/lib/utils/RpcAuth`,{error:Yn}){static layerClient=t=>rt(e,e=>ze(function*(){return yield*e.next({...e.request,headers:Oe(e.request.headers,`authorization`,`Bearer ${yield*t}`)})}))},ch=class extends A()(`TelemetryError`,{cause:Ge(P()),message:H}){},lh=me(H,he(at(/^[a-fA-F0-9]{32}$/u))),uh=me(H,he(at(/^[a-fA-F0-9]{16}$/u))),dh=me(H,he(at(/^\d{1,20}$/u))),fh=U({key:H,value:M}),ph=S(U({attributes:W(s(fh))}),[M]),mh=U({attributes:W(s(fh)),events:W(s(S(U({attributes:W(s(fh)),name:H,timeUnixNano:dh}),[M]))),links:W(s(S(U({attributes:W(s(fh)),spanId:uh,traceId:lh}),[M])))}),hh=S(U({...mh.fields,endTimeUnixNano:W(dh),name:W(H),parentSpanId:W(ut([uh,ae(``)])),spanId:uh,startTimeUnixNano:dh,status:W(S(U({code:W(b)}),[M])),traceId:lh}),[M]),gh=S(U({attributes:W(s(fh)),body:W(M),observedTimeUnixNano:W(dh),severityNumber:W(b),severityText:W(H),spanId:W(ut([uh,ae(``)])),timeUnixNano:W(dh),traceId:W(ut([lh,ae(``)]))}),[M]);U({resourceSpans:W(s(S(U({resource:W(ph),schemaUrl:W(H),scopeSpans:W(s(S(U({schemaUrl:W(H),scope:W(ph),spans:W(s(hh))}),[M])))}),[M])))}),U({resourceLogs:W(s(S(U({resource:W(ph),schemaUrl:W(H),scopeLogs:W(s(S(U({logRecords:W(s(gh)),schemaUrl:W(H),scope:W(ph)}),[M])))}),[M])))});var _h=U({durationMs:re,id:de,name:H,payload:M,resource:ph,resourceSchemaUrl:H,scope:ph,scopeSchemaUrl:H,service:H,signal:Ft([`trace`,`log`]),spanId:H,status:b,time:dh,traceId:H}).mapFields(_t([`resource`,`resourceSchemaUrl`,`scope`,`scopeSchemaUrl`])),vh=U({errors:Ke,from:re,limit:me(b,he(bt({maximum:1e3,minimum:1}))),offset:me(b,he(bt({maximum:1e5,minimum:0}))),operation:H,runs:Ft([`current`,`all`]),service:H,sort:Ft([`recent`,`slowest`]),text:H,to:re,traceId:H});U({entries:s(_h),total:b});var yh=Ft([`web`,`mobile`,`server`,`ci`,`unknown`]),bh=U({name:H,runtime:yh}),xh=U({...bh.fields,entries:u,lastEventAt:dh,runStartedAt:dh,version:H}),Sh=U({count:u,credential:Ft([`authorization`,`cookie`,`none`]),lastAt:re,route:Ft([`/v1/traces`,`/v1/logs`]),status:b});U({rejections:s(Sh),services:s(xh),since:re});var Ch=U({durationMs:re,errors:b,id:lh,logs:b,operation:H,service:H,services:s(bh),spans:b,time:dh});U({entries:s(Ch),total:b});var wh=U({durationMs:re,failure:Ge(U({message:H,span:H})),id:lh,time:dh}),Th=U({count:b,failures:b,name:H,p50Ms:re,runtime:yh,traces:s(wh)}),Eh=U({apps:s(U({name:H,operations:s(Th),versions:s(U({runtimes:s(yh),version:H}))}))});U({count:b,errors:b,from:re,maxMs:re,p50Ms:re,p95Ms:re,to:re});var Dh=U({..._h.fields,depth:u,logs:s(_h),offsetMs:re,parentSpanId:H,runtime:yh}),Oh=U({durationMs:re,id:lh,logs:s(_h),services:s(bh),spans:s(Dh)}),kh=U({errors:me(vh.fields.errors,G(Pt(!1)),_e({description:`Only failed spans and error logs.`})),operation:me(vh.fields.operation,G(Pt(``)),_e({description:`Exact span name.`})),runs:me(vh.fields.runs,G(Pt(`current`)),_e({description:`"current" searches the latest process/page load/app launch per service. "all" includes retained earlier runs in the lookback.`})),service:me(vh.fields.service,G(Pt(``)),_e({description:`Exact service name, from list_services.`})),since:me(L,he(mt(j,{expected:`a finite duration`})),G(Pt(dt(10))),_e({description:`Lookback, such as "10 minutes" or "1 hour".`})),text:me(vh.fields.text,G(Pt(``)),_e({description:`Case-insensitive text in the span name, log message or attributes.`})),traceId:me(vh.fields.traceId,G(Pt(``)),_e({description:`Only entries of this trace.`}))}),Ah=U({...kh.fields,limit:me(vh.fields.limit,G(Pt(20)),_e({description:`Page size, 1 to 1000.`})),offset:me(vh.fields.offset,G(Pt(0)),_e({description:`Entries to skip, for the next page.`}))});U({...Ah.fields,sort:me(vh.fields.sort,G(Pt(`recent`)),_e({description:`"recent" puts the newest first, "slowest" the longest first.`}))});var jh=class extends ft(ht(`scope.overview`,{error:ut([Yn,ch]),stream:!0,success:Eh}),ht(`scope.trace`,{error:ut([Yn,ch]),payload:U({id:lh}),success:Oh})).middleware(sh){},Mh=class extends Ue()(`@deslop/scope/lib/utils/RpcClient`,{group:jh,protocol:Cn}){},Nh=Pe(Mh.runtime.atom(me(Mh,Ce(e=>e(`scope.overview`,void 0)),nt,Ie(e=>me(e(jt(`2 seconds`)),ce(e=>e.input._tag===`RpcClientError`)))))),Ph=st(e=>{let t=e(Nh),n=Ee(e.self(),e=>e.seen);if(!Mt(t))return{arrived:V(),seen:n};let r=it(t.value.apps,e=>it(e.operations,e=>De(e.traces,e=>e.id)));return{arrived:ne(n,{onNone:()=>V(),onSome:e=>be(r,e)}),seen:c(r)}}),Fh=xt(e=>Mh.query(`scope.trace`,{id:m(pt(l(e,`:`)),()=>e)})),Ih=st(je(lt(`30 seconds`),()=>pe));function Lh(e,t){let n=x(0,(t-m(O(me(e,Ze(0,-6))),()=>t))/1e3);return n<10?`now`:n<60?`${N(n,0)}s`:n<3600?`${N(n/60,0)}m`:n<86400?`${N(n/3600,0)}h`:`${N(n/86400,0)}d`}function Rh(e){return e<999.5?`${N(e,0)} ms`:e<9950?`${N(e/1e3,1)} s`:e<59500?`${N(e/1e3,0)} s`:e<357e4?`${N(e/6e4,0)} min`:`${N(e/36e5,1)} h`}var zh=`/assets/icon-D1hVTa1Q.svg`;R(qe(F),e=>De(l(e,`.`),e=>m(O(e),()=>0)));function Bh(e){return me(e,z(/^@deslop\//u,``),z(/-(?:server|client|ios)$/u,``))}var Vh={ci:`ci`,mobile:`iOS`,server:`server`,unknown:``,web:`web`},Hh={ci:(0,Y.jsx)(Wn,{role:`img`,"aria-label":`ci`,"data-side":`ci`,className:`size-3.5 shrink-0 text-(--side)`}),mobile:(0,Y.jsx)(Hn,{role:`img`,"aria-label":`iOS`,"data-side":`mobile`,className:`size-3.5 shrink-0 text-(--side)`}),server:(0,Y.jsx)(Bn,{role:`img`,"aria-label":`server`,"data-side":`server`,className:`size-3.5 shrink-0 text-(--side)`}),unknown:(0,Y.jsx)(Bn,{"aria-hidden":!0,"data-side":`unknown`,className:`size-3.5 shrink-0 text-(--side)`}),web:(0,Y.jsx)(In,{role:`img`,"aria-label":`web`,"data-side":`web`,className:`size-3.5 shrink-0 text-(--side)`})},Uh=s(U({key:H,value:E})),Wh=w(H,E),Gh=Fe(De(Re(Object.assign({"../../../../auth/src/routes/icon.svg":Xn,"../../../../deploy/src/routes/icon.svg":Zn,"../../../../gateway/src/routes/icon.svg":Qn,"../../../../opm/src/routes/icon.svg":$n,"../../../../portfolio/src/routes/icon.svg":er,"../icon.svg":tr,"../../../../signal/src/routes/icon.svg":nr,"../../../../stash/src/routes/icon.svg":rr,"../../../../trips/src/routes/icon.svg":ir})),e=>[l(e[0],`/`)[4]??``,e[1]]));function Kh(e){return ne(T(e.cause),{onNone:()=>(0,Y.jsx)(_n,{error:C(e.cause),reset:()=>location.reload()}),onSome:e=>oh(e)?(0,Y.jsx)(xn,{href:ah(location.href)}):(0,Y.jsx)(_n,{error:e,reset:()=>location.reload()})})}function qh(e){return me(ye(Wh)(e),Ee(e=>pt(Se(e))),Nt(e=>ue(e)||d(e)||D(e)),ne({onNone:()=>ie(e),onSome:e=>`${e}`}))}function Jh(e){return Me(De(Me(m(ye(Uh)(e.payload.attributes),()=>[]),e=>e.key!==`service.name`),e=>({key:e.key,value:qh(e.value)})),t=>t.value!==e.name)}function Yh(e){return me(g(e,e=>e.status===2),Ee(e=>At(e.payload.status)),Nt(fe),Ee(e=>At(me(ct(e,`message`),Dt))),Nt(_),Nt(y))}function Xh(e){return v(Yh(e))||ot(Jh(e))||ot(e.logs)}function Zh(e){return`calc(var(--spacing) * 10 + ${x(0,e.depth-1)*12}px)`}function Qh(e){let t=(0,X.c)(4),n;t[0]===e.span?n=t[1]:(n=De([...ne(Yh(e.span),{onNone:ng,onSome:tg}),...De(Jh(e.span),eg),...De(e.span.logs,$h)],(t,n)=>(0,Y.jsxs)(`div`,{className:`flex items-baseline gap-3 py-1 pr-1 pl-(--indent)`,style:{"--indent":Zh(e.span)},children:[(0,Y.jsx)(`dt`,{className:`text-muted-foreground shrink-0`,children:t.key}),(0,Y.jsx)(`dd`,{className:nn(`min-w-0 flex-1 text-right break-all select-text`,t.failed&&`text-destructive`),children:ve(t.key===`url.full`&&Je(`https://`)(t.value),{onFalse:()=>t.value,onTrue:()=>(0,Y.jsx)(`a`,{href:t.value,target:`_blank`,rel:`noreferrer`,className:`text-primary`,children:t.value})})}),(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`})]},`${t.key}:${n}`)),t[0]=e.span,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Y.jsx)(`dl`,{className:`flex flex-col pb-1 font-mono text-xs`,children:n}),t[2]=n,t[3]=r),r}function $h(e){return{failed:e.status===2,key:`log`,value:e.name}}function eg(e){return{...e,failed:!1}}function tg(e){return[{failed:!0,key:`error`,value:e}]}function ng(){return[]}function rg(e){let t=(0,X.c)(35),n;t[0]===e.span?n=t[1]:(n=Zh(e.span),t[0]=e.span,t[1]=n);let r;t[2]===n?r=t[3]:(r={"--indent":n},t[2]=n,t[3]=r);let i;if(t[4]!==e.mark||t[5]!==e.span.service){let n;t[7]===e.span.service?n=t[8]:(n=t=>(0,Y.jsx)(`img`,{src:t,alt:Bh(e.span.service),className:`pixelated size-3.5 shrink-0`}),t[7]=e.span.service,t[8]=n),i=ne(e.mark,{onNone:cg,onSome:n}),t[4]=e.mark,t[5]=e.span.service,t[6]=i}else i=t[6];let a;t[9]===e.span.name?a=t[10]:(a=(0,Y.jsx)(`span`,{className:`truncate`,children:e.span.name}),t[9]=e.span.name,t[10]=a);let o;t[11]!==r||t[12]!==i||t[13]!==a?(o=(0,Y.jsxs)(`span`,{className:`flex w-36 shrink-0 items-center gap-1.5 pl-(--indent) text-left sm:w-56`,style:r,children:[i,a]}),t[11]=r,t[12]=i,t[13]=a,t[14]=o):o=t[14];let s=e.span.runtime,c;t[15]===e.span.status?c=t[16]:(c=nn(`absolute top-0 left-(--offset) h-2 w-(--length) min-w-0.5`,ve(e.span.status===2,{onFalse:sg,onTrue:og})),t[15]=e.span.status,t[16]=c);let l=`calc(${e.span.durationMs} / var(--trace-total) * 100%)`,u=`calc(${e.span.offsetMs} / var(--trace-total) * 100%)`,d;t[17]!==l||t[18]!==u?(d={"--length":l,"--offset":u},t[17]=l,t[18]=u,t[19]=d):d=t[19];let f;t[20]!==e.span.runtime||t[21]!==c||t[22]!==d?(f=(0,Y.jsx)(`span`,{className:`relative h-2 flex-1`,children:(0,Y.jsx)(`span`,{"data-side":s,className:c,style:d})}),t[20]=e.span.runtime,t[21]=c,t[22]=d,t[23]=f):f=t[23];let p;t[24]===e.span.durationMs?p=t[25]:(p=Rh(e.span.durationMs),t[24]=e.span.durationMs,t[25]=p);let m;t[26]===p?m=t[27]:(m=(0,Y.jsx)(`span`,{className:`text-muted-foreground w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:p}),t[26]=p,t[27]=m);let h;t[28]===e.open?h=t[29]:(h=ne(se(e.open),{onNone:ag,onSome:ig}),t[28]=e.open,t[29]=h);let g;return t[30]!==f||t[31]!==m||t[32]!==h||t[33]!==o?(g=(0,Y.jsxs)(Y.Fragment,{children:[o,f,m,h]}),t[30]=f,t[31]=m,t[32]=h,t[33]=o,t[34]=g):g=t[34],g}function ig(e){return(0,Y.jsx)(Pn,{className:nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,e&&`rotate-90`)})}function ag(){return(0,Y.jsx)(`span`,{className:`size-3.5 shrink-0`})}function og(){return`bg-destructive`}function sg(){return`bg-(--side)`}function cg(){return null}function lg(e){let t=Me(e,e=>e.status===2),n=De(t,e=>m(Nt(At(e.payload.parentSpanId),_),()=>``));return yt(t,e=>!St(n,t=>I(t)===e.spanId))}function ug(e){let t=(0,X.c)(16),n=`${e.id}:${e.size}`,r;t[0]===n?r=t[1]:(r=Fh(n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={includeFailure:!0},t[2]=i):i=t[2];let a=wr(r,i),[o,s]=(0,J.useState)();if(wt(a)){let e;return t[3]===a.cause?e=t[4]:(e=(0,Y.jsx)(Kh,{cause:a.cause}),t[3]=a.cause,t[4]=e),e}let c=a.value,l;if(t[5]!==o||t[6]!==c.durationMs||t[7]!==c.spans){let e=yt(c.spans,gg),n=Me(c.spans,t=>!Tt(e,e=>e.spanId===t.spanId)),r=Fe(De(c.spans,hg)),i=function(t){let n=r[t.parentSpanId]??ne(e,{onNone:()=>t.service,onSome:mg});return Nt(se(Gh[Bh(t.service)]),()=>Bh(t.service)!==Bh(n))},a;t[9]!==o||t[10]!==c.spans?(a=()=>yt(c.spans,e=>e.spanId===o),t[9]=o,t[10]=c.spans,t[11]=a):a=t[11];let u=Nt(ve(o===void 0,{onFalse:a,onTrue:()=>me(lg(c.spans),Xe(()=>e))}),Xh),d;t[12]===c.durationMs?d=t[13]:(d=x(c.durationMs,1),t[12]=c.durationMs,t[13]=d);let f=`${d}`,p;t[14]===f?p=t[15]:(p={"--trace-total":f},t[14]=f,t[15]=p),l=(0,Y.jsxs)(`div`,{className:`flex flex-col pb-2`,style:p,children:[ne(Nt(u,t=>Tt(e,e=>e.spanId===t.spanId)),{onNone:pg,onSome:fg}),De(n,e=>ve(Xh(e),{onFalse:()=>(0,Y.jsx)(`div`,{className:`flex h-8 w-full items-center gap-3 pr-1 text-xs`,children:(0,Y.jsx)(rg,{mark:i(e),span:e})},e.spanId),onTrue:()=>(0,Y.jsxs)($m,{open:Tt(u,t=>t.spanId===e.spanId),onOpenChange:t=>s(ve(t,{onFalse:dg,onTrue:()=>e.spanId})),className:`data-open:bg-muted/60`,children:[(0,Y.jsx)(eh,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 text-left text-xs`,children:(0,Y.jsx)(rg,{mark:i(e),span:e,open:Tt(u,t=>t.spanId===e.spanId)})}),(0,Y.jsx)(th,{children:(0,Y.jsx)(Qh,{span:e})})]},e.spanId)}))]}),t[5]=o,t[6]=c.durationMs,t[7]=c.spans,t[8]=l}else l=t[8];return l}function dg(){return``}function fg(e){return(0,Y.jsx)(Qh,{span:e})}function pg(){return null}function mg(e){return e.service}function hg(e){return[e.spanId,e.service]}function gg(e){return e.depth===0}function _g(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(`div`,{"aria-busy":`true`,role:`status`,"aria-label":`Spans`,className:`flex flex-col gap-2 py-2 pr-1 pl-10`,children:De(Qe(1,4),vg)}),e[0]=t):t=e[0],t}function vg(e){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(nh,{className:`h-4 w-32`}),(0,Y.jsx)(nh,{className:`h-2 flex-1`})]},e)}function yg(e){let t=(0,X.c)(37),[n,r]=(0,J.useState)(!1),i=e.arrived&&`grow-in`,a;t[0]===i?a=t[1]:(a=nn(i),t[0]=i,t[1]=a);let o;t[2]===e?o=t[3]:(o=t=>{r(t),e.onOpenChange(t)},t[2]=e,t[3]=o);let s;t[4]!==e.now||t[5]!==e.trace.time?(s=Lh(e.trace.time,e.now),t[4]=e.now,t[5]=e.trace.time,t[6]=s):s=t[6];let c;t[7]===s?c=t[8]:(c=(0,Y.jsx)(`span`,{className:`text-muted-foreground w-8 shrink-0 font-mono`,children:s}),t[7]=s,t[8]=c);let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Y.jsx)(`span`,{className:`flex-1`}),t[9]=l):l=t[9];let u;t[10]===e.trace.failure?u=t[11]:(u=e.trace.failure!==void 0&&(0,Y.jsx)(Qm,{variant:`destructive`,className:`max-w-40 shrink-0 font-mono`,title:`Failed at ${e.trace.failure.span}`,children:(0,Y.jsx)(`span`,{className:`truncate`,children:e.trace.failure.span})}),t[10]=e.trace.failure,t[11]=u);let d;t[12]===e.trace.durationMs?d=t[13]:(d=Rh(e.trace.durationMs),t[12]=e.trace.durationMs,t[13]=d);let f;t[14]===d?f=t[15]:(f=(0,Y.jsx)(`span`,{className:`w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:d}),t[14]=d,t[15]=f);let p=n&&`rotate-90`,m;t[16]===p?m=t[17]:(m=nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,p),t[16]=p,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,Y.jsx)(Pn,{className:m}),t[18]=m,t[19]=h);let g;t[20]!==h||t[21]!==c||t[22]!==u||t[23]!==f?(g=(0,Y.jsxs)(eh,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 pl-6 text-left text-xs`,children:[c,l,u,f,h]}),t[20]=h,t[21]=c,t[22]=u,t[23]=f,t[24]=g):g=t[24];let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Y.jsx)(_g,{}),t[25]=_):_=t[25];let v;t[26]!==e.trace.durationMs||t[27]!==e.trace.id?(v=(0,Y.jsx)(th,{children:(0,Y.jsx)(J.Suspense,{fallback:_,children:(0,Y.jsx)(ug,{id:e.trace.id,size:e.trace.durationMs})})}),t[26]=e.trace.durationMs,t[27]=e.trace.id,t[28]=v):v=t[28];let y;t[29]!==n||t[30]!==g||t[31]!==v||t[32]!==o?(y=(0,Y.jsxs)($m,{open:n,onOpenChange:o,className:`border-b`,children:[g,v]}),t[29]=n,t[30]=g,t[31]=v,t[32]=o,t[33]=y):y=t[33];let b;return t[34]!==a||t[35]!==y?(b=(0,Y.jsx)(`div`,{className:a,children:y}),t[34]=a,t[35]=y,t[36]=b):b=t[36],b}function bg(e){let t=(0,X.c)(59),[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(Ae),o,s,c,l,u,d,f,p,m;if(t[0]!==n||t[1]!==i||t[2]!==e.arrived||t[3]!==e.now||t[4]!==e.operation.count||t[5]!==e.operation.failures||t[6]!==e.operation.name||t[7]!==e.operation.p50Ms||t[8]!==e.operation.runtime||t[9]!==e.operation.traces){let h;t[19]===e.operation.traces?h=t[20]:(h=t=>!St(e.operation.traces,e=>e.id===t.id),t[19]=e.operation.traces,t[20]=h);let g=[...e.operation.traces,...Me(Se(i),h)];s=$m,u=`listitem`,d=n,f=r,p=`border-b`;let _=Hh[e.operation.runtime],v;t[21]===e.operation.name?v=t[22]:(v=(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.operation.name}),t[21]=e.operation.name,t[22]=v);let y;t[23]===e.operation.failures?y=t[24]:(y=e.operation.failures>0&&(0,Y.jsxs)(Qm,{variant:`destructive`,className:`shrink-0 font-mono`,title:`Failed`,children:[e.operation.failures,(0,Y.jsx)(`span`,{className:`sr-only`,children:` failed`})]}),t[23]=e.operation.failures,t[24]=y);let b;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Y.jsx)(`span`,{className:`sr-only`,children:` runs`}),t[25]=b):b=t[25];let x;t[26]===e.operation.count?x=t[27]:(x=(0,Y.jsxs)(`span`,{className:`text-muted-foreground w-12 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums max-sm:hidden`,title:`Runs`,children:[e.operation.count,`×`,b]}),t[26]=e.operation.count,t[27]=x);let S;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Y.jsx)(`span`,{className:`sr-only`,children:`typical `}),t[28]=S):S=t[28];let C;t[29]===e.operation.p50Ms?C=t[30]:(C=Rh(e.operation.p50Ms),t[29]=e.operation.p50Ms,t[30]=C);let w;t[31]===C?w=t[32]:(w=(0,Y.jsxs)(`span`,{className:`w-14 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums`,title:`Typical`,children:[S,C]}),t[31]=C,t[32]=w);let T=n&&`rotate-90`,E;t[33]===T?E=t[34]:(E=nn(`text-muted-foreground size-3.5 shrink-0 transition-transform`,T),t[33]=T,t[34]=E);let D;t[35]===E?D=t[36]:(D=(0,Y.jsx)(Pn,{className:E}),t[35]=E,t[36]=D),t[37]!==y||t[38]!==x||t[39]!==w||t[40]!==D||t[41]!==_||t[42]!==v?(m=(0,Y.jsxs)(eh,{className:`hover:bg-muted/50 flex h-10 w-full cursor-pointer items-center gap-3 px-1 text-left text-sm`,children:[_,v,y,x,w,D]}),t[37]=y,t[38]=x,t[39]=w,t[40]=D,t[41]=_,t[42]=v,t[43]=m):m=t[43],o=th,c=`border-t`;let O;t[44]!==e.arrived||t[45]!==e.now?(O=t=>(0,Y.jsx)(yg,{arrived:ge(e.arrived,t.id),now:e.now,onOpenChange:e=>a(n=>ve(e,{onFalse:()=>tt(n,t.id),onTrue:()=>Ve(n,t.id,t)})),trace:t},t.id),t[44]=e.arrived,t[45]=e.now,t[46]=O):O=t[46],l=De(g,O),t[0]=n,t[1]=i,t[2]=e.arrived,t[3]=e.now,t[4]=e.operation.count,t[5]=e.operation.failures,t[6]=e.operation.name,t[7]=e.operation.p50Ms,t[8]=e.operation.runtime,t[9]=e.operation.traces,t[10]=o,t[11]=s,t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=f,t[17]=p,t[18]=m}else o=t[10],s=t[11],c=t[12],l=t[13],u=t[14],d=t[15],f=t[16],p=t[17],m=t[18];let h;t[47]!==o||t[48]!==c||t[49]!==l?(h=(0,Y.jsx)(o,{className:c,children:l}),t[47]=o,t[48]=c,t[49]=l,t[50]=h):h=t[50];let g;return t[51]!==s||t[52]!==u||t[53]!==d||t[54]!==f||t[55]!==p||t[56]!==m||t[57]!==h?(g=(0,Y.jsxs)(s,{role:u,open:d,onOpenChange:f,className:p,children:[m,h]}),t[51]=s,t[52]=u,t[53]=d,t[54]=f,t[55]=p,t[56]=m,t[57]=h,t[58]=g):g=t[58],g}function xg(e){let t=(0,X.c)(5),n=I(Gm()),r=_r(Ph).arrived,i=xe(_r(Ih),Ng),a=Me(De(e.overview.apps,e=>({...e,operations:Me(e.operations,t=>Ot(n)(I(`${e.name} ${gt(De(e.versions,Mg),` `)} ${Vh[t.runtime]} ${t.name}`)))})),jg);if(We(a)){let e=ve(n===``,{onFalse:Ag,onTrue:kg}),r;return t[0]===e?r=t[1]:(r=(0,Y.jsx)(fn,{children:(0,Y.jsx)(an,{children:(0,Y.jsx)(vn,{children:e})})}),t[0]=e,t[1]=r),r}let s;return t[2]!==r||t[3]!==i?(s=e=>(0,Y.jsxs)(`section`,{"aria-label":e.name,className:`flex flex-col`,children:[(0,Y.jsxs)(`h2`,{className:`flex h-9 items-center gap-2 px-1 text-sm font-semibold`,children:[ne(se(Gh[e.name]),{onNone:()=>ve(o(e.operations,Og),{onFalse:Dg,onTrue:Eg}),onSome:Tg}),e.name,ne(pt(e.versions),{onNone:wg,onSome:t=>(0,Y.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs font-normal tabular-nums`,title:gt(De(e.versions,Sg),`
|
|
2
2
|
`),children:t.version})})]}),(0,Y.jsx)(`div`,{role:`list`,children:De(e.operations,e=>(0,Y.jsx)(bg,{arrived:r,now:i,operation:e},`${e.runtime} ${e.name}`))})]},e.name),t[2]=r,t[3]=i,t[4]=s):s=t[4],De(a,s)}function Sg(e){return`${gt(De(e.runtimes,Cg),`, `)} ${e.version}`}function Cg(e){return Vh[e]}function wg(){return null}function Tg(e){return(0,Y.jsx)(`img`,{src:e,alt:``,className:`pixelated size-5`})}function Eg(){return(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(ih,{className:`size-4 dark:hidden`}),(0,Y.jsx)(rh,{className:`hidden size-4 dark:block`})]})}function Dg(){return(0,Y.jsx)(Bn,{className:`text-muted-foreground size-4`})}function Og(e){return e.runtime===`ci`}function kg(){return`No traces yet`}function Ag(){return`No operation matches`}function jg(e){return ot(e.operations)}function Mg(e){return e.version}function Ng(){return Ct($e())}function Pg(){let e=(0,X.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={includeFailure:!0},e[0]=t):t=e[0];let n=wr(Nh,t);if(wt(n)){let t;return e[1]===n.cause?t=e[2]:(t=(0,Y.jsx)(Kh,{cause:n.cause}),e[1]=n.cause,e[2]=t),t}let r;return e[3]===n.value?r=e[4]:(r=(0,Y.jsx)(xg,{overview:n.value}),e[3]=n.value,e[4]=r),r}function Fg(){let e=(0,X.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Y.jsx)(Ym,{icon:zh,name:`scope`,commands:[]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Y.jsxs)(Y.Fragment,{children:[t,(0,Y.jsx)(Xm,{className:`gap-6`,children:(0,Y.jsx)(J.Suspense,{fallback:(0,Y.jsx)(`div`,{role:`status`,"aria-label":`Operations`,className:`flex flex-col gap-2`,children:De(Qe(1,6),Ig)}),children:(0,Y.jsx)(Pg,{})})})]}),e[1]=n):n=e[1],n}function Ig(e){return(0,Y.jsx)(nh,{className:`h-9 w-full`},e)}export{Fg as component};
|