@inkeep/open-knowledge 0.35.1-beta.2 → 0.35.1-beta.4

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 (89) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +45 -45
  4. package/dist/constants-CLcFGsaK.mjs +2 -0
  5. package/dist/{gh-detect-dM8nUKzs.mjs → gh-detect-Cb1UCQYG.mjs} +2 -2
  6. package/dist/git-handle-D5aVjSAb.mjs +1 -0
  7. package/dist/{git-handle-CPWu4DPI.mjs → git-handle-H0t8pegP.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-CufhJKnD.mjs → init-BRPdzN9L.mjs} +4 -4
  10. package/dist/init-BZsLem5C.mjs +1 -0
  11. package/dist/{launch-json-removal-CDi_qtNo.mjs → launch-json-removal-BmdvufOV.mjs} +2 -2
  12. package/dist/loader-C-FnqHSV.mjs +1 -0
  13. package/dist/{loader-DZWBO23a.mjs → loader-I7r-0Ldo.mjs} +3 -3
  14. package/dist/{open-browser-DLXd14zy.mjs → open-browser-Dhw8dLve.mjs} +2 -2
  15. package/dist/{preview-BGQ53z_1.mjs → preview-CAYQZDe6.mjs} +2 -2
  16. package/dist/preview-CRNhRnSv.mjs +1 -0
  17. package/dist/public/assets/{ActivityModeContent-XJSnDzK_.js → ActivityModeContent-BUW9aMAj.js} +1 -1
  18. package/dist/public/assets/{AgentDiffPane-BAnfH-YN.js → AgentDiffPane-BLaH8w6u.js} +1 -1
  19. package/dist/public/assets/CodeMirrorPropInput-Bi4r7DgZ.js +3 -0
  20. package/dist/public/assets/{DocumentContext-CU9xlvuo.js → DocumentContext-QVTcu-bw.js} +9 -9
  21. package/dist/public/assets/{EnableSyncConfirmDialog-BsDontPj.js → EnableSyncConfirmDialog-BC_Qjvcq.js} +1 -1
  22. package/dist/public/assets/{GraphPanel-D-LFOZKp.js → GraphPanel-CbZW4P-I.js} +2 -2
  23. package/dist/public/assets/{ManagedArtifactProperties-D9h21IK6.js → ManagedArtifactProperties-BfKDk54d.js} +1 -1
  24. package/dist/public/assets/{McpConsentDialogBody-DIH6Ms1u.js → McpConsentDialogBody-DrpJgjKO.js} +1 -1
  25. package/dist/public/assets/{MermaidDocEditor-Dtd-8jJV.js → MermaidDocEditor-BwDnJXMM.js} +1 -1
  26. package/dist/public/assets/PropertyPanel-NG0dp1I-.js +2 -0
  27. package/dist/public/assets/{ReportBugDialogBody-BCRLTK8_.js → ReportBugDialogBody-D_PqxqIJ.js} +1 -1
  28. package/dist/public/assets/{SettingsDialogBody-L_0jcH_T.js → SettingsDialogBody-CCOprUbG.js} +2 -2
  29. package/dist/public/assets/{ShareBranchSwitchDialog-BU6DMxX1.js → ShareBranchSwitchDialog-S4DEIUH2.js} +1 -1
  30. package/dist/public/assets/{ShareReceiveDialog-BbWq-gzG.js → ShareReceiveDialog-D63YZ5Qt.js} +1 -1
  31. package/dist/public/assets/{ShareReceiveMissDialog-yXLs8-wZ.js → ShareReceiveMissDialog-C5bCaC_x.js} +1 -1
  32. package/dist/public/assets/{SkillEditorActions-BSrcCPDd.js → SkillEditorActions-4KVF20fT.js} +1 -1
  33. package/dist/public/assets/{SourceEditor-Cd_-pUX1.js → SourceEditor-BMRoTchw.js} +1 -1
  34. package/dist/public/assets/{TerminalPanel-Mz8BwF5T.js → TerminalPanel-DO32mQGi.js} +37 -37
  35. package/dist/public/assets/{TimelineDiffPane-B_bWook5.js → TimelineDiffPane-0hFKuYI4.js} +1 -1
  36. package/dist/public/assets/{agent-presence-C7KW4GFN.js → agent-presence-ByHbes6i.js} +1 -1
  37. package/dist/public/assets/{auth-state-cache-DnhmcXiD.js → auth-state-cache-CyWc-rUz.js} +4 -4
  38. package/dist/public/assets/{config-provider-CKgTRKRt.js → config-provider-CM0Qk_B1.js} +4 -4
  39. package/dist/public/assets/{dist-z6xoO_FO.js → dist-DXjqUQWc.js} +106 -106
  40. package/dist/public/assets/{dist-Byo4jhAQ.js → dist-H67bKoaU.js} +1 -1
  41. package/dist/public/assets/{doc-hash-CR_v-pVy.js → doc-hash-DZK-3zeD.js} +1 -1
  42. package/dist/public/assets/{documents-events-WLCQAftW.js → documents-events-BVZ2_FvF.js} +1 -1
  43. package/dist/public/assets/{file-tree-adapter-BrNRZNNL.js → file-tree-adapter-4Otvq2cx.js} +1 -1
  44. package/dist/public/assets/index-BVnXUpPo.js +1995 -0
  45. package/dist/public/assets/{lint-config-client-DrncMKpi.js → lint-config-client-CvyXWmXs.js} +1 -1
  46. package/dist/public/assets/{navigation-targets-BW-vH_E0.js → navigation-targets-Bdvnj5el.js} +1 -1
  47. package/dist/public/assets/open-managed-artifact-tab-D3Xycq5B.js +5 -0
  48. package/dist/public/assets/{pending-receive-nav-store-VIiKipN9.js → pending-receive-nav-store-BhoEZnG6.js} +1 -1
  49. package/dist/public/assets/{prop-types-D0GhY5_m.js → prop-types-CCG66Y4I.js} +1 -1
  50. package/dist/public/assets/{receive-store-C5i5j6PY.js → receive-store-vKfJeA9b.js} +1 -1
  51. package/dist/public/assets/{selection-context-V0U6XHHo.js → selection-context-Camht0am.js} +1 -1
  52. package/dist/public/assets/skill-actions-cL6YQHiU.js +1 -0
  53. package/dist/public/assets/{skills-api-ej5KW5dn.js → skills-api-BrvevboZ.js} +1 -1
  54. package/dist/public/assets/{src-qvqzPkMT.js → src-BydwHjwu.js} +1 -1
  55. package/dist/public/assets/{target-navigation-intent-CmDfj84r.js → target-navigation-intent-B2IV_p5Y.js} +1 -1
  56. package/dist/public/assets/{typing-burst-detector-SjZ7M77f.js → typing-burst-detector-D3atST3k.js} +1 -1
  57. package/dist/public/assets/{use-activity-panel-BLjB8pfD.js → use-activity-panel-DBvA0hQ2.js} +1 -1
  58. package/dist/public/assets/{use-apply-config-color-theme-BHcKd5uB.js → use-apply-config-color-theme-D_qio6w-.js} +2 -2
  59. package/dist/public/assets/{use-timeline-entry-diff-q1bUunHz.js → use-timeline-entry-diff-BhNsU170.js} +4 -4
  60. package/dist/public/assets/{workspace-paths-DTMEcAKi.js → workspace-paths-iLOFM5BT.js} +1 -1
  61. package/dist/public/index.html +26 -26
  62. package/dist/{repair-launch-json-CmGczsvr.mjs → repair-launch-json-CuB19poA.mjs} +2 -2
  63. package/dist/{repair-mcp-configs-Du6KxgcG.mjs → repair-mcp-configs-D7vd7gGq.mjs} +2 -2
  64. package/dist/{repair-skills-CjpripUK.mjs → repair-skills-4Dcd6NTt.mjs} +2 -2
  65. package/dist/repair-skills-BcvPN23G.mjs +1 -0
  66. package/dist/server-lock-CPMjg3EK.mjs +1 -0
  67. package/dist/{server-lock-Cn2-KrjV.mjs → server-lock-DZQRJfHi.mjs} +2 -2
  68. package/dist/src-BKuFxm9H.mjs +3310 -0
  69. package/dist/{src-BgrRg-nl.mjs → src-CLZCA0wF.mjs} +19 -19
  70. package/dist/{src-D3RAM6vg.mjs → src-DUBbCkx-.mjs} +1 -1
  71. package/dist/{src-DFkbZTAx.mjs → src-bm9hZUKf.mjs} +5 -5
  72. package/dist/{start-DDbaUwhC.mjs → start-BrcFfijH.mjs} +2 -2
  73. package/dist/start-DXe14NGf.mjs +1 -0
  74. package/dist/{write-project-skill-CLggzjLg.mjs → write-project-skill-nQkZOZuL.mjs} +2 -2
  75. package/package.json +4 -4
  76. package/dist/constants-BO04U-js.mjs +0 -2
  77. package/dist/git-handle-BAtE8N7I.mjs +0 -1
  78. package/dist/init-CP2cybVF.mjs +0 -1
  79. package/dist/loader-DdB-N5zw.mjs +0 -1
  80. package/dist/preview-CUrIl8SW.mjs +0 -1
  81. package/dist/public/assets/CodeMirrorPropInput-D7LKYsQT.js +0 -3
  82. package/dist/public/assets/PropertyPanel-DEP9ZoSf.js +0 -2
  83. package/dist/public/assets/index-BlzqKiBJ.js +0 -1995
  84. package/dist/public/assets/open-managed-artifact-tab-Mlt2_LRl.js +0 -5
  85. package/dist/public/assets/skill-actions-MlZySxOC.js +0 -1
  86. package/dist/repair-skills-B95d0UWj.mjs +0 -1
  87. package/dist/server-lock-kLJ8OVOq.mjs +0 -1
  88. package/dist/src-D87GkAFF.mjs +0 -3309
  89. package/dist/start-DNf9Z-RJ.mjs +0 -1
@@ -1,5 +0,0 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{n as t}from"./compiler-runtime-DrcePeIl.js";import{t as n}from"./react-dom-CMNLH3L-.js";import{t as r}from"./createLucideIcon-Wgamzz8_.js";import{t as i}from"./parse-api-error-DfesE4Y7.js";import{i as a}from"./documents-events-WLCQAftW.js";import{l as o,s}from"./doc-hash-CR_v-pVy.js";var c=r(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]),l=e(n()),u=e(t());function d(){var e=[...arguments];return(0,u.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var f=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function p(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function m(e){return`nodeType`in e}function h(e){return e?p(e)?e:m(e)?e.ownerDocument?.defaultView??window:window:window}function g(e){let{Document:t}=h(e);return e instanceof t}function _(e){return p(e)?!1:e instanceof h(e).HTMLElement}function v(e){return e instanceof h(e).SVGElement}function y(e){return e?p(e)?e.document:m(e)?g(e)?e:_(e)||v(e)?e.ownerDocument:document:document:document}var b=f?u.useLayoutEffect:u.useEffect;function x(e){let t=(0,u.useRef)(e);return b(()=>{t.current=e}),(0,u.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function S(){let e=(0,u.useRef)(null);return[(0,u.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,u.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function C(e,t){t===void 0&&(t=[e]);let n=(0,u.useRef)(e);return b(()=>{n.current!==e&&(n.current=e)},t),n}function w(e,t){let n=(0,u.useRef)();return(0,u.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function T(e){let t=x(e),n=(0,u.useRef)(null);return[n,(0,u.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function E(e){let t=(0,u.useRef)();return(0,u.useEffect)(()=>{t.current=e},[e]),t.current}var D={};function O(e,t){return(0,u.useMemo)(()=>{if(t)return t;let n=D[e]==null?0:D[e]+1;return D[e]=n,e+`-`+n},[e,t])}function k(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var A=k(1),j=k(-1);function ee(e){return`clientX`in e&&`clientY`in e}function te(e){if(!e)return!1;let{KeyboardEvent:t}=h(e.target);return t&&e instanceof t}function M(e){if(!e)return!1;let{TouchEvent:t}=h(e.target);return t&&e instanceof t}function ne(e){if(M(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return ee(e)?{x:e.clientX,y:e.clientY}:null}var N=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[N.Translate.toString(e),N.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),P=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function re(e){return e.matches(P)?e:e.querySelector(P)}var ie={display:`none`};function F(e){let{id:t,value:n}=e;return u.createElement(`div`,{id:t,style:ie},n)}function I(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return u.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function L(){let[e,t]=(0,u.useState)(``);return{announce:(0,u.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var ae=(0,u.createContext)(null);function oe(e){let t=(0,u.useContext)(ae);(0,u.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function se(){let[e]=(0,u.useState)(()=>new Set),t=(0,u.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,u.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var R={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},z={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function B(e){let{announcements:t=z,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=R}=e,{announce:a,announcement:o}=L(),s=O(`DndLiveRegion`),[c,d]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{d(!0)},[]),oe((0,u.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let f=u.createElement(u.Fragment,null,u.createElement(F,{id:r,value:i.draggable}),u.createElement(I,{id:s,announcement:o}));return n?(0,l.createPortal)(f,n):f}var V;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(V||={});function H(){}function ce(e,t){return(0,u.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function U(){var e=[...arguments];return(0,u.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var W=Object.freeze({x:0,y:0});function G(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function le(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function K(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ue(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function de(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function q(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var fe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=q(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=G(q(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(le)},pe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=ue(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=ue(r),o=i.reduce((e,t,r)=>e+G(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(le)};function me(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var he=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=me(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(K)};function ge(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function J(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:W}function _e(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var ve=_e(1);function ye(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function be(e,t,n){let r=ye(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var xe={ignoreTransform:!1};function Y(e,t){t===void 0&&(t=xe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=h(e).getComputedStyle(e);t&&(n=be(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Se(e){return Y(e,{ignoreTransform:!0})}function Ce(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function we(e,t){return t===void 0&&(t=h(e).getComputedStyle(e)),t.position===`fixed`}function Te(e,t){t===void 0&&(t=h(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function Ee(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(g(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!_(i)||v(i)||n.includes(i))return n;let a=h(e).getComputedStyle(i);return i!==e&&Te(i,a)&&n.push(i),we(i,a)?n:r(i.parentNode)}return e?r(e):n}function X(e){let[t]=Ee(e,1);return t??null}function De(e){return!f||!e?null:p(e)?e:m(e)?g(e)||e===y(e).scrollingElement?window:_(e)?e:null:null}function Oe(e){return p(e)?e.scrollX:e.scrollLeft}function ke(e){return p(e)?e.scrollY:e.scrollTop}function Ae(e){return{x:Oe(e),y:ke(e)}}var Z;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Z||={});function je(e){return!f||!e?!1:e===document.scrollingElement}function Me(e){let t={x:0,y:0},n=je(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var Ne={x:.2,y:.2};function Pe(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Ne);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Me(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=Z.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=Z.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=Z.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=Z.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function Fe(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Ie(e){return e.reduce((e,t)=>A(e,Ae(t)),W)}function Le(e){return e.reduce((e,t)=>e+Oe(t),0)}function Re(e){return e.reduce((e,t)=>e+ke(t),0)}function ze(e,t){if(t===void 0&&(t=Y),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);X(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Be=[[`x`,[`left`,`right`],Le],[`y`,[`top`,`bottom`],Re]],Ve=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Ee(t),r=Ie(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Be)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},He=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Ue(e){let{EventTarget:t}=h(e);return e instanceof t?e:y(e)}function We(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var Q;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Q||={});function Ge(e){e.preventDefault()}function Ke(e){e.stopPropagation()}var $;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})($||={});var qe={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},Je=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case $.Right:return{...n,x:n.x+25};case $.Left:return{...n,x:n.x-25};case $.Down:return{...n,y:n.y+25};case $.Up:return{...n,y:n.y-25}}},Ye=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new He(y(t)),this.windowListeners=new He(h(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Q.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&ze(n),t(W)}handleKeyDown(e){if(te(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=qe,coordinateGetter:a=Je,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:W;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=j(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Me(n),p=Fe(n),m={x:Math.min(i===$.Right?p.right-p.width/2:p.right,Math.max(i===$.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===$.Down?p.bottom-p.height/2:p.bottom,Math.max(i===$.Down?p.top:p.top+p.height/2,u.y))},h=i===$.Right&&!s||i===$.Left&&!c,g=i===$.Down&&!l||i===$.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===$.Right&&e<=d.x||i===$.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===$.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===$.Down&&e<=d.y||i===$.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===$.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,A(j(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Ye.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=qe,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function Xe(e){return!!(e&&`distance`in e)}function Ze(e){return!!(e&&`delay`in e)}var Qe=class{constructor(e,t,n){n===void 0&&(n=Ue(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=y(i),this.documentListeners=new He(this.document),this.listeners=new He(n),this.windowListeners=new He(h(i)),this.initialCoordinates=ne(r)??W,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Q.Resize,this.handleCancel),this.windowListeners.add(Q.DragStart,Ge),this.windowListeners.add(Q.VisibilityChange,this.handleCancel),this.windowListeners.add(Q.ContextMenu,Ge),this.documentListeners.add(Q.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Ze(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Xe(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Q.Click,Ke,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Q.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=ne(e)??W,s=j(n,o);if(!t&&a){if(Xe(a)){if(a.tolerance!=null&&We(s,a.tolerance))return this.handleCancel();if(We(s,a.distance))return this.handleStart()}if(Ze(a)&&We(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===$.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},$e={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},et=class extends Qe{constructor(e){let{event:t}=e,n=y(t.target);super(e,$e,n)}};et.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var tt={move:{name:`mousemove`},end:{name:`mouseup`}},nt;(function(e){e[e.RightClick=2]=`RightClick`})(nt||={});var rt=class extends Qe{constructor(e){super(e,tt,y(e.event.target))}};rt.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===nt.RightClick?!1:(r?.({event:n}),!0)}}];var it={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},at=class extends Qe{constructor(e){super(e,it)}static setup(){return window.addEventListener(it.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(it.move.name,e)};function e(){}}};at.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var ot;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})(ot||={});var st;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(st||={});function ct(e){let{acceleration:t,activator:n=ot.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=st.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:f,threshold:p}=e,m=ut({delta:f,disabled:!a}),[h,g]=S(),_=(0,u.useRef)({x:0,y:0}),v=(0,u.useRef)({x:0,y:0}),y=(0,u.useMemo)(()=>{switch(n){case ot.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case ot.DraggableRect:return i}},[n,i,c]),b=(0,u.useRef)(null),x=(0,u.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),C=(0,u.useMemo)(()=>s===st.TreeOrder?[...l].reverse():l,[s,l]);(0,u.useEffect)(()=>{if(!a||!l.length||!y){g();return}for(let e of C){if(r?.(e)===!1)continue;let n=d[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=Pe(e,n,y,t,p);for(let e of[`x`,`y`])m[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){g(),b.current=e,h(x,o),_.current=a,v.current=i;return}}_.current={x:0,y:0},v.current={x:0,y:0},g()},[t,x,r,g,a,o,JSON.stringify(y),JSON.stringify(m),h,l,C,d,JSON.stringify(p)])}var lt={x:{[Z.Backward]:!1,[Z.Forward]:!1},y:{[Z.Backward]:!1,[Z.Forward]:!1}};function ut(e){let{delta:t,disabled:n}=e,r=E(t);return w(e=>{if(n||!r||!e)return lt;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Z.Backward]:e.x[Z.Backward]||i.x===-1,[Z.Forward]:e.x[Z.Forward]||i.x===1},y:{[Z.Backward]:e.y[Z.Backward]||i.y===-1,[Z.Forward]:e.y[Z.Forward]||i.y===1}}},[n,t,r])}function dt(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return w(e=>t==null?null:r??e??null,[r,t])}function ft(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var pt;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(pt||={});var mt;(function(e){e.Optimized=`optimized`})(mt||={});var ht=new Map;function gt(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,u.useState)(null),{frequency:s,measure:c,strategy:l}=i,d=(0,u.useRef)(e),f=_(),p=C(f),m=(0,u.useCallback)(function(e){e===void 0&&(e=[]),!p.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=(0,u.useRef)(null),g=w(t=>{if(f&&!n)return ht;if(!t||t===ht||d.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Ve(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,f,c]);return(0,u.useEffect)(()=>{d.current=e},[e]),(0,u.useEffect)(()=>{f||m()},[n,f]),(0,u.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,u.useEffect)(()=>{f||typeof s!=`number`||h.current!==null||(h.current=setTimeout(()=>{m(),h.current=null},s))},[s,f,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:a!=null};function _(){switch(l){case pt.Always:return!1;case pt.BeforeDragging:return n;default:return!n}}}function _t(e,t){return w(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function vt(e,t){return _t(e,t)}function yt(e){let{callback:t,disabled:n}=e,r=x(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}function bt(e){let{callback:t,disabled:n}=e,r=x(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}function xt(e){return new Ve(Y(e),e)}function St(e,t,n){t===void 0&&(t=xt);let[r,i]=(0,u.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=yt({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=bt({callback:a});return b(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function Ct(e){return J(e,_t(e))}var wt=[];function Tt(e){let t=(0,u.useRef)(e),n=w(n=>e?n&&n!==wt&&e&&t.current&&e.parentNode===t.current.parentNode?n:Ee(e):wt,[e]);return(0,u.useEffect)(()=>{t.current=e},[e]),n}function Et(e){let[t,n]=(0,u.useState)(null),r=(0,u.useRef)(e),i=(0,u.useCallback)(e=>{let t=De(e.target);t&&n(e=>e?(e.set(t,Ae(t)),new Map(e)):null)},[]);return(0,u.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=De(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Ae(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{De(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,u.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>A(e,t),W):Ie(e):W,[e,t])}function Dt(e,t){t===void 0&&(t=[]);let n=(0,u.useRef)(null);return(0,u.useEffect)(()=>{n.current=null},t),(0,u.useEffect)(()=>{let t=e!==W;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?j(e,n.current):W}function Ot(e){(0,u.useEffect)(()=>{if(!f)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function kt(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function At(e){return(0,u.useMemo)(()=>e?Ce(e):null,[e])}var jt=[];function Mt(e,t){t===void 0&&(t=Y);let[n]=e,r=At(n?h(n):null),[i,a]=(0,u.useState)(jt);function o(){a(()=>e.length?e.map(e=>je(e)?r:new Ve(t(e),e)):jt)}let s=bt({callback:o});return b(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function Nt(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _(t)?t:e}function Pt(e){let{measure:t}=e,[n,r]=(0,u.useState)(null),i=bt({callback:(0,u.useCallback)(e=>{for(let{target:n}of e)if(_(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=T((0,u.useCallback)(e=>{let n=Nt(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,u.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var Ft=[{sensor:et,options:{}},{sensor:Ye,options:{}}],It={current:{}},Lt={draggable:{measure:Se},droppable:{measure:Se,strategy:pt.WhileDragging,frequency:mt.Optimized},dragOverlay:{measure:Y}},Rt=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},zt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Rt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:H},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lt,measureDroppableContainers:H,windowRect:null,measuringScheduled:!1},Bt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:H,draggableNodes:new Map,over:null,measureDroppableContainers:H},Vt=(0,u.createContext)(Bt),Ht=(0,u.createContext)(zt);function Ut(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Rt}}}function Wt(e,t){switch(t.type){case V.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case V.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case V.DragEnd:case V.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case V.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Rt(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case V.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Rt(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case V.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Rt(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function Gt(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,u.useContext)(Vt),a=E(r),o=E(n?.id);return(0,u.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!te(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=re(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Kt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function qt(e){return(0,u.useMemo)(()=>({draggable:{...Lt.draggable,...e?.draggable},droppable:{...Lt.droppable,...e?.droppable},dragOverlay:{...Lt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Jt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,u.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;b(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=J(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=X(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var Yt=(0,u.createContext)({...W,scaleX:1,scaleY:1}),Xt;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Xt||={});var Zt=(0,u.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=Ft,collisionDetection:o=he,measuring:s,modifiers:c,...d}=e,[f,p]=(0,u.useReducer)(Wt,void 0,Ut),[m,g]=se(),[_,v]=(0,u.useState)(Xt.Uninitialized),y=_===Xt.Initialized,{draggable:{active:x,nodes:S,translate:w},droppable:{containers:T}}=f,E=x==null?null:S.get(x),D=(0,u.useRef)({initial:null,translated:null}),k=(0,u.useMemo)(()=>x==null?null:{id:x,data:E?.data??It,rect:D},[x,E]),j=(0,u.useRef)(null),[ee,te]=(0,u.useState)(null),[M,N]=(0,u.useState)(null),P=C(d,Object.values(d)),re=O(`DndDescribedBy`,t),ie=(0,u.useMemo)(()=>T.getEnabled(),[T]),F=qt(s),{droppableRects:I,measureDroppableContainers:L,measuringScheduled:oe}=gt(ie,{dragging:y,dependencies:[w.x,w.y],config:F.droppable}),R=dt(S,x),z=(0,u.useMemo)(()=>M?ne(M):null,[M]),H=Ne(),ce=vt(R,F.draggable.measure);Jt({activeNode:x==null?null:S.get(x),config:H.layoutShiftCompensation,initialRect:ce,measure:F.draggable.measure});let U=St(R,F.draggable.measure,ce),W=St(R?R.parentElement:null),G=(0,u.useRef)({activatorEvent:null,active:null,activeNode:R,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),le=T.getNodeFor(G.current.over?.id),K=Pt({measure:F.dragOverlay.measure}),ue=K.nodeRef.current??R,q=y?K.rect??U:null,fe=!!(K.nodeRef.current&&K.rect),pe=Ct(fe?null:U),me=At(ue?h(ue):null),J=Tt(y?le??R:null),_e=Mt(J),ye=Kt(c,{transform:{x:w.x-pe.x,y:w.y-pe.y,scaleX:1,scaleY:1},activatorEvent:M,active:k,activeNodeRect:U,containerNodeRect:W,draggingNodeRect:q,over:G.current.over,overlayNodeRect:K.rect,scrollableAncestors:J,scrollableAncestorRects:_e,windowRect:me}),be=z?A(z,w):null,xe=Et(J),Y=Dt(xe),Se=Dt(xe,[U]),Ce=A(ye,Y),we=q?ve(q,ye):null,Te=k&&we?o({active:k,collisionRect:we,droppableRects:I,droppableContainers:ie,pointerCoordinates:be}):null,Ee=de(Te,`id`),[X,De]=(0,u.useState)(null),Oe=ge(fe?ye:A(ye,Se),X?.rect??null,U),ke=(0,u.useRef)(null),Ae=(0,u.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(j.current==null)return;let i=S.get(j.current);if(!i)return;let a=e.nativeEvent;ke.current=new n({active:j.current,activeNode:i,event:a,options:r,context:G,onAbort(e){if(!S.get(e))return;let{onDragAbort:t}=P.current,n={id:e};t?.(n),m({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!S.get(e))return;let{onDragPending:i}=P.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),m({type:`onDragPending`,event:a})},onStart(e){let t=j.current;if(t==null)return;let n=S.get(t);if(!n)return;let{onDragStart:r}=P.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:D}};(0,l.unstable_batchedUpdates)(()=>{r?.(i),v(Xt.Initializing),p({type:V.DragStart,initialCoordinates:e,active:t}),m({type:`onDragStart`,event:i}),te(ke.current),N(a)})},onMove(e){p({type:V.DragMove,coordinates:e})},onEnd:o(V.DragEnd),onCancel:o(V.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=G.current,o=null;if(t&&i){let{cancelDrop:s}=P.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===V.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=V.DragCancel)}j.current=null,(0,l.unstable_batchedUpdates)(()=>{p({type:e}),v(Xt.Uninitialized),De(null),te(null),N(null),ke.current=null;let t=e===V.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=P.current[t];e?.(o),m({type:t,event:o})}})}}},[S]),Z=ft(a,(0,u.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=S.get(r);if(j.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},j.current=r,Ae(n,t))},[S,Ae]));Ot(a),b(()=>{U&&_===Xt.Initializing&&v(Xt.Initialized)},[U,_]),(0,u.useEffect)(()=>{let{onDragMove:e}=P.current,{active:t,activatorEvent:n,collisions:r,over:i}=G.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:Ce.x,y:Ce.y},over:i};(0,l.unstable_batchedUpdates)(()=>{e?.(a),m({type:`onDragMove`,event:a})})},[Ce.x,Ce.y]),(0,u.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=G.current;if(!e||j.current==null||!t||!i)return;let{onDragOver:a}=P.current,o=r.get(Ee),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,l.unstable_batchedUpdates)(()=>{De(s),a?.(c),m({type:`onDragOver`,event:c})})},[Ee]),b(()=>{G.current={activatorEvent:M,active:k,activeNode:R,collisionRect:we,collisions:Te,droppableRects:I,draggableNodes:S,draggingNode:ue,draggingNodeRect:q,droppableContainers:T,over:X,scrollableAncestors:J,scrollAdjustedTranslate:Ce},D.current={initial:q,translated:we}},[k,R,Te,we,S,ue,q,I,T,X,J,Ce]),ct({...H,delta:w,draggingRect:we,pointerCoordinates:be,scrollableAncestors:J,scrollableAncestorRects:_e});let je=(0,u.useMemo)(()=>({active:k,activeNode:R,activeNodeRect:U,activatorEvent:M,collisions:Te,containerNodeRect:W,dragOverlay:K,draggableNodes:S,droppableContainers:T,droppableRects:I,over:X,measureDroppableContainers:L,scrollableAncestors:J,scrollableAncestorRects:_e,measuringConfiguration:F,measuringScheduled:oe,windowRect:me}),[k,R,U,M,Te,W,K,S,T,I,X,L,J,_e,F,oe,me]),Me=(0,u.useMemo)(()=>({activatorEvent:M,activators:Z,active:k,activeNodeRect:U,ariaDescribedById:{draggable:re},dispatch:p,draggableNodes:S,over:X,measureDroppableContainers:L}),[M,Z,k,U,p,re,S,X,L]);return u.createElement(ae.Provider,{value:g},u.createElement(Vt.Provider,{value:Me},u.createElement(Ht.Provider,{value:je},u.createElement(Yt.Provider,{value:Oe},i)),u.createElement(Gt,{disabled:n?.restoreFocus===!1})),u.createElement(B,{...n,hiddenTextDescribedById:re}));function Ne(){let e=ee?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=y&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),Qt=(0,u.createContext)(null),$t=`button`,en=`Draggable`;function tn(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=O(en),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:f,over:p}=(0,u.useContext)(Vt),{role:m=$t,roleDescription:h=`draggable`,tabIndex:g=0}=i??{},_=c?.id===t,v=(0,u.useContext)(_?Yt:Qt),[y,x]=T(),[S,w]=T(),E=kt(o,t),D=C(n);return b(()=>(f.set(t,{id:t,key:a,node:y,activatorNode:S,data:D}),()=>{let e=f.get(t);e&&e.key===a&&f.delete(t)}),[f,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,u.useMemo)(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":_&&m===$t?!0:void 0,"aria-roledescription":h,"aria-describedby":d.draggable}),[r,m,g,_,h,d.draggable]),isDragging:_,listeners:r?void 0:E,node:y,over:p,setNodeRef:x,setActivatorNodeRef:w,transform:v}}function nn(){return(0,u.useContext)(Ht)}var rn=`Droppable`,an={timeout:25};function on(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=O(rn),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,u.useContext)(Vt),d=(0,u.useRef)({disabled:n}),f=(0,u.useRef)(!1),p=(0,u.useRef)(null),m=(0,u.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...an,...i},v=C(g??r),y=bt({callback:(0,u.useCallback)(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},_)},[_]),disabled:h||!o}),[b,x]=T((0,u.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),S=C(t);return(0,u.useEffect)(()=>{!y||!b.current||(y.disconnect(),f.current=!1,y.observe(b.current))},[b,y]),(0,u.useEffect)(()=>(s({type:V.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:p,data:S}}),()=>s({type:V.UnregisterDroppable,key:a,id:r})),[r]),(0,u.useEffect)(()=>{n!==d.current.disabled&&(s({type:V.SetDroppableDisabled,id:r,key:a,disabled:n}),d.current.disabled=n)},[r,a,n,s]),{active:o,rect:p,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}function sn(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function cn(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function ln(e){return e!==null&&e>=0}function un(e,t){if(e===t)return!0;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 dn(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var fn={scaleX:1,scaleY:1},pn=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=mn(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...fn}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...fn}:a<r&&a>=i?{x:o.width+s,y:0,...fn}:{x:0,y:0,...fn}};function mn(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return!r||!i&&!a?0:n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width)}var hn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=sn(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},gn={scaleX:1,scaleY:1},_n=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...gn}:null}let s=vn(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...gn}:r<t&&r>=a?{x:0,y:o.height+s,...gn}:{x:0,y:0,...gn}};function vn(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var yn=`Sortable`,bn=u.createContext({activeIndex:-1,containerId:yn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:hn,disabled:{draggable:!1,droppable:!1}});function xn(e){let{children:t,id:n,items:r,strategy:i=hn,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:d}=nn(),f=O(yn,n),p=s.rect!==null,m=(0,u.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),h=o!=null,g=o?m.indexOf(o.id):-1,_=l?m.indexOf(l.id):-1,v=(0,u.useRef)(m),y=!un(m,v.current),x=_!==-1&&g===-1||y,S=dn(a);b(()=>{y&&h&&d(m)},[y,m,h,d]),(0,u.useEffect)(()=>{v.current=m},[m]);let C=(0,u.useMemo)(()=>({activeIndex:g,containerId:f,disabled:S,disableTransforms:x,items:m,overIndex:_,useDragOverlay:p,sortedRects:cn(m,c),strategy:i}),[g,f,S.draggable,S.droppable,x,m,_,c,p,i]);return u.createElement(bn.Provider,{value:C},t)}var Sn=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return sn(n,r,i).indexOf(t)},Cn=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},wn={duration:200,easing:`ease`},Tn=`transform`,En=N.Transition.toString({property:Tn,duration:0,easing:`linear`}),Dn={roleDescription:`sortable`};function On(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,u.useState)(null),s=(0,u.useRef)(n);return b(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=Y(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,u.useEffect)(()=>{a&&o(null)},[a]),a}function kn(e){let{animateLayoutChanges:t=Cn,attributes:n,disabled:r,data:i,getNewIndex:a=Sn,id:o,strategy:s,resizeObserverConfig:c,transition:l=wn}=e,{items:f,containerId:p,activeIndex:m,disabled:h,disableTransforms:g,sortedRects:_,overIndex:v,useDragOverlay:y,strategy:b}=(0,u.useContext)(bn),x=An(r,h),S=f.indexOf(o),C=(0,u.useMemo)(()=>({sortable:{containerId:p,index:S,items:f},...i}),[p,i,S,f]),w=(0,u.useMemo)(()=>f.slice(f.indexOf(o)),[f,o]),{rect:T,node:E,isOver:D,setNodeRef:O}=on({id:o,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:k,activatorEvent:A,activeNodeRect:j,attributes:ee,setNodeRef:M,listeners:ne,isDragging:P,over:re,setActivatorNodeRef:ie,transform:F}=tn({id:o,data:C,attributes:{...Dn,...n},disabled:x.draggable}),I=d(O,M),L=!!k,ae=L&&!g&&ln(m)&&ln(v),oe=!y&&P,se=ae?(oe&&ae?F:null)??(s??b)({rects:_,activeNodeRect:j,activeIndex:m,overIndex:v,index:S}):null,R=ln(m)&&ln(v)?a({id:o,items:f,activeIndex:m,overIndex:v}):S,z=k?.id,B=(0,u.useRef)({activeId:z,items:f,newIndex:R,containerId:p}),V=f!==B.current.items,H=t({active:k,containerId:p,isDragging:P,isSorting:L,id:o,index:S,items:f,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:l,wasDragging:B.current.activeId!=null}),ce=On({disabled:!H,index:S,node:E,rect:T});return(0,u.useEffect)(()=>{L&&B.current.newIndex!==R&&(B.current.newIndex=R),p!==B.current.containerId&&(B.current.containerId=p),f!==B.current.items&&(B.current.items=f)},[L,R,p,f]),(0,u.useEffect)(()=>{if(z===B.current.activeId)return;if(z!=null&&B.current.activeId==null){B.current.activeId=z;return}let e=setTimeout(()=>{B.current.activeId=z},50);return()=>clearTimeout(e)},[z]),{active:k,activeIndex:m,attributes:ee,data:C,rect:T,index:S,newIndex:R,items:f,isOver:D,isSorting:L,isDragging:P,listeners:ne,node:E,overIndex:v,over:re,setNodeRef:I,setActivatorNodeRef:ie,setDroppableNodeRef:O,setDraggableNodeRef:M,transform:ce??se,transition:U()};function U(){if(ce||V&&B.current.newIndex===S)return En;if(!(oe&&!te(A)||!l)&&(L||H))return N.Transition.toString({...l,property:Tn})}}function An(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function jn(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var Mn=[$.Down,$.Right,$.Up,$.Left],Nn=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(Mn.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case $.Down:r.top<a.top&&t.push(n);break;case $.Up:r.top>a.top&&t.push(n);break;case $.Left:r.left>a.left&&t.push(n);break;case $.Right:r.left<a.left&&t.push(n);break}});let c=pe({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=de(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=Ee(c).some((e,t)=>s[t]!==e),i=Pn(e,t),a=Fn(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:j(u,l)}}}};function Pn(e,t){return!jn(e)||!jn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Fn(e,t){return!jn(e)||!jn(t)||!Pn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}async function In(e){return i(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function Ln(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await In(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Rn(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await In(t)};let n=await t.json().catch(()=>null);return a(),{ok:!0,created:n?.created??!1,warnings:n?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function zn(e,t){try{let n=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,r=await fetch(`/api/template${n}`,{method:`DELETE`});if(!r.ok)return{ok:!1,error:await In(r)};let i=await r.json().catch(()=>null);return a(),{ok:!0,existed:i?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function Bn(e){try{let t=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok)return{ok:!1,error:await In(t)};let n=await t.json().catch(()=>null);return a(),{ok:!0,committed:n?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function Vn(e){if(typeof window>`u`)return;let t=s(e);window.location.hash!==t&&(window.location.hash=t)}function Hn(e){if(typeof window>`u`)return;let t=o(e);window.location.hash!==t&&(window.location.hash=t)}export{fe as _,Ln as a,N as b,sn as c,kn as d,_n as f,et as g,Ye as h,Bn as i,pn as l,$ as m,Hn as n,Rn as o,Zt as p,zn as r,xn as s,Vn as t,Nn as u,ce as v,c as x,U as y};
@@ -1 +0,0 @@
1
- import{i as e}from"./chunk-DseTPa7n.js";import{n as t,r as n,t as r}from"./compiler-runtime-DrcePeIl.js";import{n as i,r as a}from"./dist-CSDjUb5q.js";import{n as o}from"./dist-DGbq0bSp.js";import{n as s,t as c,u as l}from"./createLucideIcon-Wgamzz8_.js";import{a as u,c as d,i as f,n as p,o as m,r as h,s as g,t as _}from"./dialog-492Ff7fG.js";import{C as v,S as y,T as b,_ as x,a as S,d as C,f as w,g as T,n as E,s as D,t as O,v as k,w as A}from"./skills-api-ej5KW5dn.js";import{t as j}from"./label-CveCqKNR.js";import{$t as M,Gt as N,It as P,Lt as F,P as I,Pt as L,Qt as R,Tt as z,Wt as B,Xt as V,Yr as H,_n as U,at as W,dn as G,fn as K,gn as q,mn as ee,n as te,pn as ne,t as re,un as ie,vn as ae}from"./dist-z6xoO_FO.js";import{a as J,d as oe,l as se,n as Y,r as ce,t as le,u as ue}from"./workspace-paths-DTMEcAKi.js";import{t as de}from"./copy-CfDOH9N1.js";import{t as fe}from"./folder-open-ygPcz1xa.js";import{t as pe}from"./loader-circle-BrJhrTc7.js";import{t as me}from"./refresh-cw-DgVrChIu.js";import{t as he}from"./trash-2-U9wpS1zc.js";import{n as X}from"./dist-CAIcun02.js";import{t as ge}from"./input-b4FSCbA5.js";import{t as _e}from"./dist-o9cVHl8Q.js";import{t as ve}from"./parse-api-error-DfesE4Y7.js";import{o as ye,s as be}from"./documents-events-WLCQAftW.js";import{n as xe}from"./config-context-BaIZpYSb.js";import{a as Se,n as Ce,r as we,t as Te}from"./cursor-jdIvZ4dc.js";import{n as Ee}from"./clipboard-adapter-CfjsRFpv.js";var De=c(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Oe=c(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),ke=c(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Ae=c(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=e(t(),1),Q=r(),je=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Conversational pairing in Claude Desktop's Cowork tab.`},{id:`claude-code`,displayName:`Claude`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,tagline:`Agentic coding in Claude Desktop's Code tab.`},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`,tagline:`OpenAI's coding agent, terminal-native.`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`,tagline:`AI-first VS Code fork with multi-file edits.`},{id:`copilot`,displayName:`GitHub Copilot`,schemes:[],installUrl:`https://docs.github.com/en/copilot/how-tos/copilot-cli/cli-getting-started`,tagline:`GitHub's terminal-native coding agent.`},{id:`opencode`,displayName:`OpenCode`,schemes:[],installUrl:`https://opencode.ai`,tagline:`Open-source terminal coding agent; bring any local model.`},{id:`pi`,displayName:`Pi`,schemes:[],installUrl:`https://pi.dev`,tagline:`Minimal open-source terminal coding agent, extensible in TypeScript.`},{id:`antigravity`,displayName:`Antigravity`,schemes:[],installUrl:`https://antigravity.google`,tagline:"Google's agentic IDE + `agy` terminal agent."}],Me=je.filter(e=>e.id!==`claude-cowork`&&e.id!==`copilot`&&e.id!==`opencode`&&e.id!==`pi`&&e.id!==`antigravity`),$=n();function Ne(){let e=(0,Q.c)(3),[t,n]=(0,Z.useState)(Ie),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(Fe);if(!e||!t.ok)return;let i=B.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(Pe),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Z.useEffect)(r,i),t}function Pe(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function Fe(){return null}function Ie(){return Le()}function Le(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function Re(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function ze(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=ve(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Be(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?Re(e):ze()}var Ve=`ok:skill:cowork:installed`,He=`1`,Ue=250,We=`/api/skill/install-state`;function Ge(e){return`${Ve}:v${e}`}var Ke=new Map;async function qe(e={},t={}){let n=t.force?`__force__`:`__default__`,r=Ke.get(n);if(r)return r;let i=Je(e,t);return Ke.set(n,i),i.finally(()=>{Ke.get(n)===i&&Ke.delete(n)}),i}async function Je(e,t){let n=e.installer===void 0?Be():e.installer,r=Ye(e.storage),i=e.fetchSnapshot??Ze,a=e.serverTimeoutMs??Ue,o=null;if(!t.force){try{o=await Qe(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Ge(o?.currentVersion??e.fallbackSkillVersion??Xe());if(!t.force&&r?.getItem(s)===He)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,He)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Ye(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Xe(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Ze(){let e;try{e=await fetch(We,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function Qe(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function $e(e){return qe({},e)}function et(){return qe({},{force:!0})}async function tt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function nt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return tt({target:`claude-cowork`,url:V({mode:`cowork`},e)},n);case`claude-code`:return tt({target:`claude-code`,url:V({mode:`code`},e)},n);case`codex`:return tt({target:`codex`,url:R(e)},n);case`cursor`:return tt({target:`cursor`,url:M(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function rt(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:it(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:it(e)}}}function it(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}async function at(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function ot(e){if(!e.docName||!e.workspace)return null;let t=le(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:Y(n,t,r)}}function st(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function ct(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function lt(e){return rt(e.installUrl).then(()=>void 0)}function ut(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function dt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function ft(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??le(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:Y(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function pt(e){return`Opened in ${e}.`}function mt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function ht(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function gt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function _t(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function vt(e,t,n,r){return e.compose?N(_t(e.compose,t,n,r)):e.selection?q({...e.selection,target:t,transport:r}):e.skill?U(e.skill.name,e.skill.scope,n):e.ask?ie(e.ask.relativePath,e.ask.instruction,n,t,r):H(e.docContext===null?e.folderRelativePath?ee(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?K(n,e.instruction,r):G(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ne(e.docContext.relativePath,n,e.instruction,r))}function yt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${W} ${vt(e,P[t].handoffTarget,!1,`terminal`)}`:ae(e.docContext?.relativePath??null)}async function bt(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:vt(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=gt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(pt(u));else{let i=ht(r),a=mt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{bt(e,t,n,r+1)}}})}return a}function xt(e){return je.find(t=>t.id===e)?.displayName??e}function St(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Ct(){return{dispatchHandoff:nt,recordHandoff:at,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>St(),getDisplayName:xt,ensureCoworkSkillInstalled:$e,autoOpen:!0}}function wt(){let e=(0,Q.c)(2),{merged:t}=xe(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>bt(e,t,{...Ct(),autoOpen:n}),reinstallCoworkSkill:et},e[0]=n,e[1]=r),r}var Tt=[...new Set(je.flatMap(e=>e.schemes))];function Et(e,t){let n=t.now?.()??Date.now(),r={};for(let t of je){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Dt(e){return Et({},e)}async function Ot(e){let t=e.schemes??Tt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var kt=Object.fromEntries(Tt.map(e=>[e,{installed:!1}]));async function At(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return kt}if(!t.ok)return kt;let n;try{n=await t.json()}catch{return kt}if(typeof n!=`object`||!n||Array.isArray(n))return kt;let r=n,i={};for(let e of Tt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function jt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Mt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Dt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Et(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!jt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Nt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Pt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Ot({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>At({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Ft(){let e=(0,Q.c)(5),[t,n]=(0,Z.useState)(It),r=(0,Z.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Mt(Pt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Z.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function It(){return Dt({isElectronHost:Nt(),now:Date.now})}var Lt=(0,Z.createContext)(null);function Rt(e){let t=(0,Q.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(Lt,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function zt(){return(0,Z.use)(Lt)}function Bt(e){let t=(0,Q.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`Antigravity icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M12 2.5a1.5 1.5 0 0 1 1.28.72l8.5 14A1.5 1.5 0 0 1 20.5 19.5h-17a1.5 1.5 0 0 1-1.28-2.28l8.5-14A1.5 1.5 0 0 1 12 2.5Zm0 4.42L5.83 17h12.34L12 6.92Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,d:`M12 9.6 15.6 17h-7.2L12 9.6Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`Antigravity icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 24 24`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function Vt(e){let t=(0,Q.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`OpenCode icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M384 416H128V96H384V416ZM320 160H192V352H320V160Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,fillOpacity:.55,d:`M320 224V352H192V224H320Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`OpenCode icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 512 512`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}function Ht(e){let t=(0,Q.c)(5),n,r,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,$.jsx)(`title`,{children:`Pi icon`}),r=(0,$.jsx)(`path`,{fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`,d:`M165.29 165.29H517.36V400H400V517.36H282.65V634.72H165.29ZM282.65 282.65V400H400V282.65Z`}),i=(0,$.jsx)(`path`,{fill:`currentColor`,d:`M517.36 400H634.72V634.72H517.36Z`}),t[0]=n,t[1]=r,t[2]=i):(n=t[0],r=t[1],i=t[2]);let a;return t[3]===e?a=t[4]:(a=(0,$.jsxs)(`svg`,{role:`img`,"aria-label":`Pi icon`,xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,fill:`none`,viewBox:`0 0 800 800`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var Ut={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`,copilot:`github`,opencode:`opencode`,pi:`pi`,antigravity:`antigravity`};function Wt(e){let t=(0,Q.c)(39),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:s}=o(),c=Ut[r],u=c?(s===`dark`?te[c]:void 0)??re[c]:void 0,d;t[5]!==u||t[6]!==a?(d=u?{...a,"--ok-brand-color":u}:a,t[5]=u,t[6]=a,t[7]=d):d=t[7];let f=d,p=u&&`[&_*]:![color:var(--ok-brand-color)]`,m;t[8]!==n||t[9]!==p?(m=l(p,n),t[8]=n,t[9]=p,t[10]=m):m=t[10];let h=m;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==h||t[12]!==f||t[13]!==i?(e=(0,$.jsx)(Se,{style:f,className:h,...i}),t[11]=h,t[12]=f,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==h||t[16]!==f||t[17]!==i?(e=(0,$.jsx)(we,{style:f,className:h,...i}),t[15]=h,t[16]=f,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==h||t[20]!==f||t[21]!==i?(e=(0,$.jsx)(Te,{style:f,className:h,...i}),t[19]=h,t[20]=f,t[21]=i,t[22]=e):e=t[22],e}if(r===`copilot`){let e;return t[23]!==h||t[24]!==f||t[25]!==i?(e=(0,$.jsx)(Ce,{style:f,className:h,...i}),t[23]=h,t[24]=f,t[25]=i,t[26]=e):e=t[26],e}if(r===`opencode`){let e;return t[27]!==h||t[28]!==f||t[29]!==i?(e=(0,$.jsx)(Vt,{style:f,className:h,...i}),t[27]=h,t[28]=f,t[29]=i,t[30]=e):e=t[30],e}if(r===`pi`){let e;return t[31]!==h||t[32]!==f||t[33]!==i?(e=(0,$.jsx)(Ht,{style:f,className:h,...i}),t[31]=h,t[32]=f,t[33]=i,t[34]=e):e=t[34],e}if(r===`antigravity`){let e;return t[35]!==h||t[36]!==f||t[37]!==i?(e=(0,$.jsx)(Bt,{style:f,className:h,...i}),t[35]=h,t[36]=f,t[37]=i,t[38]=e):e=t[38],e}return null}var Gt=F,Kt=new Set([`claude`]);function qt(e,t){return F.filter(n=>Kt.has(n)||n===t||e[n]!==!1)}function Jt(e){return P[e].handoffTarget}function Yt(e){let t=(0,Q.c)(48),{itemName:n,isSubmitting:r,onDelete:o,customTitle:c,customDescription:l,customDetail:_,customConfirmLabel:v,customConfirmLabelBusy:y,children:b}=e,{_:x}=a(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==v?(w=v??x({id:`cnGeoo`}),t[3]=x,t[4]=v,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==v||t[8]!==y?(E=y??v??x({id:`s3caR3`}),t[6]=x,t[7]=v,t[8]=y,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==c||t[12]!==C?(O=c??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=c,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,$.jsx)(d,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==l||t[18]!==C?(A=l??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=l,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,$.jsx)(u,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===_?M=t[23]:(M=_?(0,$.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:_}):null,t[22]=_,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,$.jsxs)(g,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,$.jsx)(p,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,$.jsx)(i,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===r?I=t[32]:(I=(0,$.jsx)(h,{asChild:!0,children:(0,$.jsx)(s,{variant:`outline`,disabled:r,children:F})}),t[31]=r,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==r?(L=r?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(pe,{className:`size-4 animate-spin`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=r,t[36]=L):L=t[36];let R;t[37]!==r||t[38]!==o||t[39]!==L?(R=(0,$.jsx)(s,{variant:`destructive`,onClick:o,disabled:r,children:L}),t[37]=r,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,$.jsxs)(m,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,$.jsxs)(f,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function Xt(e){return e?_e._({id:`wTcjov`}):null}function Zt(e){let t=(0,Q.c)(30),{_:n}=a(),r=ce(),o=zt();if(r)return null;let{input:s,installStates:c,dispatch:l}=e,u=s===null,d,f,p,m,h,g,_;if(t[0]!==n||t[1]!==l||t[2]!==s||t[3]!==u||t[4]!==c||t[5]!==o){let e=Xt(u),r;t[13]===c?r=t[14]:(r=e=>c[e.id]?.installed===!0,t[13]=c,t[14]=r);let a=Me.filter(r),S;t[15]===c?S=t[16]:(S=Me.some(e=>c[e.id]?.installed==null),t[15]=c,t[16]=S),p=S;let C=a.length>0,w=o!==null;m=!C&&!w;let E=o?qt(o.installedClis):[];f=v,t[17]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsxs)(b,{children:[(0,$.jsx)(se,{"aria-hidden":`true`}),(0,$.jsx)(i,{id:`O7_W_a`})]}),t[17]=_):_=t[17],d=A,h=w?(0,$.jsxs)(T,{"aria-label":n({id:`ALhMYW`}),children:[(0,$.jsx)(k,{children:(0,$.jsx)(i,{id:`ALhMYW`})}),E.map(t=>{let{displayName:r}=P[t];return(0,$.jsxs)(x,{onSelect:()=>{s!==null&&o.launchInTerminal(s,t)},disabled:u,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,$.jsx)(Wt,{id:Jt(t),"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,g=C?(0,$.jsxs)($.Fragment,{children:[w?(0,$.jsx)(y,{}):null,(0,$.jsxs)(T,{"aria-label":n({id:`BBqGS9`}),children:[(0,$.jsx)(k,{children:(0,$.jsx)(i,{id:`BBqGS9`})}),a.map(t=>{let r=!u,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,$.jsxs)(x,{disabled:!r,onSelect:()=>{s&&l(t.id,s)},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,$.jsx)(Wt,{id:t.id,"aria-hidden":`true`}),(0,$.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,$.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=l,t[2]=s,t[3]=u,t[4]=c,t[5]=o,t[6]=d,t[7]=f,t[8]=p,t[9]=m,t[10]=h,t[11]=g,t[12]=_}else d=t[6],f=t[7],p=t[8],m=t[9],h=t[10],g=t[11],_=t[12];let S;t[18]!==p||t[19]!==m?(S=m?(0,$.jsx)(x,{disabled:!0,"data-testid":`file-tree-open-in-empty`,children:p?(0,$.jsx)(i,{id:`EcR0fl`}):(0,$.jsx)(i,{id:`l6OXqI`})}):null,t[18]=p,t[19]=m,t[20]=S):S=t[20];let C;t[21]!==d||t[22]!==h||t[23]!==g||t[24]!==S?(C=(0,$.jsxs)(d,{children:[h,g,S]}),t[21]=d,t[22]=h,t[23]=g,t[24]=S,t[25]=C):C=t[25];let w;return t[26]!==f||t[27]!==_||t[28]!==C?(w=(0,$.jsxs)(f,{children:[_,C]}),t[26]=f,t[27]=_,t[28]=C,t[29]=w):w=t[29],w}function Qt(e){let t=(0,Q.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Z.useState)(r),[o,s]=(0,Z.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s(nn),t=be(e),n=ye(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Z.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a(tn),fetch(`/api/skills`).then($t).then(t=>{if(e)return;let n=L.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Z.useEffect)(u,d),i}async function $t(e){if(!e.ok){let t=await e.json().catch(en);throw Error(ve(t)??`HTTP ${e.status}`)}return e.json()}function en(){return null}function tn(e){return e.status===`ready`?e:{status:`loading`}}function nn(e){return e+1}function rn(e){let t=(0,Q.c)(16),{skill:n,onOpenChange:r,onDeleted:i}=e,{_:o}=a(),[s,c]=(0,Z.useState)(!1),l;t[0]!==o||t[1]!==i||t[2]!==r?(l=async function(e){c(!0);let t=await O(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),i(),r(!1)},t[0]=o,t[1]=i,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,$.jsx)(Yt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,$.jsx)(_,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function an(e){let t=(0,Q.c)(68),{skill:n,existingNames:r,onOpenChange:o,onRenamed:c}=e,{_:l}=a(),p=n!==null,h=(0,Z.useId)(),[v,y]=(0,Z.useState)(``),[b,x]=(0,Z.useState)(!1),S;t[0]===n?S=t[1]:(S=()=>{n&&y(n.name)},t[0]=n,t[1]=S);let C=n?.scope,w=n?.name,T;if(t[2]!==C||t[3]!==w?(T=[C,w],t[2]=C,t[3]=w,t[4]=T):T=t[4],(0,Z.useEffect)(S,T),!n)return null;let E,O,k,A;t[5]!==r||t[6]!==v||t[7]!==n.name?(k=v.trim(),A=k===n.name,E=k===``||!z.test(k),O=!E&&!A&&r.has(k),t[5]=r,t[6]=v,t[7]=n.name,t[8]=E,t[9]=O,t[10]=k,t[11]=A):(E=t[8],O=t[9],k=t[10],A=t[11]);let M=O,N=!E&&!M&&!A&&!b,P;t[12]!==l||t[13]!==N||t[14]!==o||t[15]!==c||t[16]!==n||t[17]!==k?(P=async function(){if(!n||!N)return;x(!0);let e=await D({scope:n.scope,fromName:n.name,toName:k});if(x(!1),!e.ok){X.error(l({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}X.success(l({id:`dUCQo4`,values:{trimmed:k}})),c?.(k),o(!1)},t[12]=l,t[13]=N,t[14]=o,t[15]=c,t[16]=n,t[17]=k,t[18]=P):P=t[18];let F=P,I;t[19]===o?I=t[20]:(I=e=>e?null:o(!1),t[19]=o,t[20]=I);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,$.jsx)(d,{children:(0,$.jsx)(i,{id:`dw_3cv`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsxs)(g,{children:[L,(0,$.jsx)(u,{children:(0,$.jsx)(i,{id:`R9IDFz`})})]}),t[22]=R):R=t[22];let B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(i,{id:`6YtxFj`}),t[23]=B):B=t[23];let V;t[24]===h?V=t[25]:(V=(0,$.jsx)(j,{htmlFor:h,children:B}),t[24]=h,t[25]=V);let H;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(H=e=>y(e.target.value),t[26]=H):H=t[26];let U;t[27]===F?U=t[28]:(U=e=>{e.key===`Enter`&&F()},t[27]=F,t[28]=U);let W=E||M,G=E&&k!==``||M?`${h}-error`:void 0,K;t[29]!==h||t[30]!==v||t[31]!==U||t[32]!==W||t[33]!==G?(K=(0,$.jsx)(ge,{id:h,value:v,onChange:H,onKeyDown:U,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":W,"aria-describedby":G,className:`font-mono`}),t[29]=h,t[30]=v,t[31]=U,t[32]=W,t[33]=G,t[34]=K):K=t[34];let q;t[35]!==M||t[36]!==h||t[37]!==E||t[38]!==k?(q=E&&k!==``?(0,$.jsx)(`p`,{id:`${h}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):M?(0,$.jsx)(`p`,{id:`${h}-error`,className:`text-xs text-destructive`,children:(0,$.jsx)(i,{id:`YJ1BTp`})}):null,t[35]=M,t[36]=h,t[37]=E,t[38]=k,t[39]=q):q=t[39];let ee;t[40]!==V||t[41]!==K||t[42]!==q?(ee=(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[V,K,q]}),t[40]=V,t[41]=K,t[42]=q,t[43]=ee):ee=t[43];let te;t[44]===o?te=t[45]:(te=()=>o(!1),t[44]=o,t[45]=te);let ne;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,$.jsx)(i,{id:`dEgA5A`}),t[46]=ne):ne=t[46];let re;t[47]!==b||t[48]!==te?(re=(0,$.jsx)(s,{variant:`ghost`,onClick:te,disabled:b,children:ne}),t[47]=b,t[48]=te,t[49]=re):re=t[49];let ie;t[50]===F?ie=t[51]:(ie=()=>void F(),t[50]=F,t[51]=ie);let ae=!N,J;t[52]===b?J=t[53]:(J=b?(0,$.jsx)(i,{id:`tHKQ6j`}):(0,$.jsx)(i,{id:`2wxgft`}),t[52]=b,t[53]=J);let oe;t[54]!==ie||t[55]!==ae||t[56]!==J?(oe=(0,$.jsx)(s,{onClick:ie,disabled:ae,children:J}),t[54]=ie,t[55]=ae,t[56]=J,t[57]=oe):oe=t[57];let se;t[58]!==re||t[59]!==oe?(se=(0,$.jsxs)(m,{children:[re,oe]}),t[58]=re,t[59]=oe,t[60]=se):se=t[60];let Y;t[61]!==ee||t[62]!==se?(Y=(0,$.jsxs)(f,{children:[R,ee,se]}),t[61]=ee,t[62]=se,t[63]=Y):Y=t[63];let ce;return t[64]!==p||t[65]!==Y||t[66]!==I?(ce=(0,$.jsx)(_,{open:p,onOpenChange:I,children:Y}),t[64]=p,t[65]=Y,t[66]=I,t[67]=ce):ce=t[67],ce}function on(e){let t=(0,Q.c)(15),{skill:n,onOpenChange:r,onUpdated:o}=e,{_:c}=a(),[l,v]=(0,Z.useState)(!1),y;t[0]!==c||t[1]!==r||t[2]!==o?(y=async function(e){v(!0);let t=await w({scope:e.scope,name:e.name});v(!1);let n=J(e.name);if(!t.ok){X.error(c({id:`FRqZ9v`,values:{0:t.error}}));return}X.success(t.checkpointRef?c({id:`My9uXI`,values:{0:t.version,display:n}}):c({id:`mPneVR`,values:{0:t.version,display:n}})),o(),r(!1)},t[0]=c,t[1]=r,t[2]=o,t[3]=y):y=t[3];let b=y,x=n!==null,S;t[4]!==r||t[5]!==l?(S=e=>{!e&&!l&&r(!1)},t[4]=r,t[5]=l,t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==n||t[9]!==l?(C=n?(0,$.jsxs)(f,{className:`sm:max-w-lg`,children:[(0,$.jsxs)(g,{children:[(0,$.jsx)(d,{children:(0,$.jsx)(i,{id:`iAoh55`,values:{0:J(n.name)}})}),(0,$.jsx)(u,{children:n.installedVersion?(0,$.jsx)(i,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,$.jsx)(i,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,$.jsx)(p,{}),(0,$.jsxs)(m,{children:[(0,$.jsx)(h,{asChild:!0,children:(0,$.jsx)(s,{variant:`outline`,disabled:l,children:(0,$.jsx)(i,{id:`dEgA5A`})})}),(0,$.jsx)(s,{onClick:()=>void b(n),disabled:l,children:l?(0,$.jsx)(i,{id:`JL3si7`}):(0,$.jsx)(i,{id:`EkH9pt`})})]})]}):null,t[7]=b,t[8]=n,t[9]=l,t[10]=C):C=t[10];let T;return t[11]!==x||t[12]!==S||t[13]!==C?(T=(0,$.jsx)(_,{open:x,onOpenChange:S,children:C}),t[11]=x,t[12]=S,t[13]=C,t[14]=T):T=t[14],T}function sn(){let e=(0,Q.c)(30),{_:t}=a(),[n,r]=(0,Z.useState)(null),[i,o]=(0,Z.useState)(null),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await S({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return X.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=cn,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return X.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&X.warning(e)}return r.hosts.length===0?X.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):X.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await C({scope:e.scope,name:e.name});return u(null),n.ok?X.success(t({id:`0LBDjY`,values:{0:e.name}})):X.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await E({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}X.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,$.jsx)(rn,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=i?.skill??null,x=i?.existingNames??un,w,T;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e||o(null)},T=()=>o(null),e[10]=w,e[11]=T):(w=e[10],T=e[11]);let D;e[12]!==b||e[13]!==x?(D=(0,$.jsx)(an,{skill:b,existingNames:x,onOpenChange:w,onRenamed:T}),e[12]=b,e[13]=x,e[14]=D):D=e[14];let O,k;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>{e||c(null)},k=()=>c(null),e[15]=O,e[16]=k):(O=e[15],k=e[16]);let A;e[17]===s?A=e[18]:(A=(0,$.jsx)(on,{skill:s,onOpenChange:O,onUpdated:k}),e[17]=s,e[18]=A);let j;e[19]!==D||e[20]!==A||e[21]!==y?(j=(0,$.jsxs)($.Fragment,{children:[y,D,A]}),e[19]=D,e[20]=A,e[21]=y,e[22]=j):j=e[22];let M=j,N;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(N=(e,t)=>o({skill:e,existingNames:t}),e[23]=N):N=e[23];let P;return e[24]!==M||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(P={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:N,requestUpdate:c,dialogs:M},e[24]=M,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=P):P=e[29],P}function cn(e){return e.map(ln).join(`, `)}function ln(e){return I[e]??e}var un=new Set;function dn(e){let t=(0,Q.c)(19),{skill:n,onEdit:r,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(ue,{"aria-hidden":!0}),l=(0,$.jsx)(i,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===r?u=t[3]:(u=(0,$.jsxs)(x,{onSelect:r,children:[c,l]}),t[2]=r,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,$.jsxs)(x,{onSelect:a,children:[(0,$.jsx)(De,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,$.jsxs)(x,{onSelect:o,children:[(0,$.jsx)(Ae,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsx)(he,{"aria-hidden":!0}),m=(0,$.jsx)(i,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,$.jsxs)(x,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let g;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(g=(0,$.jsxs)($.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=g):g=t[18],g}function fn(e){let t=(0,Q.c)(94),{skill:n,actions:r,existingNames:o}=e,{_:s}=a(),c=Ne(),l=Ft().states,{dispatch:u}=wt(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Ee(e),X.success(s({id:`SXCSQd`}))}catch{X.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p;if(n.managed){let e,r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,$.jsxs)(k,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,$.jsx)(Oe,{className:`size-3`,"aria-hidden":!0}),(0,$.jsx)(i,{id:`VITWk5`})]}),r=(0,$.jsx)(y,{}),t[2]=e,t[3]=r):(e=t[2],r=t[3]);let a;t[4]===f?a=t[5]:(a=d&&f?(0,$.jsxs)(x,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(fe,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[4]=f,t[5]=a);let o;t[6]!==n.name||t[7]!==n.scope||t[8]!==c?(o=dt({skillName:n.name,scope:n.scope,workspace:c}),t[6]=n.name,t[7]=n.scope,t[8]=c,t[9]=o):o=t[9];let s;t[10]!==u||t[11]!==l||t[12]!==o?(s=(0,$.jsx)(Zt,{input:o,installStates:l,isElectronHost:d!=null,dispatch:u}),t[10]=u,t[11]=l,t[12]=o,t[13]=s):s=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,$.jsxs)(b,{children:[(0,$.jsx)(de,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[14]=p):p=t[14];let h;t[15]!==f||t[16]!==m?(h=f?(0,$.jsx)(x,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[15]=f,t[16]=m,t[17]=h):h=t[17];let g;t[18]!==m||t[19]!==n.path?(g=()=>void m(n.path),t[18]=m,t[19]=n.path,t[20]=g):g=t[20];let _;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,$.jsx)(i,{id:`xloBjn`}),t[21]=_):_=t[21];let S;t[22]===g?S=t[23]:(S=(0,$.jsx)(x,{onSelect:g,children:_}),t[22]=g,t[23]=S);let C;t[24]!==S||t[25]!==h?(C=(0,$.jsxs)(v,{children:[p,(0,$.jsxs)(A,{children:[h,S]})]}),t[24]=S,t[25]=h,t[26]=C):C=t[26];let w;return t[27]!==C||t[28]!==a||t[29]!==s?(w=(0,$.jsxs)($.Fragment,{children:[e,r,a,s,C]}),t[27]=C,t[28]=a,t[29]=s,t[30]=w):w=t[30],w}let h;t[31]===f?h=t[32]:(h=d&&f?(0,$.jsxs)(x,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,$.jsx)(fe,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`LtSYdi`})]}):null,t[31]=f,t[32]=h);let g;t[33]!==n.name||t[34]!==n.scope||t[35]!==c?(g=dt({skillName:n.name,scope:n.scope,workspace:c}),t[33]=n.name,t[34]=n.scope,t[35]=c,t[36]=g):g=t[36];let _;t[37]!==u||t[38]!==l||t[39]!==g?(_=(0,$.jsx)(Zt,{input:g,installStates:l,isElectronHost:d!=null,dispatch:u}),t[37]=u,t[38]=l,t[39]=g,t[40]=_):_=t[40];let S;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,$.jsxs)(b,{children:[(0,$.jsx)(de,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`zd00pH`})]}),t[41]=S):S=t[41];let C;t[42]!==f||t[43]!==m?(C=f?(0,$.jsx)(x,{onSelect:()=>void m(f),children:(0,$.jsx)(i,{id:`z2funE`})}):null,t[42]=f,t[43]=m,t[44]=C):C=t[44];let w;t[45]!==m||t[46]!==n.path?(w=()=>void m(n.path),t[45]=m,t[46]=n.path,t[47]=w):w=t[47];let T;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(i,{id:`xloBjn`}),t[48]=T):T=t[48];let E;t[49]===w?E=t[50]:(E=(0,$.jsx)(x,{onSelect:w,children:T}),t[49]=w,t[50]=E);let D;t[51]!==C||t[52]!==E?(D=(0,$.jsxs)(v,{children:[S,(0,$.jsxs)(A,{children:[C,E]})]}),t[51]=C,t[52]=E,t[53]=D):D=t[53];let O;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,$.jsx)(y,{}),t[54]=O):O=t[54];let j;t[55]!==r||t[56]!==o||t[57]!==n?(j=()=>void r.duplicate(n,o),t[55]=r,t[56]=o,t[57]=n,t[58]=j):j=t[58];let M,N;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(oe,{"aria-hidden":!0}),N=(0,$.jsx)(i,{id:`euc6Ns`}),t[59]=M,t[60]=N):(M=t[59],N=t[60]);let P;t[61]===j?P=t[62]:(P=(0,$.jsxs)(x,{onSelect:j,children:[M,N]}),t[61]=j,t[62]=P);let F;t[63]!==r||t[64]!==o||t[65]!==n?(F=()=>r.requestRename(n,o),t[63]=r,t[64]=o,t[65]=n,t[66]=F):F=t[66];let I,L;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,$.jsx)(ke,{"aria-hidden":!0}),L=(0,$.jsx)(i,{id:`2wxgft`}),t[67]=I,t[68]=L):(I=t[67],L=t[68]);let R;t[69]===F?R=t[70]:(R=(0,$.jsxs)(x,{onSelect:F,children:[I,L]}),t[69]=F,t[70]=R);let z;t[71]!==r||t[72]!==n?(z=n.updateAvailable?(0,$.jsxs)(x,{onSelect:()=>r.requestUpdate(n),children:[(0,$.jsx)(me,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`6g2jsp`})]}):null,t[71]=r,t[72]=n,t[73]=z):z=t[73];let B;t[74]!==r||t[75]!==n?(B=n.installed?(0,$.jsxs)(x,{onSelect:()=>void r.uninstall(n),children:[(0,$.jsx)(Ae,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`fo0VXg`})]}):(0,$.jsxs)(x,{onSelect:()=>void r.install(n),children:[(0,$.jsx)(De,{"aria-hidden":!0}),(0,$.jsx)(i,{id:`TKQ7K-`})]}),t[74]=r,t[75]=n,t[76]=B):B=t[76];let V;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,$.jsx)(y,{}),t[77]=V):V=t[77];let H;t[78]!==r||t[79]!==n?(H=()=>r.requestDelete(n),t[78]=r,t[79]=n,t[80]=H):H=t[80];let U,W;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(he,{"aria-hidden":!0}),W=(0,$.jsx)(i,{id:`cnGeoo`}),t[81]=U,t[82]=W):(U=t[81],W=t[82]);let G;t[83]===H?G=t[84]:(G=(0,$.jsxs)(x,{variant:`destructive`,onSelect:H,children:[U,W]}),t[83]=H,t[84]=G);let K;return t[85]!==D||t[86]!==P||t[87]!==R||t[88]!==h||t[89]!==z||t[90]!==B||t[91]!==G||t[92]!==_?(K=(0,$.jsxs)($.Fragment,{children:[h,_,D,O,P,R,z,B,V,G]}),t[85]=D,t[86]=P,t[87]=R,t[88]=h,t[89]=z,t[90]=B,t[91]=G,t[92]=_,t[93]=K):K=t[93],K}export{wt as C,De as D,Oe as E,lt as S,Me as T,ot as _,Zt as a,yt as b,Jt as c,Rt as d,zt as f,ut as g,ct as h,Qt as i,qt as l,ft as m,fn as n,Yt as o,Ft as p,sn as r,Gt as s,dn as t,Wt as u,st as v,Ne as w,xt as x,dt as y};
@@ -1 +0,0 @@
1
- import{t as e}from"./repair-skills-CjpripUK.mjs";export{e as repairSkills};
@@ -1 +0,0 @@
1
- import{a as e,o as t,r as n}from"./server-lock-Cn2-KrjV.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};