@clawos-dev/clawd 0.2.311 → 0.2.313
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.cjs +1 -1
- package/dist/share-md-viewer-error.html +1 -1
- package/dist/share-md-viewer.html +1 -1
- package/dist/share-ui/assets/{guest-C1vK3q3h.css → guest-C9uDSkcF.css} +1 -1
- package/dist/share-ui/assets/{guest-DK5TSsZ7.js → guest-WSJ3n_b6.js} +1 -1
- package/dist/share-ui/guest.html +2 -2
- package/package.json +1 -1
|
@@ -492,7 +492,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
492
492
|
`)},qw=function(){var e=parseInt(document.body.getAttribute(ka)||"0",10);return isFinite(e)?e:0},U9=function(){g.useEffect(function(){return document.body.setAttribute(ka,(qw()+1).toString()),function(){var e=qw()-1;e<=0?document.body.removeAttribute(ka):document.body.setAttribute(ka,e.toString())}},[])},W9=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;U9();var s=g.useMemo(function(){return $9(i)},[i]);return g.createElement(F9,{styles:H9(s,!t,i,n?"":"!important")})},o0=!1;if(typeof window<"u")try{var pd=Object.defineProperty({},"passive",{get:function(){return o0=!0,!0}});window.addEventListener("test",pd,pd),window.removeEventListener("test",pd,pd)}catch{o0=!1}var Vo=o0?{passive:!1}:!1,V9=function(e){return e.tagName==="TEXTAREA"},UP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!V9(e)&&n[t]==="visible")},q9=function(e){return UP(e,"overflowY")},K9=function(e){return UP(e,"overflowX")},Kw=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=WP(e,r);if(i){var s=VP(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},G9=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},X9=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},WP=function(e,t){return e==="v"?q9(t):K9(t)},VP=function(e,t){return e==="v"?G9(t):X9(t)},Y9=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z9=function(e,t,n,r,i){var s=Y9(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),c=!1,u=o>0,d=0,f=0;do{if(!a)break;var p=VP(e,a),m=p[0],v=p[1],b=p[2],x=v-b-s*m;(m||x)&&WP(e,a)&&(d+=x,f+=m);var _=a.parentNode;a=_&&_.nodeType===Node.DOCUMENT_FRAGMENT_NODE?_.host:_}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(d)<1||!u&&Math.abs(f)<1)&&(c=!0),c},md=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gw=function(e){return[e.deltaX,e.deltaY]},Xw=function(e){return e&&"current"in e?e.current:e},Q9=function(e,t){return e[0]===t[0]&&e[1]===t[1]},J9=function(e){return`
|
|
493
493
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
494
494
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
495
|
-
`)},e7=0,qo=[];function t7(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(e7++)[0],s=g.useState(HP)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=w9([e.lockRef.current],(e.shards||[]).map(Xw),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var x=md(v),_=n.current,y="deltaX"in v?v.deltaX:_[0]-x[0],w="deltaY"in v?v.deltaY:_[1]-x[1],S,C=v.target,N=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&N==="h"&&C.type==="range")return!1;var T=window.getSelection(),M=T&&T.anchorNode,P=M?M===C||M.contains(C):!1;if(P)return!1;var D=Kw(N,C);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=Kw(N,C)),!D)return!1;if(!r.current&&"changedTouches"in v&&(y||w)&&(r.current=S),!S)return!0;var R=r.current||S;return Z9(R,b,v,R==="h"?y:w)},[]),l=g.useCallback(function(v){var b=v;if(!(!qo.length||qo[qo.length-1]!==s)){var x="deltaY"in b?Gw(b):md(b),_=t.current.filter(function(S){return S.name===b.type&&(S.target===b.target||b.target===S.shadowParent)&&Q9(S.delta,x)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var y=(o.current.shards||[]).map(Xw).filter(Boolean).filter(function(S){return S.contains(b.target)}),w=y.length>0?a(b,y[0]):!o.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),c=g.useCallback(function(v,b,x,_){var y={name:v,delta:b,target:x,should:_,shadowParent:n7(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),u=g.useCallback(function(v){n.current=md(v),r.current=void 0},[]),d=g.useCallback(function(v){c(v.type,Gw(v),v.target,a(v,e.lockRef.current))},[]),f=g.useCallback(function(v){c(v.type,md(v),v.target,a(v,e.lockRef.current))},[]);g.useEffect(function(){return qo.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Vo),document.addEventListener("touchmove",l,Vo),document.addEventListener("touchstart",u,Vo),function(){qo=qo.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Vo),document.removeEventListener("touchmove",l,Vo),document.removeEventListener("touchstart",u,Vo)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(s,{styles:J9(i)}):null,p?g.createElement(W9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function n7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r7=R9(FP,t7);var H_=g.forwardRef(function(e,t){return g.createElement(sp,Xr({},e,{ref:t,sideCar:r7}))});H_.classNames=sp.classNames;var a0=["Enter"," "],i7=["ArrowDown","PageUp","Home"],qP=["ArrowUp","PageDown","End"],s7=[...i7,...qP],o7={ltr:[...a0,"ArrowRight"],rtl:[...a0,"ArrowLeft"]},a7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_u="Menu",[qc,l7,c7]=eP(_u),[Mo,KP]=Ro(_u,[c7,ip,MP]),op=ip(),GP=MP(),[u7,Ao]=Mo(_u),[d7,yu]=Mo(_u),XP=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=op(t),[l,c]=g.useState(null),u=g.useRef(!1),d=ji(s),f=tP(i);return g.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.jsx(NP,{...a,children:h.jsx(u7,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(d7,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};XP.displayName=_u;var h7="MenuAnchor",U_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=op(n);return h.jsx(TP,{...i,...r,ref:t})});U_.displayName=h7;var W_="MenuPortal",[f7,YP]=Mo(W_,{forceMount:void 0}),ZP=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Ao(W_,t);return h.jsx(f7,{scope:t,forceMount:n,children:h.jsx(Hi,{present:n||s.open,children:h.jsx(F_,{asChild:!0,container:i,children:r})})})};ZP.displayName=W_;var xr="MenuContent",[p7,V_]=Mo(xr),QP=g.forwardRef((e,t)=>{const n=YP(xr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ao(xr,e.__scopeMenu),o=yu(xr,e.__scopeMenu);return h.jsx(qc.Provider,{scope:e.__scopeMenu,children:h.jsx(Hi,{present:r||s.open,children:h.jsx(qc.Slot,{scope:e.__scopeMenu,children:o.modal?h.jsx(m7,{...i,ref:t}):h.jsx(g7,{...i,ref:t})})})})}),m7=g.forwardRef((e,t)=>{const n=Ao(xr,e.__scopeMenu),r=g.useRef(null),i=qt(t,r);return g.useEffect(()=>{const s=r.current;if(s)return BP(s)},[]),h.jsx(q_,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),g7=g.forwardRef((e,t)=>{const n=Ao(xr,e.__scopeMenu);return h.jsx(q_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),v7=Wc("MenuContent.ScrollLock"),q_=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,b=Ao(xr,n),x=yu(xr,n),_=op(n),y=GP(n),w=l7(n),[S,C]=g.useState(null),N=g.useRef(null),T=qt(t,N,b.onContentChange),M=g.useRef(0),P=g.useRef(""),D=g.useRef(0),R=g.useRef(null),I=g.useRef("right"),O=g.useRef(0),z=m?H_:g.Fragment,$=m?{as:v7,allowPinchZoom:!0}:void 0,F=B=>{var pe,Oe;const E=P.current+B,H=w().filter(ie=>!ie.disabled),q=document.activeElement,A=(pe=H.find(ie=>ie.ref.current===q))==null?void 0:pe.textValue,re=H.map(ie=>ie.textValue),oe=P7(re,E,A),V=(Oe=H.find(ie=>ie.textValue===oe))==null?void 0:Oe.ref.current;(function ie(Ae){P.current=Ae,window.clearTimeout(M.current),Ae!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(E),V&&setTimeout(()=>V.focus())};g.useEffect(()=>()=>window.clearTimeout(M.current),[]),iP();const L=g.useCallback(B=>{var H,q;return I.current===((H=R.current)==null?void 0:H.side)&&R7(B,(q=R.current)==null?void 0:q.area)},[]);return h.jsx(p7,{scope:n,searchRef:P,onItemEnter:g.useCallback(B=>{L(B)&&B.preventDefault()},[L]),onItemLeave:g.useCallback(B=>{var E;L(B)||((E=N.current)==null||E.focus(),C(null))},[L]),onTriggerLeave:g.useCallback(B=>{L(B)&&B.preventDefault()},[L]),pointerGraceTimerRef:D,onPointerGraceIntentChange:g.useCallback(B=>{R.current=B},[]),children:h.jsx(z,{...$,children:h.jsx(M_,{asChild:!0,trapped:i,onMountAutoFocus:Pe(s,B=>{var E;B.preventDefault(),(E=N.current)==null||E.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(v9,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Pe(l,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(PP,{role:"menu","aria-orientation":"vertical","data-state":pI(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:Pe(v.onKeyDown,B=>{const H=B.target.closest("[data-radix-menu-content]")===B.currentTarget,q=B.ctrlKey||B.altKey||B.metaKey,A=B.key.length===1;H&&(B.key==="Tab"&&B.preventDefault(),!q&&A&&F(B.key));const re=N.current;if(B.target!==re||!s7.includes(B.key))return;B.preventDefault();const V=w().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);qP.includes(B.key)&&V.reverse(),N7(V)}),onBlur:Pe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(M.current),P.current="")}),onPointerMove:Pe(e.onPointerMove,Kc(B=>{const E=B.target,H=O.current!==B.clientX;if(B.currentTarget.contains(E)&&H){const q=B.clientX>O.current?"right":"left";I.current=q,O.current=B.clientX}}))})})})})})})});QP.displayName=xr;var x7="MenuGroup",K_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"group",...r,ref:t})});K_.displayName=x7;var _7="MenuLabel",JP=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{...r,ref:t})});JP.displayName=_7;var Qh="MenuItem",Yw="menu.itemSelect",ap=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=g.useRef(null),o=yu(Qh,e.__scopeMenu),a=V_(Qh,e.__scopeMenu),l=qt(t,s),c=g.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Yw,{bubbles:!0,cancelable:!0});d.addEventListener(Yw,p=>r==null?void 0:r(p),{once:!0}),JT(d,f),f.defaultPrevented?c.current=!1:o.onClose()}};return h.jsx(eI,{...i,ref:l,disabled:n,onClick:Pe(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:Pe(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Pe(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||a0.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ap.displayName=Qh;var eI=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=V_(Qh,n),a=GP(n),l=g.useRef(null),c=qt(t,l),[u,d]=g.useState(!1),[f,p]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[s.children]),h.jsx(qc.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(x9,{asChild:!0,...a,focusable:!r,children:h.jsx(Et.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:Pe(e.onPointerMove,Kc(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,Kc(m=>o.onItemLeave(m))),onFocus:Pe(e.onFocus,()=>d(!0)),onBlur:Pe(e.onBlur,()=>d(!1))})})})}),y7="MenuCheckboxItem",tI=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(oI,{scope:e.__scopeMenu,checked:n,children:h.jsx(ap,{role:"menuitemcheckbox","aria-checked":Jh(n)?"mixed":n,...i,ref:t,"data-state":X_(n),onSelect:Pe(i.onSelect,()=>r==null?void 0:r(Jh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tI.displayName=y7;var nI="MenuRadioGroup",[b7,w7]=Mo(nI,{value:void 0,onValueChange:()=>{}}),rI=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=ji(r);return h.jsx(b7,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(K_,{...i,ref:t})})});rI.displayName=nI;var iI="MenuRadioItem",sI=g.forwardRef((e,t)=>{const{value:n,...r}=e,i=w7(iI,e.__scopeMenu),s=n===i.value;return h.jsx(oI,{scope:e.__scopeMenu,checked:s,children:h.jsx(ap,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":X_(s),onSelect:Pe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});sI.displayName=iI;var G_="MenuItemIndicator",[oI,S7]=Mo(G_,{checked:!1}),aI=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=S7(G_,n);return h.jsx(Hi,{present:r||Jh(s.checked)||s.checked===!0,children:h.jsx(Et.span,{...i,ref:t,"data-state":X_(s.checked)})})});aI.displayName=G_;var k7="MenuSeparator",lI=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});lI.displayName=k7;var C7="MenuArrow",cI=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=op(n);return h.jsx(IP,{...i,...r,ref:t})});cI.displayName=C7;var E7="MenuSub",[Vie,uI]=Mo(E7),Vl="MenuSubTrigger",dI=g.forwardRef((e,t)=>{const n=Ao(Vl,e.__scopeMenu),r=yu(Vl,e.__scopeMenu),i=uI(Vl,e.__scopeMenu),s=V_(Vl,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.jsx(U_,{asChild:!0,...c,children:h.jsx(eI,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":pI(n.open),...e,ref:gu(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,Kc(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Pe(e.onPointerLeave,Kc(d=>{var p,m;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(m=n.content)==null?void 0:m.dataset.side,b=v==="right",x=b?-5:5,_=f[b?"left":"right"],y=f[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:_,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:_,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,d=>{var p;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||o7[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});dI.displayName=Vl;var hI="MenuSubContent",fI=g.forwardRef((e,t)=>{const n=YP(xr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ao(xr,e.__scopeMenu),o=yu(xr,e.__scopeMenu),a=uI(hI,e.__scopeMenu),l=g.useRef(null),c=qt(t,l);return h.jsx(qc.Provider,{scope:e.__scopeMenu,children:h.jsx(Hi,{present:r||s.open,children:h.jsx(qc.Slot,{scope:e.__scopeMenu,children:h.jsx(q_,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:Pe(e.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=a7[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});fI.displayName=hI;function pI(e){return e?"open":"closed"}function Jh(e){return e==="indeterminate"}function X_(e){return Jh(e)?"indeterminate":e?"checked":"unchecked"}function N7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function T7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function P7(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=T7(e,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function I7(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function R7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return I7(n,t)}function Kc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var M7=XP,A7=U_,j7=ZP,L7=QP,D7=K_,O7=JP,B7=ap,z7=tI,$7=rI,F7=sI,H7=aI,U7=lI,W7=cI,V7=dI,q7=fI,lp="DropdownMenu",[K7]=Ro(lp,[KP]),Mn=KP(),[G7,mI]=K7(lp),gI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Mn(t),c=g.useRef(null),[u,d]=Qf({prop:i,defaultProp:s??!1,onChange:o,caller:lp});return h.jsx(G7,{scope:t,triggerId:oo(),triggerRef:c,contentId:oo(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:h.jsx(M7,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};gI.displayName=lp;var vI="DropdownMenuTrigger",xI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=mI(vI,n),o=Mn(n);return h.jsx(A7,{asChild:!0,...o,children:h.jsx(Et.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:gu(t,s.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});xI.displayName=vI;var X7="DropdownMenuPortal",_I=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mn(t);return h.jsx(j7,{...r,...n})};_I.displayName=X7;var yI="DropdownMenuContent",bI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mI(yI,n),s=Mn(n),o=g.useRef(!1);return h.jsx(L7,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bI.displayName=yI;var Y7="DropdownMenuGroup",Z7=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(D7,{...i,...r,ref:t})});Z7.displayName=Y7;var Q7="DropdownMenuLabel",wI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(O7,{...i,...r,ref:t})});wI.displayName=Q7;var J7="DropdownMenuItem",SI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(B7,{...i,...r,ref:t})});SI.displayName=J7;var eH="DropdownMenuCheckboxItem",kI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(z7,{...i,...r,ref:t})});kI.displayName=eH;var tH="DropdownMenuRadioGroup",nH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx($7,{...i,...r,ref:t})});nH.displayName=tH;var rH="DropdownMenuRadioItem",iH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(F7,{...i,...r,ref:t})});iH.displayName=rH;var sH="DropdownMenuItemIndicator",CI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(H7,{...i,...r,ref:t})});CI.displayName=sH;var oH="DropdownMenuSeparator",EI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(U7,{...i,...r,ref:t})});EI.displayName=oH;var aH="DropdownMenuArrow",lH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(W7,{...i,...r,ref:t})});lH.displayName=aH;var cH="DropdownMenuSubTrigger",NI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(V7,{...i,...r,ref:t})});NI.displayName=cH;var uH="DropdownMenuSubContent",TI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(q7,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TI.displayName=uH;var dH=gI,hH=xI,PI=_I,II=bI,RI=wI,MI=SI,AI=kI,fH=CI,jI=EI,LI=NI,DI=TI;const OI=dH,BI=hH,Y_=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(PI,{children:h.jsx(II,{ref:r,sideOffset:t,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-elevated p-1","text-text-100 shadow-md",e),...n})}));Y_.displayName=II.displayName;const pH=g.forwardRef(({className:e,...t},n)=>h.jsx(LI,{ref:n,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-bg-200 focus:text-text-100 data-[state=open]:bg-bg-200","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));pH.displayName=LI.displayName;const mH=g.forwardRef(({className:e,...t},n)=>h.jsx(PI,{children:h.jsx(DI,{ref:n,className:ne("z-50 min-w-[6rem] overflow-hidden rounded-md border border-border bg-elevated p-1","text-text-100 shadow-md",e),...t})}));mH.displayName=DI.displayName;const cs=g.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(MI,{ref:r,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-bg-200 focus:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));cs.displayName=MI.displayName;const gH=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>h.jsxs(AI,{ref:i,checked:n,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-7 pr-2 text-sm outline-none","focus:bg-bg-200 focus:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(fH,{children:h.jsx(ol,{className:"h-3.5 w-3.5"})})}),t]}));gH.displayName=AI.displayName;const zI=g.forwardRef(({className:e,...t},n)=>h.jsx(jI,{ref:n,className:ne("-mx-1 my-1 h-px bg-border",e),...t}));zI.displayName=jI.displayName;const vH=g.forwardRef(({className:e,...t},n)=>h.jsx(RI,{ref:n,className:ne("px-2 py-1.5 text-xs font-semibold text-text-400",e),...t}));vH.displayName=RI.displayName;function xH({iconKey:e,tool:t,className:n}){const r=R_(t),i=YT(e);if(!i)return h.jsx(Yf,{className:ne("w-3.5 h-3.5 shrink-0",r,n),"data-testid":"session-icon-default","aria-label":"未分类"});const s=i.Icon;return h.jsx(s,{className:ne("w-3.5 h-3.5 shrink-0",r,n),"data-testid":`session-icon-${i.key}`,"aria-label":i.label})}var _H=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),yH="VisuallyHidden",$I=g.forwardRef((e,t)=>h.jsx(Et.span,{...e,ref:t,style:{..._H,...e.style}}));$I.displayName=yH;var bH=$I,[cp]=Ro("Tooltip",[ip]),up=ip(),FI="TooltipProvider",wH=700,l0="tooltip.open",[SH,Z_]=cp(FI),HI=e=>{const{__scopeTooltip:t,delayDuration:n=wH,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(SH,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(c=>{a.current=c},[]),disableHoverableContent:i,children:s})};HI.displayName=FI;var Gc="Tooltip",[kH,dp]=cp(Gc),UI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=Z_(Gc,e.__scopeTooltip),c=up(t),[u,d]=g.useState(null),f=oo(),p=g.useRef(0),m=o??l.disableHoverableContent,v=a??l.delayDuration,b=g.useRef(!1),[x,_]=Qf({prop:r,defaultProp:i??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(l0))):l.onClose(),s==null||s(N)},caller:Gc}),y=g.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),w=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,_(!0)},[_]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_(!1)},[_]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,_(!0),p.current=0},v)},[v,_]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(NP,{...c,children:h.jsx(kH,{scope:t,contentId:f,open:x,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?C():w()},[l.isOpenDelayedRef,C,w]),onTriggerLeave:g.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:w,onClose:S,disableHoverableContent:m,children:n})})};UI.displayName=Gc;var c0="TooltipTrigger",WI=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=dp(c0,n),s=Z_(c0,n),o=up(n),a=g.useRef(null),l=qt(t,a,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(TP,{asChild:!0,...o,children:h.jsx(Et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Pe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(e.onBlur,i.onClose),onClick:Pe(e.onClick,i.onClose)})})});WI.displayName=c0;var CH="TooltipPortal",[qie,EH]=cp(CH,{forceMount:void 0}),Fa="TooltipContent",VI=g.forwardRef((e,t)=>{const n=EH(Fa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=dp(Fa,e.__scopeTooltip);return h.jsx(Hi,{present:r||o.open,children:o.disableHoverableContent?h.jsx(qI,{side:i,...s,ref:t}):h.jsx(NH,{side:i,...s,ref:t})})}),NH=g.forwardRef((e,t)=>{const n=dp(Fa,e.__scopeTooltip),r=Z_(Fa,e.__scopeTooltip),i=g.useRef(null),s=qt(t,i),[o,a]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),p=g.useCallback((m,v)=>{const b=m.currentTarget,x={x:m.clientX,y:m.clientY},_=MH(x,b.getBoundingClientRect()),y=AH(x,_),w=jH(v.getBoundingClientRect()),S=DH([...y,...w]);a(S),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&u){const m=b=>p(b,u),v=b=>p(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),g.useEffect(()=>{if(o){const m=v=>{const b=v.target,x={x:v.clientX,y:v.clientY},_=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),y=!LH(x,o);_?f():y&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,o,c,f]),h.jsx(qI,{...e,ref:s})}),[TH,PH]=cp(Gc,{isInside:!1}),IH=bF("TooltipContent"),qI=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,l=dp(Fa,n),c=up(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(l0,u),()=>document.removeEventListener(l0,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(PP,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(IH,{children:r}),h.jsx(TH,{scope:n,isInside:!0,children:h.jsx(bH,{id:l.contentId,role:"tooltip",children:i||r})})]})})});VI.displayName=Fa;var KI="TooltipArrow",RH=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=up(n);return PH(KI,n).isInside?null:h.jsx(IP,{...i,...r,ref:t})});RH.displayName=KI;function MH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function AH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jH(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function LH(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function DH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),OH(t)}function OH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var BH=HI,zH=UI,$H=WI,GI=VI;const Q_=BH,J_=zH,ey=$H,hp=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(GI,{ref:r,sideOffset:t,className:ne("z-50 overflow-hidden rounded-sm border border-border bg-bg-0 px-2 py-1 text-xs text-text-300 shadow-md",e),...n}));hp.displayName=GI.displayName;function XI({value:e,onChange:t,tool:n}){const r=R_(n);return h.jsx(Q_,{delayDuration:150,children:h.jsx("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"session-icon-picker",children:XT.map(i=>{const s=i.Icon,o=e===i.key;return h.jsxs(J_,{children:[h.jsx(ey,{asChild:!0,children:h.jsx("button",{type:"button",onClick:()=>t(o?null:i.key),"data-testid":`session-icon-option-${i.key}`,"aria-label":i.label,"aria-pressed":o,className:ne("w-8 h-8 rounded-md flex items-center justify-center transition-colors cursor-pointer",o?"bg-text-100/10 ring-1 ring-text-100/30":"hover:bg-text-100/5"),children:h.jsx(s,{className:ne("w-4 h-4",r)})})}),h.jsx(hp,{side:"bottom",children:i.label})]},i.key)})})})}function FH({open:e,initialLabel:t,initialIconKey:n,placeholder:r,onSubmit:i,onCancel:s,tool:o}){const[a,l]=g.useState(t),[c,u]=g.useState(n);return g.useEffect(()=>{e&&(l(t),u(n))},[e,t,n]),g.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&s()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,s]),e?hu.createPortal(h.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-bg-0/40 backdrop-blur-[2px]",onClick:s,"data-testid":"session-edit-dialog-overlay",children:h.jsxs("div",{"data-testid":"session-edit-dialog",className:"w-[420px] max-w-[calc(100vw-32px)] rounded-2xl border border-text-100/[0.12] flex flex-col gap-4 p-5",style:{backgroundColor:"var(--bg-0)",boxShadow:"0 12px 40px rgba(0,0,0,0.04)"},onClick:d=>d.stopPropagation(),children:[h.jsx("div",{className:"text-[15px] font-semibold text-text-100",children:"Edit session"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Label"}),h.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:d=>l(d.target.value),placeholder:r,"data-testid":"session-edit-dialog-label",className:"w-full px-3 py-2 text-[13px] bg-bg-50 border border-bg-300 rounded-lg focus:outline-none focus:border-text-300 transition-colors"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Icon"}),h.jsx(XI,{value:c,onChange:u,tool:o})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:s,className:"px-4 py-1.5 text-[12px] text-text-300 rounded-lg hover:bg-text-100/5 transition-colors cursor-pointer",children:"Cancel"}),h.jsx("button",{type:"button",onClick:()=>i({label:a.trim(),iconKey:c}),"data-testid":"session-edit-dialog-save",className:"px-4 py-1.5 text-[12px] font-medium text-bg-0 rounded-lg bg-text-100 hover:bg-text-200 transition-colors cursor-pointer",children:"Save"})]})]})}),document.body):null}const HH=10,UH=20,WH=16,VH=20,qH=60,KH=4;function GH({session:e,active:t,hasUnread:n,running:r=!1,awaitingUser:i=!1,onSelect:s,onEdit:o,onDelete:a,onPin:l,onArchive:c,archiveShortcut:u=!1,depth:d=0,chevron:f,showCopyResume:p=!0,contactDisplayName:m}){const[v,b]=g.useState(!1),x=!!e.pinnedAt,_=d===0,y=d===0&&!!c,w=HH+d*UH,S=g.useCallback(async()=>{const M=e.toolSessionId;if(!M)return;const D=`cd ${`'${e.cwd.replace(/'/g,"'\\''")}'`} && claude --resume ${M} --permission-mode bypassPermissions`;try{await navigator.clipboard.writeText(D)}catch{}},[e.toolSessionId,e.cwd]),C=e.appBuilderProject?`[app] ${e.appBuilderProject}`:e.label||e.larkChatName||e.larkChatId||e.cwd.split("/").filter(Boolean).pop()||e.sessionId.slice(0,8),N=e.originOwnerPrincipalId,T=N?`@${m??`…${N.slice(-8)}`}`:null;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-testid":`session-item-${e.sessionId}`,onClick:s,style:{paddingLeft:w,display:"grid",gridTemplateColumns:`${WH}px ${VH}px 1fr auto ${qH}px`,gridTemplateAreas:'"chev icon name dot time" ". . sub sub sub"',columnGap:`${KH}px`,rowGap:"2px",alignItems:"center"},className:ne("group relative rounded-lg cursor-pointer transition-all duration-150 pr-2.5 py-1.5",t?"bg-accent-dim":"hover:bg-sidebar-hover-bg"),children:[t?h.jsx("span",{"aria-hidden":"true",className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-7 rounded-r-full bg-accent"}):null,h.jsx("div",{style:{gridArea:"chev"},className:"flex items-center justify-center",children:f??null}),h.jsx("div",{style:{gridArea:"icon"},className:"flex items-center justify-center",children:h.jsx(xH,{iconKey:e.iconKey,tool:e.tool})}),h.jsxs("div",{style:{gridArea:"name"},className:"flex items-center gap-1 min-w-0",children:[e.dispatchedFromSessionId?h.jsx(dz,{"data-testid":`dispatched-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"dispatched from another session",children:h.jsx("title",{children:"由另一个 session dispatch 派生"})}):null,e.shiftFiredFromSessionId?h.jsx(L6,{"data-testid":`shift-fired-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"fired by clawd-shift scheduler",children:h.jsx("title",{children:"由 shift 排班到点 fire 派生"})}):null,e.larkChatId?h.jsx(zz,{"data-testid":`lark-chat-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"driven by feishu chat",children:h.jsx("title",{children:e.larkChatType==="p2p"?"飞书私聊会话(对方消息驱动)":"飞书群会话(群成员 @ bot 驱动)"})}):null,h.jsx("span",{"data-testid":`session-title-${e.sessionId}`,className:ne("text-[13px] truncate min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-words",t?"text-text-100 font-medium":"text-text-200"),children:C})]}),i?h.jsx($6,{"data-testid":`awaiting-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-3 h-3 text-warning shrink-0 animate-pulse",strokeWidth:2.25,"aria-label":"awaiting user"}):n?h.jsx("span",{"data-testid":`unread-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-error shrink-0","aria-label":"unread"}):r?h.jsx("span",{"data-testid":`running-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-success shrink-0 animate-pulse","aria-label":"running"}):null,h.jsx("span",{style:{gridArea:"time"},className:ne("text-[11px] text-text-400/70 text-right shrink-0","transition-opacity duration-150 group-hover:opacity-0"),children:e.updatedAt?pF(e.updatedAt):""}),h.jsxs("span",{style:{gridArea:"sub"},className:ne("flex items-center gap-1.5 text-[11px] text-text-400/70 min-w-0","group-hover:flex-wrap"),children:[T?h.jsx("span",{"data-testid":`session-mirror-chip-${e.sessionId}`,title:`在 ${T.replace(/^@/,"")} 的设备上`,className:"shrink-0 inline-flex items-center px-1.5 py-0 rounded text-[10px] bg-accent-dim/40 text-accent border border-accent/20 max-w-[120px] truncate",children:T}):null,h.jsx("span",{"data-testid":`session-subtitle-${e.sessionId}`,className:ne("block text-[11px] text-text-400/70 truncate font-mono min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-all"),children:e.cwd.replace(/^\/Users\/[^/]+/,"~")})]}),o||a||l||c?h.jsxs("div",{className:"absolute right-2 top-[3px] flex items-center opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:[u&&y&&c?h.jsx("button",{type:"button",title:"归档",onClick:M=>{M.stopPropagation(),c(e.sessionId,!0)},className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"archive session","data-testid":`archive-shortcut-${e.sessionId}`,children:h.jsx(xw,{className:"w-4 h-4"})}):null,h.jsxs(OI,{modal:!1,children:[h.jsx(BI,{asChild:!0,children:h.jsx("button",{type:"button",onClick:M=>M.stopPropagation(),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"session actions","data-testid":`session-menu-${e.sessionId}`,children:h.jsx(Qv,{className:"w-4 h-4"})})}),h.jsxs(Y_,{align:"end",onClick:M=>M.stopPropagation(),children:[l&&_&&h.jsxs(cs,{onSelect:()=>l(e.sessionId,!x),"data-testid":`session-${x?"unpin":"pin"}-${e.sessionId}`,children:[x?h.jsx(Kz,{className:"w-3 h-3 mr-2 text-text-400"}):h.jsx(IT,{className:"w-3 h-3 mr-2 text-text-400"}),x?"Unpin":"Pin"]}),y&&c&&h.jsxs(cs,{onSelect:()=>c(e.sessionId,!0),"data-testid":`session-archive-${e.sessionId}`,children:[h.jsx(xw,{className:"w-3 h-3 mr-2 text-text-400"}),"Archive"]}),o&&h.jsxs(cs,{onSelect:()=>b(!0),"data-testid":`session-rename-${e.sessionId}`,children:[h.jsx(PT,{className:"w-3 h-3 mr-2 text-text-400"}),"Rename"]}),p&&e.toolSessionId?h.jsxs(cs,{onSelect:()=>void S(),"data-testid":`session-copy-resume-${e.sessionId}`,children:[h.jsx(mu,{className:"w-3 h-3 mr-2 text-text-400"}),"Copy Resume Command"]}):null,(l||o||p&&e.toolSessionId)&&a&&h.jsx(zI,{}),a&&h.jsxs(cs,{onSelect:()=>void a(e.sessionId),className:"text-destructive focus:text-destructive focus:bg-destructive/10","data-testid":`session-delete-${e.sessionId}`,children:[h.jsx(N_,{className:"w-3 h-3 mr-2"}),"Delete"]})]})]})]}):null]}),o?h.jsx(FH,{open:v,initialLabel:e.label??"",initialIconKey:e.iconKey??null,tool:e.tool,placeholder:e.cwd.split("/").pop()||"",onSubmit:M=>{o(e.sessionId,M),b(!1)},onCancel:()=>b(!1)}):null]})}function ty({node:e,depth:t=0,activeId:n,unreadIds:r,runningIds:i,awaitingIds:s,onSelect:o,onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,getContactDisplayName:f,showCopyResume:p}){const m=e.children.length>0,{isCollapsed:v,toggle:b}=T6(),x=!v(e.session.sessionId),_=g.useCallback(w=>{w.stopPropagation(),b(e.session.sessionId)},[b,e.session.sessionId]),y=m?h.jsx("button",{type:"button",onClick:_,"data-testid":`session-chevron-${e.session.sessionId}`,"aria-label":x?"collapse":"expand","aria-expanded":x,className:"shrink-0 flex items-center justify-center w-4 h-4 text-text-400 hover:text-text-100 cursor-pointer",children:x?h.jsx(ci,{className:"w-3 h-3"}):h.jsx(ui,{className:"w-3 h-3"})}):null;return h.jsxs("div",{"data-testid":`session-tree-node-${e.session.sessionId}`,children:[h.jsx(GH,{session:e.session,active:n===e.session.sessionId,hasUnread:(r==null?void 0:r.has(e.session.sessionId))??!1,running:(i==null?void 0:i.has(e.session.sessionId))??!1,awaitingUser:(s==null?void 0:s.has(e.session.sessionId))??!1,onSelect:()=>o(e.session.sessionId),onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,showCopyResume:p,depth:t,chevron:y,contactDisplayName:e.session.originOwnerPrincipalId?f==null?void 0:f(e.session.originOwnerPrincipalId):void 0}),m&&x?h.jsx("div",{"data-testid":`session-tree-children-${e.session.sessionId}`,children:e.children.map(w=>h.jsx(ty,{node:w,depth:t+1,activeId:n,unreadIds:r,runningIds:i,awaitingIds:s,onSelect:o,onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,getContactDisplayName:f,showCopyResume:p},w.session.sessionId))}):null]})}function XH(e){return e.forkedFromSessionId??e.dispatchedFromSessionId??e.shiftFiredFromSessionId}function YI(e){e=e.filter(s=>!s.ephemeral);const t=new Map;for(const s of e)t.set(s.sessionId,s);const n=new Map,r=[];for(const s of e){const o=XH(s);if(o&&t.has(o)){const a=n.get(o)??[];a.push(s),n.set(o,a)}else r.push(s)}const i=s=>{const a=[...n.get(s.sessionId)??[]].sort((l,c)=>l.createdAt<c.createdAt?-1:l.createdAt>c.createdAt?1:0);return{session:s,children:a.map(i)}};return[...r].sort(YH).map(i)}function ZI(e){return[...e].sort((t,n)=>t.session.updatedAt<n.session.updatedAt?1:t.session.updatedAt>n.session.updatedAt?-1:0)}function YH(e,t){const n=typeof e.pinnedAt=="number",r=typeof t.pinnedAt=="number";if(n&&r){const i=typeof e.pinSortOrder=="number",s=typeof t.pinSortOrder=="number";return i&&s?e.pinSortOrder-t.pinSortOrder:i?-1:s?1:t.pinnedAt-e.pinnedAt}return n?-1:r||e.updatedAt<t.updatedAt?1:e.updatedAt>t.updatedAt?-1:0}function ZH(e){return e.appBuilderProject?`[app] ${e.appBuilderProject}`:e.label?e.label:e.cwd.split("/").filter(Boolean).pop()??""}function Zw(e,t){const n=t.trim().toLowerCase();return n===""?!0:e.toLowerCase().includes(n)}function QI(e){return e.compositionActive||!!e.nativeIsComposing||e.keyCode===229}function JI(e){return e.key==="Enter"&&!e.shiftKey&&!QI(e)}function QH(e,t){const n=g.useRef(!1),r=g.useCallback(()=>{n.current=!0},[]),i=g.useCallback(()=>{setTimeout(()=>{n.current=!1},0)},[]);return{onKeyDown:g.useCallback(o=>{const a=o.nativeEvent;if(JI({key:o.key,shiftKey:o.shiftKey,compositionActive:n.current,nativeIsComposing:a.isComposing,keyCode:a.keyCode})){o.preventDefault(),e();return}t&&o.key==="Escape"&&(o.preventDefault(),t())},[e,t]),onCompositionStart:r,onCompositionEnd:i}}const JH={isCollapsed:()=>!1,toggle:()=>{},prune:()=>{}};function eU({personas:e,activePersonaId:t,onSelectPersona:n,onCreateSession:r,sessions:i,activeSessionId:s,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f,isPersonaExpanded:p,onTogglePersonaExpanded:m,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,searchQuery:y}){const[w,S]=g.useState(null),[C,N]=g.useState(()=>new Set),T=p??(R=>C.has(R)),M=g.useCallback(R=>{if(m){m(R);return}N(I=>{const O=new Set(I);return O.has(R)?O.delete(R):O.add(R),O})},[m]),P=g.useMemo(()=>i==null?void 0:i.filter(R=>!R.ephemeral),[i]);if(e.length===0)return h.jsx(tU,{});const D=(y??"").trim();return D?h.jsx(C_.Provider,{value:JH,children:h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(R=>{const I=P?P.filter(F=>F.ownerPersonaId===R.personaId).sort((F,L)=>L.updatedAt>F.updatedAt?1:-1):[],O=Zw(R.label,D),z=I.filter(F=>Zw(ZH(F),D));if(!O&&z.length===0)return null;const $=O?I:z;return h.jsx(Qw,{persona:R,active:R.personaId===t,editing:!1,onSelectPersona:n,onSubmitCreateSession:()=>{},onCancelCreateSession:()=>{},personaSessions:$,collapsed:!1,onToggleCollapsed:()=>{},activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},R.personaId)})})}):h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(R=>{const I=P?P.filter(O=>O.ownerPersonaId===R.personaId).sort((O,z)=>z.updatedAt>O.updatedAt?1:-1):[];return h.jsx(Qw,{persona:R,active:R.personaId===t,editing:R.personaId===w,onSelectPersona:n,onStartCreateSession:r?()=>S(R.personaId):void 0,onSubmitCreateSession:O=>{S(null),r==null||r(R.personaId,O)},onCancelCreateSession:()=>S(null),personaSessions:I,collapsed:!T(R.personaId),onToggleCollapsed:()=>M(R.personaId),activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},R.personaId)})})}function tU(){return h.jsx("div",{className:"px-3 py-3 text-[11px] leading-relaxed text-text-400",children:"还没有 persona。点上方 Personas 标题右侧 + 创建第一个。"})}function Qw({persona:e,active:t,editing:n,onSelectPersona:r,onStartCreateSession:i,onSubmitCreateSession:s,onCancelCreateSession:o,personaSessions:a,collapsed:l,onToggleCollapsed:c,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_,treatSessionsAsRoots:y,ownerPrincipalId:w,creatorDisplayNameByOwnerId:S}){const C=ZT(e.iconKey,e.tool),N=a.length>0,T=!l,M=g.useMemo(()=>{const R=[],I=new Map;for(const O of a){const z=O.creatorPrincipalId;if(O.larkChatId!=null||!z||w&&z===w){R.push(O);continue}const $=z,F=(S==null?void 0:S.get($))??`…${$.slice(-8)}`,L=I.get($);L?L.sessions.push(O):I.set($,{groupKey:$,displayName:F,sessions:[O]})}return{self:R,byPeer:[...I.values()]}},[a,w,S]),P=M.byPeer.length>0,D=g.useMemo(()=>T&&!P?ZI(YI(a)):[],[T,P,a]);return h.jsxs("div",{"data-testid":`persona-node-${e.personaId}`,children:[h.jsxs("div",{className:ne("group flex items-center gap-1 px-2 py-1.5 cursor-pointer",t?"bg-accent-dim text-text-100":"hover:bg-bg-200 text-text-200"),onClick:()=>r==null?void 0:r(e.personaId),role:"button",tabIndex:0,children:[N?h.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),c()},"aria-label":T?"collapse":"expand","aria-expanded":T,"data-testid":`persona-chevron-${e.personaId}`,className:"flex h-4 w-4 shrink-0 items-center justify-center text-text-400 hover:text-text-100",children:T?h.jsx(ci,{className:"h-3 w-3"}):h.jsx(ui,{className:"h-3 w-3"})}):h.jsx("span",{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsx(C.Component,{className:ne("h-3.5 w-3.5 shrink-0",C.colorClass),"aria-hidden":"true"}),h.jsx("span",{className:"flex-1 truncate text-[13px]",children:e.label}),N?h.jsx("span",{className:"shrink-0 text-[10px] text-text-400 tabular-nums","aria-label":`${a.length} sessions`,children:a.length}):null,i?h.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),i()},"aria-label":"新建会话",title:"新建会话","data-testid":`persona-create-session-${e.personaId}`,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-text-400 opacity-0 hover:bg-text-100/10 hover:text-text-100 focus-visible:opacity-100 group-hover:opacity-100",children:h.jsx(Qz,{className:"h-3.5 w-3.5"})}):null]}),n?h.jsx(nU,{personaId:e.personaId,iconKey:e.iconKey,tool:e.tool,onSubmit:s,onCancel:o}):null,N&&T?h.jsx("div",{"data-testid":`persona-sessions-${e.personaId}`,children:P?h.jsxs(h.Fragment,{children:[M.self.length>0&&h.jsx(Jw,{groupKey:`${e.personaId}-self`,label:"我自己",testId:`persona-sessions-${e.personaId}-self`,sessions:M.self,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_}),M.byPeer.map(R=>h.jsx(Jw,{groupKey:`${e.personaId}-peer-${R.groupKey}`,label:R.displayName,testId:`persona-sessions-${e.personaId}-peer-${R.groupKey}`,sessions:R.sessions,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_},`${e.personaId}-peer-${R.groupKey}`))]}):D.map(R=>h.jsx(ty,{node:R,depth:y?0:1,activeId:u,unreadIds:p,runningIds:f,awaitingIds:d,onSelect:I=>m==null?void 0:m(I),onDelete:v,onEdit:b,onPin:x,showCopyResume:_},R.session.sessionId))}):null]})}function Jw({label:e,testId:t,sessions:n,activeSessionId:r,awaitingIds:i,runningIds:s,unreadIds:o,onSelectSession:a,onDeleteSession:l,onEditSession:c,onPinSession:u,showCopyResume:d}){const[f,p]=g.useState(!1),m=!f,v=g.useMemo(()=>m?ZI(YI(n)):[],[m,n]);return h.jsxs("div",{"data-testid":t,children:[h.jsxs("button",{type:"button",onClick:()=>p(b=>!b),"aria-label":m?"collapse":"expand","aria-expanded":m,"data-testid":`${t}-chevron`,className:"flex items-center gap-1 w-full pl-7 pr-2 py-0.5 text-[11px] text-text-400 hover:text-text-200 transition-colors",children:[m?h.jsx(ci,{className:"h-3 w-3"}):h.jsx(ui,{className:"h-3 w-3"}),h.jsx(T_,{className:"h-3 w-3","aria-hidden":!0}),h.jsx("span",{className:"truncate",children:e}),h.jsx("span",{className:"ml-auto tabular-nums",children:n.length})]}),m&&h.jsx("div",{children:v.map(b=>h.jsx(ty,{node:b,depth:2,activeId:r,unreadIds:o,runningIds:s,awaitingIds:i,onSelect:x=>a==null?void 0:a(x),onDelete:l,onEdit:c,onPin:u,showCopyResume:d},b.session.sessionId))})]})}function nU({personaId:e,iconKey:t,tool:n,onSubmit:r,onCancel:i}){const[s,o]=g.useState(""),a=g.useRef(null),l=ZT(t,n),c=s.trim(),u=c.length>0;g.useEffect(()=>{var p;(p=a.current)==null||p.focus()},[]);const d=g.useCallback(()=>{u&&r(c)},[u,c,r]),f=QH(d,i);return h.jsxs("div",{className:"flex items-center gap-1.5 pl-9 pr-2 py-1","data-testid":`persona-new-session-row-${e}`,children:[h.jsx(l.Component,{className:ne("h-3 w-3 shrink-0",l.colorClass),"aria-hidden":"true"}),h.jsx("input",{ref:a,type:"text",value:s,onChange:p=>o(p.target.value),...f,onBlur:i,placeholder:"session label...","data-testid":`persona-new-session-input-${e}`,className:"flex-1 min-w-0 bg-bg-100 border border-text-100/15 rounded px-1.5 py-0.5 text-[12px] text-text-100 placeholder:text-text-400 focus:outline-none focus:border-text-100/40"}),h.jsx("button",{type:"button",onMouseDown:p=>{p.preventDefault(),d()},disabled:!u,"aria-label":"确认",title:"确认(Enter)","data-testid":`persona-new-session-confirm-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100 disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-text-300",children:h.jsx(ol,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",onMouseDown:p=>{p.preventDefault(),i()},"aria-label":"取消",title:"取消(Esc)","data-testid":`persona-new-session-cancel-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100",children:h.jsx(Rn,{className:"h-3 w-3"})})]})}function rU(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function iU(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function sU(e){return e/100*window.innerHeight}function oU(e){return e/100*window.innerWidth}function aU(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 ql({groupSize:e,panelElement:t,styleProp:n}){let r;const[i,s]=aU(n);switch(s){case"%":{r=i/100*e;break}case"px":{r=i;break}case"rem":{r=iU(t,i);break}case"em":{r=rU(t,i);break}case"vh":{r=sU(i);break}case"vw":{r=oU(i);break}}return r}function En(e){return parseFloat(e.toFixed(3))}function Ha({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,i)=>(r+=t==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function u0(e){const{panels:t}=e,n=Ha({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:i,panelConstraints:s}=r;let o=0;if(s.collapsedSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.collapsedSize});o=En(u/n*100)}let a;if(s.defaultSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.defaultSize});a=En(u/n*100)}let l=0;if(s.minSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.minSize});l=En(u/n*100)}let c=100;if(s.maxSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.maxSize});c=En(u/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:o,collapsible:s.collapsible===!0,defaultSize:a,disabled:s.disabled,minSize:l,maxSize:c,panelId:r.id}})}function it(e,t="Assertion error"){if(!e)throw Error(t)}function d0(e,t){return Array.from(t).sort(e==="horizontal"?lU:cU)}function lU(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function cU(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function eR(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function tR(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 uU({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const o of t){const{x:a,y:l}=tR(r,o),c=e==="horizontal"?a:l;c<s&&(s=c,i=o)}return it(i,"No rect found"),i}let gd;function dU(){return gd===void 0&&(typeof matchMedia=="function"?gd=!!matchMedia("(pointer:coarse)").matches:gd=!1),gd}function nR(e){const{element:t,orientation:n,panels:r,separators:i}=e,s=d0(n,Array.from(t.children).filter(eR).map(m=>({element:m}))).map(({element:m})=>m),o=[];let a=!1,l=!1,c=-1,u=-1,d=0,f,p=[];{let m=-1;for(const v of s)v.hasAttribute("data-panel")&&(m++,v.hasAttribute("data-disabled")||(d++,c===-1&&(c=m),u=m))}if(d>1){let m=-1;for(const v of s)if(v.hasAttribute("data-panel")){m++;const b=r.find(x=>x.element===v);if(b){if(f){const x=f.element.getBoundingClientRect(),_=v.getBoundingClientRect();let y;if(l){const w=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),S=n==="horizontal"?new DOMRect(_.left,_.top,0,_.height):new DOMRect(_.left,_.top,_.width,0);switch(p.length){case 0:{y=[w,S];break}case 1:{const C=p[0],N=uU({orientation:n,rects:[x,_],targetRect:C.element.getBoundingClientRect()});y=[C,N===x?S:w];break}default:{y=p;break}}}else p.length?y=p:y=[n==="horizontal"?new DOMRect(x.right,_.top,_.left-x.right,_.height):new DOMRect(_.left,x.bottom,_.width,_.top-x.bottom)];for(const w of y){let S="width"in w?w:w.element.getBoundingClientRect();const C=dU()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<C){const T=C-S.width;S=new DOMRect(S.x-T/2,S.y,S.width+T,S.height)}if(S.height<C){const T=C-S.height;S=new DOMRect(S.x,S.y-T/2,S.width,S.height+T)}const N=m<=c||m>u;!a&&!N&&o.push({group:e,groupSize:Ha({group:e}),panels:[f,b],separator:"width"in w?void 0:w,rect:S}),a=!1}}l=!1,f=b,p=[]}}else if(v.hasAttribute("data-separator")){v.ariaDisabled!==null&&(a=!0);const b=i.find(x=>x.element===v);b?p.push(b):(f=void 0,p=[])}else l=!0}return o}var us;class rR{constructor(){o1(this,us,{})}addListener(t,n){const r=_l(this,us)[t];return r===void 0?_l(this,us)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=_l(this,us)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const o=Array.from(r);for(let a=0;a<o.length;a++){const l=o[a];try{l.call(null,n)}catch(c){s===null&&(i=!0,s=c)}}if(i)throw s}}removeAllListeners(){a1(this,us,{})}removeListener(t,n){const r=_l(this,us)[t];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}}us=new WeakMap;let Ca={cursorFlags:0,state:"inactive"};const ny=new rR;function _o(){return Ca}function hU(e){return ny.addListener("change",e)}function fU(e){const t=Ca,n={...Ca};n.cursorFlags=e,Ca=n,ny.emit("change",{prev:t,next:n})}function Ea(e){const t=Ca;Ca=e,ny.emit("change",{prev:t,next:e})}const pU=e=>e,Im=()=>{},iR=1,sR=2,oR=4,aR=8,eS=3,tS=12;let vd;function nS(){return vd===void 0&&(vd=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(vd=!0)),vd}function mU({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(e&&nS()){const s=(e&iR)!==0,o=(e&sR)!==0,a=(e&oR)!==0,l=(e&aR)!==0;if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(o)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return nS()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const rS=new WeakMap;function ry(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=rS.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 r=_o();switch(r.state){case"active":case"hover":{const i=mU({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(o=>o.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(t===s)return;t=s,i?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}}rS.set(e,{prevStyle:t,styleSheet:n})}let Zr=new Map;const lR=new rR;function gU(e){Zr=new Map(Zr),Zr.delete(e)}function iS(e,t){for(const[n]of Zr)if(n.id===e)return n}function ks(e,t){for(const[n,r]of Zr)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function jo(){return Zr}function iy(e,t){return lR.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Oi(e,t,n){const r=Zr.get(e);Zr=new Map(Zr),Zr.set(e,t),lR.emit("groupChange",{group:e,isUserInteraction:(n==null?void 0:n.isUserInteraction)===!0,prev:r,next:t})}function cR(e){const t=_o();let n=!1;switch(t.state){case"active":Ea({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(ry(e),n=!0,t.hitRegions.forEach(r=>{const i=ks(r.group.id,!0);Oi(r.group,i,{isUserInteraction:!0})}))}return n}function sS(e){e.defaultPrevented||cR(e.currentTarget)}function vU(e,t,n){let r,i={x:1/0,y:1/0};for(const s of t){const o=tR(n,s.rect);switch(e){case"horizontal":{o.x<=i.x&&(r=s,i=o);break}case"vertical":{o.y<=i.y&&(r=s,i=o);break}}}return r?{distance:i,hitRegion:r}:void 0}function xU(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _U(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:lS(e),b:lS(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();it(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:aS(oS(n.a)),b:aS(oS(n.b))};if(i.a===i.b){const s=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const yU=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bU(e){const t=getComputedStyle(uR(e)??e).display;return t==="flex"||t==="inline-flex"}function wU(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||bU(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"||yU.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function oS(e){let t=e.length;for(;t--;){const n=e[t];if(it(n,"Missing node"),wU(n))return n}return null}function aS(e){return e&&Number(getComputedStyle(e).zIndex)||0}function lS(e){const t=[];for(;e;)t.push(e),e=uR(e);return t}function uR(e){const{parentNode:t}=e;return xU(t)?t.host:t}function SU(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 kU({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!eR(n)||n.contains(e)||e.contains(n))return!0;if(_U(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(SU(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sy(e,t){const n=[];return t.forEach((r,i)=>{if(i.disabled)return;const s=nR(i),o=vU(i.orientation,s,{x:e.clientX,y:e.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&kU({groupElement:i.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&n.push(o.hitRegion)}),n}function CU(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 xn(e,t,n=0){return Math.abs(En(e)-En(t))<=n}function Kr(e,t){return xn(e,t)?0:e>t?1:-1}function pa({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:o,maxSize:a=100,minSize:l=0}=t;if(o&&!e)return n;if(Kr(r,l)<0)if(s){const c=(i+l)/2;Kr(r,c)<0?r=i:r=l}else r=l;return r=Math.min(a,r),r=En(r),r}function Xc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(xn(e,0))return t;const o=s==="imperative-api",a=Object.values(t),l=Object.values(i),c=[...a],[u,d]=r;it(u!=null,"Invalid first pivot index"),it(d!=null,"Invalid second pivot index");let f=0;switch(s){case"keyboard":{{const v=e<0?d:u,b=n[v];it(b,`Panel constraints not found for index ${v}`);const{collapsedSize:x=0,collapsible:_,minSize:y=0}=b;if(_){const w=a[v];if(it(w!=null,`Previous layout not found for panel index ${v}`),xn(w,x)){const S=y-w;Kr(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const v=e<0?u:d,b=n[v];it(b,`No panel constraints found for index ${v}`);const{collapsedSize:x=0,collapsible:_,minSize:y=0}=b;if(_){const w=a[v];if(it(w!=null,`Previous layout not found for panel index ${v}`),xn(w,y)){const S=w-x;Kr(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const v=e<0?d:u,b=n[v];it(b,`Panel constraints not found for index ${v}`);const x=a[v],{collapsible:_,collapsedSize:y,minSize:w}=b;if(_&&Kr(x,w)<0)if(e>0){const S=w-y,C=S/2,N=x+e;Kr(N,w)<0&&(e=Kr(e,C)<=0?0:S)}else{const S=w-y,C=100-S/2,N=x-e;Kr(N,w)<0&&(e=Kr(100+e,C)>0?0:-S)}break}}{const v=e<0?1:-1;let b=e<0?d:u,x=0;for(;;){const y=a[b];it(y!=null,`Previous layout not found for panel index ${b}`);const w=pa({overrideDisabledPanels:o,panelConstraints:n[b],prevSize:y,size:100})-y;if(x+=w,b+=v,b<0||b>=n.length)break}const _=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-_:_}{let v=e<0?u:d;for(;v>=0&&v<n.length;){const b=Math.abs(e)-Math.abs(f),x=a[v];it(x!=null,`Previous layout not found for panel index ${v}`);const _=x-b,y=pa({overrideDisabledPanels:o,panelConstraints:n[v],prevSize:x,size:_});if(!xn(x,y)&&(f+=x-y,c[v]=y,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?v--:v++}}if(CU(l,c))return i;{const v=e<0?d:u,b=a[v];it(b!=null,`Previous layout not found for panel index ${v}`);const x=b+f,_=pa({overrideDisabledPanels:o,panelConstraints:n[v],prevSize:b,size:x});if(c[v]=_,!xn(_,x)){let y=x-_,w=e<0?d:u;for(;w>=0&&w<n.length;){const S=c[w];it(S!=null,`Previous layout not found for panel index ${w}`);const C=S+y,N=pa({overrideDisabledPanels:o,panelConstraints:n[w],prevSize:S,size:C});if(xn(S,N)||(y-=N-S,c[w]=N),xn(y,0))break;e>0?w--:w++}}}const p=Object.values(c).reduce((v,b)=>b+v,0);if(!xn(p,100,.1))return i;const m=Object.keys(i);return c.reduce((v,b,x)=>(v[m[x]]=b,v),{})}function yo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Kr(e[n],t[n])!==0)return!1;return!0}function bo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],i=r.reduce((a,l)=>a+l,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(a=>`${a}%`).join(", ")}`);if(!xn(i,100)&&r.length>0)for(let a=0;a<t.length;a++){const l=r[a];it(l!=null,`No layout data found for index ${a}`);const c=100/i*l;r[a]=c}let s=0;for(let a=0;a<t.length;a++){const l=n[a];it(l!=null,`No layout data found for index ${a}`);const c=r[a];it(c!=null,`No layout data found for index ${a}`);const u=pa({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:c});c!=u&&(s+=c-u,r[a]=u)}if(!xn(s,0))for(let a=0;a<t.length;a++){const l=r[a];it(l!=null,`No layout data found for index ${a}`);const c=l+s,u=pa({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:c});if(l!==u&&(s-=u-l,r[a]=u,xn(s,0)))break}const o=Object.keys(e);return r.reduce((a,l,c)=>(a[o[c]]=l,a),{})}function dR({groupId:e,panelId:t}){const n=()=>{const l=jo();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:m}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:p,layout:f,separatorToPanels:m};throw Error(`Group ${e} not found`)},r=()=>{const l=n().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{const l=n().group.panels.find(c=>c.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}`)},o=({nextSize:l,panels:c,prevLayout:u,derivedPanelConstraints:d})=>{const f=s(),p=c.findIndex(b=>b.id===t),m=p===0,v=p===c.length-1;if(v&&l<f&&(m||c.slice(0,p).every((b,x)=>{const _=d[x];return(_==null?void 0:_.collapsible)&&xn(_.collapsedSize,u[_.panelId])}))){const b=c.slice(0,p).reduce((x,_)=>x+u[_.id],0);return{...u,[t]:En(100-b)}}return Xc({delta:v?f-l:l-f,initialLayout:u,panelConstraints:d,pivotIndices:v?[p-1,p]:[p,p+1],prevLayout:u,trigger:"imperative-api"})},a=l=>{const c=s();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:p,layout:m,separatorToPanels:v}=n(),b=o({nextSize:l,panels:f.panels,prevLayout:m,derivedPanelConstraints:d}),x=bo({layout:b,panelConstraints:d});yo(m,x)||Oi(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:x,separatorToPanels:v})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=r(),{mutableValues:u}=i(),d=s();l&&d!==c&&(u.expandToSize=d,a(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=r(),{mutableValues:d}=i(),f=s();if(l&&f===c){let p=d.expandToSize??u;p===0&&(p=1),a(p)}},getSize:()=>{const{group:l}=n(),c=s(),{element:u}=i(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=r(),u=s();return l&&xn(c,u)},resize:l=>{const{group:c}=n(),{element:u}=i(),d=Ha({group:c}),f=ql({groupSize:d,panelElement:u,styleProp:l}),p=En(f/d*100);a(p)}}}function cS(e){if(e.defaultPrevented)return;const t=jo();sy(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=dR({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),e.preventDefault())}}})}function Qd(e){const t=jo();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function hR({groupId:e}){const t=()=>{const n=jo();for(const[r,i]of n)if(r.id===e)return{group:r,...i};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:o,layout:a,separatorToPanels:l}=t(),c=bo({layout:n,panelConstraints:i});return r?a:(yo(a,c)||Oi(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:o,layout:c,separatorToPanels:l}),c)}}}function Hs(e,t){const n=Qd(e),r=ks(n.id,!0),i=n.separators.find(u=>u.element===e);it(i,"Matching separator not found");const s=r.separatorToPanels.get(i);it(s,"Matching panels not found");const o=s.map(u=>n.panels.indexOf(u)),a=hR({groupId:n.id}).getLayout(),l=Xc({delta:t,initialLayout:a,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:a,trigger:"keyboard"}),c=bo({layout:l,panelConstraints:r.derivedPanelConstraints});yo(a,c)||Oi(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function uS(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Qd(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Hs(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Hs(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Hs(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Hs(t,-5);break}case"End":{e.preventDefault(),Hs(t,100);break}case"Enter":{e.preventDefault();const r=Qd(t),i=ks(r.id,!0),{derivedPanelConstraints:s,layout:o,separatorToPanels:a}=i,l=r.separators.find(f=>f.element===t);it(l,"Matching separator not found");const c=a.get(l);it(c,"Matching panels not found");const u=c[0],d=s.find(f=>f.panelId===u.id);if(it(d,"Panel metadata not found"),d.collapsible){const f=o[u.id],p=d.collapsedSize===f?r.mutableState.expandedPanelSizes[u.id]??d.minSize:d.collapsedSize;Hs(t,p-f)}break}case"F6":{e.preventDefault();const r=Qd(t).separators.map(o=>o.element),i=Array.from(r).findIndex(o=>o===e.currentTarget);it(i!==null,"Index not found");const s=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Hs(t,-100);break}}}function dS(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=jo(),n=sy(e,t),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const o=t.get(s.group);o&&r.set(s.group,o.layout)}),Ea({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function fR({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:o}){let a=0;n.forEach(c=>{const{group:u,groupSize:d}=c,{orientation:f,panels:p}=u,{disableCursor:m}=u.mutableState;let v=0;s?f==="horizontal"?v=(t.clientX-s.x)/d*100:v=(t.clientY-s.y)/d*100:f==="horizontal"?v=t.clientX<0?-100:100:v=t.clientY<0?-100:100;const b=r.get(u),x=i.get(u);if(!b||!x)return;const{defaultLayoutDeferred:_,derivedPanelConstraints:y,groupSize:w,layout:S,separatorToPanels:C}=x;if(y&&S&&C){const N=Xc({delta:v,initialLayout:b,panelConstraints:y,pivotIndices:c.panels.map(T=>p.indexOf(T)),prevLayout:S,trigger:"mouse-or-touch"});if(yo(N,S)){if(v!==0&&!m)switch(f){case"horizontal":{a|=v<0?iR:sR;break}case"vertical":{a|=v<0?oR:aR;break}}}else Oi(c.group,{defaultLayoutDeferred:_,derivedPanelConstraints:y,groupSize:w,layout:N,separatorToPanels:C})}});let l=0;t.movementX===0?l|=o&eS:l|=a&eS,t.movementY===0?l|=o&tS:l|=a&tS,fU(l),ry(e)}function hS(e){const t=jo(),n=_o();switch(n.state){case"active":fR({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function fS(e){var r,i;if(e.defaultPrevented)return;const t=_o(),n=jo();switch(t.state){case"active":{if(e.buttons===0){Ea({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(s=>{const o=ks(s.group.id,!0);Oi(s.group,o,{isUserInteraction:!0})});return}for(const s of t.hitRegions)if(s.separator){const{element:o}=s.separator;(r=o.hasPointerCapture)!=null&&r.call(o,e.pointerId)||((i=o.setPointerCapture)==null||i.call(o,e.pointerId))}fR({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const s=sy(e,n);s.length===0?t.state!=="inactive"&&Ea({cursorFlags:0,state:"inactive"}):Ea({cursorFlags:0,hitRegions:s,state:"hover"}),ry(e.currentTarget);break}}}function pS(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(_o().state){case"hover":Ea({cursorFlags:0,state:"inactive"})}}function mS(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||cR(e.currentTarget)&&e.preventDefault()}function gS(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const o=En(s.defaultSize);n+=o,r[s.panelId]=o}else r[s.panelId]=void 0;const i=e.length-t;if(i!==0){const s=En((100-n)/i);for(const o of e)o.defaultSize===void 0&&(r[o.panelId]=s)}return r}function EU(e,t,n){if(!n[0])return;const r=e.panels.find(l=>l.element===t);if(!r||!r.onResize)return;const i=Ha({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,a={asPercentage:En(s/i*100),inPixels:s};r.mutableValues.prevSize=a,r.onResize(a,r.id,o)}function NU(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 TU({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,s=0,o=!1;const a=new Map,l=[];for(const d of e.panels){const f=r[d.id]??0;switch(d.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{o=!0;const p=f/100*n,m=En(p/t*100);a.set(d.id,m),i+=m;break}case"preserve-relative-size":default:{l.push(d.id),s+=f;break}}}if(!o||l.length===0)return r;const c=100-i,u={...r};if(a.forEach((d,f)=>{u[f]=d}),s>0)for(const d of l){const f=r[d]??0;u[d]=En(f/s*c)}else{const d=En(c/l.length);for(const f of l)u[f]=d}return u}function PU(e,t){const n=e.map(i=>i.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Ko=new Map;function IU(e){let t=!0;it(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(m=>{for(const v of m){const{borderBoxSize:b,target:x}=v;if(x===e.element){if(t){const _=Ha({group:e});if(_===0)return;const y=ks(e.id);if(!y)return;const w=u0(e),S=y.defaultLayoutDeferred?gS(w):y.layout,C=TU({group:e,nextGroupSize:_,prevGroupSize:y.groupSize,prevLayout:S}),N=bo({layout:C,panelConstraints:w});if(!y.defaultLayoutDeferred&&yo(y.layout,N)&&NU(y.derivedPanelConstraints,w)&&y.groupSize===_)return;Oi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:w,groupSize:_,layout:N,separatorToPanels:y.separatorToPanels})}}else EU(e,x,b)}});s.observe(e.element),e.panels.forEach(m=>{it(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&s.observe(m.element)});const o=Ha({group:e}),a=u0(e),l=e.panels.map(({id:m})=>m).join(",");let c=e.mutableState.defaultLayout;c&&(PU(e.panels,c)||(c=void 0));const u=e.mutableState.layouts[l]??c??gS(a),d=bo({layout:u,panelConstraints:a}),f=e.element.ownerDocument;Ko.set(f,(Ko.get(f)??0)+1);const p=new Map;return nR(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Oi(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:a,groupSize:o,layout:d,separatorToPanels:p}),e.separators.forEach(m=>{it(!i.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),i.add(m.id),m.element.addEventListener("keydown",uS)}),Ko.get(f)===1&&(f.addEventListener("contextmenu",sS,!0),f.addEventListener("dblclick",cS,!0),f.addEventListener("pointerdown",dS,!0),f.addEventListener("pointerleave",hS),f.addEventListener("pointermove",fS),f.addEventListener("pointerout",pS),f.addEventListener("pointerup",mS,!0)),function(){t=!1,Ko.set(f,Math.max(0,(Ko.get(f)??0)-1)),gU(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",uS)}),Ko.get(f)||(f.removeEventListener("contextmenu",sS,!0),f.removeEventListener("dblclick",cS,!0),f.removeEventListener("pointerdown",dS,!0),f.removeEventListener("pointerleave",hS),f.removeEventListener("pointermove",fS),f.removeEventListener("pointerout",pS),f.removeEventListener("pointerup",mS,!0)),s.disconnect()}}function RU(){const[e,t]=g.useState({}),n=g.useCallback(()=>t({}),[]);return[e,n]}function oy(e){const t=g.useId();return`${e??t}`}const Lo=typeof window<"u"?g.useLayoutEffect:g.useEffect;function dc(e){const t=g.useRef(e);return Lo(()=>{t.current=e},[e]),g.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function ay(...e){return dc(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ly(e){const t=g.useRef({...e});return Lo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const pR=g.createContext(null);function MU(e,t){const n=g.useRef({getLayout:()=>({}),setLayout:pU});g.useImperativeHandle(t,()=>n.current,[]),Lo(()=>{Object.assign(n.current,hR({groupId:e}))})}function cy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:o,id:a,onLayoutChange:l,onLayoutChanged:c,orientation:u="horizontal",resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){const m=g.useRef({onLayoutChange:{},onLayoutChanged:{}}),v=dc(D=>{yo(m.current.onLayoutChange,D)||(m.current.onLayoutChange=D,l==null||l(D))}),b=dc((D,R)=>{yo(m.current.onLayoutChanged,D)||(m.current.onLayoutChanged=D,c==null||c(D,{isUserInteraction:R}))}),x=oy(a),_=g.useRef(null),[y,w]=RU(),S=g.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=ay(_,s);MU(x,o);const N=dc((D,R)=>{const I=_o(),O=iS(D),z=ks(D);if(z){let $=!1;switch(I.state){case"active":{$=I.hitRegions.some(F=>F.group===O);break}}return{flexGrow:z.layout[R]??1,pointerEvents:$?"none":void 0}}if(n!=null&&n[R])return{flexGrow:n==null?void 0:n[R]}}),T=ly({defaultLayout:n,disableCursor:r}),M=g.useMemo(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:N,id:x,orientation:u,registerPanel:D=>{const R=S.current;return R.panels=d0(u,[...R.panels,D]),w(),()=>{R.panels=R.panels.filter(I=>I!==D),w()}},registerSeparator:D=>{const R=S.current;return R.separators=d0(u,[...R.separators,D]),w(),()=>{R.separators=R.separators.filter(I=>I!==D),w()}},updatePanelProps:(D,{disabled:R})=>{const I=S.current.panels.find($=>$.id===D);I&&(I.panelConstraints.disabled=R);const O=iS(x),z=ks(x);O&&z&&Oi(O,{...z,derivedPanelConstraints:u0(O)})},updateSeparatorProps:(D,{disabled:R,disableDoubleClick:I})=>{const O=S.current.separators.find(z=>z.id===D);O&&(O.disabled=R,O.disableDoubleClick=I)}}),[N,x,w,u,T]),P=g.useRef(null);return Lo(()=>{const D=_.current;if(D===null)return;const R=S.current;let I;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===R.panels.length){I={};for(const E of R.panels){const H=T.defaultLayout[E.id];H!==void 0&&(I[E.id]=H)}}const O={disabled:!!i,element:D,id:x,mutableState:{defaultLayout:I,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};P.current=O;const z=IU(O),{defaultLayoutDeferred:$,derivedPanelConstraints:F,layout:L}=ks(O.id,!0);!$&&F.length>0&&(v(L),b(L,!1));const B=iy(x,E=>{const{defaultLayoutDeferred:H,derivedPanelConstraints:q,layout:A}=E.next;if(H||q.length===0)return;const re=O.panels.map(({id:V})=>V).join(",");O.mutableState.layouts[re]=A,q.forEach(V=>{if(V.collapsible){const{layout:pe}=E.prev??{};if(pe){const Oe=xn(V.collapsedSize,A[V.panelId]),ie=xn(V.collapsedSize,pe[V.panelId]);Oe&&!ie&&(O.mutableState.expandedPanelSizes[V.panelId]=pe[V.panelId])}}});const oe=_o().state!=="active";v(A),oe&&b(A,E.isUserInteraction)});return()=>{P.current=null,z(),B()}},[i,x,b,v,u,y,T]),g.useEffect(()=>{const D=P.current;D&&(D.mutableState.defaultLayout=n,D.mutableState.disableCursor=!!r)}),h.jsx(pR.Provider,{value:M,children:h.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:C,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:e})})}cy.displayName="Group";function uy(){const e=g.useContext(pR);return it(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function AU(e,t){const{id:n}=uy(),r=g.useRef({collapse:Im,expand:Im,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Im});g.useImperativeHandle(t,()=>r.current,[]),Lo(()=>{Object.assign(r.current,dR({groupId:n,panelId:e}))})}function Yc({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:o,groupResizeBehavior:a="preserve-relative-size",id:l,maxSize:c="100%",minSize:u="0%",onResize:d,panelRef:f,style:p,...m}){const v=!!l,b=oy(l),x=ly({disabled:s}),_=g.useRef(null),y=ay(_,o),{getPanelStyles:w,id:S,orientation:C,registerPanel:N,updatePanelProps:T}=uy(),M=d!==null,P=dc((O,z,$)=>{d==null||d(O,l,$)});Lo(()=>{const O=_.current;if(O!==null){const z={element:O,id:b,idIsStable:v,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:M?P:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:n,collapsible:r,defaultSize:i,disabled:x.disabled,maxSize:c,minSize:u}};return N(z)}},[a,n,r,i,M,b,v,c,u,P,N,x]),g.useEffect(()=>{T(b,{disabled:s})},[s,b,T]),AU(b,f);const D=()=>{const O=w(S,b);if(O)return JSON.stringify(O)},R=g.useSyncExternalStore(O=>iy(S,O),D,D);let I;return R?I=JSON.parse(R):i!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:I={flexGrow:1},h.jsx("div",{...m,"data-disabled":s||void 0,"data-panel":!0,"data-testid":b,id:b,ref:y,style:{...jU,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:h.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:C==="horizontal"?"pan-y":"pan-x"},children:e})})}Yc.displayName="Panel";const jU={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function LU({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,s;const o=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,c=a.collapsible?a.collapsedSize:a.minSize,u=[r,r+1];s=bo({layout:Xc({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=bo({layout:Xc({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:o}}function dy({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:o,...a}){const l=oy(s),c=ly({disabled:n,disableDoubleClick:r}),[u,d]=g.useState({}),[f,p]=g.useState("inactive"),[m,v]=g.useState(!1),b=g.useRef(null),x=ay(b,i),{disableCursor:_,id:y,orientation:w,registerSeparator:S,updateSeparatorProps:C}=uy(),N=w==="horizontal"?"vertical":"horizontal";Lo(()=>{const P=b.current;if(P!==null){const D={disabled:c.disabled,disableDoubleClick:c.disableDoubleClick,element:P,id:l},R=S(D),I=hU(z=>{p(z.next.state!=="inactive"&&z.next.hitRegions.some($=>$.separator===D)?z.next.state:"inactive")}),O=iy(y,z=>{const{derivedPanelConstraints:$,layout:F,separatorToPanels:L}=z.next,B=L.get(D);if(B){const E=B[0],H=B.indexOf(E);d(LU({layout:F,panelConstraints:$,panelId:E.id,panelIndex:H}))}});return()=>{I(),O(),R()}}},[y,l,S,c]),g.useEffect(()=>{C(l,{disabled:n,disableDoubleClick:r})},[n,r,l,C]);let T;n&&!_&&(T="not-allowed");let M;if(n)M="disabled";else switch(f){case"active":{M="active";break}default:m?M="focus":M=f}return h.jsx("div",{...a,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":N,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":M,"data-testid":l,id:l,onBlur:()=>v(!1),onFocus:()=>v(!0),ref:x,role:"separator",style:{flexBasis:"auto",cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}dy.displayName="Separator";function DU(e,t,n,r=!0){const i=g.useRef({sid:null,tsid:void 0});g.useEffect(()=>{const s=i.current;i.current={sid:t,tsid:n},!(!r||!n||s.sid===t&&(s.tsid===void 0||s.tsid===null)&&typeof n=="string")&&e.sessionObserve({sessionId:t,toolSessionId:n}).catch(()=>{})},[e,t,n,r])}function OU(e,t,n){const r=g.useRef(e),i=g.useRef(t),s=g.useRef(n);s.current=n,g.useEffect(()=>{const o=r.current,a=i.current;r.current=e,i.current=t;const l=o!==e,c=typeof a=="string"&&t==null;!l&&!c||s.current()},[e,t])}const BU=/^Scheduled (?:recurring job|one-shot task) ([0-9a-f]{8}) \(([^)]+)\)/;function zU(e){const t=new Map,n=new Map,r=new Map;for(const i of e)if(i.kind==="tool_call"&&i.tool==="CronCreate"){const s=i.input;if(!s||typeof s.cron!="string"||typeof s.prompt!="string")continue;const o=i.ts;t.set(i.toolUseId,{cron:s.cron,prompt:s.prompt,recurring:s.recurring!==!1,ts:typeof o=="string"?o:"",toolUseId:i.toolUseId})}else if(i.kind==="tool_call"&&i.tool==="CronDelete"){const s=i.input;if(!s||typeof s.id!="string")continue;n.set(i.toolUseId,s.id)}else if(i.kind==="tool_result"){const s=t.get(i.toolUseId);if(s){if(t.delete(i.toolUseId),i.error||typeof i.output!="string")continue;const a=i.output.match(BU);if(!a)continue;r.set(a[1],{id:a[1],cron:s.cron,prompt:s.prompt,recurring:s.recurring,humanSchedule:a[2],createdAt:s.ts,toolUseId:s.toolUseId});continue}const o=n.get(i.toolUseId);o!==void 0&&(n.delete(i.toolUseId),i.error||r.delete(o))}return Array.from(r.values()).sort((i,s)=>i.createdAt.localeCompare(s.createdAt))}const $U=["TaskCreate","TaskUpdate","TaskList","TaskGet"];function FU(e){return $U.includes(e)}function mR(e){return e==="in_progress"||e==="completed"?e:"pending"}function HU(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.subject=="string"&&n.subject?n.subject:typeof n.content=="string"&&n.content?n.content:null;if(!r)return e;const i=typeof n.activeForm=="string"?n.activeForm:void 0,s=typeof n.description=="string"?n.description:void 0;return[...e,{id:String(e.length+1),content:r,status:mR(n.status),activeForm:i,description:s}]}function UU(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.taskId=="string"&&n.taskId?n.taskId:typeof n.id=="string"&&n.id?n.id:null;if(!r)return e;const i=e.findIndex(a=>a.id===r);if(i<0)return e;const s=[...e],o={...s[i]};return"status"in n&&(o.status=mR(n.status)),typeof n.subject=="string"&&(o.content=n.subject),typeof n.content=="string"&&(o.content=n.content),typeof n.activeForm=="string"&&(o.activeForm=n.activeForm),typeof n.description=="string"&&(o.description=n.description),s[i]=o,s}function WU(e){let t=[],n=-1;for(let r=0;r<e.length;r++){const i=e[r];if(i.kind==="task-event")switch(n=r,i.name){case"TaskCreate":t=HU(t,i.input);break;case"TaskUpdate":t=UU(t,i.input);break}}return{tasks:t,lastEventIndex:n}}function VU(e){const{tasks:t,lastEventIndex:n}=WU(e);let r=-1;for(let c=e.length-1;c>=0;c--)if(e[c].kind==="todo-checklist"){r=c;break}const i=[],s=new Map,o=new Map,a=new Map,l=(c,u)=>{var f,p,m;const d={agentId:u.agentId,status:u.status};u.description?d.description=u.description:(f=c.progress)!=null&&f.description&&(d.description=c.progress.description),u.lastToolName?d.lastToolName=u.lastToolName:(p=c.progress)!=null&&p.lastToolName&&(d.lastToolName=c.progress.lastToolName),u.stats?d.stats=u.stats:(m=c.progress)!=null&&m.stats&&(d.stats=c.progress.stats),c.progress=d};for(let c=0;c<e.length;c++){const u=e[c];switch(u.kind){case"tool-call":{const d={kind:"merged-tool",seq:u.seq,tool:u.tool,toolKind:u.toolKind,toolUseId:u.toolUseId,input:u.input,pending:!0};s.set(u.toolUseId,i.length),i.push(d);break}case"tool-result":{const d=s.get(u.toolUseId);if(d!==void 0){const p=i[d];p.output=u.output,p.error=u.error,p.pending=!1,s.delete(u.toolUseId);break}const f=o.get(u.toolUseId);if(f!==void 0){const p=i[f];p.output=u.output,p.error=u.error,p.pending=!1,u.toolResultExtra&&(p.toolResultExtra=u.toolResultExtra);break}break}case"agent-call":{const d={kind:"merged-agent",seq:u.seq,toolUseId:u.toolUseId,description:u.description,input:u.input,pending:!0,notifications:[]};o.set(u.toolUseId,i.length),i.push(d);const f=a.get(u.toolUseId);f&&(l(d,f),a.delete(u.toolUseId));break}case"agent-progress":{const d=o.get(u.toolUseId);if(d!==void 0){l(i[d],u);break}a.set(u.toolUseId,u);break}case"agent-notification":{const d=u.parentToolUseId;if(d){const f=o.get(d);if(f!==void 0){i[f].notifications.push({text:u.text,taskId:u.taskId});break}}i.push({kind:"agent-notification",seq:u.seq,text:u.text,taskId:u.taskId,parentToolUseId:u.parentToolUseId});break}case"todo-checklist":{c===r&&u.todos.length>0&&i.push({kind:"todo-checklist",seq:u.seq,toolUseId:u.toolUseId,todos:u.todos});break}case"task-event":{c===n&&t.length>0&&i.push({kind:"plan-card",seq:u.seq,tasks:t});break}default:i.push(u)}}return i}const qU=/<(system-reminder|related-dir|clawd-shift-fire)\b[^>]*>[\s\S]*?<\/\1>/gi,KU=/<builder-preview\b[^>]*\/>/gi;function gR(e){return e?e.replace(qU,"").replace(KU,"").trim():""}const GU=gR;function XU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QU={};function vS(e,t){return(QU.jsx?ZU:YU).test(e)}const JU=/[ \t\n\f\r]/g;function eW(e){return typeof e=="object"?e.type==="text"?xS(e.value):!1:xS(e)}function xS(e){return e.replace(JU,"")===""}class bu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bu.prototype.normal={};bu.prototype.property={};bu.prototype.space=void 0;function vR(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new bu(n,r,t)}function h0(e){return e.toLowerCase()}class Vn{constructor(t,n){this.attribute=n,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let tW=0;const Ie=Do(),Mt=Do(),f0=Do(),Y=Do(),lt=Do(),Na=Do(),Xn=Do();function Do(){return 2**++tW}const p0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Mt,commaOrSpaceSeparated:Xn,commaSeparated:Na,number:Y,overloadedBoolean:f0,spaceSeparated:lt},Symbol.toStringTag,{value:"Module"})),Rm=Object.keys(p0);class hy extends Vn{constructor(t,n,r,i){let s=-1;if(super(t,n),_S(this,"space",i),typeof r=="number")for(;++s<Rm.length;){const o=Rm[s];_S(this,Rm[s],(r&p0[o])===p0[o])}}}hy.prototype.defined=!0;function _S(e,t,n){n&&(e[t]=n)}function cl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new hy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[h0(r)]=r,n[h0(s.attribute)]=r}return new bu(t,n,e.space)}const xR=cl({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:lt,ariaCurrent:null,ariaDescribedBy:lt,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:lt,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:lt,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lt,ariaLevel:Y,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:lt,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:lt,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Mt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _R(e,t){return t in e?e[t]:t}function yR(e,t){return _R(e,t.toLowerCase())}const nW=cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Na,acceptCharset:lt,accessKey:lt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:lt,autoFocus:Ie,autoPlay:Ie,blocking:lt,capture:null,charSet:null,checked:Ie,cite:null,className:lt,cols:Y,colSpan:null,content:null,contentEditable:Mt,controls:Ie,controlsList:lt,coords:Y|Na,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:f0,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:lt,height:Y,hidden:f0,high:Y,href:null,hrefLang:null,htmlFor:lt,httpEquiv:lt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:lt,itemRef:lt,itemScope:Ie,itemType:lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Y,pattern:null,ping:lt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:lt,required:Ie,reversed:Ie,rows:Y,rowSpan:Y,sandbox:lt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Mt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lt,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:yR}),rW=cl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xn,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:lt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Na,g2:Na,glyphName:Na,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_R}),bR=cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wR=cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yR}),SR=cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iW={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sW=/[A-Z]/g,yS=/-[a-z]/g,oW=/^data[-\w.:]+$/i;function aW(e,t){const n=h0(t);let r=t,i=Vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oW.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yS,cW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yS.test(s)){let o=s.replace(sW,lW);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=hy}return new i(r,t)}function lW(e){return"-"+e.toLowerCase()}function cW(e){return e.charAt(1).toUpperCase()}const uW=vR([xR,nW,bR,wR,SR],"html"),fy=vR([xR,rW,bR,wR,SR],"svg");function dW(e){return e.join(" ").trim()}var py={},bS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hW=/\n/g,fW=/^\s*/,pW=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mW=/^:\s*/,gW=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vW=/^[;\s]*/,xW=/^\s+|\s+$/g,_W=`
|
|
495
|
+
`)},e7=0,qo=[];function t7(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),i=g.useState(e7++)[0],s=g.useState(HP)[0],o=g.useRef(e);g.useEffect(function(){o.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=w9([e.lockRef.current],(e.shards||[]).map(Xw),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=g.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!o.current.allowPinchZoom;var x=md(v),_=n.current,y="deltaX"in v?v.deltaX:_[0]-x[0],w="deltaY"in v?v.deltaY:_[1]-x[1],S,C=v.target,N=Math.abs(y)>Math.abs(w)?"h":"v";if("touches"in v&&N==="h"&&C.type==="range")return!1;var T=window.getSelection(),M=T&&T.anchorNode,P=M?M===C||M.contains(C):!1;if(P)return!1;var D=Kw(N,C);if(!D)return!0;if(D?S=N:(S=N==="v"?"h":"v",D=Kw(N,C)),!D)return!1;if(!r.current&&"changedTouches"in v&&(y||w)&&(r.current=S),!S)return!0;var R=r.current||S;return Z9(R,b,v,R==="h"?y:w)},[]),l=g.useCallback(function(v){var b=v;if(!(!qo.length||qo[qo.length-1]!==s)){var x="deltaY"in b?Gw(b):md(b),_=t.current.filter(function(S){return S.name===b.type&&(S.target===b.target||b.target===S.shadowParent)&&Q9(S.delta,x)})[0];if(_&&_.should){b.cancelable&&b.preventDefault();return}if(!_){var y=(o.current.shards||[]).map(Xw).filter(Boolean).filter(function(S){return S.contains(b.target)}),w=y.length>0?a(b,y[0]):!o.current.noIsolation;w&&b.cancelable&&b.preventDefault()}}},[]),c=g.useCallback(function(v,b,x,_){var y={name:v,delta:b,target:x,should:_,shadowParent:n7(x)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(w){return w!==y})},1)},[]),u=g.useCallback(function(v){n.current=md(v),r.current=void 0},[]),d=g.useCallback(function(v){c(v.type,Gw(v),v.target,a(v,e.lockRef.current))},[]),f=g.useCallback(function(v){c(v.type,md(v),v.target,a(v,e.lockRef.current))},[]);g.useEffect(function(){return qo.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,Vo),document.addEventListener("touchmove",l,Vo),document.addEventListener("touchstart",u,Vo),function(){qo=qo.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,Vo),document.removeEventListener("touchmove",l,Vo),document.removeEventListener("touchstart",u,Vo)}},[]);var p=e.removeScrollBar,m=e.inert;return g.createElement(g.Fragment,null,m?g.createElement(s,{styles:J9(i)}):null,p?g.createElement(W9,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function n7(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r7=R9(FP,t7);var H_=g.forwardRef(function(e,t){return g.createElement(sp,Xr({},e,{ref:t,sideCar:r7}))});H_.classNames=sp.classNames;var a0=["Enter"," "],i7=["ArrowDown","PageUp","Home"],qP=["ArrowUp","PageDown","End"],s7=[...i7,...qP],o7={ltr:[...a0,"ArrowRight"],rtl:[...a0,"ArrowLeft"]},a7={ltr:["ArrowLeft"],rtl:["ArrowRight"]},_u="Menu",[qc,l7,c7]=eP(_u),[Mo,KP]=Ro(_u,[c7,ip,MP]),op=ip(),GP=MP(),[u7,Ao]=Mo(_u),[d7,yu]=Mo(_u),XP=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=op(t),[l,c]=g.useState(null),u=g.useRef(!1),d=ji(s),f=tP(i);return g.useEffect(()=>{const p=()=>{u.current=!0,document.addEventListener("pointerdown",m,{capture:!0,once:!0}),document.addEventListener("pointermove",m,{capture:!0,once:!0})},m=()=>u.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",m,{capture:!0}),document.removeEventListener("pointermove",m,{capture:!0})}},[]),h.jsx(NP,{...a,children:h.jsx(u7,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:h.jsx(d7,{scope:t,onClose:g.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};XP.displayName=_u;var h7="MenuAnchor",U_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=op(n);return h.jsx(TP,{...i,...r,ref:t})});U_.displayName=h7;var W_="MenuPortal",[f7,YP]=Mo(W_,{forceMount:void 0}),ZP=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Ao(W_,t);return h.jsx(f7,{scope:t,forceMount:n,children:h.jsx(Hi,{present:n||s.open,children:h.jsx(F_,{asChild:!0,container:i,children:r})})})};ZP.displayName=W_;var xr="MenuContent",[p7,V_]=Mo(xr),QP=g.forwardRef((e,t)=>{const n=YP(xr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ao(xr,e.__scopeMenu),o=yu(xr,e.__scopeMenu);return h.jsx(qc.Provider,{scope:e.__scopeMenu,children:h.jsx(Hi,{present:r||s.open,children:h.jsx(qc.Slot,{scope:e.__scopeMenu,children:o.modal?h.jsx(m7,{...i,ref:t}):h.jsx(g7,{...i,ref:t})})})})}),m7=g.forwardRef((e,t)=>{const n=Ao(xr,e.__scopeMenu),r=g.useRef(null),i=qt(t,r);return g.useEffect(()=>{const s=r.current;if(s)return BP(s)},[]),h.jsx(q_,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Pe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),g7=g.forwardRef((e,t)=>{const n=Ao(xr,e.__scopeMenu);return h.jsx(q_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),v7=Wc("MenuContent.ScrollLock"),q_=g.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...v}=e,b=Ao(xr,n),x=yu(xr,n),_=op(n),y=GP(n),w=l7(n),[S,C]=g.useState(null),N=g.useRef(null),T=qt(t,N,b.onContentChange),M=g.useRef(0),P=g.useRef(""),D=g.useRef(0),R=g.useRef(null),I=g.useRef("right"),O=g.useRef(0),z=m?H_:g.Fragment,$=m?{as:v7,allowPinchZoom:!0}:void 0,F=B=>{var pe,Oe;const E=P.current+B,H=w().filter(ie=>!ie.disabled),q=document.activeElement,A=(pe=H.find(ie=>ie.ref.current===q))==null?void 0:pe.textValue,re=H.map(ie=>ie.textValue),oe=P7(re,E,A),V=(Oe=H.find(ie=>ie.textValue===oe))==null?void 0:Oe.ref.current;(function ie(Ae){P.current=Ae,window.clearTimeout(M.current),Ae!==""&&(M.current=window.setTimeout(()=>ie(""),1e3))})(E),V&&setTimeout(()=>V.focus())};g.useEffect(()=>()=>window.clearTimeout(M.current),[]),iP();const L=g.useCallback(B=>{var H,q;return I.current===((H=R.current)==null?void 0:H.side)&&R7(B,(q=R.current)==null?void 0:q.area)},[]);return h.jsx(p7,{scope:n,searchRef:P,onItemEnter:g.useCallback(B=>{L(B)&&B.preventDefault()},[L]),onItemLeave:g.useCallback(B=>{var E;L(B)||((E=N.current)==null||E.focus(),C(null))},[L]),onTriggerLeave:g.useCallback(B=>{L(B)&&B.preventDefault()},[L]),pointerGraceTimerRef:D,onPointerGraceIntentChange:g.useCallback(B=>{R.current=B},[]),children:h.jsx(z,{...$,children:h.jsx(M_,{asChild:!0,trapped:i,onMountAutoFocus:Pe(s,B=>{var E;B.preventDefault(),(E=N.current)==null||E.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:h.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:h.jsx(v9,{asChild:!0,...y,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:Pe(l,B=>{x.isUsingKeyboardRef.current||B.preventDefault()}),preventScrollOnEntryFocus:!0,children:h.jsx(PP,{role:"menu","aria-orientation":"vertical","data-state":pI(b.open),"data-radix-menu-content":"",dir:x.dir,..._,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:Pe(v.onKeyDown,B=>{const H=B.target.closest("[data-radix-menu-content]")===B.currentTarget,q=B.ctrlKey||B.altKey||B.metaKey,A=B.key.length===1;H&&(B.key==="Tab"&&B.preventDefault(),!q&&A&&F(B.key));const re=N.current;if(B.target!==re||!s7.includes(B.key))return;B.preventDefault();const V=w().filter(pe=>!pe.disabled).map(pe=>pe.ref.current);qP.includes(B.key)&&V.reverse(),N7(V)}),onBlur:Pe(e.onBlur,B=>{B.currentTarget.contains(B.target)||(window.clearTimeout(M.current),P.current="")}),onPointerMove:Pe(e.onPointerMove,Kc(B=>{const E=B.target,H=O.current!==B.clientX;if(B.currentTarget.contains(E)&&H){const q=B.clientX>O.current?"right":"left";I.current=q,O.current=B.clientX}}))})})})})})})});QP.displayName=xr;var x7="MenuGroup",K_=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"group",...r,ref:t})});K_.displayName=x7;var _7="MenuLabel",JP=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{...r,ref:t})});JP.displayName=_7;var Qh="MenuItem",Yw="menu.itemSelect",ap=g.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=g.useRef(null),o=yu(Qh,e.__scopeMenu),a=V_(Qh,e.__scopeMenu),l=qt(t,s),c=g.useRef(!1),u=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(Yw,{bubbles:!0,cancelable:!0});d.addEventListener(Yw,p=>r==null?void 0:r(p),{once:!0}),JT(d,f),f.defaultPrevented?c.current=!1:o.onClose()}};return h.jsx(eI,{...i,ref:l,disabled:n,onClick:Pe(e.onClick,u),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:Pe(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:Pe(e.onKeyDown,d=>{const f=a.searchRef.current!=="";n||f&&d.key===" "||a0.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});ap.displayName=Qh;var eI=g.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=V_(Qh,n),a=GP(n),l=g.useRef(null),c=qt(t,l),[u,d]=g.useState(!1),[f,p]=g.useState("");return g.useEffect(()=>{const m=l.current;m&&p((m.textContent??"").trim())},[s.children]),h.jsx(qc.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:h.jsx(x9,{asChild:!0,...a,focusable:!r,children:h.jsx(Et.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:Pe(e.onPointerMove,Kc(m=>{r?o.onItemLeave(m):(o.onItemEnter(m),m.defaultPrevented||m.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Pe(e.onPointerLeave,Kc(m=>o.onItemLeave(m))),onFocus:Pe(e.onFocus,()=>d(!0)),onBlur:Pe(e.onBlur,()=>d(!1))})})})}),y7="MenuCheckboxItem",tI=g.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return h.jsx(oI,{scope:e.__scopeMenu,checked:n,children:h.jsx(ap,{role:"menuitemcheckbox","aria-checked":Jh(n)?"mixed":n,...i,ref:t,"data-state":X_(n),onSelect:Pe(i.onSelect,()=>r==null?void 0:r(Jh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});tI.displayName=y7;var nI="MenuRadioGroup",[b7,w7]=Mo(nI,{value:void 0,onValueChange:()=>{}}),rI=g.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=ji(r);return h.jsx(b7,{scope:e.__scopeMenu,value:n,onValueChange:s,children:h.jsx(K_,{...i,ref:t})})});rI.displayName=nI;var iI="MenuRadioItem",sI=g.forwardRef((e,t)=>{const{value:n,...r}=e,i=w7(iI,e.__scopeMenu),s=n===i.value;return h.jsx(oI,{scope:e.__scopeMenu,checked:s,children:h.jsx(ap,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":X_(s),onSelect:Pe(r.onSelect,()=>{var o;return(o=i.onValueChange)==null?void 0:o.call(i,n)},{checkForDefaultPrevented:!1})})})});sI.displayName=iI;var G_="MenuItemIndicator",[oI,S7]=Mo(G_,{checked:!1}),aI=g.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=S7(G_,n);return h.jsx(Hi,{present:r||Jh(s.checked)||s.checked===!0,children:h.jsx(Et.span,{...i,ref:t,"data-state":X_(s.checked)})})});aI.displayName=G_;var k7="MenuSeparator",lI=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return h.jsx(Et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});lI.displayName=k7;var C7="MenuArrow",cI=g.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=op(n);return h.jsx(IP,{...i,...r,ref:t})});cI.displayName=C7;var E7="MenuSub",[Vie,uI]=Mo(E7),Vl="MenuSubTrigger",dI=g.forwardRef((e,t)=>{const n=Ao(Vl,e.__scopeMenu),r=yu(Vl,e.__scopeMenu),i=uI(Vl,e.__scopeMenu),s=V_(Vl,e.__scopeMenu),o=g.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},u=g.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return g.useEffect(()=>u,[u]),g.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),h.jsx(U_,{asChild:!0,...c,children:h.jsx(eI,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":pI(n.open),...e,ref:gu(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Pe(e.onPointerMove,Kc(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:Pe(e.onPointerLeave,Kc(d=>{var p,m;u();const f=(p=n.content)==null?void 0:p.getBoundingClientRect();if(f){const v=(m=n.content)==null?void 0:m.dataset.side,b=v==="right",x=b?-5:5,_=f[b?"left":"right"],y=f[b?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+x,y:d.clientY},{x:_,y:f.top},{x:y,y:f.top},{x:y,y:f.bottom},{x:_,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:Pe(e.onKeyDown,d=>{var p;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||o7[r.dir].includes(d.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),d.preventDefault())})})})});dI.displayName=Vl;var hI="MenuSubContent",fI=g.forwardRef((e,t)=>{const n=YP(xr,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Ao(xr,e.__scopeMenu),o=yu(xr,e.__scopeMenu),a=uI(hI,e.__scopeMenu),l=g.useRef(null),c=qt(t,l);return h.jsx(qc.Provider,{scope:e.__scopeMenu,children:h.jsx(Hi,{present:r||s.open,children:h.jsx(qc.Slot,{scope:e.__scopeMenu,children:h.jsx(q_,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var d;o.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:Pe(e.onFocusOutside,u=>{u.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:Pe(e.onEscapeKeyDown,u=>{o.onClose(),u.preventDefault()}),onKeyDown:Pe(e.onKeyDown,u=>{var p;const d=u.currentTarget.contains(u.target),f=a7[o.dir].includes(u.key);d&&f&&(s.onOpenChange(!1),(p=a.trigger)==null||p.focus(),u.preventDefault())})})})})})});fI.displayName=hI;function pI(e){return e?"open":"closed"}function Jh(e){return e==="indeterminate"}function X_(e){return Jh(e)?"indeterminate":e?"checked":"unchecked"}function N7(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function T7(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function P7(e,t,n){const i=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=T7(e,Math.max(s,0));i.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function I7(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function R7(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return I7(n,t)}function Kc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var M7=XP,A7=U_,j7=ZP,L7=QP,D7=K_,O7=JP,B7=ap,z7=tI,$7=rI,F7=sI,H7=aI,U7=lI,W7=cI,V7=dI,q7=fI,lp="DropdownMenu",[K7]=Ro(lp,[KP]),Mn=KP(),[G7,mI]=K7(lp),gI=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=Mn(t),c=g.useRef(null),[u,d]=Qf({prop:i,defaultProp:s??!1,onChange:o,caller:lp});return h.jsx(G7,{scope:t,triggerId:oo(),triggerRef:c,contentId:oo(),open:u,onOpenChange:d,onOpenToggle:g.useCallback(()=>d(f=>!f),[d]),modal:a,children:h.jsx(M7,{...l,open:u,onOpenChange:d,dir:r,modal:a,children:n})})};gI.displayName=lp;var vI="DropdownMenuTrigger",xI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=mI(vI,n),o=Mn(n);return h.jsx(A7,{asChild:!0,...o,children:h.jsx(Et.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:gu(t,s.triggerRef),onPointerDown:Pe(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:Pe(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});xI.displayName=vI;var X7="DropdownMenuPortal",_I=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mn(t);return h.jsx(j7,{...r,...n})};_I.displayName=X7;var yI="DropdownMenuContent",bI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=mI(yI,n),s=Mn(n),o=g.useRef(!1);return h.jsx(L7,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:Pe(e.onCloseAutoFocus,a=>{var l;o.current||(l=i.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:Pe(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!i.modal||u)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bI.displayName=yI;var Y7="DropdownMenuGroup",Z7=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(D7,{...i,...r,ref:t})});Z7.displayName=Y7;var Q7="DropdownMenuLabel",wI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(O7,{...i,...r,ref:t})});wI.displayName=Q7;var J7="DropdownMenuItem",SI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(B7,{...i,...r,ref:t})});SI.displayName=J7;var eH="DropdownMenuCheckboxItem",kI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(z7,{...i,...r,ref:t})});kI.displayName=eH;var tH="DropdownMenuRadioGroup",nH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx($7,{...i,...r,ref:t})});nH.displayName=tH;var rH="DropdownMenuRadioItem",iH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(F7,{...i,...r,ref:t})});iH.displayName=rH;var sH="DropdownMenuItemIndicator",CI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(H7,{...i,...r,ref:t})});CI.displayName=sH;var oH="DropdownMenuSeparator",EI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(U7,{...i,...r,ref:t})});EI.displayName=oH;var aH="DropdownMenuArrow",lH=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(W7,{...i,...r,ref:t})});lH.displayName=aH;var cH="DropdownMenuSubTrigger",NI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(V7,{...i,...r,ref:t})});NI.displayName=cH;var uH="DropdownMenuSubContent",TI=g.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=Mn(n);return h.jsx(q7,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});TI.displayName=uH;var dH=gI,hH=xI,PI=_I,II=bI,RI=wI,MI=SI,AI=kI,fH=CI,jI=EI,LI=NI,DI=TI;const OI=dH,BI=hH,Y_=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(PI,{children:h.jsx(II,{ref:r,sideOffset:t,className:ne("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-elevated p-1","text-text-100 shadow-md",e),...n})}));Y_.displayName=II.displayName;const pH=g.forwardRef(({className:e,...t},n)=>h.jsx(LI,{ref:n,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-bg-200 focus:text-text-100 data-[highlighted]:bg-bg-200 data-[highlighted]:text-text-100 data-[state=open]:bg-bg-200","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));pH.displayName=LI.displayName;const mH=g.forwardRef(({className:e,...t},n)=>h.jsx(PI,{children:h.jsx(DI,{ref:n,className:ne("z-50 min-w-[6rem] overflow-hidden rounded-md border border-border bg-elevated p-1","text-text-100 shadow-md",e),...t})}));mH.displayName=DI.displayName;const cs=g.forwardRef(({className:e,inset:t,...n},r)=>h.jsx(MI,{ref:r,className:ne("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none","focus:bg-bg-200 focus:text-text-100 data-[highlighted]:bg-bg-200 data-[highlighted]:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));cs.displayName=MI.displayName;const gH=g.forwardRef(({className:e,children:t,checked:n,...r},i)=>h.jsxs(AI,{ref:i,checked:n,className:ne("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-7 pr-2 text-sm outline-none","focus:bg-bg-200 focus:text-text-100 data-[highlighted]:bg-bg-200 data-[highlighted]:text-text-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[h.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:h.jsx(fH,{children:h.jsx(ol,{className:"h-3.5 w-3.5"})})}),t]}));gH.displayName=AI.displayName;const zI=g.forwardRef(({className:e,...t},n)=>h.jsx(jI,{ref:n,className:ne("-mx-1 my-1 h-px bg-border",e),...t}));zI.displayName=jI.displayName;const vH=g.forwardRef(({className:e,...t},n)=>h.jsx(RI,{ref:n,className:ne("px-2 py-1.5 text-xs font-semibold text-text-400",e),...t}));vH.displayName=RI.displayName;function xH({iconKey:e,tool:t,className:n}){const r=R_(t),i=YT(e);if(!i)return h.jsx(Yf,{className:ne("w-3.5 h-3.5 shrink-0",r,n),"data-testid":"session-icon-default","aria-label":"未分类"});const s=i.Icon;return h.jsx(s,{className:ne("w-3.5 h-3.5 shrink-0",r,n),"data-testid":`session-icon-${i.key}`,"aria-label":i.label})}var _H=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),yH="VisuallyHidden",$I=g.forwardRef((e,t)=>h.jsx(Et.span,{...e,ref:t,style:{..._H,...e.style}}));$I.displayName=yH;var bH=$I,[cp]=Ro("Tooltip",[ip]),up=ip(),FI="TooltipProvider",wH=700,l0="tooltip.open",[SH,Z_]=cp(FI),HI=e=>{const{__scopeTooltip:t,delayDuration:n=wH,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=g.useRef(!0),a=g.useRef(!1),l=g.useRef(0);return g.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),h.jsx(SH,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:g.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:g.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:g.useCallback(c=>{a.current=c},[]),disableHoverableContent:i,children:s})};HI.displayName=FI;var Gc="Tooltip",[kH,dp]=cp(Gc),UI=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=Z_(Gc,e.__scopeTooltip),c=up(t),[u,d]=g.useState(null),f=oo(),p=g.useRef(0),m=o??l.disableHoverableContent,v=a??l.delayDuration,b=g.useRef(!1),[x,_]=Qf({prop:r,defaultProp:i??!1,onChange:N=>{N?(l.onOpen(),document.dispatchEvent(new CustomEvent(l0))):l.onClose(),s==null||s(N)},caller:Gc}),y=g.useMemo(()=>x?b.current?"delayed-open":"instant-open":"closed",[x]),w=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,b.current=!1,_(!0)},[_]),S=g.useCallback(()=>{window.clearTimeout(p.current),p.current=0,_(!1)},[_]),C=g.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{b.current=!0,_(!0),p.current=0},v)},[v,_]);return g.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),h.jsx(NP,{...c,children:h.jsx(kH,{scope:t,contentId:f,open:x,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:g.useCallback(()=>{l.isOpenDelayedRef.current?C():w()},[l.isOpenDelayedRef,C,w]),onTriggerLeave:g.useCallback(()=>{m?S():(window.clearTimeout(p.current),p.current=0)},[S,m]),onOpen:w,onClose:S,disableHoverableContent:m,children:n})})};UI.displayName=Gc;var c0="TooltipTrigger",WI=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=dp(c0,n),s=Z_(c0,n),o=up(n),a=g.useRef(null),l=qt(t,a,i.onTriggerChange),c=g.useRef(!1),u=g.useRef(!1),d=g.useCallback(()=>c.current=!1,[]);return g.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),h.jsx(TP,{asChild:!0,...o,children:h.jsx(Et.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:Pe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!u.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),u.current=!0)}),onPointerLeave:Pe(e.onPointerLeave,()=>{i.onTriggerLeave(),u.current=!1}),onPointerDown:Pe(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:Pe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Pe(e.onBlur,i.onClose),onClick:Pe(e.onClick,i.onClose)})})});WI.displayName=c0;var CH="TooltipPortal",[qie,EH]=cp(CH,{forceMount:void 0}),Fa="TooltipContent",VI=g.forwardRef((e,t)=>{const n=EH(Fa,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,o=dp(Fa,e.__scopeTooltip);return h.jsx(Hi,{present:r||o.open,children:o.disableHoverableContent?h.jsx(qI,{side:i,...s,ref:t}):h.jsx(NH,{side:i,...s,ref:t})})}),NH=g.forwardRef((e,t)=>{const n=dp(Fa,e.__scopeTooltip),r=Z_(Fa,e.__scopeTooltip),i=g.useRef(null),s=qt(t,i),[o,a]=g.useState(null),{trigger:l,onClose:c}=n,u=i.current,{onPointerInTransitChange:d}=r,f=g.useCallback(()=>{a(null),d(!1)},[d]),p=g.useCallback((m,v)=>{const b=m.currentTarget,x={x:m.clientX,y:m.clientY},_=MH(x,b.getBoundingClientRect()),y=AH(x,_),w=jH(v.getBoundingClientRect()),S=DH([...y,...w]);a(S),d(!0)},[d]);return g.useEffect(()=>()=>f(),[f]),g.useEffect(()=>{if(l&&u){const m=b=>p(b,u),v=b=>p(b,l);return l.addEventListener("pointerleave",m),u.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",m),u.removeEventListener("pointerleave",v)}}},[l,u,p,f]),g.useEffect(()=>{if(o){const m=v=>{const b=v.target,x={x:v.clientX,y:v.clientY},_=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),y=!LH(x,o);_?f():y&&(f(),c())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,u,o,c,f]),h.jsx(qI,{...e,ref:s})}),[TH,PH]=cp(Gc,{isInside:!1}),IH=bF("TooltipContent"),qI=g.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:o,...a}=e,l=dp(Fa,n),c=up(n),{onClose:u}=l;return g.useEffect(()=>(document.addEventListener(l0,u),()=>document.removeEventListener(l0,u)),[u]),g.useEffect(()=>{if(l.trigger){const d=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),h.jsx(Jf,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:h.jsxs(PP,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(IH,{children:r}),h.jsx(TH,{scope:n,isInside:!0,children:h.jsx(bH,{id:l.contentId,role:"tooltip",children:i||r})})]})})});VI.displayName=Fa;var KI="TooltipArrow",RH=g.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=up(n);return PH(KI,n).isInside?null:h.jsx(IP,{...i,...r,ref:t})});RH.displayName=KI;function MH(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function AH(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function jH(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function LH(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],c=a.x,u=a.y,d=l.x,f=l.y;u>r!=f>r&&n<(d-c)*(r-u)/(f-u)+c&&(i=!i)}return i}function DH(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),OH(t)}function OH(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var BH=HI,zH=UI,$H=WI,GI=VI;const Q_=BH,J_=zH,ey=$H,hp=g.forwardRef(({className:e,sideOffset:t=4,...n},r)=>h.jsx(GI,{ref:r,sideOffset:t,className:ne("z-50 overflow-hidden rounded-sm border border-border bg-bg-0 px-2 py-1 text-xs text-text-300 shadow-md",e),...n}));hp.displayName=GI.displayName;function XI({value:e,onChange:t,tool:n}){const r=R_(n);return h.jsx(Q_,{delayDuration:150,children:h.jsx("div",{className:"flex items-center gap-1 flex-wrap","data-testid":"session-icon-picker",children:XT.map(i=>{const s=i.Icon,o=e===i.key;return h.jsxs(J_,{children:[h.jsx(ey,{asChild:!0,children:h.jsx("button",{type:"button",onClick:()=>t(o?null:i.key),"data-testid":`session-icon-option-${i.key}`,"aria-label":i.label,"aria-pressed":o,className:ne("w-8 h-8 rounded-md flex items-center justify-center transition-colors cursor-pointer",o?"bg-text-100/10 ring-1 ring-text-100/30":"hover:bg-text-100/5"),children:h.jsx(s,{className:ne("w-4 h-4",r)})})}),h.jsx(hp,{side:"bottom",children:i.label})]},i.key)})})})}function FH({open:e,initialLabel:t,initialIconKey:n,placeholder:r,onSubmit:i,onCancel:s,tool:o}){const[a,l]=g.useState(t),[c,u]=g.useState(n);return g.useEffect(()=>{e&&(l(t),u(n))},[e,t,n]),g.useEffect(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&s()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,s]),e?hu.createPortal(h.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-bg-0/40 backdrop-blur-[2px]",onClick:s,"data-testid":"session-edit-dialog-overlay",children:h.jsxs("div",{"data-testid":"session-edit-dialog",className:"w-[420px] max-w-[calc(100vw-32px)] rounded-2xl border border-text-100/[0.12] flex flex-col gap-4 p-5",style:{backgroundColor:"var(--bg-0)",boxShadow:"0 12px 40px rgba(0,0,0,0.04)"},onClick:d=>d.stopPropagation(),children:[h.jsx("div",{className:"text-[15px] font-semibold text-text-100",children:"Edit session"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Label"}),h.jsx("input",{autoFocus:!0,type:"text",value:a,onChange:d=>l(d.target.value),placeholder:r,"data-testid":"session-edit-dialog-label",className:"w-full px-3 py-2 text-[13px] bg-bg-50 border border-bg-300 rounded-lg focus:outline-none focus:border-text-300 transition-colors"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[12px] font-semibold text-text-200 mb-1",children:"Icon"}),h.jsx(XI,{value:c,onChange:u,tool:o})]}),h.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[h.jsx("button",{type:"button",onClick:s,className:"px-4 py-1.5 text-[12px] text-text-300 rounded-lg hover:bg-text-100/5 transition-colors cursor-pointer",children:"Cancel"}),h.jsx("button",{type:"button",onClick:()=>i({label:a.trim(),iconKey:c}),"data-testid":"session-edit-dialog-save",className:"px-4 py-1.5 text-[12px] font-medium text-bg-0 rounded-lg bg-text-100 hover:bg-text-200 transition-colors cursor-pointer",children:"Save"})]})]})}),document.body):null}const HH=10,UH=20,WH=16,VH=20,qH=60,KH=4;function GH({session:e,active:t,hasUnread:n,running:r=!1,awaitingUser:i=!1,onSelect:s,onEdit:o,onDelete:a,onPin:l,onArchive:c,archiveShortcut:u=!1,depth:d=0,chevron:f,showCopyResume:p=!0,contactDisplayName:m}){const[v,b]=g.useState(!1),x=!!e.pinnedAt,_=d===0,y=d===0&&!!c,w=HH+d*UH,S=g.useCallback(async()=>{const M=e.toolSessionId;if(!M)return;const D=`cd ${`'${e.cwd.replace(/'/g,"'\\''")}'`} && claude --resume ${M} --permission-mode bypassPermissions`;try{await navigator.clipboard.writeText(D)}catch{}},[e.toolSessionId,e.cwd]),C=e.appBuilderProject?`[app] ${e.appBuilderProject}`:e.label||e.larkChatName||e.larkChatId||e.cwd.split("/").filter(Boolean).pop()||e.sessionId.slice(0,8),N=e.originOwnerPrincipalId,T=N?`@${m??`…${N.slice(-8)}`}`:null;return h.jsxs(h.Fragment,{children:[h.jsxs("div",{"data-testid":`session-item-${e.sessionId}`,onClick:s,style:{paddingLeft:w,display:"grid",gridTemplateColumns:`${WH}px ${VH}px 1fr auto ${qH}px`,gridTemplateAreas:'"chev icon name dot time" ". . sub sub sub"',columnGap:`${KH}px`,rowGap:"2px",alignItems:"center"},className:ne("group relative rounded-lg cursor-pointer transition-all duration-150 pr-2.5 py-1.5",t?"bg-accent-dim":"hover:bg-sidebar-hover-bg"),children:[t?h.jsx("span",{"aria-hidden":"true",className:"absolute left-0 top-1/2 -translate-y-1/2 w-[3px] h-7 rounded-r-full bg-accent"}):null,h.jsx("div",{style:{gridArea:"chev"},className:"flex items-center justify-center",children:f??null}),h.jsx("div",{style:{gridArea:"icon"},className:"flex items-center justify-center",children:h.jsx(xH,{iconKey:e.iconKey,tool:e.tool})}),h.jsxs("div",{style:{gridArea:"name"},className:"flex items-center gap-1 min-w-0",children:[e.dispatchedFromSessionId?h.jsx(dz,{"data-testid":`dispatched-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"dispatched from another session",children:h.jsx("title",{children:"由另一个 session dispatch 派生"})}):null,e.shiftFiredFromSessionId?h.jsx(L6,{"data-testid":`shift-fired-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"fired by clawd-shift scheduler",children:h.jsx("title",{children:"由 shift 排班到点 fire 派生"})}):null,e.larkChatId?h.jsx(zz,{"data-testid":`lark-chat-icon-${e.sessionId}`,className:"w-3 h-3 text-accent shrink-0",strokeWidth:2.25,"aria-label":"driven by feishu chat",children:h.jsx("title",{children:e.larkChatType==="p2p"?"飞书私聊会话(对方消息驱动)":"飞书群会话(群成员 @ bot 驱动)"})}):null,h.jsx("span",{"data-testid":`session-title-${e.sessionId}`,className:ne("text-[13px] truncate min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-words",t?"text-text-100 font-medium":"text-text-200"),children:C})]}),i?h.jsx($6,{"data-testid":`awaiting-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-3 h-3 text-warning shrink-0 animate-pulse",strokeWidth:2.25,"aria-label":"awaiting user"}):n?h.jsx("span",{"data-testid":`unread-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-error shrink-0","aria-label":"unread"}):r?h.jsx("span",{"data-testid":`running-dot-${e.sessionId}`,style:{gridArea:"dot"},className:"w-2 h-2 rounded-full bg-success shrink-0 animate-pulse","aria-label":"running"}):null,h.jsx("span",{style:{gridArea:"time"},className:ne("text-[11px] text-text-400/70 text-right shrink-0","transition-opacity duration-150 group-hover:opacity-0"),children:e.updatedAt?pF(e.updatedAt):""}),h.jsxs("span",{style:{gridArea:"sub"},className:ne("flex items-center gap-1.5 text-[11px] text-text-400/70 min-w-0","group-hover:flex-wrap"),children:[T?h.jsx("span",{"data-testid":`session-mirror-chip-${e.sessionId}`,title:`在 ${T.replace(/^@/,"")} 的设备上`,className:"shrink-0 inline-flex items-center px-1.5 py-0 rounded text-[10px] bg-accent-dim/40 text-accent border border-accent/20 max-w-[120px] truncate",children:T}):null,h.jsx("span",{"data-testid":`session-subtitle-${e.sessionId}`,className:ne("block text-[11px] text-text-400/70 truncate font-mono min-w-0","group-hover:whitespace-normal group-hover:overflow-visible group-hover:break-all"),children:e.cwd.replace(/^\/Users\/[^/]+/,"~")})]}),o||a||l||c?h.jsxs("div",{className:"absolute right-2 top-[3px] flex items-center opacity-0 group-hover:opacity-100 data-[state=open]:opacity-100 transition-opacity",children:[u&&y&&c?h.jsx("button",{type:"button",title:"归档",onClick:M=>{M.stopPropagation(),c(e.sessionId,!0)},className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"archive session","data-testid":`archive-shortcut-${e.sessionId}`,children:h.jsx(xw,{className:"w-4 h-4"})}):null,h.jsxs(OI,{modal:!1,children:[h.jsx(BI,{asChild:!0,children:h.jsx("button",{type:"button",onClick:M=>M.stopPropagation(),className:"flex items-center justify-center w-7 h-7 rounded-md text-text-400 hover:text-text-100 hover:bg-text-100/5 transition-colors cursor-pointer","aria-label":"session actions","data-testid":`session-menu-${e.sessionId}`,children:h.jsx(Qv,{className:"w-4 h-4"})})}),h.jsxs(Y_,{align:"end",onClick:M=>M.stopPropagation(),children:[l&&_&&h.jsxs(cs,{onSelect:()=>l(e.sessionId,!x),"data-testid":`session-${x?"unpin":"pin"}-${e.sessionId}`,children:[x?h.jsx(Kz,{className:"w-3 h-3 mr-2 text-text-400"}):h.jsx(IT,{className:"w-3 h-3 mr-2 text-text-400"}),x?"Unpin":"Pin"]}),y&&c&&h.jsxs(cs,{onSelect:()=>c(e.sessionId,!0),"data-testid":`session-archive-${e.sessionId}`,children:[h.jsx(xw,{className:"w-3 h-3 mr-2 text-text-400"}),"Archive"]}),o&&h.jsxs(cs,{onSelect:()=>b(!0),"data-testid":`session-rename-${e.sessionId}`,children:[h.jsx(PT,{className:"w-3 h-3 mr-2 text-text-400"}),"Rename"]}),p&&e.toolSessionId?h.jsxs(cs,{onSelect:()=>void S(),"data-testid":`session-copy-resume-${e.sessionId}`,children:[h.jsx(mu,{className:"w-3 h-3 mr-2 text-text-400"}),"Copy Resume Command"]}):null,(l||o||p&&e.toolSessionId)&&a&&h.jsx(zI,{}),a&&h.jsxs(cs,{onSelect:()=>void a(e.sessionId),className:"text-destructive focus:text-destructive focus:bg-destructive/10","data-testid":`session-delete-${e.sessionId}`,children:[h.jsx(N_,{className:"w-3 h-3 mr-2"}),"Delete"]})]})]})]}):null]}),o?h.jsx(FH,{open:v,initialLabel:e.label??"",initialIconKey:e.iconKey??null,tool:e.tool,placeholder:e.cwd.split("/").pop()||"",onSubmit:M=>{o(e.sessionId,M),b(!1)},onCancel:()=>b(!1)}):null]})}function ty({node:e,depth:t=0,activeId:n,unreadIds:r,runningIds:i,awaitingIds:s,onSelect:o,onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,getContactDisplayName:f,showCopyResume:p}){const m=e.children.length>0,{isCollapsed:v,toggle:b}=T6(),x=!v(e.session.sessionId),_=g.useCallback(w=>{w.stopPropagation(),b(e.session.sessionId)},[b,e.session.sessionId]),y=m?h.jsx("button",{type:"button",onClick:_,"data-testid":`session-chevron-${e.session.sessionId}`,"aria-label":x?"collapse":"expand","aria-expanded":x,className:"shrink-0 flex items-center justify-center w-4 h-4 text-text-400 hover:text-text-100 cursor-pointer",children:x?h.jsx(ci,{className:"w-3 h-3"}):h.jsx(ui,{className:"w-3 h-3"})}):null;return h.jsxs("div",{"data-testid":`session-tree-node-${e.session.sessionId}`,children:[h.jsx(GH,{session:e.session,active:n===e.session.sessionId,hasUnread:(r==null?void 0:r.has(e.session.sessionId))??!1,running:(i==null?void 0:i.has(e.session.sessionId))??!1,awaitingUser:(s==null?void 0:s.has(e.session.sessionId))??!1,onSelect:()=>o(e.session.sessionId),onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,showCopyResume:p,depth:t,chevron:y,contactDisplayName:e.session.originOwnerPrincipalId?f==null?void 0:f(e.session.originOwnerPrincipalId):void 0}),m&&x?h.jsx("div",{"data-testid":`session-tree-children-${e.session.sessionId}`,children:e.children.map(w=>h.jsx(ty,{node:w,depth:t+1,activeId:n,unreadIds:r,runningIds:i,awaitingIds:s,onSelect:o,onEdit:a,onDelete:l,onPin:c,onArchive:u,archiveShortcut:d,getContactDisplayName:f,showCopyResume:p},w.session.sessionId))}):null]})}function XH(e){return e.forkedFromSessionId??e.dispatchedFromSessionId??e.shiftFiredFromSessionId}function YI(e){e=e.filter(s=>!s.ephemeral);const t=new Map;for(const s of e)t.set(s.sessionId,s);const n=new Map,r=[];for(const s of e){const o=XH(s);if(o&&t.has(o)){const a=n.get(o)??[];a.push(s),n.set(o,a)}else r.push(s)}const i=s=>{const a=[...n.get(s.sessionId)??[]].sort((l,c)=>l.createdAt<c.createdAt?-1:l.createdAt>c.createdAt?1:0);return{session:s,children:a.map(i)}};return[...r].sort(YH).map(i)}function ZI(e){return[...e].sort((t,n)=>t.session.updatedAt<n.session.updatedAt?1:t.session.updatedAt>n.session.updatedAt?-1:0)}function YH(e,t){const n=typeof e.pinnedAt=="number",r=typeof t.pinnedAt=="number";if(n&&r){const i=typeof e.pinSortOrder=="number",s=typeof t.pinSortOrder=="number";return i&&s?e.pinSortOrder-t.pinSortOrder:i?-1:s?1:t.pinnedAt-e.pinnedAt}return n?-1:r||e.updatedAt<t.updatedAt?1:e.updatedAt>t.updatedAt?-1:0}function ZH(e){return e.appBuilderProject?`[app] ${e.appBuilderProject}`:e.label?e.label:e.cwd.split("/").filter(Boolean).pop()??""}function Zw(e,t){const n=t.trim().toLowerCase();return n===""?!0:e.toLowerCase().includes(n)}function QI(e){return e.compositionActive||!!e.nativeIsComposing||e.keyCode===229}function JI(e){return e.key==="Enter"&&!e.shiftKey&&!QI(e)}function QH(e,t){const n=g.useRef(!1),r=g.useCallback(()=>{n.current=!0},[]),i=g.useCallback(()=>{setTimeout(()=>{n.current=!1},0)},[]);return{onKeyDown:g.useCallback(o=>{const a=o.nativeEvent;if(JI({key:o.key,shiftKey:o.shiftKey,compositionActive:n.current,nativeIsComposing:a.isComposing,keyCode:a.keyCode})){o.preventDefault(),e();return}t&&o.key==="Escape"&&(o.preventDefault(),t())},[e,t]),onCompositionStart:r,onCompositionEnd:i}}const JH={isCollapsed:()=>!1,toggle:()=>{},prune:()=>{}};function eU({personas:e,activePersonaId:t,onSelectPersona:n,onCreateSession:r,sessions:i,activeSessionId:s,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f,isPersonaExpanded:p,onTogglePersonaExpanded:m,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,searchQuery:y}){const[w,S]=g.useState(null),[C,N]=g.useState(()=>new Set),T=p??(R=>C.has(R)),M=g.useCallback(R=>{if(m){m(R);return}N(I=>{const O=new Set(I);return O.has(R)?O.delete(R):O.add(R),O})},[m]),P=g.useMemo(()=>i==null?void 0:i.filter(R=>!R.ephemeral),[i]);if(e.length===0)return h.jsx(tU,{});const D=(y??"").trim();return D?h.jsx(C_.Provider,{value:JH,children:h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(R=>{const I=P?P.filter(F=>F.ownerPersonaId===R.personaId).sort((F,L)=>L.updatedAt>F.updatedAt?1:-1):[],O=Zw(R.label,D),z=I.filter(F=>Zw(ZH(F),D));if(!O&&z.length===0)return null;const $=O?I:z;return h.jsx(Qw,{persona:R,active:R.personaId===t,editing:!1,onSelectPersona:n,onSubmitCreateSession:()=>{},onCancelCreateSession:()=>{},personaSessions:$,collapsed:!1,onToggleCollapsed:()=>{},activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},R.personaId)})})}):h.jsx("div",{"data-testid":"my-personas-list",className:"flex flex-col gap-0.5",children:e.map(R=>{const I=P?P.filter(O=>O.ownerPersonaId===R.personaId).sort((O,z)=>z.updatedAt>O.updatedAt?1:-1):[];return h.jsx(Qw,{persona:R,active:R.personaId===t,editing:R.personaId===w,onSelectPersona:n,onStartCreateSession:r?()=>S(R.personaId):void 0,onSubmitCreateSession:O=>{S(null),r==null||r(R.personaId,O)},onCancelCreateSession:()=>S(null),personaSessions:I,collapsed:!T(R.personaId),onToggleCollapsed:()=>M(R.personaId),activeSessionId:s??null,awaitingIds:o,runningIds:a,unreadIds:l,onSelectSession:c,onDeleteSession:u,onEditSession:v,onPinSession:b,showCopyResume:x,treatSessionsAsRoots:_,ownerPrincipalId:d,creatorDisplayNameByOwnerId:f},R.personaId)})})}function tU(){return h.jsx("div",{className:"px-3 py-3 text-[11px] leading-relaxed text-text-400",children:"还没有 persona。点上方 Personas 标题右侧 + 创建第一个。"})}function Qw({persona:e,active:t,editing:n,onSelectPersona:r,onStartCreateSession:i,onSubmitCreateSession:s,onCancelCreateSession:o,personaSessions:a,collapsed:l,onToggleCollapsed:c,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_,treatSessionsAsRoots:y,ownerPrincipalId:w,creatorDisplayNameByOwnerId:S}){const C=ZT(e.iconKey,e.tool),N=a.length>0,T=!l,M=g.useMemo(()=>{const R=[],I=new Map;for(const O of a){const z=O.creatorPrincipalId;if(O.larkChatId!=null||!z||w&&z===w){R.push(O);continue}const $=z,F=(S==null?void 0:S.get($))??`…${$.slice(-8)}`,L=I.get($);L?L.sessions.push(O):I.set($,{groupKey:$,displayName:F,sessions:[O]})}return{self:R,byPeer:[...I.values()]}},[a,w,S]),P=M.byPeer.length>0,D=g.useMemo(()=>T&&!P?ZI(YI(a)):[],[T,P,a]);return h.jsxs("div",{"data-testid":`persona-node-${e.personaId}`,children:[h.jsxs("div",{className:ne("group flex items-center gap-1 px-2 py-1.5 cursor-pointer",t?"bg-accent-dim text-text-100":"hover:bg-bg-200 text-text-200"),onClick:()=>r==null?void 0:r(e.personaId),role:"button",tabIndex:0,children:[N?h.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),c()},"aria-label":T?"collapse":"expand","aria-expanded":T,"data-testid":`persona-chevron-${e.personaId}`,className:"flex h-4 w-4 shrink-0 items-center justify-center text-text-400 hover:text-text-100",children:T?h.jsx(ci,{className:"h-3 w-3"}):h.jsx(ui,{className:"h-3 w-3"})}):h.jsx("span",{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),h.jsx(C.Component,{className:ne("h-3.5 w-3.5 shrink-0",C.colorClass),"aria-hidden":"true"}),h.jsx("span",{className:"flex-1 truncate text-[13px]",children:e.label}),N?h.jsx("span",{className:"shrink-0 text-[10px] text-text-400 tabular-nums","aria-label":`${a.length} sessions`,children:a.length}):null,i?h.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),i()},"aria-label":"新建会话",title:"新建会话","data-testid":`persona-create-session-${e.personaId}`,className:"flex h-5 w-5 shrink-0 items-center justify-center rounded text-text-400 opacity-0 hover:bg-text-100/10 hover:text-text-100 focus-visible:opacity-100 group-hover:opacity-100",children:h.jsx(Qz,{className:"h-3.5 w-3.5"})}):null]}),n?h.jsx(nU,{personaId:e.personaId,iconKey:e.iconKey,tool:e.tool,onSubmit:s,onCancel:o}):null,N&&T?h.jsx("div",{"data-testid":`persona-sessions-${e.personaId}`,children:P?h.jsxs(h.Fragment,{children:[M.self.length>0&&h.jsx(Jw,{groupKey:`${e.personaId}-self`,label:"我自己",testId:`persona-sessions-${e.personaId}-self`,sessions:M.self,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_}),M.byPeer.map(R=>h.jsx(Jw,{groupKey:`${e.personaId}-peer-${R.groupKey}`,label:R.displayName,testId:`persona-sessions-${e.personaId}-peer-${R.groupKey}`,sessions:R.sessions,activeSessionId:u,awaitingIds:d,runningIds:f,unreadIds:p,onSelectSession:m,onDeleteSession:v,onEditSession:b,onPinSession:x,showCopyResume:_},`${e.personaId}-peer-${R.groupKey}`))]}):D.map(R=>h.jsx(ty,{node:R,depth:y?0:1,activeId:u,unreadIds:p,runningIds:f,awaitingIds:d,onSelect:I=>m==null?void 0:m(I),onDelete:v,onEdit:b,onPin:x,showCopyResume:_},R.session.sessionId))}):null]})}function Jw({label:e,testId:t,sessions:n,activeSessionId:r,awaitingIds:i,runningIds:s,unreadIds:o,onSelectSession:a,onDeleteSession:l,onEditSession:c,onPinSession:u,showCopyResume:d}){const[f,p]=g.useState(!1),m=!f,v=g.useMemo(()=>m?ZI(YI(n)):[],[m,n]);return h.jsxs("div",{"data-testid":t,children:[h.jsxs("button",{type:"button",onClick:()=>p(b=>!b),"aria-label":m?"collapse":"expand","aria-expanded":m,"data-testid":`${t}-chevron`,className:"flex items-center gap-1 w-full pl-7 pr-2 py-0.5 text-[11px] text-text-400 hover:text-text-200 transition-colors",children:[m?h.jsx(ci,{className:"h-3 w-3"}):h.jsx(ui,{className:"h-3 w-3"}),h.jsx(T_,{className:"h-3 w-3","aria-hidden":!0}),h.jsx("span",{className:"truncate",children:e}),h.jsx("span",{className:"ml-auto tabular-nums",children:n.length})]}),m&&h.jsx("div",{children:v.map(b=>h.jsx(ty,{node:b,depth:2,activeId:r,unreadIds:o,runningIds:s,awaitingIds:i,onSelect:x=>a==null?void 0:a(x),onDelete:l,onEdit:c,onPin:u,showCopyResume:d},b.session.sessionId))})]})}function nU({personaId:e,iconKey:t,tool:n,onSubmit:r,onCancel:i}){const[s,o]=g.useState(""),a=g.useRef(null),l=ZT(t,n),c=s.trim(),u=c.length>0;g.useEffect(()=>{var p;(p=a.current)==null||p.focus()},[]);const d=g.useCallback(()=>{u&&r(c)},[u,c,r]),f=QH(d,i);return h.jsxs("div",{className:"flex items-center gap-1.5 pl-9 pr-2 py-1","data-testid":`persona-new-session-row-${e}`,children:[h.jsx(l.Component,{className:ne("h-3 w-3 shrink-0",l.colorClass),"aria-hidden":"true"}),h.jsx("input",{ref:a,type:"text",value:s,onChange:p=>o(p.target.value),...f,onBlur:i,placeholder:"session label...","data-testid":`persona-new-session-input-${e}`,className:"flex-1 min-w-0 bg-bg-100 border border-text-100/15 rounded px-1.5 py-0.5 text-[12px] text-text-100 placeholder:text-text-400 focus:outline-none focus:border-text-100/40"}),h.jsx("button",{type:"button",onMouseDown:p=>{p.preventDefault(),d()},disabled:!u,"aria-label":"确认",title:"确认(Enter)","data-testid":`persona-new-session-confirm-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100 disabled:opacity-30 disabled:hover:bg-transparent disabled:hover:text-text-300",children:h.jsx(ol,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",onMouseDown:p=>{p.preventDefault(),i()},"aria-label":"取消",title:"取消(Esc)","data-testid":`persona-new-session-cancel-${e}`,className:"flex h-4 w-4 shrink-0 items-center justify-center rounded text-text-300 hover:bg-text-100/10 hover:text-text-100",children:h.jsx(Rn,{className:"h-3 w-3"})})]})}function rU(e,t){const n=getComputedStyle(e),r=parseFloat(n.fontSize);return t*r}function iU(e,t){const n=getComputedStyle(e.ownerDocument.documentElement),r=parseFloat(n.fontSize);return t*r}function sU(e){return e/100*window.innerHeight}function oU(e){return e/100*window.innerWidth}function aU(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 ql({groupSize:e,panelElement:t,styleProp:n}){let r;const[i,s]=aU(n);switch(s){case"%":{r=i/100*e;break}case"px":{r=i;break}case"rem":{r=iU(t,i);break}case"em":{r=rU(t,i);break}case"vh":{r=sU(i);break}case"vw":{r=oU(i);break}}return r}function En(e){return parseFloat(e.toFixed(3))}function Ha({group:e}){const{orientation:t,panels:n}=e;return n.reduce((r,i)=>(r+=t==="horizontal"?i.element.offsetWidth:i.element.offsetHeight,r),0)}function u0(e){const{panels:t}=e,n=Ha({group:e});return n===0?t.map(r=>({groupResizeBehavior:r.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:r.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:r.panelConstraints.disabled,minSize:0,maxSize:100,panelId:r.id})):t.map(r=>{const{element:i,panelConstraints:s}=r;let o=0;if(s.collapsedSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.collapsedSize});o=En(u/n*100)}let a;if(s.defaultSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.defaultSize});a=En(u/n*100)}let l=0;if(s.minSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.minSize});l=En(u/n*100)}let c=100;if(s.maxSize!==void 0){const u=ql({groupSize:n,panelElement:i,styleProp:s.maxSize});c=En(u/n*100)}return{groupResizeBehavior:s.groupResizeBehavior,collapsedSize:o,collapsible:s.collapsible===!0,defaultSize:a,disabled:s.disabled,minSize:l,maxSize:c,panelId:r.id}})}function it(e,t="Assertion error"){if(!e)throw Error(t)}function d0(e,t){return Array.from(t).sort(e==="horizontal"?lU:cU)}function lU(e,t){const n=e.element.offsetLeft-t.element.offsetLeft;return n!==0?n:e.element.offsetWidth-t.element.offsetWidth}function cU(e,t){const n=e.element.offsetTop-t.element.offsetTop;return n!==0?n:e.element.offsetHeight-t.element.offsetHeight}function eR(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.ELEMENT_NODE}function tR(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 uU({orientation:e,rects:t,targetRect:n}){const r={x:n.x+n.width/2,y:n.y+n.height/2};let i,s=Number.MAX_VALUE;for(const o of t){const{x:a,y:l}=tR(r,o),c=e==="horizontal"?a:l;c<s&&(s=c,i=o)}return it(i,"No rect found"),i}let gd;function dU(){return gd===void 0&&(typeof matchMedia=="function"?gd=!!matchMedia("(pointer:coarse)").matches:gd=!1),gd}function nR(e){const{element:t,orientation:n,panels:r,separators:i}=e,s=d0(n,Array.from(t.children).filter(eR).map(m=>({element:m}))).map(({element:m})=>m),o=[];let a=!1,l=!1,c=-1,u=-1,d=0,f,p=[];{let m=-1;for(const v of s)v.hasAttribute("data-panel")&&(m++,v.hasAttribute("data-disabled")||(d++,c===-1&&(c=m),u=m))}if(d>1){let m=-1;for(const v of s)if(v.hasAttribute("data-panel")){m++;const b=r.find(x=>x.element===v);if(b){if(f){const x=f.element.getBoundingClientRect(),_=v.getBoundingClientRect();let y;if(l){const w=n==="horizontal"?new DOMRect(x.right,x.top,0,x.height):new DOMRect(x.left,x.bottom,x.width,0),S=n==="horizontal"?new DOMRect(_.left,_.top,0,_.height):new DOMRect(_.left,_.top,_.width,0);switch(p.length){case 0:{y=[w,S];break}case 1:{const C=p[0],N=uU({orientation:n,rects:[x,_],targetRect:C.element.getBoundingClientRect()});y=[C,N===x?S:w];break}default:{y=p;break}}}else p.length?y=p:y=[n==="horizontal"?new DOMRect(x.right,_.top,_.left-x.right,_.height):new DOMRect(_.left,x.bottom,_.width,_.top-x.bottom)];for(const w of y){let S="width"in w?w:w.element.getBoundingClientRect();const C=dU()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(S.width<C){const T=C-S.width;S=new DOMRect(S.x-T/2,S.y,S.width+T,S.height)}if(S.height<C){const T=C-S.height;S=new DOMRect(S.x,S.y-T/2,S.width,S.height+T)}const N=m<=c||m>u;!a&&!N&&o.push({group:e,groupSize:Ha({group:e}),panels:[f,b],separator:"width"in w?void 0:w,rect:S}),a=!1}}l=!1,f=b,p=[]}}else if(v.hasAttribute("data-separator")){v.ariaDisabled!==null&&(a=!0);const b=i.find(x=>x.element===v);b?p.push(b):(f=void 0,p=[])}else l=!0}return o}var us;class rR{constructor(){o1(this,us,{})}addListener(t,n){const r=_l(this,us)[t];return r===void 0?_l(this,us)[t]=[n]:r.includes(n)||r.push(n),()=>{this.removeListener(t,n)}}emit(t,n){const r=_l(this,us)[t];if(r!==void 0)if(r.length===1)r[0].call(null,n);else{let i=!1,s=null;const o=Array.from(r);for(let a=0;a<o.length;a++){const l=o[a];try{l.call(null,n)}catch(c){s===null&&(i=!0,s=c)}}if(i)throw s}}removeAllListeners(){a1(this,us,{})}removeListener(t,n){const r=_l(this,us)[t];if(r!==void 0){const i=r.indexOf(n);i>=0&&r.splice(i,1)}}}us=new WeakMap;let Ca={cursorFlags:0,state:"inactive"};const ny=new rR;function _o(){return Ca}function hU(e){return ny.addListener("change",e)}function fU(e){const t=Ca,n={...Ca};n.cursorFlags=e,Ca=n,ny.emit("change",{prev:t,next:n})}function Ea(e){const t=Ca;Ca=e,ny.emit("change",{prev:t,next:e})}const pU=e=>e,Im=()=>{},iR=1,sR=2,oR=4,aR=8,eS=3,tS=12;let vd;function nS(){return vd===void 0&&(vd=!1,typeof window<"u"&&(window.navigator.userAgent.includes("Chrome")||window.navigator.userAgent.includes("Firefox"))&&(vd=!0)),vd}function mU({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case"active":case"hover":t.forEach(s=>{if(!s.mutableState.disableCursor)switch(s.orientation){case"horizontal":{r++;break}case"vertical":{i++;break}}})}if(!(r===0&&i===0)){switch(n){case"active":{if(e&&nS()){const s=(e&iR)!==0,o=(e&sR)!==0,a=(e&oR)!==0,l=(e&aR)!==0;if(s)return a?"se-resize":l?"ne-resize":"e-resize";if(o)return a?"sw-resize":l?"nw-resize":"w-resize";if(a)return"s-resize";if(l)return"n-resize"}break}}return nS()?r>0&&i>0?"move":r>0?"ew-resize":"ns-resize":r>0&&i>0?"grab":r>0?"col-resize":"row-resize"}}const rS=new WeakMap;function ry(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=rS.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 r=_o();switch(r.state){case"active":case"hover":{const i=mU({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(o=>o.group),state:r.state}),s=`*, *:hover {cursor: ${i} !important; }`;if(t===s)return;t=s,i?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}}rS.set(e,{prevStyle:t,styleSheet:n})}let Zr=new Map;const lR=new rR;function gU(e){Zr=new Map(Zr),Zr.delete(e)}function iS(e,t){for(const[n]of Zr)if(n.id===e)return n}function ks(e,t){for(const[n,r]of Zr)if(n.id===e)return r;if(t)throw Error(`Could not find data for Group with id ${e}`)}function jo(){return Zr}function iy(e,t){return lR.addListener("groupChange",n=>{n.group.id===e&&t(n)})}function Oi(e,t,n){const r=Zr.get(e);Zr=new Map(Zr),Zr.set(e,t),lR.emit("groupChange",{group:e,isUserInteraction:(n==null?void 0:n.isUserInteraction)===!0,prev:r,next:t})}function cR(e){const t=_o();let n=!1;switch(t.state){case"active":Ea({cursorFlags:0,state:"inactive"}),t.hitRegions.length>0&&(ry(e),n=!0,t.hitRegions.forEach(r=>{const i=ks(r.group.id,!0);Oi(r.group,i,{isUserInteraction:!0})}))}return n}function sS(e){e.defaultPrevented||cR(e.currentTarget)}function vU(e,t,n){let r,i={x:1/0,y:1/0};for(const s of t){const o=tR(n,s.rect);switch(e){case"horizontal":{o.x<=i.x&&(r=s,i=o);break}case"vertical":{o.y<=i.y&&(r=s,i=o);break}}}return r?{distance:i,hitRegion:r}:void 0}function xU(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function _U(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:lS(e),b:lS(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();it(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:aS(oS(n.a)),b:aS(oS(n.b))};if(i.a===i.b){const s=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const yU=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function bU(e){const t=getComputedStyle(uR(e)??e).display;return t==="flex"||t==="inline-flex"}function wU(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||bU(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"||yU.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function oS(e){let t=e.length;for(;t--;){const n=e[t];if(it(n,"Missing node"),wU(n))return n}return null}function aS(e){return e&&Number(getComputedStyle(e).zIndex)||0}function lS(e){const t=[];for(;e;)t.push(e),e=uR(e);return t}function uR(e){const{parentNode:t}=e;return xU(t)?t.host:t}function SU(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 kU({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!eR(n)||n.contains(e)||e.contains(n))return!0;if(_U(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(SU(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function sy(e,t){const n=[];return t.forEach((r,i)=>{if(i.disabled)return;const s=nR(i),o=vU(i.orientation,s,{x:e.clientX,y:e.clientY});o&&o.distance.x<=0&&o.distance.y<=0&&kU({groupElement:i.element,hitRegion:o.hitRegion.rect,pointerEventTarget:e.target})&&n.push(o.hitRegion)}),n}function CU(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 xn(e,t,n=0){return Math.abs(En(e)-En(t))<=n}function Kr(e,t){return xn(e,t)?0:e>t?1:-1}function pa({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){const{collapsedSize:i=0,collapsible:s,disabled:o,maxSize:a=100,minSize:l=0}=t;if(o&&!e)return n;if(Kr(r,l)<0)if(s){const c=(i+l)/2;Kr(r,c)<0?r=i:r=l}else r=l;return r=Math.min(a,r),r=En(r),r}function Xc({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(xn(e,0))return t;const o=s==="imperative-api",a=Object.values(t),l=Object.values(i),c=[...a],[u,d]=r;it(u!=null,"Invalid first pivot index"),it(d!=null,"Invalid second pivot index");let f=0;switch(s){case"keyboard":{{const v=e<0?d:u,b=n[v];it(b,`Panel constraints not found for index ${v}`);const{collapsedSize:x=0,collapsible:_,minSize:y=0}=b;if(_){const w=a[v];if(it(w!=null,`Previous layout not found for panel index ${v}`),xn(w,x)){const S=y-w;Kr(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}{const v=e<0?u:d,b=n[v];it(b,`No panel constraints found for index ${v}`);const{collapsedSize:x=0,collapsible:_,minSize:y=0}=b;if(_){const w=a[v];if(it(w!=null,`Previous layout not found for panel index ${v}`),xn(w,y)){const S=w-x;Kr(S,Math.abs(e))>0&&(e=e<0?0-S:S)}}}break}default:{const v=e<0?d:u,b=n[v];it(b,`Panel constraints not found for index ${v}`);const x=a[v],{collapsible:_,collapsedSize:y,minSize:w}=b;if(_&&Kr(x,w)<0)if(e>0){const S=w-y,C=S/2,N=x+e;Kr(N,w)<0&&(e=Kr(e,C)<=0?0:S)}else{const S=w-y,C=100-S/2,N=x-e;Kr(N,w)<0&&(e=Kr(100+e,C)>0?0:-S)}break}}{const v=e<0?1:-1;let b=e<0?d:u,x=0;for(;;){const y=a[b];it(y!=null,`Previous layout not found for panel index ${b}`);const w=pa({overrideDisabledPanels:o,panelConstraints:n[b],prevSize:y,size:100})-y;if(x+=w,b+=v,b<0||b>=n.length)break}const _=Math.min(Math.abs(e),Math.abs(x));e=e<0?0-_:_}{let v=e<0?u:d;for(;v>=0&&v<n.length;){const b=Math.abs(e)-Math.abs(f),x=a[v];it(x!=null,`Previous layout not found for panel index ${v}`);const _=x-b,y=pa({overrideDisabledPanels:o,panelConstraints:n[v],prevSize:x,size:_});if(!xn(x,y)&&(f+=x-y,c[v]=y,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?v--:v++}}if(CU(l,c))return i;{const v=e<0?d:u,b=a[v];it(b!=null,`Previous layout not found for panel index ${v}`);const x=b+f,_=pa({overrideDisabledPanels:o,panelConstraints:n[v],prevSize:b,size:x});if(c[v]=_,!xn(_,x)){let y=x-_,w=e<0?d:u;for(;w>=0&&w<n.length;){const S=c[w];it(S!=null,`Previous layout not found for panel index ${w}`);const C=S+y,N=pa({overrideDisabledPanels:o,panelConstraints:n[w],prevSize:S,size:C});if(xn(S,N)||(y-=N-S,c[w]=N),xn(y,0))break;e>0?w--:w++}}}const p=Object.values(c).reduce((v,b)=>b+v,0);if(!xn(p,100,.1))return i;const m=Object.keys(i);return c.reduce((v,b,x)=>(v[m[x]]=b,v),{})}function yo(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(t[n]===void 0||Kr(e[n],t[n])!==0)return!1;return!0}function bo({layout:e,panelConstraints:t}){const n=Object.values(e),r=[...n],i=r.reduce((a,l)=>a+l,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(a=>`${a}%`).join(", ")}`);if(!xn(i,100)&&r.length>0)for(let a=0;a<t.length;a++){const l=r[a];it(l!=null,`No layout data found for index ${a}`);const c=100/i*l;r[a]=c}let s=0;for(let a=0;a<t.length;a++){const l=n[a];it(l!=null,`No layout data found for index ${a}`);const c=r[a];it(c!=null,`No layout data found for index ${a}`);const u=pa({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:c});c!=u&&(s+=c-u,r[a]=u)}if(!xn(s,0))for(let a=0;a<t.length;a++){const l=r[a];it(l!=null,`No layout data found for index ${a}`);const c=l+s,u=pa({overrideDisabledPanels:!0,panelConstraints:t[a],prevSize:l,size:c});if(l!==u&&(s-=u-l,r[a]=u,xn(s,0)))break}const o=Object.keys(e);return r.reduce((a,l,c)=>(a[o[c]]=l,a),{})}function dR({groupId:e,panelId:t}){const n=()=>{const l=jo();for(const[c,{defaultLayoutDeferred:u,derivedPanelConstraints:d,layout:f,groupSize:p,separatorToPanels:m}]of l)if(c.id===e)return{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:c,groupSize:p,layout:f,separatorToPanels:m};throw Error(`Group ${e} not found`)},r=()=>{const l=n().derivedPanelConstraints.find(c=>c.panelId===t);if(l!==void 0)return l;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{const l=n().group.panels.find(c=>c.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}`)},o=({nextSize:l,panels:c,prevLayout:u,derivedPanelConstraints:d})=>{const f=s(),p=c.findIndex(b=>b.id===t),m=p===0,v=p===c.length-1;if(v&&l<f&&(m||c.slice(0,p).every((b,x)=>{const _=d[x];return(_==null?void 0:_.collapsible)&&xn(_.collapsedSize,u[_.panelId])}))){const b=c.slice(0,p).reduce((x,_)=>x+u[_.id],0);return{...u,[t]:En(100-b)}}return Xc({delta:v?f-l:l-f,initialLayout:u,panelConstraints:d,pivotIndices:v?[p-1,p]:[p,p+1],prevLayout:u,trigger:"imperative-api"})},a=l=>{const c=s();if(l===c)return;const{defaultLayoutDeferred:u,derivedPanelConstraints:d,group:f,groupSize:p,layout:m,separatorToPanels:v}=n(),b=o({nextSize:l,panels:f.panels,prevLayout:m,derivedPanelConstraints:d}),x=bo({layout:b,panelConstraints:d});yo(m,x)||Oi(f,{defaultLayoutDeferred:u,derivedPanelConstraints:d,groupSize:p,layout:x,separatorToPanels:v})};return{collapse:()=>{const{collapsible:l,collapsedSize:c}=r(),{mutableValues:u}=i(),d=s();l&&d!==c&&(u.expandToSize=d,a(c))},expand:()=>{const{collapsible:l,collapsedSize:c,minSize:u}=r(),{mutableValues:d}=i(),f=s();if(l&&f===c){let p=d.expandToSize??u;p===0&&(p=1),a(p)}},getSize:()=>{const{group:l}=n(),c=s(),{element:u}=i(),d=l.orientation==="horizontal"?u.offsetWidth:u.offsetHeight;return{asPercentage:c,inPixels:d}},isCollapsed:()=>{const{collapsible:l,collapsedSize:c}=r(),u=s();return l&&xn(c,u)},resize:l=>{const{group:c}=n(),{element:u}=i(),d=Ha({group:c}),f=ql({groupSize:d,panelElement:u,styleProp:l}),p=En(f/d*100);a(p)}}}function cS(e){if(e.defaultPrevented)return;const t=jo();sy(e,t).forEach(n=>{if(n.separator&&!n.separator.disableDoubleClick){const r=n.panels.find(i=>i.panelConstraints.defaultSize!==void 0);if(r){const i=r.panelConstraints.defaultSize,s=dR({groupId:n.group.id,panelId:r.id});s&&i!==void 0&&(s.resize(i),e.preventDefault())}}})}function Qd(e){const t=jo();for(const[n]of t)if(n.separators.some(r=>r.element===e))return n;throw Error("Could not find parent Group for separator element")}function hR({groupId:e}){const t=()=>{const n=jo();for(const[r,i]of n)if(r.id===e)return{group:r,...i};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){const{defaultLayoutDeferred:n,layout:r}=t();return n?{}:r},setLayout(n){const{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:s,groupSize:o,layout:a,separatorToPanels:l}=t(),c=bo({layout:n,panelConstraints:i});return r?a:(yo(a,c)||Oi(s,{defaultLayoutDeferred:r,derivedPanelConstraints:i,groupSize:o,layout:c,separatorToPanels:l}),c)}}}function Hs(e,t){const n=Qd(e),r=ks(n.id,!0),i=n.separators.find(u=>u.element===e);it(i,"Matching separator not found");const s=r.separatorToPanels.get(i);it(s,"Matching panels not found");const o=s.map(u=>n.panels.indexOf(u)),a=hR({groupId:n.id}).getLayout(),l=Xc({delta:t,initialLayout:a,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:a,trigger:"keyboard"}),c=bo({layout:l,panelConstraints:r.derivedPanelConstraints});yo(a,c)||Oi(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels},{isUserInteraction:!0})}function uS(e){if(e.defaultPrevented)return;const t=e.currentTarget,n=Qd(t);if(!n.disabled)switch(e.key){case"ArrowDown":{e.preventDefault(),n.orientation==="vertical"&&Hs(t,5);break}case"ArrowLeft":{e.preventDefault(),n.orientation==="horizontal"&&Hs(t,-5);break}case"ArrowRight":{e.preventDefault(),n.orientation==="horizontal"&&Hs(t,5);break}case"ArrowUp":{e.preventDefault(),n.orientation==="vertical"&&Hs(t,-5);break}case"End":{e.preventDefault(),Hs(t,100);break}case"Enter":{e.preventDefault();const r=Qd(t),i=ks(r.id,!0),{derivedPanelConstraints:s,layout:o,separatorToPanels:a}=i,l=r.separators.find(f=>f.element===t);it(l,"Matching separator not found");const c=a.get(l);it(c,"Matching panels not found");const u=c[0],d=s.find(f=>f.panelId===u.id);if(it(d,"Panel metadata not found"),d.collapsible){const f=o[u.id],p=d.collapsedSize===f?r.mutableState.expandedPanelSizes[u.id]??d.minSize:d.collapsedSize;Hs(t,p-f)}break}case"F6":{e.preventDefault();const r=Qd(t).separators.map(o=>o.element),i=Array.from(r).findIndex(o=>o===e.currentTarget);it(i!==null,"Index not found");const s=e.shiftKey?i>0?i-1:r.length-1:i+1<r.length?i+1:0;r[s].focus({preventScroll:!0});break}case"Home":{e.preventDefault(),Hs(t,-100);break}}}function dS(e){if(e.defaultPrevented||e.pointerType==="mouse"&&e.button>0)return;const t=jo(),n=sy(e,t),r=new Map;let i=!1;n.forEach(s=>{s.separator&&(i||(i=!0,s.separator.element.focus({focusVisible:!1,preventScroll:!0})));const o=t.get(s.group);o&&r.set(s.group,o.layout)}),Ea({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:"active"}),n.length&&e.preventDefault()}function fR({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:s,prevCursorFlags:o}){let a=0;n.forEach(c=>{const{group:u,groupSize:d}=c,{orientation:f,panels:p}=u,{disableCursor:m}=u.mutableState;let v=0;s?f==="horizontal"?v=(t.clientX-s.x)/d*100:v=(t.clientY-s.y)/d*100:f==="horizontal"?v=t.clientX<0?-100:100:v=t.clientY<0?-100:100;const b=r.get(u),x=i.get(u);if(!b||!x)return;const{defaultLayoutDeferred:_,derivedPanelConstraints:y,groupSize:w,layout:S,separatorToPanels:C}=x;if(y&&S&&C){const N=Xc({delta:v,initialLayout:b,panelConstraints:y,pivotIndices:c.panels.map(T=>p.indexOf(T)),prevLayout:S,trigger:"mouse-or-touch"});if(yo(N,S)){if(v!==0&&!m)switch(f){case"horizontal":{a|=v<0?iR:sR;break}case"vertical":{a|=v<0?oR:aR;break}}}else Oi(c.group,{defaultLayoutDeferred:_,derivedPanelConstraints:y,groupSize:w,layout:N,separatorToPanels:C})}});let l=0;t.movementX===0?l|=o&eS:l|=a&eS,t.movementY===0?l|=o&tS:l|=a&tS,fU(l),ry(e)}function hS(e){const t=jo(),n=_o();switch(n.state){case"active":fR({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function fS(e){var r,i;if(e.defaultPrevented)return;const t=_o(),n=jo();switch(t.state){case"active":{if(e.buttons===0){Ea({cursorFlags:0,state:"inactive"}),t.hitRegions.forEach(s=>{const o=ks(s.group.id,!0);Oi(s.group,o,{isUserInteraction:!0})});return}for(const s of t.hitRegions)if(s.separator){const{element:o}=s.separator;(r=o.hasPointerCapture)!=null&&r.call(o,e.pointerId)||((i=o.setPointerCapture)==null||i.call(o,e.pointerId))}fR({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break}default:{const s=sy(e,n);s.length===0?t.state!=="inactive"&&Ea({cursorFlags:0,state:"inactive"}):Ea({cursorFlags:0,hitRegions:s,state:"hover"}),ry(e.currentTarget);break}}}function pS(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(_o().state){case"hover":Ea({cursorFlags:0,state:"inactive"})}}function mS(e){e.defaultPrevented||e.pointerType==="mouse"&&e.button>0||cR(e.currentTarget)&&e.preventDefault()}function gS(e){let t=0,n=0;const r={};for(const s of e)if(s.defaultSize!==void 0){t++;const o=En(s.defaultSize);n+=o,r[s.panelId]=o}else r[s.panelId]=void 0;const i=e.length-t;if(i!==0){const s=En((100-n)/i);for(const o of e)o.defaultSize===void 0&&(r[o.panelId]=s)}return r}function EU(e,t,n){if(!n[0])return;const r=e.panels.find(l=>l.element===t);if(!r||!r.onResize)return;const i=Ha({group:e}),s=e.orientation==="horizontal"?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,a={asPercentage:En(s/i*100),inPixels:s};r.mutableValues.prevSize=a,r.onResize(a,r.id,o)}function NU(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 TU({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,s=0,o=!1;const a=new Map,l=[];for(const d of e.panels){const f=r[d.id]??0;switch(d.panelConstraints.groupResizeBehavior){case"preserve-pixel-size":{o=!0;const p=f/100*n,m=En(p/t*100);a.set(d.id,m),i+=m;break}case"preserve-relative-size":default:{l.push(d.id),s+=f;break}}}if(!o||l.length===0)return r;const c=100-i,u={...r};if(a.forEach((d,f)=>{u[f]=d}),s>0)for(const d of l){const f=r[d]??0;u[d]=En(f/s*c)}else{const d=En(c/l.length);for(const f of l)u[f]=d}return u}function PU(e,t){const n=e.map(i=>i.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!r.includes(i))return!1;return!0}const Ko=new Map;function IU(e){let t=!0;it(e.element.ownerDocument.defaultView,"Cannot register an unmounted Group");const n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,s=new n(m=>{for(const v of m){const{borderBoxSize:b,target:x}=v;if(x===e.element){if(t){const _=Ha({group:e});if(_===0)return;const y=ks(e.id);if(!y)return;const w=u0(e),S=y.defaultLayoutDeferred?gS(w):y.layout,C=TU({group:e,nextGroupSize:_,prevGroupSize:y.groupSize,prevLayout:S}),N=bo({layout:C,panelConstraints:w});if(!y.defaultLayoutDeferred&&yo(y.layout,N)&&NU(y.derivedPanelConstraints,w)&&y.groupSize===_)return;Oi(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:w,groupSize:_,layout:N,separatorToPanels:y.separatorToPanels})}}else EU(e,x,b)}});s.observe(e.element),e.panels.forEach(m=>{it(!r.has(m.id),`Panel ids must be unique; id "${m.id}" was used more than once`),r.add(m.id),m.onResize&&s.observe(m.element)});const o=Ha({group:e}),a=u0(e),l=e.panels.map(({id:m})=>m).join(",");let c=e.mutableState.defaultLayout;c&&(PU(e.panels,c)||(c=void 0));const u=e.mutableState.layouts[l]??c??gS(a),d=bo({layout:u,panelConstraints:a}),f=e.element.ownerDocument;Ko.set(f,(Ko.get(f)??0)+1);const p=new Map;return nR(e).forEach(m=>{m.separator&&p.set(m.separator,m.panels)}),Oi(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:a,groupSize:o,layout:d,separatorToPanels:p}),e.separators.forEach(m=>{it(!i.has(m.id),`Separator ids must be unique; id "${m.id}" was used more than once`),i.add(m.id),m.element.addEventListener("keydown",uS)}),Ko.get(f)===1&&(f.addEventListener("contextmenu",sS,!0),f.addEventListener("dblclick",cS,!0),f.addEventListener("pointerdown",dS,!0),f.addEventListener("pointerleave",hS),f.addEventListener("pointermove",fS),f.addEventListener("pointerout",pS),f.addEventListener("pointerup",mS,!0)),function(){t=!1,Ko.set(f,Math.max(0,(Ko.get(f)??0)-1)),gU(e),e.separators.forEach(m=>{m.element.removeEventListener("keydown",uS)}),Ko.get(f)||(f.removeEventListener("contextmenu",sS,!0),f.removeEventListener("dblclick",cS,!0),f.removeEventListener("pointerdown",dS,!0),f.removeEventListener("pointerleave",hS),f.removeEventListener("pointermove",fS),f.removeEventListener("pointerout",pS),f.removeEventListener("pointerup",mS,!0)),s.disconnect()}}function RU(){const[e,t]=g.useState({}),n=g.useCallback(()=>t({}),[]);return[e,n]}function oy(e){const t=g.useId();return`${e??t}`}const Lo=typeof window<"u"?g.useLayoutEffect:g.useEffect;function dc(e){const t=g.useRef(e);return Lo(()=>{t.current=e},[e]),g.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[t])}function ay(...e){return dc(t=>{e.forEach(n=>{if(n)switch(typeof n){case"function":{n(t);break}case"object":{n.current=t;break}}})})}function ly(e){const t=g.useRef({...e});return Lo(()=>{for(const n in e)t.current[n]=e[n]},[e]),t.current}const pR=g.createContext(null);function MU(e,t){const n=g.useRef({getLayout:()=>({}),setLayout:pU});g.useImperativeHandle(t,()=>n.current,[]),Lo(()=>{Object.assign(n.current,hR({groupId:e}))})}function cy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:s,groupRef:o,id:a,onLayoutChange:l,onLayoutChanged:c,orientation:u="horizontal",resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){const m=g.useRef({onLayoutChange:{},onLayoutChanged:{}}),v=dc(D=>{yo(m.current.onLayoutChange,D)||(m.current.onLayoutChange=D,l==null||l(D))}),b=dc((D,R)=>{yo(m.current.onLayoutChanged,D)||(m.current.onLayoutChanged=D,c==null||c(D,{isUserInteraction:R}))}),x=oy(a),_=g.useRef(null),[y,w]=RU(),S=g.useRef({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),C=ay(_,s);MU(x,o);const N=dc((D,R)=>{const I=_o(),O=iS(D),z=ks(D);if(z){let $=!1;switch(I.state){case"active":{$=I.hitRegions.some(F=>F.group===O);break}}return{flexGrow:z.layout[R]??1,pointerEvents:$?"none":void 0}}if(n!=null&&n[R])return{flexGrow:n==null?void 0:n[R]}}),T=ly({defaultLayout:n,disableCursor:r}),M=g.useMemo(()=>({get disableCursor(){return!!T.disableCursor},getPanelStyles:N,id:x,orientation:u,registerPanel:D=>{const R=S.current;return R.panels=d0(u,[...R.panels,D]),w(),()=>{R.panels=R.panels.filter(I=>I!==D),w()}},registerSeparator:D=>{const R=S.current;return R.separators=d0(u,[...R.separators,D]),w(),()=>{R.separators=R.separators.filter(I=>I!==D),w()}},updatePanelProps:(D,{disabled:R})=>{const I=S.current.panels.find($=>$.id===D);I&&(I.panelConstraints.disabled=R);const O=iS(x),z=ks(x);O&&z&&Oi(O,{...z,derivedPanelConstraints:u0(O)})},updateSeparatorProps:(D,{disabled:R,disableDoubleClick:I})=>{const O=S.current.separators.find(z=>z.id===D);O&&(O.disabled=R,O.disableDoubleClick=I)}}),[N,x,w,u,T]),P=g.useRef(null);return Lo(()=>{const D=_.current;if(D===null)return;const R=S.current;let I;if(T.defaultLayout!==void 0&&Object.keys(T.defaultLayout).length===R.panels.length){I={};for(const E of R.panels){const H=T.defaultLayout[E.id];H!==void 0&&(I[E.id]=H)}}const O={disabled:!!i,element:D,id:x,mutableState:{defaultLayout:I,disableCursor:!!T.disableCursor,expandedPanelSizes:S.current.lastExpandedPanelSizes,layouts:S.current.layouts},orientation:u,panels:R.panels,resizeTargetMinimumSize:R.resizeTargetMinimumSize,separators:R.separators};P.current=O;const z=IU(O),{defaultLayoutDeferred:$,derivedPanelConstraints:F,layout:L}=ks(O.id,!0);!$&&F.length>0&&(v(L),b(L,!1));const B=iy(x,E=>{const{defaultLayoutDeferred:H,derivedPanelConstraints:q,layout:A}=E.next;if(H||q.length===0)return;const re=O.panels.map(({id:V})=>V).join(",");O.mutableState.layouts[re]=A,q.forEach(V=>{if(V.collapsible){const{layout:pe}=E.prev??{};if(pe){const Oe=xn(V.collapsedSize,A[V.panelId]),ie=xn(V.collapsedSize,pe[V.panelId]);Oe&&!ie&&(O.mutableState.expandedPanelSizes[V.panelId]=pe[V.panelId])}}});const oe=_o().state!=="active";v(A),oe&&b(A,E.isUserInteraction)});return()=>{P.current=null,z(),B()}},[i,x,b,v,u,y,T]),g.useEffect(()=>{const D=P.current;D&&(D.mutableState.defaultLayout=n,D.mutableState.disableCursor=!!r)}),h.jsx(pR.Provider,{value:M,children:h.jsx("div",{...p,className:t,"data-group":!0,"data-testid":x,id:x,ref:C,style:{height:"100%",width:"100%",overflow:"hidden",...f,display:"flex",flexDirection:u==="horizontal"?"row":"column",flexWrap:"nowrap",touchAction:u==="horizontal"?"pan-y":"pan-x"},children:e})})}cy.displayName="Group";function uy(){const e=g.useContext(pR);return it(e,"Group Context not found; did you render a Panel or Separator outside of a Group?"),e}function AU(e,t){const{id:n}=uy(),r=g.useRef({collapse:Im,expand:Im,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Im});g.useImperativeHandle(t,()=>r.current,[]),Lo(()=>{Object.assign(r.current,dR({groupId:n,panelId:e}))})}function Yc({children:e,className:t,collapsedSize:n="0%",collapsible:r=!1,defaultSize:i,disabled:s,elementRef:o,groupResizeBehavior:a="preserve-relative-size",id:l,maxSize:c="100%",minSize:u="0%",onResize:d,panelRef:f,style:p,...m}){const v=!!l,b=oy(l),x=ly({disabled:s}),_=g.useRef(null),y=ay(_,o),{getPanelStyles:w,id:S,orientation:C,registerPanel:N,updatePanelProps:T}=uy(),M=d!==null,P=dc((O,z,$)=>{d==null||d(O,l,$)});Lo(()=>{const O=_.current;if(O!==null){const z={element:O,id:b,idIsStable:v,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:M?P:void 0,panelConstraints:{groupResizeBehavior:a,collapsedSize:n,collapsible:r,defaultSize:i,disabled:x.disabled,maxSize:c,minSize:u}};return N(z)}},[a,n,r,i,M,b,v,c,u,P,N,x]),g.useEffect(()=>{T(b,{disabled:s})},[s,b,T]),AU(b,f);const D=()=>{const O=w(S,b);if(O)return JSON.stringify(O)},R=g.useSyncExternalStore(O=>iy(S,O),D,D);let I;return R?I=JSON.parse(R):i!==void 0?I={flexGrow:void 0,flexShrink:void 0,flexBasis:i}:I={flexGrow:1},h.jsx("div",{...m,"data-disabled":s||void 0,"data-panel":!0,"data-testid":b,id:b,ref:y,style:{...jU,display:"flex",flexBasis:0,flexShrink:1,overflow:"visible",...I},children:h.jsx("div",{className:t,style:{maxHeight:"100%",maxWidth:"100%",flexGrow:1,overflow:"auto",...p,touchAction:C==="horizontal"?"pan-y":"pan-x"},children:e})})}Yc.displayName="Panel";const jU={minHeight:0,maxHeight:"100%",height:"auto",minWidth:0,maxWidth:"100%",width:"auto",border:"none",borderWidth:0,padding:0,margin:0};function LU({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,s;const o=e[n],a=t.find(l=>l.panelId===n);if(a){const l=a.maxSize,c=a.collapsible?a.collapsedSize:a.minSize,u=[r,r+1];s=bo({layout:Xc({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=bo({layout:Xc({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:s,valueNow:o}}function dy({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:s,style:o,...a}){const l=oy(s),c=ly({disabled:n,disableDoubleClick:r}),[u,d]=g.useState({}),[f,p]=g.useState("inactive"),[m,v]=g.useState(!1),b=g.useRef(null),x=ay(b,i),{disableCursor:_,id:y,orientation:w,registerSeparator:S,updateSeparatorProps:C}=uy(),N=w==="horizontal"?"vertical":"horizontal";Lo(()=>{const P=b.current;if(P!==null){const D={disabled:c.disabled,disableDoubleClick:c.disableDoubleClick,element:P,id:l},R=S(D),I=hU(z=>{p(z.next.state!=="inactive"&&z.next.hitRegions.some($=>$.separator===D)?z.next.state:"inactive")}),O=iy(y,z=>{const{derivedPanelConstraints:$,layout:F,separatorToPanels:L}=z.next,B=L.get(D);if(B){const E=B[0],H=B.indexOf(E);d(LU({layout:F,panelConstraints:$,panelId:E.id,panelIndex:H}))}});return()=>{I(),O(),R()}}},[y,l,S,c]),g.useEffect(()=>{C(l,{disabled:n,disableDoubleClick:r})},[n,r,l,C]);let T;n&&!_&&(T="not-allowed");let M;if(n)M="disabled";else switch(f){case"active":{M="active";break}default:m?M="focus":M=f}return h.jsx("div",{...a,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":N,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":M,"data-testid":l,id:l,onBlur:()=>v(!1),onFocus:()=>v(!0),ref:x,role:"separator",style:{flexBasis:"auto",cursor:T,...o,flexGrow:0,flexShrink:0,touchAction:"none"},tabIndex:n?void 0:0})}dy.displayName="Separator";function DU(e,t,n,r=!0){const i=g.useRef({sid:null,tsid:void 0});g.useEffect(()=>{const s=i.current;i.current={sid:t,tsid:n},!(!r||!n||s.sid===t&&(s.tsid===void 0||s.tsid===null)&&typeof n=="string")&&e.sessionObserve({sessionId:t,toolSessionId:n}).catch(()=>{})},[e,t,n,r])}function OU(e,t,n){const r=g.useRef(e),i=g.useRef(t),s=g.useRef(n);s.current=n,g.useEffect(()=>{const o=r.current,a=i.current;r.current=e,i.current=t;const l=o!==e,c=typeof a=="string"&&t==null;!l&&!c||s.current()},[e,t])}const BU=/^Scheduled (?:recurring job|one-shot task) ([0-9a-f]{8}) \(([^)]+)\)/;function zU(e){const t=new Map,n=new Map,r=new Map;for(const i of e)if(i.kind==="tool_call"&&i.tool==="CronCreate"){const s=i.input;if(!s||typeof s.cron!="string"||typeof s.prompt!="string")continue;const o=i.ts;t.set(i.toolUseId,{cron:s.cron,prompt:s.prompt,recurring:s.recurring!==!1,ts:typeof o=="string"?o:"",toolUseId:i.toolUseId})}else if(i.kind==="tool_call"&&i.tool==="CronDelete"){const s=i.input;if(!s||typeof s.id!="string")continue;n.set(i.toolUseId,s.id)}else if(i.kind==="tool_result"){const s=t.get(i.toolUseId);if(s){if(t.delete(i.toolUseId),i.error||typeof i.output!="string")continue;const a=i.output.match(BU);if(!a)continue;r.set(a[1],{id:a[1],cron:s.cron,prompt:s.prompt,recurring:s.recurring,humanSchedule:a[2],createdAt:s.ts,toolUseId:s.toolUseId});continue}const o=n.get(i.toolUseId);o!==void 0&&(n.delete(i.toolUseId),i.error||r.delete(o))}return Array.from(r.values()).sort((i,s)=>i.createdAt.localeCompare(s.createdAt))}const $U=["TaskCreate","TaskUpdate","TaskList","TaskGet"];function FU(e){return $U.includes(e)}function mR(e){return e==="in_progress"||e==="completed"?e:"pending"}function HU(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.subject=="string"&&n.subject?n.subject:typeof n.content=="string"&&n.content?n.content:null;if(!r)return e;const i=typeof n.activeForm=="string"?n.activeForm:void 0,s=typeof n.description=="string"?n.description:void 0;return[...e,{id:String(e.length+1),content:r,status:mR(n.status),activeForm:i,description:s}]}function UU(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.taskId=="string"&&n.taskId?n.taskId:typeof n.id=="string"&&n.id?n.id:null;if(!r)return e;const i=e.findIndex(a=>a.id===r);if(i<0)return e;const s=[...e],o={...s[i]};return"status"in n&&(o.status=mR(n.status)),typeof n.subject=="string"&&(o.content=n.subject),typeof n.content=="string"&&(o.content=n.content),typeof n.activeForm=="string"&&(o.activeForm=n.activeForm),typeof n.description=="string"&&(o.description=n.description),s[i]=o,s}function WU(e){let t=[],n=-1;for(let r=0;r<e.length;r++){const i=e[r];if(i.kind==="task-event")switch(n=r,i.name){case"TaskCreate":t=HU(t,i.input);break;case"TaskUpdate":t=UU(t,i.input);break}}return{tasks:t,lastEventIndex:n}}function VU(e){const{tasks:t,lastEventIndex:n}=WU(e);let r=-1;for(let c=e.length-1;c>=0;c--)if(e[c].kind==="todo-checklist"){r=c;break}const i=[],s=new Map,o=new Map,a=new Map,l=(c,u)=>{var f,p,m;const d={agentId:u.agentId,status:u.status};u.description?d.description=u.description:(f=c.progress)!=null&&f.description&&(d.description=c.progress.description),u.lastToolName?d.lastToolName=u.lastToolName:(p=c.progress)!=null&&p.lastToolName&&(d.lastToolName=c.progress.lastToolName),u.stats?d.stats=u.stats:(m=c.progress)!=null&&m.stats&&(d.stats=c.progress.stats),c.progress=d};for(let c=0;c<e.length;c++){const u=e[c];switch(u.kind){case"tool-call":{const d={kind:"merged-tool",seq:u.seq,tool:u.tool,toolKind:u.toolKind,toolUseId:u.toolUseId,input:u.input,pending:!0};s.set(u.toolUseId,i.length),i.push(d);break}case"tool-result":{const d=s.get(u.toolUseId);if(d!==void 0){const p=i[d];p.output=u.output,p.error=u.error,p.pending=!1,s.delete(u.toolUseId);break}const f=o.get(u.toolUseId);if(f!==void 0){const p=i[f];p.output=u.output,p.error=u.error,p.pending=!1,u.toolResultExtra&&(p.toolResultExtra=u.toolResultExtra);break}break}case"agent-call":{const d={kind:"merged-agent",seq:u.seq,toolUseId:u.toolUseId,description:u.description,input:u.input,pending:!0,notifications:[]};o.set(u.toolUseId,i.length),i.push(d);const f=a.get(u.toolUseId);f&&(l(d,f),a.delete(u.toolUseId));break}case"agent-progress":{const d=o.get(u.toolUseId);if(d!==void 0){l(i[d],u);break}a.set(u.toolUseId,u);break}case"agent-notification":{const d=u.parentToolUseId;if(d){const f=o.get(d);if(f!==void 0){i[f].notifications.push({text:u.text,taskId:u.taskId});break}}i.push({kind:"agent-notification",seq:u.seq,text:u.text,taskId:u.taskId,parentToolUseId:u.parentToolUseId});break}case"todo-checklist":{c===r&&u.todos.length>0&&i.push({kind:"todo-checklist",seq:u.seq,toolUseId:u.toolUseId,todos:u.todos});break}case"task-event":{c===n&&t.length>0&&i.push({kind:"plan-card",seq:u.seq,tasks:t});break}default:i.push(u)}}return i}const qU=/<(system-reminder|related-dir|clawd-shift-fire)\b[^>]*>[\s\S]*?<\/\1>/gi,KU=/<builder-preview\b[^>]*\/>/gi;function gR(e){return e?e.replace(qU,"").replace(KU,"").trim():""}const GU=gR;function XU(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const YU=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ZU=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QU={};function vS(e,t){return(QU.jsx?ZU:YU).test(e)}const JU=/[ \t\n\f\r]/g;function eW(e){return typeof e=="object"?e.type==="text"?xS(e.value):!1:xS(e)}function xS(e){return e.replace(JU,"")===""}class bu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}bu.prototype.normal={};bu.prototype.property={};bu.prototype.space=void 0;function vR(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new bu(n,r,t)}function h0(e){return e.toLowerCase()}class Vn{constructor(t,n){this.attribute=n,this.property=t}}Vn.prototype.attribute="";Vn.prototype.booleanish=!1;Vn.prototype.boolean=!1;Vn.prototype.commaOrSpaceSeparated=!1;Vn.prototype.commaSeparated=!1;Vn.prototype.defined=!1;Vn.prototype.mustUseProperty=!1;Vn.prototype.number=!1;Vn.prototype.overloadedBoolean=!1;Vn.prototype.property="";Vn.prototype.spaceSeparated=!1;Vn.prototype.space=void 0;let tW=0;const Ie=Do(),Mt=Do(),f0=Do(),Y=Do(),lt=Do(),Na=Do(),Xn=Do();function Do(){return 2**++tW}const p0=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Mt,commaOrSpaceSeparated:Xn,commaSeparated:Na,number:Y,overloadedBoolean:f0,spaceSeparated:lt},Symbol.toStringTag,{value:"Module"})),Rm=Object.keys(p0);class hy extends Vn{constructor(t,n,r,i){let s=-1;if(super(t,n),_S(this,"space",i),typeof r=="number")for(;++s<Rm.length;){const o=Rm[s];_S(this,Rm[s],(r&p0[o])===p0[o])}}}hy.prototype.defined=!0;function _S(e,t,n){n&&(e[t]=n)}function cl(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new hy(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[h0(r)]=r,n[h0(s.attribute)]=r}return new bu(t,n,e.space)}const xR=cl({properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:Y,ariaColIndex:Y,ariaColSpan:Y,ariaControls:lt,ariaCurrent:null,ariaDescribedBy:lt,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:lt,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:lt,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:lt,ariaLevel:Y,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:lt,ariaPlaceholder:null,ariaPosInSet:Y,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:lt,ariaRowCount:Y,ariaRowIndex:Y,ariaRowSpan:Y,ariaSelected:Mt,ariaSetSize:Y,ariaSort:null,ariaValueMax:Y,ariaValueMin:Y,ariaValueNow:Y,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function _R(e,t){return t in e?e[t]:t}function yR(e,t){return _R(e,t.toLowerCase())}const nW=cl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Na,acceptCharset:lt,accessKey:lt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:lt,autoFocus:Ie,autoPlay:Ie,blocking:lt,capture:null,charSet:null,checked:Ie,cite:null,className:lt,cols:Y,colSpan:null,content:null,contentEditable:Mt,controls:Ie,controlsList:lt,coords:Y|Na,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:f0,draggable:Mt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:lt,height:Y,hidden:f0,high:Y,href:null,hrefLang:null,htmlFor:lt,httpEquiv:lt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:lt,itemRef:lt,itemScope:Ie,itemType:lt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:Y,manifest:null,max:null,maxLength:Y,media:null,method:null,min:null,minLength:Y,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ie,optimum:Y,pattern:null,ping:lt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:lt,required:Ie,reversed:Ie,rows:Y,rowSpan:Y,sandbox:lt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shape:null,size:Y,sizes:null,slot:null,span:Y,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Y,step:null,style:null,tabIndex:Y,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Mt,width:Y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:lt,axis:null,background:null,bgColor:null,border:Y,borderColor:null,bottomMargin:Y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:Y,leftMargin:Y,link:null,longDesc:null,lowSrc:null,marginHeight:Y,marginWidth:Y,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:Y,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:Y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ie,disableRemotePlayback:Ie,prefix:null,property:null,results:Y,security:null,unselectable:null},space:"html",transform:yR}),rW=cl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Xn,accentHeight:Y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Y,amplitude:Y,arabicForm:null,ascent:Y,attributeName:null,attributeType:null,azimuth:Y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Y,by:null,calcMode:null,capHeight:Y,className:lt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Y,diffuseConstant:Y,direction:null,display:null,dur:null,divisor:Y,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:Y,enableBackground:null,end:null,event:null,exponent:Y,externalResourcesRequired:null,fill:null,fillOpacity:Y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Na,g2:Na,glyphName:Na,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Y,horizOriginX:Y,horizOriginY:Y,id:null,ideographic:Y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Y,k:Y,k1:Y,k2:Y,k3:Y,k4:Y,kernelMatrix:Xn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Y,overlineThickness:Y,paintOrder:null,panose1:null,path:null,pathLength:Y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:lt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Y,pointsAtY:Y,pointsAtZ:Y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Xn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Xn,rev:Xn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Xn,requiredFeatures:Xn,requiredFonts:Xn,requiredFormats:Xn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Y,specularExponent:Y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Y,strikethroughThickness:Y,string:null,stroke:null,strokeDashArray:Xn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Y,strokeOpacity:Y,strokeWidth:null,style:null,surfaceScale:Y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Xn,tabIndex:Y,tableValues:null,target:null,targetX:Y,targetY:Y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Xn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Y,underlineThickness:Y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Y,values:null,vAlphabetic:Y,vMathematical:Y,vectorEffect:null,vHanging:Y,vIdeographic:Y,version:null,vertAdvY:Y,vertOriginX:Y,vertOriginY:Y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:_R}),bR=cl({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),wR=cl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yR}),SR=cl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),iW={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},sW=/[A-Z]/g,yS=/-[a-z]/g,oW=/^data[-\w.:]+$/i;function aW(e,t){const n=h0(t);let r=t,i=Vn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oW.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yS,cW);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yS.test(s)){let o=s.replace(sW,lW);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=hy}return new i(r,t)}function lW(e){return"-"+e.toLowerCase()}function cW(e){return e.charAt(1).toUpperCase()}const uW=vR([xR,nW,bR,wR,SR],"html"),fy=vR([xR,rW,bR,wR,SR],"svg");function dW(e){return e.join(" ").trim()}var py={},bS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,hW=/\n/g,fW=/^\s*/,pW=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mW=/^:\s*/,gW=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,vW=/^[;\s]*/,xW=/^\s+|\s+$/g,_W=`
|
|
496
496
|
`,wS="/",SS="*",Ys="",yW="comment",bW="declaration";function wW(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(m){var v=m.match(hW);v&&(n+=v.length);var b=m.lastIndexOf(_W);r=~b?m.length-b:r+m.length}function s(){var m={line:n,column:r};return function(v){return v.position=new o(m),c(),v}}function o(m){this.start=m,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(m){var v=new Error(t.source+":"+n+":"+r+": "+m);if(v.reason=m,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(m){var v=m.exec(e);if(v){var b=v[0];return i(b),e=e.slice(b.length),v}}function c(){l(fW)}function u(m){var v;for(m=m||[];v=d();)v!==!1&&m.push(v);return m}function d(){var m=s();if(!(wS!=e.charAt(0)||SS!=e.charAt(1))){for(var v=2;Ys!=e.charAt(v)&&(SS!=e.charAt(v)||wS!=e.charAt(v+1));)++v;if(v+=2,Ys===e.charAt(v-1))return a("End of comment missing");var b=e.slice(2,v-2);return r+=2,i(b),e=e.slice(v),r+=2,m({type:yW,comment:b})}}function f(){var m=s(),v=l(pW);if(v){if(d(),!l(mW))return a("property missing ':'");var b=l(gW),x=m({type:bW,property:kS(v[0].replace(bS,Ys)),value:b?kS(b[0].replace(bS,Ys)):Ys});return l(vW),x}}function p(){var m=[];u(m);for(var v;v=f();)v!==!1&&(m.push(v),u(m));return m}return c(),p()}function kS(e){return e?e.replace(xW,Ys):Ys}var SW=wW,kW=ah&&ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(py,"__esModule",{value:!0});py.default=EW;const CW=kW(SW);function EW(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,CW.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:a}=s;i?t(o,a,s):a&&(n=n||{},n[o]=a)}),n}var fp={};Object.defineProperty(fp,"__esModule",{value:!0});fp.camelCase=void 0;var NW=/^--[a-zA-Z0-9_-]+$/,TW=/-([a-z])/g,PW=/^[^-]+$/,IW=/^-(webkit|moz|ms|o|khtml)-/,RW=/^-(ms)-/,MW=function(e){return!e||PW.test(e)||NW.test(e)},AW=function(e,t){return t.toUpperCase()},CS=function(e,t){return"".concat(t,"-")},jW=function(e,t){return t===void 0&&(t={}),MW(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(RW,CS):e=e.replace(IW,CS),e.replace(TW,AW))};fp.camelCase=jW;var LW=ah&&ah.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},DW=LW(py),OW=fp;function m0(e,t){var n={};return!e||typeof e!="string"||(0,DW.default)(e,function(r,i){r&&i&&(n[(0,OW.camelCase)(r,t)]=i)}),n}m0.default=m0;var BW=m0;const zW=ou(BW),kR=CR("end"),my=CR("start");function CR(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $W(e){const t=my(e),n=kR(e);if(t&&n)return{start:t,end:n}}function hc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ES(e.position):"start"in e||"end"in e?ES(e):"line"in e||"column"in e?g0(e):""}function g0(e){return NS(e&&e.line)+":"+NS(e&&e.column)}function ES(e){return g0(e&&e.start)+"-"+g0(e&&e.end)}function NS(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=hc(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const gy={}.hasOwnProperty,FW=new Map,HW=/[A-Z]/g,UW=new Set(["table","tbody","thead","tfoot","tr"]),WW=new Set(["td","th"]),ER="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function VW(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=JW(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=QW(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?fy:uW,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=NR(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function NR(e,t,n){if(t.type==="element")return qW(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return KW(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return XW(e,t,n);if(t.type==="mdxjsEsm")return GW(e,t);if(t.type==="root")return YW(e,t,n);if(t.type==="text")return ZW(e,t)}function qW(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=fy,e.schema=i),e.ancestors.push(t);const s=PR(e,t.tagName,!1),o=eV(e,t);let a=xy(e,t);return UW.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!eW(l):!0})),TR(e,o,s,t),vy(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function KW(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Zc(e,t.position)}function GW(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zc(e,t.position)}function XW(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=fy,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:PR(e,t.name,!0),o=tV(e,t),a=xy(e,t);return TR(e,o,s,t),vy(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function YW(e,t,n){const r={};return vy(r,xy(e,t)),e.create(t,e.Fragment,r,n)}function ZW(e,t){return t.value}function TR(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function vy(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function QW(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function JW(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=my(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function eV(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&gy.call(t.properties,i)){const s=nV(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&WW.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function tV(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Zc(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Zc(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function xy(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:FW;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=NR(e,s,o);a!==void 0&&n.push(a)}return n}function nV(e,t,n){const r=aW(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?XU(n):dW(n)),r.property==="style"){let i=typeof n=="object"?n:rV(e,String(n));return e.stylePropertyNameCase==="css"&&(i=iV(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?iW[r.property]||r.property:r.attribute,n]}}function rV(e,t){try{return zW(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ER+"#cannot-parse-style-attribute",i}}function PR(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=vS(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=vS(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return gy.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zc(e)}function Zc(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ER+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iV(e){const t={};let n;for(n in e)gy.call(e,n)&&(t[sV(n)]=e[n]);return t}function sV(e){let t=e.replace(HW,oV);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function oV(e){return"-"+e.toLowerCase()}const Mm={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},aV={};function _y(e,t){const n=aV,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return IR(e,r,i)}function IR(e,t,n){if(lV(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return TS(e.children,t,n)}return Array.isArray(e)?TS(e,t,n):""}function TS(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=IR(e[i],t,n);return r.join("")}function lV(e){return!!(e&&typeof e=="object")}const PS=document.createElement("i");function yy(e){const t="&"+e+";";PS.innerHTML=t;const n=PS.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function tr(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function mr(e,t){return e.length>0?(tr(e,e.length,0,t),e):t}const IS={}.hasOwnProperty;function RR(e){const t={};let n=-1;for(;++n<e.length;)cV(t,e[n]);return t}function cV(e,t){let n;for(n in t){const i=(IS.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){IS.call(i,o)||(i[o]=[]);const a=s[o];uV(i[o],Array.isArray(a)?a:a?[a]:[])}}}function uV(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);tr(e,0,0,r)}function MR(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function jr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Cn=Bs(/[A-Za-z]/),yn=Bs(/[\dA-Za-z]/),dV=Bs(/[#-'*+\--9=?A-Z^-~]/);function ef(e){return e!==null&&(e<32||e===127)}const v0=Bs(/\d/),hV=Bs(/[\dA-Fa-f]/),fV=Bs(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function ot(e){return e!==null&&(e<0||e===32)}function ze(e){return e===-2||e===-1||e===32}const pp=Bs(new RegExp("\\p{P}|\\p{S}","u")),wo=Bs(/\s/);function Bs(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function ul(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&yn(e.charCodeAt(n+1))&&yn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ve(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return ze(l)?(e.enter(n),a(l)):t(l)}function a(l){return ze(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const pV={tokenize:mV};function mV(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ve(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return be(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const gV={tokenize:vV},RS={tokenize:xV};function vV(e){const t=this,n=[];let r=0,i,s,o;return a;function a(y){if(r<n.length){const w=n[r];return t.containerState=w[1],e.attempt(w[0].continuation,l,c)(y)}return c(y)}function l(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const w=t.events.length;let S=w,C;for(;S--;)if(t.events[S][0]==="exit"&&t.events[S][1].type==="chunkFlow"){C=t.events[S][1].end;break}x(r);let N=w;for(;N<t.events.length;)t.events[N][1].end={...C},N++;return tr(t.events,S+1,0,t.events.slice(w)),t.events.length=N,c(y)}return a(y)}function c(y){if(r===n.length){if(!i)return f(y);if(i.currentConstruct&&i.currentConstruct.concrete)return m(y);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(RS,u,d)(y)}function u(y){return i&&_(),x(r),f(y)}function d(y){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(y)}function f(y){return t.containerState={},e.attempt(RS,p,m)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),f(y)}function m(y){if(y===null){i&&_(),x(0),e.consume(y);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),v(y)}function v(y){if(y===null){b(e.exit("chunkFlow"),!0),x(0),e.consume(y);return}return be(y)?(e.consume(y),b(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(y),v)}function b(y,w){const S=t.sliceStream(y);if(w&&S.push(null),y.previous=s,s&&(s.next=y),s=y,i.defineSkip(y.start),i.write(S),t.parser.lazy[y.start.line]){let C=i.events.length;for(;C--;)if(i.events[C][1].start.offset<o&&(!i.events[C][1].end||i.events[C][1].end.offset>o))return;const N=t.events.length;let T=N,M,P;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(M){P=t.events[T][1].end;break}M=!0}for(x(r),C=N;C<t.events.length;)t.events[C][1].end={...P},C++;tr(t.events,T+1,0,t.events.slice(N)),t.events.length=C}}function x(y){let w=n.length;for(;w-- >y;){const S=n[w];t.containerState=S[1],S[0].exit.call(t,e)}n.length=y}function _(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function xV(e,t,n){return Ve(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ua(e){if(e===null||ot(e)||wo(e))return 1;if(pp(e))return 2}function mp(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const x0={name:"attention",resolveAll:_V,tokenize:yV};function _V(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};MS(d,-l),MS(f,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=mr(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=mr(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=mr(c,mp(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=mr(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=mr(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,tr(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yV(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Ua(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=Ua(l),d=!u||u===2&&i||n.includes(l),f=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!f)),c._close=!!(s===42?f:f&&(u||!d)),t(l)}}function MS(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const bV={name:"autolink",tokenize:wV};function wV(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(p){return Cn(p)?(e.consume(p),o):p===64?n(p):c(p)}function o(p){return p===43||p===45||p===46||yn(p)?(r=1,a(p)):c(p)}function a(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||yn(p))&&r++<32?(e.consume(p),a):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||ef(p)?n(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):dV(p)?(e.consume(p),c):n(p)}function u(p){return yn(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,u):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):f(p)}function f(p){if((p===45||yn(p))&&r++<63){const m=p===45?f:d;return e.consume(p),m}return n(p)}}const wu={partial:!0,tokenize:SV};function SV(e,t,n){return r;function r(s){return ze(s)?Ve(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||be(s)?t(s):n(s)}}const AR={continuation:{tokenize:CV},exit:EV,name:"blockQuote",tokenize:kV};function kV(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return ze(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function CV(e,t,n){const r=this;return i;function i(o){return ze(o)?Ve(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(AR,t,n)(o)}}function EV(e){e.exit("blockQuote")}const jR={name:"characterEscape",tokenize:NV};function NV(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return fV(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const LR={name:"characterReference",tokenize:TV};function TV(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=yn,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=hV,u):(e.enter("characterReferenceValue"),s=7,o=v0,u(d))}function u(d){if(d===59&&i){const f=e.exit("characterReferenceValue");return o===yn&&!yy(r.sliceSerialize(f))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const AS={partial:!0,tokenize:IV},jS={concrete:!0,name:"codeFenced",tokenize:PV};function PV(e,t,n){const r=this,i={partial:!0,tokenize:S};let s=0,o=0,a;return l;function l(C){return c(C)}function c(C){const N=r.events[r.events.length-1];return s=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,a=C,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(C)}function u(C){return C===a?(o++,e.consume(C),u):o<3?n(C):(e.exit("codeFencedFenceSequence"),ze(C)?Ve(e,d,"whitespace")(C):d(C))}function d(C){return C===null||be(C)?(e.exit("codeFencedFence"),r.interrupt?t(C):e.check(AS,v,w)(C)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(C)):ze(C)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ve(e,p,"whitespace")(C)):C===96&&C===a?n(C):(e.consume(C),f)}function p(C){return C===null||be(C)?d(C):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(C))}function m(C){return C===null||be(C)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(C)):C===96&&C===a?n(C):(e.consume(C),m)}function v(C){return e.attempt(i,w,b)(C)}function b(C){return e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),x}function x(C){return s>0&&ze(C)?Ve(e,_,"linePrefix",s+1)(C):_(C)}function _(C){return C===null||be(C)?e.check(AS,v,w)(C):(e.enter("codeFlowValue"),y(C))}function y(C){return C===null||be(C)?(e.exit("codeFlowValue"),_(C)):(e.consume(C),y)}function w(C){return e.exit("codeFenced"),t(C)}function S(C,N,T){let M=0;return P;function P(z){return C.enter("lineEnding"),C.consume(z),C.exit("lineEnding"),D}function D(z){return C.enter("codeFencedFence"),ze(z)?Ve(C,R,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):R(z)}function R(z){return z===a?(C.enter("codeFencedFenceSequence"),I(z)):T(z)}function I(z){return z===a?(M++,C.consume(z),I):M>=o?(C.exit("codeFencedFenceSequence"),ze(z)?Ve(C,O,"whitespace")(z):O(z)):T(z)}function O(z){return z===null||be(z)?(C.exit("codeFencedFence"),N(z)):T(z)}}}function IV(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Am={name:"codeIndented",tokenize:MV},RV={partial:!0,tokenize:AV};function MV(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ve(e,s,"linePrefix",5)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):be(c)?e.attempt(RV,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||be(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function AV(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):be(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ve(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):be(o)?i(o):n(o)}}const jV={name:"codeText",previous:DV,resolve:LV,tokenize:OV};function LV(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function DV(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function OV(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):be(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||be(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}class BV{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Rl(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Rl(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Rl(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Rl(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Rl(this.left,n.reverse())}}}function Rl(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function DR(e){const t={};let n=-1,r,i,s,o,a,l,c;const u=new BV(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type==="chunkFlow"&&u.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,zV(u,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=u.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(u.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...u.get(i)[1].start},a=u.slice(i,n),a.unshift(r),u.splice(i,n-i+1,a))}}return tr(e,0,Number.POSITIVE_INFINITY,u.slice(0)),!c}function zV(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],c={};let u,d,f=-1,p=n,m=0,v=0;const b=[v];for(;p;){for(;e.get(++i)[1]!==p;);s.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<a.length;)a[f][0]==="exit"&&a[f-1][0]==="enter"&&a[f][1].type===a[f-1][1].type&&a[f][1].start.line!==a[f][1].end.line&&(v=f+1,b.push(v),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):b.pop(),f=b.length;f--;){const x=a.slice(b[f],b[f+1]),_=s.pop();l.push([_,_+x.length-1]),e.splice(_,2,x)}for(l.reverse(),f=-1;++f<l.length;)c[m+l[f][0]]=m+l[f][1],m+=l[f][1]-l[f][0]-1;return c}const $V={resolve:HV,tokenize:UV},FV={partial:!0,tokenize:WV};function HV(e){return DR(e),e}function UV(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):be(a)?e.check(FV,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function WV(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ve(e,s,"linePrefix")}function s(o){if(o===null||be(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function OR(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),f):x===null||x===32||x===41||ef(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),v(x))}function f(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),p(x))}function p(x){return x===62?(e.exit("chunkString"),e.exit(a),f(x)):x===null||x===60||be(x)?n(x):(e.consume(x),x===92?m:p)}function m(x){return x===60||x===62||x===92?(e.consume(x),p):p(x)}function v(x){return!u&&(x===null||x===41||ot(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):u<c&&x===40?(e.consume(x),u++,v):x===41?(e.consume(x),u--,v):x===null||x===32||x===40||ef(x)?n(x):(e.consume(x),x===92?b:v)}function b(x){return x===40||x===41||x===92?(e.consume(x),v):v(x)}}function BR(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(s),u}function u(p){return a>999||p===null||p===91||p===93&&!l||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(p):p===93?(e.exit(s),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||be(p)||a++>999?(e.exit("chunkString"),u(p)):(e.consume(p),l||(l=!ze(p)),p===92?f:d)}function f(p){return p===91||p===92||p===93?(e.consume(p),a++,d):d(p)}}function zR(e,t,n,r,i,s){let o;return a;function a(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),o=f===40?41:f,l):n(f)}function l(f){return f===o?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===o?(e.exit(s),l(o)):f===null?n(f):be(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ve(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(f))}function u(f){return f===o||f===null||be(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:u)}function d(f){return f===o||f===92?(e.consume(f),u):u(f)}}function fc(e,t){let n;return r;function r(i){return be(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ze(i)?Ve(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const VV={name:"definition",tokenize:KV},qV={partial:!0,tokenize:GV};function KV(e,t,n){const r=this;let i;return s;function s(p){return e.enter("definition"),o(p)}function o(p){return BR.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=jr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l):n(p)}function l(p){return ot(p)?fc(e,c)(p):c(p)}function c(p){return OR(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function u(p){return e.attempt(qV,d,d)(p)}function d(p){return ze(p)?Ve(e,f,"whitespace")(p):f(p)}function f(p){return p===null||be(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function GV(e,t,n){return r;function r(a){return ot(a)?fc(e,i)(a):n(a)}function i(a){return zR(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return ze(a)?Ve(e,o,"whitespace")(a):o(a)}function o(a){return a===null||be(a)?t(a):n(a)}}const XV={name:"hardBreakEscape",tokenize:YV};function YV(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return be(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const ZV={name:"headingAtx",resolve:QV,tokenize:JV};function QV(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},tr(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function JV(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||ot(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||be(u)?(e.exit("atxHeading"),t(u)):ze(u)?Ve(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||ot(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const eq=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],LS=["pre","script","style","textarea"],tq={concrete:!0,name:"htmlFlow",resolveTo:iq,tokenize:sq},nq={partial:!0,tokenize:aq},rq={partial:!0,tokenize:oq};function iq(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function sq(e,t,n){const r=this;let i,s,o,a,l;return c;function c(A){return u(A)}function u(A){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),f):A===47?(e.consume(A),s=!0,v):A===63?(e.consume(A),i=3,r.interrupt?t:E):Cn(A)?(e.consume(A),o=String.fromCharCode(A),b):n(A)}function f(A){return A===45?(e.consume(A),i=2,p):A===91?(e.consume(A),i=5,a=0,m):Cn(A)?(e.consume(A),i=4,r.interrupt?t:E):n(A)}function p(A){return A===45?(e.consume(A),r.interrupt?t:E):n(A)}function m(A){const re="CDATA[";return A===re.charCodeAt(a++)?(e.consume(A),a===re.length?r.interrupt?t:R:m):n(A)}function v(A){return Cn(A)?(e.consume(A),o=String.fromCharCode(A),b):n(A)}function b(A){if(A===null||A===47||A===62||ot(A)){const re=A===47,oe=o.toLowerCase();return!re&&!s&&LS.includes(oe)?(i=1,r.interrupt?t(A):R(A)):eq.includes(o.toLowerCase())?(i=6,re?(e.consume(A),x):r.interrupt?t(A):R(A)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(A):s?_(A):y(A))}return A===45||yn(A)?(e.consume(A),o+=String.fromCharCode(A),b):n(A)}function x(A){return A===62?(e.consume(A),r.interrupt?t:R):n(A)}function _(A){return ze(A)?(e.consume(A),_):P(A)}function y(A){return A===47?(e.consume(A),P):A===58||A===95||Cn(A)?(e.consume(A),w):ze(A)?(e.consume(A),y):P(A)}function w(A){return A===45||A===46||A===58||A===95||yn(A)?(e.consume(A),w):S(A)}function S(A){return A===61?(e.consume(A),C):ze(A)?(e.consume(A),S):y(A)}function C(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),l=A,N):ze(A)?(e.consume(A),C):T(A)}function N(A){return A===l?(e.consume(A),l=null,M):A===null||be(A)?n(A):(e.consume(A),N)}function T(A){return A===null||A===34||A===39||A===47||A===60||A===61||A===62||A===96||ot(A)?S(A):(e.consume(A),T)}function M(A){return A===47||A===62||ze(A)?y(A):n(A)}function P(A){return A===62?(e.consume(A),D):n(A)}function D(A){return A===null||be(A)?R(A):ze(A)?(e.consume(A),D):n(A)}function R(A){return A===45&&i===2?(e.consume(A),$):A===60&&i===1?(e.consume(A),F):A===62&&i===4?(e.consume(A),H):A===63&&i===3?(e.consume(A),E):A===93&&i===5?(e.consume(A),B):be(A)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(nq,q,I)(A)):A===null||be(A)?(e.exit("htmlFlowData"),I(A)):(e.consume(A),R)}function I(A){return e.check(rq,O,q)(A)}function O(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),z}function z(A){return A===null||be(A)?I(A):(e.enter("htmlFlowData"),R(A))}function $(A){return A===45?(e.consume(A),E):R(A)}function F(A){return A===47?(e.consume(A),o="",L):R(A)}function L(A){if(A===62){const re=o.toLowerCase();return LS.includes(re)?(e.consume(A),H):R(A)}return Cn(A)&&o.length<8?(e.consume(A),o+=String.fromCharCode(A),L):R(A)}function B(A){return A===93?(e.consume(A),E):R(A)}function E(A){return A===62?(e.consume(A),H):A===45&&i===2?(e.consume(A),E):R(A)}function H(A){return A===null||be(A)?(e.exit("htmlFlowData"),q(A)):(e.consume(A),H)}function q(A){return e.exit("htmlFlow"),t(A)}}function oq(e,t,n){const r=this;return i;function i(o){return be(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function aq(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(wu,t,n)}}const lq={name:"htmlText",tokenize:cq};function cq(e,t,n){const r=this;let i,s,o;return a;function a(E){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(E),l}function l(E){return E===33?(e.consume(E),c):E===47?(e.consume(E),S):E===63?(e.consume(E),y):Cn(E)?(e.consume(E),T):n(E)}function c(E){return E===45?(e.consume(E),u):E===91?(e.consume(E),s=0,m):Cn(E)?(e.consume(E),_):n(E)}function u(E){return E===45?(e.consume(E),p):n(E)}function d(E){return E===null?n(E):E===45?(e.consume(E),f):be(E)?(o=d,F(E)):(e.consume(E),d)}function f(E){return E===45?(e.consume(E),p):d(E)}function p(E){return E===62?$(E):E===45?f(E):d(E)}function m(E){const H="CDATA[";return E===H.charCodeAt(s++)?(e.consume(E),s===H.length?v:m):n(E)}function v(E){return E===null?n(E):E===93?(e.consume(E),b):be(E)?(o=v,F(E)):(e.consume(E),v)}function b(E){return E===93?(e.consume(E),x):v(E)}function x(E){return E===62?$(E):E===93?(e.consume(E),x):v(E)}function _(E){return E===null||E===62?$(E):be(E)?(o=_,F(E)):(e.consume(E),_)}function y(E){return E===null?n(E):E===63?(e.consume(E),w):be(E)?(o=y,F(E)):(e.consume(E),y)}function w(E){return E===62?$(E):y(E)}function S(E){return Cn(E)?(e.consume(E),C):n(E)}function C(E){return E===45||yn(E)?(e.consume(E),C):N(E)}function N(E){return be(E)?(o=N,F(E)):ze(E)?(e.consume(E),N):$(E)}function T(E){return E===45||yn(E)?(e.consume(E),T):E===47||E===62||ot(E)?M(E):n(E)}function M(E){return E===47?(e.consume(E),$):E===58||E===95||Cn(E)?(e.consume(E),P):be(E)?(o=M,F(E)):ze(E)?(e.consume(E),M):$(E)}function P(E){return E===45||E===46||E===58||E===95||yn(E)?(e.consume(E),P):D(E)}function D(E){return E===61?(e.consume(E),R):be(E)?(o=D,F(E)):ze(E)?(e.consume(E),D):M(E)}function R(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),i=E,I):be(E)?(o=R,F(E)):ze(E)?(e.consume(E),R):(e.consume(E),O)}function I(E){return E===i?(e.consume(E),i=void 0,z):E===null?n(E):be(E)?(o=I,F(E)):(e.consume(E),I)}function O(E){return E===null||E===34||E===39||E===60||E===61||E===96?n(E):E===47||E===62||ot(E)?M(E):(e.consume(E),O)}function z(E){return E===47||E===62||ot(E)?M(E):n(E)}function $(E){return E===62?(e.consume(E),e.exit("htmlTextData"),e.exit("htmlText"),t):n(E)}function F(E){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),L}function L(E){return ze(E)?Ve(e,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):B(E)}function B(E){return e.enter("htmlTextData"),o(E)}}const by={name:"labelEnd",resolveAll:fq,resolveTo:pq,tokenize:mq},uq={tokenize:gq},dq={tokenize:vq},hq={tokenize:xq};function fq(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&tr(e,0,e.length,n),e}function pq(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},u={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",c,t]],a=mr(a,e.slice(s+1,s+r+3)),a=mr(a,[["enter",u,t]]),a=mr(a,mp(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=mr(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=mr(a,e.slice(o+1)),a=mr(a,[["exit",l,t]]),tr(e,s,e.length,a),e}function mq(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(f){return s?s._inactive?d(f):(o=r.parser.defined.includes(jr(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelEnd"),l):n(f)}function l(f){return f===40?e.attempt(uq,u,o?u:d)(f):f===91?e.attempt(dq,u,o?c:d)(f):o?u(f):d(f)}function c(f){return e.attempt(hq,u,d)(f)}function u(f){return t(f)}function d(f){return s._balanced=!0,n(f)}}function gq(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return ot(d)?fc(e,s)(d):s(d)}function s(d){return d===41?u(d):OR(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return ot(d)?fc(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?zR(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return ot(d)?fc(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function vq(e,t,n){const r=this;return i;function i(a){return BR.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(jr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function xq(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const _q={name:"labelStartImage",resolveAll:by.resolveAll,tokenize:yq};function yq(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const bq={name:"labelStartLink",resolveAll:by.resolveAll,tokenize:wq};function wq(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const jm={name:"lineEnding",tokenize:Sq};function Sq(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ve(e,t,"linePrefix")}}const Jd={name:"thematicBreak",tokenize:kq};function kq(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||be(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),ze(c)?Ve(e,a,"whitespace")(c):a(c))}}const zn={continuation:{tokenize:Tq},exit:Iq,name:"list",tokenize:Nq},Cq={partial:!0,tokenize:Rq},Eq={partial:!0,tokenize:Pq};function Nq(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const m=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:v0(p)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Jd,n,c)(p):c(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(p)}return n(p)}function l(p){return v0(p)&&++o<10?(e.consume(p),l):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),c(p)):n(p)}function c(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(wu,r.interrupt?n:u,e.attempt(Cq,f,d))}function u(p){return r.containerState.initialBlankLine=!0,s++,f(p)}function d(p){return ze(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),f):n(p)}function f(p){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function Tq(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(wu,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ve(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!ze(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Eq,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ve(e,e.attempt(zn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Pq(e,t,n){const r=this;return Ve(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function Iq(e){e.exit(this.containerState.type)}function Rq(e,t,n){const r=this;return Ve(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!ze(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const DS={name:"setextUnderline",resolveTo:Mq,tokenize:Aq};function Mq(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Aq(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),ze(c)?Ve(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||be(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const jq={tokenize:Lq};function Lq(e){const t=this,n=e.attempt(wu,r,e.attempt(this.parser.constructs.flowInitial,i,Ve(e,e.attempt(this.parser.constructs.flow,i,e.attempt($V,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Dq={resolveAll:FR()},Oq=$R("string"),Bq=$R("text");function $R(e){return{resolveAll:FR(e==="text"?zq:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let f=-1;if(d)for(;++f<d.length;){const p=d[f];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function FR(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function zq(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...c.start},r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}const $q={42:zn,43:zn,45:zn,48:zn,49:zn,50:zn,51:zn,52:zn,53:zn,54:zn,55:zn,56:zn,57:zn,62:AR},Fq={91:VV},Hq={[-2]:Am,[-1]:Am,32:Am},Uq={35:ZV,42:Jd,45:[DS,Jd],60:tq,61:DS,95:Jd,96:jS,126:jS},Wq={38:LR,92:jR},Vq={[-5]:jm,[-4]:jm,[-3]:jm,33:_q,38:LR,42:x0,60:[bV,lq],91:bq,92:[XV,jR],93:by,95:x0,96:jV},qq={null:[x0,Dq]},Kq={null:[42,95]},Gq={null:[]},Xq=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Kq,contentInitial:Fq,disable:Gq,document:$q,flow:Uq,flowInitial:Hq,insideSpan:qq,string:Wq,text:Vq},Symbol.toStringTag,{value:"Module"}));function Yq(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:N(S),check:N(C),consume:_,enter:y,exit:w,interrupt:N(C,{interrupt:!0})},c={code:null,containerState:{},defineSkip:v,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(D){return o=mr(o,D),b(),o[o.length-1]!==null?[]:(T(t,0),c.events=mp(s,c.events,c),c.events)}function f(D,R){return Qq(p(D),R)}function p(D){return Zq(o,D)}function m(){const{_bufferIndex:D,_index:R,line:I,column:O,offset:z}=r;return{_bufferIndex:D,_index:R,line:I,column:O,offset:z}}function v(D){i[D.line]=D.column,P()}function b(){let D;for(;r._index<o.length;){const R=o[r._index];if(typeof R=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<R.length;)x(R.charCodeAt(r._bufferIndex));else x(R)}}function x(D){u=u(D)}function _(D){be(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,P()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=D}function y(D,R){const I=R||{};return I.type=D,I.start=m(),c.events.push(["enter",I,c]),a.push(I),I}function w(D){const R=a.pop();return R.end=m(),c.events.push(["exit",R,c]),R}function S(D,R){T(D,R.from)}function C(D,R){R.restore()}function N(D,R){return I;function I(O,z,$){let F,L,B,E;return Array.isArray(O)?q(O):"tokenize"in O?q([O]):H(O);function H(V){return pe;function pe(Oe){const ie=Oe!==null&&V[Oe],Ae=Oe!==null&&V.null,Fe=[...Array.isArray(ie)?ie:ie?[ie]:[],...Array.isArray(Ae)?Ae:Ae?[Ae]:[]];return q(Fe)(Oe)}}function q(V){return F=V,L=0,V.length===0?$:A(V[L])}function A(V){return pe;function pe(Oe){return E=M(),B=V,V.partial||(c.currentConstruct=V),V.name&&c.parser.constructs.disable.null.includes(V.name)?oe():V.tokenize.call(R?Object.assign(Object.create(c),R):c,l,re,oe)(Oe)}}function re(V){return D(B,E),z}function oe(V){return E.restore(),++L<F.length?A(F[L]):$}}}function T(D,R){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&tr(c.events,R,c.events.length-R,D.resolve(c.events.slice(R),c)),D.resolveTo&&(c.events=D.resolveTo(c.events,c))}function M(){const D=m(),R=c.previous,I=c.currentConstruct,O=c.events.length,z=Array.from(a);return{from:O,restore:$};function $(){r=D,c.previous=R,c.currentConstruct=I,c.events.length=O,a=z,P()}}function P(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Zq(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Qq(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
497
497
|
`;break}case-3:{o=`\r
|
|
498
498
|
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function Jq(e){const r={constructs:RR([Xq,...(e||{}).extensions||[]]),content:i(pV),defined:[],document:i(gV),flow:i(jq),lazy:{},string:i(Oq),text:i(Bq)};return r;function i(s){return o;function o(a){return Yq(r,s,a)}}}function eK(e){for(;!DR(e););return e}const OS=/[\0\t\n\r]/g;function tK(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,f,p;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(OS.lastIndex=d,c=OS.exec(s),f=c&&c.index!==void 0?c.index:s.length,p=s.charCodeAt(f),!c){t=s.slice(d);break}if(p===10&&d===f&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<f&&(l.push(s.slice(d,f)),e+=f-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=f+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const nK=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rK(e){return e.replace(nK,iK)}function iK(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return MR(n.slice(s?2:1),s?16:10)}return yy(n)||e}const HR={}.hasOwnProperty;function sK(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),oK(n)(eK(Jq(n).document().write(tK()(e,t,!0))))}function oK(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Bt),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(Gt),blockQuote:s(Ae),characterEscape:M,characterReference:M,codeFenced:s(Fe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(Fe,o),codeText:s(We,o),codeTextData:M,data:M,codeFlowValue:M,definition:s(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(qe),hardBreakEscape:s(wt),hardBreakTrailing:s(wt),htmlFlow:s(Rt,o),htmlFlowData:M,htmlText:s(Rt,o),htmlTextData:M,image:s(ln),label:o,link:s(Bt),listItem:s(Ue),listItemValue:f,listOrdered:s(at,d),listUnordered:s(at),paragraph:s(nt),reference:A,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Gt),strong:s(mt),thematicBreak:s(pn)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:ie,autolinkProtocol:Oe,blockQuote:l(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:oe,characterReferenceMarkerNumeric:oe,characterReferenceValue:V,characterReference:pe,codeFenced:l(b),codeFencedFence:v,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:P,codeIndented:l(x),codeText:l(z),codeTextData:P,data:P,definition:l(),definitionDestinationString:w,definitionLabelString:_,definitionTitleString:y,emphasis:l(),hardBreakEscape:l(R),hardBreakTrailing:l(R),htmlFlow:l(I),htmlFlowData:P,htmlText:l(O),htmlTextData:P,image:l(F),label:B,labelText:L,lineEnding:D,link:l($),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:re,resourceDestinationString:E,resourceTitleString:H,resource:q,setextHeading:l(T),setextHeadingLineSequence:N,setextHeadingText:C,strong:l(),thematicBreak:l()}};UR(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let Q={type:"root",children:[]};const ve={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},Se=[];let J=-1;for(;++J<U.length;)if(U[J][1].type==="listOrdered"||U[J][1].type==="listUnordered")if(U[J][0]==="enter")Se.push(J);else{const Ye=Se.pop();J=i(U,Ye,J)}for(J=-1;++J<U.length;){const Ye=t[U[J][0]];HR.call(Ye,U[J][1].type)&&Ye[U[J][1].type].call(Object.assign({sliceSerialize:U[J][2].sliceSerialize},ve),U[J][1])}if(ve.tokenStack.length>0){const Ye=ve.tokenStack[ve.tokenStack.length-1];(Ye[1]||BS).call(ve,void 0,Ye[0])}for(Q.position={start:Zi(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:Zi(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},J=-1;++J<t.transforms.length;)Q=t.transforms[J](Q)||Q;return Q}function i(U,Q,ve){let Se=Q-1,J=-1,Ye=!1,Yt,Zt,ue,Te;for(;++Se<=ve;){const Je=U[Se];switch(Je[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Je[0]==="enter"?J++:J--,Te=void 0;break}case"lineEndingBlank":{Je[0]==="enter"&&(Yt&&!Te&&!J&&!ue&&(ue=Se),Te=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Te=void 0}if(!J&&Je[0]==="enter"&&Je[1].type==="listItemPrefix"||J===-1&&Je[0]==="exit"&&(Je[1].type==="listUnordered"||Je[1].type==="listOrdered")){if(Yt){let Ln=Se;for(Zt=void 0;Ln--;){const Qt=U[Ln];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;Zt&&(U[Zt][1].type="lineEndingBlank",Ye=!0),Qt[1].type="lineEnding",Zt=Ln}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}ue&&(!Zt||ue<Zt)&&(Yt._spread=!0),Yt.end=Object.assign({},Zt?U[Zt][1].start:Je[1].end),U.splice(Zt||Se,0,["exit",Yt,Je[2]]),Se++,ve++}if(Je[1].type==="listItemPrefix"){const Ln={type:"listItem",_spread:!1,start:Object.assign({},Je[1].start),end:void 0};Yt=Ln,U.splice(Se,0,["enter",Ln,Je[2]]),Se++,ve++,ue=void 0,Te=!0}}}return U[Q][1]._spread=Ye,ve}function s(U,Q){return ve;function ve(Se){a.call(this,U(Se),Se),Q&&Q.call(this,Se)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(U,Q,ve){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([Q,ve||void 0]),U.position={start:Zi(Q.start),end:void 0}}function l(U){return Q;function Q(ve){U&&U.call(this,ve),c.call(this,ve)}}function c(U,Q){const ve=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==U.type&&(Q?Q.call(this,U,Se[0]):(Se[1]||BS).call(this,U,Se[0]));else throw new Error("Cannot close `"+U.type+"` ("+hc({start:U.start,end:U.end})+"): it’s not open");ve.position.end=Zi(U.end)}function u(){return _y(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(U){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function p(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=U}function m(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=U}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.value=U.replace(/(\r?\n|\r)$/g,"")}function _(U){const Q=this.resume(),ve=this.stack[this.stack.length-1];ve.label=Q,ve.identifier=jr(this.sliceSerialize(U)).toLowerCase()}function y(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.title=U}function w(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.url=U}function S(U){const Q=this.stack[this.stack.length-1];if(!Q.depth){const ve=this.sliceSerialize(U).length;Q.depth=ve}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function N(U){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function M(U){const ve=this.stack[this.stack.length-1].children;let Se=ve[ve.length-1];(!Se||Se.type!=="text")&&(Se=Xt(),Se.position={start:Zi(U.start),end:void 0},ve.push(Se)),this.stack.push(Se)}function P(U){const Q=this.stack.pop();Q.value+=this.sliceSerialize(U),Q.position.end=Zi(U.end)}function D(U){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ve=Q.children[Q.children.length-1];ve.position.end=Zi(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(M.call(this,U),P.call(this,U))}function R(){this.data.atHardBreak=!0}function I(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.value=U}function O(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.value=U}function z(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.value=U}function $(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=Q,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function F(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=Q,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function L(U){const Q=this.sliceSerialize(U),ve=this.stack[this.stack.length-2];ve.label=rK(Q),ve.identifier=jr(Q).toLowerCase()}function B(){const U=this.stack[this.stack.length-1],Q=this.resume(),ve=this.stack[this.stack.length-1];if(this.data.inReference=!0,ve.type==="link"){const Se=U.children;ve.children=Se}else ve.alt=Q}function E(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.url=U}function H(){const U=this.resume(),Q=this.stack[this.stack.length-1];Q.title=U}function q(){this.data.inReference=void 0}function A(){this.data.referenceType="collapsed"}function re(U){const Q=this.resume(),ve=this.stack[this.stack.length-1];ve.label=Q,ve.identifier=jr(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function oe(U){this.data.characterReferenceType=U.type}function V(U){const Q=this.sliceSerialize(U),ve=this.data.characterReferenceType;let Se;ve?(Se=MR(Q,ve==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=yy(Q);const J=this.stack[this.stack.length-1];J.value+=Se}function pe(U){const Q=this.stack.pop();Q.position.end=Zi(U.end)}function Oe(U){P.call(this,U);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(U)}function ie(U){P.call(this,U);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(U)}function Ae(){return{type:"blockquote",children:[]}}function Fe(){return{type:"code",lang:null,meta:null,value:""}}function We(){return{type:"inlineCode",value:""}}function ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qe(){return{type:"emphasis",children:[]}}function Gt(){return{type:"heading",depth:0,children:[]}}function wt(){return{type:"break"}}function Rt(){return{type:"html",value:""}}function ln(){return{type:"image",title:null,url:"",alt:null}}function Bt(){return{type:"link",title:null,url:"",children:[]}}function at(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Ue(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function nt(){return{type:"paragraph",children:[]}}function mt(){return{type:"strong",children:[]}}function Xt(){return{type:"text",value:""}}function pn(){return{type:"thematicBreak"}}}function Zi(e){return{line:e.line,column:e.column,offset:e.offset}}function UR(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?UR(e,r):aK(e,r)}}function aK(e,t){let n;for(n in t)if(HR.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function BS(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hc({start:t.start,end:t.end})+") is still open")}function lK(e){const t=this;t.parser=n;function n(r){return sK(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function cK(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function uK(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|