@deslop/scope 0.1.1244 → 0.1.1246

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.
@@ -0,0 +1,41 @@
1
+ import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{$ as t,$n as n,$t as r,An as i,At as a,B as o,Bn as s,Bt as c,C as l,Cn as u,Ct as d,D as f,Dn as p,Dt as m,E as h,Et as g,F as _,Fn as v,G as y,Gn as b,Gt as x,H as S,Hn as C,Ht as w,I as T,In as E,J as D,Jt as O,K as k,Kn as A,Kt as j,L as M,Ln as N,Lt as P,M as F,Mn as I,Mt as L,N as R,Nn as z,Ot as ee,P as te,Pn as B,Q as V,Qt as ne,R as H,Rn as U,Rt as re,S as ie,Sn as ae,St as oe,T as se,Tn as ce,Tt as le,U as ue,Un as de,Ut as fe,V as pe,Vn as me,Vt as he,W as ge,Wn as _e,Wt as ve,X as ye,Y as be,Yn as xe,Yt as Se,Z as W,_ as Ce,_t as we,an as Te,at as Ee,b as De,bn as Oe,cn as ke,ct as Ae,d as je,dn as Me,dt as Ne,en as Pe,er as Fe,et as Ie,f as Le,fn as Re,ft as ze,g as Be,gn as Ve,gt as He,h as Ue,hn as We,ht as Ge,i as Ke,in as qe,it as Je,j as Ye,jn as Xe,jt as Ze,k as Qe,kn as $e,kt as et,ln as tt,lt as nt,m as rt,mn as it,mt as at,n as ot,nr as st,on as ct,p as lt,pn as ut,pt as G,q as dt,qn as ft,qt as pt,r as mt,rn as ht,rr as gt,rt as _t,s as vt,sn as yt,t as bt,tt as xt,u as St,un as Ct,ut as wt,v as Tt,vn as Et,vt as Dt,w as Ot,wn as kt,wt as At,x as jt,xn as Mt,xt as Nt,y as Pt,yn as Ft,yt as It,z as Lt,zn as Rt,zt}from"./effect-CTnU1PfQ.js";import{a as Bt,i as Vt,o as Ht,r as Ut,t as Wt}from"./react-CDnnZf73.js";import{A as Gt,B as Kt,C as qt,D as Jt,E as Yt,F as Xt,G as Zt,H as Qt,I as $t,J as en,K as tn,L as nn,M as rn,N as an,O as on,P as sn,R as cn,S as ln,T as K,U as un,V as dn,W as fn,X as pn,Y as mn,Z as hn,_ as gn,a as _n,b as vn,c as yn,d as bn,f as xn,g as Sn,h as Cn,i as wn,j as Tn,k as En,l as Dn,m as On,n as kn,o as An,p as jn,q,r as Mn,s as Nn,t as Pn,u as Fn,v as In,w as J,x as Ln,y as Rn,z as zn}from"./index-CTt5ZHpn.js";var Bn={name:`app-window`,size:24,node:[[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}],[`path`,{d:`M10 4v4`,key:`pp8u80`}],[`path`,{d:`M2 8h20`,key:`d11cs7`}],[`path`,{d:`M6 4v4`,key:`1svtjw`}]]};Bn.node;var Vn=mn(Bn),Hn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Hn.node;var Un=mn(Hn),Wn={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Wn.node;var Gn=mn(Wn),Kn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Kn.node;var qn=mn(Kn),Jn={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};Jn.node;var Yn=mn(Jn),Xn={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`}]]};Xn.node;var Zn=mn(Xn),Qn={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Qn.node;var $n=mn(Qn),er={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`}]]};er.node;var tr=mn(er),nr={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`}]]};nr.node;var rr=mn(nr),ir={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`}]]};ir.node;var ar=mn(ir),or={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};or.node;var sr=mn(or);function cr(e){return e?.ownerDocument||document}var lr=`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`,ur=`/assets/icon-B_7Zk4lP.svg`,dr=`/assets/icon-61pmFc-p.svg`,fr=`/assets/icon-BGymHyAZ.svg`,pr=`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`,mr=`/assets/icon-D1hVTa1Q.svg`,hr=`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`,gr=`/assets/icon-THdxja9j.svg`,_r=`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`,Y=e(Ht(),1),vr=e(Vt(),1);function yr(e){let t=vr.unstable_scheduleCallback(4,e);return()=>vr.unstable_cancelCallback(t)}var br=Y.createContext(Ce({scheduleTask:yr,defaultIdleTTL:400})),xr=new WeakMap,Sr=0,Cr=new Set;function wr(e){Sr++;try{return e()}finally{Sr--}}function Tr(e){if(Sr===0)return e();Cr.size===0&&queueMicrotask(Er),Cr.add(e)}function Er(){for(let e of Cr)Cr.delete(e),e()}function Dr(e,t){let n=xr.get(e);n===void 0&&(n=new WeakMap,xr.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,()=>Tr(n));return()=>{i--,Cr.delete(n),r()}},snapshot(){return wr(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:wr(()=>Le(t,e))}),a.value}};return n.set(t,o),o}function Or(e,t){let n=Dr(e,t);return Y.useEffect(Er),Y.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function kr(e,t,n){let r=Dr(e,t),i=Y.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return Y.useEffect(Er),Y.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var Ar=(e,t)=>{let n=Y.useContext(br);return t?kr(n,e,t):Or(n,e)};function jr(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?Y.useCallback(r=>{e.set(t,r);let i=m(Be(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(Mr):i},[e,t,n.mode]):Y.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var Mr=e=>{if(ne(e))return e.value;throw ht(e.cause)},Nr=(e,t)=>{let n=Y.useContext(br);return[Or(n,e),jr(n,e,t)]},Pr={suspendOnWaiting:new WeakMap,default:new WeakMap};function Fr(e,t,n){let r=n?Pr.suspendOnWaiting:Pr.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 Ir(e,t,n){let r=Or(e,t);if(r._tag===`Initial`||n&&r.waiting)throw Fr(e,t,n);return r}var Lr=(e,t)=>{let n=Ir(Y.useContext(br),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw ht(n.cause);return n};function Rr(e){return xn(e.defaultTagName??`div`,e,e)}var X=Wt(),zr=1,Br=.9,Vr=.8,Hr=.17,Ur=.1,Wr=.999,Gr=.9999,Kr=.99,qr=/[\\\/_+.#"@\[\(\{&]/,Jr=/[\\\/_+.#"@\[\(\{&]/g,Yr=/[\s-]/,Xr=/[\s-]/g;function Zr(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?zr:Kr;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Zr(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=zr:qr.test(e.charAt(l-1))?(d*=Vr,p=e.slice(i,l-1).match(Jr),p&&i>0&&(d*=Wr**+p.length)):Yr.test(e.charAt(l-1))?(d*=Br,m=e.slice(i,l-1).match(Xr),m&&i>0&&(d*=Wr**+m.length)):(d*=Hr,i>0&&(d*=Wr**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Gr)),(d<Ur&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Zr(e,t,n,r,l+1,a+2,o),f*Ur>d&&(d=f*Ur)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Qr(e){return e.toLowerCase().replace(Xr,` `)}function $r(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Zr(e,t,Qr(e),Qr(t),0,0,{})}var ei=Object.defineProperty,ti=(e,t)=>ei(e,`name`,{value:t,configurable:!0}),ni=!!(typeof window<`u`&&window.document&&window.document.createElement);function ri(e,t,{checkForDefaultPrevented:n=!0}={}){return ti(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}ti(ri,`composeEventHandlers`);function ii(e){if(!ni)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}ti(ii,`getOwnerWindow`);function ai(e){if(!ni)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}ti(ai,`getOwnerDocument`);function oi(e,t=!1){let{activeElement:n}=ai(e);if(!n?.nodeName)return null;if(si(n)&&n.contentDocument)return oi(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ai(n).getElementById(e);if(t)return t}}return n}ti(oi,`getActiveElement`);function si(e){return e.tagName===`IFRAME`}ti(si,`isFrame`);var ci=Object.defineProperty,li=(e,t)=>ci(e,`name`,{value:t,configurable:!0});function ui(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}li(ui,`setRef`);function di(...e){return t=>{let n=!1,r=e.map(e=>{let r=ui(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():ui(e[t],null)}}}}li(di,`composeRefs`);function fi(...e){return Y.useCallback(di(...e),e)}li(fi,`useComposedRefs`);var Z=Bt(),pi=Object.defineProperty,mi=(e,t)=>pi(e,`name`,{value:t,configurable:!0});function hi(e,t){let n=Y.createContext(t);n.displayName=e+`Context`;let r=mi(e=>{let{children:t,...r}=e,i=Y.useMemo(()=>r,Object.values(r));return(0,Z.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=Y.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return mi(i,`useContext`),[r,i]}mi(hi,`createContext`);function gi(e,t=[]){let n=[];function r(t,r){let i=Y.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=mi(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=Y.useMemo(()=>o,Object.values(o));return(0,Z.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=Y.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return mi(s,`useContext`),[o,s]}mi(r,`createContext`);let i=mi(()=>{let t=n.map(e=>Y.createContext(e));return mi(function(n){let r=n?.[e]||t;return Y.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,_i(i,...t)]}mi(gi,`createContextScope`);function _i(...e){let t=e[0];if(e.length===1)return t;let n=mi(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return mi(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return Y.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}mi(_i,`composeContextScopes`);var vi=globalThis?.document?Y.useLayoutEffect:()=>{},yi=Object.defineProperty,bi=(e,t)=>yi(e,`name`,{value:t,configurable:!0}),xi=Y.useId||(()=>void 0),Si=0;function Ci(e){let[t,n]=Y.useState(xi());return vi(()=>{e||n(e=>e??String(Si++))},[e]),e||(t?`radix-${t}`:``)}bi(Ci,`useId`);var wi=Object.defineProperty,Ti=(e,t)=>wi(e,`name`,{value:t,configurable:!0}),Ei=Y.useEffectEvent,Di=Y.useInsertionEffect;function Oi(e){if(typeof Ei==`function`)return Ei(e);let t=Y.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Di==`function`?Di(()=>{t.current=e}):vi(()=>{t.current=e}),Y.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ti(Oi,`useEffectEvent`);var ki=Object.defineProperty,Ai=(e,t)=>ki(e,`name`,{value:t,configurable:!0}),ji=Y.useInsertionEffect||vi;function Mi({prop:e,defaultProp:t,onChange:n=Ai(()=>{},`onChange`),caller:r}){let[i,a,o]=Ni({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,Y.useCallback(t=>{if(s){let n=Pi(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Ai(Mi,`useControllableState`);function Ni({defaultProp:e,onChange:t}){let[n,r]=Y.useState(e),i=Y.useRef(n),a=Y.useRef(t);return ji(()=>{a.current=t},[t]),Y.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Ai(Ni,`useUncontrolledState`);function Pi(e){return typeof e==`function`}Ai(Pi,`isFunction`);var Fi=Symbol(`RADIX:SYNC_STATE`);function Ii(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Oi(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=Y.useReducer((t,n)=>{if(n.type===Fi)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=Y.useRef(p);Y.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=Y.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return Y.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Fi,state:i})},[i,d.state,c]),[h,f]}Ai(Ii,`useControllableStateReducer`);var Li=e(Ut(),1),Ri=Object.defineProperty,zi=(e,t)=>Ri(e,`name`,{value:t,configurable:!0});function Bi(e){let t=Y.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=Xi(r),Y.Children.forEach(r,e=>{if(Ki(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Ji(n)&&typeof ea==`function`;)n=ea(n._payload);a=Ui(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=Y.cloneElement(a,void 0,s):!o&&Y.Children.count(r)===1&&Y.isValidElement(r)&&(a=r);let c=a?Gi(a):void 0,l=fi(n,c);if(!a){if(r||r===0)throw Error(o?$i(e):Qi(e));return r}let u=Wi(i,a.props??{});return a.type!==Y.Fragment&&(u.ref=n?l:c),Y.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}zi(Bi,`createSlot`);var Vi=Symbol.for(`radix.slottable`);function Hi(e){let t=zi(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Vi,t}zi(Hi,`createSlottable`);var Ui=zi((e,t)=>`child`in e.props?Y.isValidElement(t)?Y.cloneElement(t,void 0,e.props.children(t.props.children)):null:Y.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function Wi(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Zi(a,i))}return{...e,...n}}zi(Wi,`mergeProps`);function Gi(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}zi(Gi,`getElementRef`);function Ki(e){return Y.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Vi}zi(Ki,`isSlottable`);var qi=Symbol.for(`react.lazy`);function Ji(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===qi&&`_payload`in e&&Yi(e._payload)}zi(Ji,`isLazyComponent`);function Yi(e){return typeof e==`object`&&!!e&&`then`in e}zi(Yi,`isPromiseLike`);function Xi(e){let t=e;for(;Ji(t)&&typeof ea==`function`;)t=ea(t._payload);return t}zi(Xi,`useUnwrappedLazy`);function Zi(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}zi(Zi,`concatAriaDescribedby`);var Qi=zi(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),$i=zi(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),ea=Y.use,ta=Object.defineProperty,na=(e,t)=>ta(e,`name`,{value:t,configurable:!0}),ra=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Bi(`Primitive.${t}`),r=Y.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,Z.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ia(e,t){e&&Li.flushSync(()=>e.dispatchEvent(t))}na(ia,`dispatchDiscreteCustomEvent`);var aa=Object.defineProperty,oa=(e,t)=>aa(e,`name`,{value:t,configurable:!0}),sa=Y.useInsertionEffect;function ca(e){let t=Y.useRef(e);return typeof sa==`function`?sa(()=>{t.current=e}):vi(()=>{t.current=e}),Y.useMemo(()=>((...e)=>t.current?.(...e)),[])}oa(ca,`useCallbackRef`);var la=Object.defineProperty,ua=(e,t)=>la(e,`name`,{value:t,configurable:!0}),da=`dismissableLayer.update`,fa=`dismissableLayer.pointerDownOutside`,pa=`dismissableLayer.focusOutside`,ma,ha=Y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ga=Y.forwardRef(ua(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=Y.useContext(ha),[d,f]=Y.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=Y.useState({}),h=fi(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=Y.useRef(!1),C=ya(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:Y.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=ba(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,E=ca(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return Y.useEffect(()=>{if(T)return p.addEventListener(`keydown`,E,{capture:!0}),()=>p.removeEventListener(`keydown`,E,{capture:!0})},[p,T,E]),Y.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ma=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xa(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ma))}},[d,p,n,u]),Y.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xa())},[d,u]),Y.useEffect(()=>{let e=ua(()=>m({}),`handleUpdate`);return document.addEventListener(da,e),()=>document.removeEventListener(da,e)},[]),(0,Z.jsx)(ra.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:ri(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ri(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ri(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function _a(){let e=Y.useContext(ha),[t,n]=Y.useState(null);return Y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ua(_a,`useDismissableLayerSurface`);var va=ua(()=>!0,`IS_TRUE`);function ya(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=va}=t,s=ca(e),c=Y.useRef(!1),l=Y.useRef(!1),u=Y.useRef(new Map),d=Y.useRef(()=>{});return Y.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}ua(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}ua(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}ua(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}ua(p,`handleInteractionBubble`);let m=ua(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Sa(fa,s,p,{discrete:!0})};if(ua(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:ua(()=>c.current=!0,`onPointerDownCapture`)}}ua(ya,`usePointerDownOutside`);function ba(e,t=globalThis?.document){let n=ca(e),r=Y.useRef(!1);return Y.useEffect(()=>{let e=ua(e=>{e.target&&!r.current&&Sa(pa,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:ua(()=>r.current=!0,`onFocusCapture`),onBlurCapture:ua(()=>r.current=!1,`onBlurCapture`)}}ua(ba,`useFocusOutside`);function xa(){let e=new CustomEvent(da);document.dispatchEvent(e)}ua(xa,`dispatchUpdate`);function Sa(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?ia(i,a):i.dispatchEvent(a)}ua(Sa,`handleAndDispatchCustomEvent`);var Ca=Object.defineProperty,wa=(e,t)=>Ca(e,`name`,{value:t,configurable:!0}),Ta=`focusScope.autoFocusOnMount`,Ea=`focusScope.autoFocusOnUnmount`,Da={bubbles:!1,cancelable:!0},Oa=Y.forwardRef(wa(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=Y.useState(null),u=ca(a),d=ca(o),f=Y.useRef(null),p=fi(t,l),m=Y.useRef(i);Y.useEffect(()=>{m.current=i});let h=Y.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=Y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Y.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:za(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||za(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&za(c)};wa(e,`handleFocusIn`),wa(t,`handleFocusOut`),wa(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),Y.useEffect(()=>{if(c){Ba.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(Ta,Da);c.addEventListener(Ta,u),c.dispatchEvent(t),t.defaultPrevented||(Na(Ua(Fa(c)),{select:!0}),document.activeElement===e&&za(c))}return()=>{c.removeEventListener(Ta,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Ea,Da);c.addEventListener(Ea,d),c.dispatchEvent(r),r.defaultPrevented||za(e??t.body,{select:!0}),c.removeEventListener(Ea,d),Ba.remove(g)},0)}}},[c,u,d,g]);let _=Y.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Pa(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&za(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&za(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,Z.jsx)(ra.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),ka=Y.createContext(null);function Aa({registry:e,children:t}){return e?(0,Z.jsx)(ka.Provider,{value:e,children:t}):t}wa(Aa,`FocusScopeBranchProvider`);function ja(){let[e,t]=Y.useState([]);return{nodes:e,registry:Y.useMemo(()=>({add:wa(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:wa(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}wa(ja,`useFocusScopeBranchRegistry`);function Ma(e){let t=Y.useContext(ka);Y.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}wa(Ma,`useFocusScopeBranch`);function Na(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(za(r,{select:t}),document.activeElement!==n)return}wa(Na,`focusFirst`);function Pa(e){let t=Fa(e);return[Ia(t,e),Ia(t.reverse(),e)]}wa(Pa,`getTabbableEdges`);function Fa(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:wa(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}wa(Fa,`getTabbableCandidates`);function Ia(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):La(r,{upTo:t})))return r}wa(Ia,`findVisible`);function La(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}wa(La,`isHidden`);function Ra(e){return e.tagName===`INPUT`&&typeof e.select==`function`}wa(Ra,`isSelectableInput`);function za(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Ra(e)&&t&&e.select()}}wa(za,`focus`);var Ba=Va();function Va(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ha(e,t),e.unshift(t)},remove(t){e=Ha(e,t),e[0]?.resume()}}}wa(Va,`createFocusScopesStack`);function Ha(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}wa(Ha,`arrayRemove`);function Ua(e){return e.filter(e=>e.tagName!==`A`)}wa(Ua,`removeLinks`);var Wa=Object.defineProperty,Ga=Y.forwardRef(((e,t)=>Wa(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=Y.useState(!1);vi(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Li.createPortal((0,Z.jsx)(ra.div,{...r,ref:t}),o):null},`Portal`)),Ka=Object.defineProperty,qa=(e,t)=>Ka(e,`name`,{value:t,configurable:!0});function Ja(e,t){return Y.useReducer((e,n)=>t[e][n]??e,e)}qa(Ja,`useStateMachine`);var Ya=qa(e=>{let{present:t,children:n}=e,r=Xa(t),i=typeof n==`function`?n({present:r.isPresent}):Y.Children.only(n),a=Qa(r.ref,eo(i));return typeof n==`function`||r.isPresent?Y.cloneElement(i,{ref:a}):null},`Presence`);function Xa(e){let[t,n]=Y.useState(),r=Y.useRef(null),i=Y.useRef(e),a=Y.useRef(`none`),o=Y.useRef(void 0),[s,c]=Ja(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return Y.useEffect(()=>{s===`mounted`?(a.current=o.current??$a(r.current),o.current=void 0):a.current=`none`},[s]),vi(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=$a(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),vi(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=qa(a=>{let o=$a(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=qa(e=>{e.target===t&&(a.current=$a(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:Y.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=$a(t)}else r.current=null;n(e)},[])}}qa(Xa,`usePresence`);function Za(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}qa(Za,`setRef`);function Qa(...e){let t=Y.useRef(e);return t.current=e,Y.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Za(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Za(n[e],null)}}},[])}qa(Qa,`useStableComposedRefs`);function $a(e){return e?.animationName||`none`}qa($a,`getAnimationName`);function eo(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}qa(eo,`getElementRef`);var to=Object.defineProperty,no=(e,t)=>to(e,`name`,{value:t,configurable:!0}),ro=0,io=null;function ao(e){return oo(),e.children}no(ao,`FocusGuards`);function oo(){Y.useEffect(()=>{io||={start:so(),end:so()};let{start:e,end:t}=io;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),ro++,()=>{ro===1&&(io?.start.remove(),io?.end.remove(),io=null),ro=Math.max(0,ro-1)}},[])}no(oo,`useFocusGuards`);function so(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}no(so,`createFocusGuard`);var co=function(){return co=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},co.apply(this,arguments)};function lo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function uo(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var fo=`right-scroll-bar-position`,po=`width-before-scroll-bar`,mo=`with-scroll-bars-hidden`,ho=`--removed-body-scroll-bar-size`;function go(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function _o(e,t){var n=(0,Y.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var vo=typeof window<`u`?Y.useLayoutEffect:Y.useEffect,yo=new WeakMap;function bo(e,t){var n=_o(t||null,function(t){return e.forEach(function(e){return go(e,t)})});return vo(function(){var t=yo.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||go(e,null)}),i.forEach(function(e){r.has(e)||go(e,a)})}yo.set(n,e)},[e]),n}function xo(e){return e}function So(e,t){t===void 0&&(t=xo);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Co(e){e===void 0&&(e={});var t=So(null);return t.options=co({async:!0,ssr:!1},e),t}var wo=function(e){var t=e.sideCar,n=lo(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return Y.createElement(r,co({},n))};wo.isSideCarExport=!0;function To(e,t){return e.useMedium(t),wo}var Eo=Co(),Do=function(){},Oo=Y.forwardRef(function(e,t){var n=Y.useRef(null),r=Y.useState({onScrollCapture:Do,onWheelCapture:Do,onTouchMoveCapture:Do}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=lo(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=bo([n,t]),C=co(co({},b),i);return Y.createElement(Y.Fragment,null,u&&Y.createElement(x,{sideCar:Eo,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?Y.cloneElement(Y.Children.only(s),co(co({},C),{ref:S})):Y.createElement(v,co({},C,{className:c,ref:S}),s))});Oo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Oo.classNames={fullWidth:po,zeroRight:fo};var ko=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ao(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=ko();return t&&e.setAttribute(`nonce`,t),e}function jo(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Mo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var No=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ao())&&(jo(t,n),Mo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Po=function(){var e=No();return function(t,n){Y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fo=function(){var e=Po();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Io={left:0,top:0,right:0,gap:0},Lo=function(e){return parseInt(e||``,10)||0},Ro=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Lo(n),Lo(r),Lo(i)]},zo=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Io;var t=Ro(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Bo=Fo(),Vo=`data-scroll-locked`,Ho=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
+ .${mo} {
3
+ overflow: hidden ${r};
4
+ padding-right: ${s}px ${r};
5
+ }
6
+ body[${Vo}] {
7
+ overflow: hidden ${r};
8
+ overscroll-behavior: contain;
9
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
10
+ padding-left: ${i}px;
11
+ padding-top: ${a}px;
12
+ padding-right: ${o}px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: ${s}px ${r};
16
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
+ }
18
+
19
+ .${fo} {
20
+ right: ${s}px ${r};
21
+ }
22
+
23
+ .${po} {
24
+ margin-right: ${s}px ${r};
25
+ }
26
+
27
+ .${fo} .${fo} {
28
+ right: 0 ${r};
29
+ }
30
+
31
+ .${po} .${po} {
32
+ margin-right: 0 ${r};
33
+ }
34
+
35
+ body[${Vo}] {
36
+ ${ho}: ${s}px;
37
+ }
38
+ `},Uo=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Wo=function(){Y.useEffect(function(){return document.body.setAttribute(Vo,(Uo()+1).toString()),function(){var e=Uo()-1;e<=0?document.body.removeAttribute(Vo):document.body.setAttribute(Vo,e.toString())}},[])},Go=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Wo();var a=Y.useMemo(function(){return zo(i)},[i]);return Y.createElement(Bo,{styles:Ho(a,!t,i,n?``:`!important`)})},Ko=!1;if(typeof window<`u`)try{var qo=Object.defineProperty({},"passive",{get:function(){return Ko=!0,!0}});window.addEventListener(`test`,qo,qo),window.removeEventListener(`test`,qo,qo)}catch{Ko=!1}var Jo=Ko?{passive:!1}:!1,Yo=function(e){return e.tagName===`TEXTAREA`},Xo=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Yo(e)&&n[t]===`visible`)},Zo=function(e){return Xo(e,`overflowY`)},Qo=function(e){return Xo(e,`overflowX`)},$o=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ns(e,r)){var i=rs(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},es=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ts=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ns=function(e,t){return e===`v`?Zo(t):Qo(t)},rs=function(e,t){return e===`v`?es(t):ts(t)},is=function(e,t){return e===`h`&&t===`rtl`?-1:1},as=function(e,t,n,r,i){var a=is(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=rs(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ns(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},os=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ss=function(e){return[e.deltaX,e.deltaY]},cs=function(e){return e&&`current`in e?e.current:e},ls=function(e,t){return e[0]===t[0]&&e[1]===t[1]},us=function(e){return`
39
+ .block-interactivity-${e} {pointer-events: none;}
40
+ .allow-interactivity-${e} {pointer-events: all;}
41
+ `},ds=0,fs=[];function ps(e){var t=Y.useRef([]),n=Y.useRef([0,0]),r=Y.useRef(),i=Y.useState(ds++)[0],a=Y.useState(Fo)[0],o=Y.useRef(e);Y.useEffect(function(){o.current=e},[e]),Y.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=uo([e.lockRef.current],(e.shards||[]).map(cs),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=Y.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=os(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=$o(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=$o(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return as(h,t,e,h===`h`?s:c,!0)},[]),c=Y.useCallback(function(e){var n=e;if(fs.length&&fs[fs.length-1]===a){var r=`deltaY`in n?ss(n):os(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ls(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(cs).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=Y.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ms(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=Y.useCallback(function(e){n.current=os(e),r.current=void 0},[]),d=Y.useCallback(function(t){l(t.type,ss(t),t.target,s(t,e.lockRef.current))},[]),f=Y.useCallback(function(t){l(t.type,os(t),t.target,s(t,e.lockRef.current))},[]);Y.useEffect(function(){return fs.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Jo),document.addEventListener(`touchmove`,c,Jo),document.addEventListener(`touchstart`,u,Jo),function(){fs=fs.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Jo),document.removeEventListener(`touchmove`,c,Jo),document.removeEventListener(`touchstart`,u,Jo)}},[]);var p=e.removeScrollBar,m=e.inert;return Y.createElement(Y.Fragment,null,m?Y.createElement(a,{styles:us(i)}):null,p?Y.createElement(Go,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ms(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var hs=To(Eo,ps),gs=Y.forwardRef(function(e,t){return Y.createElement(Oo,co({},e,{ref:t,sideCar:hs}))});gs.classNames=Oo.classNames;var _s=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},vs=new WeakMap,ys=new WeakMap,bs={},xs=0,Ss=function(e){return e&&(e.host||Ss(e.parentNode))},Cs=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ss(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},ws=function(e,t,n,r){var i=Cs(t,Array.isArray(e)?e:[e]);bs[n]||(bs[n]=new WeakMap);var a=bs[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(vs.get(e)||0)+1,l=(a.get(e)||0)+1;vs.set(e,c),a.set(e,l),o.push(e),c===1&&i&&ys.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),xs++,function(){o.forEach(function(e){var t=vs.get(e)-1,i=a.get(e)-1;vs.set(e,t),a.set(e,i),t||(ys.has(e)||e.removeAttribute(r),ys.delete(e)),i||e.removeAttribute(n)}),xs--,xs||(vs=new WeakMap,vs=new WeakMap,ys=new WeakMap,bs={})}},Ts=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||_s(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ws(r,i,n,`aria-hidden`)):function(){return null}},Es=Object.defineProperty,Ds=(e,t)=>Es(e,`name`,{value:t,configurable:!0}),Os=`Dialog`,[ks,As]=gi(Os),[js,Ms]=ks(Os),Ns=Ds(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=Y.useRef(null),c=Y.useRef(null),{nodes:l,registry:u}=ja(),[d,f]=Mi({prop:r,defaultProp:i??!1,onChange:a,caller:Os}),[p,m]=Y.useState(0),[h,g]=Y.useState(0);return(0,Z.jsx)(js,{scope:t,triggerRef:s,contentRef:c,contentId:Ci(),titleId:Ci(),descriptionId:Ci(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:Y.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Ps=`DialogPortal`,[Fs,Is]=ks(Ps,{forceMount:void 0}),Ls=Ds(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Ms(Ps,t);return(0,Z.jsx)(Fs,{scope:t,forceMount:n,children:Y.Children.map(r,e=>(0,Z.jsx)(Ya,{present:n||a.open,children:(0,Z.jsx)(Ga,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Rs=`DialogOverlay`,zs=Y.forwardRef(Ds(function(e,t){let n=Is(Rs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ms(Rs,e.__scopeDialog);return a.modal?(0,Z.jsx)(Ya,{present:r||a.open,children:(0,Z.jsx)(Vs,{...i,ref:t})}):null},`DialogOverlay`)),Bs=Bi(`DialogOverlay.RemoveScroll`),Vs=Y.forwardRef(Ds(function(e,t){let{__scopeDialog:n,...r}=e,i=Ms(Rs,n),a=fi(t,_a());return(0,Z.jsx)(gs,{as:Bs,allowPinchZoom:!0,shards:Y.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,Z.jsx)(ra.div,{"data-state":Js(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Hs=`DialogContent`,Us=Y.forwardRef(Ds(function(e,t){let n=Is(Hs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Ms(Hs,e.__scopeDialog);return(0,Z.jsx)(Ya,{present:r||a.open,children:a.modal?(0,Z.jsx)(Ws,{...i,ref:t}):(0,Z.jsx)(Gs,{...i,ref:t})})},`DialogContent`)),Ws=Y.forwardRef(Ds(function(e,t){let n=Ms(Hs,e.__scopeDialog),r=Y.useRef(null),i=fi(t,n.contentRef,r);return Y.useEffect(()=>{let e=r.current;if(e)return Ts(e)},[]),(0,Z.jsx)(Ks,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:ri(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ri(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ri(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Gs=Y.forwardRef(Ds(function(e,t){let n=Ms(Hs,e.__scopeDialog),r=Y.useRef(!1),i=Y.useRef(!1);return(0,Z.jsx)(Ks,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ks=Y.forwardRef(Ds(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Ms(Hs,n);return oo(),(0,Z.jsx)(Aa,{registry:l.branchRegistry,children:(0,Z.jsx)(Oa,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,Z.jsx)(ga,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?qs(o,l.descriptionId):o,"data-state":Js(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`));function qs(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ds(qs,`concatAriaDescribedby`);function Js(e){return e?`open`:`closed`}Ds(Js,`getState`);var Ys=`[cmdk-group=""]`,Xs=`[cmdk-group-items=""]`,Zs=`[cmdk-group-heading=""]`,Qs=`[cmdk-item=""]`,$s=`${Qs}:not([aria-disabled="true"])`,ec=`cmdk-item-select`,tc=`data-value`,nc=(e,t,n)=>$r(e,t,n),rc=Y.createContext(void 0),ic=()=>Y.useContext(rc),ac=Y.createContext(void 0),oc=()=>Y.useContext(ac),sc=Y.createContext(void 0),cc=Y.forwardRef((e,t)=>{let n=Sc(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Sc(()=>new Set),i=Sc(()=>new Map),a=Sc(()=>new Map),o=Sc(()=>new Set),s=bc(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=Ci(),y=Ci(),b=Ci(),x=Y.useRef(null),S=Tc();xc(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),xc(()=>{S(6,k)},[]);let C=Y.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=Y.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??nc;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Xs);t?t.appendChild(e.parentElement===t?e:e.closest(`${Xs} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Xs} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${Ys}[${tc}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(tc);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Ys)?.querySelector(Zs))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${Qs}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll($s)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(tc))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(tc))}function P(e){let t=A()?.closest(Ys),n;for(;t&&!n;)t=e>0?vc(t,Ys):yc(t,Ys),n=t?.querySelector($s);n?C.setState(`value`,n.getAttribute(tc)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return Y.createElement(ra.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(ec);t.dispatchEvent(e)}}}}},Y.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:Oc},c),Dc(e,e=>Y.createElement(ac.Provider,{value:C},Y.createElement(rc.Provider,{value:w},e))))}),lc=Y.forwardRef((e,t)=>{let n=Ci(),r=Y.useRef(null),i=Y.useContext(sc),a=ic(),o=bc(e),s=o.current?.forceMount??i?.forceMount;xc(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=wc(n,r,[e.value,e.children,r],e.keywords),l=oc(),u=Cc(e=>e.value&&e.value===c.current),d=Cc(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);Y.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(ec,f),()=>t.removeEventListener(ec,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Y.createElement(ra.div,{ref:di(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),uc=Y.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ci(),s=Y.useRef(null),c=Y.useRef(null),l=Ci(),u=ic(),d=Cc(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));xc(()=>u.group(o),[]),wc(o,s,[e.value,e.heading,c]);let f=Y.useMemo(()=>({id:o,forceMount:i}),[i]);return Y.createElement(ra.div,{ref:di(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&Y.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Dc(e,e=>Y.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Y.createElement(sc.Provider,{value:f},e))))}),dc=Y.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Y.useRef(null),a=Cc(e=>!e.search);return!n&&!a?null:Y.createElement(ra.div,{ref:di(i,t),...r,"cmdk-separator":``,role:`separator`})}),fc=Y.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=oc(),o=Cc(e=>e.search),s=Cc(e=>e.selectedItemId),c=ic();return Y.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Y.createElement(ra.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),pc=Y.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Y.useRef(null),o=Y.useRef(null),s=Cc(e=>e.selectedItemId),c=ic();return Y.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Y.createElement(ra.div,{ref:di(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Dc(e,e=>Y.createElement(`div`,{ref:di(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),mc=Y.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Y.createElement(Ns,{open:n,onOpenChange:r},Y.createElement(Ls,{container:o},Y.createElement(zs,{"cmdk-overlay":``,className:i}),Y.createElement(Us,{"aria-label":e.label,"cmdk-dialog":``,className:a},Y.createElement(cc,{ref:t,...s}))))}),hc=Y.forwardRef((e,t)=>Cc(e=>e.filtered.count===0)?Y.createElement(ra.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),gc=Y.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Y.createElement(ra.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Dc(e,e=>Y.createElement(`div`,{"aria-hidden":!0},e)))}),_c=Object.assign(cc,{List:pc,Item:lc,Input:fc,Group:uc,Separator:dc,Dialog:mc,Empty:hc,Loading:gc});function vc(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function yc(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function bc(e){let t=Y.useRef(e);return xc(()=>{t.current=e}),t}var xc=typeof window>`u`?Y.useEffect:Y.useLayoutEffect;function Sc(e){let t=Y.useRef();return t.current===void 0&&(t.current=e()),t}function Cc(e){let t=oc(),n=()=>e(t.snapshot());return Y.useSyncExternalStore(t.subscribe,n,n)}function wc(e,t,n,r=[]){let i=Y.useRef(),a=ic();return xc(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(tc,s),i.current=s}),i}var Tc=()=>{let[e,t]=Y.useState(),n=Sc(()=>new Map);return xc(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Ec(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Dc({asChild:e,children:t},n){return e&&Y.isValidElement(t)?Y.cloneElement(Ec(t),{ref:t.ref},n(t.props.children)):n(t)}var Oc={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},kc=Y.createContext(void 0);function Ac(e){let t=Y.useContext(kc);if(!e&&t===void 0)throw Error(ln(27));return t}var jc=`data-starting-style`,Mc=`data-ending-style`,Nc={[jc]:``},Pc={[Mc]:``},Fc={transitionStatus(e){return e===`starting`?Nc:e===`ending`?Pc:null}},Ic=`data-open`,Lc=`data-closed`,Rc=`data-anchor-hidden`,zc=`data-popup-open`,Bc=`data-pressed`,Vc={[zc]:``,[Bc]:``},Hc={[Ic]:``},Uc={[Lc]:``},Wc={[Rc]:``},Gc={open(e){return e?Vc:null}},Kc={open(e){return e?Hc:Uc},anchorHidden(e){return e?Wc:null}},qc={...Kc,...Fc},Jc=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Ac(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return xn(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:qc,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})});function Yc(e,t,n,r){let i=!1,a=!1,o=r??Cn;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 Xc(e,t,n){let r=n??Cn;return{reason:e,event:t??new Event(`base-ui`),...r}}var Zc=`none`,Qc=`trigger-press`,$c=`trigger-hover`,el=`trigger-focus`,tl=`outside-press`,nl=`item-press`,rl=`close-press`,il=`focus-out`,al=`escape-key`,ol=`list-navigation`,sl=`keyboard`,cl=`pointer`,ll=`cancel-open`,ul=`sibling-open`,dl=`imperative-action`,fl=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Ac(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Rn({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Yc(rl,e.nativeEvent))}return xn(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})});function pl(){let[,e]=Y.useState({});return Y.useCallback(()=>{e({})},[])}var ml=0;function hl(e,t=`mui`){let n=Y.useRef(void 0),r=pl(),i=e??n.current;return Y.useEffect(()=>{n.current??(ml+=1,n.current=`${t}-${ml}`,e??r())},[e,t,r]),i}var gl=Jt.useId;function _l(e,t){if(gl!==void 0){let n=gl();return e??(t?`${t}-${n}`:n)}return hl(e,t)}function vl(e){return _l(e,`base-ui`)}var yl=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ac(),c=vl(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),xn(`p`,e,{ref:t,props:[{id:c},o]})});function Q(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function bl(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function xl(e){let t=Yt(Sl,e).current;return t.next=e,J(t.effect),t}function Sl(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Cl(e){Y.useEffect(e,On)}var wl=0,Tl=class e{static create(){return new e}currentId=wl;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=wl,t()},e)}isStarted(){return this.currentId!==wl}clear=()=>{this.currentId!==wl&&(clearTimeout(this.currentId),this.currentId=wl)};disposeEffect=()=>this.clear};function El(){let e=Yt(Tl.create).current;return Cl(e.disposeEffect),e}function Dl(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Ol,platform:kl,maxTouchPoints:Al}=Dl(),jl=Ol.toLowerCase(),Ml=kl.toLowerCase(),Nl=/^i(os$|p)/.test(Ml)||Ml===`macintel`&&Al>1,Pl=`android`,Fl=Ml===Pl||jl.includes(Pl),Il=!Nl&&Ml.startsWith(`mac`);Ml.startsWith(`win`),!Fl&&/^(linux|chrome os)/.test(Ml);var Ll=Il||Nl,Rl=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Rl&&jl.includes(`firefox`),!Rl&&jl.includes(`chrom`);var zl=Ll,Bl=/jsdom|happydom/.test(jl),Vl=null;globalThis.requestAnimationFrame;var Hl=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)}},Ul=class e{static create(){return new e}static request(e){return Hl.request(e)}static cancel(e){return Hl.cancel(e)}currentId=Vl;request(e){this.cancel(),this.currentId=Hl.request(()=>{this.currentId=Vl,e()})}cancel=()=>{this.currentId!==Vl&&(Hl.cancel(this.currentId),this.currentId=Vl)};disposeEffect=()=>this.cancel};function Wl(){let e=Yt(Ul.create).current;return Cl(e.disposeEffect),e}var Gl={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},Kl={...Gl,position:`fixed`,margin:0,top:0,left:0};({...Gl});var ql=Y.forwardRef(function(e,t){let[n,r]=Y.useState();J(()=>{zl&&Rl&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:Kl,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Jl(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&un(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Yl(e,t){let n=e;for(;n;){if(cn(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(un(n)?n.host:null)}return null}function Xl(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Zl=`data-base-ui-focusable`,Ql=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,$l=`ArrowLeft`,eu=`ArrowRight`,tu=`ArrowUp`,nu=`ArrowDown`,ru=`data-trigger-disabled`;function iu(e,t){if(!cn(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(ru);for(let[,e]of t.entries())if($(e,n))return!e.hasAttribute(ru);return!1}function au(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 ou(e){return e.matches(`html,body`)}function su(e){return zn(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function cu(e){return Yl(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${Ql}`)!=null}function lu(e){return e?e.getAttribute(`role`)===`combobox`&&su(e):!1}function uu(e){if(!e||Bl)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function du(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function fu(e){e.preventDefault(),e.stopPropagation()}function pu(e){return`nativeEvent`in e}function mu(e){return e.pointerType===``&&e.isTrusted?!0:Fl&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function hu(e){return Bl?!1:!Fl&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Fl||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function gu(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function _u(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var vu=Math.min,yu=Math.max,bu=Math.round,xu=Math.floor,Su=e=>({x:e,y:e}),Cu={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function wu(e,t,n){return yu(e,vu(t,n))}function Tu(e,t){return typeof e==`function`?e(t):e}function Eu(e){return e.split(`-`)[0]}function Du(e){return e.split(`-`)[1]}function Ou(e){return e===`x`?`y`:`x`}function ku(e){return e===`y`?`height`:`width`}function Au(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ju(e){return Ou(Au(e))}function Mu(e,t,n){n===void 0&&(n=!1);let r=Du(e),i=ju(e),a=ku(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Vu(o)),[o,Vu(o)]}function Nu(e){let t=Vu(e);return[Pu(e),t,Pu(t)]}function Pu(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Fu=[`left`,`right`],Iu=[`right`,`left`],Lu=[`top`,`bottom`],Ru=[`bottom`,`top`];function zu(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Iu:Fu:t?Fu:Iu;case`left`:case`right`:return t?Lu:Ru;default:return[]}}function Bu(e,t,n,r){let i=Du(e),a=zu(Eu(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Pu)))),a}function Vu(e){let t=Eu(e);return Cu[t]+e.slice(t.length)}function Hu(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Uu(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Hu(e)}function Wu(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 Gu(e,t){return t<0||t>=e.length}function Ku(e,t){return Yu(e.current,{disabledIndices:t})}function qu(e,t){return Yu(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ju(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Yu(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:Gu(e,u)?-1:u,wrapped:d}}function Yu(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&&Xu(e,a,r));return a}function Xu(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!Qu(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Zu(e){return e.visibility===`hidden`||e.visibility===`collapse`}function Qu(e,t=e?on(e):null){return!e||!e.isConnected||!t||Zu(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var $u=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ed(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return un(n)?n.host:null}function td(e){for(let t of Array.from(e.children))if(rn(t)===`summary`)return t;return null}function nd(e,t){let n=td(t);return!!n&&(e===n||$(n,e))}function rd(e){let t=e?rn(e):``;return e!=null&&e.matches($u)&&(t!==`summary`||e.parentElement!=null&&rn(e.parentElement)===`details`&&td(e.parentElement)===e)&&(t!==`details`||td(e)==null)&&(t!==`input`||e.type!==`hidden`)}function id(e){if(!rd(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ed(t)){let n=t!==e,r=rn(t)===`slot`;if(t.hasAttribute(`inert`)||n&&rn(t)===`details`&&!t.open&&!nd(e,t)||t.hasAttribute(`hidden`)||!r&&!ad(t,n))return!1}return!0}function ad(e,t){let n=on(e);return t?n.display!==`none`:Qu(e,n)}function od(e){let t=e.tabIndex;if(t<0){let t=rn(e);if(t===`details`||t===`audio`||t===`video`||zn(e)&&e.isContentEditable)return 0}return t}function sd(e){if(rn(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function cd(e,t){let n=sd(e);if(!n)return!0;let r=t.find(e=>{let t=sd(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=sd(e);return t?.name===n.name&&t.form===n.form})===n}function ld(e){if(zn(e)&&rn(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return zn(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function ud(e,t){ld(e).forEach(e=>{rd(e)&&t.push(e),ud(e,t)})}function dd(e,t,n){ld(e).forEach(e=>{zn(e)&&e.matches(t)&&n.push(e),dd(e,t,n)})}function fd(e){return id(e)&&od(e)>=0}function pd(e){let t=[];return ud(e,t),t.filter(id)}function md(e){let t=pd(e);return t.filter(e=>od(e)>=0&&cd(e,t))}function hd(e,t){let n=md(e),r=n.length;if(r===0)return;let i=Jl(cr(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function gd(e){return hd(cr(e).body,1)||e}function _d(e){return hd(cr(e).body,-1)||e}function vd(e,t,n){if(!e)return null;let r=[];ud(cr(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(id);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!$(n,o)&&fd(o)&&cd(o,a))return o}return r[i]}function yd(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function bd(e){md(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function xd(e){let t=[];dd(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 Sd(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Sd(e,t.id,n)])}function Cd(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 wd(e){return`data-base-ui-${e}`}var Td=0;function Ed(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Td);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),Sn;let o=requestAnimationFrame(a);return Td=o,()=>{Td===o&&(cancelAnimationFrame(o),Td=0)}}var Dd=`data-base-ui-inert`,Od=new WeakMap,kd=new WeakSet,Ad=new WeakMap,jd=0;function Md(e){return e?un(e)?e.host:Md(e.parentNode):null}var Nd=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Md(t);return e.contains(n)?n:null}).filter(e=>e!=null),Pd=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Fd=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{rn(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Id(e,t,n,{mark:r=!0}){let i=Nd(t,e),a=r?Fd(t,Pd(i),new Set(i)):[],o=[],s=[];if(n){let e=Nd(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Fd(t,Pd(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Od.get(e)||0)+1;Od.set(e,r),o.push(e),r===1&&n&&kd.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Ad.get(e)||0)+1;Ad.set(e,t),s.push(e),t===1&&e.setAttribute(Dd,``)}),jd+=1,()=>{o.forEach(e=>{let t=(Od.get(e)||0)-1;Od.set(e,t),t||(kd.has(e)||e.removeAttribute(`aria-hidden`),kd.delete(e))}),r&&s.forEach(e=>{let t=(Ad.get(e)||0)-1;Ad.set(e,t),t||e.removeAttribute(Dd)}),--jd,jd||(Od=new WeakMap,kd=new WeakSet,Ad=new WeakMap)}}function Ld(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=cr(e[0]).body;return Id(e,i,n,{mark:r})}var Rd={style:{transition:`none`}},zd={fallbackAxisSide:`none`},Bd={fallbackAxisSide:`end`},Vd={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Hd=Y.createContext(null),Ud=()=>Y.useContext(Hd),Wd=wd(`portal`);function Gd(e={}){let{ref:t,container:n,componentProps:r=Cn,elementProps:i}=e,a=_l(),o=Ud()?.portalNode,[s,c]=Y.useState(null),[l,u]=Y.useState(null),d=K(e=>{e!==null&&u(e)}),f=Y.useRef(null);J(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(dn(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=xn(`div`,r,{ref:[t,d],props:[{id:a,[Wd]:``},i]}),m=s&&p?Li.createPortal(p,s):null;return{node:l,nodeId:Y.isValidElement(p)?p.props.id:void 0,subtree:m}}var Kd=Y.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}=Gd({container:o,ref:t,componentProps:e,elementProps:c}),f=Y.useRef(null),p=Y.useRef(null),m=Y.useRef(null),h=Y.useRef(null),[g,_]=Y.useState(null),v=Y.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;Y.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&yd(e)&&(e.type===`focusin`?v.current&&=(xd(l),!1):(bd(l),v.current=!0))}return bl(Q(l,`focusin`,e,!0),Q(l,`focusout`,e,!0))},[l,y]),J(()=>{l&&b===!0&&v.current&&(xd(l),v.current=!1)},[b,l]);let S=Y.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Z.jsxs)(Y.Fragment,{children:[d,(0,Z.jsxs)(Hd.Provider,{value:S,children:[x&&l&&(0,Z.jsx)(ql,{"data-type":`outside`,ref:f,onFocus:e=>{yd(e,l)?m.current?.focus():_d(g?g.domReference:null)?.focus()}}),x&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Vd}),l&&Li.createPortal(a,l),x&&l&&(0,Z.jsx)(ql,{"data-type":`outside`,ref:p,onFocus:e=>{yd(e,l)?h.current?.focus():(gd(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,Yc(`focus-out`,e.nativeEvent)))}})]})]})});function qd(){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 Jd=class{nodesRef={current:[]};events=qd();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)}},Yd=Y.createContext(null),Xd=Y.createContext(null),Zd=()=>Y.useContext(Yd)?.id||null,Qd=e=>{let t=Y.useContext(Xd);return e??t};function $d(e){let t=_l(),n=Qd(e),r=Zd();return J(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function ef(e){let{children:t,id:n}=e,r=Zd();return(0,Z.jsx)(Yd.Provider,{value:Y.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function tf(e){let{children:t,externalTree:n}=e,r=Yt(()=>n??new Jd).current;return(0,Z.jsx)(Xd.Provider,{value:r,children:t})}function nf(e){return e==null?e:`current`in e?e.current:e}function rf(e,t){let n=$t(Xl(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(mu(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var af=20,of=[];function sf(){of=of.filter(e=>e.deref()?.isConnected)}function cf(e){sf(),e&&rn(e)!==`body`&&(of.push(new WeakRef(e)),of.length>af&&(of=of.slice(-20)))}function lf(){return sf(),of[of.length-1]?.deref()}function uf(e){return e?fd(e)?e:md(e)[0]||e:null}function df(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=pd(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return fd(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 ff(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=lu(_)&&S,w=xl(i),T=xl(a),E=xl(o),D=xl(u),O=xl(g),k=Qd(m),A=Ud(),j=Y.useRef(!1),M=Y.useRef(!1),N=Y.useRef(!1),P=Y.useRef(null),F=Y.useRef(``),I=Y.useRef(``),L=Y.useRef(null),R=Y.useRef(null),z=In(L,p,A?.beforeInsideRef),ee=In(R,A?.afterInsideRef),te=El(),B=El(),V=Wl(),ne=A!=null,H=du(v),U=K((e=H)=>e?md(e):[]),re=K(()=>h?.().filter(e=>e!=null)??[]);Y.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&$(H,Jl(cr(H)))&&U().length===0&&!C&&fu(e)}return Q(cr(H),`keydown`,e)},[r,H,c,C,U]),Y.useEffect(()=>{if(r||!g)return;let e=cr(H);function t(){N.current=!1}function n(e){let t=Xl(e),n=re(),r=$(v,t)||$(_,t)||$(A?.portalNode,t)||n.some(e=>e===t||$(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,Yl(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,B.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return bl(Q(e,`pointerdown`,n,!0),Q(e,`pointerup`,t,!0),Q(e,`pointercancel`,t,!0),Q(e,`keydown`,i,!0),t)},[r,v,_,H,g,A,B,re]),Y.useEffect(()=>{if(r||!l)return;let e=cr(H);function n(){M.current=!0,B.start(0,()=>{M.current=!1})}function i(e){let t=Xl(e);fd(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Xl(n);c&&r==null&&a!=null&&$(v,a)&&cf(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=re(),p=r?.hasAttribute(wd(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,nf(f),nf(d)].includes(r),m=!($(_,r)||$(v,r)||$(r,v)||$(A?.portalNode,r)||u.some(e=>e===r||$(e,r))||l.hasMatchingElement(e=>$(e,r))||p||k&&(Sd(k.nodesRef.current,o).find(e=>$(e.context?.elements.floating,r)||$(e.context?.elements.domReference,r))||Cd(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,du(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&H&&df(H),s&&i!==_&&!Qu(a)&&Jl(e)===e.body){if(zn(H)&&(H.focus(),s===`popup`)){V.request(()=>{H.focus()});return}let e=U(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;zn(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==lf())&&(j.current=!0,t.setOpen(!1,Yc(il,n)))})}function o(){N.current||(b.current.insideReactTree=!0,te.start(0,()=>{b.current.insideReactTree=!1}))}let u=zn(_)?_:null;if(v||u)return bl(u&&Q(u,`focusout`,a),u&&Q(u,`pointerdown`,n),v&&Q(v,`focusin`,i),v&&Q(v,`focusout`,a),v&&A&&Q(v,`focusout`,o,!0))},[r,_,v,H,c,k,A,t,l,s,U,C,x,b,te,B,V,d,f,re]),Y.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${wd(`portal`)}]`)||[]),t=(k?Cd(k.nodesRef.current,x()):[]).find(e=>lu(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Ld([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,nf(f),nf(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Ld([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,re]),J(()=>{if(!g||r||!zn(H))return;F.current=``,I.current=``;let e=cr(H),t=Jl(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||$(H,t))return;let i=null,a=()=>(i??=U(H),i[0]||H),o;o=r===!0||r===null?a():nf(r),o||=a();let s=$(H,Jl(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&mu(c);Ed(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=Jl(e);return!(t!==o&&$(H,t))}})})},[r,g,H,U,w,D,O,b]);let ie=Y.useRef(null);J(()=>{if(r||!H){ie.current=null;return}ie.current&&=(ie.current.cancelled=!0,null);let e=cr(H),t=Jl(e),n=D.current==null;cf(t);function i(e){if(e.open||(F.current=rf(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(wd(`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(mu(e.nativeEvent)||hu(e.nativeEvent))j.current=!1;else{let e=!1;cr(H).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&&rn(t)!==`body`?t:null,s=n?o||a:a||o;return s||=lf()||null,typeof i==`boolean`?s:nf(i)||s||null}return()=>{y.off(`openchange`,i);let t=Jl(e),n=re(),r=$(v,t)||n.some(e=>e===t||$(e,t))||k&&Sd(k.nodesRef.current,x(),!1).some(e=>$(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ie.current=l,queueMicrotask(()=>{ie.current===l&&(ie.current=null);let n=uf(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&zn(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,H,T,E,D,y,k,_,x,re]),J(()=>{if(!Rl||g||!v)return;let e=Jl(cr(v));zn(e)&&su(e)&&$(v,e)&&e.blur()},[g,v]),J(()=>{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,_]),J(()=>{if(!r&&H)return df(H),()=>{queueMicrotask(sf)}},[r,H]);let ae=!r&&(!c||!C)&&(ne||c);return(0,Z.jsxs)(Y.Fragment,{children:[ae&&(0,Z.jsx)(ql,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=U();Ed(e[e.length-1])}else A?.portalNode&&(j.current=!1,yd(e,A.portalNode)?gd(_)?.focus():nf(f??A.beforeOutsideRef)?.focus())}}),n,ae&&(0,Z.jsx)(ql,{"data-type":`inside`,ref:ee,onFocus:e=>{c?Ed(U()[0]):A?.portalNode&&(l&&(j.current=!0),yd(e,A.portalNode)?_d(_)?.focus():nf(d??A.afterOutsideRef)?.focus())}})]})}function pf(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Qc}=t,l=e.context.dataRef,u=Y.useRef(void 0),d=Wl(),f=El(),p=Y.useMemo(()=>{function t(t,n,r,i){let a=Yc(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=gu(e.pointerType,!0)&&hu(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||gu(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=Xl(s),p=su(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:gu(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 Y.useMemo(()=>n?{reference:p}:Cn,[n,p])}function mf(){return!1}function hf(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function gf(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=mf,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=Qd(c),m=K(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=K(()=>a),{escapeKey:v,outsidePress:y}=hf(s),b=Y.useRef(!1),x=Y.useRef(!1),S=Y.useRef(!1),C=Y.useRef(!1),w=Y.useRef(!1),T=Y.useRef(``),E=Y.useRef(null),D=El(),O=El(),k=El(),A=K(()=>{O.clear(),d.current.insideReactTree=!1}),j=K(e=>{let t=d.current.floatingContext?.nodeId;return(p?Sd(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=K(t=>au(t,e.select(`floatingElement`))||au(t,e.select(`domReferenceElement`))),N=K(t=>{o()&&e.setOpen(!1,Yc(Qc,t.nativeEvent))}),P=K(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=pu(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=Yc(al,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=Xl(t.nativeEvent);$(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)});Y.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),Y.useEffect(()=>A,[A]),Y.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 Tl,i=cr(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(Rl?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&&Sd(p.nodesRef.current,t).some(t=>au(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=Xl(n),i=`[${wd(`inert`)}]`,a=cn(r)?r.getRootNode():null,o=Array.from((un(a)?a:cr(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>$(e,r))))return;let c=cn(r)?r:null;for(;c&&!Kt(c);){let e=Xt(c);if(Kt(e)||!cn(e))break;c=e}if(!(o.length&&cn(r)&&!ou(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(zn(r)&&!(`touches`in n)){let e=Kt(r),t=on(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&&!mu(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,Yc(tl,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=Xl(e);if(!n)return;let r=Q(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(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 ee(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 te(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 B(e){L(e,te)}function V(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function ne(e){L(e,V)}let H=bl(r&&bl(Q(i,`keydown`,P),Q(i,`compositionstart`,a),Q(i,`compositionend`,o)),g&&bl(Q(i,`click`,z,!0),Q(i,`pointerdown`,z,!0),Q(i,`pointerup`,ee,!0),Q(i,`pointercancel`,ee,!0),Q(i,`mousedown`,z,!0),Q(i,`mouseup`,ee,!0),Q(i,`touchstart`,R,{capture:!0,passive:!0}),Q(i,`touchmove`,B,{capture:!0,passive:!0}),Q(i,`touchend`,ne,{capture:!0,passive:!0})));return()=>{H(),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=Y.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=Y.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 Y.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function _f(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),J(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};cn(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 vf(e,t=!1,n=!1,r=!1){let[i,a]=Y.useState(e&&t?`idle`:void 0),[o,s]=Y.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),J(()=>{if(!e&&o&&i!==`ending`&&n){let e=Ul.request(()=>{a(`ending`)});return()=>{Ul.cancel(e)}}},[e,o,i,n]),J(()=>{if(!e||t||i===void 0)return;let n=Ul.request(()=>{a(void 0)});return()=>{Ul.cancel(n)}},[t,e,i]),J(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=Ul.request(()=>{a(`idle`)});return()=>{Ul.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function yf(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var bf=null;function xf(e){if(!bf){let e=[];bf=e,queueMicrotask(()=>{bf=null,Li.flushSync(()=>{for(let t of e)t()})})}bf.push(e)}function Sf(e,t=!1,n=!1){let r=Wl();return K((i,a=null)=>{r.cancel();let o=nf(e);if(o==null)return;let s=o,c=()=>{n?xf(()=>{a?.aborted||i()}):Li.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(yf(s).map(e=>e.finished.then(Sn))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(yf(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=jc;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 Cf(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=K(a),s=Sf(r,n,i);Y.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function wf(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=K(i),{mounted:c,setMounted:l,transitionStatus:u}=vf(t,!1,!1,o),d=!t&&r;J(()=>{t&&s(!1)},[t,s]);let f=Y.useRef(c),p=Y.useRef(!1),m=pl(),h=()=>{f.current=!1,l(!1),a()};J(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=K(()=>{f.current&&(t?(p.current=!0,m()):h())});return Cf({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var Tf={tabIndex:-1,[Zl]:``};function Ef(e){return t=>t!==`touch`||e.current}function Df(e,t=!1){let n=_l(),r=Zd()!=null,i=Yt(()=>e(n,r)).current;return _f({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function Of({handle:e,store:t}){return J(()=>e.attachStore(t),[e,t]),null}function kf(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Af(e,t){let n=Y.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),kf(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),kf(t))})}function jf(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 Mf(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Nf(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Af(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 J(()=>(s(t.current),()=>s(null)),[s,t,n,e]),J(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Pf(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=Y.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);J(()=>{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=Yc(Zc);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Ff(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=wf({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 Yt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function If(e,t){e.useSyncedValues(t),J(()=>()=>{e.update({activeTriggerProps:Cn,inactiveTriggerProps:Cn,popupProps:Cn})},[e])}function Lf(e,t){J(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),J(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Rf=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}},zf=[],Bf=void 0;function Vf(){return Bf}function Hf(e){zf.push(e)}function Uf(e){let t=(t,n)=>{let r=Yt(Gf).current,i;try{Bf=r;for(let e of zf)e.before(r);i=e(t,n);for(let e of zf)e.after(r);r.didInitialize=!0}finally{Bf=void 0}return i};return t.displayName=e.displayName||e.name,t}function Wf(e){return Y.forwardRef(Uf(e))}function Gf(){return{didInitialize:!1}}var Kf=hn(),qf=pn(),Jf=gn(19)?Zf:Qf;function Yf(e,t,n,r,i){return Jf(e,t,n,r,i)}function Xf(e,t,n,r,i){let a=Y.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Kf.useSyncExternalStore)(e.subscribe,a,a)}Hf({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,Kf.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Zf(e,t,n,r,i){let a=Vf();if(!a)return Xf(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 Qf(e,t,n,r,i){return(0,qf.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var $f=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 Yf(this,e,t,n,r)}},ep=class extends $f{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){Y.useDebugValue(e);let n=this;J(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;J(()=>(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);J(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){Y.useDebugValue(e);let n=this,r=t!==void 0;J(()=>{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 Y.useDebugValue(e),Yf(this,this.selectors[e],t,n,r)}useContextCallback(e,t){Y.useDebugValue(e);let n=K(t??Sn);this.context[e]=n}useStateSetter(e){let t=Y.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)}})}},tp={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},np=class extends ep{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:qd(),nested:n,triggerElements:i},tp),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&_u(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 rp(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new np({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:Cn,inactiveTriggerProps:Cn,popupProps:Cn}}var ip=e=>e.triggerIdProp??e.activeTriggerId,ap=e=>e.openProp??e.open,op=e=>(e.popupElement?.id??e.floatingId)||void 0;function sp(e,t){return t!==void 0&&ap(e)&&ip(e)===t}function cp(e,t){return sp(e,t)?!0:t!==void 0&&ap(e)&&ip(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var lp={open:ap,mounted:e=>e.mounted,transitionStatus:e=>ap(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:ip,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:op,isTriggerActive:(e,t)=>t!==void 0&&ip(e)===t,isOpenedByTrigger:(e,t)=>sp(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&ip(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>cp(e,t)?op(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function up(e){let t=Y.useCallback(t=>e===void 0?Sn:e.subscribeStore(t),[e]),n=Y.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Kf.useSyncExternalStore)(t,n,()=>e?.serverStore)}var dp=Il&&Rl;function fp(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=Y.useRef(!1),s=Y.useRef(null),c=Y.useRef(!0),l=El();Y.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=$t(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&zn(t)&&t===Jl(cr(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return bl(Q(r,`blur`,i),dp&&Q(r,`keydown`,a,!0),dp&&Q(r,`pointerdown`,l,!0))},[e,n]),Y.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);cn(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=Y.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=Xl(n.nativeEvent);if(cn(a)){if(dp&&!n.relatedTarget){if(!c.current&&!su(a))return}else if(!uu(a))return}let u=iu(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,Yc(el,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,Yc(el,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=cn(r)&&r.hasAttribute(wd(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=Jl(cr(t));!r&&n===t||$(a.current.floatingContext?.refs.floating.current,n)||$(t,n)||o||iu(r??n,e.context.triggerElements)||e.setOpen(!1,Yc(el,i))})}}},[a,r,e,l]);return Y.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var pp=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Tl;restTimeout=new Tl;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},mp=new WeakMap;function hp(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&mp.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),mp.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function gp(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=mp.get(n);a&&a!==e&&hp(a),hp(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,mp.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function _p(e){let t=e.context.dataRef.current,n=Yt(()=>t.hoverInteractionState??pp.create()).current;return t.hoverInteractionState||=n,Cl(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function vp(e,t){return t!=null&&!gu(t)?0:typeof e==`function`?e():e}function yp(e,t,n){let r=vp(e,n);return typeof r==`number`?r:r?.[t]}function bp(e){return typeof e==`function`?e():e}function xp(e,t){return t||e===`click`||e===`mousedown`}function Sp(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Cp(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=Qd(),u=Zd(),d=_p(e),f=El(),p=K(()=>xp(c.current.openEvent?.type,d.interactedInside)),m=K(()=>Sp(c.current.openEvent?.type)),h=K(()=>{hp(d)});J(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),Y.useEffect(()=>h,[h]),J(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&cn(s)&&o){let e=s,t=o,n=cr(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??Yl(e,`[data-rootownerid]`)??n.body;return gp(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),Y.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&Sd(l.nodesRef.current,u).length>0)}function a(t){let n=yp(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,Yc($c,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=Xl(e);cu(t)?d.interactedInside=Yl(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(iu(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&cn(o)&&Sd(l.nodesRef.current,r,!1).some(e=>$(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,Yc($c,n)),l.events.emit(`floating.closed`,n)})}let y=o;return bl(y&&Q(y,`mouseenter`,g),y&&Q(y,`mouseleave`,_),y&&Q(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var wp={current:null};function Tp(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=wp,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=Qd(l),v=_p(e),y=Y.useRef(!1),b=xl(i),x=xl(r),S=xl(o),C=xl(n),w=xl(p),T=xl(f),E=K(()=>xp(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||!$(t,n);if(!cn(r))return!1;let a=r;return i.hasMatchingElement(e=>$(e,a))&&(!t||!$(t,a))}),k=K(()=>{v.handler&&=(cr(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=K(()=>{hp(v)});return u&&(v.handleCloseOptions=i?.__options),Y.useEffect(()=>k,[k]),Y.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===$c,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]),Y.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=yp(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,Yc($c,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,Yc($c,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!cn(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!gu(v.pointerType))return;let n=bp(S.current),r=yp(x.current,`open`,v.pointerType),i=Xl(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(cn(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if($(t,i)){c=t;break}}cn(o)&&cn(s)&&!e.context.triggerElements.hasElement(o)&&$(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&&cn(c)&&cn(s)&&$(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,Yc($c,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,Yc($c,t,c))}):g&&D()&&e.setOpen(!0,Yc($c,t,c)))}function o(n){if(E()){A();return}k();let r=cr(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!iu(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`&&$(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){$(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Q(r,`mouseout`,l):void 0;return s?bl(Q(r,`mousemove`,i,{once:!0}),Q(r,`mouseenter`,i),Q(r,`mouseleave`,o),f):bl(Q(r,`mouseenter`,i),Q(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),Y.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&&!gu(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;gp(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=bp(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,Yc($c,n,r))}v.pointerType===`touch`?Li.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function Ep(e){return Rl&&e.movementX===0&&e.movementY===0}function Dp(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Op(e,t){return Dp(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function kp(e,t,n){return Dp(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ap(e,t,n){return Dp(t,n?e===$l:e===eu,e===nu)}function jp(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Dp(t,n?e===eu:e===$l,e===tu)}function Mp(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=du(E),A=lu(D),j=xl(k),M=Zd(),N=Qd(x),P=Y.useRef(f),F=Y.useRef(o??-1),I=Y.useRef(null),L=Y.useRef(!0),R=K(e=>{i(F.current===-1?null:F.current,e)}),z=Y.useRef(!!E),ee=Y.useRef(T),te=Y.useRef(!1),B=Y.useRef(!1),V=Y.useRef(null),ne=xl(h),H=xl(T),U=xl(o),re=xl(b),ie=Wl(),ae=Wl(),oe=K(()=>{ie.cancel();function e(e){d||(V.current=Ed(e,{sync:te.current,preventScroll:!0}))}let t=n.current[F.current],r=B.current;t&&e(t),(te.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),fe&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});J(()=>{O.current.orientation=g},[O,g]),J(()=>{T||(I.current=null),T&&f===`auto`||(P.current=f)},[T,f]),J(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(B.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),J(()=>{if(a){if(!T)te.current=!1;else if(E){if(r==null){if(te.current=!1,U.current!=null)return;if(z.current&&(F.current=-1,oe()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||kp(I.current,_,u)||l?Ku(n):qu(n),I.current=null,R())};t()}}else Gu(n.current,r)||(F.current=r,oe(),B.current=!1)}}},[a,T,E,r,U,l,n,_,u,R,oe,ae]),J(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=Jl(cr(D??t??null)),r=e.some(e=>e.context&&$(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),J(()=>{ee.current=T,z.current=!!E});let se=r!=null,ce=K(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),le=K(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ue=K(()=>Ku(n,ne.current)),de=K(t=>{if(L.current=!1,te.current=!0,t.which===229||!H.current&&t.currentTarget===j.current)return;if(l&&jp(t.key,g,u,w)){Op(t.key,le())||fu(t),e.setOpen(!1,Yc(ol,t.nativeEvent));let n=S?.current??D;zn(n)&&n.focus();return}r!=null&&r!==F.current&&!Gu(n.current,r)&&(F.current=r);let i=F.current,a=Ku(n,h),o=qu(n,h);if(A||(t.key===`Home`&&(fu(t),F.current=a,R(t)),t.key===`End`&&(fu(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(Op(t.key,g)){fu(t);let e=Jl(t.currentTarget.ownerDocument);if(T&&!d&&$(t.currentTarget,e)&&!n.current.some(t=>t!=null&&$(t,e))){F.current=kp(t.key,g,u)?a:o,R(t),r===F.current&&oe();return}let{index:l,wrapped:f}=Ju(n.current,i,{decrement:!kp(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(te.current=!1),F.current=l,R(t)}}),fe=Y.useMemo(()=>({onFocus(e){te.current=!0,ce(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){Ep(e)||(te.current=!0,B.current=!1,p&&ce(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(V.current?.(),V.current=null,F.current=-1,R(e),!d)){let e=j.current,t=Jl(cr(e));e&&$(e,t)&&e.focus({preventScroll:!0})}}}),[ce,H,j,p,n,R,re,d]),pe=Y.useMemo(()=>d&&T&&se&&{"aria-activedescendant":`${y}-${r}`},[d,T,se,y,r]),me=Y.useMemo(()=>({...A?{}:pe,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=Xl(t.nativeEvent);if(n&&!$(j.current,n))return;fu(t);let r=Yc(il,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&zn(i)&&i.focus()}else de(t)},onPointerMove(e){Ep(e)||(L.current=!0)}}),[pe,de,j,A,e,T,d,D,S]),he=Y.useMemo(()=>{function t(t){e.setOpen(!0,Yc(ol,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&mu(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&hu(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=Ap(n.key,le(),u),o=Op(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||su(n.currentTarget)))return de(n);if(r||m||!i){if(s){let e=Op(n.key,le());I.current=l&&e?null:n.key}l?a&&(fu(n),r?(F.current=ue(),R(n),d&&j.current?.focus()):t(n)):o&&(U.current!=null&&(F.current=U.current),fu(n),!r&&m?t(n):de(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}},[de,f,ue,l,R,e,m,g,_,le,u,U,d,j]),ge=Y.useMemo(()=>({...pe,...he}),[pe,he]);return Y.useMemo(()=>a?{reference:ge,floating:me,item:fe,trigger:he}:{},[a,ge,me,he,fe])}function Np(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=El(),m=Y.useRef(``),h=Y.useRef(u??i??-1),g=Y.useRef(null),_=K(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!Qu(n)||n?.matches(`:disabled`)?!1:o==null||!Xu(On,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===` `&&(fu(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!==` `&&(fu(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`);$(r,n)||$(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});J(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=Y.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return Y.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var Pp=.1,Fp=Pp*Pp,Ip=.5;function Lp(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Rp(e,t,n,r,i,a,o,s,c,l){let u=!1;return Lp(e,t,n,r,i,a)&&(u=!u),Lp(e,t,i,a,o,s)&&(u=!u),Lp(e,t,o,s,c,l)&&(u=!u),Lp(e,t,c,l,n,r)&&(u=!u),u}function zp(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Bp(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 Vp(e={}){let{blockPointerEvents:t=!1}=e,n=new Tl,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*Fp;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=Xl(r),g=r.type===`mouseleave`,_=$(u,h),v=$(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&cn(r.relatedTarget)&&$(u,r.relatedTarget))return;function y(){return!!(s&&Sd(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=Bp(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Bp(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Bp(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Bp(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!zp(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Ip/2:Ip*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Ip+1,o=C||T?S.bottom-Ip:S.top,s=C?T?S.bottom-Ip:S.top:S.bottom-Ip;M=Rp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Ip/2:Ip*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Ip,o=C||T?S.top+Ip:S.bottom,s=C?T?S.top+Ip:S.bottom:S.top+Ip;M=Rp(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Ip/2:Ip*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Ip+1,o=w||E?S.right-Ip:S.left,s=w?E?S.right-Ip:S.left:S.right-Ip;M=Rp(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Ip/2:Ip*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Ip,o=w||E?S.left+Ip:S.right,s=w?E?S.left+Ip:S.right:S.left+Ip;M=Rp(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 Hp(e,t,n){let{reference:r,floating:i}=e,a=Au(t),o=ju(t),s=ku(o),c=Eu(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=Du(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Up(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}=Tu(t,e),p=Uu(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Wu(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=Wu(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 Wp=50,Gp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Up},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hp(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<Wp&&(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}=Hp(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Kp=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}=Tu(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Eu(r),_=Au(o),v=Eu(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Vu(o)]:Nu(o)),x=p!==`none`;!d&&x&&b.push(...Bu(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=Mu(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`||_===Au(t)||T.every(e=>Au(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=Au(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{}}}},qp=new Set([`left`,`top`]);async function Jp(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Eu(n),s=Du(n),c=Au(n)===`y`,l=qp.has(o)?-1:1,u=a&&c?-1:1,d=Tu(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 Yp=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 Jp(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}}}}},Xp=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}=Tu(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Au(i),p=Ou(f),m=u[p],h=u[f],g=(e,t)=>wu(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}}}}}},Zp=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}=Tu(e,t),u={x:n,y:r},d=Au(i),f=Ou(d),p=u[f],m=u[d],h=Tu(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=qp.has(Eu(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}}}},Qp=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}=Tu(e,t),c=await i.detectOverflow(t,s),l=Eu(n),u=Du(n),d=Au(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=vu(p-c[m],g),y=vu(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*yu(c.left,c.right):S=p-2*yu(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 $p(e){let t=on(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=zn(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=bu(n)!==a||bu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function em(e){return cn(e)?e:e.contextElement}function tm(e){let t=em(e);if(!zn(t))return Su(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$p(t),o=(a?bu(n.width):n.width)/r,s=(a?bu(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var nm=Su(0);function rm(e){let t=$t(e);return!tn()||!t.visualViewport?nm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function im(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$t(e)}function am(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=em(e),o=Su(1);t&&(r?cn(r)&&(o=tm(r)):o=tm(e));let s=im(a,n,r)?rm(a):Su(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=$t(a),t=cn(r)?$t(r):r,n=e,i=Tn(n);for(;i&&t!==n;){let e=tm(i),t=i.getBoundingClientRect(),r=on(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=$t(i),i=Tn(n)}}return Wu({width:u,height:d,x:c,y:l})}function om(e,t){let n=an(e).scrollLeft;return t?t.left+n:am(Gt(e)).left+n}function sm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-om(e,n),y:n.top+t.scrollTop}}function cm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Gt(r),s=t?Zt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Su(1),u=Su(0),d=zn(r);if((d||!a)&&((rn(r)!==`body`||Qt(o))&&(c=an(r)),d)){let e=am(r);l=tm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sm(o,c):Su(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 lm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function um(e){let t=an(e),n=e.ownerDocument.body,r=yu(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=yu(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+om(e),o=-t.scrollTop;return on(n).direction===`rtl`&&(a+=yu(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dm=25;function fm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=$t(e),a=Gt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!tn()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(om(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<=dm&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pm(e,t){let n=am(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fm(e,n,t);else if(t===`document`)r=um(Gt(e));else if(cn(t))r=pm(t,n);else{let n=rm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Wu(r)}function hm(e,t){let n=t.get(e);if(n)return n;let r=sn(e,[],!1).filter(e=>cn(e)&&rn(e)!==`body`),i=null,a=on(e).position===`fixed`,o=a?Xt(e):e;for(;cn(o)&&!Kt(o);){let e=on(o),t=nn(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Xt(o)}return t.set(e,r),r}function gm(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Zt(t)?[]:hm(t,this._c):[].concat(n),r],o=mm(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=mm(t,a[e],i);s=yu(n.top,s),c=vu(n.right,c),l=vu(n.bottom,l),u=yu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _m(e){let{width:t,height:n}=$p(e);return{width:t,height:n}}function vm(e,t,n){let r=zn(t),i=Gt(t),a=n===`fixed`,o=am(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Su(0);if((r||!a)&&((rn(t)!==`body`||Qt(i))&&(s=an(t)),r)){let e=am(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=om(i));let l=i&&!r&&!a?sm(i,s):Su(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 ym(e){return on(e).position===`static`}function bm(e,t){if(!zn(e)||on(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Gt(e)===n&&(n=n.ownerDocument.body),n}function xm(e,t){let n=$t(e);if(Zt(e))return n;if(!zn(e)){let t=Xt(e);for(;t&&!Kt(t);){if(cn(t)&&!ym(t))return t;t=Xt(t)}return n}let r=bm(e,t);for(;r&&fn(r)&&ym(r);)r=bm(r,t);return r&&Kt(r)&&ym(r)&&!nn(r)?n:r||En(e)||n}var Sm=async function(e){let t=this.getOffsetParent||xm,n=this.getDimensions,r=await n(e.floating);return{reference:vm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cm(e){return on(e).direction===`rtl`}var wm={convertOffsetParentRelativeRectToViewportRelativeRect:cm,getDocumentElement:Gt,getClippingRect:gm,getOffsetParent:xm,getElementRects:Sm,getClientRects:lm,getDimensions:_m,getScale:tm,isElement:cn,isRTL:Cm};function Tm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Em(e,t,n){let r=null,i,a=Gt(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=xu(d),h=xu(a.clientWidth-(u+f)),g=xu(a.clientHeight-(d+p)),_=xu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:yu(0,vu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Tm(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=$t(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dm(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=em(e),u=i||a?[...l?sn(l):[],...t?sn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Em(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?am(e):null;c&&g();function g(){let t=am(e);h&&!Tm(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 Om=Yp,km=Xp,Am=Kp,jm=Qp,Mm=Zp,Nm=(e,t,n)=>{let r=new Map,i=n??{},a={...wm,...i.platform,_c:r};return Gp(e,t,{...i,platform:a})},Pm=typeof document<`u`?Y.useLayoutEffect:function(){};function Fm(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(!Fm(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)&&!Fm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Im(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lm(e,t){let n=Im(e);return Math.round(t*n)/n}function Rm(e){let t=Y.useRef(e);return Pm(()=>{t.current=e}),t}function zm(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]=Y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Y.useState(r);Fm(f,r)||p(r);let[m,h]=Y.useState(null),[g,_]=Y.useState(null),v=Y.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Y.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Y.useRef(null),C=Y.useRef(null),w=Y.useRef(u),T=c!=null,E=Rm(c),D=Rm(i),O=Rm(l),k=Y.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Nm(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Fm(w.current,t)&&(w.current=t,Li.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Pm(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Y.useRef(!1);Pm(()=>(A.current=!0,()=>{A.current=!1}),[]),Pm(()=>{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=Y.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Y.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Y.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Lm(M.floating,u.x),r=Lm(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Im(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Y.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var Bm=(e,t)=>{let n=Om(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vm=(e,t)=>{let n=km(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hm=(e,t)=>({fn:Mm(e).fn,options:[e,t]}),Um=(e,t)=>{let n=Am(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wm=(e,t)=>{let n=jm(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gm=Y.createContext(void 0);function Km(){let e=Y.useContext(Gm);if(e===void 0)throw Error(ln(26));return e}var qm=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Jm=`--nested-dialogs`,Ym=`data-nested-dialog-open`,Xm={...Kc,...Fc,nestedDialogOpen(e){return e?{[Ym]:``}:null}},Zm=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Ac(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);Km(),Cf({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?Ef(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=xn(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...Tf,hidden:!m,onKeyDown(e){qm.has(e.key)&&e.stopPropagation()},style:{[Jm]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:Xm});return(0,Z.jsx)(ff,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})});function Qm(e){return gn(19)?e:e?`true`:void 0}var $m=Y.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,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),eh=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Ac(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Z.jsx)(Gm.Provider,{value:n,children:(0,Z.jsxs)(Kd,{ref:t,...r,children:[a&&o===!0&&(0,Z.jsx)($m,{ref:i.context.internalBackdropRef,inert:Qm(!s)}),e.children]})}):null}),th={},nh={},rh=``;function ih(e,t){return Qt(e)?e:t}function ah(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ih(t,n)).overflowY)}function oh(e){if(typeof document>`u`)return!1;let t=cr(e);return $t(t).innerWidth-t.documentElement.clientWidth>0}function sh(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=cr(e),n=t.documentElement,r=t.body,i=ih(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 ch(e){let t=cr(e),n=t.documentElement,r=t.body,i=ih(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 lh(e){let t=cr(e),n=t.documentElement,r=t.body,i=$t(n),a=0,o=0,s=!1,c=Ul.create();if(Rl&&(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,th={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},rh=n.style.scrollBehavior,nh={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=ih(n,r);s=sh(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,th),Object.assign(r.style,nh),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=rh)}function d(){u(),c.request(l)}l();let f=Q(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var uh=new class{lockCount=0;restore=null;timeoutLock=Tl.create();timeoutUnlock=Tl.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=cr(e),n=t.documentElement,r=t.body,i=$t(n);if(ah(i,n,r)){let t=new i.MutationObserver(()=>{ah(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=Nl||!oh(e);this.restore=a?ch(e):lh(e)}};function dh(e=!0,t=null){J(()=>{if(e)return uh.acquire(t)},[e,t])}function fh({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=Y.useState(0),[d,f]=Y.useState(0),p=l===0,m=gf(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Xl(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||$(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return dh(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),J(()=>{!r&&!i&&(u(0),f(0))},[r,i]),J(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),If(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var ph={...lp,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},mh=class extends ep{constructor(e,t,n){let r=new Rf,i=hh(e,r,t,n);super(i,gh(r),ph)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(jf(this.state,e,t.trigger)))}};function hh(e,t,n,r=!1){return{...rp(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function gh(e){return{popupRef:Y.createRef(),backdropRef:Y.createRef(),internalBackdropRef:Y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function _h(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,h=m?!0:c,g=m||s,_=m?`alertdialog`:`dialog`,v=Ac(!0),y={modal:h,disablePointerDismissal:g,nested:v!=null,role:_},b=Df((e,t)=>new mh({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...y},e,t),!0);b.useControlledProp(`openProp`,r),b.useControlledProp(`triggerIdProp`,d),b.useSyncedValues(y),b.useContextCallback(`onOpenChange`,a),b.useContextCallback(`onOpenChangeComplete`,o);let x=b.useState(`open`),S=b.useState(`mounted`),C=b.useState(`payload`);Lf(b,x),Pf(b);let{forceUnmount:w}=Ff(x,b);Y.useImperativeHandle(l,()=>({unmount:w,close:()=>b.setOpen(!1,Yc(dl))}),[w,b]);let T=x||S||u!=null;return(0,Z.jsxs)(kc.Provider,{value:b,children:[u&&(0,Z.jsx)(Of,{handle:u,store:b}),T&&(0,Z.jsx)(fh,{store:b,parentContext:v?.context,isDrawer:p}),typeof n==`function`?n({payload:C}):n]})}var vh=Uf(function(e){return _h(`dialog`,e)}),yh=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Ac(),c=vl(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),xn(`h2`,e,{ref:t,props:[{id:c},o]})});function bh(e){let t=Y.useRef(``),n=Y.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Y.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 xh(e,t){let n=Y.useRef(e),r=K(t);J(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Sh(e,t){let{onClick:n,onPointerDown:r}=bh(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(Nl?`touch`:``))}));return Y.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Ch(e){let[t,n]=Y.useState(null),r=Sh(e,n);return xh(e,t=>{t&&!e&&n(null)}),Y.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function wh(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,Z.jsx)(vh,{"data-slot":`dialog`,...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,Z.jsx)(eh,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function Eh(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=q(`fixed inset-0 isolate z-50 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Jc,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Dh(e){let t=(0,X.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,showCloseButton:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0||a,s;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Eh,{}),t[5]=s):s=t[5];let c;t[6]===r?c=t[7]:(c=q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm 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[6]=r,t[7]=c);let l;t[8]===o?l=t[9]:(l=o&&(0,Z.jsxs)(fl,{"data-slot":`dialog-close`,render:(0,Z.jsx)(Fn,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Z.jsx)(sr,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=o,t[9]=l);let u;return t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==l?(u=(0,Z.jsxs)(Th,{children:[s,(0,Z.jsxs)(Zm,{"data-slot":`dialog-content`,className:c,...i,children:[n,l]})]}),t[10]=n,t[11]=i,t[12]=c,t[13]=l,t[14]=u):u=t[14],u}function Oh(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=q(`flex flex-col gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function kh(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=q(`text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(yh,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ah(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=q(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(yl,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jh(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=q(`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,Z.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 Mh=en(`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 Nh(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=q(Mh({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,Z.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:Ph,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function Ph(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}en(`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 Fh(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=q(`flex size-full flex-col overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_c,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ih(e){let t=(0,X.c)(24),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]):({title:a,description:o,children:n,className:r,showCloseButton: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?`Command Palette`:a,l=o===void 0?`Search for a command to run...`:o,u=s!==void 0&&s,d;t[7]===c?d=t[8]:(d=(0,Z.jsx)(kh,{children:c}),t[7]=c,t[8]=d);let f;t[9]===l?f=t[10]:(f=(0,Z.jsx)(Ah,{children:l}),t[9]=l,t[10]=f);let p;t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(Oh,{className:`sr-only`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===r?m=t[15]:(m=q(`top-1/3 translate-y-0 overflow-hidden rounded-xl! p-0`,r),t[14]=r,t[15]=m);let h;t[16]!==n||t[17]!==u||t[18]!==m?(h=(0,Z.jsx)(Dh,{className:m,showCloseButton:u,children:n}),t[16]=n,t[17]=u,t[18]=m,t[19]=h):h=t[19];let g;return t[20]!==i||t[21]!==p||t[22]!==h?(g=(0,Z.jsxs)(wh,{...i,children:[p,h]}),t[20]=i,t[21]=p,t[22]=h,t[23]=g):g=t[23],g}function Lh(e){let t=(0,X.c)(11),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=q(`w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,n),t[3]=n,t[4]=i);let a;t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_c.Input,{"data-slot":`command-input`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7];let o;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Nh,{children:(0,Z.jsx)($n,{className:`size-3.5 shrink-0 opacity-50`})}),t[8]=o):o=t[8];let s;return t[9]===a?s=t[10]:(s=(0,Z.jsx)(`div`,{"data-slot":`command-input-wrapper`,className:`p-1 pr-10 pb-0`,children:(0,Z.jsxs)(jh,{className:`h-8! bg-input/20 dark:bg-input/30`,children:[a,o]})}),t[9]=a,t[10]=s),s}function Rh(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=q(`no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_c.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function zh(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=q(`py-6 text-center text-xs/relaxed`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_c.Empty,{"data-slot":`command-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bh(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=q(`overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2.5 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(_c.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vh(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=q(`-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,Z.jsx)(_c.Separator,{"data-slot":`command-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Hh(e){let t=(0,X.c)(10),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=q(`group/command-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none in-data-[slot=dialog-content]:rounded-md data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-selected:bg-muted data-selected:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-selected:*:[svg]:text-foreground`,r),t[4]=r,t[5]=a);let o;return t[6]!==n||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(_c.Item,{"data-slot":`command-item`,className:a,...i,children:n}),t[6]=n,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Uh(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=q(`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,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Wh=[{name:`deploy`,url:`https://deploy.mp281x.xyz`},{name:`scope`,url:`https://scope.mp281x.xyz`},{name:`gateway`,url:`https://gateway.mp281x.xyz`},{name:`auth`,url:`https://auth.mp281x.xyz`},{name:`signal`,url:`https://signal.mp281x.xyz`},{name:`portfolio`,url:`https://mp281x.xyz`}];function Gh(e){let t=(0,X.c)(5),[n,r]=(0,Y.useState)(!1);if(n){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Vn,{className:`text-muted-foreground size-4`}),t[0]=e):e=t[0],e}let i=`${e.url}/icon`,a;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>r(!0),t[1]=a):a=t[1];let o;return t[2]!==e.name||t[3]!==i?(o=(0,Z.jsx)(`img`,{src:i,alt:``,className:`pixelated size-4`,onError:a,title:e.name}),t[2]=e.name,t[3]=i,t[4]=o):o=t[4],o}function Kh(e){let t=(0,X.c)(10),n=`${e.group}:${e.item.id??e.item.label}`,r;t[0]===e.item.label?r=t[1]:(r=(0,Z.jsx)(`span`,{className:`min-w-0 shrink truncate`,children:e.item.label}),t[0]=e.item.label,t[1]=r);let i;t[2]===e.item.detail?i=t[3]:(i=e.item.detail!==void 0&&(0,Z.jsx)(`span`,{className:`text-muted-foreground ml-auto max-w-1/2 truncate text-xs`,children:e.item.detail}),t[2]=e.item.detail,t[3]=i);let a;return t[4]!==e.item.icon||t[5]!==e.onSelect||t[6]!==n||t[7]!==r||t[8]!==i?(a=(0,Z.jsxs)(Hh,{value:n,onSelect:e.onSelect,children:[e.item.icon,r,i]}),t[4]=e.item.icon,t[5]=e.onSelect,t[6]=n,t[7]=r,t[8]=i,t[9]=a):a=t[9],a}function qh(e){let t=(0,X.c)(33),n;t[0]===e?n=t[1]:(n=function(t){e.onOpenChange(!1),t.run()},t[0]=e,t[1]=n);let r=n,i;t[2]===e.groups?i=t[3]:(i=kt([...it(e.groups,Qh),...Et(Wh,Zh)]),t[2]=e.groups,t[3]=i);let a=i,o=e.open,s=e.onOpenChange,c;t[4]===a?c=t[5]:(c=(e,t)=>nc(B(ce(a,e),()=>e),t),t[4]=a,t[5]=c);let l=`Search ${e.current??`Deslop`}…`,u;t[6]===l?u=t[7]:(u=(0,Z.jsx)(Lh,{autoFocus:!0,placeholder:l}),t[6]=l,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(zh,{children:`No results.`}),t[8]=d):d=t[8];let f;if(t[9]!==e.groups||t[10]!==r){let n;t[12]===r?n=t[13]:(n=e=>(0,Z.jsx)(Bh,{heading:e.label,children:Et(e.items,t=>(0,Z.jsx)(Kh,{group:e.label,item:t,onSelect:()=>r(t)},`${e.label}:${t.id??t.label}`))},e.label),t[12]=r,t[13]=n),f=Et(Re(e.groups,Xh),n),t[9]=e.groups,t[10]=r,t[11]=f}else f=t[11];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(Vh,{}),t[14]=p):p=t[14];let m;t[15]!==e.current||t[16]!==r?(m=Et(Wh,t=>{let n={detail:`${new URL(t.url).hostname}${yt(t.name===e.current,{onFalse:Yh,onTrue:Jh})}`,icon:(0,Z.jsx)(Gh,{name:t.name,url:t.url}),keywords:new URL(t.url).hostname,label:t.name,run:()=>{location.assign(t.url)}};return(0,Z.jsx)(Kh,{group:`Deslop`,item:n,onSelect:()=>r(n)},t.name)}),t[15]=e.current,t[16]=r,t[17]=m):m=t[17];let h;t[18]===m?h=t[19]:(h=(0,Z.jsx)(Bh,{heading:`Other apps`,children:m}),t[18]=m,t[19]=h);let g;t[20]!==h||t[21]!==f?(g=(0,Z.jsxs)(Rh,{className:`max-h-96`,children:[d,f,p,h]}),t[20]=h,t[21]=f,t[22]=g):g=t[22];let _;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Uh,{children:`↑`}),(0,Z.jsx)(Uh,{children:`↓`}),(0,Z.jsx)(`span`,{children:`navigate`})]}),t[23]=_):_=t[23];let v;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsxs)(`div`,{className:`text-muted-foreground hidden items-center justify-between border-t px-3 py-2 text-xs sm:flex`,children:[_,(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(Uh,{children:`↵`}),(0,Z.jsx)(`span`,{children:`open`}),(0,Z.jsx)(Uh,{children:`esc`}),(0,Z.jsx)(`span`,{children:`close`})]})]}),t[24]=v):v=t[24];let y;t[25]!==g||t[26]!==c||t[27]!==u?(y=(0,Z.jsxs)(Fh,{filter:c,children:[u,g,v]}),t[25]=g,t[26]=c,t[27]=u,t[28]=y):y=t[28];let b;return t[29]!==e.onOpenChange||t[30]!==e.open||t[31]!==y?(b=(0,Z.jsx)(Ih,{open:o,onOpenChange:s,title:`Search or run a command`,description:`Jump to a record, run an action, or open another Deslop tool.`,showCloseButton:!0,className:`sm:max-w-lg`,children:y}),t[29]=e.onOpenChange,t[30]=e.open,t[31]=y,t[32]=b):b=t[32],b}function Jh(){return` · current`}function Yh(){return``}function Xh(e){return Ve(e.items)}function Zh(e){return[`Deslop:${e.name}`,`${e.name} ${new URL(e.url).hostname}`]}function Qh(e){return Et(e.items,t=>[`${e.label}:${t.id??t.label}`,`${t.label} ${t.detail??``} ${t.keywords??``}`])}function $h(e){let t=(0,X.c)(13),n=(0,Y.useSyncExternalStore)(og,ag,ig),r;t[0]===n?r=t[1]:(r=yt(n,{onFalse:rg,onTrue:ng}),t[0]=n,t[1]=r);let i=e.label,a=e.onClick,o,s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)($n,{className:`size-3.5`}),s=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:`Search`}),t[2]=o,t[3]=s):(o=t[2],s=t[3]);let c;t[4]===n?c=t[5]:(c=yt(n,{onFalse:tg,onTrue:eg}),t[4]=n,t[5]=c);let l;t[6]===c?l=t[7]:(l=(0,Z.jsx)(`span`,{className:`ml-auto`,children:(0,Z.jsx)(Uh,{children:c})}),t[6]=c,t[7]=l);let u;return t[8]!==e.label||t[9]!==e.onClick||t[10]!==r||t[11]!==l?(u=(0,Z.jsxs)(Fn,{variant:`outline`,size:`lg`,"aria-keyshortcuts":r,"aria-label":i,onClick:a,className:`hidden w-64 justify-start sm:flex lg:absolute lg:top-2 lg:left-1/2 lg:-translate-x-1/2`,children:[o,s,l]}),t[8]=e.label,t[9]=e.onClick,t[10]=r,t[11]=l,t[12]=u):u=t[12],u}function eg(){return`⌘K`}function tg(){return`Ctrl K`}function ng(){return`Meta+K`}function rg(){return`Control+K`}function ig(){return!0}function ag(){return N(zt(/Mac|iPhone|iPad/u)(navigator.userAgent))}function og(){return sg}function sg(){}function cg(e){let t=(0,X.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)($n,{}),t[0]=n):n=t[0];let r;return t[1]!==e.label||t[2]!==e.onClick?(r=(0,Z.jsx)(Fn,{variant:`ghost`,size:`icon`,"aria-label":e.label,onClick:e.onClick,className:`max-sm:size-11 sm:hidden`,children:n}),t[1]=e.label,t[2]=e.onClick,t[3]=r):r=t[3],r}var lg=Y.createContext(void 0);function ug(){let e=Y.useContext(lg);if(e===void 0)throw Error(ln(13));return e}var dg={imageLoadingStatus:()=>null},fg=Y.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=Y.useState(`idle`),c={imageLoadingStatus:o},l=Y.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=xn(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:dg});return(0,Z.jsx)(lg.Provider,{value:l,children:u})});function pg(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=Y.useState(`idle`),s=o[1];return J(()=>{if(!a)return Sn;if(!e&&!i)return s(`error`),Sn;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 mg={...dg,...Fc},hg=Y.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}=ug(),[f,p]=pg(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=vf(m),v=Y.useRef(null),y=Y.useRef(!0);J(()=>{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)});J(()=>{f!==`idle`&&x(f)},[f,x]),J(()=>()=>d(`idle`),[d]),Cf({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=xn(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:mg,enabled:C});return C?T:null}),gg=Y.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=ug(),[c,l]=Y.useState(i===0),u=El();return Y.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),xn(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:dg,enabled:s!==`loaded`&&(i===0||c)})});function _g(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=q(`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,Z.jsx)(fg,{"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 vg(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=q(`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,Z.jsx)(hg,{"data-slot":`avatar-image`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function yg(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=q(`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,Z.jsx)(gg,{"data-slot":`avatar-fallback`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var bg=Y.createContext(void 0);function xg(e){let t=Y.useContext(bg);if(t===void 0&&!e)throw Error(ln(33));return t}var Sg=Y.createContext(void 0);function Cg(e){let t=Y.useContext(Sg);if(t===void 0&&!e)throw Error(ln(36));return t}var wg=Y.createContext(void 0);function Tg(e=!0){let t=Y.useContext(wg);if(t===void 0&&!e)throw Error(ln(25));return t}function Eg({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=Y.useRef(e!==void 0),[a,o]=Y.useState(()=>t);return[i&&e!==void 0?e:a,Y.useCallback(e=>{i||o(e)},[])]}var Dg=Y.createContext(null);function Og(e=`root`){let t=Y.useContext(Dg),n=Y.useContext(Sg);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var kg={visible:!0,ref:null};function Ag(){return kg}function jg(e,t,n=`root`){let r=Og(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??Ag)({label:e.label,children:e.children,render:e.render}),a=In(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function Mg(e){e.preventDefault()}function Ng(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=Cg(),u=Tg(!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 Y.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?Mg: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:nl})},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&&!Il&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&vn(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var Pg={type:`regular-item`};function Fg(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=Y.useRef(null),{getButtonProps:d,buttonRef:f}=Rn({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=Ng({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=Y.useCallback(e=>qt(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=In(u,f);return Y.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var Ig=Y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function Lg(){return Y.useContext(Ig)}function Rg(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=Lg(),u=Y.useRef(-1),[d,f]=Y.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=Y.useRef(null),h=Y.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 J(()=>{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 zg=Y.createContext(void 0);function Bg(){let e=Y.useContext(zg);if(e===void 0)throw Error(ln(31));return e}var Vg=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Y.useState(void 0),c=xn(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Z.jsx)(zg.Provider,{value:s,children:c})}),Hg=Y.forwardRef(function(e,t){let n=Og()?.Group??Vg;return(0,Z.jsx)(n,{...e,ref:t})}),Ug=Y.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=vl(a),c=Bg();return J(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),xn(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Wg=Y.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}=Cg(),f=Rg({guess:!0,label:a}),p=vl(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}=Fg({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:Pg});return xn(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Gg=Y.forwardRef(function(e,t){let n=jg(e,t);return n.visible?(0,Z.jsx)(Wg,{...e,ref:n.ref}):null}),Kg=Y.createContext(void 0);function qg(e){let t=Y.useContext(Kg);if(t===void 0&&!e)throw Error(ln(69));return t}function Jg(e){return e===`starting`?Rd:Cn}var Yg=Y.createContext(void 0);function Xg(){return Y.useContext(Yg)}function Zg(e,t){let n=bn(e.render);if(Y.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Qg(e,t,n){let r=Zg(e,t),i=r===t?void 0:r;return[r,Y.useCallback(e=>n?.(e?i:void 0),[i,n])]}function $g(e,t,n){let r=bn(e.render),i=Y.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 e_=Y.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}=Cg(),m=Xg(),{side:h,align:g}=xg(),_=qg(!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]=Qg(e,u,d),L=$g(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,ee=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(ee=()=>l.state.activeIndex===null&&P),Cf({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),Y.useEffect(()=>{function e(e){l.setOpen(!1,Yc(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),Cp(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:B,handleFocus:V}=(Y.useContext(Dg)?.useParentHandoff??n_)(l,w,v,f),ne={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},H=xn(`div`,e,{state:ne,ref:[t,l.context.popupRef,te,I],stateAttributesMapping:qc,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&qm.has(e.key)&&e.stopPropagation()},onFocus:V},Jg(y),c,{"data-rootownerid":E}]}),U=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(U=!0);let re=R?.getReturnElement??B;return(0,Z.jsx)(ff,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??re??U,explicitReturnFocus:a===void 0&&re?!1:void 0,initialFocus:ee,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:H})}),t_={parentVirtualFocusRef:void 0,handleFocus:void 0};function n_(){return t_}var r_=Y.forwardRef(function(e,t){let n=Og()?.Popup??e_;return(0,Z.jsx)(n,{...e,ref:t})}),i_=Y.createContext(void 0);function a_(){let e=Y.useContext(i_);if(e===void 0)throw Error(ln(32));return e}var o_=Y.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=Cg();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(i_.Provider,{value:n,children:(0,Z.jsx)(Kd,{ref:t,...r,portalOwnerRole:o})})});function s_(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]=Y.useState(null),d=Y.useRef(null),f=Qd(n),p=Y.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=zm({...e,elements:{...p,...l&&{reference:l}}}),h=Y.useCallback(e=>{let t=cn(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=Y.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=Y.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=Y.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 J(()=>{o&&(d.current=o)},[o]),J(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),Y.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var c_=Y.createContext(void 0);function l_(){return Y.useContext(c_)?.direction??`ltr`}var u_=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}=Tu(e,t)||{};if(l==null)return{};let d=Uu(u),f={x:n,y:r},p=ju(i),m=ku(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=wu(D,k,O),j=!c.arrow&&Du(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}}}),d_=(e,t)=>{let{name:n,fn:r}=u_(e);return{name:n,fn:r,options:[e,t]}},f_={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}}}},p_={sideX:`left`,sideY:`top`},m_=`--available-width`,h_=`--available-height`,g_=`--anchor-width`,__=`--anchor-height`,v_=`--transform-origin`,y_=m_,b_=h_;function x_(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 S_(e,t,n){let{rects:r,placement:i}=e;return{side:x_(t,Eu(i),n),align:Du(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function C_(e){return w_(e,s_)}function w_(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=xl(n),M=xl(g),N=l_()===`rtl`,[P,F]=Y.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?Eu(P):null,R=P&&I?Du(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],ee=R||o,te=ee===`center`?z:`${z}-${ee}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let V=+(i===`bottom`),ne=+(i===`top`),H=+(i===`right`),U=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},ie=Y.useRef(null),ae=xl(a),oe=xl(s),se=typeof a==`function`?0:a,ce=typeof s==`function`?0:s,le=[];p&&le.push(p),le.push(Bm(e=>{let t=S_(e,i,N),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,N,i]));let ue=w===`none`&&C!==`shift`,de=!ue&&(u||E||C===`shift`),fe=C===`none`?null:Um({...re,padding:{top:B.top+1+V,right:B.right+1+U,bottom:B.bottom+1+ne,left:B.left+1+H},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),pe=ue?null:Vm({...re,rootBoundary:D,mainAxis:w!==`none`,crossAxis:de,limiter:u||E?void 0:Hm(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=Au(Eu(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[re,u,E,D,B,w]);C===`shift`||w===`shift`||ee===`center`?le.push(pe,fe):le.push(fe,pe),le.push(Wm({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(y_,`${t}px`),i.setProperty(b_,`${n}px`);let a=$t(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(g_,`${u}px`),i.setProperty(__,`${d}px`)}}),d_(e=>({element:ie.current||cr(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=Eu(r),u=Du(r),d=Au(l)===`y`,f=ie.current,p=typeof a==`function`?a(S_(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 de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(v_,d?`${m} ${h}`:`${h} ${m}`),{}}},f_,b),J(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let me=Y.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:W,floatingStyles:Ce}=t({rootContext:h,open:m?g:void 0,placement:te,middleware:le,strategy:r,whileElementsMounted:m?void 0:(...e)=>Dm(...e,me),nodeId:y,externalTree:S}),{sideX:we,sideY:Te}=ye.adaptiveOrigin||p_,Ee=W?r:`fixed`,De=Y.useMemo(()=>{let e;return e=W?b?{position:Ee,[we]:_e,[Te]:ve}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[y_]=`100vw`,e[b_]=`100vh`,W||(e.opacity=0),e},[b,Ee,we,_e,Te,ve,Ce,W]),Oe=Y.useRef(null);J(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(T_(t)?t.current:t)||null;n!==Oe.current&&(he.setPositionReference(n),Oe.current=n)},[g,he,A,j]),Y.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&T_(e)&&e.current!==Oe.current&&(he.setPositionReference(e.current),Oe.current=e.current)},[g,he,A,j]),Y.useEffect(()=>{if(m&&g&&ge.reference&&ge.floating)return Dm(ge.reference,ge.floating,be,me)},[m,g,ge,be,me]);let ke=Eu(xe),Ae=x_(i,ke,N),je=Du(xe)||`center`,Me=!!ye.hide?.referenceHidden;J(()=>{x&&g&&W&&(ke!==z||I&&je!==ee)&&F(xe)},[x,I,g,W,xe,ke,je,z,ee]);let Ne=Y.useMemo(()=>({position:`absolute`,top:ye.arrow?.y,left:ye.arrow?.x}),[ye.arrow]),Pe=ye.arrow?.centerOffset!==0;return Y.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ie,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:he,context:Se,isPositioned:W,update:be}),[De,Ne,ie,Pe,Ae,je,ke,Me,he,Se,W,be])}function T_(e){return e!=null&&`current`in e}function E_(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=K(i),[,o]=Y.useState(0),s=Yt(O_).current,c=Yt(D_).current,l=Y.useRef(0),u=Y.useRef(!0),d=Y.useRef(null),f=Y.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(!j_(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&M_(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=A_(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=K(()=>{let[e,t]=k_(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))});J(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),J(()=>{u.current&&v()}),J(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=K(e=>(s.add(e),()=>{s.delete(e)})),b=Y.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Z.jsx)(Ig.Provider,{value:b,children:t})}function D_(){return new Map}function O_(){return new Set}function k_(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)=>M_(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 A_(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function j_(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 M_(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function N_(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=Y.useRef(null),o=Y.useRef(null),s=Sf(r);J(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),J(()=>{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])}function P_(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),xn(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Jg(r),i],stateAttributesMapping:Kc})}var F_=20;function I_(e,t,n,r){let[i,a]=Y.useState(!1);J(()=>{if(!e||!t||n==null){a(!1);return}let r=cr(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-F_)},[e,t,n]),dh(e&&(!t||i),r)}var L_=Y.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=zd,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=Cg(),x=a_(),S=Tg(!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`),z=n,ee=c,te=l,B=s,V=h;C.type===`context-menu`&&(z=n??C.context?.anchor,B??=`start`,!o&&B!==`center`&&(te=e.alignOffset??2,ee=e.sideOffset??-5));let ne=o,H=B;C.type===`menu`?(ne??=`inline-end`,H??=`start`,V=e.collisionAvoidance??Bd):C.type===`menubar`&&(ne??=C.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let U=C.type===`context-menu`,re=C_({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:ne,sideOffset:ee,align:H,alignOffset:te,arrowPadding:U?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:V,shift:U?{crossAxis:!(`side`in V&&V.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});Y.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,Yc(ul)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),Y.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,Yc(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ie=El();Y.useEffect(()=>{D||ie.clear()},[D,ie]),Y.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?ie.isStarted()||ie.start(e,()=>{v.setOpen(!1,Yc(ul))}):v.setOpen(!1,Yc(ul))}else ie.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ie]),Y.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),N_({store:v,domReference:R,positionerElement:M,open:D});let ae={open:D,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:C.type===`menu`,instant:N},oe=C.type===`menubar`&&C.context.modal;I_(D&&(oe||O&&F!==`trigger-hover`),k===`touch`,M,A);let se=P_(e,ae,{styles:re.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),ce=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),le=null;return C.type===`menubar`?le=C.context.contentElement:C.type===void 0&&(le=A),(0,Z.jsxs)(bg.Provider,{value:re,children:[ce&&(0,Z.jsx)($m,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:Qm(!D),cutout:le}),(0,Z.jsx)(ef,{id:I,children:(0,Z.jsx)(E_,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:se})})]})}),R_=Y.createContext(null);function z_(e){let t=Y.useContext(R_);if(t===null&&!e)throw Error(ln(5));return t}function B_(e){return e==null?Zc:e.type.startsWith(`key`)?sl:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?cl:Zc}var V_={...lp,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=lp.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Rl&&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`&&!lp.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`)}},H_=class extends ep{constructor(e,t,n=!1){let r=new Rf,i=W_(r,t,n,e);super(i,U_(r),V_),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 U_(e){return{positionerRef:Y.createRef(),popupRef:Y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:Y.createRef(),beforeTriggerFocusGuardRef:Y.createRef(),beforeContentFocusGuardRef:Y.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function W_(e,t,n=!1,r){return{...rp(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:Cn,inputProps:Cn,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Jd,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Cn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var G_=Y.createContext(null);function K_(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function q_(e,t){return e===`list-navigation`||K_(e,t)}var J_=Uf(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=Tg(!0),C=Cg(!0),w=z_(!0),T=C?.store,E=C?.virtualFocus??!1,D=Y.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=vl(),k=vl(),[A,j]=Y.useState(void 0),M=(A??k)||void 0,N=Zd(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=Yt(()=>F?P?.state.instantType:void 0).current,L=Yt(()=>{let e=new H_({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`),z=$d(R),ee=L.useState(`open`),te=L.useState(`activeTriggerElement`),B=L.useState(`positionerElement`),V=L.useState(`hoverEnabled`),ne=L.useState(`disabled`),H=L.useState(`lastOpenChangeReason`),U=L.useState(`parent`),re=L.useState(`activeIndex`),ie=L.useState(`keyboardOpen`),ae=L.useState(`payload`),oe=L.useState(`floatingParentNodeId`),se=Y.useRef(null),ce=Y.useRef(U.type!==`context-menu`),le=El(),ue=Y.useRef(!0),de=El(),fe=oe!=null,{openMethod:pe,triggerProps:me}=Ch(ee);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:U.type===void 0?c:void 0,openMethod:pe,rootId:O}),Pf(L);let{forceUnmount:he,transitionStatus:ge}=Ff(ee,L,()=>{L.set(`allowMouseEnter`,!1)},F),_e=Sf(L.context.popupRef);Y.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!ee){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,ee,ge,_e,L]),J(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:z,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:z,floatingParentNodeId:N})},[S,C,z,N,te,L]),Y.useEffect(()=>{ee||(se.current=null),U.type===`context-menu`&&(ee?le.start(500,()=>{ce.current=!0}):(le.clear(),ce.current=!1))},[le,ee,U.type]),J(()=>{!ee&&!V&&L.set(`hoverEnabled`,!0)},[ee,V,L]);let ve=K((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||ee===e&&t.trigger===te&&H===n)return;let i=Mf(t);if(!e&&t.trigger==null&&(t.trigger=te??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`&&!ue.current)return;e&&n===`trigger-focus`?(ue.current=!1,de.start(300,()=>{ue.current=!0})):(ue.current=!0,de.clear());let o=!e&&(n===`escape-key`||n==null);se.current=t.event;let s=jf(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&q_(n,a),s.instantType=U.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:K_(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),ye=_f({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ve}),be=ye.context.events;J(()=>{let e=({open:e,eventDetails:t})=>ve(e,t);return be.on(`setOpen`,e),()=>{be?.off(`setOpen`,e)}},[be,ve]),J(()=>L.subscribeToParentMenu(),[L]);let xe=Y.useCallback(()=>{L.setOpen(!1,Yc(dl))},[L]);Y.useImperativeHandle(d,()=>({unmount:he,close:xe}),[he,xe]);let Se;U.type===`context-menu`&&(Se=U.context),Y.useImperativeHandle(Se?.positionerRef,()=>B,[B]),Y.useImperativeHandle(Se?.actionsRef,()=>({setOpen:ve}),[ve]);let W=gf(ye,{enabled:!ne,bubbles:{escapeKey:f&&U.type===`menu`},outsidePress(){return U.type!==`context-menu`||se.current?.type===`contextmenu`||ce.current},externalTree:fe?R:void 0}),Ce=l_(),we=Mp(ye,{enabled:!ne,listRef:L.context.itemDomElements,activeIndex:re,virtual:v,nested:U.type===`menubar`||!v&&U.type!==void 0,parentOrientation:U.type===`menubar`?U.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ie:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:Ce===`rtl`,disabledIndices:On,onNavigate(e,t){L.setActiveIndex(e,B_(t),t?.nativeEvent)},openOnArrowKeyDown:U.type!==`context-menu`&&!(v&&_),externalTree:!v&&fe?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Te=Y.useCallback(e=>{L.context.typingRef.current=e},[L]),Ee=Np(ye,{enabled:!ne&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:re,resetMs:500,onMatch:(e,t)=>{ee&&e!==re&&L.setActiveIndex(e,sl,t.nativeEvent)},onTyping:Te}),De=K(a),Oe=Y.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=Zc,L.context.highlightEvent=void 0,a&&De(t,Xc(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});J(()=>{ke()},[re,ke]);let Ae=Y.useMemo(()=>{if(!v)return we.reference;if(!we.trigger)return Cn;let{onFocus:e,...t}=we.trigger;return t},[v,we.reference,we.trigger]);L.useSyncedValue(`inputProps`,v?we.reference??Cn:Cn);let je=Y.useMemo(()=>{let e=qt(Ee.reference,Ae,W.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=ee,e},[L,Ee.reference,Ae,W.reference,me,ee]),Me=Y.useMemo(()=>{let e=qt(we.trigger,W.trigger,me);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[we.trigger,W.trigger,me]);Yt(()=>(L.update({inactiveTriggerProps:Me}),null)),If(L,{floatingRootContext:ye,activeTriggerProps:je,inactiveTriggerProps:Me,popupProps:Y.useMemo(()=>qt(Tf,{onMouseMove(){L.set(`allowMouseEnter`,!0),U.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,we.floating,W.floating),[U.type,L,Ee.floating,we.floating,W.floating]),itemProps:we.item??Cn});let Ne=Y.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:ae}):t,Fe=(0,Z.jsxs)(Sg.Provider,{value:Ne,children:[p&&(0,Z.jsx)(Of,{handle:p,store:L}),Pe]});return(U.type===void 0||U.type===`context-menu`)&&(Fe=(0,Z.jsx)(tf,{externalTree:R,children:Fe})),Fe});function Y_(e){let t=Y.useContext(G_);if(t===null)return(0,Z.jsx)(J_,{...e});let n=t.Root;return(0,Z.jsx)(G_.Provider,{value:null,children:(0,Z.jsx)(n,{...t.options,...e})})}var X_=5;function Z_(e,t){let n=Q_(t);return e.clientX>=n.left-X_&&e.clientX<=n.right+X_&&e.clientY>=n.top-X_&&e.clientY<=n.bottom+X_}function Q_(e){let t=e.getBoundingClientRect(),n=$t(e);if(Bl)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 $_(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=Ln(),{ref:i,index:a}=Rg(e),o=n===a,s=Y.useRef(null),c=In(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 ev(e){let{render:t,className:n,style:r,state:i=Cn,props:a=On,refs:o=On,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=$_({metadata:s});return xn(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function tv(e){if(zn(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Kt(e))return tv(Xt(e))}function nv(e,t){function n(n,r,i){let a=n.currentTarget;Li.flushSync(()=>{e.setOpen(!1,Yc(il,n.nativeEvent,a))}),vd(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&&yd(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function rv(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Y.useRef(!1);return Y.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,cr(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:Cn,[t,n,r])}var iv=Wf(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=Cg(!0),h=up(d)??m?.store;if(!h)throw Error(ln(85));let g=vl(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=Y.useRef(null),S=ov(),C=Ln(!0),w=Qd(),T=Y.useMemo(()=>w??new Jd,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Nf(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:$d(T),floatingParentNodeId:Zd(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=Rn({disabled:A,native:o});Y.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=Y.useRef(null),P=El(),F=K(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;$(N.current,t)||$(h.select(`positionerElement`),t)||t===N.current||t!=null&&tv(t)===h.select(`rootId`)||Z_(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:ll})});Y.useEffect(()=>{let e=cr(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=Tp(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:Vp({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=av(y,h.select(`lastOpenChangeReason`)),z=pf(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),ee=fp(v,{enabled:!A&&I}),te=rv({open:y,enabled:O,mouseDownAction:`open`}),B=Y.useMemo(()=>qt(ee.reference,z.reference),[ee.reference,z.reference]),V=h.useState(`triggerProps`,D),ne=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:H,handleFocusTargetFocus:U}=nv(h,x),re={disabled:A,open:y},ie=[N,t,M,E,x],ae=[B,L??Cn,V,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),cr(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},ne,O?{role:`menuitem`}:{},te,p,j],oe=xn(`button`,e,{enabled:!O,stateAttributesMapping:Gc,state:re,ref:ie,props:ae});return O?(0,Z.jsx)(ev,{tag:`button`,render:n,className:r,style:i,state:re,refs:ie,props:ae,stateAttributesMapping:Gc}):y?(0,Z.jsxs)(Y.Fragment,{children:[(0,Z.jsx)(ql,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:H},`${g}-pre-focus-guard`),(0,Z.jsx)(Y.Fragment,{children:oe},g),(0,Z.jsx)(ql,{ref:h.context.triggerFocusTargetRef,onFocus:U},`${g}-post-focus-guard`)]}):(0,Z.jsx)(Y.Fragment,{children:oe},g)});function av(e,t){let n=El(),[r,i]=Y.useState(!1);return J(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function ov(){let e=z_(!0);return Y.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var sv=Y.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return xn(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function cv(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,Z.jsx)(Y_,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function lv(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,Z.jsx)(iv,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function uv(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=q(`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,Z.jsx)(r_,{"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,Z.jsx)(o_,{children:(0,Z.jsx)(L_,{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 dv(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,Z.jsx)(Hg,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function fv(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=q(`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,Z.jsx)(Ug,{"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 pv(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=q(`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,Z.jsx)(Gg,{"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 mv(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=q(`-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,Z.jsx)(sv,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var hv=V({id:W,name:W,signOut:Lt}),gv=Ue(Ot).atom(gt(se(`/auth/user`),At(h),At(f(hv))));function _v(){let e=(0,X.c)(27),t=Ar(gv);if(!jt(t))return null;let n;e[0]===t.value.id?n=e[1]:(n=c(`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,Z.jsx)(vg,{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=x(he(0,1)(t.value.name)),e[5]=t.value.name,e[6]=a);let o;e[7]===a?o=e[8]:(o=(0,Z.jsx)(yg,{children:a}),e[7]=a,e[8]=o);let s;e[9]!==i||e[10]!==o?(s=(0,Z.jsx)(lv,{"aria-label":`Account`,className:`flex items-center justify-center max-sm:size-11`,children:(0,Z.jsxs)(_g,{size:`sm`,children:[i,o]})}),e[9]=i,e[10]=o,e[11]=s):s=e[11];let l;e[12]===t.value.name?l=e[13]:(l=(0,Z.jsx)(dv,{children:(0,Z.jsxs)(fv,{children:[`@`,t.value.name]})}),e[12]=t.value.name,e[13]=l);let u;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(mv,{}),e[14]=u):u=e[14];let d=!t.value.signOut,f;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(f=new URLSearchParams({next:location.href}),e[15]=f):f=e[15];let p=`/auth/sign-out?${f}`,m;e[16]===p?m=e[17]:(m=(0,Z.jsx)(`a`,{"aria-label":`Sign out`,href:p}),e[16]=p,e[17]=m);let h;e[18]!==m||e[19]!==d?(h=(0,Z.jsx)(pv,{variant:`destructive`,disabled:d,render:m,children:`Sign out`}),e[18]=m,e[19]=d,e[20]=h):h=e[20];let g;e[21]!==h||e[22]!==l?(g=(0,Z.jsxs)(uv,{align:`end`,className:`w-auto min-w-48`,children:[l,u,h]}),e[21]=h,e[22]=l,e[23]=g):g=e[23];let _;return e[24]!==g||e[25]!==s?(_=(0,Z.jsxs)(cv,{children:[s,g]}),e[24]=g,e[25]=s,e[26]=_):_=e[26],_}function vv(e){let t=(0,X.c)(44),[n,r]=(0,Y.useState)(!1),i,a;t[0]===e.palette?(i=t[1],a=t[2]):(i=()=>{if(e.palette===void 0)return;let t=function(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),r(!0))};return addEventListener(`keydown`,t),()=>removeEventListener(`keydown`,t)},a=[e.palette],t[0]=e.palette,t[1]=i,t[2]=a),(0,Y.useEffect)(i,a);let o;if(t[3]!==e.back||t[4]!==e.icon||t[5]!==e.name||t[6]!==e.title){let n;t[8]!==e.icon||t[9]!==e.name?(n=()=>(0,Z.jsxs)(`a`,{href:`/`,className:`flex shrink-0 items-center gap-2`,children:[(0,Z.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`}),(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:e.name})]}),t[8]=e.icon,t[9]=e.name,t[10]=n):n=t[10];let r;t[11]!==e.back||t[12]!==e.icon||t[13]!==e.name?(r=t=>(0,Z.jsxs)(`div`,{className:`flex min-w-0 shrink items-center gap-1.5`,children:[s(z(e.back),{onNone:()=>(0,Z.jsx)(`a`,{href:`/`,"aria-label":e.name,className:`flex size-8 shrink-0 items-center justify-center max-sm:size-11`,children:(0,Z.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`})}),onSome:xv}),(0,Z.jsx)(`span`,{className:`max-w-40 min-w-0 truncate text-sm font-medium`,children:t})]}),t[11]=e.back,t[12]=e.icon,t[13]=e.name,t[14]=r):r=t[14],o=s(z(e.title),{onNone:n,onSome:r}),t[3]=e.back,t[4]=e.icon,t[5]=e.name,t[6]=e.title,t[7]=o}else o=t[7];let c;t[15]===e.tabs?c=t[16]:(c=e.tabs!==void 0&&(0,Z.jsx)(`nav`,{"aria-label":`Sections`,className:`flex items-center gap-1`,children:e.tabs}),t[15]=e.tabs,t[16]=c);let l;if(t[17]!==e.name||t[18]!==e.palette){let n;t[20]===e.name?n=t[21]:(n=()=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($h,{label:`Search ${e.name}`,onClick:()=>r(!0)}),(0,Z.jsx)(cg,{label:`Search ${e.name}`,onClick:()=>r(!0)})]}),t[20]=e.name,t[21]=n),l=s(z(e.palette),{onNone:bv,onSome:n}),t[17]=e.name,t[18]=e.palette,t[19]=l}else l=t[19];let u;t[22]===l?u=t[23]:(u=(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center justify-end sm:justify-center`,children:l}),t[22]=l,t[23]=u);let d;t[24]===e.account?d=t[25]:(d=e.account??(0,Z.jsx)(_v,{}),t[24]=e.account,t[25]=d);let f;t[26]!==e.action||t[27]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[e.action,d]}),t[26]=e.action,t[27]=d,t[28]=f):f=t[28];let p;t[29]!==o||t[30]!==c||t[31]!==u||t[32]!==f?(p=(0,Z.jsxs)(`header`,{className:`bg-background border-border sticky top-0 z-30 flex h-12 shrink-0 items-center gap-2 border-b px-3`,children:[o,c,u,f]}),t[29]=o,t[30]=c,t[31]=u,t[32]=f,t[33]=p):p=t[33];let m;if(t[34]!==n||t[35]!==e.name||t[36]!==e.palette){let i;t[38]!==n||t[39]!==e.name?(i=t=>(0,Z.jsx)(qh,{current:e.name,groups:t,open:n,onOpenChange:r}),t[38]=n,t[39]=e.name,t[40]=i):i=t[40],m=s(z(e.palette),{onNone:yv,onSome:i}),t[34]=n,t[35]=e.name,t[36]=e.palette,t[37]=m}else m=t[37];let h;return t[41]!==p||t[42]!==m?(h=(0,Z.jsxs)(Z.Fragment,{children:[p,m]}),t[41]=p,t[42]=m,t[43]=h):h=t[43],h}function yv(){return null}function bv(){return null}function xv(e){return(0,Z.jsx)(Fn,{variant:`ghost`,size:`icon`,className:`max-sm:size-11`,"aria-label":e.label,onClick:e.onClick,children:(0,Z.jsx)(Gn,{className:`size-4`})})}function Sv(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=q(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Cv(e){let t=(0,X.c)(8),n=e.label,r;if(t[0]!==e.media||t[1]!==e.rows){let n;t[3]===e.media?n=t[4]:(n=t=>(0,Z.jsxs)(`div`,{"aria-hidden":!0,className:`flex h-8 items-center gap-3 border-b px-1 max-sm:h-11`,children:[e.media===!0&&(0,Z.jsx)(Sv,{className:`size-5`}),(0,Z.jsx)(Sv,{className:`h-4 w-1/3`})]},t),t[3]=e.media,t[4]=n),r=Et(Oe(1,e.rows),n),t[0]=e.media,t[1]=e.rows,t[2]=r}else r=t[2];let i;return t[5]!==e.label||t[6]!==r?(i=(0,Z.jsx)(`div`,{"aria-busy":`true`,"aria-label":n,role:`status`,children:r}),t[5]=e.label,t[6]=r,t[7]=i):i=t[7],i}var wv=en(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md 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 Tv(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=Rr,r=`span`,i=qt({className:q(wv({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 Ev(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=Eg({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=vf(a,!0,!0),u=vl(),[d,f]=Y.useState(),p=d===null?void 0:d??u,m=K(e=>{let t=!a,n=Yc(Qc,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return Y.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 Dv=Y.createContext(void 0);function Ov(){let e=Y.useContext(Dv);if(e===void 0)throw Error(ln(15));return e}var kv=`data-open`,Av=`data-closed`,jv=jc,Mv=`data-panel-open`,Nv={[kv]:``},Pv={[Av]:``},Fv={open(e){return e?{[Mv]:``}:null}},Iv={open(e){return e?Nv:Pv},...Fc},Lv=Y.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=Ev({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=Y.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=Y.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=xn(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Iv});return(0,Z.jsx)(Dv.Provider,{value:p,children:m})}),Rv={...Fv,...Fc},zv=Y.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Ov(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=Rn({disabled:c,native:u});return xn(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Rv})}),Bv={height:void 0,width:void 0};function Vv(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=Y.useRef(null),f=Y.useRef(null),[p,m]=Y.useState(Bv),h=Y.useRef(Bv),g=Y.useRef(!1),_=Y.useRef(s),v=Y.useRef(!1),[y,b]=Y.useState(!1),x=Y.useRef(null),S=In(t,d),C=xl(s),w=Sf(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)});J(()=>{y&&u!==`starting`&&b(!1)},[y,u]),Y.useEffect(()=>()=>{N(),j()},[N,j]),J(()=>{s||(_.current=!1,v.current=!1);let e=d.current;if(!e)return;!s&&x.current&&j();let t=Uv(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=Hv(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(Hv(e)),b(!0);return}if(t===`css-transition`){let t=Kv(e);if(A(Hv(e)),!n)return t;let r=Gv(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(Hv(e));let r=Gv(e,`animation-name`,`none`);if(!n){r();return}let i=Gv(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){A(Bv,!1),c(!1);return}A(Hv(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Hv(e);n.height>0||n.width>0?(A(n),t===`css-animation`&&Gv(e,`animation-name`,`none`)()):c(!1)},[a,s,j,A,c,M,D,u]),Cf({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(Bv,!1)}}),Y.useEffect(()=>{if(s||!a||E!==`ending`)return;if(!d.current){c(!1),A(Bv,!1);return}let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(Bv,!1))}return t=Ul.request(()=>{w(n,e.signal)}),()=>{Ul.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),J(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),Y.useEffect(function(){let e=d.current;if(!e)return;let t=Tl.create(),n=-1,r=(r,i)=>{t.start(0,()=>{C.current||(n=Ul.request(()=>{C.current||(r&&(g.current=!1),i&&e.setAttribute(jv,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Q(e,`beforematch`,t=>{let n=Yc(Zc,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(jv);e.removeAttribute(jv),l(!0),r(!0,i)});return()=>{t.clear(),Ul.cancel(n),i()}},[C,o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[jv]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function Hv(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Uv(e,t){let n=$t(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Wv(n.animationDuration),i=Wv(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Wv(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function Gv(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 Kv(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=Ul.request(n);return()=>{Ul.cancel(r),n()}}var qv=`--collapsible-panel-height`,Jv=`--collapsible-panel-width`,Yv=Y.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:_}=Ov(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;J(()=>(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}=Vv({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=jn(s,k),j=xn(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[qv]:S===void 0?`auto`:`${S}px`,[Jv]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Iv});return E?j:null});function Xv(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,Z.jsx)(Lv,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function Zv(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,Z.jsx)(zv,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function Qv(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,Z.jsx)(Yv,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}var $v=`(max-width: 767px)`;function ey(){return Y.useSyncExternalStore(ry,ny,ty)}function ty(){return!1}function ny(){return window.matchMedia($v).matches}function ry(e){let t=window.matchMedia($v);return t.addEventListener(`change`,e),()=>t.removeEventListener(`change`,e)}var iy=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.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,Z.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r},ay=e=>{let t=(0,X.c)(3),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.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,Z.jsx)(`svg`,{...e,viewBox:`0 0 1024 1024`,fill:`none`,children:n}),t[1]=e,t[2]=r),r},oy=_(T(te(`AUTH_URL`)),E);le(function*(){let e=R(W,`GITHUB_ADMINS`);return(yield*oy)?yield*M(e,[`0`]):yield*e});function sy(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function cy(e){return Ae(wn)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}ct()(`@deslop/runtime/auth/lib/utils/CurrentUser`);var ly=class e extends bt()(`@deslop/runtime/auth/lib/utils/RpcAuth`,{error:wn}){static layerClient=t=>ot(e,e=>le(function*(){return yield*e.next({...e.request,headers:He(e.request.headers,`authorization`,`Bearer ${yield*t}`)})}))},uy=0;function dy(e){return uy+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${uy}`}function fy(){let e=new Set;function t(t){e.forEach(e=>e(t))}return{" subscribe":function(t){return e.add(t),()=>{e.delete(t)}},add(e){let n=e.id||dy(`toast`);return t({action:`add`,options:{...e,id:n,transitionStatus:`starting`}}),n},close(e){t({action:`close`,options:{id:e}})},update(e,n){t({action:`update`,options:{id:e,updates:n}})},promise(e,n){let r=e;return t({action:`promise`,options:{...n,promise:e,setPromise(e){r=e}}}),r}}}var py=fy(),my=class extends Ie()(`TelemetryError`,{cause:ze(o()),message:W}){},hy=gt(W,Je(wt(/^[a-fA-F0-9]{32}$/u))),gy=gt(W,Je(wt(/^[a-fA-F0-9]{16}$/u))),_y=gt(W,Je(wt(/^\d{1,20}$/u))),vy=V({key:W,value:y}),yy=t(V({attributes:G(H(vy))}),[y]),by=V({attributes:G(H(vy)),events:G(H(t(V({attributes:G(H(vy)),name:W,timeUnixNano:_y}),[y]))),links:G(H(t(V({attributes:G(H(vy)),spanId:gy,traceId:hy}),[y])))}),xy=t(V({...by.fields,endTimeUnixNano:G(_y),name:G(W),parentSpanId:G(xt([gy,k(``)])),spanId:gy,startTimeUnixNano:_y,status:G(t(V({code:G(ue)}),[y])),traceId:hy}),[y]),Sy=t(V({attributes:G(H(vy)),body:G(y),observedTimeUnixNano:G(_y),severityNumber:G(ue),severityText:G(W),spanId:G(xt([gy,k(``)])),timeUnixNano:G(_y),traceId:G(xt([hy,k(``)]))}),[y]);V({resourceSpans:G(H(t(V({resource:G(yy),schemaUrl:G(W),scopeSpans:G(H(t(V({schemaUrl:G(W),scope:G(yy),spans:G(H(xy))}),[y])))}),[y])))}),V({resourceLogs:G(H(t(V({resource:G(yy),schemaUrl:G(W),scopeLogs:G(H(t(V({logRecords:G(H(Sy)),schemaUrl:G(W),scope:G(yy)}),[y])))}),[y])))});var Cy=V({durationMs:S,id:be,name:W,payload:y,resource:yy,resourceSchemaUrl:W,scope:yy,scopeSchemaUrl:W,service:W,signal:dt([`trace`,`log`]),spanId:W,status:ue,time:_y,traceId:W}).mapFields(Ge([`resource`,`resourceSchemaUrl`,`scope`,`scopeSchemaUrl`])),wy=V({errors:Lt,from:S,limit:gt(ue,Je(nt({maximum:1e3,minimum:1}))),offset:gt(ue,Je(nt({maximum:1e5,minimum:0}))),operation:W,runs:dt([`current`,`all`]),service:W,sort:dt([`recent`,`slowest`]),text:W,to:S,traceId:W});V({entries:H(Cy),total:ue});var Ty=dt([`web`,`mobile`,`server`,`ci`,`unknown`]),Ey=V({name:W,runtime:Ty}),Dy=V({...Ey.fields,entries:D,lastEventAt:_y,runStartedAt:_y,version:W}),Oy=V({count:D,credential:dt([`authorization`,`cookie`,`none`]),lastAt:S,route:dt([`/v1/traces`,`/v1/logs`]),status:ue});V({rejections:H(Oy),services:H(Dy),since:S});var ky=V({durationMs:S,errors:ue,id:hy,logs:ue,operation:W,service:W,services:H(Ey),spans:ue,time:_y});V({entries:H(ky),total:ue});var Ay=V({durationMs:S,failure:G(V({message:W,span:W})),id:hy,time:_y}),jy=V({count:ue,failures:ue,name:W,p50Ms:S,runtime:Ty,traces:H(Ay)}),My=V({apps:H(V({name:W,operations:H(jy),versions:H(V({runtimes:H(Ty),version:W}))}))});V({count:ue,errors:ue,from:S,maxMs:S,p50Ms:S,p95Ms:S,to:S});var Ny=V({...Cy.fields,depth:D,logs:H(Cy),offsetMs:S,parentSpanId:W,runtime:Ty}),Py=V({durationMs:S,id:hy,logs:H(Cy),services:H(Ey),spans:H(Ny)}),Fy=V({errors:gt(wy.fields.errors,at(et(!1)),_t({description:`Only failed spans and error logs.`})),operation:gt(wy.fields.operation,at(et(``)),_t({description:`Exact span name.`})),runs:gt(wy.fields.runs,at(et(`current`)),_t({description:`"current" searches the latest process/page load/app launch per service. "all" includes retained earlier runs in the lookback.`})),service:gt(wy.fields.service,at(et(``)),_t({description:`Exact service name, from list_services.`})),since:gt(pe,Je(Ne(qe,{expected:`a finite duration`})),at(et(Te(10))),_t({description:`Lookback, such as "10 minutes" or "1 hour".`})),text:gt(wy.fields.text,at(et(``)),_t({description:`Case-insensitive text in the span name, log message or attributes.`})),traceId:gt(wy.fields.traceId,at(et(``)),_t({description:`Only entries of this trace.`}))}),Iy=V({...Fy.fields,limit:gt(wy.fields.limit,at(et(20)),_t({description:`Page size, 1 to 1000.`})),offset:gt(wy.fields.offset,at(et(0)),_t({description:`Entries to skip, for the next page.`}))});V({...Iy.fields,sort:gt(wy.fields.sort,at(et(`recent`)),_t({description:`"recent" puts the newest first, "slowest" the longest first.`}))});var Ly=class extends mt(vt(`scope.overview`,{error:xt([wn,my]),stream:!0,success:My}),vt(`scope.trace`,{error:xt([wn,my]),payload:V({id:hy}),success:Py})).middleware(ly){},Ry=class extends Ke()(`@deslop/scope/lib/utils/RpcClient`,{group:Ly,protocol:kn}){},zy=lt(Ry.runtime.atom(gt(Ry,g(e=>e(`scope.overview`,void 0)),oe,Mn))),By=rt(e=>{let t=e(zy),n=Xe(e.self(),e=>e.seen);if(!jt(t))return{arrived:Ct(),seen:n};let r=it(t.value.apps,e=>it(e.operations,e=>Et(e.traces,e=>e.id)));return{arrived:s(n,{onNone:()=>Ct(),onSome:e=>tt(r,e)}),seen:C(r)}}),Vy=St(e=>Ry.query(`scope.trace`,{id:B(We(w(e,`:`)),()=>e)})),Hy=rt(It(Nt(`30 seconds`),()=>r)),Uy=je(e=>gt(L({catch:e=>wn.make({cause:e,message:`Cannot copy the trace ID`}),try:()=>navigator.clipboard.writeText(e)}),Ze(e=>a(()=>py.add({description:e.message,title:`Cannot copy the trace ID`,type:`error`}))),d(ee(`1500 millis`))));function Wy(e,t){let n=pt(0,(t-B(O(gt(e,he(0,-6))),()=>t))/1e3);return n<10?`now`:n<60?`${Se(n,0)}s`:n<3600?`${Se(n/60,0)}m`:n<86400?`${Se(n/3600,0)}h`:`${Se(n/86400,0)}d`}function Gy(e){return e<999.5?`${Se(e,0)} ms`:e<9950?`${Se(e/1e3,1)} s`:e<59500?`${Se(e/1e3,0)} s`:e<357e4?`${Se(e/6e4,0)} min`:`${Se(e/36e5,1)} h`}var Ky=`/assets/icon-D1hVTa1Q.svg`;A(de(b),e=>Et(w(e,`.`),e=>B(O(e),()=>0)));function qy(e){return gt(e,c(/^@deslop\//u,``),c(/-(?:server|client|ios)$/u,``))}var Jy=A(_e,e=>BigInt(e));A(Jy,e=>e.time);var Yy={ci:`ci`,mobile:`iOS`,server:`server`,unknown:``,web:`web`},Xy={400:`Bad Request`,401:`Unauthorized`,403:`Forbidden`,404:`Not Found`,409:`Conflict`,422:`Unprocessable`,429:`Too Many Requests`,500:`Server Error`,502:`Bad Gateway`,503:`Unavailable`,504:`Gateway Timeout`},Zy=[`http.request.method`,`http.response.status_code`,`server.address`,`server.port`,`url.full`,`url.path`,`url.scheme`],Qy={ci:(0,Z.jsx)(ar,{role:`img`,"aria-label":`ci`,"data-side":`ci`,className:`size-3.5 shrink-0 text-(--side)`}),mobile:(0,Z.jsx)(rr,{role:`img`,"aria-label":`iOS`,"data-side":`mobile`,className:`size-3.5 shrink-0 text-(--side)`}),server:(0,Z.jsx)(tr,{role:`img`,"aria-label":`server`,"data-side":`server`,className:`size-3.5 shrink-0 text-(--side)`}),unknown:(0,Z.jsx)(tr,{"aria-hidden":!0,"data-side":`unknown`,className:`size-3.5 shrink-0 text-(--side)`}),web:(0,Z.jsx)(Zn,{role:`img`,"aria-label":`web`,"data-side":`web`,className:`size-3.5 shrink-0 text-(--side)`})},$y=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,hourCycle:`h23`,minute:`2-digit`,second:`2-digit`}),eb=new Intl.NumberFormat(void 0,{maximumFractionDigits:0}),tb=H(V({key:W,value:ge})),nb=ye(W,ge),rb=Pn(Object.assign({"../../../../auth/src/routes/icon.svg":lr,"../../../../deploy/src/routes/icon.svg":ur,"../../../../gateway/src/routes/icon.svg":dr,"../../../../opm/src/routes/icon.svg":fr,"../../../../portfolio/src/routes/icon.svg":pr,"../icon.svg":mr,"../../../../signal/src/routes/icon.svg":hr,"../../../../stash/src/routes/icon.svg":gr,"../../../../trips/src/routes/icon.svg":_r}));function ib(e){return s(Pe(e.cause),{onNone:()=>(0,Z.jsx)(_n,{error:ht(e.cause),reset:()=>location.reload()}),onSome:e=>yt(cy(e),{onFalse:()=>(0,Z.jsx)(_n,{error:e,reset:()=>location.reload()}),onTrue:()=>(0,Z.jsx)(An,{href:sy(location.href)})})})}function ab(e){let t=(0,X.c)(3);if(cy(e.error)){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(An,{href:sy(location.href)}),t[0]=e):e=t[0],e}let n;return t[1]===e.error?n=t[2]:(n=(0,Z.jsx)(_n,{error:e.error,reset:ob}),t[1]=e.error,t[2]=n),n}function ob(){return location.reload()}function sb(e){return gt(Ee(nb)(e),Xe(e=>We(p(e))),i(e=>st(e)||n(e)||xe(e)),s({onNone:()=>ft(e),onSome:e=>`${e}`}))}function cb(e){return gt(U(e,e=>e.status===2),Xe(e=>I(e.payload.status)),i(Fe),Xe(e=>I(gt(ce(e,`message`),v))),i(re),i(P))}function lb(e){let t=N(cb(e)),n=Et(Re(B(Ee(tb)(e.payload.attributes),()=>[]),e=>e.key!==`service.name`),e=>({key:e.key,value:sb(e.value)})),r=ut(n,e=>e.key===`http.response.status_code`);return Re(n,n=>n.value!==e.name&&!(t&&ke(Zy,n.key))&&(n.key!==`error.type`||!$e(r,e=>e.value===n.value)))}function ub(e){return s(zt(/^StatusCode error \((\d{3}) (\w+) (https?:\/\/[^\s)]+)\)$/u)(e.message),{onNone:()=>(0,Z.jsx)(`span`,{className:`break-words`,children:e.message}),onSome:e=>{let t=e[1]??``,n=e[2]??``,r=e[3]??``;return(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-2 break-words`,children:[(0,Z.jsxs)(`span`,{className:`font-medium`,children:[t,` `,B(ce(Xy,t),()=>``)]}),(0,Z.jsx)(`span`,{children:n}),(0,Z.jsx)(`span`,{className:`min-w-0 break-all`,children:c(/^https?:\/\//u,``)(r)})]})}})}function db(e){return N(cb(e))||Ve(lb(e))||Ve(e.logs)}function fb(e){return`calc(var(--spacing) * 6 + ${pt(0,e.depth-1)*12}px)`}function pb(e){let t=(0,X.c)(4),n;t[0]===e.span?n=t[1]:(n=Et([...s(cb(e.span),{onNone:_b,onSome:gb}),...Et(lb(e.span),hb),...Et(e.span.logs,mb)],(t,n)=>(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5 py-1 pr-1 pl-(--indent)`,style:{"--indent":fb(e.span)},children:[(0,Z.jsx)(`dt`,{className:q(`text-muted-foreground`,t.failed&&`text-destructive`),children:t.key}),(0,Z.jsx)(`dd`,{className:q(`min-w-0 break-words select-text`,t.failed&&`text-destructive`),children:yt(t.key===`error`,{onFalse:()=>yt(t.key===`url.full`&&fe(`https://`)(t.value),{onFalse:()=>t.value,onTrue:()=>(0,Z.jsx)(`a`,{href:t.value,target:`_blank`,rel:`noreferrer`,className:`text-primary`,children:t.value})}),onTrue:()=>(0,Z.jsx)(ub,{message:t.value})})})]},`${t.key}:${n}`)),t[0]=e.span,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(`dl`,{className:`flex flex-col pb-1 font-mono text-xs`,children:n}),t[2]=n,t[3]=r),r}function mb(e){return{failed:e.status===2,key:`log`,value:e.name}}function hb(e){return{...e,failed:!1}}function gb(e){return[{failed:!0,key:`error`,value:e}]}function _b(){return[]}function vb(e){let t=(0,X.c)(35),n;t[0]===e.span?n=t[1]:(n=fb(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,Z.jsx)(`img`,{src:t,alt:qy(e.span.service),className:`pixelated size-3.5 shrink-0`}),t[7]=e.span.service,t[8]=n),i=s(e.mark,{onNone:Cb,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,Z.jsx)(`span`,{className:`truncate font-mono`,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,Z.jsxs)(`span`,{className:`flex w-40 shrink-0 items-center gap-1.5 pl-(--indent) text-left`,style:r,children:[i,a]}),t[11]=r,t[12]=i,t[13]=a,t[14]=o):o=t[14];let c=e.span.runtime,l;t[15]===e.span.status?l=t[16]:(l=q(`absolute top-0 left-(--offset) h-1.5 w-(--length) min-w-0.5 rounded-full`,yt(e.span.status===2,{onFalse:Sb,onTrue:xb})),t[15]=e.span.status,t[16]=l);let u=`calc(${e.span.durationMs} / var(--trace-total) * 100%)`,d=`calc(${e.span.offsetMs} / var(--trace-total) * 100%)`,f;t[17]!==u||t[18]!==d?(f={"--length":u,"--offset":d},t[17]=u,t[18]=d,t[19]=f):f=t[19];let p;t[20]!==e.span.runtime||t[21]!==l||t[22]!==f?(p=(0,Z.jsx)(`span`,{className:`bg-muted/60 relative h-1.5 flex-1 rounded-full`,children:(0,Z.jsx)(`span`,{"data-side":c,className:l,style:f})}),t[20]=e.span.runtime,t[21]=l,t[22]=f,t[23]=p):p=t[23];let m;t[24]===e.span.durationMs?m=t[25]:(m=Gy(e.span.durationMs),t[24]=e.span.durationMs,t[25]=m);let h;t[26]===m?h=t[27]:(h=(0,Z.jsx)(`span`,{className:`text-muted-foreground w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:m}),t[26]=m,t[27]=h);let g;t[28]===e.open?g=t[29]:(g=s(z(e.open),{onNone:bb,onSome:yb}),t[28]=e.open,t[29]=g);let _;return t[30]!==p||t[31]!==h||t[32]!==g||t[33]!==o?(_=(0,Z.jsxs)(Z.Fragment,{children:[o,p,h,g]}),t[30]=p,t[31]=h,t[32]=g,t[33]=o,t[34]=_):_=t[34],_}function yb(e){return(0,Z.jsx)(qn,{className:q(`text-muted-foreground size-3.5 shrink-0 transition-transform`,e&&`rotate-90`)})}function bb(){return(0,Z.jsx)(`span`,{className:`size-3.5 shrink-0`})}function xb(){return`bg-destructive`}function Sb(){return`bg-(--side)`}function Cb(){return null}function wb(e){let t=Re(e,e=>e.status===2),n=Et(t,e=>B(i(I(e.payload.parentSpanId),re),()=>``));return ut(t,e=>!ae(n,t=>ve(t)===e.spanId))}function Tb(e){let t=(0,X.c)(22),n=e.focus===e.span.spanId;if(!db(e.span)){let n;t[0]!==e.mark||t[1]!==e.span?(n=e.mark(e.span),t[0]=e.mark,t[1]=e.span,t[2]=n):n=t[2];let r;return t[3]!==e.span||t[4]!==n?(r=(0,Z.jsx)(`div`,{className:`flex h-8 w-full items-center gap-3 pr-1 text-xs max-sm:h-11`,children:(0,Z.jsx)(vb,{mark:n,span:e.span})}),t[3]=e.span,t[4]=n,t[5]=r):r=t[5],r}let r;t[6]===e?r=t[7]:(r=t=>e.onPick(yt(t,{onFalse:Eb,onTrue:()=>e.span.spanId})),t[6]=e,t[7]=r);let i;t[8]!==e.mark||t[9]!==e.span?(i=e.mark(e.span),t[8]=e.mark,t[9]=e.span,t[10]=i):i=t[10];let a;t[11]!==n||t[12]!==e.span||t[13]!==i?(a=(0,Z.jsx)(Zv,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 text-left text-xs max-sm:h-11`,children:(0,Z.jsx)(vb,{mark:i,span:e.span,open:n})}),t[11]=n,t[12]=e.span,t[13]=i,t[14]=a):a=t[14];let o;t[15]===e.span?o=t[16]:(o=(0,Z.jsx)(Qv,{children:(0,Z.jsx)(pb,{span:e.span})}),t[15]=e.span,t[16]=o);let s;return t[17]!==n||t[18]!==r||t[19]!==a||t[20]!==o?(s=(0,Z.jsxs)(Xv,{open:n,onOpenChange:r,className:`data-open:bg-muted/60`,children:[a,o]}),t[17]=n,t[18]=r,t[19]=a,t[20]=o,t[21]=s):s=t[21],s}function Eb(){return``}function Db(e){let t=(0,X.c)(16),n=`${e.id}:${e.size}`,r;t[0]===n?r=t[1]:(r=Vy(n),t[0]=n,t[1]=r);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={includeFailure:!0},t[2]=a):a=t[2];let o=Lr(r,a),[c,l]=(0,Y.useState)();if(De(o)){let e;return t[3]===o.cause?e=t[4]:(e=(0,Z.jsx)(ib,{cause:o.cause}),t[3]=o.cause,t[4]=e),e}let u=o.value,d;if(t[5]!==c||t[6]!==u.durationMs||t[7]!==u.spans){let e=ut(u.spans,Mb),n=Re(u.spans,t=>!$e(e,e=>e.spanId===t.spanId)),r=kt(Et(u.spans,jb)),a=function(t){let n=r[t.parentSpanId]??s(e,{onNone:()=>t.service,onSome:Ab});return i(z(rb[qy(t.service)]),()=>qy(t.service)!==qy(n))},o;t[9]!==c||t[10]!==u.spans?(o=()=>ut(u.spans,e=>e.spanId===c),t[9]=c,t[10]=u.spans,t[11]=o):o=t[11];let f=i(yt(c===void 0,{onFalse:o,onTrue:()=>gt(wb(u.spans),me(()=>e))}),db),p=v(Rt(f,kb)),m;t[12]===u.durationMs?m=t[13]:(m=pt(u.durationMs,1),t[12]=u.durationMs,t[13]=m);let h=`${m}`,g;t[14]===h?g=t[15]:(g={"--trace-total":h},t[14]=h,t[15]=g),d=(0,Z.jsxs)(`div`,{className:`flex flex-col pb-2`,style:g,children:[s(e,{onNone:Ob,onSome:e=>(0,Z.jsx)(Tb,{focus:p,mark:a,onPick:e=>l(e),span:e})}),Et(n,e=>(0,Z.jsx)(Tb,{focus:p,mark:a,onPick:e=>l(e),span:e},e.spanId))]}),t[5]=c,t[6]=u.durationMs,t[7]=u.spans,t[8]=d}else d=t[8];return d}function Ob(){return null}function kb(e){return e.spanId}function Ab(e){return e.service}function jb(e){return[e.spanId,e.service]}function Mb(e){return e.depth===0}function Nb(){let e=(0,X.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{"aria-busy":`true`,role:`status`,"aria-label":`Spans`,className:`flex flex-col gap-2 py-2 pr-1 pl-10`,children:Et(Oe(1,4),Pb)}),e[0]=t):t=e[0],t}function Pb(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Sv,{className:`h-4 w-32`}),(0,Z.jsx)(Sv,{className:`h-2 flex-1`})]},e)}function Fb(e){let t=(0,X.c)(10),n=e.label,r;t[0]===e.className?r=t[1]:(r=q(`flex min-h-0 flex-col`,e.className),t[0]=e.className,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`header`,{className:`bg-background flex h-8 shrink-0 items-center gap-2 border-b px-3`,children:(0,Z.jsx)(Sv,{className:`h-4 w-24`})}),t[2]=i):i=t[2];let a;t[3]!==e.label||t[4]!==e.rows?(a=(0,Z.jsx)(`div`,{className:`p-2`,children:(0,Z.jsx)(Cv,{label:e.label,media:!0,rows:e.rows})}),t[3]=e.label,t[4]=e.rows,t[5]=a):a=t[5];let o;return t[6]!==e.label||t[7]!==r||t[8]!==a?(o=(0,Z.jsxs)(`section`,{"aria-busy":`true`,role:`status`,"aria-label":n,className:r,children:[i,a]}),t[6]=e.label,t[7]=r,t[8]=a,t[9]=o):o=t[9],o}function Ib(e){let t=(0,X.c)(6),n;t[0]===e.className?n=t[1]:(n=q(`flex min-h-0 flex-col`,e.className),t[0]=e.className,t[1]=n);let r,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`header`,{className:`bg-background flex h-8 shrink-0 items-center gap-2 border-b px-3`,children:(0,Z.jsx)(Sv,{className:`h-4 w-32`})}),i=(0,Z.jsx)(Nb,{}),t[2]=r,t[3]=i):(r=t[2],i=t[3]);let a;return t[4]===n?a=t[5]:(a=(0,Z.jsxs)(`section`,{"aria-busy":`true`,role:`status`,"aria-label":`Trace`,className:n,children:[r,i]}),t[4]=n,t[5]=a),a}function Lb(e){let t=(0,X.c)(2);if(e.isMobile){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Fb,{className:`min-h-0 flex-1`,label:`Operations`,rows:8}),t[0]=e):e=t[0],e}let n;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`grid-cols-scope grid min-h-0 flex-1`,children:[(0,Z.jsx)(Fb,{className:`min-w-0 border-r`,label:`Operations`,rows:8}),(0,Z.jsx)(Fb,{className:`min-w-0 border-r`,label:`Traces`,rows:6}),(0,Z.jsx)(Ib,{className:`min-w-0`})]}),t[1]=n):n=t[1],n}function Rb(e){let t=(0,X.c)(10),n;if(t[0]!==e.app.name||t[1]!==e.app.operations){let r;t[3]===e.app.operations?r=t[4]:(r=()=>yt(Me(e.app.operations,Hb),{onFalse:Vb,onTrue:Bb}),t[3]=e.app.operations,t[4]=r),n=s(z(rb[e.app.name]),{onNone:r,onSome:zb}),t[0]=e.app.name,t[1]=e.app.operations,t[2]=n}else n=t[2];let r;t[5]===e.app.name?r=t[6]:(r=(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-xs font-semibold`,children:e.app.name}),t[5]=e.app.name,t[6]=r);let i;return t[7]!==n||t[8]!==r?(i=(0,Z.jsxs)(`div`,{className:`bg-background sticky top-8 z-20 flex h-8 shrink-0 items-center gap-2 border-b px-2.5`,children:[n,r]}),t[7]=n,t[8]=r,t[9]=i):i=t[9],i}function zb(e){return(0,Z.jsx)(`img`,{src:e,alt:``,className:`pixelated size-5`})}function Bb(){return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ay,{className:`size-4 dark:hidden`}),(0,Z.jsx)(iy,{className:`hidden size-4 dark:block`})]})}function Vb(){return(0,Z.jsx)(tr,{className:`text-muted-foreground size-4`})}function Hb(e){return e.runtime===`ci`}function Ub(e){let t=(0,X.c)(30),n;t[0]===e.active?n=t[1]:(n=yt(e.active,{onFalse:qb,onTrue:Kb}),t[0]=e.active,t[1]=n);let r;t[2]===e.active?r=t[3]:(r=yt(e.active,{onFalse:Gb,onTrue:Wb}),t[2]=e.active,t[3]=r);let i=e.onSelect,a=Qy[e.operation.runtime],o;t[4]===e.operation.name?o=t[5]:(o=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono`,children:e.operation.name}),t[4]=e.operation.name,t[5]=o);let s;t[6]===e.operation.failures?s=t[7]:(s=e.operation.failures>0&&(0,Z.jsxs)(Tv,{variant:`destructive`,className:`shrink-0 font-mono`,title:`Failed`,children:[e.operation.failures,(0,Z.jsx)(`span`,{className:`sr-only`,children:` failed`})]}),t[6]=e.operation.failures,t[7]=s);let c;t[8]===s?c=t[9]:(c=(0,Z.jsx)(`span`,{className:`flex w-8 shrink-0 justify-end`,children:s}),t[8]=s,t[9]=c);let l;t[10]===e.operation.count?l=t[11]:(l=eb.format(e.operation.count),t[10]=e.operation.count,t[11]=l);let u;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`span`,{className:`sr-only`,children:` runs`}),t[12]=u):u=t[12];let d;t[13]===l?d=t[14]:(d=(0,Z.jsxs)(`span`,{className:`text-muted-foreground w-10 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums max-lg:hidden`,title:`Runs`,children:[l,`×`,u]}),t[13]=l,t[14]=d);let f;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`span`,{className:`sr-only`,children:`typical `}),t[15]=f):f=t[15];let p;t[16]===e.operation.p50Ms?p=t[17]:(p=Gy(e.operation.p50Ms),t[16]=e.operation.p50Ms,t[17]=p);let m;t[18]===p?m=t[19]:(m=(0,Z.jsxs)(`span`,{className:`text-muted-foreground w-12 shrink-0 text-right font-mono text-xs whitespace-nowrap tabular-nums`,title:`Typical`,children:[f,p]}),t[18]=p,t[19]=m);let h;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(qn,{className:`text-muted-foreground size-3.5 shrink-0 sm:hidden`}),t[20]=h):h=t[20];let g;return t[21]!==e.onSelect||t[22]!==n||t[23]!==r||t[24]!==m||t[25]!==a||t[26]!==o||t[27]!==c||t[28]!==d?(g=(0,Z.jsx)(`div`,{role:`listitem`,className:`border-b`,children:(0,Z.jsxs)(Fn,{size:`lg`,variant:n,className:`w-full justify-start text-left max-sm:h-11`,"aria-current":r,onClick:i,children:[a,o,c,d,m,h]})}),t[21]=e.onSelect,t[22]=n,t[23]=r,t[24]=m,t[25]=a,t[26]=o,t[27]=c,t[28]=d,t[29]=g):g=t[29],g}function Wb(){return`true`}function Gb(){}function Kb(){return`secondary`}function qb(){return`ghost`}function Jb(e){let t=(0,X.c)(16),n;t[0]===e.className?n=t[1]:(n=q(`pb-safe-bottom flex min-h-0 flex-col overflow-y-auto`,e.className),t[0]=e.className,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`span`,{className:`text-sm font-semibold`,children:`Operations`}),t[2]=r):r=t[2];let i;t[3]===e.overview.apps?i=t[4]:(i=eb.format(Mt(e.overview.apps,0,Xb)),t[3]=e.overview.apps,t[4]=i);let a;t[5]===i?a=t[6]:(a=(0,Z.jsx)(`span`,{className:`text-muted-foreground font-mono text-xs`,children:i}),t[5]=i,t[6]=a);let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-8 text-right text-xs`,children:`Failed`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground w-10 text-right text-xs max-lg:hidden`,children:`Runs`}),(0,Z.jsx)(`span`,{className:`text-muted-foreground w-12 text-right text-xs`,children:`Typical`}),(0,Z.jsx)(`span`,{className:`size-3.5 sm:hidden`})]}),t[7]=o):o=t[7];let s;t[8]===a?s=t[9]:(s=(0,Z.jsxs)(`header`,{className:`bg-background sticky top-0 z-30 flex h-8 shrink-0 items-center gap-1 border-b px-2.5`,children:[r,a,o]}),t[8]=a,t[9]=s);let c;t[10]===e?c=t[11]:(c=Ft(e.overview.apps,{onEmpty:Yb,onNonEmpty:t=>(0,Z.jsx)(Z.Fragment,{children:Et(t,t=>(0,Z.jsxs)(`section`,{"aria-label":t.name,children:[(0,Z.jsx)(Rb,{app:t}),(0,Z.jsx)(`div`,{role:`list`,children:Et(t.operations,n=>(0,Z.jsx)(Ub,{active:e.activeKey!==void 0&&e.activeKey.app===t.name&&e.activeKey.runtime===n.runtime&&e.activeKey.name===n.name,onSelect:()=>e.onSelect(t.name,n),operation:n},`${n.runtime} ${n.name}`))})]},t.name))})}),t[10]=e,t[11]=c);let l;return t[12]!==n||t[13]!==s||t[14]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":`Operations`,className:n,children:[s,c]}),t[12]=n,t[13]=s,t[14]=c,t[15]=l):l=t[15],l}function Yb(){return(0,Z.jsx)(Nn,{children:(0,Z.jsx)(yn,{children:(0,Z.jsx)(Dn,{children:`No traces yet`})})})}function Xb(e,t){return e+t.operations.length}function Zb(e,t){return e.span===t?s(zt(/StatusCode error \((\d{3})/u)(e.message),{onNone:()=>`Failed`,onSome:e=>s(z(e[1]),{onNone:()=>`Failed`,onSome:e=>j(`${e} ${B(ce(Xy,e),()=>``)}`)})}):e.span}function Qb(e){let t=(0,X.c)(36),n=e.arrived&&`grid-rows-single animate-grow-in grid motion-reduce:animate-none [&>*]:min-h-0 [&>*]:overflow-clip`,r;t[0]===n?r=t[1]:(r=q(n),t[0]=n,t[1]=r);let i;t[2]===e.active?i=t[3]:(i=yt(e.active,{onFalse:nx,onTrue:tx}),t[2]=e.active,t[3]=i);let a;t[4]===e.active?a=t[5]:(a=yt(e.active,{onFalse:ex,onTrue:$b}),t[4]=e.active,t[5]=a);let o=e.onSelect,s;t[6]!==e.now||t[7]!==e.trace.time?(s=Wy(e.trace.time,e.now),t[6]=e.now,t[7]=e.trace.time,t[8]=s):s=t[8];let c;t[9]===s?c=t[10]:(c=(0,Z.jsx)(`span`,{className:`text-muted-foreground w-8 shrink-0 font-mono text-xs`,children:s}),t[9]=s,t[10]=c);let l;t[11]===e.trace.id?l=t[12]:(l=he(0,8)(e.trace.id),t[11]=e.trace.id,t[12]=l);let u;t[13]===l?u=t[14]:(u=(0,Z.jsx)(`span`,{className:`text-muted-foreground min-w-0 flex-1 truncate font-mono text-xs`,children:l}),t[13]=l,t[14]=u);let d;t[15]!==e.operation||t[16]!==e.trace.failure?(d=e.trace.failure!==void 0&&(0,Z.jsx)(Tv,{variant:`destructive`,className:`max-w-32 shrink-0 font-mono`,title:`Failed at ${e.trace.failure.span}: ${e.trace.failure.message}`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:Zb(e.trace.failure,e.operation)})}),t[15]=e.operation,t[16]=e.trace.failure,t[17]=d):d=t[17];let f;t[18]===d?f=t[19]:(f=(0,Z.jsx)(`span`,{className:`flex w-32 shrink-0 justify-end`,children:d}),t[18]=d,t[19]=f);let p;t[20]===e.trace.durationMs?p=t[21]:(p=Gy(e.trace.durationMs),t[20]=e.trace.durationMs,t[21]=p);let m;t[22]===p?m=t[23]:(m=(0,Z.jsx)(`span`,{className:`w-14 shrink-0 text-right font-mono whitespace-nowrap tabular-nums`,children:p}),t[22]=p,t[23]=m);let h;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(qn,{className:`text-muted-foreground size-3.5 shrink-0 sm:hidden`}),t[24]=h):h=t[24];let g;t[25]!==e.onSelect||t[26]!==f||t[27]!==m||t[28]!==i||t[29]!==a||t[30]!==c||t[31]!==u?(g=(0,Z.jsx)(`div`,{className:`border-b`,children:(0,Z.jsxs)(Fn,{size:`lg`,variant:i,className:`w-full justify-start text-left max-sm:h-11`,"aria-current":a,onClick:o,children:[c,u,f,m,h]})}),t[25]=e.onSelect,t[26]=f,t[27]=m,t[28]=i,t[29]=a,t[30]=c,t[31]=u,t[32]=g):g=t[32];let _;return t[33]!==r||t[34]!==g?(_=(0,Z.jsx)(`div`,{role:`listitem`,className:r,children:g}),t[33]=r,t[34]=g,t[35]=_):_=t[35],_}function $b(){return`true`}function ex(){}function tx(){return`secondary`}function nx(){return`ghost`}function rx(e){return s(z(e.active),{onNone:()=>(0,Z.jsx)(`section`,{"aria-label":`Traces`,className:q(`flex min-h-0 flex-col`,e.className),children:(0,Z.jsx)(Nn,{children:(0,Z.jsx)(yn,{children:(0,Z.jsx)(Dn,{children:`Select an operation`})})})}),onSome:t=>(0,Z.jsxs)(`section`,{"aria-label":`Traces`,className:q(`pb-safe-bottom flex min-h-0 flex-col overflow-y-auto`,e.className),children:[(0,Z.jsxs)(`header`,{className:`bg-background sticky top-0 z-20 flex h-8 shrink-0 items-center gap-2 border-b px-2.5`,children:[s(z(rb[t.app.name]),{onNone:()=>(0,Z.jsx)(tr,{className:`text-muted-foreground size-4 shrink-0`}),onSome:e=>(0,Z.jsx)(`img`,{src:e,alt:``,className:`pixelated size-4 shrink-0`})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-semibold max-sm:hidden`,children:t.operation.name}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 max-sm:ml-auto`,children:[t.operation.failures>0&&(0,Z.jsxs)(Tv,{variant:`destructive`,className:`shrink-0 font-mono`,title:`Failed`,children:[t.operation.failures,(0,Z.jsx)(`span`,{className:`sr-only`,children:` failed`})]}),(0,Z.jsxs)(`span`,{className:`text-muted-foreground shrink-0 font-mono text-xs whitespace-nowrap`,children:[Gy(t.operation.p50Ms),` typical`]})]})]}),(0,Z.jsxs)(`div`,{className:`bg-background text-muted-foreground sticky top-8 z-10 flex h-8 shrink-0 items-center gap-1 border-b px-2.5 text-xs`,children:[(0,Z.jsx)(`span`,{className:`w-8`,children:`Age`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Trace`}),(0,Z.jsx)(`span`,{className:`w-32 text-right`,children:`Failure`}),(0,Z.jsx)(`span`,{className:`w-14 text-right`,children:`Duration`}),(0,Z.jsx)(`span`,{className:`size-3.5 sm:hidden`})]}),(0,Z.jsx)(`div`,{role:`list`,children:Et(t.operation.traces,n=>(0,Z.jsx)(Qb,{active:e.selectedTrace?.id===n.id,arrived:ke(e.arrived,n.id),now:e.now,onSelect:()=>e.onSelect(n),operation:t.operation.name,trace:n},n.id))})]})})}function ix(e){let t=(0,X.c)(27),[n,r]=Nr(Uy),i,a,o,s,c,l,u,d;t[0]!==n||t[1]!==r||t[2]!==e.id?(a=ie(n),i=Fn,o=`ghost`,s=`icon`,c=`max-sm:size-11`,l=yt(a,{onFalse:cx,onTrue:sx}),t[11]!==r||t[12]!==e.id?(u=()=>r(e.id),t[11]=r,t[12]=e.id,t[13]=u):u=t[13],d=yt(a,{onFalse:ox,onTrue:ax}),t[0]=n,t[1]=r,t[2]=e.id,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d):(i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10]);let f;t[14]!==i||t[15]!==o||t[16]!==s||t[17]!==c||t[18]!==l||t[19]!==u||t[20]!==d?(f=(0,Z.jsx)(i,{variant:o,size:s,className:c,"aria-label":l,onClick:u,children:d}),t[14]=i,t[15]=o,t[16]=s,t[17]=c,t[18]=l,t[19]=u,t[20]=d,t[21]=f):f=t[21];let p=a&&`Copied`,m;t[22]===p?m=t[23]:(m=(0,Z.jsx)(`span`,{role:`status`,className:`sr-only`,children:p}),t[22]=p,t[23]=m);let h;return t[24]!==f||t[25]!==m?(h=(0,Z.jsxs)(Z.Fragment,{children:[f,m]}),t[24]=f,t[25]=m,t[26]=h):h=t[26],h}function ax(){return(0,Z.jsx)(Un,{className:`text-primary`})}function ox(){return(0,Z.jsx)(Yn,{})}function sx(){return`Copied`}function cx(){return`Copy trace ID`}function lx(e){return s(z(e.trace),{onNone:()=>(0,Z.jsx)(`section`,{"aria-label":`Trace`,className:q(`flex min-h-0 flex-col`,e.className),children:(0,Z.jsx)(Nn,{children:(0,Z.jsx)(yn,{children:(0,Z.jsx)(Dn,{children:`Select a trace`})})})}),onSome:t=>(0,Z.jsxs)(`section`,{"aria-label":`Trace`,className:q(`pb-safe-bottom flex min-h-0 flex-col overflow-y-auto`,e.className),children:[(0,Z.jsxs)(`header`,{className:`bg-background sticky top-0 z-20 flex h-8 shrink-0 items-center gap-2 border-b px-3 max-sm:h-11`,children:[(0,Z.jsx)(`span`,{className:`text-muted-foreground w-14 shrink-0 font-mono text-xs`,title:$y.format(B(O(he(0,-6)(t.time)),()=>e.now)),children:yt(Wy(t.time,e.now)===`now`,{onFalse:()=>`${Wy(t.time,e.now)} ago`,onTrue:()=>`now`})}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs`,title:t.id,children:he(0,8)(t.id)}),(0,Z.jsx)(ix,{id:t.id}),(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-xs whitespace-nowrap tabular-nums`,children:Gy(t.durationMs)})]}),(0,Z.jsxs)(`div`,{className:`bg-background text-muted-foreground sticky top-8 z-10 flex h-8 shrink-0 items-center gap-3 border-b pr-4 pl-3 text-xs max-sm:top-11`,children:[(0,Z.jsx)(`span`,{className:`w-40 pl-6`,children:`Span`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:`Timeline`}),(0,Z.jsx)(`span`,{className:`w-14 text-right`,children:`Duration`}),(0,Z.jsx)(`span`,{className:`size-3.5`})]}),(0,Z.jsx)(`div`,{className:`min-w-0 px-3`,children:(0,Z.jsx)(Y.Suspense,{fallback:(0,Z.jsx)(Nb,{}),children:(0,Z.jsx)(Db,{id:t.id,size:t.durationMs},t.id)})})]})})}function ux(e,t){return Xe(ut(e.apps,e=>e.name===t.app),e=>Rt(ut(e.operations,e=>e.runtime===t.runtime&&e.name===t.name),t=>({app:e,operation:t})))}function dx(){let e=(0,X.c)(10),t=ey(),[n,r]=(0,Y.useState)(`operations`),[a,o]=(0,Y.useState)(),[c,d]=(0,Y.useState)(),f=Ar(zy),p=l(f),m=Tt(f),h=i(m,Ae(wn)),g=Pt(Ar(Hy),Mx),_=Ar(By).arrived,y=me(Xe(z(a),e=>Xe(p,t=>ux(t,e))),()=>Xe(p,Ax)),b=Rt(y,kx),x;e[0]===c?x=e[1]:(x=e=>me(Xe(z(c),t=>ut(e.operation.traces,e=>e.id===t.id)),()=>We(e.operation.traces)),e[0]=c,e[1]=x);let S=Xe(y,x),C;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(C=function(e,t){o({app:e,name:t.name,runtime:t.runtime}),d(v(We(t.traces))),r(`traces`)},e[2]=C):C=e[2];let w=C,T;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(T=function(e){d(e),r(`trace`)},e[3]=T):T=e[3];let E=T,D;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>it(e.apps,e=>Et(e.operations,t=>({detail:`${t.failures} failed · ${Gy(t.p50Ms)} typical`,icon:Qy[t.runtime],id:`${e.name}:${t.runtime}:${t.name}`,keywords:`${e.name} ${t.name} ${Yy[t.runtime]}`,label:`${e.name} · ${t.name}`,run:()=>w(e.name,t)}))),e[4]=D):D=e[4];let O={items:s(p,{onNone:Ox,onSome:D}),label:`Operations`},k={items:s(y,{onNone:Dx,onSome:e=>Et(u(e.operation.traces,6),t=>({detail:s(z(t.failure),{onNone:Ex,onSome:Tx}),icon:Qy[e.operation.runtime],id:t.id,keywords:t.id,label:`${Wy(t.time,g)} · ${Gy(t.durationMs)}`,run:()=>E(t)}))}),label:`Traces`},A=yt(t,{onFalse:wx,onTrue:()=>gt(Ye(n),F(`operations`,Cx),F(`traces`,()=>s(y,{onNone:Sx,onSome:xx})),Qe(bx))}),j;if(e[5]!==t||e[6]!==n){let i;e[8]===n?i=e[9]:(i=()=>({label:yt(n===`trace`,{onFalse:vx,onTrue:_x}),onClick:()=>r(yt(n===`trace`,{onFalse:gx,onTrue:hx}))}),e[8]=n,e[9]=i),j=yt(t&&n!==`operations`,{onFalse:yx,onTrue:i}),e[5]=t,e[6]=n,e[7]=j}else j=e[7];return(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(vv,{icon:Ky,name:`scope`,title:A,back:j,palette:yt(N(h),{onFalse:()=>[k,O],onTrue:mx})}),s(h,{onNone:()=>s(p,{onNone:()=>s(m,{onNone:()=>(0,Z.jsx)(Lb,{isMobile:t}),onSome:px}),onSome:e=>(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:yt(t,{onFalse:()=>(0,Z.jsxs)(`div`,{className:`grid-cols-scope grid min-h-0 flex-1`,children:[(0,Z.jsx)(Jb,{activeKey:v(b),className:`min-w-0 border-r`,onSelect:w,overview:e}),(0,Z.jsx)(rx,{active:v(y),arrived:_,className:`min-w-0 border-r`,now:g,onSelect:E,selectedTrace:v(S)}),(0,Z.jsx)(lx,{className:`min-w-0`,now:g,trace:v(S)})]}),onTrue:()=>(0,Z.jsx)(Z.Fragment,{children:gt(Ye(n),F(`operations`,()=>(0,Z.jsx)(Jb,{activeKey:v(b),className:`min-h-0 flex-1`,onSelect:w,overview:e})),F(`traces`,()=>(0,Z.jsx)(rx,{active:v(y),arrived:_,className:`min-h-0 flex-1`,now:g,onSelect:E,selectedTrace:v(S)})),Qe(()=>(0,Z.jsx)(lx,{className:`min-h-0 flex-1`,now:g,trace:v(S)})))})})})}),onSome:fx})]})}function fx(e){return(0,Z.jsx)(ab,{error:e})}function px(e){return(0,Z.jsx)(ab,{error:e})}function mx(){return[]}function hx(){return`traces`}function gx(){return`operations`}function _x(){return`Traces`}function vx(){return`Operations`}function yx(){}function bx(){return`Trace`}function xx(e){return e.operation.name}function Sx(){return`Traces`}function Cx(){return`scope`}function wx(){}function Tx(e){return`failed at ${e.span}`}function Ex(){return`ok`}function Dx(){return[]}function Ox(){return[]}function kx(e){return{app:e.app.name,name:e.operation.name,runtime:e.operation.runtime}}function Ax(e){return Xe(Xe(We(e.apps),jx),t=>ux(e,t))}function jx(e){return Rt(We(e.operations),t=>({app:e.name,name:t.name,runtime:t.runtime}))}function Mx(){return Dt(we())}export{dx as component};