@puddle-code/cli 0.0.43 → 0.0.47

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +8 -8
  2. package/README.md +15 -3
  3. package/dist/index.js +1304 -865
  4. package/dist/install.sh +19 -3
  5. package/dist/public/assets/Dashboard-D5d81RrW.js +1 -0
  6. package/dist/public/assets/EditorTabClose-DQFig1yS.js +1 -0
  7. package/dist/public/assets/LazyTerminal-DLpi1FQW.js +2 -0
  8. package/dist/public/assets/{ModelRefcount-CCLXoHn3.js → ModelRefcount-QvnWLhBB.js} +1 -1
  9. package/dist/public/assets/PaneEditorBody-mRqGUQOX.js +515 -0
  10. package/dist/public/assets/SettingsDialog-D15adtF_.js +1 -0
  11. package/dist/public/assets/{Terminal-2XYN3IO5.js → Terminal-ZApPvZ0N.js} +51 -26
  12. package/dist/public/assets/Workspace-CsXrKmgW.js +7 -0
  13. package/dist/public/assets/{buffer-store-kyNS3Ffy.js → buffer-store-B2HjJa44.js} +3 -3
  14. package/dist/public/assets/chevron-down-59O6CgEo.js +1 -0
  15. package/dist/public/assets/context-menu-DOkkb33w.js +1 -0
  16. package/dist/public/assets/{cssMode-CfVFZjxa.js → cssMode-10rVHs6e.js} +1 -1
  17. package/dist/public/assets/dialog-DjL0qoAv.js +41 -0
  18. package/dist/public/assets/dist-DDFe8e3m.js +1 -0
  19. package/dist/public/assets/editor-context-D8zZKoyt.js +1 -0
  20. package/dist/public/assets/{editor-sync-1UzWDCzn.js → editor-sync-C_rbvqxK.js} +1 -1
  21. package/dist/public/assets/file-links-D3c5reil.js +1 -0
  22. package/dist/public/assets/hotkeys-C1l8zghv.js +73 -0
  23. package/dist/public/assets/{htmlMode-CwjicKNM.js → htmlMode-Dk6DjDk-.js} +1 -1
  24. package/dist/public/assets/index-CjwWpHJ7.js +10 -0
  25. package/dist/public/assets/index-Du89SpLI.css +2 -0
  26. package/dist/public/assets/{jsonMode-B9Rj1ARB.js → jsonMode-CwJtwmIn.js} +1 -1
  27. package/dist/public/assets/session-seed-BY79S7pl.js +1 -0
  28. package/dist/public/assets/{tsMode-gVybv0cY.js → tsMode-BZb-xILx.js} +1 -1
  29. package/dist/public/assets/use-find-controls-BxqgwO4Z.js +1 -0
  30. package/dist/public/assets/x-BJOrp_m5.js +1 -0
  31. package/dist/public/index.html +6 -8
  32. package/package.json +1 -1
  33. package/dist/public/assets/Dashboard-CVuyy1FW.js +0 -1
  34. package/dist/public/assets/EditorTabClose-Dltbo1Dg.js +0 -1
  35. package/dist/public/assets/LazyTerminal-dx89528B.js +0 -2
  36. package/dist/public/assets/PaneEditorBody-BEq9lIXk.js +0 -355
  37. package/dist/public/assets/SettingsDialog-cXSqHb2k.js +0 -1
  38. package/dist/public/assets/Workspace-DEEiDdYw.js +0 -7
  39. package/dist/public/assets/context-menu-DsXFpYcn.js +0 -1
  40. package/dist/public/assets/createLucideIcon-DyMAgLa3.js +0 -1
  41. package/dist/public/assets/dialog-B43iKmfK.js +0 -41
  42. package/dist/public/assets/dist-i-QevsUb.js +0 -1
  43. package/dist/public/assets/editor-context-A7YnYVrw.js +0 -1
  44. package/dist/public/assets/file-links-xHzwSI4k.js +0 -1
  45. package/dist/public/assets/hotkeys-CA5Pxll4.js +0 -73
  46. package/dist/public/assets/index-BYC57b5y.js +0 -10
  47. package/dist/public/assets/index-Cs421fXN.css +0 -2
  48. package/dist/public/assets/jsx-runtime-ffCh33zF.js +0 -1
  49. package/dist/public/assets/session-seed-2cbwtTKV.js +0 -1
  50. package/dist/public/assets/utils-B6KiDbIe.js +0 -1
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{A as r,C as i,E as a,O as o,S as s,T as c,_ as l,b as u,d,f,j as p,m,p as h,v as g,w as _,x as ee,y as v}from"./dialog-B43iKmfK.js";import{_ as y,f as b,g as te,h as x,m as S,p as C,v as w}from"./LazyTerminal-dx89528B.js";import{t as T}from"./utils-B6KiDbIe.js";import{t as E}from"./createLucideIcon-DyMAgLa3.js";import{n as D,r as O,t as ne}from"./dist-i-QevsUb.js";var k=E(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),A=E(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]);function re(e){let t=Date.parse(e.created_at);return Number.isNaN(t)?0:t}function j(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(t.id)?r:i).push(t);return r.sort((e,t)=>n.get(e.id)-n.get(t.id)),i.sort((e,t)=>re(t)-re(e)),[...i,...r]}function M(e,t,n){if(t===n)return[...e];let r=e.filter(e=>e!==t),i=r.indexOf(n);return i===-1?[...e]:(r.splice(i,0,t),r)}function N(e,t,n){if(t===n)return null;let r=e.find(e=>e.sessions.some(e=>e.id===t));if(!r||!r.sessions.some(e=>e.id===n))return null;let i=e.flatMap(e=>e.sessions.map(e=>e.id)),a=M(i,t,n);return a.some((e,t)=>e!==i[t])?a:null}function ie(e,t){let n=new Set(e);return[...e,...t.filter(e=>!n.has(e))]}var P=e(t(),1),F=!1;function ae(){let[e,t]=P.useState(F);return P.useEffect(()=>{F||(F=!0,t(!0))},[]),e}var I=P.useSyncExternalStore;function oe(){return()=>{}}function se(){return I(oe,()=>!0,()=>!1)}var ce=typeof I==`function`?se:ae,L=n(),le=`rovingFocusGroup.onEntryFocus`,ue={bubbles:!1,cancelable:!0},R=`RovingFocusGroup`,[de,fe,pe]=D(R),[me,he]=o(R,[pe]),[ge,_e]=me(R),ve=P.forwardRef((e,t)=>(0,L.jsx)(de.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(de.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(ye,{...e,ref:t})})}));ve.displayName=R;var ye=P.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:a,loop:o=!1,dir:s,currentTabStopId:c,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:f,preventScrollOnEntryFocus:m=!1,...h}=e,g=P.useRef(null),ee=r(t,g),v=ne(s),[y,b]=l({prop:c,defaultProp:u??null,onChange:d,caller:R}),[te,x]=P.useState(!1),S=i(f),C=fe(n),w=P.useRef(!1),[T,E]=P.useState(0);return P.useEffect(()=>{let e=g.current;if(e)return e.addEventListener(le,S),()=>e.removeEventListener(le,S)},[S]),(0,L.jsx)(ge,{scope:n,orientation:a,dir:v,loop:o,currentTabStopId:y,onItemFocus:P.useCallback(e=>b(e),[b]),onItemShiftTab:P.useCallback(()=>x(!0),[]),onFocusableItemAdd:P.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:P.useCallback(()=>E(e=>e-1),[]),children:(0,L.jsx)(_.div,{tabIndex:te||T===0?-1:0,"data-orientation":a,...h,ref:ee,style:{outline:`none`,...e.style},onMouseDown:p(e.onMouseDown,()=>{w.current=!0}),onFocus:p(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!te){let t=new CustomEvent(le,ue);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);Te([e.find(e=>e.active),e.find(e=>e.id===y),...e].filter(Boolean).map(e=>e.ref.current),m)}}w.current=!1}),onBlur:p(e.onBlur,()=>x(!1))})})}),be=`RovingFocusGroupItem`,xe=P.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=u(),l=a||c,d=_e(be,n),f=d.currentTabStopId===l,m=fe(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:v}=d,y=ce();return ee(()=>{if(!(!y||!r))return h(),()=>g()},[y,r,h,g]),P.useEffect(()=>{if(!(y||!r))return h(),()=>g()},[y,r,h,g]),(0,L.jsx)(de.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(_.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:p(e.onMouseDown,e=>{r?d.onItemFocus(l):e.preventDefault()}),onFocus:p(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:p(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=we(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?Ee(n,r+1):n.slice(r+1)}setTimeout(()=>Te(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:v!=null}):o})})});xe.displayName=be;var Se={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Ce(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function we(e,t,n){let r=Ce(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Se[r]}function Te(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Ee(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var De=ve,Oe=xe,ke=[`Enter`,` `],Ae=[`ArrowDown`,`PageUp`,`Home`],je=[`ArrowUp`,`PageDown`,`End`],Me=[...Ae,...je],Ne={ltr:[...ke,`ArrowRight`],rtl:[...ke,`ArrowLeft`]},Pe={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},z=`Menu`,[B,Fe,Ie]=D(z),[V,Le]=o(z,[Ie,w,he]),H=w(),Re=he(),[ze,U]=V(z),[Be,W]=V(z),Ve=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:o,modal:s=!0}=e,c=H(t),[l,u]=P.useState(null),d=P.useRef(!1),f=i(o),p=ne(a);return P.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),P.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,L.jsx)(y,{...c,children:(0,L.jsx)(ze,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,L.jsx)(Be,{scope:t,onClose:P.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:s,children:r})})})};Ve.displayName=z;var He=`MenuAnchor`,Ue=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,L.jsx)(S,{...i,...r,ref:t})});Ue.displayName=He;var We=`MenuPortal`,[Ge,Ke]=V(We,{forceMount:void 0}),qe=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=U(We,t);return(0,L.jsx)(Ge,{scope:t,forceMount:n,children:(0,L.jsx)(g,{present:n||a.open,children:(0,L.jsx)(v,{asChild:!0,container:i,children:r})})})};qe.displayName=We;var G=`MenuContent`,[Je,Ye]=V(G),Xe=P.forwardRef((e,t)=>{let n=Ke(G,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=U(G,e.__scopeMenu),o=W(G,e.__scopeMenu);return(0,L.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(g,{present:r||a.open,children:(0,L.jsx)(B.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(Ze,{...i,ref:t}):(0,L.jsx)(Qe,{...i,ref:t})})})})}),Ze=P.forwardRef((e,t)=>{let n=U(G,e.__scopeMenu),i=P.useRef(null),a=r(t,i);return P.useEffect(()=>{let e=i.current;if(e)return d(e)},[]),(0,L.jsx)(et,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:p(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Qe=P.forwardRef((e,t)=>{let n=U(G,e.__scopeMenu);return(0,L.jsx)(et,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),$e=a(`MenuContent.ScrollLock`),et=P.forwardRef((e,t)=>{let{__scopeMenu:n,loop:i=!1,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:c,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,disableOutsideScroll:y,...b}=e,x=U(G,n),S=W(G,n),C=H(n),w=Re(n),T=Fe(n),[E,D]=P.useState(null),O=P.useRef(null),ne=r(t,O,x.onContentChange),k=P.useRef(0),A=P.useRef(``),re=P.useRef(0),j=P.useRef(null),M=P.useRef(`right`),N=P.useRef(0),ie=y?f:P.Fragment,F=y?{as:$e,allowPinchZoom:!0}:void 0,ae=e=>{let t=A.current+e,n=T().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Pt(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){A.current=t,window.clearTimeout(k.current),t!==``&&(k.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};P.useEffect(()=>()=>window.clearTimeout(k.current),[]),h();let I=P.useCallback(e=>M.current===j.current?.side&&It(e,j.current?.area),[]);return(0,L.jsx)(Je,{scope:n,searchRef:A,onItemEnter:P.useCallback(e=>{I(e)&&e.preventDefault()},[I]),onItemLeave:P.useCallback(e=>{I(e)||(O.current?.focus(),D(null))},[I]),onTriggerLeave:P.useCallback(e=>{I(e)&&e.preventDefault()},[I]),pointerGraceTimerRef:re,onPointerGraceIntentChange:P.useCallback(e=>{j.current=e},[]),children:(0,L.jsx)(ie,{...F,children:(0,L.jsx)(m,{asChild:!0,trapped:a,onMountAutoFocus:p(o,e=>{e.preventDefault(),O.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:(0,L.jsx)(s,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:d,onPointerDownOutside:g,onFocusOutside:_,onInteractOutside:ee,onDismiss:v,children:(0,L.jsx)(De,{asChild:!0,...w,dir:S.dir,orientation:`vertical`,loop:i,currentTabStopId:E,onCurrentTabStopIdChange:D,onEntryFocus:p(u,e=>{S.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(te,{role:`menu`,"aria-orientation":`vertical`,"data-state":At(x.open),"data-radix-menu-content":``,dir:S.dir,...C,...b,ref:ne,style:{outline:`none`,...b.style},onKeyDown:p(b.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ae(e.key));let i=O.current;if(e.target!==i||!Me.includes(e.key))return;e.preventDefault();let a=T().filter(e=>!e.disabled).map(e=>e.ref.current);je.includes(e.key)&&a.reverse(),Mt(a)}),onBlur:p(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(k.current),A.current=``)}),onPointerMove:p(e.onPointerMove,X(e=>{let t=e.target,n=N.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>N.current?`right`:`left`;M.current=t,N.current=e.clientX}}))})})})})})})});Xe.displayName=G;var tt=`MenuGroup`,nt=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(_.div,{role:`group`,...r,ref:t})});nt.displayName=tt;var rt=`MenuLabel`,it=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(_.div,{...r,ref:t})});it.displayName=rt;var K=`MenuItem`,at=`menu.itemSelect`,q=P.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:i,...a}=e,o=P.useRef(null),s=W(K,e.__scopeMenu),l=Ye(K,e.__scopeMenu),u=r(t,o),d=P.useRef(!1),f=()=>{let e=o.current;if(!n&&e){let t=new CustomEvent(at,{bubbles:!0,cancelable:!0});e.addEventListener(at,e=>i?.(e),{once:!0}),c(e,t),t.defaultPrevented?d.current=!1:s.onClose()}};return(0,L.jsx)(ot,{...a,ref:u,disabled:n,onClick:p(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:p(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:p(e.onKeyDown,e=>{n||e.target!==e.currentTarget||l.searchRef.current!==``&&e.key===` `||ke.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});q.displayName=K;var ot=P.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:i=!1,textValue:a,...o}=e,s=Ye(K,n),c=Re(n),l=P.useRef(null),u=r(t,l),[d,f]=P.useState(!1),[m,h]=P.useState(``);return P.useEffect(()=>{let e=l.current;e&&h((e.textContent??``).trim())},[o.children]),(0,L.jsx)(B.ItemSlot,{scope:n,disabled:i,textValue:a??m,children:(0,L.jsx)(Oe,{asChild:!0,...c,focusable:!i,children:(0,L.jsx)(_.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,...o,ref:u,onPointerMove:p(e.onPointerMove,X(e=>{i?s.onItemLeave(e):(s.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:p(e.onPointerLeave,X(e=>s.onItemLeave(e))),onFocus:p(e.onFocus,()=>f(!0)),onBlur:p(e.onBlur,()=>f(!1))})})})}),st=`MenuCheckboxItem`,ct=P.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(gt,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(q,{role:`menuitemcheckbox`,"aria-checked":Y(n)?`mixed`:n,...i,ref:t,"data-state":jt(n),onSelect:p(i.onSelect,()=>r?.(Y(n)?!0:!n),{checkForDefaultPrevented:!1})})})});ct.displayName=st;var lt=`MenuRadioGroup`,[ut,dt]=V(lt,{value:void 0,onValueChange:()=>{}}),ft=P.forwardRef((e,t)=>{let{value:n,onValueChange:r,...a}=e,o=i(r);return(0,L.jsx)(ut,{scope:e.__scopeMenu,value:n,onValueChange:o,children:(0,L.jsx)(nt,{...a,ref:t})})});ft.displayName=lt;var pt=`MenuRadioItem`,mt=P.forwardRef((e,t)=>{let{value:n,...r}=e,i=dt(pt,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(gt,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(q,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":jt(a),onSelect:p(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});mt.displayName=pt;var ht=`MenuItemIndicator`,[gt,_t]=V(ht,{checked:!1}),vt=P.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=_t(ht,n);return(0,L.jsx)(g,{present:r||Y(a.checked)||a.checked===!0,children:(0,L.jsx)(_.span,{...i,ref:t,"data-state":jt(a.checked)})})});vt.displayName=ht;var yt=`MenuSeparator`,bt=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(_.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});bt.displayName=yt;var xt=`MenuArrow`,St=P.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=H(n);return(0,L.jsx)(x,{...i,...r,ref:t})});St.displayName=xt;var Ct=`MenuSub`,[wt,Tt]=V(Ct),Et=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:a}=e,o=U(Ct,t),s=H(t),[c,l]=P.useState(null),[d,f]=P.useState(null),p=i(a);return P.useEffect(()=>(o.open===!1&&p(!1),()=>p(!1)),[o.open,p]),(0,L.jsx)(y,{...s,children:(0,L.jsx)(ze,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,L.jsx)(wt,{scope:t,contentId:u(),triggerId:u(),trigger:c,onTriggerChange:l,children:n})})})};Et.displayName=Ct;var J=`MenuSubTrigger`,Dt=P.forwardRef((e,t)=>{let n=U(J,e.__scopeMenu),i=W(J,e.__scopeMenu),a=Tt(J,e.__scopeMenu),o=Ye(J,e.__scopeMenu),s=P.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:l}=o,u={__scopeMenu:e.__scopeMenu},d=P.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);P.useEffect(()=>d,[d]),P.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),l(null)}},[c,l]);let f=r(t,a.onTriggerChange);return(0,L.jsx)(Ue,{asChild:!0,...u,children:(0,L.jsx)(ot,{id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?a.contentId:void 0,"data-state":At(n.open),...e,ref:f,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:p(e.onPointerMove,X(t=>{o.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(o.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:p(e.onPointerLeave,X(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,a=i?-5:5,s=t[i?`left`:`right`],l=t[i?`right`:`left`];o.onPointerGraceIntentChange({area:[{x:e.clientX+a,y:e.clientY},{x:s,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:s,y:t.bottom}],side:r}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(e),e.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:p(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||o.searchRef.current!==``&&t.key===` `||Ne[i.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Dt.displayName=J;var Ot=`MenuSubContent`,kt=P.forwardRef((e,t)=>{let n=Ke(G,e.__scopeMenu),{forceMount:i=n.forceMount,align:a=`start`,...o}=e,s=U(G,e.__scopeMenu),c=W(G,e.__scopeMenu),l=Tt(Ot,e.__scopeMenu),u=P.useRef(null),d=r(t,u);return(0,L.jsx)(B.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(g,{present:i||s.open,children:(0,L.jsx)(B.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)(et,{id:l.contentId,"aria-labelledby":l.triggerId,...o,ref:d,align:a,side:c.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{c.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:p(e.onFocusOutside,e=>{e.target!==l.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:p(e.onEscapeKeyDown,e=>{c.onClose(),e.preventDefault()}),onKeyDown:p(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Pe[c.dir].includes(e.key);t&&n&&(s.onOpenChange(!1),l.trigger?.focus(),e.preventDefault())})})})})})});kt.displayName=Ot;function At(e){return e?`open`:`closed`}function Y(e){return e===`indeterminate`}function jt(e){return Y(e)?`indeterminate`:e?`checked`:`unchecked`}function Mt(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Nt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Pt(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Nt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ft(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function It(e,t){return t?Ft({x:e.clientX,y:e.clientY},t):!1}function X(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Lt=Ve,Rt=Ue,zt=qe,Bt=Xe,Vt=nt,Ht=it,Ut=q,Wt=ct,Gt=ft,Kt=mt,qt=vt,Jt=bt,Yt=St,Xt=Et,Zt=Dt,Qt=kt,Z=`ContextMenu`,[$t,en]=o(Z,[Le]),Q=Le(),[tn,nn]=$t(Z),rn=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:a,modal:o=!0}=e,s=P.useRef(!1);{let e=P.useRef(!1);P.useEffect(()=>{i===!0&&!s.current&&!e.current&&(e.current=!0,console.warn("ContextMenu: The `open` prop has been set to `true` before the user has interacted with the trigger, so its position is indeterminate. This is likely unintended and will result in the menu being anchored to the top-left corner of the viewport."))},[i])}let[c,u]=l({prop:i,defaultProp:!1,onChange:r,caller:Z}),d=Q(t);return(0,L.jsx)(tn,{scope:t,open:c,onOpenChange:u,modal:o,hasInteractedRef:s,children:(0,L.jsx)(Lt,{...d,dir:a,open:c,onOpenChange:u,modal:o,children:n})})};rn.displayName=Z;var an=`ContextMenuTrigger`,on=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=nn(an,n),o=Q(n),[s,c]=P.useState({x:0,y:0}),l=P.useMemo(()=>({current:{getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s})}}),[s]),u=P.useRef(0),d=P.useCallback(()=>window.clearTimeout(u.current),[]),f=e=>{a.hasInteractedRef.current=!0,c({x:e.clientX,y:e.clientY}),a.onOpenChange(!0)};return P.useEffect(()=>d,[d]),P.useEffect(()=>void(r&&d()),[r,d]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Rt,{...o,virtualRef:l}),(0,L.jsx)(_.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:p(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:p(e.onPointerDown,$(e=>{d(),a.open&&a.onOpenChange(!1),u.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:p(e.onPointerMove,$(d)),onPointerCancel:r?e.onPointerCancel:p(e.onPointerCancel,$(d)),onPointerUp:r?e.onPointerUp:p(e.onPointerUp,$(d))})]})});on.displayName=an;var sn=`ContextMenuPortal`,cn=e=>{let{__scopeContextMenu:t,...n}=e,r=Q(t);return(0,L.jsx)(zt,{...r,...n})};cn.displayName=sn;var ln=`ContextMenuContent`,un=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=nn(ln,n),a=Q(n),o=P.useRef(!1);return(0,L.jsx)(Bt,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});un.displayName=ln;var dn=`ContextMenuGroup`,fn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Vt,{...i,...r,ref:t})});fn.displayName=dn;var pn=`ContextMenuLabel`,mn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Ht,{...i,...r,ref:t})});mn.displayName=pn;var hn=`ContextMenuItem`,gn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Ut,{...i,...r,ref:t})});gn.displayName=hn;var _n=`ContextMenuCheckboxItem`,vn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Wt,{...i,...r,ref:t})});vn.displayName=_n;var yn=`ContextMenuRadioGroup`,bn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Gt,{...i,...r,ref:t})});bn.displayName=yn;var xn=`ContextMenuRadioItem`,Sn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Kt,{...i,...r,ref:t})});Sn.displayName=xn;var Cn=`ContextMenuItemIndicator`,wn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(qt,{...i,...r,ref:t})});wn.displayName=Cn;var Tn=`ContextMenuSeparator`,En=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Jt,{...i,...r,ref:t})});En.displayName=Tn;var Dn=`ContextMenuArrow`,On=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Yt,{...i,...r,ref:t})});On.displayName=Dn;var kn=`ContextMenuSub`,An=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Q(t),[s,c]=l({prop:i,defaultProp:a??!1,onChange:r,caller:kn});return(0,L.jsx)(Xt,{...o,open:s,onOpenChange:c,children:n})};An.displayName=kn;var jn=`ContextMenuSubTrigger`,Mn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Zt,{...i,...r,ref:t})});Mn.displayName=jn;var Nn=`ContextMenuSubContent`,Pn=P.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Q(n);return(0,L.jsx)(Qt,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pn.displayName=Nn;function $(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var Fn=rn,In=on,Ln=cn,Rn=un,zn=gn,Bn=En,Vn=An,Hn=Mn,Un=Pn,Wn=Fn,Gn=In,Kn=Vn;function qn({className:e,...t}){return(0,L.jsx)(Ln,{children:(0,L.jsx)(Rn,{className:T(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function Jn({className:e,...t}){return(0,L.jsx)(zn,{className:T(C,b,`[&_svg]:size-3.5`,e),...t})}function Yn({className:e,children:t,...n}){return(0,L.jsxs)(Hn,{className:T(C,b,`data-[state=open]:bg-action data-[state=open]:text-action-ink [&_svg]:size-3.5`,e),...n,children:[t,(0,L.jsx)(O,{className:`ml-auto`})]})}function Xn({className:e,...t}){return(0,L.jsx)(Ln,{children:(0,L.jsx)(Un,{className:T(`z-50 min-w-36 overflow-hidden rounded-md bg-elevated p-1 shadow-xl`,e),...t})})}function Zn({className:e,...t}){return(0,L.jsx)(Bn,{className:T(`-mx-1 my-1 h-px bg-border`,e),...t})}function Qn(){return{onClick:e=>{e.detail===2&&e.preventDefault()},onDoubleClick:e=>{e.preventDefault(),e.currentTarget.dispatchEvent(new MouseEvent(`contextmenu`,{bubbles:!0,cancelable:!0,clientX:e.clientX,clientY:e.clientY,button:2}))}}}export{M as A,Xt as C,ie as D,Le as E,k as M,N as O,Jt as S,Zt as T,Ht as _,Kn as a,Kt as b,Gn as c,Yt as d,Wt as f,qt as g,Ut as h,Zn as i,A as j,j as k,Qn as l,Vt as m,qn as n,Xn as o,Bt as p,Jn as r,Yn as s,Wn as t,Rt as u,zt as v,Qt as w,Lt as x,Gt as y};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";var n=e(t(),1),r=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},l=(0,n.createContext)({}),u=()=>(0,n.useContext)(l),d=(0,n.forwardRef)(({color:e,size:t,strokeWidth:i,absoluteStrokeWidth:a,className:o=``,children:l,iconNode:d,...f},p)=>{let{size:m=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,color:_=`currentColor`,className:v=``}=u()??{},y=a??g?Number(i??h)*24/Number(t??m):i??h;return(0,n.createElement)(`svg`,{ref:p,...s,width:t??m??s.width,height:t??m??s.height,stroke:e??_,strokeWidth:y,className:r(`lucide`,v,o),...!l&&!c(f)&&{"aria-hidden":`true`},...f},[...d.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(l)?l:[l]])}),f=(e,t)=>{let a=(0,n.forwardRef)(({className:a,...s},c)=>(0,n.createElement)(d,{ref:c,iconNode:t,className:r(`lucide-${i(o(e))}`,`lucide-${e}`,a),...s}));return a.displayName=o(e),a};export{f as t};
@@ -1,41 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{n,t as r}from"./jsx-runtime-ffCh33zF.js";import{n as i,t as a}from"./utils-B6KiDbIe.js";import{t as o}from"./createLucideIcon-DyMAgLa3.js";var s=e(t(),1),c=r();typeof window<`u`&&window.document&&window.document.createElement;function l(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)}}function u(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function d(...e){return t=>{let n=!1,r=e.map(e=>{let r=u(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():u(e[t],null)}}}}function f(...e){return s.useCallback(d(...e),e)}function p(e,t=[]){let n=[];function r(t,r){let i=s.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,l=n?.[e]?.[a]||i,u=s.useMemo(()=>o,Object.values(o));return(0,c.jsx)(l.Provider,{value:u,children:r})};o.displayName=t+`Provider`;function l(n,o,c={}){let{optional:l=!1}=c,u=o?.[e]?.[a]||i,d=s.useContext(u);if(d)return d;if(r!==void 0)return r;if(!l)throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,l]}let i=()=>{let t=n.map(e=>s.createContext(e));return function(n){let r=n?.[e]||t;return s.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,m(i,...t)]}function m(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function h(e){let t=s.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,c=[];S(r)&&typeof w==`function`&&(r=w(r._payload)),s.Children.forEach(r,e=>{if(te(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;S(n)&&typeof w==`function`&&(n=w(n._payload)),a=ee(t,n),c.push(a?.props?.children)}else c.push(e)}),a?a=s.cloneElement(a,void 0,c):!o&&s.Children.count(r)===1&&s.isValidElement(r)&&(a=r);let l=a?b(a):void 0,u=f(n,l);if(!a){if(r||r===0)throw Error(o?re(e):ne(e));return r}let d=y(i,a.props??{});return a.type!==s.Fragment&&(d.ref=n?u:l),s.cloneElement(a,d)});return t.displayName=`${e}.Slot`,t}var g=h(`Slot`),_=Symbol.for(`radix.slottable`);function v(e){let t=e=>`child`in e?e.children(e.child):e.children;return t.displayName=`${e}.Slottable`,t.__radixId=_,t}var ee=(e,t)=>{if(`child`in e.props){let t=e.props.child;return s.isValidElement(t)?s.cloneElement(t,void 0,e.props.children(t.props.children)):null}return s.isValidElement(t)?t:null};function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function te(e){return s.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===_}var x=Symbol.for(`react.lazy`);function S(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===x&&`_payload`in e&&C(e._payload)}function C(e){return typeof e==`object`&&!!e&&`then`in e}var ne=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,re=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,w=s.use,T=e(n(),1),E=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=h(`Primitive.${t}`),r=s.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function D(e,t){e&&T.flushSync(()=>e.dispatchEvent(t))}function O(e){let t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>((...e)=>t.current?.(...e)),[])}var ie=`DismissableLayer`,ae=`dismissableLayer.update`,oe=`dismissableLayer.pointerDownOutside`,se=`dismissableLayer.focusOutside`,ce,le=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ue=s.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:u,onDismiss:d,...p}=e,m=s.useContext(le),[h,g]=s.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=s.useState({}),ee=f(t,g),y=Array.from(m.layers),[b]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),te=b?y.indexOf(b):-1,x=h?y.indexOf(h):-1,S=m.layersWithOutsidePointerEventsDisabled.size>0,C=x>=te,ne=s.useRef(!1),re=he(e=>{a?.(e),u?.(e),e.defaultPrevented||d?.()},{ownerDocument:_,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:ne,dismissableSurfaces:m.dismissableSurfaces,shouldHandlePointerDownOutside:s.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...m.branches].some(t=>t.contains(e));return C&&!t},[m.branches,C])}),w=ge(e=>{if(r&&ne.current)return;let t=e.target;[...m.branches].some(e=>e.contains(t))||(o?.(e),u?.(e),e.defaultPrevented||d?.())},_),T=h?x===y.length-1:!1,D=O(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))});return s.useEffect(()=>{if(T)return _.addEventListener(`keydown`,D,{capture:!0}),()=>_.removeEventListener(`keydown`,D,{capture:!0})},[_,T,D]),s.useEffect(()=>{if(h)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(ce=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),m.layersWithOutsidePointerEventsDisabled.add(h)),m.layers.add(h),_e(),()=>{n&&(m.layersWithOutsidePointerEventsDisabled.delete(h),m.layersWithOutsidePointerEventsDisabled.size===0&&(_.body.style.pointerEvents=ce))}},[h,_,n,m]),s.useEffect(()=>()=>{h&&(m.layers.delete(h),m.layersWithOutsidePointerEventsDisabled.delete(h),_e())},[h,m]),s.useEffect(()=>{let e=()=>v({});return document.addEventListener(ae,e),()=>document.removeEventListener(ae,e)},[]),(0,c.jsx)(E.div,{...p,ref:ee,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:l(e.onFocusCapture,w.onFocusCapture),onBlurCapture:l(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:l(e.onPointerDownCapture,re.onPointerDownCapture)})});ue.displayName=ie;var de=`DismissableLayerBranch`,fe=s.forwardRef((e,t)=>{let n=s.useContext(le),r=s.useRef(null),i=f(t,r);return s.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(E.div,{...e,ref:i})});fe.displayName=de;function pe(){let e=s.useContext(le),[t,n]=s.useState(null);return s.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}var me=()=>!0;function he(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=me}=t,c=O(e),l=s.useRef(!1),u=s.useRef(!1),d=s.useRef(new Map),f=s.useRef(()=>{});return s.useEffect(()=>{function e(){u.current=!1,i.current=!1,d.current.clear()}function t(){return Array.from(d.current.values()).some(Boolean)}function s(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||d.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&d.current.set(e.type,!1)}let m=a=>{if(a.target&&!l.current){let s=function(){n.removeEventListener(`click`,f.current);let r=t();e(),r||ve(oe,c,p,{discrete:!0})};if(!o(a.target)){n.removeEventListener(`click`,f.current),e(),l.current=!1;return}let p={originalEvent:a};u.current=!0,i.current=r&&a.button===0,d.current.clear(),!r||a.button!==0?s():(n.removeEventListener(`click`,f.current),f.current=s,n.addEventListener(`click`,f.current,{once:!0}))}else n.removeEventListener(`click`,f.current),e();l.current=!1},h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,s,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,f.current);for(let e of h)n.removeEventListener(e,s,!0),n.removeEventListener(e,p)}},[n,c,r,i,a,o]),{onPointerDownCapture:()=>l.current=!0}}function ge(e,t=globalThis?.document){let n=O(e),r=s.useRef(!1);return s.useEffect(()=>{let e=e=>{e.target&&!r.current&&ve(se,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function _e(){let e=new CustomEvent(ae);document.dispatchEvent(e)}function ve(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?D(i,a):i.dispatchEvent(a)}var k=globalThis?.document?s.useLayoutEffect:()=>{},ye=s.useId||(()=>void 0),be=0;function A(e){let[t,n]=s.useState(ye());return k(()=>{e||n(e=>e??String(be++))},[e]),e||(t?`radix-${t}`:``)}var xe=`Portal`,Se=s.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=s.useState(!1);k(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?T.createPortal((0,c.jsx)(E.div,{...r,ref:t}),o):null});Se.displayName=xe;function Ce(e,t){return s.useReducer((e,n)=>t[e][n]??e,e)}var j=e=>{let{present:t,children:n}=e,r=we(t),i=typeof n==`function`?n({present:r.isPresent}):s.Children.only(n),a=Ee(r.ref,De(i));return typeof n==`function`||r.isPresent?s.cloneElement(i,{ref:a}):null};j.displayName=`Presence`;function we(e){let[t,n]=s.useState(),r=s.useRef(null),i=s.useRef(e),a=s.useRef(`none`),o=s.useRef(void 0),[c,l]=Ce(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return s.useEffect(()=>{c===`mounted`?(a.current=o.current??M(r.current),o.current=void 0):a.current=`none`},[c]),k(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=M(t);e?(o.current=s,l(`MOUNT`)):s===`none`||t?.display===`none`?l(`UNMOUNT`):l(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,l]),k(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=M(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(l(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=M(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else l(`ANIMATION_END`)},[t,l]),{isPresent:[`mounted`,`unmountSuspended`].includes(c),ref:s.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=M(t)}else r.current=null;n(e)},[])}}function Te(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ee(...e){let t=s.useRef(e);return t.current=e,s.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Te(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Te(n[e],null)}}},[])}function M(e){return e?.animationName||`none`}function De(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Oe=s.useInsertionEffect||k;function ke({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ae({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=s.useRef(e!==void 0);s.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,s.useCallback(t=>{if(c){let n=je(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[c,e,a,o])]}function Ae({defaultProp:e,onChange:t}){let[n,r]=s.useState(e),i=s.useRef(n),a=s.useRef(t);return Oe(()=>{a.current=t},[t]),s.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function je(e){return typeof e==`function`}var Me=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ne=i,Pe=((e,t)=>n=>{if(t?.variants==null)return Ne(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Me(t)||Me(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ne(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex items-center justify-center gap-1.5 whitespace-nowrap rounded-md font-medium transition-colors duration-150 disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-3.5 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-action text-action-ink hover:bg-action-hover active:opacity-85`,secondary:`bg-elevated text-fg hover:bg-border/70 active:bg-border`,ghost:`text-fg-secondary hover:bg-elevated hover:text-fg active:bg-border/70`,danger:`bg-danger text-ground hover:opacity-90 active:opacity-80`},size:{default:`h-8 px-3 text-sm`,sm:`h-7 px-2 text-xs`,lg:`h-9 px-4 text-sm`,icon:`h-8 w-8`}},defaultVariants:{variant:`default`,size:`default`}});function Fe({className:e,variant:t,size:n,asChild:r=!1,...i}){return(0,c.jsx)(r?g:`button`,{className:a(Pe({variant:t,size:n}),e),...i})}var Ie=o(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Le=`focusScope.autoFocusOnMount`,Re=`focusScope.autoFocusOnUnmount`,ze={bubbles:!1,cancelable:!0},Be=`FocusScope`,Ve=s.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[l,u]=s.useState(null),d=O(i),p=O(a),m=s.useRef(null),h=f(t,u),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(r){let e=function(e){if(g.paused||!l)return;let t=e.target;l.contains(t)?m.current=t:N(m.current,{select:!0})},t=function(e){if(g.paused||!l)return;let t=e.relatedTarget;t!==null&&(l.contains(t)||N(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&N(l)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,l,g.paused]),s.useEffect(()=>{if(l){Je.add(g);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(Le,ze);l.addEventListener(Le,d),l.dispatchEvent(t),t.defaultPrevented||(He(Ze(We(l)),{select:!0}),document.activeElement===e&&N(l))}return()=>{l.removeEventListener(Le,d),setTimeout(()=>{let t=new CustomEvent(Re,ze);l.addEventListener(Re,p),l.dispatchEvent(t),t.defaultPrevented||N(e??document.body,{select:!0}),l.removeEventListener(Re,p),Je.remove(g)},0)}}},[l,d,p,g]);let _=s.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Ue(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&N(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&N(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,c.jsx)(E.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});Ve.displayName=Be;function He(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(N(r,{select:t}),document.activeElement!==n)return}function Ue(e){let t=We(e);return[Ge(t,e),Ge(t.reverse(),e)]}function We(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ge(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ke(r,{upTo:t})))return r}function Ke(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function qe(e){return e instanceof HTMLInputElement&&`select`in e}function N(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&qe(e)&&t&&e.select()}}var Je=Ye();function Ye(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Xe(e,t),e.unshift(t)},remove(t){e=Xe(e,t),e[0]?.resume()}}}function Xe(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ze(e){return e.filter(e=>e.tagName!==`A`)}var P=0,F=null;function Qe(){s.useEffect(()=>{F||={start:$e(),end:$e()};let{start:e,end:t}=F;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),P++,()=>{P===1&&(F?.start.remove(),F?.end.remove(),F=null),P=Math.max(0,P-1)}},[])}function $e(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var I=function(){return I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},I.apply(this,arguments)};function et(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function tt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var L=`right-scroll-bar-position`,R=`width-before-scroll-bar`,nt=`with-scroll-bars-hidden`,rt=`--removed-body-scroll-bar-size`;function it(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function at(e,t){var n=(0,s.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var ot=typeof window<`u`?s.useLayoutEffect:s.useEffect,st=new WeakMap;function ct(e,t){var n=at(t||null,function(t){return e.forEach(function(e){return it(e,t)})});return ot(function(){var t=st.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||it(e,null)}),i.forEach(function(e){r.has(e)||it(e,a)})}st.set(n,e)},[e]),n}function lt(e){return e}function ut(e,t){t===void 0&&(t=lt);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function dt(e){e===void 0&&(e={});var t=ut(null);return t.options=I({async:!0,ssr:!1},e),t}var ft=function(e){var t=e.sideCar,n=et(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return s.createElement(r,I({},n))};ft.isSideCarExport=!0;function pt(e,t){return e.useMedium(t),ft}var mt=dt(),ht=function(){},z=s.forwardRef(function(e,t){var n=s.useRef(null),r=s.useState({onScrollCapture:ht,onWheelCapture:ht,onTouchMoveCapture:ht}),i=r[0],a=r[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,ee=v===void 0?`div`:v,y=e.gapMode,b=et(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),te=p,x=ct([n,t]),S=I(I({},b),i);return s.createElement(s.Fragment,null,d&&s.createElement(te,{sideCar:mt,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:y}),o?s.cloneElement(s.Children.only(c),I(I({},S),{ref:x})):s.createElement(ee,I({},S,{className:l,ref:x}),c))});z.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},z.classNames={fullWidth:R,zeroRight:L};var gt,_t=function(){if(gt)return gt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function vt(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=_t();return t&&e.setAttribute(`nonce`,t),e}function yt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function bt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var xt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vt())&&(yt(t,n),bt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},St=function(){var e=xt();return function(t,n){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ct=function(){var e=St();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},wt={left:0,top:0,right:0,gap:0},Tt=function(e){return parseInt(e||``,10)||0},Et=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Tt(n),Tt(r),Tt(i)]},Dt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return wt;var t=Et(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ot=Ct(),B=`data-scroll-locked`,kt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${nt} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${B}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${L} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${R} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${L} .${L} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${R} .${R} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${B}] {
36
- ${rt}: ${s}px;
37
- }
38
- `},At=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},jt=function(){s.useEffect(function(){return document.body.setAttribute(B,(At()+1).toString()),function(){var e=At()-1;e<=0?document.body.removeAttribute(B):document.body.setAttribute(B,e.toString())}},[])},Mt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;jt();var a=s.useMemo(function(){return Dt(i)},[i]);return s.createElement(Ot,{styles:kt(a,!t,i,n?``:`!important`)})},V=!1;if(typeof window<`u`)try{var H=Object.defineProperty({},"passive",{get:function(){return V=!0,!0}});window.addEventListener(`test`,H,H),window.removeEventListener(`test`,H,H)}catch{V=!1}var U=V?{passive:!1}:!1,Nt=function(e){return e.tagName===`TEXTAREA`},Pt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Nt(e)&&n[t]===`visible`)},Ft=function(e){return Pt(e,`overflowY`)},It=function(e){return Pt(e,`overflowX`)},Lt=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Bt(e,r)){var i=Vt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Rt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},zt=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Bt=function(e,t){return e===`v`?Ft(t):It(t)},Vt=function(e,t){return e===`v`?Rt(t):zt(t)},Ht=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ut=function(e,t,n,r,i){var a=Ht(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Vt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Bt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},W=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Wt=function(e){return[e.deltaX,e.deltaY]},Gt=function(e){return e&&`current`in e?e.current:e},Kt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qt=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},Jt=0,G=[];function Yt(e){var t=s.useRef([]),n=s.useRef([0,0]),r=s.useRef(),i=s.useState(Jt++)[0],a=s.useState(Ct)[0],o=s.useRef(e);s.useEffect(function(){o.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=tt([e.lockRef.current],(e.shards||[]).map(Gt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var c=s.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=W(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Lt(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Lt(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ut(h,t,e,h===`h`?s:c,!0)},[]),l=s.useCallback(function(e){var n=e;if(!(!G.length||G[G.length-1]!==a)){var r=`deltaY`in n?Wt(n):W(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Kt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var s=(o.current.shards||[]).map(Gt).filter(Boolean).filter(function(e){return e.contains(n.target)});(s.length>0?c(n,s[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=s.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Xt(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){n.current=W(e),r.current=void 0},[]),f=s.useCallback(function(t){u(t.type,Wt(t),t.target,c(t,e.lockRef.current))},[]),p=s.useCallback(function(t){u(t.type,W(t),t.target,c(t,e.lockRef.current))},[]);s.useEffect(function(){return G.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,U),document.addEventListener(`touchmove`,l,U),document.addEventListener(`touchstart`,d,U),function(){G=G.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,U),document.removeEventListener(`touchmove`,l,U),document.removeEventListener(`touchstart`,d,U)}},[]);var m=e.removeScrollBar,h=e.inert;return s.createElement(s.Fragment,null,h?s.createElement(a,{styles:qt(i)}):null,m?s.createElement(Mt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Xt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Zt=pt(mt,Yt),Qt=s.forwardRef(function(e,t){return s.createElement(z,I({},e,{ref:t,sideCar:Zt}))});Qt.classNames=z.classNames;var $t=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},K=new WeakMap,q=new WeakMap,J={},en=0,tn=function(e){return e&&(e.host||tn(e.parentNode))},nn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=tn(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},rn=function(e,t,n,r){var i=nn(t,Array.isArray(e)?e:[e]);J[n]||(J[n]=new WeakMap);var a=J[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(K.get(e)||0)+1,l=(a.get(e)||0)+1;K.set(e,c),a.set(e,l),o.push(e),c===1&&i&&q.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),en++,function(){o.forEach(function(e){var t=K.get(e)-1,i=a.get(e)-1;K.set(e,t),a.set(e,i),t||(q.has(e)||e.removeAttribute(r),q.delete(e)),i||e.removeAttribute(n)}),en--,en||(K=new WeakMap,K=new WeakMap,q=new WeakMap,J={})}},an=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||$t(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),rn(r,i,n,`aria-hidden`)):function(){return null}},Y=`Dialog`,[on,sn]=p(Y),[cn,X]=on(Y),ln=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,l=s.useRef(null),u=s.useRef(null),[d,f]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:Y});return(0,c.jsx)(cn,{scope:t,triggerRef:l,contentRef:u,contentId:A(),titleId:A(),descriptionId:A(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),modal:o,children:n})};ln.displayName=Y;var un=`DialogTrigger`,dn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(un,n),a=f(t,i.triggerRef);return(0,c.jsx)(E.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":On(i.open),...r,ref:a,onClick:l(e.onClick,i.onOpenToggle)})});dn.displayName=un;var fn=`DialogPortal`,[pn,mn]=on(fn,{forceMount:void 0}),hn=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=X(fn,t);return(0,c.jsx)(pn,{scope:t,forceMount:n,children:s.Children.map(r,e=>(0,c.jsx)(j,{present:n||a.open,children:(0,c.jsx)(Se,{asChild:!0,container:i,children:e})}))})};hn.displayName=fn;var Z=`DialogOverlay`,Q=s.forwardRef((e,t)=>{let n=mn(Z,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X(Z,e.__scopeDialog);return a.modal?(0,c.jsx)(j,{present:r||a.open,children:(0,c.jsx)(_n,{...i,ref:t})}):null});Q.displayName=Z;var gn=h(`DialogOverlay.RemoveScroll`),_n=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Z,n),a=f(t,pe());return(0,c.jsx)(Qt,{as:gn,allowPinchZoom:!0,shards:[i.contentRef],children:(0,c.jsx)(E.div,{"data-state":On(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})}),$=`DialogContent`,vn=s.forwardRef((e,t)=>{let n=mn($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=X($,e.__scopeDialog);return(0,c.jsx)(j,{present:r||a.open,children:a.modal?(0,c.jsx)(yn,{...i,ref:t}):(0,c.jsx)(bn,{...i,ref:t})})});vn.displayName=$;var yn=s.forwardRef((e,t)=>{let n=X($,e.__scopeDialog),r=s.useRef(null),i=f(t,n.contentRef,r);return s.useEffect(()=>{let e=r.current;if(e)return an(e)},[]),(0,c.jsx)(xn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault())})}),bn=s.forwardRef((e,t)=>{let n=X($,e.__scopeDialog),r=s.useRef(!1),i=s.useRef(!1);return(0,c.jsx)(xn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),xn=s.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=X($,n);return Qe(),(0,c.jsx)(c.Fragment,{children:(0,c.jsx)(Ve,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,c.jsx)(ue,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":On(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})}),Sn=`DialogTitle`,Cn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(Sn,n);return(0,c.jsx)(E.h2,{id:i.titleId,...r,ref:t})});Cn.displayName=Sn;var wn=`DialogDescription`,Tn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(wn,n);return(0,c.jsx)(E.p,{id:i.descriptionId,...r,ref:t})});Tn.displayName=wn;var En=`DialogClose`,Dn=s.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=X(En,n);return(0,c.jsx)(E.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});Dn.displayName=En;function On(e){return e?`open`:`closed`}var kn=ln;function An({className:e,children:t,wide:n=!1,...r}){return(0,c.jsxs)(hn,{children:[(0,c.jsx)(Q,{className:`fixed inset-0 z-50 bg-ground/70 backdrop-blur-[2px]`}),(0,c.jsxs)(vn,{className:a(`fixed left-1/2 top-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-lg bg-elevated p-5 shadow-2xl`,n?`max-w-3xl`:`max-w-md`,e),...r,children:[t,(0,c.jsxs)(Dn,{className:`absolute right-3.5 top-3.5 rounded-sm text-fg-muted transition-colors hover:text-fg`,children:[(0,c.jsx)(Ie,{className:`size-4`}),(0,c.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function jn({className:e,...t}){return(0,c.jsx)(`div`,{className:a(`flex flex-col gap-1`,e),...t})}function Mn({className:e,...t}){return(0,c.jsx)(Cn,{className:a(`text-lg font-semibold text-fg`,e),...t})}function Nn({className:e,...t}){return(0,c.jsx)(Tn,{className:a(`text-sm text-fg-secondary`,e),...t})}function Pn({className:e,...t}){return(0,c.jsx)(`div`,{className:a(`flex justify-end gap-2`,e),...t})}export{f as A,O as C,v as D,h as E,p as O,ue as S,D as T,ke as _,jn as a,A as b,vn as c,an as d,Qt as f,Fe as g,Ie as h,Pn as i,l as j,d as k,Q as l,Ve as m,An as n,Mn as o,Qe as p,Nn as r,ln as s,kn as t,hn as u,j as v,E as w,k as x,Se as y};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{A as r,E as i,O as a}from"./dialog-B43iKmfK.js";import{t as o}from"./createLucideIcon-DyMAgLa3.js";var s=o(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),c=e(t(),1),l=n();function u(e){let t=e+`CollectionProvider`,[n,o]=a(t),[s,u]=n(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:n}=e,r=c.useRef(null),i=c.useRef(new Map).current;return(0,l.jsx)(s,{scope:t,itemMap:i,collectionRef:r,children:n})};d.displayName=t;let f=e+`CollectionSlot`,p=i(f),m=c.forwardRef((e,t)=>{let{scope:n,children:i}=e,a=r(t,u(f,n).collectionRef);return(0,l.jsx)(p,{ref:a,children:i})});m.displayName=f;let h=e+`CollectionItemSlot`,g=`data-radix-collection-item`,_=i(h),v=c.forwardRef((e,t)=>{let{scope:n,children:i,...a}=e,o=c.useRef(null),s=r(t,o),d=u(h,n);return c.useEffect(()=>(d.itemMap.set(o,{ref:o,...a}),()=>void d.itemMap.delete(o))),(0,l.jsx)(_,{[g]:``,ref:s,children:i})});v.displayName=h;function y(t){let n=u(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${g}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:d,Slot:m,ItemSlot:v},y,o]}var d=c.createContext(void 0);function f(e){let t=c.useContext(d);return e||t||`ltr`}export{u as n,s as r,f as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./react-CZI7_Jkm.js";import{t as n}from"./jsx-runtime-ffCh33zF.js";import{Bt as r,Gt as i,Ht as a,Ut as o,Vt as s,Xt as c,Yt as l,bt as u,qt as d,vt as f,xt as p}from"./hotkeys-CA5Pxll4.js";import{t as m}from"./createLucideIcon-DyMAgLa3.js";var h=class extends d{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,u=n.fetchMeta?.fetchMore?.direction,d=o&&u===`forward`,f=i&&u===`forward`,p=o&&u===`backward`,m=i&&u===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:l(t,n.data),hasPreviousPage:c(t,n.data),isFetchNextPageError:d,isFetchingNextPage:f,isFetchPreviousPageError:p,isFetchingPreviousPage:m,isRefetchError:s&&!d&&!p,isRefetching:a&&!f&&!m}}};function g(e,t){return o(e,h,t)}var _=m(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),v=50;function y(e){return e===void 0?``:`&root=${encodeURIComponent(e)}`}function b(e){return e?{placeholderData:e=>e}:{}}function ee(e,t,n){let r=e!==void 0;return a({queryKey:n===void 0?[`wt-tree`,e,t]:[`wt-tree`,e,t,n],queryFn:()=>u(`GET`,`/api/worktrees/${e}/tree?path=${encodeURIComponent(t)}${y(n)}`),enabled:r,...b(r)})}function te(e,t,n){let r=n?.root;return a({queryKey:r===void 0?[`wt-file`,e,t]:[`wt-file`,e,t,r],queryFn:()=>u(`GET`,`/api/worktrees/${e}/file?path=${encodeURIComponent(t)}${y(r)}`),enabled:e!==void 0&&(n?.enabled??!0),...n?.live===!0?{refetchInterval:f(3e3),refetchOnWindowFocus:!0}:{}})}function ne(e,t){let n=i();return s({mutationFn:({path:n,...r})=>u(`PUT`,`/api/worktrees/${e}/file?path=${encodeURIComponent(n)}${y(t)}`,r),onSuccess:(r,{path:i})=>{n.invalidateQueries({queryKey:t===void 0?[`wt-file`,e,i]:[`wt-file`,e,i,t]}),n.invalidateQueries({queryKey:[`wt-diff`,e]})}})}function re(e,t){let n=t?.against??`base`,r=t?.area,i=t?.root,o=e!==void 0&&(t?.enabled??!0);return a({queryKey:i===void 0?[`wt-diff`,e,n,r]:[`wt-diff`,e,n,r,i],queryFn:()=>{let t=r===void 0?``:`&area=${r}`;return u(`GET`,`/api/worktrees/${e}/diff?against=${n}${t}${y(i)}`)},enabled:o,refetchInterval:f(1e4),refetchOnWindowFocus:!0,...b(o)})}function ie(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`git-repositories`,e]:[`git-repositories`,e,n],queryFn:()=>u(`GET`,`/api/worktrees/${e}/git-repositories${T(n)}`),enabled:r,refetchInterval:f(1e4),refetchOnWindowFocus:!0,...b(r)})}function x(e,t,n){let r=n?.root,i=e!==void 0&&(n?.enabled??!0);return a({queryKey:[`git-original`,e,t,r],queryFn:()=>u(`GET`,`/api/worktrees/${e}/git-original?path=${encodeURIComponent(t)}${y(r)}`),enabled:i,refetchInterval:f(1e4),refetchOnWindowFocus:!0})}function S(e,t,n){let r=n?.root;return a({queryKey:[`git-index-file`,e,t,r],queryFn:()=>u(`GET`,`/api/worktrees/${e}/index-file?path=${encodeURIComponent(t)}${y(r)}`),enabled:e!==void 0&&(n?.enabled??!0)})}function C(e,t){let n=i();return s({mutationFn:({action:n,...r})=>u(`POST`,`/api/worktrees/${e}/git-${n}${T(t)}`,r),onSuccess:()=>{n.invalidateQueries({queryKey:[`git-repositories`,e]}),n.invalidateQueries({queryKey:[`wt-git-status`,e]}),n.invalidateQueries({queryKey:[`wt-diff`,e]}),n.invalidateQueries({queryKey:[`wt-log`,e]}),n.invalidateQueries({queryKey:[`wt-show`,e]}),n.invalidateQueries({queryKey:[`git-original`,e]}),n.invalidateQueries({queryKey:[`git-index-file`,e]})}})}function w(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return a({queryKey:n===void 0?[`wt-git-status`,e]:[`wt-git-status`,e,n],queryFn:()=>u(`GET`,`/api/worktrees/${e}/git-status${T(n)}`),enabled:r,refetchInterval:f(1e4),refetchOnWindowFocus:!0,...b(r)})}function T(e){return e===void 0?``:`?root=${encodeURIComponent(e)}`}function E(e,t,n,r){return u(`POST`,`/api/worktrees/${e}/create${T(r)}`,{path:t,kind:n})}function D(e,t,n,r){return u(`POST`,`/api/worktrees/${e}/rename${T(r)}`,{from:t,to:n})}function O(e,t,n,r){return u(`POST`,`/api/worktrees/${e}/copy${T(r)}`,{from:t,to:n})}function k(e,t,n){return u(`POST`,`/api/worktrees/${e}/delete${T(n)}`,{path:t})}function A(e,t,n){let{query:r,regex:i,caseSensitive:o,wholeWord:s}=t;return a({queryKey:[`wt-search`,e,r,i,o,s,n],queryFn:()=>{let t=new URLSearchParams({q:r});return i&&t.set(`regex`,`1`),o&&t.set(`case`,`1`),s&&t.set(`word`,`1`),n!==void 0&&t.set(`root`,n),u(`GET`,`/api/worktrees/${e}/search?${t.toString()}`)},enabled:e!==void 0&&r.length>0,staleTime:2e3})}function j(e,t,n,r){let i=r?.root;return a({queryKey:[`wt-file-at`,e,t,n,i],queryFn:()=>u(`GET`,`/api/worktrees/${e}/file-at?ref=${encodeURIComponent(t)}&path=${encodeURIComponent(n)}${y(i)}`),enabled:e!==void 0&&(r?.enabled??!0),staleTime:1/0})}function M(e,t){let n=t?.root,r=e!==void 0&&(t?.enabled??!0);return g({queryKey:n===void 0?[`wt-log`,e]:[`wt-log`,e,n],queryFn:({pageParam:t})=>u(`GET`,`/api/worktrees/${e}/log?limit=${v}&skip=${t}${y(n)}`),initialPageParam:0,getNextPageParam:(e,t)=>e.has_more?t.length*v:void 0,enabled:r,...b(r)})}function N(e,t,n){return a({queryKey:n===void 0?[`wt-show`,e,t]:[`wt-show`,e,t,n],queryFn:()=>u(`GET`,`/api/worktrees/${e}/show/${t}${T(n)}`),enabled:e!==void 0&&t!==void 0,staleTime:1/0})}var P=64*1024*1024;function F(e,t){let n=[],r=[],i=0;for(let a of e)r.length>0&&i+a.size>t&&(n.push(r),r=[],i=0),r.push(a),i+=a.size;return r.length>0&&n.push(r),n}async function I(e,t,n,r){let i=[];for(let a of F(n,P)){let n=new FormData;for(let e of a)n.append(`files`,e,e.name);let o=await p(`POST`,`/api/worktrees/${e}/upload?dir=${encodeURIComponent(t)}${y(r)}`,{body:n});i.push(...(await o.json()).files)}return{files:i}}function L(e,t){if(!e)return t;let n=/filename\*=UTF-8''([^;]+)/i.exec(e);if(n?.[1])try{return decodeURIComponent(n[1])}catch{return t}return/filename="?([^"; ]+)"?/i.exec(e)?.[1]??t}async function R(e,t,n){let r=await p(`GET`,`/api/worktrees/${e}/download?path=${encodeURIComponent(t)}${y(n)}`),i=await r.blob(),a=t.split(`/`).filter(Boolean).pop()??`worktree`,o=L(r.headers.get(`content-disposition`),a),s=URL.createObjectURL(i);try{let e=document.createElement(`a`);e.href=s,e.download=o,document.body.appendChild(e),e.click(),e.remove()}finally{URL.revokeObjectURL(s)}}function z(e,t,n){let r=`${encodeURIComponent(e)}:${encodeURIComponent(t)}`;return n===void 0?r:`${r}:${encodeURIComponent(n)}`}var B=new Map;function ae(e,t){return B.set(e,t),()=>{B.get(e)===t&&B.delete(e)}}function V(e){if(e===null)return!1;let t=B.get(e);return t?(t(),!0):!1}var H=`UTC`;function U(e){return new Date(e).toLocaleDateString(`en-GB`,{day:`numeric`,month:`short`,year:`numeric`,timeZone:H})}var W=60,G=60*W,K=24*G,q=7*K;function J(e,t=new Date){let n=new Date(e).getTime(),r=Math.max(0,Math.floor((t.getTime()-n)/1e3));return r<W?`just now`:r<G?`${Math.floor(r/W)} m ago`:r<K?`${Math.floor(r/G)} h ago`:r<q?`${Math.floor(r/K)} d ago`:U(n)}function oe(e,t){return t?`added`:e}function se(e){return u(`POST`,`/api/profiles/${e}/untitled`)}function ce(e,t){return a({queryKey:[`untitled`,e,t],queryFn:()=>u(`GET`,`/api/profiles/${e}/untitled/${t}`),enabled:e!==null,staleTime:1/0})}function le(e,t,n){return u(`PUT`,`/api/profiles/${e}/untitled/${t}`,{content:n})}function ue(e,t){return u(`DELETE`,`/api/profiles/${e}/untitled/${t}`)}var Y=null,X=new Map;function de(e){Y=e}function fe(e){Y?.(e)}function pe(e,t){X.set(e,t)}function me(e){return X.get(e)}function he(e){X.delete(e)}var Z=e(t(),1),ge=n(),Q=(0,Z.createContext)({openFile:()=>void 0,handler:null,setHandler:()=>void 0});function $({children:e}){let[t,n]=(0,Z.useState)(null),i=(0,Z.useCallback)(e=>n(()=>e),[]),a=(0,Z.useCallback)((e,n,i,a)=>{if(!t){r(`The editor is not ready yet.`);return}t(e,n,i,a)},[t]),o=(0,Z.useMemo)(()=>({openFile:a,handler:t,setHandler:i}),[a,t,i]);return(0,ge.jsx)(Q.Provider,{value:o,children:e})}function _e(){let{openFile:e}=(0,Z.useContext)(Q);return{openFile:e}}function ve(e){let{setHandler:t}=(0,Z.useContext)(Q),n=(0,Z.useRef)(e);n.current=e,(0,Z.useEffect)(()=>(t((e,t,r,i)=>n.current(e,t,r,i)),()=>t(null)),[t])}export{S as A,y as C,C as D,j as E,M as F,A as I,ee as L,re as M,te as N,x as O,w as P,_ as R,D as S,N as T,z as _,pe as a,k as b,me as c,le as d,ce as f,V as g,ae as h,he as i,ne as j,ie as k,se as l,J as m,_e as n,fe as o,oe as p,ve as r,de as s,$ as t,ue as u,O as v,I as w,R as x,E as y};
@@ -1 +0,0 @@
1
- import{bt as e}from"./hotkeys-CA5Pxll4.js";import{r as t}from"./index-BYC57b5y.js";function n(){return t.get()}var r=/(?:^|[\s"'`([<])((?:(?:\/|\.{1,2}\/|~\/)(?:[\w.+@~-]+\/)*[\w.+@~-]+|(?:[\w.+@~-]+\/)+[\w.+@~-]*|[\w.+@~-]+\.[A-Za-z]\w{0,11}))(?::(\d{1,6})(?::(\d{1,6}))?)?/dg,i=new Set([`.`,`,`,`;`,`:`,`)`,`]`,`'`,`"`]);function a(e){let t=[],n=new RegExp(r.source,r.flags),a;for(;a=n.exec(e);){let e=a.indices,n=a[1];if(!e?.[1]||n===void 0)continue;let r=e[1][0],o=e[1][1],s=n;for(s.startsWith(`@`)&&(s=s.slice(1),r++);s.length>0&&i.has(s[s.length-1]);)s=s.slice(0,-1),o--;if(s.length===0)continue;let c=a[2]===void 0?void 0:Number.parseInt(a[2],10),l=a[3]===void 0?void 0:Number.parseInt(a[3],10),u=l!==void 0&&e[3]?e[3][1]:c!==void 0&&e[2]?e[2][1]:o;t.push({path:s,line:c,column:l,start:r,end:u})}return t}var o=class{fetcher;now;positiveTtlMs;negativeTtlMs;maxEntries;maxConcurrent;entries=new Map;inflight=new Map;inUse=0;waiters=[];constructor(e){this.fetcher=e.fetcher,this.now=e.now??Date.now,this.positiveTtlMs=e.positiveTtlMs??15e3,this.negativeTtlMs=e.negativeTtlMs??5e3,this.maxEntries=e.maxEntries??500,this.maxConcurrent=e.maxConcurrent??4}resolve(e,t,n){let r=`${e}\0${t}`,i=this.entries.get(r);if(i){if(this.now()<i.expiresAt)return Promise.resolve(i.value);this.entries.delete(r)}let a=this.inflight.get(r);if(a)return a;let o=this.withSlot(()=>this.fetcher(e,t,n)).then(e=>(this.store(r,e),e)).finally(()=>{this.inflight.delete(r)});return this.inflight.set(r,o),o}store(e,t){let n=t?this.positiveTtlMs:this.negativeTtlMs;for(this.entries.set(e,{value:t,expiresAt:this.now()+n});this.entries.size>this.maxEntries;){let e=this.entries.keys().next().value;if(e===void 0)break;this.entries.delete(e)}}async withSlot(e){this.inUse>=this.maxConcurrent&&await new Promise(e=>this.waiters.push(e)),this.inUse++;try{return await e()}finally{this.inUse--,this.waiters.shift()?.()}}};function s(e,t){let n=t;for(;n>0&&e.getLine(n)?.isWrapped;)n--;let r=``;for(let t=n;;t++){let i=e.getLine(t);if(!i||t!==n&&!i.isWrapped||(r+=i.translateToString(!0),r.length>2048))break}return{text:r,startRow:n}}function c(e,t,n,r){let i=e.getNullCell(),a=t,o=n,s=r;for(;s>=0;){let t=e.getLine(a);if(!t)return null;for(;o<t.length;o++){if(t.getCell(o,i),i.getWidth()&&(s-=i.getChars().length||1,o===t.length-1&&i.getChars()===``)){let t=e.getLine(a+1);t?.isWrapped&&(t.getCell(0,i),i.getWidth()===2&&(s+=1))}if(s<0)return{row:a,col:o}}a++,o=0}return{row:a,col:o}}async function l(t,n,r,i){let a=new URLSearchParams({path:n});return r!==void 0&&a.set(`line`,String(r)),i!==void 0&&a.set(`root`,i),e(`GET`,`/api/worktrees/${t}/resolve?${a}`)}function u(e,t,n){let r=e.kind??`file`;return{kind:r,path:e.path,...e.root===void 0?{}:{root:e.root},...r===`file`&&t!==void 0?{line:Math.max(1,t)}:{},...r===`file`&&n!==void 0?{column:n}:{}}}async function d(e,t,n){return u(await l(e,t,n?.line,n?.root),n?.line,n?.column)}async function f(e,t,n){try{return await l(e,t,n)}catch{return null}}function p(e,t,n){let r=new o({fetcher:f});return e.registerLinkProvider({provideLinks(i,o){let l=e.buffer.active,{text:d,startRow:f}=s(l,i-1),p=a(d);if(p.length===0){o(void 0);return}Promise.all(p.map(async e=>{let i=await r.resolve(t,e.path,e.line);if(!i)return null;let a=c(l,f,0,e.start),o=c(l,a?.row??f,a?.col??0,e.end-e.start);return!a||!o?null:{range:{start:{x:a.col+1,y:a.row+1},end:{x:o.col,y:o.row+1}},text:d.slice(e.start,e.end),decorations:{underline:!0,pointerCursor:!0},activate:t=>{!t.metaKey&&!t.ctrlKey||n(u(i,e.line,e.column))}}})).then(e=>{let t=e.filter(e=>e!==null);o(t.length>0?t:void 0)})}})}export{d as n,n as r,p as t};