cogpit 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +276 -73
- package/dist/web/assets/{CommandPaletteHost-DJghey7B.js → CommandPaletteHost-D43icOGh.js} +1 -1
- package/dist/web/assets/{ConfigBrowser-x0UdXG0K.js → ConfigBrowser-BailHbYr.js} +1 -1
- package/dist/web/assets/{HighlightedEditor-D0TDZx8S.js → HighlightedEditor-Kf1cQYyg.js} +1 -1
- package/dist/web/assets/{KeyboardShortcutsDialog-2606YXAx.js → KeyboardShortcutsDialog-CHb_hQuK.js} +1 -1
- package/dist/web/assets/{MobileFileChanges-B4dwGXMS.js → MobileFileChanges-C9Xk9gfg.js} +1 -1
- package/dist/web/assets/{PreviewPanel-CJdf-VLC.js → PreviewPanel-Djv1bZZJ.js} +1 -1
- package/dist/web/assets/ProjectFilesPanel-DuBqjGFA.js +4 -0
- package/dist/web/assets/{ProjectSwitcherModal-D8boI2Qx.js → ProjectSwitcherModal-CxQ6p2B4.js} +1 -1
- package/dist/web/assets/{TerminalOutput-C-6RWc6C.js → TerminalOutput-Cm-dLkUR.js} +1 -1
- package/dist/web/assets/ThemeSelectorModal-CTuOdp5Q.js +1 -0
- package/dist/web/assets/WorkflowsPanel-P7HtcaDf.js +1 -0
- package/dist/web/assets/{WorktreePanel-D-BUTFL2.js → WorktreePanel-DcjYVMuA.js} +1 -1
- package/dist/web/assets/index-CEBq1nya.js +1 -0
- package/dist/web/assets/{index-ztb2qsgi.js → index-CVfvPIib.js} +4 -4
- package/dist/web/assets/index-CWj7TiFf.css +1 -0
- package/dist/web/assets/{index-BBKPLXTq.js → index-D2LNKOXE.js} +1 -1
- package/dist/web/assets/index-DFiPbdIb.js +153 -0
- package/dist/web/assets/session-parser.worker-SrNyVFwl.js +29 -0
- package/dist/web/assets/{vendor-ui-RwWl1mlR.js → vendor-ui-DUTyrBOX.js} +1 -1
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/web/assets/ProjectFilesPanel-3GzuQyp3.js +0 -4
- package/dist/web/assets/ThemeSelectorModal-DZ9JuT6j.js +0 -1
- package/dist/web/assets/WorkflowsPanel-i3GanFyN.js +0 -1
- package/dist/web/assets/index-CMQcske6.js +0 -1
- package/dist/web/assets/index-C_0XOtqJ.css +0 -1
- package/dist/web/assets/index-D6p4gVB_.js +0 -154
- package/dist/web/assets/session-parser.worker-D3MwyNH5.js +0 -29
|
@@ -879,4 +879,4 @@ var Op=Object.defineProperty;var sc=e=>{throw TypeError(e)};var Ap=(e,t,n)=>t in
|
|
|
879
879
|
`)},wl=function(){var e=parseInt(document.body.getAttribute(no)||"0",10);return isFinite(e)?e:0},Gx=function(){c.useEffect(function(){return document.body.setAttribute(no,(wl()+1).toString()),function(){var e=wl()-1;e<=0?document.body.removeAttribute(no):document.body.setAttribute(no,e.toString())}},[])},qx=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,r=o===void 0?"margin":o;Gx();var s=c.useMemo(function(){return Bx(r)},[r]);return c.createElement(Wx,{styles:Ux(s,!t,r,n?"":"!important")})},Mi=!1;if(typeof window<"u")try{var mr=Object.defineProperty({},"passive",{get:function(){return Mi=!0,!0}});window.addEventListener("test",mr,mr),window.removeEventListener("test",mr,mr)}catch{Mi=!1}var Bn=Mi?{passive:!1}:!1,Yx=function(e){return e.tagName==="TEXTAREA"},_f=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Yx(e)&&n[t]==="visible")},Xx=function(e){return _f(e,"overflowY")},Kx=function(e){return _f(e,"overflowX")},Sl=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var r=Lf(e,o);if(r){var s=Ff(e,o),i=s[1],a=s[2];if(i>a)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},Zx=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},Qx=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},Lf=function(e,t){return e==="v"?Xx(t):Kx(t)},Ff=function(e,t){return e==="v"?Zx(t):Qx(t)},Jx=function(e,t){return e==="h"&&t==="rtl"?-1:1},e2=function(e,t,n,o,r){var s=Jx(e,window.getComputedStyle(t).direction),i=s*o,a=n.target,l=t.contains(a),u=!1,d=i>0,p=0,f=0;do{if(!a)break;var y=Ff(e,a),m=y[0],g=y[1],h=y[2],b=g-h-s*m;(m||b)&&Lf(e,a)&&(p+=b,f+=m);var v=a.parentNode;a=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(p)<1||!d&&Math.abs(f)<1)&&(u=!0),u},yr=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Rl=function(e){return[e.deltaX,e.deltaY]},kl=function(e){return e&&"current"in e?e.current:e},t2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},n2=function(e){return`
|
|
880
880
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
881
881
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
882
|
-
`)},o2=0,Wn=[];function r2(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(o2++)[0],s=c.useState(Df)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var g=Cx([e.lockRef.current],(e.shards||[]).map(kl),!0).filter(Boolean);return g.forEach(function(h){return h.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),g.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(g,h){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=yr(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-b[0],x="deltaY"in g?g.deltaY:v[1]-b[1],S,R=g.target,C=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in g&&C==="h"&&R.type==="range")return!1;var k=window.getSelection(),P=k&&k.anchorNode,E=P?P===R||P.contains(R):!1;if(E)return!1;var O=Sl(C,R);if(!O)return!0;if(O?S=C:(S=C==="v"?"h":"v",O=Sl(C,R)),!O)return!1;if(!o.current&&"changedTouches"in g&&(w||x)&&(o.current=S),!S)return!0;var I=o.current||S;return e2(I,h,g,I==="h"?w:x)},[]),l=c.useCallback(function(g){var h=g;if(!(!Wn.length||Wn[Wn.length-1]!==s)){var b="deltaY"in h?Rl(h):yr(h),v=t.current.filter(function(S){return S.name===h.type&&(S.target===h.target||h.target===S.shadowParent)&&t2(S.delta,b)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(kl).filter(Boolean).filter(function(S){return S.contains(h.target)}),x=w.length>0?a(h,w[0]):!i.current.noIsolation;x&&h.cancelable&&h.preventDefault()}}},[]),u=c.useCallback(function(g,h,b,v){var w={name:g,delta:h,target:b,should:v,shadowParent:s2(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),d=c.useCallback(function(g){n.current=yr(g),o.current=void 0},[]),p=c.useCallback(function(g){u(g.type,Rl(g),g.target,a(g,e.lockRef.current))},[]),f=c.useCallback(function(g){u(g.type,yr(g),g.target,a(g,e.lockRef.current))},[]);c.useEffect(function(){return Wn.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Bn),document.addEventListener("touchmove",l,Bn),document.addEventListener("touchstart",d,Bn),function(){Wn=Wn.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Bn),document.removeEventListener("touchmove",l,Bn),document.removeEventListener("touchstart",d,Bn)}},[]);var y=e.removeScrollBar,m=e.inert;return c.createElement(c.Fragment,null,m?c.createElement(s,{styles:n2(r)}):null,y?c.createElement(qx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function s2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i2=Dx(Nf,r2);var zf=c.forwardRef(function(e,t){return c.createElement(ks,Bt({},e,{ref:t,sideCar:i2}))});zf.classNames=ks.classNames;var a2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Un=new WeakMap,br=new WeakMap,vr={},Ks=0,Vf=function(e){return e&&(e.host||Vf(e.parentNode))},c2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Vf(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},l2=function(e,t,n,o){var r=c2(t,Array.isArray(e)?e:[e]);vr[n]||(vr[n]=new WeakMap);var s=vr[n],i=[],a=new Set,l=new Set(r),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};r.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(f){if(a.has(f))d(f);else try{var y=f.getAttribute(o),m=y!==null&&y!=="false",g=(Un.get(f)||0)+1,h=(s.get(f)||0)+1;Un.set(f,g),s.set(f,h),i.push(f),g===1&&m&&br.set(f,!0),h===1&&f.setAttribute(n,"true"),m||f.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),Ks++,function(){i.forEach(function(p){var f=Un.get(p)-1,y=s.get(p)-1;Un.set(p,f),s.set(p,y),f||(br.has(p)||p.removeAttribute(o),br.delete(p)),y||p.removeAttribute(n)}),Ks--,Ks||(Un=new WeakMap,Un=new WeakMap,br=new WeakMap,vr={})}},u2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=a2(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),l2(o,r,n,"aria-hidden")):function(){return null}},d2=Object.defineProperty,un=(e,t)=>d2(e,"name",{value:t,configurable:!0}),Wa="Dialog",[$f,FC]=rf(Wa),[f2,$n]=$f(Wa),zC=un(e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,a=c.useRef(null),l=c.useRef(null),[u,d]=cf({prop:o,defaultProp:r??!1,onChange:s,caller:Wa}),[p,f]=c.useState(0),[y,m]=c.useState(0);return K.jsx(f2,{scope:t,triggerRef:a,contentRef:l,contentId:Pr(),titleId:Pr(),descriptionId:Pr(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:f,setDescriptionCount:m,open:u,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(g=>!g),[d]),modal:i,children:n})},"Dialog"),Hf="DialogPortal",[p2,jf]=$f(Hf,{forceMount:void 0}),VC=un(e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=$n(Hf,t);return K.jsx(p2,{scope:t,forceMount:n,children:c.Children.map(o,i=>K.jsx(Ha,{present:n||s.open,children:K.jsx(wx,{asChild:!0,container:r,children:i})}))})},"DialogPortal"),Pi="DialogOverlay",$C=c.forwardRef(un(function(t,n){const o=jf(Pi,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,i=$n(Pi,t.__scopeDialog);return i.modal?K.jsx(Ha,{present:r||i.open,children:K.jsx(g2,{...s,ref:n})}):null},"DialogOverlay")),h2=za("DialogOverlay.RemoveScroll"),g2=c.forwardRef(un(function(t,n){const{__scopeDialog:o,...r}=t,s=$n(Pi,o),i=bf(),a=wo(n,i);return K.jsx(zf,{as:h2,allowPinchZoom:!0,shards:[s.contentRef],children:K.jsx(Rs.div,{"data-state":Ua(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),$o="DialogContent",HC=c.forwardRef(un(function(t,n){const o=jf($o,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,i=$n($o,t.__scopeDialog);return K.jsx(Ha,{present:r||i.open,children:i.modal?K.jsx(m2,{...s,ref:n}):K.jsx(y2,{...s,ref:n})})},"DialogContent")),m2=c.forwardRef(un(function(t,n){const o=$n($o,t.__scopeDialog),r=c.useRef(null),s=wo(n,o.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return u2(i)},[]),K.jsx(Bf,{...t,ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Nn(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=o.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Nn(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:Nn(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),y2=c.forwardRef(un(function(t,n){const o=$n($o,t.__scopeDialog),r=c.useRef(!1),s=c.useRef(!1);return K.jsx(Bf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,l;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(l=o.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=o.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Bf=c.forwardRef(un(function(t,n){const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,l=$n($o,o);return Ba(),K.jsx(K.Fragment,{children:K.jsx(bx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:K.jsx(gx,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Ua(l.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl"));function Ua(e){return e?"open":"closed"}un(Ua,"getState");function b2(e){const{open:t,defaultOpen:n,onOpenChange:o,disabled:r}=e,[s,i]=_t({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:l,transitionStatus:u}=ln(s,!0,!0),d=tt(),[p,f]=c.useState(),y=p===null?void 0:p??d,m=le(g=>{const h=!s,b=ke(Rn,g.nativeEvent);o(h,b),!b.isCanceled&&i(h)});return c.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:m,mounted:a,open:s,panelId:y,setMounted:l,setOpen:i,setPanelIdState:f,transitionStatus:u}),[d,r,m,a,s,y,l,i,f,u])}const Wf=c.createContext(void 0);function Uf(){const e=c.useContext(Wf);if(e===void 0)throw new Error(De(15));return e}let Ga=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_r.startingStyle]="startingStyle",e[e.endingStyle=_r.endingStyle]="endingStyle",e})({}),v2=(function(e){return e.panelOpen="data-panel-open",e})({});const x2={[Ga.open]:""},w2={[Ga.closed]:""},S2={open(e){return e?{[v2.panelOpen]:""}:null}},R2={open(e){return e?x2:w2}},Gf={...R2,...Gt},jC=c.forwardRef(function(t,n){const{render:o,className:r,defaultOpen:s=!1,disabled:i=!1,onOpenChange:a,open:l,style:u,...d}=t,p=le(a),f=b2({open:l,defaultOpen:s,onOpenChange:p,disabled:i}),y=c.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=c.useMemo(()=>({...f,onOpenChange:p,state:y}),[f,p,y]),g=Se("div",t,{state:y,ref:n,props:d,stateAttributesMapping:Gf});return K.jsx(Wf.Provider,{value:m,children:g})}),k2={...S2,...Gt},BC=c.forwardRef(function(t,n){const{panelId:o,open:r,handleTrigger:s,state:i,disabled:a}=Uf(),{className:l,disabled:u=a,render:d,nativeButton:p=!0,style:f,...y}=t,{getButtonProps:m,buttonRef:g}=Tt({disabled:u,focusableWhenDisabled:!0,native:p});return Se("button",t,{state:i,ref:[n,g],props:[{"aria-controls":r?o:void 0,"aria-expanded":r,onClick:s},y,m],stateAttributesMapping:k2})}),Mo={height:void 0,width:void 0};function C2(e){const{externalRef:t,hiddenUntilFound:n,id:o,keepMounted:r,mounted:s,onOpenChange:i,open:a,setMounted:l,setOpen:u,transitionStatus:d}=e,p=c.useRef(null),f=c.useRef(null),[y,m]=c.useState(Mo),g=c.useRef(Mo),h=c.useRef(!1),b=c.useRef(a),v=c.useRef(!1),[w,x]=c.useState(!1),S=c.useRef(null),R=Nt(t,p),C=Ze(a),k=Qi(p),P=!a&&!s,E=w?"idle":d,O=a&&(b.current||v.current),I=!a&&s&&f.current==="css-animation"&&y.height===void 0&&y.width===void 0?g.current:y,N=n&&P&&f.current!=="css-animation",D=le((F,T=!0)=>{T&&(g.current=F),m(F)}),M=le(()=>{var F;(F=S.current)==null||F.call(S),S.current=null}),z=le(F=>{M(),S.current=()=>{S.current=null,F()}}),_=le(()=>{a&&s&&f.current==="css-animation"&&(v.current=!0)});oe(()=>{!w||d==="starting"||x(!1)},[w,d]),c.useEffect(()=>()=>{_(),M()},[_,M]),oe(()=>{const F=p.current;if(!F)return;!a&&S.current&&M();const T=E2(F,O);if(f.current=T,a&&d==="idle"&&b.current&&T==="css-animation"){g.current=Gn(F);return}if(a&&d==="starting"){const $=h.current;if(h.current=!1,T==="none"){D(Gn(F)),x(!0);return}if(T==="css-transition"){const V=M2(F);if(D(Gn(F)),!$)return V;const Q=xr(F,"transition-duration","0s");return z(Q),x(!0),V}D(Gn(F));const U=xr(F,"animation-name","none");if(!$){U();return}const q=xr(F,"animation-duration","0s");U(),z(q),x(!0);return}if(!a&&s&&(d==="idle"||d==="starting")){if(b.current=!1,v.current=!1,T==="none"){D(Mo,!1),l(!1);return}D(Gn(F));return}if(d!=="ending")return;if(T==="none"){l(!1);return}const L=Gn(F);if(!(L.height>0||L.width>0)){l(!1);return}D(L),T==="css-animation"&&xr(F,"animation-name","none")()},[s,a,M,D,l,z,O,d]),kt({enabled:a&&s&&E==="idle",open:!0,ref:p,onComplete(){a&&D(Mo,!1)}}),c.useEffect(()=>{if(a||!s||E!=="ending"||!p.current)return;const T=new AbortController;let L=-1;function j(){C.current||(l(!1),D(Mo,!1))}return L=vt.request(()=>{k(j,T.signal)}),()=>{vt.cancel(L),T.abort()}},[C,s,a,E,k,D,l]),oe(()=>{const F=p.current;!F||!n||!P||F.setAttribute("hidden","until-found")},[P,n]),c.useEffect(function(){const T=p.current;if(!T)return;function L(j){const $=ke(Rt,j);i(!0,$),!$.isCanceled&&(h.current=!0,u(!0))}return Pe(T,"beforematch",L)},[i,u]);const A=r||n||s||a;return{height:I.height,props:{...N?{[Ga.startingStyle]:""}:void 0,hidden:P,id:o},ref:R,shouldPreventOpenAnimation:O,shouldRender:A,transitionStatus:E,width:I.width}}function Gn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function E2(e,t){const n=He(e).getComputedStyle(e),o=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Cl(n.animationDuration),r=Cl(n.transitionDuration);return o&&r||r?"css-transition":o?"css-animation":"none"}function Cl(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function xr(e,t,n){const o=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(o===""){e.style.removeProperty(t);return}e.style.setProperty(t,o,r)}}function M2(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const o=vt.request(n);return()=>{vt.cancel(o),n()}}let El=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const WC=c.forwardRef(function(t,n){const{className:o,hiddenUntilFound:r,keepMounted:s,render:i,id:a,style:l,...u}=t,{defaultPanelId:d,mounted:p,onOpenChange:f,open:y,setMounted:m,setPanelIdState:g,setOpen:h,state:b,transitionStatus:v}=Uf(),w=r??!1,x=s??!1,S=a||void 0,R=S??d;oe(()=>(g(_=>S??(_===null?void 0:_)),()=>{g(_=>_===S?null:_)}),[S,g]);const{height:C,props:k,ref:P,shouldPreventOpenAnimation:E,shouldRender:O,transitionStatus:I,width:N}=C2({externalRef:n,hiddenUntilFound:w,id:R,keepMounted:x,mounted:p,onOpenChange:f,open:y,setMounted:m,setOpen:h,transitionStatus:v}),D={...b,transitionStatus:I},M=fu(l,D),z=Se("div",{...t,style:void 0},{state:D,ref:P,props:[k,{style:{[El.collapsiblePanelHeight]:C===void 0?"auto":`${C}px`,[El.collapsiblePanelWidth]:N===void 0?"auto":`${N}px`}},u,M?{style:M}:void 0,E?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Gf});return O?z:null}),qf=c.createContext(void 0);function Cs(e){const t=c.useContext(qf);if(t===void 0&&!e)throw new Error(De(72));return t}const P2={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class T2 extends Uo{constructor(n,o,r){const s=new Go;super(I2(n,s,o,r),O2(s),P2);Ne(this,"setOpen",(n,o)=>{ab(this,n,o,{extraState:{openChangeReason:o.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,ke(Rn,n))}}function I2(e,t,n,o=!1){const r={...Sa(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return r.floatingRootContext=xd(t,n,o),r}function O2(e){return{popupRef:c.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const UC=ga(function(t){const{disabled:n=!1,defaultOpen:o=!1,open:r,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:l,onOpenChangeComplete:u,handle:d,triggerId:p,defaultTriggerId:f=null,children:y}=t,m=bd((O,I)=>new T2({open:o,openProp:r,activeTriggerId:f,triggerIdProp:p},O,I));m.useControlledProp("openProp",r),m.useControlledProp("triggerIdProp",p),m.useContextCallback("onOpenChange",l),m.useContextCallback("onOpenChangeComplete",u);const g=m.useState("open"),h=!n&&g,b=m.useState("activeTriggerId"),v=m.useState("mounted"),w=m.useState("payload");m.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),va(m,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:x,transitionStatus:S}=xa(h,m),R=m.useState("isInstantPhase"),C=m.useState("instantType"),k=m.useState("lastOpenChangeReason"),P=c.useRef(null);oe(()=>{g&&n&&m.setOpen(!1,ke(Iu))},[g,n,m]),oe(()=>{S==="ending"&&k===Rt||S!=="ending"&&R?(C!=="delay"&&(P.current=C),m.set("instantType","delay")):P.current!==null&&(m.set("instantType",P.current),P.current=null)},[S,R,k,C,m]),oe(()=>{h&&b==null&&m.set("payload",void 0)},[m,b,h]),c.useImperativeHandle(a,()=>({unmount:x,close:()=>m.setOpen(!1,ke(Gi))}),[x,m]);const E=h||v||!n&&i!=="none";return K.jsxs(qf.Provider,{value:m,children:[d&&K.jsx(ma,{handle:d,store:m}),E&&K.jsx(A2,{store:m,disabled:n,trackCursorAxis:i}),typeof y=="function"?y({payload:w}):y]})});function A2({store:e,disabled:t,trackCursorAxis:n}){const o=e.useState("floatingRootContext"),r=as(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=o1(o,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=c.useMemo(()=>St(s.reference,r.reference),[s.reference,r.reference]);return wa(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:r.floating??We}),null}const Yf=c.createContext(void 0);function N2(){return c.useContext(Yf)}const Ml=600,Xf="data-base-ui-tooltip-trigger";function Pl(e){if("composedPath"in e){const n=e.composedPath();for(let o=0;o<n.length;o+=1){const r=n[o];if(Oe(r))return r}}const t=e.target;return Oe(t)?t:null}function D2(e){let t=e;for(;t;){const n=t.closest(`[${Xf}]`);if(n)return n;const o=t.getRootNode();t="host"in o&&Oe(o.host)?o.host:null}return null}const GC=md(function(t,n){const{render:o,className:r,style:s,handle:i,payload:a,disabled:l,delay:u,closeOnClick:d=!0,closeDelay:p,id:f,...y}=t,m=Cs(!0),h=Ca(i)??m;if(!h)throw new Error(De(82));const b=tt(f),v=h.useState("isTriggerActive",b),w=h.useState("isOpenedByTrigger",b),x=h.useState("floatingRootContext"),S=c.useRef(null),R=u??Ml,C=p??0,{registerTrigger:k,isMountedByThisTrigger:P}=ba(b,S,h,{payload:a,closeOnClick:d,closeDelay:C}),E=N2(),{delayRef:O,isInstantPhase:I,hasProvider:N}=Ey(x,{open:w}),D=Ma(x);h.useSyncedValue("isInstantPhase",I);const M=h.useState("disabled"),z=l??M,_=Ze(z),A=h.useState("trackCursorAxis"),F=h.useState("disableHoverablePopup"),T=c.useRef(!1),L=Ge(),j=c.useRef(void 0);function $(){return N?vn(O.current,"open")===0?0:u??E??Ml:R}function U(J){const ee=S.current;if(!ee||!J)return!1;const ie=D2(J);return ie!==null&&ie!==ee&&ve(ee,ie)}function q(J){const ee=U(J);return T.current=ee,ee&&(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1,L.clear()),ee}const V=Cd(x,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!F&&A!=="both"?Pd():null,restMs:$,delay(){return p==null&&N?{close:vn(O.current,"close")}:{close:C}},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select("transitionStatus")==="ending",shouldOpen(){return!T.current}}),Q=Sd(x,{enabled:!z}).reference,H=J=>{const ee=T.current,ie=Pl(J),xe=q(ie),ae=S.current,he=ae&&ie&&ve(ae,ie);if(xe&&h.select("open")&&h.select("lastOpenChangeReason")===rt){h.setOpen(!1,ke(rt,J));return}if(ee&&!xe&&he&&!_.current&&!h.select("open")&&ae&&mn(j.current)){const re=()=>{!T.current&&!_.current&&!h.select("open")&&h.setOpen(!0,ke(rt,J,ae))},ge=$();ge===0?(L.clear(),re()):L.start(ge,re)}},G=h.useState("triggerProps",P);return Se("button",t,{state:{open:w},ref:[n,k,S],props:[V,Q,P||A!=="none"?G:void 0,{onMouseOver(J){H(J.nativeEvent)},onFocus(J){U(Pl(J.nativeEvent))&&J.preventBaseUIHandler()},onMouseLeave(){T.current=!1,L.clear(),j.current=void 0},onPointerEnter(J){j.current=J.pointerType},onPointerDown(J){j.current=J.pointerType,h.set("closeOnClick",d),d&&!h.select("open")&&h.cancelPendingOpen(J.nativeEvent)},onClick(J){d&&!h.select("open")&&h.cancelPendingOpen(J.nativeEvent)},id:b,"data-trigger-disabled":z?"":void 0,[Xf]:z?void 0:""},y],stateAttributesMapping:Bi})}),Kf=c.createContext(void 0);function _2(){const e=c.useContext(Kf);if(e===void 0)throw new Error(De(70));return e}const L2=c.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,style:a,...l}=t,{node:u,subtree:d}=nd({container:r,ref:n,componentProps:t,elementProps:l});return!d&&!u?null:K.jsxs(c.Fragment,{children:[d,u&&At.createPortal(o,u)]})}),qC=c.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t;return Cs().useState("mounted")||o?K.jsx(Kf.Provider,{value:o,children:K.jsx(L2,{ref:n,...r})}):null}),Zf=c.createContext(void 0);function F2(){const e=c.useContext(Zf);if(e===void 0)throw new Error(De(71));return e}const YC=c.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:a="top",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:f=5,arrowPadding:y=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:h=Ju,style:b,...v}=t,w=Cs(),x=_2(),S=w.useState("open"),R=w.useState("mounted"),C=w.useState("trackCursorAxis"),k=w.useState("disableHoverablePopup"),P=w.useState("floatingRootContext"),E=w.useState("instantType"),O=w.useState("transitionStatus"),I=w.useState("adaptiveOrigin"),N=Ta({anchor:s,positionMethod:i,floatingRootContext:P,mounted:R,side:a,sideOffset:u,align:l,alignOffset:d,collisionBoundary:p,collisionPadding:f,sticky:m,arrowPadding:y,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:h,adaptiveOrigin:I}),D=c.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:C!=="none"?"tracking-cursor":E}),[S,N.side,N.align,N.anchorHidden,C,E]),M=Oa(t,D,{styles:N.positionerStyles,transitionStatus:O,props:v,refs:[n,w.useStateSetter("positionerElement")],hidden:!R,inert:!S||C==="both"||k});return K.jsx(Zf.Provider,{value:N,children:M})}),XC=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=Cs(),{side:l,align:u}=F2(),d=a.useState("open"),p=a.useState("instantType"),f=a.useState("transitionStatus"),y=a.useState("popupProps"),m=a.useState("floatingRootContext"),g=a.useState("disabled"),h=a.useState("closeDelay");kt({open:d,ref:a.context.popupRef,onComplete(){var x,S;d&&((S=(x=a.context).onOpenChangeComplete)==null||S.call(x,!0))}}),kd(m,{enabled:!g,closeDelay:h});const b=a.useStateSetter("popupElement");return Se("div",t,{state:{open:d,side:l,align:u,instant:p,transitionStatus:f},ref:[n,a.context.popupRef,b],props:[ds,y,hs(f),i],stateAttributesMapping:Wi})}),KC=function(t){const{delay:n,closeDelay:o,timeout:r=400}=t,s=c.useMemo(()=>({open:n,close:o}),[n,o]);return K.jsx(Yf.Provider,{value:n,children:K.jsx(Cy,{delay:s,timeoutMs:r,children:t.children})})};function Qf(e,t,n,o=!0,r){const[s,i]=c.useState(),a=tt(r?`${r}-label`:void 0),l=e??t??s;return oe(()=>{const u=e||t||!o?void 0:z2(n.current,a);s!==u&&i(u)}),l}function z2(e,t){const n=V2(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function V2(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const r=e.nextElementSibling;if(r&&r.htmlFor===n)return r}const o=e.labels;return o&&o[0]}const $2=c.createContext({disabled:!1});function H2(){return c.useContext($2)}const j2=c.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:a,disabled:l=!1,onValueChange:u,defaultValue:d,autoFocus:p=!1,style:f,...y}=t,{state:m,name:g,disabled:h,setTouched:b,setDirty:v,validityData:w,setFocused:x,setFilled:S,validationMode:R,validation:C}=vo(),{clearErrors:k}=Ss(),P=h||l,E=g??i,O={...m,disabled:P},{labelId:I}=qo(),N=ws({id:s});oe(()=>{var L;const T=a!=null;(L=C.inputRef.current)!=null&&L.value||T&&a!==""?S(!0):T&&a===""&&S(!1)},[C.inputRef,S,a]);const D=c.useRef(null);oe(()=>{p&&D.current===dt(Te(D.current))&&x(!0)},[p,x]);const[M]=_t({controlled:a,default:d,name:"FieldControl",state:"value"}),z=a!==void 0,_=z?M:void 0,A=le(()=>{var T;return(T=C.inputRef.current)==null?void 0:T.value});return xs(C.inputRef,N,_,A,!P,i),Se("input",t,{ref:[n,D],state:O,props:[{id:N,disabled:P,name:E,ref:C.inputRef,"aria-labelledby":I,autoFocus:p,...z?{value:_}:{defaultValue:d},onChange(T){const L=T.currentTarget.value;u==null||u(L,ke(Rt,T.nativeEvent)),v(L!==(w.initialValue??"")),S(L!==""),T.nativeEvent.defaultPrevented||(k(E),C.change(L))},onFocus(){x(!0)},onBlur(T){b(!0),x(!1),R==="onBlur"&&C.commit(T.currentTarget.value)},onKeyDown(T){T.currentTarget.tagName==="INPUT"&&T.key==="Enter"&&(b(!0),C.commit(T.currentTarget.value))}},y,T=>C.getValidationProps(P,T)],stateAttributesMapping:vs})}),ZC=c.forwardRef(function(t,n){return K.jsx(j2,{ref:n,...t})});function Jf(e){return Array.isArray(e)?e.map(t=>Jf(t)).join(","):e==null?"":String(e)}const Tl=new Map;function B2(e,t){const n=JSON.stringify({locale:Jf(e),options:t}),o=Tl.get(n);if(o)return o;const r=new Intl.NumberFormat(e,t);return Tl.set(n,r),r}function Il(e,t,n){return e==null?"":B2(t,n).format(e)}function W2(e,t,n){return(e-t)*100/(n-t)}const ep=c.createContext(void 0);function Es(){const e=c.useContext(ep);if(e===void 0)throw new Error(De(51));return e}const Xo={status(e){return{[`data-${e}`]:""}}},QC=c.forwardRef(function(t,n){const{format:o,getAriaValueText:r,locale:s,max:i=100,min:a=0,value:l,render:u,className:d,children:p,style:f,...y}=t,[m,g]=c.useState();let h="indeterminate",b=null,v=null,w="",x="indeterminate progress";if(l!=null&&Number.isFinite(l)){const P=W2(l,a,i);b=hn(Number.isNaN(P)?0:P,0,100),v=hn(l,a,i),h=v===i?"complete":"progressing",w=o?Il(v,s,o):Il(b/100,s,{style:"percent"}),x=w}const S=c.useMemo(()=>({status:h}),[h]),R={"aria-labelledby":m,"aria-valuemax":i,"aria-valuemin":a,"aria-valuenow":v??void 0,"aria-valuetext":r?r(w,l):x,role:"progressbar",children:K.jsxs(c.Fragment,{children:[p,K.jsx("span",{role:"presentation",style:Bo,children:"x"})]})},C=c.useMemo(()=>({formattedValue:w,percentageValue:b,setLabelId:g,state:S,value:l}),[w,b,g,S,l]),k=Se("div",t,{state:S,ref:n,props:[R,y],stateAttributesMapping:Xo});return K.jsx(ep.Provider,{value:C,children:k})}),JC=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{state:a}=Es();return Se("div",t,{state:a,ref:n,props:i,stateAttributesMapping:Xo})}),eE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{percentageValue:a,state:l}=Es(),u=a==null?{}:{insetInlineStart:0,height:"inherit",width:`${a}%`};return Se("div",t,{state:l,ref:n,props:[{style:u},i],stateAttributesMapping:Xo})}),tE=c.forwardRef(function(t,n){const{className:o,render:r,children:s,style:i,...a}=t,{value:l,formattedValue:u,state:d}=Es(),p=d.status==="indeterminate";return Se("span",t,{state:d,ref:n,props:[{"aria-hidden":!0,children:typeof s=="function"?s(p?"indeterminate":u,l):p?null:u},a],stateAttributesMapping:Xo})}),nE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...a}=t,{setLabelId:l,state:u}=Es(),d=xv(i,l);return Se("span",t,{state:u,ref:n,props:[{id:d,role:"presentation"},a],stateAttributesMapping:Xo})}),tp=c.createContext(void 0);function Ms(){const e=c.useContext(tp);if(e===void 0)throw new Error(De(53));return e}const U2=500,Ti=16;function gn(e,t,n){if(!e)return 0;const o=getComputedStyle(e),r=`${t}${n==="x"?"Inline":"Block"}`,s=parseFloat(o[`${r}Start`]);return n==="x"&&t==="margin"?s*2:s+parseFloat(o[`${r}End`])}const qn=e=>t=>t?{[e]:""}:null,qa={hasOverflowX:qn("data-has-overflow-x"),hasOverflowY:qn("data-has-overflow-y"),overflowXStart:qn("data-overflow-x-start"),overflowXEnd:qn("data-overflow-x-end"),overflowYStart:qn("data-overflow-y-start"),overflowYEnd:qn("data-overflow-y-end"),cornerHidden:()=>null},G2={x:0,y:0},Ol={width:0,height:0},q2={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Y2={x:!0,y:!0,corner:!0},oE=c.forwardRef(function(t,n){const{render:o,className:r,overflowEdgeThreshold:s,style:i,...a}=t,{xStart:l,xEnd:u,yStart:d,yEnd:p}=X2(s),f=tt(),y=Ge(),m=Ge(),{nonce:g,disableStyleElements:h}=_a(),[b,v]=c.useState(!1),[w,x]=c.useState(!1),[S,R]=c.useState(!1),[C,k]=c.useState(!1),[P,E]=c.useState(!1),[O,I]=c.useState(Ol),[N,D]=c.useState(Ol),[M,z]=c.useState(q2),[_,A]=c.useState(Y2),F=c.useRef(null),T=c.useRef(null),L=c.useRef(null),j=c.useRef(null),$=c.useRef(null),U=c.useRef(null),q=c.useRef(null),V=c.useRef(null),Q=c.useRef(0),H=c.useRef(0),G=c.useRef(0),ue=c.useRef(0),ne=c.useRef("vertical"),te=c.useRef(G2),J=c.useRef(null);function ee(se){const Z=se?R:x,X=se?y:m;Z(!0),X.start(U2,()=>{Z(!1)})}const ie=le(se=>{const Z=se.x-te.current.x,X=se.y-te.current.y;te.current=se,X!==0&&ee(!0),Z!==0&&ee(!1)}),xe=le(()=>{const se=T.current;se&&J.current===null&&(J.current=se.style.scrollSnapType,se.style.scrollSnapType="none")}),ae=le(se=>{if(se.button!==0)return;if(V.current!==null){const pe=ne.current==="vertical"?$.current:U.current;if(pe!=null&&pe.hasPointerCapture(V.current))return}V.current=se.pointerId,Q.current=se.clientY,H.current=se.clientX,ne.current=se.currentTarget.getAttribute("data-orientation");const Z=T.current;Z&&(G.current=Z.scrollTop,ue.current=Z.scrollLeft,xe());const X=ne.current==="vertical"?$.current:U.current;X==null||X.setPointerCapture(se.pointerId)}),he=le(se=>{if(se.pointerId!==V.current)return;V.current=null,(ne.current==="vertical"?R:x)(!1),J.current!==null&&(T.current&&(T.current.style.scrollSnapType=J.current),J.current=null);const Z=ne.current==="vertical"?$.current:U.current;Z!=null&&Z.hasPointerCapture(se.pointerId)&&Z.releasePointerCapture(se.pointerId)}),re=le(se=>{if(se.pointerId!==V.current)return;if(se.buttons%2===0){he(se);return}const Z=T.current;if(!Z)return;const X=ne.current==="vertical",pe=X?$.current:U.current,be=X?L.current:j.current;if(!pe||!be)return;const _e=X?"y":"x",Ue=gn(be,"padding",_e),Ye=gn(pe,"margin",_e),st=X?pe.offsetHeight:pe.offsetWidth,Je=(X?be.offsetHeight:be.offsetWidth)-st-Ue-Ye,ct=X?se.clientY-Q.current:se.clientX-H.current,Re=Je<=0?0:ct/Je,je=X?Z.scrollHeight:Z.scrollWidth,qe=X?Z.clientHeight:Z.clientWidth,Xe=(X?G.current:ue.current)+Re*(je-qe);X?Z.scrollTop=Xe:Z.scrollLeft=Xe,se.preventDefault(),ee(X)});function ge(se){k(se.pointerType==="touch")}function de(se){if(ge(se),se.pointerType!=="touch"){const Z=ve(F.current,se.target);v(Z)}}const ce=c.useMemo(()=>({scrolling:w||S,hasOverflowX:!_.x,hasOverflowY:!_.y,overflowXStart:M.xStart,overflowXEnd:M.xEnd,overflowYStart:M.yStart,overflowYEnd:M.yEnd,cornerHidden:_.corner}),[w,S,_.x,_.y,_.corner,M]),fe={role:"presentation",onPointerEnter:de,onPointerMove:de,onPointerDown:ge,onPointerLeave(){v(!1)},style:{position:"relative","--scroll-area-corner-height":`${O.height}px`,"--scroll-area-corner-width":`${O.width}px`}},W=Se("div",t,{state:ce,ref:[n,F],props:[fe,a],stateAttributesMapping:qa}),Y=c.useMemo(()=>({handlePointerDown:ae,handlePointerMove:re,handlePointerUp:he,handleScroll:ie,disableViewportSnap:xe,cornerSize:O,setCornerSize:I,thumbSize:N,setThumbSize:D,hasMeasuredScrollbar:P,setHasMeasuredScrollbar:E,touchModality:C,cornerRef:q,scrollingX:w,scrollingY:S,hovering:b,setHovering:v,viewportRef:T,scrollbarYRef:L,scrollbarXRef:j,thumbYRef:$,thumbXRef:U,rootId:f,hiddenState:_,setHiddenState:A,overflowEdges:M,setOverflowEdges:z,viewportState:ce,overflowEdgeThreshold:{xStart:l,xEnd:u,yStart:d,yEnd:p}}),[ae,re,he,ie,xe,O,N,P,C,w,S,b,f,_,M,ce,l,u,d,p]);return K.jsxs(tp.Provider,{value:Y,children:[!h&&Vo.getElement(g),W]})});function X2(e){const t=typeof e=="number"?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,(t==null?void 0:t.xStart)||0),xEnd:Math.max(0,(t==null?void 0:t.xEnd)||0),yStart:Math.max(0,(t==null?void 0:t.yStart)||0),yEnd:Math.max(0,(t==null?void 0:t.yEnd)||0)}}const K2=c.createContext(void 0),np=["--scroll-area-overflow-x-start","--scroll-area-overflow-x-end","--scroll-area-overflow-y-start","--scroll-area-overflow-y-end"];let Al=!1;function Z2(){Al||qt||(typeof CSS<"u"&&"registerProperty"in CSS&&np.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Al=!0)}const rE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{viewportRef:a,scrollbarYRef:l,scrollbarXRef:u,thumbYRef:d,thumbXRef:p,cornerRef:f,cornerSize:y,setCornerSize:m,setThumbSize:g,rootId:h,setHiddenState:b,hiddenState:v,setHasMeasuredScrollbar:w,handleScroll:x,touchModality:S,setHovering:R,setOverflowEdges:C,overflowEdgeThreshold:k,viewportState:P}=Ms(),E=bo(),O=c.useRef(!0),I=c.useRef([NaN,NaN,NaN,NaN]),N=Ge(),D=Ge(),M=le(()=>{const T=a.current,L=l.current,j=u.current,$=d.current,U=p.current,q=f.current;if(!T)return;const V=T.scrollHeight,Q=T.scrollWidth,H=T.clientHeight,G=T.clientWidth,ue=T.scrollTop,ne=T.scrollLeft,te=I.current,J=Number.isNaN(te[0]);if(te[0]=H,te[1]=V,te[2]=G,te[3]=Q,J&&w(!0),V===0||Q===0)return;const ee=Q2(T),ie=ee.y,xe=ee.x,ae=G/Q,he=H/V,re=Math.max(0,Q-G),ge=Math.max(0,V-H);let de=0,ce=0;xe||(de=fo(E==="rtl"?-ne:ne,re),ce=re-de);const fe=ie?0:fo(ue,ge),W=ie?0:ge-fe,Y=xe?0:G,se=ie?0:H;let Z=0,X=0;!xe&&!ie&&(Z=(L==null?void 0:L.offsetWidth)||0,X=(j==null?void 0:j.offsetHeight)||0);const pe=y.width===0&&y.height===0,be=pe?Z:0,_e=pe?X:0,Ue=gn(j,"padding","x"),Ye=gn(L,"padding","y"),st=gn(U,"margin","x"),Le=gn($,"margin","y"),Je=Y-Ue-st,ct=se-Ye-Le,Re=j?Math.min(j.offsetWidth-be,Je):Je,je=L?Math.min(L.offsetHeight-_e,ct):ct,qe=Math.max(Ti,Re*ae),Be=Math.max(Ti,je*he);if(g(we=>wr(we,{width:qe,height:Be})),L&&$){const we=L.offsetHeight-Be-Ye-Le,Ae=Nl($,"--scroll-area-thumb-height",ue,ge,V,Be,we);$.style.transform=`translate3d(0,${Ae}px,0)`}if(j&&U){const we=j.offsetWidth-qe-Ue-st,Ae=E==="rtl"?-ne:ne,Qe=Nl(U,"--scroll-area-thumb-width",Ae,re,Q,qe,we);U.style.transform=`translate3d(${E==="rtl"?-Qe:Qe}px,0,0)`}const Xe=[de,ce,fe,W];np.forEach((we,Ae)=>{T.style.setProperty(we,`${Xe[Ae]}px`)}),q&&m(we=>wr(we,{width:Z,height:X})),b(we=>wr(we,ee));const pt={xStart:!xe&&de>k.xStart,xEnd:!xe&&ce>k.xEnd,yStart:!ie&&fe>k.yStart,yEnd:!ie&&W>k.yEnd};C(we=>wr(we,pt))});oe(()=>{Z2()},[]),oe(()=>{queueMicrotask(M)},[M,v,E,k.xStart,k.xEnd,k.yStart,k.yEnd]),oe(()=>{var T;(T=a.current)!=null&&T.matches(":hover")&&R(!0)},[a,R]),oe(()=>{const T=a.current;if(typeof ResizeObserver>"u"||!T)return;let L=!1;const j=new ResizeObserver(()=>{if(!L){L=!0;const $=I.current;if($[0]===T.clientHeight&&$[1]===T.scrollHeight&&$[2]===T.clientWidth&&$[3]===T.scrollWidth)return}M()});return j.observe(T),D.start(0,()=>{const $=T.getAnimations({subtree:!0});$.length!==0&&Promise.allSettled($.map(U=>U.finished)).then(M).catch(()=>{})}),()=>{j.disconnect(),D.clear()}},[M,a,D]);function z(){O.current=!1}const _={role:"presentation",...h&&{"data-id":`${h}-viewport`},tabIndex:v.x&&v.y?-1:0,className:Vo.className,style:{overflow:"scroll"},onScroll(){a.current&&(M(),(S||!O.current)&&x({x:a.current.scrollLeft,y:a.current.scrollTop}),N.start(100,()=>{O.current=!0}))},onWheel:z,onPointerMove:z,onPointerEnter:z,onKeyDown:z},A=Se("div",t,{ref:[n,a],state:P,props:[_,i],stateAttributesMapping:qa}),F=c.useMemo(()=>({computeThumbPosition:M}),[M]);return K.jsx(K2.Provider,{value:F,children:A})});function Q2(e){const t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function wr(e,t){for(const n in t)if(e[n]!==t[n])return t;return e}function Nl(e,t,n,o,r,s,i){const a=hn(n,0,o),l=n-a,u=Math.max(Ti,s*r/(r+Math.abs(l)));return e.style.setProperty(t,l?`${u}px`:""),(o?a/o*i:0)+(l>0?s-u:0)}const op=c.createContext(void 0);function J2(){const e=c.useContext(op);if(e===void 0)throw new Error(De(54));return e}const sE=c.forwardRef(function(t,n){const{render:o,className:r,orientation:s="vertical",keepMounted:i=!1,style:a,...l}=t,{hovering:u,scrollingX:d,scrollingY:p,hiddenState:f,scrollbarYRef:y,scrollbarXRef:m,viewportRef:g,thumbYRef:h,thumbXRef:b,handlePointerDown:v,handlePointerUp:w,handleScroll:x,disableViewportSnap:S,rootId:R,thumbSize:C,hasMeasuredScrollbar:k,viewportState:P}=Ms(),E=s==="vertical",O={...P,hovering:u,scrolling:E?p:d,orientation:s},I=bo(),N=!k&&!i,D=E?f.y:f.x,M=i||!D;c.useEffect(()=>{if(!M)return;const A=g.current,F=E?y.current:m.current;if(!F)return;function T(L){if(!A||L.ctrlKey)return;const j=!E,$=j?"scrollLeft":"scrollTop",U=j?L.deltaX:L.deltaY;if(U===0)return;const q=j?A.scrollWidth-A.clientWidth:A.scrollHeight-A.clientHeight,V=j&&I==="rtl"?-q:0,Q=j&&I==="rtl"?0:q,H=A[$];H<=V&&U<0||H>=Q&&U>0||(L.preventDefault(),A[$]=Math.min(Q,Math.max(V,H+U)),x({x:A.scrollLeft,y:A.scrollTop}))}return Pe(F,"wheel",T,{passive:!1})},[I,x,E,m,y,M,g]);const z={...R&&{"data-id":`${R}-scrollbar`},onPointerDown(A){if(A.button!==0)return;const F=et(A.nativeEvent),T=E?h.current:b.current;if(T&&ve(T,F))return;const L=g.current;if(!L)return;const j=E?y.current:m.current;if(!T||!j)return;const $=E?"y":"x",U=gn(T,"margin",$),q=gn(j,"padding",$),V=E?T.offsetHeight:T.offsetWidth,Q=j.getBoundingClientRect(),H=E?A.clientY-Q.top-V/2-q+U/2:A.clientX-Q.left-V/2-q+U/2,G=E?L.scrollHeight:L.scrollWidth,ue=E?L.clientHeight:L.clientWidth,te=(E?j.offsetHeight:j.offsetWidth)-V-q-U;if(te<=0)return;const J=H/te,ee=G-ue;S(),E?L.scrollTop=J*ee:I==="rtl"?L.scrollLeft=-(1-J)*ee:L.scrollLeft=J*ee,x({x:L.scrollLeft,y:L.scrollTop}),v(A)},onPointerUp:w,onPointerCancel:w,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:N?"hidden":void 0,...E?{top:0,bottom:"var(--scroll-area-corner-height)",insetInlineEnd:0,"--scroll-area-thumb-height":`${C.height}px`}:{insetInlineStart:0,insetInlineEnd:"var(--scroll-area-corner-width)",bottom:0,"--scroll-area-thumb-width":`${C.width}px`}}},_=Se("div",t,{ref:[n,E?y:m],state:O,props:[z,l],stateAttributesMapping:qa});return M?K.jsx(op.Provider,{value:s,children:_}):null}),iE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{thumbYRef:a,thumbXRef:l,handlePointerDown:u,handlePointerMove:d,handlePointerUp:p,scrollingX:f,scrollingY:y,hasMeasuredScrollbar:m}=Ms(),g=J2(),h=g==="vertical";return Se("div",t,{ref:[n,h?a:l],state:{scrolling:h?y:f,orientation:g},props:[{onPointerDown:u,onPointerMove:d,onPointerUp:p,onPointerCancel:p,style:{visibility:m?void 0:"hidden",...h?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},i]})}),aE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{cornerRef:a,cornerSize:l,hiddenState:u}=Ms(),d=Se("div",t,{ref:[n,a],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:l.width,height:l.height}},i]});return u.corner?null:d}),rp=c.createContext(void 0);function Ps(){const e=c.useContext(rp);if(e===void 0)throw new Error(De(64));return e}const Ko={tabActivationDirection:e=>({"data-activation-direction":e})},cE=c.forwardRef(function(t,n){const{className:o,defaultValue:r=0,onValueChange:s,orientation:i="horizontal",render:a,value:l,style:u,...d}=t,p=t.defaultValue!==void 0,f=c.useRef([]),[y,m]=c.useState(()=>new Map),[g,h]=_t({controlled:l,default:r,name:"Tabs",state:"value"}),b=l!==void 0,[v,w]=c.useState(()=>new Map),x=c.useRef(void 0),S=c.useCallback(H=>Ii(v,H),[v]),[R,C]=c.useState(()=>({previousValue:g,tabActivationDirection:"none"})),{previousValue:k,tabActivationDirection:P}=R;let E=P,O=!1;k!==g&&(E=Dl(k,g,i,v),O=k!=null&&g!=null&&S(g)==null);const I=O?k:g,N=k!==I||P!==E;oe(()=>{N&&C({previousValue:I,tabActivationDirection:E})},[I,N,E]);const D=le((H,G)=>{const ue=Dl(g,H,i,v);G.activationDirection=ue,s==null||s(H,G),!G.isCanceled&&h(H)}),M=le((H,G)=>{s==null||s(H,ke(G,void 0,void 0,{activationDirection:"none"}))}),z=le((H,G)=>(m(ue=>{const ne=new Map(ue);return ne.set(H,G),ne}),()=>{m(ue=>{if(ue.get(H)!==G)return ue;const ne=new Map(ue);return ne.delete(H),ne})})),_=c.useCallback(H=>y.get(H),[y]),A=c.useCallback(H=>{for(const G of v.values())if(H===G.value)return G.id},[v]),F=c.useMemo(()=>({getTabElementBySelectedValue:S,getTabIdByPanelValue:A,getTabPanelIdByValue:_,onValueChange:D,orientation:i,registerMountedTabPanel:z,setTabMap:w,tabActivationDirection:E,value:g}),[S,A,_,D,i,z,w,E,g]),T=c.useMemo(()=>{for(const H of v.values())if(H.value===g)return H},[v,g]),L=c.useMemo(()=>{for(const H of v.values())if(!H.disabled)return H.value},[v]),j=c.useRef(!p),$=c.useRef(r),U=c.useRef(p),q=c.useRef(!1);oe(()=>{var te;if(b)return;function H(J,ee){h(J),C({previousValue:J,tabActivationDirection:"none"}),M(J,ee),j.current=!1}if(v.size===0){q.current&&g!==null&&!((te=x.current)!=null&&te.isConnected)&&H(null,xc);return}q.current=!0,x.current=v.keys().next().value;const G=T==null?void 0:T.disabled,ue=T==null&&g!==null;if(!G&&g===$.current&&(U.current=!1),U.current&&G&&g===$.current)return;const ne=j.current;if(G||ue){const J=L??null;if(g===J){j.current=!1;return}let ee=xc;ne?ee=wc:G&&(ee=Iu),H(J,ee);return}ne&&T!=null&&(M(g,wc),j.current=!1)},[L,b,M,T,h,v,g]);const Q=Se("div",t,{state:{orientation:i,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:Ko});return K.jsx(rp.Provider,{value:F,children:K.jsx(ms,{elementsRef:f,children:Q})})});function Ii(e,t){for(const[n,o]of e.entries())if(t===o.value)return n;return null}function Dl(e,t,n,o){if(e==null||t==null)return"none";const[r,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=Ii(o,e),l=Ii(o,t);if(a==null||l==null)return a!==l&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[r],d=l.getBoundingClientRect()[r];return d<u?s:d>u?i:"none"}const sp="data-composite-item-active",ip=c.createContext(void 0);function ap(){const e=c.useContext(ip);if(e===void 0)throw new Error(De(65));return e}const lE=c.forwardRef(function(t,n){const{className:o,disabled:r=!1,render:s,value:i,id:a,nativeButton:l=!0,style:u,...d}=t,{value:p,getTabPanelIdByValue:f,onValueChange:y,orientation:m,tabActivationDirection:g}=Ps(),{activateOnFocus:h,registerTabResizeObserverElement:b,tabsListElement:v}=ap(),{highlightedIndex:w,onHighlightedIndexChange:x}=Yr(),S=tt(a),R=c.useMemo(()=>({disabled:r,id:S,value:i}),[r,S,i]),{compositeProps:C,compositeRef:k,index:P}=$d({metadata:R}),E=i===p,O=c.useRef(!1),I=c.useRef(null),N=le(q=>{var V;(V=I.current)==null||V.call(I),I.current=q?b(q):null});oe(()=>{if(O.current){O.current=!1;return}if(!(E&&P>-1&&w!==P))return;const q=v;if(q!=null){const V=dt(Te(q));if(V&&ve(q,V))return}r||x(P)},[E,P,w,x,r,v]);const{getButtonProps:D,buttonRef:M}=Tt({disabled:r,native:l,focusableWhenDisabled:!0}),z=f(i),_=c.useRef(!1),A=c.useRef(!1);function F(q){y(i,ke(Rt,q.nativeEvent,void 0,{activationDirection:"none"}))}function T(q){E||r||F(q)}function L(q){E||r||h&&(!_.current||A.current)&&F(q)}function j(q){if(E||r)return;_.current=!0,A.current=q.button===0;const V=Te(q.currentTarget);function Q(){_.current=!1,A.current=!1,V.removeEventListener("pointerup",Q),V.removeEventListener("pointercancel",Q)}V.addEventListener("pointerup",Q),V.addEventListener("pointercancel",Q)}return Se("button",t,{state:{disabled:r,active:E,orientation:m,tabActivationDirection:g},ref:[n,M,k,N],props:[C,{role:"tab","aria-controls":z,"aria-selected":E,id:S,onClick:T,onFocus:L,onPointerDown:j,[sp]:E?"":void 0,onKeyDownCapture(){O.current=!0}},d,D],stateAttributesMapping:Ko})}),ew="";function tw(){return Ke}function nw(){return!1}function ow(){return!0}function rw(){return ls.useSyncExternalStore(tw,nw,ow)}function sw(e){const{script:t}=e,{nonce:n}=_a();return rw()?K.jsx("script",{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var _l;const iw={...Ko,activeTabPosition:()=>null,activeTabSize:()=>null},uE=c.forwardRef(function(t,n){const{className:o,render:r,renderBeforeHydration:s=!1,style:i,...a}=t,{getTabElementBySelectedValue:l,orientation:u,tabActivationDirection:d,value:p}=Ps(),{tabsListElement:f,registerIndicatorUpdateListener:y}=ap(),m=ob();c.useEffect(()=>y(m),[y,m]);let g=0,h=0,b=0,v=0,w=0,x=0,S=!1;if(p!=null&&f!=null){const I=l(p);if(I!=null){S=!0;const{width:N,height:D}=ul(I),{width:M,height:z}=ul(f),_=I.getBoundingClientRect(),A=f.getBoundingClientRect(),F=M>0?A.width/M:1,T=z>0?A.height/z:1;if(F>Number.EPSILON&&T>Number.EPSILON){const j=_.left-A.left,$=_.top-A.top;g=j/F+f.scrollLeft-f.clientLeft,b=$/T+f.scrollTop-f.clientTop}else g=I.offsetLeft,b=I.offsetTop;w=N,x=D,h=f.scrollWidth-g-w,v=f.scrollHeight-b-x}}const R=S?{left:g,right:h,top:b,bottom:v}:null,C=S?{width:w,height:x}:null,k=S?{"--active-tab-left":`${g}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${b}px`,"--active-tab-bottom":`${v}px`,"--active-tab-width":`${w}px`,"--active-tab-height":`${x}px`}:void 0,P=S&&w>0&&x>0,O=Se("span",t,{state:{orientation:u,activeTabPosition:R,activeTabSize:C,tabActivationDirection:d},ref:n,props:[{role:"presentation",style:k,hidden:!P},a,{suppressHydrationWarning:!0}],stateAttributesMapping:iw});return p==null?null:K.jsxs(c.Fragment,{children:[O,s&&(_l||(_l=K.jsx(sw,{script:ew})))]})}),aw={...Ko,...Gt},dE=c.forwardRef(function(t,n){const{className:o,value:r,render:s,keepMounted:i=!1,style:a,...l}=t,{value:u,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:y}=Ps(),m=tt(),{ref:g,index:h}=yo(),b=r===u,{mounted:v,transitionStatus:w,setMounted:x}=ln(b),S=!v,R=d(r),C={hidden:S,orientation:p,tabActivationDirection:f,transitionStatus:w},k=c.useRef(null),P=Se("div",t,{state:C,ref:[n,g,k],props:[{"aria-labelledby":R,hidden:S,id:m,role:"tabpanel",tabIndex:b?0:-1,inert:gs(!b),"data-index":h},l],stateAttributesMapping:aw});return kt({open:b,ref:k,onComplete(){b||x(!1)}}),oe(()=>{if(!(m==null||S&&!i))return y(r,m)},[S,i,r,m,y]),i||v?P:null}),cw=[];function lw(e){const{loopFocus:t=!0,orientation:n="both",grid:o,onLoop:r,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d,disabledIndices:p,modifierKeys:f=cw}=e,[y,m]=c.useState(0),g=o!=null,h=c.useRef(null),b=Nt(h,l),v=c.useRef([]),w=c.useRef(!1),x=i??y,S=le((E,O=!1)=>{if((a??m)(E),O){const I=v.current[E];el(h.current,I,s,n)}}),R=le(E=>{var D;if(E.size===0||w.current)return;w.current=!0;const O=Array.from(E.keys()),I=O.find(M=>M==null?void 0:M.hasAttribute(sp))??null,N=I?((D=E.get(I))==null?void 0:D.index)??-1:-1;if(N!==-1)S(N);else if($r(O,x,p)){const M=Jt(O,{disabledIndices:p});Ao(O,M)||S(M)}el(h.current,I,s,n)});oe(()=>{if(p==null||i!=null||!w.current)return;const E=v.current;if($r(E,x,p)){const O=Jt(E,{disabledIndices:p});Ao(E,O)||S(O)}},[p,i,x,v,S]);const C=le((E,O,I)=>r?r(E,O,I,v):I),k=le(E=>{const O=E.key===gi||E.key===mi;if(!ps.has(E.key)||!u&&O||uw(E,f)||!h.current)return;const N=s==="rtl",D=N?pi:hi,M=N?hi:pi,z=n==="vertical"?fi:D,_=n==="vertical"?di:M,A=et(E.nativeEvent);if(A!=null&&Jc(A)&&!jd(A)){const U=A.selectionStart,q=A.selectionEnd,V=A.value;if(U==null||E.shiftKey||U!==q||E.key!==_&&U<V.length||E.key!==z&&U>0)return}let F=x;const T=kr(v,p),L=ii(v,p);o!=null&&(F=o({disabledIndices:p,elementsRef:v,event:E,highlightedIndex:x,loopFocus:t,maxIndex:L,minIndex:T,onLoop:C,orientation:n,rtl:N}));const j=n!=="vertical"&&E.key===D||n!=="horizontal"&&E.key===fi,$=n!=="vertical"&&E.key===M||n!=="horizontal"&&E.key===di;u&&(E.key===gi?F=T:E.key===mi&&(F=L)),F===x&&(j||$)&&(t&&F===L&&j?(F=T,r&&(F=r(E,x,F,v))):t&&F===T&&$?(F=L,r&&(F=r(E,x,F,v))):F=Jt(v.current,{startingIndex:F,decrement:$,disabledIndices:p})),F!==x&&!Ao(v.current,F)&&(d&&E.stopPropagation(),(g||O||j||$)&&E.preventDefault(),S(F,!0),queueMicrotask(()=>{var U;(U=v.current[F])==null||U.focus()}))});return{props:{ref:b,onFocus(E){const O=h.current,I=et(E.nativeEvent);!O||I==null||!Jc(I)||I.setSelectionRange(0,I.value.length)},onKeyDown:k},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:R,relayKeyboardEvent:k}}function uw(e,t){for(const n of Sb)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function cp(e){const{render:t,className:n,style:o,refs:r=Dt,props:s=Dt,state:i=We,stateAttributesMapping:a,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:p,loopFocus:f,onLoop:y,enableHomeAndEndKeys:m,onMapChange:g,stopEventPropagation:h=!0,rootRef:b,disabledIndices:v,modifierKeys:w,highlightItemOnHover:x=!1,tag:S="div",...R}=e,C=bo(),{props:k,highlightedIndex:P,onHighlightedIndexChange:E,elementsRef:O,onMapChange:I,relayKeyboardEvent:N}=lw({grid:p,loopFocus:f,onLoop:y,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:h,enableHomeAndEndKeys:m,direction:C,disabledIndices:v,modifierKeys:w}),D=Se(S,e,{state:i,ref:r,props:[k,...s,R],stateAttributesMapping:a}),M=c.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:N}),[P,E,x,N]);return K.jsx(lu.Provider,{value:M,children:K.jsx(ms,{elementsRef:O,onMapChange:z=>{g==null||g(z),I(z)},children:D})})}const fE=c.forwardRef(function(t,n){const{activateOnFocus:o=!1,className:r,loopFocus:s=!0,render:i,style:a,...l}=t,{orientation:u,setTabMap:d,tabActivationDirection:p}=Ps(),[f,y]=c.useState(0),[m,g]=c.useState(null),h=c.useRef(new Set),b=c.useRef(new Set),v=c.useRef(null);oe(()=>{if(typeof ResizeObserver>"u")return;const k=new ResizeObserver(()=>{h.current.forEach(P=>{P()})});return v.current=k,m&&k.observe(m),b.current.forEach(P=>{k.observe(P)}),()=>{k.disconnect(),v.current=null}},[m]);const w=le(k=>(h.current.add(k),()=>{h.current.delete(k)})),x=le(k=>{var P;return b.current.add(k),(P=v.current)==null||P.observe(k),()=>{var E;b.current.delete(k),(E=v.current)==null||E.unobserve(k)}}),S={orientation:u,tabActivationDirection:p},R={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},C=c.useMemo(()=>({activateOnFocus:o,registerIndicatorUpdateListener:w,registerTabResizeObserverElement:x,tabsListElement:m}),[o,w,x,m]);return K.jsx(ip.Provider,{value:C,children:K.jsx(cp,{render:i,className:r,style:a,state:S,refs:[n,g],props:[R,l],stateAttributesMapping:Ko,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:y,onMapChange:d,disabledIndices:Dt})})});function pE(e){return Jd("alert-dialog",e)}const hE=$v;function dw(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const o=t;if(o.type==="submit")return o}}return null}function lp(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...vs}}const fw=c.createContext(void 0);function pw(){return c.useContext(fw)}const up=c.createContext(void 0);function hw(){const e=c.useContext(up);if(e===void 0)throw new Error(De(14));return e}const gw="data-parent",gE=c.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:l,id:u,indeterminate:d=!1,inputRef:p,name:f,onCheckedChange:y,parent:m=!1,readOnly:g=!1,render:h,required:b=!1,uncheckedValue:v,value:w,nativeButton:x=!1,style:S,...R}=t,{clearErrors:C}=Ss(),{disabled:k,name:P,setDirty:E,setFilled:O,setFocused:I,setTouched:N,state:D,validationMode:M,validityData:z,validation:_}=vo(),A=H2(),{labelId:F,controlId:T,registerControlId:L,getDescriptionProps:j}=qo(),$=pw(),U=($==null?void 0:$.allValues)===void 0?void 0:$.parent,q=U!==void 0,V=k||A.disabled||($==null?void 0:$.disabled)||a,Q=P??f,H=w??Q,G=tt(),ue=tt();let ne=u||T;q&&(m?ne=ue:H!==void 0?ne=`${U.id}-${H}`:ne||(ne=ue));let te={};q&&(m?te=U.getParentProps():H!==void 0&&(te=U.getChildProps(H)));const{checked:J=o,indeterminate:ee=d,onCheckedChange:ie,...xe}=te,ae=$==null?void 0:$.value,he=c.useRef(null),re=at(()=>Symbol()),ge=c.useRef(!1),{getButtonProps:de,buttonRef:ce}=Tt({disabled:V,native:x}),fe=($==null?void 0:$.validation)??_,[W,Y]=_t({controlled:H!==void 0&&ae!==void 0&&!m?ae.includes(H):J,default:s,name:"Checkbox",state:"checked"}),se=q?!!J:W,Z=q&&ee||d;oe(()=>{L!==Ke&&(ge.current=!0,L(re.current,ne))},[ne,L,re]),c.useEffect(()=>{const Re=re.current;return()=>{!ge.current||L===Ke||(ge.current=!1,L(Re,void 0))}},[L,re]),xs(he,G,W,void 0,!$&&!V,f);const X=c.useRef(null),pe=fe.registerInput,be=$?H:void 0,_e=c.useCallback(Re=>pe(Re,{controlRef:he,value:be}),[pe,be]),Ue=Nt(p,X,m?void 0:_e),Ye=Qf(i,F,X,!x,ne??void 0);oe(()=>{X.current&&(X.current.indeterminate=Z,W&&O(!0))},[W,Z,O]),bs(W,()=>{$||(C(Q),O(W),E(W!==z.initialValue),fe.change(W))});const st=St({checked:W,disabled:V,form:l,name:m?void 0:Q,id:x?void 0:ne??void 0,required:b,ref:Ue,style:Q?oa:Bo,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Re){if(Re.nativeEvent.defaultPrevented)return;if(g){Re.preventDefault();return}const je=Re.currentTarget.checked,qe=ke(Rt,Re.nativeEvent);if(y==null||y(je,qe),!qe.isCanceled&&(ie==null||ie(je,qe),!qe.isCanceled&&(Y(je),H!==void 0&&$!==void 0&&!m&&!q))){const Be=je?[...$.value,H]:$.value.filter(Xe=>Xe!==H);$.setValue(Be,qe)}},onClick(Re){Re.stopPropagation()},onFocus(){var Re;(Re=he.current)==null||Re.focus()}},w!==void 0?{value:($?W&&w:w)||""}:We,j,Re=>fe.getValidationProps(V,Re));c.useEffect(()=>{if(!U||H===void 0)return;const Re=U.disabledStatesRef.current;return Re.set(H,V),()=>{Re.delete(H)}},[U,V,H]);const Le=c.useMemo(()=>({...D,checked:se,disabled:V,readOnly:g,required:b,indeterminate:Z}),[D,se,V,g,b,Z]),Je=lp(Le),ct=Se("span",t,{state:Le,ref:[ce,he,n],props:[{id:x?ne??void 0:G,role:"checkbox","aria-checked":Z?"mixed":se,"aria-readonly":g||void 0,"aria-required":b||void 0,"aria-labelledby":Ye,[gw]:m?"":void 0,onFocus(){V||I(!0)},onBlur(){const Re=X.current;Re&&(N(!0),I(!1),M==="onBlur"&&fe.commit($?ae:Re.checked))},onKeyDown(Re){var Ae;if(Re.key!=="Enter"||(Re.preventBaseUIHandler(),Re.defaultPrevented))return;const je=((Ae=X.current)==null?void 0:Ae.form)??null,qe=Re.currentTarget,Be=Re.nativeEvent,Xe=Re.preventDefault,pt=Be.preventDefault;let we=!1;Re.preventDefault=()=>{we=!0,Xe.call(Re)},Be.preventDefault=()=>{we=!0,pt.call(Be)},pt.call(Be),He(qe).queueMicrotask(()=>{var Qe;Re.preventDefault=Xe,Be.preventDefault=pt,we||(Qe=dw(je))==null||Qe.click()})},onClick(Re){if(g||V)return;Re.preventDefault();const je=X.current;je&&Qn(je,Re)}},R,xe,de,j,Re=>fe.getValidationProps(V,Re)],stateAttributesMapping:Je});return K.jsxs(up.Provider,{value:Le,children:[ct,!W&&!$&&Q&&!m&&v!==void 0&&K.jsx("input",{type:"hidden",form:l,name:Q,value:v,disabled:V}),K.jsx("input",{...st,suppressHydrationWarning:!0})]})}),mE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,keepMounted:i=!1,...a}=t,l=hw(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:p,setMounted:f}=ln(u),y=c.useRef(null),m={...l,transitionStatus:p};kt({open:u,ref:y,onComplete(){u||f(!1)}});const h={...lp(l),...Gt},b=i||d,v=Se("span",t,{ref:[n,y],state:m,stateAttributesMapping:h,props:a});return b?v:null}),dp=c.createContext(void 0);function mw(){return c.useContext(dp)}const yE=c.forwardRef(function(t,n){const{className:o,defaultPressed:r=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:l,render:u,type:d,value:p,nativeButton:f=!0,style:y,...m}=t,g=tt(p||void 0),h=mw(),b=(h==null?void 0:h.value)??[],v=h?void 0:r,w=(s||(h==null?void 0:h.disabled))??!1,[x,S]=_t({controlled:h?g!==void 0&&b.indexOf(g)>-1:l,default:v,name:"Toggle",state:"pressed"}),{getButtonProps:R,buttonRef:C}=Tt({disabled:w,native:f}),k={disabled:w,pressed:x},P=[C,n],E=[{"aria-pressed":x,onClick(N){var z;const D=!x,M=ke(Rt,N.nativeEvent);a==null||a(D,M),!M.isCanceled&&(g&&((z=h==null?void 0:h.setGroupValue)==null||z.call(h,g,D,M)),!M.isCanceled&&S(D))}},m,R],O=Se("button",t,{enabled:!h,state:k,ref:P,props:E}),I=c.useMemo(()=>({disabled:w,focusableWhenDisabled:!1}),[w]);return h?K.jsx(Hd,{tag:"button",render:u,className:o,style:y,metadata:I,state:k,refs:P,props:E}):O}),yw=c.createContext(void 0);function bw(){return c.useContext(yw)}const bE=c.forwardRef(function(t,n){const{defaultValue:o,disabled:r=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:l=!1,value:u,className:d,render:p,style:f,...y}=t,m=Pa(),g=bw(),h=u!==void 0||o!==void 0,b=((m==null?void 0:m.disabled)??!1)||((g==null?void 0:g.disabled)??!1)||r,[v,w]=_t({controlled:u,default:u===void 0?o??Dt:void 0,name:"ToggleGroup",state:"value"}),x=le((P,E,O)=>{let I;l?(I=v.slice(),E?I.push(P):I.splice(v.indexOf(P),1)):I=E?[P]:[],i==null||i(I,O),!O.isCanceled&&w(I)}),S={disabled:b,multiple:l,orientation:a},R=c.useMemo(()=>({disabled:b,setGroupValue:x,value:v,isValueInitialized:h}),[b,x,v,h]),C={role:"group"},k=Se("div",t,{enabled:!!m,state:S,ref:n,props:[C,y]});return K.jsx(dp.Provider,{value:R,children:m?k:K.jsx(cp,{render:p,className:d,style:f,state:S,refs:[n],props:[C,y],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})});function vE(e){const[t,n]=c.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),o=c.useRef(null),r=c.useRef(null),s=c.useRef(null),i=c.useRef(null),a=c.useRef(!0),l=c.useRef(null),u=bn(),d=c.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:s,backdropRef:o,internalBackdropRef:r,positionerRef:i,allowMouseUpTriggerRef:a,initialCursorPointRef:l,rootId:u}),[t,u]);return K.jsx(Tu.Provider,{value:d,children:K.jsx(ji.Provider,{value:void 0,children:K.jsx(Jb,{...e})})})}const Ll=500,xE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{setAnchor:a,actionsRef:l,internalBackdropRef:u,backdropRef:d,positionerRef:p,allowMouseUpTriggerRef:f,initialCursorPointRef:y,rootId:m}=Zr(!1),{store:g}=cn(!1),h=g.useState("open"),b=g.useState("disabled"),v=c.useRef(null),w=c.useRef(null),x=Ge(),S=Ge(),R=c.useRef(!1),C=c.useRef(null);function k(M,z,_){var F;const A=_.type.startsWith("touch");y.current={x:M,y:z},a({getBoundingClientRect(){return DOMRect.fromRect({width:A?10:0,height:A?10:0,x:M,y:z})}}),R.current=!1,(F=l.current)==null||F.setOpen(!0,ke(Rn,_)),S.start(Ll,()=>{R.current=!0})}function P(M){var A;if(b)return;f.current=!0,It(M),k(M.clientX,M.clientY,M.nativeEvent);const z=Te(v.current);(A=C.current)==null||A.abort();const _=new AbortController;C.current=_,z.addEventListener("mouseup",F=>{var L;if(f.current=!1,!R.current)return;S.clear(),R.current=!1;const T=et(F);ve(p.current,T)||m&&T&&Aa(T)===m||(L=l.current)==null||L.setOpen(!1,ke(Ui,F))},{once:!0,signal:_.signal})}function E(){x.clear(),w.current=null}function O(M){if(b){E();return}if(f.current=!1,M.touches.length!==1){E();return}M.stopPropagation();const z=M.touches[0],_={x:z.clientX,y:z.clientY};w.current=_,x.start(Ll,()=>{k(_.x,_.y,M.nativeEvent)})}function I(M){if(M.touches.length!==1){E();return}if(x.isStarted()&&w.current){const z=M.touches[0],_=10,A=Math.abs(z.clientX-w.current.x),F=Math.abs(z.clientY-w.current.y);(A>_||F>_)&&E()}}return c.useEffect(()=>()=>{var M;(M=C.current)==null||M.abort()},[]),c.useEffect(()=>{function M(_){if(b)return;const F=et(_);(ve(v.current,F)||ve(u.current,F)||ve(d.current,F))&&_.preventDefault()}const z=Te(v.current);return Pe(z,"contextmenu",M)},[d,b,u]),Se("div",t,{state:{open:h},ref:[v,n],props:[{onContextMenu:P,onTouchStart:O,onTouchMove:I,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:"none"}},i],stateAttributesMapping:Lr})});function vw(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function xw(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function ww(e){return e/100*window.innerHeight}function Sw(e){return e/100*window.innerWidth}function Rw(e){switch(typeof e){case"number":return[e,"px"];case"string":{const 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 Oo({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,s]=Rw(n);switch(s){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=xw(t,r);break}case"em":{o=vw(t,r);break}case"vh":{o=ww(r);break}case"vw":{o=Sw(r);break}}return o}function mt(e){return parseFloat(e.toFixed(3))}function go({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function Oi(e){const{panels:t}=e,n=go({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:s}=o;let i=0;if(s.collapsedSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.collapsedSize});i=mt(d/n*100)}let a;if(s.defaultSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.defaultSize});a=mt(d/n*100)}let l=0;if(s.minSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.minSize});l=mt(d/n*100)}let u=100;if(s.maxSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.maxSize});u=mt(d/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:i,collapsible:s.collapsible===!0,defaultSize:a,disabled:s.disabled,minSize:l,maxSize:u,panelId:o.id}})}function $e(e,t="Assertion error"){if(!e)throw Error(t)}function Ai(e,t){return Array.from(t).sort(e==="horizontal"?kw:Cw)}function kw(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Cw(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function fp(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function pp(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 Ew({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,s=Number.MAX_VALUE;for(const i of t){const{x:a,y:l}=pp(o,i),u=e==="horizontal"?a:l;u<s&&(s=u,r=i)}return $e(r,"No rect found"),r}let Sr;function Mw(){return Sr===void 0&&(typeof matchMedia=="function"?Sr=!!matchMedia("(pointer:coarse)").matches:Sr=!1),Sr}function hp(e){const{element:t,orientation:n,panels:o,separators:r}=e,s=Ai(n,Array.from(t.children).filter(fp).map(m=>({element:m}))).map(({element:m})=>m),i=[];let a=!1,l=!1,u=-1,d=-1,p=0,f,y=[];{let m=-1;for(const g of s)g.hasAttribute("data-panel")&&(m++,g.hasAttribute("data-disabled")||(p++,u===-1&&(u=m),d=m))}if(p>1){let m=-1;for(const g of s)if(g.hasAttribute("data-panel")){m++;const h=o.find(b=>b.element===g);if(h){if(f){const b=f.element.getBoundingClientRect(),v=g.getBoundingClientRect();let w;if(l){const x=n==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),S=n==="horizontal"?new DOMRect(v.left,v.top,0,v.height):new DOMRect(v.left,v.top,v.width,0);switch(y.length){case 0:{w=[x,S];break}case 1:{const R=y[0],C=Ew({orientation:n,rects:[b,v],targetRect:R.element.getBoundingClientRect()});w=[R,C===b?S:x];break}default:{w=y;break}}}else y.length?w=y:w=[n==="horizontal"?new DOMRect(b.right,v.top,v.left-b.right,v.height):new DOMRect(v.left,b.bottom,v.width,v.top-b.bottom)];for(const x of w){let S="width"in x?x:x.element.getBoundingClientRect();const R=Mw()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<R){const k=R-S.width;S=new DOMRect(S.x-k/2,S.y,S.width+k,S.height)}if(S.height<R){const k=R-S.height;S=new DOMRect(S.x,S.y-k/2,S.width,S.height+k)}const C=m<=u||m>d;!a&&!C&&i.push({group:e,groupSize:go({group:e}),panels:[f,h],separator:"width"in x?void 0:x,rect:S}),a=!1}}l=!1,f=h,y=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(a=!0);const h=r.find(b=>b.element===g);h?y.push(h):(f=void 0,y=[])}else l=!0}return i}var fn;class gp{constructor(){ac(this,fn,{})}addListener(t,n){const o=Ro(this,fn)[t];return o===void 0?Ro(this,fn)[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=Ro(this,fn)[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,s=null;const i=Array.from(o);for(let a=0;a<i.length;a++){const l=i[a];try{l.call(null,n)}catch(u){s===null&&(r=!0,s=u)}}if(r)throw s}}removeAllListeners(){cc(this,fn,{})}removeListener(t,n){const o=Ro(this,fn)[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}fn=new WeakMap;let oo={cursorFlags:0,state:"inactive"};const Ya=new gp;function Ln(){return oo}function Pw(e){return Ya.addListener("change",e)}function Tw(e){const t=oo,n={...oo};n.cursorFlags=e,oo=n,Ya.emit("change",{prev:t,next:n})}function ro(e){const t=oo;oo=e,Ya.emit("change",{prev:t,next:e})}const Iw=e=>e,Zs=()=>{},mp=1,yp=2,bp=4,vp=8,Fl=3,zl=12;let Rr;function Vl(){return Rr===void 0&&(Rr=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Rr=!0)),Rr}function Ow({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Vl()){const s=(e&mp)!==0,i=(e&yp)!==0,a=(e&bp)!==0,l=(e&vp)!==0;if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(i)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return Vl()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const $l=new WeakMap;function Xa(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=$l.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]));const o=Ln();switch(o.state){case"active":case"hover":{const r=Ow({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(i=>i.group),state:o.state}),s=`*, *:hover {cursor: ${r} !important; }`;if(t===s)return;t=s,r?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}$l.set(e,{prevStyle:t,styleSheet:n})}let Wt=new Map;const xp=new gp;function Aw(e){Wt=new Map(Wt),Wt.delete(e)}function Hl(e,t){for(const[n]of Wt)if(n.id===e)return n}function yn(e,t){for(const[n,o]of Wt)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Hn(){return Wt}function Ka(e,t){return xp.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function sn(e,t,n){const o=Wt.get(e);Wt=new Map(Wt),Wt.set(e,t),xp.emit("groupChange",{group:e,isUserInteraction:(n==null?void 0:n.isUserInteraction)===!0,prev:o,next:t})}function wp(e){const t=Ln();let n=!1;switch(t.state){case"active":ro({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Xa(e),n=!0,t.hitRegions.forEach(o=>{const r=yn(o.group.id,!0);sn(o.group,r,{isUserInteraction:!0})}))}return n}function jl(e){e.defaultPrevented||wp(e.currentTarget)}function Nw(e,t,n){let o,r={x:1/0,y:1/0};for(const s of t){const i=pp(n,s.rect);switch(e){case"horizontal":{i.x<=r.x&&(o=s,r=i);break}case"vertical":{i.y<=r.y&&(o=s,r=i);break}}}return o?{distance:r,hitRegion:o}:void 0}function Dw(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _w(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ul(e),b:Ul(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();$e(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Wl(Bl(n.a)),b:Wl(Bl(n.b))};if(r.a===r.b){const s=o.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===i.a)return 1;if(l===i.b)return-1}}return Math.sign(r.a-r.b)}const Lw=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fw(e){const t=getComputedStyle(Sp(e)??e).display;return t==="flex"||t==="inline-flex"}function zw(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Fw(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"||Lw.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Bl(e){let t=e.length;for(;t--;){const n=e[t];if($e(n,"Missing node"),zw(n))return n}return null}function Wl(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ul(e){const t=[];for(;e;)t.push(e),e=Sp(e);return t}function Sp(e){const{parentNode:t}=e;return Dw(t)?t.host:t}function Vw(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 $w({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!fp(n)||n.contains(e)||e.contains(n))return!0;if(_w(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Vw(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function Za(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const s=hp(r),i=Nw(r.orientation,s,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&$w({groupElement:r.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function Hw(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 ft(e,t,n=0){return Math.abs(mt(e)-mt(t))<=n}function jt(e,t){return ft(e,t)?0:e>t?1:-1}function Zn({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:s,disabled:i,maxSize:a=100,minSize:l=0}=t;if(i&&!e)return n;if(jt(o,l)<0)if(s){const u=(r+l)/2;jt(o,u)<0?o=r:o=l}else o=l;return o=Math.min(a,o),o=mt(o),o}function Ho({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:s}){if(ft(e,0))return t;const i=s==="imperative-api",a=Object.values(t),l=Object.values(r),u=[...a],[d,p]=o;$e(d!=null,"Invalid first pivot index"),$e(p!=null,"Invalid second pivot index");let f=0;switch(s){case"keyboard":{{const g=e<0?p:d,h=n[g];$e(h,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:v,minSize:w=0}=h;if(v){const x=a[g];if($e(x!=null,`Previous layout not found for panel index ${g}`),ft(x,b)){const S=w-x;jt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const g=e<0?d:p,h=n[g];$e(h,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:v,minSize:w=0}=h;if(v){const x=a[g];if($e(x!=null,`Previous layout not found for panel index ${g}`),ft(x,w)){const S=x-b;jt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const g=e<0?p:d,h=n[g];$e(h,`Panel constraints not found for index ${g}`);const b=a[g],{collapsible:v,collapsedSize:w,minSize:x}=h;if(v&&jt(b,x)<0)if(e>0){const S=x-w,R=S/2,C=b+e;jt(C,x)<0&&(e=jt(e,R)<=0?0:S)}else{const S=x-w,R=100-S/2,C=b-e;jt(C,x)<0&&(e=jt(100+e,R)>0?0:-S)}break}}{const g=e<0?1:-1;let h=e<0?p:d,b=0;for(;;){const w=a[h];$e(w!=null,`Previous layout not found for panel index ${h}`);const x=Zn({overrideDisabledPanels:i,panelConstraints:n[h],prevSize:w,size:100})-w;if(b+=x,h+=g,h<0||h>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-v:v}{let g=e<0?d:p;for(;g>=0&&g<n.length;){const h=Math.abs(e)-Math.abs(f),b=a[g];$e(b!=null,`Previous layout not found for panel index ${g}`);const v=b-h,w=Zn({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:b,size:v});if(!ft(b,w)&&(f+=b-w,u[g]=w,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(Hw(l,u))return r;{const g=e<0?p:d,h=a[g];$e(h!=null,`Previous layout not found for panel index ${g}`);const b=h+f,v=Zn({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:h,size:b});if(u[g]=v,!ft(v,b)){let w=b-v,x=e<0?p:d;for(;x>=0&&x<n.length;){const S=u[x];$e(S!=null,`Previous layout not found for panel index ${x}`);const R=S+w,C=Zn({overrideDisabledPanels:i,panelConstraints:n[x],prevSize:S,size:R});if(ft(S,C)||(w-=C-S,u[x]=C),ft(w,0))break;e>0?x--:x++}}}const y=Object.values(u).reduce((g,h)=>h+g,0);if(!ft(y,100,.1))return r;const m=Object.keys(r);return u.reduce((g,h,b)=>(g[m[b]]=h,g),{})}function Fn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||jt(e[n],t[n])!==0)return!1;return!0}function zn({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((a,l)=>a+l,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(a=>`${a}%`).join(", ")}`);if(!ft(r,100)&&o.length>0)for(let a=0;a<t.length;a++){const l=o[a];$e(l!=null,`No layout data found for index ${a}`);const u=100/r*l;o[a]=u}let s=0;for(let a=0;a<t.length;a++){const l=n[a];$e(l!=null,`No layout data found for index ${a}`);const u=o[a];$e(u!=null,`No layout data found for index ${a}`);const d=Zn({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:u});u!=d&&(s+=u-d,o[a]=d)}if(!ft(s,0))for(let a=0;a<t.length;a++){const l=o[a];$e(l!=null,`No layout data found for index ${a}`);const u=l+s,d=Zn({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:u});if(l!==d&&(s-=d-l,o[a]=d,ft(s,0)))break}const i=Object.keys(e);return o.reduce((a,l,u)=>(a[i[u]]=l,a),{})}function Rp({groupId:e,panelId:t}){const n=()=>{const l=Hn();for(const[u,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,groupSize:y,separatorToPanels:m}]of l)if(u.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:u,groupSize:y,layout:f,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const l=n().derivedPanelConstraints.find(u=>u.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const l=n().group.panels.find(u=>u.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const l=n().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=({nextSize:l,panels:u,prevLayout:d,derivedPanelConstraints:p})=>{const f=s(),y=u.findIndex(h=>h.id===t),m=y===0,g=y===u.length-1;if(g&&l<f&&(m||u.slice(0,y).every((h,b)=>{const v=p[b];return(v==null?void 0:v.collapsible)&&ft(v.collapsedSize,d[v.panelId])}))){const h=u.slice(0,y).reduce((b,v)=>b+d[v.id],0);return{...d,[t]:mt(100-h)}}return Ho({delta:g?f-l:l-f,initialLayout:d,panelConstraints:p,pivotIndices:g?[y-1,y]:[y,y+1],prevLayout:d,trigger:"imperative-api"})},a=l=>{const u=s();if(l===u)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,groupSize:y,layout:m,separatorToPanels:g}=n(),h=i({nextSize:l,panels:f.panels,prevLayout:m,derivedPanelConstraints:p}),b=zn({layout:h,panelConstraints:p});Fn(m,b)||sn(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,groupSize:y,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:l,collapsedSize:u}=o(),{mutableValues:d}=r(),p=s();l&&p!==u&&(d.expandToSize=p,a(u))},expand:()=>{const{collapsible:l,collapsedSize:u,minSize:d}=o(),{mutableValues:p}=r(),f=s();if(l&&f===u){let y=p.expandToSize??d;y===0&&(y=1),a(y)}},getSize:()=>{const{group:l}=n(),u=s(),{element:d}=r(),p=l.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:u,inPixels:p}},isCollapsed:()=>{const{collapsible:l,collapsedSize:u}=o(),d=s();return l&&ft(u,d)},resize:l=>{const{group:u}=n(),{element:d}=r(),p=go({group:u}),f=Oo({groupSize:p,panelElement:d,styleProp:l}),y=mt(f/p*100);a(y)}}}function Gl(e){if(e.defaultPrevented)return;const t=Hn();Za(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,s=Rp({groupId:n.group.id,panelId:o.id});s&&r!==void 0&&(s.resize(r),e.preventDefault())}}})}function Or(e){const t=Hn();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function kp({groupId:e}){const t=()=>{const n=Hn();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:s,groupSize:i,layout:a,separatorToPanels:l}=t(),u=zn({layout:n,panelConstraints:r});return o?a:(Fn(a,u)||sn(s,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:i,layout:u,separatorToPanels:l}),u)}}}function On(e,t){const n=Or(e),o=yn(n.id,!0),r=n.separators.find(d=>d.element===e);$e(r,"Matching separator not found");const s=o.separatorToPanels.get(r);$e(s,"Matching panels not found");const i=s.map(d=>n.panels.indexOf(d)),a=kp({groupId:n.id}).getLayout(),l=Ho({delta:t,initialLayout:a,panelConstraints:o.derivedPanelConstraints,pivotIndices:i,prevLayout:a,trigger:"keyboard"}),u=zn({layout:l,panelConstraints:o.derivedPanelConstraints});Fn(a,u)||sn(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function ql(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Or(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&On(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&On(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&On(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&On(t,-5);break}case"End":{e.preventDefault(),On(t,100);break}case"Enter":{e.preventDefault();const o=Or(t),r=yn(o.id,!0),{derivedPanelConstraints:s,layout:i,separatorToPanels:a}=r,l=o.separators.find(f=>f.element===t);$e(l,"Matching separator not found");const u=a.get(l);$e(u,"Matching panels not found");const d=u[0],p=s.find(f=>f.panelId===d.id);if($e(p,"Panel metadata not found"),p.collapsible){const f=i[d.id],y=p.collapsedSize===f?o.mutableState.expandedPanelSizes[d.id]??p.minSize:p.collapsedSize;On(t,y-f)}break}case"F6":{e.preventDefault();const o=Or(t).separators.map(i=>i.element),r=Array.from(o).findIndex(i=>i===e.currentTarget);$e(r!==null,"Index not found");const s=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),On(t,-100);break}}}function Yl(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Hn(),n=Za(e,t),o=new Map;let r=!1;n.forEach(s=>{s.separator&&(r||(r=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const i=t.get(s.group);i&&o.set(s.group,i.layout)}),ro({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function Cp({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:s,prevCursorFlags:i}){let a=0;n.forEach(u=>{const{group:d,groupSize:p}=u,{orientation:f,panels:y}=d,{disableCursor:m}=d.mutableState;let g=0;s?f==="horizontal"?g=(t.clientX-s.x)/p*100:g=(t.clientY-s.y)/p*100:f==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const h=o.get(d),b=r.get(d);if(!h||!b)return;const{defaultLayoutDeferred:v,derivedPanelConstraints:w,groupSize:x,layout:S,separatorToPanels:R}=b;if(w&&S&&R){const C=Ho({delta:g,initialLayout:h,panelConstraints:w,pivotIndices:u.panels.map(k=>y.indexOf(k)),prevLayout:S,trigger:"mouse-or-touch"});if(Fn(C,S)){if(g!==0&&!m)switch(f){case"horizontal":{a|=g<0?mp:yp;break}case"vertical":{a|=g<0?bp:vp;break}}}else sn(u.group,{defaultLayoutDeferred:v,derivedPanelConstraints:w,groupSize:x,layout:C,separatorToPanels:R})}});let l=0;t.movementX===0?l|=i&Fl:l|=a&Fl,t.movementY===0?l|=i&zl:l|=a&zl,Tw(l),Xa(e)}function Xl(e){const t=Hn(),n=Ln();switch(n.state){case"active":Cp({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Kl(e){var o,r;if(e.defaultPrevented)return;const t=Ln(),n=Hn();switch(t.state){case"active":{if(e.buttons===0){ro({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(s=>{const i=yn(s.group.id,!0);sn(s.group,i,{isUserInteraction:!0})});return}for(const s of t.hitRegions)if(s.separator){const{element:i}=s.separator;(o=i.hasPointerCapture)!=null&&o.call(i,e.pointerId)||((r=i.setPointerCapture)==null||r.call(i,e.pointerId))}Cp({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const s=Za(e,n);s.length===0?t.state!=="inactive"&&ro({cursorFlags:0,state:"inactive"}):ro({cursorFlags:0,hitRegions:s,state:"hover"}),Xa(e.currentTarget);break}}}function Zl(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Ln().state){case"hover":ro({cursorFlags:0,state:"inactive"})}}function Ql(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||wp(e.currentTarget)&&e.preventDefault()}function Jl(e){let t=0,n=0;const o={};for(const s of e)if(s.defaultSize!==void 0){t++;const i=mt(s.defaultSize);n+=i,o[s.panelId]=i}else o[s.panelId]=void 0;const r=e.length-t;if(r!==0){const s=mt((100-n)/r);for(const i of e)i.defaultSize===void 0&&(o[i.panelId]=s)}return o}function jw(e,t,n){if(!n[0])return;const o=e.panels.find(l=>l.element===t);if(!o||!o.onResize)return;const r=go({group:e}),s=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,i=o.mutableValues.prevSize,a={asPercentage:mt(s/r*100),inPixels:s};o.mutableValues.prevSize=a,o.onResize(a,o.id,i)}function Bw(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ww({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,s=0,i=!1;const a=new Map,l=[];for(const p of e.panels){const f=o[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{i=!0;const y=f/100*n,m=mt(y/t*100);a.set(p.id,m),r+=m;break}case"preserve-relative-size":default:{l.push(p.id),s+=f;break}}}if(!i||l.length===0)return o;const u=100-r,d={...o};if(a.forEach((p,f)=>{d[f]=p}),s>0)for(const p of l){const f=o[p]??0;d[p]=mt(f/s*u)}else{const p=mt(u/l.length);for(const f of l)d[f]=p}return d}function Uw(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const Yn=new Map;function Gw(e){let t=!0;$e(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,s=new n(m=>{for(const g of m){const{borderBoxSize:h,target:b}=g;if(b===e.element){if(t){const v=go({group:e});if(v===0)return;const w=yn(e.id);if(!w)return;const x=Oi(e),S=w.defaultLayoutDeferred?Jl(x):w.layout,R=Ww({group:e,nextGroupSize:v,prevGroupSize:w.groupSize,prevLayout:S}),C=zn({layout:R,panelConstraints:x});if(!w.defaultLayoutDeferred&&Fn(w.layout,C)&&Bw(w.derivedPanelConstraints,x)&&w.groupSize===v)return;sn(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:x,groupSize:v,layout:C,separatorToPanels:w.separatorToPanels})}}else jw(e,b,h)}});s.observe(e.element),e.panels.forEach(m=>{$e(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&s.observe(m.element)});const i=go({group:e}),a=Oi(e),l=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Uw(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[l]??u??Jl(a),p=zn({layout:d,panelConstraints:a}),f=e.element.ownerDocument;Yn.set(f,(Yn.get(f)??0)+1);const y=new Map;return hp(e).forEach(m=>{m.separator&&y.set(m.separator,m.panels)}),sn(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:a,groupSize:i,layout:p,separatorToPanels:y}),e.separators.forEach(m=>{$e(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",ql)}),Yn.get(f)===1&&(f.addEventListener("contextmenu",jl,!0),f.addEventListener("dblclick",Gl,!0),f.addEventListener("pointerdown",Yl,!0),f.addEventListener("pointerleave",Xl),f.addEventListener("pointermove",Kl),f.addEventListener("pointerout",Zl),f.addEventListener("pointerup",Ql,!0)),function(){t=!1,Yn.set(f,Math.max(0,(Yn.get(f)??0)-1)),Aw(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",ql)}),Yn.get(f)||(f.removeEventListener("contextmenu",jl,!0),f.removeEventListener("dblclick",Gl,!0),f.removeEventListener("pointerdown",Yl,!0),f.removeEventListener("pointerleave",Xl),f.removeEventListener("pointermove",Kl),f.removeEventListener("pointerout",Zl),f.removeEventListener("pointerup",Ql,!0)),s.disconnect()}}function qw(){const[e,t]=c.useState({}),n=c.useCallback(()=>t({}),[]);return[e,n]}function Qa(e){const t=c.useId();return`${e??t}`}const jn=typeof window<"u"?c.useLayoutEffect:c.useEffect;function Do(e){const t=c.useRef(e);return jn(()=>{t.current=e},[e]),c.useCallback((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[t])}function Ja(...e){return Do(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ec(e){const t=c.useRef({...e});return jn(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Ep=c.createContext(null);function Yw(e,t){const n=c.useRef({getLayout:()=>({}),setLayout:Iw});c.useImperativeHandle(t,()=>n.current,[]),jn(()=>{Object.assign(n.current,kp({groupId:e}))})}function Xw({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:s,groupRef:i,id:a,onLayoutChange:l,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:f,...y}){const m=c.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=Do(O=>{Fn(m.current.onLayoutChange,O)||(m.current.onLayoutChange=O,l==null||l(O))}),h=Do((O,I)=>{Fn(m.current.onLayoutChanged,O)||(m.current.onLayoutChanged=O,u==null||u(O,{isUserInteraction:I}))}),b=Qa(a),v=c.useRef(null),[w,x]=qw(),S=c.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),R=Ja(v,s);Yw(b,i);const C=Do((O,I)=>{const N=Ln(),D=Hl(O),M=yn(O);if(M){let z=!1;switch(N.state){case"active":{z=N.hitRegions.some(_=>_.group===D);break}}return{flexGrow:M.layout[I]??1,pointerEvents:z?"none":void 0}}if(n!=null&&n[I])return{flexGrow:n==null?void 0:n[I]}}),k=ec({defaultLayout:n,disableCursor:o}),P=c.useMemo(()=>({get disableCursor(){return!!k.disableCursor},getPanelStyles:C,id:b,orientation:d,registerPanel:O=>{const I=S.current;return I.panels=Ai(d,[...I.panels,O]),x(),()=>{I.panels=I.panels.filter(N=>N!==O),x()}},registerSeparator:O=>{const I=S.current;return I.separators=Ai(d,[...I.separators,O]),x(),()=>{I.separators=I.separators.filter(N=>N!==O),x()}},updatePanelProps:(O,{disabled:I})=>{const N=S.current.panels.find(z=>z.id===O);N&&(N.panelConstraints.disabled=I);const D=Hl(b),M=yn(b);D&&M&&sn(D,{...M,derivedPanelConstraints:Oi(D)})},updateSeparatorProps:(O,{disabled:I,disableDoubleClick:N})=>{const D=S.current.separators.find(M=>M.id===O);D&&(D.disabled=I,D.disableDoubleClick=N)}}),[C,b,x,d,k]),E=c.useRef(null);return jn(()=>{const O=v.current;if(O===null)return;const I=S.current;let N;if(k.defaultLayout!==void 0&&Object.keys(k.defaultLayout).length===I.panels.length){N={};for(const T of I.panels){const L=k.defaultLayout[T.id];L!==void 0&&(N[T.id]=L)}}const D={disabled:!!r,element:O,id:b,mutableState:{defaultLayout:N,disableCursor:!!k.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:d,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};E.current=D;const M=Gw(D),{defaultLayoutDeferred:z,derivedPanelConstraints:_,layout:A}=yn(D.id,!0);!z&&_.length>0&&(g(A),h(A,!1));const F=Ka(b,T=>{const{defaultLayoutDeferred:L,derivedPanelConstraints:j,layout:$}=T.next;if(L||j.length===0)return;const U=D.panels.map(({id:V})=>V).join(",");D.mutableState.layouts[U]=$,j.forEach(V=>{if(V.collapsible){const{layout:Q}=T.prev??{};if(Q){const H=ft(V.collapsedSize,$[V.panelId]),G=ft(V.collapsedSize,Q[V.panelId]);H&&!G&&(D.mutableState.expandedPanelSizes[V.panelId]=Q[V.panelId])}}});const q=Ln().state!=="active";g($),q&&h($,T.isUserInteraction)});return()=>{E.current=null,M(),F()}},[r,b,h,g,d,w,k]),c.useEffect(()=>{const O=E.current;O&&(O.mutableState.defaultLayout=n,O.mutableState.disableCursor=!!o)}),K.jsx(Ep.Provider,{value:P,children:K.jsx("div",{...y,className:t,"data-group":!0,"data-testid":b,id:b,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}Xw.displayName="Group";function tc(){const e=c.useContext(Ep);return $e(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Kw(e,t){const{id:n}=tc(),o=c.useRef({collapse:Zs,expand:Zs,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Zs});c.useImperativeHandle(t,()=>o.current,[]),jn(()=>{Object.assign(o.current,Rp({groupId:n,panelId:e}))})}function Zw({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:s,elementRef:i,groupResizeBehavior:a="preserve-relative-size",id:l,maxSize:u="100%",minSize:d="0%",onResize:p,panelRef:f,style:y,...m}){const g=!!l,h=Qa(l),b=ec({disabled:s}),v=c.useRef(null),w=Ja(v,i),{getPanelStyles:x,id:S,orientation:R,registerPanel:C,updatePanelProps:k}=tc(),P=p!==null,E=Do((D,M,z)=>{p==null||p(D,l,z)});jn(()=>{const D=v.current;if(D!==null){const M={element:D,id:h,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:P?E:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:n,collapsible:o,defaultSize:r,disabled:b.disabled,maxSize:u,minSize:d}};return C(M)}},[a,n,o,r,P,h,g,u,d,E,C,b]),c.useEffect(()=>{k(h,{disabled:s})},[s,h,k]),Kw(h,f);const O=()=>{const D=x(S,h);if(D)return JSON.stringify(D)},I=c.useSyncExternalStore(D=>Ka(S,D),O,O);let N;return I?N=JSON.parse(I):r!==void 0?N={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:N={flexGrow:1},K.jsx("div",{...m,"data-disabled":s||void 0,"data-panel":!0,"data-testid":h,id:h,ref:w,style:{...Qw,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...N},children:K.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}Zw.displayName="Panel";const Qw={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Jw({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,s;const i=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,u=a.collapsible?a.collapsedSize:a.minSize,d=[o,o+1];s=zn({layout:Ho({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],r=zn({layout:Ho({delta:l-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:s,valueNow:i}}function eS({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:s,style:i,...a}){const l=Qa(s),u=ec({disabled:n,disableDoubleClick:o}),[d,p]=c.useState({}),[f,y]=c.useState("inactive"),[m,g]=c.useState(!1),h=c.useRef(null),b=Ja(h,r),{disableCursor:v,id:w,orientation:x,registerSeparator:S,updateSeparatorProps:R}=tc(),C=x==="horizontal"?"vertical":"horizontal";jn(()=>{const E=h.current;if(E!==null){const O={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:E,id:l},I=S(O),N=Pw(M=>{y(M.next.state!=="inactive"&&M.next.hitRegions.some(z=>z.separator===O)?M.next.state:"inactive")}),D=Ka(w,M=>{const{derivedPanelConstraints:z,layout:_,separatorToPanels:A}=M.next,F=A.get(O);if(F){const T=F[0],L=F.indexOf(T);p(Jw({layout:_,panelConstraints:z,panelId:T.id,panelIndex:L}))}});return()=>{N(),D(),I()}}},[w,l,S,u]),c.useEffect(()=>{R(l,{disabled:n,disableDoubleClick:o})},[n,o,l,R]);let k;n&&!v&&(k="not-allowed");let P;if(n)P="disabled";else switch(f){case"active":{P="active";break}default:m?P="focus":P=f}return K.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":P,"data-testid":l,id:l,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:b,role:"separator",style:{flexBasis:"auto",cursor:k,...i,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}eS.displayName="Separator";const Mp=c.createContext(void 0);function tS(){const e=c.useContext(Mp);if(e===void 0)throw new Error(De(63));return e}const Pp={...vs,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},wE=c.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s,"aria-labelledby":i,form:a,id:l,inputRef:u,name:d,nativeButton:p=!1,onCheckedChange:f,readOnly:y=!1,required:m=!1,disabled:g=!1,render:h,uncheckedValue:b,value:v,style:w,...x}=t,{clearErrors:S}=Ss(),{state:R,setTouched:C,setDirty:k,validityData:P,setFilled:E,setFocused:O,validationMode:I,disabled:N,name:D,validation:M}=vo(),{labelId:z}=qo(),_=N||g,A=D??d,F=c.useRef(null),T=Nt(F,u,M.inputRef),L=c.useRef(null),j=tt(),$=ws({id:l,implicit:!1,controlRef:L}),U=p?void 0:$,[q,V]=_t({controlled:o,default:!!s,name:"Switch",state:"checked"});xs(L,j,q,void 0,!_,d),oe(()=>{F.current&&E(F.current.checked)},[E]),bs(q,()=>{S(A),k(q!==P.initialValue),E(q),M.change(q)});const{getButtonProps:Q,buttonRef:H}=Tt({disabled:_,native:p}),G=Qf(i,z,F,!p,U),ue={id:p?$:j,role:"switch","aria-checked":q,"aria-readonly":y||void 0,"aria-required":m||void 0,"aria-labelledby":G,onFocus(){_||O(!0)},onBlur(){const ee=F.current;!ee||_||(C(!0),O(!1),I==="onBlur"&&M.commit(ee.checked))},onClick(ee){if(y||_)return;ee.preventDefault();const ie=F.current;ie&&Qn(ie,ee)}},ne={...M.getValidationProps(_),checked:q,disabled:_,form:a,id:U,name:A,required:m,style:A?oa:Bo,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:T,onChange(ee){if(ee.nativeEvent.defaultPrevented)return;if(y){ee.preventDefault();return}const ie=ee.currentTarget.checked,xe=ke(Rt,ee.nativeEvent);f==null||f(ie,xe),!xe.isCanceled&&V(ie)},onClick(ee){ee.stopPropagation()},onFocus(){var ee;(ee=L.current)==null||ee.focus()},...v!==void 0?{value:v}:We},te=c.useMemo(()=>({...R,checked:q,disabled:_,readOnly:y,required:m}),[R,q,_,y,m]),J=Se("span",t,{state:te,ref:[n,L,H],props:[ue,x,Q,ee=>M.getValidationProps(_,ee)],stateAttributesMapping:Pp});return K.jsxs(Mp.Provider,{value:te,children:[J,!q&&A&&b!==void 0&&K.jsx("input",{type:"hidden",form:a,name:A,value:b,disabled:_}),K.jsx("input",{...ne,suppressHydrationWarning:!0})]})}),SE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=tS();return Se("span",t,{state:a,ref:n,stateAttributesMapping:Pp,props:i})});export{bS as $,Ok as A,Dk as B,xS as C,BS as D,qS as E,aR as F,fR as G,RR as H,lR as I,$S as J,PR as K,OR as L,qR as M,xk as N,yS as O,ck as P,hR as Q,hk as R,yk as S,Nk as T,vS as U,HS as V,Yk as W,Xk as X,VS as Y,Qk as Z,nR as _,cR as a,CC as a$,KR as a0,fS as a1,IR as a2,qk as a3,uk as a4,wE as a5,SE as a6,KS as a7,ZS as a8,Gk as a9,CR as aA,iC as aB,dC as aC,Jb as aD,pC as aE,aC as aF,rC as aG,hC as aH,cC as aI,lC as aJ,fC as aK,sC as aL,nC as aM,uC as aN,oC as aO,vR as aP,Ck as aQ,Kk as aR,RC as aS,gC as aT,mC as aU,yC as aV,wC as aW,bC as aX,SC as aY,vC as aZ,xC as a_,Uk as aa,WS as ab,LR as ac,Bk as ad,nk as ae,ES as af,LS as ag,QS as ah,dS as ai,ak as aj,iR as ak,xR as al,Vk as am,NR as an,FR as ao,zk as ap,Rk as aq,VR as ar,PS as as,_R as at,rS as au,tC as av,s0 as aw,Jk as ax,eC as ay,XR as az,fk as b,kR as b$,kC as b0,MC as b1,EC as b2,wS as b3,PC as b4,_C as b5,OC as b6,AC as b7,DC as b8,NC as b9,lk as bA,Ak as bB,bk as bC,CS as bD,ZC as bE,QC as bF,JC as bG,eE as bH,nE as bI,tE as bJ,rR as bK,ik as bL,ok as bM,oE as bN,rE as bO,aE as bP,sE as bQ,iE as bR,dE as bS,fE as bT,cE as bU,lE as bV,uE as bW,pE as bX,hE as bY,gE as bZ,mE as b_,IC as ba,TC as bb,$v as bc,US as bd,St as be,LC as bf,Pr as bg,Rs as bh,zC as bi,VC as bj,$C as bk,HC as bl,of as bm,sk as bn,oR as bo,WC as bp,jC as bq,BC as br,ER as bs,rk as bt,GC as bu,XC as bv,UC as bw,KC as bx,qC as by,YC as bz,XS as c,GR as c0,wR as c1,FS as c2,MS as c3,GS as c4,RS as c5,sS as c6,Wk as c7,zS as c8,yE as c9,YS as cA,QR as cB,eS as cC,Zw as cD,Xw as cE,TS as cF,cS as cG,hS as cH,DR as cI,NS as cJ,OS as cK,$k as cL,jk as cM,Hk as cN,_S as cO,gR as cP,mR as cQ,WR as cR,aS as cS,lS as cT,pk as cU,IS as cV,tk as cW,Lk as cX,kk as cY,AR as cZ,bE as ca,DS as cb,YR as cc,SR as cd,tR as ce,eR as cf,pR as cg,Ek as ch,dR as ci,xE as cj,vE as ck,AS as cl,pS as cm,UR as cn,dk as co,mk as cp,jR as cq,iS as cr,$R as cs,MR as ct,sR as cu,uS as cv,mS as cw,yR as cx,Sk as cy,JR as cz,vk as d,Tk as e,zR as f,Zk as g,uR as h,Fk as i,HR as j,gk as k,JS as l,Ik as m,bR as n,_k as o,BR as p,jS as q,TR as r,gS as s,ek as t,Mk as u,kS as v,SS as w,ZR as x,wk as y,Pk as z};
|
|
882
|
+
`)},o2=0,Wn=[];function r2(e){var t=c.useRef([]),n=c.useRef([0,0]),o=c.useRef(),r=c.useState(o2++)[0],s=c.useState(Df)[0],i=c.useRef(e);c.useEffect(function(){i.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(r));var g=Cx([e.lockRef.current],(e.shards||[]).map(kl),!0).filter(Boolean);return g.forEach(function(h){return h.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),g.forEach(function(h){return h.classList.remove("allow-interactivity-".concat(r))})}}},[e.inert,e.lockRef.current,e.shards]);var a=c.useCallback(function(g,h){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var b=yr(g),v=n.current,w="deltaX"in g?g.deltaX:v[0]-b[0],x="deltaY"in g?g.deltaY:v[1]-b[1],S,R=g.target,C=Math.abs(w)>Math.abs(x)?"h":"v";if("touches"in g&&C==="h"&&R.type==="range")return!1;var k=window.getSelection(),P=k&&k.anchorNode,E=P?P===R||P.contains(R):!1;if(E)return!1;var O=Sl(C,R);if(!O)return!0;if(O?S=C:(S=C==="v"?"h":"v",O=Sl(C,R)),!O)return!1;if(!o.current&&"changedTouches"in g&&(w||x)&&(o.current=S),!S)return!0;var I=o.current||S;return e2(I,h,g,I==="h"?w:x)},[]),l=c.useCallback(function(g){var h=g;if(!(!Wn.length||Wn[Wn.length-1]!==s)){var b="deltaY"in h?Rl(h):yr(h),v=t.current.filter(function(S){return S.name===h.type&&(S.target===h.target||h.target===S.shadowParent)&&t2(S.delta,b)})[0];if(v&&v.should){h.cancelable&&h.preventDefault();return}if(!v){var w=(i.current.shards||[]).map(kl).filter(Boolean).filter(function(S){return S.contains(h.target)}),x=w.length>0?a(h,w[0]):!i.current.noIsolation;x&&h.cancelable&&h.preventDefault()}}},[]),u=c.useCallback(function(g,h,b,v){var w={name:g,delta:h,target:b,should:v,shadowParent:s2(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(x){return x!==w})},1)},[]),d=c.useCallback(function(g){n.current=yr(g),o.current=void 0},[]),p=c.useCallback(function(g){u(g.type,Rl(g),g.target,a(g,e.lockRef.current))},[]),f=c.useCallback(function(g){u(g.type,yr(g),g.target,a(g,e.lockRef.current))},[]);c.useEffect(function(){return Wn.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Bn),document.addEventListener("touchmove",l,Bn),document.addEventListener("touchstart",d,Bn),function(){Wn=Wn.filter(function(g){return g!==s}),document.removeEventListener("wheel",l,Bn),document.removeEventListener("touchmove",l,Bn),document.removeEventListener("touchstart",d,Bn)}},[]);var y=e.removeScrollBar,m=e.inert;return c.createElement(c.Fragment,null,m?c.createElement(s,{styles:n2(r)}):null,y?c.createElement(qx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function s2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const i2=Dx(Nf,r2);var zf=c.forwardRef(function(e,t){return c.createElement(ks,Bt({},e,{ref:t,sideCar:i2}))});zf.classNames=ks.classNames;var a2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Un=new WeakMap,br=new WeakMap,vr={},Ks=0,Vf=function(e){return e&&(e.host||Vf(e.parentNode))},c2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=Vf(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},l2=function(e,t,n,o){var r=c2(t,Array.isArray(e)?e:[e]);vr[n]||(vr[n]=new WeakMap);var s=vr[n],i=[],a=new Set,l=new Set(r),u=function(p){!p||a.has(p)||(a.add(p),u(p.parentNode))};r.forEach(u);var d=function(p){!p||l.has(p)||Array.prototype.forEach.call(p.children,function(f){if(a.has(f))d(f);else try{var y=f.getAttribute(o),m=y!==null&&y!=="false",g=(Un.get(f)||0)+1,h=(s.get(f)||0)+1;Un.set(f,g),s.set(f,h),i.push(f),g===1&&m&&br.set(f,!0),h===1&&f.setAttribute(n,"true"),m||f.setAttribute(o,"true")}catch(b){console.error("aria-hidden: cannot operate on ",f,b)}})};return d(t),a.clear(),Ks++,function(){i.forEach(function(p){var f=Un.get(p)-1,y=s.get(p)-1;Un.set(p,f),s.set(p,y),f||(br.has(p)||p.removeAttribute(o),br.delete(p)),y||p.removeAttribute(n)}),Ks--,Ks||(Un=new WeakMap,Un=new WeakMap,br=new WeakMap,vr={})}},u2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),r=a2(e);return r?(o.push.apply(o,Array.from(r.querySelectorAll("[aria-live], script"))),l2(o,r,n,"aria-hidden")):function(){return null}},d2=Object.defineProperty,un=(e,t)=>d2(e,"name",{value:t,configurable:!0}),Wa="Dialog",[$f,FC]=rf(Wa),[f2,$n]=$f(Wa),zC=un(e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:s,modal:i=!0}=e,a=c.useRef(null),l=c.useRef(null),[u,d]=cf({prop:o,defaultProp:r??!1,onChange:s,caller:Wa}),[p,f]=c.useState(0),[y,m]=c.useState(0);return K.jsx(f2,{scope:t,triggerRef:a,contentRef:l,contentId:Pr(),titleId:Pr(),descriptionId:Pr(),titlePresent:p>0,descriptionPresent:y>0,setTitleCount:f,setDescriptionCount:m,open:u,onOpenChange:d,onOpenToggle:c.useCallback(()=>d(g=>!g),[d]),modal:i,children:n})},"Dialog"),Hf="DialogPortal",[p2,jf]=$f(Hf,{forceMount:void 0}),VC=un(e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,s=$n(Hf,t);return K.jsx(p2,{scope:t,forceMount:n,children:c.Children.map(o,i=>K.jsx(Ha,{present:n||s.open,children:K.jsx(wx,{asChild:!0,container:r,children:i})}))})},"DialogPortal"),Pi="DialogOverlay",$C=c.forwardRef(un(function(t,n){const o=jf(Pi,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,i=$n(Pi,t.__scopeDialog);return i.modal?K.jsx(Ha,{present:r||i.open,children:K.jsx(g2,{...s,ref:n})}):null},"DialogOverlay")),h2=za("DialogOverlay.RemoveScroll"),g2=c.forwardRef(un(function(t,n){const{__scopeDialog:o,...r}=t,s=$n(Pi,o),i=bf(),a=wo(n,i);return K.jsx(zf,{as:h2,allowPinchZoom:!0,shards:[s.contentRef],children:K.jsx(Rs.div,{"data-state":Ua(s.open),...r,ref:a,style:{pointerEvents:"auto",...r.style}})})},"DialogOverlayImpl")),$o="DialogContent",HC=c.forwardRef(un(function(t,n){const o=jf($o,t.__scopeDialog),{forceMount:r=o.forceMount,...s}=t,i=$n($o,t.__scopeDialog);return K.jsx(Ha,{present:r||i.open,children:i.modal?K.jsx(m2,{...s,ref:n}):K.jsx(y2,{...s,ref:n})})},"DialogContent")),m2=c.forwardRef(un(function(t,n){const o=$n($o,t.__scopeDialog),r=c.useRef(null),s=wo(n,o.contentRef,r);return c.useEffect(()=>{const i=r.current;if(i)return u2(i)},[]),K.jsx(Bf,{...t,ref:s,trapFocus:o.open,disableOutsidePointerEvents:o.open,onCloseAutoFocus:Nn(t.onCloseAutoFocus,i=>{var a;i.preventDefault(),(a=o.triggerRef.current)==null||a.focus()}),onPointerDownOutside:Nn(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:Nn(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),y2=c.forwardRef(un(function(t,n){const o=$n($o,t.__scopeDialog),r=c.useRef(!1),s=c.useRef(!1);return K.jsx(Bf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var a,l;(a=t.onCloseAutoFocus)==null||a.call(t,i),i.defaultPrevented||(r.current||(l=o.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=i.target;((d=o.triggerRef.current)==null?void 0:d.contains(a))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Bf=c.forwardRef(un(function(t,n){const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...a}=t,l=$n($o,o);return Ba(),K.jsx(K.Fragment,{children:K.jsx(bx,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:K.jsx(gx,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":Ua(l.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl"));function Ua(e){return e?"open":"closed"}un(Ua,"getState");function b2(e){const{open:t,defaultOpen:n,onOpenChange:o,disabled:r}=e,[s,i]=_t({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:a,setMounted:l,transitionStatus:u}=ln(s,!0,!0),d=tt(),[p,f]=c.useState(),y=p===null?void 0:p??d,m=le(g=>{const h=!s,b=ke(Rn,g.nativeEvent);o(h,b),!b.isCanceled&&i(h)});return c.useMemo(()=>({defaultPanelId:d,disabled:r,handleTrigger:m,mounted:a,open:s,panelId:y,setMounted:l,setOpen:i,setPanelIdState:f,transitionStatus:u}),[d,r,m,a,s,y,l,i,f,u])}const Wf=c.createContext(void 0);function Uf(){const e=c.useContext(Wf);if(e===void 0)throw new Error(De(15));return e}let Ga=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=_r.startingStyle]="startingStyle",e[e.endingStyle=_r.endingStyle]="endingStyle",e})({}),v2=(function(e){return e.panelOpen="data-panel-open",e})({});const x2={[Ga.open]:""},w2={[Ga.closed]:""},S2={open(e){return e?{[v2.panelOpen]:""}:null}},R2={open(e){return e?x2:w2}},Gf={...R2,...Gt},jC=c.forwardRef(function(t,n){const{render:o,className:r,defaultOpen:s=!1,disabled:i=!1,onOpenChange:a,open:l,style:u,...d}=t,p=le(a),f=b2({open:l,defaultOpen:s,onOpenChange:p,disabled:i}),y=c.useMemo(()=>({open:f.open,disabled:f.disabled,transitionStatus:f.transitionStatus}),[f.open,f.disabled,f.transitionStatus]),m=c.useMemo(()=>({...f,onOpenChange:p,state:y}),[f,p,y]),g=Se("div",t,{state:y,ref:n,props:d,stateAttributesMapping:Gf});return K.jsx(Wf.Provider,{value:m,children:g})}),k2={...S2,...Gt},BC=c.forwardRef(function(t,n){const{panelId:o,open:r,handleTrigger:s,state:i,disabled:a}=Uf(),{className:l,disabled:u=a,render:d,nativeButton:p=!0,style:f,...y}=t,{getButtonProps:m,buttonRef:g}=Tt({disabled:u,focusableWhenDisabled:!0,native:p});return Se("button",t,{state:i,ref:[n,g],props:[{"aria-controls":r?o:void 0,"aria-expanded":r,onClick:s},y,m],stateAttributesMapping:k2})}),Mo={height:void 0,width:void 0};function C2(e){const{externalRef:t,hiddenUntilFound:n,id:o,keepMounted:r,mounted:s,onOpenChange:i,open:a,setMounted:l,setOpen:u,transitionStatus:d}=e,p=c.useRef(null),f=c.useRef(null),[y,m]=c.useState(Mo),g=c.useRef(Mo),h=c.useRef(!1),b=c.useRef(a),v=c.useRef(!1),[w,x]=c.useState(!1),S=c.useRef(null),R=Nt(t,p),C=Ze(a),k=Qi(p),P=!a&&!s,E=w?"idle":d,O=a&&(b.current||v.current),I=!a&&s&&f.current==="css-animation"&&y.height===void 0&&y.width===void 0?g.current:y,N=n&&P&&f.current!=="css-animation",D=le((F,T=!0)=>{T&&(g.current=F),m(F)}),M=le(()=>{var F;(F=S.current)==null||F.call(S),S.current=null}),z=le(F=>{M(),S.current=()=>{S.current=null,F()}}),_=le(()=>{a&&s&&f.current==="css-animation"&&(v.current=!0)});oe(()=>{!w||d==="starting"||x(!1)},[w,d]),c.useEffect(()=>()=>{_(),M()},[_,M]),oe(()=>{const F=p.current;if(!F)return;!a&&S.current&&M();const T=E2(F,O);if(f.current=T,a&&d==="idle"&&b.current&&T==="css-animation"){g.current=Gn(F);return}if(a&&d==="starting"){const $=h.current;if(h.current=!1,T==="none"){D(Gn(F)),x(!0);return}if(T==="css-transition"){const V=M2(F);if(D(Gn(F)),!$)return V;const Q=xr(F,"transition-duration","0s");return z(Q),x(!0),V}D(Gn(F));const U=xr(F,"animation-name","none");if(!$){U();return}const q=xr(F,"animation-duration","0s");U(),z(q),x(!0);return}if(!a&&s&&(d==="idle"||d==="starting")){if(b.current=!1,v.current=!1,T==="none"){D(Mo,!1),l(!1);return}D(Gn(F));return}if(d!=="ending")return;if(T==="none"){l(!1);return}const L=Gn(F);if(!(L.height>0||L.width>0)){l(!1);return}D(L),T==="css-animation"&&xr(F,"animation-name","none")()},[s,a,M,D,l,z,O,d]),kt({enabled:a&&s&&E==="idle",open:!0,ref:p,onComplete(){a&&D(Mo,!1)}}),c.useEffect(()=>{if(a||!s||E!=="ending"||!p.current)return;const T=new AbortController;let L=-1;function j(){C.current||(l(!1),D(Mo,!1))}return L=vt.request(()=>{k(j,T.signal)}),()=>{vt.cancel(L),T.abort()}},[C,s,a,E,k,D,l]),oe(()=>{const F=p.current;!F||!n||!P||F.setAttribute("hidden","until-found")},[P,n]),c.useEffect(function(){const T=p.current;if(!T)return;function L(j){const $=ke(Rt,j);i(!0,$),!$.isCanceled&&(h.current=!0,u(!0))}return Pe(T,"beforematch",L)},[i,u]);const A=r||n||s||a;return{height:I.height,props:{...N?{[Ga.startingStyle]:""}:void 0,hidden:P,id:o},ref:R,shouldPreventOpenAnimation:O,shouldRender:A,transitionStatus:E,width:I.width}}function Gn(e){return{height:e.scrollHeight,width:e.scrollWidth}}function E2(e,t){const n=He(e).getComputedStyle(e),o=(n.animationName.split(",").map(s=>s.trim()).some(s=>s!==""&&s!=="none")||t)&&Cl(n.animationDuration),r=Cl(n.transitionDuration);return o&&r||r?"css-transition":o?"css-animation":"none"}function Cl(e){return e.split(",").map(t=>t.trim()).some(t=>t!==""&&Number.parseFloat(t)>0)}function xr(e,t,n){const o=e.style.getPropertyValue(t),r=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{if(o===""){e.style.removeProperty(t);return}e.style.setProperty(t,o,r)}}function M2(e){const t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(r=>{e.style.setProperty(r,"initial","important")});function n(){Object.entries(t).forEach(([r,s])=>{if(s===""){e.style.removeProperty(r);return}e.style.setProperty(r,s)})}const o=vt.request(n);return()=>{vt.cancel(o),n()}}let El=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const WC=c.forwardRef(function(t,n){const{className:o,hiddenUntilFound:r,keepMounted:s,render:i,id:a,style:l,...u}=t,{defaultPanelId:d,mounted:p,onOpenChange:f,open:y,setMounted:m,setPanelIdState:g,setOpen:h,state:b,transitionStatus:v}=Uf(),w=r??!1,x=s??!1,S=a||void 0,R=S??d;oe(()=>(g(_=>S??(_===null?void 0:_)),()=>{g(_=>_===S?null:_)}),[S,g]);const{height:C,props:k,ref:P,shouldPreventOpenAnimation:E,shouldRender:O,transitionStatus:I,width:N}=C2({externalRef:n,hiddenUntilFound:w,id:R,keepMounted:x,mounted:p,onOpenChange:f,open:y,setMounted:m,setOpen:h,transitionStatus:v}),D={...b,transitionStatus:I},M=fu(l,D),z=Se("div",{...t,style:void 0},{state:D,ref:P,props:[k,{style:{[El.collapsiblePanelHeight]:C===void 0?"auto":`${C}px`,[El.collapsiblePanelWidth]:N===void 0?"auto":`${N}px`}},u,M?{style:M}:void 0,E?{style:{animationName:"none"}}:void 0],stateAttributesMapping:Gf});return O?z:null}),qf=c.createContext(void 0);function Cs(e){const t=c.useContext(qf);if(t===void 0&&!e)throw new Error(De(72));return t}const P2={...ka,disabled:e=>e.disabled,instantType:e=>e.instantType,isInstantPhase:e=>e.isInstantPhase,trackCursorAxis:e=>e.trackCursorAxis,disableHoverablePopup:e=>e.disableHoverablePopup,lastOpenChangeReason:e=>e.openChangeReason,closeOnClick:e=>e.closeOnClick,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin};class T2 extends Uo{constructor(n,o,r){const s=new Go;super(I2(n,s,o,r),O2(s),P2);Ne(this,"setOpen",(n,o)=>{ab(this,n,o,{extraState:{openChangeReason:o.reason}})})}cancelPendingOpen(n){this.state.floatingRootContext.dispatchOpenChange(!1,ke(Rn,n))}}function I2(e,t,n,o=!1){const r={...Sa(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...e};return r.floatingRootContext=xd(t,n,o),r}function O2(e){return{popupRef:c.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e}}const UC=ga(function(t){const{disabled:n=!1,defaultOpen:o=!1,open:r,disableHoverablePopup:s=!1,trackCursorAxis:i="none",actionsRef:a,onOpenChange:l,onOpenChangeComplete:u,handle:d,triggerId:p,defaultTriggerId:f=null,children:y}=t,m=bd((O,I)=>new T2({open:o,openProp:r,activeTriggerId:f,triggerIdProp:p},O,I));m.useControlledProp("openProp",r),m.useControlledProp("triggerIdProp",p),m.useContextCallback("onOpenChange",l),m.useContextCallback("onOpenChangeComplete",u);const g=m.useState("open"),h=!n&&g,b=m.useState("activeTriggerId"),v=m.useState("mounted"),w=m.useState("payload");m.useSyncedValues({trackCursorAxis:i,disableHoverablePopup:s,disabled:n}),va(m,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:x,transitionStatus:S}=xa(h,m),R=m.useState("isInstantPhase"),C=m.useState("instantType"),k=m.useState("lastOpenChangeReason"),P=c.useRef(null);oe(()=>{g&&n&&m.setOpen(!1,ke(Iu))},[g,n,m]),oe(()=>{S==="ending"&&k===Rt||S!=="ending"&&R?(C!=="delay"&&(P.current=C),m.set("instantType","delay")):P.current!==null&&(m.set("instantType",P.current),P.current=null)},[S,R,k,C,m]),oe(()=>{h&&b==null&&m.set("payload",void 0)},[m,b,h]),c.useImperativeHandle(a,()=>({unmount:x,close:()=>m.setOpen(!1,ke(Gi))}),[x,m]);const E=h||v||!n&&i!=="none";return K.jsxs(qf.Provider,{value:m,children:[d&&K.jsx(ma,{handle:d,store:m}),E&&K.jsx(A2,{store:m,disabled:n,trackCursorAxis:i}),typeof y=="function"?y({payload:w}):y]})});function A2({store:e,disabled:t,trackCursorAxis:n}){const o=e.useState("floatingRootContext"),r=as(o,{enabled:!t,referencePress:()=>e.select("closeOnClick")}),s=o1(o,{enabled:!t&&n!=="none",axis:n==="none"?void 0:n}),i=c.useMemo(()=>St(s.reference,r.reference),[s.reference,r.reference]);return wa(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:r.floating??We}),null}const Yf=c.createContext(void 0);function N2(){return c.useContext(Yf)}const Ml=600,Xf="data-base-ui-tooltip-trigger";function Pl(e){if("composedPath"in e){const n=e.composedPath();for(let o=0;o<n.length;o+=1){const r=n[o];if(Oe(r))return r}}const t=e.target;return Oe(t)?t:null}function D2(e){let t=e;for(;t;){const n=t.closest(`[${Xf}]`);if(n)return n;const o=t.getRootNode();t="host"in o&&Oe(o.host)?o.host:null}return null}const GC=md(function(t,n){const{render:o,className:r,style:s,handle:i,payload:a,disabled:l,delay:u,closeOnClick:d=!0,closeDelay:p,id:f,...y}=t,m=Cs(!0),h=Ca(i)??m;if(!h)throw new Error(De(82));const b=tt(f),v=h.useState("isTriggerActive",b),w=h.useState("isOpenedByTrigger",b),x=h.useState("floatingRootContext"),S=c.useRef(null),R=u??Ml,C=p??0,{registerTrigger:k,isMountedByThisTrigger:P}=ba(b,S,h,{payload:a,closeOnClick:d,closeDelay:C}),E=N2(),{delayRef:O,isInstantPhase:I,hasProvider:N}=Ey(x,{open:w}),D=Ma(x);h.useSyncedValue("isInstantPhase",I);const M=h.useState("disabled"),z=l??M,_=Ze(z),A=h.useState("trackCursorAxis"),F=h.useState("disableHoverablePopup"),T=c.useRef(!1),L=Ge(),j=c.useRef(void 0);function $(){return N?vn(O.current,"open")===0?0:u??E??Ml:R}function U(J){const ee=S.current;if(!ee||!J)return!1;const ie=D2(J);return ie!==null&&ie!==ee&&ve(ee,ie)}function q(J){const ee=U(J);return T.current=ee,ee&&(D.openChangeTimeout.clear(),D.restTimeout.clear(),D.restTimeoutPending=!1,L.clear()),ee}const V=Cd(x,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!F&&A!=="both"?Pd():null,restMs:$,delay(){return p==null&&N?{close:vn(O.current,"close")}:{close:C}},triggerElementRef:S,isActiveTrigger:v,isClosing:()=>h.select("transitionStatus")==="ending",shouldOpen(){return!T.current}}),Q=Sd(x,{enabled:!z}).reference,H=J=>{const ee=T.current,ie=Pl(J),xe=q(ie),ae=S.current,he=ae&&ie&&ve(ae,ie);if(xe&&h.select("open")&&h.select("lastOpenChangeReason")===rt){h.setOpen(!1,ke(rt,J));return}if(ee&&!xe&&he&&!_.current&&!h.select("open")&&ae&&mn(j.current)){const re=()=>{!T.current&&!_.current&&!h.select("open")&&h.setOpen(!0,ke(rt,J,ae))},ge=$();ge===0?(L.clear(),re()):L.start(ge,re)}},G=h.useState("triggerProps",P);return Se("button",t,{state:{open:w},ref:[n,k,S],props:[V,Q,P||A!=="none"?G:void 0,{onMouseOver(J){H(J.nativeEvent)},onFocus(J){U(Pl(J.nativeEvent))&&J.preventBaseUIHandler()},onMouseLeave(){T.current=!1,L.clear(),j.current=void 0},onPointerEnter(J){j.current=J.pointerType},onPointerDown(J){j.current=J.pointerType,h.set("closeOnClick",d),d&&!h.select("open")&&h.cancelPendingOpen(J.nativeEvent)},onClick(J){d&&!h.select("open")&&h.cancelPendingOpen(J.nativeEvent)},id:b,"data-trigger-disabled":z?"":void 0,[Xf]:z?void 0:""},y],stateAttributesMapping:Bi})}),Kf=c.createContext(void 0);function _2(){const e=c.useContext(Kf);if(e===void 0)throw new Error(De(70));return e}const L2=c.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,style:a,...l}=t,{node:u,subtree:d}=nd({container:r,ref:n,componentProps:t,elementProps:l});return!d&&!u?null:K.jsxs(c.Fragment,{children:[d,u&&At.createPortal(o,u)]})}),qC=c.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t;return Cs().useState("mounted")||o?K.jsx(Kf.Provider,{value:o,children:K.jsx(L2,{ref:n,...r})}):null}),Zf=c.createContext(void 0);function F2(){const e=c.useContext(Zf);if(e===void 0)throw new Error(De(71));return e}const YC=c.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:a="top",align:l="center",sideOffset:u=0,alignOffset:d=0,collisionBoundary:p="clipping-ancestors",collisionPadding:f=5,arrowPadding:y=5,sticky:m=!1,disableAnchorTracking:g=!1,collisionAvoidance:h=Ju,style:b,...v}=t,w=Cs(),x=_2(),S=w.useState("open"),R=w.useState("mounted"),C=w.useState("trackCursorAxis"),k=w.useState("disableHoverablePopup"),P=w.useState("floatingRootContext"),E=w.useState("instantType"),O=w.useState("transitionStatus"),I=w.useState("adaptiveOrigin"),N=Ta({anchor:s,positionMethod:i,floatingRootContext:P,mounted:R,side:a,sideOffset:u,align:l,alignOffset:d,collisionBoundary:p,collisionPadding:f,sticky:m,arrowPadding:y,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:h,adaptiveOrigin:I}),D=c.useMemo(()=>({open:S,side:N.side,align:N.align,anchorHidden:N.anchorHidden,instant:C!=="none"?"tracking-cursor":E}),[S,N.side,N.align,N.anchorHidden,C,E]),M=Oa(t,D,{styles:N.positionerStyles,transitionStatus:O,props:v,refs:[n,w.useStateSetter("positionerElement")],hidden:!R,inert:!S||C==="both"||k});return K.jsx(Zf.Provider,{value:N,children:M})}),XC=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=Cs(),{side:l,align:u}=F2(),d=a.useState("open"),p=a.useState("instantType"),f=a.useState("transitionStatus"),y=a.useState("popupProps"),m=a.useState("floatingRootContext"),g=a.useState("disabled"),h=a.useState("closeDelay");kt({open:d,ref:a.context.popupRef,onComplete(){var x,S;d&&((S=(x=a.context).onOpenChangeComplete)==null||S.call(x,!0))}}),kd(m,{enabled:!g,closeDelay:h});const b=a.useStateSetter("popupElement");return Se("div",t,{state:{open:d,side:l,align:u,instant:p,transitionStatus:f},ref:[n,a.context.popupRef,b],props:[ds,y,hs(f),i],stateAttributesMapping:Wi})}),KC=function(t){const{delay:n,closeDelay:o,timeout:r=400}=t,s=c.useMemo(()=>({open:n,close:o}),[n,o]);return K.jsx(Yf.Provider,{value:n,children:K.jsx(Cy,{delay:s,timeoutMs:r,children:t.children})})};function Qf(e,t,n,o=!0,r){const[s,i]=c.useState(),a=tt(r?`${r}-label`:void 0),l=e??t??s;return oe(()=>{const u=e||t||!o?void 0:z2(n.current,a);s!==u&&i(u)}),l}function z2(e,t){const n=V2(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function V2(e){if(!e)return;const t=e.parentElement;if(t&&t.tagName==="LABEL")return t;const n=e.id;if(n){const r=e.nextElementSibling;if(r&&r.htmlFor===n)return r}const o=e.labels;return o&&o[0]}const $2=c.createContext({disabled:!1});function H2(){return c.useContext($2)}const j2=c.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:a,disabled:l=!1,onValueChange:u,defaultValue:d,autoFocus:p=!1,style:f,...y}=t,{state:m,name:g,disabled:h,setTouched:b,setDirty:v,validityData:w,setFocused:x,setFilled:S,validationMode:R,validation:C}=vo(),{clearErrors:k}=Ss(),P=h||l,E=g??i,O={...m,disabled:P},{labelId:I}=qo(),N=ws({id:s});oe(()=>{var L;const T=a!=null;(L=C.inputRef.current)!=null&&L.value||T&&a!==""?S(!0):T&&a===""&&S(!1)},[C.inputRef,S,a]);const D=c.useRef(null);oe(()=>{p&&D.current===dt(Te(D.current))&&x(!0)},[p,x]);const[M]=_t({controlled:a,default:d,name:"FieldControl",state:"value"}),z=a!==void 0,_=z?M:void 0,A=le(()=>{var T;return(T=C.inputRef.current)==null?void 0:T.value});return xs(C.inputRef,N,_,A,!P,i),Se("input",t,{ref:[n,D],state:O,props:[{id:N,disabled:P,name:E,ref:C.inputRef,"aria-labelledby":I,autoFocus:p,...z?{value:_}:{defaultValue:d},onChange(T){const L=T.currentTarget.value;u==null||u(L,ke(Rt,T.nativeEvent)),v(L!==(w.initialValue??"")),S(L!==""),T.nativeEvent.defaultPrevented||(k(E),C.change(L))},onFocus(){x(!0)},onBlur(T){b(!0),x(!1),R==="onBlur"&&C.commit(T.currentTarget.value)},onKeyDown(T){T.currentTarget.tagName==="INPUT"&&T.key==="Enter"&&(b(!0),C.commit(T.currentTarget.value))}},y,T=>C.getValidationProps(P,T)],stateAttributesMapping:vs})}),ZC=c.forwardRef(function(t,n){return K.jsx(j2,{ref:n,...t})});function Jf(e){return Array.isArray(e)?e.map(t=>Jf(t)).join(","):e==null?"":String(e)}const Tl=new Map;function B2(e,t){const n=JSON.stringify({locale:Jf(e),options:t}),o=Tl.get(n);if(o)return o;const r=new Intl.NumberFormat(e,t);return Tl.set(n,r),r}function Il(e,t,n){return e==null?"":B2(t,n).format(e)}function W2(e,t,n){return(e-t)*100/(n-t)}const ep=c.createContext(void 0);function Es(){const e=c.useContext(ep);if(e===void 0)throw new Error(De(51));return e}const Xo={status(e){return{[`data-${e}`]:""}}},QC=c.forwardRef(function(t,n){const{format:o,getAriaValueText:r,locale:s,max:i=100,min:a=0,value:l,render:u,className:d,children:p,style:f,...y}=t,[m,g]=c.useState();let h="indeterminate",b=null,v=null,w="",x="indeterminate progress";if(l!=null&&Number.isFinite(l)){const P=W2(l,a,i);b=hn(Number.isNaN(P)?0:P,0,100),v=hn(l,a,i),h=v===i?"complete":"progressing",w=o?Il(v,s,o):Il(b/100,s,{style:"percent"}),x=w}const S=c.useMemo(()=>({status:h}),[h]),R={"aria-labelledby":m,"aria-valuemax":i,"aria-valuemin":a,"aria-valuenow":v??void 0,"aria-valuetext":r?r(w,l):x,role:"progressbar",children:K.jsxs(c.Fragment,{children:[p,K.jsx("span",{role:"presentation",style:Bo,children:"x"})]})},C=c.useMemo(()=>({formattedValue:w,percentageValue:b,setLabelId:g,state:S,value:l}),[w,b,g,S,l]),k=Se("div",t,{state:S,ref:n,props:[R,y],stateAttributesMapping:Xo});return K.jsx(ep.Provider,{value:C,children:k})}),JC=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{state:a}=Es();return Se("div",t,{state:a,ref:n,props:i,stateAttributesMapping:Xo})}),eE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{percentageValue:a,state:l}=Es(),u=a==null?{}:{insetInlineStart:0,height:"inherit",width:`${a}%`};return Se("div",t,{state:l,ref:n,props:[{style:u},i],stateAttributesMapping:Xo})}),tE=c.forwardRef(function(t,n){const{className:o,render:r,children:s,style:i,...a}=t,{value:l,formattedValue:u,state:d}=Es(),p=d.status==="indeterminate";return Se("span",t,{state:d,ref:n,props:[{"aria-hidden":!0,children:typeof s=="function"?s(p?"indeterminate":u,l):p?null:u},a],stateAttributesMapping:Xo})}),nE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,id:i,...a}=t,{setLabelId:l,state:u}=Es(),d=xv(i,l);return Se("span",t,{state:u,ref:n,props:[{id:d,role:"presentation"},a],stateAttributesMapping:Xo})}),tp=c.createContext(void 0);function Ms(){const e=c.useContext(tp);if(e===void 0)throw new Error(De(53));return e}const U2=500,Ti=16;function gn(e,t,n){if(!e)return 0;const o=getComputedStyle(e),r=`${t}${n==="x"?"Inline":"Block"}`,s=parseFloat(o[`${r}Start`]);return n==="x"&&t==="margin"?s*2:s+parseFloat(o[`${r}End`])}const qn=e=>t=>t?{[e]:""}:null,qa={hasOverflowX:qn("data-has-overflow-x"),hasOverflowY:qn("data-has-overflow-y"),overflowXStart:qn("data-overflow-x-start"),overflowXEnd:qn("data-overflow-x-end"),overflowYStart:qn("data-overflow-y-start"),overflowYEnd:qn("data-overflow-y-end"),cornerHidden:()=>null},G2={x:0,y:0},Ol={width:0,height:0},q2={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},Y2={x:!0,y:!0,corner:!0},oE=c.forwardRef(function(t,n){const{render:o,className:r,overflowEdgeThreshold:s,style:i,...a}=t,{xStart:l,xEnd:u,yStart:d,yEnd:p}=X2(s),f=tt(),y=Ge(),m=Ge(),{nonce:g,disableStyleElements:h}=_a(),[b,v]=c.useState(!1),[w,x]=c.useState(!1),[S,R]=c.useState(!1),[C,k]=c.useState(!1),[P,E]=c.useState(!1),[O,I]=c.useState(Ol),[N,D]=c.useState(Ol),[M,z]=c.useState(q2),[_,A]=c.useState(Y2),F=c.useRef(null),T=c.useRef(null),L=c.useRef(null),j=c.useRef(null),$=c.useRef(null),U=c.useRef(null),q=c.useRef(null),V=c.useRef(null),Q=c.useRef(0),H=c.useRef(0),G=c.useRef(0),ue=c.useRef(0),ne=c.useRef("vertical"),te=c.useRef(G2),J=c.useRef(null);function ee(se){const Z=se?R:x,X=se?y:m;Z(!0),X.start(U2,()=>{Z(!1)})}const ie=le(se=>{const Z=se.x-te.current.x,X=se.y-te.current.y;te.current=se,X!==0&&ee(!0),Z!==0&&ee(!1)}),xe=le(()=>{const se=T.current;se&&J.current===null&&(J.current=se.style.scrollSnapType,se.style.scrollSnapType="none")}),ae=le(se=>{if(se.button!==0)return;if(V.current!==null){const pe=ne.current==="vertical"?$.current:U.current;if(pe!=null&&pe.hasPointerCapture(V.current))return}V.current=se.pointerId,Q.current=se.clientY,H.current=se.clientX,ne.current=se.currentTarget.getAttribute("data-orientation");const Z=T.current;Z&&(G.current=Z.scrollTop,ue.current=Z.scrollLeft,xe());const X=ne.current==="vertical"?$.current:U.current;X==null||X.setPointerCapture(se.pointerId)}),he=le(se=>{if(se.pointerId!==V.current)return;V.current=null,(ne.current==="vertical"?R:x)(!1),J.current!==null&&(T.current&&(T.current.style.scrollSnapType=J.current),J.current=null);const Z=ne.current==="vertical"?$.current:U.current;Z!=null&&Z.hasPointerCapture(se.pointerId)&&Z.releasePointerCapture(se.pointerId)}),re=le(se=>{if(se.pointerId!==V.current)return;if(se.buttons%2===0){he(se);return}const Z=T.current;if(!Z)return;const X=ne.current==="vertical",pe=X?$.current:U.current,be=X?L.current:j.current;if(!pe||!be)return;const _e=X?"y":"x",Ue=gn(be,"padding",_e),Ye=gn(pe,"margin",_e),st=X?pe.offsetHeight:pe.offsetWidth,Je=(X?be.offsetHeight:be.offsetWidth)-st-Ue-Ye,ct=X?se.clientY-Q.current:se.clientX-H.current,Re=Je<=0?0:ct/Je,je=X?Z.scrollHeight:Z.scrollWidth,qe=X?Z.clientHeight:Z.clientWidth,Xe=(X?G.current:ue.current)+Re*(je-qe);X?Z.scrollTop=Xe:Z.scrollLeft=Xe,se.preventDefault(),ee(X)});function ge(se){k(se.pointerType==="touch")}function de(se){if(ge(se),se.pointerType!=="touch"){const Z=ve(F.current,se.target);v(Z)}}const ce=c.useMemo(()=>({scrolling:w||S,hasOverflowX:!_.x,hasOverflowY:!_.y,overflowXStart:M.xStart,overflowXEnd:M.xEnd,overflowYStart:M.yStart,overflowYEnd:M.yEnd,cornerHidden:_.corner}),[w,S,_.x,_.y,_.corner,M]),fe={role:"presentation",onPointerEnter:de,onPointerMove:de,onPointerDown:ge,onPointerLeave(){v(!1)},style:{position:"relative","--scroll-area-corner-height":`${O.height}px`,"--scroll-area-corner-width":`${O.width}px`}},W=Se("div",t,{state:ce,ref:[n,F],props:[fe,a],stateAttributesMapping:qa}),Y=c.useMemo(()=>({handlePointerDown:ae,handlePointerMove:re,handlePointerUp:he,handleScroll:ie,disableViewportSnap:xe,cornerSize:O,setCornerSize:I,thumbSize:N,setThumbSize:D,hasMeasuredScrollbar:P,setHasMeasuredScrollbar:E,touchModality:C,cornerRef:q,scrollingX:w,scrollingY:S,hovering:b,setHovering:v,viewportRef:T,scrollbarYRef:L,scrollbarXRef:j,thumbYRef:$,thumbXRef:U,rootId:f,hiddenState:_,setHiddenState:A,overflowEdges:M,setOverflowEdges:z,viewportState:ce,overflowEdgeThreshold:{xStart:l,xEnd:u,yStart:d,yEnd:p}}),[ae,re,he,ie,xe,O,N,P,C,w,S,b,f,_,M,ce,l,u,d,p]);return K.jsxs(tp.Provider,{value:Y,children:[!h&&Vo.getElement(g),W]})});function X2(e){const t=typeof e=="number"?{xStart:e,xEnd:e,yStart:e,yEnd:e}:e;return{xStart:Math.max(0,(t==null?void 0:t.xStart)||0),xEnd:Math.max(0,(t==null?void 0:t.xEnd)||0),yStart:Math.max(0,(t==null?void 0:t.yStart)||0),yEnd:Math.max(0,(t==null?void 0:t.yEnd)||0)}}const K2=c.createContext(void 0),np=["--scroll-area-overflow-x-start","--scroll-area-overflow-x-end","--scroll-area-overflow-y-start","--scroll-area-overflow-y-end"];let Al=!1;function Z2(){Al||qt||(typeof CSS<"u"&&"registerProperty"in CSS&&np.forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Al=!0)}const rE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{viewportRef:a,scrollbarYRef:l,scrollbarXRef:u,thumbYRef:d,thumbXRef:p,cornerRef:f,cornerSize:y,setCornerSize:m,setThumbSize:g,rootId:h,setHiddenState:b,hiddenState:v,setHasMeasuredScrollbar:w,handleScroll:x,touchModality:S,setHovering:R,setOverflowEdges:C,overflowEdgeThreshold:k,viewportState:P}=Ms(),E=bo(),O=c.useRef(!0),I=c.useRef([NaN,NaN,NaN,NaN]),N=Ge(),D=Ge(),M=le(()=>{const T=a.current,L=l.current,j=u.current,$=d.current,U=p.current,q=f.current;if(!T)return;const V=T.scrollHeight,Q=T.scrollWidth,H=T.clientHeight,G=T.clientWidth,ue=T.scrollTop,ne=T.scrollLeft,te=I.current,J=Number.isNaN(te[0]);if(te[0]=H,te[1]=V,te[2]=G,te[3]=Q,J&&w(!0),V===0||Q===0)return;const ee=Q2(T),ie=ee.y,xe=ee.x,ae=G/Q,he=H/V,re=Math.max(0,Q-G),ge=Math.max(0,V-H);let de=0,ce=0;xe||(de=fo(E==="rtl"?-ne:ne,re),ce=re-de);const fe=ie?0:fo(ue,ge),W=ie?0:ge-fe,Y=xe?0:G,se=ie?0:H;let Z=0,X=0;!xe&&!ie&&(Z=(L==null?void 0:L.offsetWidth)||0,X=(j==null?void 0:j.offsetHeight)||0);const pe=y.width===0&&y.height===0,be=pe?Z:0,_e=pe?X:0,Ue=gn(j,"padding","x"),Ye=gn(L,"padding","y"),st=gn(U,"margin","x"),Le=gn($,"margin","y"),Je=Y-Ue-st,ct=se-Ye-Le,Re=j?Math.min(j.offsetWidth-be,Je):Je,je=L?Math.min(L.offsetHeight-_e,ct):ct,qe=Math.max(Ti,Re*ae),Be=Math.max(Ti,je*he);if(g(we=>wr(we,{width:qe,height:Be})),L&&$){const we=L.offsetHeight-Be-Ye-Le,Ae=Nl($,"--scroll-area-thumb-height",ue,ge,V,Be,we);$.style.transform=`translate3d(0,${Ae}px,0)`}if(j&&U){const we=j.offsetWidth-qe-Ue-st,Ae=E==="rtl"?-ne:ne,Qe=Nl(U,"--scroll-area-thumb-width",Ae,re,Q,qe,we);U.style.transform=`translate3d(${E==="rtl"?-Qe:Qe}px,0,0)`}const Xe=[de,ce,fe,W];np.forEach((we,Ae)=>{T.style.setProperty(we,`${Xe[Ae]}px`)}),q&&m(we=>wr(we,{width:Z,height:X})),b(we=>wr(we,ee));const pt={xStart:!xe&&de>k.xStart,xEnd:!xe&&ce>k.xEnd,yStart:!ie&&fe>k.yStart,yEnd:!ie&&W>k.yEnd};C(we=>wr(we,pt))});oe(()=>{Z2()},[]),oe(()=>{queueMicrotask(M)},[M,v,E,k.xStart,k.xEnd,k.yStart,k.yEnd]),oe(()=>{var T;(T=a.current)!=null&&T.matches(":hover")&&R(!0)},[a,R]),oe(()=>{const T=a.current;if(typeof ResizeObserver>"u"||!T)return;let L=!1;const j=new ResizeObserver(()=>{if(!L){L=!0;const $=I.current;if($[0]===T.clientHeight&&$[1]===T.scrollHeight&&$[2]===T.clientWidth&&$[3]===T.scrollWidth)return}M()});return j.observe(T),D.start(0,()=>{const $=T.getAnimations({subtree:!0});$.length!==0&&Promise.allSettled($.map(U=>U.finished)).then(M).catch(()=>{})}),()=>{j.disconnect(),D.clear()}},[M,a,D]);function z(){O.current=!1}const _={role:"presentation",...h&&{"data-id":`${h}-viewport`},tabIndex:v.x&&v.y?-1:0,className:Vo.className,style:{overflow:"scroll"},onScroll(){a.current&&(M(),(S||!O.current)&&x({x:a.current.scrollLeft,y:a.current.scrollTop}),N.start(100,()=>{O.current=!0}))},onWheel:z,onPointerMove:z,onPointerEnter:z,onKeyDown:z},A=Se("div",t,{ref:[n,a],state:P,props:[_,i],stateAttributesMapping:qa}),F=c.useMemo(()=>({computeThumbPosition:M}),[M]);return K.jsx(K2.Provider,{value:F,children:A})});function Q2(e){const t=e.clientHeight>=e.scrollHeight,n=e.clientWidth>=e.scrollWidth;return{y:t,x:n,corner:t||n}}function wr(e,t){for(const n in t)if(e[n]!==t[n])return t;return e}function Nl(e,t,n,o,r,s,i){const a=hn(n,0,o),l=n-a,u=Math.max(Ti,s*r/(r+Math.abs(l)));return e.style.setProperty(t,l?`${u}px`:""),(o?a/o*i:0)+(l>0?s-u:0)}const op=c.createContext(void 0);function J2(){const e=c.useContext(op);if(e===void 0)throw new Error(De(54));return e}const sE=c.forwardRef(function(t,n){const{render:o,className:r,orientation:s="vertical",keepMounted:i=!1,style:a,...l}=t,{hovering:u,scrollingX:d,scrollingY:p,hiddenState:f,scrollbarYRef:y,scrollbarXRef:m,viewportRef:g,thumbYRef:h,thumbXRef:b,handlePointerDown:v,handlePointerUp:w,handleScroll:x,disableViewportSnap:S,rootId:R,thumbSize:C,hasMeasuredScrollbar:k,viewportState:P}=Ms(),E=s==="vertical",O={...P,hovering:u,scrolling:E?p:d,orientation:s},I=bo(),N=!k&&!i,D=E?f.y:f.x,M=i||!D;c.useEffect(()=>{if(!M)return;const A=g.current,F=E?y.current:m.current;if(!F)return;function T(L){if(!A||L.ctrlKey)return;const j=!E,$=j?"scrollLeft":"scrollTop",U=j?L.deltaX:L.deltaY;if(U===0)return;const q=j?A.scrollWidth-A.clientWidth:A.scrollHeight-A.clientHeight,V=j&&I==="rtl"?-q:0,Q=j&&I==="rtl"?0:q,H=A[$];H<=V&&U<0||H>=Q&&U>0||(L.preventDefault(),A[$]=Math.min(Q,Math.max(V,H+U)),x({x:A.scrollLeft,y:A.scrollTop}))}return Pe(F,"wheel",T,{passive:!1})},[I,x,E,m,y,M,g]);const z={...R&&{"data-id":`${R}-scrollbar`},onPointerDown(A){if(A.button!==0)return;const F=et(A.nativeEvent),T=E?h.current:b.current;if(T&&ve(T,F))return;const L=g.current;if(!L)return;const j=E?y.current:m.current;if(!T||!j)return;const $=E?"y":"x",U=gn(T,"margin",$),q=gn(j,"padding",$),V=E?T.offsetHeight:T.offsetWidth,Q=j.getBoundingClientRect(),H=E?A.clientY-Q.top-V/2-q+U/2:A.clientX-Q.left-V/2-q+U/2,G=E?L.scrollHeight:L.scrollWidth,ue=E?L.clientHeight:L.clientWidth,te=(E?j.offsetHeight:j.offsetWidth)-V-q-U;if(te<=0)return;const J=H/te,ee=G-ue;S(),E?L.scrollTop=J*ee:I==="rtl"?L.scrollLeft=-(1-J)*ee:L.scrollLeft=J*ee,x({x:L.scrollLeft,y:L.scrollTop}),v(A)},onPointerUp:w,onPointerCancel:w,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",visibility:N?"hidden":void 0,...E?{top:0,bottom:"var(--scroll-area-corner-height)",insetInlineEnd:0,"--scroll-area-thumb-height":`${C.height}px`}:{insetInlineStart:0,insetInlineEnd:"var(--scroll-area-corner-width)",bottom:0,"--scroll-area-thumb-width":`${C.width}px`}}},_=Se("div",t,{ref:[n,E?y:m],state:O,props:[z,l],stateAttributesMapping:qa});return M?K.jsx(op.Provider,{value:s,children:_}):null}),iE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{thumbYRef:a,thumbXRef:l,handlePointerDown:u,handlePointerMove:d,handlePointerUp:p,scrollingX:f,scrollingY:y,hasMeasuredScrollbar:m}=Ms(),g=J2(),h=g==="vertical";return Se("div",t,{ref:[n,h?a:l],state:{scrolling:h?y:f,orientation:g},props:[{onPointerDown:u,onPointerMove:d,onPointerUp:p,onPointerCancel:p,style:{visibility:m?void 0:"hidden",...h?{height:"var(--scroll-area-thumb-height)"}:{width:"var(--scroll-area-thumb-width)"}}},i]})}),aE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{cornerRef:a,cornerSize:l,hiddenState:u}=Ms(),d=Se("div",t,{ref:[n,a],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:l.width,height:l.height}},i]});return u.corner?null:d}),rp=c.createContext(void 0);function Ps(){const e=c.useContext(rp);if(e===void 0)throw new Error(De(64));return e}const Ko={tabActivationDirection:e=>({"data-activation-direction":e})},cE=c.forwardRef(function(t,n){const{className:o,defaultValue:r=0,onValueChange:s,orientation:i="horizontal",render:a,value:l,style:u,...d}=t,p=t.defaultValue!==void 0,f=c.useRef([]),[y,m]=c.useState(()=>new Map),[g,h]=_t({controlled:l,default:r,name:"Tabs",state:"value"}),b=l!==void 0,[v,w]=c.useState(()=>new Map),x=c.useRef(void 0),S=c.useCallback(H=>Ii(v,H),[v]),[R,C]=c.useState(()=>({previousValue:g,tabActivationDirection:"none"})),{previousValue:k,tabActivationDirection:P}=R;let E=P,O=!1;k!==g&&(E=Dl(k,g,i,v),O=k!=null&&g!=null&&S(g)==null);const I=O?k:g,N=k!==I||P!==E;oe(()=>{N&&C({previousValue:I,tabActivationDirection:E})},[I,N,E]);const D=le((H,G)=>{const ue=Dl(g,H,i,v);G.activationDirection=ue,s==null||s(H,G),!G.isCanceled&&h(H)}),M=le((H,G)=>{s==null||s(H,ke(G,void 0,void 0,{activationDirection:"none"}))}),z=le((H,G)=>(m(ue=>{const ne=new Map(ue);return ne.set(H,G),ne}),()=>{m(ue=>{if(ue.get(H)!==G)return ue;const ne=new Map(ue);return ne.delete(H),ne})})),_=c.useCallback(H=>y.get(H),[y]),A=c.useCallback(H=>{for(const G of v.values())if(H===G.value)return G.id},[v]),F=c.useMemo(()=>({getTabElementBySelectedValue:S,getTabIdByPanelValue:A,getTabPanelIdByValue:_,onValueChange:D,orientation:i,registerMountedTabPanel:z,setTabMap:w,tabActivationDirection:E,value:g}),[S,A,_,D,i,z,w,E,g]),T=c.useMemo(()=>{for(const H of v.values())if(H.value===g)return H},[v,g]),L=c.useMemo(()=>{for(const H of v.values())if(!H.disabled)return H.value},[v]),j=c.useRef(!p),$=c.useRef(r),U=c.useRef(p),q=c.useRef(!1);oe(()=>{var te;if(b)return;function H(J,ee){h(J),C({previousValue:J,tabActivationDirection:"none"}),M(J,ee),j.current=!1}if(v.size===0){q.current&&g!==null&&!((te=x.current)!=null&&te.isConnected)&&H(null,xc);return}q.current=!0,x.current=v.keys().next().value;const G=T==null?void 0:T.disabled,ue=T==null&&g!==null;if(!G&&g===$.current&&(U.current=!1),U.current&&G&&g===$.current)return;const ne=j.current;if(G||ue){const J=L??null;if(g===J){j.current=!1;return}let ee=xc;ne?ee=wc:G&&(ee=Iu),H(J,ee);return}ne&&T!=null&&(M(g,wc),j.current=!1)},[L,b,M,T,h,v,g]);const Q=Se("div",t,{state:{orientation:i,tabActivationDirection:E},ref:n,props:d,stateAttributesMapping:Ko});return K.jsx(rp.Provider,{value:F,children:K.jsx(ms,{elementsRef:f,children:Q})})});function Ii(e,t){for(const[n,o]of e.entries())if(t===o.value)return n;return null}function Dl(e,t,n,o){if(e==null||t==null)return"none";const[r,s,i]=n==="horizontal"?["left","left","right"]:["top","up","down"],a=Ii(o,e),l=Ii(o,t);if(a==null||l==null)return a!==l&&(typeof e=="number"||typeof e=="string")&&typeof e==typeof t?t>e?i:s:"none";const u=a.getBoundingClientRect()[r],d=l.getBoundingClientRect()[r];return d<u?s:d>u?i:"none"}const sp="data-composite-item-active",ip=c.createContext(void 0);function ap(){const e=c.useContext(ip);if(e===void 0)throw new Error(De(65));return e}const lE=c.forwardRef(function(t,n){const{className:o,disabled:r=!1,render:s,value:i,id:a,nativeButton:l=!0,style:u,...d}=t,{value:p,getTabPanelIdByValue:f,onValueChange:y,orientation:m,tabActivationDirection:g}=Ps(),{activateOnFocus:h,registerTabResizeObserverElement:b,tabsListElement:v}=ap(),{highlightedIndex:w,onHighlightedIndexChange:x}=Yr(),S=tt(a),R=c.useMemo(()=>({disabled:r,id:S,value:i}),[r,S,i]),{compositeProps:C,compositeRef:k,index:P}=$d({metadata:R}),E=i===p,O=c.useRef(!1),I=c.useRef(null),N=le(q=>{var V;(V=I.current)==null||V.call(I),I.current=q?b(q):null});oe(()=>{if(O.current){O.current=!1;return}if(!(E&&P>-1&&w!==P))return;const q=v;if(q!=null){const V=dt(Te(q));if(V&&ve(q,V))return}r||x(P)},[E,P,w,x,r,v]);const{getButtonProps:D,buttonRef:M}=Tt({disabled:r,native:l,focusableWhenDisabled:!0}),z=f(i),_=c.useRef(!1),A=c.useRef(!1);function F(q){y(i,ke(Rt,q.nativeEvent,void 0,{activationDirection:"none"}))}function T(q){E||r||F(q)}function L(q){E||r||h&&(!_.current||A.current)&&F(q)}function j(q){if(E||r)return;_.current=!0,A.current=q.button===0;const V=Te(q.currentTarget);function Q(){_.current=!1,A.current=!1,V.removeEventListener("pointerup",Q),V.removeEventListener("pointercancel",Q)}V.addEventListener("pointerup",Q),V.addEventListener("pointercancel",Q)}return Se("button",t,{state:{disabled:r,active:E,orientation:m,tabActivationDirection:g},ref:[n,M,k,N],props:[C,{role:"tab","aria-controls":z,"aria-selected":E,id:S,onClick:T,onFocus:L,onPointerDown:j,[sp]:E?"":void 0,onKeyDownCapture(){O.current=!0}},d,D],stateAttributesMapping:Ko})}),ew="";function tw(){return Ke}function nw(){return!1}function ow(){return!0}function rw(){return ls.useSyncExternalStore(tw,nw,ow)}function sw(e){const{script:t}=e,{nonce:n}=_a();return rw()?K.jsx("script",{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var _l;const iw={...Ko,activeTabPosition:()=>null,activeTabSize:()=>null},uE=c.forwardRef(function(t,n){const{className:o,render:r,renderBeforeHydration:s=!1,style:i,...a}=t,{getTabElementBySelectedValue:l,orientation:u,tabActivationDirection:d,value:p}=Ps(),{tabsListElement:f,registerIndicatorUpdateListener:y}=ap(),m=ob();c.useEffect(()=>y(m),[y,m]);let g=0,h=0,b=0,v=0,w=0,x=0,S=!1;if(p!=null&&f!=null){const I=l(p);if(I!=null){S=!0;const{width:N,height:D}=ul(I),{width:M,height:z}=ul(f),_=I.getBoundingClientRect(),A=f.getBoundingClientRect(),F=M>0?A.width/M:1,T=z>0?A.height/z:1;if(F>Number.EPSILON&&T>Number.EPSILON){const j=_.left-A.left,$=_.top-A.top;g=j/F+f.scrollLeft-f.clientLeft,b=$/T+f.scrollTop-f.clientTop}else g=I.offsetLeft,b=I.offsetTop;w=N,x=D,h=f.scrollWidth-g-w,v=f.scrollHeight-b-x}}const R=S?{left:g,right:h,top:b,bottom:v}:null,C=S?{width:w,height:x}:null,k=S?{"--active-tab-left":`${g}px`,"--active-tab-right":`${h}px`,"--active-tab-top":`${b}px`,"--active-tab-bottom":`${v}px`,"--active-tab-width":`${w}px`,"--active-tab-height":`${x}px`}:void 0,P=S&&w>0&&x>0,O=Se("span",t,{state:{orientation:u,activeTabPosition:R,activeTabSize:C,tabActivationDirection:d},ref:n,props:[{role:"presentation",style:k,hidden:!P},a,{suppressHydrationWarning:!0}],stateAttributesMapping:iw});return p==null?null:K.jsxs(c.Fragment,{children:[O,s&&(_l||(_l=K.jsx(sw,{script:ew})))]})}),aw={...Ko,...Gt},dE=c.forwardRef(function(t,n){const{className:o,value:r,render:s,keepMounted:i=!1,style:a,...l}=t,{value:u,getTabIdByPanelValue:d,orientation:p,tabActivationDirection:f,registerMountedTabPanel:y}=Ps(),m=tt(),{ref:g,index:h}=yo(),b=r===u,{mounted:v,transitionStatus:w,setMounted:x}=ln(b),S=!v,R=d(r),C={hidden:S,orientation:p,tabActivationDirection:f,transitionStatus:w},k=c.useRef(null),P=Se("div",t,{state:C,ref:[n,g,k],props:[{"aria-labelledby":R,hidden:S,id:m,role:"tabpanel",tabIndex:b?0:-1,inert:gs(!b),"data-index":h},l],stateAttributesMapping:aw});return kt({open:b,ref:k,onComplete(){b||x(!1)}}),oe(()=>{if(!(m==null||S&&!i))return y(r,m)},[S,i,r,m,y]),i||v?P:null}),cw=[];function lw(e){const{loopFocus:t=!0,orientation:n="both",grid:o,onLoop:r,direction:s,highlightedIndex:i,onHighlightedIndexChange:a,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d,disabledIndices:p,modifierKeys:f=cw}=e,[y,m]=c.useState(0),g=o!=null,h=c.useRef(null),b=Nt(h,l),v=c.useRef([]),w=c.useRef(!1),x=i??y,S=le((E,O=!1)=>{if((a??m)(E),O){const I=v.current[E];el(h.current,I,s,n)}}),R=le(E=>{var D;if(E.size===0||w.current)return;w.current=!0;const O=Array.from(E.keys()),I=O.find(M=>M==null?void 0:M.hasAttribute(sp))??null,N=I?((D=E.get(I))==null?void 0:D.index)??-1:-1;if(N!==-1)S(N);else if($r(O,x,p)){const M=Jt(O,{disabledIndices:p});Ao(O,M)||S(M)}el(h.current,I,s,n)});oe(()=>{if(p==null||i!=null||!w.current)return;const E=v.current;if($r(E,x,p)){const O=Jt(E,{disabledIndices:p});Ao(E,O)||S(O)}},[p,i,x,v,S]);const C=le((E,O,I)=>r?r(E,O,I,v):I),k=le(E=>{const O=E.key===gi||E.key===mi;if(!ps.has(E.key)||!u&&O||uw(E,f)||!h.current)return;const N=s==="rtl",D=N?pi:hi,M=N?hi:pi,z=n==="vertical"?fi:D,_=n==="vertical"?di:M,A=et(E.nativeEvent);if(A!=null&&Jc(A)&&!jd(A)){const U=A.selectionStart,q=A.selectionEnd,V=A.value;if(U==null||E.shiftKey||U!==q||E.key!==_&&U<V.length||E.key!==z&&U>0)return}let F=x;const T=kr(v,p),L=ii(v,p);o!=null&&(F=o({disabledIndices:p,elementsRef:v,event:E,highlightedIndex:x,loopFocus:t,maxIndex:L,minIndex:T,onLoop:C,orientation:n,rtl:N}));const j=n!=="vertical"&&E.key===D||n!=="horizontal"&&E.key===fi,$=n!=="vertical"&&E.key===M||n!=="horizontal"&&E.key===di;u&&(E.key===gi?F=T:E.key===mi&&(F=L)),F===x&&(j||$)&&(t&&F===L&&j?(F=T,r&&(F=r(E,x,F,v))):t&&F===T&&$?(F=L,r&&(F=r(E,x,F,v))):F=Jt(v.current,{startingIndex:F,decrement:$,disabledIndices:p})),F!==x&&!Ao(v.current,F)&&(d&&E.stopPropagation(),(g||O||j||$)&&E.preventDefault(),S(F,!0),queueMicrotask(()=>{var U;(U=v.current[F])==null||U.focus()}))});return{props:{ref:b,onFocus(E){const O=h.current,I=et(E.nativeEvent);!O||I==null||!Jc(I)||I.setSelectionRange(0,I.value.length)},onKeyDown:k},highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:v,onMapChange:R,relayKeyboardEvent:k}}function uw(e,t){for(const n of Sb)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function cp(e){const{render:t,className:n,style:o,refs:r=Dt,props:s=Dt,state:i=We,stateAttributesMapping:a,highlightedIndex:l,onHighlightedIndexChange:u,orientation:d,grid:p,loopFocus:f,onLoop:y,enableHomeAndEndKeys:m,onMapChange:g,stopEventPropagation:h=!0,rootRef:b,disabledIndices:v,modifierKeys:w,highlightItemOnHover:x=!1,tag:S="div",...R}=e,C=bo(),{props:k,highlightedIndex:P,onHighlightedIndexChange:E,elementsRef:O,onMapChange:I,relayKeyboardEvent:N}=lw({grid:p,loopFocus:f,onLoop:y,orientation:d,highlightedIndex:l,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:h,enableHomeAndEndKeys:m,direction:C,disabledIndices:v,modifierKeys:w}),D=Se(S,e,{state:i,ref:r,props:[k,...s,R],stateAttributesMapping:a}),M=c.useMemo(()=>({highlightedIndex:P,onHighlightedIndexChange:E,highlightItemOnHover:x,relayKeyboardEvent:N}),[P,E,x,N]);return K.jsx(lu.Provider,{value:M,children:K.jsx(ms,{elementsRef:O,onMapChange:z=>{g==null||g(z),I(z)},children:D})})}const fE=c.forwardRef(function(t,n){const{activateOnFocus:o=!1,className:r,loopFocus:s=!0,render:i,style:a,...l}=t,{orientation:u,setTabMap:d,tabActivationDirection:p}=Ps(),[f,y]=c.useState(0),[m,g]=c.useState(null),h=c.useRef(new Set),b=c.useRef(new Set),v=c.useRef(null);oe(()=>{if(typeof ResizeObserver>"u")return;const k=new ResizeObserver(()=>{h.current.forEach(P=>{P()})});return v.current=k,m&&k.observe(m),b.current.forEach(P=>{k.observe(P)}),()=>{k.disconnect(),v.current=null}},[m]);const w=le(k=>(h.current.add(k),()=>{h.current.delete(k)})),x=le(k=>{var P;return b.current.add(k),(P=v.current)==null||P.observe(k),()=>{var E;b.current.delete(k),(E=v.current)==null||E.unobserve(k)}}),S={orientation:u,tabActivationDirection:p},R={"aria-orientation":u==="vertical"?"vertical":void 0,role:"tablist"},C=c.useMemo(()=>({activateOnFocus:o,registerIndicatorUpdateListener:w,registerTabResizeObserverElement:x,tabsListElement:m}),[o,w,x,m]);return K.jsx(ip.Provider,{value:C,children:K.jsx(cp,{render:i,className:r,style:a,state:S,refs:[n,g],props:[R,l],stateAttributesMapping:Ko,highlightedIndex:f,enableHomeAndEndKeys:!0,loopFocus:s,orientation:u,onHighlightedIndexChange:y,onMapChange:d,disabledIndices:Dt})})});function pE(e){return Jd("alert-dialog",e)}const hE=$v;function dw(e){if(!e)return null;for(const t of e.elements){const n=t.tagName;if(n==="BUTTON"||n==="INPUT"){const o=t;if(o.type==="submit")return o}}return null}function lp(e){return{checked(t){return e.indeterminate?{}:t?{"data-checked":""}:{"data-unchecked":""}},...vs}}const fw=c.createContext(void 0);function pw(){return c.useContext(fw)}const up=c.createContext(void 0);function hw(){const e=c.useContext(up);if(e===void 0)throw new Error(De(14));return e}const gw="data-parent",gE=c.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s=!1,"aria-labelledby":i,disabled:a=!1,form:l,id:u,indeterminate:d=!1,inputRef:p,name:f,onCheckedChange:y,parent:m=!1,readOnly:g=!1,render:h,required:b=!1,uncheckedValue:v,value:w,nativeButton:x=!1,style:S,...R}=t,{clearErrors:C}=Ss(),{disabled:k,name:P,setDirty:E,setFilled:O,setFocused:I,setTouched:N,state:D,validationMode:M,validityData:z,validation:_}=vo(),A=H2(),{labelId:F,controlId:T,registerControlId:L,getDescriptionProps:j}=qo(),$=pw(),U=($==null?void 0:$.allValues)===void 0?void 0:$.parent,q=U!==void 0,V=k||A.disabled||($==null?void 0:$.disabled)||a,Q=P??f,H=w??Q,G=tt(),ue=tt();let ne=u||T;q&&(m?ne=ue:H!==void 0?ne=`${U.id}-${H}`:ne||(ne=ue));let te={};q&&(m?te=U.getParentProps():H!==void 0&&(te=U.getChildProps(H)));const{checked:J=o,indeterminate:ee=d,onCheckedChange:ie,...xe}=te,ae=$==null?void 0:$.value,he=c.useRef(null),re=at(()=>Symbol()),ge=c.useRef(!1),{getButtonProps:de,buttonRef:ce}=Tt({disabled:V,native:x}),fe=($==null?void 0:$.validation)??_,[W,Y]=_t({controlled:H!==void 0&&ae!==void 0&&!m?ae.includes(H):J,default:s,name:"Checkbox",state:"checked"}),se=q?!!J:W,Z=q&&ee||d;oe(()=>{L!==Ke&&(ge.current=!0,L(re.current,ne))},[ne,L,re]),c.useEffect(()=>{const Re=re.current;return()=>{!ge.current||L===Ke||(ge.current=!1,L(Re,void 0))}},[L,re]),xs(he,G,W,void 0,!$&&!V,f);const X=c.useRef(null),pe=fe.registerInput,be=$?H:void 0,_e=c.useCallback(Re=>pe(Re,{controlRef:he,value:be}),[pe,be]),Ue=Nt(p,X,m?void 0:_e),Ye=Qf(i,F,X,!x,ne??void 0);oe(()=>{X.current&&(X.current.indeterminate=Z,W&&O(!0))},[W,Z,O]),bs(W,()=>{$||(C(Q),O(W),E(W!==z.initialValue),fe.change(W))});const st=St({checked:W,disabled:V,form:l,name:m?void 0:Q,id:x?void 0:ne??void 0,required:b,ref:Ue,style:Q?oa:Bo,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(Re){if(Re.nativeEvent.defaultPrevented)return;if(g){Re.preventDefault();return}const je=Re.currentTarget.checked,qe=ke(Rt,Re.nativeEvent);if(y==null||y(je,qe),!qe.isCanceled&&(ie==null||ie(je,qe),!qe.isCanceled&&(Y(je),H!==void 0&&$!==void 0&&!m&&!q))){const Be=je?[...$.value,H]:$.value.filter(Xe=>Xe!==H);$.setValue(Be,qe)}},onClick(Re){Re.stopPropagation()},onFocus(){var Re;(Re=he.current)==null||Re.focus()}},w!==void 0?{value:($?W&&w:w)||""}:We,j,Re=>fe.getValidationProps(V,Re));c.useEffect(()=>{if(!U||H===void 0)return;const Re=U.disabledStatesRef.current;return Re.set(H,V),()=>{Re.delete(H)}},[U,V,H]);const Le=c.useMemo(()=>({...D,checked:se,disabled:V,readOnly:g,required:b,indeterminate:Z}),[D,se,V,g,b,Z]),Je=lp(Le),ct=Se("span",t,{state:Le,ref:[ce,he,n],props:[{id:x?ne??void 0:G,role:"checkbox","aria-checked":Z?"mixed":se,"aria-readonly":g||void 0,"aria-required":b||void 0,"aria-labelledby":Ye,[gw]:m?"":void 0,onFocus(){V||I(!0)},onBlur(){const Re=X.current;Re&&(N(!0),I(!1),M==="onBlur"&&fe.commit($?ae:Re.checked))},onKeyDown(Re){var Ae;if(Re.key!=="Enter"||(Re.preventBaseUIHandler(),Re.defaultPrevented))return;const je=((Ae=X.current)==null?void 0:Ae.form)??null,qe=Re.currentTarget,Be=Re.nativeEvent,Xe=Re.preventDefault,pt=Be.preventDefault;let we=!1;Re.preventDefault=()=>{we=!0,Xe.call(Re)},Be.preventDefault=()=>{we=!0,pt.call(Be)},pt.call(Be),He(qe).queueMicrotask(()=>{var Qe;Re.preventDefault=Xe,Be.preventDefault=pt,we||(Qe=dw(je))==null||Qe.click()})},onClick(Re){if(g||V)return;Re.preventDefault();const je=X.current;je&&Qn(je,Re)}},R,xe,de,j,Re=>fe.getValidationProps(V,Re)],stateAttributesMapping:Je});return K.jsxs(up.Provider,{value:Le,children:[ct,!W&&!$&&Q&&!m&&v!==void 0&&K.jsx("input",{type:"hidden",form:l,name:Q,value:v,disabled:V}),K.jsx("input",{...st,suppressHydrationWarning:!0})]})}),mE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,keepMounted:i=!1,...a}=t,l=hw(),u=l.checked||l.indeterminate,{mounted:d,transitionStatus:p,setMounted:f}=ln(u),y=c.useRef(null),m={...l,transitionStatus:p};kt({open:u,ref:y,onComplete(){u||f(!1)}});const h={...lp(l),...Gt},b=i||d,v=Se("span",t,{ref:[n,y],state:m,stateAttributesMapping:h,props:a});return b?v:null}),dp=c.createContext(void 0);function mw(){return c.useContext(dp)}const yE=c.forwardRef(function(t,n){const{className:o,defaultPressed:r=!1,disabled:s=!1,form:i,onPressedChange:a,pressed:l,render:u,type:d,value:p,nativeButton:f=!0,style:y,...m}=t,g=tt(p||void 0),h=mw(),b=(h==null?void 0:h.value)??[],v=h?void 0:r,w=(s||(h==null?void 0:h.disabled))??!1,[x,S]=_t({controlled:h?g!==void 0&&b.indexOf(g)>-1:l,default:v,name:"Toggle",state:"pressed"}),{getButtonProps:R,buttonRef:C}=Tt({disabled:w,native:f}),k={disabled:w,pressed:x},P=[C,n],E=[{"aria-pressed":x,onClick(N){var z;const D=!x,M=ke(Rt,N.nativeEvent);a==null||a(D,M),!M.isCanceled&&(g&&((z=h==null?void 0:h.setGroupValue)==null||z.call(h,g,D,M)),!M.isCanceled&&S(D))}},m,R],O=Se("button",t,{enabled:!h,state:k,ref:P,props:E}),I=c.useMemo(()=>({disabled:w,focusableWhenDisabled:!1}),[w]);return h?K.jsx(Hd,{tag:"button",render:u,className:o,style:y,metadata:I,state:k,refs:P,props:E}):O}),yw=c.createContext(void 0);function bw(){return c.useContext(yw)}const bE=c.forwardRef(function(t,n){const{defaultValue:o,disabled:r=!1,loopFocus:s=!0,onValueChange:i,orientation:a="horizontal",multiple:l=!1,value:u,className:d,render:p,style:f,...y}=t,m=Pa(),g=bw(),h=u!==void 0||o!==void 0,b=((m==null?void 0:m.disabled)??!1)||((g==null?void 0:g.disabled)??!1)||r,[v,w]=_t({controlled:u,default:u===void 0?o??Dt:void 0,name:"ToggleGroup",state:"value"}),x=le((P,E,O)=>{let I;l?(I=v.slice(),E?I.push(P):I.splice(v.indexOf(P),1)):I=E?[P]:[],i==null||i(I,O),!O.isCanceled&&w(I)}),S={disabled:b,multiple:l,orientation:a},R=c.useMemo(()=>({disabled:b,setGroupValue:x,value:v,isValueInitialized:h}),[b,x,v,h]),C={role:"group"},k=Se("div",t,{enabled:!!m,state:S,ref:n,props:[C,y]});return K.jsx(dp.Provider,{value:R,children:m?k:K.jsx(cp,{render:p,className:d,style:f,state:S,refs:[n],props:[C,y],loopFocus:s,enableHomeAndEndKeys:!0,orientation:a})})});function vE(e){const[t,n]=c.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),o=c.useRef(null),r=c.useRef(null),s=c.useRef(null),i=c.useRef(null),a=c.useRef(!0),l=c.useRef(null),u=bn(),d=c.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:s,backdropRef:o,internalBackdropRef:r,positionerRef:i,allowMouseUpTriggerRef:a,initialCursorPointRef:l,rootId:u}),[t,u]);return K.jsx(Tu.Provider,{value:d,children:K.jsx(ji.Provider,{value:void 0,children:K.jsx(Jb,{...e})})})}const Ll=500,xE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,{setAnchor:a,actionsRef:l,internalBackdropRef:u,backdropRef:d,positionerRef:p,allowMouseUpTriggerRef:f,initialCursorPointRef:y,rootId:m}=Zr(!1),{store:g}=cn(!1),h=g.useState("open"),b=g.useState("disabled"),v=c.useRef(null),w=c.useRef(null),x=Ge(),S=Ge(),R=c.useRef(!1),C=c.useRef(null);function k(M,z,_){var F;const A=_.type.startsWith("touch");y.current={x:M,y:z},a({getBoundingClientRect(){return DOMRect.fromRect({width:A?10:0,height:A?10:0,x:M,y:z})}}),R.current=!1,(F=l.current)==null||F.setOpen(!0,ke(Rn,_)),S.start(Ll,()=>{R.current=!0})}function P(M){var A;if(b)return;f.current=!0,It(M),k(M.clientX,M.clientY,M.nativeEvent);const z=Te(v.current);(A=C.current)==null||A.abort();const _=new AbortController;C.current=_,z.addEventListener("mouseup",F=>{var L;if(f.current=!1,!R.current)return;S.clear(),R.current=!1;const T=et(F);ve(p.current,T)||m&&T&&Aa(T)===m||(L=l.current)==null||L.setOpen(!1,ke(Ui,F))},{once:!0,signal:_.signal})}function E(){x.clear(),w.current=null}function O(M){if(b){E();return}if(f.current=!1,M.touches.length!==1){E();return}M.stopPropagation();const z=M.touches[0],_={x:z.clientX,y:z.clientY};w.current=_,x.start(Ll,()=>{k(_.x,_.y,M.nativeEvent)})}function I(M){if(M.touches.length!==1){E();return}if(x.isStarted()&&w.current){const z=M.touches[0],_=10,A=Math.abs(z.clientX-w.current.x),F=Math.abs(z.clientY-w.current.y);(A>_||F>_)&&E()}}return c.useEffect(()=>()=>{var M;(M=C.current)==null||M.abort()},[]),c.useEffect(()=>{function M(_){if(b)return;const F=et(_);(ve(v.current,F)||ve(u.current,F)||ve(d.current,F))&&_.preventDefault()}const z=Te(v.current);return Pe(z,"contextmenu",M)},[d,b,u]),Se("div",t,{state:{open:h},ref:[v,n],props:[{onContextMenu:P,onTouchStart:O,onTouchMove:I,onTouchEnd:E,onTouchCancel:E,style:{WebkitTouchCallout:"none"}},i],stateAttributesMapping:Lr})});function vw(e,t){const n=getComputedStyle(e),o=parseFloat(n.fontSize);return t*o}function xw(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),o=parseFloat(n.fontSize);return t*o}function ww(e){return e/100*window.innerHeight}function Sw(e){return e/100*window.innerWidth}function Rw(e){switch(typeof e){case"number":return[e,"px"];case"string":{const 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 Oo({groupSize:e,panelElement:t,styleProp:n}){let o;const[r,s]=Rw(n);switch(s){case"%":{o=r/100*e;break}case"px":{o=r;break}case"rem":{o=xw(t,r);break}case"em":{o=vw(t,r);break}case"vh":{o=ww(r);break}case"vw":{o=Sw(r);break}}return o}function mt(e){return parseFloat(e.toFixed(3))}function go({group:e}){const{orientation:t,panels:n}=e;return n.reduce((o,r)=>(o+=t==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o),0)}function Oi(e){const{panels:t}=e,n=go({group:e});return n===0?t.map(o=>({groupResizeBehavior:o.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:o.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:o.panelConstraints.disabled,minSize:0,maxSize:100,panelId:o.id})):t.map(o=>{const{element:r,panelConstraints:s}=o;let i=0;if(s.collapsedSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.collapsedSize});i=mt(d/n*100)}let a;if(s.defaultSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.defaultSize});a=mt(d/n*100)}let l=0;if(s.minSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.minSize});l=mt(d/n*100)}let u=100;if(s.maxSize!==void 0){const d=Oo({groupSize:n,panelElement:r,styleProp:s.maxSize});u=mt(d/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:i,collapsible:s.collapsible===!0,defaultSize:a,disabled:s.disabled,minSize:l,maxSize:u,panelId:o.id}})}function $e(e,t="Assertion error"){if(!e)throw Error(t)}function Ai(e,t){return Array.from(t).sort(e==="horizontal"?kw:Cw)}function kw(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function Cw(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function fp(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function pp(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 Ew({orientation:e,rects:t,targetRect:n}){const o={x:n.x+n.width/2,y:n.y+n.height/2};let r,s=Number.MAX_VALUE;for(const i of t){const{x:a,y:l}=pp(o,i),u=e==="horizontal"?a:l;u<s&&(s=u,r=i)}return $e(r,"No rect found"),r}let Sr;function Mw(){return Sr===void 0&&(typeof matchMedia=="function"?Sr=!!matchMedia("(pointer:coarse)").matches:Sr=!1),Sr}function hp(e){const{element:t,orientation:n,panels:o,separators:r}=e,s=Ai(n,Array.from(t.children).filter(fp).map(m=>({element:m}))).map(({element:m})=>m),i=[];let a=!1,l=!1,u=-1,d=-1,p=0,f,y=[];{let m=-1;for(const g of s)g.hasAttribute("data-panel")&&(m++,g.hasAttribute("data-disabled")||(p++,u===-1&&(u=m),d=m))}if(p>1){let m=-1;for(const g of s)if(g.hasAttribute("data-panel")){m++;const h=o.find(b=>b.element===g);if(h){if(f){const b=f.element.getBoundingClientRect(),v=g.getBoundingClientRect();let w;if(l){const x=n==="horizontal"?new DOMRect(b.right,b.top,0,b.height):new DOMRect(b.left,b.bottom,b.width,0),S=n==="horizontal"?new DOMRect(v.left,v.top,0,v.height):new DOMRect(v.left,v.top,v.width,0);switch(y.length){case 0:{w=[x,S];break}case 1:{const R=y[0],C=Ew({orientation:n,rects:[b,v],targetRect:R.element.getBoundingClientRect()});w=[R,C===b?S:x];break}default:{w=y;break}}}else y.length?w=y:w=[n==="horizontal"?new DOMRect(b.right,v.top,v.left-b.right,v.height):new DOMRect(v.left,b.bottom,v.width,v.top-b.bottom)];for(const x of w){let S="width"in x?x:x.element.getBoundingClientRect();const R=Mw()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<R){const k=R-S.width;S=new DOMRect(S.x-k/2,S.y,S.width+k,S.height)}if(S.height<R){const k=R-S.height;S=new DOMRect(S.x,S.y-k/2,S.width,S.height+k)}const C=m<=u||m>d;!a&&!C&&i.push({group:e,groupSize:go({group:e}),panels:[f,h],separator:"width"in x?void 0:x,rect:S}),a=!1}}l=!1,f=h,y=[]}}else if(g.hasAttribute("data-separator")){g.ariaDisabled!==null&&(a=!0);const h=r.find(b=>b.element===g);h?y.push(h):(f=void 0,y=[])}else l=!0}return i}var fn;class gp{constructor(){ac(this,fn,{})}addListener(t,n){const o=Ro(this,fn)[t];return o===void 0?Ro(this,fn)[t]=[n]:o.includes(n)||o.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const o=Ro(this,fn)[t];if(o!==void 0)if(o.length===1)o[0].call(null,n);else{let r=!1,s=null;const i=Array.from(o);for(let a=0;a<i.length;a++){const l=i[a];try{l.call(null,n)}catch(u){s===null&&(r=!0,s=u)}}if(r)throw s}}removeAllListeners(){cc(this,fn,{})}removeListener(t,n){const o=Ro(this,fn)[t];if(o!==void 0){const r=o.indexOf(n);r>=0&&o.splice(r,1)}}}fn=new WeakMap;let oo={cursorFlags:0,state:"inactive"};const Ya=new gp;function Ln(){return oo}function Pw(e){return Ya.addListener("change",e)}function Tw(e){const t=oo,n={...oo};n.cursorFlags=e,oo=n,Ya.emit("change",{prev:t,next:n})}function ro(e){const t=oo;oo=e,Ya.emit("change",{prev:t,next:e})}const Iw=e=>e,Zs=()=>{},mp=1,yp=2,bp=4,vp=8,Fl=3,zl=12;let Rr;function Vl(){return Rr===void 0&&(Rr=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(Rr=!0)),Rr}function Ow({cursorFlags:e,groups:t,state:n}){let o=0,r=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{o++;break}case"vertical":{r++;break}}})}if(!(o===0&&r===0)){switch(n){case"active":{if(e&&Vl()){const s=(e&mp)!==0,i=(e&yp)!==0,a=(e&bp)!==0,l=(e&vp)!==0;if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(i)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return Vl()?o>0&&r>0?"move":o>0?"ew-resize":"ns-resize":o>0&&r>0?"grab":o>0?"col-resize":"row-resize"}}const $l=new WeakMap;function Xa(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=$l.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]));const o=Ln();switch(o.state){case"active":case"hover":{const r=Ow({cursorFlags:o.cursorFlags,groups:o.hitRegions.map(i=>i.group),state:o.state}),s=`*, *:hover {cursor: ${r} !important; }`;if(t===s)return;t=s,r?n.cssRules.length===0?n.insertRule(s):n.replaceSync(s):n.cssRules.length===1&&n.deleteRule(0);break}case"inactive":{t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}}$l.set(e,{prevStyle:t,styleSheet:n})}let Wt=new Map;const xp=new gp;function Aw(e){Wt=new Map(Wt),Wt.delete(e)}function Hl(e,t){for(const[n]of Wt)if(n.id===e)return n}function yn(e,t){for(const[n,o]of Wt)if(n.id===e)return o;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Hn(){return Wt}function Ka(e,t){return xp.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function sn(e,t,n){const o=Wt.get(e);Wt=new Map(Wt),Wt.set(e,t),xp.emit("groupChange",{group:e,isUserInteraction:(n==null?void 0:n.isUserInteraction)===!0,prev:o,next:t})}function wp(e){const t=Ln();let n=!1;switch(t.state){case"active":ro({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(Xa(e),n=!0,t.hitRegions.forEach(o=>{const r=yn(o.group.id,!0);sn(o.group,r,{isUserInteraction:!0})}))}return n}function jl(e){e.defaultPrevented||wp(e.currentTarget)}function Nw(e,t,n){let o,r={x:1/0,y:1/0};for(const s of t){const i=pp(n,s.rect);switch(e){case"horizontal":{i.x<=r.x&&(o=s,r=i);break}case"vertical":{i.y<=r.y&&(o=s,r=i);break}}}return o?{distance:r,hitRegion:o}:void 0}function Dw(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _w(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ul(e),b:Ul(t)};let o;for(;n.a.at(-1)===n.b.at(-1);)o=n.a.pop(),n.b.pop();$e(o,"Stacking order can only be calculated for elements with a common ancestor");const r={a:Wl(Bl(n.a)),b:Wl(Bl(n.b))};if(r.a===r.b){const s=o.childNodes,i={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===i.a)return 1;if(l===i.b)return-1}}return Math.sign(r.a-r.b)}const Lw=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fw(e){const t=getComputedStyle(Sp(e)??e).display;return t==="flex"||t==="inline-flex"}function zw(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||Fw(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"||Lw.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Bl(e){let t=e.length;for(;t--;){const n=e[t];if($e(n,"Missing node"),zw(n))return n}return null}function Wl(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ul(e){const t=[];for(;e;)t.push(e),e=Sp(e);return t}function Sp(e){const{parentNode:t}=e;return Dw(t)?t.host:t}function Vw(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 $w({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!fp(n)||n.contains(e)||e.contains(n))return!0;if(_w(n,e)>0){let o=n;for(;o;){if(o.contains(e))return!0;if(Vw(o.getBoundingClientRect(),t))return!1;o=o.parentElement}}return!0}function Za(e,t){const n=[];return t.forEach((o,r)=>{if(r.disabled)return;const s=hp(r),i=Nw(r.orientation,s,{x:e.clientX,y:e.clientY});i&&i.distance.x<=0&&i.distance.y<=0&&$w({groupElement:r.element,hitRegion:i.hitRegion.rect,pointerEventTarget:e.target})&&n.push(i.hitRegion)}),n}function Hw(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 ft(e,t,n=0){return Math.abs(mt(e)-mt(t))<=n}function jt(e,t){return ft(e,t)?0:e>t?1:-1}function Zn({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:o}){const{collapsedSize:r=0,collapsible:s,disabled:i,maxSize:a=100,minSize:l=0}=t;if(i&&!e)return n;if(jt(o,l)<0)if(s){const u=(r+l)/2;jt(o,u)<0?o=r:o=l}else o=l;return o=Math.min(a,o),o=mt(o),o}function Ho({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:o,prevLayout:r,trigger:s}){if(ft(e,0))return t;const i=s==="imperative-api",a=Object.values(t),l=Object.values(r),u=[...a],[d,p]=o;$e(d!=null,"Invalid first pivot index"),$e(p!=null,"Invalid second pivot index");let f=0;switch(s){case"keyboard":{{const g=e<0?p:d,h=n[g];$e(h,`Panel constraints not found for index ${g}`);const{collapsedSize:b=0,collapsible:v,minSize:w=0}=h;if(v){const x=a[g];if($e(x!=null,`Previous layout not found for panel index ${g}`),ft(x,b)){const S=w-x;jt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const g=e<0?d:p,h=n[g];$e(h,`No panel constraints found for index ${g}`);const{collapsedSize:b=0,collapsible:v,minSize:w=0}=h;if(v){const x=a[g];if($e(x!=null,`Previous layout not found for panel index ${g}`),ft(x,w)){const S=x-b;jt(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const g=e<0?p:d,h=n[g];$e(h,`Panel constraints not found for index ${g}`);const b=a[g],{collapsible:v,collapsedSize:w,minSize:x}=h;if(v&&jt(b,x)<0)if(e>0){const S=x-w,R=S/2,C=b+e;jt(C,x)<0&&(e=jt(e,R)<=0?0:S)}else{const S=x-w,R=100-S/2,C=b-e;jt(C,x)<0&&(e=jt(100+e,R)>0?0:-S)}break}}{const g=e<0?1:-1;let h=e<0?p:d,b=0;for(;;){const w=a[h];$e(w!=null,`Previous layout not found for panel index ${h}`);const x=Zn({overrideDisabledPanels:i,panelConstraints:n[h],prevSize:w,size:100})-w;if(b+=x,h+=g,h<0||h>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(b));e=e<0?0-v:v}{let g=e<0?d:p;for(;g>=0&&g<n.length;){const h=Math.abs(e)-Math.abs(f),b=a[g];$e(b!=null,`Previous layout not found for panel index ${g}`);const v=b-h,w=Zn({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:b,size:v});if(!ft(b,w)&&(f+=b-w,u[g]=w,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?g--:g++}}if(Hw(l,u))return r;{const g=e<0?p:d,h=a[g];$e(h!=null,`Previous layout not found for panel index ${g}`);const b=h+f,v=Zn({overrideDisabledPanels:i,panelConstraints:n[g],prevSize:h,size:b});if(u[g]=v,!ft(v,b)){let w=b-v,x=e<0?p:d;for(;x>=0&&x<n.length;){const S=u[x];$e(S!=null,`Previous layout not found for panel index ${x}`);const R=S+w,C=Zn({overrideDisabledPanels:i,panelConstraints:n[x],prevSize:S,size:R});if(ft(S,C)||(w-=C-S,u[x]=C),ft(w,0))break;e>0?x--:x++}}}const y=Object.values(u).reduce((g,h)=>h+g,0);if(!ft(y,100,.1))return r;const m=Object.keys(r);return u.reduce((g,h,b)=>(g[m[b]]=h,g),{})}function Fn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||jt(e[n],t[n])!==0)return!1;return!0}function zn({layout:e,panelConstraints:t}){const n=Object.values(e),o=[...n],r=o.reduce((a,l)=>a+l,0);if(o.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${o.map(a=>`${a}%`).join(", ")}`);if(!ft(r,100)&&o.length>0)for(let a=0;a<t.length;a++){const l=o[a];$e(l!=null,`No layout data found for index ${a}`);const u=100/r*l;o[a]=u}let s=0;for(let a=0;a<t.length;a++){const l=n[a];$e(l!=null,`No layout data found for index ${a}`);const u=o[a];$e(u!=null,`No layout data found for index ${a}`);const d=Zn({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:u});u!=d&&(s+=u-d,o[a]=d)}if(!ft(s,0))for(let a=0;a<t.length;a++){const l=o[a];$e(l!=null,`No layout data found for index ${a}`);const u=l+s,d=Zn({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:u});if(l!==d&&(s-=d-l,o[a]=d,ft(s,0)))break}const i=Object.keys(e);return o.reduce((a,l,u)=>(a[i[u]]=l,a),{})}function Rp({groupId:e,panelId:t}){const n=()=>{const l=Hn();for(const[u,{defaultLayoutDeferred:d,derivedPanelConstraints:p,layout:f,groupSize:y,separatorToPanels:m}]of l)if(u.id===e)return{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:u,groupSize:y,layout:f,separatorToPanels:m};throw Error(`Group ${e} not found`)},o=()=>{const l=n().derivedPanelConstraints.find(u=>u.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},r=()=>{const l=n().group.panels.find(u=>u.id===t);if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},s=()=>{const l=n().layout[t];if(l!==void 0)return l;throw Error(`Layout not found for Panel ${t}`)},i=({nextSize:l,panels:u,prevLayout:d,derivedPanelConstraints:p})=>{const f=s(),y=u.findIndex(h=>h.id===t),m=y===0,g=y===u.length-1;if(g&&l<f&&(m||u.slice(0,y).every((h,b)=>{const v=p[b];return(v==null?void 0:v.collapsible)&&ft(v.collapsedSize,d[v.panelId])}))){const h=u.slice(0,y).reduce((b,v)=>b+d[v.id],0);return{...d,[t]:mt(100-h)}}return Ho({delta:g?f-l:l-f,initialLayout:d,panelConstraints:p,pivotIndices:g?[y-1,y]:[y,y+1],prevLayout:d,trigger:"imperative-api"})},a=l=>{const u=s();if(l===u)return;const{defaultLayoutDeferred:d,derivedPanelConstraints:p,group:f,groupSize:y,layout:m,separatorToPanels:g}=n(),h=i({nextSize:l,panels:f.panels,prevLayout:m,derivedPanelConstraints:p}),b=zn({layout:h,panelConstraints:p});Fn(m,b)||sn(f,{defaultLayoutDeferred:d,derivedPanelConstraints:p,groupSize:y,layout:b,separatorToPanels:g})};return{collapse:()=>{const{collapsible:l,collapsedSize:u}=o(),{mutableValues:d}=r(),p=s();l&&p!==u&&(d.expandToSize=p,a(u))},expand:()=>{const{collapsible:l,collapsedSize:u,minSize:d}=o(),{mutableValues:p}=r(),f=s();if(l&&f===u){let y=p.expandToSize??d;y===0&&(y=1),a(y)}},getSize:()=>{const{group:l}=n(),u=s(),{element:d}=r(),p=l.orientation==="horizontal"?d.offsetWidth:d.offsetHeight;return{asPercentage:u,inPixels:p}},isCollapsed:()=>{const{collapsible:l,collapsedSize:u}=o(),d=s();return l&&ft(u,d)},resize:l=>{const{group:u}=n(),{element:d}=r(),p=go({group:u}),f=Oo({groupSize:p,panelElement:d,styleProp:l}),y=mt(f/p*100);a(y)}}}function Gl(e){if(e.defaultPrevented)return;const t=Hn();Za(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const o=n.panels.find(r=>r.panelConstraints.defaultSize!==void 0);if(o){const r=o.panelConstraints.defaultSize,s=Rp({groupId:n.group.id,panelId:o.id});s&&r!==void 0&&(s.resize(r),e.preventDefault())}}})}function Or(e){const t=Hn();for(const[n]of t)if(n.separators.some(o=>o.element===e))return n;throw Error("Could not find parent Group for separator element")}function kp({groupId:e}){const t=()=>{const n=Hn();for(const[o,r]of n)if(o.id===e)return{group:o,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:o}=t();return n?{}:o},setLayout(n){const{defaultLayoutDeferred:o,derivedPanelConstraints:r,group:s,groupSize:i,layout:a,separatorToPanels:l}=t(),u=zn({layout:n,panelConstraints:r});return o?a:(Fn(a,u)||sn(s,{defaultLayoutDeferred:o,derivedPanelConstraints:r,groupSize:i,layout:u,separatorToPanels:l}),u)}}}function On(e,t){const n=Or(e),o=yn(n.id,!0),r=n.separators.find(d=>d.element===e);$e(r,"Matching separator not found");const s=o.separatorToPanels.get(r);$e(s,"Matching panels not found");const i=s.map(d=>n.panels.indexOf(d)),a=kp({groupId:n.id}).getLayout(),l=Ho({delta:t,initialLayout:a,panelConstraints:o.derivedPanelConstraints,pivotIndices:i,prevLayout:a,trigger:"keyboard"}),u=zn({layout:l,panelConstraints:o.derivedPanelConstraints});Fn(a,u)||sn(n,{defaultLayoutDeferred:o.defaultLayoutDeferred,derivedPanelConstraints:o.derivedPanelConstraints,groupSize:o.groupSize,layout:u,separatorToPanels:o.separatorToPanels},{isUserInteraction:!0})}function ql(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Or(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&On(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&On(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&On(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&On(t,-5);break}case"End":{e.preventDefault(),On(t,100);break}case"Enter":{e.preventDefault();const o=Or(t),r=yn(o.id,!0),{derivedPanelConstraints:s,layout:i,separatorToPanels:a}=r,l=o.separators.find(f=>f.element===t);$e(l,"Matching separator not found");const u=a.get(l);$e(u,"Matching panels not found");const d=u[0],p=s.find(f=>f.panelId===d.id);if($e(p,"Panel metadata not found"),p.collapsible){const f=i[d.id],y=p.collapsedSize===f?o.mutableState.expandedPanelSizes[d.id]??p.minSize:p.collapsedSize;On(t,y-f)}break}case"F6":{e.preventDefault();const o=Or(t).separators.map(i=>i.element),r=Array.from(o).findIndex(i=>i===e.currentTarget);$e(r!==null,"Index not found");const s=e.shiftKey?r>0?r-1:o.length-1:r+1<o.length?r+1:0;o[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),On(t,-100);break}}}function Yl(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=Hn(),n=Za(e,t),o=new Map;let r=!1;n.forEach(s=>{s.separator&&(r||(r=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const i=t.get(s.group);i&&o.set(s.group,i.layout)}),ro({cursorFlags:0,hitRegions:n,initialLayoutMap:o,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function Cp({document:e,event:t,hitRegions:n,initialLayoutMap:o,mountedGroups:r,pointerDownAtPoint:s,prevCursorFlags:i}){let a=0;n.forEach(u=>{const{group:d,groupSize:p}=u,{orientation:f,panels:y}=d,{disableCursor:m}=d.mutableState;let g=0;s?f==="horizontal"?g=(t.clientX-s.x)/p*100:g=(t.clientY-s.y)/p*100:f==="horizontal"?g=t.clientX<0?-100:100:g=t.clientY<0?-100:100;const h=o.get(d),b=r.get(d);if(!h||!b)return;const{defaultLayoutDeferred:v,derivedPanelConstraints:w,groupSize:x,layout:S,separatorToPanels:R}=b;if(w&&S&&R){const C=Ho({delta:g,initialLayout:h,panelConstraints:w,pivotIndices:u.panels.map(k=>y.indexOf(k)),prevLayout:S,trigger:"mouse-or-touch"});if(Fn(C,S)){if(g!==0&&!m)switch(f){case"horizontal":{a|=g<0?mp:yp;break}case"vertical":{a|=g<0?bp:vp;break}}}else sn(u.group,{defaultLayoutDeferred:v,derivedPanelConstraints:w,groupSize:x,layout:C,separatorToPanels:R})}});let l=0;t.movementX===0?l|=i&Fl:l|=a&Fl,t.movementY===0?l|=i&zl:l|=a&zl,Tw(l),Xa(e)}function Xl(e){const t=Hn(),n=Ln();switch(n.state){case"active":Cp({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Kl(e){var o,r;if(e.defaultPrevented)return;const t=Ln(),n=Hn();switch(t.state){case"active":{if(e.buttons===0){ro({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(s=>{const i=yn(s.group.id,!0);sn(s.group,i,{isUserInteraction:!0})});return}for(const s of t.hitRegions)if(s.separator){const{element:i}=s.separator;(o=i.hasPointerCapture)!=null&&o.call(i,e.pointerId)||((r=i.setPointerCapture)==null||r.call(i,e.pointerId))}Cp({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const s=Za(e,n);s.length===0?t.state!=="inactive"&&ro({cursorFlags:0,state:"inactive"}):ro({cursorFlags:0,hitRegions:s,state:"hover"}),Xa(e.currentTarget);break}}}function Zl(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Ln().state){case"hover":ro({cursorFlags:0,state:"inactive"})}}function Ql(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||wp(e.currentTarget)&&e.preventDefault()}function Jl(e){let t=0,n=0;const o={};for(const s of e)if(s.defaultSize!==void 0){t++;const i=mt(s.defaultSize);n+=i,o[s.panelId]=i}else o[s.panelId]=void 0;const r=e.length-t;if(r!==0){const s=mt((100-n)/r);for(const i of e)i.defaultSize===void 0&&(o[i.panelId]=s)}return o}function jw(e,t,n){if(!n[0])return;const o=e.panels.find(l=>l.element===t);if(!o||!o.onResize)return;const r=go({group:e}),s=e.orientation==="horizontal"?o.element.offsetWidth:o.element.offsetHeight,i=o.mutableValues.prevSize,a={asPercentage:mt(s/r*100),inPixels:s};o.mutableValues.prevSize=a,o.onResize(a,o.id,i)}function Bw(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Ww({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:o}){if(n<=0||t<=0||n===t)return o;let r=0,s=0,i=!1;const a=new Map,l=[];for(const p of e.panels){const f=o[p.id]??0;switch(p.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{i=!0;const y=f/100*n,m=mt(y/t*100);a.set(p.id,m),r+=m;break}case"preserve-relative-size":default:{l.push(p.id),s+=f;break}}}if(!i||l.length===0)return o;const u=100-r,d={...o};if(a.forEach((p,f)=>{d[f]=p}),s>0)for(const p of l){const f=o[p]??0;d[p]=mt(f/s*u)}else{const p=mt(u/l.length);for(const f of l)d[f]=p}return d}function Uw(e,t){const n=e.map(r=>r.id),o=Object.keys(t);if(n.length!==o.length)return!1;for(const r of n)if(!o.includes(r))return!1;return!0}const Yn=new Map;function Gw(e){let t=!0;$e(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,o=new Set,r=new Set,s=new n(m=>{for(const g of m){const{borderBoxSize:h,target:b}=g;if(b===e.element){if(t){const v=go({group:e});if(v===0)return;const w=yn(e.id);if(!w)return;const x=Oi(e),S=w.defaultLayoutDeferred?Jl(x):w.layout,R=Ww({group:e,nextGroupSize:v,prevGroupSize:w.groupSize,prevLayout:S}),C=zn({layout:R,panelConstraints:x});if(!w.defaultLayoutDeferred&&Fn(w.layout,C)&&Bw(w.derivedPanelConstraints,x)&&w.groupSize===v)return;sn(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:x,groupSize:v,layout:C,separatorToPanels:w.separatorToPanels})}}else jw(e,b,h)}});s.observe(e.element),e.panels.forEach(m=>{$e(!o.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),o.add(m.id),m.onResize&&s.observe(m.element)});const i=go({group:e}),a=Oi(e),l=e.panels.map(({id:m})=>m).join(",");let u=e.mutableState.defaultLayout;u&&(Uw(e.panels,u)||(u=void 0));const d=e.mutableState.layouts[l]??u??Jl(a),p=zn({layout:d,panelConstraints:a}),f=e.element.ownerDocument;Yn.set(f,(Yn.get(f)??0)+1);const y=new Map;return hp(e).forEach(m=>{m.separator&&y.set(m.separator,m.panels)}),sn(e,{defaultLayoutDeferred:i===0,derivedPanelConstraints:a,groupSize:i,layout:p,separatorToPanels:y}),e.separators.forEach(m=>{$e(!r.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.element.addEventListener("keydown",ql)}),Yn.get(f)===1&&(f.addEventListener("contextmenu",jl,!0),f.addEventListener("dblclick",Gl,!0),f.addEventListener("pointerdown",Yl,!0),f.addEventListener("pointerleave",Xl),f.addEventListener("pointermove",Kl),f.addEventListener("pointerout",Zl),f.addEventListener("pointerup",Ql,!0)),function(){t=!1,Yn.set(f,Math.max(0,(Yn.get(f)??0)-1)),Aw(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",ql)}),Yn.get(f)||(f.removeEventListener("contextmenu",jl,!0),f.removeEventListener("dblclick",Gl,!0),f.removeEventListener("pointerdown",Yl,!0),f.removeEventListener("pointerleave",Xl),f.removeEventListener("pointermove",Kl),f.removeEventListener("pointerout",Zl),f.removeEventListener("pointerup",Ql,!0)),s.disconnect()}}function qw(){const[e,t]=c.useState({}),n=c.useCallback(()=>t({}),[]);return[e,n]}function Qa(e){const t=c.useId();return`${e??t}`}const jn=typeof window<"u"?c.useLayoutEffect:c.useEffect;function Do(e){const t=c.useRef(e);return jn(()=>{t.current=e},[e]),c.useCallback((...n)=>{var o;return(o=t.current)==null?void 0:o.call(t,...n)},[t])}function Ja(...e){return Do(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ec(e){const t=c.useRef({...e});return jn(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const Ep=c.createContext(null);function Yw(e,t){const n=c.useRef({getLayout:()=>({}),setLayout:Iw});c.useImperativeHandle(t,()=>n.current,[]),jn(()=>{Object.assign(n.current,kp({groupId:e}))})}function Xw({children:e,className:t,defaultLayout:n,disableCursor:o,disabled:r,elementRef:s,groupRef:i,id:a,onLayoutChange:l,onLayoutChanged:u,orientation:d="horizontal",resizeTargetMinimumSize:p={coarse:20,fine:10},style:f,...y}){const m=c.useRef({onLayoutChange:{},onLayoutChanged:{}}),g=Do(O=>{Fn(m.current.onLayoutChange,O)||(m.current.onLayoutChange=O,l==null||l(O))}),h=Do((O,I)=>{Fn(m.current.onLayoutChanged,O)||(m.current.onLayoutChanged=O,u==null||u(O,{isUserInteraction:I}))}),b=Qa(a),v=c.useRef(null),[w,x]=qw(),S=c.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:p,separators:[]}),R=Ja(v,s);Yw(b,i);const C=Do((O,I)=>{const N=Ln(),D=Hl(O),M=yn(O);if(M){let z=!1;switch(N.state){case"active":{z=N.hitRegions.some(_=>_.group===D);break}}return{flexGrow:M.layout[I]??1,pointerEvents:z?"none":void 0}}if(n!=null&&n[I])return{flexGrow:n==null?void 0:n[I]}}),k=ec({defaultLayout:n,disableCursor:o}),P=c.useMemo(()=>({get disableCursor(){return!!k.disableCursor},getPanelStyles:C,id:b,orientation:d,registerPanel:O=>{const I=S.current;return I.panels=Ai(d,[...I.panels,O]),x(),()=>{I.panels=I.panels.filter(N=>N!==O),x()}},registerSeparator:O=>{const I=S.current;return I.separators=Ai(d,[...I.separators,O]),x(),()=>{I.separators=I.separators.filter(N=>N!==O),x()}},updatePanelProps:(O,{disabled:I})=>{const N=S.current.panels.find(z=>z.id===O);N&&(N.panelConstraints.disabled=I);const D=Hl(b),M=yn(b);D&&M&&sn(D,{...M,derivedPanelConstraints:Oi(D)})},updateSeparatorProps:(O,{disabled:I,disableDoubleClick:N})=>{const D=S.current.separators.find(M=>M.id===O);D&&(D.disabled=I,D.disableDoubleClick=N)}}),[C,b,x,d,k]),E=c.useRef(null);return jn(()=>{const O=v.current;if(O===null)return;const I=S.current;let N;if(k.defaultLayout!==void 0&&Object.keys(k.defaultLayout).length===I.panels.length){N={};for(const T of I.panels){const L=k.defaultLayout[T.id];L!==void 0&&(N[T.id]=L)}}const D={disabled:!!r,element:O,id:b,mutableState:{defaultLayout:N,disableCursor:!!k.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:d,panels:I.panels,resizeTargetMinimumSize:I.resizeTargetMinimumSize,separators:I.separators};E.current=D;const M=Gw(D),{defaultLayoutDeferred:z,derivedPanelConstraints:_,layout:A}=yn(D.id,!0);!z&&_.length>0&&(g(A),h(A,!1));const F=Ka(b,T=>{const{defaultLayoutDeferred:L,derivedPanelConstraints:j,layout:$}=T.next;if(L||j.length===0)return;const U=D.panels.map(({id:V})=>V).join(",");D.mutableState.layouts[U]=$,j.forEach(V=>{if(V.collapsible){const{layout:Q}=T.prev??{};if(Q){const H=ft(V.collapsedSize,$[V.panelId]),G=ft(V.collapsedSize,Q[V.panelId]);H&&!G&&(D.mutableState.expandedPanelSizes[V.panelId]=Q[V.panelId])}}});const q=Ln().state!=="active";g($),q&&h($,T.isUserInteraction)});return()=>{E.current=null,M(),F()}},[r,b,h,g,d,w,k]),c.useEffect(()=>{const O=E.current;O&&(O.mutableState.defaultLayout=n,O.mutableState.disableCursor=!!o)}),K.jsx(Ep.Provider,{value:P,children:K.jsx("div",{...y,className:t,"data-group":!0,"data-testid":b,id:b,ref:R,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:d==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:d==="horizontal"?"pan-y":"pan-x"},children:e})})}Xw.displayName="Group";function tc(){const e=c.useContext(Ep);return $e(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function Kw(e,t){const{id:n}=tc(),o=c.useRef({collapse:Zs,expand:Zs,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Zs});c.useImperativeHandle(t,()=>o.current,[]),jn(()=>{Object.assign(o.current,Rp({groupId:n,panelId:e}))})}function Zw({children:e,className:t,collapsedSize:n="0%",collapsible:o=!1,defaultSize:r,disabled:s,elementRef:i,groupResizeBehavior:a="preserve-relative-size",id:l,maxSize:u="100%",minSize:d="0%",onResize:p,panelRef:f,style:y,...m}){const g=!!l,h=Qa(l),b=ec({disabled:s}),v=c.useRef(null),w=Ja(v,i),{getPanelStyles:x,id:S,orientation:R,registerPanel:C,updatePanelProps:k}=tc(),P=p!==null,E=Do((D,M,z)=>{p==null||p(D,l,z)});jn(()=>{const D=v.current;if(D!==null){const M={element:D,id:h,idIsStable:g,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:P?E:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:n,collapsible:o,defaultSize:r,disabled:b.disabled,maxSize:u,minSize:d}};return C(M)}},[a,n,o,r,P,h,g,u,d,E,C,b]),c.useEffect(()=>{k(h,{disabled:s})},[s,h,k]),Kw(h,f);const O=()=>{const D=x(S,h);if(D)return JSON.stringify(D)},I=c.useSyncExternalStore(D=>Ka(S,D),O,O);let N;return I?N=JSON.parse(I):r!==void 0?N={flexGrow:void 0,flexShrink:void 0,flexBasis:r}:N={flexGrow:1},K.jsx("div",{...m,"data-disabled":s||void 0,"data-panel":!0,"data-testid":h,id:h,ref:w,style:{...Qw,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...N},children:K.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...y,touchAction:R==="horizontal"?"pan-y":"pan-x"},children:e})})}Zw.displayName="Panel";const Qw={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function Jw({layout:e,panelConstraints:t,panelId:n,panelIndex:o}){let r,s;const i=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,u=a.collapsible?a.collapsedSize:a.minSize,d=[o,o+1];s=zn({layout:Ho({delta:u-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n],r=zn({layout:Ho({delta:l-i,initialLayout:e,panelConstraints:t,pivotIndices:d,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:r,valueMin:s,valueNow:i}}function eS({children:e,className:t,disabled:n,disableDoubleClick:o,elementRef:r,id:s,style:i,...a}){const l=Qa(s),u=ec({disabled:n,disableDoubleClick:o}),[d,p]=c.useState({}),[f,y]=c.useState("inactive"),[m,g]=c.useState(!1),h=c.useRef(null),b=Ja(h,r),{disableCursor:v,id:w,orientation:x,registerSeparator:S,updateSeparatorProps:R}=tc(),C=x==="horizontal"?"vertical":"horizontal";jn(()=>{const E=h.current;if(E!==null){const O={disabled:u.disabled,disableDoubleClick:u.disableDoubleClick,element:E,id:l},I=S(O),N=Pw(M=>{y(M.next.state!=="inactive"&&M.next.hitRegions.some(z=>z.separator===O)?M.next.state:"inactive")}),D=Ka(w,M=>{const{derivedPanelConstraints:z,layout:_,separatorToPanels:A}=M.next,F=A.get(O);if(F){const T=F[0],L=F.indexOf(T);p(Jw({layout:_,panelConstraints:z,panelId:T.id,panelIndex:L}))}});return()=>{N(),D(),I()}}},[w,l,S,u]),c.useEffect(()=>{R(l,{disabled:n,disableDoubleClick:o})},[n,o,l,R]);let k;n&&!v&&(k="not-allowed");let P;if(n)P="disabled";else switch(f){case"active":{P="active";break}default:m?P="focus":P=f}return K.jsx("div",{...a,"aria-controls":d.valueControls,"aria-disabled":n||void 0,"aria-orientation":C,"aria-valuemax":d.valueMax,"aria-valuemin":d.valueMin,"aria-valuenow":d.valueNow,children:e,className:t,"data-separator":P,"data-testid":l,id:l,onBlur:()=>g(!1),onFocus:()=>g(!0),ref:b,role:"separator",style:{flexBasis:"auto",cursor:k,...i,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}eS.displayName="Separator";const Mp=c.createContext(void 0);function tS(){const e=c.useContext(Mp);if(e===void 0)throw new Error(De(63));return e}const Pp={...vs,checked(e){return e?{"data-checked":""}:{"data-unchecked":""}}},wE=c.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s,"aria-labelledby":i,form:a,id:l,inputRef:u,name:d,nativeButton:p=!1,onCheckedChange:f,readOnly:y=!1,required:m=!1,disabled:g=!1,render:h,uncheckedValue:b,value:v,style:w,...x}=t,{clearErrors:S}=Ss(),{state:R,setTouched:C,setDirty:k,validityData:P,setFilled:E,setFocused:O,validationMode:I,disabled:N,name:D,validation:M}=vo(),{labelId:z}=qo(),_=N||g,A=D??d,F=c.useRef(null),T=Nt(F,u,M.inputRef),L=c.useRef(null),j=tt(),$=ws({id:l,implicit:!1,controlRef:L}),U=p?void 0:$,[q,V]=_t({controlled:o,default:!!s,name:"Switch",state:"checked"});xs(L,j,q,void 0,!_,d),oe(()=>{F.current&&E(F.current.checked)},[E]),bs(q,()=>{S(A),k(q!==P.initialValue),E(q),M.change(q)});const{getButtonProps:Q,buttonRef:H}=Tt({disabled:_,native:p}),G=Qf(i,z,F,!p,U),ue={id:p?$:j,role:"switch","aria-checked":q,"aria-readonly":y||void 0,"aria-required":m||void 0,"aria-labelledby":G,onFocus(){_||O(!0)},onBlur(){const ee=F.current;!ee||_||(C(!0),O(!1),I==="onBlur"&&M.commit(ee.checked))},onClick(ee){if(y||_)return;ee.preventDefault();const ie=F.current;ie&&Qn(ie,ee)}},ne={...M.getValidationProps(_),checked:q,disabled:_,form:a,id:U,name:A,required:m,style:A?oa:Bo,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:T,onChange(ee){if(ee.nativeEvent.defaultPrevented)return;if(y){ee.preventDefault();return}const ie=ee.currentTarget.checked,xe=ke(Rt,ee.nativeEvent);f==null||f(ie,xe),!xe.isCanceled&&V(ie)},onClick(ee){ee.stopPropagation()},onFocus(){var ee;(ee=L.current)==null||ee.focus()},...v!==void 0?{value:v}:We},te=c.useMemo(()=>({...R,checked:q,disabled:_,readOnly:y,required:m}),[R,q,_,y,m]),J=Se("span",t,{state:te,ref:[n,L,H],props:[ue,x,Q,ee=>M.getValidationProps(_,ee)],stateAttributesMapping:Pp});return K.jsxs(Mp.Provider,{value:te,children:[J,!q&&A&&b!==void 0&&K.jsx("input",{type:"hidden",form:a,name:A,value:b,disabled:_}),K.jsx("input",{...ne,suppressHydrationWarning:!0})]})}),SE=c.forwardRef(function(t,n){const{render:o,className:r,style:s,...i}=t,a=tS();return Se("span",t,{state:a,ref:n,stateAttributesMapping:Pp,props:i})});export{nR as $,lR as A,$S as B,xS as C,xk as D,qS as E,aR as F,fR as G,RR as H,yS as I,Fk as J,PR as K,OR as L,qR as M,dR as N,HR as O,ck as P,gk as Q,hk as R,yk as S,Nk as T,hR as U,vS as V,HS as W,Xk as X,Yk as Y,Qk as Z,VS as _,cR as a,xC as a$,bS as a0,KR as a1,fS as a2,IR as a3,qk as a4,uk as a5,wE as a6,SE as a7,KS as a8,ZS as a9,XR as aA,CR as aB,iC as aC,dC as aD,Jb as aE,pC as aF,aC as aG,rC as aH,hC as aI,cC as aJ,lC as aK,fC as aL,sC as aM,nC as aN,uC as aO,oC as aP,vR as aQ,Ck as aR,Kk as aS,RC as aT,gC as aU,mC as aV,yC as aW,wC as aX,bC as aY,SC as aZ,vC as a_,Gk as aa,Uk as ab,WS as ac,LR as ad,Bk as ae,nk as af,ES as ag,LS as ah,QS as ai,dS as aj,ak,iR as al,xR as am,Vk as an,NR as ao,FR as ap,zk as aq,Rk as ar,VR as as,PS as at,_R as au,rS as av,tC as aw,s0 as ax,Jk as ay,eC as az,fk as b,mE as b$,CC as b0,kC as b1,MC as b2,EC as b3,wS as b4,PC as b5,_C as b6,OC as b7,AC as b8,DC as b9,YC as bA,lk as bB,Ak as bC,bk as bD,CS as bE,ZC as bF,QC as bG,JC as bH,eE as bI,nE as bJ,tE as bK,rR as bL,ik as bM,ok as bN,oE as bO,rE as bP,aE as bQ,sE as bR,iE as bS,dE as bT,fE as bU,cE as bV,lE as bW,uE as bX,pE as bY,hE as bZ,gE as b_,NC as ba,IC as bb,TC as bc,$v as bd,US as be,St as bf,LC as bg,Pr as bh,Rs as bi,zC as bj,VC as bk,$C as bl,HC as bm,of as bn,sk as bo,oR as bp,WC as bq,jC as br,BC as bs,ER as bt,rk as bu,GC as bv,XC as bw,UC as bx,KC as by,qC as bz,XS as c,kR as c0,GR as c1,wR as c2,FS as c3,MS as c4,GS as c5,RS as c6,sS as c7,Wk as c8,OS as c9,JR as cA,YS as cB,QR as cC,eS as cD,Zw as cE,Xw as cF,TS as cG,cS as cH,hS as cI,DR as cJ,NS as cK,$k as cL,jk as cM,Hk as cN,_S as cO,gR as cP,mR as cQ,WR as cR,aS as cS,lS as cT,pk as cU,IS as cV,tk as cW,Lk as cX,kk as cY,AR as cZ,yE as ca,bE as cb,zS as cc,DS as cd,YR as ce,SR as cf,tR as cg,eR as ch,pR as ci,Ek as cj,xE as ck,vE as cl,AS as cm,pS as cn,UR as co,dk as cp,mk as cq,jR as cr,iS as cs,$R as ct,MR as cu,sR as cv,uS as cw,mS as cx,yR as cy,Sk as cz,vk as d,Tk as e,zR as f,Zk as g,Ik as h,bR as i,_k as j,JS as k,BR as l,jS as m,TR as n,uR as o,gS as p,ek as q,Mk as r,kS as s,SS as t,ZR as u,wk as v,Pk as w,Ok as x,Dk as y,BS as z};
|
package/dist/web/index.html
CHANGED
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
.dark body { background: #09090b; color: #fafafa; }
|
|
16
16
|
body { background: #fafafa; color: #09090b; }
|
|
17
17
|
</style>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-DFiPbdIb.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-gGw_S5I_.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-ui-DUTyrBOX.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/vendor-markdown-BE1gYnO9.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/vendor-shiki-DOn6sF-i.js">
|
|
23
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
23
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CWj7TiFf.css">
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
|
26
26
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{r as s,j as e}from"./vendor-react-gGw_S5I_.js";import{w as V,a0 as wt,a1 as Ct,B as w,l as Q,a2 as I,m as Nt,I as St,n as kt,Y as Xe,Z as le,q as Et,a3 as re,E as z,y as $,z as P,G,H,a4 as Dt,_ as Ye,a5 as Rt,a6 as Ft,D as Lt,h as Tt,i as Mt,j as Ut,k as At,a7 as It,a8 as zt,a9 as $t,aa as Pt,ab as Gt,ac as Ht,ad as Kt,ae as Ot,af as Wt,ag as Bt,Q as Xt}from"./index-D6p4gVB_.js";import{H as Yt}from"./HighlightedEditor-D0TDZx8S.js";import{h as Ve,X as Vt,G as Qt,S as qt,b as Qe,i as be,j as qe,k as Jt,l as ve}from"./vendor-ui-RwWl1mlR.js";import"./vendor-shiki-DOn6sF-i.js";import"./vendor-markdown-BE1gYnO9.js";const we=520,Zt=760,Je="cogpit-project-files-width",_t={"?":{label:"Untracked",className:"text-info"},A:{label:"Added",className:"text-success"},M:{label:"Modified",className:"text-warning"},D:{label:"Deleted",className:"text-destructive"},R:{label:"Renamed",className:"text-info"},C:{label:"Copied",className:"text-info"},U:{label:"Conflicted",className:"text-destructive"}};function ye(r){const x=r.workTreeStatus.trim()||r.indexStatus.trim();return _t[x]??{label:"Changed",className:"text-muted-foreground"}}function es(){try{const r=Number(localStorage.getItem(Je));if(Number.isFinite(r)&&r>=we)return r}catch{}return Zt}async function q(r,x){try{const u=await r.json();if(u&&typeof u=="object"&&typeof u.error=="string")return u.error}catch{}return x}function ts(r){return r<1024?`${r} B`:`${(r/1024).toFixed(r<10*1024?1:0)} KB`}function ss(r,x){let u=0;for(let m=1;m<x;m+=1){const S=r.indexOf(`
|
|
2
|
-
`,u);if(S<0)return u;u=S+1}return u}function cs({cwd:r,onClose:x,onAddToPrompt:u,openRequest:m,embedded:S=!1}){const Ce=s.useRef(null),oe=s.useRef(null),ce=s.useRef(null),k=s.useRef(null),[J,Ze]=s.useState(es),Ne=s.useRef(J),[K,_e]=s.useState(""),[Se,ke]=s.useState([]),[et,Ee]=s.useState(!0),[tt,De]=s.useState(null),[de,st]=s.useState(0),[Re,nt]=s.useState(!1),[at,it]=s.useState(0),ue=s.useRef(!1),[a,Fe]=s.useState(null),[f,E]=s.useState(""),[lt,O]=s.useState(""),[b,W]=s.useState(null),[rt,Le]=s.useState(0),[D,Te]=s.useState(!1),[R,Me]=s.useState(!1),[Ue,F]=s.useState(null),[ot,L]=s.useState(!1),[p,fe]=s.useState("all"),[o,Ae]=s.useState(null),[Ie,ze]=s.useState(!1),[ct,$e]=s.useState(null),[c,Z]=s.useState("edit"),[d,_]=s.useState(null),[B,Pe]=s.useState(!1),[Ge,he]=s.useState(null),[X,C]=s.useState(null),[v,ee]=s.useState(null),[te,xe]=s.useState(""),[y,Y]=s.useState(null),h=a!==null&&f!==lt,g=s.useMemo(()=>new Map(((o==null?void 0:o.files)??[]).flatMap(t=>[[t.path,t],...t.originalPath?[[t.originalPath,t]]:[]])),[o==null?void 0:o.files]),T=s.useCallback(async()=>{ze(!0),$e(null);try{const t=await V(`/api/git-status?cwd=${encodeURIComponent(r)}`);if(!t.ok)throw new Error(await q(t,"Unable to read git status"));const n=await t.json();Ae(n),n.isRepository||fe("all")}catch(t){Ae(null),fe("all"),$e(t instanceof Error?t.message:"Unable to read git status")}finally{ze(!1)}},[r]);s.useEffect(()=>{T()},[T]),s.useEffect(()=>{const t=new AbortController,n=window.setTimeout(async()=>{Ee(!0),De(null);const i=ue.current;ue.current=!1;try{const l=await V(`/api/project-files?cwd=${encodeURIComponent(r)}&q=${encodeURIComponent(K)}&limit=100${i?"&refresh=1":""}`,{signal:t.signal});if(!l.ok)throw new Error(await q(l,"Unable to list project files"));const j=await l.json();if(t.signal.aborted)return;const A=wt(j),ie=j.totalMatches;ke(A),st(typeof ie=="number"?ie:A.length),nt(j.scanLimited===!0)}catch(l){t.signal.aborted||(ke([]),De(l instanceof Error?l.message:"Unable to list project files"))}finally{t.signal.aborted||Ee(!1)}},120);return()=>{window.clearTimeout(n),t.abort()}},[r,K,at]),s.useEffect(()=>{Fe(null),E(""),O(""),W(null),F(null),C(null),Z("edit"),_(null),he(null),Y(null)},[r]),s.useEffect(()=>{if(!h)return;const t=n=>n.preventDefault();return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[h]);const dt=s.useCallback((t,n)=>{const i=oe.current;if(!i)return;if(!n||n<1){i.focus();return}const l=ss(t,n);i.blur(),i.setSelectionRange(l,l),i.focus()},[]);s.useEffect(()=>{const t=ce.current;!t||!oe.current||(ce.current=null,dt(t.text,t.line))});const M=s.useCallback(async(t,n)=>{Te(!0),F(null),L(!1),C(null);try{const i=await V(`/api/project-file?cwd=${encodeURIComponent(r)}&path=${encodeURIComponent(t)}`);if(!i.ok)throw new Error(await q(i,"Unable to open file"));const l=await i.json();E(l.content),O(l.content),W(l.mtimeMs),Le(l.size),ce.current={text:l.content,line:n}}catch(i){E(""),O(""),W(null),F(i instanceof Error?i.message:"Unable to open file")}finally{Te(!1)}},[r]),U=s.useCallback(async(t,n)=>{Pe(!0),he(null),_(null);try{const i=n?`&originalPath=${encodeURIComponent(n)}`:"",l=await V(`/api/git-diff?cwd=${encodeURIComponent(r)}&path=${encodeURIComponent(t)}${i}`);if(!l.ok)throw new Error(await q(l,"Unable to diff file"));_(await l.json())}catch(i){he(i instanceof Error?i.message:"Unable to diff file")}finally{Pe(!1)}},[r]),se=s.useCallback(({path:t,mode:n,line:i})=>{var l;if(Fe(t),Z(n),n==="edit"){M(t,i);return}E(""),O(""),W(null),F(null),L(!1),C(null),U(t,(l=g.get(t))==null?void 0:l.originalPath)},[g,U,M]),ne=s.useCallback(t=>{if(h){Y({type:"file",target:t});return}se(t)},[h,se]),ut=s.useCallback(t=>{if(t===a)return;const n=p==="changes"&&g.has(t)?"diff":"edit";ne({path:t,mode:n})},[g,p,ne,a]),He=s.useRef(0);s.useEffect(()=>{!m||m.token===He.current||(He.current=m.token,ne({path:m.file,mode:m.mode,line:m.line}))},[m,ne]);const ft=s.useCallback(()=>{var t;!a||c==="diff"||(Z("diff"),(d==null?void 0:d.path)!==a&&!B&&U(a,(t=g.get(a))==null?void 0:t.originalPath))},[g,d==null?void 0:d.path,B,U,a,c]),ht=s.useCallback(()=>{!a||c==="edit"||(Z("edit"),b===null&&!D&&M(a))},[D,M,b,a,c]),me=s.useCallback(()=>{var t;if(a){if(c==="diff"){U(a,(t=g.get(a))==null?void 0:t.originalPath);return}M(a)}},[g,U,M,a,c]),xt=s.useCallback(()=>{ue.current=!0,it(t=>t+1),T(),c==="diff"&&me()},[T,me,c]),pe=s.useCallback(async()=>{if(!(!a||b===null||!h||R)){Me(!0),F(null),L(!1);try{const t=await V("/api/project-file",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,path:a,content:f,expectedMtimeMs:b})});if(!t.ok)throw new Error(await q(t,"Unable to save file"));const n=await t.json();O(f),W(n.mtimeMs),Le(n.size),L(!0),_(null),T()}catch(t){F(t instanceof Error?t.message:"Unable to save file")}finally{Me(!1)}}},[f,r,h,T,b,R,a]);s.useEffect(()=>{function t(n){var i;(i=Ce.current)!=null&&i.contains(document.activeElement)&&Xt("projectFileSave",n)&&(n.preventDefault(),pe())}return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[pe]);const mt=s.useCallback(()=>{if(h){Y({type:"close"});return}x()},[h,x]),pt=s.useCallback(()=>{if(!y)return;const t=y;if(Y(null),t.type==="file"){se(t.target);return}x()},[x,se,y]),gt=s.useCallback(t=>{if(t.key!=="Tab")return;t.preventDefault();const n=t.currentTarget,i=n.selectionStart,l=n.selectionEnd,j=`${f.slice(0,i)} ${f.slice(l)}`;E(j),L(!1),C(null),requestAnimationFrame(()=>{n.selectionStart=i+2,n.selectionEnd=i+2})},[f]),jt=s.useCallback(t=>{const n=t.currentTarget;if(n.selectionStart===n.selectionEnd){C(null);return}const i=f.slice(n.selectionStart,n.selectionEnd),l=f.slice(0,n.selectionStart).split(`
|
|
3
|
-
`).length,j=l+i.split(`
|
|
4
|
-
`).length-1;C({text:i,startLine:l,endLine:j})},[f]),bt=s.useCallback(t=>{t.preventDefault(),k.current={startX:t.clientX,startWidth:J},t.currentTarget.setPointerCapture(t.pointerId)},[J]),vt=s.useCallback(t=>{if(!k.current)return;const n=Math.max(we,window.innerWidth*.9),i=k.current.startWidth+(k.current.startX-t.clientX),l=Math.min(n,Math.max(we,i));Ne.current=l,Ze(l)},[]),Ke=s.useCallback(()=>{if(k.current){k.current=null;try{localStorage.setItem(Je,String(Ne.current))}catch{}}},[]),ge=s.useMemo(()=>(a==null?void 0:a.split("/").at(-1))??null,[a]),ae=a?g.get(a):void 0,je=s.useMemo(()=>d&&!d.binary&&!d.tooLarge?Ct(d.original??"",d.current??""):null,[d]),N=s.useMemo(()=>{if(p==="all")return Se;const t=K.trim().toLowerCase();return((o==null?void 0:o.files)??[]).map(n=>n.path).filter((n,i,l)=>l.indexOf(n)===i).filter(n=>!t||n.toLowerCase().includes(t)).sort((n,i)=>n.localeCompare(i))},[p,Se,o==null?void 0:o.files,K]),Oe=s.useMemo(()=>a&&!N.includes(a)?[a,...N]:N,[N,a]),yt=p==="changes"?Ie:et,We=p==="changes"?ct:tt,Be=Ie;return e.jsxs("aside",{ref:Ce,"aria-label":"Project files",className:Ye("relative flex min-h-0 flex-col bg-background",S?"size-full":"view-transition-right-panel panel-enter-right shrink-0 border-l"),style:S?void 0:{width:J},children:[!S&&e.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0 left-0 w-1 cursor-col-resize hover:bg-accent",onPointerDown:bt,onPointerMove:vt,onPointerUp:Ke,onPointerCancel:Ke}),e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[e.jsx(Ve,{"data-icon":"inline-start","aria-hidden":"true",className:"size-4 text-muted-foreground"}),e.jsx("h2",{className:"text-sm font-medium",children:"Project files"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",title:r,children:r}),e.jsx(w,{variant:"ghost",size:"icon-sm",onClick:mt,"aria-label":"Close project files",children:e.jsx(Vt,{"data-icon":"inline-start"})})]}),e.jsx(Q,{}),(o==null?void 0:o.isRepository)&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-8 shrink-0 items-center gap-2 px-3 text-xs text-muted-foreground",children:[e.jsx(Qt,{"data-icon":"inline-start","aria-hidden":"true",className:"size-3.5"}),e.jsx("span",{className:"max-w-40 truncate font-mono text-foreground",title:o.branch??"Detached HEAD",children:o.branch??"detached HEAD"}),o.upstream&&e.jsxs("span",{className:"truncate",children:["tracks ",o.upstream]}),(o.ahead??0)>0&&e.jsxs(I,{variant:"outline",children:["↑ ",o.ahead]}),(o.behind??0)>0&&e.jsxs(I,{variant:"outline",children:["↓ ",o.behind]}),e.jsx("span",{className:"flex-1"}),e.jsxs("span",{children:[o.files.length," changed"]})]}),e.jsx(Q,{})]}),e.jsxs("div",{className:"flex min-h-0 flex-1",children:[e.jsxs("section",{"aria-label":"File browser",className:"flex w-56 shrink-0 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-2 p-2",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs(Nt,{className:"min-w-0 flex-1",children:[e.jsx(St,{children:e.jsx(qt,{"data-icon":"inline-start"})}),e.jsx(kt,{"aria-label":"Search project files",value:K,onChange:t=>_e(t.target.value),placeholder:"Filter files…",spellCheck:!1})]}),e.jsx(w,{variant:"ghost",size:"icon-sm",disabled:Be,onClick:xt,"aria-label":"Refresh files and git status",title:"Refresh files and git status",children:e.jsx(Qe,{"data-icon":"inline-start",className:Be?"animate-spin":void 0})})]}),(o==null?void 0:o.isRepository)&&e.jsxs(Xe,{"aria-label":"File scope",value:[p],onValueChange:t=>{const n=t[0];(n==="all"||n==="changes")&&fe(n)},variant:"outline",size:"sm",spacing:0,className:"w-full",children:[e.jsx(le,{value:"all",className:"flex-1",children:"All files"}),e.jsx(le,{value:"changes",className:"flex-1",children:"Changes"})]})]}),e.jsx(Q,{}),e.jsx(Et,{className:"min-h-0 flex-1",children:yt?e.jsxs("div",{className:"flex items-center justify-center gap-2 p-6 text-xs text-muted-foreground",role:"status",children:[e.jsx(re,{}),"Loading files…"]}):We?e.jsx(z,{className:"min-h-48 rounded-none p-4",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(be,{})}),e.jsx(G,{children:"Could not load files"}),e.jsx(H,{children:We})]})}):Oe.length===0?e.jsx(z,{className:"min-h-48 rounded-none p-4",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(Ve,{})}),e.jsx(G,{children:p==="changes"?"No working-tree changes":"No matching files"}),e.jsx(H,{children:p==="changes"?"This project has no changed files matching the filter.":"Try a different path or filename."})]})}):e.jsxs("div",{className:"flex flex-col py-1",children:[Oe.map(t=>{const n=t.split("/").at(-1)??t,i=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",l=g.get(t),j=l?`${l.indexStatus}${l.workTreeStatus}`.trim()||"?":null,A=l?ye(l):null,ie=Dt(t);return e.jsxs(w,{variant:a===t?"secondary":"ghost",size:"sm",className:"h-auto w-full justify-start rounded-none px-2 py-1.5 text-left",onClick:()=>ut(t),title:t,children:[e.jsx(ie,{"data-icon":"inline-start",className:"text-muted-foreground"}),e.jsxs("span",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"block truncate text-xs",children:n}),i&&e.jsx("span",{className:"block truncate font-mono text-xs text-muted-foreground",children:i})]}),j&&A&&e.jsx(I,{variant:"outline",className:Ye("font-mono",A.className),title:A.label,children:j})]},t)}),p==="all"&&(de>N.length||Re)&&e.jsxs("p",{className:"px-3 py-2 text-xs text-muted-foreground",children:[de>N.length&&`Showing ${N.length} of ${de} matches. Type to narrow the list. `,Re&&"This project is too large to scan completely."]})]})})]}),e.jsx(Q,{orientation:"vertical"}),e.jsx("section",{"aria-label":"File editor",className:"flex min-w-0 flex-1 flex-col",children:a?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-2 px-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"truncate text-xs font-medium",title:a,children:ge}),e.jsx("p",{className:"truncate font-mono text-xs text-muted-foreground",children:a})]}),(ae||c==="diff")&&e.jsxs(Xe,{"aria-label":"File view",value:[c],onValueChange:t=>{t[0]==="diff"?ft():t[0]==="edit"&&ht()},variant:"outline",size:"sm",spacing:0,children:[e.jsx(le,{value:"diff",children:"Diff"}),e.jsx(le,{value:"edit",children:"Edit"})]}),c==="diff"&&ae&&e.jsx(I,{variant:"outline",className:ye(ae).className,children:ye(ae).label}),c==="diff"&&je&&e.jsx(Rt,{add:je.add,del:je.del}),c==="edit"&&h&&e.jsx(I,{variant:"outline",children:"Unsaved"}),c==="edit"&&!h&&ot&&e.jsx(I,{variant:"secondary",children:"Saved"}),c==="edit"&&b!==null&&e.jsx("span",{className:"text-xs text-muted-foreground",children:ts(rt)}),u&&e.jsxs(w,{variant:"outline",size:"sm",disabled:c==="diff"?B||d===null:D||b===null,onClick:()=>{X?(xe(""),ee(X)):u({path:a})},"aria-label":X?"Add selected lines to prompt":"Reference file in prompt",title:X?"Add selected lines to prompt":"Reference file in prompt",children:[e.jsx(qe,{"data-icon":"inline-start"}),X?"Add selection":"Reference"]}),e.jsx(w,{variant:"ghost",size:"icon-sm",disabled:c==="diff"?B:D||R,onClick:me,"aria-label":c==="diff"?"Reload diff":"Reload file",title:c==="diff"?"Reload diff":"Reload file",children:e.jsx(Qe,{"data-icon":"inline-start"})}),c==="edit"&&e.jsxs(w,{size:"sm",disabled:!h||D||R||b===null,onClick:()=>void pe(),children:[R?e.jsx(re,{"data-icon":"inline-start"}):e.jsx(Jt,{"data-icon":"inline-start"}),R?"Saving…":"Save"]})]}),e.jsx(Q,{}),c==="edit"&&Ue&&e.jsxs("div",{role:"alert",className:"flex items-center gap-2 px-3 py-2 text-xs text-destructive",children:[e.jsx(be,{"data-icon":"inline-start","aria-hidden":"true",className:"size-4 shrink-0"}),e.jsx("span",{children:Ue})]}),c==="diff"?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:B?e.jsxs("div",{className:"flex size-full items-center justify-center gap-2 text-xs text-muted-foreground",role:"status",children:[e.jsx(re,{}),"Loading diff…"]}):Ge?e.jsx(z,{className:"rounded-none",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(be,{})}),e.jsx(G,{children:"Could not diff this file"}),e.jsx(H,{children:Ge})]})}):d===null?null:d.binary||d.tooLarge?e.jsx(z,{className:"rounded-none",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(ve,{})}),e.jsx(G,{children:d.binary?"Binary file":"File is too large to diff"}),e.jsx(H,{children:d.binary?"Git tracks this change, but there is no text diff to show.":"Review this change in your editor instead."})]})}):d.original===d.current?e.jsx(z,{className:"rounded-none",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(ve,{})}),e.jsx(G,{children:"No content changes"}),e.jsx(H,{children:"This file matches the last commit — only its mode or index entry differs."})]})}):e.jsx("div",{className:"min-h-0 flex-1 overflow-auto",children:e.jsx(Ft,{oldString:d.original??"",newString:d.current??"",filePath:a,compact:!1,hideHeader:!0})})}):e.jsx("div",{className:"flex min-h-0 flex-1 flex-col",children:D?e.jsxs("div",{className:"flex size-full items-center justify-center gap-2 text-xs text-muted-foreground",role:"status",children:[e.jsx(re,{}),"Opening file…"]}):b!==null?e.jsx(Yt,{textareaRef:oe,ariaLabel:`Editing ${a}`,filePath:a,value:f,readOnly:!1,onChange:t=>{E(t),L(!1),C(null)},onKeyDown:gt,onSelect:jt}):null})]}):e.jsx(z,{className:"rounded-none",children:e.jsxs($,{children:[e.jsx(P,{variant:"icon",children:e.jsx(ve,{})}),e.jsx(G,{children:"Select a file"}),e.jsx(H,{children:"Browse or filter project files, then open one to inspect and edit it."})]})})})]}),e.jsx(Lt,{open:v!==null,onOpenChange:t=>{t||ee(null)},children:e.jsxs(Tt,{children:[e.jsxs(Mt,{children:[e.jsx(Ut,{children:"Comment on selected lines"}),e.jsxs(At,{children:["Add a review instruction for ",a," lines ",v==null?void 0:v.startLine,"-",v==null?void 0:v.endLine,"."]})]}),e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:t=>{t.preventDefault();const n=te.trim();!a||!v||!n||!u||(u({path:a,...v,comment:n}),ee(null),xe(""))},children:[e.jsx(It,{autoFocus:!0,"aria-label":"Review comment",value:te,onChange:t=>xe(t.target.value),placeholder:"Describe the change you want…",onKeyDown:t=>{var n;(t.metaKey||t.ctrlKey)&&t.key==="Enter"&&te.trim()&&(t.preventDefault(),(n=t.currentTarget.form)==null||n.requestSubmit())}}),e.jsxs(zt,{children:[e.jsx(w,{type:"button",variant:"outline",onClick:()=>ee(null),children:"Cancel"}),e.jsxs(w,{type:"submit",disabled:!te.trim(),children:[e.jsx(qe,{"data-icon":"inline-start"}),"Add to prompt"]})]})]})]})}),e.jsx($t,{open:y!==null,onOpenChange:t=>{t||Y(null)},children:e.jsxs(Pt,{size:"sm",children:[e.jsxs(Gt,{children:[e.jsx(Ht,{children:"Discard unsaved changes?"}),e.jsx(Kt,{children:(y==null?void 0:y.type)==="file"?`Your edits to ${ge??"this file"} will be lost when you open ${y.target.path}.`:`Your edits to ${ge??"this file"} will be lost when you close the file workspace.`})]}),e.jsxs(Ot,{children:[e.jsx(Wt,{size:"sm",children:"Keep editing"}),e.jsx(Bt,{variant:"destructive",size:"sm",onClick:pt,children:"Discard changes"})]})]})})]})}export{cs as ProjectFilesPanel};
|