@nylorun/studio 0.4.0-beta → 0.4.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.4.1-beta
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d27242c: Show stopped guardrail and failed model requests as errors in Studio. Runtime now emits a terminal AG-UI error instead of marking failed requests successful, and Studio displays the reported message. The guardrails example also checks text content parts sent by Studio, including mixed media input, before invoking the model.
|
|
8
|
+
|
|
3
9
|
## 0.4.0-beta
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -55,4 +55,4 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
55
55
|
`},c_=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},l_=function(){v.useEffect(function(){return document.body.setAttribute(o_,(c_()+1).toString()),function(){var e=c_()-1;e<=0?document.body.removeAttribute(o_):document.body.setAttribute(o_,e.toString())}},[])},u_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;l_();var a=v.useMemo(function(){return i_(i)},[i]);return v.createElement(a_,{styles:s_(a,!t,i,n?``:`!important`)})},d_=!1;if(typeof window<`u`)try{var f_=Object.defineProperty({},"passive",{get:function(){return d_=!0,!0}});window.addEventListener(`test`,f_,f_),window.removeEventListener(`test`,f_,f_)}catch{d_=!1}var p_=d_?{passive:!1}:!1,m_=function(e){return e.tagName===`TEXTAREA`},h_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!m_(e)&&n[t]===`visible`)},g_=function(e){return h_(e,`overflowY`)},__=function(e){return h_(e,`overflowX`)},v_=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),x_(e,r)){var i=S_(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},y_=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},b_=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},x_=function(e,t){return e===`v`?g_(t):__(t)},S_=function(e,t){return e===`v`?y_(t):b_(t)},C_=function(e,t){return e===`h`&&t===`rtl`?-1:1},w_=function(e,t,n,r,i){var a=C_(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=S_(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&x_(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},T_=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},E_=function(e){return[e.deltaX,e.deltaY]},D_=function(e){return e&&`current`in e?e.current:e},O_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k_=function(e){return`
|
|
56
56
|
.block-interactivity-${e} {pointer-events: none;}
|
|
57
57
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
58
|
-
`},A_=0,j_=[];function M_(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(A_++)[0],a=v.useState(e_)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Wo([e.lockRef.current],(e.shards||[]).map(D_),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=T_(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=v_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=v_(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 w_(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!j_.length||j_[j_.length-1]!==a)){var r=`deltaY`in n?E_(n):T_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&O_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(D_).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:N_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=T_(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,E_(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,T_(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return j_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,p_),document.addEventListener(`touchmove`,c,p_),document.addEventListener(`touchstart`,u,p_),function(){j_=j_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,p_),document.removeEventListener(`touchmove`,c,p_),document.removeEventListener(`touchstart`,u,p_)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:k_(i)}):null,p?v.createElement(u_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function N_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var P_=Wg(Gg,M_),F_=v.forwardRef(function(e,t){return v.createElement(qg,Ro({},e,{ref:t,sideCar:P_}))});F_.classNames=qg.classNames;var I_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},L_=new WeakMap,R_=new WeakMap,z_={},B_=0,V_=function(e){return e&&(e.host||V_(e.parentNode))},H_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=V_(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})},U_=function(e,t,n,r){var i=H_(t,Array.isArray(e)?e:[e]);z_[n]||(z_[n]=new WeakMap);var a=z_[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=(L_.get(e)||0)+1,l=(a.get(e)||0)+1;L_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&R_.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(),B_++,function(){o.forEach(function(e){var t=L_.get(e)-1,i=a.get(e)-1;L_.set(e,t),a.set(e,i),t||(R_.has(e)||e.removeAttribute(r),R_.delete(e)),i||e.removeAttribute(n)}),B_--,B_||(L_=new WeakMap,L_=new WeakMap,R_=new WeakMap,z_={})}},W_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||I_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),U_(r,i,n,`aria-hidden`)):function(){return null}},G_=Object.defineProperty,K_=(e,t)=>G_(e,`name`,{value:t,configurable:!0}),q_=`Dialog`,[J_,Y_]=Dm(q_),[X_,Z_]=J_(q_),Q_=K_(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ih({prop:r,defaultProp:i??!1,onChange:a,caller:q_}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,X.jsx)(X_,{scope:t,triggerRef:s,contentRef:c,contentId:Sh(),titleId:Sh(),descriptionId:Sh(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),$_=`DialogPortal`,[ev,tv]=J_($_,{forceMount:void 0}),nv=K_(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z_($_,t);return(0,X.jsx)(ev,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),rv=`DialogOverlay`,iv=v.forwardRef(K_(function(e,t){let n=tv(rv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z_(rv,e.__scopeDialog);return a.modal?(0,X.jsx)(fh,{present:r||a.open,children:(0,X.jsx)(ov,{...i,ref:t})}):null},`DialogOverlay`)),av=$p(`DialogOverlay.RemoveScroll`),ov=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(rv,n),a=Xp(t,$h());return(0,X.jsx)(F_,{as:av,allowPinchZoom:!0,shards:[i.contentRef],children:(0,X.jsx)(vm.div,{"data-state":vv(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),sv=`DialogContent`,cv=v.forwardRef(K_(function(e,t){let n=tv(sv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z_(sv,e.__scopeDialog);return(0,X.jsx)(fh,{present:r||a.open,children:a.modal?(0,X.jsx)(lv,{...i,ref:t}):(0,X.jsx)(uv,{...i,ref:t})})},`DialogContent`)),lv=v.forwardRef(K_(function(e,t){let n=Z_(sv,e.__scopeDialog),r=v.useRef(null),i=Xp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return W_(e)},[]),(0,X.jsx)(dv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),uv=v.forwardRef(K_(function(e,t){let n=Z_(sv,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,X.jsx)(dv,{...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`)),dv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z_(sv,n);return kg(),(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(ug,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(Qh,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":vv(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),fv=`DialogTitle`,pv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(fv,n),{setTitleCount:a}=i;return Ym(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(vm.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),mv=`DialogDescription`,hv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(mv,n),{setDescriptionCount:a}=i;return Ym(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(vm.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),gv=`DialogClose`,_v=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(gv,n);return(0,X.jsx)(vm.button,{type:`button`,...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function vv(e){return e?`open`:`closed`}K_(vv,`getState`);var yv=Object.defineProperty,bv=(e,t)=>yv(e,`name`,{value:t,configurable:!0});function xv(e){let[t,n]=v.useState(void 0);return Ym(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}bv(xv,`useSize`);var Sv=[`top`,`right`,`bottom`,`left`],Cv=Math.min,wv=Math.max,Tv=Math.round,Ev=Math.floor,Dv=e=>({x:e,y:e}),Ov={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kv(e,t,n){return wv(e,Cv(t,n))}function Av(e,t){return typeof e==`function`?e(t):e}function jv(e){return e.split(`-`)[0]}function Mv(e){return e.split(`-`)[1]}function Nv(e){return e===`x`?`y`:`x`}function Pv(e){return e===`y`?`height`:`width`}function Fv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Iv(e){return Nv(Fv(e))}function Lv(e,t,n){n===void 0&&(n=!1);let r=Mv(e),i=Iv(e),a=Pv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kv(o)),[o,Kv(o)]}function Rv(e){let t=Kv(e);return[zv(e),t,zv(t)]}function zv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Bv=[`left`,`right`],Vv=[`right`,`left`],Hv=[`top`,`bottom`],Uv=[`bottom`,`top`];function Wv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vv:Bv:t?Bv:Vv;case`left`:case`right`:return t?Hv:Uv;default:return[]}}function Gv(e,t,n,r){let i=Mv(e),a=Wv(jv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zv)))),a}function Kv(e){let t=jv(e);return Ov[t]+e.slice(t.length)}function qv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Jv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qv(e)}function Yv(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 Xv(e,t,n){let{reference:r,floating:i}=e,a=Fv(t),o=Iv(t),s=Pv(o),c=jv(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=Mv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Zv(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}=Av(t,e),p=Jv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yv(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=Yv(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 Qv=50,$v=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xv(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<Qv&&(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}=Xv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ey=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}=Av(e,t)||{};if(l==null)return{};let d=Jv(u),f={x:n,y:r},p=Iv(i),m=Pv(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Cv(d[_],T),te=Cv(d[v],T),ne=C-h[m]-te,re=C/2-h[m]/2+w,ie=kv(ee,re,ne),ae=!c.arrow&&Mv(i)!=null&&re!==ie&&a.reference[m]/2-(re<ee?ee:te)-h[m]/2<0,E=ae?re<ee?re-ee:re-ne:0;return{[p]:f[p]+E,data:{[p]:ie,centerOffset:re-ie-E,...ae&&{alignmentOffset:E}},reset:ae}}}),ty=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}=Av(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jv(r),_=Fv(o),v=jv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Kv(o)]:Rv(o)),x=p!==`none`;!d&&x&&b.push(...Gv(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=Lv(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`||_===Fv(t)||T.every(e=>Fv(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=Fv(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{}}}};function ny(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ry(e){return Sv.some(t=>e[t]>=0)}var iy=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Av(e,t);switch(i){case`referenceHidden`:{let e=ny(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ry(e)}}}case`escaped`:{let e=ny(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ry(e)}}}default:return{}}}}},ay=new Set([`left`,`top`]);async function oy(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jv(n),s=Mv(n),c=Fv(n)===`y`,l=ay.has(o)?-1:1,u=a&&c?-1:1,d=Av(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 sy=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 oy(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}}}}},cy=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}=Av(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fv(i),p=Nv(f),m=u[p],h=u[f],g=(e,t)=>kv(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}}}}}},ly=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}=Av(e,t),u={x:n,y:r},d=Fv(i),f=Nv(d),p=u[f],m=u[d],h=Av(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=ay.has(jv(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}}}},uy=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}=Av(e,t),c=await i.detectOverflow(t,s),l=jv(n),u=Mv(n),d=Fv(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=Cv(p-c[m],g),y=Cv(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*wv(c.left,c.right):S=p-2*wv(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 dy(){return typeof window<`u`}function fy(e){return hy(e)?(e.nodeName||``).toLowerCase():`#document`}function py(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function my(e){return((hy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hy(e){return dy()?e instanceof Node||e instanceof py(e).Node:!1}function gy(e){return dy()?e instanceof Element||e instanceof py(e).Element:!1}function _y(e){return dy()?e instanceof HTMLElement||e instanceof py(e).HTMLElement:!1}function vy(e){return!dy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof py(e).ShadowRoot}function yy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ay(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function by(e){return/^(table|td|th)$/.test(fy(e))}function xy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Sy=/transform|translate|scale|rotate|perspective|filter/,Cy=/paint|layout|strict|content/,wy=e=>!!e&&e!==`none`,Ty;function Ey(e){let t=gy(e)?Ay(e):e;return wy(t.transform)||wy(t.translate)||wy(t.scale)||wy(t.rotate)||wy(t.perspective)||!Oy()&&(wy(t.backdropFilter)||wy(t.filter))||Sy.test(t.willChange||``)||Cy.test(t.contain||``)}function Dy(e){let t=My(e);for(;_y(t)&&!ky(t);){if(Ey(t))return t;if(xy(t))return null;t=My(t)}return null}function Oy(){return Ty??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ty}function ky(e){return/^(html|body|#document)$/.test(fy(e))}function Ay(e){return py(e).getComputedStyle(e)}function jy(e){return gy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function My(e){if(fy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vy(e)&&e.host||my(e);return vy(t)?t.host:t}function Ny(e){let t=My(e);return ky(t)?(e.ownerDocument||e).body:_y(t)&&yy(t)?t:Ny(t)}function Py(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ny(e),i=r===e.ownerDocument?.body,a=py(r);if(i){let e=Fy(a);return t.concat(a,a.visualViewport||[],yy(r)?r:[],e&&n?Py(e):[])}return t.concat(r,Py(r,[],n))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Iy(e){let t=Ay(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tv(n)!==a||Tv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ly(e){return gy(e)?e:e.contextElement}function Ry(e){let t=Ly(e);if(!_y(t))return Dv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Iy(t),o=(a?Tv(n.width):n.width)/r,s=(a?Tv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var zy=Dv(0);function By(e){let t=py(e);return!Oy()||!t.visualViewport?zy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vy(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===py(e)}function Hy(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ly(e),o=Dv(1);t&&(r?gy(r)&&(o=Ry(r)):o=Ry(e));let s=Vy(a,n,r)?By(a):Dv(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=py(a),t=gy(r)?py(r):r,n=e,i=Fy(n);for(;i&&t!==n;){let e=Ry(i),t=i.getBoundingClientRect(),r=Ay(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=py(i),i=Fy(n)}}return Yv({width:u,height:d,x:c,y:l})}function Uy(e,t){let n=jy(e).scrollLeft;return t?t.left+n:Hy(my(e)).left+n}function Wy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Uy(e,n),y:n.top+t.scrollTop}}function Gy(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=my(r),s=t?xy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dv(1),u=Dv(0),d=_y(r);if((d||!a)&&((fy(r)!==`body`||yy(o))&&(c=jy(r)),d)){let e=Hy(r);l=Ry(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Wy(o,c):Dv(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 Ky(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function qy(e){let t=jy(e),n=e.ownerDocument.body,r=wv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=wv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Uy(e),o=-t.scrollTop;return Ay(n).direction===`rtl`&&(a+=wv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Jy=25;function Yy(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=py(e),a=my(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Oy()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Uy(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<=Jy&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Xy(e,t){let n=Hy(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ry(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Zy(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Yy(e,n,t);else if(t===`document`)r=qy(my(e));else if(gy(t))r=Xy(t,n);else{let n=By(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yv(r)}function Qy(e,t){let n=t.get(e);if(n)return n;let r=Py(e,[],!1).filter(e=>gy(e)&&fy(e)!==`body`),i=null,a=Ay(e).position===`fixed`,o=a?My(e):e;for(;gy(o)&&!ky(o);){let e=Ay(o),t=Ey(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=My(o)}return t.set(e,r),r}function $y(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xy(t)?[]:Qy(t,this._c):[].concat(n),r],o=Zy(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=Zy(t,a[e],i);s=wv(n.top,s),c=Cv(n.right,c),l=Cv(n.bottom,l),u=wv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function eb(e){let{width:t,height:n}=Iy(e);return{width:t,height:n}}function tb(e,t,n){let r=_y(t),i=my(t),a=n===`fixed`,o=Hy(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dv(0);if((r||!a)&&((fy(t)!==`body`||yy(i))&&(s=jy(t)),r)){let e=Hy(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Uy(i));let l=i&&!r&&!a?Wy(i,s):Dv(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 nb(e){return Ay(e).position===`static`}function rb(e,t){if(!_y(e)||Ay(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return my(e)===n&&(n=n.ownerDocument.body),n}function ib(e,t){let n=py(e);if(xy(e))return n;if(!_y(e)){let t=My(e);for(;t&&!ky(t);){if(gy(t)&&!nb(t))return t;t=My(t)}return n}let r=rb(e,t);for(;r&&by(r)&&nb(r);)r=rb(r,t);return r&&ky(r)&&nb(r)&&!Ey(r)?n:r||Dy(e)||n}var ab=async function(e){let t=this.getOffsetParent||ib,n=this.getDimensions,r=await n(e.floating);return{reference:tb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ob(e){return Ay(e).direction===`rtl`}var sb={convertOffsetParentRelativeRectToViewportRelativeRect:Gy,getDocumentElement:my,getClippingRect:$y,getOffsetParent:ib,getElementRects:ab,getClientRects:Ky,getDimensions:eb,getScale:Ry,isElement:gy,isRTL:ob};function cb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lb(e,t,n){let r=null,i,a=my(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=Ev(d),h=Ev(a.clientWidth-(u+f)),g=Ev(a.clientHeight-(d+p)),_=Ev(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wv(0,Cv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!cb(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=py(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ub(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=Ly(e),u=i||a?[...l?Py(l):[],...t?Py(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?lb(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?Hy(e):null;c&&g();function g(){let t=Hy(e);h&&!cb(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 db=sy,fb=cy,pb=ty,mb=uy,hb=iy,gb=ey,_b=ly,vb=(e,t,n)=>{let r=new Map,i=n??{},a={...sb,...i.platform,_c:r};return $v(e,t,{...i,platform:a})},yb=typeof document<`u`?v.useLayoutEffect:function(){};function bb(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(!bb(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)&&!bb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sb(e,t){let n=xb(e);return Math.round(t*n)/n}function Cb(e){let t=v.useRef(e);return yb(()=>{t.current=e}),t}function wb(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);bb(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),ee=c!=null,te=Cb(c),ne=Cb(i),re=Cb(l),ie=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),vb(C.current,w.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ae.current&&!bb(T.current,t)&&(T.current=t,hm.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);yb(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ae=v.useRef(!1);yb(()=>(ae.current=!0,()=>{ae.current=!1}),[]),yb(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,ie);ie()}},[x,S,ie,te,ee]);let E=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),oe=v.useMemo(()=>({reference:x,floating:S}),[x,S]),se=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=Sb(oe.floating,u.x),r=Sb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xb(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:ie,refs:E,elements:oe,floatingStyles:se}),[u,ie,E,oe,se])}var Tb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:gb({element:r.current,padding:i}).fn(n):r?gb({element:r,padding:i}).fn(n):{}}}},Eb=(e,t)=>{let n=db(e);return{name:n.name,fn:n.fn,options:[e,t]}},Db=(e,t)=>{let n=fb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ob=(e,t)=>({fn:_b(e).fn,options:[e,t]}),kb=(e,t)=>{let n=pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ab=(e,t)=>{let n=mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},jb=(e,t)=>{let n=hb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mb=(e,t)=>{let n=Tb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nb=Object.defineProperty,Pb=v.forwardRef(((e,t)=>Nb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,X.jsx)(vm.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,X.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Fb=Object.defineProperty,Ib=(e,t)=>Fb(e,`name`,{value:t,configurable:!0}),Lb=`Popper`,[Rb,zb]=Dm(Lb),[Bb,Vb]=Rb(Lb),Hb=Ib(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,X.jsx)(Bb,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ub=`PopperAnchor`,Wb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Vb(Ub,n),o=v.useRef(null),s=a.onAnchorChange,c=Xp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ex(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,X.jsx)(vm.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Gb=`PopperContent`,[Kb,qb]=Rb(Gb),Jb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Vb(Gb,n),[_,y]=v.useState(null),b=Xp(t,y),[x,S]=v.useState(null),C=xv(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ne=Array.isArray(l)?l:[l],re=ne.length>0,ie={padding:te,boundary:ne.filter(Qb),altBoundary:re},{refs:ae,floatingStyles:E,placement:oe,isPositioned:se,middlewareData:ce}=wb({strategy:`fixed`,placement:ee,whileElementsMounted:Ib((...e)=>ub(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Eb({mainAxis:i+T,alignmentAxis:o}),c&&Db({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Ob():void 0,...ie}),c&&kb({...ie}),Ab({...ie,apply:Ib(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Mb({element:x,padding:s}),$b({arrowWidth:w,arrowHeight:T}),f&&jb({strategy:`referenceHidden`,...ie,boundary:re?ie.boundary:void 0})]}),D=g.setPlacementState;Ym(()=>(D(oe),()=>{D(void 0)}),[oe,D]);let[le,ue]=ex(oe),de=Wh(m);Ym(()=>{se&&de?.()},[se,de]);let fe=ce.arrow?.x,pe=ce.arrow?.y,me=ce.arrow?.centerOffset!==0,[he,ge]=v.useState();return Ym(()=>{_&&ge(window.getComputedStyle(_).zIndex)},[_]),(0,X.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...E,transform:se?E.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:he,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(` `),...ce.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,X.jsx)(Kb,{scope:n,placedSide:le,placedAlign:ue,onArrowChange:S,arrowX:fe,arrowY:pe,shouldHideArrow:me,children:(0,X.jsx)(vm.div,{"data-side":le,"data-align":ue,...h,ref:b,style:{...h.style,animation:se?h.style?.animation:`none`}})})})},`PopperContent`)),Yb=`PopperArrow`,Xb={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Zb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,...r}=e,i=qb(Yb,n),a=Xb[i.placedSide];return(0,X.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,X.jsx)(Pb,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Qb(e){return e!==null}Ib(Qb,`isNotNull`);var $b=Ib(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ex(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ex(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ib(ex,`getSideAndAlignFromPlacement`);var tx=Hb,nx=Wb,rx=Jb,ix=Zb,ax=Object.defineProperty,ox=(e,t)=>ax(e,`name`,{value:t,configurable:!0}),sx=!1;function cx(){let[e,t]=v.useState(sx);return v.useEffect(()=>{sx||(sx=!0,t(!0))},[]),e}ox(cx,`useIsHydrated`);var lx=v.useSyncExternalStore;function ux(){return()=>{}}ox(ux,`subscribe`);function dx(){return lx(ux,()=>!0,()=>!1)}ox(dx,`useIsHydratedModern`);var fx=typeof lx==`function`?dx:cx,px=Object.defineProperty,mx=(e,t)=>px(e,`name`,{value:t,configurable:!0}),hx=`rovingFocusGroup.onEntryFocus`,gx={bubbles:!1,cancelable:!0},_x=`RovingFocusGroup`,[vx,yx,bx]=jm(_x),[xx,Sx]=Dm(_x,[bx]),[Cx,wx]=xx(_x),Tx=v.forwardRef(mx(function(e,t){return(0,X.jsx)(vx.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,X.jsx)(vx.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,X.jsx)(Ex,{...e,ref:t})})})},`RovingFocusGroup`)),Ex=v.forwardRef(mx(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=Xp(t,f),m=Vh(a),[h,g]=ih({prop:o,defaultProp:s??null,onChange:c,caller:_x}),[_,y]=v.useState(!1),b=Wh(l),x=yx(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(hx,b),()=>e.removeEventListener(hx,b)},[b]),(0,X.jsx)(Cx,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,X.jsx)(vm.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Z(e.onMouseDown,()=>{S.current=!0}),onFocus:Z(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(hx,gx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Mx([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Dx=`RovingFocusGroupItem`,Ox=v.forwardRef(mx(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Sh(),l=a||c,u=wx(Dx,n),d=u.currentTabStopId===l,f=yx(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=fx();return Ym(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,X.jsx)(vx.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,X.jsx)(vm.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Z(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=jx(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Nx(n,r+1):n.slice(r+1)}setTimeout(()=>Mx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),kx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ax(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}mx(Ax,`getDirectionAwareKey`);function jx(e,t,n){let r=Ax(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return kx[r]}mx(jx,`getFocusIntent`);function Mx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}mx(Mx,`focusFirst`);function Nx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}mx(Nx,`wrapArray`);var Px=Tx,Fx=Ox,Ix=Object.defineProperty,Lx=(e,t)=>Ix(e,`name`,{value:t,configurable:!0}),Rx=[`Enter`,` `],zx=[`ArrowDown`,`PageUp`,`Home`],Bx=[`ArrowUp`,`PageDown`,`End`],Vx=[...zx,...Bx];[...Rx],[...Rx];var Hx=`Menu`,[Ux,Wx,Gx]=jm(Hx),[Kx,qx]=Dm(Hx,[Gx,zb,Sx]),Jx=zb(),Yx=Sx(),[Xx,Zx]=Kx(Hx),[Qx,$x]=Kx(Hx),eS=Lx(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Jx(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Wh(a),f=Vh(i);return v.useEffect(()=>{let e=Lx(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Lx(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),v.useEffect(()=>{if(!n)return;let e=Lx(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,X.jsx)(tx,{...s,children:(0,X.jsx)(Xx,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,X.jsx)(Qx,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),tS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,...r}=e,i=Jx(n);return(0,X.jsx)(nx,{...i,...r,ref:t})},`MenuAnchor`)),nS=`MenuPortal`,[rS,iS]=Kx(nS,{forceMount:void 0}),aS=Lx(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Zx(nS,t);return(0,X.jsx)(rS,{scope:t,forceMount:n,children:(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:r})})})},`MenuPortal`),oS=`MenuContent`,[sS,cS]=Kx(oS),lS=v.forwardRef(Lx(function(e,t){let n=iS(oS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Zx(oS,e.__scopeMenu),o=$x(oS,e.__scopeMenu);return(0,X.jsx)(Ux.Provider,{scope:e.__scopeMenu,children:(0,X.jsx)(fh,{present:r||a.open,children:(0,X.jsx)(Ux.Slot,{scope:e.__scopeMenu,children:o.modal?(0,X.jsx)(uS,{...i,ref:t}):(0,X.jsx)(dS,{...i,ref:t})})})})},`MenuContent`)),uS=v.forwardRef(Lx(function(e,t){let n=Zx(oS,e.__scopeMenu),r=v.useRef(null),i=Xp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return W_(e)},[]),(0,X.jsx)(pS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),dS=v.forwardRef(Lx(function(e,t){let n=Zx(oS,e.__scopeMenu);return(0,X.jsx)(pS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),fS=$p(`MenuContent.ScrollLock`),pS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Zx(oS,n),_=$x(oS,n),y=Jx(n),b=Yx(n),x=Wx(n),[S,C]=v.useState(null),w=v.useRef(null),T=Xp(t,w,g.onContentChange),ee=v.useRef(0),te=v.useRef(``),ne=v.useRef(0),re=v.useRef(null),ie=v.useRef(`right`),ae=v.useRef(0),E=m?F_:v.Fragment,oe=m?{as:fS,allowPinchZoom:!0}:void 0,se=Lx(e=>{let t=te.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=MS(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Lx((function e(t){te.current=t,window.clearTimeout(ee.current),t!==``&&(ee.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(ee.current),[]),kg();let ce=v.useCallback(e=>ie.current===re.current?.side&&PS(e,re.current?.area),[]);return(0,X.jsx)(sS,{scope:n,searchRef:te,onItemEnter:v.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:v.useCallback(e=>{ce(e)||(w.current?.focus(),C(null))},[ce]),onTriggerLeave:v.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:v.useCallback(e=>{re.current=e},[]),children:(0,X.jsx)(E,{...oe,children:(0,X.jsx)(ug,{asChild:!0,trapped:i,onMountAutoFocus:Z(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,X.jsx)(Qh,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,X.jsx)(Px,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Z(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,X.jsx)(rx,{role:`menu`,"aria-orientation":`vertical`,"data-state":DS(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:Z(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=w.current;if(e.target!==i||!Vx.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Bx.includes(e.key)&&a.reverse(),AS(a)}),onBlur:Z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(ee.current),te.current=``)}),onPointerMove:Z(e.onPointerMove,FS(e=>{let t=e.target,n=ae.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ae.current?`right`:`left`;ie.current=t,ae.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),mS=`MenuItem`,hS=`menu.itemSelect`,gS=v.forwardRef(Lx(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=$x(mS,e.__scopeMenu),s=cS(mS,e.__scopeMenu),c=Xp(t,a),l=v.useRef(!1),u=Lx(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(hS,{bubbles:!0,cancelable:!0});e.addEventListener(hS,e=>r?.(e),{once:!0}),ym(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,X.jsx)(_S,{...i,ref:c,disabled:n,onClick:Z(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Z(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Rx.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),_S=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=cS(mS,n),s=Yx(n),c=v.useRef(null),l=Xp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,X.jsx)(Ux.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,X.jsx)(Fx,{asChild:!0,...s,focusable:!r,children:(0,X.jsx)(vm.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Z(e.onPointerMove,FS(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,FS(e=>o.onItemLeave(e))),onFocus:Z(e.onFocus,()=>d(!0)),onBlur:Z(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),vS=v.forwardRef(Lx(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,X.jsx)(SS,{scope:e.__scopeMenu,checked:n,children:(0,X.jsx)(gS,{role:`menuitemcheckbox`,"aria-checked":OS(n)?`mixed`:n,...i,ref:t,"data-state":kS(n),onSelect:Z(i.onSelect,()=>r?.(OS(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[yS,bS]=Kx(`MenuRadioGroup`,{value:void 0,onValueChange:Lx(()=>{},`onValueChange`)}),xS=`MenuItemIndicator`,[SS,CS]=Kx(xS,{checked:!1}),wS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=CS(xS,n);return(0,X.jsx)(fh,{present:r||OS(a.checked)||a.checked===!0,children:(0,X.jsx)(vm.span,{...i,ref:t,"data-state":kS(a.checked)})})},`MenuItemIndicator`)),[TS,ES]=Kx(`MenuSub`);function DS(e){return e?`open`:`closed`}Lx(DS,`getOpenState`);function OS(e){return e===`indeterminate`}Lx(OS,`isIndeterminate`);function kS(e){return OS(e)?`indeterminate`:e?`checked`:`unchecked`}Lx(kS,`getCheckedState`);function AS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Lx(AS,`focusFirst`);function jS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Lx(jS,`wrapArray`);function MS(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=jS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Lx(MS,`getNextMatch`);function NS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Lx(NS,`isPointInPolygon`);function PS(e,t){return t?NS({x:e.clientX,y:e.clientY},t):!1}Lx(PS,`isPointerInGraceArea`);function FS(e){return t=>t.pointerType===`mouse`?e(t):void 0}Lx(FS,`whenMouse`);var IS=eS,LS=tS,RS=aS,zS=lS,BS=vS,VS=wS,HS=Object.defineProperty,US=(e,t)=>HS(e,`name`,{value:t,configurable:!0}),WS=`DropdownMenu`,[GS,KS]=Dm(WS,[qx]),qS=qx(),[JS,YS]=GS(WS),XS=US(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=qS(t),l=v.useRef(null),[u,d]=ih({prop:i,defaultProp:a??!1,onChange:o,caller:WS});return(0,X.jsx)(JS,{scope:t,triggerId:Sh(),triggerRef:l,contentId:Sh(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,X.jsx)(IS,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),ZS=`DropdownMenuTrigger`,QS=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=YS(ZS,n),o=qS(n),s=Xp(t,a.triggerRef);return(0,X.jsx)(LS,{asChild:!0,...o,children:(0,X.jsx)(vm.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),$S=US(e=>{let{__scopeDropdownMenu:t,...n}=e,r=qS(t);return(0,X.jsx)(RS,{...r,...n})},`DropdownMenuPortal`),eC=`DropdownMenuContent`,tC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=YS(eC,n),a=qS(n),o=v.useRef(!1);return(0,X.jsx)(zS,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),nC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=qS(n);return(0,X.jsx)(BS,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),rC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=qS(n);return(0,X.jsx)(VS,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),iC=XS,aC=QS,oC=$S,sC=tC,cC=nC,lC=rC,uC=Object.defineProperty,dC=(e,t)=>uC(e,`name`,{value:t,configurable:!0});function fC(e,[t,n]){return Math.min(n,Math.max(t,e))}dC(fC,`clamp`);var pC=Object.defineProperty,mC=(e,t)=>pC(e,`name`,{value:t,configurable:!0});function hC(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}mC(hC,`useStateMachine`);var gC=`ScrollArea`,[_C,vC]=Dm(gC),[yC,bC]=_C(gC),xC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState(null),[p,m]=v.useState(null),[h,g]=v.useState(null),[_,y]=v.useState(0),[b,x]=v.useState(0),[S,C]=v.useState(!1),[w,T]=v.useState(!1),ee=Xp(t,c),te=Vh(i);return(0,X.jsx)(yC,{scope:n,type:r,dir:te,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,X.jsx)(vm.div,{dir:te,...o,ref:ee,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),SC=`ScrollAreaViewport`,CC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=bC(SC,n),s=Xp(t,v.useRef(null),o.onViewportChange);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(wC,{nonce:i}),(0,X.jsx)(vm.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,X.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),wC=v.memo(mC(function({nonce:e}){return(0,X.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),TC=`ScrollAreaScrollbar`,EC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return v.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,X.jsx)(DC,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,X.jsx)(OC,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,X.jsx)(kC,{...r,ref:t,forceMount:n}):i.type===`always`?(0,X.jsx)(AC,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),DC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=mC(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=mC(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,X.jsx)(fh,{present:n||a,children:(0,X.jsx)(kC,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),OC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=XC(()=>c(`SCROLL_END`),100),[s,c]=hC(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return v.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),v.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=mC(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,X.jsx)(fh,{present:n||s!==`hidden`,children:(0,X.jsx)(AC,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Z(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Z(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),kC=v.forwardRef(mC(function(e,t){let n=bC(TC,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=v.useState(!1),s=e.orientation===`horizontal`,c=XC(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return ZC(n.viewport,c),ZC(n.content,c),(0,X.jsx)(fh,{present:r||a,children:(0,X.jsx)(AC,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),AC=v.forwardRef(mC(function(e,t){let{orientation:n=`vertical`,...r}=e,i=bC(TC,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[s,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=UC(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:mC(e=>a.current=e,`onThumbChange`),onThumbPointerUp:mC(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:mC(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return GC(e,o.current,s,t)}return mC(d,`getScrollPosition`),n===`horizontal`?(0,X.jsx)(jC,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=KC(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,X.jsx)(MC,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=KC(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),jC=v.forwardRef(mC(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=bC(TC,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=Xp(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,X.jsx)(FC,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":WC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),JC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:HC(o.paddingLeft),paddingEnd:HC(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),MC=v.forwardRef(mC(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=bC(TC,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=Xp(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,X.jsx)(FC,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":WC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),JC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:HC(o.paddingTop),paddingEnd:HC(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[NC,PC]=_C(TC),FC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=bC(TC,n),[m,h]=v.useState(null),g=Xp(t,h),_=v.useRef(null),y=v.useRef(``),b=p.viewport,x=r.content-r.viewport,S=Wh(u),C=Wh(c),w=XC(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return mC(T,`handleDragScroll`),v.useEffect(()=>{let e=mC(e=>{let t=e.target;m?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),v.useEffect(C,[r,C]),ZC(m,w),ZC(p.content,w),(0,X.jsx)(NC,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Wh(a),onThumbPointerUp:Wh(o),onThumbPositionChange:C,onThumbPointerDown:Wh(s),children:(0,X.jsx)(vm.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Z(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Z(e.onPointerMove,T),onPointerUp:Z(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),IC=`ScrollAreaThumb`,LC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=PC(IC,e.__scopeScrollArea);return(0,X.jsx)(fh,{present:n||i.hasThumb,children:(0,X.jsx)(RC,{ref:t,...r})})},`ScrollAreaThumb`)),RC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=bC(IC,n),o=PC(IC,n),{onThumbPositionChange:s}=o,c=Xp(t,o.onThumbChange),l=v.useRef(void 0),u=XC(()=>{l.current&&=(l.current(),void 0)},100);return v.useEffect(()=>{let e=a.viewport;if(e){let t=mC(()=>{if(u(),!l.current){let t=YC(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,X.jsx)(vm.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Z(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Z(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),zC=`ScrollAreaCorner`,BC=v.forwardRef(mC(function(e,t){let n=bC(zC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,X.jsx)(VC,{...e,ref:t}):null},`ScrollAreaCorner`)),VC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,...r}=e,i=bC(zC,n),[a,o]=v.useState(0),[s,c]=v.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return ZC(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),ZC(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),v.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,X.jsx)(vm.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function HC(e){return e?parseInt(e,10):0}mC(HC,`toInt`);function UC(e,t){let n=e/t;return isNaN(n)?0:n}mC(UC,`getThumbRatio`);function WC(e){let t=UC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}mC(WC,`getThumbSize`);function GC(e,t,n,r=`ltr`){let i=WC(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return qC([c,l],d)(e)}mC(GC,`getScrollPositionFromPointer`);function KC(e,t,n=`ltr`){let r=WC(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=fC(e,n===`ltr`?[0,o]:[o*-1,0]);return qC([0,o],[0,s])(c)}mC(KC,`getThumbOffsetFromScroll`);function qC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}mC(qC,`linearScale`);function JC(e,t){return e>0&&e<t}mC(JC,`isScrollingWithinScrollbarBounds`);var YC=mC((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return mC((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function XC(e,t){let n=Wh(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}mC(XC,`useDebounceCallback`);function ZC(e,t){let n=Wh(t);Ym(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}mC(ZC,`useResizeObserver`);var QC=xC,$C=CC,ew=BC,tw=Object.defineProperty,nw=(e,t)=>tw(e,`name`,{value:t,configurable:!0}),rw=`horizontal`,iw=[`horizontal`,`vertical`],aw=v.forwardRef(nw(function(e,t){let{decorative:n,orientation:r=rw,...i}=e,a=ow(r)?r:rw,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,X.jsx)(vm.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function ow(e){return iw.includes(e)}nw(ow,`isValidOrientation`);var sw=aw,cw=Object.defineProperty,lw=(e,t)=>cw(e,`name`,{value:t,configurable:!0}),uw=`Tabs`,[dw,fw]=Dm(uw,[Sx]),pw=Sx(),[mw,hw]=dw(uw),gw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Vh(s),[d,f]=ih({prop:r,onChange:i,defaultProp:a??``,caller:uw});return(0,X.jsx)(mw,{scope:n,baseId:Sh(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,X.jsx)(vm.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),_w=`TabsList`,vw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=hw(_w,n),o=pw(n);return(0,X.jsx)(Px,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,X.jsx)(vm.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),yw=`TabsTrigger`,bw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=hw(yw,n),s=pw(n),c=Cw(o.baseId,r),l=ww(o.baseId,r),u=r===o.value;return(0,X.jsx)(Fx,{asChild:!0,...s,focusable:!i,active:u,children:(0,X.jsx)(vm.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Z(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Z(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),xw=`TabsContent`,Sw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=hw(xw,n),c=Cw(s.baseId,r),l=ww(s.baseId,r),u=r===s.value,d=v.useRef(u);return v.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,X.jsx)(fh,{present:i||u,children:({present:n})=>(0,X.jsx)(vm.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Cw(e,t){return`${e}-trigger-${t}`}lw(Cw,`makeTriggerId`);function ww(e,t){return`${e}-content-${t}`}lw(ww,`makeContentId`);var Tw=gw,Ew=vw,Dw=bw,Ow=Sw,kw=Object.defineProperty,Aw=(e,t)=>kw(e,`name`,{value:t,configurable:!0}),[jw,Mw]=Dm(`Tooltip`,[zb]),Nw=zb(),Pw=`TooltipProvider`,Fw=700,Iw=`tooltip.open`,[Lw,Rw]=jw(Pw),zw=Aw(e=>{let{__scopeTooltip:t,delayDuration:n=Fw,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,X.jsx)(Lw,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Bw=`Tooltip`,[Vw,Hw]=jw(Bw),Uw=Aw(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Rw(Bw,e.__scopeTooltip),l=Nw(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=Sh(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=ih({prop:r,defaultProp:i??!1,onChange:Aw(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Iw))):c.onClose(),a?.(e)},`onChange`),caller:Bw}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let ee=f??m;return(0,X.jsx)(tx,{...l,children:(0,X.jsx)(Vw,{scope:t,contentId:ee,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Ww=`TooltipTrigger`,Gw=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,...r}=e,i=Hw(Ww,n),a=Rw(Ww,n),o=Nw(n),s=Xp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,X.jsx)(nx,{asChild:!0,...o,children:(0,X.jsx)(vm.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Z(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Z(e.onBlur,i.onClose),onClick:Z(e.onClick,i.onClose)})})},`TooltipTrigger`)),Kw=`TooltipPortal`,[qw,Jw]=jw(Kw,{forceMount:void 0}),Yw=Aw(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Hw(Kw,t);return(0,X.jsx)(qw,{scope:t,forceMount:n,children:(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Xw=`TooltipContent`,Zw=v.forwardRef(Aw(function(e,t){let n=Jw(Xw,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Hw(Xw,e.__scopeTooltip);return(0,X.jsx)(fh,{present:r||o.open,children:o.disableHoverableContent?(0,X.jsx)(eT,{side:i,...a,ref:t}):(0,X.jsx)(Qw,{side:i,...a,ref:t})})},`TooltipContent`)),Qw=v.forwardRef(Aw(function(e,t){let n=Hw(Xw,e.__scopeTooltip),r=Rw(Xw,e.__scopeTooltip),i=v.useRef(null),a=Xp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=rT(r,nT(r,n.getBoundingClientRect())),a=iT(t.getBoundingClientRect()),o=oT([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=Aw(e=>p(e,u),`handleTriggerLeave`),t=Aw(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=Aw(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!aT(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,X.jsx)(eT,{...e,ref:a})},`TooltipContentHoverable`)),$w=nm(`TooltipContent`),eT=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Hw(Xw,n),u=Nw(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(Iw,d),()=>document.removeEventListener(Iw,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=Aw(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ym(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,X.jsx)(Qh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,X.jsxs)(rx,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,X.jsx)($w,{children:r}),i?(0,X.jsx)(Cm,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),tT=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,...r}=e,i=Nw(n);return(0,X.jsx)(ix,{...i,...r,ref:t})},`TooltipArrow`));function nT(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Aw(nT,`getExitSideFromRect`);function rT(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Aw(rT,`getPaddedExitPoints`);function iT(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Aw(iT,`getPointsFromRect`);function aT(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Aw(aT,`isPointInPolygon`);function oT(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),sT(t)}Aw(oT,`getHull`);function sT(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Aw(sT,`getHullPresorted`);var cT=zw,lT=Uw,uT=Gw,dT=Yw,fT=Zw,pT=tT,mT=l(xp(),1);function hT({...e}){return(0,X.jsx)(Lh,{"data-slot":`collapsible`,...e})}function gT({...e}){return(0,X.jsx)(Mh,{"data-slot":`collapsible-trigger`,...e})}function _T({...e}){return(0,X.jsx)(Ph,{"data-slot":`collapsible-content`,...e})}function vT(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vT(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function yT(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vT(e))&&(r&&(r+=` `),r+=t);return r}var bT=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xT=yT,ST=(e,t)=>n=>{if(t?.variants==null)return xT(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bT(t)||bT(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xT(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},CT=768;function wT(){let[e,t]=v.useState(void 0);return v.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<CT)};return e.addEventListener(`change`,n),t(window.innerWidth<CT),()=>e.removeEventListener(`change`,n)},[]),!!e}var TT=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ET=(e,t)=>({classGroupId:e,validator:t}),DT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),OT=`-`,kT=[],AT=`arbitrary..`,jT=e=>{let t=PT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return NT(e);let n=e.split(OT);return MT(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?TT(i,t):t:i||kT}return n[e]||kT}}},MT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=MT(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(OT):e.slice(t).join(OT),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},NT=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?AT+r:void 0})(),PT=e=>{let{theme:t,classGroups:n}=e;return FT(n,t)},FT=(e,t)=>{let n=DT();for(let r in e){let i=e[r];IT(i,n,r,t)}return n},IT=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];LT(i,t,n,r)}},LT=(e,t,n,r)=>{if(typeof e==`string`){RT(e,t,n);return}if(typeof e==`function`){zT(e,t,n,r);return}BT(e,t,n,r)},RT=(e,t,n)=>{let r=e===``?t:VT(t,e);r.classGroupId=n},zT=(e,t,n,r)=>{if(HT(e)){IT(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ET(n,e))},BT=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];IT(o,VT(t,a),n,r)}},VT=(e,t)=>{let n=e,r=t.split(OT),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=DT(),n.nextPart.set(t,i)),n=i}return n},HT=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,UT=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},WT=`!`,GT=`:`,KT=[],qT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),JT=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===GT){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(WT)?(c=s.slice(0,-1),l=!0):s.startsWith(WT)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return qT(t,l,c,u)};if(t){let e=t+GT,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):qT(KT,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},YT=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},XT=e=>({cache:UT(e.cacheSize),parseClassName:JT(e),sortModifiers:YT(e),postfixLookupClassGroupIds:ZT(e),...jT(e)}),ZT=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},QT=/\s+/,$T=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(QT),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+WT:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},eE=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=tE(n))&&(i&&(i+=` `),i+=r);return i},tE=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=tE(e[r]))&&(n&&(n+=` `),n+=t);return n},nE=(e,...t)=>{let n,r,i,a,o=o=>(n=XT(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=$T(e,n);return i(e,a),a};return a=o,(...e)=>a(eE(...e))},rE=[],iE=e=>{let t=t=>t[e]||rE;return t.isThemeGetter=!0,t},aE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,oE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pE=e=>sE.test(e),mE=e=>!!e&&!Number.isNaN(Number(e)),hE=e=>!!e&&Number.isInteger(Number(e)),gE=e=>e.endsWith(`%`)&&mE(e.slice(0,-1)),_E=e=>cE.test(e),vE=()=>!0,yE=e=>lE.test(e)&&!uE.test(e),bE=()=>!1,xE=e=>dE.test(e),SE=e=>fE.test(e),CE=e=>!Q(e)&&!$(e),wE=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),TE=e=>BE(e,WE,bE),Q=e=>aE.test(e),EE=e=>BE(e,GE,yE),DE=e=>BE(e,KE,mE),OE=e=>BE(e,JE,vE),kE=e=>BE(e,qE,bE),AE=e=>BE(e,HE,bE),jE=e=>BE(e,UE,SE),ME=e=>BE(e,YE,xE),$=e=>oE.test(e),NE=e=>VE(e,GE),PE=e=>VE(e,qE),FE=e=>VE(e,HE),IE=e=>VE(e,WE),LE=e=>VE(e,UE),RE=e=>VE(e,YE,!0),zE=e=>VE(e,JE,!0),BE=(e,t,n)=>{let r=aE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},VE=(e,t,n=!1)=>{let r=oE.exec(e);return r?r[1]?t(r[1]):n:!1},HE=e=>e===`position`||e===`percentage`,UE=e=>e===`image`||e===`url`,WE=e=>e===`length`||e===`size`||e===`bg-size`,GE=e=>e===`length`,KE=e=>e===`number`,qE=e=>e===`family-name`,JE=e=>e===`number`||e===`weight`,YE=e=>e===`shadow`,XE=nE(()=>{let e=iE(`color`),t=iE(`font`),n=iE(`text`),r=iE(`font-weight`),i=iE(`tracking`),a=iE(`leading`),o=iE(`breakpoint`),s=iE(`container`),c=iE(`spacing`),l=iE(`radius`),u=iE(`shadow`),d=iE(`inset-shadow`),f=iE(`text-shadow`),p=iE(`drop-shadow`),m=iE(`blur`),h=iE(`perspective`),g=iE(`aspect`),_=iE(`ease`),v=iE(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[pE,`full`,`auto`,...w()],ee=()=>[hE,`none`,`subgrid`,$,Q],te=()=>[`auto`,{span:[`full`,hE,$,Q]},hE,$,Q],ne=()=>[hE,`auto`,$,Q],re=()=>[`auto`,`min`,`max`,`fr`,$,Q],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],E=()=>[`auto`,...w()],oe=()=>[pE,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[pE,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[pE,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,$,Q],le=()=>[...b(),FE,AE,{position:[$,Q]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,IE,TE,{size:[$,Q]}],fe=()=>[gE,NE,EE],pe=()=>[``,`none`,`full`,l,$,Q],me=()=>[``,mE,NE,EE],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[mE,gE,FE,AE],ve=()=>[``,`none`,m,$,Q],ye=()=>[`none`,mE,$,Q],be=()=>[`none`,mE,$,Q],xe=()=>[mE,$,Q],Se=()=>[pE,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[_E],breakpoint:[_E],color:[vE],container:[_E],"drop-shadow":[_E],ease:[`in`,`out`,`in-out`],font:[CE],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[_E],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[_E],shadow:[_E],spacing:[`px`,mE],text:[_E],"text-shadow":[_E],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,pE,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[wE],columns:[{columns:[mE,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[hE,`auto`,$,Q]}],basis:[{basis:[pE,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[mE,pE,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,mE,$,Q]}],shrink:[{shrink:[``,mE,$,Q]}],order:[{order:[hE,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,NE,EE]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,zE,OE]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,gE,Q]}],"font-family":[{font:[PE,kE,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[mE,`none`,$,DE]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[mE,`from-font`,`auto`,$,EE]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[mE,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[hE,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},hE,$,Q],radial:[``,$,Q],conic:[hE,$,Q]},LE,jE]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[mE,$,Q]}],"outline-w":[{outline:[``,mE,NE,EE]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,RE,ME]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,RE,ME]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[mE,EE]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,RE,ME]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[mE,$,Q]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[mE]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[mE]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:ve()}],brightness:[{brightness:[mE,$,Q]}],contrast:[{contrast:[mE,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,RE,ME]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,mE,$,Q]}],"hue-rotate":[{"hue-rotate":[mE,$,Q]}],invert:[{invert:[``,mE,$,Q]}],saturate:[{saturate:[mE,$,Q]}],sepia:[{sepia:[``,mE,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[mE,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[mE,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,mE,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mE,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,mE,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[mE,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[mE,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,mE,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[mE,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[mE,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],zoom:[{zoom:[hE,$,Q]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[mE,NE,EE,DE]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ZE(...e){return XE(yT(e))}var QE=ST(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function $E({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?em:`button`;return(0,X.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:ZE(QE({variant:t,size:n,className:e})),...i})}function eD({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,X.jsx)(sw,{"data-slot":`separator`,decorative:n,orientation:t,className:ZE(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function tD({...e}){return(0,X.jsx)(Q_,{"data-slot":`sheet`,...e})}function nD({...e}){return(0,X.jsx)(nv,{"data-slot":`sheet-portal`,...e})}function rD({className:e,...t}){return(0,X.jsx)(iv,{"data-slot":`sheet-overlay`,className:ZE(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function iD({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,X.jsxs)(nD,{children:[(0,X.jsx)(rD,{}),(0,X.jsxs)(cv,{"data-slot":`sheet-content`,className:ZE(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,X.jsxs)(_v,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,X.jsx)(Gp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function aD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sheet-header`,className:ZE(`flex flex-col gap-1.5 p-4`,e),...t})}function oD({className:e,...t}){return(0,X.jsx)(pv,{"data-slot":`sheet-title`,className:ZE(`font-semibold text-foreground`,e),...t})}function sD({className:e,...t}){return(0,X.jsx)(hv,{"data-slot":`sheet-description`,className:ZE(`text-sm text-muted-foreground`,e),...t})}function cD({delayDuration:e=0,...t}){return(0,X.jsx)(cT,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function lD({...e}){return(0,X.jsx)(lT,{"data-slot":`tooltip`,...e})}function uD({...e}){return(0,X.jsx)(uT,{"data-slot":`tooltip-trigger`,...e})}function dD({className:e,sideOffset:t=0,children:n,...r}){return(0,X.jsx)(dT,{children:(0,X.jsxs)(fT,{"data-slot":`tooltip-content`,sideOffset:t,className:ZE(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,X.jsx)(pT,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var fD=`sidebar_state`,pD=604800,mD=`16rem`,hD=`18rem`,gD=`3rem`,_D=`b`,vD=v.createContext(null);function yD(){let e=v.useContext(vD);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function bD({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=wT(),[c,l]=v.useState(!1),[u,d]=v.useState(e),f=t??u,p=v.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${fD}=${t}; path=/; max-age=${pD}`},[n,f]),m=v.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);v.useEffect(()=>{let e=e=>{e.key===_D&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=v.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,X.jsx)(vD.Provider,{value:g,children:(0,X.jsx)(cD,{delayDuration:0,children:(0,X.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":mD,"--sidebar-width-icon":gD,...i},className:ZE(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})})}function xD({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=yD();return n===`none`?(0,X.jsx)(`div`,{"data-slot":`sidebar`,className:ZE(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,X.jsx)(tD,{open:c,onOpenChange:l,...a,children:(0,X.jsxs)(iD,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":hD},side:e,children:[(0,X.jsxs)(aD,{className:`sr-only`,children:[(0,X.jsx)(oD,{children:`Sidebar`}),(0,X.jsx)(sD,{children:`Displays the mobile sidebar.`})]}),(0,X.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,X.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,X.jsx)(`div`,{"data-slot":`sidebar-gap`,className:ZE(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,X.jsx)(`div`,{"data-slot":`sidebar-container`,className:ZE(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,X.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm`,children:i})})]})}function SD({className:e,onClick:t,...n}){let{toggleSidebar:r}=yD();return(0,X.jsxs)($E,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:ZE(`size-7`,e),onClick:e=>{t?.(e),r()},...n,children:[(0,X.jsx)(Hp,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function CD({className:e,...t}){return(0,X.jsx)(`main`,{"data-slot":`sidebar-inset`,className:ZE(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function wD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:ZE(`flex flex-col gap-2 p-2`,e),...t})}function TD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:ZE(`flex flex-col gap-2 p-2`,e),...t})}function ED({className:e,...t}){return(0,X.jsx)(eD,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:ZE(`mx-2 w-auto bg-sidebar-border`,e),...t})}function DD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:ZE(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function OD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:ZE(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function kD({className:e,asChild:t=!1,...n}){let r=t?em:`div`;return(0,X.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:ZE(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n})}function AD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:ZE(`w-full text-sm`,e),...t})}function jD({className:e,...t}){return(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:ZE(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function MD({className:e,...t}){return(0,X.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:ZE(`group/menu-item relative`,e),...t})}var ND=ST(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function PD({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?em:`button`,{isMobile:c,state:l}=yD(),u=(0,X.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:ZE(ND({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,X.jsxs)(lD,{children:[(0,X.jsx)(uD,{asChild:!0,children:u}),(0,X.jsx)(dD,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function FD({className:e,asChild:t=!1,showOnHover:n=!1,...r}){let i=t?em:`button`;return(0,X.jsx)(i,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:ZE(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function ID({className:e,...t}){return(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:ZE(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function LD({className:e,...t}){return(0,X.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:ZE(`group/menu-sub-item relative`,e),...t})}function RD({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){let a=e?em:`a`;return(0,X.jsx)(a,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:ZE(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}function zD(e){return`/agents/`+encodeURIComponent(e)}function BD(e,t){return zD(e)+`/sessions/`+encodeURIComponent(t)}function VD(e){return e.title?.replace(/\s+/gu,` `).trim()||`New session`}function HD({status:e}){return e===`running`?(0,X.jsx)(Vp,{className:`ml-auto size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-label":`Running`}):e===`waiting`?(0,X.jsx)(`span`,{className:`ml-auto size-1.5 shrink-0 rounded-full bg-amber-500`,"aria-label":`Waiting for input`}):(0,X.jsx)(`span`,{className:`ml-auto size-1.5 shrink-0 rounded-full bg-muted-foreground`,"aria-label":`Idle`})}function UD({session:e,active:t,agentId:n}){let r=VD(e);return(0,X.jsx)(LD,{children:(0,X.jsx)(RD,{asChild:!0,isActive:t,size:`sm`,children:(0,X.jsxs)(zn,{to:BD(n,e.session),title:r,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),(0,X.jsx)(HD,{status:e.status})]})})})}function WD({agent:e,sessions:t,activeAgentId:n,activeSessionId:r}){let i=Dt(),[a,o]=(0,v.useState)(!0);(0,v.useEffect)(()=>{e.id===n&&o(!0)},[e.id,n]);let s=n===e.id&&r!==void 0&&!t.some(e=>e.session===r)?[{session:r,status:`idle`,startedAt:Date.now()},...t]:t;return(0,X.jsx)(hT,{open:a,onOpenChange:o,asChild:!0,children:(0,X.jsxs)(MD,{children:[(0,X.jsx)(PD,{asChild:!0,isActive:e.id===n,tooltip:e.name,children:(0,X.jsxs)(zn,{to:zD(e.id),children:[(0,X.jsx)(Np,{}),(0,X.jsx)(`span`,{children:e.name})]})}),(0,X.jsx)(gT,{asChild:!0,children:(0,X.jsxs)(FD,{className:`data-[state=open]:rotate-90`,children:[(0,X.jsx)(Ip,{}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Toggle `,e.name,` sessions`]})]})}),(0,X.jsxs)(FD,{className:`right-7`,showOnHover:!0,onClick:()=>{i(BD(e.id,crypto.randomUUID()))},children:[(0,X.jsx)(Lp,{}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[`New `,e.name,` session`]})]}),(0,X.jsx)(_T,{children:(0,X.jsx)(ID,{children:s.length===0?(0,X.jsx)(LD,{children:(0,X.jsx)(`span`,{className:`block px-2 py-1 text-xs text-muted-foreground`,children:`No sessions yet`})}):s.map(t=>(0,X.jsx)(UD,{session:t,active:t.session===r,agentId:e.id},t.session))})})]})})}function GD({connection:e}){let t=e.status===`Running`,n=t?`bg-emerald-500`:e.status===`Connecting`?`bg-amber-500`:`bg-muted-foreground`,r=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`size-2 shrink-0 rounded-full `+n}),e.status===`Connecting`?(0,X.jsx)(Vp,{className:`size-3.5 shrink-0 animate-spin`}):t?(0,X.jsx)(Mp,{className:`size-3.5 shrink-0`}):(0,X.jsx)(Wp,{className:`size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`group-data-[collapsible=icon]:hidden`,children:e.status})]});return e.url===void 0?r:(0,X.jsxs)(lD,{children:[(0,X.jsx)(uD,{asChild:!0,children:r}),(0,X.jsx)(dD,{side:`right`,children:e.url})]})}function KD({connection:e,activeAgentId:t,activeSessionId:n}){let r=e.status===`Running`?e.agents.length+` agent`+(e.agents.length===1?``:`s`):`Agent server unavailable`;return(0,X.jsxs)(xD,{collapsible:`icon`,children:[(0,X.jsx)(wD,{children:(0,X.jsx)(jD,{children:(0,X.jsx)(MD,{children:(0,X.jsx)(PD,{size:`lg`,asChild:!0,children:(0,X.jsxs)(zn,{to:`/`,children:[(0,X.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,X.jsx)(`img`,{alt:``,"aria-hidden":!0,className:`size-5 dark:invert`,height:20,src:`/brand/nylorun-mark-white.svg`,width:20})}),(0,X.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,X.jsx)(`span`,{className:`truncate font-medium`,children:`Nylorun`}),(0,X.jsx)(`span`,{className:`truncate text-xs`,children:`Studio`})]})]})})})})}),(0,X.jsx)(DD,{children:(0,X.jsxs)(OD,{children:[(0,X.jsx)(kD,{children:`Agents`}),(0,X.jsx)(AD,{children:(0,X.jsxs)(jD,{children:[e.agents.map(r=>(0,X.jsx)(WD,{agent:r,sessions:e.sessionsByAgent[r.id]??[],activeAgentId:t,activeSessionId:n},r.id)),e.status===`Running`&&e.agents.length===0?(0,X.jsx)(MD,{children:(0,X.jsx)(`span`,{className:`block px-2 py-1 text-sm text-muted-foreground`,children:`No agents exposed`})}):null,e.status===`Connecting`?(0,X.jsx)(MD,{children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2 px-2 py-1 text-sm text-muted-foreground`,children:[(0,X.jsx)(Vp,{className:`size-4 animate-spin`}),`Discovering agents`]})}):null]})})]})}),(0,X.jsxs)(TD,{children:[(0,X.jsx)(ED,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-1.5 text-xs text-sidebar-foreground/70 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Rp,{className:`size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`group-data-[collapsible=icon]:hidden`,children:r})]}),(0,X.jsx)(GD,{connection:e})]})]})]})}function qD({className:e,...t}){return(0,X.jsx)(`textarea`,{"data-slot":`textarea`,className:ZE(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...t})}function JD({value:e,onChange:t,onSubmit:n,attachment:r,onAttachmentChange:i,acceptedTypes:a=[],maxBytes:o,disabled:s=!1,sending:c=!1,placeholder:l,submitLabel:u=`Send message`,autoFocus:d=!1}){let f=(0,v.useRef)(null),[p,m]=(0,v.useState)(),h=s||c,g=i!==void 0&&a.length>0,_=!h&&(e.trim()!==``||r!==void 0),y=e=>{e?.preventDefault(),_&&n()};return(0,X.jsxs)(`form`,{onSubmit:y,children:[r===void 0?null:(0,X.jsxs)(`div`,{className:`mb-2 flex w-fit items-start gap-2 rounded-lg border bg-muted/40 p-1.5`,children:[(0,X.jsx)(`img`,{src:r.previewUrl,alt:`Attached room`,className:`h-16 w-20 rounded object-cover`}),(0,X.jsxs)($E,{type:`button`,size:`icon`,variant:`ghost`,className:`size-6`,disabled:h,onClick:()=>i?.(void 0),children:[(0,X.jsx)(Gp,{className:`size-3.5`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Remove image`})]})]}),(0,X.jsxs)(`div`,{className:`flex items-end gap-2 rounded-xl border bg-muted/40 p-2 focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50`,children:[g?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{ref:f,type:`file`,accept:a.join(`,`),className:`sr-only`,onChange:e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(!a.includes(t.type)){m(`Choose a JPEG, PNG, or WebP image.`);return}if(o!==void 0&&t.size>o){m(`Images must be no larger than ${Math.floor(o/1048576)} MiB.`);return}let n=new FileReader;n.onerror=()=>m(`Studio could not read that image.`),n.onload=()=>{let e=typeof n.result==`string`?n.result:``,r=`data:${t.type};base64,`;if(!e.startsWith(r)){m(`Studio could not encode that image.`);return}m(void 0),i?.({mediaType:t.type,base64:e.slice(r.length),previewUrl:e})},n.readAsDataURL(t)},disabled:h}),(0,X.jsxs)($E,{type:`button`,size:`icon`,variant:`ghost`,className:`mb-0.5 shrink-0`,disabled:h,onClick:()=>f.current?.click(),children:[(0,X.jsx)(Bp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Attach image`})]})]}):null,(0,X.jsx)(qD,{value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.keyCode===229||(e.preventDefault(),y())},disabled:h,placeholder:l,autoFocus:d,rows:1,className:`min-h-12 max-h-40 flex-1 resize-none overflow-y-auto border-0 bg-transparent py-1.5 shadow-none focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`}),(0,X.jsxs)($E,{type:`submit`,size:`icon`,disabled:!_,className:`mb-0.5 shrink-0`,"aria-busy":c,children:[c?(0,X.jsx)(Vp,{className:`size-4 animate-spin`}):(0,X.jsx)(Up,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:u})]})]}),p===void 0?null:(0,X.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-[11px] text-destructive`,children:p}),(0,X.jsx)(`p`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:`Enter to send · Shift+Enter for a new line`})]})}var YD=ST(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function XD({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?em:`span`;return(0,X.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:ZE(YD({variant:t}),e),...r})}function ZD(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function QD(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function $D(e){return e/100*window.innerHeight}function eO(e){return e/100*window.innerWidth}function tO(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function nO({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=tO(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=QD(t,i);break;case`em`:r=ZD(t,i);break;case`vh`:r=$D(i);break;case`vw`:r=eO(i)}return r}function rO(e){return parseFloat(e.toFixed(3))}function iO({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function aO(e){let{panels:t}=e,n=iO({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=rO(nO({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=rO(nO({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=rO(nO({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=rO(nO({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function oO(e,t=`Assertion error`){if(!e)throw Error(t)}function sO(e,t){return Array.from(t).sort(e===`horizontal`?cO:lO)}function cO(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function lO(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function uO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function dO(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function fO({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=dO(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return oO(i,`No rect found`),i}var pO;function mO(){return pO===void 0&&(pO=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),pO}function hO(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=sO(n,Array.from(t.children).filter(uO).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,fO({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=mO()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:iO({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var gO=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},_O={cursorFlags:0,state:`inactive`},vO=new gO;function yO(){return _O}function bO(e){return vO.addListener(`change`,e)}function xO(e){let t=_O,n={..._O};n.cursorFlags=e,_O=n,vO.emit(`change`,{prev:t,next:n})}function SO(e){let t=_O;_O=e,vO.emit(`change`,{prev:t,next:e})}var CO=e=>e,wO=()=>{},TO=1,EO=2,DO=4,OO=8,kO=3,AO=12,jO;function MO(){return jO===void 0&&(jO=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(jO=!0)),jO}function NO({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&MO()){let t=(e&TO)!==0,n=(e&EO)!==0,r=(e&DO)!==0,i=(e&OO)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return MO()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var PO=new WeakMap;function FO(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=PO.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=yO();switch(r.state){case`active`:case`hover`:{let e=NO({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}PO.set(e,{prevStyle:t,styleSheet:n})}var IO=new Map,LO=new gO;function RO(e){IO=new Map(IO),IO.delete(e)}function zO(e,t){for(let[t]of IO)if(t.id===e)return t}function BO(e,t){for(let[t,n]of IO)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function VO(){return IO}function HO(e,t){return LO.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function UO(e,t,n){let r=IO.get(e);IO=new Map(IO),IO.set(e,t),LO.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function WO(e){let t=yO(),n=VO(),r=!1;return t.state===`active`&&(SO({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(FO(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=BO(e.group.id,!0);UO(e.group,t,{isUserInteraction:!0})}))),r}function GO(e){e.defaultPrevented||WO(e.currentTarget)}function KO(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=dO(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function qO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function JO(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:ek(e),b:ek(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();oO(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:$O(QO(n.a)),b:$O(QO(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var YO=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function XO(e){let t=getComputedStyle(tk(e)??e).display;return t===`flex`||t===`inline-flex`}function ZO(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||XO(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||YO.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function QO(e){let t=e.length;for(;t--;){let n=e[t];if(oO(n,`Missing node`),ZO(n))return n}return null}function $O(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ek(e){let t=[];for(;e;)t.push(e),e=tk(e);return t}function tk(e){let{parentNode:t}=e;return qO(t)?t.host:t}function nk(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rk({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!uO(n)||n.contains(e)||e.contains(n))return!0;if(JO(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(nk(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ik(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=hO(r),a=KO(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&rk({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function ak(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ok(e,t,n=0){return Math.abs(rO(e)-rO(t))<=n}function sk(e,t){return ok(e,t)?0:e>t?1:-1}function ck({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(sk(r,c)<0){if(a){let e=(i+c)/2;r=sk(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=rO(r),r}function lk({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ok(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;oO(u!=null,`Invalid first pivot index`),oO(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];oO(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(oO(n!=null,`Previous layout not found for panel index ${t}`),ok(n,i)){let t=o-n;sk(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];oO(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(oO(n!=null,`Previous layout not found for panel index ${t}`),ok(n,o)){let t=n-i;sk(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];oO(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&sk(i,c)<0){if(e>0){let t=c-o,n=t/2;sk(i+e,c)<0&&(e=sk(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;sk(i-e,c)<0&&(e=sk(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];oO(e!=null,`Previous layout not found for panel index ${r}`);let a=ck({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];oO(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=ck({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!ok(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(ak(c,l))return i;{let t=e<0?d:u,r=s[t];oO(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=ck({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!ok(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];oO(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=ck({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(ok(i,s)||(t-=s-i,l[r]=s),ok(t,0))break;e>0?r--:r++}}}if(!ok(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function uk(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||sk(e[n],t[n])!==0)return!1;return!0}function dk({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!ok(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];oO(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];oO(i!=null,`No layout data found for index ${e}`);let o=r[e];oO(o!=null,`No layout data found for index ${e}`);let s=ck({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!ok(a,0))for(let e=0;e<t.length;e++){let n=r[e];oO(n!=null,`No layout data found for index ${e}`);let i=n+a,o=ck({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,ok(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function fk({groupId:e,panelId:t}){let n=()=>{let t=VO();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&ok(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:rO(100-e)}}return lk({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=dk({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});uk(c,u)||UO(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&ok(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=iO({group:t}),o=rO(nO({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function pk(e){e.defaultPrevented||ik(e,VO()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=fk({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function mk(e){let t=VO();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function hk({groupId:e}){let t=()=>{let t=VO();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=dk({layout:e,panelConstraints:r});return n?o:(uk(o,c)||UO(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function gk(e,t){let n=mk(e),r=BO(n.id,!0),i=n.separators.find(t=>t.element===e);oO(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);oO(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=hk({groupId:n.id}).getLayout(),c=dk({layout:lk({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});uk(s,c)||UO(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function _k(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=mk(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&gk(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&gk(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&gk(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&gk(t,-5);break;case`End`:e.preventDefault(),gk(t,100);break;case`Enter`:{e.preventDefault();let n=mk(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=BO(n.id,!0),o=n.separators.find(e=>e.element===t);oO(o,`Matching separator not found`);let s=a.get(o);oO(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(oO(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];gk(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=mk(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);oO(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),gk(t,-100)}}function vk(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=VO(),n=ik(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),SO({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function yk({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=lk({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(uk(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?TO:EO;break;case`vertical`:s|=d<0?DO:OO}}else UO(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&kO:c|=s&kO,t.movementY===0?c|=o&AO:c|=s&AO,xO(c),FO(e)}function bk(e){let t=VO(),n=yO();n.state===`active`&&yk({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function xk(e){if(e.defaultPrevented)return;let t=yO(),n=VO();switch(t.state){case`active`:if(e.buttons===0){SO({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=BO(e.group.id,!0);UO(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}yk({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ik(e,n);r.length===0?t.state!==`inactive`&&SO({cursorFlags:0,state:`inactive`}):SO({cursorFlags:0,hitRegions:r,state:`hover`}),FO(e.currentTarget);break}}}function Sk(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(yO().state){case`hover`:SO({cursorFlags:0,state:`inactive`})}}function Ck(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||WO(e.currentTarget)&&e.preventDefault()}function wk(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=rO(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=rO((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Tk(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=iO({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:rO(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Ek(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Dk(e,t){return e.length===t.length&&e.every((e,n)=>Ek(e,t[n]))}function Ok({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=rO(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=rO((r[e]??0)/a*l);else{let e=rO(l/c.length);for(let t of c)u[t]=e}return u}function kk(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Ak=new Map;function jk(e){let t=!0;oO(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=iO({group:e});if(t===0)return;let n=BO(e.id);if(!n)return;let r=aO(e),i=n.defaultLayoutDeferred?wk(r):n.layout,a=dk({layout:Ok({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&uk(n.layout,a)&&Dk(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;UO(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Tk(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{oO(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=iO({group:e}),s=aO(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(kk(e.panels,l)||(l=void 0));let u=dk({layout:e.mutableState.layouts[c]??l??wk(s),panelConstraints:s}),d=e.element.ownerDocument;Ak.set(d,(Ak.get(d)??0)+1);let f=new Map;return hO(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),UO(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{oO(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,_k)}),Ak.get(d)===1&&(d.addEventListener(`contextmenu`,GO,!0),d.addEventListener(`dblclick`,pk,!0),d.addEventListener(`pointerdown`,vk,!0),d.addEventListener(`pointerleave`,bk),d.addEventListener(`pointermove`,xk),d.addEventListener(`pointerout`,Sk),d.addEventListener(`pointerup`,Ck,!0)),function(){t=!1,Ak.set(d,Math.max(0,(Ak.get(d)??0)-1)),RO(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,_k)}),Ak.get(d)||(d.removeEventListener(`contextmenu`,GO,!0),d.removeEventListener(`dblclick`,pk,!0),d.removeEventListener(`pointerdown`,vk,!0),d.removeEventListener(`pointerleave`,bk),d.removeEventListener(`pointermove`,xk),d.removeEventListener(`pointerout`,Sk),d.removeEventListener(`pointerup`,Ck,!0)),a.disconnect()}}function Mk(){let[e,t]=(0,v.useState)({});return[e,(0,v.useCallback)(()=>t({}),[])]}function Nk(e){let t=(0,v.useId)();return`${e??t}`}var Pk=typeof window<`u`?v.useLayoutEffect:v.useEffect;function Fk(e){let t=(0,v.useRef)(e);return Pk(()=>{t.current=e},[e]),(0,v.useCallback)((...e)=>t.current?.(...e),[t])}function Ik(...e){return Fk(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function Lk(e){let t=(0,v.useRef)({...e});return Pk(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Rk=(0,v.createContext)(null);function zk(e,t){let n=(0,v.useRef)({getLayout:()=>({}),setLayout:CO});(0,v.useImperativeHandle)(t,()=>n.current,[]),Pk(()=>{Object.assign(n.current,hk({groupId:e}))})}function Bk({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,v.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Fk(e=>{uk(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Fk((e,t)=>{uk(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=Nk(s),y=(0,v.useRef)(null),[b,x]=Mk(),S=(0,v.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=Ik(y,a);zk(_,o);let w=Fk((e,t)=>{let r=yO(),i=zO(e),a=BO(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=Lk({defaultLayout:n,disableCursor:r}),ee=(0,v.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=sO(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=sO(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=zO(_),i=BO(_);r&&i&&UO(r,{...i,derivedPanelConstraints:aO(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,x,u,T]),te=(0,v.useRef)(null);return Pk(()=>{let e=y.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};te.current=r;let a=jk(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=BO(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=HO(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=ok(t.collapsedSize,i[t.panelId]),a=ok(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=yO().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{te.current=null,a(),l()}},[i,_,g,h,u,b,T]),(0,v.useEffect)(()=>{let e=te.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,X.jsx)(Rk.Provider,{value:ee,children:(0,X.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}Bk.displayName=`Group`;function Vk(){let e=(0,v.useContext)(Rk);return oO(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Hk(e,t){let{id:n}=Vk(),r=(0,v.useRef)({collapse:wO,expand:wO,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:wO});(0,v.useImperativeHandle)(t,()=>r.current,[]),Pk(()=>{Object.assign(r.current,fk({groupId:n,panelId:e}))})}function Uk({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Nk(c),_=Lk({disabled:a}),y=(0,v.useRef)(null),b=Ik(y,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=Vk(),ee=d!==null,te=Fk((e,t,n)=>{d?.(e,c,n)});Pk(()=>{let e=y.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:ee?te:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return w(t)}},[s,n,r,i,ee,g,h,l,u,te,w,_]),(0,v.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),Hk(g,f);let ne=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},re=(0,v.useSyncExternalStore)(e=>HO(S,e),ne,ne),ie;return ie=re?JSON.parse(re):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,X.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:b,style:{...Wk,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...ie},children:(0,X.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}Uk.displayName=`Panel`;var Wk={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Gk({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=dk({layout:lk({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=dk({layout:lk({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Kk({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Nk(a),l=Lk({disabled:n,disableDoubleClick:r}),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)(`inactive`),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(null),_=Ik(g,i),{disableCursor:y,id:b,orientation:x,registerSeparator:S,updateSeparatorProps:C}=Vk(),w=x===`horizontal`?`vertical`:`horizontal`;Pk(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=S(t),r=bO(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=HO(b,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Gk({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[b,c,S,l]),(0,v.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!y&&(T=`not-allowed`);let ee;if(n)ee=`disabled`;else switch(f){case`active`:ee=`active`;break;default:ee=m?`focus`:f}return(0,X.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":ee,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Kk.displayName=`Separator`;function qk({className:e,...t}){return(0,X.jsx)(Bk,{"data-slot":`resizable-panel-group`,className:ZE(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function Jk({className:e,...t}){return(0,X.jsx)(Uk,{"data-slot":`resizable-panel`,className:ZE(`flex min-h-0 flex-col overflow-hidden`,e),...t})}function Yk({withHandle:e,className:t,...n}){return(0,X.jsx)(Kk,{"data-slot":`resizable-handle`,className:ZE(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,X.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,X.jsx)(zp,{className:`size-2.5`})})})}function Xk({className:e,children:t,...n}){return(0,X.jsxs)(QC,{"data-slot":`scroll-area`,className:ZE(`relative min-h-0 overflow-hidden`,e),...n,children:[(0,X.jsx)($C,{"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:min-w-0 [&>div]:max-w-full`,children:t}),(0,X.jsx)(Zk,{}),(0,X.jsx)(ew,{})]})}function Zk({className:e,orientation:t=`vertical`,...n}){return(0,X.jsx)(EC,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:ZE(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,X.jsx)(LC,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function Qk({...e}){return(0,X.jsx)(iC,{"data-slot":`dropdown-menu`,...e})}function $k({...e}){return(0,X.jsx)(aC,{"data-slot":`dropdown-menu-trigger`,...e})}function eA({className:e,sideOffset:t=4,...n}){return(0,X.jsx)(oC,{children:(0,X.jsx)(sC,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:ZE(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function tA({className:e,children:t,checked:n,onSelect:r,...i}){return(0,X.jsxs)(cC,{"data-slot":`dropdown-menu-checkbox-item`,className:ZE(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,onSelect:e=>{e.preventDefault(),r?.(e)},...i,children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(lC,{children:(0,X.jsx)(Pp,{className:`size-4`})})}),t]})}function nA({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,X.jsx)(`table`,{"data-slot":`table`,className:ZE(`w-full caption-bottom text-sm`,e),...t})})}function rA({className:e,...t}){return(0,X.jsx)(`thead`,{"data-slot":`table-header`,className:ZE(`[&_tr]:border-b`,e),...t})}function iA({className:e,...t}){return(0,X.jsx)(`tbody`,{"data-slot":`table-body`,className:ZE(`[&_tr:last-child]:border-0`,e),...t})}function aA({className:e,...t}){return(0,X.jsx)(`tr`,{"data-slot":`table-row`,className:ZE(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function oA({className:e,...t}){return(0,X.jsx)(`th`,{"data-slot":`table-head`,className:ZE(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function sA({className:e,...t}){return(0,X.jsx)(`td`,{"data-slot":`table-cell`,className:ZE(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function cA(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`nylo-studio.config.json must contain an object.`);let n=e.agentServerUrl;if(n===void 0)return Object.freeze({});if(typeof n!=`string`)throw Error(`agentServerUrl must be a string.`);let r;try{r=new URL(n)}catch{throw Error(`agentServerUrl must be an absolute http(s) URL.`)}if(r.protocol!==`http:`&&r.protocol!==`https:`)throw Error(`agentServerUrl must use http or https.`);if(r.username!==``||r.password!==``||r.search!==``||r.hash!==``)throw Error(`agentServerUrl must not contain credentials, a query string, or a fragment.`);if(t===`https:`&&r.protocol===`http:`)throw Error(`An HTTPS Studio cannot connect to an HTTP Agent Server. Serve the Agent Server over HTTPS.`);return Object.freeze({agentServerUrl:r.href.replace(/\/$/u,``)})}async function lA(e=fetch,t=document.baseURI){let n=new URL(t),r=await e(new URL(`/nylo-studio.config.json`,n.origin));if(!r.ok)throw Error(`Could not load nylo-studio.config.json (${r.status}).`);return cA(await r.json(),new URL(t).protocol)}function uA(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function dA(e,t){return typeof e==`string`&&e!==``?e:t}function fA(e){if(typeof e==`string`)return e.length>140?`${e.slice(0,137)}…`:e;try{let t=JSON.stringify(e);return t.length>140?`${t.slice(0,137)}…`:t}catch{return`Result is not serializable.`}}function pA(e){switch(e.type){case`model.requested`:return`Model requested`;case`model.completed`:return`Model completed`;case`model.deferred`:return`Model deferred`;case`model.call`:return`Model response`;case`tool.started`:return`Tool started`;case`tool.completed`:return`Tool completed`;case`tool.deferred`:return`Tool deferred`;case`interaction.required`:return uA(uA(e.payload).interaction).kind===`response`?`Response required`:`Approval required`;case`session.run.started`:return`Session input received`;case`final`:return`Final answer`;case`error`:return`Run failed`;default:return e.type.replaceAll(`.`,` `)}}function mA(e){let t=e.payload;if(e.type.startsWith(`tool.`)){let n=dA(t.toolName,`tool`);if(e.type===`tool.completed`){let e=uA(t.attributes);return e.kind===`failed`?`${n}: ${dA(e.message,dA(t.code,`failed`))}`:`${n}: ${fA(e.output??e.kind??t.outcome)}`}return n}return e.type===`interaction.required`?dA(uA(t.interaction).prompt,`A response is required before this work can continue.`):e.type===`final`?fA(t.output):e.type===`error`?dA(t.message,`The run failed.`):e.type===`model.requested`?dA(t.requestedModelId,`Preparing a model request.`):e.type===`model.completed`?`Candidate received.`:e.type===`session.run.started`&&t.input_kind===`approve`?t.approved===!0?`Approval granted.`:`Approval denied.`:e.type===`session.run.started`&&t.input_kind===`respond`?`Response submitted.`:e.type===`middleware.entered`||e.type===`middleware.completed`?dA(t.middlewareId,`middleware`):e.type===`middleware.lease-violation`?`${dA(t.middlewareId,`middleware`)}: ${dA(t.reason,`lease violated`)}`:`Canonical agent event.`}function hA(e,t){return new URL(t,e+`/`).toString()}function gA(e){return e.length>12?e.slice(0,8)+`…`+e.slice(-4):e}function _A(e){return e===void 0?`—`:(0,mT.default)(e).format(`HH:mm:ss`)}function vA(e){try{return JSON.stringify(e,null,2)}catch{return`Unserializable value`}}function yA(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function bA(e){if(e.type!==`model.requested`)return;let t=yA(yA(e.payload).digests);if([`prompt`,`tools`,`model`,`output`,`configuration`,`context`].every(e=>typeof t[e]==`string`&&/^[a-f0-9]{64}$/u.test(t[e])))return t}function xA(e,t){return e instanceof TypeError&&e.message===`Failed to fetch`?`Studio could not reach the agent server. Confirm it is running, then retry.`:e instanceof Error?e.message:t}function SA(e){return`/agents/`+encodeURIComponent(e)}function CA(e,t){return SA(e)+`/sessions/`+encodeURIComponent(t)}function wA(e){return typeof e==`string`?[{type:`text`,text:e}]:[{type:`json`,value:e}]}function TA(){let[e,t]=(0,v.useState)({status:`Connecting`,agents:[],sessionsByAgent:{}});return(0,v.useEffect)(()=>{let e=!1,n=async()=>{try{let n=await lA();if(n.agentServerUrl===void 0)throw Error(`No Agent Server URL configured.`);let r=await fetch(hA(n.agentServerUrl,`/v1/agents`),{cache:`no-store`});if(!r.ok)throw Error(`Agent Server returned `+r.status+`.`);let i=await r.json();if(!b(i))throw Error(`Unsupported Studio discovery document.`);let a=await Promise.all(i.agents.map(async e=>{let t=await fetch(hA(n.agentServerUrl,e.manifestUrl),{cache:`no-store`});if(!t.ok)throw Error(`Manifest for `+e.id+` returned `+t.status+`.`);let r=await t.json();return{...r,endpoints:{agUi:hA(n.agentServerUrl,r.endpoints.agUi),sessions:hA(n.agentServerUrl,r.endpoints.sessions)}}}));e||t(e=>({status:`Running`,url:n.agentServerUrl,setup:i.setup?.state===`required`?i.setup:void 0,agents:a,sessionsByAgent:e.sessionsByAgent}))}catch{e||t(e=>({...e,status:`Offline`}))}};n();let r=window.setInterval(()=>void n(),2e3);return()=>{e=!0,window.clearInterval(r)}},[]),(0,v.useEffect)(()=>{if(e.status!==`Running`||e.agents.length===0)return;let n=!1,r=async()=>{let r=await Promise.all(e.agents.map(async e=>{try{let t=await fetch(e.endpoints.sessions,{cache:`no-store`});if(!t.ok)return[e.id,void 0];let n=await t.json();return[e.id,[...n.sessions].sort((e,t)=>t.startedAt-e.startedAt)]}catch{return[e.id,void 0]}}));n||t(e=>{let t={...e.sessionsByAgent};for(let[e,n]of r)n!==void 0&&(t[e]=n);return{...e,sessionsByAgent:t}})};r();let i=window.setInterval(()=>void r(),2e3);return()=>{n=!0,window.clearInterval(i)}},[e.status,e.agents]),e}function EA({title:e,detail:t,action:n}){return(0,X.jsxs)(`div`,{className:`relative grid h-full min-h-52 place-items-center p-8 text-center`,children:[(0,X.jsx)(`div`,{className:`absolute left-2 top-2`,children:(0,X.jsx)(SD,{})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`font-medium`,children:e}),(0,X.jsx)(`p`,{className:`mt-1 max-w-md text-sm text-muted-foreground`,children:t}),n===void 0?null:(0,X.jsx)(`div`,{className:`mt-4 flex justify-center`,children:n})]})]})}function DA({values:e}){return(0,X.jsx)(`p`,{className:`text-sm`,children:e.length===0?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`None declared`}):e.join(`, `)})}function OA(){return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`None declared`})}function kA(e){return e.find(e=>e.id===`agent`)?.instructions??[]}function AA({values:e}){return e.length===0?(0,X.jsx)(`p`,{className:`mt-2 text-sm`,children:(0,X.jsx)(OA,{})}):(0,X.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.map((e,t)=>(0,X.jsx)(`p`,{className:`whitespace-pre-wrap text-sm`,children:e},t))})}function jA({tools:e}){return e.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),e.description===void 0?null:(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,e.description]})]},e.name))})}function MA({model:e}){if(e===void 0)return(0,X.jsx)(OA,{});let t=[e.id,e.controls?.temperature===void 0?void 0:`temperature ${e.controls.temperature}`,e.controls?.maxOutputTokens===void 0?void 0:`max ${e.controls.maxOutputTokens}`].filter(e=>e!==void 0);return t.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`span`,{children:t.join(` · `)})}function NA({agent:e,sessionId:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(),g=(0,v.useRef)(null);(0,v.useEffect)(()=>{let n=!1,i=async()=>{let i=await fetch(e.endpoints.agUi.replace(/\/$/u,``)+`/sessions/`+encodeURIComponent(t),{cache:`no-store`});i.ok&&!n&&r((await i.json()).messages);let a=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{cache:`no-store`});a.ok&&!n&&l((await a.json()).pending_interaction)};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.agUi,e.endpoints.sessions,t]),(0,v.useEffect)(()=>{f&&g.current?.scrollIntoView({block:`end`})},[n,f]);let _=async()=>{if(!i.trim()&&o===void 0||f)return;let n=i.trim(),c=o,l=[...n===``?[]:[{type:`text`,text:n}],...c===void 0?[]:[{type:`image`,source:{type:`data`,value:c.base64,mimeType:c.mediaType}}]];a(``),s(void 0),p(!0),h(void 0),r(e=>[...e,{id:crypto.randomUUID(),role:`user`,content:[...n===``?[]:[{type:`text`,text:n}],...c===void 0?[]:[{type:`image`,url:c.previewUrl,mediaType:c.mediaType}]]}]);try{let n=new bp({url:e.endpoints.agUi,threadId:t});n.addMessage({id:crypto.randomUUID(),role:`user`,content:l}),await n.runAgent({runId:crypto.randomUUID()},{onNewMessage:({message:e})=>{let t=e;r(e=>[...e,{id:t.id??crypto.randomUUID(),role:t.role??`assistant`,content:wA(t.content)}])}})}catch(e){h(xA(e,`Agent request failed.`))}finally{p(!1)}},y=async(n,r)=>{if(c!==void 0){p(!0);try{let i=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({interaction:{id:c.id,...n}})});if(!i.ok)throw Error(r+` returned `+i.status+`.`);l(void 0),d(``)}catch(e){h(xA(e,r+` failed.`))}finally{p(!1)}}};return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b bg-background px-3`,children:[(0,X.jsx)(SD,{className:`-ml-0.5`}),(0,X.jsx)(`h1`,{className:`min-w-0 truncate text-sm font-medium`,children:e.name}),(0,X.jsx)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:gA(t)})]}),(0,X.jsx)(Xk,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[n.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start the conversation to run this session.`}):n.map(t=>(0,X.jsxs)(`article`,{className:`max-w-3xl rounded-lg px-4 py-3 text-sm `+(t.role===`user`?`ml-auto bg-primary text-primary-foreground`:`bg-muted`),children:[(0,X.jsx)(`p`,{className:`mb-1 text-xs opacity-70`,children:t.role}),t.content.map((t,n)=>t.type===`text`?(0,X.jsx)(`p`,{className:`whitespace-pre-wrap`,children:t.text},n):t.type===`image`?(0,X.jsx)(`img`,{src:new URL(t.url,e.endpoints.agUi).toString(),alt:`Shared image`,className:`max-h-96 rounded-md object-contain`},n):(0,X.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap rounded bg-background/60 p-2 text-xs`,children:vA(t.value)},n))]},t.id)),c!==void 0&&(0,X.jsxs)(`section`,{className:`rounded-lg border border-amber-400/50 bg-amber-50 p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:c.kind===`response`?`Response required`:`Approval required`}),(0,X.jsx)(`p`,{className:`mt-1`,children:c.prompt}),c.kind===`response`?(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(JD,{value:u,onChange:d,onSubmit:()=>void y({kind:`respond`,value:u.trim()},`Reply`),sending:f,placeholder:`Your reply…`,submitLabel:`Send reply`})}):(0,X.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,X.jsx)($E,{size:`sm`,onClick:()=>void y({kind:`approval`,approved:!0},`Approval`),children:`Approve`}),(0,X.jsx)($E,{size:`sm`,variant:`outline`,onClick:()=>void y({kind:`approval`,approved:!1},`Approval`),children:`Deny`})]})]}),m!==void 0&&(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:m}),(0,X.jsx)(`div`,{ref:g})]})}),(0,X.jsx)(`div`,{className:`shrink-0 border-t bg-background p-3`,children:(0,X.jsx)(JD,{value:i,onChange:a,onSubmit:()=>void _(),attachment:o,onAttachmentChange:s,acceptedTypes:e.mediaInput?.acceptedTypes,maxBytes:e.mediaInput?.maxBytes,disabled:c!==void 0,sending:f,placeholder:`Message the agent…`,autoFocus:!0})})]})}function PA({agent:e}){let t=x(e),n=kA(t),r=t.filter(e=>e.id!==`agent`);return(0,X.jsx)(Xk,{className:`h-full`,children:(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`ID`}),(0,X.jsx)(`p`,{className:`mt-2 font-mono text-xs`,children:e.id})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Name`}),(0,X.jsx)(`p`,{className:`mt-2 text-sm`,children:e.name})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Instructions`}),(0,X.jsx)(AA,{values:n})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Middleware`}),(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(DA,{values:r.map(e=>e.id)})})]}),r.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`font-mono text-sm font-medium`,children:e.id}),(0,X.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Instructions`}),(0,X.jsx)(`dd`,{children:e.instructions===void 0||e.instructions.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`div`,{className:`space-y-1`,children:e.instructions.map((e,t)=>(0,X.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e},t))})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Tools`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(jA,{tools:e.tools??[]})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Context`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(OA,{})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Model`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(MA,{model:e.model})})]})]})]},e.id))]})})}function FA({events:e,selected:t,onSelect:n}){let[r,i]=(0,v.useState)(),a=(0,v.useMemo)(()=>[...new Set(e.map(e=>e.type))].sort(),[e]),o=r??a,s=r===void 0?e:e.filter(e=>r.includes(e.type)),c=r===void 0||r.length===a.length?`All event types`:r.length===0?`No event types`:r.length===1?pA({type:r[0]}):r.length+` event types`,l=(e,t)=>{i(n=>{let r=(n??a).filter(t=>t!==e);return t&&r.push(e),r.length===a.length&&a.every(e=>r.includes(e))?void 0:r})};return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-3 border-b bg-background px-4`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-medium`,children:`Events`}),(0,X.jsxs)(Qk,{children:[(0,X.jsx)($k,{asChild:!0,children:(0,X.jsxs)($E,{variant:`outline`,size:`sm`,className:`ml-auto w-44 justify-between font-normal`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:c}),(0,X.jsx)(Fp,{className:`size-4 opacity-50`})]})}),(0,X.jsx)(eA,{align:`end`,className:`w-56`,children:a.length===0?(0,X.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,children:`No event types yet`}):a.map(e=>(0,X.jsx)(tA,{checked:o.includes(e),onCheckedChange:t=>l(e,t===!0),children:pA({type:e})},e))})]})]}),(0,X.jsx)(Xk,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(nA,{children:[(0,X.jsx)(rA,{className:`sticky top-0 z-10 bg-background`,children:(0,X.jsxs)(aA,{children:[(0,X.jsx)(oA,{className:`w-14`,children:`Seq`}),(0,X.jsx)(oA,{className:`w-20`,children:`Time`}),(0,X.jsx)(oA,{className:`w-40`,children:`Type`}),(0,X.jsx)(oA,{children:`Summary`})]})}),(0,X.jsx)(iA,{children:s.length===0?(0,X.jsx)(aA,{children:(0,X.jsx)(sA,{colSpan:4,className:`h-28 text-center text-muted-foreground`,children:e.length===0?`Events will appear when the agent runs.`:`No events match this filter.`})}):s.map(e=>(0,X.jsxs)(aA,{"data-state":t?.seq===e.seq?`selected`:void 0,className:`cursor-pointer`,onClick:()=>n(e),children:[(0,X.jsx)(sA,{className:`font-mono text-xs`,children:e.seq}),(0,X.jsx)(sA,{className:`text-xs text-muted-foreground`,children:_A(e.ts)}),(0,X.jsx)(sA,{children:(0,X.jsx)(XD,{variant:`secondary`,children:pA(e)})}),(0,X.jsx)(sA,{className:`max-w-0 truncate text-xs text-muted-foreground`,children:mA(e)})]},e.seq))})]})})]})}function IA({event:e,onClose:t}){let n=bA(e);return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b bg-background px-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:pA(e)}),(0,X.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[`Event `,e.seq]})]}),(0,X.jsxs)($E,{className:`ml-auto`,size:`icon`,variant:`ghost`,onClick:t,children:[(0,X.jsx)(Gp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close event details`})]})]}),(0,X.jsx)(Xk,{className:`min-h-0 min-w-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-4 overflow-hidden p-4`,children:[(0,X.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Sequence`}),(0,X.jsx)(`dd`,{children:e.seq}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Timestamp`}),(0,X.jsx)(`dd`,{children:_A(e.ts)}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Type`}),(0,X.jsx)(`dd`,{children:e.type})]}),n===void 0?null:(0,X.jsxs)(`section`,{className:`min-w-0 max-w-full`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Digests`}),(0,X.jsxs)(`dl`,{className:`mt-2 space-y-2 rounded-md bg-muted p-3 text-xs`,children:[(0,X.jsx)(LA,{label:`Prompt`,value:n.prompt}),(0,X.jsx)(LA,{label:`Tools`,value:n.tools}),(0,X.jsx)(LA,{label:`Model`,value:n.model}),(0,X.jsx)(LA,{label:`Output contract`,value:n.output}),(0,X.jsx)(LA,{label:`Configuration`,value:n.configuration}),(0,X.jsx)(LA,{label:`Context`,value:n.context})]})]}),(0,X.jsxs)(`section`,{className:`min-w-0 max-w-full`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Canonical event`}),(0,X.jsx)(`pre`,{className:`mt-2 w-full max-w-full overflow-x-auto whitespace-pre-wrap break-all rounded-md bg-muted p-3 text-xs leading-5`,children:vA(e)})]})]})})]})}function LA({label:e,value:t}){return(0,X.jsxs)(`div`,{className:`grid gap-1`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`font-mono break-all select-text`,children:t})]})}function RA({agent:e,sessionId:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(`events`),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!1,i=async()=>{let i=e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t)+`/events?after=0&limit=1000`,a=await fetch(i,{cache:`no-store`});if(a.ok&&!n){let e=await a.json();r([...e.events].sort((e,t)=>t.seq-e.seq))}};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.sessions,t]),(0,v.useEffect)(()=>{s(void 0),l(!1),a(`events`)},[t]);let u=e=>{s(e),l(!0)},d=e=>{let t=e;a(t),t===`manifest`&&l(!1)},f=i===`events`&&c&&o!==void 0;return(0,X.jsxs)(qk,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[(0,X.jsx)(Jk,{defaultSize:f?24:32,minSize:20,children:(0,X.jsx)(NA,{agent:e,sessionId:t})}),(0,X.jsx)(Yk,{withHandle:!0}),(0,X.jsx)(Jk,{defaultSize:f?40:68,minSize:28,children:(0,X.jsxs)(Tw,{value:i,onValueChange:d,className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`flex h-12 shrink-0 items-end border-b bg-background px-4`,children:(0,X.jsxs)(Ew,{className:`flex h-full items-end gap-5`,children:[(0,X.jsx)(Dw,{value:`events`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Events`}),(0,X.jsx)(Dw,{value:`manifest`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Agent Manifest`})]})}),(0,X.jsx)(Ow,{value:`events`,className:`flex min-h-0 flex-1 flex-col overflow-hidden outline-none`,children:(0,X.jsx)(FA,{events:n,selected:o,onSelect:u})}),(0,X.jsx)(Ow,{value:`manifest`,className:`flex min-h-0 flex-1 flex-col overflow-hidden outline-none`,children:(0,X.jsx)(PA,{agent:e})})]})}),f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Yk,{withHandle:!0}),(0,X.jsx)(Jk,{defaultSize:36,minSize:26,children:(0,X.jsx)(IA,{event:o,onClose:()=>{l(!1),s(void 0)}})})]}):null]},f?`details`:`workspace`)}function zA({connection:e}){let{agentId:t=``,sessionId:n}=kt(),r=Dt();if(e.setup!==void 0)return(0,X.jsx)(EA,{title:e.setup.title,detail:`${e.setup.detail} Run \`${e.setup.command}\` in another terminal; Studio will become ready automatically.`});let i=e.agents.find(e=>e.id===t);return t===``?(0,X.jsx)(EA,{title:`Choose an agent`,detail:`Select an agent and one of its sessions from the navigation.`}):i===void 0?(0,X.jsx)(EA,{title:`Agent not found`,detail:`This agent is not currently exposed by the connected agent server.`}):n===void 0?(0,X.jsx)(EA,{title:`Choose a session`,detail:`Select a saved session from the navigation, or start a new conversation with this agent.`,action:(0,X.jsxs)($E,{onClick:()=>r(CA(i.id,crypto.randomUUID())),children:[(0,X.jsx)(Lp,{className:`size-4`}),`New session`]})}):(0,X.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:(0,X.jsx)(RA,{agent:i,sessionId:n})})}function BA(){let e=TA(),t=wt().pathname.match(/^\/agents\/([^/]+)(?:\/sessions\/([^/]+))?/u),n=t===null?void 0:decodeURIComponent(t[1]),r=t?.[2];return(0,X.jsxs)(bD,{className:`h-svh overflow-hidden`,children:[(0,X.jsx)(KD,{connection:e,activeAgentId:n,activeSessionId:r}),(0,X.jsx)(CD,{className:`h-svh min-h-0 min-w-0 overflow-hidden`,children:(0,X.jsxs)($t,{children:[(0,X.jsx)(Zt,{path:`/`,element:(0,X.jsx)(zA,{connection:e})}),(0,X.jsx)(Zt,{path:`/agents/:agentId`,element:(0,X.jsx)(zA,{connection:e})}),(0,X.jsx)(Zt,{path:`/agents/:agentId/sessions/:sessionId`,element:(0,X.jsx)(zA,{connection:e})})]})})]})}function VA(){return(0,X.jsx)(Rn,{children:(0,X.jsx)(BA,{})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(v.StrictMode,{children:(0,X.jsx)(VA,{})}));
|
|
58
|
+
`},A_=0,j_=[];function M_(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(A_++)[0],a=v.useState(e_)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Wo([e.lockRef.current],(e.shards||[]).map(D_),!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=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=T_(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=v_(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=v_(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 w_(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!j_.length||j_[j_.length-1]!==a)){var r=`deltaY`in n?E_(n):T_(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&O_(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(D_).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=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:N_(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=T_(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,E_(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,T_(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return j_.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,p_),document.addEventListener(`touchmove`,c,p_),document.addEventListener(`touchstart`,u,p_),function(){j_=j_.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,p_),document.removeEventListener(`touchmove`,c,p_),document.removeEventListener(`touchstart`,u,p_)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:k_(i)}):null,p?v.createElement(u_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function N_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var P_=Wg(Gg,M_),F_=v.forwardRef(function(e,t){return v.createElement(qg,Ro({},e,{ref:t,sideCar:P_}))});F_.classNames=qg.classNames;var I_=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},L_=new WeakMap,R_=new WeakMap,z_={},B_=0,V_=function(e){return e&&(e.host||V_(e.parentNode))},H_=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=V_(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})},U_=function(e,t,n,r){var i=H_(t,Array.isArray(e)?e:[e]);z_[n]||(z_[n]=new WeakMap);var a=z_[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=(L_.get(e)||0)+1,l=(a.get(e)||0)+1;L_.set(e,c),a.set(e,l),o.push(e),c===1&&i&&R_.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(),B_++,function(){o.forEach(function(e){var t=L_.get(e)-1,i=a.get(e)-1;L_.set(e,t),a.set(e,i),t||(R_.has(e)||e.removeAttribute(r),R_.delete(e)),i||e.removeAttribute(n)}),B_--,B_||(L_=new WeakMap,L_=new WeakMap,R_=new WeakMap,z_={})}},W_=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||I_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),U_(r,i,n,`aria-hidden`)):function(){return null}},G_=Object.defineProperty,K_=(e,t)=>G_(e,`name`,{value:t,configurable:!0}),q_=`Dialog`,[J_,Y_]=Dm(q_),[X_,Z_]=J_(q_),Q_=K_(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=ih({prop:r,defaultProp:i??!1,onChange:a,caller:q_}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,X.jsx)(X_,{scope:t,triggerRef:s,contentRef:c,contentId:Sh(),titleId:Sh(),descriptionId:Sh(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),$_=`DialogPortal`,[ev,tv]=J_($_,{forceMount:void 0}),nv=K_(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Z_($_,t);return(0,X.jsx)(ev,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),rv=`DialogOverlay`,iv=v.forwardRef(K_(function(e,t){let n=tv(rv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z_(rv,e.__scopeDialog);return a.modal?(0,X.jsx)(fh,{present:r||a.open,children:(0,X.jsx)(ov,{...i,ref:t})}):null},`DialogOverlay`)),av=$p(`DialogOverlay.RemoveScroll`),ov=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(rv,n),a=Xp(t,$h());return(0,X.jsx)(F_,{as:av,allowPinchZoom:!0,shards:[i.contentRef],children:(0,X.jsx)(vm.div,{"data-state":vv(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),sv=`DialogContent`,cv=v.forwardRef(K_(function(e,t){let n=tv(sv,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Z_(sv,e.__scopeDialog);return(0,X.jsx)(fh,{present:r||a.open,children:a.modal?(0,X.jsx)(lv,{...i,ref:t}):(0,X.jsx)(uv,{...i,ref:t})})},`DialogContent`)),lv=v.forwardRef(K_(function(e,t){let n=Z_(sv,e.__scopeDialog),r=v.useRef(null),i=Xp(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return W_(e)},[]),(0,X.jsx)(dv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),uv=v.forwardRef(K_(function(e,t){let n=Z_(sv,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,X.jsx)(dv,{...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`)),dv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Z_(sv,n);return kg(),(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(ug,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,X.jsx)(Qh,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":vv(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),fv=`DialogTitle`,pv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(fv,n),{setTitleCount:a}=i;return Ym(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(vm.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),mv=`DialogDescription`,hv=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(mv,n),{setDescriptionCount:a}=i;return Ym(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,X.jsx)(vm.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),gv=`DialogClose`,_v=v.forwardRef(K_(function(e,t){let{__scopeDialog:n,...r}=e,i=Z_(gv,n);return(0,X.jsx)(vm.button,{type:`button`,...r,ref:t,onClick:Z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function vv(e){return e?`open`:`closed`}K_(vv,`getState`);var yv=Object.defineProperty,bv=(e,t)=>yv(e,`name`,{value:t,configurable:!0});function xv(e){let[t,n]=v.useState(void 0);return Ym(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}bv(xv,`useSize`);var Sv=[`top`,`right`,`bottom`,`left`],Cv=Math.min,wv=Math.max,Tv=Math.round,Ev=Math.floor,Dv=e=>({x:e,y:e}),Ov={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function kv(e,t,n){return wv(e,Cv(t,n))}function Av(e,t){return typeof e==`function`?e(t):e}function jv(e){return e.split(`-`)[0]}function Mv(e){return e.split(`-`)[1]}function Nv(e){return e===`x`?`y`:`x`}function Pv(e){return e===`y`?`height`:`width`}function Fv(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Iv(e){return Nv(Fv(e))}function Lv(e,t,n){n===void 0&&(n=!1);let r=Mv(e),i=Iv(e),a=Pv(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Kv(o)),[o,Kv(o)]}function Rv(e){let t=Kv(e);return[zv(e),t,zv(t)]}function zv(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Bv=[`left`,`right`],Vv=[`right`,`left`],Hv=[`top`,`bottom`],Uv=[`bottom`,`top`];function Wv(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Vv:Bv:t?Bv:Vv;case`left`:case`right`:return t?Hv:Uv;default:return[]}}function Gv(e,t,n,r){let i=Mv(e),a=Wv(jv(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(zv)))),a}function Kv(e){let t=jv(e);return Ov[t]+e.slice(t.length)}function qv(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Jv(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:qv(e)}function Yv(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 Xv(e,t,n){let{reference:r,floating:i}=e,a=Fv(t),o=Iv(t),s=Pv(o),c=jv(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=Mv(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Zv(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}=Av(t,e),p=Jv(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Yv(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=Yv(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 Qv=50,$v=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Zv},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Xv(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<Qv&&(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}=Xv(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ey=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}=Av(e,t)||{};if(l==null)return{};let d=Jv(u),f={x:n,y:r},p=Iv(i),m=Pv(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,ee=Cv(d[_],T),te=Cv(d[v],T),ne=C-h[m]-te,re=C/2-h[m]/2+w,ie=kv(ee,re,ne),ae=!c.arrow&&Mv(i)!=null&&re!==ie&&a.reference[m]/2-(re<ee?ee:te)-h[m]/2<0,E=ae?re<ee?re-ee:re-ne:0;return{[p]:f[p]+E,data:{[p]:ie,centerOffset:re-ie-E,...ae&&{alignmentOffset:E}},reset:ae}}}),ty=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}=Av(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=jv(r),_=Fv(o),v=jv(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Kv(o)]:Rv(o)),x=p!==`none`;!d&&x&&b.push(...Gv(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=Lv(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`||_===Fv(t)||T.every(e=>Fv(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=Fv(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{}}}};function ny(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ry(e){return Sv.some(t=>e[t]>=0)}var iy=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Av(e,t);switch(i){case`referenceHidden`:{let e=ny(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ry(e)}}}case`escaped`:{let e=ny(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ry(e)}}}default:return{}}}}},ay=new Set([`left`,`top`]);async function oy(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=jv(n),s=Mv(n),c=Fv(n)===`y`,l=ay.has(o)?-1:1,u=a&&c?-1:1,d=Av(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 sy=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 oy(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}}}}},cy=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}=Av(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Fv(i),p=Nv(f),m=u[p],h=u[f],g=(e,t)=>kv(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}}}}}},ly=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}=Av(e,t),u={x:n,y:r},d=Fv(i),f=Nv(d),p=u[f],m=u[d],h=Av(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=ay.has(jv(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}}}},uy=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}=Av(e,t),c=await i.detectOverflow(t,s),l=jv(n),u=Mv(n),d=Fv(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=Cv(p-c[m],g),y=Cv(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*wv(c.left,c.right):S=p-2*wv(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 dy(){return typeof window<`u`}function fy(e){return hy(e)?(e.nodeName||``).toLowerCase():`#document`}function py(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function my(e){return((hy(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function hy(e){return dy()?e instanceof Node||e instanceof py(e).Node:!1}function gy(e){return dy()?e instanceof Element||e instanceof py(e).Element:!1}function _y(e){return dy()?e instanceof HTMLElement||e instanceof py(e).HTMLElement:!1}function vy(e){return!dy()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof py(e).ShadowRoot}function yy(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ay(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function by(e){return/^(table|td|th)$/.test(fy(e))}function xy(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Sy=/transform|translate|scale|rotate|perspective|filter/,Cy=/paint|layout|strict|content/,wy=e=>!!e&&e!==`none`,Ty;function Ey(e){let t=gy(e)?Ay(e):e;return wy(t.transform)||wy(t.translate)||wy(t.scale)||wy(t.rotate)||wy(t.perspective)||!Oy()&&(wy(t.backdropFilter)||wy(t.filter))||Sy.test(t.willChange||``)||Cy.test(t.contain||``)}function Dy(e){let t=My(e);for(;_y(t)&&!ky(t);){if(Ey(t))return t;if(xy(t))return null;t=My(t)}return null}function Oy(){return Ty??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ty}function ky(e){return/^(html|body|#document)$/.test(fy(e))}function Ay(e){return py(e).getComputedStyle(e)}function jy(e){return gy(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function My(e){if(fy(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||vy(e)&&e.host||my(e);return vy(t)?t.host:t}function Ny(e){let t=My(e);return ky(t)?(e.ownerDocument||e).body:_y(t)&&yy(t)?t:Ny(t)}function Py(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Ny(e),i=r===e.ownerDocument?.body,a=py(r);if(i){let e=Fy(a);return t.concat(a,a.visualViewport||[],yy(r)?r:[],e&&n?Py(e):[])}return t.concat(r,Py(r,[],n))}function Fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Iy(e){let t=Ay(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=_y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Tv(n)!==a||Tv(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ly(e){return gy(e)?e:e.contextElement}function Ry(e){let t=Ly(e);if(!_y(t))return Dv(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Iy(t),o=(a?Tv(n.width):n.width)/r,s=(a?Tv(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var zy=Dv(0);function By(e){let t=py(e);return!Oy()||!t.visualViewport?zy:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Vy(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===py(e)}function Hy(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ly(e),o=Dv(1);t&&(r?gy(r)&&(o=Ry(r)):o=Ry(e));let s=Vy(a,n,r)?By(a):Dv(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=py(a),t=gy(r)?py(r):r,n=e,i=Fy(n);for(;i&&t!==n;){let e=Ry(i),t=i.getBoundingClientRect(),r=Ay(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=py(i),i=Fy(n)}}return Yv({width:u,height:d,x:c,y:l})}function Uy(e,t){let n=jy(e).scrollLeft;return t?t.left+n:Hy(my(e)).left+n}function Wy(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Uy(e,n),y:n.top+t.scrollTop}}function Gy(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=my(r),s=t?xy(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Dv(1),u=Dv(0),d=_y(r);if((d||!a)&&((fy(r)!==`body`||yy(o))&&(c=jy(r)),d)){let e=Hy(r);l=Ry(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Wy(o,c):Dv(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 Ky(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function qy(e){let t=jy(e),n=e.ownerDocument.body,r=wv(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=wv(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Uy(e),o=-t.scrollTop;return Ay(n).direction===`rtl`&&(a+=wv(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Jy=25;function Yy(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=py(e),a=my(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Oy()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Uy(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<=Jy&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Xy(e,t){let n=Hy(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ry(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Zy(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Yy(e,n,t);else if(t===`document`)r=qy(my(e));else if(gy(t))r=Xy(t,n);else{let n=By(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Yv(r)}function Qy(e,t){let n=t.get(e);if(n)return n;let r=Py(e,[],!1).filter(e=>gy(e)&&fy(e)!==`body`),i=null,a=Ay(e).position===`fixed`,o=a?My(e):e;for(;gy(o)&&!ky(o);){let e=Ay(o),t=Ey(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=My(o)}return t.set(e,r),r}function $y(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?xy(t)?[]:Qy(t,this._c):[].concat(n),r],o=Zy(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=Zy(t,a[e],i);s=wv(n.top,s),c=Cv(n.right,c),l=Cv(n.bottom,l),u=wv(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function eb(e){let{width:t,height:n}=Iy(e);return{width:t,height:n}}function tb(e,t,n){let r=_y(t),i=my(t),a=n===`fixed`,o=Hy(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Dv(0);if((r||!a)&&((fy(t)!==`body`||yy(i))&&(s=jy(t)),r)){let e=Hy(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Uy(i));let l=i&&!r&&!a?Wy(i,s):Dv(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 nb(e){return Ay(e).position===`static`}function rb(e,t){if(!_y(e)||Ay(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return my(e)===n&&(n=n.ownerDocument.body),n}function ib(e,t){let n=py(e);if(xy(e))return n;if(!_y(e)){let t=My(e);for(;t&&!ky(t);){if(gy(t)&&!nb(t))return t;t=My(t)}return n}let r=rb(e,t);for(;r&&by(r)&&nb(r);)r=rb(r,t);return r&&ky(r)&&nb(r)&&!Ey(r)?n:r||Dy(e)||n}var ab=async function(e){let t=this.getOffsetParent||ib,n=this.getDimensions,r=await n(e.floating);return{reference:tb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ob(e){return Ay(e).direction===`rtl`}var sb={convertOffsetParentRelativeRectToViewportRelativeRect:Gy,getDocumentElement:my,getClippingRect:$y,getOffsetParent:ib,getElementRects:ab,getClientRects:Ky,getDimensions:eb,getScale:Ry,isElement:gy,isRTL:ob};function cb(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lb(e,t,n){let r=null,i,a=my(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=Ev(d),h=Ev(a.clientWidth-(u+f)),g=Ev(a.clientHeight-(d+p)),_=Ev(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:wv(0,Cv(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!cb(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=py(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function ub(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=Ly(e),u=i||a?[...l?Py(l):[],...t?Py(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?lb(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?Hy(e):null;c&&g();function g(){let t=Hy(e);h&&!cb(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 db=sy,fb=cy,pb=ty,mb=uy,hb=iy,gb=ey,_b=ly,vb=(e,t,n)=>{let r=new Map,i=n??{},a={...sb,...i.platform,_c:r};return $v(e,t,{...i,platform:a})},yb=typeof document<`u`?v.useLayoutEffect:function(){};function bb(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(!bb(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)&&!bb(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function xb(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sb(e,t){let n=xb(e);return Math.round(t*n)/n}function Cb(e){let t=v.useRef(e);return yb(()=>{t.current=e}),t}function wb(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]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);bb(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),ee=c!=null,te=Cb(c),ne=Cb(i),re=Cb(l),ie=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ne.current&&(e.platform=ne.current),vb(C.current,w.current,e).then(e=>{let t={...e,isPositioned:re.current!==!1};ae.current&&!bb(T.current,t)&&(T.current=t,hm.flushSync(()=>{d(t)}))})},[f,t,n,ne,re]);yb(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ae=v.useRef(!1);yb(()=>(ae.current=!0,()=>{ae.current=!1}),[]),yb(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(te.current)return te.current(x,S,ie);ie()}},[x,S,ie,te,ee]);let E=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),oe=v.useMemo(()=>({reference:x,floating:S}),[x,S]),se=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!oe.floating)return e;let t=Sb(oe.floating,u.x),r=Sb(oe.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...xb(oe.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,oe.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:ie,refs:E,elements:oe,floatingStyles:se}),[u,ie,E,oe,se])}var Tb=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:gb({element:r.current,padding:i}).fn(n):r?gb({element:r,padding:i}).fn(n):{}}}},Eb=(e,t)=>{let n=db(e);return{name:n.name,fn:n.fn,options:[e,t]}},Db=(e,t)=>{let n=fb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ob=(e,t)=>({fn:_b(e).fn,options:[e,t]}),kb=(e,t)=>{let n=pb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ab=(e,t)=>{let n=mb(e);return{name:n.name,fn:n.fn,options:[e,t]}},jb=(e,t)=>{let n=hb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mb=(e,t)=>{let n=Tb(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nb=Object.defineProperty,Pb=v.forwardRef(((e,t)=>Nb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,X.jsx)(vm.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,X.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Fb=Object.defineProperty,Ib=(e,t)=>Fb(e,`name`,{value:t,configurable:!0}),Lb=`Popper`,[Rb,zb]=Dm(Lb),[Bb,Vb]=Rb(Lb),Hb=Ib(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,X.jsx)(Bb,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Ub=`PopperAnchor`,Wb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Vb(Ub,n),o=v.useRef(null),s=a.onAnchorChange,c=Xp(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&ex(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,X.jsx)(vm.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Gb=`PopperContent`,[Kb,qb]=Rb(Gb),Jb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Vb(Gb,n),[_,y]=v.useState(null),b=Xp(t,y),[x,S]=v.useState(null),C=xv(x),w=C?.width??0,T=C?.height??0,ee=r+(a===`center`?``:`-`+a),te=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ne=Array.isArray(l)?l:[l],re=ne.length>0,ie={padding:te,boundary:ne.filter(Qb),altBoundary:re},{refs:ae,floatingStyles:E,placement:oe,isPositioned:se,middlewareData:ce}=wb({strategy:`fixed`,placement:ee,whileElementsMounted:Ib((...e)=>ub(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Eb({mainAxis:i+T,alignmentAxis:o}),c&&Db({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Ob():void 0,...ie}),c&&kb({...ie}),Ab({...ie,apply:Ib(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&Mb({element:x,padding:s}),$b({arrowWidth:w,arrowHeight:T}),f&&jb({strategy:`referenceHidden`,...ie,boundary:re?ie.boundary:void 0})]}),D=g.setPlacementState;Ym(()=>(D(oe),()=>{D(void 0)}),[oe,D]);let[le,ue]=ex(oe),de=Wh(m);Ym(()=>{se&&de?.()},[se,de]);let fe=ce.arrow?.x,pe=ce.arrow?.y,me=ce.arrow?.centerOffset!==0,[he,ge]=v.useState();return Ym(()=>{_&&ge(window.getComputedStyle(_).zIndex)},[_]),(0,X.jsx)(`div`,{ref:ae.setFloating,"data-radix-popper-content-wrapper":``,style:{...E,transform:se?E.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:he,"--radix-popper-transform-origin":[ce.transformOrigin?.x,ce.transformOrigin?.y].join(` `),...ce.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,X.jsx)(Kb,{scope:n,placedSide:le,placedAlign:ue,onArrowChange:S,arrowX:fe,arrowY:pe,shouldHideArrow:me,children:(0,X.jsx)(vm.div,{"data-side":le,"data-align":ue,...h,ref:b,style:{...h.style,animation:se?h.style?.animation:`none`}})})})},`PopperContent`)),Yb=`PopperArrow`,Xb={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Zb=v.forwardRef(Ib(function(e,t){let{__scopePopper:n,...r}=e,i=qb(Yb,n),a=Xb[i.placedSide];return(0,X.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,X.jsx)(Pb,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Qb(e){return e!==null}Ib(Qb,`isNotNull`);var $b=Ib(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=ex(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function ex(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Ib(ex,`getSideAndAlignFromPlacement`);var tx=Hb,nx=Wb,rx=Jb,ix=Zb,ax=Object.defineProperty,ox=(e,t)=>ax(e,`name`,{value:t,configurable:!0}),sx=!1;function cx(){let[e,t]=v.useState(sx);return v.useEffect(()=>{sx||(sx=!0,t(!0))},[]),e}ox(cx,`useIsHydrated`);var lx=v.useSyncExternalStore;function ux(){return()=>{}}ox(ux,`subscribe`);function dx(){return lx(ux,()=>!0,()=>!1)}ox(dx,`useIsHydratedModern`);var fx=typeof lx==`function`?dx:cx,px=Object.defineProperty,mx=(e,t)=>px(e,`name`,{value:t,configurable:!0}),hx=`rovingFocusGroup.onEntryFocus`,gx={bubbles:!1,cancelable:!0},_x=`RovingFocusGroup`,[vx,yx,bx]=jm(_x),[xx,Sx]=Dm(_x,[bx]),[Cx,wx]=xx(_x),Tx=v.forwardRef(mx(function(e,t){return(0,X.jsx)(vx.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,X.jsx)(vx.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,X.jsx)(Ex,{...e,ref:t})})})},`RovingFocusGroup`)),Ex=v.forwardRef(mx(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=v.useRef(null),p=Xp(t,f),m=Vh(a),[h,g]=ih({prop:o,defaultProp:s??null,onChange:c,caller:_x}),[_,y]=v.useState(!1),b=Wh(l),x=yx(n),S=v.useRef(!1),[C,w]=v.useState(0);return v.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(hx,b),()=>e.removeEventListener(hx,b)},[b]),(0,X.jsx)(Cx,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:v.useCallback(e=>g(e),[g]),onItemShiftTab:v.useCallback(()=>y(!0),[]),onFocusableItemAdd:v.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:v.useCallback(()=>w(e=>e-1),[]),children:(0,X.jsx)(vm.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:Z(e.onMouseDown,()=>{S.current=!0}),onFocus:Z(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(hx,gx);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);Mx([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:Z(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Dx=`RovingFocusGroupItem`,Ox=v.forwardRef(mx(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Sh(),l=a||c,u=wx(Dx,n),d=u.currentTabStopId===l,f=yx(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=fx();return Ym(()=>{if(!(!g||!r))return p(),()=>m()},[g,r,p,m]),v.useEffect(()=>{if(!(g||!r))return p(),()=>m()},[g,r,p,m]),(0,X.jsx)(vx.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,X.jsx)(vm.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:Z(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:Z(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:Z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=jx(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Nx(n,r+1):n.slice(r+1)}setTimeout(()=>Mx(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),kx={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ax(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}mx(Ax,`getDirectionAwareKey`);function jx(e,t,n){let r=Ax(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return kx[r]}mx(jx,`getFocusIntent`);function Mx(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}mx(Mx,`focusFirst`);function Nx(e,t){return e.map((n,r)=>e[(t+r)%e.length])}mx(Nx,`wrapArray`);var Px=Tx,Fx=Ox,Ix=Object.defineProperty,Lx=(e,t)=>Ix(e,`name`,{value:t,configurable:!0}),Rx=[`Enter`,` `],zx=[`ArrowDown`,`PageUp`,`Home`],Bx=[`ArrowUp`,`PageDown`,`End`],Vx=[...zx,...Bx];[...Rx],[...Rx];var Hx=`Menu`,[Ux,Wx,Gx]=jm(Hx),[Kx,qx]=Dm(Hx,[Gx,zb,Sx]),Jx=zb(),Yx=Sx(),[Xx,Zx]=Kx(Hx),[Qx,$x]=Kx(Hx),eS=Lx(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Jx(t),[c,l]=v.useState(null),u=v.useRef(!1),d=Wh(a),f=Vh(i);return v.useEffect(()=>{let e=Lx(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=Lx(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),v.useEffect(()=>{if(!n)return;let e=Lx(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,X.jsx)(tx,{...s,children:(0,X.jsx)(Xx,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,X.jsx)(Qx,{scope:t,onClose:v.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),tS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,...r}=e,i=Jx(n);return(0,X.jsx)(nx,{...i,...r,ref:t})},`MenuAnchor`)),nS=`MenuPortal`,[rS,iS]=Kx(nS,{forceMount:void 0}),aS=Lx(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Zx(nS,t);return(0,X.jsx)(rS,{scope:t,forceMount:n,children:(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:r})})})},`MenuPortal`),oS=`MenuContent`,[sS,cS]=Kx(oS),lS=v.forwardRef(Lx(function(e,t){let n=iS(oS,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Zx(oS,e.__scopeMenu),o=$x(oS,e.__scopeMenu);return(0,X.jsx)(Ux.Provider,{scope:e.__scopeMenu,children:(0,X.jsx)(fh,{present:r||a.open,children:(0,X.jsx)(Ux.Slot,{scope:e.__scopeMenu,children:o.modal?(0,X.jsx)(uS,{...i,ref:t}):(0,X.jsx)(dS,{...i,ref:t})})})})},`MenuContent`)),uS=v.forwardRef(Lx(function(e,t){let n=Zx(oS,e.__scopeMenu),r=v.useRef(null),i=Xp(t,r);return v.useEffect(()=>{let e=r.current;if(e)return W_(e)},[]),(0,X.jsx)(pS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),dS=v.forwardRef(Lx(function(e,t){let n=Zx(oS,e.__scopeMenu);return(0,X.jsx)(pS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),fS=$p(`MenuContent.ScrollLock`),pS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Zx(oS,n),_=$x(oS,n),y=Jx(n),b=Yx(n),x=Wx(n),[S,C]=v.useState(null),w=v.useRef(null),T=Xp(t,w,g.onContentChange),ee=v.useRef(0),te=v.useRef(``),ne=v.useRef(0),re=v.useRef(null),ie=v.useRef(`right`),ae=v.useRef(0),E=m?F_:v.Fragment,oe=m?{as:fS,allowPinchZoom:!0}:void 0,se=Lx(e=>{let t=te.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=MS(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;Lx((function e(t){te.current=t,window.clearTimeout(ee.current),t!==``&&(ee.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);v.useEffect(()=>()=>window.clearTimeout(ee.current),[]),kg();let ce=v.useCallback(e=>ie.current===re.current?.side&&PS(e,re.current?.area),[]);return(0,X.jsx)(sS,{scope:n,searchRef:te,onItemEnter:v.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:v.useCallback(e=>{ce(e)||(w.current?.focus(),C(null))},[ce]),onTriggerLeave:v.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:v.useCallback(e=>{re.current=e},[]),children:(0,X.jsx)(E,{...oe,children:(0,X.jsx)(ug,{asChild:!0,trapped:i,onMountAutoFocus:Z(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,X.jsx)(Qh,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,X.jsx)(Px,{asChild:!0,...b,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Z(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,X.jsx)(rx,{role:`menu`,"aria-orientation":`vertical`,"data-state":DS(g.open),"data-radix-menu-content":``,dir:_.dir,...y,...h,ref:T,style:{outline:`none`,...h.style},onKeyDown:Z(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=w.current;if(e.target!==i||!Vx.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);Bx.includes(e.key)&&a.reverse(),AS(a)}),onBlur:Z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(ee.current),te.current=``)}),onPointerMove:Z(e.onPointerMove,FS(e=>{let t=e.target,n=ae.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>ae.current?`right`:`left`;ie.current=t,ae.current=e.clientX}}))})})})})})})},`MenuContentImpl`)),mS=`MenuItem`,hS=`menu.itemSelect`,gS=v.forwardRef(Lx(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=v.useRef(null),o=$x(mS,e.__scopeMenu),s=cS(mS,e.__scopeMenu),c=Xp(t,a),l=v.useRef(!1),u=Lx(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(hS,{bubbles:!0,cancelable:!0});e.addEventListener(hS,e=>r?.(e),{once:!0}),ym(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,X.jsx)(_S,{...i,ref:c,disabled:n,onClick:Z(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:Z(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:Z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&Rx.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),_S=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=cS(mS,n),s=Yx(n),c=v.useRef(null),l=Xp(t,c),[u,d]=v.useState(!1),[f,p]=v.useState(``);return v.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,X.jsx)(Ux.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,X.jsx)(Fx,{asChild:!0,...s,focusable:!r,children:(0,X.jsx)(vm.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:Z(e.onPointerMove,FS(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Z(e.onPointerLeave,FS(e=>o.onItemLeave(e))),onFocus:Z(e.onFocus,()=>d(!0)),onBlur:Z(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),vS=v.forwardRef(Lx(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,X.jsx)(SS,{scope:e.__scopeMenu,checked:n,children:(0,X.jsx)(gS,{role:`menuitemcheckbox`,"aria-checked":OS(n)?`mixed`:n,...i,ref:t,"data-state":kS(n),onSelect:Z(i.onSelect,()=>r?.(OS(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[yS,bS]=Kx(`MenuRadioGroup`,{value:void 0,onValueChange:Lx(()=>{},`onValueChange`)}),xS=`MenuItemIndicator`,[SS,CS]=Kx(xS,{checked:!1}),wS=v.forwardRef(Lx(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=CS(xS,n);return(0,X.jsx)(fh,{present:r||OS(a.checked)||a.checked===!0,children:(0,X.jsx)(vm.span,{...i,ref:t,"data-state":kS(a.checked)})})},`MenuItemIndicator`)),[TS,ES]=Kx(`MenuSub`);function DS(e){return e?`open`:`closed`}Lx(DS,`getOpenState`);function OS(e){return e===`indeterminate`}Lx(OS,`isIndeterminate`);function kS(e){return OS(e)?`indeterminate`:e?`checked`:`unchecked`}Lx(kS,`getCheckedState`);function AS(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}Lx(AS,`focusFirst`);function jS(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Lx(jS,`wrapArray`);function MS(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=jS(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Lx(MS,`getNextMatch`);function NS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Lx(NS,`isPointInPolygon`);function PS(e,t){return t?NS({x:e.clientX,y:e.clientY},t):!1}Lx(PS,`isPointerInGraceArea`);function FS(e){return t=>t.pointerType===`mouse`?e(t):void 0}Lx(FS,`whenMouse`);var IS=eS,LS=tS,RS=aS,zS=lS,BS=vS,VS=wS,HS=Object.defineProperty,US=(e,t)=>HS(e,`name`,{value:t,configurable:!0}),WS=`DropdownMenu`,[GS,KS]=Dm(WS,[qx]),qS=qx(),[JS,YS]=GS(WS),XS=US(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=qS(t),l=v.useRef(null),[u,d]=ih({prop:i,defaultProp:a??!1,onChange:o,caller:WS});return(0,X.jsx)(JS,{scope:t,triggerId:Sh(),triggerRef:l,contentId:Sh(),open:u,onOpenChange:d,onOpenToggle:v.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,X.jsx)(IS,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),ZS=`DropdownMenuTrigger`,QS=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=YS(ZS,n),o=qS(n),s=Xp(t,a.triggerRef);return(0,X.jsx)(LS,{asChild:!0,...o,children:(0,X.jsx)(vm.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:Z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),$S=US(e=>{let{__scopeDropdownMenu:t,...n}=e,r=qS(t);return(0,X.jsx)(RS,{...r,...n})},`DropdownMenuPortal`),eC=`DropdownMenuContent`,tC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=YS(eC,n),a=qS(n),o=v.useRef(!1);return(0,X.jsx)(zS,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Z(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),nC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=qS(n);return(0,X.jsx)(BS,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),rC=v.forwardRef(US(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=qS(n);return(0,X.jsx)(VS,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),iC=XS,aC=QS,oC=$S,sC=tC,cC=nC,lC=rC,uC=Object.defineProperty,dC=(e,t)=>uC(e,`name`,{value:t,configurable:!0});function fC(e,[t,n]){return Math.min(n,Math.max(t,e))}dC(fC,`clamp`);var pC=Object.defineProperty,mC=(e,t)=>pC(e,`name`,{value:t,configurable:!0});function hC(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}mC(hC,`useStateMachine`);var gC=`ScrollArea`,[_C,vC]=Dm(gC),[yC,bC]=_C(gC),xC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=v.useState(null),[l,u]=v.useState(null),[d,f]=v.useState(null),[p,m]=v.useState(null),[h,g]=v.useState(null),[_,y]=v.useState(0),[b,x]=v.useState(0),[S,C]=v.useState(!1),[w,T]=v.useState(!1),ee=Xp(t,c),te=Vh(i);return(0,X.jsx)(yC,{scope:n,type:r,dir:te,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,X.jsx)(vm.div,{dir:te,...o,ref:ee,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})},`ScrollArea`)),SC=`ScrollAreaViewport`,CC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=bC(SC,n),s=Xp(t,v.useRef(null),o.onViewportChange);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(wC,{nonce:i}),(0,X.jsx)(vm.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,X.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})},`ScrollAreaViewport`)),wC=v.memo(mC(function({nonce:e}){return(0,X.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:e})},`ScrollAreaViewportStyle`),(e,t)=>e.nonce===t.nonce),TC=`ScrollAreaScrollbar`,EC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return v.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,X.jsx)(DC,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,X.jsx)(OC,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,X.jsx)(kC,{...r,ref:t,forceMount:n}):i.type===`always`?(0,X.jsx)(AC,{...r,ref:t,"data-state":`visible`}):null},`ScrollAreaScrollbar`)),DC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),[a,o]=v.useState(!1);return v.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=mC(()=>{window.clearTimeout(t),o(!0)},`handlePointerEnter`),r=mC(()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)},`handlePointerLeave`);return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,X.jsx)(fh,{present:n||a,children:(0,X.jsx)(kC,{"data-state":a?`visible`:`hidden`,...r,ref:t})})},`ScrollAreaScrollbarHover`)),OC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=bC(TC,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=XC(()=>c(`SCROLL_END`),100),[s,c]=hC(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return v.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),v.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=mC(()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r},`handleScroll`);return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,X.jsx)(fh,{present:n||s!==`hidden`,children:(0,X.jsx)(AC,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:Z(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:Z(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})},`ScrollAreaScrollbarScroll`)),kC=v.forwardRef(mC(function(e,t){let n=bC(TC,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=v.useState(!1),s=e.orientation===`horizontal`,c=XC(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return ZC(n.viewport,c),ZC(n.content,c),(0,X.jsx)(fh,{present:r||a,children:(0,X.jsx)(AC,{"data-state":a?`visible`:`hidden`,...i,ref:t})})},`ScrollAreaScrollbarAuto`)),AC=v.forwardRef(mC(function(e,t){let{orientation:n=`vertical`,...r}=e,i=bC(TC,e.__scopeScrollArea),a=v.useRef(null),o=v.useRef(0),[s,c]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=UC(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:mC(e=>a.current=e,`onThumbChange`),onThumbPointerUp:mC(()=>o.current=0,`onThumbPointerUp`),onThumbPointerDown:mC(e=>o.current=e,`onThumbPointerDown`)};function d(e,t){return GC(e,o.current,s,t)}return mC(d,`getScrollPosition`),n===`horizontal`?(0,X.jsx)(jC,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=KC(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,X.jsx)(MC,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=KC(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null},`ScrollAreaScrollbarVisible`)),jC=v.forwardRef(mC(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=bC(TC,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=Xp(t,c,a.onScrollbarXChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,X.jsx)(FC,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":WC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),JC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:HC(o.paddingLeft),paddingEnd:HC(o.paddingRight)}})}})},`ScrollAreaScrollbarX`)),MC=v.forwardRef(mC(function(e,t){let{sizes:n,onSizesChange:r,...i}=e,a=bC(TC,e.__scopeScrollArea),[o,s]=v.useState(),c=v.useRef(null),l=Xp(t,c,a.onScrollbarYChange);return v.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,X.jsx)(FC,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":WC(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),JC(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:HC(o.paddingTop),paddingEnd:HC(o.paddingBottom)}})}})},`ScrollAreaScrollbarY`)),[NC,PC]=_C(TC),FC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=bC(TC,n),[m,h]=v.useState(null),g=Xp(t,h),_=v.useRef(null),y=v.useRef(``),b=p.viewport,x=r.content-r.viewport,S=Wh(u),C=Wh(c),w=XC(d,10);function T(e){if(_.current){let t=e.clientX-_.current.left,n=e.clientY-_.current.top;l({x:t,y:n})}}return mC(T,`handleDragScroll`),v.useEffect(()=>{let e=mC(e=>{let t=e.target;m?.contains(t)&&S(e,x)},`handleWheel`);return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,m,x,S]),v.useEffect(C,[r,C]),ZC(m,w),ZC(p.content,w),(0,X.jsx)(NC,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:Wh(a),onThumbPointerUp:Wh(o),onThumbPositionChange:C,onThumbPointerDown:Wh(s),children:(0,X.jsx)(vm.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:Z(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),T(e))}),onPointerMove:Z(e.onPointerMove,T),onPointerUp:Z(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})},`ScrollAreaScrollbarImpl`)),IC=`ScrollAreaThumb`,LC=v.forwardRef(mC(function(e,t){let{forceMount:n,...r}=e,i=PC(IC,e.__scopeScrollArea);return(0,X.jsx)(fh,{present:n||i.hasThumb,children:(0,X.jsx)(RC,{ref:t,...r})})},`ScrollAreaThumb`)),RC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,style:r,...i}=e,a=bC(IC,n),o=PC(IC,n),{onThumbPositionChange:s}=o,c=Xp(t,o.onThumbChange),l=v.useRef(void 0),u=XC(()=>{l.current&&=(l.current(),void 0)},100);return v.useEffect(()=>{let e=a.viewport;if(e){let t=mC(()=>{if(u(),!l.current){let t=YC(e,s);l.current=t,s()}},`handleScroll`);return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,X.jsx)(vm.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:Z(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:Z(e.onPointerUp,o.onThumbPointerUp)})},`ScrollAreaThumbImpl`)),zC=`ScrollAreaCorner`,BC=v.forwardRef(mC(function(e,t){let n=bC(zC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,X.jsx)(VC,{...e,ref:t}):null},`ScrollAreaCorner`)),VC=v.forwardRef(mC(function(e,t){let{__scopeScrollArea:n,...r}=e,i=bC(zC,n),[a,o]=v.useState(0),[s,c]=v.useState(0),l=!!(a&&s),{onCornerWidthChange:u,onCornerHeightChange:d}=i;return ZC(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),ZC(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),v.useEffect(()=>()=>{u(0),d(0)},[u,d]),l?(0,X.jsx)(vm.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null},`ScrollAreaCornerImpl`));function HC(e){return e?parseInt(e,10):0}mC(HC,`toInt`);function UC(e,t){let n=e/t;return isNaN(n)?0:n}mC(UC,`getThumbRatio`);function WC(e){let t=UC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}mC(WC,`getThumbSize`);function GC(e,t,n,r=`ltr`){let i=WC(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return qC([c,l],d)(e)}mC(GC,`getScrollPositionFromPointer`);function KC(e,t,n=`ltr`){let r=WC(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=fC(e,n===`ltr`?[0,o]:[o*-1,0]);return qC([0,o],[0,s])(c)}mC(KC,`getThumbOffsetFromScroll`);function qC(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}mC(qC,`linearScale`);function JC(e,t){return e>0&&e<t}mC(JC,`isScrollingWithinScrollbarBounds`);var YC=mC((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return mC((function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)}),`loop`)(),()=>window.cancelAnimationFrame(r)},`addUnlinkedScrollListener`);function XC(e,t){let n=Wh(e),r=v.useRef(0);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),v.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}mC(XC,`useDebounceCallback`);function ZC(e,t){let n=Wh(t);Ym(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}mC(ZC,`useResizeObserver`);var QC=xC,$C=CC,ew=BC,tw=Object.defineProperty,nw=(e,t)=>tw(e,`name`,{value:t,configurable:!0}),rw=`horizontal`,iw=[`horizontal`,`vertical`],aw=v.forwardRef(nw(function(e,t){let{decorative:n,orientation:r=rw,...i}=e,a=ow(r)?r:rw,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,X.jsx)(vm.div,{"data-orientation":a,...o,...i,ref:t})},`Separator`));function ow(e){return iw.includes(e)}nw(ow,`isValidOrientation`);var sw=aw,cw=Object.defineProperty,lw=(e,t)=>cw(e,`name`,{value:t,configurable:!0}),uw=`Tabs`,[dw,fw]=Dm(uw,[Sx]),pw=Sx(),[mw,hw]=dw(uw),gw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Vh(s),[d,f]=ih({prop:r,onChange:i,defaultProp:a??``,caller:uw});return(0,X.jsx)(mw,{scope:n,baseId:Sh(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,X.jsx)(vm.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),_w=`TabsList`,vw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=hw(_w,n),o=pw(n);return(0,X.jsx)(Px,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,X.jsx)(vm.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),yw=`TabsTrigger`,bw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=hw(yw,n),s=pw(n),c=Cw(o.baseId,r),l=ww(o.baseId,r),u=r===o.value;return(0,X.jsx)(Fx,{asChild:!0,...s,focusable:!i,active:u,children:(0,X.jsx)(vm.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Z(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Z(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Z(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),xw=`TabsContent`,Sw=v.forwardRef(lw(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=hw(xw,n),c=Cw(s.baseId,r),l=ww(s.baseId,r),u=r===s.value,d=v.useRef(u);return v.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,X.jsx)(fh,{present:i||u,children:({present:n})=>(0,X.jsx)(vm.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Cw(e,t){return`${e}-trigger-${t}`}lw(Cw,`makeTriggerId`);function ww(e,t){return`${e}-content-${t}`}lw(ww,`makeContentId`);var Tw=gw,Ew=vw,Dw=bw,Ow=Sw,kw=Object.defineProperty,Aw=(e,t)=>kw(e,`name`,{value:t,configurable:!0}),[jw,Mw]=Dm(`Tooltip`,[zb]),Nw=zb(),Pw=`TooltipProvider`,Fw=700,Iw=`tooltip.open`,[Lw,Rw]=jw(Pw),zw=Aw(e=>{let{__scopeTooltip:t,delayDuration:n=Fw,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=v.useRef(!0),s=v.useRef(!1),c=v.useRef(0);return v.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,X.jsx)(Lw,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:v.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:v.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Bw=`Tooltip`,[Vw,Hw]=jw(Bw),Uw=Aw(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Rw(Bw,e.__scopeTooltip),l=Nw(t),[u,d]=v.useState(null),[f,p]=v.useState(void 0),m=Sh(),h=v.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,y=v.useRef(!1),[b,x]=ih({prop:r,defaultProp:i??!1,onChange:Aw(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Iw))):c.onClose(),a?.(e)},`onChange`),caller:Bw}),S=v.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=v.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=v.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},_)},[_,x]);v.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let ee=f??m;return(0,X.jsx)(tx,{...l,children:(0,X.jsx)(Vw,{scope:t,contentId:ee,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:v.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:v.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Ww=`TooltipTrigger`,Gw=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,...r}=e,i=Hw(Ww,n),a=Rw(Ww,n),o=Nw(n),s=Xp(t,v.useRef(null),i.onTriggerChange),c=v.useRef(!1),l=v.useRef(!1),u=v.useCallback(()=>c.current=!1,[]);return v.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,X.jsx)(nx,{asChild:!0,...o,children:(0,X.jsx)(vm.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Z(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Z(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Z(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Z(e.onBlur,i.onClose),onClick:Z(e.onClick,i.onClose)})})},`TooltipTrigger`)),Kw=`TooltipPortal`,[qw,Jw]=jw(Kw,{forceMount:void 0}),Yw=Aw(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Hw(Kw,t);return(0,X.jsx)(qw,{scope:t,forceMount:n,children:(0,X.jsx)(fh,{present:n||a.open,children:(0,X.jsx)(Cg,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Xw=`TooltipContent`,Zw=v.forwardRef(Aw(function(e,t){let n=Jw(Xw,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Hw(Xw,e.__scopeTooltip);return(0,X.jsx)(fh,{present:r||o.open,children:o.disableHoverableContent?(0,X.jsx)(eT,{side:i,...a,ref:t}):(0,X.jsx)(Qw,{side:i,...a,ref:t})})},`TooltipContent`)),Qw=v.forwardRef(Aw(function(e,t){let n=Hw(Xw,e.__scopeTooltip),r=Rw(Xw,e.__scopeTooltip),i=v.useRef(null),a=Xp(t,i),[o,s]=v.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=v.useCallback(()=>{s(null),d(!1)},[d]),p=v.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=rT(r,nT(r,n.getBoundingClientRect())),a=iT(t.getBoundingClientRect()),o=oT([...i,...a]);s(o),d(!0)},[d]);return v.useEffect(()=>()=>f(),[f]),v.useEffect(()=>{if(c&&u){let e=Aw(e=>p(e,u),`handleTriggerLeave`),t=Aw(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),v.useEffect(()=>{if(o){let e=Aw(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!aT(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,X.jsx)(eT,{...e,ref:a})},`TooltipContentHoverable`)),$w=nm(`TooltipContent`),eT=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Hw(Xw,n),u=Nw(n),{onClose:d}=l;v.useEffect(()=>(document.addEventListener(Iw,d),()=>document.removeEventListener(Iw,d)),[d]),v.useEffect(()=>{if(l.trigger){let e=Aw(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Ym(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,X.jsx)(Qh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,X.jsxs)(rx,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,X.jsx)($w,{children:r}),i?(0,X.jsx)(Cm,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),tT=v.forwardRef(Aw(function(e,t){let{__scopeTooltip:n,...r}=e,i=Nw(n);return(0,X.jsx)(ix,{...i,...r,ref:t})},`TooltipArrow`));function nT(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Aw(nT,`getExitSideFromRect`);function rT(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Aw(rT,`getPaddedExitPoints`);function iT(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Aw(iT,`getPointsFromRect`);function aT(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Aw(aT,`isPointInPolygon`);function oT(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),sT(t)}Aw(oT,`getHull`);function sT(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Aw(sT,`getHullPresorted`);var cT=zw,lT=Uw,uT=Gw,dT=Yw,fT=Zw,pT=tT,mT=l(xp(),1);function hT({...e}){return(0,X.jsx)(Lh,{"data-slot":`collapsible`,...e})}function gT({...e}){return(0,X.jsx)(Mh,{"data-slot":`collapsible-trigger`,...e})}function _T({...e}){return(0,X.jsx)(Ph,{"data-slot":`collapsible-content`,...e})}function vT(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=vT(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function yT(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=vT(e))&&(r&&(r+=` `),r+=t);return r}var bT=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,xT=yT,ST=(e,t)=>n=>{if(t?.variants==null)return xT(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=bT(t)||bT(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return xT(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},CT=768;function wT(){let[e,t]=v.useState(void 0);return v.useEffect(()=>{let e=window.matchMedia(`(max-width: 767px)`),n=()=>{t(window.innerWidth<CT)};return e.addEventListener(`change`,n),t(window.innerWidth<CT),()=>e.removeEventListener(`change`,n)},[]),!!e}var TT=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ET=(e,t)=>({classGroupId:e,validator:t}),DT=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),OT=`-`,kT=[],AT=`arbitrary..`,jT=e=>{let t=PT(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return NT(e);let n=e.split(OT);return MT(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?TT(i,t):t:i||kT}return n[e]||kT}}},MT=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=MT(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(OT):e.slice(t).join(OT),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},NT=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?AT+r:void 0})(),PT=e=>{let{theme:t,classGroups:n}=e;return FT(n,t)},FT=(e,t)=>{let n=DT();for(let r in e){let i=e[r];IT(i,n,r,t)}return n},IT=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];LT(i,t,n,r)}},LT=(e,t,n,r)=>{if(typeof e==`string`){RT(e,t,n);return}if(typeof e==`function`){zT(e,t,n,r);return}BT(e,t,n,r)},RT=(e,t,n)=>{let r=e===``?t:VT(t,e);r.classGroupId=n},zT=(e,t,n,r)=>{if(HT(e)){IT(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ET(n,e))},BT=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];IT(o,VT(t,a),n,r)}},VT=(e,t)=>{let n=e,r=t.split(OT),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=DT(),n.nextPart.set(t,i)),n=i}return n},HT=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,UT=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},WT=`!`,GT=`:`,KT=[],qT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),JT=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===GT){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(WT)?(c=s.slice(0,-1),l=!0):s.startsWith(WT)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return qT(t,l,c,u)};if(t){let e=t+GT,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):qT(KT,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},YT=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},XT=e=>({cache:UT(e.cacheSize),parseClassName:JT(e),sortModifiers:YT(e),postfixLookupClassGroupIds:ZT(e),...jT(e)}),ZT=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},QT=/\s+/,$T=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(QT),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+WT:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},eE=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=tE(n))&&(i&&(i+=` `),i+=r);return i},tE=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=tE(e[r]))&&(n&&(n+=` `),n+=t);return n},nE=(e,...t)=>{let n,r,i,a,o=o=>(n=XT(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=$T(e,n);return i(e,a),a};return a=o,(...e)=>a(eE(...e))},rE=[],iE=e=>{let t=t=>t[e]||rE;return t.isThemeGetter=!0,t},aE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,oE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sE=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,cE=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lE=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uE=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,dE=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fE=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pE=e=>sE.test(e),mE=e=>!!e&&!Number.isNaN(Number(e)),hE=e=>!!e&&Number.isInteger(Number(e)),gE=e=>e.endsWith(`%`)&&mE(e.slice(0,-1)),_E=e=>cE.test(e),vE=()=>!0,yE=e=>lE.test(e)&&!uE.test(e),bE=()=>!1,xE=e=>dE.test(e),SE=e=>fE.test(e),CE=e=>!Q(e)&&!$(e),wE=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),TE=e=>BE(e,WE,bE),Q=e=>aE.test(e),EE=e=>BE(e,GE,yE),DE=e=>BE(e,KE,mE),OE=e=>BE(e,JE,vE),kE=e=>BE(e,qE,bE),AE=e=>BE(e,HE,bE),jE=e=>BE(e,UE,SE),ME=e=>BE(e,YE,xE),$=e=>oE.test(e),NE=e=>VE(e,GE),PE=e=>VE(e,qE),FE=e=>VE(e,HE),IE=e=>VE(e,WE),LE=e=>VE(e,UE),RE=e=>VE(e,YE,!0),zE=e=>VE(e,JE,!0),BE=(e,t,n)=>{let r=aE.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},VE=(e,t,n=!1)=>{let r=oE.exec(e);return r?r[1]?t(r[1]):n:!1},HE=e=>e===`position`||e===`percentage`,UE=e=>e===`image`||e===`url`,WE=e=>e===`length`||e===`size`||e===`bg-size`,GE=e=>e===`length`,KE=e=>e===`number`,qE=e=>e===`family-name`,JE=e=>e===`number`||e===`weight`,YE=e=>e===`shadow`,XE=nE(()=>{let e=iE(`color`),t=iE(`font`),n=iE(`text`),r=iE(`font-weight`),i=iE(`tracking`),a=iE(`leading`),o=iE(`breakpoint`),s=iE(`container`),c=iE(`spacing`),l=iE(`radius`),u=iE(`shadow`),d=iE(`inset-shadow`),f=iE(`text-shadow`),p=iE(`drop-shadow`),m=iE(`blur`),h=iE(`perspective`),g=iE(`aspect`),_=iE(`ease`),v=iE(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),$,Q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[$,Q,c],T=()=>[pE,`full`,`auto`,...w()],ee=()=>[hE,`none`,`subgrid`,$,Q],te=()=>[`auto`,{span:[`full`,hE,$,Q]},hE,$,Q],ne=()=>[hE,`auto`,$,Q],re=()=>[`auto`,`min`,`max`,`fr`,$,Q],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],E=()=>[`auto`,...w()],oe=()=>[pE,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],se=()=>[pE,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[pE,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[e,$,Q],le=()=>[...b(),FE,AE,{position:[$,Q]}],ue=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],de=()=>[`auto`,`cover`,`contain`,IE,TE,{size:[$,Q]}],fe=()=>[gE,NE,EE],pe=()=>[``,`none`,`full`,l,$,Q],me=()=>[``,mE,NE,EE],he=()=>[`solid`,`dashed`,`dotted`,`double`],ge=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],_e=()=>[mE,gE,FE,AE],ve=()=>[``,`none`,m,$,Q],ye=()=>[`none`,mE,$,Q],be=()=>[`none`,mE,$,Q],xe=()=>[mE,$,Q],Se=()=>[pE,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[_E],breakpoint:[_E],color:[vE],container:[_E],"drop-shadow":[_E],ease:[`in`,`out`,`in-out`],font:[CE],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[_E],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[_E],shadow:[_E],spacing:[`px`,mE],text:[_E],"text-shadow":[_E],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,pE,Q,$,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,$,Q]}],"container-named":[wE],columns:[{columns:[mE,Q,$,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[hE,`auto`,$,Q]}],basis:[{basis:[pE,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[mE,pE,`auto`,`initial`,`none`,Q]}],grow:[{grow:[``,mE,$,Q]}],shrink:[{shrink:[``,mE,$,Q]}],order:[{order:[hE,`first`,`last`,`none`,$,Q]}],"grid-cols":[{"grid-cols":ee()}],"col-start-end":[{col:te()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":ee()}],"row-start-end":[{row:te()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:E()}],mx:[{mx:E()}],my:[{my:E()}],ms:[{ms:E()}],me:[{me:E()}],mbs:[{mbs:E()}],mbe:[{mbe:E()}],mt:[{mt:E()}],mr:[{mr:E()}],mb:[{mb:E()}],ml:[{ml:E()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:oe()}],"inline-size":[{inline:[`auto`,...se()]}],"min-inline-size":[{"min-inline":[`auto`,...se()]}],"max-inline-size":[{"max-inline":[`none`,...se()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[s,`screen`,...oe()]}],"min-w":[{"min-w":[s,`screen`,`none`,...oe()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...oe()]}],h:[{h:[`screen`,`lh`,...oe()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...oe()]}],"max-h":[{"max-h":[`screen`,`lh`,...oe()]}],"font-size":[{text:[`base`,n,NE,EE]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,zE,OE]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,gE,Q]}],"font-family":[{font:[PE,kE,t]}],"font-features":[{"font-features":[Q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,$,Q]}],"line-clamp":[{"line-clamp":[mE,`none`,$,DE]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,$,Q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,$,Q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...he(),`wavy`]}],"text-decoration-thickness":[{decoration:[mE,`from-font`,`auto`,$,EE]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[mE,`auto`,$,Q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[hE,$,Q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,$,Q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,$,Q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ue()}],"bg-size":[{bg:de()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},hE,$,Q],radial:[``,$,Q],conic:[hE,$,Q]},LE,jE]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:fe()}],"gradient-via-pos":[{via:fe()}],"gradient-to-pos":[{to:fe()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:pe()}],"rounded-s":[{"rounded-s":pe()}],"rounded-e":[{"rounded-e":pe()}],"rounded-t":[{"rounded-t":pe()}],"rounded-r":[{"rounded-r":pe()}],"rounded-b":[{"rounded-b":pe()}],"rounded-l":[{"rounded-l":pe()}],"rounded-ss":[{"rounded-ss":pe()}],"rounded-se":[{"rounded-se":pe()}],"rounded-ee":[{"rounded-ee":pe()}],"rounded-es":[{"rounded-es":pe()}],"rounded-tl":[{"rounded-tl":pe()}],"rounded-tr":[{"rounded-tr":pe()}],"rounded-br":[{"rounded-br":pe()}],"rounded-bl":[{"rounded-bl":pe()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":me()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...he(),`hidden`,`none`]}],"divide-style":[{divide:[...he(),`hidden`,`none`]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-bs":[{"border-bs":D()}],"border-color-be":[{"border-be":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...he(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[mE,$,Q]}],"outline-w":[{outline:[``,mE,NE,EE]}],"outline-color":[{outline:D()}],shadow:[{shadow:[``,`none`,u,RE,ME]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":[`none`,d,RE,ME]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:me()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[mE,EE]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":[`none`,f,RE,ME]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[mE,$,Q]}],"mix-blend":[{"mix-blend":[...ge(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[mE]}],"mask-image-linear-from-pos":[{"mask-linear-from":_e()}],"mask-image-linear-to-pos":[{"mask-linear-to":_e()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":_e()}],"mask-image-t-to-pos":[{"mask-t-to":_e()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":_e()}],"mask-image-r-to-pos":[{"mask-r-to":_e()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":_e()}],"mask-image-b-to-pos":[{"mask-b-to":_e()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":_e()}],"mask-image-l-to-pos":[{"mask-l-to":_e()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":_e()}],"mask-image-x-to-pos":[{"mask-x-to":_e()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":_e()}],"mask-image-y-to-pos":[{"mask-y-to":_e()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[$,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":_e()}],"mask-image-radial-to-pos":[{"mask-radial-to":_e()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[mE]}],"mask-image-conic-from-pos":[{"mask-conic-from":_e()}],"mask-image-conic-to-pos":[{"mask-conic-to":_e()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ue()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,$,Q]}],filter:[{filter:[``,`none`,$,Q]}],blur:[{blur:ve()}],brightness:[{brightness:[mE,$,Q]}],contrast:[{contrast:[mE,$,Q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,RE,ME]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:[``,mE,$,Q]}],"hue-rotate":[{"hue-rotate":[mE,$,Q]}],invert:[{invert:[``,mE,$,Q]}],saturate:[{saturate:[mE,$,Q]}],sepia:[{sepia:[``,mE,$,Q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,$,Q]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[mE,$,Q]}],"backdrop-contrast":[{"backdrop-contrast":[mE,$,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,mE,$,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[mE,$,Q]}],"backdrop-invert":[{"backdrop-invert":[``,mE,$,Q]}],"backdrop-opacity":[{"backdrop-opacity":[mE,$,Q]}],"backdrop-saturate":[{"backdrop-saturate":[mE,$,Q]}],"backdrop-sepia":[{"backdrop-sepia":[``,mE,$,Q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,$,Q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[mE,`initial`,$,Q]}],ease:[{ease:[`linear`,`initial`,_,$,Q]}],delay:[{delay:[mE,$,Q]}],animate:[{animate:[`none`,v,$,Q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,$,Q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ye()}],"rotate-x":[{"rotate-x":ye()}],"rotate-y":[{"rotate-y":ye()}],"rotate-z":[{"rotate-z":ye()}],scale:[{scale:be()}],"scale-x":[{"scale-x":be()}],"scale-y":[{"scale-y":be()}],"scale-z":[{"scale-z":be()}],"scale-3d":[`scale-3d`],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[$,Q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:Se()}],"translate-x":[{"translate-x":Se()}],"translate-y":[{"translate-y":Se()}],"translate-z":[{"translate-z":Se()}],"translate-none":[`translate-none`],zoom:[{zoom:[hE,$,Q]}],accent:[{accent:D()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,$,Q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":D()}],"scrollbar-track-color":[{"scrollbar-track":D()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,$,Q]}],fill:[{fill:[`none`,...D()]}],"stroke-w":[{stroke:[mE,NE,EE,DE]}],stroke:[{stroke:[`none`,...D()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function ZE(...e){return XE(yT(e))}var QE=ST(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function $E({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?em:`button`;return(0,X.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:ZE(QE({variant:t,size:n,className:e})),...i})}function eD({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,X.jsx)(sw,{"data-slot":`separator`,decorative:n,orientation:t,className:ZE(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function tD({...e}){return(0,X.jsx)(Q_,{"data-slot":`sheet`,...e})}function nD({...e}){return(0,X.jsx)(nv,{"data-slot":`sheet-portal`,...e})}function rD({className:e,...t}){return(0,X.jsx)(iv,{"data-slot":`sheet-overlay`,className:ZE(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function iD({className:e,children:t,side:n=`right`,showCloseButton:r=!0,...i}){return(0,X.jsxs)(nD,{children:[(0,X.jsx)(rD,{}),(0,X.jsxs)(cv,{"data-slot":`sheet-content`,className:ZE(`fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500`,n===`right`&&`inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm`,n===`left`&&`inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm`,n===`top`&&`inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top`,n===`bottom`&&`inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom`,e),...i,children:[t,r&&(0,X.jsxs)(_v,{className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary`,children:[(0,X.jsx)(Gp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function aD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sheet-header`,className:ZE(`flex flex-col gap-1.5 p-4`,e),...t})}function oD({className:e,...t}){return(0,X.jsx)(pv,{"data-slot":`sheet-title`,className:ZE(`font-semibold text-foreground`,e),...t})}function sD({className:e,...t}){return(0,X.jsx)(hv,{"data-slot":`sheet-description`,className:ZE(`text-sm text-muted-foreground`,e),...t})}function cD({delayDuration:e=0,...t}){return(0,X.jsx)(cT,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function lD({...e}){return(0,X.jsx)(lT,{"data-slot":`tooltip`,...e})}function uD({...e}){return(0,X.jsx)(uT,{"data-slot":`tooltip-trigger`,...e})}function dD({className:e,sideOffset:t=0,children:n,...r}){return(0,X.jsx)(dT,{children:(0,X.jsxs)(fT,{"data-slot":`tooltip-content`,sideOffset:t,className:ZE(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,X.jsx)(pT,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}var fD=`sidebar_state`,pD=604800,mD=`16rem`,hD=`18rem`,gD=`3rem`,_D=`b`,vD=v.createContext(null);function yD(){let e=v.useContext(vD);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function bD({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o}){let s=wT(),[c,l]=v.useState(!1),[u,d]=v.useState(e),f=t??u,p=v.useCallback(e=>{let t=typeof e==`function`?e(f):e;n?n(t):d(t),document.cookie=`${fD}=${t}; path=/; max-age=${pD}`},[n,f]),m=v.useCallback(()=>s?l(e=>!e):p(e=>!e),[s,p,l]);v.useEffect(()=>{let e=e=>{e.key===_D&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),m())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[m]);let h=f?`expanded`:`collapsed`,g=v.useMemo(()=>({state:h,open:f,setOpen:p,isMobile:s,openMobile:c,setOpenMobile:l,toggleSidebar:m}),[h,f,p,s,c,l,m]);return(0,X.jsx)(vD.Provider,{value:g,children:(0,X.jsx)(cD,{delayDuration:0,children:(0,X.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":mD,"--sidebar-width-icon":gD,...i},className:ZE(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),...o,children:a})})})}function xD({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a}){let{isMobile:o,state:s,openMobile:c,setOpenMobile:l}=yD();return n===`none`?(0,X.jsx)(`div`,{"data-slot":`sidebar`,className:ZE(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),...a,children:i}):o?(0,X.jsx)(tD,{open:c,onOpenChange:l,...a,children:(0,X.jsxs)(iD,{"data-sidebar":`sidebar`,"data-slot":`sidebar`,"data-mobile":`true`,className:`w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":hD},side:e,children:[(0,X.jsxs)(aD,{className:`sr-only`,children:[(0,X.jsx)(oD,{children:`Sidebar`}),(0,X.jsx)(sD,{children:`Displays the mobile sidebar.`})]}),(0,X.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})]})}):(0,X.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":s,"data-collapsible":s===`collapsed`?n:``,"data-variant":t,"data-side":e,"data-slot":`sidebar`,children:[(0,X.jsx)(`div`,{"data-slot":`sidebar-gap`,className:ZE(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,X.jsx)(`div`,{"data-slot":`sidebar-container`,className:ZE(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,X.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow-sm`,children:i})})]})}function SD({className:e,onClick:t,...n}){let{toggleSidebar:r}=yD();return(0,X.jsxs)($E,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:ZE(`size-7`,e),onClick:e=>{t?.(e),r()},...n,children:[(0,X.jsx)(Hp,{}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function CD({className:e,...t}){return(0,X.jsx)(`main`,{"data-slot":`sidebar-inset`,className:ZE(`relative flex w-full flex-1 flex-col bg-background`,`md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,e),...t})}function wD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:ZE(`flex flex-col gap-2 p-2`,e),...t})}function TD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:ZE(`flex flex-col gap-2 p-2`,e),...t})}function ED({className:e,...t}){return(0,X.jsx)(eD,{"data-slot":`sidebar-separator`,"data-sidebar":`separator`,className:ZE(`mx-2 w-auto bg-sidebar-border`,e),...t})}function DD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:ZE(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t})}function OD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:ZE(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function kD({className:e,asChild:t=!1,...n}){let r=t?em:`div`;return(0,X.jsx)(r,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:ZE(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n})}function AD({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:ZE(`w-full text-sm`,e),...t})}function jD({className:e,...t}){return(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:ZE(`flex w-full min-w-0 flex-col gap-1`,e),...t})}function MD({className:e,...t}){return(0,X.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:ZE(`group/menu-item relative`,e),...t})}var ND=ST(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function PD({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o}){let s=e?em:`button`,{isMobile:c,state:l}=yD(),u=(0,X.jsx)(s,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:ZE(ND({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,X.jsxs)(lD,{children:[(0,X.jsx)(uD,{asChild:!0,children:u}),(0,X.jsx)(dD,{side:`right`,align:`center`,hidden:l!==`collapsed`||c,...i})]})):u}function FD({className:e,asChild:t=!1,showOnHover:n=!1,...r}){let i=t?em:`button`;return(0,X.jsx)(i,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:ZE(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 md:after:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground data-[state=open]:opacity-100 md:opacity-0`,e),...r})}function ID({className:e,...t}){return(0,X.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:ZE(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t})}function LD({className:e,...t}){return(0,X.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:ZE(`group/menu-sub-item relative`,e),...t})}function RD({asChild:e=!1,size:t=`md`,isActive:n=!1,className:r,...i}){let a=e?em:`a`;return(0,X.jsx)(a,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:ZE(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i})}function zD(e){return`/agents/`+encodeURIComponent(e)}function BD(e,t){return zD(e)+`/sessions/`+encodeURIComponent(t)}function VD(e){return e.title?.replace(/\s+/gu,` `).trim()||`New session`}function HD({status:e}){return e===`running`?(0,X.jsx)(Vp,{className:`ml-auto size-3.5 shrink-0 animate-spin text-muted-foreground`,"aria-label":`Running`}):e===`waiting`?(0,X.jsx)(`span`,{className:`ml-auto size-1.5 shrink-0 rounded-full bg-amber-500`,"aria-label":`Waiting for input`}):(0,X.jsx)(`span`,{className:`ml-auto size-1.5 shrink-0 rounded-full bg-muted-foreground`,"aria-label":`Idle`})}function UD({session:e,active:t,agentId:n}){let r=VD(e);return(0,X.jsx)(LD,{children:(0,X.jsx)(RD,{asChild:!0,isActive:t,size:`sm`,children:(0,X.jsxs)(zn,{to:BD(n,e.session),title:r,children:[(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:r}),(0,X.jsx)(HD,{status:e.status})]})})})}function WD({agent:e,sessions:t,activeAgentId:n,activeSessionId:r}){let i=Dt(),[a,o]=(0,v.useState)(!0);(0,v.useEffect)(()=>{e.id===n&&o(!0)},[e.id,n]);let s=n===e.id&&r!==void 0&&!t.some(e=>e.session===r)?[{session:r,status:`idle`,startedAt:Date.now()},...t]:t;return(0,X.jsx)(hT,{open:a,onOpenChange:o,asChild:!0,children:(0,X.jsxs)(MD,{children:[(0,X.jsx)(PD,{asChild:!0,isActive:e.id===n,tooltip:e.name,children:(0,X.jsxs)(zn,{to:zD(e.id),children:[(0,X.jsx)(Np,{}),(0,X.jsx)(`span`,{children:e.name})]})}),(0,X.jsx)(gT,{asChild:!0,children:(0,X.jsxs)(FD,{className:`data-[state=open]:rotate-90`,children:[(0,X.jsx)(Ip,{}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[`Toggle `,e.name,` sessions`]})]})}),(0,X.jsxs)(FD,{className:`right-7`,showOnHover:!0,onClick:()=>{i(BD(e.id,crypto.randomUUID()))},children:[(0,X.jsx)(Lp,{}),(0,X.jsxs)(`span`,{className:`sr-only`,children:[`New `,e.name,` session`]})]}),(0,X.jsx)(_T,{children:(0,X.jsx)(ID,{children:s.length===0?(0,X.jsx)(LD,{children:(0,X.jsx)(`span`,{className:`block px-2 py-1 text-xs text-muted-foreground`,children:`No sessions yet`})}):s.map(t=>(0,X.jsx)(UD,{session:t,active:t.session===r,agentId:e.id},t.session))})})]})})}function GD({connection:e}){let t=e.status===`Running`,n=t?`bg-emerald-500`:e.status===`Connecting`?`bg-amber-500`:`bg-muted-foreground`,r=(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(`span`,{className:`size-2 shrink-0 rounded-full `+n}),e.status===`Connecting`?(0,X.jsx)(Vp,{className:`size-3.5 shrink-0 animate-spin`}):t?(0,X.jsx)(Mp,{className:`size-3.5 shrink-0`}):(0,X.jsx)(Wp,{className:`size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`group-data-[collapsible=icon]:hidden`,children:e.status})]});return e.url===void 0?r:(0,X.jsxs)(lD,{children:[(0,X.jsx)(uD,{asChild:!0,children:r}),(0,X.jsx)(dD,{side:`right`,children:e.url})]})}function KD({connection:e,activeAgentId:t,activeSessionId:n}){let r=e.status===`Running`?e.agents.length+` agent`+(e.agents.length===1?``:`s`):`Agent server unavailable`;return(0,X.jsxs)(xD,{collapsible:`icon`,children:[(0,X.jsx)(wD,{children:(0,X.jsx)(jD,{children:(0,X.jsx)(MD,{children:(0,X.jsx)(PD,{size:`lg`,asChild:!0,children:(0,X.jsxs)(zn,{to:`/`,children:[(0,X.jsx)(`div`,{className:`flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground`,children:(0,X.jsx)(`img`,{alt:``,"aria-hidden":!0,className:`size-5 dark:invert`,height:20,src:`/brand/nylorun-mark-white.svg`,width:20})}),(0,X.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,X.jsx)(`span`,{className:`truncate font-medium`,children:`Nylorun`}),(0,X.jsx)(`span`,{className:`truncate text-xs`,children:`Studio`})]})]})})})})}),(0,X.jsx)(DD,{children:(0,X.jsxs)(OD,{children:[(0,X.jsx)(kD,{children:`Agents`}),(0,X.jsx)(AD,{children:(0,X.jsxs)(jD,{children:[e.agents.map(r=>(0,X.jsx)(WD,{agent:r,sessions:e.sessionsByAgent[r.id]??[],activeAgentId:t,activeSessionId:n},r.id)),e.status===`Running`&&e.agents.length===0?(0,X.jsx)(MD,{children:(0,X.jsx)(`span`,{className:`block px-2 py-1 text-sm text-muted-foreground`,children:`No agents exposed`})}):null,e.status===`Connecting`?(0,X.jsx)(MD,{children:(0,X.jsxs)(`span`,{className:`flex items-center gap-2 px-2 py-1 text-sm text-muted-foreground`,children:[(0,X.jsx)(Vp,{className:`size-4 animate-spin`}),`Discovering agents`]})}):null]})})]})}),(0,X.jsxs)(TD,{children:[(0,X.jsx)(ED,{}),(0,X.jsxs)(`div`,{className:`flex flex-col gap-2 px-2 py-1.5 text-xs text-sidebar-foreground/70 group-data-[collapsible=icon]:items-center group-data-[collapsible=icon]:px-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(Rp,{className:`size-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`group-data-[collapsible=icon]:hidden`,children:r})]}),(0,X.jsx)(GD,{connection:e})]})]})]})}function qD({className:e,...t}){return(0,X.jsx)(`textarea`,{"data-slot":`textarea`,className:ZE(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...t})}function JD({value:e,onChange:t,onSubmit:n,attachment:r,onAttachmentChange:i,acceptedTypes:a=[],maxBytes:o,disabled:s=!1,sending:c=!1,placeholder:l,submitLabel:u=`Send message`,autoFocus:d=!1}){let f=(0,v.useRef)(null),[p,m]=(0,v.useState)(),h=s||c,g=i!==void 0&&a.length>0,_=!h&&(e.trim()!==``||r!==void 0),y=e=>{e?.preventDefault(),_&&n()};return(0,X.jsxs)(`form`,{onSubmit:y,children:[r===void 0?null:(0,X.jsxs)(`div`,{className:`mb-2 flex w-fit items-start gap-2 rounded-lg border bg-muted/40 p-1.5`,children:[(0,X.jsx)(`img`,{src:r.previewUrl,alt:`Attached room`,className:`h-16 w-20 rounded object-cover`}),(0,X.jsxs)($E,{type:`button`,size:`icon`,variant:`ghost`,className:`size-6`,disabled:h,onClick:()=>i?.(void 0),children:[(0,X.jsx)(Gp,{className:`size-3.5`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Remove image`})]})]}),(0,X.jsxs)(`div`,{className:`flex items-end gap-2 rounded-xl border bg-muted/40 p-2 focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50`,children:[g?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`input`,{ref:f,type:`file`,accept:a.join(`,`),className:`sr-only`,onChange:e=>{let t=e.target.files?.[0];if(e.target.value=``,!t)return;if(!a.includes(t.type)){m(`Choose a JPEG, PNG, or WebP image.`);return}if(o!==void 0&&t.size>o){m(`Images must be no larger than ${Math.floor(o/1048576)} MiB.`);return}let n=new FileReader;n.onerror=()=>m(`Studio could not read that image.`),n.onload=()=>{let e=typeof n.result==`string`?n.result:``,r=`data:${t.type};base64,`;if(!e.startsWith(r)){m(`Studio could not encode that image.`);return}m(void 0),i?.({mediaType:t.type,base64:e.slice(r.length),previewUrl:e})},n.readAsDataURL(t)},disabled:h}),(0,X.jsxs)($E,{type:`button`,size:`icon`,variant:`ghost`,className:`mb-0.5 shrink-0`,disabled:h,onClick:()=>f.current?.click(),children:[(0,X.jsx)(Bp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Attach image`})]})]}):null,(0,X.jsx)(qD,{value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||e.keyCode===229||(e.preventDefault(),y())},disabled:h,placeholder:l,autoFocus:d,rows:1,className:`min-h-12 max-h-40 flex-1 resize-none overflow-y-auto border-0 bg-transparent py-1.5 shadow-none focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`}),(0,X.jsxs)($E,{type:`submit`,size:`icon`,disabled:!_,className:`mb-0.5 shrink-0`,"aria-busy":c,children:[c?(0,X.jsx)(Vp,{className:`size-4 animate-spin`}):(0,X.jsx)(Up,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:u})]})]}),p===void 0?null:(0,X.jsx)(`p`,{role:`alert`,className:`mt-1.5 text-[11px] text-destructive`,children:p}),(0,X.jsx)(`p`,{className:`mt-1.5 text-[11px] text-muted-foreground`,children:`Enter to send · Shift+Enter for a new line`})]})}var YD=ST(`inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function XD({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?em:`span`;return(0,X.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:ZE(YD({variant:t}),e),...r})}function ZD(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function QD(e,t){let n=getComputedStyle(e.ownerDocument.documentElement);return t*parseFloat(n.fontSize)}function $D(e){return e/100*window.innerHeight}function eO(e){return e/100*window.innerWidth}function tO(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function nO({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=tO(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=QD(t,i);break;case`em`:r=ZD(t,i);break;case`vh`:r=$D(i);break;case`vw`:r=eO(i)}return r}function rO(e){return parseFloat(e.toFixed(3))}function iO({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function aO(e){let{panels:t}=e,n=iO({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=rO(nO({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=rO(nO({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=rO(nO({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=rO(nO({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function oO(e,t=`Assertion error`){if(!e)throw Error(t)}function sO(e,t){return Array.from(t).sort(e===`horizontal`?cO:lO)}function cO(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function lO(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function uO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function dO(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function fO({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=dO(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return oO(i,`No rect found`),i}var pO;function mO(){return pO===void 0&&(pO=typeof matchMedia==`function`&&!!matchMedia(`(pointer:coarse)`).matches),pO}function hO(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=sO(n,Array.from(t.children).filter(uO).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,fO({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=mO()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:iO({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var gO=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0){if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},_O={cursorFlags:0,state:`inactive`},vO=new gO;function yO(){return _O}function bO(e){return vO.addListener(`change`,e)}function xO(e){let t=_O,n={..._O};n.cursorFlags=e,_O=n,vO.emit(`change`,{prev:t,next:n})}function SO(e){let t=_O;_O=e,vO.emit(`change`,{prev:t,next:e})}var CO=e=>e,wO=()=>{},TO=1,EO=2,DO=4,OO=8,kO=3,AO=12,jO;function MO(){return jO===void 0&&(jO=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(jO=!0)),jO}function NO({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++}})}if(r!==0||i!==0){if(n===`active`&&e&&MO()){let t=(e&TO)!==0,n=(e&EO)!==0,r=(e&DO)!==0,i=(e&OO)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}return MO()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var PO=new WeakMap;function FO(e){if(!e.defaultView||!e.adoptedStyleSheets)return;let{prevStyle:t,styleSheet:n}=PO.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&(Object.isExtensible(e.adoptedStyleSheets)?e.adoptedStyleSheets.push(n):e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]));let r=yO();switch(r.state){case`active`:case`hover`:{let e=NO({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0)}PO.set(e,{prevStyle:t,styleSheet:n})}var IO=new Map,LO=new gO;function RO(e){IO=new Map(IO),IO.delete(e)}function zO(e,t){for(let[t]of IO)if(t.id===e)return t}function BO(e,t){for(let[t,n]of IO)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function VO(){return IO}function HO(e,t){return LO.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function UO(e,t,n){let r=IO.get(e);IO=new Map(IO),IO.set(e,t),LO.emit(`groupChange`,{group:e,isUserInteraction:n?.isUserInteraction===!0,prev:r,next:t})}function WO(e){let t=yO(),n=VO(),r=!1;return t.state===`active`&&(SO({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(FO(e),r=!0,t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=BO(e.group.id,!0);UO(e.group,t,{isUserInteraction:!0})}))),r}function GO(e){e.defaultPrevented||WO(e.currentTarget)}function KO(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=dO(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t)}}return r?{distance:i,hitRegion:r}:void 0}function qO(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function JO(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:ek(e),b:ek(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();oO(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:$O(QO(n.a)),b:$O(QO(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var YO=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function XO(e){let t=getComputedStyle(tk(e)??e).display;return t===`flex`||t===`inline-flex`}function ZO(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||XO(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||YO.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function QO(e){let t=e.length;for(;t--;){let n=e[t];if(oO(n,`Missing node`),ZO(n))return n}return null}function $O(e){return e&&Number(getComputedStyle(e).zIndex)||0}function ek(e){let t=[];for(;e;)t.push(e),e=tk(e);return t}function tk(e){let{parentNode:t}=e;return qO(t)?t.host:t}function nk(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rk({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!uO(n)||n.contains(e)||e.contains(n))return!0;if(JO(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(nk(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ik(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=hO(r),a=KO(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&rk({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function ak(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function ok(e,t,n=0){return Math.abs(rO(e)-rO(t))<=n}function sk(e,t){return ok(e,t)?0:e>t?1:-1}function ck({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(sk(r,c)<0){if(a){let e=(i+c)/2;r=sk(r,e)<0?i:c}else r=c}return r=Math.min(s,r),r=rO(r),r}function lk({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(ok(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;oO(u!=null,`Invalid first pivot index`),oO(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];oO(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(oO(n!=null,`Previous layout not found for panel index ${t}`),ok(n,i)){let t=o-n;sk(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];oO(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(oO(n!=null,`Previous layout not found for panel index ${t}`),ok(n,o)){let t=n-i;sk(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];oO(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&sk(i,c)<0){if(e>0){let t=c-o,n=t/2;sk(i+e,c)<0&&(e=sk(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;sk(i-e,c)<0&&(e=sk(100+e,n)>0?0:-t)}}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];oO(e!=null,`Previous layout not found for panel index ${r}`);let a=ck({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];oO(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=ck({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!ok(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(ak(c,l))return i;{let t=e<0?d:u,r=s[t];oO(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=ck({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!ok(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];oO(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=ck({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(ok(i,s)||(t-=s-i,l[r]=s),ok(t,0))break;e>0?r--:r++}}}if(!ok(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function uk(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||sk(e[n],t[n])!==0)return!1;return!0}function dk({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!ok(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];oO(t!=null,`No layout data found for index ${e}`);let n=100/i*t;r[e]=n}let a=0;for(let e=0;e<t.length;e++){let i=n[e];oO(i!=null,`No layout data found for index ${e}`);let o=r[e];oO(o!=null,`No layout data found for index ${e}`);let s=ck({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!ok(a,0))for(let e=0;e<t.length;e++){let n=r[e];oO(n!=null,`No layout data found for index ${e}`);let i=n+a,o=ck({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,ok(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function fk({groupId:e,panelId:t}){let n=()=>{let t=VO();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=({nextSize:e,panels:n,prevLayout:r,derivedPanelConstraints:i})=>{let o=a(),s=n.findIndex(e=>e.id===t),c=s===0,l=s===n.length-1;if(l&&e<o&&(c||n.slice(0,s).every((e,t)=>{let n=i[t];return n?.collapsible&&ok(n.collapsedSize,r[n.panelId])}))){let e=n.slice(0,s).reduce((e,t)=>e+r[t.id],0);return{...r,[t]:rO(100-e)}}return lk({delta:l?o-e:e-o,initialLayout:r,panelConstraints:i,pivotIndices:l?[s-1,s]:[s,s+1],prevLayout:r,trigger:`imperative-api`})},s=e=>{if(e===a())return;let{defaultLayoutDeferred:t,derivedPanelConstraints:r,group:i,groupSize:s,layout:c,separatorToPanels:l}=n(),u=dk({layout:o({nextSize:e,panels:i.panels,prevLayout:c,derivedPanelConstraints:r}),panelConstraints:r});uk(c,u)||UO(i,{defaultLayoutDeferred:t,derivedPanelConstraints:r,groupSize:s,layout:u,separatorToPanels:l})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),o=a();e&&o!==t&&(n.expandToSize=o,s(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:o}=i(),c=a();if(e&&c===t){let e=o.expandToSize??n;e===0&&(e=1),s(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&ok(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=iO({group:t}),o=rO(nO({groupSize:a,panelElement:r,styleProp:e})/a*100);s(o)}}}function pk(e){e.defaultPrevented||ik(e,VO()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=fk({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function mk(e){let t=VO();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function hk({groupId:e}){let t=()=>{let t=VO();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=dk({layout:e,panelConstraints:r});return n?o:(uk(o,c)||UO(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function gk(e,t){let n=mk(e),r=BO(n.id,!0),i=n.separators.find(t=>t.element===e);oO(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);oO(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=hk({groupId:n.id}).getLayout(),c=dk({layout:lk({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});uk(s,c)||UO(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function _k(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=mk(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&gk(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&gk(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&gk(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&gk(t,-5);break;case`End`:e.preventDefault(),gk(t,100);break;case`Enter`:{e.preventDefault();let n=mk(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=BO(n.id,!0),o=n.separators.find(e=>e.element===t);oO(o,`Matching separator not found`);let s=a.get(o);oO(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(oO(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];gk(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=mk(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);oO(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),gk(t,-100)}}function vk(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=VO(),n=ik(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({focusVisible:!1,preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),SO({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}function yk({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=lk({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(uk(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?TO:EO;break;case`vertical`:s|=d<0?DO:OO}}else UO(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&kO:c|=s&kO,t.movementY===0?c|=o&AO:c|=s&AO,xO(c),FO(e)}function bk(e){let t=VO(),n=yO();n.state===`active`&&yk({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}function xk(e){if(e.defaultPrevented)return;let t=yO(),n=VO();switch(t.state){case`active`:if(e.buttons===0){SO({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{if(!n.has(e.group))return;let t=BO(e.group.id,!0);UO(e.group,t,{isUserInteraction:!0})});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}yk({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ik(e,n);r.length===0?t.state!==`inactive`&&SO({cursorFlags:0,state:`inactive`}):SO({cursorFlags:0,hitRegions:r,state:`hover`}),FO(e.currentTarget);break}}}function Sk(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(yO().state){case`hover`:SO({cursorFlags:0,state:`inactive`})}}function Ck(e){e.defaultPrevented||e.pointerType===`mouse`&&e.button>0||WO(e.currentTarget)&&e.preventDefault()}function wk(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=rO(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=rO((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function Tk(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=iO({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:rO(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Ek(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Dk(e,t){return e.length===t.length&&e.every((e,n)=>Ek(e,t[n]))}function Ok({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=rO(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=rO((r[e]??0)/a*l);else{let e=rO(l/c.length);for(let t of c)u[t]=e}return u}function kk(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Ak=new Map;function jk(e){let t=!0;oO(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=iO({group:e});if(t===0)return;let n=BO(e.id);if(!n)return;let r=aO(e),i=n.defaultLayoutDeferred?wk(r):n.layout,a=dk({layout:Ok({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&uk(n.layout,a)&&Dk(n.derivedPanelConstraints,r)&&n.groupSize===t)continue;UO(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else Tk(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{oO(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=iO({group:e}),s=aO(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(kk(e.panels,l)||(l=void 0));let u=dk({layout:e.mutableState.layouts[c]??l??wk(s),panelConstraints:s}),d=e.element.ownerDocument;Ak.set(d,(Ak.get(d)??0)+1);let f=new Map;return hO(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),UO(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{oO(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,_k)}),Ak.get(d)===1&&(d.addEventListener(`contextmenu`,GO,!0),d.addEventListener(`dblclick`,pk,!0),d.addEventListener(`pointerdown`,vk,!0),d.addEventListener(`pointerleave`,bk),d.addEventListener(`pointermove`,xk),d.addEventListener(`pointerout`,Sk),d.addEventListener(`pointerup`,Ck,!0)),function(){t=!1,Ak.set(d,Math.max(0,(Ak.get(d)??0)-1)),RO(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,_k)}),Ak.get(d)||(d.removeEventListener(`contextmenu`,GO,!0),d.removeEventListener(`dblclick`,pk,!0),d.removeEventListener(`pointerdown`,vk,!0),d.removeEventListener(`pointerleave`,bk),d.removeEventListener(`pointermove`,xk),d.removeEventListener(`pointerout`,Sk),d.removeEventListener(`pointerup`,Ck,!0)),a.disconnect()}}function Mk(){let[e,t]=(0,v.useState)({});return[e,(0,v.useCallback)(()=>t({}),[])]}function Nk(e){let t=(0,v.useId)();return`${e??t}`}var Pk=typeof window<`u`?v.useLayoutEffect:v.useEffect;function Fk(e){let t=(0,v.useRef)(e);return Pk(()=>{t.current=e},[e]),(0,v.useCallback)((...e)=>t.current?.(...e),[t])}function Ik(...e){return Fk(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t}})})}function Lk(e){let t=(0,v.useRef)({...e});return Pk(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Rk=(0,v.createContext)(null);function zk(e,t){let n=(0,v.useRef)({getLayout:()=>({}),setLayout:CO});(0,v.useImperativeHandle)(t,()=>n.current,[]),Pk(()=>{Object.assign(n.current,hk({groupId:e}))})}function Bk({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,v.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Fk(e=>{uk(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Fk((e,t)=>{uk(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e,{isUserInteraction:t}))}),_=Nk(s),y=(0,v.useRef)(null),[b,x]=Mk(),S=(0,v.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=Ik(y,a);zk(_,o);let w=Fk((e,t)=>{let r=yO(),i=zO(e),a=BO(e);if(a){let e=!1;return r.state===`active`&&(e=r.hitRegions.some(e=>e.group===i)),{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),T=Lk({defaultLayout:n,disableCursor:r}),ee=(0,v.useMemo)(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:w,id:_,orientation:u,registerPanel:e=>{let t=S.current;return t.panels=sO(u,[...t.panels,e]),x(),()=>{t.panels=t.panels.filter(t=>t!==e),x()}},registerSeparator:e=>{let t=S.current;return t.separators=sO(u,[...t.separators,e]),x(),()=>{t.separators=t.separators.filter(t=>t!==e),x()}},updatePanelProps:(e,{disabled:t})=>{let n=S.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=zO(_),i=BO(_);r&&i&&UO(r,{...i,derivedPanelConstraints:aO(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=S.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[w,_,x,u,T]),te=(0,v.useRef)(null);return Pk(()=>{let e=y.current;if(e===null)return;let t=S.current,n;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=T.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};te.current=r;let a=jk(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=BO(r.id,!0);!o&&s.length>0&&(h(c),g(c,!1));let l=HO(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=ok(t.collapsedSize,i[t.panelId]),a=ok(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=yO().state!==`active`;h(i),o&&g(i,e.isUserInteraction)});return()=>{te.current=null,a(),l()}},[i,_,g,h,u,b,T]),(0,v.useEffect)(()=>{let e=te.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,X.jsx)(Rk.Provider,{value:ee,children:(0,X.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:C,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}Bk.displayName=`Group`;function Vk(){let e=(0,v.useContext)(Rk);return oO(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Hk(e,t){let{id:n}=Vk(),r=(0,v.useRef)({collapse:wO,expand:wO,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:wO});(0,v.useImperativeHandle)(t,()=>r.current,[]),Pk(()=>{Object.assign(r.current,fk({groupId:n,panelId:e}))})}function Uk({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Nk(c),_=Lk({disabled:a}),y=(0,v.useRef)(null),b=Ik(y,o),{getPanelStyles:x,id:S,orientation:C,registerPanel:w,updatePanelProps:T}=Vk(),ee=d!==null,te=Fk((e,t,n)=>{d?.(e,c,n)});Pk(()=>{let e=y.current;if(e!==null){let t={element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:ee?te:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}};return w(t)}},[s,n,r,i,ee,g,h,l,u,te,w,_]),(0,v.useEffect)(()=>{T(g,{disabled:a})},[a,g,T]),Hk(g,f);let ne=()=>{let e=x(S,g);if(e)return JSON.stringify(e)},re=(0,v.useSyncExternalStore)(e=>HO(S,e),ne,ne),ie;return ie=re?JSON.parse(re):i===void 0?{flexGrow:1}:{flexGrow:void 0,flexShrink:void 0,flexBasis:i},(0,X.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:b,style:{...Wk,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...ie},children:(0,X.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:C===`horizontal`?`pan-y`:`pan-x`},children:e})})}Uk.displayName=`Panel`;var Wk={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Gk({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=dk({layout:lk({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=dk({layout:lk({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Kk({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Nk(a),l=Lk({disabled:n,disableDoubleClick:r}),[u,d]=(0,v.useState)({}),[f,p]=(0,v.useState)(`inactive`),[m,h]=(0,v.useState)(!1),g=(0,v.useRef)(null),_=Ik(g,i),{disableCursor:y,id:b,orientation:x,registerSeparator:S,updateSeparatorProps:C}=Vk(),w=x===`horizontal`?`vertical`:`horizontal`;Pk(()=>{let e=g.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=S(t),r=bO(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=HO(b,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Gk({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[b,c,S,l]),(0,v.useEffect)(()=>{C(c,{disabled:n,disableDoubleClick:r})},[n,r,c,C]);let T;n&&!y&&(T=`not-allowed`);let ee;if(n)ee=`disabled`;else switch(f){case`active`:ee=`active`;break;default:ee=m?`focus`:f}return(0,X.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":w,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":ee,"data-testid":c,id:c,onBlur:()=>h(!1),onFocus:()=>h(!0),ref:_,role:`separator`,style:{flexBasis:`auto`,cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Kk.displayName=`Separator`;function qk({className:e,...t}){return(0,X.jsx)(Bk,{"data-slot":`resizable-panel-group`,className:ZE(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function Jk({className:e,...t}){return(0,X.jsx)(Uk,{"data-slot":`resizable-panel`,className:ZE(`flex min-h-0 flex-col overflow-hidden`,e),...t})}function Yk({withHandle:e,className:t,...n}){return(0,X.jsx)(Kk,{"data-slot":`resizable-handle`,className:ZE(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,X.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border`,children:(0,X.jsx)(zp,{className:`size-2.5`})})})}function Xk({className:e,children:t,...n}){return(0,X.jsxs)(QC,{"data-slot":`scroll-area`,className:ZE(`relative min-h-0 overflow-hidden`,e),...n,children:[(0,X.jsx)($C,{"data-slot":`scroll-area-viewport`,className:`size-full min-w-0 rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:min-w-0 [&>div]:max-w-full`,children:t}),(0,X.jsx)(Zk,{}),(0,X.jsx)(ew,{})]})}function Zk({className:e,orientation:t=`vertical`,...n}){return(0,X.jsx)(EC,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:ZE(`flex touch-none p-px transition-colors select-none`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent`,e),...n,children:(0,X.jsx)(LC,{"data-slot":`scroll-area-thumb`,className:`relative flex-1 rounded-full bg-border`})})}function Qk({...e}){return(0,X.jsx)(iC,{"data-slot":`dropdown-menu`,...e})}function $k({...e}){return(0,X.jsx)(aC,{"data-slot":`dropdown-menu-trigger`,...e})}function eA({className:e,sideOffset:t=4,...n}){return(0,X.jsx)(oC,{children:(0,X.jsx)(sC,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:ZE(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-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-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function tA({className:e,children:t,checked:n,onSelect:r,...i}){return(0,X.jsxs)(cC,{"data-slot":`dropdown-menu-checkbox-item`,className:ZE(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,onSelect:e=>{e.preventDefault(),r?.(e)},...i,children:[(0,X.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,X.jsx)(lC,{children:(0,X.jsx)(Pp,{className:`size-4`})})}),t]})}function nA({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,X.jsx)(`table`,{"data-slot":`table`,className:ZE(`w-full caption-bottom text-sm`,e),...t})})}function rA({className:e,...t}){return(0,X.jsx)(`thead`,{"data-slot":`table-header`,className:ZE(`[&_tr]:border-b`,e),...t})}function iA({className:e,...t}){return(0,X.jsx)(`tbody`,{"data-slot":`table-body`,className:ZE(`[&_tr:last-child]:border-0`,e),...t})}function aA({className:e,...t}){return(0,X.jsx)(`tr`,{"data-slot":`table-row`,className:ZE(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function oA({className:e,...t}){return(0,X.jsx)(`th`,{"data-slot":`table-head`,className:ZE(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function sA({className:e,...t}){return(0,X.jsx)(`td`,{"data-slot":`table-cell`,className:ZE(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function cA(e,t){if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`nylo-studio.config.json must contain an object.`);let n=e.agentServerUrl;if(n===void 0)return Object.freeze({});if(typeof n!=`string`)throw Error(`agentServerUrl must be a string.`);let r;try{r=new URL(n)}catch{throw Error(`agentServerUrl must be an absolute http(s) URL.`)}if(r.protocol!==`http:`&&r.protocol!==`https:`)throw Error(`agentServerUrl must use http or https.`);if(r.username!==``||r.password!==``||r.search!==``||r.hash!==``)throw Error(`agentServerUrl must not contain credentials, a query string, or a fragment.`);if(t===`https:`&&r.protocol===`http:`)throw Error(`An HTTPS Studio cannot connect to an HTTP Agent Server. Serve the Agent Server over HTTPS.`);return Object.freeze({agentServerUrl:r.href.replace(/\/$/u,``)})}async function lA(e=fetch,t=document.baseURI){let n=new URL(t),r=await e(new URL(`/nylo-studio.config.json`,n.origin));if(!r.ok)throw Error(`Could not load nylo-studio.config.json (${r.status}).`);return cA(await r.json(),new URL(t).protocol)}function uA(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function dA(e,t){return typeof e==`string`&&e!==``?e:t}function fA(e){if(typeof e==`string`)return e.length>140?`${e.slice(0,137)}…`:e;try{let t=JSON.stringify(e);return t.length>140?`${t.slice(0,137)}…`:t}catch{return`Result is not serializable.`}}function pA(e){switch(e.type){case`model.requested`:return`Model requested`;case`model.completed`:return`Model completed`;case`model.deferred`:return`Model deferred`;case`model.call`:return`Model response`;case`tool.started`:return`Tool started`;case`tool.completed`:return`Tool completed`;case`tool.deferred`:return`Tool deferred`;case`interaction.required`:return uA(uA(e.payload).interaction).kind===`response`?`Response required`:`Approval required`;case`session.run.started`:return`Session input received`;case`final`:return`Final answer`;case`error`:return`Run failed`;default:return e.type.replaceAll(`.`,` `)}}function mA(e){let t=e.payload;if(e.type.startsWith(`tool.`)){let n=dA(t.toolName,`tool`);if(e.type===`tool.completed`){let e=uA(t.attributes);return e.kind===`failed`?`${n}: ${dA(e.message,dA(t.code,`failed`))}`:`${n}: ${fA(e.output??e.kind??t.outcome)}`}return n}return e.type===`interaction.required`?dA(uA(t.interaction).prompt,`A response is required before this work can continue.`):e.type===`final`?fA(t.output):e.type===`error`?dA(t.message,`The run failed.`):e.type===`model.requested`?dA(t.requestedModelId,`Preparing a model request.`):e.type===`model.completed`?`Candidate received.`:e.type===`session.run.started`&&t.input_kind===`approve`?t.approved===!0?`Approval granted.`:`Approval denied.`:e.type===`session.run.started`&&t.input_kind===`respond`?`Response submitted.`:e.type===`middleware.entered`||e.type===`middleware.completed`?dA(t.middlewareId,`middleware`):e.type===`middleware.lease-violation`?`${dA(t.middlewareId,`middleware`)}: ${dA(t.reason,`lease violated`)}`:`Canonical agent event.`}function hA(e,t){return new URL(t,e+`/`).toString()}function gA(e){return e.length>12?e.slice(0,8)+`…`+e.slice(-4):e}function _A(e){return e===void 0?`—`:(0,mT.default)(e).format(`HH:mm:ss`)}function vA(e){try{return JSON.stringify(e,null,2)}catch{return`Unserializable value`}}function yA(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function bA(e){if(e.type!==`model.requested`)return;let t=yA(yA(e.payload).digests);if([`prompt`,`tools`,`model`,`output`,`configuration`,`context`].every(e=>typeof t[e]==`string`&&/^[a-f0-9]{64}$/u.test(t[e])))return t}function xA(e,t){return e instanceof TypeError&&e.message===`Failed to fetch`?`Studio could not reach the agent server. Confirm it is running, then retry.`:e instanceof Error?e.message:t}function SA(e){return`/agents/`+encodeURIComponent(e)}function CA(e,t){return SA(e)+`/sessions/`+encodeURIComponent(t)}function wA(e){return typeof e==`string`?[{type:`text`,text:e}]:[{type:`json`,value:e}]}function TA(){let[e,t]=(0,v.useState)({status:`Connecting`,agents:[],sessionsByAgent:{}});return(0,v.useEffect)(()=>{let e=!1,n=async()=>{try{let n=await lA();if(n.agentServerUrl===void 0)throw Error(`No Agent Server URL configured.`);let r=await fetch(hA(n.agentServerUrl,`/v1/agents`),{cache:`no-store`});if(!r.ok)throw Error(`Agent Server returned `+r.status+`.`);let i=await r.json();if(!b(i))throw Error(`Unsupported Studio discovery document.`);let a=await Promise.all(i.agents.map(async e=>{let t=await fetch(hA(n.agentServerUrl,e.manifestUrl),{cache:`no-store`});if(!t.ok)throw Error(`Manifest for `+e.id+` returned `+t.status+`.`);let r=await t.json();return{...r,endpoints:{agUi:hA(n.agentServerUrl,r.endpoints.agUi),sessions:hA(n.agentServerUrl,r.endpoints.sessions)}}}));e||t(e=>({status:`Running`,url:n.agentServerUrl,setup:i.setup?.state===`required`?i.setup:void 0,agents:a,sessionsByAgent:e.sessionsByAgent}))}catch{e||t(e=>({...e,status:`Offline`}))}};n();let r=window.setInterval(()=>void n(),2e3);return()=>{e=!0,window.clearInterval(r)}},[]),(0,v.useEffect)(()=>{if(e.status!==`Running`||e.agents.length===0)return;let n=!1,r=async()=>{let r=await Promise.all(e.agents.map(async e=>{try{let t=await fetch(e.endpoints.sessions,{cache:`no-store`});if(!t.ok)return[e.id,void 0];let n=await t.json();return[e.id,[...n.sessions].sort((e,t)=>t.startedAt-e.startedAt)]}catch{return[e.id,void 0]}}));n||t(e=>{let t={...e.sessionsByAgent};for(let[e,n]of r)n!==void 0&&(t[e]=n);return{...e,sessionsByAgent:t}})};r();let i=window.setInterval(()=>void r(),2e3);return()=>{n=!0,window.clearInterval(i)}},[e.status,e.agents]),e}function EA({title:e,detail:t,action:n}){return(0,X.jsxs)(`div`,{className:`relative grid h-full min-h-52 place-items-center p-8 text-center`,children:[(0,X.jsx)(`div`,{className:`absolute left-2 top-2`,children:(0,X.jsx)(SD,{})}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h2`,{className:`font-medium`,children:e}),(0,X.jsx)(`p`,{className:`mt-1 max-w-md text-sm text-muted-foreground`,children:t}),n===void 0?null:(0,X.jsx)(`div`,{className:`mt-4 flex justify-center`,children:n})]})]})}function DA({values:e}){return(0,X.jsx)(`p`,{className:`text-sm`,children:e.length===0?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`None declared`}):e.join(`, `)})}function OA(){return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:`None declared`})}function kA(e){return e.find(e=>e.id===`agent`)?.instructions??[]}function AA({values:e}){return e.length===0?(0,X.jsx)(`p`,{className:`mt-2 text-sm`,children:(0,X.jsx)(OA,{})}):(0,X.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.map((e,t)=>(0,X.jsx)(`p`,{className:`whitespace-pre-wrap text-sm`,children:e},t))})}function jA({tools:e}){return e.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.name}),e.description===void 0?null:(0,X.jsxs)(`span`,{className:`text-muted-foreground`,children:[` — `,e.description]})]},e.name))})}function MA({model:e}){if(e===void 0)return(0,X.jsx)(OA,{});let t=[e.id,e.controls?.temperature===void 0?void 0:`temperature ${e.controls.temperature}`,e.controls?.maxOutputTokens===void 0?void 0:`max ${e.controls.maxOutputTokens}`].filter(e=>e!==void 0);return t.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`span`,{children:t.join(` · `)})}function NA({agent:e,sessionId:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(),g=(0,v.useRef)(null);(0,v.useEffect)(()=>{let n=!1,i=async()=>{let i=await fetch(e.endpoints.agUi.replace(/\/$/u,``)+`/sessions/`+encodeURIComponent(t),{cache:`no-store`});i.ok&&!n&&r((await i.json()).messages);let a=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{cache:`no-store`});a.ok&&!n&&l((await a.json()).pending_interaction)};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.agUi,e.endpoints.sessions,t]),(0,v.useEffect)(()=>{f&&g.current?.scrollIntoView({block:`end`})},[n,f]);let _=async()=>{if(!i.trim()&&o===void 0||f)return;let n=i.trim(),c=o,l=[...n===``?[]:[{type:`text`,text:n}],...c===void 0?[]:[{type:`image`,source:{type:`data`,value:c.base64,mimeType:c.mediaType}}]];a(``),s(void 0),p(!0),h(void 0),r(e=>[...e,{id:crypto.randomUUID(),role:`user`,content:[...n===``?[]:[{type:`text`,text:n}],...c===void 0?[]:[{type:`image`,url:c.previewUrl,mediaType:c.mediaType}]]}]);try{let n=new bp({url:e.endpoints.agUi,threadId:t});n.addMessage({id:crypto.randomUUID(),role:`user`,content:l}),await n.runAgent({runId:crypto.randomUUID()},{onRunErrorEvent:({event:e})=>{h(e.message)},onNewMessage:({message:e})=>{let t=e;r(e=>[...e,{id:t.id??crypto.randomUUID(),role:t.role??`assistant`,content:wA(t.content)}])}})}catch(e){h(xA(e,`Agent request failed.`))}finally{p(!1)}},y=async(n,r)=>{if(c!==void 0){p(!0);try{let i=await fetch(e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t),{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({interaction:{id:c.id,...n}})});if(!i.ok)throw Error(r+` returned `+i.status+`.`);l(void 0),d(``)}catch(e){h(xA(e,r+` failed.`))}finally{p(!1)}}};return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b bg-background px-3`,children:[(0,X.jsx)(SD,{className:`-ml-0.5`}),(0,X.jsx)(`h1`,{className:`min-w-0 truncate text-sm font-medium`,children:e.name}),(0,X.jsx)(`span`,{className:`ml-auto font-mono text-xs text-muted-foreground`,children:gA(t)})]}),(0,X.jsx)(Xk,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[n.length===0?(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Start the conversation to run this session.`}):n.map(t=>(0,X.jsxs)(`article`,{className:`max-w-3xl rounded-lg px-4 py-3 text-sm `+(t.role===`user`?`ml-auto bg-primary text-primary-foreground`:`bg-muted`),children:[(0,X.jsx)(`p`,{className:`mb-1 text-xs opacity-70`,children:t.role}),t.content.map((t,n)=>t.type===`text`?(0,X.jsx)(`p`,{className:`whitespace-pre-wrap`,children:t.text},n):t.type===`image`?(0,X.jsx)(`img`,{src:new URL(t.url,e.endpoints.agUi).toString(),alt:`Shared image`,className:`max-h-96 rounded-md object-contain`},n):(0,X.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap rounded bg-background/60 p-2 text-xs`,children:vA(t.value)},n))]},t.id)),c!==void 0&&(0,X.jsxs)(`section`,{className:`rounded-lg border border-amber-400/50 bg-amber-50 p-4 text-sm`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:c.kind===`response`?`Response required`:`Approval required`}),(0,X.jsx)(`p`,{className:`mt-1`,children:c.prompt}),c.kind===`response`?(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(JD,{value:u,onChange:d,onSubmit:()=>void y({kind:`respond`,value:u.trim()},`Reply`),sending:f,placeholder:`Your reply…`,submitLabel:`Send reply`})}):(0,X.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,X.jsx)($E,{size:`sm`,onClick:()=>void y({kind:`approval`,approved:!0},`Approval`),children:`Approve`}),(0,X.jsx)($E,{size:`sm`,variant:`outline`,onClick:()=>void y({kind:`approval`,approved:!1},`Approval`),children:`Deny`})]})]}),m!==void 0&&(0,X.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:m}),(0,X.jsx)(`div`,{ref:g})]})}),(0,X.jsx)(`div`,{className:`shrink-0 border-t bg-background p-3`,children:(0,X.jsx)(JD,{value:i,onChange:a,onSubmit:()=>void _(),attachment:o,onAttachmentChange:s,acceptedTypes:e.mediaInput?.acceptedTypes,maxBytes:e.mediaInput?.maxBytes,disabled:c!==void 0,sending:f,placeholder:`Message the agent…`,autoFocus:!0})})]})}function PA({agent:e}){let t=x(e),n=kA(t),r=t.filter(e=>e.id!==`agent`);return(0,X.jsx)(Xk,{className:`h-full`,children:(0,X.jsxs)(`div`,{className:`p-4`,children:[(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`ID`}),(0,X.jsx)(`p`,{className:`mt-2 font-mono text-xs`,children:e.id})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Name`}),(0,X.jsx)(`p`,{className:`mt-2 text-sm`,children:e.name})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Instructions`}),(0,X.jsx)(AA,{values:n})]}),(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Middleware`}),(0,X.jsx)(`div`,{className:`mt-3`,children:(0,X.jsx)(DA,{values:r.map(e=>e.id)})})]}),r.map(e=>(0,X.jsxs)(`div`,{children:[(0,X.jsx)(eD,{className:`my-4`}),(0,X.jsxs)(`section`,{children:[(0,X.jsx)(`h3`,{className:`font-mono text-sm font-medium`,children:e.id}),(0,X.jsxs)(`dl`,{className:`mt-3 grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Instructions`}),(0,X.jsx)(`dd`,{children:e.instructions===void 0||e.instructions.length===0?(0,X.jsx)(OA,{}):(0,X.jsx)(`div`,{className:`space-y-1`,children:e.instructions.map((e,t)=>(0,X.jsx)(`p`,{className:`whitespace-pre-wrap`,children:e},t))})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Tools`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(jA,{tools:e.tools??[]})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Context`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(OA,{})}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Model`}),(0,X.jsx)(`dd`,{children:(0,X.jsx)(MA,{model:e.model})})]})]})]},e.id))]})})}function FA({events:e,selected:t,onSelect:n}){let[r,i]=(0,v.useState)(),a=(0,v.useMemo)(()=>[...new Set(e.map(e=>e.type))].sort(),[e]),o=r??a,s=r===void 0?e:e.filter(e=>r.includes(e.type)),c=r===void 0||r.length===a.length?`All event types`:r.length===0?`No event types`:r.length===1?pA({type:r[0]}):r.length+` event types`,l=(e,t)=>{i(n=>{let r=(n??a).filter(t=>t!==e);return t&&r.push(e),r.length===a.length&&a.every(e=>r.includes(e))?void 0:r})};return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-3 border-b bg-background px-4`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-medium`,children:`Events`}),(0,X.jsxs)(Qk,{children:[(0,X.jsx)($k,{asChild:!0,children:(0,X.jsxs)($E,{variant:`outline`,size:`sm`,className:`ml-auto w-44 justify-between font-normal`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:c}),(0,X.jsx)(Fp,{className:`size-4 opacity-50`})]})}),(0,X.jsx)(eA,{align:`end`,className:`w-56`,children:a.length===0?(0,X.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,children:`No event types yet`}):a.map(e=>(0,X.jsx)(tA,{checked:o.includes(e),onCheckedChange:t=>l(e,t===!0),children:pA({type:e})},e))})]})]}),(0,X.jsx)(Xk,{className:`min-h-0 flex-1`,children:(0,X.jsxs)(nA,{children:[(0,X.jsx)(rA,{className:`sticky top-0 z-10 bg-background`,children:(0,X.jsxs)(aA,{children:[(0,X.jsx)(oA,{className:`w-14`,children:`Seq`}),(0,X.jsx)(oA,{className:`w-20`,children:`Time`}),(0,X.jsx)(oA,{className:`w-40`,children:`Type`}),(0,X.jsx)(oA,{children:`Summary`})]})}),(0,X.jsx)(iA,{children:s.length===0?(0,X.jsx)(aA,{children:(0,X.jsx)(sA,{colSpan:4,className:`h-28 text-center text-muted-foreground`,children:e.length===0?`Events will appear when the agent runs.`:`No events match this filter.`})}):s.map(e=>(0,X.jsxs)(aA,{"data-state":t?.seq===e.seq?`selected`:void 0,className:`cursor-pointer`,onClick:()=>n(e),children:[(0,X.jsx)(sA,{className:`font-mono text-xs`,children:e.seq}),(0,X.jsx)(sA,{className:`text-xs text-muted-foreground`,children:_A(e.ts)}),(0,X.jsx)(sA,{children:(0,X.jsx)(XD,{variant:`secondary`,children:pA(e)})}),(0,X.jsx)(sA,{className:`max-w-0 truncate text-xs text-muted-foreground`,children:mA(e)})]},e.seq))})]})})]})}function IA({event:e,onClose:t}){let n=bA(e);return(0,X.jsxs)(`section`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:[(0,X.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center gap-3 border-b bg-background px-4`,children:[(0,X.jsxs)(`div`,{className:`min-w-0`,children:[(0,X.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:pA(e)}),(0,X.jsxs)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:[`Event `,e.seq]})]}),(0,X.jsxs)($E,{className:`ml-auto`,size:`icon`,variant:`ghost`,onClick:t,children:[(0,X.jsx)(Gp,{className:`size-4`}),(0,X.jsx)(`span`,{className:`sr-only`,children:`Close event details`})]})]}),(0,X.jsx)(Xk,{className:`min-h-0 min-w-0 flex-1`,children:(0,X.jsxs)(`div`,{className:`min-w-0 max-w-full space-y-4 overflow-hidden p-4`,children:[(0,X.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-sm`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Sequence`}),(0,X.jsx)(`dd`,{children:e.seq}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Timestamp`}),(0,X.jsx)(`dd`,{children:_A(e.ts)}),(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:`Type`}),(0,X.jsx)(`dd`,{children:e.type})]}),n===void 0?null:(0,X.jsxs)(`section`,{className:`min-w-0 max-w-full`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Digests`}),(0,X.jsxs)(`dl`,{className:`mt-2 space-y-2 rounded-md bg-muted p-3 text-xs`,children:[(0,X.jsx)(LA,{label:`Prompt`,value:n.prompt}),(0,X.jsx)(LA,{label:`Tools`,value:n.tools}),(0,X.jsx)(LA,{label:`Model`,value:n.model}),(0,X.jsx)(LA,{label:`Output contract`,value:n.output}),(0,X.jsx)(LA,{label:`Configuration`,value:n.configuration}),(0,X.jsx)(LA,{label:`Context`,value:n.context})]})]}),(0,X.jsxs)(`section`,{className:`min-w-0 max-w-full`,children:[(0,X.jsx)(`h3`,{className:`text-sm font-medium`,children:`Canonical event`}),(0,X.jsx)(`pre`,{className:`mt-2 w-full max-w-full overflow-x-auto whitespace-pre-wrap break-all rounded-md bg-muted p-3 text-xs leading-5`,children:vA(e)})]})]})})]})}function LA({label:e,value:t}){return(0,X.jsxs)(`div`,{className:`grid gap-1`,children:[(0,X.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`font-mono break-all select-text`,children:t})]})}function RA({agent:e,sessionId:t}){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(`events`),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!1,i=async()=>{let i=e.endpoints.sessions.replace(/\/$/u,``)+`/`+encodeURIComponent(t)+`/events?after=0&limit=1000`,a=await fetch(i,{cache:`no-store`});if(a.ok&&!n){let e=await a.json();r([...e.events].sort((e,t)=>t.seq-e.seq))}};i();let a=window.setInterval(()=>void i(),1e3);return()=>{n=!0,window.clearInterval(a)}},[e.endpoints.sessions,t]),(0,v.useEffect)(()=>{s(void 0),l(!1),a(`events`)},[t]);let u=e=>{s(e),l(!0)},d=e=>{let t=e;a(t),t===`manifest`&&l(!1)},f=i===`events`&&c&&o!==void 0;return(0,X.jsxs)(qk,{orientation:`horizontal`,className:`h-full min-h-0 overflow-hidden`,children:[(0,X.jsx)(Jk,{defaultSize:f?24:32,minSize:20,children:(0,X.jsx)(NA,{agent:e,sessionId:t})}),(0,X.jsx)(Yk,{withHandle:!0}),(0,X.jsx)(Jk,{defaultSize:f?40:68,minSize:28,children:(0,X.jsxs)(Tw,{value:i,onValueChange:d,className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,X.jsx)(`div`,{className:`flex h-12 shrink-0 items-end border-b bg-background px-4`,children:(0,X.jsxs)(Ew,{className:`flex h-full items-end gap-5`,children:[(0,X.jsx)(Dw,{value:`events`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Events`}),(0,X.jsx)(Dw,{value:`manifest`,className:`border-b-2 border-transparent px-0 pb-3 text-sm font-medium text-muted-foreground outline-none transition-colors hover:text-foreground data-[state=active]:border-primary data-[state=active]:text-foreground`,children:`Agent Manifest`})]})}),(0,X.jsx)(Ow,{value:`events`,className:`flex min-h-0 flex-1 flex-col overflow-hidden outline-none`,children:(0,X.jsx)(FA,{events:n,selected:o,onSelect:u})}),(0,X.jsx)(Ow,{value:`manifest`,className:`flex min-h-0 flex-1 flex-col overflow-hidden outline-none`,children:(0,X.jsx)(PA,{agent:e})})]})}),f?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Yk,{withHandle:!0}),(0,X.jsx)(Jk,{defaultSize:36,minSize:26,children:(0,X.jsx)(IA,{event:o,onClose:()=>{l(!1),s(void 0)}})})]}):null]},f?`details`:`workspace`)}function zA({connection:e}){let{agentId:t=``,sessionId:n}=kt(),r=Dt();if(e.setup!==void 0)return(0,X.jsx)(EA,{title:e.setup.title,detail:`${e.setup.detail} Run \`${e.setup.command}\` in another terminal; Studio will become ready automatically.`});let i=e.agents.find(e=>e.id===t);return t===``?(0,X.jsx)(EA,{title:`Choose an agent`,detail:`Select an agent and one of its sessions from the navigation.`}):i===void 0?(0,X.jsx)(EA,{title:`Agent not found`,detail:`This agent is not currently exposed by the connected agent server.`}):n===void 0?(0,X.jsx)(EA,{title:`Choose a session`,detail:`Select a saved session from the navigation, or start a new conversation with this agent.`,action:(0,X.jsxs)($E,{onClick:()=>r(CA(i.id,crypto.randomUUID())),children:[(0,X.jsx)(Lp,{className:`size-4`}),`New session`]})}):(0,X.jsx)(`div`,{className:`h-full min-h-0 overflow-hidden`,children:(0,X.jsx)(RA,{agent:i,sessionId:n})})}function BA(){let e=TA(),t=wt().pathname.match(/^\/agents\/([^/]+)(?:\/sessions\/([^/]+))?/u),n=t===null?void 0:decodeURIComponent(t[1]),r=t?.[2];return(0,X.jsxs)(bD,{className:`h-svh overflow-hidden`,children:[(0,X.jsx)(KD,{connection:e,activeAgentId:n,activeSessionId:r}),(0,X.jsx)(CD,{className:`h-svh min-h-0 min-w-0 overflow-hidden`,children:(0,X.jsxs)($t,{children:[(0,X.jsx)(Zt,{path:`/`,element:(0,X.jsx)(zA,{connection:e})}),(0,X.jsx)(Zt,{path:`/agents/:agentId`,element:(0,X.jsx)(zA,{connection:e})}),(0,X.jsx)(Zt,{path:`/agents/:agentId/sessions/:sessionId`,element:(0,X.jsx)(zA,{connection:e})})]})})]})}function VA(){return(0,X.jsx)(Rn,{children:(0,X.jsx)(BA,{})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(v.StrictMode,{children:(0,X.jsx)(VA,{})}));
|
package/dist/web/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="apple-touch-icon" href="/favicon/apple-touch-icon.png" sizes="180x180" />
|
|
11
11
|
<link rel="manifest" href="/favicon/site.webmanifest" />
|
|
12
12
|
<title>Nylo Studio</title>
|
|
13
|
-
<script type="module" crossorigin src="/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/assets/index-k9Rug6YB.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/index-DTySHxBY.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nylorun/studio",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1-beta",
|
|
4
4
|
"description": "Local developer Studio for Nylorun agents. Docs: docs.nylorun.com.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"class-variance-authority": "^0.7.1",
|
|
57
57
|
"clsx": "^2.1.1",
|
|
58
58
|
"dayjs": "^1.11.23",
|
|
59
|
-
"lucide-react": "^1.
|
|
59
|
+
"lucide-react": "^1.41.0",
|
|
60
60
|
"radix-ui": "^1.6.7",
|
|
61
61
|
"react": "^19.2.8",
|
|
62
62
|
"react-dom": "^19.2.8",
|